tekivex-ui 2.6.0 → 3.0.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 (48) hide show
  1. package/README.md +22 -8
  2. package/dist/charts.cjs +1 -1
  3. package/dist/charts.js +14 -14
  4. package/dist/{chunk-B3ph66Zb.js → chunk-BHX35YDv.js} +1 -1
  5. package/dist/chunk-BpuJ3-K8.js +1 -0
  6. package/dist/{chunk-Bc16rJT-.js → chunk-C8Wy8P59.js} +1 -1
  7. package/dist/chunk-CDGrC2Wo.js +3 -0
  8. package/dist/{chunk-LWkKqC8d.js → chunk-D7-yknXg.js} +1 -1
  9. package/dist/{chunk-DnCXUUx5.js → chunk-DcVMayoM.js} +1 -1
  10. package/dist/chunk-DdHSYetV.js +1 -0
  11. package/dist/chunk-VUD-TF9j.js +1 -0
  12. package/dist/headless.cjs +1 -1
  13. package/dist/headless.js +1 -1
  14. package/dist/i18n.cjs +1 -1
  15. package/dist/i18n.js +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.ts +18 -2
  18. package/dist/index.js +499 -414
  19. package/dist/quantum.cjs +1 -1
  20. package/dist/quantum.js +1 -1
  21. package/dist/realtime.cjs +1 -1
  22. package/dist/realtime.js +1 -1
  23. package/dist/src/components/TkxAadhaarInput.d.ts +22 -0
  24. package/dist/src/components/TkxAddressInput.d.ts +32 -0
  25. package/dist/src/components/TkxCalendarLunar.d.ts +25 -0
  26. package/dist/src/components/TkxCaptcha.d.ts +23 -0
  27. package/dist/src/components/TkxCheckout.d.ts +26 -0
  28. package/dist/src/components/TkxConfetti.d.ts +21 -0
  29. package/dist/src/components/TkxCurrencyInput.d.ts +20 -0
  30. package/dist/src/components/TkxFontProvider.d.ts +12 -0
  31. package/dist/src/components/TkxImageEditor.d.ts +44 -0
  32. package/dist/src/components/TkxKycInputs.d.ts +59 -0
  33. package/dist/src/components/TkxOTP.d.ts +2 -1
  34. package/dist/src/components/TkxPaymentButton.d.ts +61 -0
  35. package/dist/src/components/TkxPhoneInput.d.ts +34 -0
  36. package/dist/src/components/TkxSEO.d.ts +58 -0
  37. package/dist/src/components/TkxSignaturePad.d.ts +21 -0
  38. package/dist/src/components/TkxSortable.d.ts +18 -0
  39. package/dist/src/components/TkxSubscription.d.ts +42 -0
  40. package/dist/src/components/TkxWatermark.d.ts +8 -1
  41. package/dist/src/i18n/index.d.ts +51 -0
  42. package/dist/src/themes/index.d.ts +6 -1
  43. package/dist/tekivex-ui.css +1 -1
  44. package/package.json +20 -4
  45. package/dist/chunk-Dike2DLU.js +0 -3
  46. package/dist/chunk-DjxOP8W4.js +0 -1
  47. package/dist/chunk-DkoFTL1O.js +0 -1
  48. package/dist/chunk-PJ50l0JC.js +0 -1
package/dist/index.js CHANGED
@@ -1,429 +1,514 @@
1
- import{A as e,C as t,D as n,E as o,F as r,I as i,L as l,M as a,N as s,O as d,P as c,S as u,T as h,_ as p,a as f,b as m,c as g,d as x,f as b,h as y,i as v,k as w,l as k,m as C,n as S,o as $,p as z,r as N,s as M,t as I,u as L,v as W,w as D,x as R,y as T}from"./chunk-PJ50l0JC.js";import{A as B,C as A,D as F,E,O as H,S as j,T as O,_ as P,a as V,b as Y,c as U,d as K,f as X,g as q,h as G,i as _,j as Z,k as J,l as Q,m as ee,n as te,o as ne,p as oe,r as re,s as ie,t as le,u as ae,v as se,w as de,x as ce,y as ue}from"./chunk-DnCXUUx5.js";import{a as he,i as pe,n as fe,o as me,r as ge,t as xe}from"./chunk-B3ph66Zb.js";import{n as be,r as ye,t as ve}from"./chunk-Dike2DLU.js";import{I18nContext as we,LOCALES as ke,enUS as Ce,isRTL as Se,useDirection as $e,useI18n as ze,useLocale as Ne}from"./i18n.js";import Me,{Children as Ie,cloneElement as Le,createContext as We,createElement as De,forwardRef as Re,useCallback as Te,useContext as Be,useEffect as Ae,useId as Fe,useMemo as Ee,useReducer as He,useRef as je,useState as Oe}from"react";import{Fragment as Pe,jsx as Ve,jsxs as Ye}from"react/jsx-runtime";import{createPortal as Ue}from"react-dom";var Ke={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},Xe={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},qe={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},Ge={sm:14,md:16,lg:18,xl:20};function _e({size:e}){const t=Ge[e];/* @__PURE__ */
2
- return Ye("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:V("animate-spin shrink-0"),children:[/* @__PURE__ */Ve("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),/* @__PURE__ */Ve("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var Ze=Re(({variant:e="solid",size:t="md",colorScheme:n="primary",isLoading:o=!1,loadingText:r,leftIcon:i,rightIcon:l,isFullWidth:a=!1,glow:s=!1,disabled:d,children:c,className:u,style:h,...p},f)=>{const m=b(),g=me(),x=d||o,y={primary:m.primary,secondary:m.secondary,danger:m.danger,warning:m.warning,success:m.success}[n],v=W(y,["#ffffff","#000000",m.bg]),w="string"==typeof c?E(c):c,k=r?E(r):void 0,C="solid"===e?{backgroundColor:y,color:v,border:"none",boxShadow:s&&!g?`0 0 20px ${y}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:y,border:`2px solid ${y}`}:"ghost"===e?{backgroundColor:"transparent",color:y,border:"none"}:{backgroundColor:"transparent",color:y,border:"none",textDecoration:"underline"};/* @__PURE__ */
3
- return Ve("button",{ref:f,"aria-busy":o,"aria-disabled":x,disabled:x,className:le(V("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",Ke[t],Xe[t],qe[t],"link"!==e&&qe[t],a&&"w-full",x?"cursor-not-allowed opacity-60":"cursor-pointer",!g&&"transition-all duration-200","focus-visible:focus-ring"),u),style:{...C,...h},...p,children:/* @__PURE__ */Ye(Pe,o?{children:[/* @__PURE__ */Ve(_e,{size:t}),k??w]}:{children:[i&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",children:i}),w,l&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",children:l})]})})});Ze.displayName="TkxButton";var Je={none:"",sm:"p-3",md:"p-5",lg:"p-7"},Qe=Re(({variant:e="default",isHoverable:t,isClickable:n,padding:o="md",as:r,children:i,className:l,style:a,...s},d)=>{const c=b(),u=me(),h=r??(n?"button":"div"),p={default:{backgroundColor:c.surface,border:`1px solid ${c.border}`},glass:{backgroundColor:`${c.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${c.border}55`,boxShadow:`0 4px 24px ${c.bg}40`},quantum:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.primary}33`,boxShadow:`0 0 24px ${c.primary}18`},elevated:{backgroundColor:c.surface,boxShadow:`0 4px 20px ${c.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${c.border}`}}[e];/* @__PURE__ */
4
- return Ve(h,{ref:d,className:le("tkx-card",V("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",Je[o],(t||n)&&!u&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default"),l),style:{color:c.text,...p,...a},...s,children:i})});function et({title:e,subtitle:t,action:n,children:o,className:r,...i}){const l=b();/* @__PURE__ */
5
- return Ye("div",{className:le(V("flex justify-between items-start mb-4"),r),...i,children:[/* @__PURE__ */Ye("div",{className:V("flex-1 min-w-0"),children:[e&&/* @__PURE__ */Ve("h3",{className:V("text-base font-semibold m-0"),style:{color:l.text},children:e}),t&&/* @__PURE__ */Ve("p",{className:V("text-sm mt-1 mb-0"),style:{color:l.textMuted},children:t}),o]}),n&&/* @__PURE__ */Ve("div",{className:V("ml-3 shrink-0"),children:n})]})}function tt({children:e,className:t,...n}){/* @__PURE__ */
6
- return Ve("div",{className:le(V(""),t),...n,children:e})}function nt({children:e,className:t,style:n,...o}){const r=b();/* @__PURE__ */
7
- return Ve("div",{className:le(V("flex items-center justify-end gap-2 mt-4 pt-4"),t),style:{borderTop:`1px solid ${r.border}`,...n},...o,children:e})}Qe.displayName="TkxCard";var ot=Re(({label:e,id:t,error:n,hint:o,leftAddon:r,rightAddon:i,isInvalid:l,isRequired:a,disabled:s,className:d,style:c,unicodeSafe:u=!0,onChange:h,...p},f)=>{const m=b(),g=Fe(),x=t??g,y=`${x}-hint`,v=`${x}-error`,w=l||!!n,k=[o&&y,w&&v].filter(Boolean).join(" ")||void 0,C=E(e),S=n?E(n):void 0,$=o?E(o):void 0,z=w?m.danger:m.border;/* @__PURE__ */
8
- return Ye("div",{className:le(V("flex flex-col gap-1 w-full"),d),style:c,children:[
9
- /* @__PURE__ */Ye("label",{htmlFor:x,className:V("text-sm font-medium font-sans"),style:{color:m.text},children:[C,a&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",className:V("ml-1"),style:{color:m.danger},children:"*"})]}),
10
- /* @__PURE__ */Ye("div",{className:V("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",s?"opacity-60":""),style:{border:`1.5px solid ${z}`,backgroundColor:m.surface},children:[r&&/* @__PURE__ */Ve("div",{className:V("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:m.surfaceAlt,color:m.textMuted,borderRight:`1px solid ${m.border}`},children:r}),
11
- /* @__PURE__ */Ve("input",{ref:f,id:x,"aria-invalid":w,"aria-required":a,"aria-describedby":k,disabled:s,className:le(V("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:m.text},onChange:u?e=>{const t=F(e.target.value);t!==e.target.value&&(e.target.value=t),h?.(e)}:h,...p}),i&&/* @__PURE__ */Ve("div",{className:V("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:m.surfaceAlt,color:m.textMuted,borderLeft:`1px solid ${m.border}`},children:i})]}),$&&!S&&/* @__PURE__ */Ve("span",{id:y,className:V("text-xs"),style:{color:m.textMuted},children:$}),S&&/* @__PURE__ */Ye("span",{id:v,role:"alert",className:V("text-xs flex items-center gap-1"),style:{color:m.danger},children:[/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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]})]})});ot.displayName="TkxInput";var rt={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]"},it={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},lt=Re(({variant:e="default",size:t="md",dot:n=!1,pulse:o=!1,outlined:r=!1,children:i,className:l,style:a,...s},d)=>{const c=b(),u={default:c.border,primary:c.primary,secondary:c.secondary,danger:c.danger,warning:c.warning,success:c.success,info:c.info}[e]||"#666666",h=W(u,["#ffffff","#000000",c.bg||"#000000"]),p="string"==typeof i?E(i):i;/* @__PURE__ */
12
- return Ve("span",n?{ref:d,"aria-label":"string"==typeof i?E(i):void 0,className:le(V("inline-block rounded-full",it[t],o&&"animate-pulse"),l),style:{backgroundColor:u,...a},...s}:{ref:d,className:le(V("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",rt[t],o&&"animate-pulse"),l),style:{backgroundColor:r?"transparent":u,color:r?u:h,border:r?`1px solid ${u}`:"none",...a},...s,children:p})});lt.displayName="TkxBadge";var at={sm:"4px",md:"8px",lg:"12px"},st={sm:32,md:48,lg:64},dt=Re(({value:e,variant:t="linear",size:n="md",label:o,showValue:r,color:i,className:l,style:a,...s},d)=>{const c=b(),u=me(),h=i??c.primary,p=void 0===e,f=void 0!==e?Math.min(100,Math.max(0,e)):0;if(void 0!==e){const{errors:t}=B({value:e},{value:{type:"number",min:0,max:100}});t.length}if("circular"===t){const e=st[n],t="sm"===n?3:"md"===n?4:5,i=(e-2*t)/2,s=2*Math.PI*i,m=p?0:s-f/100*s;/* @__PURE__ */
13
- return Ye("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p?void 0:f,"aria-label":o??(p?"Loading":`${f}%`),className:le(V("inline-flex flex-col items-center gap-1"),l),style:a,children:[/* @__PURE__ */Ye("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:c.border,strokeWidth:t}),/* @__PURE__ */Ve("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:h,strokeWidth:t,strokeLinecap:"round",strokeDasharray:s,strokeDashoffset:m,transform:`rotate(-90 ${e/2} ${e/2})`,style:{transition:u?"none":"stroke-dashoffset 300ms ease",animation:p&&!u?"tkx-spin 1s linear infinite":void 0}})]}),r&&!p&&/* @__PURE__ */Ye("span",{className:V("text-xs"),style:{color:c.textMuted},children:[f,"%"]})]})}const m=at[n];/* @__PURE__ */
14
- return Ye("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p?void 0:f,"aria-label":o??(p?"Loading":`${f}%`),className:le(V("flex flex-col gap-1 w-full"),l),style:a,children:[o&&/* @__PURE__ */Ye("div",{className:V("flex justify-between text-sm"),style:{color:c.text},children:[/* @__PURE__ */Ve("span",{children:o}),r&&!p&&/* @__PURE__ */Ye("span",{children:[f,"%"]})]}),/* @__PURE__ */Ve("div",{className:V("w-full overflow-hidden"),style:{height:m,borderRadius:m,backgroundColor:c.border},children:/* @__PURE__ */Ve("div",{style:{height:"100%",borderRadius:m,backgroundColor:h,width:p?"40%":`${f}%`,transition:u?"none":"width 300ms ease",animation:p&&!u?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});dt.displayName="TkxProgress";var ct={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}},ut=Re(({checked:e,onChange:t,label:n,size:o="md",hideLabel:r,disabled:i,className:l,style:a,...s},d)=>{const c=b(),u=me(),h=Fe();B({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:p,th:f,td:m,gap:g}=ct[o],x=e?p-m-g:g,y=e?c.primary:c.border;/* @__PURE__ */
15
- return Ye("div",{className:le(V("inline-flex items-center gap-2",i?"opacity-50":""),l),style:a,children:[!r&&/* @__PURE__ */Ve("label",{htmlFor:h,className:V("text-sm font-sans",i?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:c.text},children:n}),/* @__PURE__ */Ve("button",{ref:d,id:h,role:"switch","aria-checked":e,"aria-label":r?n:void 0,disabled:i,onClick:()=>!i&&t(!e),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||i||(n.preventDefault(),t(!e))},className:le(V("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",i?"cursor-not-allowed":"cursor-pointer",!u&&"transition-colors duration-200")),style:{width:p,height:f,borderRadius:f,backgroundColor:y},...s,children:/* @__PURE__ */Ve("span",{"aria-hidden":"true",className:V("absolute rounded-full"),style:{top:"50%",left:x,width:m,height:m,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:u?"none":"left 200ms ease"}})})]})});ut.displayName="TkxToggle";var ht={info:/* @__PURE__ */Ve("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:/* @__PURE__ */Ve("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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 pt({variant:e,title:t,children:n,dismissible:o,onDismiss:r,icon:i,style:l,className:a}){const s=b(),d=xe(),c=t?E(t):void 0;Ae(()=>{c&&d(c,"danger"===e||"warning"===e?"assertive":"polite")},[c,e]);const u={info:s.info,success:s.success,warning:s.warning,danger:s.danger}[e];/* @__PURE__ */
16
- return Ye("div",{role:"danger"===e||"warning"===e?"alert":"status",className:V("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",a??""),style:{backgroundColor:`${u}18`,borderColor:u,color:s.text,...l},children:[
17
- /* @__PURE__ */Ve("span",{className:V("shrink-0 mt-[1px]"),style:{color:u},children:i??ht[e]}),
18
- /* @__PURE__ */Ye("div",{className:V("flex-1 min-w-0"),children:[c&&/* @__PURE__ */Ve("p",{className:V("m-0 font-semibold text-sm mb-1"),children:c}),/* @__PURE__ */Ve("div",{className:V("text-sm leading-relaxed"),children:n})]}),o&&r&&/* @__PURE__ */Ve("button",{"aria-label":"Dismiss alert",onClick:r,className:V("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}var ft={sm:"400px",md:"560px",lg:"720px",full:"100vw"},mt=0;function gt(){--mt<=0&&(mt=0,document.body.style.overflow="")}function xt({isOpen:e,onClose:t,title:n,size:o="md",closeOnOverlayClick:r=!0,closeOnEscape:i=!0,children:l,footer:a}){const s=b(),d=Fe(),c=pe(e),u=me(),h=xe(),p=E(n),f="full"===o;return ge(t,i&&e),Ae(()=>{if(e){if(1===++mt&&(document.body.style.overflow="hidden"),h(p,"polite"),ue())try{window.dispatchEvent(new CustomEvent("tkx:framed-modal",{detail:{title:p,at:Date.now()}}))}catch{}}else gt();return()=>{e&&gt()}},[e,p,h]),e&&"undefined"!=typeof document?Ue(/* @__PURE__ */Ye("div",{role:"presentation",className:V("fixed inset-0 z-[9000] flex",f?"items-stretch":"items-center justify-center",f?"":"p-4"),children:[/* @__PURE__ */Ve("div",{"aria-hidden":"true",onClick:r?t:void 0,className:V("absolute inset-0",!u&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),/* @__PURE__ */Ye("div",{ref:c,role:"dialog","aria-modal":"true","aria-labelledby":d,className:V("relative z-10 flex flex-col overflow-hidden",!u&&"animate-slide-up",f?"":"rounded-xl"),style:{backgroundColor:s.surface,border:`1px solid ${s.border}`,width:ft[o],maxWidth:"100%",maxHeight:f?"100vh":"90vh",boxShadow:`0 20px 60px ${s.bg}80`},children:[
19
- /* @__PURE__ */Ye("div",{className:V("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${s.border}`},children:[/* @__PURE__ */Ve("h2",{id:d,className:V("m-0 text-lg font-semibold font-sans"),style:{color:s.text},children:p}),/* @__PURE__ */Ve("button",{onClick:t,"aria-label":"Close dialog",className:V("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),
20
- /* @__PURE__ */Ve("div",{className:V("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:s.text},children:l}),a&&/* @__PURE__ */Ve("div",{className:V("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${s.border}`},children:a})]})]}),document.body):null}var bt=We(null);function yt(){const e=Be(bt);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function vt({defaultIndex:e=0,activeIndex:t,onChange:n,children:o,tabCount:r=0,style:i,className:l}){const[a,s]=Oe(e),d=Fe(),c=void 0!==t?t:a;/* @__PURE__ */
21
- return Ve(bt.Provider,{value:{activeIndex:c,setActiveIndex:e=>{void 0===t&&s(e),n?.(e)},baseId:d,tabCount:r},children:/* @__PURE__ */Ve("div",{className:l,style:i,children:o})})}function wt({children:e,className:t,style:n,...o}){const r=b();/* @__PURE__ */
22
- return Ve("div",{role:"tablist",className:le(V("flex gap-1"),t),style:{borderBottom:`2px solid ${r.border}`,...n},...o,children:e})}function kt({index:e,children:t,disabled:n=!1,className:o,style:r}){const i=b(),{activeIndex:l,setActiveIndex:a,baseId:s,tabCount:d}=yt(),c=je(null),u=l===e;/* @__PURE__ */
23
- return Ve("button",{ref:c,role:"tab",id:`${s}-tab-${e}`,"aria-controls":`${s}-panel-${e}`,"aria-selected":u,tabIndex:u?0:-1,disabled:n,className:le(V("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:u?i.primary:i.textMuted,fontWeight:u?600:400,borderBottom:u?`2px solid ${i.primary}`:"2px solid transparent",marginBottom:"-2px",...r},onClick:()=>!n&&a(e),onKeyDown:t=>T(t,e,d,e=>{a(e),document.getElementById(`${s}-tab-${e}`)?.focus()}),children:t})}function Ct({children:e,className:t,...n}){/* @__PURE__ */
24
- return Ve("div",{className:t,...n,children:e})}function St({index:e,children:t,style:n,className:o}){const{activeIndex:r,baseId:i}=yt();return r!==e?null:/* @__PURE__ */Ve("div",{role:"tabpanel",id:`${i}-panel-${e}`,"aria-labelledby":`${i}-tab-${e}`,tabIndex:0,className:le(V("pt-4"),o),style:n,children:t})}var $t={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 zt({content:e,children:t,placement:n="top",delay:o=300}){const r=b(),[i,l]=Oe(!1),a=je(null),s=Fe(),d=je(null),c=me(),u=E(e),h=W(r.surfaceAlt,[r.text,"#ffffff","#000000"]);function p(){d.current=setTimeout(()=>l(!0),o)}function f(){d.current&&clearTimeout(d.current),l(!1)}ge(f,i),fe(a,f),Ae(()=>()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]);const m=t,g=Le(m,{"aria-describedby":i?s:void 0,onMouseEnter:e=>{m.props.onMouseEnter?.(e),p()},onMouseLeave:e=>{m.props.onMouseLeave?.(e),f()},onFocus:e=>{m.props.onFocus?.(e),p()},onBlur:e=>{m.props.onBlur?.(e),f()}});/* @__PURE__ */
25
- return Ye("span",{ref:a,className:V("relative inline-flex"),children:[g,i&&/* @__PURE__ */Ve("span",{id:s,role:"tooltip",className:V("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!c&&"animate-fade-in"),style:{backgroundColor:r.surfaceAlt,color:h,border:`1px solid ${r.border}`,boxShadow:`0 4px 12px ${r.bg}40`,maxWidth:280,...$t[n]},children:u})]})}function Nt({variant:e,width:t,height:n,animation:o,bgColor:r,accentColor:i}){const l=void 0!==t?"number"==typeof t?`${t}px`:t:"100%",a=void 0!==n?"number"==typeof n?`${n}px`:n:{text:"1em",circular:l,rectangular:"80px"}[e],s=V("circular"===e?"rounded-full":"text"===e?"rounded":"rounded-lg"),d="pulse"===o?V("animate-pulse"):"wave"===o?V("animate-shimmer"):"",c="wave"===o?{background:`linear-gradient(90deg,${r} 25%,${i} 50%,${r} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:r};/* @__PURE__ */
26
- return Ve("div",{className:le(s,d),style:{width:l,height:a,...c}})}var Mt=Re(({variant:e="rectangular",width:t,height:n,lines:o,animation:r="pulse",className:i,style:l,...a},s)=>{const d=b(),c=!me()&&r;/* @__PURE__ */
27
- return Ve("div","text"===e&&o&&o>1?{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:le(V("flex flex-col gap-2"),i),style:l,...a,children:Array.from({length:o},(e,r)=>/* @__PURE__ */Ve(Nt,{variant:"text",width:r===o-1?"75%":t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border},r))}:{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:i,style:l,...a,children:/* @__PURE__ */Ve(Nt,{variant:e,width:t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border})})});Mt.displayName="TkxSkeleton";var It={xs:24,sm:32,md:40,lg:56,xl:72},Lt={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Wt=Re(({src:e,alt:t,initials:n,size:o="md",shape:r="circle",status:i,className:l,style:a,...s},d)=>{const c=b(),[u,h]=Oe(!1),p=It[o],f="circle"===r,m=c.surfaceAlt,g=W(m,[c.text,c.textMuted]),x=e&&!u,y=!x&&n,v=Math.max(8,.22*p),w=V("relative inline-flex shrink-0",f?"rounded-full":"rounded-lg"),k=V("block object-cover",f?"rounded-full":"rounded-lg"),C=V("flex items-center justify-center font-semibold font-sans select-none",f?"rounded-full":"rounded-lg");/* @__PURE__ */
28
- return Ye("div",{ref:d,className:le(w,l),style:{width:p,height:p,...a},...s,children:[x?/* @__PURE__ */Ve("img",{src:E(e),alt:E(t),onError:()=>h(!0),className:k,style:{width:p,height:p}}):/* @__PURE__ */Ve("div",{role:"img","aria-label":E(t),className:C,style:{width:p,height:p,backgroundColor:m,color:g,fontSize:.38*p},children:y?E(n).slice(0,2).toUpperCase():/* @__PURE__ */Ye("svg",{width:.5*p,height:.5*p,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ve("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),/* @__PURE__ */Ve("circle",{cx:"12",cy:"7",r:"4"})]})}),i&&/* @__PURE__ */Ve("span",{"aria-label":`Status: ${i}`,className:V("absolute bottom-0 right-0 rounded-full"),style:{width:v,height:v,backgroundColor:Lt[i],border:`2px solid ${c.bg}`}})]})});function Dt({dir:e}){/* @__PURE__ */
29
- return Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:V("shrink-0"),children:/* @__PURE__ */Ve("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function Rt({columns:e,data:t,caption:n,sortable:o,stickyHeader:r,isLoading:i,emptyState:l,style:a,className:s,striped:d,maxHeight:c,rowHeight:u=44,virtualScroll:h,onLoadMore:p,hasMore:f,loadingMore:m=!1,onRowClick:g,selectedRows:x,bordered:y,compact:v}){const w=b(),[k,C]=Oe(null),[S,$]=Oe("asc"),z=Ee(()=>k&&o?[...t].sort((e,t)=>{const n=e[k],o=t[k];let r=0;return"string"==typeof n&&"string"==typeof o?r=n.localeCompare(o):"number"==typeof n&&"number"==typeof o&&(r=n-o),"asc"===S?r:-r}):t,[t,k,S,o]),N=Te(e=>{k===e?$(e=>"asc"===e?"desc":"asc"):(C(e),$("asc"))},[k]),M=void 0!==h?h:void 0!==c&&z.length>=50,I=je(null),[L,W]=Oe(0),[D,R]=Oe(400),T=Te(()=>{I.current&&W(I.current.scrollTop)},[]);Ae(()=>{if(!M||!I.current)return;const e=I.current;R(e.clientHeight);const t=new ResizeObserver(()=>R(e.clientHeight));return t.observe(e),()=>t.disconnect()},[M]);const B=M?Math.max(0,Math.floor(L/u)-5):0,A=M?Math.min(z.length,Math.ceil((L+D)/u)+5):z.length,F=M?z.slice(B,A):z,H=je(null),j=je(!1);Ae(()=>{j.current=!1},[t.length]),Ae(()=>{if(!p)return;const e=H.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!j.current&&!1!==f&&(j.current=!0,p())},{root:I.current,rootMargin:"0px 0px 200px 0px",threshold:0});return t.observe(e),()=>t.disconnect()},[p,f]);const O=v?"4px":"12px",P=v?"8px":"16px",Y=y?`1px solid ${w.border}`:"none",U=Ee(()=>new Set(x??[]),[x]);/* @__PURE__ */
30
- return Ve("div",{className:V("w-full rounded-lg",s??""),style:{border:`1px solid ${w.border}`,overflow:"hidden",...a},children:/* @__PURE__ */Ye("div",{ref:I,onScroll:M?T:void 0,style:{overflowX:"auto",overflowY:c?"auto":"visible",maxHeight:c??"none"},children:[
31
- /* @__PURE__ */Ye("table",{className:V("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:w.text},children:[n&&/* @__PURE__ */Ve("caption",{className:V("text-sm text-left p-2"),style:{color:w.textMuted},children:E(n)}),
32
- /* @__PURE__ */Ve("thead",{style:r?{position:"sticky",top:0,backgroundColor:w.surfaceAlt,zIndex:1}:{backgroundColor:w.surfaceAlt},children:/* @__PURE__ */Ve("tr",{children:e.map(e=>{const t=o&&!1!==e.sortable,n=(r=e.key,k!==r?"none":S);var r;/* @__PURE__ */
33
- return Ve("th",{scope:"col","aria-sort":t?"none"===n?"none":"asc"===n?"ascending":"descending":void 0,className:V("text-left font-semibold whitespace-nowrap",t?"cursor-pointer select-none":""),style:{padding:`${O} ${P}`,color:w.textMuted,borderBottom:`2px solid ${w.border}`,borderRight:Y,width:e.width},onClick:()=>t&&N(e.key),onKeyDown:n=>{!t||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),N(e.key))},tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("span",{className:V("inline-flex items-center gap-1.5"),children:[E(e.header),t&&/* @__PURE__ */Ve(Dt,{dir:n})]})},String(e.key))})})}),
34
- /* @__PURE__ */Ve("tbody",{children:i?Array.from({length:5},(t,n)=>/* @__PURE__ */Ve("tr",{children:e.map(e=>/* @__PURE__ */Ve("td",{style:{padding:`${O} ${P}`},children:/* @__PURE__ */Ve(Mt,{variant:"text",height:"16px"})},String(e.key)))},n)):0===z.length?/* @__PURE__ */Ve("tr",{children:/* @__PURE__ */Ve("td",{colSpan:e.length,className:V("text-center"),style:{padding:"32px 16px",color:w.textMuted},children:l??"No data available"})}):/* @__PURE__ */Ye(Pe,{children:[M&&B>0&&/* @__PURE__ */Ve("tr",{"aria-hidden":"true",style:{height:B*u},children:/* @__PURE__ */Ve("td",{colSpan:e.length,style:{padding:0,border:"none"}})}),F.map((t,n)=>{const o=B+n,r=U.has(o);/* @__PURE__ */
35
- return Ve("tr",{"aria-rowindex":o+1,"aria-selected":r||void 0,onClick:g?()=>g(t,o):void 0,onKeyDown:g?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g(t,o))}:void 0,tabIndex:g?0:void 0,className:V(g?"cursor-pointer":""),style:{backgroundColor:r?`${w.primary}22`:d&&o%2==1?w.surfaceAlt:"transparent",borderBottom:`1px solid ${w.border}`,...M?{height:u,boxSizing:"border-box"}:{}},children:e.map(e=>{const n=t[e.key],o=e.render?e.render(n,t):"string"==typeof n?E(n):String(n??"");/* @__PURE__ */
36
- return Ve("td",{style:{padding:`${O} ${P}`,color:w.text,borderRight:Y},children:o},String(e.key))})},o)}),M&&A<z.length&&/* @__PURE__ */Ve("tr",{"aria-hidden":"true",style:{height:(z.length-A)*u},children:/* @__PURE__ */Ve("td",{colSpan:e.length,style:{padding:0,border:"none"}})})]})})]}),(f||m)&&/* @__PURE__ */Ve("div",{ref:H,style:{height:1,width:"100%"},children:m&&/* @__PURE__ */Ve("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ve("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ve("tr",{children:e.map(e=>/* @__PURE__ */Ve("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ve(Mt,{variant:"text",height:"16px"})},String(e.key)))},n))})})}),!f&&p&&/* @__PURE__ */Ve("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:w.textMuted},children:"✓ All rows loaded"})]})})}Wt.displayName="TkxAvatar";var Tt=Re(({orientation:e="horizontal",label:t,variant:n="solid",className:o,style:r,...i},l)=>{const a=b(),s=t?E(t):void 0,d="vertical"===e,c=d?"borderLeft":"borderTop",u=`1px ${n} ${a.border}`;return s?/* @__PURE__ */Ye("div",{role:"separator","aria-orientation":e,className:le(V("flex items-center gap-3 text-xs"),o),style:{color:a.textMuted,...r},...i,children:[
37
- /* @__PURE__ */Ve("hr",{className:V("flex-1 m-0 border-none"),style:{[c]:u}}),
38
- /* @__PURE__ */Ve("span",{children:s}),
39
- /* @__PURE__ */Ve("hr",{className:V("flex-1 m-0 border-none"),style:{[c]:u}})]}):/* @__PURE__ */Ve("hr",{ref:l,role:"separator","aria-orientation":e,className:le(V(d?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),o),style:{[c]:u,...r},...i})});Tt.displayName="TkxDivider";var Bt={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 At(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function Ft({size:e,color:t}){/* @__PURE__ */
40
- return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[/* @__PURE__ */Ve("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */Ve("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function Et({options:e,value:t,defaultValue:n,placeholder:o="Select an option…",size:r="md",isDisabled:i=!1,isInvalid:l=!1,label:a,hint:s,errorMessage:d,multiple:c=!1,searchable:u=!1,clearable:h=!1,isLoading:p=!1,onChange:f,renderOption:m,maxMenuHeight:g=280,virtualScroll:x,optionHeight:y=36,id:v,className:w,style:k}){const C=b(),S=Fe(),$=v??S,z=`${$}-listbox`,N=`${$}-hint`,M=`${$}-error`,I=void 0!==t,[L,W]=Oe(At(n)),D=I?At(t):L,[R,T]=Oe(!1),[B,A]=Oe(""),[F,H]=Oe(-1),[j,O]=Oe(null),[P,Y]=Oe(""),U=je(null),K=je(null),X=je(null),q=je(null),G=je(null),_=Bt[r],Z=l||!!d,J=je(null),[Q,ee]=Oe(0),[te,ne]=Oe(0),oe=Te(()=>{J.current&&ee(J.current.scrollTop)},[]);Ae(()=>{if(!R)return void ee(0);const e=J.current;if(!e)return;ne(e.clientHeight);const t=new ResizeObserver(()=>{ne(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[R]);const re=u&&B?e.filter(e=>e.label.toLowerCase().includes(B.toLowerCase())):e,ie=re.filter(e=>!e.disabled),ae=re.some(e=>!!e.group),se=(void 0!==x?x:re.length>=100)&&!ae,de=re.length*y,ce=se?Math.max(0,Math.floor(Q/y)-8):0,ue=se?Math.min(re.length,Math.ceil((Q+te)/y)+8):re.length,he=se?re.slice(ce,ue):re,pe=ce*y,fe=re.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),me=Te(e=>{let t;t=c?D.includes(e)?D.filter(t=>t!==e):[...D,e]:[e],I||W(t),f?.(c?t:t[0]??""),c||(T(!1),A(""),H(-1),K.current?.focus())},[I,c,f,D]),ge=Te((e,t)=>{t.stopPropagation();const n=D.filter(t=>t!==e);I||W(n),f?.(c?n:n[0]??"")},[I,c,f,D]),xe=Te(e=>{e.stopPropagation(),I||W([]),f?.(c?[]:"")},[I,c,f]),be=Te(()=>{K.current&&R&&O(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight-n.bottom-6,r=n.top-6,i=o>=Math.min(t,200)||o>=r?"below":"above";return{top:"below"===i?n.bottom+window.scrollY+6:n.top+window.scrollY-6-Math.min(t,280),left:n.left+window.scrollX,width:n.width,placement:i}}(K.current,g))},[R,g]);function ye(){if(i||p)return;T(!0);const e=ie.findIndex(e=>D.includes(e.value));H(e>=0?e:0)}Ae(()=>{if(R)return be(),window.addEventListener("scroll",be,!0),window.addEventListener("resize",be),()=>{window.removeEventListener("scroll",be,!0),window.removeEventListener("resize",be)}},[R,be]),Ae(()=>{if(!R)return;const e=e=>{const t=e.target;K.current?.contains(t)||q.current?.contains(t)||(T(!1),A(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[R]),Ae(()=>{R&&u&&setTimeout(()=>X.current?.focus(),0)},[R,u]),Ae(()=>{if(R&&!(F<0))if(se&&J.current){const e=F*y,t=e+y,n=J.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(G.current?.querySelector(`[data-idx="${F}"]`))?.scrollIntoView({block:"nearest"})},[F,R,se,y]);const ve=Z?C.danger:R?C.primary:C.border,we=F>=0&&ie[F]?`${$}-opt-${ie[F].value}`:void 0,ke=[s&&N,Z&&M].filter(Boolean).join(" ")||void 0,Ce=D.map(t=>e.find(e=>e.value===t)).filter(Boolean),Se=R&&j?Ue(/* @__PURE__ */Ye("div",{ref:q,role:"listbox",id:z,"aria-label":a?E(a):"Options","aria-multiselectable":c,style:{position:"absolute",top:j.top,left:j.left,width:j.width,zIndex:9999,backgroundColor:C.surface,border:`1.5px solid ${C.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:j.width,maxHeight:g,display:"flex",flexDirection:"column"},children:[u&&/* @__PURE__ */Ye("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${C.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:C.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ve("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ve("path",{d:"M21 21l-4.35-4.35"})]}),/* @__PURE__ */Ve("input",{ref:X,type:"text",value:B,onChange:e=>{A(e.target.value),H(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),T(!1),A(""),K.current?.focus();break;case"ArrowDown":e.preventDefault(),H(e=>Math.min(e+1,ie.length-1));break;case"ArrowUp":e.preventDefault(),H(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),H(0);break;case"End":e.preventDefault(),H(ie.length-1);break;case"Enter":e.preventDefault(),F>=0&&ie[F]&&me(ie[F].value)}},placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:C.text,fontSize:_.fontSize,fontFamily:"inherit",width:"100%"}})]}),/* @__PURE__ */Ve("div",{ref:e=>{G.current=e,J.current=e},onScroll:se?oe:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:g-(u?48:0)},children:se?/* @__PURE__ */Ye("div",{style:{height:de,position:"relative"},children:[/* @__PURE__ */Ve("div",{style:{position:"absolute",top:pe,left:0,right:0},children:he.map(e=>{const t=ie.indexOf(e),n=t===F,o=D.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ve("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ve("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(e.label)})]}),e.description&&/* @__PURE__ */Ve("span",{style:{fontSize:"12px",color:C.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(e.description)})]});/* @__PURE__ */
41
- return Ye("div",{id:`${$}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&me(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&H(t),style:{height:y,boxSizing:"border-box",padding:`0 ${_.px}`,fontSize:_.fontSize,fontFamily:"inherit",color:e.disabled?C.textMuted:C.text,backgroundColor:n?`${C.primary}22`:o?`${C.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[r,o&&!m&&/* @__PURE__ */Ve("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:C.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===re.length&&/* @__PURE__ */Ve("div",{style:{padding:`${_.py} ${_.px}`,fontSize:_.fontSize,fontFamily:"inherit",color:C.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:p?"Loading…":"No options found"})]}):/* @__PURE__ */Ye(Pe,{children:[Object.entries(fe).map(([e,t])=>/* @__PURE__ */Ye("div",{children:[e&&/* @__PURE__ */Ve("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:C.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:C.surface,zIndex:1,borderBottom:`1px solid ${C.border}`},children:E(e)}),t.map(e=>{const t=ie.indexOf(e),n=t===F,o=D.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ve("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ve("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(e.label)})]}),e.description&&/* @__PURE__ */Ve("span",{style:{fontSize:"12px",color:C.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(e.description)})]});/* @__PURE__ */
42
- return Ye("div",{id:`${$}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&me(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&H(t),style:{padding:`${_.py} ${_.px}`,fontSize:_.fontSize,fontFamily:"inherit",color:e.disabled?C.textMuted:C.text,backgroundColor:n?`${C.primary}22`:o?`${C.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[r,o&&!m&&/* @__PURE__ */Ve("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:C.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===re.length&&/* @__PURE__ */Ve("div",{style:{padding:`${_.py} ${_.px}`,fontSize:_.fontSize,fontFamily:"inherit",color:C.textMuted,textAlign:"center"},children:p?"Loading…":"No options found"})]})})]}),document.body):null,$e=h&&D.length>0&&!i&&!p;/* @__PURE__ */
43
- return Ye("div",{className:le(V("flex flex-col gap-1 w-full"),w),style:k,children:[a&&/* @__PURE__ */Ve("label",{htmlFor:$,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:C.text,userSelect:"none"},children:E(a)}),
44
- /* @__PURE__ */Ve("div",{style:{position:"relative",width:"100%",opacity:i?.55:1},children:/* @__PURE__ */Ye("button",{ref:K,id:$,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":R,"aria-controls":z,"aria-activedescendant":we,"aria-invalid":Z||void 0,"aria-describedby":ke,"aria-multiselectable":c,disabled:i,onClick:()=>R?T(!1):ye(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),R?F>=0&&ie[F]&&me(ie[F].value):ye();break;case"Escape":e.preventDefault(),T(!1),A("");break;case"ArrowDown":e.preventDefault(),R?H(e=>Math.min(e+1,ie.length-1)):ye();break;case"ArrowUp":e.preventDefault(),R?H(e=>Math.max(e-1,0)):ye();break;case"Home":e.preventDefault(),R&&H(0);break;case"End":e.preventDefault(),R&&H(ie.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(R||ye(),function(e){U.current&&clearTimeout(U.current);const t=P+e.toLowerCase();Y(t);const n=ie.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&H(n),U.current=setTimeout(()=>Y(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:c&&D.length>0?`4px ${_.px}`:`${_.py} ${_.px}`,fontSize:_.fontSize,fontFamily:"inherit",backgroundColor:C.surface,color:D.length>0?C.text:C.textMuted,border:`1.5px solid ${ve}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:i?"not-allowed":"pointer",outline:"none",minHeight:"sm"===r?34:"lg"===r?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[/* @__PURE__ */Ve("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:c&&Ce.length>0?Ce.map(e=>/* @__PURE__ */Ye("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${_.tagPy} ${_.tagPx}`,fontSize:`calc(${_.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${C.primary}22`,color:C.primary,borderRadius:6,border:`1px solid ${C.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[/* @__PURE__ */Ve("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:E(e.label)}),/* @__PURE__ */Ve("span",{role:"button","aria-label":`Remove ${E(e.label)}`,tabIndex:-1,onClick:t=>ge(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:/* @__PURE__ */Ve("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!c&&D.length>0?(()=>{const t=e.find(e=>e.value===D[0]);/* @__PURE__ */
45
- return Ye("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&/* @__PURE__ */Ve("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?E(t.label):""]})})():/* @__PURE__ */Ve("span",{style:{opacity:.6},children:E(o)})}),/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:C.textMuted},children:[p&&/* @__PURE__ */Ve(Ft,{size:_.iconSize,color:C.primary}),$e&&!p&&/* @__PURE__ */Ve("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:xe,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.7",children:/* @__PURE__ */Ve("svg",{width:_.iconSize,height:_.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M18 6L6 18M6 6l12 12"})})}),
46
- /* @__PURE__ */Ve("svg",{width:_.iconSize,height:_.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:R?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M6 9l6 6 6-6"})})]})]})}),s&&!Z&&/* @__PURE__ */Ve("span",{id:N,style:{fontSize:"12px",color:C.textMuted,fontFamily:"inherit"},children:E(s)}),Z&&d&&/* @__PURE__ */Ye("span",{id:M,role:"alert",style:{fontSize:"12px",color:C.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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(d)]}),Se]})}Et.displayName="TkxSelect";var Ht={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},jt=Re(({label:e,hint:t,isInvalid:n,errorMessage:o,isIndeterminate:r=!1,size:i="md",colorScheme:l="primary",checked:a,defaultChecked:s,onChange:d,disabled:c,className:u,style:h,id:p,...f},m)=>{const g=b(),x=me(),y=Fe(),v=p??y,w=`${v}-hint`,k=`${v}-error`,C=je(null),[S,$]=Oe(!1),z=Ht[i],N=n||!!o,M={primary:g.primary,success:g.success,danger:g.danger,warning:g.warning}[l]??g.primary,I=void 0!==a?a:void 0;Ae(()=>{const e=m?.current??C.current;e&&(e.indeterminate=r)},[r,m]);const L=r||(I??!1),D=L?M:g.surface,R=N?g.danger:L?M:g.border,T=W(M),B=S?{outline:`2px solid ${M}`,outlineOffset:"2px"}:{},A=[t&&w,N&&k].filter(Boolean).join(" ")||void 0,F=!x&&L?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};/* @__PURE__ */
47
- return Ye("div",{className:le(V("flex flex-col gap-1"),u),style:{opacity:c?.5:1,...h},children:[
48
- /* @__PURE__ */Ve("style",{children:"\n @keyframes tkx-check-scale-in {\n from { transform: scale(0.4); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n }\n "}),
49
- /* @__PURE__ */Ye("label",{htmlFor:v,className:V("flex items-center gap-2 select-none"),style:{cursor:c?"not-allowed":"pointer",fontFamily:"inherit"},children:[
50
- /* @__PURE__ */Ve("input",{ref:e=>{C.current=e,"function"==typeof m?m(e):m&&(m.current=e)},id:v,type:"checkbox",checked:a,defaultChecked:s,onChange:d,disabled:c,"aria-invalid":N,"aria-describedby":A,onFocus:e=>{e.target.matches(":focus-visible")&&$(!0)},onBlur:()=>$(!1),className:V("sr-only"),...f}),
51
- /* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{width:z.box,height:z.box,minWidth:z.box,borderRadius:"4px",border:`2px solid ${R}`,backgroundColor:D,display:"flex",alignItems:"center",justifyContent:"center",transition:x?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...B},children:r?/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{display:"block",width:.5*z.box,height:2,backgroundColor:T,borderRadius:"1px",...F}}):L?/* @__PURE__ */Ve("svg",{width:.6*z.box,height:.6*z.box,viewBox:"0 0 24 24",fill:"none",stroke:T,strokeWidth:z.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:F,children:/* @__PURE__ */Ve("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&/* @__PURE__ */Ve("span",{style:{fontSize:z.fontSize,color:g.text,lineHeight:1.4},children:"string"==typeof e?E(e):e})]}),t&&!N&&/* @__PURE__ */Ve("span",{id:w,className:V("text-xs ml-7"),style:{color:g.textMuted,marginLeft:z.box+8},children:E(t)}),N&&o&&/* @__PURE__ */Ye("span",{id:k,role:"alert",className:V("text-xs flex items-center gap-1"),style:{color:g.danger,marginLeft:z.box+8},children:[/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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(o)]})]})});jt.displayName="TkxCheckbox";var Ot=We(null),Pt={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},Vt=Re(({label:e,hint:t,size:n="md",colorScheme:o="primary",value:r,checked:i,onChange:l,disabled:a,name:s,className:d,style:c,id:u,...h},p)=>{const f=b(),m=me(),g=Fe(),x=u??g,y=Be(Ot),v=y?y.value===String(r??""):i??!1,w=a??y?.isDisabled??!1,k=s??y?.name??"",C=Pt[n],S={primary:f.primary,success:f.success,danger:f.danger}[o]??f.primary;W(S);const $=v?S:f.border,z=f.surface;/* @__PURE__ */
52
- return Ye("div",{className:le(V("flex flex-col gap-0.5"),d),style:{opacity:w?.5:1,...c},children:[
53
- /* @__PURE__ */Ve("style",{children:"\n @keyframes tkx-radio-dot-in {\n from { transform: scale(0) translate(-50%, -50%); opacity: 0; }\n to { transform: scale(1) translate(-50%, -50%); opacity: 1; }\n }\n "}),
54
- /* @__PURE__ */Ye("label",{htmlFor:x,className:V("flex items-center gap-2 select-none"),style:{cursor:w?"not-allowed":"pointer",fontFamily:"inherit"},children:[
55
- /* @__PURE__ */Ve("input",{ref:p,id:x,type:"radio",name:k,value:r,checked:v,onChange:()=>{w||(y?y.onChange(String(r??"")):l?.({target:{value:String(r??"")}}))},disabled:w,"aria-invalid":y?.isInvalid,className:V("sr-only"),...h}),
56
- /* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{position:"relative",width:C.outer,height:C.outer,minWidth:C.outer,borderRadius:"50%",border:`2px solid ${$}`,backgroundColor:z,display:"inline-block",boxSizing:"border-box",transition:m?"none":"border-color 120ms"},children:v&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:C.inner,height:C.inner,borderRadius:"50%",backgroundColor:S,transform:"translate(-50%, -50%)",transformOrigin:"center",...m?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&/* @__PURE__ */Ve("span",{style:{fontSize:C.fontSize,color:f.text,lineHeight:1.4},children:"string"==typeof e?E(e):e})]}),t&&/* @__PURE__ */Ve("span",{className:V("text-xs"),style:{color:f.textMuted,marginLeft:C.outer+8},children:E(t)})]})});function Yt({name:e,value:t,defaultValue:n="",onChange:o,label:r,orientation:i="vertical",isDisabled:l=!1,isInvalid:a=!1,errorMessage:s,children:d}){const c=b(),u=`${Fe()}-error`,[h,p]=Oe(n),f=void 0!==t,m=f?t:h,g=a||!!s;/* @__PURE__ */
57
- return Ve(Ot.Provider,{value:{name:e,value:m,onChange:e=>{f||p(e),o?.(e)},isDisabled:l,isInvalid:a},children:/* @__PURE__ */Ye("div",{role:"radiogroup","aria-label":r?E(r):void 0,"aria-describedby":g?u:void 0,"aria-invalid":g,children:[r&&/* @__PURE__ */Ve("div",{className:V("text-sm font-medium font-sans mb-2"),style:{color:c.text},children:E(r)}),
58
- /* @__PURE__ */Ve("div",{className:V("horizontal"===i?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:d}),g&&s&&/* @__PURE__ */Ye("span",{id:u,role:"alert",className:V("text-xs flex items-center gap-1 mt-1"),style:{color:c.danger},children:[/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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(s)]})]})})}Vt.displayName="TkxRadio";var Ut=[],Kt=[],Xt=/* @__PURE__ */new Set,qt=/* @__PURE__ */new Map;function Gt(){const e=[...Kt];Xt.forEach(t=>t(e))}function _t(e,t){0!==t&&qt.set(e,setTimeout(()=>Zt(e),t))}function Zt(e){clearTimeout(qt.get(e)),qt.delete(e);const t=Kt.some(t=>t.id===e);if(Kt=Kt.filter(t=>t.id!==e),Ut=Ut.filter(t=>t.id!==e),t&&Ut.length>0&&Kt.length<5){const e=Ut.shift();Kt=[...Kt,e],_t(e.id,e.duration??4e3)}Gt()}function Jt(){return{toast:Te(e=>function(e){const t=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:t,duration:e.duration??4e3};return Kt.length<5?(Kt=[...Kt,n],_t(t,n.duration)):Ut=[...Ut,n],Gt(),t}(e),[]),dismiss:Te(e=>Zt(e),[]),dismissAll:Te(()=>(qt.forEach(e=>clearTimeout(e)),qt.clear(),Kt=[],Ut=[],void Gt()),[])}}var Qt={default:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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"})})},en={"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 tn(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function nn({toast:e,position:t,onDismiss:n,reduced:o}){const r=b(),i=Fe(),l={default:r.textMuted,success:r.success,danger:r.danger,warning:r.warning,info:r.info},a=e.variant??"default",s=l[a],d="danger"===a,c=e.title?E(e.title):void 0,u=e.description?E(e.description):void 0;/* @__PURE__ */
59
- return Ye("div",{role:d?"alert":"status","aria-live":d?"assertive":"polite","aria-atomic":"true","aria-labelledby":c?i:void 0,className:V("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:r.surface,border:`1px solid ${s}55`,boxShadow:`0 8px 24px ${r.bg}cc`,color:r.text,...tn(t,o)},children:[
60
- /* @__PURE__ */Ve("span",{className:V("shrink-0 mt-[2px]"),style:{color:s},children:Qt[a]}),
61
- /* @__PURE__ */Ye("div",{className:V("flex-1 min-w-0"),children:[c&&/* @__PURE__ */Ve("p",{id:i,className:V("m-0 font-semibold text-sm leading-snug"),children:c}),u&&/* @__PURE__ */Ve("p",{className:V("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:r.textMuted},children:u}),e.action&&/* @__PURE__ */Ve("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:V("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:s},children:E(e.action.label)})]}),
62
- /* @__PURE__ */Ve("button",{"aria-label":"Dismiss notification",onClick:()=>n(e.id),className:V("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:r.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function on({position:e="top-right",children:t}){const[n,o]=Oe([...Kt]),r=me();Ae(()=>{o([...Kt]);const e=e=>o([...e]);return Xt.add(e),()=>{Xt.delete(e)}},[]);const i=e.startsWith("bottom"),l=en[e],a=je(!1);if(Ae(()=>{if(!a.current&&"undefined"!=typeof document&&(a.current=!0,!document.getElementById("tkx-toast-kf"))){const e=document.createElement("style");e.id="tkx-toast-kf",e.textContent="\n @keyframes tkx-toast-slide-down {\n from { opacity: 0; transform: translateY(-16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-toast-slide-up {\n from { opacity: 0; transform: translateY(16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}},[]),"undefined"==typeof document)/* @__PURE__ */return Ve(Pe,{children:t});const s=i?[...n].reverse():n;/* @__PURE__ */
63
- return Ye(Pe,{children:[t,Ue(/* @__PURE__ */Ve("div",{"aria-label":"Notifications",className:V("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:s.map(t=>/* @__PURE__ */Ve("div",{className:V("pointer-events-auto"),children:/* @__PURE__ */Ve(nn,{toast:t,position:e,onDismiss:Zt,reduced:r})},t.id))}),document.body)]})}var rn={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 ln({open:e,reduced:t,iconStyle:n,size:o,color:r}){const i=t?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return"chevron"===n?/* @__PURE__ */Ve("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:i,flexShrink:0},children:/* @__PURE__ */Ve("polyline",{points:"6 9 12 15 18 9"})}):/* @__PURE__ */Ye("svg","plus"===n?{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[/* @__PURE__ */Ve("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ve("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}:{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[/* @__PURE__ */Ve("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),/* @__PURE__ */Ve("polyline",{points:"12 5 19 12 12 19"})]})}function an({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=je(null),l=je(null),a=je(e),s=je(!1);return Ae(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),Ae(()=>{if(a.current===e)return;a.current=e;const n=i.current,o=l.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(s.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}s.current=!0,n.style.overflow="hidden",e?(n.style.height="0px",n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`${o.scrollHeight}px`})})):(n.style.height=`${o.scrollHeight}px`,n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height="0px"})}))}},[e,t]),/* @__PURE__ */Ve("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;s.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:/* @__PURE__ */Ve("div",{ref:l,children:n})})}function sn({items:e,multiple:t=!1,defaultOpen:n,value:o,onChange:r,variant:i="default",size:l="md",iconPosition:a="right",iconStyle:s="chevron",flush:d=!1,className:c,style:u}){const h=b(),p=me(),f=Fe(),m=void 0!==o,g=e=>e?Array.isArray(e)?new Set(e):new Set([e]):/* @__PURE__ */new Set,[x,y]=Oe(()=>g(n)),v=m?g(o):x,w=Te((e,n)=>{if(n)return;let i;if(!m)return void y(n=>{i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e));const o=[...i];return r?.(t?o:o[0]??""),i});{const n=g(o);i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e))}const l=[...i];r?.(t?l:l[0]??"")},[t,r,m,o]),k=rn[l],C=(e,t,n)=>{if(d)return{};switch(i){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${h.border}`};case"separated":return{border:`1px solid ${h.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};default:return{}}},S="separated"===i;/* @__PURE__ */
64
- return Ve("div",{className:V(c??""),style:{...d?{}:"bordered"===i?{border:`1px solid ${h.border}`,borderRadius:"10px",overflow:"hidden"}:{},display:S?"flex":void 0,flexDirection:S?"column":void 0,gap:S?"8px":void 0,...u},children:e.map((t,n)=>{const o=v.has(t.id),r=n===e.length-1,l=`${f}-trigger-${t.id}`,d=`${f}-panel-${t.id}`;/* @__PURE__ */
65
- return Ye("div",{className:t.className,style:C(0,0,r),children:[/* @__PURE__ */Ye("button",{id:l,type:"button",role:"button","aria-expanded":o,"aria-controls":d,disabled:t.disabled,onClick:()=>w(t.id,t.disabled),style:{width:"100%",display:"flex",alignItems:t.subtitle?"flex-start":"center",gap:"8px",padding:k.triggerPadding,border:"none",background:"transparent",cursor:t.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:k.fontSize,fontWeight:500,color:t.disabled?h.textMuted:h.text,opacity:t.disabled?.5:1,transition:p?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=(e=>"ghost"===i||"flush"===i?e?`${h.primary}10`:`${h.surfaceAlt}80`:e?`${h.primary}0d`:`${h.surfaceAlt}60`)(o))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${h.primary}0d`:"transparent"},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${h.primary}`,e.currentTarget.style.outlineOffset="2px")},onBlur:e=>{e.currentTarget.style.outline="none"},children:[t.icon&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:h.primary,marginTop:t.subtitle?"1px":void 0},children:t.icon}),"left"===a&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?h.primary:h.textMuted,marginTop:t.subtitle?"1px":void 0},children:/* @__PURE__ */Ve(ln,{open:o,reduced:p,iconStyle:s,size:k.iconSize,color:o?h.primary:h.textMuted})}),
66
- /* @__PURE__ */Ye("span",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ve("span",{style:{display:"block",lineHeight:1.4},children:t.title}),t.subtitle&&/* @__PURE__ */Ve("span",{style:{display:"block",fontSize:k.subtitleSize,color:h.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:t.subtitle})]}),t.badge&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:t.badge}),"right"===a&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?h.primary:h.textMuted,marginTop:t.subtitle?"1px":void 0},children:/* @__PURE__ */Ve(ln,{open:o,reduced:p,iconStyle:s,size:k.iconSize,color:o?h.primary:h.textMuted})})]}),/* @__PURE__ */Ve(an,{isOpen:o,reduced:p,id:d,triggerId:l,children:/* @__PURE__ */Ve("div",{style:{padding:k.contentPadding,fontSize:k.fontSize,lineHeight:1.6,color:h.textMuted,fontFamily:"inherit"},children:t.content})})]},t.id)})})}sn.displayName="TkxAccordion";var dn={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"},cn=0;function un(){--cn<=0&&(cn=0,document.body.style.overflow="")}function hn(){/* @__PURE__ */
67
- return Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function pn({isOpen:e,onClose:t,placement:n="right",size:o="md",title:r,children:i,footer:l,closeOnOverlayClick:a=!0,closeOnEsc:s=!0}){const d=b(),c=me(),u=Fe(),h=pe(e);if(ge(t,s&&e),Ae(()=>{if(e){if(1===++cn&&(document.body.style.overflow="hidden"),ue())try{window.dispatchEvent(new CustomEvent("tkx:framed-drawer",{detail:{placement:n,at:Date.now()}}))}catch{}}else un();return()=>{e&&un()}},[e,n]),"undefined"==typeof document)return null;const p=function(e,t){const n=dn[t],o={position:"absolute"};return"left"===e||"right"===e?{...o,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...o,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}(n,o),f=function(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}(n),m=c?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",g="string"==typeof r?E(r):r;return Ue(/* @__PURE__ */Ye("div",{role:"presentation",className:V("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[/* @__PURE__ */Ve("div",{"aria-hidden":"true",onClick:a?t:void 0,className:V("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:c?"none":"opacity 280ms ease",cursor:a?"pointer":"default"}}),/* @__PURE__ */Ye("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":r?u:void 0,className:V("absolute flex flex-col font-sans"),style:{...p,backgroundColor:d.surface,borderLeft:"right"===n?`1px solid ${d.border}`:void 0,borderRight:"left"===n?`1px solid ${d.border}`:void 0,borderTop:"bottom"===n?`1px solid ${d.border}`:void 0,borderBottom:"top"===n?`1px solid ${d.border}`:void 0,boxShadow:`0 20px 60px ${d.bg}99`,transform:e?"translate(0,0)":f,opacity:e?1:0,transition:m,willChange:"transform"},children:[void 0!==r&&/* @__PURE__ */Ye("div",{className:V("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${d.border}`},children:[/* @__PURE__ */Ve("h2",{id:u,className:V("m-0 text-base font-semibold leading-snug"),style:{color:d.text},children:g}),/* @__PURE__ */Ve("button",{onClick:t,"aria-label":"Close drawer",className:V("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ve(hn,{})})]}),void 0===r&&/* @__PURE__ */Ve("div",{className:V("flex justify-end px-3 pt-3 shrink-0"),children:/* @__PURE__ */Ve("button",{onClick:t,"aria-label":"Close drawer",className:V("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ve(hn,{})})}),
68
- /* @__PURE__ */Ve("div",{className:V("flex-1 overflow-y-auto px-5 py-4"),style:{color:d.text},children:i}),l&&/* @__PURE__ */Ve("div",{className:V("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${d.border}`},children:l})]})]}),document.body)}var fn=["Su","Mo","Tu","We","Th","Fr","Sa"],mn=["January","February","March","April","May","June","July","August","September","October","November","December"],gn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function bn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function yn(e,t,n){return!(!t||!xn(e,t))||!(!n||!xn(e,n))}function vn(e,t="en-US",n){if(!e)return"";if(n){const t=String(e.getFullYear()),o=t.slice(-2),r=e.getMonth()+1,i=String(r).padStart(2,"0"),l=gn[e.getMonth()],a=mn[e.getMonth()],s=e.getDate(),d=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,o).replace(/MMMM/g,a).replace(/MMM/g,l).replace(/MM/g,i).replace(/\bM\b/g,String(r)).replace(/DD/g,d).replace(/\bD\b/g,String(s))}return e.toLocaleDateString(t,{month:"2-digit",day:"2-digit",year:"numeric"})}function wn(e,t){return new Date(e,t+1,0).getDate()}function kn(e){return 10*Math.floor(e/10)}function Cn({values:e,selected:t,onSelect:n,label:o,theme:r,format:i}){const l=je([]),a=je(null);Ae(()=>{const e=l.current[t];e&&a.current&&e.scrollIntoView({block:"nearest"})},[t]);const s=i??(e=>String(e).padStart(2,"0"));/* @__PURE__ */
69
- return Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[/* @__PURE__ */Ve("div",{style:{fontSize:"11px",fontWeight:600,color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),/* @__PURE__ */Ve("div",{ref:a,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${r.border}`,borderRadius:"8px",padding:"4px"},children:e.map(e=>{const o=e===t;/* @__PURE__ */
70
- return Ve("button",{ref:t=>{l.current[e]=t},type:"button",onClick:()=>n(e),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?r.primary:"transparent",color:o?r.bg:r.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:s(e)},e)})})]})}function Sn({year:e,month:t,today:n,mode:o,selectedDate:r,selectedRange:i,multiDates:l,hoverDate:a,focusedDate:s,isDateDisabled:d,onSelectDate:c,onHoverDate:u,onSetFocused:h,theme:p,locale:f}){const m=function(e,t){const n=new Date(e,t,1).getDay(),o=wn(e,t),r=[],i=wn(e,t-1);for(let a=n-1;a>=0;a--)r.push(new Date(e,t-1,i-a));for(let a=1;a<=o;a++)r.push(new Date(e,t,a));let l=1;for(;r.length<42;)r.push(new Date(e,t+1,l++));return r}(e,t);/* @__PURE__ */
71
- return Ye("div",{children:[/* @__PURE__ */Ve("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:fn.map(e=>/* @__PURE__ */Ve("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:p.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */Ve("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:m.map((e,m)=>{const g=e.getMonth()===t,x=xn(e,n),b=0===e.getDay()||6===e.getDay(),y=d(e),v="single"===o&&null!=r&&xn(e,r),w="multiple"===o&&l.some(t=>xn(t,e)),k="range"===o&&yn(e,i[0],null),C="range"===o&&yn(e,null,i[1]),S=k||C,$="range"===o&&i[0]&&!i[1]&&a?a:i[1],z="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=bn(e).getTime(),r=bn(t).getTime(),i=bn(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],$),N="range"===o&&i[0]&&!i[1]&&a&&xn(e,a),M=v||w||S,I=null!=s&&xn(e,s);let L="transparent",W=g?b?`${p.text}cc`:p.text:`${p.textMuted}60`,D="none",R=400;return M||N?(L=p.primary,W=p.bg,R=600):z&&(L=`${p.primary}18`),x&&!M&&(D=`2px solid ${p.primary}`,R=600),y&&(W=`${p.textMuted}50`),I&&!M&&(D=`2px solid ${p.secondary}`),/* @__PURE__ */Ve("button",{type:"button","aria-label":e.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":M,"aria-disabled":y,disabled:y,onClick:()=>!y&&c(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:L,color:W,border:D,fontSize:"13px",fontWeight:R,cursor:y?"not-allowed":"pointer",opacity:y?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:y?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},m)})})]})}function $n({value:e,onChange:t,rangeValue:n,onRangeChange:o,multiValue:r,onMultiChange:i,mode:l="single",minDate:a,maxDate:s,disabledDates:d,locale:c="en-US",dateFormat:u,showTime:h=!1,timeValue:p,onTimeChange:f,showPresets:m=!1,customPresets:g,label:x,placeholder:y="MM/DD/YYYY",hint:v,isDisabled:w=!1,isInvalid:k=!1,errorMessage:C,numberOfMonths:S=1,id:$,className:z,style:N}){const M=b(),I=Fe(),L=$??I,W=me(),D=bn(/* @__PURE__ */new Date),R=void 0!==e,[T,B]=Oe(null),A=R?e??null:T,F=void 0!==n,[H,j]=Oe([null,null]),O=F?n:H,P=void 0!==r,[V,Y]=Oe([]),U=P?r:V,[K,X]=Oe("start"),q="range"===l||"single"===l&&h,[G,_]=Oe([null,null]),[Z,J]=Oe(null),Q=A??O[0]??D,[ee,te]=Oe(Q.getFullYear()),[ne,oe]=Oe(Q.getMonth()),[re,ie]=Oe("day"),[le,ae]=Oe({h:0,m:0}),se=p??le,[de,ce]=Oe(!1),[ue,he]=Oe(()=>{if("single"===l)return vn(A,c,u);if("range"===l){const[e,t]=O;if(e&&t)return`${vn(e,c,u)} – ${vn(t,c,u)}`}return""}),[pe,fe]=Oe(null),[ge,xe]=Oe(null),[be,ye]=Oe({top:0,left:0,flipUp:!1}),[,ve]=He(e=>e+1,0),we=je(null),ke=je(null),Ce=je(null),Se=m?420:h?480:360;Ae(()=>{if("single"===l)he(vn(A,c,u));else if("range"===l){const[e,t]=O;he(e&&t?`${vn(e,c,u)} – ${vn(t,c,u)}`:e?vn(e,c,u):"")}else"multiple"===l&&he(U.length>0?`${U.length} date${1!==U.length?"s":""} selected`:"")},[A,O,U,l,c,u]);const $e=Te(()=>{we.current&&ye(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,l=o-n.bottom<t+8&&n.top>t+8;return{top:l?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:l}}(we.current,Se))},[Se]);Ae(()=>{if(de)return $e(),window.addEventListener("scroll",$e,!0),window.addEventListener("resize",$e),()=>{window.removeEventListener("scroll",$e,!0),window.removeEventListener("resize",$e)}},[de,$e]),Ae(()=>{if(!de)return;const e=e=>{we.current?.contains(e.target)||ke.current?.contains(e.target)||ce(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[de]),Ae(()=>{if(!de)return;const e=e=>{"Escape"===e.key&&(ce(!1),Ce.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[de]);const ze=Te(e=>!!(a&&bn(e)<bn(a))||!!(s&&bn(e)>bn(s))||!!d&&("function"==typeof d?d(e):d.some(t=>xn(t,e))),[a,s,d]),Ne=Te(e=>{if(!ze(e)){if("single"===l)q?J(e):(R||B(e),t?.(e),he(vn(e,c,u)),ce(!1));else if("range"===l)if("start"===K){const t=[e,null];_(t),F||j(t),o?.(t),X("end")}else{const t=G[0]??O[0],n=t&&e<t?[e,t]:[t,e];_(n),q?X("start"):(F||j(n),o?.(n),X("start"),ce(!1))}else if("multiple"===l){const t=U.some(t=>xn(t,e))?U.filter(t=>!xn(t,e)):[...U,e];P||Y(t),i?.(t)}ve()}},[l,ze,R,F,P,t,o,i,K,G,O,U,q,c]),Me=Te(()=>{if("single"===l){const e=Z??A;R||B(e),t?.(e)}else"range"===l&&(F||j(G),o?.(G));ce(!1),X("start")},[l,Z,G,A,R,F,t,o]),Ie=Te(()=>{J(null),_([null,null]),X("start"),ce(!1)},[]),Le=g??[{label:"Today",getValue:()=>{const e=bn(/* @__PURE__ */new Date);return[e,e]}},{label:"Yesterday",getValue:()=>{const e=bn(/* @__PURE__ */new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:"Last 7 days",getValue:()=>{const e=bn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:"Last 30 days",getValue:()=>{const e=bn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:"Last 90 days",getValue:()=>{const e=bn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:"This week",getValue:()=>{const e=bn(/* @__PURE__ */new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay());const n=new Date(t);return n.setDate(n.getDate()+6),[t,n]}},{label:"Last week",getValue:()=>{const e=bn(/* @__PURE__ */new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay()-1);const n=new Date(t);return n.setDate(n.getDate()-6),[n,t]}},{label:"This month",getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:"Last month",getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=/* @__PURE__ */new Date,t=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),3*t,1),new Date(e.getFullYear(),3*t+3,0)]}},{label:"Last quarter",getValue:()=>{const e=/* @__PURE__ */new Date,t=Math.floor(e.getMonth()/3),n=0===t?3:t-1,o=0===t?e.getFullYear()-1:e.getFullYear();return[new Date(o,3*n,1),new Date(o,3*n+3,0)]}},{label:"This year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}],We=11===ne?0:ne+1,De=11===ne?ee+1:ee,Re=S>=2,Be=x?E(x):void 0,Ee=v?E(v):void 0,Ke=C?E(C):void 0,Xe=E(y),qe="single"===l&&null!=A||"range"===l&&(null!=O[0]||null!=O[1])||"multiple"===l&&U.length>0,Ge="range"===l?q?G:O:[null,null],_e=k?M.danger:de?M.primary:M.border,Ze=Array.from({length:24},(e,t)=>t),Je=Array.from({length:60},(e,t)=>t),Qe=/* @__PURE__ */Ye("div",{ref:ke,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==re)return;const t=pe??A??D;let n=null;if("ArrowRight"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);else if("ArrowLeft"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);else if("ArrowDown"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+7);else if("ArrowUp"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7);else if("Enter"===e.key&&pe)return void Ne(pe);n&&(e.preventDefault(),fe(n),n.getMonth()===ne&&n.getFullYear()===ee||(oe(n.getMonth()),te(n.getFullYear())))},style:{position:"absolute",top:be.top,left:be.left,zIndex:9999,backgroundColor:M.surface,border:`1px solid ${M.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:Re?"580px":"300px",maxWidth:Re&&m?"780px":Re?"620px":m?"520px":"300px",opacity:de?1:0,transform:de?"translateY(0) scale(1)":be.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:W?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[m&&"range"===l&&/* @__PURE__ */Ye("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${M.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[/* @__PURE__ */Ve("div",{style:{fontSize:"11px",fontWeight:600,color:M.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),Le.map(e=>{const[t,n]=e.getValue(),r=Ge[0]&&Ge[1]&&xn(Ge[0],t)&&xn(Ge[1],n);/* @__PURE__ */
72
- return Ve("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];_(r),F||j(r),o?.(r),te(t.getFullYear()),oe(t.getMonth()),X("start"),q||ce(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:r?`${M.primary}20`:"transparent",color:r?M.primary:M.text,fontWeight:r?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor=`${M.surfaceAlt}`)},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),/* @__PURE__ */Ye("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[
1
+ import{A as e,C as t,D as n,E as o,F as r,I as i,L as a,N as l,O as s,P as d,R as c,S as u,T as h,a as p,b as f,c as m,d as g,f as x,g as y,h as b,i as v,j as w,k,l as S,m as C,n as $,o as z,p as N,r as M,s as I,t as D,u as W,v as L,w as R,x as T,y as A}from"./chunk-DdHSYetV.js";import{A as B,C as F,D as E,E as j,O as H,S as P,T as O,_ as V,a as K,b as U,c as Y,d as X,f as q,g as _,h as Z,i as G,j as J,k as Q,l as ee,m as te,n as ne,o as oe,p as re,r as ie,s as ae,t as le,u as se,v as de,w as ce,x as ue,y as he}from"./chunk-DcVMayoM.js";import{a as pe,i as fe,n as me,o as ge,r as xe,t as ye}from"./chunk-BHX35YDv.js";import{I18nContext as be,LOCALES as ve,enUS as we,isRTL as ke,useDirection as Se,useI18n as Ce,useLocale as $e}from"./i18n.js";import{n as ze,r as Ne,t as Me}from"./chunk-CDGrC2Wo.js";import Ie,{Children as De,cloneElement as We,createContext as Le,createElement as Re,forwardRef as Te,useCallback as Ae,useContext as Be,useEffect as Fe,useId as Ee,useImperativeHandle as je,useMemo as He,useReducer as Pe,useRef as Oe,useState as Ve}from"react";import{Fragment as Ke,jsx as Ue,jsxs as Ye}from"react/jsx-runtime";import{createPortal as Xe}from"react-dom";var qe={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},_e={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},Ze={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},Ge={sm:14,md:16,lg:18,xl:20};function Je({size:e}){const t=Ge[e];/* @__PURE__ */
2
+ return Ye("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:K("animate-spin shrink-0"),children:[/* @__PURE__ */Ue("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),/* @__PURE__ */Ue("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var Qe=Te(({variant:e="solid",size:t="md",colorScheme:n="primary",isLoading:o=!1,loadingText:r,leftIcon:i,rightIcon:a,isFullWidth:l=!1,glow:s=!1,disabled:d,children:c,className:u,style:h,...p},f)=>{const m=N(),g=ge(),x=d||o,y={primary:m.primary,secondary:m.secondary,danger:m.danger,warning:m.warning,success:m.success}[n],b=A(y,["#ffffff","#000000",m.bg]),v="string"==typeof c?j(c):c,w=r?j(r):void 0,k="solid"===e?{backgroundColor:y,color:b,border:"none",boxShadow:s&&!g?`0 0 20px ${y}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:y,border:`2px solid ${y}`}:"ghost"===e?{backgroundColor:"transparent",color:y,border:"none"}:{backgroundColor:"transparent",color:y,border:"none",textDecoration:"underline"};/* @__PURE__ */
3
+ return Ue("button",{ref:f,"aria-busy":o,"aria-disabled":x,disabled:x,className:le(K("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",qe[t],_e[t],Ze[t],"link"!==e&&Ze[t],l&&"w-full",x?"cursor-not-allowed opacity-60":"cursor-pointer",!g&&"transition-all duration-200","focus-visible:focus-ring"),u),style:{...k,...h},...p,children:/* @__PURE__ */Ye(Ke,o?{children:[/* @__PURE__ */Ue(Je,{size:t}),w??v]}:{children:[i&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",children:i}),v,a&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",children:a})]})})});Qe.displayName="TkxButton";var et={none:"",sm:"p-3",md:"p-5",lg:"p-7"},tt=Te(({variant:e="default",isHoverable:t,isClickable:n,padding:o="md",as:r,children:i,className:a,style:l,...s},d)=>{const c=N(),u=ge(),h=r??(n?"button":"div"),p={default:{backgroundColor:c.surface,border:`1px solid ${c.border}`},glass:{backgroundColor:`${c.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${c.border}55`,boxShadow:`0 4px 24px ${c.bg}40`},quantum:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.primary}33`,boxShadow:`0 0 24px ${c.primary}18`},elevated:{backgroundColor:c.surface,boxShadow:`0 4px 20px ${c.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${c.border}`}}[e];/* @__PURE__ */
4
+ return Ue(h,{ref:d,className:le("tkx-card",K("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",et[o],(t||n)&&!u&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default"),a),style:{color:c.text,...p,...l},...s,children:i})});function nt({title:e,subtitle:t,action:n,children:o,className:r,...i}){const a=N();/* @__PURE__ */
5
+ return Ye("div",{className:le(K("flex justify-between items-start mb-4"),r),...i,children:[/* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[e&&/* @__PURE__ */Ue("h3",{className:K("text-base font-semibold m-0"),style:{color:a.text},children:e}),t&&/* @__PURE__ */Ue("p",{className:K("text-sm mt-1 mb-0"),style:{color:a.textMuted},children:t}),o]}),n&&/* @__PURE__ */Ue("div",{className:K("ml-3 shrink-0"),children:n})]})}function ot({children:e,className:t,...n}){/* @__PURE__ */
6
+ return Ue("div",{className:le(K(""),t),...n,children:e})}function rt({children:e,className:t,style:n,...o}){const r=N();/* @__PURE__ */
7
+ return Ue("div",{className:le(K("flex items-center justify-end gap-2 mt-4 pt-4"),t),style:{borderTop:`1px solid ${r.border}`,...n},...o,children:e})}tt.displayName="TkxCard";var it=Te(({label:e,id:t,error:n,hint:o,leftAddon:r,rightAddon:i,isInvalid:a,isRequired:l,disabled:s,className:d,style:c,unicodeSafe:u=!0,onChange:h,...p},f)=>{const m=N(),g=Ee(),x=t??g,y=`${x}-hint`,b=`${x}-error`,v=a||!!n,w=[o&&y,v&&b].filter(Boolean).join(" ")||void 0,k=j(e),S=n?j(n):void 0,C=o?j(o):void 0,$=v?m.danger:m.border;/* @__PURE__ */
8
+ return Ye("div",{className:le(K("flex flex-col gap-1 w-full"),d),style:c,children:[
9
+ /* @__PURE__ */Ye("label",{htmlFor:x,className:K("text-sm font-medium font-sans"),style:{color:m.text},children:[k,l&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("ml-1"),style:{color:m.danger},children:"*"})]}),
10
+ /* @__PURE__ */Ye("div",{className:K("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",s?"opacity-60":""),style:{border:`1.5px solid ${$}`,backgroundColor:m.surface},children:[r&&/* @__PURE__ */Ue("div",{className:K("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:m.surfaceAlt,color:m.textMuted,borderRight:`1px solid ${m.border}`},children:r}),
11
+ /* @__PURE__ */Ue("input",{ref:f,id:x,"aria-invalid":v,"aria-required":l,"aria-describedby":w,disabled:s,className:le(K("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:m.text},onChange:u?e=>{const t=E(e.target.value);t!==e.target.value&&(e.target.value=t),h?.(e)}:h,...p}),i&&/* @__PURE__ */Ue("div",{className:K("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:m.surfaceAlt,color:m.textMuted,borderLeft:`1px solid ${m.border}`},children:i})]}),C&&!S&&/* @__PURE__ */Ue("span",{id:y,className:K("text-xs"),style:{color:m.textMuted},children:C}),S&&/* @__PURE__ */Ye("span",{id:b,role:"alert",className:K("text-xs flex items-center gap-1"),style:{color:m.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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]})]})});it.displayName="TkxInput";var at={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]"},lt={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},st=Te(({variant:e="default",size:t="md",dot:n=!1,pulse:o=!1,outlined:r=!1,children:i,className:a,style:l,...s},d)=>{const c=N(),u={default:c.border,primary:c.primary,secondary:c.secondary,danger:c.danger,warning:c.warning,success:c.success,info:c.info}[e]||"#666666",h=A(u,["#ffffff","#000000",c.bg||"#000000"]),p="string"==typeof i?j(i):i;/* @__PURE__ */
12
+ return Ue("span",n?{ref:d,"aria-label":"string"==typeof i?j(i):void 0,className:le(K("inline-block rounded-full",lt[t],o&&"animate-pulse"),a),style:{backgroundColor:u,...l},...s}:{ref:d,className:le(K("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",at[t],o&&"animate-pulse"),a),style:{backgroundColor:r?"transparent":u,color:r?u:h,border:r?`1px solid ${u}`:"none",...l},...s,children:p})});st.displayName="TkxBadge";var dt={sm:"4px",md:"8px",lg:"12px"},ct={sm:32,md:48,lg:64},ut=Te(({value:e,variant:t="linear",size:n="md",label:o,showValue:r,color:i,className:a,style:l,...s},d)=>{const c=N(),u=ge(),h=i??c.primary,p=void 0===e,f=void 0!==e?Math.min(100,Math.max(0,e)):0;if(void 0!==e){const{errors:t}=B({value:e},{value:{type:"number",min:0,max:100}});t.length}if("circular"===t){const e=ct[n],t="sm"===n?3:"md"===n?4:5,i=(e-2*t)/2,s=2*Math.PI*i,m=p?0:s-f/100*s;/* @__PURE__ */
13
+ return Ye("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p?void 0:f,"aria-label":o??(p?"Loading":`${f}%`),className:le(K("inline-flex flex-col items-center gap-1"),a),style:l,children:[/* @__PURE__ */Ye("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:c.border,strokeWidth:t}),/* @__PURE__ */Ue("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:h,strokeWidth:t,strokeLinecap:"round",strokeDasharray:s,strokeDashoffset:m,transform:`rotate(-90 ${e/2} ${e/2})`,style:{transition:u?"none":"stroke-dashoffset 300ms ease",animation:p&&!u?"tkx-spin 1s linear infinite":void 0}})]}),r&&!p&&/* @__PURE__ */Ye("span",{className:K("text-xs"),style:{color:c.textMuted},children:[f,"%"]})]})}const m=dt[n];/* @__PURE__ */
14
+ return Ye("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p?void 0:f,"aria-label":o??(p?"Loading":`${f}%`),className:le(K("flex flex-col gap-1 w-full"),a),style:l,children:[o&&/* @__PURE__ */Ye("div",{className:K("flex justify-between text-sm"),style:{color:c.text},children:[/* @__PURE__ */Ue("span",{children:o}),r&&!p&&/* @__PURE__ */Ye("span",{children:[f,"%"]})]}),/* @__PURE__ */Ue("div",{className:K("w-full overflow-hidden"),style:{height:m,borderRadius:m,backgroundColor:c.border},children:/* @__PURE__ */Ue("div",{style:{height:"100%",borderRadius:m,backgroundColor:h,width:p?"40%":`${f}%`,transition:u?"none":"width 300ms ease",animation:p&&!u?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});ut.displayName="TkxProgress";var ht={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}},pt=Te(({checked:e,onChange:t,label:n,size:o="md",hideLabel:r,disabled:i,className:a,style:l,...s},d)=>{const c=N(),u=ge(),h=Ee();B({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:p,th:f,td:m,gap:g}=ht[o],x=e?p-m-g:g,y=e?c.primary:c.border;/* @__PURE__ */
15
+ return Ye("div",{className:le(K("inline-flex items-center gap-2",i?"opacity-50":""),a),style:l,children:[!r&&/* @__PURE__ */Ue("label",{htmlFor:h,className:K("text-sm font-sans",i?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:c.text},children:n}),/* @__PURE__ */Ue("button",{ref:d,id:h,role:"switch","aria-checked":e,"aria-label":r?n:void 0,disabled:i,onClick:()=>!i&&t(!e),onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||i||(n.preventDefault(),t(!e))},className:le(K("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",i?"cursor-not-allowed":"cursor-pointer",!u&&"transition-colors duration-200")),style:{width:p,height:f,borderRadius:f,backgroundColor:y},...s,children:/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("absolute rounded-full"),style:{top:"50%",left:x,width:m,height:m,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:u?"none":"left 200ms ease"}})})]})});pt.displayName="TkxToggle";var ft={info:/* @__PURE__ */Ue("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:/* @__PURE__ */Ue("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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 mt({variant:e,title:t,children:n,dismissible:o,onDismiss:r,icon:i,style:a,className:l}){const s=N(),d=ye(),c=t?j(t):void 0;Fe(()=>{c&&d(c,"danger"===e||"warning"===e?"assertive":"polite")},[c,e]);const u={info:s.info,success:s.success,warning:s.warning,danger:s.danger}[e];/* @__PURE__ */
16
+ return Ye("div",{role:"danger"===e||"warning"===e?"alert":"status",className:K("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",l??""),style:{backgroundColor:`${u}18`,borderColor:u,color:s.text,...a},children:[
17
+ /* @__PURE__ */Ue("span",{className:K("shrink-0 mt-[1px]"),style:{color:u},children:i??ft[e]}),
18
+ /* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[c&&/* @__PURE__ */Ue("p",{className:K("m-0 font-semibold text-sm mb-1"),children:c}),/* @__PURE__ */Ue("div",{className:K("text-sm leading-relaxed"),children:n})]}),o&&r&&/* @__PURE__ */Ue("button",{"aria-label":"Dismiss alert",onClick:r,className:K("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}var gt={sm:"400px",md:"560px",lg:"720px",full:"100vw"},xt=0;function yt(){--xt<=0&&(xt=0,document.body.style.overflow="")}function bt({isOpen:e,onClose:t,title:n,size:o="md",closeOnOverlayClick:r=!0,closeOnEscape:i=!0,children:a,footer:l}){const s=N(),d=$e(),c=Ee(),u=fe(e),h=ge(),p=ye(),f=j(n),m="full"===o;return xe(t,i&&e),Fe(()=>{if(e){if(1===++xt&&(document.body.style.overflow="hidden"),p(f,"polite"),he())try{window.dispatchEvent(new CustomEvent("tkx:framed-modal",{detail:{title:f,at:Date.now()}}))}catch{}}else yt();return()=>{e&&yt()}},[e,f,p]),e&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{role:"presentation",className:K("fixed inset-0 z-[9000] flex",m?"items-stretch":"items-center justify-center",m?"":"p-4"),children:[/* @__PURE__ */Ue("div",{"aria-hidden":"true",onClick:r?t:void 0,className:K("absolute inset-0",!h&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),/* @__PURE__ */Ye("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":c,className:K("relative z-10 flex flex-col overflow-hidden",!h&&"animate-slide-up",m?"":"rounded-xl"),style:{backgroundColor:s.surface,border:`1px solid ${s.border}`,width:gt[o],maxWidth:"100%",maxHeight:m?"100vh":"90vh",boxShadow:`0 20px 60px ${s.bg}80`},children:[
19
+ /* @__PURE__ */Ye("div",{className:K("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${s.border}`},children:[/* @__PURE__ */Ue("h2",{id:c,className:K("m-0 text-lg font-semibold font-sans"),style:{color:s.text},children:f}),/* @__PURE__ */Ue("button",{onClick:t,"aria-label":d.close,className:K("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),
20
+ /* @__PURE__ */Ue("div",{className:K("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:s.text},children:a}),l&&/* @__PURE__ */Ue("div",{className:K("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${s.border}`},children:l})]})]}),document.body):null}var vt=Le(null);function wt(){const e=Be(vt);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function kt({defaultIndex:e=0,activeIndex:t,onChange:n,children:o,tabCount:r=0,style:i,className:a}){const[l,s]=Ve(e),d=Ee(),c=void 0!==t?t:l;/* @__PURE__ */
21
+ return Ue(vt.Provider,{value:{activeIndex:c,setActiveIndex:e=>{void 0===t&&s(e),n?.(e)},baseId:d,tabCount:r},children:/* @__PURE__ */Ue("div",{className:a,style:i,children:o})})}function St({children:e,className:t,style:n,...o}){const r=N();/* @__PURE__ */
22
+ return Ue("div",{role:"tablist",className:le(K("flex gap-1"),t),style:{borderBottom:`2px solid ${r.border}`,...n},...o,children:e})}function Ct({index:e,children:t,disabled:n=!1,className:o,style:r}){const i=N(),{activeIndex:a,setActiveIndex:l,baseId:s,tabCount:d}=wt(),c=Oe(null),u=a===e;/* @__PURE__ */
23
+ return Ue("button",{ref:c,role:"tab",id:`${s}-tab-${e}`,"aria-controls":`${s}-panel-${e}`,"aria-selected":u,tabIndex:u?0:-1,disabled:n,className:le(K("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:u?i.primary:i.textMuted,fontWeight:u?600:400,borderBottom:u?`2px solid ${i.primary}`:"2px solid transparent",marginBottom:"-2px",...r},onClick:()=>!n&&l(e),onKeyDown:t=>f(t,e,d,e=>{l(e),document.getElementById(`${s}-tab-${e}`)?.focus()}),children:t})}function $t({children:e,className:t,...n}){/* @__PURE__ */
24
+ return Ue("div",{className:t,...n,children:e})}function zt({index:e,children:t,style:n,className:o}){const{activeIndex:r,baseId:i}=wt();return r!==e?null:/* @__PURE__ */Ue("div",{role:"tabpanel",id:`${i}-panel-${e}`,"aria-labelledby":`${i}-tab-${e}`,tabIndex:0,className:le(K("pt-4"),o),style:n,children:t})}var Nt={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 Mt({content:e,children:t,placement:n="top",delay:o=300}){const r=N(),[i,a]=Ve(!1),l=Oe(null),s=Ee(),d=Oe(null),c=ge(),u=j(e),h=A(r.surfaceAlt,[r.text,"#ffffff","#000000"]);function p(){d.current=setTimeout(()=>a(!0),o)}function f(){d.current&&clearTimeout(d.current),a(!1)}xe(f,i),me(l,f),Fe(()=>()=>{d.current&&(clearTimeout(d.current),d.current=null)},[]);const m=t,g=We(m,{"aria-describedby":i?s:void 0,onMouseEnter:e=>{m.props.onMouseEnter?.(e),p()},onMouseLeave:e=>{m.props.onMouseLeave?.(e),f()},onFocus:e=>{m.props.onFocus?.(e),p()},onBlur:e=>{m.props.onBlur?.(e),f()}});/* @__PURE__ */
25
+ return Ye("span",{ref:l,className:K("relative inline-flex"),children:[g,i&&/* @__PURE__ */Ue("span",{id:s,role:"tooltip",className:K("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!c&&"animate-fade-in"),style:{backgroundColor:r.surfaceAlt,color:h,border:`1px solid ${r.border}`,boxShadow:`0 4px 12px ${r.bg}40`,maxWidth:280,...Nt[n]},children:u})]})}function It({variant:e,width:t,height:n,animation:o,bgColor:r,accentColor:i}){const a=void 0!==t?"number"==typeof t?`${t}px`:t:"100%",l=void 0!==n?"number"==typeof n?`${n}px`:n:{text:"1em",circular:a,rectangular:"80px"}[e],s=K("circular"===e?"rounded-full":"text"===e?"rounded":"rounded-lg"),d="pulse"===o?K("animate-pulse"):"wave"===o?K("animate-shimmer"):"",c="wave"===o?{background:`linear-gradient(90deg,${r} 25%,${i} 50%,${r} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:r};/* @__PURE__ */
26
+ return Ue("div",{className:le(s,d),style:{width:a,height:l,...c}})}var Dt=Te(({variant:e="rectangular",width:t,height:n,lines:o,animation:r="pulse",className:i,style:a,...l},s)=>{const d=N(),c=!ge()&&r;/* @__PURE__ */
27
+ return Ue("div","text"===e&&o&&o>1?{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:le(K("flex flex-col gap-2"),i),style:a,...l,children:Array.from({length:o},(e,r)=>/* @__PURE__ */Ue(It,{variant:"text",width:r===o-1?"75%":t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border},r))}:{ref:s,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:i,style:a,...l,children:/* @__PURE__ */Ue(It,{variant:e,width:t,height:n,animation:c,bgColor:d.surfaceAlt,accentColor:d.border})})});Dt.displayName="TkxSkeleton";var Wt={xs:24,sm:32,md:40,lg:56,xl:72},Lt={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Rt=Te(({src:e,alt:t,initials:n,size:o="md",shape:r="circle",status:i,className:a,style:l,...s},d)=>{const c=N(),[u,h]=Ve(!1),p=Wt[o],f="circle"===r,m=c.surfaceAlt,g=A(m,[c.text,c.textMuted]),x=e&&!u,y=!x&&n,b=Math.max(8,.22*p),v=K("relative inline-flex shrink-0",f?"rounded-full":"rounded-lg"),w=K("block object-cover",f?"rounded-full":"rounded-lg"),k=K("flex items-center justify-center font-semibold font-sans select-none",f?"rounded-full":"rounded-lg");/* @__PURE__ */
28
+ return Ye("div",{ref:d,className:le(v,a),style:{width:p,height:p,...l},...s,children:[x?/* @__PURE__ */Ue("img",{src:j(e),alt:j(t),onError:()=>h(!0),className:w,style:{width:p,height:p}}):/* @__PURE__ */Ue("div",{role:"img","aria-label":j(t),className:k,style:{width:p,height:p,backgroundColor:m,color:g,fontSize:.38*p},children:y?j(n).slice(0,2).toUpperCase():/* @__PURE__ */Ye("svg",{width:.5*p,height:.5*p,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ue("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),/* @__PURE__ */Ue("circle",{cx:"12",cy:"7",r:"4"})]})}),i&&/* @__PURE__ */Ue("span",{"aria-label":`Status: ${i}`,className:K("absolute bottom-0 right-0 rounded-full"),style:{width:b,height:b,backgroundColor:Lt[i],border:`2px solid ${c.bg}`}})]})});function Tt({dir:e}){/* @__PURE__ */
29
+ return Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:K("shrink-0"),children:/* @__PURE__ */Ue("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function At({columns:e,data:t,caption:n,sortable:o,stickyHeader:r,isLoading:i,emptyState:a,style:l,className:s,striped:d,maxHeight:c,rowHeight:u=44,virtualScroll:h,onLoadMore:p,hasMore:f,loadingMore:m=!1,onRowClick:g,selectedRows:x,bordered:y,compact:b}){const v=N(),[w,k]=Ve(null),[S,C]=Ve("asc"),$=He(()=>w&&o?[...t].sort((e,t)=>{const n=e[w],o=t[w];let r=0;return"string"==typeof n&&"string"==typeof o?r=n.localeCompare(o):"number"==typeof n&&"number"==typeof o&&(r=n-o),"asc"===S?r:-r}):t,[t,w,S,o]),z=Ae(e=>{w===e?C(e=>"asc"===e?"desc":"asc"):(k(e),C("asc"))},[w]),M=void 0!==h?h:void 0!==c&&$.length>=50,I=Oe(null),[D,W]=Ve(0),[L,R]=Ve(400),T=Ae(()=>{I.current&&W(I.current.scrollTop)},[]);Fe(()=>{if(!M||!I.current)return;const e=I.current;R(e.clientHeight);const t=new ResizeObserver(()=>R(e.clientHeight));return t.observe(e),()=>t.disconnect()},[M]);const A=M?Math.max(0,Math.floor(D/u)-5):0,B=M?Math.min($.length,Math.ceil((D+L)/u)+5):$.length,F=M?$.slice(A,B):$,E=Oe(null),H=Oe(!1);Fe(()=>{H.current=!1},[t.length]),Fe(()=>{if(!p)return;const e=E.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!H.current&&!1!==f&&(H.current=!0,p())},{root:I.current,rootMargin:"0px 0px 200px 0px",threshold:0});return t.observe(e),()=>t.disconnect()},[p,f]);const P=b?"4px":"12px",O=b?"8px":"16px",V=y?`1px solid ${v.border}`:"none",U=He(()=>new Set(x??[]),[x]);/* @__PURE__ */
30
+ return Ue("div",{className:K("w-full rounded-lg",s??""),style:{border:`1px solid ${v.border}`,overflow:"hidden",...l},children:/* @__PURE__ */Ye("div",{ref:I,onScroll:M?T:void 0,style:{overflowX:"auto",overflowY:c?"auto":"visible",maxHeight:c??"none"},children:[
31
+ /* @__PURE__ */Ye("table",{className:K("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:v.text},children:[n&&/* @__PURE__ */Ue("caption",{className:K("text-sm text-left p-2"),style:{color:v.textMuted},children:j(n)}),
32
+ /* @__PURE__ */Ue("thead",{style:r?{position:"sticky",top:0,backgroundColor:v.surfaceAlt,zIndex:1}:{backgroundColor:v.surfaceAlt},children:/* @__PURE__ */Ue("tr",{children:e.map(e=>{const t=o&&!1!==e.sortable,n=(r=e.key,w!==r?"none":S);var r;/* @__PURE__ */
33
+ return Ue("th",{scope:"col","aria-sort":t?"none"===n?"none":"asc"===n?"ascending":"descending":void 0,className:K("text-left font-semibold whitespace-nowrap",t?"cursor-pointer select-none":""),style:{padding:`${P} ${O}`,color:v.textMuted,borderBottom:`2px solid ${v.border}`,borderRight:V,width:e.width},onClick:()=>t&&z(e.key),onKeyDown:n=>{!t||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),z(e.key))},tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("span",{className:K("inline-flex items-center gap-1.5"),children:[j(e.header),t&&/* @__PURE__ */Ue(Tt,{dir:n})]})},String(e.key))})})}),
34
+ /* @__PURE__ */Ue("tbody",{children:i?Array.from({length:5},(t,n)=>/* @__PURE__ */Ue("tr",{children:e.map(e=>/* @__PURE__ */Ue("td",{style:{padding:`${P} ${O}`},children:/* @__PURE__ */Ue(Dt,{variant:"text",height:"16px"})},String(e.key)))},n)):0===$.length?/* @__PURE__ */Ue("tr",{children:/* @__PURE__ */Ue("td",{colSpan:e.length,className:K("text-center"),style:{padding:"32px 16px",color:v.textMuted},children:a??"No data available"})}):/* @__PURE__ */Ye(Ke,{children:[M&&A>0&&/* @__PURE__ */Ue("tr",{"aria-hidden":"true",style:{height:A*u},children:/* @__PURE__ */Ue("td",{colSpan:e.length,style:{padding:0,border:"none"}})}),F.map((t,n)=>{const o=A+n,r=U.has(o);/* @__PURE__ */
35
+ return Ue("tr",{"aria-rowindex":o+1,"aria-selected":r||void 0,onClick:g?()=>g(t,o):void 0,onKeyDown:g?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g(t,o))}:void 0,tabIndex:g?0:void 0,className:K(g?"cursor-pointer":""),style:{backgroundColor:r?`${v.primary}22`:d&&o%2==1?v.surfaceAlt:"transparent",borderBottom:`1px solid ${v.border}`,...M?{height:u,boxSizing:"border-box"}:{}},children:e.map(e=>{const n=t[e.key],o=e.render?e.render(n,t):"string"==typeof n?j(n):String(n??"");/* @__PURE__ */
36
+ return Ue("td",{style:{padding:`${P} ${O}`,color:v.text,borderRight:V},children:o},String(e.key))})},o)}),M&&B<$.length&&/* @__PURE__ */Ue("tr",{"aria-hidden":"true",style:{height:($.length-B)*u},children:/* @__PURE__ */Ue("td",{colSpan:e.length,style:{padding:0,border:"none"}})})]})})]}),(f||m)&&/* @__PURE__ */Ue("div",{ref:E,style:{height:1,width:"100%"},children:m&&/* @__PURE__ */Ue("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ue("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ue("tr",{children:e.map(e=>/* @__PURE__ */Ue("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ue(Dt,{variant:"text",height:"16px"})},String(e.key)))},n))})})}),!f&&p&&/* @__PURE__ */Ue("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:v.textMuted},children:"✓ All rows loaded"})]})})}Rt.displayName="TkxAvatar";var Bt=Te(({orientation:e="horizontal",label:t,variant:n="solid",className:o,style:r,...i},a)=>{const l=N(),s=t?j(t):void 0,d="vertical"===e,c=d?"borderLeft":"borderTop",u=`1px ${n} ${l.border}`;return s?/* @__PURE__ */Ye("div",{role:"separator","aria-orientation":e,className:le(K("flex items-center gap-3 text-xs"),o),style:{color:l.textMuted,...r},...i,children:[
37
+ /* @__PURE__ */Ue("hr",{className:K("flex-1 m-0 border-none"),style:{[c]:u}}),
38
+ /* @__PURE__ */Ue("span",{children:s}),
39
+ /* @__PURE__ */Ue("hr",{className:K("flex-1 m-0 border-none"),style:{[c]:u}})]}):/* @__PURE__ */Ue("hr",{ref:a,role:"separator","aria-orientation":e,className:le(K(d?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),o),style:{[c]:u,...r},...i})});Bt.displayName="TkxDivider";var Ft={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 Et(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function jt({size:e,color:t}){/* @__PURE__ */
40
+ return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[/* @__PURE__ */Ue("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),/* @__PURE__ */Ue("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function Ht({options:e,value:t,defaultValue:n,placeholder:o,size:r="md",isDisabled:i=!1,isInvalid:a=!1,label:l,hint:s,errorMessage:d,multiple:c=!1,searchable:u=!1,clearable:h=!1,isLoading:p=!1,onChange:f,renderOption:m,maxMenuHeight:g=280,virtualScroll:x,optionHeight:y=36,id:b,className:v,style:w}){const k=N(),S=$e(),C=o??S.selectPlaceholder,$=Ee(),z=b??$,M=`${z}-listbox`,I=`${z}-hint`,D=`${z}-error`,W=void 0!==t,[L,R]=Ve(Et(n)),T=W?Et(t):L,[A,B]=Ve(!1),[F,E]=Ve(""),[H,P]=Ve(-1),[O,V]=Ve(null),[U,Y]=Ve(""),X=Oe(null),q=Oe(null),_=Oe(null),Z=Oe(null),G=Oe(null),J=Ft[r],Q=a||!!d,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Fe(()=>{if(!A)return void ne(0);const e=ee.current;if(!e)return;re(e.clientHeight);const t=new ResizeObserver(()=>{re(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[A]);const ae=u&&F?e.filter(e=>e.label.toLowerCase().includes(F.toLowerCase())):e,se=ae.filter(e=>!e.disabled),de=ae.some(e=>!!e.group),ce=(void 0!==x?x:ae.length>=100)&&!de,ue=ae.length*y,he=ce?Math.max(0,Math.floor(te/y)-8):0,pe=ce?Math.min(ae.length,Math.ceil((te+oe)/y)+8):ae.length,fe=ce?ae.slice(he,pe):ae,me=he*y,ge=ae.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),xe=Ae(e=>{let t;t=c?T.includes(e)?T.filter(t=>t!==e):[...T,e]:[e],W||R(t),f?.(c?t:t[0]??""),c||(B(!1),E(""),P(-1),q.current?.focus())},[W,c,f,T]),ye=Ae((e,t)=>{t.stopPropagation();const n=T.filter(t=>t!==e);W||R(n),f?.(c?n:n[0]??"")},[W,c,f,T]),be=Ae(e=>{e.stopPropagation(),W||R([]),f?.(c?[]:"")},[W,c,f]),ve=Ae(()=>{q.current&&A&&V(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight-n.bottom-6,r=n.top-6,i=o>=Math.min(t,200)||o>=r?"below":"above";return{top:"below"===i?n.bottom+window.scrollY+6:n.top+window.scrollY-6-Math.min(t,280),left:n.left+window.scrollX,width:n.width,placement:i}}(q.current,g))},[A,g]);function we(){if(i||p)return;B(!0);const e=se.findIndex(e=>T.includes(e.value));P(e>=0?e:0)}Fe(()=>{if(A)return ve(),window.addEventListener("scroll",ve,!0),window.addEventListener("resize",ve),()=>{window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",ve)}},[A,ve]),Fe(()=>{if(!A)return;const e=e=>{const t=e.target;q.current?.contains(t)||Z.current?.contains(t)||(B(!1),E(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[A]),Fe(()=>{A&&u&&setTimeout(()=>_.current?.focus(),0)},[A,u]),Fe(()=>{if(A&&!(H<0))if(ce&&ee.current){const e=H*y,t=e+y,n=ee.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(G.current?.querySelector(`[data-idx="${H}"]`))?.scrollIntoView({block:"nearest"})},[H,A,ce,y]);const ke=Q?k.danger:A?k.primary:k.border,Se=H>=0&&se[H]?`${z}-opt-${se[H].value}`:void 0,Ce=[s&&I,Q&&D].filter(Boolean).join(" ")||void 0,ze=T.map(t=>e.find(e=>e.value===t)).filter(Boolean),Ne=A&&O?Xe(/* @__PURE__ */Ye("div",{ref:Z,role:"listbox",id:M,"aria-label":l?j(l):"Options","aria-multiselectable":c,style:{position:"absolute",top:O.top,left:O.left,width:O.width,zIndex:9999,backgroundColor:k.surface,border:`1.5px solid ${k.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:O.width,maxHeight:g,display:"flex",flexDirection:"column"},children:[u&&/* @__PURE__ */Ye("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${k.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ue("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ue("path",{d:"M21 21l-4.35-4.35"})]}),/* @__PURE__ */Ue("input",{ref:_,type:"text",value:F,onChange:e=>{E(e.target.value),P(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),B(!1),E(""),q.current?.focus();break;case"ArrowDown":e.preventDefault(),P(e=>Math.min(e+1,se.length-1));break;case"ArrowUp":e.preventDefault(),P(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),P(0);break;case"End":e.preventDefault(),P(se.length-1);break;case"Enter":e.preventDefault(),H>=0&&se[H]&&xe(se[H].value)}},placeholder:`${S.search}…`,"aria-label":`${S.search} options`,style:{border:"none",outline:"none",background:"transparent",color:k.text,fontSize:J.fontSize,fontFamily:"inherit",width:"100%"}})]}),/* @__PURE__ */Ue("div",{ref:e=>{G.current=e,ee.current=e},onScroll:ce?ie:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:g-(u?48:0)},children:ce?/* @__PURE__ */Ye("div",{style:{height:ue,position:"relative"},children:[/* @__PURE__ */Ue("div",{style:{position:"absolute",top:me,left:0,right:0},children:fe.map(e=>{const t=se.indexOf(e),n=t===H,o=T.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ue("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.label)})]}),e.description&&/* @__PURE__ */Ue("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.description)})]});/* @__PURE__ */
41
+ return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{height:y,boxSizing:"border-box",padding:`0 ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[r,o&&!m&&/* @__PURE__ */Ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===ae.length&&/* @__PURE__ */Ue("div",{style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:p?"Loading…":"No options found"})]}):/* @__PURE__ */Ye(Ke,{children:[Object.entries(ge).map(([e,t])=>/* @__PURE__ */Ye("div",{children:[e&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:k.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:k.surface,zIndex:1,borderBottom:`1px solid ${k.border}`},children:j(e)}),t.map(e=>{const t=se.indexOf(e),n=t===H,o=T.includes(e.value),r=m?m(e,o):/* @__PURE__ */Ye("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),/* @__PURE__ */Ue("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.label)})]}),e.description&&/* @__PURE__ */Ue("span",{style:{fontSize:"12px",color:k.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.description)})]});/* @__PURE__ */
42
+ return Ye("div",{id:`${z}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":o,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&xe(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&P(t),style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:e.disabled?k.textMuted:k.text,backgroundColor:n?`${k.primary}22`:o?`${k.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[r,o&&!m&&/* @__PURE__ */Ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:k.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===ae.length&&/* @__PURE__ */Ue("div",{style:{padding:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",color:k.textMuted,textAlign:"center"},children:p?"Loading…":"No options found"})]})})]}),document.body):null,Me=h&&T.length>0&&!i&&!p;/* @__PURE__ */
43
+ return Ye("div",{className:le(K("flex flex-col gap-1 w-full"),v),style:w,children:[l&&/* @__PURE__ */Ue("label",{htmlFor:z,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:k.text,userSelect:"none"},children:j(l)}),
44
+ /* @__PURE__ */Ue("div",{style:{position:"relative",width:"100%",opacity:i?.55:1},children:/* @__PURE__ */Ye("button",{ref:q,id:z,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":A,"aria-controls":M,"aria-activedescendant":Se,"aria-invalid":Q||void 0,"aria-describedby":Ce,"aria-multiselectable":c,disabled:i,onClick:()=>A?B(!1):we(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),A?H>=0&&se[H]&&xe(se[H].value):we();break;case"Escape":e.preventDefault(),B(!1),E("");break;case"ArrowDown":e.preventDefault(),A?P(e=>Math.min(e+1,se.length-1)):we();break;case"ArrowUp":e.preventDefault(),A?P(e=>Math.max(e-1,0)):we();break;case"Home":e.preventDefault(),A&&P(0);break;case"End":e.preventDefault(),A&&P(se.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(A||we(),function(e){X.current&&clearTimeout(X.current);const t=U+e.toLowerCase();Y(t);const n=se.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&P(n),X.current=setTimeout(()=>Y(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:c&&T.length>0?`4px ${J.px}`:`${J.py} ${J.px}`,fontSize:J.fontSize,fontFamily:"inherit",backgroundColor:k.surface,color:T.length>0?k.text:k.textMuted,border:`1.5px solid ${ke}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:i?"not-allowed":"pointer",outline:"none",minHeight:"sm"===r?34:"lg"===r?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[/* @__PURE__ */Ue("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:c&&ze.length>0?ze.map(e=>/* @__PURE__ */Ye("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${J.tagPy} ${J.tagPx}`,fontSize:`calc(${J.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${k.primary}22`,color:k.primary,borderRadius:6,border:`1px solid ${k.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[/* @__PURE__ */Ue("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:j(e.label)}),/* @__PURE__ */Ue("span",{role:"button","aria-label":`Remove ${j(e.label)}`,tabIndex:-1,onClick:t=>ye(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:/* @__PURE__ */Ue("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!c&&T.length>0?(()=>{const t=e.find(e=>e.value===T[0]);/* @__PURE__ */
45
+ return Ye("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?j(t.label):""]})})():/* @__PURE__ */Ue("span",{style:{opacity:.6},children:j(C)})}),/* @__PURE__ */Ye("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:k.textMuted},children:[p&&/* @__PURE__ */Ue(jt,{size:J.iconSize,color:k.primary}),Me&&!p&&/* @__PURE__ */Ue("span",{role:"button","aria-label":S.clearSelection,tabIndex:-1,onClick:be,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.7",children:/* @__PURE__ */Ue("svg",{width:J.iconSize,height:J.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M18 6L6 18M6 6l12 12"})})}),
46
+ /* @__PURE__ */Ue("svg",{width:J.iconSize,height:J.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:A?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M6 9l6 6 6-6"})})]})]})}),s&&!Q&&/* @__PURE__ */Ue("span",{id:I,style:{fontSize:"12px",color:k.textMuted,fontFamily:"inherit"},children:j(s)}),Q&&d&&/* @__PURE__ */Ye("span",{id:D,role:"alert",style:{fontSize:"12px",color:k.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})}),j(d)]}),Ne]})}Ht.displayName="TkxSelect";var Pt={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},Ot=Te(({label:e,hint:t,isInvalid:n,errorMessage:o,isIndeterminate:r=!1,size:i="md",colorScheme:a="primary",checked:l,defaultChecked:s,onChange:d,disabled:c,className:u,style:h,id:p,...f},m)=>{const g=N(),x=ge(),y=Ee(),b=p??y,v=`${b}-hint`,w=`${b}-error`,k=Oe(null),[S,C]=Ve(!1),$=Pt[i],z=n||!!o,M={primary:g.primary,success:g.success,danger:g.danger,warning:g.warning}[a]??g.primary,I=void 0!==l?l:void 0;Fe(()=>{const e=m?.current??k.current;e&&(e.indeterminate=r)},[r,m]);const D=r||(I??!1),W=D?M:g.surface,L=z?g.danger:D?M:g.border,R=A(M),T=S?{outline:`2px solid ${M}`,outlineOffset:"2px"}:{},B=[t&&v,z&&w].filter(Boolean).join(" ")||void 0,F=!x&&D?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};/* @__PURE__ */
47
+ return Ye("div",{className:le(K("flex flex-col gap-1"),u),style:{opacity:c?.5:1,...h},children:[
48
+ /* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-check-scale-in {\n from { transform: scale(0.4); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n }\n "}),
49
+ /* @__PURE__ */Ye("label",{htmlFor:b,className:K("flex items-center gap-2 select-none"),style:{cursor:c?"not-allowed":"pointer",fontFamily:"inherit"},children:[
50
+ /* @__PURE__ */Ue("input",{ref:e=>{k.current=e,"function"==typeof m?m(e):m&&(m.current=e)},id:b,type:"checkbox",checked:l,defaultChecked:s,onChange:d,disabled:c,"aria-invalid":z,"aria-describedby":B,onFocus:e=>{e.target.matches(":focus-visible")&&C(!0)},onBlur:()=>C(!1),className:K("sr-only"),...f}),
51
+ /* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{width:$.box,height:$.box,minWidth:$.box,borderRadius:"4px",border:`2px solid ${L}`,backgroundColor:W,display:"flex",alignItems:"center",justifyContent:"center",transition:x?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...T},children:r?/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"block",width:.5*$.box,height:2,backgroundColor:R,borderRadius:"1px",...F}}):D?/* @__PURE__ */Ue("svg",{width:.6*$.box,height:.6*$.box,viewBox:"0 0 24 24",fill:"none",stroke:R,strokeWidth:$.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:F,children:/* @__PURE__ */Ue("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&/* @__PURE__ */Ue("span",{style:{fontSize:$.fontSize,color:g.text,lineHeight:1.4},children:"string"==typeof e?j(e):e})]}),t&&!z&&/* @__PURE__ */Ue("span",{id:v,className:K("text-xs ml-7"),style:{color:g.textMuted,marginLeft:$.box+8},children:j(t)}),z&&o&&/* @__PURE__ */Ye("span",{id:w,role:"alert",className:K("text-xs flex items-center gap-1"),style:{color:g.danger,marginLeft:$.box+8},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})}),j(o)]})]})});Ot.displayName="TkxCheckbox";var Vt=Le(null),Kt={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},Ut=Te(({label:e,hint:t,size:n="md",colorScheme:o="primary",value:r,checked:i,onChange:a,disabled:l,name:s,className:d,style:c,id:u,...h},p)=>{const f=N(),m=ge(),g=Ee(),x=u??g,y=Be(Vt),b=y?y.value===String(r??""):i??!1,v=l??y?.isDisabled??!1,w=s??y?.name??"",k=Kt[n],S={primary:f.primary,success:f.success,danger:f.danger}[o]??f.primary;A(S);const C=b?S:f.border,$=f.surface;/* @__PURE__ */
52
+ return Ye("div",{className:le(K("flex flex-col gap-0.5"),d),style:{opacity:v?.5:1,...c},children:[
53
+ /* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-radio-dot-in {\n from { transform: scale(0) translate(-50%, -50%); opacity: 0; }\n to { transform: scale(1) translate(-50%, -50%); opacity: 1; }\n }\n "}),
54
+ /* @__PURE__ */Ye("label",{htmlFor:x,className:K("flex items-center gap-2 select-none"),style:{cursor:v?"not-allowed":"pointer",fontFamily:"inherit"},children:[
55
+ /* @__PURE__ */Ue("input",{ref:p,id:x,type:"radio",name:w,value:r,checked:b,onChange:()=>{v||(y?y.onChange(String(r??"")):a?.({target:{value:String(r??"")}}))},disabled:v,"aria-invalid":y?.isInvalid,className:K("sr-only"),...h}),
56
+ /* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{position:"relative",width:k.outer,height:k.outer,minWidth:k.outer,borderRadius:"50%",border:`2px solid ${C}`,backgroundColor:$,display:"inline-block",boxSizing:"border-box",transition:m?"none":"border-color 120ms"},children:b&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:k.inner,height:k.inner,borderRadius:"50%",backgroundColor:S,transform:"translate(-50%, -50%)",transformOrigin:"center",...m?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&/* @__PURE__ */Ue("span",{style:{fontSize:k.fontSize,color:f.text,lineHeight:1.4},children:"string"==typeof e?j(e):e})]}),t&&/* @__PURE__ */Ue("span",{className:K("text-xs"),style:{color:f.textMuted,marginLeft:k.outer+8},children:j(t)})]})});function Yt({name:e,value:t,defaultValue:n="",onChange:o,label:r,orientation:i="vertical",isDisabled:a=!1,isInvalid:l=!1,errorMessage:s,children:d}){const c=N(),u=`${Ee()}-error`,[h,p]=Ve(n),f=void 0!==t,m=f?t:h,g=l||!!s;/* @__PURE__ */
57
+ return Ue(Vt.Provider,{value:{name:e,value:m,onChange:e=>{f||p(e),o?.(e)},isDisabled:a,isInvalid:l},children:/* @__PURE__ */Ye("div",{role:"radiogroup","aria-label":r?j(r):void 0,"aria-describedby":g?u:void 0,"aria-invalid":g,children:[r&&/* @__PURE__ */Ue("div",{className:K("text-sm font-medium font-sans mb-2"),style:{color:c.text},children:j(r)}),
58
+ /* @__PURE__ */Ue("div",{className:K("horizontal"===i?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:d}),g&&s&&/* @__PURE__ */Ye("span",{id:u,role:"alert",className:K("text-xs flex items-center gap-1 mt-1"),style:{color:c.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})}),j(s)]})]})})}Ut.displayName="TkxRadio";var Xt=[],qt=[],_t=/* @__PURE__ */new Set,Zt=/* @__PURE__ */new Map;function Gt(){const e=[...qt];_t.forEach(t=>t(e))}function Jt(e,t){0!==t&&Zt.set(e,setTimeout(()=>Qt(e),t))}function Qt(e){clearTimeout(Zt.get(e)),Zt.delete(e);const t=qt.some(t=>t.id===e);if(qt=qt.filter(t=>t.id!==e),Xt=Xt.filter(t=>t.id!==e),t&&Xt.length>0&&qt.length<5){const e=Xt.shift();qt=[...qt,e],Jt(e.id,e.duration??4e3)}Gt()}function en(){return{toast:Ae(e=>function(e){const t=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:t,duration:e.duration??4e3};return qt.length<5?(qt=[...qt,n],Jt(t,n.duration)):Xt=[...Xt,n],Gt(),t}(e),[]),dismiss:Ae(e=>Qt(e),[]),dismissAll:Ae(()=>(Zt.forEach(e=>clearTimeout(e)),Zt.clear(),qt=[],Xt=[],void Gt()),[])}}var tn={default:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})})},nn={"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 on(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function rn({toast:e,position:t,onDismiss:n,reduced:o}){const r=N(),i=$e(),a=Ee(),l={default:r.textMuted,success:r.success,danger:r.danger,warning:r.warning,info:r.info},s=e.variant??"default",d=l[s],c="danger"===s,u=e.title?j(e.title):void 0,h=e.description?j(e.description):void 0;/* @__PURE__ */
59
+ return Ye("div",{role:c?"alert":"status","aria-live":c?"assertive":"polite","aria-atomic":"true","aria-labelledby":u?a:void 0,className:K("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:r.surface,border:`1px solid ${d}55`,boxShadow:`0 8px 24px ${r.bg}cc`,color:r.text,...on(t,o)},children:[
60
+ /* @__PURE__ */Ue("span",{className:K("shrink-0 mt-[2px]"),style:{color:d},children:tn[s]}),
61
+ /* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[u&&/* @__PURE__ */Ue("p",{id:a,className:K("m-0 font-semibold text-sm leading-snug"),children:u}),h&&/* @__PURE__ */Ue("p",{className:K("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:r.textMuted},children:h}),e.action&&/* @__PURE__ */Ue("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:K("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:d},children:j(e.action.label)})]}),
62
+ /* @__PURE__ */Ue("button",{"aria-label":i.close,onClick:()=>n(e.id),className:K("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:r.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function an({position:e="top-right",children:t}){const[n,o]=Ve([...qt]),r=ge(),i=$e();Fe(()=>{o([...qt]);const e=e=>o([...e]);return _t.add(e),()=>{_t.delete(e)}},[]);const a=e.startsWith("bottom"),l=nn[e],s=Oe(!1);if(Fe(()=>{if(!s.current&&"undefined"!=typeof document&&(s.current=!0,!document.getElementById("tkx-toast-kf"))){const e=document.createElement("style");e.id="tkx-toast-kf",e.textContent="\n @keyframes tkx-toast-slide-down {\n from { opacity: 0; transform: translateY(-16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-toast-slide-up {\n from { opacity: 0; transform: translateY(16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}},[]),"undefined"==typeof document)/* @__PURE__ */return Ue(Ke,{children:t});const d=a?[...n].reverse():n;/* @__PURE__ */
63
+ return Ye(Ke,{children:[t,Xe(/* @__PURE__ */Ue("div",{"aria-label":i.notifications??"Notifications",className:K("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:d.map(t=>/* @__PURE__ */Ue("div",{className:K("pointer-events-auto"),children:/* @__PURE__ */Ue(rn,{toast:t,position:e,onDismiss:Qt,reduced:r})},t.id))}),document.body)]})}var ln={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 sn({open:e,reduced:t,iconStyle:n,size:o,color:r}){const i=t?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return"chevron"===n?/* @__PURE__ */Ue("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:i,flexShrink:0},children:/* @__PURE__ */Ue("polyline",{points:"6 9 12 15 18 9"})}):/* @__PURE__ */Ye("svg","plus"===n?{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[/* @__PURE__ */Ue("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}:{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),/* @__PURE__ */Ue("polyline",{points:"12 5 19 12 12 19"})]})}function dn({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=Oe(null),a=Oe(null),l=Oe(e),s=Oe(!1);return Fe(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),Fe(()=>{if(l.current===e)return;l.current=e;const n=i.current,o=a.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(s.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}s.current=!0,n.style.overflow="hidden",e?(n.style.height="0px",n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`${o.scrollHeight}px`})})):(n.style.height=`${o.scrollHeight}px`,n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height="0px"})}))}},[e,t]),/* @__PURE__ */Ue("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;s.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:/* @__PURE__ */Ue("div",{ref:a,children:n})})}function cn({items:e,multiple:t=!1,defaultOpen:n,value:o,onChange:r,variant:i="default",size:a="md",iconPosition:l="right",iconStyle:s="chevron",flush:d=!1,className:c,style:u}){const h=N(),p=ge(),f=Ee(),m=void 0!==o,g=e=>e?Array.isArray(e)?new Set(e):new Set([e]):/* @__PURE__ */new Set,[x,y]=Ve(()=>g(n)),b=m?g(o):x,v=Ae((e,n)=>{if(n)return;let i;if(!m)return void y(n=>{i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e));const o=[...i];return r?.(t?o:o[0]??""),i});{const n=g(o);i=new Set(n),i.has(e)?i.delete(e):(t||i.clear(),i.add(e))}const a=[...i];r?.(t?a:a[0]??"")},[t,r,m,o]),w=ln[a],k=(e,t,n)=>{if(d)return{};switch(i){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${h.border}`};case"separated":return{border:`1px solid ${h.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};default:return{}}},S="separated"===i;/* @__PURE__ */
64
+ return Ue("div",{className:K(c??""),style:{...d?{}:"bordered"===i?{border:`1px solid ${h.border}`,borderRadius:"10px",overflow:"hidden"}:{},display:S?"flex":void 0,flexDirection:S?"column":void 0,gap:S?"8px":void 0,...u},children:e.map((t,n)=>{const o=b.has(t.id),r=n===e.length-1,a=`${f}-trigger-${t.id}`,d=`${f}-panel-${t.id}`;/* @__PURE__ */
65
+ return Ye("div",{className:t.className,style:k(0,0,r),children:[/* @__PURE__ */Ye("button",{id:a,type:"button",role:"button","aria-expanded":o,"aria-controls":d,disabled:t.disabled,onClick:()=>v(t.id,t.disabled),style:{width:"100%",display:"flex",alignItems:t.subtitle?"flex-start":"center",gap:"8px",padding:w.triggerPadding,border:"none",background:"transparent",cursor:t.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:w.fontSize,fontWeight:500,color:t.disabled?h.textMuted:h.text,opacity:t.disabled?.5:1,transition:p?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=(e=>"ghost"===i||"flush"===i?e?`${h.primary}10`:`${h.surfaceAlt}80`:e?`${h.primary}0d`:`${h.surfaceAlt}60`)(o))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${h.primary}0d`:"transparent"},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${h.primary}`,e.currentTarget.style.outlineOffset="2px")},onBlur:e=>{e.currentTarget.style.outline="none"},children:[t.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:h.primary,marginTop:t.subtitle?"1px":void 0},children:t.icon}),"left"===l&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?h.primary:h.textMuted,marginTop:t.subtitle?"1px":void 0},children:/* @__PURE__ */Ue(sn,{open:o,reduced:p,iconStyle:s,size:w.iconSize,color:o?h.primary:h.textMuted})}),
66
+ /* @__PURE__ */Ye("span",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ue("span",{style:{display:"block",lineHeight:1.4},children:t.title}),t.subtitle&&/* @__PURE__ */Ue("span",{style:{display:"block",fontSize:w.subtitleSize,color:h.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:t.subtitle})]}),t.badge&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:t.badge}),"right"===l&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?h.primary:h.textMuted,marginTop:t.subtitle?"1px":void 0},children:/* @__PURE__ */Ue(sn,{open:o,reduced:p,iconStyle:s,size:w.iconSize,color:o?h.primary:h.textMuted})})]}),/* @__PURE__ */Ue(dn,{isOpen:o,reduced:p,id:d,triggerId:a,children:/* @__PURE__ */Ue("div",{style:{padding:w.contentPadding,fontSize:w.fontSize,lineHeight:1.6,color:h.textMuted,fontFamily:"inherit"},children:t.content})})]},t.id)})})}cn.displayName="TkxAccordion";var un={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"},hn=0;function pn(){--hn<=0&&(hn=0,document.body.style.overflow="")}function fn(){/* @__PURE__ */
67
+ return Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function mn({isOpen:e,onClose:t,placement:n="right",size:o="md",title:r,children:i,footer:a,closeOnOverlayClick:l=!0,closeOnEsc:s=!0}){const d=N(),c=ge(),u=Ee(),h=fe(e);if(xe(t,s&&e),Fe(()=>{if(e){if(1===++hn&&(document.body.style.overflow="hidden"),he())try{window.dispatchEvent(new CustomEvent("tkx:framed-drawer",{detail:{placement:n,at:Date.now()}}))}catch{}}else pn();return()=>{e&&pn()}},[e,n]),"undefined"==typeof document)return null;const p=function(e,t){const n=un[t],o={position:"absolute"};return"left"===e||"right"===e?{...o,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...o,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}(n,o),f=function(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}(n),m=c?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",g="string"==typeof r?j(r):r;return Xe(/* @__PURE__ */Ye("div",{role:"presentation",className:K("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[/* @__PURE__ */Ue("div",{"aria-hidden":"true",onClick:l?t:void 0,className:K("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:c?"none":"opacity 280ms ease",cursor:l?"pointer":"default"}}),/* @__PURE__ */Ye("div",{ref:h,role:"dialog","aria-modal":"true","aria-labelledby":r?u:void 0,className:K("absolute flex flex-col font-sans"),style:{...p,backgroundColor:d.surface,borderLeft:"right"===n?`1px solid ${d.border}`:void 0,borderRight:"left"===n?`1px solid ${d.border}`:void 0,borderTop:"bottom"===n?`1px solid ${d.border}`:void 0,borderBottom:"top"===n?`1px solid ${d.border}`:void 0,boxShadow:`0 20px 60px ${d.bg}99`,transform:e?"translate(0,0)":f,opacity:e?1:0,transition:m,willChange:"transform"},children:[void 0!==r&&/* @__PURE__ */Ye("div",{className:K("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${d.border}`},children:[/* @__PURE__ */Ue("h2",{id:u,className:K("m-0 text-base font-semibold leading-snug"),style:{color:d.text},children:g}),/* @__PURE__ */Ue("button",{onClick:t,"aria-label":"Close drawer",className:K("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ue(fn,{})})]}),void 0===r&&/* @__PURE__ */Ue("div",{className:K("flex justify-end px-3 pt-3 shrink-0"),children:/* @__PURE__ */Ue("button",{onClick:t,"aria-label":"Close drawer",className:K("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:d.textMuted},children:/* @__PURE__ */Ue(fn,{})})}),
68
+ /* @__PURE__ */Ue("div",{className:K("flex-1 overflow-y-auto px-5 py-4"),style:{color:d.text},children:i}),a&&/* @__PURE__ */Ue("div",{className:K("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${d.border}`},children:a})]})]}),document.body)}var gn=["Su","Mo","Tu","We","Th","Fr","Sa"],xn=["January","February","March","April","May","June","July","August","September","October","November","December"],yn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function bn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function vn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function wn(e,t,n){return!(!t||!bn(e,t))||!(!n||!bn(e,n))}function kn(e,t="en-US",n){if(!e)return"";if(n){const t=String(e.getFullYear()),o=t.slice(-2),r=e.getMonth()+1,i=String(r).padStart(2,"0"),a=yn[e.getMonth()],l=xn[e.getMonth()],s=e.getDate(),d=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,o).replace(/MMMM/g,l).replace(/MMM/g,a).replace(/MM/g,i).replace(/\bM\b/g,String(r)).replace(/DD/g,d).replace(/\bD\b/g,String(s))}return e.toLocaleDateString(t,{month:"2-digit",day:"2-digit",year:"numeric"})}function Sn(e,t){return new Date(e,t+1,0).getDate()}function Cn(e){return 10*Math.floor(e/10)}function $n({values:e,selected:t,onSelect:n,label:o,theme:r,format:i}){const a=Oe([]),l=Oe(null);Fe(()=>{const e=a.current[t];e&&l.current&&e.scrollIntoView({block:"nearest"})},[t]);const s=i??(e=>String(e).padStart(2,"0"));/* @__PURE__ */
69
+ return Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[/* @__PURE__ */Ue("div",{style:{fontSize:"11px",fontWeight:600,color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),/* @__PURE__ */Ue("div",{ref:l,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${r.border}`,borderRadius:"8px",padding:"4px"},children:e.map(e=>{const o=e===t;/* @__PURE__ */
70
+ return Ue("button",{ref:t=>{a.current[e]=t},type:"button",onClick:()=>n(e),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?r.primary:"transparent",color:o?r.bg:r.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:s(e)},e)})})]})}function zn({year:e,month:t,today:n,mode:o,selectedDate:r,selectedRange:i,multiDates:a,hoverDate:l,focusedDate:s,isDateDisabled:d,onSelectDate:c,onHoverDate:u,onSetFocused:h,theme:p,locale:f}){const m=function(e,t){const n=new Date(e,t,1).getDay(),o=Sn(e,t),r=[],i=Sn(e,t-1);for(let l=n-1;l>=0;l--)r.push(new Date(e,t-1,i-l));for(let l=1;l<=o;l++)r.push(new Date(e,t,l));let a=1;for(;r.length<42;)r.push(new Date(e,t+1,a++));return r}(e,t);/* @__PURE__ */
71
+ return Ye("div",{children:[/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:gn.map(e=>/* @__PURE__ */Ue("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:p.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:m.map((e,m)=>{const g=e.getMonth()===t,x=bn(e,n),y=0===e.getDay()||6===e.getDay(),b=d(e),v="single"===o&&null!=r&&bn(e,r),w="multiple"===o&&a.some(t=>bn(t,e)),k="range"===o&&wn(e,i[0],null),S="range"===o&&wn(e,null,i[1]),C=k||S,$="range"===o&&i[0]&&!i[1]&&l?l:i[1],z="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=vn(e).getTime(),r=vn(t).getTime(),i=vn(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],$),N="range"===o&&i[0]&&!i[1]&&l&&bn(e,l),M=v||w||C,I=null!=s&&bn(e,s);let D="transparent",W=g?y?`${p.text}cc`:p.text:`${p.textMuted}60`,L="none",R=400;return M||N?(D=p.primary,W=p.bg,R=600):z&&(D=`${p.primary}18`),x&&!M&&(L=`2px solid ${p.primary}`,R=600),b&&(W=`${p.textMuted}50`),I&&!M&&(L=`2px solid ${p.secondary}`),/* @__PURE__ */Ue("button",{type:"button","aria-label":e.toLocaleDateString(f,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":M,"aria-disabled":b,disabled:b,onClick:()=>!b&&c(e),onMouseEnter:()=>u(e),onMouseLeave:()=>u(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:W,border:L,fontSize:"13px",fontWeight:R,cursor:b?"not-allowed":"pointer",opacity:b?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:b?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},m)})})]})}function Nn({value:e,onChange:t,rangeValue:n,onRangeChange:o,multiValue:r,onMultiChange:i,mode:a="single",minDate:l,maxDate:s,disabledDates:d,locale:c="en-US",dateFormat:u,showTime:h=!1,timeValue:p,onTimeChange:f,showPresets:m=!1,customPresets:g,label:x,placeholder:y="MM/DD/YYYY",hint:b,isDisabled:v=!1,isInvalid:w=!1,errorMessage:k,numberOfMonths:S=1,id:C,className:$,style:z}){const M=N(),I=$e(),D=Ee(),W=C??D,L=ge(),R=vn(/* @__PURE__ */new Date),T=void 0!==e,[A,B]=Ve(null),F=T?e??null:A,E=void 0!==n,[H,P]=Ve([null,null]),O=E?n:H,V=void 0!==r,[K,U]=Ve([]),Y=V?r:K,[X,q]=Ve("start"),_="range"===a||"single"===a&&h,[Z,G]=Ve([null,null]),[J,Q]=Ve(null),ee=F??O[0]??R,[te,ne]=Ve(ee.getFullYear()),[oe,re]=Ve(ee.getMonth()),[ie,ae]=Ve("day"),[le,se]=Ve({h:0,m:0}),de=p??le,[ce,ue]=Ve(!1),[he,pe]=Ve(()=>{if("single"===a)return kn(F,c,u);if("range"===a){const[e,t]=O;if(e&&t)return`${kn(e,c,u)} – ${kn(t,c,u)}`}return""}),[fe,me]=Ve(null),[xe,ye]=Ve(null),[be,ve]=Ve({top:0,left:0,flipUp:!1}),[,we]=Pe(e=>e+1,0),ke=Oe(null),Se=Oe(null),Ce=Oe(null),ze=m?420:h?480:360;Fe(()=>{if("single"===a)pe(kn(F,c,u));else if("range"===a){const[e,t]=O;pe(e&&t?`${kn(e,c,u)} – ${kn(t,c,u)}`:e?kn(e,c,u):"")}else"multiple"===a&&pe(Y.length>0?`${Y.length} date${1!==Y.length?"s":""} selected`:"")},[F,O,Y,a,c,u]);const Ne=Ae(()=>{ke.current&&ve(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,a=o-n.bottom<t+8&&n.top>t+8;return{top:a?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:a}}(ke.current,ze))},[ze]);Fe(()=>{if(ce)return Ne(),window.addEventListener("scroll",Ne,!0),window.addEventListener("resize",Ne),()=>{window.removeEventListener("scroll",Ne,!0),window.removeEventListener("resize",Ne)}},[ce,Ne]),Fe(()=>{if(!ce)return;const e=e=>{ke.current?.contains(e.target)||Se.current?.contains(e.target)||ue(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[ce]),Fe(()=>{if(!ce)return;const e=e=>{"Escape"===e.key&&(ue(!1),Ce.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ce]);const Me=Ae(e=>!!(l&&vn(e)<vn(l))||!!(s&&vn(e)>vn(s))||!!d&&("function"==typeof d?d(e):d.some(t=>bn(t,e))),[l,s,d]),Ie=Ae(e=>{if(!Me(e)){if("single"===a)_?Q(e):(T||B(e),t?.(e),pe(kn(e,c,u)),ue(!1));else if("range"===a)if("start"===X){const t=[e,null];G(t),E||P(t),o?.(t),q("end")}else{const t=Z[0]??O[0],n=t&&e<t?[e,t]:[t,e];G(n),_?q("start"):(E||P(n),o?.(n),q("start"),ue(!1))}else if("multiple"===a){const t=Y.some(t=>bn(t,e))?Y.filter(t=>!bn(t,e)):[...Y,e];V||U(t),i?.(t)}we()}},[a,Me,T,E,V,t,o,i,X,Z,O,Y,_,c]),De=Ae(()=>{if("single"===a){const e=J??F;T||B(e),t?.(e)}else"range"===a&&(E||P(Z),o?.(Z));ue(!1),q("start")},[a,J,Z,F,T,E,t,o]),We=Ae(()=>{Q(null),G([null,null]),q("start"),ue(!1)},[]),Le=g??function(e){const t={today:e?.today??"Today",yesterday:e?.yesterday??"Yesterday",last7:e?.last7Days??"Last 7 days",last30:e?.last30Days??"Last 30 days",last90:"Last 90 days",thisWeek:"This week",lastWeek:"Last week",thisMonth:e?.thisMonth??"This month",lastMonth:e?.lastMonth??"Last month"};return[{label:t.today,getValue:()=>{const e=vn(/* @__PURE__ */new Date);return[e,e]}},{label:t.yesterday,getValue:()=>{const e=vn(/* @__PURE__ */new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:t.last7,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:t.last30,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:t.last90,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:t.thisWeek,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay());const n=new Date(t);return n.setDate(n.getDate()+6),[t,n]}},{label:t.lastWeek,getValue:()=>{const e=vn(/* @__PURE__ */new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay()-1);const n=new Date(t);return n.setDate(n.getDate()-6),[n,t]}},{label:t.thisMonth,getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:t.lastMonth,getValue:()=>{const e=/* @__PURE__ */new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=/* @__PURE__ */new Date,t=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),3*t,1),new Date(e.getFullYear(),3*t+3,0)]}},{label:"Last quarter",getValue:()=>{const e=/* @__PURE__ */new Date,t=Math.floor(e.getMonth()/3),n=0===t?3:t-1,o=0===t?e.getFullYear()-1:e.getFullYear();return[new Date(o,3*n,1),new Date(o,3*n+3,0)]}},{label:"This year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=/* @__PURE__ */(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}(I),Re=11===oe?0:oe+1,Te=11===oe?te+1:te,Be=S>=2,je=x?j(x):void 0,He=b?j(b):void 0,qe=k?j(k):void 0,_e=j(y),Ze="single"===a&&null!=F||"range"===a&&(null!=O[0]||null!=O[1])||"multiple"===a&&Y.length>0,Ge="range"===a?_?Z:O:[null,null],Je=w?M.danger:ce?M.primary:M.border,Qe=Array.from({length:24},(e,t)=>t),et=Array.from({length:60},(e,t)=>t),tt=/* @__PURE__ */Ye("div",{ref:Se,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==ie)return;const t=fe??F??R;let n=null;if("ArrowRight"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);else if("ArrowLeft"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);else if("ArrowDown"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+7);else if("ArrowUp"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7);else if("Enter"===e.key&&fe)return void Ie(fe);n&&(e.preventDefault(),me(n),n.getMonth()===oe&&n.getFullYear()===te||(re(n.getMonth()),ne(n.getFullYear())))},style:{position:"absolute",top:be.top,left:be.left,zIndex:9999,backgroundColor:M.surface,border:`1px solid ${M.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:Be?"580px":"300px",maxWidth:Be&&m?"780px":Be?"620px":m?"520px":"300px",opacity:ce?1:0,transform:ce?"translateY(0) scale(1)":be.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:L?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[m&&"range"===a&&/* @__PURE__ */Ye("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${M.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[/* @__PURE__ */Ue("div",{style:{fontSize:"11px",fontWeight:600,color:M.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),Le.map(e=>{const[t,n]=e.getValue(),r=Ge[0]&&Ge[1]&&bn(Ge[0],t)&&bn(Ge[1],n);/* @__PURE__ */
72
+ return Ue("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),r=[t,n];G(r),E||P(r),o?.(r),ne(t.getFullYear()),re(t.getMonth()),q("start"),_||ue(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:r?`${M.primary}20`:"transparent",color:r?M.primary:M.text,fontWeight:r?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor=`${M.surfaceAlt}`)},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),/* @__PURE__ */Ye("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[
73
73
  /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[
74
- /* @__PURE__ */Ve("button",{type:"button","aria-label":"day"===re?"Previous month":"month"===re?"Previous year":"Previous decade",onClick:()=>{"day"===re?(0===ne?(oe(11),te(e=>e-1)):oe(e=>e-1),ie("day")):te("month"===re?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ve("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ve("polyline",{points:"15 18 9 12 15 6"})})}),
75
- /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===re&&/* @__PURE__ */Ye(Pe,{children:[
76
- /* @__PURE__ */Ve("button",{type:"button",onClick:()=>ie("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:mn[ne]}),
77
- /* @__PURE__ */Ve("button",{type:"button",onClick:()=>ie("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:ee}),Re&&/* @__PURE__ */Ye(Pe,{children:[/* @__PURE__ */Ve("span",{style:{color:M.textMuted,fontSize:"14px"},children:"–"}),/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:M.text},children:[mn[We]," ",De]})]})]}),"month"===re&&/* @__PURE__ */Ve("button",{type:"button",onClick:()=>ie("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:ee}),"year"===re&&/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:M.text},children:[kn(ee),"–",kn(ee)+9]})]}),
78
- /* @__PURE__ */Ve("button",{type:"button","aria-label":"day"===re?"Next month":"month"===re?"Next year":"Next decade",onClick:()=>{"day"===re?(11===ne?(oe(0),te(e=>e+1)):oe(e=>e+1),ie("day")):te("month"===re?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ve("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ve("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===re&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"20px"},children:[/* @__PURE__ */Ve(Sn,{year:ee,month:ne,today:D,mode:l,selectedDate:A,selectedRange:Ge,multiDates:U,hoverDate:ge,focusedDate:pe,isDateDisabled:ze,onSelectDate:Ne,onHoverDate:xe,onSetFocused:fe,theme:M,locale:c}),Re&&/* @__PURE__ */Ve(Sn,{year:De,month:We,today:D,mode:l,selectedDate:A,selectedRange:Ge,multiDates:U,hoverDate:ge,focusedDate:pe,isDateDisabled:ze,onSelectDate:Ne,onHoverDate:xe,onSetFocused:fe,theme:M,locale:c})]}),"month"===re&&/* @__PURE__ */Ve("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:gn.map((e,t)=>{const n=t===ne;/* @__PURE__ */
79
- return Ve("button",{type:"button",onClick:()=>{oe(t),ie("day")},style:{padding:"10px",borderRadius:"8px",border:t!==D.getMonth()||ee!==D.getFullYear()||n?"none":`2px solid ${M.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?M.primary:"transparent",color:n?M.bg:M.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===re&&/* @__PURE__ */Ve("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=kn(ee)-1+t,o=n===ee,r=n===D.getFullYear(),i=0===t||11===t;/* @__PURE__ */
80
- return Ve("button",{type:"button",onClick:()=>{te(n),ie("month")},style:{padding:"10px 6px",borderRadius:"8px",border:r&&!o?`2px solid ${M.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?M.primary:"transparent",color:o?M.bg:i?M.textMuted:M.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),h&&"day"===re&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[
81
- /* @__PURE__ */Ve(Cn,{values:Ze,selected:se.h,onSelect:e=>{p||ae(t=>({...t,h:e})),f?.({...se,h:e})},label:"Hour",theme:M}),
82
- /* @__PURE__ */Ve("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:M.textMuted},children:":"}),
83
- /* @__PURE__ */Ve(Cn,{values:Je,selected:se.m,onSelect:e=>{p||ae(t=>({...t,m:e})),f?.({...se,m:e})},label:"Min",theme:M})]}),"multiple"===l&&"day"===re&&U.length>0&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"8px",fontSize:"12px",color:M.textMuted,textAlign:"center"},children:[U.length," date",1!==U.length?"s":""," selected"]}),
84
- /* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:q?"space-between":"flex-start",gap:"8px"},children:[/* @__PURE__ */Ve("button",{type:"button",onClick:()=>{te(D.getFullYear()),oe(D.getMonth()),ie("day"),Ne(D)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:M.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),q&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px"},children:[/* @__PURE__ */Ve("button",{type:"button",onClick:Ie,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${M.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:M.text,fontFamily:"inherit"},children:"Cancel"}),/* @__PURE__ */Ve("button",{type:"button",onClick:Me,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:M.primary,color:M.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});/* @__PURE__ */
85
- return Ye("div",{className:z,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...N},children:[Be&&/* @__PURE__ */Ve("label",{htmlFor:L,style:{fontSize:"13px",fontWeight:500,color:M.text,marginBottom:"2px"},children:Be}),
86
- /* @__PURE__ */Ye("div",{ref:we,style:{display:"flex",alignItems:"center",border:`1.5px solid ${_e}`,borderRadius:"8px",backgroundColor:M.surface,overflow:"hidden",transition:W?"none":"border-color 120ms ease",opacity:w?.5:1},children:[
87
- /* @__PURE__ */Ve("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
88
- /* @__PURE__ */Ve("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),
89
- /* @__PURE__ */Ve("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),
90
- /* @__PURE__ */Ve("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),
91
- /* @__PURE__ */Ve("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),
92
- /* @__PURE__ */Ve("input",{ref:Ce,id:L,type:"text",value:ue,placeholder:Xe,disabled:w,"aria-invalid":k,"aria-haspopup":"dialog","aria-expanded":de,readOnly:"range"===l||"multiple"===l,onChange:e=>(e=>{if(he(e),"single"===l){const n=function(e,t){const n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){const[,e,t,o]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){const n=new Date(o,e-1,t);if(n.getMonth()===e-1)return n}}const o=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o){const[,e,t,n]=o.map(Number),r=new Date(e,t-1,n);if(r.getMonth()===t-1)return r}if(t&&/^DD/.test(t)){const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){const[,e,n,o]=t.map(Number),r=new Date(o,n-1,e);if(r.getMonth()===n-1)return r}}return null}(e,u);n&&!ze(n)&&(R||B(n),t?.(n),te(n.getFullYear()),oe(n.getMonth()))}})(e.target.value),onFocus:()=>{w||ce(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:M.text,cursor:"single"!==l?"pointer":"text",fontFamily:"inherit",minWidth:0}}),qe&&!w&&/* @__PURE__ */Ve("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===l)R||B(null),t?.(null),he("");else if("range"===l){const e=[null,null];F||j(e),o?.(e),_(e),he(""),X("start")}else"multiple"===l&&(P||Y([]),i?.([]),he(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:/* @__PURE__ */Ye("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:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),
93
- /* @__PURE__ */Ve("button",{type:"button","aria-label":de?"Close calendar":"Open calendar",tabIndex:-1,disabled:w,onClick:()=>{w||ce(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:w?"not-allowed":"pointer",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ve("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:de?"rotate(180deg)":"rotate(0deg)",transition:W?"none":"transform 160ms ease"},children:/* @__PURE__ */Ve("polyline",{points:"6 9 12 15 18 9"})})})]}),Ee&&!k&&/* @__PURE__ */Ve("span",{style:{fontSize:"12px",color:M.textMuted},children:Ee}),k&&Ke&&/* @__PURE__ */Ve("span",{role:"alert",style:{fontSize:"12px",color:M.danger},children:Ke}),de&&"undefined"!=typeof document&&Ue(Qe,document.body)]})}$n.displayName="TkxDatePicker";var zn={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function Nn(e,t,n){return Math.min(Math.max(e,t),n)}function Mn(e,t,n){return Math.round((e-t)/n)*n+t}function In(e,t,n){return(e-t)/(n-t)*100}function Ln({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:l,ariaLabel:a,tooltipMode:s,formatValue:d,orientation:c,onChange:u,onChangeEnd:h}){const[p,f]=Oe(!1),[m,g]=Oe(!1),[x,b]=Oe(!1),y="vertical"===c,v=In(e,t,n);/* @__PURE__ */
94
- return Ye("div",{style:y?{position:"absolute",bottom:`${v}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${l/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${v}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${l/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},children:[("always"===s||"hover"===s&&(x||m||p))&&/* @__PURE__ */Ve("div",{style:y?{position:"absolute",left:l+6,top:"50%",transform:"translateY(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:l+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"},children:d(e)}),/* @__PURE__ */Ve("div",{role:"slider",tabIndex:r?-1:0,"aria-label":a,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":c,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),u(Nn(Mn(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),u(Nn(Mn(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),u(t)):"End"===i.key&&(i.preventDefault(),u(n)))},onFocus:()=>f(!0),onBlur:()=>f(!1),onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),onPointerDown:e=>{r||(g(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{g(!1),h?.()},style:{width:l,height:l,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:p?`0 0 0 3px ${i}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function Wn({value:e,defaultValue:t=0,onChange:n,rangeValue:o,onRangeChange:r,min:i=0,max:l=100,step:a=1,isRange:s=!1,label:d,showValue:c=!1,showTicks:u=!1,tickCount:h=5,isDisabled:p=!1,colorScheme:f="primary",size:m="md",marks:g,orientation:x="horizontal",showTooltip:y=!1,formatValue:v,onChangeEnd:w,onRangeChangeEnd:k,gradient:C=!1}){const S=b(),$=Fe(),z=me(),N=void 0!==e,[M,I]=Oe(t),L=N?e:M,W=void 0!==o,[D,R]=Oe([i,l]),T=W?o:D,B=je(null),A=je(L);A.current=L;const F=je(T);F.current=T;const H={primary:S.primary,success:S.success,danger:S.danger,warning:S.warning}[f],j=zn[m],O="vertical"===x,P=!0===y?"hover":!1!==y&&y,Y=v??(e=>String(e)),U=H+"66",K=Te((e,t)=>{const n=B.current;if(!n)return i;const o=n.getBoundingClientRect();let r;return r=Nn(O?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),Nn(Mn(r*(l-i)+i,i,a),i,l)},[i,l,a,O]),X=Te(e=>{if(p)return;const t=K(e.clientX,e.clientY);if(s){const[e,n]=T,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];W||R(o),r?.(o)}else N||I(t),n?.(t)},[p,s,N,W,K,n,r,T]),q=s?In(T[0],i,l):0,G=In(s?T[1]:L,i,l),_=u?Array.from({length:h},(e,t)=>i+t/(h-1)*(l-i)):[],Z=d?E(d):void 0,J=z?"none":"background 150ms ease";/* @__PURE__ */
95
- return Ye("div",{className:V("flex flex-col gap-2"),style:{opacity:p?.55:1,...O?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(Z||c)&&/* @__PURE__ */Ye("div",{className:V("flex items-center justify-between"),children:[Z&&/* @__PURE__ */Ve("label",{htmlFor:$,className:V("text-sm font-medium"),style:{color:S.text,fontSize:j.fontSize},children:Z}),c&&!s&&/* @__PURE__ */Ve("span",{className:V("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:j.fontSize},children:Y(L)}),c&&s&&/* @__PURE__ */Ye("span",{className:V("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:j.fontSize},children:[Y(T[0])," – ",Y(T[1])]})]}),
96
- /* @__PURE__ */Ye("div",{style:{position:"relative",...O?{paddingLeft:j.thumb/2,paddingRight:j.thumb/2,flex:1}:{paddingTop:j.thumb/2,paddingBottom:j.thumb/2}},children:[/* @__PURE__ */Ye("div",{ref:B,onPointerDown:X,style:{position:"relative",...O?{width:j.track,height:"100%"}:{height:j.track},borderRadius:9999,backgroundColor:S.border,cursor:p?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[
97
- /* @__PURE__ */Ve("div",{style:{position:"absolute",...O?{left:0,bottom:`${q}%`,height:G-q+"%",width:"100%"}:{top:0,left:`${q}%`,width:G-q+"%",height:"100%"},borderRadius:9999,...p?{backgroundColor:S.textMuted}:C?{background:O?`linear-gradient(to top, ${U}, ${H})`:`linear-gradient(to right, ${U}, ${H})`}:{backgroundColor:H},transition:J}}),_.map((e,t)=>/* @__PURE__ */Ve("div",{style:{position:"absolute",...O?{bottom:`${In(e,i,l)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:j.track+4}:{left:`${In(e,i,l)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:j.track+4},backgroundColor:S.surface,borderRadius:9999,pointerEvents:"none"}},t)),s?/* @__PURE__ */Ye(Pe,{children:[/* @__PURE__ */Ve(Ln,{value:T[0],min:i,max:T[1],step:a,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:`${Z??"Range"} start`,tooltipMode:P,formatValue:Y,orientation:x,onChange:e=>{const t=[Nn(e,i,T[1]),T[1]];W||R(t),r?.(t)},onChangeEnd:k?()=>k(F.current):void 0}),/* @__PURE__ */Ve(Ln,{value:T[1],min:T[0],max:l,step:a,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:`${Z??"Range"} end`,tooltipMode:P,formatValue:Y,orientation:x,onChange:e=>{const t=[T[0],Nn(e,T[0],l)];W||R(t),r?.(t)},onChangeEnd:k?()=>k(F.current):void 0})]}):/* @__PURE__ */Ve(Ln,{value:L,min:i,max:l,step:a,isDisabled:p,trackColor:H,trackHeight:j.track,thumbSize:j.thumb,ariaLabel:Z??"Slider",tooltipMode:P,formatValue:Y,orientation:x,onChange:e=>{N||I(e),n?.(e)},onChangeEnd:w?()=>w(A.current):void 0})]}),g&&g.length>0&&/* @__PURE__ */Ve("div",{style:{position:O?"absolute":"relative",...O?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:g.map((e,t)=>/* @__PURE__ */Ve("div",{style:{position:"absolute",...O?{bottom:`${In(e.value,i,l)}%`,transform:"translateY(50%)",left:0}:{left:`${In(e.value,i,l)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:S.textMuted,whiteSpace:"nowrap"},children:E(e.label)},t))})]}),u&&!g&&!O&&/* @__PURE__ */Ve("div",{style:{position:"relative",height:"1rem"},children:_.map((e,t)=>/* @__PURE__ */Ve("span",{style:{position:"absolute",left:`${In(e,i,l)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:S.textMuted},children:Y(Math.round(e))},t))})]})}Wn.displayName="TkxSlider";var Dn={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 Rn({total:e,pageSize:t=10,page:n,defaultPage:o=1,onChange:r,siblingCount:i=1,showEdges:l=!0,showPageSize:a=!1,onPageSizeChange:s,pageSizeOptions:d=[10,25,50,100],size:c="md",variant:u="default"}){const h=b(),p=Fe(),f=void 0!==n,[m,g]=Oe(o),x=f?n:m,[y,v]=Oe(t),w=t,k=Math.max(1,Math.ceil(e/w)),C=e=>{const t=Math.min(Math.max(e,1),k);t!==x&&(f||g(t),r?.(t))},S=function(e,t,n,o){if(t<=1)return[1];const r=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),i=Math.max(e-n,1),l=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,l)),l<t&&e.push("..."),e}const a=i>3,s=l<t-2,d=[];d.push(1),a?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(l,t-1))),s?d.push("right-ellipsis"):d.push(...r(l+1,t-1)),t>1&&d.push(t);const c=/* @__PURE__ */new Set,u=[];for(const h of d)"number"==typeof h?c.has(h)||(c.add(h),u.push(h)):u.push(h);return u}(x,k,i,l),$=Dn[c],z=Math.min((x-1)*w+1,e),N=Math.min(x*w,e),M=(e,t)=>{const n={height:$.height,minWidth:$.minWidth,paddingLeft:$.px,paddingRight:$.px,fontSize:$.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:t?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:t?.4:1};return e?{...n,backgroundColor:h.primary,color:h.bg,fontWeight:600,boxShadow:`0 0 0 2px ${h.primary}44`}:"default"===u?{...n,backgroundColor:h.surface,color:h.text,border:`1px solid ${h.border}`}:"outline"===u?{...n,backgroundColor:"transparent",color:h.text,border:`1px solid ${h.border}`}:{...n,backgroundColor:"transparent",color:h.text}},I=({d:e})=>/* @__PURE__ */Ve("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ve("polyline",{points:e})});/* @__PURE__ */
98
- return Ye("nav",{"aria-label":"Pagination",className:V("flex flex-col gap-2"),children:[e>0&&/* @__PURE__ */Ve("p",{className:V("text-sm"),style:{color:h.textMuted,fontSize:$.fontSize},children:E(`Showing ${z}–${N} of ${e} items`)}),/* @__PURE__ */Ye("div",{className:V("flex items-center gap-1 flex-wrap"),children:[l&&/* @__PURE__ */Ye("button",{type:"button","aria-label":"First page",disabled:1===x,onClick:()=>C(1),style:M(!1,1===x),children:[/* @__PURE__ */Ve(I,{d:"15 18 9 12 15 6"}),/* @__PURE__ */Ve(I,{d:"20 18 14 12 20 6"})]}),
99
- /* @__PURE__ */Ve("button",{type:"button","aria-label":"Previous page",disabled:1===x,onClick:()=>C(x-1),style:M(!1,1===x),children:/* @__PURE__ */Ve(I,{d:"15 18 9 12 15 6"})}),S.map((e,t)=>{if("string"==typeof e)/* @__PURE__ */return Ve("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:$.minWidth,height:$.height,fontSize:$.fontSize,color:h.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===x;/* @__PURE__ */
100
- return Ve("button",{type:"button","aria-label":`Page ${n}`,"aria-current":o?"page":void 0,onClick:()=>C(n),style:M(o,!1),children:n},n)}),
101
- /* @__PURE__ */Ve("button",{type:"button","aria-label":"Next page",disabled:x===k,onClick:()=>C(x+1),style:M(!1,x===k),children:/* @__PURE__ */Ve(I,{d:"9 18 15 12 9 6"})}),l&&/* @__PURE__ */Ye("button",{type:"button","aria-label":"Last page",disabled:x===k,onClick:()=>C(k),style:M(!1,x===k),children:[/* @__PURE__ */Ve(I,{d:"4 18 10 12 4 6"}),/* @__PURE__ */Ve(I,{d:"14 18 20 12 14 6"})]}),a&&/* @__PURE__ */Ye("div",{className:V("flex items-center gap-2 ml-2"),children:[/* @__PURE__ */Ve("label",{htmlFor:p,className:V("text-sm"),style:{color:h.textMuted,fontSize:$.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),/* @__PURE__ */Ve("select",{id:p,value:y,onChange:e=>{return t=Number(e.target.value),v(t),s?.(t),void C(1);var t},style:{height:$.height,paddingLeft:$.px,paddingRight:$.px,fontSize:$.fontSize,borderRadius:"8px",border:`1px solid ${h.border}`,backgroundColor:h.surface,color:h.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:d.map(e=>/* @__PURE__ */Ve("option",{value:e,children:e},e))})]})]})]})}Rn.displayName="TkxPagination";var Tn={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},Bn={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function An({color:e,size:t}){/* @__PURE__ */
74
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":"day"===ie?"Previous month":"month"===ie?"Previous year":"Previous decade",onClick:()=>{"day"===ie?(0===oe?(re(11),ne(e=>e-1)):re(e=>e-1),ae("day")):ne("month"===ie?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ue("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"15 18 9 12 15 6"})})}),
75
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===ie&&/* @__PURE__ */Ye(Ke,{children:[
76
+ /* @__PURE__ */Ue("button",{type:"button",onClick:()=>ae("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:xn[oe]}),
77
+ /* @__PURE__ */Ue("button",{type:"button",onClick:()=>ae("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:te}),Be&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("span",{style:{color:M.textMuted,fontSize:"14px"},children:"–"}),/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:M.text},children:[xn[Re]," ",Te]})]})]}),"month"===ie&&/* @__PURE__ */Ue("button",{type:"button",onClick:()=>ae("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:M.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:te}),"year"===ie&&/* @__PURE__ */Ye("span",{style:{fontSize:"14px",fontWeight:600,color:M.text},children:[Cn(te),"–",Cn(te)+9]})]}),
78
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":"day"===ie?"Next month":"month"===ie?"Next year":"Next decade",onClick:()=>{"day"===ie?(11===oe?(re(0),ne(e=>e+1)):re(e=>e+1),ae("day")):ne("month"===ie?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ue("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===ie&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"20px"},children:[/* @__PURE__ */Ue(zn,{year:te,month:oe,today:R,mode:a,selectedDate:F,selectedRange:Ge,multiDates:Y,hoverDate:xe,focusedDate:fe,isDateDisabled:Me,onSelectDate:Ie,onHoverDate:ye,onSetFocused:me,theme:M,locale:c}),Be&&/* @__PURE__ */Ue(zn,{year:Te,month:Re,today:R,mode:a,selectedDate:F,selectedRange:Ge,multiDates:Y,hoverDate:xe,focusedDate:fe,isDateDisabled:Me,onSelectDate:Ie,onHoverDate:ye,onSetFocused:me,theme:M,locale:c})]}),"month"===ie&&/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:yn.map((e,t)=>{const n=t===oe;/* @__PURE__ */
79
+ return Ue("button",{type:"button",onClick:()=>{re(t),ae("day")},style:{padding:"10px",borderRadius:"8px",border:t!==R.getMonth()||te!==R.getFullYear()||n?"none":`2px solid ${M.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?M.primary:"transparent",color:n?M.bg:M.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===ie&&/* @__PURE__ */Ue("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=Cn(te)-1+t,o=n===te,r=n===R.getFullYear(),i=0===t||11===t;/* @__PURE__ */
80
+ return Ue("button",{type:"button",onClick:()=>{ne(n),ae("month")},style:{padding:"10px 6px",borderRadius:"8px",border:r&&!o?`2px solid ${M.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?M.primary:"transparent",color:o?M.bg:i?M.textMuted:M.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),h&&"day"===ie&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[
81
+ /* @__PURE__ */Ue($n,{values:Qe,selected:de.h,onSelect:e=>{p||se(t=>({...t,h:e})),f?.({...de,h:e})},label:"Hour",theme:M}),
82
+ /* @__PURE__ */Ue("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:M.textMuted},children:":"}),
83
+ /* @__PURE__ */Ue($n,{values:et,selected:de.m,onSelect:e=>{p||se(t=>({...t,m:e})),f?.({...de,m:e})},label:"Min",theme:M})]}),"multiple"===a&&"day"===ie&&Y.length>0&&/* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"8px",fontSize:"12px",color:M.textMuted,textAlign:"center"},children:[Y.length," date",1!==Y.length?"s":""," selected"]}),
84
+ /* @__PURE__ */Ye("div",{style:{borderTop:`1px solid ${M.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:_?"space-between":"flex-start",gap:"8px"},children:[/* @__PURE__ */Ue("button",{type:"button",onClick:()=>{ne(R.getFullYear()),re(R.getMonth()),ae("day"),Ie(R)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:M.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),_&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px"},children:[/* @__PURE__ */Ue("button",{type:"button",onClick:We,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${M.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:M.text,fontFamily:"inherit"},children:"Cancel"}),/* @__PURE__ */Ue("button",{type:"button",onClick:De,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:M.primary,color:M.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});/* @__PURE__ */
85
+ return Ye("div",{className:$,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...z},children:[je&&/* @__PURE__ */Ue("label",{htmlFor:W,style:{fontSize:"13px",fontWeight:500,color:M.text,marginBottom:"2px"},children:je}),
86
+ /* @__PURE__ */Ye("div",{ref:ke,style:{display:"flex",alignItems:"center",border:`1.5px solid ${Je}`,borderRadius:"8px",backgroundColor:M.surface,overflow:"hidden",transition:L?"none":"border-color 120ms ease",opacity:v?.5:1},children:[
87
+ /* @__PURE__ */Ue("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
88
+ /* @__PURE__ */Ue("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),
89
+ /* @__PURE__ */Ue("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),
90
+ /* @__PURE__ */Ue("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),
91
+ /* @__PURE__ */Ue("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),
92
+ /* @__PURE__ */Ue("input",{ref:Ce,id:W,type:"text",value:he,placeholder:_e,disabled:v,"aria-invalid":w,"aria-haspopup":"dialog","aria-expanded":ce,readOnly:"range"===a||"multiple"===a,onChange:e=>(e=>{if(pe(e),"single"===a){const n=function(e,t){const n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){const[,e,t,o]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){const n=new Date(o,e-1,t);if(n.getMonth()===e-1)return n}}const o=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o){const[,e,t,n]=o.map(Number),r=new Date(e,t-1,n);if(r.getMonth()===t-1)return r}if(t&&/^DD/.test(t)){const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){const[,e,n,o]=t.map(Number),r=new Date(o,n-1,e);if(r.getMonth()===n-1)return r}}return null}(e,u);n&&!Me(n)&&(T||B(n),t?.(n),ne(n.getFullYear()),re(n.getMonth()))}})(e.target.value),onFocus:()=>{v||ue(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:M.text,cursor:"single"!==a?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Ze&&!v&&/* @__PURE__ */Ue("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===a)T||B(null),t?.(null),pe("");else if("range"===a){const e=[null,null];E||P(e),o?.(e),G(e),pe(""),q("start")}else"multiple"===a&&(V||U([]),i?.([]),pe(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:M.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:/* @__PURE__ */Ye("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:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),
93
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":ce?"Close calendar":"Open calendar",tabIndex:-1,disabled:v,onClick:()=>{v||ue(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:v?"not-allowed":"pointer",color:M.textMuted,flexShrink:0},children:/* @__PURE__ */Ue("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:ce?"rotate(180deg)":"rotate(0deg)",transition:L?"none":"transform 160ms ease"},children:/* @__PURE__ */Ue("polyline",{points:"6 9 12 15 18 9"})})})]}),He&&!w&&/* @__PURE__ */Ue("span",{style:{fontSize:"12px",color:M.textMuted},children:He}),w&&qe&&/* @__PURE__ */Ue("span",{role:"alert",style:{fontSize:"12px",color:M.danger},children:qe}),ce&&"undefined"!=typeof document&&Xe(tt,document.body)]})}Nn.displayName="TkxDatePicker";var Mn={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function In(e,t,n){return Math.min(Math.max(e,t),n)}function Dn(e,t,n){return Math.round((e-t)/n)*n+t}function Wn(e,t,n){return(e-t)/(n-t)*100}function Ln({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:a,ariaLabel:l,tooltipMode:s,formatValue:d,orientation:c,onChange:u,onChangeEnd:h}){const[p,f]=Ve(!1),[m,g]=Ve(!1),[x,y]=Ve(!1),b="vertical"===c,v=Wn(e,t,n);/* @__PURE__ */
94
+ return Ye("div",{style:b?{position:"absolute",bottom:`${v}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${v}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${a/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},children:[("always"===s||"hover"===s&&(x||m||p))&&/* @__PURE__ */Ue("div",{style:b?{position:"absolute",left:a+6,top:"50%",transform:"translateY(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:a+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"},children:d(e)}),/* @__PURE__ */Ue("div",{role:"slider",tabIndex:r?-1:0,"aria-label":l,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":c,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),u(In(Dn(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),u(In(Dn(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),u(t)):"End"===i.key&&(i.preventDefault(),u(n)))},onFocus:()=>f(!0),onBlur:()=>f(!1),onPointerEnter:()=>y(!0),onPointerLeave:()=>y(!1),onPointerDown:e=>{r||(g(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{g(!1),h?.()},style:{width:a,height:a,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:p?`0 0 0 3px ${i}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function Rn({value:e,defaultValue:t=0,onChange:n,rangeValue:o,onRangeChange:r,min:i=0,max:a=100,step:l=1,isRange:s=!1,label:d,showValue:c=!1,showTicks:u=!1,tickCount:h=5,isDisabled:p=!1,colorScheme:f="primary",size:m="md",marks:g,orientation:x="horizontal",showTooltip:y=!1,formatValue:b,onChangeEnd:v,onRangeChangeEnd:w,gradient:k=!1}){const S=N(),C=Ee(),$=ge(),z=void 0!==e,[M,I]=Ve(t),D=z?e:M,W=void 0!==o,[L,R]=Ve([i,a]),T=W?o:L,A=Oe(null),B=Oe(D);B.current=D;const F=Oe(T);F.current=T;const E={primary:S.primary,success:S.success,danger:S.danger,warning:S.warning}[f],H=Mn[m],P="vertical"===x,O=!0===y?"hover":!1!==y&&y,V=b??(e=>String(e)),U=E+"66",Y=Ae((e,t)=>{const n=A.current;if(!n)return i;const o=n.getBoundingClientRect();let r;return r=In(P?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),In(Dn(r*(a-i)+i,i,l),i,a)},[i,a,l,P]),X=Ae(e=>{if(p)return;const t=Y(e.clientX,e.clientY);if(s){const[e,n]=T,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];W||R(o),r?.(o)}else z||I(t),n?.(t)},[p,s,z,W,Y,n,r,T]),q=s?Wn(T[0],i,a):0,_=Wn(s?T[1]:D,i,a),Z=u?Array.from({length:h},(e,t)=>i+t/(h-1)*(a-i)):[],G=d?j(d):void 0,J=$?"none":"background 150ms ease";/* @__PURE__ */
95
+ return Ye("div",{className:K("flex flex-col gap-2"),style:{opacity:p?.55:1,...P?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(G||c)&&/* @__PURE__ */Ye("div",{className:K("flex items-center justify-between"),children:[G&&/* @__PURE__ */Ue("label",{htmlFor:C,className:K("text-sm font-medium"),style:{color:S.text,fontSize:H.fontSize},children:G}),c&&!s&&/* @__PURE__ */Ue("span",{className:K("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:H.fontSize},children:V(D)}),c&&s&&/* @__PURE__ */Ye("span",{className:K("text-sm tabular-nums"),style:{color:S.textMuted,fontSize:H.fontSize},children:[V(T[0])," – ",V(T[1])]})]}),
96
+ /* @__PURE__ */Ye("div",{style:{position:"relative",...P?{paddingLeft:H.thumb/2,paddingRight:H.thumb/2,flex:1}:{paddingTop:H.thumb/2,paddingBottom:H.thumb/2}},children:[/* @__PURE__ */Ye("div",{ref:A,onPointerDown:X,style:{position:"relative",...P?{width:H.track,height:"100%"}:{height:H.track},borderRadius:9999,backgroundColor:S.border,cursor:p?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[
97
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",...P?{left:0,bottom:`${q}%`,height:_-q+"%",width:"100%"}:{top:0,left:`${q}%`,width:_-q+"%",height:"100%"},borderRadius:9999,...p?{backgroundColor:S.textMuted}:k?{background:P?`linear-gradient(to top, ${U}, ${E})`:`linear-gradient(to right, ${U}, ${E})`}:{backgroundColor:E},transition:J}}),Z.map((e,t)=>/* @__PURE__ */Ue("div",{style:{position:"absolute",...P?{bottom:`${Wn(e,i,a)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:H.track+4}:{left:`${Wn(e,i,a)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:H.track+4},backgroundColor:S.surface,borderRadius:9999,pointerEvents:"none"}},t)),s?/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue(Ln,{value:T[0],min:i,max:T[1],step:l,isDisabled:p,trackColor:E,trackHeight:H.track,thumbSize:H.thumb,ariaLabel:`${G??"Range"} start`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[In(e,i,T[1]),T[1]];W||R(t),r?.(t)},onChangeEnd:w?()=>w(F.current):void 0}),/* @__PURE__ */Ue(Ln,{value:T[1],min:T[0],max:a,step:l,isDisabled:p,trackColor:E,trackHeight:H.track,thumbSize:H.thumb,ariaLabel:`${G??"Range"} end`,tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{const t=[T[0],In(e,T[0],a)];W||R(t),r?.(t)},onChangeEnd:w?()=>w(F.current):void 0})]}):/* @__PURE__ */Ue(Ln,{value:D,min:i,max:a,step:l,isDisabled:p,trackColor:E,trackHeight:H.track,thumbSize:H.thumb,ariaLabel:G??"Slider",tooltipMode:O,formatValue:V,orientation:x,onChange:e=>{z||I(e),n?.(e)},onChangeEnd:v?()=>v(B.current):void 0})]}),g&&g.length>0&&/* @__PURE__ */Ue("div",{style:{position:P?"absolute":"relative",...P?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:g.map((e,t)=>/* @__PURE__ */Ue("div",{style:{position:"absolute",...P?{bottom:`${Wn(e.value,i,a)}%`,transform:"translateY(50%)",left:0}:{left:`${Wn(e.value,i,a)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:S.textMuted,whiteSpace:"nowrap"},children:j(e.label)},t))})]}),u&&!g&&!P&&/* @__PURE__ */Ue("div",{style:{position:"relative",height:"1rem"},children:Z.map((e,t)=>/* @__PURE__ */Ue("span",{style:{position:"absolute",left:`${Wn(e,i,a)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:S.textMuted},children:V(Math.round(e))},t))})]})}Rn.displayName="TkxSlider";var Tn={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 An({total:e,pageSize:t=10,page:n,defaultPage:o=1,onChange:r,siblingCount:i=1,showEdges:a=!0,showPageSize:l=!1,onPageSizeChange:s,pageSizeOptions:d=[10,25,50,100],size:c="md",variant:u="default"}){const h=N(),p=$e(),f=Ee(),m={pagination:"Pagination",firstPage:p.firstPage??"First page",lastPage:p.lastPage??"Last page",previousPage:p.previousPage??"Previous page",nextPage:p.nextPage??"Next page",pageN:e=>`Page ${e}`,showing:(e,t,n)=>p.showingRange?p.showingRange(e,t,n):`Showing ${e}–${t} of ${n} items`},g=void 0!==n,[x,y]=Ve(o),b=g?n:x,[v,w]=Ve(t),k=t,S=Math.max(1,Math.ceil(e/k)),C=e=>{const t=Math.min(Math.max(e,1),S);t!==b&&(g||y(t),r?.(t))},$=function(e,t,n,o){if(t<=1)return[1];const r=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),i=Math.max(e-n,1),a=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,a)),a<t&&e.push("..."),e}const l=i>3,s=a<t-2,d=[];d.push(1),l?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(a,t-1))),s?d.push("right-ellipsis"):d.push(...r(a+1,t-1)),t>1&&d.push(t);const c=/* @__PURE__ */new Set,u=[];for(const h of d)"number"==typeof h?c.has(h)||(c.add(h),u.push(h)):u.push(h);return u}(b,S,i,a),z=Tn[c],M=Math.min((b-1)*k+1,e),I=Math.min(b*k,e),D=(e,t)=>{const n={height:z.height,minWidth:z.minWidth,paddingLeft:z.px,paddingRight:z.px,fontSize:z.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:t?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:t?.4:1};return e?{...n,backgroundColor:h.primary,color:h.bg,fontWeight:600,boxShadow:`0 0 0 2px ${h.primary}44`}:"default"===u?{...n,backgroundColor:h.surface,color:h.text,border:`1px solid ${h.border}`}:"outline"===u?{...n,backgroundColor:"transparent",color:h.text,border:`1px solid ${h.border}`}:{...n,backgroundColor:"transparent",color:h.text}},W=({d:e})=>/* @__PURE__ */Ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:e})});/* @__PURE__ */
98
+ return Ye("nav",{"aria-label":m.pagination,className:K("flex flex-col gap-2"),children:[e>0&&/* @__PURE__ */Ue("p",{className:K("text-sm"),style:{color:h.textMuted,fontSize:z.fontSize},children:j(m.showing(M,I,e))}),/* @__PURE__ */Ye("div",{className:K("flex items-center gap-1 flex-wrap"),children:[a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":m.firstPage,disabled:1===b,onClick:()=>C(1),style:D(!1,1===b),children:[/* @__PURE__ */Ue(W,{d:"15 18 9 12 15 6"}),/* @__PURE__ */Ue(W,{d:"20 18 14 12 20 6"})]}),
99
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":m.previousPage,disabled:1===b,onClick:()=>C(b-1),style:D(!1,1===b),children:/* @__PURE__ */Ue(W,{d:"15 18 9 12 15 6"})}),$.map((e,t)=>{if("string"==typeof e)/* @__PURE__ */return Ue("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:z.minWidth,height:z.height,fontSize:z.fontSize,color:h.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===b;/* @__PURE__ */
100
+ return Ue("button",{type:"button","aria-label":m.pageN(n),"aria-current":o?"page":void 0,onClick:()=>C(n),style:D(o,!1),children:n},n)}),
101
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":m.nextPage,disabled:b===S,onClick:()=>C(b+1),style:D(!1,b===S),children:/* @__PURE__ */Ue(W,{d:"9 18 15 12 9 6"})}),a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":m.lastPage,disabled:b===S,onClick:()=>C(S),style:D(!1,b===S),children:[/* @__PURE__ */Ue(W,{d:"4 18 10 12 4 6"}),/* @__PURE__ */Ue(W,{d:"14 18 20 12 14 6"})]}),l&&/* @__PURE__ */Ye("div",{className:K("flex items-center gap-2 ml-2"),children:[/* @__PURE__ */Ue("label",{htmlFor:f,className:K("text-sm"),style:{color:h.textMuted,fontSize:z.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),/* @__PURE__ */Ue("select",{id:f,value:v,onChange:e=>{return t=Number(e.target.value),w(t),s?.(t),void C(1);var t},style:{height:z.height,paddingLeft:z.px,paddingRight:z.px,fontSize:z.fontSize,borderRadius:"8px",border:`1px solid ${h.border}`,backgroundColor:h.surface,color:h.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:d.map(e=>/* @__PURE__ */Ue("option",{value:e,children:e},e))})]})]})]})}An.displayName="TkxPagination";var Bn={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},Fn={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function En({color:e,size:t}){/* @__PURE__ */
102
102
  return Ye("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[
103
- /* @__PURE__ */Ve("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
104
- /* @__PURE__ */Ve("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),
105
- /* @__PURE__ */Ve("path",{d:"M21 15l-5-5L5 21"})]})}function Fn({src:e,alt:t,fallback:n,placeholder:o="skeleton",fit:r="cover",ratio:i="auto",radius:l="none",caption:a,lazy:s=!0,preview:d=!1,className:c,style:u,...h}){const p=b(),f=me(),[m,g]=Oe(!1),[x,y]=Oe(!1),[v,w]=Oe(!1),k=je(null),C=E(e),S=t?E(t):"",$=a?E(a):"",z=Bn[l];Ae(()=>{k.current?.complete&&g(!0)},[]);const N=Te(()=>g(!0),[]),M=Te(()=>y(!0),[]),I=Te(()=>{d&&!x&&w(!0)},[d,x]),L=Te(()=>w(!1),[]);Ae(()=>{if(!v)return;const e=e=>{"Escape"===e.key&&L()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v,L]);const W="skeleton"===o&&!m&&!x,D=W&&!f?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},R=x?null:/* @__PURE__ */Ve("img",{ref:k,src:C,alt:S||void 0,role:S?void 0:"img","aria-label":S?void 0:"Image",loading:s?"lazy":void 0,onLoad:N,onError:M,onClick:d?I:void 0,className:le(V("block w-full h-full"),d&&!x?V("cursor-pointer"):""),style:{objectFit:r,borderRadius:z,opacity:m?1:0,transition:f?"none":"opacity 200ms ease",position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0},...h}),T=x?n?/* @__PURE__ */Ve(Pe,{children:n}):/* @__PURE__ */Ye("div",{role:"img","aria-label":S||"Image failed to load",className:V("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:p.surfaceAlt,borderRadius:z,color:p.textMuted,minHeight:"80px"},children:[/* @__PURE__ */Ve(An,{color:p.textMuted,size:32}),/* @__PURE__ */Ve("span",{className:V("text-xs"),style:{color:p.textMuted},children:"Failed to load"})]}):null,B=W?/* @__PURE__ */Ve("div",{"aria-hidden":"true",style:{position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0,width:"100%",height:"auto"===i?"100%":void 0,minHeight:"auto"===i?"80px":void 0,borderRadius:z,backgroundColor:p.surfaceAlt,...D}}):null,A=/* @__PURE__ */Ye("div","auto"===i?{className:V("relative w-full"),style:{borderRadius:z},children:[B,R,T]}:{className:V("relative w-full overflow-hidden"),style:{paddingBottom:Tn[i],borderRadius:z},children:[B,R,T]}),F=$?/* @__PURE__ */Ye("figure",{className:V("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:z},children:[A,/* @__PURE__ */Ve("figcaption",{className:V("text-sm text-center"),style:{color:p.textMuted},children:$})]}):A;/* @__PURE__ */
106
- return Ye(Pe,{children:[/* @__PURE__ */Ve("div",{className:le(V("inline-block w-full"),c),style:u,children:F}),v&&"undefined"!=typeof document?Ue(/* @__PURE__ */Ye("div",{role:"dialog","aria-modal":"true","aria-label":S||"Image preview",className:V("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:L,children:[
107
- /* @__PURE__ */Ve("div",{"aria-hidden":"true",className:V("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),
108
- /* @__PURE__ */Ve("img",{src:C,alt:S||"Full-size preview",onClick:e=>e.stopPropagation(),className:V("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),
109
- /* @__PURE__ */Ve("button",{"aria-label":"Close preview",onClick:L,className:V("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:/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null]})}function En(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Hn({mimeType:e,color:t}){return e.startsWith("image/")?/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[
110
- /* @__PURE__ */Ve("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
111
- /* @__PURE__ */Ve("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),
112
- /* @__PURE__ */Ve("path",{d:"M21 15l-5-5L5 21"})]}):/* @__PURE__ */Ye("svg","application/pdf"===e?{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[
113
- /* @__PURE__ */Ve("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),
114
- /* @__PURE__ */Ve("polyline",{points:"14 2 14 8 20 8"}),
115
- /* @__PURE__ */Ve("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),
116
- /* @__PURE__ */Ve("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}:{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[/* @__PURE__ */Ve("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),/* @__PURE__ */Ve("polyline",{points:"14 2 14 8 20 8"})]})}var jn=0;function On({accept:e,multiple:t=!1,maxSize:n,maxFiles:o,onChange:r,onError:i,label:l="Upload files",hint:a,isDisabled:s=!1,preview:d=!0,dragDrop:c=!0,variant:u="dropzone"}){const h=b(),p=me(),f=Fe(),m=je(null),[g,x]=Oe(!1),[y,v]=Oe([]);Ae(()=>()=>{y.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);const w=Te(e=>{let t=0;const n=setInterval(()=>{t+=Math.floor(20*Math.random())+10,t>=100&&(t=100,clearInterval(n)),v(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),k=Te(t=>n&&t.size>n?`"${E(t.name)}" exceeds max size of ${En(n)}`:/[\u0000-\u001F\u007F]|\.\.\/|\.\.\\/.test(t.name)?`"${E(t.name)}" contains forbidden characters`:e&&!e.split(",").map(e=>e.trim()).some(e=>e.startsWith(".")?t.name.toLowerCase().endsWith(e.toLowerCase()):e.endsWith("/*")?t.type.startsWith(e.slice(0,-1)):t.type===e)?`"${E(t.name)}" is not an accepted file type`:void 0,[e,n]),C=Te(async e=>{if(!e.error)try{const t=await J(e.file);if(t&&e.file.type&&!e.file.type.startsWith(t.split("/")[0])){const t=`"${E(e.file.name)}" file content does not match its type`;v(n=>n.map(n=>n.id===e.id?{...n,error:t}:n)),i?.(t)}}catch{}},[i]),S=Te(e=>{const n=o?o-y.length:1/0;if(n<=0)return void i?.(`Maximum of ${o} file${1===o?"":"s"} allowed`);const l=e.slice(0,n).map(e=>{const t=k(e),n=d&&e.type.startsWith("image/")&&!t?URL.createObjectURL(e):void 0;return{file:e,id:"tkx-file-"+ ++jn,objectUrl:n,progress:0,error:t}});v(e=>{const n=t?[...e,...l]:l,o=n.filter(e=>!e.error).map(e=>e.file);return r?.(o),n}),l.forEach(e=>{e.error?i?.(e.error):C(e)}),l.forEach(e=>{e.error||w(e.id)})},[y.length,o,t,r,i,d,w,k]),$=Te(e=>{const t=Array.from(e.target.files??[]);t.length&&S(t),e.target.value=""},[S]),z=Te(e=>{if(e.preventDefault(),x(!1),s)return;const t=Array.from(e.dataTransfer.files);t.length&&S(t)},[s,S]),N=Te(e=>{e.preventDefault(),s||x(!0)},[s]),M=Te(()=>x(!1),[]),I=Te(e=>{v(t=>{const n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);const o=t.filter(t=>t.id!==e);return r?.(o.filter(e=>!e.error).map(e=>e.file)),o})},[r]),L=Te(()=>{s||m.current?.click()},[s]),W=g?h.primary:h.border,D=E(l),R=a?E(a):"",T=/* @__PURE__ */Ye("div",{role:"button",tabIndex:s?-1:0,"aria-label":D,"aria-describedby":a?f:void 0,"aria-disabled":s,onClick:L,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L())},onDrop:c?z:void 0,onDragOver:c?N:void 0,onDragLeave:c?M:void 0,className:V("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${W}`,backgroundColor:g?`${h.primary}10`:h.surface,cursor:s?"not-allowed":"pointer",opacity:s?.5:1,transition:p?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[/* @__PURE__ */Ye("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:g?h.primary:h.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[
117
- /* @__PURE__ */Ve("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
118
- /* @__PURE__ */Ve("polyline",{points:"17 8 12 3 7 8"}),
119
- /* @__PURE__ */Ve("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),/* @__PURE__ */Ye("div",{className:V("text-center"),children:[/* @__PURE__ */Ve("p",{className:V("m-0 text-sm font-medium"),style:{color:h.text},children:g?"Drop files here":D}),R&&/* @__PURE__ */Ve("p",{id:f,className:V("m-0 text-xs mt-1"),style:{color:h.textMuted},children:R})]})]}),B=/* @__PURE__ */Ye("button",{type:"button",disabled:s,onClick:L,"aria-describedby":a?f:void 0,className:V("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:h.primary,color:h.bg,opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[
103
+ /* @__PURE__ */Ue("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
104
+ /* @__PURE__ */Ue("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),
105
+ /* @__PURE__ */Ue("path",{d:"M21 15l-5-5L5 21"})]})}function jn({src:e,alt:t,fallback:n,placeholder:o="skeleton",fit:r="cover",ratio:i="auto",radius:a="none",caption:l,lazy:s=!0,preview:d=!1,className:c,style:u,...h}){const p=N(),f=ge(),[m,g]=Ve(!1),[x,y]=Ve(!1),[b,v]=Ve(!1),w=Oe(null),k=j(e),S=t?j(t):"",C=l?j(l):"",$=Fn[a];Fe(()=>{w.current?.complete&&g(!0)},[]);const z=Ae(()=>g(!0),[]),M=Ae(()=>y(!0),[]),I=Ae(()=>{d&&!x&&v(!0)},[d,x]),D=Ae(()=>v(!1),[]);Fe(()=>{if(!b)return;const e=e=>{"Escape"===e.key&&D()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[b,D]);const W="skeleton"===o&&!m&&!x,L=W&&!f?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},R=x?null:/* @__PURE__ */Ue("img",{ref:w,src:k,alt:S||void 0,role:S?void 0:"img","aria-label":S?void 0:"Image",loading:s?"lazy":void 0,onLoad:z,onError:M,onClick:d?I:void 0,className:le(K("block w-full h-full"),d&&!x?K("cursor-pointer"):""),style:{objectFit:r,borderRadius:$,opacity:m?1:0,transition:f?"none":"opacity 200ms ease",position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0},...h}),T=x?n?/* @__PURE__ */Ue(Ke,{children:n}):/* @__PURE__ */Ye("div",{role:"img","aria-label":S||"Image failed to load",className:K("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:p.surfaceAlt,borderRadius:$,color:p.textMuted,minHeight:"80px"},children:[/* @__PURE__ */Ue(En,{color:p.textMuted,size:32}),/* @__PURE__ */Ue("span",{className:K("text-xs"),style:{color:p.textMuted},children:"Failed to load"})]}):null,A=W?/* @__PURE__ */Ue("div",{"aria-hidden":"true",style:{position:"auto"===i?void 0:"absolute",inset:"auto"===i?void 0:0,width:"100%",height:"auto"===i?"100%":void 0,minHeight:"auto"===i?"80px":void 0,borderRadius:$,backgroundColor:p.surfaceAlt,...L}}):null,B=/* @__PURE__ */Ye("div","auto"===i?{className:K("relative w-full"),style:{borderRadius:$},children:[A,R,T]}:{className:K("relative w-full overflow-hidden"),style:{paddingBottom:Bn[i],borderRadius:$},children:[A,R,T]}),F=C?/* @__PURE__ */Ye("figure",{className:K("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:$},children:[B,/* @__PURE__ */Ue("figcaption",{className:K("text-sm text-center"),style:{color:p.textMuted},children:C})]}):B;/* @__PURE__ */
106
+ return Ye(Ke,{children:[/* @__PURE__ */Ue("div",{className:le(K("inline-block w-full"),c),style:u,children:F}),b&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{role:"dialog","aria-modal":"true","aria-label":S||"Image preview",className:K("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:D,children:[
107
+ /* @__PURE__ */Ue("div",{"aria-hidden":"true",className:K("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),
108
+ /* @__PURE__ */Ue("img",{src:k,alt:S||"Full-size preview",onClick:e=>e.stopPropagation(),className:K("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),
109
+ /* @__PURE__ */Ue("button",{"aria-label":"Close preview",onClick:D,className:K("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:/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null]})}function Hn(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Pn({mimeType:e,color:t}){return e.startsWith("image/")?/* @__PURE__ */Ye("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[
110
+ /* @__PURE__ */Ue("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),
111
+ /* @__PURE__ */Ue("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),
112
+ /* @__PURE__ */Ue("path",{d:"M21 15l-5-5L5 21"})]}):/* @__PURE__ */Ye("svg","application/pdf"===e?{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[
113
+ /* @__PURE__ */Ue("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),
114
+ /* @__PURE__ */Ue("polyline",{points:"14 2 14 8 20 8"}),
115
+ /* @__PURE__ */Ue("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),
116
+ /* @__PURE__ */Ue("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}:{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),/* @__PURE__ */Ue("polyline",{points:"14 2 14 8 20 8"})]})}var On=0;function Vn({accept:e,multiple:t=!1,maxSize:n,maxFiles:o,onChange:r,onError:i,label:a,hint:l,isDisabled:s=!1,preview:d=!0,dragDrop:c=!0,variant:u="dropzone"}){const h=N(),p=$e(),f=a??p.uploadFiles??"Upload files",m=p.dropFiles?.replace(/^.*$/,p.dropFiles)??"Drop files here",g=ge(),x=Ee(),y=Oe(null),[b,v]=Ve(!1),[w,k]=Ve([]);Fe(()=>()=>{w.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);const S=Ae(e=>{let t=0;const n=setInterval(()=>{t+=Math.floor(20*Math.random())+10,t>=100&&(t=100,clearInterval(n)),k(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),C=Ae(t=>n&&t.size>n?`"${j(t.name)}" exceeds max size of ${Hn(n)}`:/[\u0000-\u001F\u007F]|\.\.\/|\.\.\\/.test(t.name)?`"${j(t.name)}" contains forbidden characters`:e&&!e.split(",").map(e=>e.trim()).some(e=>e.startsWith(".")?t.name.toLowerCase().endsWith(e.toLowerCase()):e.endsWith("/*")?t.type.startsWith(e.slice(0,-1)):t.type===e)?`"${j(t.name)}" is not an accepted file type`:void 0,[e,n]),$=Ae(async e=>{if(!e.error)try{const t=await Q(e.file);if(t&&e.file.type&&!e.file.type.startsWith(t.split("/")[0])){const t=`"${j(e.file.name)}" file content does not match its type`;k(n=>n.map(n=>n.id===e.id?{...n,error:t}:n)),i?.(t)}}catch{}},[i]),z=Ae(e=>{const n=o?o-w.length:1/0;if(n<=0)return void i?.(`Maximum of ${o} file${1===o?"":"s"} allowed`);const a=e.slice(0,n).map(e=>{const t=C(e),n=d&&e.type.startsWith("image/")&&!t?URL.createObjectURL(e):void 0;return{file:e,id:"tkx-file-"+ ++On,objectUrl:n,progress:0,error:t}});k(e=>{const n=t?[...e,...a]:a,o=n.filter(e=>!e.error).map(e=>e.file);return r?.(o),n}),a.forEach(e=>{e.error?i?.(e.error):$(e)}),a.forEach(e=>{e.error||S(e.id)})},[w.length,o,t,r,i,d,S,C]),M=Ae(e=>{const t=Array.from(e.target.files??[]);t.length&&z(t),e.target.value=""},[z]),I=Ae(e=>{if(e.preventDefault(),v(!1),s)return;const t=Array.from(e.dataTransfer.files);t.length&&z(t)},[s,z]),D=Ae(e=>{e.preventDefault(),s||v(!0)},[s]),W=Ae(()=>v(!1),[]),L=Ae(e=>{k(t=>{const n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);const o=t.filter(t=>t.id!==e);return r?.(o.filter(e=>!e.error).map(e=>e.file)),o})},[r]),R=Ae(()=>{s||y.current?.click()},[s]),T=b?h.primary:h.border,A=j(f),B=l?j(l):"",F=/* @__PURE__ */Ye("div",{role:"button",tabIndex:s?-1:0,"aria-label":A,"aria-describedby":l?x:void 0,"aria-disabled":s,onClick:R,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),R())},onDrop:c?I:void 0,onDragOver:c?D:void 0,onDragLeave:c?W:void 0,className:K("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${T}`,backgroundColor:b?`${h.primary}10`:h.surface,cursor:s?"not-allowed":"pointer",opacity:s?.5:1,transition:g?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[/* @__PURE__ */Ye("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:b?h.primary:h.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[
117
+ /* @__PURE__ */Ue("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
118
+ /* @__PURE__ */Ue("polyline",{points:"17 8 12 3 7 8"}),
119
+ /* @__PURE__ */Ue("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),/* @__PURE__ */Ye("div",{className:K("text-center"),children:[/* @__PURE__ */Ue("p",{className:K("m-0 text-sm font-medium"),style:{color:h.text},children:b?m:A}),B&&/* @__PURE__ */Ue("p",{id:x,className:K("m-0 text-xs mt-1"),style:{color:h.textMuted},children:B})]})]}),E=/* @__PURE__ */Ye("button",{type:"button",disabled:s,onClick:R,"aria-describedby":l?x:void 0,className:K("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:h.primary,color:h.bg,opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[
120
120
  /* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[
121
- /* @__PURE__ */Ve("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
122
- /* @__PURE__ */Ve("polyline",{points:"17 8 12 3 7 8"}),
123
- /* @__PURE__ */Ve("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),D,a&&/* @__PURE__ */Ve("span",{id:f,className:V("sr-only"),children:R})]});/* @__PURE__ */
124
- return Ye("div",{className:V("flex flex-col gap-3 w-full font-sans"),children:[
125
- /* @__PURE__ */Ve("input",{ref:m,type:"file",accept:e,multiple:t,disabled:s,onChange:$,className:V("sr-only"),tabIndex:-1,"aria-hidden":"true"}),"dropzone"===u?T:B,y.length>0&&/* @__PURE__ */Ve("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:V("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:y.map(e=>/* @__PURE__ */Ye("li",{className:V("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:h.surfaceAlt,border:`1px solid ${e.error?h.danger:h.border}`},children:[/* @__PURE__ */Ye("div",{className:V("flex items-center gap-3"),children:[e.objectUrl&&d?/* @__PURE__ */Ve("img",{src:e.objectUrl,alt:E(e.file.name),className:V("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ve("span",{style:{flexShrink:0},children:/* @__PURE__ */Ve(Hn,{mimeType:e.file.type,color:e.error?h.danger:h.textMuted})}),
126
- /* @__PURE__ */Ye("div",{className:V("flex flex-col gap-0.5 flex-1 min-w-0"),children:[/* @__PURE__ */Ve("span",{className:V("text-sm font-medium truncate"),style:{color:e.error?h.danger:h.text},title:e.file.name,children:E(e.file.name)}),/* @__PURE__ */Ye("span",{className:V("text-xs"),style:{color:h.textMuted},children:[En(e.file.size),e.error&&` — ${e.error}`]})]}),
127
- /* @__PURE__ */Ve("button",{type:"button","aria-label":`Remove ${E(e.file.name)}`,onClick:()=>I(e.id),className:V("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:h.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!e.error&&e.progress<100&&/* @__PURE__ */Ve("div",{className:V("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:h.border},"aria-hidden":"true",children:/* @__PURE__ */Ve("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:h.primary,width:`${e.progress}%`,transition:p?"none":"width 100ms ease"}})})]},e.id))})]})}var Pn={sm:16,md:24,lg:32,xl:40};function Vn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
128
- return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ve("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ve("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ve("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ve("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&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Yn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
129
- return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ve("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ve("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ve("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ve("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&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Un({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
130
- return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ve("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ve("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ve("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ve("circle",{cx:"12",cy:"12",r:"9",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5})]})}function Kn({type:e,size:t,filled:n,color:o,halfFilled:r,uid:i}){/* @__PURE__ */
131
- return Ve("heart"===e?Yn:"circle"===e?Un:Vn,{size:t,filled:n,color:o,halfFilled:r,id:i})}function Xn(e,t,n){return Math.min(n,Math.max(t,e))}function qn(e,t,n){if(1===n)return t+1;const o=e.currentTarget.getBoundingClientRect(),r=o.left+o.width/2;return e.clientX<r?t+.5:t+1}function Gn({value:e,defaultValue:t=0,onChange:n,max:o=5,precision:r=1,size:i="md",isReadOnly:l=!1,isDisabled:a=!1,label:s,showValue:d=!1,colorScheme:c="warning",emptyIcon:u="star",filledIcon:h="star"}){const p=b(),f=me(),m=Fe(),g=void 0!==e,[x,y]=Oe(t),[v,w]=Oe(null),k=je(null),C=g?e??0:x,S=v??C,$={warning:p.warning,primary:p.primary,danger:p.danger}[c]??p.warning,z=Pn[i],N=!l&&!a,M=Te(e=>{g||y(e),n?.(e)},[g,n]),I=Te((e,t)=>{N&&w(qn(e,t,r))},[N,r]),L=Te(()=>{N&&w(null)},[N]),W=Te((e,t)=>{if(!N)return;const n=qn(e,t,r);M(n===C?0:n)},[N,r,C,M]),D=Te(e=>{if(!N)return;const t=r;let n=C;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=Xn(C+t,0,o);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=Xn(C-t,0,o);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=o}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,r),M(n)},[N,C,o,r,M]),R=s?E(s):"Rating";/* @__PURE__ */
132
- return Ye("div",{className:le(V("inline-flex items-center gap-2 font-sans"),a?V("opacity-50"):""),children:[/* @__PURE__ */Ve("div",{ref:k,role:"radiogroup","aria-label":R,"aria-disabled":a,"aria-readonly":l,tabIndex:N?0:-1,onKeyDown:D,onMouseLeave:L,className:V("flex items-center gap-0.5 outline-none"),style:{cursor:N?"pointer":"default"},children:Array.from({length:o},(e,t)=>{const n=t+1,o=t+.5,i=S>=n,l=!i&&.5===r&&S>=o,a=`${m}-${t}`;/* @__PURE__ */
133
- return Ve("span",{role:"radio","aria-checked":.5===r&&C===o||C===n,"aria-label":.5===r?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>I(e,t),onClick:e=>W(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:f?"none":"transform 120ms ease",transform:null!==v&&S>=o&&N?"scale(1.15)":"scale(1)"},children:/* @__PURE__ */Ve(Kn,{type:i||l?h:u,size:z,filled:i,halfFilled:l,color:i||l?$:p.border,uid:l?a:void 0})},t)})}),d&&/* @__PURE__ */Ye("span",{className:V("text-sm tabular-nums"),style:{color:p.textMuted},"aria-live":"polite","aria-atomic":"true",children:[C%1==0?C.toFixed(0):C.toFixed(1)," / ",o]})]})}var _n=!1;function Zn(){/* @__PURE__ */
121
+ /* @__PURE__ */Ue("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
122
+ /* @__PURE__ */Ue("polyline",{points:"17 8 12 3 7 8"}),
123
+ /* @__PURE__ */Ue("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),A,l&&/* @__PURE__ */Ue("span",{id:x,className:K("sr-only"),children:B})]});/* @__PURE__ */
124
+ return Ye("div",{className:K("flex flex-col gap-3 w-full font-sans"),children:[
125
+ /* @__PURE__ */Ue("input",{ref:y,type:"file",accept:e,multiple:t,disabled:s,onChange:M,className:K("sr-only"),tabIndex:-1,"aria-hidden":"true"}),"dropzone"===u?F:E,w.length>0&&/* @__PURE__ */Ue("ul",{role:"status","aria-live":"polite","aria-label":p.uploadFiles??"Uploaded files",className:K("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(e=>/* @__PURE__ */Ye("li",{className:K("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:h.surfaceAlt,border:`1px solid ${e.error?h.danger:h.border}`},children:[/* @__PURE__ */Ye("div",{className:K("flex items-center gap-3"),children:[e.objectUrl&&d?/* @__PURE__ */Ue("img",{src:e.objectUrl,alt:j(e.file.name),className:K("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ue("span",{style:{flexShrink:0},children:/* @__PURE__ */Ue(Pn,{mimeType:e.file.type,color:e.error?h.danger:h.textMuted})}),
126
+ /* @__PURE__ */Ye("div",{className:K("flex flex-col gap-0.5 flex-1 min-w-0"),children:[/* @__PURE__ */Ue("span",{className:K("text-sm font-medium truncate"),style:{color:e.error?h.danger:h.text},title:e.file.name,children:j(e.file.name)}),/* @__PURE__ */Ye("span",{className:K("text-xs"),style:{color:h.textMuted},children:[Hn(e.file.size),e.error&&` — ${e.error}`]})]}),
127
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":`Remove ${j(e.file.name)}`,onClick:()=>L(e.id),className:K("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:h.textMuted,flexShrink:0},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!e.error&&e.progress<100&&/* @__PURE__ */Ue("div",{className:K("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:h.border},"aria-hidden":"true",children:/* @__PURE__ */Ue("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:h.primary,width:`${e.progress}%`,transition:g?"none":"width 100ms ease"}})})]},e.id))})]})}var Kn={sm:16,md:24,lg:32,xl:40};function Un({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
128
+ return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ue("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ue("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&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Yn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
129
+ return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ue("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ue("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&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Xn({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;/* @__PURE__ */
130
+ return Ye("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&/* @__PURE__ */Ue("defs",{children:/* @__PURE__ */Ye("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:n}),/* @__PURE__ */Ue("stop",{offset:"50%",stopColor:"transparent"})]})}),/* @__PURE__ */Ue("circle",{cx:"12",cy:"12",r:"9",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5})]})}function qn({type:e,size:t,filled:n,color:o,halfFilled:r,uid:i}){/* @__PURE__ */
131
+ return Ue("heart"===e?Yn:"circle"===e?Xn:Un,{size:t,filled:n,color:o,halfFilled:r,id:i})}function _n(e,t,n){return Math.min(n,Math.max(t,e))}function Zn(e,t,n){if(1===n)return t+1;const o=e.currentTarget.getBoundingClientRect(),r=o.left+o.width/2;return e.clientX<r?t+.5:t+1}function Gn({value:e,defaultValue:t=0,onChange:n,max:o=5,precision:r=1,size:i="md",isReadOnly:a=!1,isDisabled:l=!1,label:s,showValue:d=!1,colorScheme:c="warning",emptyIcon:u="star",filledIcon:h="star"}){const p=N(),f=ge(),m=Ee(),g=void 0!==e,[x,y]=Ve(t),[b,v]=Ve(null),w=Oe(null),k=g?e??0:x,S=b??k,C={warning:p.warning,primary:p.primary,danger:p.danger}[c]??p.warning,$=Kn[i],z=!a&&!l,M=Ae(e=>{g||y(e),n?.(e)},[g,n]),I=Ae((e,t)=>{z&&v(Zn(e,t,r))},[z,r]),D=Ae(()=>{z&&v(null)},[z]),W=Ae((e,t)=>{if(!z)return;const n=Zn(e,t,r);M(n===k?0:n)},[z,r,k,M]),L=Ae(e=>{if(!z)return;const t=r;let n=k;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=_n(k+t,0,o);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=_n(k-t,0,o);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=o}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,r),M(n)},[z,k,o,r,M]),R=s?j(s):"Rating";/* @__PURE__ */
132
+ return Ye("div",{className:le(K("inline-flex items-center gap-2 font-sans"),l?K("opacity-50"):""),children:[/* @__PURE__ */Ue("div",{ref:w,role:"radiogroup","aria-label":R,"aria-disabled":l,"aria-readonly":a,tabIndex:z?0:-1,onKeyDown:L,onMouseLeave:D,className:K("flex items-center gap-0.5 outline-none"),style:{cursor:z?"pointer":"default"},children:Array.from({length:o},(e,t)=>{const n=t+1,o=t+.5,i=S>=n,a=!i&&.5===r&&S>=o,l=`${m}-${t}`;/* @__PURE__ */
133
+ return Ue("span",{role:"radio","aria-checked":.5===r&&k===o||k===n,"aria-label":.5===r?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>I(e,t),onClick:e=>W(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:f?"none":"transform 120ms ease",transform:null!==b&&S>=o&&z?"scale(1.15)":"scale(1)"},children:/* @__PURE__ */Ue(qn,{type:i||a?h:u,size:$,filled:i,halfFilled:a,color:i||a?C:p.border,uid:a?l:void 0})},t)})}),d&&/* @__PURE__ */Ye("span",{className:K("text-sm tabular-nums"),style:{color:p.textMuted},"aria-live":"polite","aria-atomic":"true",children:[k%1==0?k.toFixed(0):k.toFixed(1)," / ",o]})]})}var Jn=!1;function Qn(){/* @__PURE__ */
134
134
  return Ye("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[
135
- /* @__PURE__ */Ve("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),
136
- /* @__PURE__ */Ve("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),
137
- /* @__PURE__ */Ve("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function Jn(){/* @__PURE__ */
138
- return Ye("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),/* @__PURE__ */Ve("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 Qn(){const e=b();/* @__PURE__ */
139
- return Ye("div",{className:V("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:[
140
- /* @__PURE__ */Ve("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),
141
- /* @__PURE__ */Ve("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),
142
- /* @__PURE__ */Ve("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function eo({message:e,showTimestamp:t,avatarUser:n,avatarAssistant:o}){const r=b(),i=me(),{role:l,content:a,timestamp:s,isStreaming:d,error:c}=e,u=E(a),h=s?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(s):null;if("system"===l)/* @__PURE__ */return Ve("div",{role:"listitem",className:V("flex justify-center my-2"),children:/* @__PURE__ */Ve("p",{className:V("text-xs italic px-3 py-1 rounded-full"),style:{color:r.textMuted,backgroundColor:r.surfaceAlt},children:u})});const p="user"===l,f=p?n??/* @__PURE__ */Ve(Zn,{}):o??/* @__PURE__ */Ve(Jn,{}),m=p?{backgroundColor:r.primary,color:r.bg}:{backgroundColor:r.surface,color:r.text,border:`1px solid ${c?r.danger:r.border}`};return c&&(m.borderColor=r.danger,m.borderWidth="2px"),/* @__PURE__ */Ye("div",{role:"listitem",className:V("flex gap-2 mb-4",p?"flex-row-reverse":"flex-row"),children:[/* @__PURE__ */Ve("div",{className:V("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:p?r.primary:r.secondary},children:f}),/* @__PURE__ */Ye("div",{className:V("flex flex-col gap-1 max-w-[75%]",p?"items-end":"items-start"),children:[/* @__PURE__ */Ye("div",{className:le(V("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),d&&!i?"tkx-cursor":""),style:m,children:[u,c&&/* @__PURE__ */Ve("span",{"aria-label":"Error",style:{marginLeft:6,color:r.danger},children:"⚠"})]}),t&&h&&/* @__PURE__ */Ve("span",{className:V("text-[10px]"),style:{color:r.textMuted},children:h})]})]})}function to({messages:e,onSend:t,isLoading:n=!1,placeholder:o="Type a message…",maxLength:r,showTimestamps:i=!1,avatarUser:l,avatarAssistant:a,height:s=480,inputPosition:d="bottom"}){const c=b(),u=me(),[h,p]=Oe(""),f=je(null),m=je(null);Ae(()=>{!function(){if(_n||"undefined"==typeof document)return;_n=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }\n @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }\n .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }\n .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }\n .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }\n .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }\n ",document.head.appendChild(e)}()},[]),Ae(()=>{const e=f.current;e&&e.scrollTo({top:e.scrollHeight,behavior:u?"auto":"smooth"})},[e,n,u]);const g=Te(()=>{const e=h.trim();e&&t&&(t(e),p(""),m.current&&(m.current.style.height="auto"))},[h,t]),x=Te(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},[g]),y=Te(e=>{p(r?e.target.value.slice(0,r):e.target.value);const t=m.current;if(t){t.style.height="auto";const e=120;t.style.height=`${Math.min(t.scrollHeight,e)}px`}},[r]),v=h.trim().length>0&&!n,w="number"==typeof s?`${s}px`:s,k="floating"===d,C=/* @__PURE__ */Ye("div",{className:V("flex flex-col gap-1 p-3"),style:k?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:c.surface,border:`1px solid ${c.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${c.border}`,backgroundColor:c.surface},children:[/* @__PURE__ */Ye("div",{className:V("flex items-end gap-2"),children:[/* @__PURE__ */Ve("textarea",{ref:m,rows:1,value:h,onChange:y,onKeyDown:x,placeholder:E(o),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:V("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:c.text,caretColor:c.primary,minHeight:32,maxHeight:120}}),/* @__PURE__ */Ve("button",{onClick:g,disabled:!v,"aria-label":"Send message",className:V("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!u&&"transition-opacity duration-150",v?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:c.primary,color:c.bg},children:/* @__PURE__ */Ve("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),r&&/* @__PURE__ */Ye("div",{className:V("text-right text-[10px]"),style:{color:c.textMuted},children:[h.length,"/",r]})]});/* @__PURE__ */
143
- return Ye("div",{className:V("flex flex-col overflow-hidden rounded-2xl"),style:{height:w,backgroundColor:c.bg,border:`1px solid ${c.border}`,position:"relative"},children:[/* @__PURE__ */Ve("div",{ref:f,role:"log","aria-live":"polite","aria-label":"Chat messages",className:V("flex-1 overflow-y-auto p-4"),style:{paddingBottom:k?80:void 0},children:/* @__PURE__ */Ye("div",{role:"list",children:[e.map(e=>/* @__PURE__ */Ve(eo,{message:e,showTimestamp:i,avatarUser:l,avatarAssistant:a},e.id)),n&&/* @__PURE__ */Ye("div",{role:"listitem",className:V("flex gap-2 mb-4"),children:[/* @__PURE__ */Ve("div",{className:V("w-8 h-8 shrink-0")}),/* @__PURE__ */Ve(Qn,{})]})]})}),C]})}var no={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},oo={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},ro={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},io={sm:12,md:14,lg:16};function lo({variant:e="subtle",size:t="md",colorScheme:n="default",onRemove:o,leftIcon:r,isDisabled:i=!1,clickable:l=!1,children:a,className:s,style:d,onClick:c,...u}){b();const h=me(),p=function(e,t){const n=b(),o={default:n.textMuted,primary:n.primary,secondary:n.secondary,success:n.success,danger:n.danger,warning:n.warning,info:n.info}[e];return"solid"===t?{bg:o,color:n.bg,border:"transparent"}:"subtle"===t?{bg:`${o}22`,color:o,border:"transparent"}:{bg:"transparent",color:o,border:o}}(n,e),f="string"==typeof a?E(a):a,m=io[t],g=V("inline-flex items-center font-medium rounded-full select-none",no[t],oo[t],ro[t],i?"opacity-50 cursor-not-allowed":l?"cursor-pointer":"cursor-default",l&&!h&&"transition-opacity duration-150");/* @__PURE__ */
144
- return Ye("span",{role:l?"button":void 0,tabIndex:l&&!i?0:void 0,"aria-disabled":i||void 0,className:le(g,s),style:{backgroundColor:p.bg,color:p.color,border:`1px solid ${"transparent"===p.border?"transparent":p.border}`,...d},onClick:i?void 0:c,onKeyDown:l&&!i&&c?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c(e))}:void 0,...u,children:[r&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",className:V("shrink-0 flex items-center"),children:r}),
145
- /* @__PURE__ */Ve("span",{children:f}),o&&!i&&/* @__PURE__ */Ve("button",{type:"button","aria-label":`Remove ${"string"==typeof a?a:"tag"}`,onClick:e=>{e.stopPropagation(),o()},className:V("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:m+4,height:m+4,color:p.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:/* @__PURE__ */Ve("svg",{width:m,height:m,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}function ao({value:e,defaultValue:t=[],onChange:n,placeholder:o="Add tag…",maxTags:r,allowDuplicates:i=!1,validate:l,colorScheme:a="primary",size:s="md",label:d,hint:c,isDisabled:u=!1}){const h=b(),p=me(),[f,m]=Oe(t),[g,x]=Oe(""),[y,v]=Oe(null),w=je(null),k=void 0!==e,C=k?e:f,S=Te(e=>{k||m(e),n?.(e)},[k,n]),$=Te(e=>{const t=e.trim();if(t)if(void 0!==r&&C.length>=r)v(`Maximum ${r} tags allowed`);else if(i||!C.includes(t)){if(l){const e=l(t);if(!1===e)return void v("Invalid tag");if("string"==typeof e)return void v(e)}v(null),S([...C,t]),x("")}else v("Duplicate tags are not allowed")},[C,r,i,l,S]),z=Te(e=>{S(C.filter((t,n)=>n!==e)),v(null)},[C,S]),N=Te(e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),$(g)):"Backspace"===e.key&&""===g&&C.length>0&&z(C.length-1)},[g,C,$,z]),M=Te(e=>{const t=e.target.value;t.endsWith(",")?$(t.slice(0,-1)):(x(t),y&&v(null))},[$,y]),I="sm"===s?"6px 8px":"lg"===s?"10px 12px":"8px 10px",L="sm"===s?11:"lg"===s?14:12;/* @__PURE__ */
146
- return Ye("div",{className:V("flex flex-col gap-1.5"),children:[d&&/* @__PURE__ */Ve("label",{className:V("text-sm font-medium"),style:{color:h.text},onClick:()=>w.current?.focus(),children:E(d)}),
147
- /* @__PURE__ */Ye("div",{className:V("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!p&&"transition-colors duration-150"),style:{padding:I,backgroundColor:h.surface,border:`1.5px solid ${y?h.danger:h.border}`,opacity:u?.55:1,minHeight:"sm"===s?36:"lg"===s?48:40},onClick:()=>!u&&w.current?.focus(),children:[C.map((e,t)=>/* @__PURE__ */Ve(lo,{size:s,variant:"subtle",colorScheme:a,onRemove:u?void 0:()=>z(t),isDisabled:u,children:e},`${e}-${t}`)),(!r||C.length<r)&&!u&&/* @__PURE__ */Ve("input",{ref:w,type:"text",value:g,onChange:M,onKeyDown:N,placeholder:0===C.length?E(o):"",disabled:u,className:V("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:L,color:h.text,caretColor:h.primary},"aria-label":d??"Tag input"})]}),y&&/* @__PURE__ */Ve("p",{className:V("text-xs"),style:{color:h.danger},role:"alert",children:y}),c&&!y&&/* @__PURE__ */Ve("p",{className:V("text-xs"),style:{color:h.textMuted},children:E(c)})]})}var so=!1;function co({status:e="pending",icon:t,size:n=28}){const o=b(),r=me(),i=function(e="pending"){const t=b();return{completed:t.success,active:t.primary,pending:t.border,error:t.danger}[e]}(e),l="active"===e;/* @__PURE__ */
148
- return Ve("div",{className:le(V("relative flex items-center justify-center rounded-full shrink-0 z-10"),l&&!r?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:"pending"===e?o.surface:i,border:`2px solid ${i}`,color:"pending"===e?i:o.bg},"aria-hidden":"true",children:/* @__PURE__ */Ve("span",t?{style:{fontSize:.45*n,lineHeight:1},children:t}:{style:{width:.35*n,height:.35*n,borderRadius:"50%",backgroundColor:"pending"===e?i:o.bg,display:"block"}})})}function uo({style:e,color:t,animate:n}){return b(),/* @__PURE__ */Ve("div",{className:le(V("w-0.5 flex-1 min-h-[24px]"),n?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${t}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:t,marginLeft:1},"aria-hidden":"true"})}function ho({style:e,color:t,animate:n}){/* @__PURE__ */
149
- return Ve("div",{className:le(V("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":"true"})}function po({item:e,compact:t}){const n=b(),o=e.timestamp?E(e.timestamp):null;/* @__PURE__ */
150
- return Ye("div",{className:V("flex flex-col gap-0.5",t?"pb-3":"pb-5"),children:[/* @__PURE__ */Ye("div",{className:V("flex items-center gap-2 flex-wrap"),children:[
151
- /* @__PURE__ */Ve("span",{className:V("text-sm font-semibold leading-snug"),style:{color:n.text},children:"string"==typeof e.title?E(e.title):e.title}),e.badge&&/* @__PURE__ */Ve("span",{children:e.badge}),o&&/* @__PURE__ */Ve("span",{className:V("text-[11px] ml-auto"),style:{color:n.textMuted},children:o})]}),e.description&&!t&&/* @__PURE__ */Ve("div",{className:V("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:"string"==typeof e.description?E(e.description):e.description})]})}function fo({items:e,variant:t="default",orientation:n="vertical",connectorStyle:o="solid"}){const r=b(),i=me(),l=je(!1);Ae(()=>{!function(){if(so||"undefined"==typeof document)return;so=!0;const e=document.createElement("style");e.textContent="\n @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; } }\n @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }\n @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }\n .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }\n .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }\n .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }\n ",document.head.appendChild(e)}(),l.current=!0},[]);const a=!i,s="compact"===t,d="alternating"===t&&"vertical"===n;/* @__PURE__ */
152
- return Ve("div","horizontal"===n?{role:"list","aria-label":"Timeline",className:V("flex items-start w-full overflow-x-auto"),children:e.map((t,n)=>{const i=t.status??"pending",l="completed"===i?r.success:r.border,s=n===e.length-1;/* @__PURE__ */
153
- return Ve("div",{role:"listitem",className:V("flex items-start flex-1 min-w-0"),children:/* @__PURE__ */Ye("div",{className:V("flex flex-col items-center flex-1 min-w-0"),children:[/* @__PURE__ */Ye("div",{className:V("flex items-center w-full"),children:[n>0&&/* @__PURE__ */Ve(ho,{style:o,color:l,animate:a}),
154
- /* @__PURE__ */Ve(co,{status:i,icon:t.icon,size:24}),!s&&/* @__PURE__ */Ve(ho,{style:o,color:l,animate:a})]}),/* @__PURE__ */Ye("div",{className:V("mt-2 px-1 text-center min-w-0 w-full"),children:[/* @__PURE__ */Ve("div",{className:V("text-xs font-semibold truncate"),style:{color:r.text},children:"string"==typeof t.title?E(t.title):t.title}),t.timestamp&&/* @__PURE__ */Ve("div",{className:V("text-[10px] mt-0.5"),style:{color:r.textMuted},children:E(t.timestamp)})]})]})},t.id)})}:{role:"list","aria-label":"Timeline",className:V("flex flex-col"),children:e.map((t,n)=>{const i=t.status??"pending",l=n===e.length-1,c="completed"===i?r.success:r.border,u=d&&n%2==0;/* @__PURE__ */
155
- return Ye("div",d?{role:"listitem",className:V("flex items-stretch gap-0"),children:[
156
- /* @__PURE__ */Ve("div",{className:V("flex-1 flex flex-col items-end pr-4",u?"":"invisible"),children:u&&/* @__PURE__ */Ve(po,{item:t,compact:s})}),
157
- /* @__PURE__ */Ye("div",{className:V("flex flex-col items-center"),children:[/* @__PURE__ */Ve(co,{status:i,icon:t.icon,size:28}),!l&&/* @__PURE__ */Ve(uo,{style:o,color:c,animate:a})]}),
158
- /* @__PURE__ */Ve("div",{className:V("flex-1 flex flex-col items-start pl-4",u?"invisible":""),children:!u&&/* @__PURE__ */Ve(po,{item:t,compact:s})})]}:{role:"listitem",className:V("flex gap-3 items-stretch"),children:[/* @__PURE__ */Ye("div",{className:V("flex flex-col items-center"),children:[/* @__PURE__ */Ve(co,{status:i,icon:t.icon,size:s?22:28}),!l&&/* @__PURE__ */Ve(uo,{style:o,color:c,animate:a})]}),/* @__PURE__ */Ve("div",{className:V("flex-1 min-w-0 pt-0.5"),children:/* @__PURE__ */Ve(po,{item:t,compact:s})})]},t.id)})})}function mo(e,t,n,o){const r=window.innerWidth,i=window.innerHeight;let l=0,a=0,s="top left";switch(t){case"bottom-start":l=e.bottom+6,a=e.left,s="top left",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"bottom-end":l=e.bottom+6,a=e.right-n,s="top right",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom right"),a<0&&(a=8);break;case"top-start":l=e.top-6-o,a=e.left,s="bottom left",l<0&&(l=e.bottom+6,s="top left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"top-end":l=e.top-6-o,a=e.right-n,s="bottom right",l<0&&(l=e.bottom+6,s="top right"),a<0&&(a=8);break;case"right-start":l=e.top,a=e.right+6,s="top left",a+n>r&&(a=e.left-6-n,s="top right"),l+o>i&&(l=Math.max(8,i-o-8));break;case"left-start":l=e.top,a=e.left-6-n,s="top right",a<0&&(a=e.right+6,s="top left"),l+o>i&&(l=Math.max(8,i-o-8))}return{top:l+window.scrollY,left:a+window.scrollX,transformOrigin:s}}function go(e,t){return{position:"absolute",top:t.top,left:t.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:t.transformOrigin,overflow:"hidden"}}function xo({color:e}){/* @__PURE__ */
159
- return Ve("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:/* @__PURE__ */Ve("path",{d:"M20 6L9 17l-5-5"})})}function bo({color:e}){/* @__PURE__ */
160
- return Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:"12",cy:"12",r:"5",fill:e}),/* @__PURE__ */Ve("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function yo({color:e}){/* @__PURE__ */
161
- return Ve("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M9 18l6-6-6-6"})})}function vo({items:e,pos:t,panelId:n,onClose:o,onCloseAll:r,isSubmenu:i=!1}){const l=b(),[a,s]=Oe(-1),[d,c]=Oe(null),[u,h]=Oe(null),p=je(null),[f,m]=Oe(""),g=je(null),x=function(e){const t=[];let n=0;for(const o of e)if("separator"!==o.type)if("radio-group"===o.type)for(let e=0;e<o.options.length;e++)t.push({kind:"radio",item:o,optionIdx:e,idx:n++});else"check"===o.type?t.push({kind:"check",item:o,idx:n++}):"submenu"===o.type?t.push({kind:"submenu",item:o,idx:n++}):t.push({kind:"action",item:o,idx:n++});return t}(e);Ae(()=>{p.current?.focus()},[]),Ae(()=>{a<0||(p.current?.querySelector(`[data-midx="${a}"]`))?.scrollIntoView({block:"nearest"})},[a]);const y=Te(e=>{if("action"===e.kind){if(e.item.disabled)return;e.item.onClick?.(),r()}else if("check"===e.kind){if(e.item.disabled)return;e.item.onChange?.(!e.item.checked)}else if("radio"===e.kind){if(e.item.disabled)return;e.item.onChange?.(e.item.options[e.optionIdx].value)}else if("submenu"===e.kind){if(e.item.disabled)return;c(e.item.id)}},[r]);function v(){c(null),h(null)}/* @__PURE__ */
162
- return Ye(Pe,{children:[/* @__PURE__ */Ve("style",{children:"\n@keyframes tkxMenuIn {\n from { opacity: 0; transform: scale(0.94); }\n to { opacity: 1; transform: scale(1); }\n}\n@keyframes tkxMenuInReduced {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@media (prefers-reduced-motion: no-preference) {\n .tkx-menu-panel {\n animation: tkxMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-menu-panel {\n animation: tkxMenuInReduced 100ms ease forwards;\n }\n}\n"}),/* @__PURE__ */Ve("div",{ref:p,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),s(e=>{const t=e+1;return t<x.length?t:0});break;case"ArrowUp":e.preventDefault(),s(e=>{const t=e-1;return t>=0?t:x.length-1});break;case"Home":e.preventDefault(),s(0);break;case"End":e.preventDefault(),s(x.length-1);break;case"Enter":case" ":e.preventDefault(),a>=0&&x[a]&&y(x[a]);break;case"Escape":e.preventDefault(),i?o():r();break;case"Tab":e.preventDefault(),r();break;case"ArrowRight":e.preventDefault(),a>=0&&"submenu"===x[a]?.kind&&c(x[a].item.id);break;case"ArrowLeft":e.preventDefault(),i&&o();break;default:1!==e.key.length||e.ctrlKey||e.metaKey||function(e){g.current&&clearTimeout(g.current);const t=f+e.toLowerCase();m(t);const n=x.findIndex(e=>("radio"===e.kind?e.item.options[e.optionIdx].label:e.item.label).toLowerCase().startsWith(t));n>=0&&s(n),g.current=setTimeout(()=>m(""),800)}(e.key)}},style:{...go(l,t),maxHeight:400,overflowY:"auto"},children:(()=>{let t=-1;return e.map(e=>{if("separator"===e.type)/* @__PURE__ */return Ve("div",{role:"separator",style:{margin:(e.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:e.label?/* @__PURE__ */Ye(Pe,{children:[
163
- /* @__PURE__ */Ve("div",{style:{flex:1,height:1,backgroundColor:l.border,marginLeft:14}}),
164
- /* @__PURE__ */Ve("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:E(e.label)}),
165
- /* @__PURE__ */Ve("div",{style:{flex:1,height:1,backgroundColor:l.border,marginRight:14}})]}):/* @__PURE__ */Ve("div",{style:{flex:1,height:1,backgroundColor:l.border,margin:"0 10px"}})},e.id);if("radio-group"===e.type)/* @__PURE__ */return Ye("div",{role:"group","aria-label":e.label,children:[e.label&&/* @__PURE__ */Ve("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:E(e.label)}),e.options.map((n,o)=>{t++;const r=t,i=r===a,d=n.value===e.value,c=!!e.disabled,u=wo(l,i,!1,c);/* @__PURE__ */
135
+ /* @__PURE__ */Ue("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),
136
+ /* @__PURE__ */Ue("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),
137
+ /* @__PURE__ */Ue("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function eo(){/* @__PURE__ */
138
+ return Ye("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),/* @__PURE__ */Ue("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 to(){const e=N();/* @__PURE__ */
139
+ return Ye("div",{className:K("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:[
140
+ /* @__PURE__ */Ue("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),
141
+ /* @__PURE__ */Ue("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),
142
+ /* @__PURE__ */Ue("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function no({message:e,showTimestamp:t,avatarUser:n,avatarAssistant:o}){const r=N(),i=ge(),{role:a,content:l,timestamp:s,isStreaming:d,error:c}=e,u=j(l),h=s?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(s):null;if("system"===a)/* @__PURE__ */return Ue("div",{role:"listitem",className:K("flex justify-center my-2"),children:/* @__PURE__ */Ue("p",{className:K("text-xs italic px-3 py-1 rounded-full"),style:{color:r.textMuted,backgroundColor:r.surfaceAlt},children:u})});const p="user"===a,f=p?n??/* @__PURE__ */Ue(Qn,{}):o??/* @__PURE__ */Ue(eo,{}),m=p?{backgroundColor:r.primary,color:r.bg}:{backgroundColor:r.surface,color:r.text,border:`1px solid ${c?r.danger:r.border}`};return c&&(m.borderColor=r.danger,m.borderWidth="2px"),/* @__PURE__ */Ye("div",{role:"listitem",className:K("flex gap-2 mb-4",p?"flex-row-reverse":"flex-row"),children:[/* @__PURE__ */Ue("div",{className:K("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:p?r.primary:r.secondary},children:f}),/* @__PURE__ */Ye("div",{className:K("flex flex-col gap-1 max-w-[75%]",p?"items-end":"items-start"),children:[/* @__PURE__ */Ye("div",{className:le(K("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),d&&!i?"tkx-cursor":""),style:m,children:[u,c&&/* @__PURE__ */Ue("span",{"aria-label":"Error",style:{marginLeft:6,color:r.danger},children:"⚠"})]}),t&&h&&/* @__PURE__ */Ue("span",{className:K("text-[10px]"),style:{color:r.textMuted},children:h})]})]})}function oo({messages:e,onSend:t,isLoading:n=!1,placeholder:o="Type a message…",maxLength:r,showTimestamps:i=!1,avatarUser:a,avatarAssistant:l,height:s=480,inputPosition:d="bottom"}){const c=N(),u=ge(),[h,p]=Ve(""),f=Oe(null),m=Oe(null);Fe(()=>{!function(){if(Jn||"undefined"==typeof document)return;Jn=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }\n @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }\n .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }\n .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }\n .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }\n .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }\n ",document.head.appendChild(e)}()},[]),Fe(()=>{const e=f.current;e&&e.scrollTo({top:e.scrollHeight,behavior:u?"auto":"smooth"})},[e,n,u]);const g=Ae(()=>{const e=h.trim();e&&t&&(t(e),p(""),m.current&&(m.current.style.height="auto"))},[h,t]),x=Ae(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g())},[g]),y=Ae(e=>{p(r?e.target.value.slice(0,r):e.target.value);const t=m.current;if(t){t.style.height="auto";const e=120;t.style.height=`${Math.min(t.scrollHeight,e)}px`}},[r]),b=h.trim().length>0&&!n,v="number"==typeof s?`${s}px`:s,w="floating"===d,k=/* @__PURE__ */Ye("div",{className:K("flex flex-col gap-1 p-3"),style:w?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:c.surface,border:`1px solid ${c.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${c.border}`,backgroundColor:c.surface},children:[/* @__PURE__ */Ye("div",{className:K("flex items-end gap-2"),children:[/* @__PURE__ */Ue("textarea",{ref:m,rows:1,value:h,onChange:y,onKeyDown:x,placeholder:j(o),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:K("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:c.text,caretColor:c.primary,minHeight:32,maxHeight:120}}),/* @__PURE__ */Ue("button",{onClick:g,disabled:!b,"aria-label":"Send message",className:K("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!u&&"transition-opacity duration-150",b?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:c.primary,color:c.bg},children:/* @__PURE__ */Ue("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),r&&/* @__PURE__ */Ye("div",{className:K("text-right text-[10px]"),style:{color:c.textMuted},children:[h.length,"/",r]})]});/* @__PURE__ */
143
+ return Ye("div",{className:K("flex flex-col overflow-hidden rounded-2xl"),style:{height:v,backgroundColor:c.bg,border:`1px solid ${c.border}`,position:"relative"},children:[/* @__PURE__ */Ue("div",{ref:f,role:"log","aria-live":"polite","aria-label":"Chat messages",className:K("flex-1 overflow-y-auto p-4"),style:{paddingBottom:w?80:void 0},children:/* @__PURE__ */Ye("div",{role:"list",children:[e.map(e=>/* @__PURE__ */Ue(no,{message:e,showTimestamp:i,avatarUser:a,avatarAssistant:l},e.id)),n&&/* @__PURE__ */Ye("div",{role:"listitem",className:K("flex gap-2 mb-4"),children:[/* @__PURE__ */Ue("div",{className:K("w-8 h-8 shrink-0")}),/* @__PURE__ */Ue(to,{})]})]})}),k]})}var ro={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},io={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},ao={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},lo={sm:12,md:14,lg:16};function so({variant:e="subtle",size:t="md",colorScheme:n="default",onRemove:o,leftIcon:r,isDisabled:i=!1,clickable:a=!1,children:l,className:s,style:d,onClick:c,...u}){N();const h=ge(),p=function(e,t){const n=N(),o={default:n.textMuted,primary:n.primary,secondary:n.secondary,success:n.success,danger:n.danger,warning:n.warning,info:n.info}[e];return"solid"===t?{bg:o,color:n.bg,border:"transparent"}:"subtle"===t?{bg:`${o}22`,color:o,border:"transparent"}:{bg:"transparent",color:o,border:o}}(n,e),f="string"==typeof l?j(l):l,m=lo[t],g=K("inline-flex items-center font-medium rounded-full select-none",ro[t],io[t],ao[t],i?"opacity-50 cursor-not-allowed":a?"cursor-pointer":"cursor-default",a&&!h&&"transition-opacity duration-150");/* @__PURE__ */
144
+ return Ye("span",{role:a?"button":void 0,tabIndex:a&&!i?0:void 0,"aria-disabled":i||void 0,className:le(g,s),style:{backgroundColor:p.bg,color:p.color,border:`1px solid ${"transparent"===p.border?"transparent":p.border}`,...d},onClick:i?void 0:c,onKeyDown:a&&!i&&c?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c(e))}:void 0,...u,children:[r&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("shrink-0 flex items-center"),children:r}),
145
+ /* @__PURE__ */Ue("span",{children:f}),o&&!i&&/* @__PURE__ */Ue("button",{type:"button","aria-label":`Remove ${"string"==typeof l?l:"tag"}`,onClick:e=>{e.stopPropagation(),o()},className:K("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:m+4,height:m+4,color:p.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:/* @__PURE__ */Ue("svg",{width:m,height:m,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}function co({value:e,defaultValue:t=[],onChange:n,placeholder:o="Add tag…",maxTags:r,allowDuplicates:i=!1,validate:a,colorScheme:l="primary",size:s="md",label:d,hint:c,isDisabled:u=!1}){const h=N(),p=ge(),[f,m]=Ve(t),[g,x]=Ve(""),[y,b]=Ve(null),v=Oe(null),w=void 0!==e,k=w?e:f,S=Ae(e=>{w||m(e),n?.(e)},[w,n]),C=Ae(e=>{const t=e.trim();if(t)if(void 0!==r&&k.length>=r)b(`Maximum ${r} tags allowed`);else if(i||!k.includes(t)){if(a){const e=a(t);if(!1===e)return void b("Invalid tag");if("string"==typeof e)return void b(e)}b(null),S([...k,t]),x("")}else b("Duplicate tags are not allowed")},[k,r,i,a,S]),$=Ae(e=>{S(k.filter((t,n)=>n!==e)),b(null)},[k,S]),z=Ae(e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),C(g)):"Backspace"===e.key&&""===g&&k.length>0&&$(k.length-1)},[g,k,C,$]),M=Ae(e=>{const t=e.target.value;t.endsWith(",")?C(t.slice(0,-1)):(x(t),y&&b(null))},[C,y]),I="sm"===s?"6px 8px":"lg"===s?"10px 12px":"8px 10px",D="sm"===s?11:"lg"===s?14:12;/* @__PURE__ */
146
+ return Ye("div",{className:K("flex flex-col gap-1.5"),children:[d&&/* @__PURE__ */Ue("label",{className:K("text-sm font-medium"),style:{color:h.text},onClick:()=>v.current?.focus(),children:j(d)}),
147
+ /* @__PURE__ */Ye("div",{className:K("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!p&&"transition-colors duration-150"),style:{padding:I,backgroundColor:h.surface,border:`1.5px solid ${y?h.danger:h.border}`,opacity:u?.55:1,minHeight:"sm"===s?36:"lg"===s?48:40},onClick:()=>!u&&v.current?.focus(),children:[k.map((e,t)=>/* @__PURE__ */Ue(so,{size:s,variant:"subtle",colorScheme:l,onRemove:u?void 0:()=>$(t),isDisabled:u,children:e},`${e}-${t}`)),(!r||k.length<r)&&!u&&/* @__PURE__ */Ue("input",{ref:v,type:"text",value:g,onChange:M,onKeyDown:z,placeholder:0===k.length?j(o):"",disabled:u,className:K("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:D,color:h.text,caretColor:h.primary},"aria-label":d??"Tag input"})]}),y&&/* @__PURE__ */Ue("p",{className:K("text-xs"),style:{color:h.danger},role:"alert",children:y}),c&&!y&&/* @__PURE__ */Ue("p",{className:K("text-xs"),style:{color:h.textMuted},children:j(c)})]})}var uo=!1;function ho({status:e="pending",icon:t,size:n=28}){const o=N(),r=ge(),i=function(e="pending"){const t=N();return{completed:t.success,active:t.primary,pending:t.border,error:t.danger}[e]}(e),a="active"===e;/* @__PURE__ */
148
+ return Ue("div",{className:le(K("relative flex items-center justify-center rounded-full shrink-0 z-10"),a&&!r?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:"pending"===e?o.surface:i,border:`2px solid ${i}`,color:"pending"===e?i:o.bg},"aria-hidden":"true",children:/* @__PURE__ */Ue("span",t?{style:{fontSize:.45*n,lineHeight:1},children:t}:{style:{width:.35*n,height:.35*n,borderRadius:"50%",backgroundColor:"pending"===e?i:o.bg,display:"block"}})})}function po({style:e,color:t,animate:n}){return N(),/* @__PURE__ */Ue("div",{className:le(K("w-0.5 flex-1 min-h-[24px]"),n?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${t}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:t,marginLeft:1},"aria-hidden":"true"})}function fo({style:e,color:t,animate:n}){/* @__PURE__ */
149
+ return Ue("div",{className:le(K("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":"true"})}function mo({item:e,compact:t}){const n=N(),o=e.timestamp?j(e.timestamp):null;/* @__PURE__ */
150
+ return Ye("div",{className:K("flex flex-col gap-0.5",t?"pb-3":"pb-5"),children:[/* @__PURE__ */Ye("div",{className:K("flex items-center gap-2 flex-wrap"),children:[
151
+ /* @__PURE__ */Ue("span",{className:K("text-sm font-semibold leading-snug"),style:{color:n.text},children:"string"==typeof e.title?j(e.title):e.title}),e.badge&&/* @__PURE__ */Ue("span",{children:e.badge}),o&&/* @__PURE__ */Ue("span",{className:K("text-[11px] ml-auto"),style:{color:n.textMuted},children:o})]}),e.description&&!t&&/* @__PURE__ */Ue("div",{className:K("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:"string"==typeof e.description?j(e.description):e.description})]})}function go({items:e,variant:t="default",orientation:n="vertical",connectorStyle:o="solid"}){const r=N(),i=ge(),a=Oe(!1);Fe(()=>{!function(){if(uo||"undefined"==typeof document)return;uo=!0;const e=document.createElement("style");e.textContent="\n @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; } }\n @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }\n @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }\n .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }\n .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }\n .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }\n ",document.head.appendChild(e)}(),a.current=!0},[]);const l=!i,s="compact"===t,d="alternating"===t&&"vertical"===n;/* @__PURE__ */
152
+ return Ue("div","horizontal"===n?{role:"list","aria-label":"Timeline",className:K("flex items-start w-full overflow-x-auto"),children:e.map((t,n)=>{const i=t.status??"pending",a="completed"===i?r.success:r.border,s=n===e.length-1;/* @__PURE__ */
153
+ return Ue("div",{role:"listitem",className:K("flex items-start flex-1 min-w-0"),children:/* @__PURE__ */Ye("div",{className:K("flex flex-col items-center flex-1 min-w-0"),children:[/* @__PURE__ */Ye("div",{className:K("flex items-center w-full"),children:[n>0&&/* @__PURE__ */Ue(fo,{style:o,color:a,animate:l}),
154
+ /* @__PURE__ */Ue(ho,{status:i,icon:t.icon,size:24}),!s&&/* @__PURE__ */Ue(fo,{style:o,color:a,animate:l})]}),/* @__PURE__ */Ye("div",{className:K("mt-2 px-1 text-center min-w-0 w-full"),children:[/* @__PURE__ */Ue("div",{className:K("text-xs font-semibold truncate"),style:{color:r.text},children:"string"==typeof t.title?j(t.title):t.title}),t.timestamp&&/* @__PURE__ */Ue("div",{className:K("text-[10px] mt-0.5"),style:{color:r.textMuted},children:j(t.timestamp)})]})]})},t.id)})}:{role:"list","aria-label":"Timeline",className:K("flex flex-col"),children:e.map((t,n)=>{const i=t.status??"pending",a=n===e.length-1,c="completed"===i?r.success:r.border,u=d&&n%2==0;/* @__PURE__ */
155
+ return Ye("div",d?{role:"listitem",className:K("flex items-stretch gap-0"),children:[
156
+ /* @__PURE__ */Ue("div",{className:K("flex-1 flex flex-col items-end pr-4",u?"":"invisible"),children:u&&/* @__PURE__ */Ue(mo,{item:t,compact:s})}),
157
+ /* @__PURE__ */Ye("div",{className:K("flex flex-col items-center"),children:[/* @__PURE__ */Ue(ho,{status:i,icon:t.icon,size:28}),!a&&/* @__PURE__ */Ue(po,{style:o,color:c,animate:l})]}),
158
+ /* @__PURE__ */Ue("div",{className:K("flex-1 flex flex-col items-start pl-4",u?"invisible":""),children:!u&&/* @__PURE__ */Ue(mo,{item:t,compact:s})})]}:{role:"listitem",className:K("flex gap-3 items-stretch"),children:[/* @__PURE__ */Ye("div",{className:K("flex flex-col items-center"),children:[/* @__PURE__ */Ue(ho,{status:i,icon:t.icon,size:s?22:28}),!a&&/* @__PURE__ */Ue(po,{style:o,color:c,animate:l})]}),/* @__PURE__ */Ue("div",{className:K("flex-1 min-w-0 pt-0.5"),children:/* @__PURE__ */Ue(mo,{item:t,compact:s})})]},t.id)})})}function xo(e,t,n,o){const r=window.innerWidth,i=window.innerHeight;let a=0,l=0,s="top left";switch(t){case"bottom-start":a=e.bottom+6,l=e.left,s="top left",a+o>i&&e.top-6-o>0&&(a=e.top-6-o,s="bottom left"),l+n>r&&(l=Math.max(0,r-n-8));break;case"bottom-end":a=e.bottom+6,l=e.right-n,s="top right",a+o>i&&e.top-6-o>0&&(a=e.top-6-o,s="bottom right"),l<0&&(l=8);break;case"top-start":a=e.top-6-o,l=e.left,s="bottom left",a<0&&(a=e.bottom+6,s="top left"),l+n>r&&(l=Math.max(0,r-n-8));break;case"top-end":a=e.top-6-o,l=e.right-n,s="bottom right",a<0&&(a=e.bottom+6,s="top right"),l<0&&(l=8);break;case"right-start":a=e.top,l=e.right+6,s="top left",l+n>r&&(l=e.left-6-n,s="top right"),a+o>i&&(a=Math.max(8,i-o-8));break;case"left-start":a=e.top,l=e.left-6-n,s="top right",l<0&&(l=e.right+6,s="top left"),a+o>i&&(a=Math.max(8,i-o-8))}return{top:a+window.scrollY,left:l+window.scrollX,transformOrigin:s}}function yo(e,t){return{position:"absolute",top:t.top,left:t.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:t.transformOrigin,overflow:"hidden"}}function bo({color:e}){/* @__PURE__ */
159
+ return Ue("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:/* @__PURE__ */Ue("path",{d:"M20 6L9 17l-5-5"})})}function vo({color:e}){/* @__PURE__ */
160
+ return Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:"12",cy:"12",r:"5",fill:e}),/* @__PURE__ */Ue("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function wo({color:e}){/* @__PURE__ */
161
+ return Ue("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M9 18l6-6-6-6"})})}function ko({items:e,pos:t,panelId:n,onClose:o,onCloseAll:r,isSubmenu:i=!1}){const a=N(),[l,s]=Ve(-1),[d,c]=Ve(null),[u,h]=Ve(null),p=Oe(null),[f,m]=Ve(""),g=Oe(null),x=function(e){const t=[];let n=0;for(const o of e)if("separator"!==o.type)if("radio-group"===o.type)for(let e=0;e<o.options.length;e++)t.push({kind:"radio",item:o,optionIdx:e,idx:n++});else"check"===o.type?t.push({kind:"check",item:o,idx:n++}):"submenu"===o.type?t.push({kind:"submenu",item:o,idx:n++}):t.push({kind:"action",item:o,idx:n++});return t}(e);Fe(()=>{p.current?.focus()},[]),Fe(()=>{l<0||(p.current?.querySelector(`[data-midx="${l}"]`))?.scrollIntoView({block:"nearest"})},[l]);const y=Ae(e=>{if("action"===e.kind){if(e.item.disabled)return;e.item.onClick?.(),r()}else if("check"===e.kind){if(e.item.disabled)return;e.item.onChange?.(!e.item.checked)}else if("radio"===e.kind){if(e.item.disabled)return;e.item.onChange?.(e.item.options[e.optionIdx].value)}else if("submenu"===e.kind){if(e.item.disabled)return;c(e.item.id)}},[r]);function b(){c(null),h(null)}/* @__PURE__ */
162
+ return Ye(Ke,{children:[/* @__PURE__ */Ue("style",{children:"\n@keyframes tkxMenuIn {\n from { opacity: 0; transform: scale(0.94); }\n to { opacity: 1; transform: scale(1); }\n}\n@keyframes tkxMenuInReduced {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@media (prefers-reduced-motion: no-preference) {\n .tkx-menu-panel {\n animation: tkxMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-menu-panel {\n animation: tkxMenuInReduced 100ms ease forwards;\n }\n}\n"}),/* @__PURE__ */Ue("div",{ref:p,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),s(e=>{const t=e+1;return t<x.length?t:0});break;case"ArrowUp":e.preventDefault(),s(e=>{const t=e-1;return t>=0?t:x.length-1});break;case"Home":e.preventDefault(),s(0);break;case"End":e.preventDefault(),s(x.length-1);break;case"Enter":case" ":e.preventDefault(),l>=0&&x[l]&&y(x[l]);break;case"Escape":e.preventDefault(),i?o():r();break;case"Tab":e.preventDefault(),r();break;case"ArrowRight":e.preventDefault(),l>=0&&"submenu"===x[l]?.kind&&c(x[l].item.id);break;case"ArrowLeft":e.preventDefault(),i&&o();break;default:1!==e.key.length||e.ctrlKey||e.metaKey||function(e){g.current&&clearTimeout(g.current);const t=f+e.toLowerCase();m(t);const n=x.findIndex(e=>("radio"===e.kind?e.item.options[e.optionIdx].label:e.item.label).toLowerCase().startsWith(t));n>=0&&s(n),g.current=setTimeout(()=>m(""),800)}(e.key)}},style:{...yo(a,t),maxHeight:400,overflowY:"auto"},children:(()=>{let t=-1;return e.map(e=>{if("separator"===e.type)/* @__PURE__ */return Ue("div",{role:"separator",style:{margin:(e.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:e.label?/* @__PURE__ */Ye(Ke,{children:[
163
+ /* @__PURE__ */Ue("div",{style:{flex:1,height:1,backgroundColor:a.border,marginLeft:14}}),
164
+ /* @__PURE__ */Ue("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:a.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:j(e.label)}),
165
+ /* @__PURE__ */Ue("div",{style:{flex:1,height:1,backgroundColor:a.border,marginRight:14}})]}):/* @__PURE__ */Ue("div",{style:{flex:1,height:1,backgroundColor:a.border,margin:"0 10px"}})},e.id);if("radio-group"===e.type)/* @__PURE__ */return Ye("div",{role:"group","aria-label":e.label,children:[e.label&&/* @__PURE__ */Ue("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:a.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:j(e.label)}),e.options.map((n,o)=>{t++;const r=t,i=r===l,d=n.value===e.value,c=!!e.disabled,u=So(a,i,!1,c);/* @__PURE__ */
166
166
  return Ye("div",{role:"menuitemradio","aria-checked":d,"aria-disabled":c||void 0,"data-midx":r,tabIndex:-1,style:u,onClick:()=>!c&&e.onChange?.(n.value),onMouseEnter:()=>!c&&s(r),children:[
167
- /* @__PURE__ */Ve("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:d?/* @__PURE__ */Ve(bo,{color:l.primary}):/* @__PURE__ */Ve("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${l.border}`,display:"inline-block"}})}),n.icon&&/* @__PURE__ */Ve("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:n.icon}),
168
- /* @__PURE__ */Ve("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(n.label)})]},n.value)})]},e.id);if("check"===e.type){t++;const n=t,o=n===a,r=!!e.disabled,i=wo(l,o,!1,r);/* @__PURE__ */
167
+ /* @__PURE__ */Ue("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:d?/* @__PURE__ */Ue(vo,{color:a.primary}):/* @__PURE__ */Ue("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${a.border}`,display:"inline-block"}})}),n.icon&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,display:"flex",color:a.textMuted},children:n.icon}),
168
+ /* @__PURE__ */Ue("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(n.label)})]},n.value)})]},e.id);if("check"===e.type){t++;const n=t,o=n===l,r=!!e.disabled,i=So(a,o,!1,r);/* @__PURE__ */
169
169
  return Ye("div",{role:"menuitemcheckbox","aria-checked":e.checked,"aria-disabled":r||void 0,"data-midx":n,tabIndex:-1,style:i,onClick:()=>!r&&e.onChange?.(!e.checked),onMouseEnter:()=>!r&&s(n),children:[
170
- /* @__PURE__ */Ve("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.checked?/* @__PURE__ */Ve(xo,{color:l.primary}):/* @__PURE__ */Ve("span",{style:{width:14,height:14,display:"inline-block"}})}),e.icon&&/* @__PURE__ */Ve("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:e.icon}),
171
- /* @__PURE__ */Ve("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(e.label)})]},e.id)}if("submenu"===e.type){t++;const o=t,i=o===a,p=!!e.disabled,f=d===e.id,m=wo(l,i||f,!1,p);/* @__PURE__ */
172
- return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ye("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":f,"aria-disabled":p||void 0,"data-midx":o,tabIndex:-1,style:m,onMouseEnter:t=>{p||(s(o),function(e,t){const n=t.getBoundingClientRect();c(e.id),h(function(e,t,n){const o=window.innerWidth,r=window.innerHeight;let i=e.right+4,l="top left";i+220>o&&(i=e.left-4-220,l="top right");let a=e.top;return a+n>r&&(a=Math.max(8,r-n-8)),{top:a+window.scrollY,left:i+window.scrollX,transformOrigin:l}}(n,0,Math.min(38*e.items.length+12,360)))}(e,t.currentTarget))},onMouseLeave:()=>{},onClick:()=>{p||c(f?null:e.id)},children:[
173
- /* @__PURE__ */Ve("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.icon?/* @__PURE__ */Ve("span",{style:{display:"flex",color:l.textMuted},children:e.icon}):/* @__PURE__ */Ve("span",{style:{width:14}})}),
174
- /* @__PURE__ */Ve("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(e.label)}),
175
- /* @__PURE__ */Ve(yo,{color:l.textMuted})]}),f&&u&&Ue(/* @__PURE__ */Ve(vo,{items:e.items,pos:u,panelId:`${n}-sub-${e.id}`,onClose:v,onCloseAll:r,isSubmenu:!0}),document.body)]},e.id)}const o=e;t++;const i=t,p=i===a,f=!!o.disabled,m=!!o.danger,g=wo(l,p,m,f);/* @__PURE__ */
176
- return Ye("div",{role:"menuitem","aria-disabled":f||void 0,"data-midx":i,tabIndex:-1,style:g,onClick:()=>{f||(o.onClick?.(),r())},onMouseEnter:()=>{f||(s(i),v())},children:[
177
- /* @__PURE__ */Ve("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:o.icon?/* @__PURE__ */Ve("span",{style:{display:"flex",color:m?l.danger:l.textMuted},children:o.icon}):/* @__PURE__ */Ve("span",{style:{width:14}})}),
178
- /* @__PURE__ */Ye("span",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ve("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(o.label)}),o.description&&/* @__PURE__ */Ve("span",{style:{display:"block",fontSize:"12px",color:l.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:E(o.description)})]}),o.shortcut&&/* @__PURE__ */Ve("span",{style:{fontSize:"12px",color:l.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:E(o.shortcut)})]},o.id)})})()})]})}function wo(e,t,n,o){const r=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:t&&n?e.danger:r,backgroundColor:t?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:o?.5:1,outline:"none"}}function ko({trigger:e,items:t,placement:n="bottom-start",isDisabled:o=!1,onOpen:r,onClose:i,className:l,style:a}){const s=`tkx-menu-${Fe().replace(/:/g,"")}`,[d,c]=Oe(!1),[u,h]=Oe(null),p=je(null),f=Te(()=>{if(o)return;const e=p.current;e&&(h(mo(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360))),c(!0),r?.())},[o,t.length,r,n]),m=Te(()=>{c(!1),i?.(),(p.current?.firstElementChild)?.focus?.()},[i]);return Ae(()=>{if(!d)return;const e=e=>{const t=e.target;if(p.current?.contains(t))return;const n=document.querySelectorAll(".tkx-menu-panel");for(const o of n)if(o.contains(t))return;m()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,m]),Ae(()=>{if(!d)return;const e=()=>{const e=p.current;e&&h(mo(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360)))};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[d,t.length,n]),/* @__PURE__ */Ye("span",{ref:p,className:l,style:{display:"inline-flex",...a},children:[/* @__PURE__ */Ve("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?s:void 0,"aria-disabled":o||void 0,onClick:()=>d?m():f(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),d||f()),"Escape"===e.key&&d&&(e.preventDefault(),m())},style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),d&&u&&Ue(/* @__PURE__ */Ve(vo,{items:t,pos:u,panelId:s,onClose:m,onCloseAll:m}),document.body)]})}ko.displayName="TkxMenu";var Co={sm:120,md:180,lg:240,xl:320};function So(e){const t=/* @__PURE__ */new Date;if(e)try{const n=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(t),o=e=>n.find(t=>t.type===e)?.value??"0";let r=parseInt(o("hour"),10);24===r&&(r=0);const i=parseInt(o("minute"),10),l=parseInt(o("second"),10),a=`${o("weekday")}, ${o("month")} ${o("day")}, ${o("year")}`;return{hours:r,minutes:i,seconds:l,milliseconds:t.getMilliseconds(),dateString:a}}catch{}const n=t.getHours(),o=t.getMinutes(),r=t.getSeconds(),i=t.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:o,seconds:r,milliseconds:t.getMilliseconds(),dateString:i}}function $o({time:e,size:t,analogStyle:n,showSeconds:o,reducedMotion:r,primary:i,danger:l,text:a,textMuted:s,border:d,surface:c,bg:u}){const h=t/2,p=t/2,f=t/2-4,{hours:m,minutes:g,seconds:x,milliseconds:b}=e,y=(x+(r?0:b)/1e3)/60*360,v=g/60*360+x/60*6,w=m%12/12*360+g/60*30,k=(e,t)=>{const n=(e-90)*Math.PI/180;return{x:h+Math.cos(n)*t,y:p+Math.sin(n)*t}},C=r?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if("modern"===n){const e=(e,t)=>{const n=360*e-90;return`M ${h+Math.cos(-90*Math.PI/180)*t} ${p+Math.sin(-90*Math.PI/180)*t} A ${t} ${t} 0 ${e>.5?1:0} 1 ${h+Math.cos(n*Math.PI/180)*t} ${p+Math.sin(n*Math.PI/180)*t}`},n=m%12/12+g/60/12,c=g/60+x/3600,u=(x+(r?0:b/1e3))/60,y=f-2,v=f-10,w=f-18;/* @__PURE__ */
170
+ /* @__PURE__ */Ue("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.checked?/* @__PURE__ */Ue(bo,{color:a.primary}):/* @__PURE__ */Ue("span",{style:{width:14,height:14,display:"inline-block"}})}),e.icon&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,display:"flex",color:a.textMuted},children:e.icon}),
171
+ /* @__PURE__ */Ue("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.label)})]},e.id)}if("submenu"===e.type){t++;const o=t,i=o===l,p=!!e.disabled,f=d===e.id,m=So(a,i||f,!1,p);/* @__PURE__ */
172
+ return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ye("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":f,"aria-disabled":p||void 0,"data-midx":o,tabIndex:-1,style:m,onMouseEnter:t=>{p||(s(o),function(e,t){const n=t.getBoundingClientRect();c(e.id),h(function(e,t,n){const o=window.innerWidth,r=window.innerHeight;let i=e.right+4,a="top left";i+220>o&&(i=e.left-4-220,a="top right");let l=e.top;return l+n>r&&(l=Math.max(8,r-n-8)),{top:l+window.scrollY,left:i+window.scrollX,transformOrigin:a}}(n,0,Math.min(38*e.items.length+12,360)))}(e,t.currentTarget))},onMouseLeave:()=>{},onClick:()=>{p||c(f?null:e.id)},children:[
173
+ /* @__PURE__ */Ue("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.icon?/* @__PURE__ */Ue("span",{style:{display:"flex",color:a.textMuted},children:e.icon}):/* @__PURE__ */Ue("span",{style:{width:14}})}),
174
+ /* @__PURE__ */Ue("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(e.label)}),
175
+ /* @__PURE__ */Ue(wo,{color:a.textMuted})]}),f&&u&&Xe(/* @__PURE__ */Ue(ko,{items:e.items,pos:u,panelId:`${n}-sub-${e.id}`,onClose:b,onCloseAll:r,isSubmenu:!0}),document.body)]},e.id)}const o=e;t++;const i=t,p=i===l,f=!!o.disabled,m=!!o.danger,g=So(a,p,m,f);/* @__PURE__ */
176
+ return Ye("div",{role:"menuitem","aria-disabled":f||void 0,"data-midx":i,tabIndex:-1,style:g,onClick:()=>{f||(o.onClick?.(),r())},onMouseEnter:()=>{f||(s(i),b())},children:[
177
+ /* @__PURE__ */Ue("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:o.icon?/* @__PURE__ */Ue("span",{style:{display:"flex",color:m?a.danger:a.textMuted},children:o.icon}):/* @__PURE__ */Ue("span",{style:{width:14}})}),
178
+ /* @__PURE__ */Ye("span",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ue("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(o.label)}),o.description&&/* @__PURE__ */Ue("span",{style:{display:"block",fontSize:"12px",color:a.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:j(o.description)})]}),o.shortcut&&/* @__PURE__ */Ue("span",{style:{fontSize:"12px",color:a.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:j(o.shortcut)})]},o.id)})})()})]})}function So(e,t,n,o){const r=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:t&&n?e.danger:r,backgroundColor:t?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:o?.5:1,outline:"none"}}function Co({trigger:e,items:t,placement:n="bottom-start",isDisabled:o=!1,onOpen:r,onClose:i,className:a,style:l}){const s=`tkx-menu-${Ee().replace(/:/g,"")}`,[d,c]=Ve(!1),[u,h]=Ve(null),p=Oe(null),f=Ae(()=>{if(o)return;const e=p.current;e&&(h(xo(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360))),c(!0),r?.())},[o,t.length,r,n]),m=Ae(()=>{c(!1),i?.(),(p.current?.firstElementChild)?.focus?.()},[i]);return Fe(()=>{if(!d)return;const e=e=>{const t=e.target;if(p.current?.contains(t))return;const n=document.querySelectorAll(".tkx-menu-panel");for(const o of n)if(o.contains(t))return;m()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,m]),Fe(()=>{if(!d)return;const e=()=>{const e=p.current;e&&h(xo(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360)))};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[d,t.length,n]),/* @__PURE__ */Ye("span",{ref:p,className:a,style:{display:"inline-flex",...l},children:[/* @__PURE__ */Ue("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?s:void 0,"aria-disabled":o||void 0,onClick:()=>d?m():f(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),d||f()),"Escape"===e.key&&d&&(e.preventDefault(),m())},style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),d&&u&&Xe(/* @__PURE__ */Ue(ko,{items:t,pos:u,panelId:s,onClose:m,onCloseAll:m}),document.body)]})}Co.displayName="TkxMenu";var $o={sm:120,md:180,lg:240,xl:320};function zo(e){const t=/* @__PURE__ */new Date;if(e)try{const n=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(t),o=e=>n.find(t=>t.type===e)?.value??"0";let r=parseInt(o("hour"),10);24===r&&(r=0);const i=parseInt(o("minute"),10),a=parseInt(o("second"),10),l=`${o("weekday")}, ${o("month")} ${o("day")}, ${o("year")}`;return{hours:r,minutes:i,seconds:a,milliseconds:t.getMilliseconds(),dateString:l}}catch{}const n=t.getHours(),o=t.getMinutes(),r=t.getSeconds(),i=t.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:o,seconds:r,milliseconds:t.getMilliseconds(),dateString:i}}function No({time:e,size:t,analogStyle:n,showSeconds:o,reducedMotion:r,primary:i,danger:a,text:l,textMuted:s,border:d,surface:c,bg:u}){const h=t/2,p=t/2,f=t/2-4,{hours:m,minutes:g,seconds:x,milliseconds:y}=e,b=(x+(r?0:y)/1e3)/60*360,v=g/60*360+x/60*6,w=m%12/12*360+g/60*30,k=(e,t)=>{const n=(e-90)*Math.PI/180;return{x:h+Math.cos(n)*t,y:p+Math.sin(n)*t}},S=r?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if("modern"===n){const e=(e,t)=>{const n=360*e-90;return`M ${h+Math.cos(-90*Math.PI/180)*t} ${p+Math.sin(-90*Math.PI/180)*t} A ${t} ${t} 0 ${e>.5?1:0} 1 ${h+Math.cos(n*Math.PI/180)*t} ${p+Math.sin(n*Math.PI/180)*t}`},n=m%12/12+g/60/12,c=g/60+x/3600,u=(x+(r?0:y/1e3))/60,b=f-2,v=f-10,w=f-18;/* @__PURE__ */
179
179
  return Ye("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[
180
- /* @__PURE__ */Ve("circle",{cx:h,cy:p,r:y,fill:"none",stroke:d,strokeWidth:4}),
181
- /* @__PURE__ */Ve("circle",{cx:h,cy:p,r:v,fill:"none",stroke:d,strokeWidth:4}),o&&/* @__PURE__ */Ve("circle",{cx:h,cy:p,r:w,fill:"none",stroke:d,strokeWidth:3}),
182
- /* @__PURE__ */Ve("path",{d:e(n,y),fill:"none",stroke:i,strokeWidth:4,strokeLinecap:"round"}),
183
- /* @__PURE__ */Ve("path",{d:e(c,v),fill:"none",stroke:a,strokeWidth:4,strokeLinecap:"round"}),o&&/* @__PURE__ */Ve("path",{d:e(u,w),fill:"none",stroke:l,strokeWidth:3,strokeLinecap:"round"}),
184
- /* @__PURE__ */Ve("circle",{cx:h,cy:p,r:4,fill:i}),
185
- /* @__PURE__ */Ye("text",{x:h,y:p+20,textAnchor:"middle",fontSize:.12*t,fill:s,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(m).padStart(2,"0"),":",String(g).padStart(2,"0")]})]})}const S=k(w,.5*f),$=k(v,.75*f),z=k(y,.85*f),N=k(y+180,.2*f),M=[];if("classic"===n){for(let e=0;e<60;e++){const t=e%5==0,n=(e/60*360-90)*Math.PI/180,o=t?f-10:f-6,r=h+Math.cos(n)*f,i=p+Math.sin(n)*f,l=h+Math.cos(n)*o,d=p+Math.sin(n)*o;M.push(/* @__PURE__ */Ve("line",{x1:r,y1:i,x2:l,y2:d,stroke:t?a:s,strokeWidth:t?2:1,strokeLinecap:"round"},e))}for(const{n:e,angle:n}of[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}]){const o=(n-90)*Math.PI/180,r=f-20;M.push(/* @__PURE__ */Ve("text",{x:h+Math.cos(o)*r,y:p+Math.sin(o)*r,textAnchor:"middle",dominantBaseline:"central",fontSize:.09*t,fill:a,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:e},`n${e}`))}}else for(let I=0;I<12;I++){const e=(I/12*360-90)*Math.PI/180,t=f-8;M.push(/* @__PURE__ */Ve("circle",{cx:h+Math.cos(e)*t,cy:p+Math.sin(e)*t,r:I%3==0?3:2,fill:I%3==0?a:s},I))}/* @__PURE__ */
180
+ /* @__PURE__ */Ue("circle",{cx:h,cy:p,r:b,fill:"none",stroke:d,strokeWidth:4}),
181
+ /* @__PURE__ */Ue("circle",{cx:h,cy:p,r:v,fill:"none",stroke:d,strokeWidth:4}),o&&/* @__PURE__ */Ue("circle",{cx:h,cy:p,r:w,fill:"none",stroke:d,strokeWidth:3}),
182
+ /* @__PURE__ */Ue("path",{d:e(n,b),fill:"none",stroke:i,strokeWidth:4,strokeLinecap:"round"}),
183
+ /* @__PURE__ */Ue("path",{d:e(c,v),fill:"none",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o&&/* @__PURE__ */Ue("path",{d:e(u,w),fill:"none",stroke:a,strokeWidth:3,strokeLinecap:"round"}),
184
+ /* @__PURE__ */Ue("circle",{cx:h,cy:p,r:4,fill:i}),
185
+ /* @__PURE__ */Ye("text",{x:h,y:p+20,textAnchor:"middle",fontSize:.12*t,fill:s,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(m).padStart(2,"0"),":",String(g).padStart(2,"0")]})]})}const C=k(w,.5*f),$=k(v,.75*f),z=k(b,.85*f),N=k(b+180,.2*f),M=[];if("classic"===n){for(let e=0;e<60;e++){const t=e%5==0,n=(e/60*360-90)*Math.PI/180,o=t?f-10:f-6,r=h+Math.cos(n)*f,i=p+Math.sin(n)*f,a=h+Math.cos(n)*o,d=p+Math.sin(n)*o;M.push(/* @__PURE__ */Ue("line",{x1:r,y1:i,x2:a,y2:d,stroke:t?l:s,strokeWidth:t?2:1,strokeLinecap:"round"},e))}for(const{n:e,angle:n}of[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}]){const o=(n-90)*Math.PI/180,r=f-20;M.push(/* @__PURE__ */Ue("text",{x:h+Math.cos(o)*r,y:p+Math.sin(o)*r,textAnchor:"middle",dominantBaseline:"central",fontSize:.09*t,fill:l,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:e},`n${e}`))}}else for(let I=0;I<12;I++){const e=(I/12*360-90)*Math.PI/180,t=f-8;M.push(/* @__PURE__ */Ue("circle",{cx:h+Math.cos(e)*t,cy:p+Math.sin(e)*t,r:I%3==0?3:2,fill:I%3==0?l:s},I))}/* @__PURE__ */
186
186
  return Ye("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",style:{display:"block"},children:[
187
- /* @__PURE__ */Ve("circle",{cx:h,cy:p,r:f,fill:c,stroke:d,strokeWidth:2}),M,
188
- /* @__PURE__ */Ve("line",{x1:h,y1:p,x2:S.x,y2:S.y,stroke:i,strokeWidth:"minimal"===n?3:4,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:C}}),
189
- /* @__PURE__ */Ve("line",{x1:h,y1:p,x2:$.x,y2:$.y,stroke:a,strokeWidth:"minimal"===n?2:3,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:C}}),o&&/* @__PURE__ */Ye(Pe,{children:[/* @__PURE__ */Ve("line",{x1:N.x,y1:N.y,x2:z.x,y2:z.y,stroke:l,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:"none"}}),/* @__PURE__ */Ve("circle",{cx:h,cy:p,r:3,fill:l})]}),
190
- /* @__PURE__ */Ve("circle",{cx:h,cy:p,r:"minimal"===n?3:5,fill:i})]})}function zo({time:e,format:t,showSeconds:n,showDate:o,label:r,size:i,primary:l,text:a,textMuted:s,colonVisible:d}){const{hours:c,minutes:u,seconds:h,dateString:p}=e;let f=c,m="";"12h"===t&&(m=c>=12?"PM":"AM",f=c%12||12);const g=.2*i,x={opacity:d?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};/* @__PURE__ */
187
+ /* @__PURE__ */Ue("circle",{cx:h,cy:p,r:f,fill:c,stroke:d,strokeWidth:2}),M,
188
+ /* @__PURE__ */Ue("line",{x1:h,y1:p,x2:C.x,y2:C.y,stroke:i,strokeWidth:"minimal"===n?3:4,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:S}}),
189
+ /* @__PURE__ */Ue("line",{x1:h,y1:p,x2:$.x,y2:$.y,stroke:l,strokeWidth:"minimal"===n?2:3,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:S}}),o&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("line",{x1:N.x,y1:N.y,x2:z.x,y2:z.y,stroke:a,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${h}px ${p}px`,transition:"none"}}),/* @__PURE__ */Ue("circle",{cx:h,cy:p,r:3,fill:a})]}),
190
+ /* @__PURE__ */Ue("circle",{cx:h,cy:p,r:"minimal"===n?3:5,fill:i})]})}function Mo({time:e,format:t,showSeconds:n,showDate:o,label:r,size:i,primary:a,text:l,textMuted:s,colonVisible:d}){const{hours:c,minutes:u,seconds:h,dateString:p}=e;let f=c,m="";"12h"===t&&(m=c>=12?"PM":"AM",f=c%12||12);const g=.2*i,x={opacity:d?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};/* @__PURE__ */
191
191
  return Ye("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[
192
- /* @__PURE__ */Ye("div",{style:{fontSize:g,color:l,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[
193
- /* @__PURE__ */Ve("span",{children:String(f).padStart(2,"0")}),
194
- /* @__PURE__ */Ve("span",{style:x,children:":"}),
195
- /* @__PURE__ */Ve("span",{children:String(u).padStart(2,"0")}),n&&/* @__PURE__ */Ye(Pe,{children:[/* @__PURE__ */Ve("span",{style:x,children:":"}),/* @__PURE__ */Ve("span",{children:String(h).padStart(2,"0")})]}),"12h"===t&&/* @__PURE__ */Ve("span",{style:{fontSize:.45*g,color:s,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*g},children:m})]}),o&&/* @__PURE__ */Ve("div",{style:{fontSize:.072*i,color:s,marginTop:.025*i,letterSpacing:"0.03em"},children:p}),r&&/* @__PURE__ */Ve("div",{style:{fontSize:.065*i,color:s,marginTop:.015*i,textTransform:"uppercase",letterSpacing:"0.08em"},children:E(r)})]})}function No({variant:e="both",size:t="md",showSeconds:n=!0,showDate:o=!1,format:r="24h",timezone:i,timezone2:l,label:a,analogStyle:s="classic",className:d,style:c}){const u=b(),h=me(),[p,f]=Oe(()=>So(i)),[m,g]=Oe(()=>l?So(l):null),[x,y]=Oe(!0),[v,w]=Oe(!1),k=je(null);Ae(()=>{w(!0)},[]),Ae(()=>{const e=()=>{f(So(i)),l&&g(So(l))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[i,l]),Ae(()=>(k.current=setInterval(()=>{y(e=>!e)},500),()=>{k.current&&clearInterval(k.current)}),[]);const C=Co[t],S="digital"===e||"both"===e;/* @__PURE__ */
196
- return Ye("div",{className:d,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*C+"px":0,opacity:v?1:0,transition:h?"none":"opacity 0.4s ease",...c},role:"timer","aria-live":"off",children:[("analog"===e||"both"===e)&&/* @__PURE__ */Ve($o,{time:p,size:C,analogStyle:s,showSeconds:n,reducedMotion:h,primary:u.primary,danger:u.danger,text:u.text,textMuted:u.textMuted,border:u.border,surface:u.surface,bg:u.bg}),S&&/* @__PURE__ */Ve(zo,{time:p,format:r,showSeconds:n,showDate:o,label:a,size:C,primary:u.primary,text:u.text,textMuted:u.textMuted,colonVisible:x}),m&&l&&/* @__PURE__ */Ve("div",{style:{marginTop:.04*C,padding:`${.03*C}px ${.06*C}px`,borderTop:`1px solid ${u.border}`,textAlign:"center"},children:/* @__PURE__ */Ve(zo,{time:m,format:r,showSeconds:!1,showDate:!1,label:l,size:.7*C,primary:u.secondary,text:u.text,textMuted:u.textMuted,colonVisible:x})})]})}function Mo(e){if(!isFinite(e)||isNaN(e))return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return t>0?`${t}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function Io({path:e,size:t=20,color:n="currentColor",title:o}){/* @__PURE__ */
197
- return Ve("svg",{width:t,height:t,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:/* @__PURE__ */Ve("path",{d:e})})}No.displayName="TkxClock";var Lo="M8 5v14l11-7z",Wo="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function Do({onClick:e,title:t,children:n,active:o,primary:r}){const[i,l]=Oe(!1);/* @__PURE__ */
198
- return Ve("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||i?r:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function Ro({src:e,poster:t,title:n,width:o="100%",height:r,autoPlay:i=!1,loop:l=!1,muted:a=!1,controls:s=!0,showTitle:d=!0,allowFullscreen:c=!0,allowPiP:u=!0,allowDownload:h=!1,chapters:p=[],subtitles:f=[],startTime:m,onPlay:g,onPause:x,onEnded:y,onTimeUpdate:v,className:w,style:k}){const C=b(),S=me(),$=je(null),z=je(null),N=je(null),M=je(null),[I,L]=Oe(!1),[W,D]=Oe(0),[R,T]=Oe(0),[B,A]=Oe(0),[F,H]=Oe(1),[j,O]=Oe(a),[P,V]=Oe(!1),[Y,U]=Oe(!0),[K,X]=Oe(!1),[q,G]=Oe(1),[_,Z]=Oe(!1),[J,Q]=Oe(-1),[ee,te]=Oe(null),[ne,oe]=Oe(0),[re,ie]=Oe(null),[le,ae]=Oe(!1),[se,de]=Oe(!1),[ce,ue]=Oe(null),[he,pe]=Oe(!1);Ae(()=>{const e=$.current;if(!e)return;void 0!==m&&(e.currentTime=m);const t=()=>{D(e.currentTime),e.buffered.length>0&&A(e.buffered.end(e.buffered.length-1))},n=()=>T(e.duration),o=()=>L(!0),r=()=>{L(!1),X(!0)},i=()=>{L(!1),X(!0),y?.()},l=()=>ae(!0),a=()=>ae(!1),s=()=>de(!0),d=()=>de(!1),c=()=>{const t=e.error;ue(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),de(!1)};return e.addEventListener("timeupdate",t),e.addEventListener("durationchange",n),e.addEventListener("play",o),e.addEventListener("pause",r),e.addEventListener("ended",i),e.addEventListener("enterpictureinpicture",l),e.addEventListener("leavepictureinpicture",a),e.addEventListener("waiting",s),e.addEventListener("canplay",d),e.addEventListener("error",c),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("durationchange",n),e.removeEventListener("play",o),e.removeEventListener("pause",r),e.removeEventListener("ended",i),e.removeEventListener("enterpictureinpicture",l),e.removeEventListener("leavepictureinpicture",a),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[y,m]),Ae(()=>{$.current&&(I?g?.():x?.())},[I,g,x]),Ae(()=>{v?.(W,R)},[W,R,v]),Ae(()=>{const e=$.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===J?"showing":"disabled"},[J]),Ae(()=>{const e=()=>V(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),Ae(()=>{const e=z.current;if(!e)return;const t=e=>{const t=$.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),ge();break;case"f":case"F":c&&be();break;case"m":case"M":xe();break;case"ArrowRight":e.preventDefault(),t.currentTime=Math.min(t.currentTime+10,t.duration);break;case"ArrowLeft":e.preventDefault(),t.currentTime=Math.max(t.currentTime-10,0);break;case"ArrowUp":e.preventDefault(),H(Math.min(F+.1,1)),$.current&&($.current.volume=Math.min(F+.1,1));break;case"ArrowDown":e.preventDefault(),H(Math.max(F-.1,0)),$.current&&($.current.volume=Math.max(F-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[F,c]);const fe=Te(()=>{U(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{I&&U(!1)},3e3)},[I]);Ae(()=>(fe(),()=>{M.current&&clearTimeout(M.current)}),[I,fe]);const ge=Te(()=>{const e=$.current;e&&(e.paused?(e.play().catch(()=>{}),ie("play"),X(!1)):(e.pause(),ie("pause")),setTimeout(()=>ie(null),600))},[]),xe=Te(()=>{const e=$.current;if(!e)return;const t=!j;O(t),e.muted=t},[j]),be=Te(()=>{const e=z.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),ye=Te(async()=>{const e=$.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ve=Te(()=>{0!==f.length&&(Q(e=>(e+1)%(f.length+1)-1),Q(e=>{const t=e+1;return t>=f.length?-1:t}))},[f.length]),we=Te(()=>{const e=$.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),ke=Te(()=>{const e=$.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),Ce=Te(()=>{const e=$.current;e&&(ue(null),e.load())},[]),Se=Te(()=>{c&&be()},[c,be]),$e=Te(e=>{const t=$.current,n=N.current;if(!t||!n||!R)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*R},[R]),ze=Te(e=>{const t=N.current;if(!t||!R)return;const n=t.getBoundingClientRect();te(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*R),oe(e.clientX-n.left)},[R]),Ne=Te(e=>{const t=parseFloat(e.target.value);H(t),$.current&&($.current.volume=t,$.current.muted=0===t,O(0===t))},[]),Me=Te(e=>{G(e),$.current&&($.current.playbackRate=e),Z(!1)},[]),Ie=p.length>0?[...p].reverse().find(e=>W>=e.time):null,Le=e=>[...p].reverse().find(t=>e>=t.time)??null,We=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],De=Array.isArray(e)?e[0].src:e,Re=Y||K||!I,Be=S?"none":"opacity 0.25s ease",Fe=j||0===F?"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":F<.5?"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":"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",Ee=R>0?W/R*100:0,He=R>0?B/R*100:0;/* @__PURE__ */
199
- return Ye("div",{ref:z,className:w,tabIndex:0,onMouseMove:fe,onMouseLeave:()=>{I&&U(!1)},style:{position:"relative",width:o,height:r??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...k},children:[
200
- /* @__PURE__ */Ye("video",{ref:$,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:t,autoPlay:i,loop:l,muted:a,playsInline:!0,onClick:ge,onDoubleClick:Se,children:[We.map((e,t)=>/* @__PURE__ */Ve("source",{src:e.src,type:e.type},t)),f.map((e,t)=>/* @__PURE__ */Ve("track",{kind:"subtitles",label:E(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),d&&n&&/* @__PURE__ */Ye("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:Re?1:0,transition:Be,pointerEvents:"none"},children:[/* @__PURE__ */Ve("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:E(n)}),Ie&&/* @__PURE__ */Ye("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",E(Ie.label)]})]}),re&&/* @__PURE__ */Ve("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:S?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:/* @__PURE__ */Ve(Io,{path:"play"===re?Lo:Wo,size:32,color:"#fff"})}),se&&!ce&&/* @__PURE__ */Ve("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:/* @__PURE__ */Ve("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:C.primary,borderRadius:"50%",animation:S?"none":"tkxvp-spin 0.8s linear infinite"}})}),ce&&/* @__PURE__ */Ye("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:[
201
- /* @__PURE__ */Ve(Io,{path:"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",size:48,color:"#ef4444"}),
202
- /* @__PURE__ */Ve("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:ce}),
203
- /* @__PURE__ */Ye("button",{type:"button",onClick:Ce,style:{display:"flex",alignItems:"center",gap:6,background:C.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[/* @__PURE__ */Ve(Io,{path:"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",size:18,color:"#fff"}),"Retry"]})]}),s&&/* @__PURE__ */Ye("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:Re?1:0,transition:Be},onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),children:[/* @__PURE__ */Ye("div",{ref:N,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(R),"aria-valuenow":Math.floor(W),tabIndex:0,onClick:$e,onMouseMove:ze,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.height="8px"},onMouseLeave:e=>{e.currentTarget.style.height="4px",te(null)},children:[
204
- /* @__PURE__ */Ve("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${He}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),
205
- /* @__PURE__ */Ve("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Ee}%`,background:C.primary,borderRadius:2,pointerEvents:"none"}}),
206
- /* @__PURE__ */Ve("div",{style:{position:"absolute",top:"50%",left:`${Ee}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:C.primary,pointerEvents:"none"}}),p.map((e,t)=>{const n=R>0?e.time/R*100:0;/* @__PURE__ */
207
- return Ve("div",{title:E(e.label),style:{position:"absolute",top:"50%",left:`${n}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${C.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},t)}),null!==ee&&/* @__PURE__ */Ye("div",{style:{position:"absolute",bottom:12,left:ne,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:[Mo(ee),Le(ee)&&/* @__PURE__ */Ve("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:E(Le(ee).label)})]})]}),/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:2},children:[
208
- /* @__PURE__ */Ve(Do,{onClick:ge,title:I?"Pause":"Play",primary:C.primary,children:/* @__PURE__ */Ve(Io,{path:I?Wo:Lo,size:22})}),
209
- /* @__PURE__ */Ve(Do,{onClick:ke,title:"Skip back 10 seconds",primary:C.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ve(Io,{path:"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",size:22}),/* @__PURE__ */Ve("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
210
- /* @__PURE__ */Ve(Do,{onClick:we,title:"Skip forward 10 seconds",primary:C.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ve(Io,{path:"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",size:22}),/* @__PURE__ */Ve("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
211
- /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>pe(!0),onMouseLeave:()=>pe(!1),children:[/* @__PURE__ */Ve(Do,{onClick:xe,title:j?"Unmute":"Mute",primary:C.primary,children:/* @__PURE__ */Ve(Io,{path:Fe,size:20})}),/* @__PURE__ */Ve("div",{style:{overflow:"hidden",width:he?64:0,opacity:he?1:0,transition:S?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ve("input",{type:"range",min:0,max:1,step:.05,value:j?0:F,onChange:Ne,"aria-label":"Volume",style:{width:64,accentColor:C.primary,cursor:"pointer",height:4}})})]}),
212
- /* @__PURE__ */Ye("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Mo(W)," / ",Mo(R)]}),
213
- /* @__PURE__ */Ve("div",{style:{flex:1}}),f.length>0&&/* @__PURE__ */Ve(Do,{onClick:ve,title:"Subtitles",primary:C.primary,active:J>=0,children:/* @__PURE__ */Ve(Io,{path:"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",size:20})}),
192
+ /* @__PURE__ */Ye("div",{style:{fontSize:g,color:a,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[
193
+ /* @__PURE__ */Ue("span",{children:String(f).padStart(2,"0")}),
194
+ /* @__PURE__ */Ue("span",{style:x,children:":"}),
195
+ /* @__PURE__ */Ue("span",{children:String(u).padStart(2,"0")}),n&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("span",{style:x,children:":"}),/* @__PURE__ */Ue("span",{children:String(h).padStart(2,"0")})]}),"12h"===t&&/* @__PURE__ */Ue("span",{style:{fontSize:.45*g,color:s,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*g},children:m})]}),o&&/* @__PURE__ */Ue("div",{style:{fontSize:.072*i,color:s,marginTop:.025*i,letterSpacing:"0.03em"},children:p}),r&&/* @__PURE__ */Ue("div",{style:{fontSize:.065*i,color:s,marginTop:.015*i,textTransform:"uppercase",letterSpacing:"0.08em"},children:j(r)})]})}function Io({variant:e="both",size:t="md",showSeconds:n=!0,showDate:o=!1,format:r="24h",timezone:i,timezone2:a,label:l,analogStyle:s="classic",className:d,style:c}){const u=N(),h=ge(),[p,f]=Ve(()=>zo(i)),[m,g]=Ve(()=>a?zo(a):null),[x,y]=Ve(!0),[b,v]=Ve(!1),w=Oe(null);Fe(()=>{v(!0)},[]),Fe(()=>{const e=()=>{f(zo(i)),a&&g(zo(a))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[i,a]),Fe(()=>(w.current=setInterval(()=>{y(e=>!e)},500),()=>{w.current&&clearInterval(w.current)}),[]);const k=$o[t],S="digital"===e||"both"===e;/* @__PURE__ */
196
+ return Ye("div",{className:d,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*k+"px":0,opacity:b?1:0,transition:h?"none":"opacity 0.4s ease",...c},role:"timer","aria-live":"off",children:[("analog"===e||"both"===e)&&/* @__PURE__ */Ue(No,{time:p,size:k,analogStyle:s,showSeconds:n,reducedMotion:h,primary:u.primary,danger:u.danger,text:u.text,textMuted:u.textMuted,border:u.border,surface:u.surface,bg:u.bg}),S&&/* @__PURE__ */Ue(Mo,{time:p,format:r,showSeconds:n,showDate:o,label:l,size:k,primary:u.primary,text:u.text,textMuted:u.textMuted,colonVisible:x}),m&&a&&/* @__PURE__ */Ue("div",{style:{marginTop:.04*k,padding:`${.03*k}px ${.06*k}px`,borderTop:`1px solid ${u.border}`,textAlign:"center"},children:/* @__PURE__ */Ue(Mo,{time:m,format:r,showSeconds:!1,showDate:!1,label:a,size:.7*k,primary:u.secondary,text:u.text,textMuted:u.textMuted,colonVisible:x})})]})}function Do(e){if(!isFinite(e)||isNaN(e))return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return t>0?`${t}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function Wo({path:e,size:t=20,color:n="currentColor",title:o}){/* @__PURE__ */
197
+ return Ue("svg",{width:t,height:t,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:/* @__PURE__ */Ue("path",{d:e})})}Io.displayName="TkxClock";var Lo="M8 5v14l11-7z",Ro="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function To({onClick:e,title:t,children:n,active:o,primary:r}){const[i,a]=Ve(!1);/* @__PURE__ */
198
+ return Ue("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||i?r:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function Ao({src:e,poster:t,title:n,width:o="100%",height:r,autoPlay:i=!1,loop:a=!1,muted:l=!1,controls:s=!0,showTitle:d=!0,allowFullscreen:c=!0,allowPiP:u=!0,allowDownload:h=!1,chapters:p=[],subtitles:f=[],startTime:m,onPlay:g,onPause:x,onEnded:y,onTimeUpdate:b,className:v,style:w}){const k=N(),S=ge(),C=Oe(null),$=Oe(null),z=Oe(null),M=Oe(null),[I,D]=Ve(!1),[W,L]=Ve(0),[R,T]=Ve(0),[A,B]=Ve(0),[F,E]=Ve(1),[H,P]=Ve(l),[O,V]=Ve(!1),[K,U]=Ve(!0),[Y,X]=Ve(!1),[q,_]=Ve(1),[Z,G]=Ve(!1),[J,Q]=Ve(-1),[ee,te]=Ve(null),[ne,oe]=Ve(0),[re,ie]=Ve(null),[ae,le]=Ve(!1),[se,de]=Ve(!1),[ce,ue]=Ve(null),[he,pe]=Ve(!1);Fe(()=>{const e=C.current;if(!e)return;void 0!==m&&(e.currentTime=m);const t=()=>{L(e.currentTime),e.buffered.length>0&&B(e.buffered.end(e.buffered.length-1))},n=()=>T(e.duration),o=()=>D(!0),r=()=>{D(!1),X(!0)},i=()=>{D(!1),X(!0),y?.()},a=()=>le(!0),l=()=>le(!1),s=()=>de(!0),d=()=>de(!1),c=()=>{const t=e.error;ue(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),de(!1)};return e.addEventListener("timeupdate",t),e.addEventListener("durationchange",n),e.addEventListener("play",o),e.addEventListener("pause",r),e.addEventListener("ended",i),e.addEventListener("enterpictureinpicture",a),e.addEventListener("leavepictureinpicture",l),e.addEventListener("waiting",s),e.addEventListener("canplay",d),e.addEventListener("error",c),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("durationchange",n),e.removeEventListener("play",o),e.removeEventListener("pause",r),e.removeEventListener("ended",i),e.removeEventListener("enterpictureinpicture",a),e.removeEventListener("leavepictureinpicture",l),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[y,m]),Fe(()=>{C.current&&(I?g?.():x?.())},[I,g,x]),Fe(()=>{b?.(W,R)},[W,R,b]),Fe(()=>{const e=C.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===J?"showing":"disabled"},[J]),Fe(()=>{const e=()=>V(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),Fe(()=>{const e=$.current;if(!e)return;const t=e=>{const t=C.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),me();break;case"f":case"F":c&&ye();break;case"m":case"M":xe();break;case"ArrowRight":e.preventDefault(),t.currentTime=Math.min(t.currentTime+10,t.duration);break;case"ArrowLeft":e.preventDefault(),t.currentTime=Math.max(t.currentTime-10,0);break;case"ArrowUp":e.preventDefault(),E(Math.min(F+.1,1)),C.current&&(C.current.volume=Math.min(F+.1,1));break;case"ArrowDown":e.preventDefault(),E(Math.max(F-.1,0)),C.current&&(C.current.volume=Math.max(F-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[F,c]);const fe=Ae(()=>{U(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{I&&U(!1)},3e3)},[I]);Fe(()=>(fe(),()=>{M.current&&clearTimeout(M.current)}),[I,fe]);const me=Ae(()=>{const e=C.current;e&&(e.paused?(e.play().catch(()=>{}),ie("play"),X(!1)):(e.pause(),ie("pause")),setTimeout(()=>ie(null),600))},[]),xe=Ae(()=>{const e=C.current;if(!e)return;const t=!H;P(t),e.muted=t},[H]),ye=Ae(()=>{const e=$.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),be=Ae(async()=>{const e=C.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ve=Ae(()=>{0!==f.length&&(Q(e=>(e+1)%(f.length+1)-1),Q(e=>{const t=e+1;return t>=f.length?-1:t}))},[f.length]),we=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),ke=Ae(()=>{const e=C.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),Se=Ae(()=>{const e=C.current;e&&(ue(null),e.load())},[]),Ce=Ae(()=>{c&&ye()},[c,ye]),$e=Ae(e=>{const t=C.current,n=z.current;if(!t||!n||!R)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*R},[R]),ze=Ae(e=>{const t=z.current;if(!t||!R)return;const n=t.getBoundingClientRect();te(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*R),oe(e.clientX-n.left)},[R]),Ne=Ae(e=>{const t=parseFloat(e.target.value);E(t),C.current&&(C.current.volume=t,C.current.muted=0===t,P(0===t))},[]),Me=Ae(e=>{_(e),C.current&&(C.current.playbackRate=e),G(!1)},[]),Ie=p.length>0?[...p].reverse().find(e=>W>=e.time):null,De=e=>[...p].reverse().find(t=>e>=t.time)??null,We=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Le=Array.isArray(e)?e[0].src:e,Re=K||Y||!I,Te=S?"none":"opacity 0.25s ease",Be=H||0===F?"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":F<.5?"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":"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",Ee=R>0?W/R*100:0,je=R>0?A/R*100:0;/* @__PURE__ */
199
+ return Ye("div",{ref:$,className:v,tabIndex:0,onMouseMove:fe,onMouseLeave:()=>{I&&U(!1)},style:{position:"relative",width:o,height:r??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...w},children:[
200
+ /* @__PURE__ */Ye("video",{ref:C,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:t,autoPlay:i,loop:a,muted:l,playsInline:!0,onClick:me,onDoubleClick:Ce,children:[We.map((e,t)=>/* @__PURE__ */Ue("source",{src:e.src,type:e.type},t)),f.map((e,t)=>/* @__PURE__ */Ue("track",{kind:"subtitles",label:j(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),d&&n&&/* @__PURE__ */Ye("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:Re?1:0,transition:Te,pointerEvents:"none"},children:[/* @__PURE__ */Ue("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:j(n)}),Ie&&/* @__PURE__ */Ye("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",j(Ie.label)]})]}),re&&/* @__PURE__ */Ue("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:S?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:/* @__PURE__ */Ue(Wo,{path:"play"===re?Lo:Ro,size:32,color:"#fff"})}),se&&!ce&&/* @__PURE__ */Ue("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:/* @__PURE__ */Ue("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:k.primary,borderRadius:"50%",animation:S?"none":"tkxvp-spin 0.8s linear infinite"}})}),ce&&/* @__PURE__ */Ye("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:[
201
+ /* @__PURE__ */Ue(Wo,{path:"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",size:48,color:"#ef4444"}),
202
+ /* @__PURE__ */Ue("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:ce}),
203
+ /* @__PURE__ */Ye("button",{type:"button",onClick:Se,style:{display:"flex",alignItems:"center",gap:6,background:k.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[/* @__PURE__ */Ue(Wo,{path:"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",size:18,color:"#fff"}),"Retry"]})]}),s&&/* @__PURE__ */Ye("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:Re?1:0,transition:Te},onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),children:[/* @__PURE__ */Ye("div",{ref:z,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(R),"aria-valuenow":Math.floor(W),tabIndex:0,onClick:$e,onMouseMove:ze,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.height="8px"},onMouseLeave:e=>{e.currentTarget.style.height="4px",te(null)},children:[
204
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${je}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),
205
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Ee}%`,background:k.primary,borderRadius:2,pointerEvents:"none"}}),
206
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",top:"50%",left:`${Ee}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:k.primary,pointerEvents:"none"}}),p.map((e,t)=>{const n=R>0?e.time/R*100:0;/* @__PURE__ */
207
+ return Ue("div",{title:j(e.label),style:{position:"absolute",top:"50%",left:`${n}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${k.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},t)}),null!==ee&&/* @__PURE__ */Ye("div",{style:{position:"absolute",bottom:12,left:ne,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:[Do(ee),De(ee)&&/* @__PURE__ */Ue("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:j(De(ee).label)})]})]}),/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:2},children:[
208
+ /* @__PURE__ */Ue(To,{onClick:me,title:I?"Pause":"Play",primary:k.primary,children:/* @__PURE__ */Ue(Wo,{path:I?Ro:Lo,size:22})}),
209
+ /* @__PURE__ */Ue(To,{onClick:ke,title:"Skip back 10 seconds",primary:k.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ue(Wo,{path:"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",size:22}),/* @__PURE__ */Ue("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
210
+ /* @__PURE__ */Ue(To,{onClick:we,title:"Skip forward 10 seconds",primary:k.primary,children:/* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[/* @__PURE__ */Ue(Wo,{path:"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",size:22}),/* @__PURE__ */Ue("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),
211
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>pe(!0),onMouseLeave:()=>pe(!1),children:[/* @__PURE__ */Ue(To,{onClick:xe,title:H?"Unmute":"Mute",primary:k.primary,children:/* @__PURE__ */Ue(Wo,{path:Be,size:20})}),/* @__PURE__ */Ue("div",{style:{overflow:"hidden",width:he?64:0,opacity:he?1:0,transition:S?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:/* @__PURE__ */Ue("input",{type:"range",min:0,max:1,step:.05,value:H?0:F,onChange:Ne,"aria-label":"Volume",style:{width:64,accentColor:k.primary,cursor:"pointer",height:4}})})]}),
212
+ /* @__PURE__ */Ye("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Do(W)," / ",Do(R)]}),
213
+ /* @__PURE__ */Ue("div",{style:{flex:1}}),f.length>0&&/* @__PURE__ */Ue(To,{onClick:ve,title:"Subtitles",primary:k.primary,active:J>=0,children:/* @__PURE__ */Ue(Wo,{path:"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",size:20})}),
214
214
  /* @__PURE__ */Ye("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[
215
- /* @__PURE__ */Ye("button",{type:"button",onClick:()=>Z(e=>!e),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:[q,"×"]}),1!==q&&/* @__PURE__ */Ye("span",{style:{position:"absolute",top:0,right:0,background:C.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[q,"x"]}),_&&/* @__PURE__ */Ve("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${C.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>/* @__PURE__ */Ye("button",{type:"button",onClick:()=>Me(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===q?C.primary+"30":"none",border:"none",color:e===q?C.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),u&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&/* @__PURE__ */Ve(Do,{onClick:ye,title:"Picture-in-Picture",primary:C.primary,active:le,children:/* @__PURE__ */Ve(Io,{path:"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",size:20})}),h&&/* @__PURE__ */Ve("a",{href:De,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:/* @__PURE__ */Ve(Io,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),c&&/* @__PURE__ */Ve(Do,{onClick:be,title:P?"Exit fullscreen":"Fullscreen",primary:C.primary,children:/* @__PURE__ */Ve(Io,{path:P?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",size:20})})]})]}),
216
- /* @__PURE__ */Ve("style",{children:"\n @keyframes tkxvp-flash {\n 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }\n 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }\n }\n @keyframes tkxvp-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})}Ro.displayName="TkxVideoPlayer";var To={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 Bo({size:e}){const t=.55*e;/* @__PURE__ */
217
- return Ve("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function Ao({size:e}){const t=.55*e;/* @__PURE__ */
218
- return Ve("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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 Fo({status:e,index:t,showStepNumbers:n,icon:o,circleSize:r,fontSize:i,primary:l,danger:a,success:s,text:d,textMuted:c,border:u,surface:h,variant:p,reducedMotion:f,clickable:m}){const g="completed"===e,x="active"===e,b="error"===e;let y=h,v=u,w=c,k=2;g?(y="filled"===p?s:h,v=s,w="filled"===p?"#fff":s):x?(y="outlined"===p?h:l,v=l,w="outlined"===p?l:"#fff",k=2):b?(y="filled"===p?a:h,v=a,w="filled"===p?"#fff":a):"pending"===e&&(y=h,v=u,w=c);const C=x&&!f?{boxShadow:`0 0 0 4px ${l}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},S=m?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let $;return $=!o||g||b?g?/* @__PURE__ */Ve(Bo,{size:r}):b?/* @__PURE__ */Ve(Ao,{size:r}):/* @__PURE__ */Ve("span",n?{style:{fontSize:i,fontWeight:600,lineHeight:1},children:t+1}:{style:{fontSize:.22*r,lineHeight:1,background:w,borderRadius:"50%",width:.22*r,height:.22*r,display:"block"}}):/* @__PURE__ */Ve("span",{style:{fontSize:i,lineHeight:1},children:o}),/* @__PURE__ */Ye(Pe,{children:[/* @__PURE__ */Ve("style",{children:`\n @keyframes tkxstepper-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 ${l}50; }\n 50% { box-shadow: 0 0 0 6px ${l}20; }\n }\n `}),/* @__PURE__ */Ve("div",{style:{width:r,height:r,minWidth:r,borderRadius:"50%",border:`${k}px solid ${v}`,backgroundColor:y,color:w,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:f?"none":"background-color 0.2s, border-color 0.2s",...C,...S},children:$})]})}function Eo({completed:e,orientation:t,connectorStyle:n,connectorWidth:o,primary:r,border:i,reducedMotion:l}){const a=e?r:i;/* @__PURE__ */
219
- return Ve("div","horizontal"===t?{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?a:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${a} 0, ${a} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}:{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?a:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${a} 0, ${a} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Ho({steps:e,activeStep:t=0,orientation:n="horizontal",variant:o="default",size:r="md",clickable:i=!1,onStepClick:l,showStepNumbers:a=!0,alternateLabel:s=!1,connector:d="solid",className:c,style:u}){const h=b(),p=me(),f=To[r],m="horizontal"===n;/* @__PURE__ */
220
- return Ve("div",{className:c,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:m?"row":"column",alignItems:m?s?"flex-start":"center":"stretch",width:"100%",gap:0,...u},children:e.map((n,r)=>{const c=((e,n)=>e.status?e.status:n<t?"completed":n===t?"active":"pending")(n,r),u=r===e.length-1,g="completed"===c||r<t,x=r%2==0,b=()=>{i&&l?.(r)},y=/* @__PURE__ */Ve(Fo,{status:c,index:r,showStepNumbers:a,icon:n.icon,circleSize:f.circle,fontSize:f.fontSize,primary:h.primary,danger:h.danger,success:h.success,text:h.text,textMuted:h.textMuted,border:h.border,surface:h.surface,variant:o,reducedMotion:p,clickable:i}),v=/* @__PURE__ */Ye("div",{style:{textAlign:m&&!s?"center":"left",maxWidth:m?120:void 0},children:[
221
- /* @__PURE__ */Ye("div",{style:{fontSize:f.titleSize,fontWeight:"active"===c?600:500,color:"pending"===c?h.textMuted:"error"===c?h.danger:h.text,lineHeight:1.3,transition:p?"none":"color 0.2s"},children:[E(n.title),n.optional&&/* @__PURE__ */Ve("span",{style:{fontSize:f.descSize,color:h.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),n.description&&/* @__PURE__ */Ve("div",{style:{fontSize:f.descSize,color:h.textMuted,marginTop:2,lineHeight:1.4},children:E(n.description)}),n.error&&"error"===c&&/* @__PURE__ */Ve("div",{style:{fontSize:f.descSize,color:h.danger,marginTop:2},children:E(n.error)})]});/* @__PURE__ */
222
- return Ye("div",m?{role:"listitem",style:{display:"flex",flex:u?0:1,alignItems:"center",minWidth:0},children:[/* @__PURE__ */Ye("div",{onClick:b,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:i?"pointer":"default",flexShrink:0},"aria-current":"active"===c?"step":void 0,children:[s&&!x&&/* @__PURE__ */Ve("div",{style:{minHeight:1.5*f.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:v}),y,!s&&v,s&&x&&/* @__PURE__ */Ve("div",{style:{marginTop:6},children:v})]}),!u&&/* @__PURE__ */Ve(Eo,{completed:g,orientation:"horizontal",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}:{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[/* @__PURE__ */Ve("div",{onClick:b,style:{cursor:i?"pointer":"default"},"aria-current":"active"===c?"step":void 0,children:y}),!u&&/* @__PURE__ */Ve(Eo,{completed:g,orientation:"vertical",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}),/* @__PURE__ */Ve("div",{style:{paddingTop:(f.circle-16*parseFloat(f.titleSize))/2,paddingBottom:u?0:16,flex:1,minWidth:0},children:v})]},n.id)})})}function jo(e){let t=0,n=0,o=0;const r=e.replace("#","");3===r.length?(t=parseInt(r[0]+r[0],16),n=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16)):r.length>=6&&(t=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16)),t/=255,n/=255,o/=255;const i=Math.max(t,n,o),l=Math.min(t,n,o);let a=0,s=0;const d=(i+l)/2;if(i!==l){const e=i-l;switch(s=d>.5?e/(2-i-l):e/(i+l),i){case t:a=((n-o)/e+(n<o?6:0))/6;break;case n:a=((o-t)/e+2)/6;break;case o:a=((t-n)/e+4)/6}}return[Math.round(360*a),Math.round(100*s),Math.round(100*d)]}function Oo(e,t,n){n/=100;const o=(t/=100)*Math.min(n,1-n),r=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function Po(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(r)?0:r]}function Vo(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Yo(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Uo(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=Po(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[l,a,s]=jo(e);return"hsl"===n?t<1?`hsla(${l}, ${a}%, ${s}%, ${t.toFixed(2)})`:`hsl(${l}, ${a}%, ${s}%)`:e}Ho.displayName="TkxStepper";var Ko=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Xo({hue:e,sat:t,bright:n,onChange:o}){const r=je(null),i=je(!1),l=Te(e=>{const t=r.current;if(!t)return;const n=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),l=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));o(Math.round(100*i),Math.round(100*(1-l)))},[o]);Ae(()=>{const e=e=>{i.current&&l(e)},t=()=>{i.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[l]);const a=`${t}%`,s=100-n+"%";/* @__PURE__ */
223
- return Ye("div",{ref:r,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:e=>{i.current=!0,l(e)},children:[
224
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),
225
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),
226
- /* @__PURE__ */Ve("div",{style:{position:"absolute",left:a,top:s,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:Oo(e,t,n/2+25)}})]})}function qo({hue:e,onChange:t}){const n=je(null),o=je(!1),r=Te(e=>{const o=n.current;if(!o)return;const r=o.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));t(Math.round(360*i))},[t]);return Ae(()=>{const e=e=>{o.current&&r(e)},t=()=>{o.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[r]),/* @__PURE__ */Ve("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:e=>{o.current=!0,r(e)},children:/* @__PURE__ */Ve("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 Go({alpha:e,hex:t,onChange:n}){const o=je(null),r=je(!1),i=Te(e=>{const t=o.current;if(!t)return;const r=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));n(Math.round(100*i)/100)},[n]);Ae(()=>{const e=e=>{r.current&&i(e)},t=()=>{r.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[i]);const[l,a,s]=Po(t);/* @__PURE__ */
227
- return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ve("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),/* @__PURE__ */Ve("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${l},${a},${s},0), rgba(${l},${a},${s},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:/* @__PURE__ */Ve("div",{style:{position:"absolute",left:100*e+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${l},${a},${s},${e})`,pointerEvents:"none"}})})]})}function _o({value:e,defaultValue:t="#3b82f6",onChange:n,format:o="hex",showAlpha:r=!1,presets:i=Ko,disabled:l=!1,size:a="md",placeholder:s,label:d,style:c}){const u=b(),h=je(null),p=je(null),[f,m]=Oe(!1),g=void 0!==e,[x,y]=Oe(g&&e||t),v=g?e||t:x,[w,k]=Oe(1),[C,S]=Oe(v),[$,z]=Oe({top:0,left:0}),[N,M,I]=jo(Yo(v)?v:t);Math.round(I+M/100*Math.min(I/100,1-I/100)*100);const L=Te((e,t=w)=>{Yo(e)&&(S(e),g||y(e),n?.(Uo(e,t,o),o))},[w,g,o,n]);Ae(()=>{g&&e&&Yo(e)&&S(e)},[g,e]),Ae(()=>{if(!f)return;const e=e=>{p.current&&!p.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]),Ae(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);const W=e=>{k(e),n?.(Uo(v,e,o),o)},D={sm:28,md:34,lg:40}[a],[R,T,B]=Po(Yo(v)?v:t),A={display:"inline-flex",alignItems:"center",gap:"8px",height:`${D}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${u.border}`,backgroundColor:u.surface,cursor:l?"not-allowed":"pointer",opacity:l?.5:1,color:u.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...c},F={width:D-8+"px",height:D-8+"px",borderRadius:"4px",backgroundColor:`rgba(${R},${T},${B},${w})`,border:`1px solid ${u.border}`,flexShrink:0},E={position:"absolute",top:$.top,left:$.left,zIndex:9999,width:"260px",backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},H={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},j={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},O=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===v.toLowerCase()?`2px solid ${u.primary}`:`1px solid ${u.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});/* @__PURE__ */
228
- return Ye(Pe,{children:[d&&/* @__PURE__ */Ve("label",{style:{display:"block",fontSize:"13px",color:u.text,marginBottom:"6px",fontWeight:500},children:d}),
229
- /* @__PURE__ */Ye("button",{ref:h,type:"button",style:A,onClick:()=>{if(l)return;const e=h.current;if(!e)return;const t=e.getBoundingClientRect();z({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),m(!0)},disabled:l,"aria-label":`Color picker, current color ${v}`,"aria-haspopup":"dialog","aria-expanded":f,children:[/* @__PURE__ */Ve("div",{style:F}),/* @__PURE__ */Ve("span",{style:{fontFamily:"monospace",fontSize:"12px",color:u.textMuted},children:s??Uo(Yo(v)?v:t,w,o)})]}),f&&Ue(/* @__PURE__ */Ye("div",{ref:p,style:E,role:"dialog","aria-label":"Color picker",children:[
230
- /* @__PURE__ */Ve(Xo,{hue:N,sat:M,bright:I,onChange:(e,t)=>{const n=t/100,o=n*(1-e/100/2),r=0===o||1===o?0:(n-o)/Math.min(o,1-o);L(Oo(N,Math.round(100*r),Math.round(100*o)))}}),
231
- /* @__PURE__ */Ve(qo,{hue:N,onChange:e=>{L(Oo(e,M,I))}}),r&&/* @__PURE__ */Ve(Go,{alpha:w,hex:Yo(v)?v:t,onChange:W}),
232
- /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[/* @__PURE__ */Ve("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${R},${T},${B},${w})`,border:`1px solid ${u.border}`}}),/* @__PURE__ */Ve("input",{style:H,value:C,onChange:e=>{const t=e.target.value;S(t),Yo(t)&&L(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),
233
- /* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ve("input",{style:j,type:"number",min:0,max:255,value:"r"===e?R:"g"===e?T:B,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=Po(v);L("r"===e?Vo(n,r,i):"g"===e?Vo(o,n,i):Vo(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),/* @__PURE__ */Ve("span",{style:{fontSize:"10px",color:u.textMuted,textTransform:"uppercase"},children:e})]},e)),r&&/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ve("input",{style:j,type:"number",min:0,max:100,value:Math.round(100*w),onChange:e=>W(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),/* @__PURE__ */Ve("span",{style:{fontSize:"10px",color:u.textMuted},children:"A%"})]})]}),i.length>0&&/* @__PURE__ */Ye("div",{children:[/* @__PURE__ */Ve("div",{style:{fontSize:"11px",color:u.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),/* @__PURE__ */Ve("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:i.map(e=>/* @__PURE__ */Ve("button",{type:"button",style:O(e),onClick:()=>L(e),"aria-label":`Select color ${e}`,onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"}},e))})]})]}),document.body)]})}var Zo={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 Jo(e,t,n){let o=e;return void 0!==t&&(o=Math.max(o,t)),void 0!==n&&(o=Math.min(o,n)),o}function Qo(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function er({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:l,iconSz:a,onStep:s}){const d=je(null),c=je(null),u="inc"===e?1:-1,h=Te(()=>{s(u),d.current=setTimeout(()=>{c.current=setInterval(()=>s(u),60)},400)},[u,s]),p=Te(()=>{d.current&&(clearTimeout(d.current),d.current=null),c.current&&(clearInterval(c.current),c.current=null)},[]);Ae(()=>()=>p(),[p]);const f="inc"===e;/* @__PURE__ */
234
- return Ve("button",{type:"button","aria-label":f?"Increment":"Decrement",disabled:t,onMouseDown:h,onMouseUp:p,onMouseLeave:p,onTouchStart:e=>{e.preventDefault(),h()},onTouchEnd:p,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:f?void 0:`1px solid ${i}`,borderLeft:f?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?l:r,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${r}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:f?/* @__PURE__ */Ye("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ve("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */Ve("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ve("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function tr({value:e,defaultValue:t=0,onChange:n,min:o,max:r,step:i=1,precision:l,prefix:a,suffix:s,format:d,currency:c,locale:u,clampOnBlur:h=!0,allowMouseWheel:p=!1,size:f="md",label:m,hint:g,isDisabled:x=!1,isReadOnly:y=!1,isInvalid:v=!1,errorMessage:w,id:k,className:C,style:S}){const $=b(),z=Fe(),N=k??z,M=`${N}-hint`,I=`${N}-error`,L=void 0!==e,[W,D]=Oe(t),R=L?e:W,[T,B]=Oe(!1),[A,F]=Oe(""),H=Zo[f],j=v||!!w,O=j?$.danger:T?$.primary:$.border,P=[g&&M,j&&I].filter(Boolean).join(" ")||void 0,Y=m?E(m):void 0,U=g?E(g):void 0,K=w?E(w):void 0,X=a?E(a):void 0,q=s?E(s):void 0,G=Te(e=>{const t=Qo(e,l);L||D(t),n?.(t)},[L,n,l]),_=Te(e=>{x||y||G(Jo(Qo(R+e*i,l),o,r))},[x,y,R,i,l,o,r,G]),Z=T?A:function(e,t,n,o,r){const i=o??"en-US";return"currency"===t?new Intl.NumberFormat(i,{style:"currency",currency:n??"USD",minimumFractionDigits:r??2,maximumFractionDigits:r??2}).format(e):"percent"===t?new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:r??0,maximumFractionDigits:r??0}).format(e/100):"decimal"===t||void 0!==r?new Intl.NumberFormat(i,{minimumFractionDigits:r??0,maximumFractionDigits:r??20}).format(e):String(e)}(R,d,c,u,l),J=(X||q)&&!T;/* @__PURE__ */
235
- return Ye("div",{className:le(V("flex flex-col gap-1 w-full"),C),style:S,children:[Y&&/* @__PURE__ */Ve("label",{htmlFor:N,className:V("text-sm font-medium font-sans"),style:{color:$.text},children:Y}),
236
- /* @__PURE__ */Ye("div",{className:V("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${O}`,backgroundColor:x?$.surfaceAlt:$.surface,opacity:x?.65:1,height:H.height},children:[
237
- /* @__PURE__ */Ve(er,{direction:"dec",isDisabled:x||y,btnW:H.btnW,height:H.height,primaryColor:$.primary,borderColor:$.border,textMuted:$.textMuted,iconSz:H.iconSz,onStep:_}),
238
- /* @__PURE__ */Ye("div",{className:V("relative flex-1 flex items-center overflow-hidden"),children:[J&&X&&/* @__PURE__ */Ve("span",{style:{position:"absolute",left:H.px,fontSize:H.fontSize,color:$.textMuted,pointerEvents:"none",userSelect:"none"},children:X}),
239
- /* @__PURE__ */Ve("input",{id:N,type:"text",inputMode:"decimal",value:T?A:Z,readOnly:y,disabled:x,"aria-invalid":j,"aria-describedby":P,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":R,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:H.fontSize,fontFamily:"inherit",color:$.text,paddingLeft:J&&X?`calc(${H.px} + 1.2em)`:H.px,paddingRight:J&&q?`calc(${H.px} + 1.2em)`:H.px,cursor:x?"not-allowed":y?"default":"text"},onFocus:()=>{B(!0),F(String(R))},onBlur:()=>{B(!1);const e=parseFloat(A);if(isNaN(e))return n?.(null),void F(String(R));let t=Qo(e,l);h&&(t=Jo(t,o,r)),G(t)},onChange:e=>{F(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),_(1)),"ArrowDown"===e.key&&(e.preventDefault(),_(-1))},onWheel:e=>{p&&T&&(e.preventDefault(),_(e.deltaY<0?1:-1))}}),J&&q&&/* @__PURE__ */Ve("span",{style:{position:"absolute",right:H.px,fontSize:H.fontSize,color:$.textMuted,pointerEvents:"none",userSelect:"none"},children:q})]}),
240
- /* @__PURE__ */Ve(er,{direction:"inc",isDisabled:x||y,btnW:H.btnW,height:H.height,primaryColor:$.primary,borderColor:$.border,textMuted:$.textMuted,iconSz:H.iconSz,onStep:_})]}),U&&!K&&/* @__PURE__ */Ve("span",{id:M,className:V("text-xs"),style:{color:$.textMuted},children:U}),K&&/* @__PURE__ */Ye("span",{id:I,role:"alert",className:V("text-xs flex items-center gap-1"),style:{color:$.danger},children:[/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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]})]})}tr.displayName="TkxNumberInput";var nr={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},or={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function rr(e,t){return or[t].test(e)?e.toUpperCase():""}function ir({length:e=6,value:t,onChange:n,onComplete:o,type:r="number",mask:i=!1,autoFocus:l=!1,isDisabled:a=!1,isInvalid:s=!1,errorMessage:d,hint:c,size:u="md",separator:h,separatorPosition:p,className:f,style:m}){const g=b(),x=Fe(),y=`${x}-hint`,v=`${x}-error`,w=void 0!==t,k=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[C,S]=Oe(()=>k(w?t:"")),$=w?k(t):C,z=je([]),N=nr[u],M=s||!!d,I=$.every(e=>""!==e),L=c?E(c):void 0,W=d?E(d):void 0,D=e=>M?g.danger:I?g.success:g.border;Ae(()=>{l&&z.current[0]?.focus()},[]);const R=Te(e=>{w||S(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&o?.(t)},[w,n,o]),T=t=>{const n=Math.max(0,Math.min(e-1,t));z.current[n]?.focus()},B=t=>n=>{if(!a){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...$];return e[t]="",void R(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void T(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void T(t+1)):"Home"===n.key?(n.preventDefault(),void T(0)):"End"===n.key?(n.preventDefault(),void T(e-1)):void 0}if(n.preventDefault(),""!==$[t]){const e=[...$];e[t]="",R(e)}else if(t>0){const e=[...$];e[t-1]="",R(e),T(t-1)}}},A=t=>n=>{if(a)return;const o=n.target.value.slice(-1);if(!o)return;const i=rr(o,r);if(!i)return;const l=[...$];l[t]=i,R(l),t<e-1&&T(t+1)},F=t=>n=>{if(n.preventDefault(),a)return;const o=n.clipboardData.getData("text").split("").map(e=>rr(e,r)).filter(Boolean);if(!o.length)return;const i=[...$];let l=t;for(const t of o){if(l>=e)break;i[l]=t,l++}R(i),T(Math.min(l,e-1))},H=[L&&y,M&&v].filter(Boolean).join(" ")||void 0;/* @__PURE__ */
241
- return Ye("div",{className:le(V("flex flex-col gap-2 w-fit"),f),style:m,children:[
242
- /* @__PURE__ */Ve("div",{role:"group","aria-label":"One-time password","aria-describedby":H,className:V("flex items-center"),style:{gap:N.gap},children:Array.from({length:e},(t,n)=>{const o=D();return"undefined"!=typeof document&&(document.activeElement,z.current[n]/* @__PURE__ */),Ye("div",{className:V("flex items-center"),style:{gap:N.gap},children:[h&&p===n&&0!==n&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{color:g.textMuted,userSelect:"none",flexShrink:0},children:h}),/* @__PURE__ */Ve("input",{ref:e=>{z.current[n]=e},type:i?"password":"text",inputMode:"number"===r?"numeric":"text",maxLength:1,value:$[n],disabled:a,"aria-label":`Digit ${n+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:A(n),onKeyDown:B(n),onPaste:F(n),onFocus:e=>e.target.select(),style:{width:N.box,height:N.box,textAlign:"center",fontSize:N.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${o}`,borderRadius:"8px",backgroundColor:a?g.surfaceAlt:g.surface,color:g.text,outline:"none",boxShadow:"none",cursor:a?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:a?.6:1},onFocusCapture:e=>{a||(e.currentTarget.style.borderColor=M?g.danger:g.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${M?g.danger:g.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=D(),e.currentTarget.style.boxShadow="none"}})]},n)})}),L&&!W&&/* @__PURE__ */Ve("span",{id:y,className:V("text-xs"),style:{color:g.textMuted},children:L}),W&&/* @__PURE__ */Ye("span",{id:v,role:"alert",className:V("text-xs flex items-center gap-1"),style:{color:g.danger},children:[/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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"})}),W]})]})}function lr(){const[e,t]=Oe(!1);return{isOpen:e,open:Te(()=>t(!0),[]),close:Te(()=>t(!1),[]),toggle:Te(()=>t(e=>!e),[])}}function ar(e,t){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=t.toLowerCase(),r=o.indexOf(n);if(-1!==r)return{matched:!0,ranges:[[r,r+n.length-1]],score:0===r?100:80};const i=[];let l=0,a=-1,s=-1;for(let d=0;d<o.length&&l<n.length;d++)o[d]===n[l]&&(-1!==s&&d===s+1||(-1!==a&&i.push([a,s]),a=d),s=d,l++);return-1!==a&&-1!==s&&i.push([a,s]),l<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function sr({text:e,ranges:t,color:n}){if(!t.length)/* @__PURE__ */return Ve(Pe,{children:e});const o=[];let r=0;for(const[i,l]of t)r<i&&o.push(/* @__PURE__ */Ve("span",{children:e.slice(r,i)},`t-${r}`)),o.push(/* @__PURE__ */Ve("span",{style:{color:n,fontWeight:700},children:e.slice(i,l+1)},`h-${i}`)),r=l+1;return r<e.length&&o.push(/* @__PURE__ */Ve("span",{children:e.slice(r)},"t-end")),/* @__PURE__ */Ve(Pe,{children:o})}function dr({surface:e,border:t}){/* @__PURE__ */
243
- return Ye("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[/* @__PURE__ */Ve("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[/* @__PURE__ */Ve("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),/* @__PURE__ */Ve("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function cr({items:e,isOpen:t=!1,onClose:n,placeholder:o="Type a command or search…",emptyMessage:r,maxItems:i=8,onItemSelect:l,className:a,style:s}){const d=b(),[c,u]=Oe(""),[h,p]=Oe(0),[f,m]=Oe(!1),g=je(null),x=je(null),y=Fe(),v=function(e){const t=je(null);return Ae(()=>{if(!e||!t.current)return;const n=t.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=o[0],i=o[o.length-1],l=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[e]),t}(t),w=function(e,t){if(!e.trim())return t.filter(e=>!e.disabled).map(e=>({item:e,score:0,labelRanges:[]}));const n=[];for(const o of t){if(o.disabled)continue;const t=ar(e,o.label),r=o.description?ar(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>ar(e,t).matched);t.matched?n.push({item:o,score:t.score+20,labelRanges:t.ranges}):r.matched?n.push({item:o,score:r.score,labelRanges:[]}):i&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((e,t)=>t.score-e.score)}(c,e).slice(0,i),k=[];for(const b of w){const e=b.item.group,t=k.find(t=>t.group===e);t?t.items.push(b):k.push({group:e,items:[b]})}const C=k.flatMap(e=>e.items);var S,$;Ae(()=>{if(!$)return;const e=e=>{"Escape"===e.key&&S()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[S=()=>{n?.()},$=t]),Ae(()=>{t&&(u(""),p(0),setTimeout(()=>g.current?.focus(),30))},[t]),Ae(()=>{h>=C.length&&p(Math.max(0,C.length-1))},[C.length,h]);const z=Te(e=>{const t=x.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),N=e=>{e.disabled||(e.onSelect?.(),l?.(e),n?.())};if(!t||"undefined"==typeof document)return null;const M=E(o),I=r?E(r):`No results for "${E(c)}"`;if("undefined"!=typeof document&&!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 Ue(/* @__PURE__ */Ye("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[/* @__PURE__ */Ve("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"}}),/* @__PURE__ */Ye("div",{ref:v,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:y,className:le(a),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:d.surface,border:`1px solid ${d.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${d.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...s},children:[
215
+ /* @__PURE__ */Ye("button",{type:"button",onClick:()=>G(e=>!e),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:[q,"×"]}),1!==q&&/* @__PURE__ */Ye("span",{style:{position:"absolute",top:0,right:0,background:k.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[q,"x"]}),Z&&/* @__PURE__ */Ue("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${k.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>/* @__PURE__ */Ye("button",{type:"button",onClick:()=>Me(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===q?k.primary+"30":"none",border:"none",color:e===q?k.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),u&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&/* @__PURE__ */Ue(To,{onClick:be,title:"Picture-in-Picture",primary:k.primary,active:ae,children:/* @__PURE__ */Ue(Wo,{path:"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",size:20})}),h&&/* @__PURE__ */Ue("a",{href:Le,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:/* @__PURE__ */Ue(Wo,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),c&&/* @__PURE__ */Ue(To,{onClick:ye,title:O?"Exit fullscreen":"Fullscreen",primary:k.primary,children:/* @__PURE__ */Ue(Wo,{path:O?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",size:20})})]})]}),
216
+ /* @__PURE__ */Ue("style",{children:"\n @keyframes tkxvp-flash {\n 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }\n 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }\n }\n @keyframes tkxvp-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})}Ao.displayName="TkxVideoPlayer";var Bo={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 Fo({size:e}){const t=.55*e;/* @__PURE__ */
217
+ return Ue("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function Eo({size:e}){const t=.55*e;/* @__PURE__ */
218
+ return Ue("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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 jo({status:e,index:t,showStepNumbers:n,icon:o,circleSize:r,fontSize:i,primary:a,danger:l,success:s,text:d,textMuted:c,border:u,surface:h,variant:p,reducedMotion:f,clickable:m}){const g="completed"===e,x="active"===e,y="error"===e;let b=h,v=u,w=c,k=2;g?(b="filled"===p?s:h,v=s,w="filled"===p?"#fff":s):x?(b="outlined"===p?h:a,v=a,w="outlined"===p?a:"#fff",k=2):y?(b="filled"===p?l:h,v=l,w="filled"===p?"#fff":l):"pending"===e&&(b=h,v=u,w=c);const S=x&&!f?{boxShadow:`0 0 0 4px ${a}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},C=m?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let $;return $=!o||g||y?g?/* @__PURE__ */Ue(Fo,{size:r}):y?/* @__PURE__ */Ue(Eo,{size:r}):/* @__PURE__ */Ue("span",n?{style:{fontSize:i,fontWeight:600,lineHeight:1},children:t+1}:{style:{fontSize:.22*r,lineHeight:1,background:w,borderRadius:"50%",width:.22*r,height:.22*r,display:"block"}}):/* @__PURE__ */Ue("span",{style:{fontSize:i,lineHeight:1},children:o}),/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("style",{children:`\n @keyframes tkxstepper-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 ${a}50; }\n 50% { box-shadow: 0 0 0 6px ${a}20; }\n }\n `}),/* @__PURE__ */Ue("div",{style:{width:r,height:r,minWidth:r,borderRadius:"50%",border:`${k}px solid ${v}`,backgroundColor:b,color:w,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:f?"none":"background-color 0.2s, border-color 0.2s",...S,...C},children:$})]})}function Ho({completed:e,orientation:t,connectorStyle:n,connectorWidth:o,primary:r,border:i,reducedMotion:a}){const l=e?r:i;/* @__PURE__ */
219
+ return Ue("div","horizontal"===t?{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}:{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?l:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${l} 0, ${l} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:a?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Po({steps:e,activeStep:t=0,orientation:n="horizontal",variant:o="default",size:r="md",clickable:i=!1,onStepClick:a,showStepNumbers:l=!0,alternateLabel:s=!1,connector:d="solid",className:c,style:u}){const h=N(),p=ge(),f=Bo[r],m="horizontal"===n;/* @__PURE__ */
220
+ return Ue("div",{className:c,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:m?"row":"column",alignItems:m?s?"flex-start":"center":"stretch",width:"100%",gap:0,...u},children:e.map((n,r)=>{const c=((e,n)=>e.status?e.status:n<t?"completed":n===t?"active":"pending")(n,r),u=r===e.length-1,g="completed"===c||r<t,x=r%2==0,y=()=>{i&&a?.(r)},b=/* @__PURE__ */Ue(jo,{status:c,index:r,showStepNumbers:l,icon:n.icon,circleSize:f.circle,fontSize:f.fontSize,primary:h.primary,danger:h.danger,success:h.success,text:h.text,textMuted:h.textMuted,border:h.border,surface:h.surface,variant:o,reducedMotion:p,clickable:i}),v=/* @__PURE__ */Ye("div",{style:{textAlign:m&&!s?"center":"left",maxWidth:m?120:void 0},children:[
221
+ /* @__PURE__ */Ye("div",{style:{fontSize:f.titleSize,fontWeight:"active"===c?600:500,color:"pending"===c?h.textMuted:"error"===c?h.danger:h.text,lineHeight:1.3,transition:p?"none":"color 0.2s"},children:[j(n.title),n.optional&&/* @__PURE__ */Ue("span",{style:{fontSize:f.descSize,color:h.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),n.description&&/* @__PURE__ */Ue("div",{style:{fontSize:f.descSize,color:h.textMuted,marginTop:2,lineHeight:1.4},children:j(n.description)}),n.error&&"error"===c&&/* @__PURE__ */Ue("div",{style:{fontSize:f.descSize,color:h.danger,marginTop:2},children:j(n.error)})]});/* @__PURE__ */
222
+ return Ye("div",m?{role:"listitem",style:{display:"flex",flex:u?0:1,alignItems:"center",minWidth:0},children:[/* @__PURE__ */Ye("div",{onClick:y,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:i?"pointer":"default",flexShrink:0},"aria-current":"active"===c?"step":void 0,children:[s&&!x&&/* @__PURE__ */Ue("div",{style:{minHeight:1.5*f.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:v}),b,!s&&v,s&&x&&/* @__PURE__ */Ue("div",{style:{marginTop:6},children:v})]}),!u&&/* @__PURE__ */Ue(Ho,{completed:g,orientation:"horizontal",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}:{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[/* @__PURE__ */Ue("div",{onClick:y,style:{cursor:i?"pointer":"default"},"aria-current":"active"===c?"step":void 0,children:b}),!u&&/* @__PURE__ */Ue(Ho,{completed:g,orientation:"vertical",connectorStyle:d,connectorWidth:f.connectorWidth,primary:h.primary,border:h.border,reducedMotion:p})]}),/* @__PURE__ */Ue("div",{style:{paddingTop:(f.circle-16*parseFloat(f.titleSize))/2,paddingBottom:u?0:16,flex:1,minWidth:0},children:v})]},n.id)})})}function Oo(e){let t=0,n=0,o=0;const r=e.replace("#","");3===r.length?(t=parseInt(r[0]+r[0],16),n=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16)):r.length>=6&&(t=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16)),t/=255,n/=255,o/=255;const i=Math.max(t,n,o),a=Math.min(t,n,o);let l=0,s=0;const d=(i+a)/2;if(i!==a){const e=i-a;switch(s=d>.5?e/(2-i-a):e/(i+a),i){case t:l=((n-o)/e+(n<o?6:0))/6;break;case n:l=((o-t)/e+2)/6;break;case o:l=((t-n)/e+4)/6}}return[Math.round(360*l),Math.round(100*s),Math.round(100*d)]}function Vo(e,t,n){n/=100;const o=(t/=100)*Math.min(n,1-n),r=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function Ko(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(r)?0:r]}function Uo(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Yo(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Xo(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=Ko(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[a,l,s]=Oo(e);return"hsl"===n?t<1?`hsla(${a}, ${l}%, ${s}%, ${t.toFixed(2)})`:`hsl(${a}, ${l}%, ${s}%)`:e}Po.displayName="TkxStepper";var qo=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function _o({hue:e,sat:t,bright:n,onChange:o}){const r=Oe(null),i=Oe(!1),a=Ae(e=>{const t=r.current;if(!t)return;const n=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),a=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));o(Math.round(100*i),Math.round(100*(1-a)))},[o]);Fe(()=>{const e=e=>{i.current&&a(e)},t=()=>{i.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[a]);const l=`${t}%`,s=100-n+"%";/* @__PURE__ */
223
+ return Ye("div",{ref:r,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:e=>{i.current=!0,a(e)},children:[
224
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),
225
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),
226
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",left:l,top:s,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:Vo(e,t,n/2+25)}})]})}function Zo({hue:e,onChange:t}){const n=Oe(null),o=Oe(!1),r=Ae(e=>{const o=n.current;if(!o)return;const r=o.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));t(Math.round(360*i))},[t]);return Fe(()=>{const e=e=>{o.current&&r(e)},t=()=>{o.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[r]),/* @__PURE__ */Ue("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:e=>{o.current=!0,r(e)},children:/* @__PURE__ */Ue("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 Go({alpha:e,hex:t,onChange:n}){const o=Oe(null),r=Oe(!1),i=Ae(e=>{const t=o.current;if(!t)return;const r=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));n(Math.round(100*i)/100)},[n]);Fe(()=>{const e=e=>{r.current&&i(e)},t=()=>{r.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[i]);const[a,l,s]=Ko(t);/* @__PURE__ */
227
+ return Ye("div",{style:{position:"relative"},children:[/* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),/* @__PURE__ */Ue("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${a},${l},${s},0), rgba(${a},${l},${s},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:/* @__PURE__ */Ue("div",{style:{position:"absolute",left:100*e+"%",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(${a},${l},${s},${e})`,pointerEvents:"none"}})})]})}function Jo({value:e,defaultValue:t="#3b82f6",onChange:n,format:o="hex",showAlpha:r=!1,presets:i=qo,disabled:a=!1,size:l="md",placeholder:s,label:d,style:c}){const u=N(),h=Oe(null),p=Oe(null),[f,m]=Ve(!1),g=void 0!==e,[x,y]=Ve(g&&e||t),b=g?e||t:x,[v,w]=Ve(1),[k,S]=Ve(b),[C,$]=Ve({top:0,left:0}),[z,M,I]=Oo(Yo(b)?b:t);Math.round(I+M/100*Math.min(I/100,1-I/100)*100);const D=Ae((e,t=v)=>{Yo(e)&&(S(e),g||y(e),n?.(Xo(e,t,o),o))},[v,g,o,n]);Fe(()=>{g&&e&&Yo(e)&&S(e)},[g,e]),Fe(()=>{if(!f)return;const e=e=>{p.current&&!p.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]),Fe(()=>{if(!f)return;const e=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);const W=e=>{w(e),n?.(Xo(b,e,o),o)},L={sm:28,md:34,lg:40}[l],[R,T,A]=Ko(Yo(b)?b:t),B={display:"inline-flex",alignItems:"center",gap:"8px",height:`${L}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${u.border}`,backgroundColor:u.surface,cursor:a?"not-allowed":"pointer",opacity:a?.5:1,color:u.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...c},F={width:L-8+"px",height:L-8+"px",borderRadius:"4px",backgroundColor:`rgba(${R},${T},${A},${v})`,border:`1px solid ${u.border}`,flexShrink:0},E={position:"absolute",top:C.top,left:C.left,zIndex:9999,width:"260px",backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},j={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},H={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${u.border}`,backgroundColor:u.bg,color:u.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},P=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===b.toLowerCase()?`2px solid ${u.primary}`:`1px solid ${u.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});/* @__PURE__ */
228
+ return Ye(Ke,{children:[d&&/* @__PURE__ */Ue("label",{style:{display:"block",fontSize:"13px",color:u.text,marginBottom:"6px",fontWeight:500},children:d}),
229
+ /* @__PURE__ */Ye("button",{ref:h,type:"button",style:B,onClick:()=>{if(a)return;const e=h.current;if(!e)return;const t=e.getBoundingClientRect();$({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),m(!0)},disabled:a,"aria-label":`Color picker, current color ${b}`,"aria-haspopup":"dialog","aria-expanded":f,children:[/* @__PURE__ */Ue("div",{style:F}),/* @__PURE__ */Ue("span",{style:{fontFamily:"monospace",fontSize:"12px",color:u.textMuted},children:s??Xo(Yo(b)?b:t,v,o)})]}),f&&Xe(/* @__PURE__ */Ye("div",{ref:p,style:E,role:"dialog","aria-label":"Color picker",children:[
230
+ /* @__PURE__ */Ue(_o,{hue:z,sat:M,bright:I,onChange:(e,t)=>{const n=t/100,o=n*(1-e/100/2),r=0===o||1===o?0:(n-o)/Math.min(o,1-o);D(Vo(z,Math.round(100*r),Math.round(100*o)))}}),
231
+ /* @__PURE__ */Ue(Zo,{hue:z,onChange:e=>{D(Vo(e,M,I))}}),r&&/* @__PURE__ */Ue(Go,{alpha:v,hex:Yo(b)?b:t,onChange:W}),
232
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[/* @__PURE__ */Ue("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${R},${T},${A},${v})`,border:`1px solid ${u.border}`}}),/* @__PURE__ */Ue("input",{style:j,value:k,onChange:e=>{const t=e.target.value;S(t),Yo(t)&&D(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),
233
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ue("input",{style:H,type:"number",min:0,max:255,value:"r"===e?R:"g"===e?T:A,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=Ko(b);D("r"===e?Uo(n,r,i):"g"===e?Uo(o,n,i):Uo(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),/* @__PURE__ */Ue("span",{style:{fontSize:"10px",color:u.textMuted,textTransform:"uppercase"},children:e})]},e)),r&&/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[/* @__PURE__ */Ue("input",{style:H,type:"number",min:0,max:100,value:Math.round(100*v),onChange:e=>W(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),/* @__PURE__ */Ue("span",{style:{fontSize:"10px",color:u.textMuted},children:"A%"})]})]}),i.length>0&&/* @__PURE__ */Ye("div",{children:[/* @__PURE__ */Ue("div",{style:{fontSize:"11px",color:u.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),/* @__PURE__ */Ue("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:i.map(e=>/* @__PURE__ */Ue("button",{type:"button",style:P(e),onClick:()=>D(e),"aria-label":`Select color ${e}`,onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"}},e))})]})]}),document.body)]})}var Qo={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 er(e,t,n){let o=e;return void 0!==t&&(o=Math.max(o,t)),void 0!==n&&(o=Math.min(o,n)),o}function tr(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function nr({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:a,iconSz:l,onStep:s,incrementLabel:d,decrementLabel:c}){const u=Oe(null),h=Oe(null),p="inc"===e?1:-1,f=Ae(()=>{s(p),u.current=setTimeout(()=>{h.current=setInterval(()=>s(p),60)},400)},[p,s]),m=Ae(()=>{u.current&&(clearTimeout(u.current),u.current=null),h.current&&(clearInterval(h.current),h.current=null)},[]);Fe(()=>()=>m(),[m]);const g="inc"===e;/* @__PURE__ */
234
+ return Ue("button",{type:"button","aria-label":g?d:c,disabled:t,onMouseDown:f,onMouseUp:m,onMouseLeave:m,onTouchStart:e=>{e.preventDefault(),f()},onTouchEnd:m,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:g?void 0:`1px solid ${i}`,borderLeft:g?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?a:r,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${r}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:g?/* @__PURE__ */Ye("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):/* @__PURE__ */Ue("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function or({value:e,defaultValue:t=0,onChange:n,min:o,max:r,step:i=1,precision:a,prefix:l,suffix:s,format:d,currency:c,locale:u,clampOnBlur:h=!0,allowMouseWheel:p=!1,size:f="md",label:m,hint:g,isDisabled:x=!1,isReadOnly:y=!1,isInvalid:b=!1,errorMessage:v,id:w,className:k,style:S}){const C=N(),$=$e(),z=$.increment??"Increment",M=$.decrement??"Decrement",I=Ee(),D=w??I,W=`${D}-hint`,L=`${D}-error`,R=void 0!==e,[T,A]=Ve(t),B=R?e:T,[F,E]=Ve(!1),[H,P]=Ve(""),O=Qo[f],V=b||!!v,U=V?C.danger:F?C.primary:C.border,Y=[g&&W,V&&L].filter(Boolean).join(" ")||void 0,X=m?j(m):void 0,q=g?j(g):void 0,_=v?j(v):void 0,Z=l?j(l):void 0,G=s?j(s):void 0,J=Ae(e=>{const t=tr(e,a);R||A(t),n?.(t)},[R,n,a]),Q=Ae(e=>{x||y||J(er(tr(B+e*i,a),o,r))},[x,y,B,i,a,o,r,J]),ee=F?H:function(e,t,n,o,r){const i=o??"en-US";return"currency"===t?new Intl.NumberFormat(i,{style:"currency",currency:n??"USD",minimumFractionDigits:r??2,maximumFractionDigits:r??2}).format(e):"percent"===t?new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:r??0,maximumFractionDigits:r??0}).format(e/100):"decimal"===t||void 0!==r?new Intl.NumberFormat(i,{minimumFractionDigits:r??0,maximumFractionDigits:r??20}).format(e):String(e)}(B,d,c,u,a),te=(Z||G)&&!F;/* @__PURE__ */
235
+ return Ye("div",{className:le(K("flex flex-col gap-1 w-full"),k),style:S,children:[X&&/* @__PURE__ */Ue("label",{htmlFor:D,className:K("text-sm font-medium font-sans"),style:{color:C.text},children:X}),
236
+ /* @__PURE__ */Ye("div",{className:K("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${U}`,backgroundColor:x?C.surfaceAlt:C.surface,opacity:x?.65:1,height:O.height},children:[
237
+ /* @__PURE__ */Ue(nr,{direction:"dec",isDisabled:x||y,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:M}),
238
+ /* @__PURE__ */Ye("div",{className:K("relative flex-1 flex items-center overflow-hidden"),children:[te&&Z&&/* @__PURE__ */Ue("span",{style:{position:"absolute",left:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:Z}),
239
+ /* @__PURE__ */Ue("input",{id:D,type:"text",inputMode:"decimal",value:F?H:ee,readOnly:y,disabled:x,"aria-invalid":V,"aria-describedby":Y,"aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":B,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:C.text,paddingLeft:te&&Z?`calc(${O.px} + 1.2em)`:O.px,paddingRight:te&&G?`calc(${O.px} + 1.2em)`:O.px,cursor:x?"not-allowed":y?"default":"text"},onFocus:()=>{E(!0),P(String(B))},onBlur:()=>{E(!1);const e=parseFloat(H);if(isNaN(e))return n?.(null),void P(String(B));let t=tr(e,a);h&&(t=er(t,o,r)),J(t)},onChange:e=>{P(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),Q(1)),"ArrowDown"===e.key&&(e.preventDefault(),Q(-1))},onWheel:e=>{p&&F&&(e.preventDefault(),Q(e.deltaY<0?1:-1))}}),te&&G&&/* @__PURE__ */Ue("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:G})]}),
240
+ /* @__PURE__ */Ue(nr,{direction:"inc",isDisabled:x||y,btnW:O.btnW,height:O.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:O.iconSz,onStep:Q,incrementLabel:z,decrementLabel:M})]}),q&&!_&&/* @__PURE__ */Ue("span",{id:W,className:K("text-xs"),style:{color:C.textMuted},children:q}),_&&/* @__PURE__ */Ye("span",{id:L,role:"alert",className:K("text-xs flex items-center gap-1"),style:{color:C.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})}),_]})]})}or.displayName="TkxNumberInput";var rr={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},ir={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function ar(e,t){return ir[t].test(e)?e.toUpperCase():""}function lr({length:e=6,value:t,onChange:n,onComplete:o,type:r="number",mask:i=!1,autoFocus:a=!1,isDisabled:l=!1,isInvalid:s=!1,errorMessage:d,hint:c,size:u="md",separator:h,separatorPosition:p,webOTP:f=!0,className:m,style:g}){const x=N(),y=$e(),b=Ee(),v=`${b}-hint`,w=`${b}-error`,k=void 0!==t,S=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[C,$]=Ve(()=>S(k?t:"")),z=k?S(t):C,M=Oe([]),I=rr[u],D=s||!!d,W=z.every(e=>""!==e),L=c?j(c):void 0,R=d?j(d):void 0,T=e=>D?x.danger:W?x.success:x.border;Fe(()=>{a&&M.current[0]?.focus()},[]);const A=Ae(e=>{k||$(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&o?.(t)},[k,n,o]);Fe(()=>{if(!f||l)return;if("undefined"==typeof window||!("OTPCredential"in window))return;const t=new AbortController;return navigator.credentials?.get({otp:{transport:["sms"]},signal:t.signal}).then(t=>{if(!t?.code)return;const n=String(t.code).slice(0,e).split("").map(e=>ar(e,r));for(;n.length<e;)n.push("");A(n)}).catch(()=>{}),()=>t.abort()},[f,l,e,r]);const B=t=>{const n=Math.max(0,Math.min(e-1,t));M.current[n]?.focus()},F=t=>n=>{if(!l){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...z];return e[t]="",void A(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void B(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void B(t+1)):"Home"===n.key?(n.preventDefault(),void B(0)):"End"===n.key?(n.preventDefault(),void B(e-1)):void 0}if(n.preventDefault(),""!==z[t]){const e=[...z];e[t]="",A(e)}else if(t>0){const e=[...z];e[t-1]="",A(e),B(t-1)}}},E=t=>n=>{if(l)return;const o=n.target.value.slice(-1);if(!o)return;const i=ar(o,r);if(!i)return;const a=[...z];a[t]=i,A(a),t<e-1&&B(t+1)},H=t=>n=>{if(n.preventDefault(),l)return;const o=n.clipboardData.getData("text").split("").map(e=>ar(e,r)).filter(Boolean);if(!o.length)return;const i=[...z];let a=t;for(const t of o){if(a>=e)break;i[a]=t,a++}A(i),B(Math.min(a,e-1))},P=[L&&v,D&&w].filter(Boolean).join(" ")||void 0;/* @__PURE__ */
241
+ return Ye("div",{className:le(K("flex flex-col gap-2 w-fit"),m),style:g,children:[
242
+ /* @__PURE__ */Ue("div",{role:"group","aria-label":y.oneTimePassword??"One-time password","aria-describedby":P,className:K("flex items-center"),style:{gap:I.gap},children:Array.from({length:e},(t,n)=>{const o=T();return"undefined"!=typeof document&&(document.activeElement,M.current[n]/* @__PURE__ */),Ye("div",{className:K("flex items-center"),style:{gap:I.gap},children:[h&&p===n&&0!==n&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{color:x.textMuted,userSelect:"none",flexShrink:0},children:h}),/* @__PURE__ */Ue("input",{ref:e=>{M.current[n]=e},type:i?"password":"text",inputMode:"number"===r?"numeric":"text",maxLength:1,value:z[n],disabled:l,"aria-label":`Digit ${n+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:E(n),onKeyDown:F(n),onPaste:H(n),onFocus:e=>e.target.select(),style:{width:I.box,height:I.box,textAlign:"center",fontSize:I.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${o}`,borderRadius:"8px",backgroundColor:l?x.surfaceAlt:x.surface,color:x.text,outline:"none",boxShadow:"none",cursor:l?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:l?.6:1},onFocusCapture:e=>{l||(e.currentTarget.style.borderColor=D?x.danger:x.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${D?x.danger:x.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=T(),e.currentTarget.style.boxShadow="none"}})]},n)})}),L&&!R&&/* @__PURE__ */Ue("span",{id:v,className:K("text-xs"),style:{color:x.textMuted},children:L}),R&&/* @__PURE__ */Ye("span",{id:w,role:"alert",className:K("text-xs flex items-center gap-1"),style:{color:x.danger},children:[/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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]})]})}function sr(){const[e,t]=Ve(!1);return{isOpen:e,open:Ae(()=>t(!0),[]),close:Ae(()=>t(!1),[]),toggle:Ae(()=>t(e=>!e),[])}}function dr(e,t){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=t.toLowerCase(),r=o.indexOf(n);if(-1!==r)return{matched:!0,ranges:[[r,r+n.length-1]],score:0===r?100:80};const i=[];let a=0,l=-1,s=-1;for(let d=0;d<o.length&&a<n.length;d++)o[d]===n[a]&&(-1!==s&&d===s+1||(-1!==l&&i.push([l,s]),l=d),s=d,a++);return-1!==l&&-1!==s&&i.push([l,s]),a<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function cr({text:e,ranges:t,color:n}){if(!t.length)/* @__PURE__ */return Ue(Ke,{children:e});const o=[];let r=0;for(const[i,a]of t)r<i&&o.push(/* @__PURE__ */Ue("span",{children:e.slice(r,i)},`t-${r}`)),o.push(/* @__PURE__ */Ue("span",{style:{color:n,fontWeight:700},children:e.slice(i,a+1)},`h-${i}`)),r=a+1;return r<e.length&&o.push(/* @__PURE__ */Ue("span",{children:e.slice(r)},"t-end")),/* @__PURE__ */Ue(Ke,{children:o})}function ur({surface:e,border:t}){/* @__PURE__ */
243
+ return Ye("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[/* @__PURE__ */Ue("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),/* @__PURE__ */Ye("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[/* @__PURE__ */Ue("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),/* @__PURE__ */Ue("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function hr({items:e,isOpen:t=!1,onClose:n,placeholder:o,emptyMessage:r,maxItems:i=8,onItemSelect:a,className:l,style:s}){const d=N(),c=$e(),u=o??c.commandSearch??"Type a command or search…",[h,p]=Ve(""),[f,m]=Ve(0),[g,x]=Ve(!1),y=Oe(null),b=Oe(null),v=Ee(),w=function(e){const t=Oe(null);return Fe(()=>{if(!e||!t.current)return;const n=t.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=o[0],i=o[o.length-1],a=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",a),()=>n.removeEventListener("keydown",a)},[e]),t}(t),k=function(e,t){if(!e.trim())return t.filter(e=>!e.disabled).map(e=>({item:e,score:0,labelRanges:[]}));const n=[];for(const o of t){if(o.disabled)continue;const t=dr(e,o.label),r=o.description?dr(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>dr(e,t).matched);t.matched?n.push({item:o,score:t.score+20,labelRanges:t.ranges}):r.matched?n.push({item:o,score:r.score,labelRanges:[]}):i&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((e,t)=>t.score-e.score)}(h,e).slice(0,i),S=[];for(const N of k){const e=N.item.group,t=S.find(t=>t.group===e);t?t.items.push(N):S.push({group:e,items:[N]})}const C=S.flatMap(e=>e.items);var $,z;Fe(()=>{if(!z)return;const e=e=>{"Escape"===e.key&&$()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$=()=>{n?.()},z=t]),Fe(()=>{t&&(p(""),m(0),setTimeout(()=>y.current?.focus(),30))},[t]),Fe(()=>{f>=C.length&&m(Math.max(0,C.length-1))},[C.length,f]);const M=Ae(e=>{const t=b.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),I=e=>{e.disabled||(e.onSelect?.(),a?.(e),n?.())};if(!t||"undefined"==typeof document)return null;const D=j(u),W=c.noCommandsFound??`No results for "${j(h)}"`,L=r?j(r):W;if("undefined"!=typeof document&&!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 Xe(/* @__PURE__ */Ye("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[/* @__PURE__ */Ue("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"}}),/* @__PURE__ */Ye("div",{ref:w,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:v,className:le(l),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:d.surface,border:`1px solid ${d.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${d.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...s},children:[
244
244
  /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${d.border}`},children:[
245
- /* @__PURE__ */Ye("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:d.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ve("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ve("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),
246
- /* @__PURE__ */Ve("input",{ref:g,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${y}-list`,"aria-activedescendant":C[h]?`${y}-item-${C[h].item.id}`:void 0,value:c,onChange:e=>{u(e.target.value),p(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(C.length-1,h+1);p(t),z(t)}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(0,h-1);p(t),z(t)}else if("Enter"===e.key){e.preventDefault();const t=C[h];t&&N(t.item)}},placeholder:M,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:d.text}}),c&&/* @__PURE__ */Ve("button",{type:"button","aria-label":"Clear search",onClick:()=>{u(""),p(0),g.current?.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:d.textMuted,display:"flex",alignItems:"center",padding:0},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),
247
- /* @__PURE__ */Ve("div",{id:`${y}-list`,ref:x,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:f?Array.from({length:4},(e,t)=>/* @__PURE__ */Ve(dr,{surface:d.surface,border:d.border},t)):0===C.length?/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:d.textMuted},children:[/* @__PURE__ */Ye("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[
248
- /* @__PURE__ */Ve("circle",{cx:"11",cy:"11",r:"8"}),
249
- /* @__PURE__ */Ve("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),
250
- /* @__PURE__ */Ve("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),/* @__PURE__ */Ve("span",{style:{fontSize:"0.875rem"},children:I})]}):k.map(({group:e,items:t},n)=>{const o=k.slice(0,n).reduce((e,t)=>e+t.items.length,0);/* @__PURE__ */
251
- return Ye("div",{children:[e&&/* @__PURE__ */Ve("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:d.textMuted,padding:"10px 12px 4px"},children:E(e)}),t.map((e,t)=>{const n=o+t,r=n===h,i=e.item;/* @__PURE__ */
252
- return Ye("div",{id:`${y}-item-${i.id}`,role:"option","aria-selected":r,"aria-disabled":i.disabled,"data-command-item":!0,onClick:()=>N(i),onMouseEnter:()=>p(n),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:i.disabled?"not-allowed":"pointer",opacity:i.disabled?.45:1,backgroundColor:r?`${d.primary}18`:"transparent",borderLeft:r?`2px solid ${d.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[i.icon&&/* @__PURE__ */Ve("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:r?d.primary:d.textMuted},children:i.icon}),
253
- /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ve("div",{style:{fontSize:"0.875rem",fontWeight:500,color:d.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:/* @__PURE__ */Ve(sr,{text:i.label,ranges:e.labelRanges,color:d.primary})}),i.description&&/* @__PURE__ */Ve("div",{style:{fontSize:"0.75rem",color:d.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:E(i.description)})]}),i.shortcut&&/* @__PURE__ */Ve("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:d.textMuted,backgroundColor:d.surfaceAlt,border:`1px solid ${d.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:E(i.shortcut)})]},i.id)})]},e??"__default__")})}),C.length>0&&/* @__PURE__ */Ye("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${d.border}`,fontSize:"0.6875rem",color:d.textMuted},children:[
254
- /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ve("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),
255
- /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ve("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),
256
- /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ve("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}function ur({direction:e,onClick:t,isDisabled:n,primaryColor:o,position:r,orientation:i}){const l="vertical"===i,a="prev"===e,s="inside"===r?{position:"absolute",zIndex:3,...l?{[a?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[a?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};/* @__PURE__ */
257
- return Ve("button",{type:"button","aria-label":a?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...s,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:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:/* @__PURE__ */Ve("svg",l?a?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ve("polyline",{points:"18 15 12 9 6 15"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ve("polyline",{points:"6 9 12 15 18 9"})}:a?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ve("polyline",{points:"15 18 9 12 15 6"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ve("polyline",{points:"9 18 15 12 9 6"})})})}function hr({slides:e,autoPlay:t=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:r=!0,showArrows:i=!0,showDots:l=!0,showThumbnails:a=!1,orientation:s="horizontal",slidesToShow:d=1,gap:c=0,transitionDuration:u=400,swipeable:h=!0,initialIndex:p=0,onChange:f,arrowPosition:m="inside",height:g=320,className:x,style:y}){const v=b(),w=me(),k=Fe(),C=e.length,[S,$]=Oe(p),[z,N]=Oe(r?p+1:p),[M,I]=Oe(!1),[L,W]=Oe(!1),D=je(null),R=je(null),T=je(null),B=je(0),A=je(!1),F="vertical"===s,E=w?0:u,H=r&&C>1?[e[C-1],...e,e[0]]:e,j=H.length,O=100/d,P=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return F?`translateY(calc(-${e*O}%${n}))`:`translateX(calc(-${e*O}%${n}))`},Y=Te((e,t=!1)=>{const n=r?(e%C+C)%C:Math.max(0,Math.min(C-1,e)),o=r?n+1:n;t&&D.current?(D.current.style.transition="none",N(o),$(n),D.current.offsetHeight,D.current.style.transition=""):(I(!0),N(o),$(n)),f?.(n)},[C,r,f]),U=Te(()=>Y(S-1),[S,Y]),K=Te(()=>Y(S+1),[S,Y]),X=Te(()=>{I(!1),!r||C<=1||(0===z?Y(C-1,!0):z===j-1&&Y(0,!0))},[r,C,z,j,Y]);Ae(()=>{if(!(!t||L||C<=1))return R.current=setInterval(K,n),()=>{R.current&&clearInterval(R.current)}},[t,L,n,K,C]),Ae(()=>{const e=e=>{const t=document.activeElement;document.getElementById(k)?.contains(t)&&(e.key===(F?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),U()),e.key===(F?"ArrowDown":"ArrowRight")&&(e.preventDefault(),K()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[k,F,U,K]);const q=e=>"touches"in e?F?e.touches[0].clientY:e.touches[0].clientX:F?e.clientY:e.clientX,G=e=>{h&&(T.current=q(e),B.current=0,A.current=!0)},_=e=>{if(!A.current||null===T.current)return;const t=q(e)-T.current;B.current=t,D.current&&(D.current.style.transition="none",D.current.style.transform=P(z,-t))},Z=()=>{if(!A.current)return;A.current=!1;const e=B.current;D.current&&(D.current.style.transition="",D.current.style.transform=""),e<-50?K():e>50?U():D.current&&(D.current.style.transform=P(z)),T.current=null,B.current=0},J="number"==typeof g?`${g}px`:g,Q={display:"flex",flexDirection:F?"column":"row",width:F?"100%":j/d*100+"%",height:F?j/d*100+"%":"100%",transform:P(z),transition:M||!w?`transform ${E}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:c>0?c:void 0},ee={flexShrink:0,width:F?"100%":O/(j/d)+"%",height:F?O/(j/d)+"%":"100%",overflow:"hidden",position:"relative"},te=r||S>0,ne=r||S<C-1,oe="outside"===m;/* @__PURE__ */
258
- return Ye("div",{id:k,className:le(V("flex flex-col gap-2"),x),style:y,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[/* @__PURE__ */Ye("div",{className:V("flex items-center gap-2"),style:{gap:oe&&i?8:0},children:[i&&oe&&/* @__PURE__ */Ve(ur,{direction:"prev",onClick:U,isDisabled:!te,primaryColor:v.primary,position:"outside",orientation:s}),
259
- /* @__PURE__ */Ye("div",{style:{position:"relative",flex:1,overflow:"hidden",height:J,borderRadius:12,cursor:h?A.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&W(!0),onMouseLeave:()=>{W(!1),Z()},onTouchStart:G,onTouchMove:_,onTouchEnd:Z,onMouseDown:G,onMouseMove:_,onMouseUp:Z,"aria-live":"polite","aria-atomic":"false",children:[i&&!oe&&/* @__PURE__ */Ye(Pe,{children:[/* @__PURE__ */Ve(ur,{direction:"prev",onClick:U,isDisabled:!te,primaryColor:v.primary,position:"inside",orientation:s}),/* @__PURE__ */Ve(ur,{direction:"next",onClick:K,isDisabled:!ne,primaryColor:v.primary,position:"inside",orientation:s})]}),
260
- /* @__PURE__ */Ve("div",{ref:D,style:Q,onTransitionEnd:X,children:H.map((e,t)=>/* @__PURE__ */Ve("div",{style:ee,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(t-(r?1:0)+C)%C+1} of ${C}`,"aria-hidden":(t-(r?1:0)+C)%C!==S,children:e.content},`${e.id}-${t}`))}),l&&!a&&/* @__PURE__ */Ve("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((e,t)=>/* @__PURE__ */Ve("button",{type:"button","aria-label":`Go to slide ${t+1}`,"aria-current":t===S?"true":void 0,onClick:()=>Y(t),style:{width:t===S?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:t===S?v.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${v.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow="none"}},e.id))})]}),i&&oe&&/* @__PURE__ */Ve(ur,{direction:"next",onClick:K,isDisabled:!ne,primaryColor:v.primary,position:"outside",orientation:s})]}),a&&/* @__PURE__ */Ve("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((e,t)=>/* @__PURE__ */Ye("button",{type:"button",role:"tab","aria-selected":t===S,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>Y(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===S?v.primary:v.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:v.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${v.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},children:[e.thumbnail?/* @__PURE__ */Ve("img",{src:e.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):/* @__PURE__ */Ve("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:v.textMuted,fontWeight:600},children:t+1}),t===S&&/* @__PURE__ */Ve("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${v.primary}22`}})]},e.id))})]})}function pr({color:e}){/* @__PURE__ */
261
- return Ve("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function fr({onClick:e,bgColor:t,hoverColor:n,textColor:o}){/* @__PURE__ */
262
- return Ve("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":"Show hidden breadcrumb items",className:V("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:t,color:o,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=n},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function mr({items:e,separator:t,maxItems:n,onNavigate:o,className:r,style:i}){const l=b(),a=me(),s=void 0!==n&&n>1&&e.length>n,d=Te(()=>{if(!s||!n)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((n-1)/2),o=n-1-t,r=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),i=e.slice(e.length-o).map((t,n)=>({item:t,originalIndex:e.length-o+n}));return r.concat(i)},[e,n,s])(),c=s&&n?Math.ceil((n-1)/2):-1,u=(e,t)=>{o?.(e,t)},h=a?{}:{transition:"color 150ms ease, background-color 150ms ease"},p=e=>/* @__PURE__ */Ve("li",{role:"presentation","aria-hidden":"true",className:V("flex items-center mx-1.5"),children:t??/* @__PURE__ */Ve(pr,{color:l.textMuted})},e),f=(e,t,n)=>{const r=E(e.label);if(n)/* @__PURE__ */return Ve("li",{children:/* @__PURE__ */Ye("span",{"aria-current":"page",className:V("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:l.text},children:[e.icon&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",className:V("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,a={color:l.textMuted,textDecoration:"none",...h},s={onMouseEnter:e=>{e.currentTarget.style.color=l.primary},onMouseLeave:e=>{e.currentTarget.style.color=l.textMuted}},d=/* @__PURE__ */Ye(Pe,{children:[e.icon&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",className:V("flex-shrink-0"),children:e.icon}),r]});/* @__PURE__ */
263
- return Ve("li",i?{children:/* @__PURE__ */Ve("a",{href:e.href,onClick:n=>{o&&(n.preventDefault(),u(e,t))},className:V("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...a,focusRingColor:l.primary},...s,children:d})}:{children:/* @__PURE__ */Ve("button",{type:"button",onClick:()=>u(e,t),onKeyDown:n=>((e,t,n)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u(t,n))})(n,e,t),className:V("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:a,...s,children:d})},`item-${t}`)},m=[];let g=!1;for(let x=0;x<d.length;x++){const{item:t,originalIndex:n}=d[x],o=n===e.length-1;s&&!g&&x===c&&(m.length>0&&m.push(p("sep-ellipsis-before")),m.push(/* @__PURE__ */Ve("li",{role:"presentation",children:/* @__PURE__ */Ve(fr,{onClick:()=>{},bgColor:l.surfaceAlt,hoverColor:l.surface,textColor:l.textMuted})},"ellipsis")),g=!0),m.length>0&&null!==m[m.length-1]&&m.push(p(`sep-${n}`)),m.push(f(t,n,o))}/* @__PURE__ */
264
- return Ve("nav",{"aria-label":"Breadcrumb",className:V("font-sans",r??""),style:{...i},children:/* @__PURE__ */Ve("ol",{role:"list",className:V("flex items-center flex-wrap list-none m-0 p-0"),children:m})})}function gr({trigger:e,content:t,placement:n="bottom",isOpen:o,onOpenChange:r,closeOnClickOutside:i=!0,className:l,style:a}){const s=b(),d=me(),c=Fe(),u=void 0!==o,[h,p]=Oe(!1),f=u?o:h,m=je(null),g=je(null);je(null);const[x,y]=Oe(null),v=Te(e=>{u||p(e),r?.(e)},[u,r]),w=Te(()=>v(!1),[v]),k=Te(()=>v(!f),[v,f]);ge(w,f),Ae(()=>{if(!f||!i)return;const e=e=>{const t=e.target;m.current?.contains(t)||g.current?.contains(t)||w()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[f,i,w]),Ae(()=>{if(!f||!m.current)return;const e=()=>{m.current&&g.current&&y(function(e,t,n){const o=t.getBoundingClientRect(),r=window.scrollX,i=window.scrollY,l=window.innerWidth,a=window.innerHeight;let s=0,d=0,c=n;const u={top:e.top-o.height-8-8>0,bottom:e.bottom+o.height+8+8<a,left:e.left-o.width-8-8>0,right:e.right+o.width+8+8<l};if(!u[n]){const e={top:"bottom",bottom:"top",left:"right",right:"left"};u[e[n]]&&(c=e[n])}switch(c){case"top":s=e.top+i-o.height-8-8,d=e.left+r+e.width/2-o.width/2;break;case"bottom":s=e.bottom+i+8+8,d=e.left+r+e.width/2-o.width/2;break;case"left":s=e.top+i+e.height/2-o.height/2,d=e.left+r-o.width-8-8;break;case"right":s=e.top+i+e.height/2-o.height/2,d=e.right+r+8+8}d=Math.max(8,Math.min(d,l+r-o.width-8)),s=Math.max(8,Math.min(s,a+i-o.height-8));const h={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:8};switch(c){case"top":Object.assign(h,{bottom:-16,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(h,{top:-16,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(h,{right:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(h,{left:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"})}return{top:s,left:d,arrowStyle:h,resolvedPlacement:c}}(m.current.getBoundingClientRect(),g.current,n))};return requestAnimationFrame(e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f,n]);const C=d?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},S=f&&"undefined"!=typeof document?Ue(/* @__PURE__ */Ye("div",{ref:g,id:c,role:"dialog","aria-modal":"false",className:V("absolute z-[9100] rounded-lg font-sans",l??""),style:{"--tkx-popover-bg":s.surface,top:x?.top??-9999,left:x?.left??-9999,backgroundColor:s.surface,border:`1px solid ${s.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:s.text,...C,...a},children:[x&&/* @__PURE__ */Ve("span",{style:x.arrowStyle,"aria-hidden":"true"}),t]}),document.body):null;/* @__PURE__ */
265
- return Ye(Pe,{children:[
266
- /* @__PURE__ */Ve("div",{ref:m,className:V("inline-flex"),onClick:k,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),k())},"aria-expanded":f,"aria-haspopup":"dialog","aria-controls":f?c:void 0,children:e}),S,f&&!d&&/* @__PURE__ */Ve("style",{children:"\n @keyframes tkxPopoverFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})}function xr(e,t){if(!t)return!0;const n=t.toLowerCase(),o=e.label.toLowerCase();let r=0;for(let i=0;i<o.length&&r<n.length;i++)o[i]===n[r]&&r++;return r===n.length}function br({color:e}){/* @__PURE__ */
267
- return Ye("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:[/* @__PURE__ */Ve("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),/* @__PURE__ */Ve("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}function yr({options:e,value:t,onChange:n,onInputChange:o,placeholder:r="",label:i,isLoading:l=!1,emptyMessage:a="No results found",filterFn:s,freeSolo:d=!1,className:c,style:u}){const h=b(),p=me(),f=Fe(),m=Fe(),g=je(null),x=je(null),[y,v]=Oe(""),[w,k]=Oe(!1),[C,S]=Oe(-1),[$,z]=Oe(null);Ae(()=>{if(void 0!==t){const n=e.find(e=>e.value===t);v(n?n.label:t)}},[t,e]);const N=s??xr,M=Ee(()=>w?e.filter(e=>N(e,y)):[],[e,y,w,N]),I=E(i),L=E(a);Ae(()=>{if(!w||!x.current)return;const e=()=>{x.current&&z(function(e){const t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,o=t.top,r=n>=284||n>=o?"below":"above";return{top:"below"===r?t.bottom+window.scrollY+4:t.top+window.scrollY-280-4,left:t.left+window.scrollX,width:t.width,placement:r}}(x.current))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[w]),Ae(()=>{if(!w)return;const e=e=>{const t=e.target;x.current?.contains(t)||document.getElementById(m)?.contains(t)||k(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[w,m]),ge(()=>k(!1),w);const W=Te(e=>{e.disabled||(v(e.label),n?.(e.value),k(!1),S(-1),g.current?.focus())},[n]);Ae(()=>{if(C<0)return;const e=`${m}-opt-${C}`;document.getElementById(e)?.scrollIntoView({block:"nearest"})},[C,m]);const D=C>=0?`${m}-opt-${C}`:void 0,R=p?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},T=w&&"undefined"!=typeof document&&$?Ue(/* @__PURE__ */Ve("ul",{id:m,role:"listbox","aria-label":I,className:V("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:$.top,left:$.left,width:$.width,maxHeight:280,backgroundColor:h.surface,border:`1px solid ${h.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...R},children:l?/* @__PURE__ */Ye("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:V("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:h.textMuted},children:[/* @__PURE__ */Ve(br,{color:h.primary}),"Loading..."]}):0===M.length?/* @__PURE__ */Ve("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:V("px-3 py-2 text-sm text-center"),style:{color:h.textMuted},children:L}):M.map((e,n)=>{const o=n===C,r=E(e.label),i=e.description?E(e.description):null;/* @__PURE__ */
268
- return Ye("li",{id:`${m}-opt-${n}`,role:"option","aria-selected":e.value===t,"aria-disabled":e.disabled||void 0,className:V("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",e.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:o?h.surfaceAlt:"transparent",color:e.disabled?h.textMuted:h.text,transition:p?"none":"background-color 100ms ease"},onMouseEnter:()=>!e.disabled&&S(n),onMouseDown:t=>{t.preventDefault(),W(e)},children:[e.icon&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",className:V("flex-shrink-0"),children:e.icon}),
269
- /* @__PURE__ */Ye("span",{className:V("flex flex-col min-w-0"),children:[/* @__PURE__ */Ve("span",{className:V("truncate"),children:r}),i&&/* @__PURE__ */Ve("span",{className:V("text-xs truncate"),style:{color:h.textMuted},children:i})]}),e.value===t&&/* @__PURE__ */Ve("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:V("ml-auto flex-shrink-0"),children:/* @__PURE__ */Ve("path",{d:"M3 8l3.5 3.5L13 5",stroke:h.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.value)})}),document.body):null;/* @__PURE__ */
270
- return Ye("div",{ref:x,className:V("relative font-sans",c??""),style:u,children:[
271
- /* @__PURE__ */Ve("label",{htmlFor:f,className:V("block text-sm font-medium mb-1.5"),style:{color:h.text},children:I}),
272
- /* @__PURE__ */Ye("div",{className:V("relative flex items-center"),style:{backgroundColor:h.surface,border:`1px solid ${w?h.primary:h.border}`,borderRadius:8,transition:p?"none":"border-color 150ms ease"},children:[/* @__PURE__ */Ve("input",{ref:g,id:f,type:"text",role:"combobox","aria-expanded":w,"aria-controls":m,"aria-activedescendant":D,"aria-autocomplete":"list","aria-label":I,value:y,placeholder:r,onChange:e=>{const t=e.target.value;v(t),o?.(t),w||k(!0),S(-1),d&&n?.(t)},onFocus:()=>k(!0),onKeyDown:e=>{if(w||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)switch(e.key){case"ArrowDown":e.preventDefault(),S(e=>{let t=e+1;for(;t<M.length&&M[t].disabled;)t++;return t<M.length?t:e});break;case"ArrowUp":e.preventDefault(),S(e=>{let t=e-1;for(;t>=0&&M[t].disabled;)t--;return t>=0?t:e});break;case"Enter":e.preventDefault(),C>=0&&C<M.length?W(M[C]):d&&y&&(n?.(y),k(!1));break;case"Escape":k(!1),S(-1)}else k(!0)},className:V("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:h.text}}),l&&/* @__PURE__ */Ve("span",{className:V("pr-3"),children:/* @__PURE__ */Ve(br,{color:h.primary})})]}),T,w&&!p&&/* @__PURE__ */Ve("style",{children:"\n @keyframes tkxAutoFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})}function vr({expanded:e,color:t,reducedMotion:n}){/* @__PURE__ */
273
- return Ve("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:/* @__PURE__ */Ve("path",{d:"M6 3l5 5-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function wr({checked:e,color:t,borderColor:n}){/* @__PURE__ */
274
- return Ve("span",{role:"presentation","aria-hidden":"true",className:V("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:n}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&/* @__PURE__ */Ve("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:/* @__PURE__ */Ve("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function kr({data:e,selected:t,onSelect:n,expanded:o,onExpand:r,multiSelect:i=!1,showCheckboxes:l=!1,showLines:a=!1,className:s,style:d}){const c=b(),u=me();Fe();const[h,p]=Oe([]),[f,m]=Oe([]),g=new Set(t??h),x=new Set(o??f),y=Te(e=>{void 0===o&&m(e),r?.(e)},[o,r]),v=Te(e=>{void 0===t&&p(e),n?.(e)},[t,n]),w=Te(e=>{const t=Array.from(x);x.has(e)?y(t.filter(t=>t!==e)):y([...t,e])},[x,y]),k=Te(e=>{if(i){const t=Array.from(g);g.has(e)?v(t.filter(t=>t!==e)):v([...t,e])}else v(g.has(e)?[]:[e])},[i,g,v]),C=function(e,t){const n=[];return function e(o,r){for(const i of o)n.push({node:i,depth:r}),i.children?.length&&t.has(i.id)&&e(i.children,r+1)}(e,0),n}(e,x),S=je(0),$=je(/* @__PURE__ */new Map),z=e=>{S.current=e,$.current.get(e)?.focus()};/* @__PURE__ */
275
- return Ve("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":i||void 0,className:V("list-none m-0 p-0 font-sans select-none",s??""),style:{color:c.text,...d},children:C.map(({node:e,depth:t},n)=>{const o=(e.children?.length??0)>0,r=x.has(e.id),i=g.has(e.id),s=E(e.label);/* @__PURE__ */
276
- return Ye("li",{role:"treeitem","aria-selected":i,"aria-expanded":o?r:void 0,"aria-disabled":e.disabled||void 0,"aria-level":t+1,"aria-setsize":C.filter(e=>e.depth===t).length,tabIndex:0===n?0:-1,ref:e=>{e?$.current.set(n,e):$.current.delete(n)},onKeyDown:e=>((e,t)=>{const n=C[t];if(!n)return;const{node:o}=n,r=(o.children?.length??0)>0;switch(e.key){case"ArrowDown":e.preventDefault(),t<C.length-1&&z(t+1);break;case"ArrowUp":e.preventDefault(),t>0&&z(t-1);break;case"ArrowRight":e.preventDefault(),r&&!x.has(o.id)?w(o.id):r&&x.has(o.id)&&t<C.length-1&&z(t+1);break;case"ArrowLeft":if(e.preventDefault(),r&&x.has(o.id))w(o.id);else for(let e=t-1;e>=0;e--)if(C[e].depth<n.depth){z(e);break}break;case"Enter":case" ":e.preventDefault(),o.disabled||k(o.id);break;case"Home":e.preventDefault(),z(0);break;case"End":e.preventDefault(),z(C.length-1)}})(e,n),onClick:()=>{e.disabled||(o&&w(e.id),k(e.id))},className:V("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:24*t+8,backgroundColor:i?`${c.primary}18`:"transparent",transition:u?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:t=>{i||e.disabled||(t.currentTarget.style.backgroundColor=c.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=i?`${c.primary}18`:"transparent"},children:[a&&t>0&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{position:"absolute",left:24*(t-1)+16,top:0,bottom:0,width:1,backgroundColor:c.border}}),/* @__PURE__ */Ve("span",o?{role:"presentation",onClick:t=>{t.stopPropagation(),w(e.id)},className:V("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:/* @__PURE__ */Ve(vr,{expanded:r,color:c.textMuted,reducedMotion:u})}:{style:{width:20,height:20},"aria-hidden":"true"}),l&&/* @__PURE__ */Ve(wr,{checked:i,color:c.primary,borderColor:c.border}),e.icon&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",className:V("flex-shrink-0"),children:e.icon}),
277
- /* @__PURE__ */Ve("span",{className:V("text-sm truncate"),style:{color:e.disabled?c.textMuted:c.text},children:s})]},e.id)})})}ir.displayName="TkxOTP",cr.displayName="TkxCommand",hr.displayName="TkxCarousel";var Cr={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 Sr({items:e,orientation:t="horizontal",size:n="md",variant:o="default",ariaLabel:r="Toolbar",className:i,style:l}){const a=b(),s=me(),d=Cr[n],c="horizontal"===t,u=je(/* @__PURE__ */new Map),h=e.filter(e=>"separator"!==e.type&&!e.disabled).map(e=>e.id),p=Te(e=>{u.current.get(e)?.focus()},[]),f=Te((e,t)=>{const n=h.indexOf(t);if(n<0)return;const o=c?"ArrowRight":"ArrowDown",r=c?"ArrowLeft":"ArrowUp";switch(e.key){case o:e.preventDefault(),p(h[n+1<h.length?n+1:0]);break;case r:e.preventDefault(),p(h[n-1>=0?n-1:h.length-1]);break;case"Home":e.preventDefault(),p(h[0]);break;case"End":e.preventDefault(),p(h[h.length-1])}},[h,p,c]),m=e=>{e.type;const t=e.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${d.buttonPy}px ${d.buttonPx}px`,fontSize:d.fontSize,borderRadius:6,border:"none",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:t?`${a.primary}20`:"transparent",color:t?a.primary:e.disabled?a.textMuted:a.text,opacity:e.disabled?.5:1,outline:"none",transition:s?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};/* @__PURE__ */
278
- return Ve("div",{role:"toolbar","aria-label":r,"aria-orientation":t,className:V("inline-flex items-center rounded-lg font-sans",c?"flex-row":"flex-col",i??""),style:{...(()=>{switch(o){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${a.border}`};case"filled":return{backgroundColor:a.surfaceAlt,border:"none"};default:return{backgroundColor:a.surface,border:`1px solid ${a.border}`}}})(),padding:d.gap,gap:d.gap,...l},children:e.map((e,t)=>{if("separator"===e.type)/* @__PURE__ */return Ve("div",{role:"separator","aria-orientation":c?"vertical":"horizontal",className:V("flex-shrink-0"),style:{...c?{width:1,height:d.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:d.separatorSize,marginTop:2,marginBottom:2},backgroundColor:a.border}},e.id);const n=E(e.label),o=!e.disabled,r=h[0]===e.id;/* @__PURE__ */
279
- return Ye("button",{ref:t=>{t?u.current.set(e.id,t):u.current.delete(e.id)},type:"button",role:void e.type,"aria-pressed":"toggle"===e.type?e.active:void 0,"aria-label":n,"aria-disabled":e.disabled||void 0,tabIndex:o&&r?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{f(t,e.id),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.disabled||e.onClick?.())},className:V("focus-visible:ring-2 focus-visible:ring-offset-1"),style:m(e),onMouseEnter:t=>{e.disabled||e.active||(t.currentTarget.style.backgroundColor=a.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${a.primary}20`:"transparent")},children:[e.icon&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{width:d.iconSize,height:d.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),!e.icon&&n]},e.id)})})}function $r({color:e}){/* @__PURE__ */
280
- return Ye("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),/* @__PURE__ */Ve("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function zr({checked:e,primaryColor:t,borderColor:n}){/* @__PURE__ */
281
- return Ve("span",{"aria-hidden":"true",className:V("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:n}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&/* @__PURE__ */Ve("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:/* @__PURE__ */Ve("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Nr({color:e}){/* @__PURE__ */
282
- return Ve("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Mr({color:e}){/* @__PURE__ */
283
- return Ve("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ir({title:e,items:t,selected:n,onToggle:o,onToggleAll:r,search:i,onSearchChange:l,searchable:a,height:s,listId:d}){const c=b(),u=me(),h=E(e),p=Ee(()=>{if(!i)return t;const e=i.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,i]),f=p.filter(e=>!e.disabled),m=f.length>0&&f.every(e=>n.has(e.value));return f.some(e=>n.has(e.value)),/* @__PURE__ */Ye("div",{className:V("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${c.border}`,backgroundColor:c.surface},children:[
284
- /* @__PURE__ */Ye("div",{className:V("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:c.border,backgroundColor:c.surfaceAlt},children:[
285
- /* @__PURE__ */Ve("button",{type:"button","aria-label":m?`Deselect all ${h}`:`Select all ${h}`,onClick:r,className:V("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:/* @__PURE__ */Ve(zr,{checked:m,primaryColor:c.primary,borderColor:c.border})}),
286
- /* @__PURE__ */Ve("span",{className:V("text-sm font-medium flex-1 truncate"),style:{color:c.text},children:h}),
287
- /* @__PURE__ */Ye("span",{className:V("text-xs"),style:{color:c.textMuted},children:[n.size,"/",t.length]})]}),a&&/* @__PURE__ */Ye("div",{className:V("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:c.border},children:[/* @__PURE__ */Ve($r,{color:c.textMuted}),/* @__PURE__ */Ve("input",{type:"text","aria-label":`Search ${h}`,value:i,onChange:e=>l(e.target.value),placeholder:"Search...",className:V("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:c.text}})]}),
288
- /* @__PURE__ */Ve("ul",{id:d,role:"listbox","aria-label":h,"aria-multiselectable":"true",className:V("list-none m-0 p-1 overflow-y-auto"),style:{height:s,minHeight:100},children:0===p.length?/* @__PURE__ */Ve("li",{className:V("text-xs text-center py-4"),style:{color:c.textMuted},"aria-disabled":"true",children:"No items"}):p.map(e=>{const t=n.has(e.value),r=E(e.label);/* @__PURE__ */
289
- return Ye("li",{role:"option","aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&o(e.value),onKeyDown:t=>!e.disabled&&((e,t)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o(t))})(t,e.value),className:V("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",e.disabled?"opacity-50 cursor-not-allowed":""),style:{color:e.disabled?c.textMuted:c.text,backgroundColor:t?`${c.primary}10`:"transparent",transition:u?"none":"background-color 100ms ease"},onMouseEnter:n=>{e.disabled||t||(n.currentTarget.style.backgroundColor=c.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${c.primary}10`:"transparent"},children:[/* @__PURE__ */Ve(zr,{checked:t,primaryColor:c.primary,borderColor:c.border}),/* @__PURE__ */Ve("span",{className:V("truncate"),children:r})]},e.value)})})]})}function Lr({sourceItems:e,targetItems:t,onTransfer:n,sourceTitle:o="Available",targetTitle:r="Selected",searchable:i=!1,height:l=300,className:a,style:s}){const d=b(),c=me(),u=Fe(),h=Fe(),[p,f]=Oe(/* @__PURE__ */new Set),[m,g]=Oe(/* @__PURE__ */new Set),[x,y]=Oe(""),[v,w]=Oe(""),k=Te(e=>{f(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),C=Te(e=>{g(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),S=Te(()=>{const t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>p.has(e))?f(/* @__PURE__ */new Set):f(new Set(t))},[e,p]),$=Te(()=>{const e=t.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>m.has(e))?g(/* @__PURE__ */new Set):g(new Set(e))},[t,m]),z=Te(()=>{if(0===p.size)return;const o=e.filter(e=>p.has(e.value)&&!e.disabled);n(e.filter(e=>!p.has(e.value)||e.disabled),[...t,...o]),f(/* @__PURE__ */new Set)},[e,t,p,n]),N=Te(()=>{if(0===m.size)return;const o=t.filter(e=>m.has(e.value)&&!e.disabled),r=t.filter(e=>!m.has(e.value)||e.disabled);n([...e,...o],r),g(/* @__PURE__ */new Set)},[e,t,m,n]),M=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${d.border}`,backgroundColor:e?d.surface:d.surfaceAlt,cursor:e?"not-allowed":"pointer",opacity:e?.5:1,transition:c?"none":"all 100ms ease",outline:"none"});/* @__PURE__ */
290
- return Ye("div",{className:V("flex gap-3 font-sans","flex-col sm:flex-row",a??""),style:{color:d.text,...s},children:[
291
- /* @__PURE__ */Ve(Ir,{title:o,items:e,selected:p,onToggle:k,onToggleAll:S,search:x,onSearchChange:y,searchable:i,height:l,listId:u}),
292
- /* @__PURE__ */Ye("div",{className:V("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[/* @__PURE__ */Ve("button",{type:"button","aria-label":"Move selected items to target list",disabled:0===p.size,onClick:z,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z())},className:V("focus-visible:ring-2 focus-visible:ring-offset-1"),style:M(0===p.size),onMouseEnter:e=>{p.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===p.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ve(Nr,{color:d.text})}),/* @__PURE__ */Ve("button",{type:"button","aria-label":"Move selected items to source list",disabled:0===m.size,onClick:N,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),N())},className:V("focus-visible:ring-2 focus-visible:ring-offset-1"),style:M(0===m.size),onMouseEnter:e=>{m.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===m.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ve(Mr,{color:d.text})})]}),
293
- /* @__PURE__ */Ve(Ir,{title:r,items:t,selected:m,onToggle:C,onToggleAll:$,search:v,onSearchChange:w,searchable:i,height:l,listId:h})]})}function Wr({color:e,rotated:t,reducedMotion:n}){/* @__PURE__ */
294
- return Ve("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:t?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:/* @__PURE__ */Ve("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}var Dr={"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 Rr({actions:e,icon:t,direction:n="up",position:o="bottom-right",className:r,style:i}){const l=b(),a=me(),s=Fe(),[d,c]=Oe(!1),[u,h]=Oe(-1),p=je(null),f=je(/* @__PURE__ */new Map),m=Te(()=>{c(e=>!e),h(-1)},[]),g=Te(()=>{c(!1),h(-1)},[]);ge(g,d),Ae(()=>{if(!d)return;const e=e=>{p.current?.contains(e.target)||g()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,g]),Ae(()=>{u>=0&&f.current.get(u)?.focus()},[u]);const x=e=>a?"0ms":40*e+"ms";/* @__PURE__ */
295
- return Ye(Pe,{children:[d&&"undefined"!=typeof document&&Ue(/* @__PURE__ */Ve("div",{"aria-hidden":"true",onClick:g,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:a?"none":"opacity 200ms ease"}}),document.body),
296
- /* @__PURE__ */Ye("div",{ref:p,className:V("fixed z-[9100] font-sans",r??""),style:{...Dr[o],...i},children:[d&&e.map((t,o)=>{const r=E(t.label),i=function(e,t){const n=64*(t+1);switch(e){case"up":return{bottom:n,left:"50%",transform:"translateX(-50%)"};case"down":return{top:n,left:"50%",transform:"translateX(-50%)"};case"left":return{right:n,top:"50%",transform:"translateY(-50%)"};case"right":return{left:n,top:"50%",transform:"translateY(-50%)"}}}(n,o),s=function(e){switch(e){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}(n);/* @__PURE__ */
297
- return Ve("div",{className:V("absolute"),style:{...i,opacity:a?1:0,animation:a?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:x(o)},children:/* @__PURE__ */Ye("div",{className:V("relative inline-flex"),children:[/* @__PURE__ */Ve("span",{className:V("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...s,backgroundColor:l.surfaceAlt,color:l.text,border:`1px solid ${l.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:r}),/* @__PURE__ */Ve("button",{ref:e=>{e?f.current.set(o,e):f.current.delete(o)},type:"button","aria-label":r,tabIndex:d?0:-1,onClick:()=>{t.onClick?.(),g()},onKeyDown:t=>((t,n)=>{switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),h(n>0?n-1:e.length-1);break;case"ArrowDown":case"ArrowRight":t.preventDefault(),h(n<e.length-1?n+1:0);break;case"Enter":case" ":t.preventDefault(),e[n].onClick?.(),g();break;case"Escape":g();break;case"Home":t.preventDefault(),h(0);break;case"End":t.preventDefault(),h(e.length-1)}})(t,o),className:V("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:48,height:48,backgroundColor:l.surface,color:l.text,border:`1px solid ${l.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:a?"none":"all 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=l.surfaceAlt,e.currentTarget.style.transform="scale(1.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=l.surface,e.currentTarget.style.transform="scale(1)"},children:t.icon})]})},t.id)}),
298
- /* @__PURE__ */Ve("button",{type:"button","aria-label":d?"Close actions menu":"Open actions menu","aria-expanded":d,"aria-controls":s,"aria-haspopup":"true",onClick:m,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m()),d&&("ArrowUp"!==e.key&&"ArrowLeft"!==e.key||(e.preventDefault(),h(0)),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),h(0)))},className:V("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:56,height:56,backgroundColor:l.primary,color:l.bg,boxShadow:`0 6px 20px ${l.primary}40`,transition:a?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${l.primary}60`,a||(e.currentTarget.style.transform="scale(1.05)")},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${l.primary}40`,e.currentTarget.style.transform="scale(1)"},children:t??/* @__PURE__ */Ve(Wr,{color:l.bg,rotated:d,reducedMotion:a})}),
299
- /* @__PURE__ */Ve("div",{id:s,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(e=>/* @__PURE__ */Ve("div",{role:"menuitem",children:E(e.label)},e.id))})]}),d&&!a&&/* @__PURE__ */Ve("style",{children:"\n @keyframes tkxSpeedDialIn {\n from { opacity: 0; transform: translateX(-50%) scale(0.5); }\n to { opacity: 1; transform: translateX(-50%) scale(1); }\n }\n "})]})}function Tr({open:e}){/* @__PURE__ */
300
- return Ve("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */Ye(Pe,e?{children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}:{children:[
301
- /* @__PURE__ */Ve("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),
302
- /* @__PURE__ */Ve("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),
303
- /* @__PURE__ */Ve("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}function Br({title:e,logo:t,actions:n,navigation:o,position:r="sticky",variant:i="default",color:l="surface"}){const a=b(),s=me(),d=function(){const[e,t]=Oe(()=>"undefined"!=typeof window&&window.innerWidth<768);return Ae(()=>{if("undefined"==typeof window)return;const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[c,u]=Oe(!1),h=je(null),p=Fe();ge(()=>u(!1),c),Ae(()=>{!d&&c&&u(!1)},[d,c]),Ae(()=>{if(!c)return;const e=e=>{h.current&&!h.current.contains(e.target)&&u(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[c]);const f=Te(()=>{u(e=>!e)},[]),m="primary"===l?a.primary:a.surface,g="primary"===l?a.bg:a.text,x={default:{backgroundColor:m,borderBottom:`1px solid ${a.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:m,boxShadow:`0 2px 8px ${a.bg}66`,borderBottom:"none"}},y="string"==typeof e?E(e):e,v=s?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";/* @__PURE__ */
304
- return Ye("header",{role:"banner",className:V("font-sans w-full"),style:{...{fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}}[r],...x[i],color:g,height:56},children:[/* @__PURE__ */Ye("div",{ref:h,className:V("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[t&&/* @__PURE__ */Ve("div",{className:V("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:t}),y&&/* @__PURE__ */Ve("div",{className:V("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:g},children:y}),!d&&o&&/* @__PURE__ */Ve("nav",{id:p,"aria-label":"Main navigation",className:V("flex items-center flex-1 gap-1"),children:o}),d&&/* @__PURE__ */Ve("div",{className:V("flex-1")}),n&&/* @__PURE__ */Ve("div",{className:V("flex items-center gap-2 ml-auto shrink-0"),children:n}),d&&o&&/* @__PURE__ */Ve("button",{onClick:f,"aria-expanded":c,"aria-controls":p,"aria-label":c?"Close navigation menu":"Open navigation menu",className:V("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:g},children:/* @__PURE__ */Ve(Tr,{open:c})})]}),d&&o&&/* @__PURE__ */Ve("nav",{id:p,"aria-label":"Main navigation",style:{maxHeight:c?400:0,opacity:c?1:0,overflow:"hidden",transition:v,backgroundColor:a.surface,borderBottom:c?`1px solid ${a.border}`:"none"},children:/* @__PURE__ */Ve("div",{className:V("flex flex-col gap-1 px-4 py-3"),role:"menu",children:o})})]})}var Ar=!1;function Fr({items:e,activeId:t,onChange:n,showLabels:o=!0}){const r=b(),i=me(),l=je(null);Ae(()=>{!function(){if(Ar||"undefined"==typeof document)return;Ar=!0;const e=document.createElement("style");e.id="tkx-bottom-nav-kf",e.textContent="\n @keyframes tkx-bottom-nav-pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.15); }\n 100% { transform: scale(1); }\n }\n ",document.head.appendChild(e)}()},[]);const a=e.slice(0,5),s=Te(e=>{n?.(e)},[n]),d=Te(e=>{const t=l.current;if(!t)return;const n=Array.from(t.querySelectorAll('[role="tab"]')),o=n.findIndex(e=>e===document.activeElement);if(-1===o)return;let r=o;"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),r=(o+1)%n.length):"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),r=(o-1+n.length)%n.length):"Home"===e.key?(e.preventDefault(),r=0):"End"===e.key&&(e.preventDefault(),r=n.length-1),r!==o&&(n[r].focus(),s(a[r].id))},[s,a]),c=i?"none":"color 200ms ease, transform 150ms ease";/* @__PURE__ */
305
- return Ve("nav",{ref:l,role:"navigation","aria-label":"Bottom navigation",className:V("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:56,backgroundColor:r.surface,borderTop:`1px solid ${r.border}`,boxShadow:`0 -2px 12px ${r.bg}44`},children:/* @__PURE__ */Ve("div",{role:"tablist","aria-label":"Navigation tabs",className:V("flex items-center justify-around h-full"),onKeyDown:d,children:a.map(e=>{const n=e.id===t,l=E(e.label),a=n?r.primary:r.textMuted;/* @__PURE__ */
306
- return Ye("button",{role:"tab","aria-selected":n,"aria-label":l,tabIndex:n?0:-1,onClick:()=>s(e.id),className:V("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:a,transition:c,outline:"none"},children:[n&&/* @__PURE__ */Ve("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:r.primary,transition:i?"none":"width 200ms ease"}}),
307
- /* @__PURE__ */Ye("div",{className:V("relative flex items-center justify-center"),style:{animation:n&&!i?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[e.icon,void 0!==e.badge&&e.badge>0&&/* @__PURE__ */Ve("span",{"aria-label":`${e.badge} notifications`,className:V("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:r.danger,color:r.bg},children:e.badge>99?"99+":e.badge})]}),o&&/* @__PURE__ */Ve("span",{className:V("text-[10px] leading-tight mt-0.5"),style:{fontWeight:n?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l})]},e.id)})})})}var Er=!1,Hr={success:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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"})})},jr={"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 Or({message:e,isOpen:t,onClose:n,action:o,variant:r="default",position:i="bottom-center",autoHideDuration:l=5e3,icon:a}){const s=b(),d=me(),c=Fe(),u=je(null),[h,p]=Oe(!1),[f,m]=Oe(!1);Ae(()=>{!function(){if(Er||"undefined"==typeof document)return;Er=!0;const e=document.createElement("style");e.id="tkx-snackbar-kf",e.textContent="\n @keyframes tkx-snackbar-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-slide-down {\n from { opacity: 0; transform: translateY(-24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-fade-out {\n from { opacity: 1; }\n to { opacity: 0; transform: translateY(8px); }\n }\n ",document.head.appendChild(e)}()},[]),Ae(()=>{if(t)m(!1),p(!0);else if(h){if(!d){m(!0);const e=setTimeout(()=>{p(!1),m(!1)},250);return()=>clearTimeout(e)}p(!1)}},[t,d,h]),Ae(()=>{if(t&&!(l<=0)&&n)return u.current=setTimeout(()=>{n()},l),()=>{u.current&&clearTimeout(u.current)}},[t,l,n]);const g=Te(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),x=Te(()=>{t&&l>0&&n&&(u.current=setTimeout(()=>n(),l))},[t,l,n]),y={default:s.textMuted,success:s.success,error:s.danger,warning:s.warning,info:s.info}[r],v=E(e);if(!h||"undefined"==typeof document)return null;let w={};d||(w=f?{animation:"tkx-snackbar-fade-out 250ms ease forwards"}:{animation:("top-center"===i?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up")+" 250ms cubic-bezier(0.16,1,0.3,1) both"});const k=a??Hr[r]??null;return Ue(/* @__PURE__ */Ve("div",{role:"error"===r?"alert":"status","aria-live":"error"===r?"assertive":"polite","aria-atomic":"true","aria-labelledby":c,className:V("fixed z-[9500] font-sans"),style:{...jr[i],...w,pointerEvents:"auto"},onMouseEnter:g,onMouseLeave:x,children:/* @__PURE__ */Ye("div",{className:V("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:s.surface,border:`1px solid ${y}44`,boxShadow:`0 8px 24px ${s.bg}aa`,color:s.text},children:[k&&/* @__PURE__ */Ve("span",{className:V("shrink-0 flex items-center"),style:{color:y},children:k}),
308
- /* @__PURE__ */Ve("span",{id:c,className:V("flex-1 text-sm leading-snug"),children:v}),o&&/* @__PURE__ */Ve("button",{onClick:()=>{o.onClick(),n?.()},className:V("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:s.primary},children:E(o.label)}),n&&/* @__PURE__ */Ve("button",{"aria-label":"Dismiss snackbar",onClick:n,className:V("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ve("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ve("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)}function Pr({direction:e}){/* @__PURE__ */
309
- return Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:V("shrink-0 ml-1"),children:/* @__PURE__ */Ve("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function Vr({checked:e,indeterminate:t}){const n=b();/* @__PURE__ */
245
+ /* @__PURE__ */Ye("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:d.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[/* @__PURE__ */Ue("circle",{cx:"11",cy:"11",r:"8"}),/* @__PURE__ */Ue("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),
246
+ /* @__PURE__ */Ue("input",{ref:y,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${v}-list`,"aria-activedescendant":C[f]?`${v}-item-${C[f].item.id}`:void 0,value:h,onChange:e=>{p(e.target.value),m(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(C.length-1,f+1);m(t),M(t)}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(0,f-1);m(t),M(t)}else if("Enter"===e.key){e.preventDefault();const t=C[f];t&&I(t.item)}},placeholder:D,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:d.text}}),h&&/* @__PURE__ */Ue("button",{type:"button","aria-label":c.clearSelection,onClick:()=>{p(""),m(0),y.current?.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:d.textMuted,display:"flex",alignItems:"center",padding:0},children:/* @__PURE__ */Ye("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),
247
+ /* @__PURE__ */Ue("div",{id:`${v}-list`,ref:b,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:g?Array.from({length:4},(e,t)=>/* @__PURE__ */Ue(ur,{surface:d.surface,border:d.border},t)):0===C.length?/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:d.textMuted},children:[/* @__PURE__ */Ye("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[
248
+ /* @__PURE__ */Ue("circle",{cx:"11",cy:"11",r:"8"}),
249
+ /* @__PURE__ */Ue("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),
250
+ /* @__PURE__ */Ue("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),/* @__PURE__ */Ue("span",{style:{fontSize:"0.875rem"},children:L})]}):S.map(({group:e,items:t},n)=>{const o=S.slice(0,n).reduce((e,t)=>e+t.items.length,0);/* @__PURE__ */
251
+ return Ye("div",{children:[e&&/* @__PURE__ */Ue("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:d.textMuted,padding:"10px 12px 4px"},children:j(e)}),t.map((e,t)=>{const n=o+t,r=n===f,i=e.item;/* @__PURE__ */
252
+ return Ye("div",{id:`${v}-item-${i.id}`,role:"option","aria-selected":r,"aria-disabled":i.disabled,"data-command-item":!0,onClick:()=>I(i),onMouseEnter:()=>m(n),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:i.disabled?"not-allowed":"pointer",opacity:i.disabled?.45:1,backgroundColor:r?`${d.primary}18`:"transparent",borderLeft:r?`2px solid ${d.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[i.icon&&/* @__PURE__ */Ue("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:r?d.primary:d.textMuted},children:i.icon}),
253
+ /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ue("div",{style:{fontSize:"0.875rem",fontWeight:500,color:d.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:/* @__PURE__ */Ue(cr,{text:i.label,ranges:e.labelRanges,color:d.primary})}),i.description&&/* @__PURE__ */Ue("div",{style:{fontSize:"0.75rem",color:d.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:j(i.description)})]}),i.shortcut&&/* @__PURE__ */Ue("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:d.textMuted,backgroundColor:d.surfaceAlt,border:`1px solid ${d.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:j(i.shortcut)})]},i.id)})]},e??"__default__")})}),C.length>0&&/* @__PURE__ */Ye("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${d.border}`,fontSize:"0.6875rem",color:d.textMuted},children:[
254
+ /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ue("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),
255
+ /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ue("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),
256
+ /* @__PURE__ */Ye("span",{children:[/* @__PURE__ */Ue("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}function pr({direction:e,onClick:t,isDisabled:n,primaryColor:o,position:r,orientation:i}){const a="vertical"===i,l="prev"===e,s="inside"===r?{position:"absolute",zIndex:3,...a?{[l?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[l?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};/* @__PURE__ */
257
+ return Ue("button",{type:"button","aria-label":l?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...s,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:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:/* @__PURE__ */Ue("svg",a?l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"18 15 12 9 6 15"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"6 9 12 15 18 9"})}:l?{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"15 18 9 12 15 6"})}:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:/* @__PURE__ */Ue("polyline",{points:"9 18 15 12 9 6"})})})}function fr({slides:e,autoPlay:t=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:r=!0,showArrows:i=!0,showDots:a=!0,showThumbnails:l=!1,orientation:s="horizontal",slidesToShow:d=1,gap:c=0,transitionDuration:u=400,swipeable:h=!0,initialIndex:p=0,onChange:f,arrowPosition:m="inside",height:g=320,className:x,style:y}){const b=N(),v=ge(),w=Ee(),k=e.length,[S,C]=Ve(p),[$,z]=Ve(r?p+1:p),[M,I]=Ve(!1),[D,W]=Ve(!1),L=Oe(null),R=Oe(null),T=Oe(null),A=Oe(0),B=Oe(!1),F="vertical"===s,E=v?0:u,j=r&&k>1?[e[k-1],...e,e[0]]:e,H=j.length,P=100/d,O=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return F?`translateY(calc(-${e*P}%${n}))`:`translateX(calc(-${e*P}%${n}))`},V=Ae((e,t=!1)=>{const n=r?(e%k+k)%k:Math.max(0,Math.min(k-1,e)),o=r?n+1:n;t&&L.current?(L.current.style.transition="none",z(o),C(n),L.current.offsetHeight,L.current.style.transition=""):(I(!0),z(o),C(n)),f?.(n)},[k,r,f]),U=Ae(()=>V(S-1),[S,V]),Y=Ae(()=>V(S+1),[S,V]),X=Ae(()=>{I(!1),!r||k<=1||(0===$?V(k-1,!0):$===H-1&&V(0,!0))},[r,k,$,H,V]);Fe(()=>{if(!(!t||D||k<=1))return R.current=setInterval(Y,n),()=>{R.current&&clearInterval(R.current)}},[t,D,n,Y,k]),Fe(()=>{const e=e=>{const t=document.activeElement;document.getElementById(w)?.contains(t)&&(e.key===(F?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),U()),e.key===(F?"ArrowDown":"ArrowRight")&&(e.preventDefault(),Y()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w,F,U,Y]);const q=e=>"touches"in e?F?e.touches[0].clientY:e.touches[0].clientX:F?e.clientY:e.clientX,_=e=>{h&&(T.current=q(e),A.current=0,B.current=!0)},Z=e=>{if(!B.current||null===T.current)return;const t=q(e)-T.current;A.current=t,L.current&&(L.current.style.transition="none",L.current.style.transform=O($,-t))},G=()=>{if(!B.current)return;B.current=!1;const e=A.current;L.current&&(L.current.style.transition="",L.current.style.transform=""),e<-50?Y():e>50?U():L.current&&(L.current.style.transform=O($)),T.current=null,A.current=0},J="number"==typeof g?`${g}px`:g,Q={display:"flex",flexDirection:F?"column":"row",width:F?"100%":H/d*100+"%",height:F?H/d*100+"%":"100%",transform:O($),transition:M||!v?`transform ${E}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:c>0?c:void 0},ee={flexShrink:0,width:F?"100%":P/(H/d)+"%",height:F?P/(H/d)+"%":"100%",overflow:"hidden",position:"relative"},te=r||S>0,ne=r||S<k-1,oe="outside"===m;/* @__PURE__ */
258
+ return Ye("div",{id:w,className:le(K("flex flex-col gap-2"),x),style:y,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[/* @__PURE__ */Ye("div",{className:K("flex items-center gap-2"),style:{gap:oe&&i?8:0},children:[i&&oe&&/* @__PURE__ */Ue(pr,{direction:"prev",onClick:U,isDisabled:!te,primaryColor:b.primary,position:"outside",orientation:s}),
259
+ /* @__PURE__ */Ye("div",{style:{position:"relative",flex:1,overflow:"hidden",height:J,borderRadius:12,cursor:h?B.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&W(!0),onMouseLeave:()=>{W(!1),G()},onTouchStart:_,onTouchMove:Z,onTouchEnd:G,onMouseDown:_,onMouseMove:Z,onMouseUp:G,"aria-live":"polite","aria-atomic":"false",children:[i&&!oe&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue(pr,{direction:"prev",onClick:U,isDisabled:!te,primaryColor:b.primary,position:"inside",orientation:s}),/* @__PURE__ */Ue(pr,{direction:"next",onClick:Y,isDisabled:!ne,primaryColor:b.primary,position:"inside",orientation:s})]}),
260
+ /* @__PURE__ */Ue("div",{ref:L,style:Q,onTransitionEnd:X,children:j.map((e,t)=>/* @__PURE__ */Ue("div",{style:ee,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(t-(r?1:0)+k)%k+1} of ${k}`,"aria-hidden":(t-(r?1:0)+k)%k!==S,children:e.content},`${e.id}-${t}`))}),a&&!l&&/* @__PURE__ */Ue("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((e,t)=>/* @__PURE__ */Ue("button",{type:"button","aria-label":`Go to slide ${t+1}`,"aria-current":t===S?"true":void 0,onClick:()=>V(t),style:{width:t===S?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:t===S?b.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${b.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow="none"}},e.id))})]}),i&&oe&&/* @__PURE__ */Ue(pr,{direction:"next",onClick:Y,isDisabled:!ne,primaryColor:b.primary,position:"outside",orientation:s})]}),l&&/* @__PURE__ */Ue("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((e,t)=>/* @__PURE__ */Ye("button",{type:"button",role:"tab","aria-selected":t===S,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>V(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===S?b.primary:b.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:b.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${b.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},children:[e.thumbnail?/* @__PURE__ */Ue("img",{src:e.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):/* @__PURE__ */Ue("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:b.textMuted,fontWeight:600},children:t+1}),t===S&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${b.primary}22`}})]},e.id))})]})}function mr({color:e}){/* @__PURE__ */
261
+ return Ue("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function gr({onClick:e,bgColor:t,hoverColor:n,textColor:o,label:r}){/* @__PURE__ */
262
+ return Ue("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":r,className:K("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:t,color:o,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=n},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function xr({items:e,separator:t,maxItems:n,onNavigate:o,className:r,style:i}){const a=N(),l=$e(),s=ge(),d=void 0!==n&&n>1&&e.length>n,c=Ae(()=>{if(!d||!n)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((n-1)/2),o=n-1-t,r=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),i=e.slice(e.length-o).map((t,n)=>({item:t,originalIndex:e.length-o+n}));return r.concat(i)},[e,n,d])(),u=d&&n?Math.ceil((n-1)/2):-1,h=(e,t)=>{o?.(e,t)},p=s?{}:{transition:"color 150ms ease, background-color 150ms ease"},f=e=>/* @__PURE__ */Ue("li",{role:"presentation","aria-hidden":"true",className:K("flex items-center mx-1.5"),children:t??/* @__PURE__ */Ue(mr,{color:a.textMuted})},e),m=(e,t,n)=>{const r=j(e.label);if(n)/* @__PURE__ */return Ue("li",{children:/* @__PURE__ */Ye("span",{"aria-current":"page",className:K("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:a.text},children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,l={color:a.textMuted,textDecoration:"none",...p},s={onMouseEnter:e=>{e.currentTarget.style.color=a.primary},onMouseLeave:e=>{e.currentTarget.style.color=a.textMuted}},d=/* @__PURE__ */Ye(Ke,{children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("flex-shrink-0"),children:e.icon}),r]});/* @__PURE__ */
263
+ return Ue("li",i?{children:/* @__PURE__ */Ue("a",{href:e.href,onClick:n=>{o&&(n.preventDefault(),h(e,t))},className:K("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...l,focusRingColor:a.primary},...s,children:d})}:{children:/* @__PURE__ */Ue("button",{type:"button",onClick:()=>h(e,t),onKeyDown:n=>((e,t,n)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h(t,n))})(n,e,t),className:K("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:l,...s,children:d})},`item-${t}`)},g=[];let x=!1;for(let y=0;y<c.length;y++){const{item:t,originalIndex:n}=c[y],o=n===e.length-1;d&&!x&&y===u&&(g.length>0&&g.push(f("sep-ellipsis-before")),g.push(/* @__PURE__ */Ue("li",{role:"presentation",children:/* @__PURE__ */Ue(gr,{onClick:()=>{},bgColor:a.surfaceAlt,hoverColor:a.surface,textColor:a.textMuted,label:l.showHiddenItems??"Show hidden breadcrumb items"})},"ellipsis")),x=!0),g.length>0&&null!==g[g.length-1]&&g.push(f(`sep-${n}`)),g.push(m(t,n,o))}/* @__PURE__ */
264
+ return Ue("nav",{"aria-label":l.breadcrumb??"Breadcrumb",className:K("font-sans",r??""),style:{...i},children:/* @__PURE__ */Ue("ol",{role:"list",className:K("flex items-center flex-wrap list-none m-0 p-0"),children:g})})}function yr({trigger:e,content:t,placement:n="bottom",isOpen:o,onOpenChange:r,closeOnClickOutside:i=!0,className:a,style:l}){const s=N(),d=ge(),c=Ee(),u=void 0!==o,[h,p]=Ve(!1),f=u?o:h,m=Oe(null),g=Oe(null);Oe(null);const[x,y]=Ve(null),b=Ae(e=>{u||p(e),r?.(e)},[u,r]),v=Ae(()=>b(!1),[b]),w=Ae(()=>b(!f),[b,f]);xe(v,f),Fe(()=>{if(!f||!i)return;const e=e=>{const t=e.target;m.current?.contains(t)||g.current?.contains(t)||v()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[f,i,v]),Fe(()=>{if(!f||!m.current)return;const e=()=>{m.current&&g.current&&y(function(e,t,n){const o=t.getBoundingClientRect(),r=window.scrollX,i=window.scrollY,a=window.innerWidth,l=window.innerHeight;let s=0,d=0,c=n;const u={top:e.top-o.height-8-8>0,bottom:e.bottom+o.height+8+8<l,left:e.left-o.width-8-8>0,right:e.right+o.width+8+8<a};if(!u[n]){const e={top:"bottom",bottom:"top",left:"right",right:"left"};u[e[n]]&&(c=e[n])}switch(c){case"top":s=e.top+i-o.height-8-8,d=e.left+r+e.width/2-o.width/2;break;case"bottom":s=e.bottom+i+8+8,d=e.left+r+e.width/2-o.width/2;break;case"left":s=e.top+i+e.height/2-o.height/2,d=e.left+r-o.width-8-8;break;case"right":s=e.top+i+e.height/2-o.height/2,d=e.right+r+8+8}d=Math.max(8,Math.min(d,a+r-o.width-8)),s=Math.max(8,Math.min(s,l+i-o.height-8));const h={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:8};switch(c){case"top":Object.assign(h,{bottom:-16,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(h,{top:-16,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(h,{right:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(h,{left:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"})}return{top:s,left:d,arrowStyle:h,resolvedPlacement:c}}(m.current.getBoundingClientRect(),g.current,n))};return requestAnimationFrame(e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f,n]);const k=d?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},S=f&&"undefined"!=typeof document?Xe(/* @__PURE__ */Ye("div",{ref:g,id:c,role:"dialog","aria-modal":"false",className:K("absolute z-[9100] rounded-lg font-sans",a??""),style:{"--tkx-popover-bg":s.surface,top:x?.top??-9999,left:x?.left??-9999,backgroundColor:s.surface,border:`1px solid ${s.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:s.text,...k,...l},children:[x&&/* @__PURE__ */Ue("span",{style:x.arrowStyle,"aria-hidden":"true"}),t]}),document.body):null;/* @__PURE__ */
265
+ return Ye(Ke,{children:[
266
+ /* @__PURE__ */Ue("div",{ref:m,className:K("inline-flex"),onClick:w,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},"aria-expanded":f,"aria-haspopup":"dialog","aria-controls":f?c:void 0,children:e}),S,f&&!d&&/* @__PURE__ */Ue("style",{children:"\n @keyframes tkxPopoverFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})}function br(e,t){if(!t)return!0;const n=t.toLowerCase(),o=e.label.toLowerCase();let r=0;for(let i=0;i<o.length&&r<n.length;i++)o[i]===n[r]&&r++;return r===n.length}function vr({color:e}){/* @__PURE__ */
267
+ return Ye("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:[/* @__PURE__ */Ue("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),/* @__PURE__ */Ue("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}function wr({options:e,value:t,onChange:n,onInputChange:o,placeholder:r="",label:i,isLoading:a=!1,emptyMessage:l,filterFn:s,freeSolo:d=!1,className:c,style:u}){const h=N(),p=$e(),f=l??p.noResults,m=ge(),g=Ee(),x=Ee(),y=Oe(null),b=Oe(null),[v,w]=Ve(""),[k,S]=Ve(!1),[C,$]=Ve(-1),[z,M]=Ve(null);Fe(()=>{if(void 0!==t){const n=e.find(e=>e.value===t);w(n?n.label:t)}},[t,e]);const I=s??br,D=He(()=>k?e.filter(e=>I(e,v)):[],[e,v,k,I]),W=j(i),L=j(f);Fe(()=>{if(!k||!b.current)return;const e=()=>{b.current&&M(function(e){const t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,o=t.top,r=n>=284||n>=o?"below":"above";return{top:"below"===r?t.bottom+window.scrollY+4:t.top+window.scrollY-280-4,left:t.left+window.scrollX,width:t.width,placement:r}}(b.current))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[k]),Fe(()=>{if(!k)return;const e=e=>{const t=e.target;b.current?.contains(t)||document.getElementById(x)?.contains(t)||S(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[k,x]),xe(()=>S(!1),k);const R=Ae(e=>{e.disabled||(w(e.label),n?.(e.value),S(!1),$(-1),y.current?.focus())},[n]);Fe(()=>{if(C<0)return;const e=`${x}-opt-${C}`;document.getElementById(e)?.scrollIntoView({block:"nearest"})},[C,x]);const T=C>=0?`${x}-opt-${C}`:void 0,A=m?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},B=k&&"undefined"!=typeof document&&z?Xe(/* @__PURE__ */Ue("ul",{id:x,role:"listbox","aria-label":W,className:K("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:z.top,left:z.left,width:z.width,maxHeight:280,backgroundColor:h.surface,border:`1px solid ${h.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...A},children:a?/* @__PURE__ */Ye("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:K("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:h.textMuted},children:[/* @__PURE__ */Ue(vr,{color:h.primary}),"Loading..."]}):0===D.length?/* @__PURE__ */Ue("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:K("px-3 py-2 text-sm text-center"),style:{color:h.textMuted},children:L}):D.map((e,n)=>{const o=n===C,r=j(e.label),i=e.description?j(e.description):null;/* @__PURE__ */
268
+ return Ye("li",{id:`${x}-opt-${n}`,role:"option","aria-selected":e.value===t,"aria-disabled":e.disabled||void 0,className:K("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",e.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:o?h.surfaceAlt:"transparent",color:e.disabled?h.textMuted:h.text,transition:m?"none":"background-color 100ms ease"},onMouseEnter:()=>!e.disabled&&$(n),onMouseDown:t=>{t.preventDefault(),R(e)},children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("flex-shrink-0"),children:e.icon}),
269
+ /* @__PURE__ */Ye("span",{className:K("flex flex-col min-w-0"),children:[/* @__PURE__ */Ue("span",{className:K("truncate"),children:r}),i&&/* @__PURE__ */Ue("span",{className:K("text-xs truncate"),style:{color:h.textMuted},children:i})]}),e.value===t&&/* @__PURE__ */Ue("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:K("ml-auto flex-shrink-0"),children:/* @__PURE__ */Ue("path",{d:"M3 8l3.5 3.5L13 5",stroke:h.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.value)})}),document.body):null;/* @__PURE__ */
270
+ return Ye("div",{ref:b,className:K("relative font-sans",c??""),style:u,children:[
271
+ /* @__PURE__ */Ue("label",{htmlFor:g,className:K("block text-sm font-medium mb-1.5"),style:{color:h.text},children:W}),
272
+ /* @__PURE__ */Ye("div",{className:K("relative flex items-center"),style:{backgroundColor:h.surface,border:`1px solid ${k?h.primary:h.border}`,borderRadius:8,transition:m?"none":"border-color 150ms ease"},children:[/* @__PURE__ */Ue("input",{ref:y,id:g,type:"text",role:"combobox","aria-expanded":k,"aria-controls":x,"aria-activedescendant":T,"aria-autocomplete":"list","aria-label":W,value:v,placeholder:r,onChange:e=>{const t=e.target.value;w(t),o?.(t),k||S(!0),$(-1),d&&n?.(t)},onFocus:()=>S(!0),onKeyDown:e=>{if(k||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)switch(e.key){case"ArrowDown":e.preventDefault(),$(e=>{let t=e+1;for(;t<D.length&&D[t].disabled;)t++;return t<D.length?t:e});break;case"ArrowUp":e.preventDefault(),$(e=>{let t=e-1;for(;t>=0&&D[t].disabled;)t--;return t>=0?t:e});break;case"Enter":e.preventDefault(),C>=0&&C<D.length?R(D[C]):d&&v&&(n?.(v),S(!1));break;case"Escape":S(!1),$(-1)}else S(!0)},className:K("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:h.text}}),a&&/* @__PURE__ */Ue("span",{className:K("pr-3"),children:/* @__PURE__ */Ue(vr,{color:h.primary})})]}),B,k&&!m&&/* @__PURE__ */Ue("style",{children:"\n @keyframes tkxAutoFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})}function kr({expanded:e,color:t,reducedMotion:n}){/* @__PURE__ */
273
+ return Ue("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:/* @__PURE__ */Ue("path",{d:"M6 3l5 5-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Sr({checked:e,color:t,borderColor:n}){/* @__PURE__ */
274
+ return Ue("span",{role:"presentation","aria-hidden":"true",className:K("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:n}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&/* @__PURE__ */Ue("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:/* @__PURE__ */Ue("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Cr({data:e,selected:t,onSelect:n,expanded:o,onExpand:r,multiSelect:i=!1,showCheckboxes:a=!1,showLines:l=!1,className:s,style:d}){const c=N(),u=ge();Ee();const[h,p]=Ve([]),[f,m]=Ve([]),g=new Set(t??h),x=new Set(o??f),y=Ae(e=>{void 0===o&&m(e),r?.(e)},[o,r]),b=Ae(e=>{void 0===t&&p(e),n?.(e)},[t,n]),v=Ae(e=>{const t=Array.from(x);x.has(e)?y(t.filter(t=>t!==e)):y([...t,e])},[x,y]),w=Ae(e=>{if(i){const t=Array.from(g);g.has(e)?b(t.filter(t=>t!==e)):b([...t,e])}else b(g.has(e)?[]:[e])},[i,g,b]),k=function(e,t){const n=[];return function e(o,r){for(const i of o)n.push({node:i,depth:r}),i.children?.length&&t.has(i.id)&&e(i.children,r+1)}(e,0),n}(e,x),S=Oe(0),C=Oe(/* @__PURE__ */new Map),$=e=>{S.current=e,C.current.get(e)?.focus()};/* @__PURE__ */
275
+ return Ue("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":i||void 0,className:K("list-none m-0 p-0 font-sans select-none",s??""),style:{color:c.text,...d},children:k.map(({node:e,depth:t},n)=>{const o=(e.children?.length??0)>0,r=x.has(e.id),i=g.has(e.id),s=j(e.label);/* @__PURE__ */
276
+ return Ye("li",{role:"treeitem","aria-selected":i,"aria-expanded":o?r:void 0,"aria-disabled":e.disabled||void 0,"aria-level":t+1,"aria-setsize":k.filter(e=>e.depth===t).length,tabIndex:0===n?0:-1,ref:e=>{e?C.current.set(n,e):C.current.delete(n)},onKeyDown:e=>((e,t)=>{const n=k[t];if(!n)return;const{node:o}=n,r=(o.children?.length??0)>0;switch(e.key){case"ArrowDown":e.preventDefault(),t<k.length-1&&$(t+1);break;case"ArrowUp":e.preventDefault(),t>0&&$(t-1);break;case"ArrowRight":e.preventDefault(),r&&!x.has(o.id)?v(o.id):r&&x.has(o.id)&&t<k.length-1&&$(t+1);break;case"ArrowLeft":if(e.preventDefault(),r&&x.has(o.id))v(o.id);else for(let e=t-1;e>=0;e--)if(k[e].depth<n.depth){$(e);break}break;case"Enter":case" ":e.preventDefault(),o.disabled||w(o.id);break;case"Home":e.preventDefault(),$(0);break;case"End":e.preventDefault(),$(k.length-1)}})(e,n),onClick:()=>{e.disabled||(o&&v(e.id),w(e.id))},className:K("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:24*t+8,backgroundColor:i?`${c.primary}18`:"transparent",transition:u?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:t=>{i||e.disabled||(t.currentTarget.style.backgroundColor=c.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=i?`${c.primary}18`:"transparent"},children:[l&&t>0&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{position:"absolute",left:24*(t-1)+16,top:0,bottom:0,width:1,backgroundColor:c.border}}),/* @__PURE__ */Ue("span",o?{role:"presentation",onClick:t=>{t.stopPropagation(),v(e.id)},className:K("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:/* @__PURE__ */Ue(kr,{expanded:r,color:c.textMuted,reducedMotion:u})}:{style:{width:20,height:20},"aria-hidden":"true"}),a&&/* @__PURE__ */Ue(Sr,{checked:i,color:c.primary,borderColor:c.border}),e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",className:K("flex-shrink-0"),children:e.icon}),
277
+ /* @__PURE__ */Ue("span",{className:K("text-sm truncate"),style:{color:e.disabled?c.textMuted:c.text},children:s})]},e.id)})})}lr.displayName="TkxOTP",hr.displayName="TkxCommand",fr.displayName="TkxCarousel";var $r={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 zr({items:e,orientation:t="horizontal",size:n="md",variant:o="default",ariaLabel:r="Toolbar",className:i,style:a}){const l=N(),s=ge(),d=$r[n],c="horizontal"===t,u=Oe(/* @__PURE__ */new Map),h=e.filter(e=>"separator"!==e.type&&!e.disabled).map(e=>e.id),p=Ae(e=>{u.current.get(e)?.focus()},[]),f=Ae((e,t)=>{const n=h.indexOf(t);if(n<0)return;const o=c?"ArrowRight":"ArrowDown",r=c?"ArrowLeft":"ArrowUp";switch(e.key){case o:e.preventDefault(),p(h[n+1<h.length?n+1:0]);break;case r:e.preventDefault(),p(h[n-1>=0?n-1:h.length-1]);break;case"Home":e.preventDefault(),p(h[0]);break;case"End":e.preventDefault(),p(h[h.length-1])}},[h,p,c]),m=e=>{e.type;const t=e.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${d.buttonPy}px ${d.buttonPx}px`,fontSize:d.fontSize,borderRadius:6,border:"none",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:t?`${l.primary}20`:"transparent",color:t?l.primary:e.disabled?l.textMuted:l.text,opacity:e.disabled?.5:1,outline:"none",transition:s?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};/* @__PURE__ */
278
+ return Ue("div",{role:"toolbar","aria-label":r,"aria-orientation":t,className:K("inline-flex items-center rounded-lg font-sans",c?"flex-row":"flex-col",i??""),style:{...(()=>{switch(o){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${l.border}`};case"filled":return{backgroundColor:l.surfaceAlt,border:"none"};default:return{backgroundColor:l.surface,border:`1px solid ${l.border}`}}})(),padding:d.gap,gap:d.gap,...a},children:e.map((e,t)=>{if("separator"===e.type)/* @__PURE__ */return Ue("div",{role:"separator","aria-orientation":c?"vertical":"horizontal",className:K("flex-shrink-0"),style:{...c?{width:1,height:d.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:d.separatorSize,marginTop:2,marginBottom:2},backgroundColor:l.border}},e.id);const n=j(e.label),o=!e.disabled,r=h[0]===e.id;/* @__PURE__ */
279
+ return Ye("button",{ref:t=>{t?u.current.set(e.id,t):u.current.delete(e.id)},type:"button",role:void e.type,"aria-pressed":"toggle"===e.type?e.active:void 0,"aria-label":n,"aria-disabled":e.disabled||void 0,tabIndex:o&&r?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{f(t,e.id),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.disabled||e.onClick?.())},className:K("focus-visible:ring-2 focus-visible:ring-offset-1"),style:m(e),onMouseEnter:t=>{e.disabled||e.active||(t.currentTarget.style.backgroundColor=l.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${l.primary}20`:"transparent")},children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{width:d.iconSize,height:d.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),!e.icon&&n]},e.id)})})}function Nr({color:e}){/* @__PURE__ */
280
+ return Ye("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),/* @__PURE__ */Ue("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function Mr({checked:e,primaryColor:t,borderColor:n}){/* @__PURE__ */
281
+ return Ue("span",{"aria-hidden":"true",className:K("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:n}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&/* @__PURE__ */Ue("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:/* @__PURE__ */Ue("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Ir({color:e}){/* @__PURE__ */
282
+ return Ue("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dr({color:e}){/* @__PURE__ */
283
+ return Ue("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wr({title:e,items:t,selected:n,onToggle:o,onToggleAll:r,search:i,onSearchChange:a,searchable:l,height:s,listId:d}){const c=N(),u=ge(),h=j(e),p=He(()=>{if(!i)return t;const e=i.toLowerCase();return t.filter(t=>t.label.toLowerCase().includes(e))},[t,i]),f=p.filter(e=>!e.disabled),m=f.length>0&&f.every(e=>n.has(e.value));return f.some(e=>n.has(e.value)),/* @__PURE__ */Ye("div",{className:K("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${c.border}`,backgroundColor:c.surface},children:[
284
+ /* @__PURE__ */Ye("div",{className:K("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:c.border,backgroundColor:c.surfaceAlt},children:[
285
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":m?`Deselect all ${h}`:`Select all ${h}`,onClick:r,className:K("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:/* @__PURE__ */Ue(Mr,{checked:m,primaryColor:c.primary,borderColor:c.border})}),
286
+ /* @__PURE__ */Ue("span",{className:K("text-sm font-medium flex-1 truncate"),style:{color:c.text},children:h}),
287
+ /* @__PURE__ */Ye("span",{className:K("text-xs"),style:{color:c.textMuted},children:[n.size,"/",t.length]})]}),l&&/* @__PURE__ */Ye("div",{className:K("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:c.border},children:[/* @__PURE__ */Ue(Nr,{color:c.textMuted}),/* @__PURE__ */Ue("input",{type:"text","aria-label":`Search ${h}`,value:i,onChange:e=>a(e.target.value),placeholder:"Search...",className:K("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:c.text}})]}),
288
+ /* @__PURE__ */Ue("ul",{id:d,role:"listbox","aria-label":h,"aria-multiselectable":"true",className:K("list-none m-0 p-1 overflow-y-auto"),style:{height:s,minHeight:100},children:0===p.length?/* @__PURE__ */Ue("li",{className:K("text-xs text-center py-4"),style:{color:c.textMuted},"aria-disabled":"true",children:"No items"}):p.map(e=>{const t=n.has(e.value),r=j(e.label);/* @__PURE__ */
289
+ return Ye("li",{role:"option","aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&o(e.value),onKeyDown:t=>!e.disabled&&((e,t)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o(t))})(t,e.value),className:K("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",e.disabled?"opacity-50 cursor-not-allowed":""),style:{color:e.disabled?c.textMuted:c.text,backgroundColor:t?`${c.primary}10`:"transparent",transition:u?"none":"background-color 100ms ease"},onMouseEnter:n=>{e.disabled||t||(n.currentTarget.style.backgroundColor=c.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${c.primary}10`:"transparent"},children:[/* @__PURE__ */Ue(Mr,{checked:t,primaryColor:c.primary,borderColor:c.border}),/* @__PURE__ */Ue("span",{className:K("truncate"),children:r})]},e.value)})})]})}function Lr({sourceItems:e,targetItems:t,onTransfer:n,sourceTitle:o="Available",targetTitle:r="Selected",searchable:i=!1,height:a=300,className:l,style:s}){const d=N(),c=ge(),u=Ee(),h=Ee(),[p,f]=Ve(/* @__PURE__ */new Set),[m,g]=Ve(/* @__PURE__ */new Set),[x,y]=Ve(""),[b,v]=Ve(""),w=Ae(e=>{f(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),k=Ae(e=>{g(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),S=Ae(()=>{const t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>p.has(e))?f(/* @__PURE__ */new Set):f(new Set(t))},[e,p]),C=Ae(()=>{const e=t.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>m.has(e))?g(/* @__PURE__ */new Set):g(new Set(e))},[t,m]),$=Ae(()=>{if(0===p.size)return;const o=e.filter(e=>p.has(e.value)&&!e.disabled);n(e.filter(e=>!p.has(e.value)||e.disabled),[...t,...o]),f(/* @__PURE__ */new Set)},[e,t,p,n]),z=Ae(()=>{if(0===m.size)return;const o=t.filter(e=>m.has(e.value)&&!e.disabled),r=t.filter(e=>!m.has(e.value)||e.disabled);n([...e,...o],r),g(/* @__PURE__ */new Set)},[e,t,m,n]),M=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${d.border}`,backgroundColor:e?d.surface:d.surfaceAlt,cursor:e?"not-allowed":"pointer",opacity:e?.5:1,transition:c?"none":"all 100ms ease",outline:"none"});/* @__PURE__ */
290
+ return Ye("div",{className:K("flex gap-3 font-sans","flex-col sm:flex-row",l??""),style:{color:d.text,...s},children:[
291
+ /* @__PURE__ */Ue(Wr,{title:o,items:e,selected:p,onToggle:w,onToggleAll:S,search:x,onSearchChange:y,searchable:i,height:a,listId:u}),
292
+ /* @__PURE__ */Ye("div",{className:K("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[/* @__PURE__ */Ue("button",{type:"button","aria-label":"Move selected items to target list",disabled:0===p.size,onClick:$,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),$())},className:K("focus-visible:ring-2 focus-visible:ring-offset-1"),style:M(0===p.size),onMouseEnter:e=>{p.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===p.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ue(Ir,{color:d.text})}),/* @__PURE__ */Ue("button",{type:"button","aria-label":"Move selected items to source list",disabled:0===m.size,onClick:z,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),z())},className:K("focus-visible:ring-2 focus-visible:ring-offset-1"),style:M(0===m.size),onMouseEnter:e=>{m.size>0&&(e.currentTarget.style.backgroundColor=d.primary,e.currentTarget.style.borderColor=d.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===m.size?d.surface:d.surfaceAlt,e.currentTarget.style.borderColor=d.border},children:/* @__PURE__ */Ue(Dr,{color:d.text})})]}),
293
+ /* @__PURE__ */Ue(Wr,{title:r,items:t,selected:m,onToggle:k,onToggleAll:C,search:b,onSearchChange:v,searchable:i,height:a,listId:h})]})}function Rr({color:e,rotated:t,reducedMotion:n}){/* @__PURE__ */
294
+ return Ue("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:t?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:/* @__PURE__ */Ue("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}var Tr={"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 Ar({actions:e,icon:t,direction:n="up",position:o="bottom-right",className:r,style:i}){const a=N(),l=ge(),s=Ee(),[d,c]=Ve(!1),[u,h]=Ve(-1),p=Oe(null),f=Oe(/* @__PURE__ */new Map),m=Ae(()=>{c(e=>!e),h(-1)},[]),g=Ae(()=>{c(!1),h(-1)},[]);xe(g,d),Fe(()=>{if(!d)return;const e=e=>{p.current?.contains(e.target)||g()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[d,g]),Fe(()=>{u>=0&&f.current.get(u)?.focus()},[u]);const x=e=>l?"0ms":40*e+"ms";/* @__PURE__ */
295
+ return Ye(Ke,{children:[d&&"undefined"!=typeof document&&Xe(/* @__PURE__ */Ue("div",{"aria-hidden":"true",onClick:g,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:l?"none":"opacity 200ms ease"}}),document.body),
296
+ /* @__PURE__ */Ye("div",{ref:p,className:K("fixed z-[9100] font-sans",r??""),style:{...Tr[o],...i},children:[d&&e.map((t,o)=>{const r=j(t.label),i=function(e,t){const n=64*(t+1);switch(e){case"up":return{bottom:n,left:"50%",transform:"translateX(-50%)"};case"down":return{top:n,left:"50%",transform:"translateX(-50%)"};case"left":return{right:n,top:"50%",transform:"translateY(-50%)"};case"right":return{left:n,top:"50%",transform:"translateY(-50%)"}}}(n,o),s=function(e){switch(e){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}(n);/* @__PURE__ */
297
+ return Ue("div",{className:K("absolute"),style:{...i,opacity:l?1:0,animation:l?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:x(o)},children:/* @__PURE__ */Ye("div",{className:K("relative inline-flex"),children:[/* @__PURE__ */Ue("span",{className:K("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...s,backgroundColor:a.surfaceAlt,color:a.text,border:`1px solid ${a.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:r}),/* @__PURE__ */Ue("button",{ref:e=>{e?f.current.set(o,e):f.current.delete(o)},type:"button","aria-label":r,tabIndex:d?0:-1,onClick:()=>{t.onClick?.(),g()},onKeyDown:t=>((t,n)=>{switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),h(n>0?n-1:e.length-1);break;case"ArrowDown":case"ArrowRight":t.preventDefault(),h(n<e.length-1?n+1:0);break;case"Enter":case" ":t.preventDefault(),e[n].onClick?.(),g();break;case"Escape":g();break;case"Home":t.preventDefault(),h(0);break;case"End":t.preventDefault(),h(e.length-1)}})(t,o),className:K("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:48,height:48,backgroundColor:a.surface,color:a.text,border:`1px solid ${a.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:l?"none":"all 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=a.surfaceAlt,e.currentTarget.style.transform="scale(1.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=a.surface,e.currentTarget.style.transform="scale(1)"},children:t.icon})]})},t.id)}),
298
+ /* @__PURE__ */Ue("button",{type:"button","aria-label":d?"Close actions menu":"Open actions menu","aria-expanded":d,"aria-controls":s,"aria-haspopup":"true",onClick:m,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m()),d&&("ArrowUp"!==e.key&&"ArrowLeft"!==e.key||(e.preventDefault(),h(0)),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),h(0)))},className:K("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:56,height:56,backgroundColor:a.primary,color:a.bg,boxShadow:`0 6px 20px ${a.primary}40`,transition:l?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${a.primary}60`,l||(e.currentTarget.style.transform="scale(1.05)")},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${a.primary}40`,e.currentTarget.style.transform="scale(1)"},children:t??/* @__PURE__ */Ue(Rr,{color:a.bg,rotated:d,reducedMotion:l})}),
299
+ /* @__PURE__ */Ue("div",{id:s,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(e=>/* @__PURE__ */Ue("div",{role:"menuitem",children:j(e.label)},e.id))})]}),d&&!l&&/* @__PURE__ */Ue("style",{children:"\n @keyframes tkxSpeedDialIn {\n from { opacity: 0; transform: translateX(-50%) scale(0.5); }\n to { opacity: 1; transform: translateX(-50%) scale(1); }\n }\n "})]})}function Br({open:e}){/* @__PURE__ */
300
+ return Ue("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */Ye(Ke,e?{children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}:{children:[
301
+ /* @__PURE__ */Ue("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),
302
+ /* @__PURE__ */Ue("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),
303
+ /* @__PURE__ */Ue("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}function Fr({title:e,logo:t,actions:n,navigation:o,position:r="sticky",variant:i="default",color:a="surface"}){const l=N(),s=ge(),d=function(){const[e,t]=Ve(()=>"undefined"!=typeof window&&window.innerWidth<768);return Fe(()=>{if("undefined"==typeof window)return;const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[c,u]=Ve(!1),h=Oe(null),p=Ee();xe(()=>u(!1),c),Fe(()=>{!d&&c&&u(!1)},[d,c]),Fe(()=>{if(!c)return;const e=e=>{h.current&&!h.current.contains(e.target)&&u(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[c]);const f=Ae(()=>{u(e=>!e)},[]),m="primary"===a?l.primary:l.surface,g="primary"===a?l.bg:l.text,x={default:{backgroundColor:m,borderBottom:`1px solid ${l.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:m,boxShadow:`0 2px 8px ${l.bg}66`,borderBottom:"none"}},y="string"==typeof e?j(e):e,b=s?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";/* @__PURE__ */
304
+ return Ye("header",{role:"banner",className:K("font-sans w-full"),style:{...{fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}}[r],...x[i],color:g,height:56},children:[/* @__PURE__ */Ye("div",{ref:h,className:K("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[t&&/* @__PURE__ */Ue("div",{className:K("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:t}),y&&/* @__PURE__ */Ue("div",{className:K("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:g},children:y}),!d&&o&&/* @__PURE__ */Ue("nav",{id:p,"aria-label":"Main navigation",className:K("flex items-center flex-1 gap-1"),children:o}),d&&/* @__PURE__ */Ue("div",{className:K("flex-1")}),n&&/* @__PURE__ */Ue("div",{className:K("flex items-center gap-2 ml-auto shrink-0"),children:n}),d&&o&&/* @__PURE__ */Ue("button",{onClick:f,"aria-expanded":c,"aria-controls":p,"aria-label":c?"Close navigation menu":"Open navigation menu",className:K("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:g},children:/* @__PURE__ */Ue(Br,{open:c})})]}),d&&o&&/* @__PURE__ */Ue("nav",{id:p,"aria-label":"Main navigation",style:{maxHeight:c?400:0,opacity:c?1:0,overflow:"hidden",transition:b,backgroundColor:l.surface,borderBottom:c?`1px solid ${l.border}`:"none"},children:/* @__PURE__ */Ue("div",{className:K("flex flex-col gap-1 px-4 py-3"),role:"menu",children:o})})]})}var Er=!1;function jr({items:e,activeId:t,onChange:n,showLabels:o=!0}){const r=N(),i=ge(),a=Oe(null);Fe(()=>{!function(){if(Er||"undefined"==typeof document)return;Er=!0;const e=document.createElement("style");e.id="tkx-bottom-nav-kf",e.textContent="\n @keyframes tkx-bottom-nav-pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.15); }\n 100% { transform: scale(1); }\n }\n ",document.head.appendChild(e)}()},[]);const l=e.slice(0,5),s=Ae(e=>{n?.(e)},[n]),d=Ae(e=>{const t=a.current;if(!t)return;const n=Array.from(t.querySelectorAll('[role="tab"]')),o=n.findIndex(e=>e===document.activeElement);if(-1===o)return;let r=o;"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),r=(o+1)%n.length):"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),r=(o-1+n.length)%n.length):"Home"===e.key?(e.preventDefault(),r=0):"End"===e.key&&(e.preventDefault(),r=n.length-1),r!==o&&(n[r].focus(),s(l[r].id))},[s,l]),c=i?"none":"color 200ms ease, transform 150ms ease";/* @__PURE__ */
305
+ return Ue("nav",{ref:a,role:"navigation","aria-label":"Bottom navigation",className:K("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:56,backgroundColor:r.surface,borderTop:`1px solid ${r.border}`,boxShadow:`0 -2px 12px ${r.bg}44`},children:/* @__PURE__ */Ue("div",{role:"tablist","aria-label":"Navigation tabs",className:K("flex items-center justify-around h-full"),onKeyDown:d,children:l.map(e=>{const n=e.id===t,a=j(e.label),l=n?r.primary:r.textMuted;/* @__PURE__ */
306
+ return Ye("button",{role:"tab","aria-selected":n,"aria-label":a,tabIndex:n?0:-1,onClick:()=>s(e.id),className:K("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:l,transition:c,outline:"none"},children:[n&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:r.primary,transition:i?"none":"width 200ms ease"}}),
307
+ /* @__PURE__ */Ye("div",{className:K("relative flex items-center justify-center"),style:{animation:n&&!i?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[e.icon,void 0!==e.badge&&e.badge>0&&/* @__PURE__ */Ue("span",{"aria-label":`${e.badge} notifications`,className:K("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:r.danger,color:r.bg},children:e.badge>99?"99+":e.badge})]}),o&&/* @__PURE__ */Ue("span",{className:K("text-[10px] leading-tight mt-0.5"),style:{fontWeight:n?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a})]},e.id)})})})}var Hr=!1,Pr={success:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})})},Or={"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 Vr({message:e,isOpen:t,onClose:n,action:o,variant:r="default",position:i="bottom-center",autoHideDuration:a=5e3,icon:l}){const s=N(),d=ge(),c=Ee(),u=Oe(null),[h,p]=Ve(!1),[f,m]=Ve(!1);Fe(()=>{!function(){if(Hr||"undefined"==typeof document)return;Hr=!0;const e=document.createElement("style");e.id="tkx-snackbar-kf",e.textContent="\n @keyframes tkx-snackbar-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-slide-down {\n from { opacity: 0; transform: translateY(-24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-fade-out {\n from { opacity: 1; }\n to { opacity: 0; transform: translateY(8px); }\n }\n ",document.head.appendChild(e)}()},[]),Fe(()=>{if(t)m(!1),p(!0);else if(h){if(!d){m(!0);const e=setTimeout(()=>{p(!1),m(!1)},250);return()=>clearTimeout(e)}p(!1)}},[t,d,h]),Fe(()=>{if(t&&!(a<=0)&&n)return u.current=setTimeout(()=>{n()},a),()=>{u.current&&clearTimeout(u.current)}},[t,a,n]);const g=Ae(()=>{u.current&&(clearTimeout(u.current),u.current=null)},[]),x=Ae(()=>{t&&a>0&&n&&(u.current=setTimeout(()=>n(),a))},[t,a,n]),y={default:s.textMuted,success:s.success,error:s.danger,warning:s.warning,info:s.info}[r],b=j(e);if(!h||"undefined"==typeof document)return null;let v={};d||(v=f?{animation:"tkx-snackbar-fade-out 250ms ease forwards"}:{animation:("top-center"===i?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up")+" 250ms cubic-bezier(0.16,1,0.3,1) both"});const w=l??Pr[r]??null;return Xe(/* @__PURE__ */Ue("div",{role:"error"===r?"alert":"status","aria-live":"error"===r?"assertive":"polite","aria-atomic":"true","aria-labelledby":c,className:K("fixed z-[9500] font-sans"),style:{...Or[i],...v,pointerEvents:"auto"},onMouseEnter:g,onMouseLeave:x,children:/* @__PURE__ */Ye("div",{className:K("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:s.surface,border:`1px solid ${y}44`,boxShadow:`0 8px 24px ${s.bg}aa`,color:s.text},children:[w&&/* @__PURE__ */Ue("span",{className:K("shrink-0 flex items-center"),style:{color:y},children:w}),
308
+ /* @__PURE__ */Ue("span",{id:c,className:K("flex-1 text-sm leading-snug"),children:b}),o&&/* @__PURE__ */Ue("button",{onClick:()=>{o.onClick(),n?.()},className:K("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:s.primary},children:j(o.label)}),n&&/* @__PURE__ */Ue("button",{"aria-label":"Dismiss snackbar",onClick:n,className:K("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:s.textMuted},children:/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[/* @__PURE__ */Ue("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),/* @__PURE__ */Ue("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)}function Kr({direction:e}){/* @__PURE__ */
309
+ return Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:K("shrink-0 ml-1"),children:/* @__PURE__ */Ue("path","asc"===e?{d:"M7 14l5-5 5 5H7z"}:"desc"===e?{d:"M7 10l5 5 5-5H7z"}:{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function Ur({checked:e,indeterminate:t}){const n=N();/* @__PURE__ */
310
310
  return Ye("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[
311
- /* @__PURE__ */Ve("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||t?n.primary:"transparent",stroke:e||t?n.primary:n.border,strokeWidth:"1.5"}),t&&/* @__PURE__ */Ve("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!t&&/* @__PURE__ */Ve("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr(e,t){return"function"==typeof t?t(e):String(e[t])}function Ur(e,t){return e[t]}function Kr(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function Xr({colCount:e}){const t=b();/* @__PURE__ */
312
- return Ve("tbody",{children:Array.from({length:5},(n,o)=>/* @__PURE__ */Ve("tr",{children:Array.from({length:e},(e,n)=>/* @__PURE__ */Ve("td",{className:V("px-3 py-2"),style:{borderBottom:`1px solid ${t.border}`},children:/* @__PURE__ */Ve(Mt,{height:16})},n))},o))})}function qr({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[/* @__PURE__ */Ve("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&/* @__PURE__ */Ye("button",{onClick:n,"aria-label":`Export ${e} as CSV`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 12px",fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer"},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
313
- /* @__PURE__ */Ve("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
314
- /* @__PURE__ */Ve("polyline",{points:"7 10 12 15 17 10"}),
315
- /* @__PURE__ */Ve("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function Gr({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const l=(e-1)*n+1,a=Math.min(e*n,o),s={display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer",fontSize:13,fontWeight:500};/* @__PURE__ */
316
- return Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderTop:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8,flexWrap:"wrap"},role:"navigation","aria-label":"Pagination",children:[/* @__PURE__ */Ve("span",{style:{fontSize:13,color:i.textMuted},children:0===o?"0 rows":`${l}–${a} of ${o}`}),/* @__PURE__ */Ye("div",{style:{display:"flex",gap:4},children:[
317
- /* @__PURE__ */Ve("button",{onClick:()=>r(1),disabled:1===e,"aria-label":"First page",style:{...s,opacity:1===e?.4:1},children:"«"}),
318
- /* @__PURE__ */Ve("button",{onClick:()=>r(e-1),disabled:1===e,"aria-label":"Previous page",style:{...s,opacity:1===e?.4:1},children:"‹"}),Array.from({length:Math.min(5,t)},(n,o)=>{let l=o+1;return t>5&&(l=Math.max(1,Math.min(e-Math.floor(2.5),t-4))+o),/* @__PURE__ */Ve("button",{onClick:()=>r(l),"aria-label":`Page ${l}`,"aria-current":l===e?"page":void 0,style:{...s,backgroundColor:l===e?i.primary:"transparent",color:l===e?i.bg:i.text,borderColor:l===e?i.primary:i.border},children:l},l)}),
319
- /* @__PURE__ */Ve("button",{onClick:()=>r(e+1),disabled:e===t,"aria-label":"Next page",style:{...s,opacity:e===t?.4:1},children:"›"}),
320
- /* @__PURE__ */Ve("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...s,opacity:e===t?.4:1},children:"»"})]})]})}function _r({columns:e,data:t,rowKey:n,selectable:o=!1,selectedRows:r=[],onSelectionChange:i,sortable:l=!1,onSort:a,loading:s=!1,emptyMessage:d="No data to display",stickyHeader:c=!1,striped:u=!1,bordered:h=!1,compact:p=!1,maxHeight:f,onRowClick:m,virtualScroll:g,rowHeight:x=40,showFilters:y=!1,filterValues:v,onFilterChange:w,pageSize:k=0,showExport:C=!1,exportFileName:S="export",onLoadMore:$,hasMore:z,loadingMore:N=!1,loadMoreThreshold:M=200}){const I=b(),L=me(),W=Fe(),[D,R]=Oe(null),[T,B]=Oe("asc"),A=Te(e=>{const t=D===e&&"asc"===T?"desc":"asc";R(e),B(t),a?.(e,t)},[D,T,a]),F=Ee(()=>a||!D?t:[...t].sort((e,t)=>{const n=function(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}(Ur(e,D),Ur(t,D));return"asc"===T?n:-n}),[t,D,T,a]),[H,j]=Oe({}),O=v??H,P=Te((e,t)=>{w?w(e,t):j(n=>({...n,[e]:t}))},[w]),Y=Ee(()=>{const e=Object.entries(O).filter(([,e])=>""!==e.trim());return 0===e.length?F:F.filter(t=>e.every(([e,n])=>{const o=Ur(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[F,O]),[U,K]=Oe(1),X=k>0,q=Y.length,G=X?Math.max(1,Math.ceil(q/k)):1;Ae(()=>{K(1)},[O,D,T]);const _=Ee(()=>X?Y.slice((U-1)*k,U*k):Y,[Y,X,U,k]),Z=void 0!==g?g:!X&&void 0!==f&&_.length>=50,J=je(null),[Q,ee]=Oe(0),[te,ne]=Oe(0),oe=Te(()=>{J.current&&ee(J.current.scrollTop)},[]);Ae(()=>{if(!Z||!J.current)return;const e=J.current;ne(e.clientHeight);const t=new ResizeObserver(()=>ne(e.clientHeight));return t.observe(e),()=>t.disconnect()},[Z]),_.length;const re=Z?Math.max(0,Math.floor(Q/x)-10):0,ie=Z?Math.min(_.length,Math.ceil((Q+te)/x)+10):_.length,le=Z?_.slice(re,ie):_,ae=re*x,se=je(null),de=je(!1);Ae(()=>{de.current=!1},[t.length]),Ae(()=>{if(!$)return;const e=se.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!de.current&&!1!==z&&(de.current=!0,$())},{root:J.current,rootMargin:`0px 0px ${M}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[$,z,M]);const ce=Ee(()=>new Set(r),[r]),ue=Ee(()=>Y.map(e=>Yr(e,n)),[Y,n]),he=ue.length>0&&ue.every(e=>ce.has(e)),pe=ue.some(e=>ce.has(e)),fe=Te(()=>{i?.(he?[]:ue)},[he,ue,i]),ge=Te(e=>{const t=ce.has(e)?r.filter(t=>t!==e):[...r,e];i?.(t)},[ce,r,i]),[xe,be]=Oe({}),ye=je(null),ve=Te((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=xe[e]||n.getBoundingClientRect().width;ye.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!ye.current)return;const t=Math.max(50,ye.current.startWidth+e.clientX-ye.current.startX);be(e=>({...e,[ye.current.key]:t}))},i=()=>{ye.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[xe]),we=Te(()=>{const t=[e.map(e=>Kr(e.header)).join(","),...Y.map(t=>e.map(e=>Kr(Ur(t,e.key))).join(","))].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=`${S}.csv`,r.click(),URL.revokeObjectURL(o)},[e,Y,S]),ke=p?"4px":"8px",Ce=p?"8px":"12px",Se=e=>{const t=xe[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${ke} ${Ce}`}},$e=h?`1px solid ${I.border}`:"none",ze=E(d),Ne=e.length+(o?1:0),Me=e.some(e=>e.filterable);/* @__PURE__ */
321
- return Ye("div",{role:"grid","aria-label":"Data grid","aria-rowcount":q,id:W,className:V("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${I.border}`,backgroundColor:I.bg},children:[
322
- /* @__PURE__ */Ve(qr,{label:"data grid",showExport:C,onExport:we,totalRows:q,selectedCount:r.length,theme:I}),
323
- /* @__PURE__ */Ye("div",{ref:J,onScroll:Z?oe:void 0,style:{maxHeight:f??"none",overflowX:"auto",overflowY:f?"auto":"visible"},children:[
324
- /* @__PURE__ */Ye("table",{className:V("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[
325
- /* @__PURE__ */Ye("thead",{children:[/* @__PURE__ */Ye("tr",{role:"row",children:[o&&/* @__PURE__ */Ve("th",{scope:"col",role:"columnheader",style:{position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,borderBottom:`2px solid ${I.border}`,borderRight:$e,padding:`${ke} ${Ce}`,width:40,textAlign:"center"},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[/* @__PURE__ */Ve("input",{type:"checkbox",checked:he,ref:e=>{e&&(e.indeterminate=pe&&!he)},onChange:fe,"aria-label":he?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ve(Vr,{checked:he,indeterminate:pe&&!he})]})}),e.map(e=>{const t=(e.sortable??l)&&!1!==e.sortable,n=D===e.key,o=E(e.header);/* @__PURE__ */
326
- return Ve("th",{scope:"col",role:"columnheader","aria-sort":n?"asc"===T?"ascending":"descending":t?"none":void 0,className:V("text-xs font-semibold uppercase tracking-wider"),style:{...Se(e),position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,color:I.textMuted,borderBottom:`2px solid ${I.border}`,borderRight:$e,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:L?"none":"background-color 150ms ease"},onClick:t?()=>A(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),A(e.key))}:void 0,tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("div",{className:V("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):o,t&&/* @__PURE__ */Ve(Pr,{direction:n?T:null}),e.resizable&&/* @__PURE__ */Ve("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${o}`,className:V("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>ve(e.key,t)})]})},e.key)})]}),(y||Me)&&/* @__PURE__ */Ye("tr",{role:"row","aria-label":"Column filters",children:[o&&/* @__PURE__ */Ve("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:$e,padding:`4px ${Ce}`,width:40}}),e.map(e=>/* @__PURE__ */Ve("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:$e,padding:`4px ${Ce}`},children:(e.filterable||y)&&/* @__PURE__ */Ve("input",{type:"text",value:O[e.key]??"",onChange:t=>P(e.key,t.target.value),placeholder:`Filter ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${I.border}`,backgroundColor:I.bg,color:I.text,outline:"none"}})},e.key))]})]}),s&&/* @__PURE__ */Ve(Xr,{colCount:Ne}),!s&&/* @__PURE__ */Ve("tbody",{children:0===_.length?/* @__PURE__ */Ve("tr",{children:/* @__PURE__ */Ve("td",{colSpan:Ne,className:V("text-center py-10"),style:{color:I.textMuted},children:ze})}):/* @__PURE__ */Ye(Pe,{children:[Z&&ae>0&&/* @__PURE__ */Ve("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ve("td",{colSpan:Ne,style:{height:ae,padding:0,border:"none"}})}),le.map((t,r)=>{const i=re+r,l=Yr(t,n),a=ce.has(l),s=u&&i%2==1;let d="transparent";return a?d=`${I.primary}22`:s&&(d=I.surfaceAlt),/* @__PURE__ */Ye("tr",{role:"row","aria-rowindex":i+1,"aria-selected":o?a:void 0,onClick:m?()=>m(t):void 0,onKeyDown:m?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m(t))}:void 0,tabIndex:m?0:void 0,className:V(m?"cursor-pointer":""),style:{backgroundColor:d,transition:L?"none":"background-color 120ms ease",...Z?{height:x,boxSizing:"border-box"}:{}},onMouseEnter:m?e=>{e.currentTarget.style.backgroundColor=a?`${I.primary}30`:I.surfaceAlt}:void 0,onMouseLeave:m?e=>{e.currentTarget.style.backgroundColor=d}:void 0,children:[o&&/* @__PURE__ */Ve("td",{role:"gridcell",style:{borderBottom:`1px solid ${I.border}`,borderRight:$e,padding:`${ke} ${Ce}`,textAlign:"center",width:40},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[/* @__PURE__ */Ve("input",{type:"checkbox",checked:a,onChange:()=>ge(l),"aria-label":a?`Deselect row ${l}`:`Select row ${l}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ve(Vr,{checked:a})]})}),e.map(e=>{const n=Ur(t,e.key),o=e.renderCell?e.renderCell(n,t):"string"==typeof n?E(n):String(n??"");/* @__PURE__ */
327
- return Ve("td",{role:"gridcell",className:V("text-sm"),style:{...Se(e),borderBottom:`1px solid ${I.border}`,borderRight:$e,color:I.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o},e.key)})]},l)}),Z&&ie<_.length&&/* @__PURE__ */Ve("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ve("td",{colSpan:Ne,style:{height:(_.length-ie)*x,padding:0,border:"none"}})})]})})]}),(z||N)&&/* @__PURE__ */Ve("div",{ref:se,style:{height:1,width:"100%"},children:N&&/* @__PURE__ */Ve("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ve("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ve("tr",{children:e.map(e=>/* @__PURE__ */Ve("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ve(Mt,{variant:"text",height:"16px"})},e.key))},n))})})}),!z&&$&&/* @__PURE__ */Ve("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:I.textMuted},children:"✓ All rows loaded"})]}),X&&!s&&/* @__PURE__ */Ve(Gr,{page:U,totalPages:G,pageSize:k,totalRows:q,onPageChange:K,theme:I})]})}var Zr=!1;function Jr({columns:e,gap:t=16,children:n}){b();const o=me(),r=function(){const[e,t]=Oe(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return Ae(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth;t(e>=1024?"lg":e>=768?"md":"sm")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}();Ae(()=>{!function(){if(Zr||"undefined"==typeof document)return;Zr=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent="\n @keyframes tkx-masonry-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}()},[]);const i=function(e,t){return void 0===e?3:"number"==typeof e?Math.max(1,e):"lg"===t?e.lg??e.md??e.sm??3:"md"===t?e.md??e.sm??2:e.sm??1}(e,r),l=Ie.toArray(n),a=Ee(()=>{const e=Array.from({length:i},()=>[]);return l.forEach((t,n)=>{e[n%i].push(t)}),e},[l,i]);/* @__PURE__ */
328
- return Ve("div",{role:"list","aria-label":"Masonry grid",className:V("flex w-full"),style:{gap:t,alignItems:"flex-start"},children:a.map((e,n)=>/* @__PURE__ */Ve("div",{className:V("flex flex-col"),style:{flex:1,gap:t,minWidth:0},children:e.map((e,t)=>{/* @__PURE__ */
329
- return Ve("div",{role:"listitem",style:(r=t*i+n,o?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*r,400)}ms`}),children:e},t);var r})},n))})}var Qr={info:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ve("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"})})},ei={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}},ti={heading:function({block:e}){const t=b(),n=e.level??1,o=`h${n}`,r=E(e.content??"");/* @__PURE__ */
330
- return Ve(o,{className:V("m-0"),style:{...ei[n],color:t.text},children:r})},paragraph:function({block:e}){const t=b(),n=E(e.content??"");/* @__PURE__ */
331
- return Ve("p",{className:V("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:t.text,marginBottom:12},children:n})},blockquote:function({block:e}){const t=b(),n=E(e.content??"");/* @__PURE__ */
332
- return Ve("blockquote",{className:V("m-0"),style:{borderLeft:`3px solid ${t.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${t.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:t.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:n})},code:function({block:e}){const t=b(),n=E(e.content??""),o=e.language?E(e.language):null;/* @__PURE__ */
333
- return Ye("div",{className:V("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${t.border}`,backgroundColor:t.surfaceAlt},children:[o&&/* @__PURE__ */Ve("div",{className:V("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:t.textMuted,borderBottom:`1px solid ${t.border}`,backgroundColor:t.surface},children:o}),/* @__PURE__ */Ve("pre",{className:V("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:t.text,tabSize:2},children:/* @__PURE__ */Ve("code",{"aria-label":o?`Code block in ${o}`:"Code block",children:n})})]})},list:function({block:e}){const t=b(),n=e.ordered?"ol":"ul",o=(e.items??[]).map(e=>E(e));/* @__PURE__ */
334
- return Ve(n,{className:V("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:t.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:o.map((e,t)=>/* @__PURE__ */Ve("li",{role:"listitem",style:{marginBottom:4},children:e},t))})},divider:function(){/* @__PURE__ */
335
- return Ve("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${b().border}`,marginTop:20,marginBottom:20}})},image:function({block:e}){const t=b(),n=E(e.src??""),o=E(e.alt??"Image");/* @__PURE__ */
336
- return Ye("figure",{className:V("m-0"),style:{marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ve("img",{src:n,alt:o,loading:"lazy",className:V("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${t.border}`}}),e.alt&&/* @__PURE__ */Ve("figcaption",{className:V("text-xs mt-2 text-center"),style:{color:t.textMuted},children:o})]})},callout:function({block:e}){const t=b(),n=e.variant??"info",o=E(e.content??""),r={info:t.info,warning:t.warning,success:t.success,danger:t.danger}[n],i=Qr[n];/* @__PURE__ */
337
- return Ye("div",{role:{info:"note",warning:"alert",success:"status",danger:"alert"}[n],className:V("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${r}12`,border:`1px solid ${r}33`,marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ve("span",{className:V("shrink-0 mt-[2px]"),style:{color:r},children:i}),/* @__PURE__ */Ve("div",{className:V("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:t.text},children:o})]})}};function ni({blocks:e,className:t,style:n}){const o=b(),r=me(),i=Ee(()=>e.map((e,t)=>{const n=ti[e.type];return n?/* @__PURE__ */Ve("div",{style:r?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(30*t,300)}ms`},children:/* @__PURE__ */Ve(n,{block:e,index:t})},t):null}),[e,r]);return Ee(()=>{if("undefined"==typeof document)return;if(document.getElementById("tkx-rich-text-kf"))return;const e=document.createElement("style");e.id="tkx-rich-text-kf",e.textContent="\n @keyframes tkx-rich-text-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n ",document.head.appendChild(e)},[]),/* @__PURE__ */Ve("article",{"aria-label":"Rich text content",className:V("font-sans",t??""),style:{color:o.text,maxWidth:720,...n},children:i})}function oi(e){const t=[];let n=0,o="";const r=()=>{o&&(t.push({kind:"text",value:o}),o="")};for(;n<e.length;){const i=e[n];if("\\"===i&&n+1<e.length)o+=e[n+1],n+=2;else{if("!"===i&&"["===e[n+1]){const o=e.indexOf("]",n+2);if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"image",alt:e.slice(n+2,o),src:e.slice(o+2,i)}),n=i+1;continue}}}if("["===i){const o=ri(e,n,"[","]");if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"link",href:e.slice(o+2,i).trim(),children:oi(e.slice(n+1,o))}),n=i+1;continue}}}if("<"===i){const o=e.indexOf(">",n+1);if(-1!==o){const i=e.slice(n+1,o);if(/^(https?:\/\/|mailto:)/i.test(i)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)){r();const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)?`mailto:${i}`:i;t.push({kind:"link",href:e,children:[{kind:"text",value:i}]}),n=o+1;continue}}}if("`"===i){const o=e.indexOf("`",n+1);if(-1!==o){r(),t.push({kind:"code",value:e.slice(n+1,o)}),n=o+1;continue}}if("~"===i&&"~"===e[n+1]){const o=e.indexOf("~~",n+2);if(-1!==o){r(),t.push({kind:"strike",children:oi(e.slice(n+2,o))}),n=o+2;continue}}if("*"===i&&"*"===e[n+1]||"_"===i&&"_"===e[n+1]){const o=i+i,l=e.indexOf(o,n+2);if(-1!==l){r(),t.push({kind:"bold",children:oi(e.slice(n+2,l))}),n=l+2;continue}}if(("*"===i||"_"===i)&&e[n+1]!==i){const o=e.indexOf(i,n+1);if(-1!==o&&e.slice(n+1,o).trim().length>0){r(),t.push({kind:"italic",children:oi(e.slice(n+1,o))}),n=o+1;continue}}o+=i,n++}}return r(),t}function ri(e,t,n,o){let r=0;for(let i=t;i<e.length;i++)if("\\"!==e[i]){if(e[i]===n)r++;else if(e[i]===o&&(r--,0===r))return i}else i++;return-1}function ii(e){const t=e.replace(/^\uFEFF/,"").replace(/\r\n?/g,"\n").split("\n"),n=[];let o=0;for(;o<t.length;){const e=t[o];if(/^\s*$/.test(e)){o++;continue}const r=e.match(/^\s*```(.*)$/);if(r){const e=r[1].trim();o++;const i=[];for(;o<t.length&&!/^\s*```\s*$/.test(t[o]);)i.push(t[o]),o++;o<t.length&&o++,n.push({kind:"code",language:e,value:i.join("\n")});continue}const i=e.match(/^(#{1,6})\s+(.*?)\s*#*\s*$/);if(i){n.push({kind:"heading",level:i[1].length,inline:oi(i[2])}),o++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:"hr"}),o++;continue}if(si(e)&&o+1<t.length&&di(t[o+1])){const r=ci(e).map(oi),i=ui(t[o+1]);o+=2;const l=[];for(;o<t.length&&si(t[o]);)l.push(ci(t[o]).map(oi)),o++;n.push({kind:"table",headers:r,rows:l,align:i});continue}if(/^\s*>/.test(e)){const e=[];for(;o<t.length&&/^\s*>/.test(t[o]);)e.push(t[o].replace(/^\s*>\s?/,"")),o++;n.push({kind:"blockquote",children:ii(e.join("\n"))});continue}if(li(e)){const[e,r]=ai(t,o);n.push(e),o=r;continue}const l=[e];for(o++;o<t.length&&!/^\s*$/.test(t[o])&&!/^#{1,6}\s/.test(t[o])&&!/^\s*```/.test(t[o])&&!/^\s*>/.test(t[o])&&!li(t[o])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[o]);)l.push(t[o]),o++;n.push({kind:"paragraph",inline:oi(l.join(" "))})}return n}function li(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function ai(e,t){const n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),o=n[1].length,r=/\d/.test(n[2]),i=[];let l=t;for(;l<e.length;){const t=e[l].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==o)break;const n=t[3];let r=null,a=n;const s=n.match(/^\[([ xX])\]\s+(.*)$/);s&&(r="x"===s[1].toLowerCase()?"checked":"unchecked",a=s[2]);const d=[a];for(l++;l<e.length;){if(/^\s*$/.test(e[l])){if(l+1<e.length&&/^\s+\S/.test(e[l+1])){d.push(""),l++;continue}break}const t=e[l].match(/^(\s*)(\S)/);if(!(t&&t[1].length>o))break;d.push(e[l].slice(o+2)),l++}i.push({blocks:ii(d.join("\n")),task:r})}return[{kind:"list",ordered:r,items:i},l]}function si(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes("|")&&e.trim().startsWith("|")}function di(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function ci(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}function ui(e){return ci(e).map(e=>{const t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function hi(e,t,n="i"){return e.map((e,o)=>{const r=`${n}-${o}`;switch(e.kind){case"text":/* @__PURE__ */return Ve("span",{children:E(e.value)},r);case"bold":/* @__PURE__ */return Ve("strong",{children:hi(e.children,t,r)},r);case"italic":/* @__PURE__ */return Ve("em",{children:hi(e.children,t,r)},r);case"strike":/* @__PURE__ */return Ve("s",{children:hi(e.children,t,r)},r);case"code":/* @__PURE__ */return Ve("code",{style:{background:t.theme.surfaceAlt,border:`1px solid ${t.theme.border}`,borderRadius:4,padding:"0.15em 0.4em",fontSize:"0.9em",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",wordBreak:"break-word"},children:E(e.value)},r);case"link":{const n=pi(e.href);if(!n)/* @__PURE__ */return Ve("span",{children:hi(e.children,t,r)},r);const o=/^(https?:)?\/\//i.test(n)||n.startsWith("mailto:");/* @__PURE__ */
338
- return Ve("a",{href:n,target:o?t.externalLinkTarget:void 0,rel:o?t.externalLinkRel:void 0,onClick:e=>{!1===t.onLinkClick?.(n,e)&&e.preventDefault()},style:{color:t.theme.primary,textDecoration:"underline",wordBreak:"break-word"},children:hi(e.children,t,r)},r)}case"image":/* @__PURE__ */return Ve("img",{src:pi(e.src)||"",alt:E(e.alt),loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto",borderRadius:6,display:"inline-block"}},r)}})}function pi(e){const t=e.trim();return t?/^javascript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)||/^vbscript:/i.test(t)?null:t:null}function fi({text:e,theme:t}){const[n,o]=Oe(!1);/* @__PURE__ */
339
- return Ve("button",{type:"button",onClick:()=>{"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},"aria-label":n?"Copied to clipboard":"Copy code",style:{position:"absolute",top:6,right:6,padding:"2px 8px",fontSize:11,background:t.surface,color:n?t.success:t.textMuted,border:`1px solid ${t.border}`,borderRadius:4,cursor:"pointer",fontFamily:"inherit",transition:"color 120ms"},children:n?"Copied":"Copy"})}function mi(e,t,n="b"){return e.map((e,o)=>{const r=`${n}-${o}`;switch(e.kind){case"heading":{const n=`h${e.level}`,o={1:{fs:t.compact?"1.75rem":"2rem",lh:"1.2",mt:"0.6em",mb:"0.5em",fw:700},2:{fs:t.compact?"1.4rem":"1.6rem",lh:"1.25",mt:"1em",mb:"0.5em",fw:700},3:{fs:t.compact?"1.2rem":"1.3rem",lh:"1.3",mt:"1em",mb:"0.4em",fw:600},4:{fs:"1.1rem",lh:"1.35",mt:"1em",mb:"0.4em",fw:600},5:{fs:"1rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600},6:{fs:"0.9rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600}}[e.level];/* @__PURE__ */
340
- return Ve(n,{style:{fontSize:o.fs,lineHeight:o.lh,marginTop:o.mt,marginBottom:o.mb,fontWeight:o.fw,color:t.theme.text,scrollMarginTop:"1em"},children:hi(e.inline,t,r)},r)}case"paragraph":/* @__PURE__ */return Ve("p",{style:{margin:"0 0 "+(t.compact?"0.7em":"1em"),lineHeight:1.65,color:t.theme.text,wordBreak:"break-word"},children:hi(e.inline,t,r)},r);case"blockquote":/* @__PURE__ */return Ve("blockquote",{style:{margin:"0 0 1em",padding:"0.5em 1em",borderLeft:`4px solid ${t.theme.primary}`,background:`${t.theme.surfaceAlt}`,color:t.theme.textMuted,borderRadius:"0 6px 6px 0"},children:mi(e.children,t,r)},r);case"code":{const n=e.value;/* @__PURE__ */
341
- return Ye("div",{style:{position:"relative",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:8,background:t.theme.surfaceAlt,overflow:"hidden"},children:[e.language&&/* @__PURE__ */Ve("div",{style:{padding:"4px 10px",fontSize:11,color:t.theme.textMuted,borderBottom:`1px solid ${t.theme.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:E(e.language)}),t.copyableCode&&/* @__PURE__ */Ve(fi,{text:n,theme:t.theme}),
342
- /* @__PURE__ */Ve("pre",{style:{margin:0,padding:12,overflowX:"auto",fontSize:13,lineHeight:1.55,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:t.theme.text,whiteSpace:"pre"},children:/* @__PURE__ */Ve("code",{children:E(n)})})]},r)}case"list":/* @__PURE__ */return Ve(e.ordered?"ol":"ul",{style:{margin:"0 0 1em",paddingLeft:"1.5em",color:t.theme.text,lineHeight:1.65},children:e.items.map((e,n)=>/* @__PURE__ */Ye("li",{style:{listStyle:null!==e.task?"none":void 0,marginLeft:null!==e.task?"-1.25em":void 0},children:[null!==e.task&&/* @__PURE__ */Ve("input",{type:"checkbox",disabled:!0,checked:"checked"===e.task,readOnly:!0,style:{marginRight:6,verticalAlign:"middle"},"aria-label":"checked"===e.task?"Completed task":"Uncompleted task"}),mi(e.blocks,t,`${r}-${n}`)]},`${r}-${n}`))},r);case"hr":/* @__PURE__ */return Ve("hr",{style:{border:"none",borderTop:`1px solid ${t.theme.border}`,margin:"1.5em 0"}},r);case"table":/* @__PURE__ */return Ve("div",{style:{overflowX:"auto",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:"touch"},children:/* @__PURE__ */Ye("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,color:t.theme.text},children:[/* @__PURE__ */Ve("thead",{children:/* @__PURE__ */Ve("tr",{children:e.headers.map((n,o)=>/* @__PURE__ */Ve("th",{style:{padding:"8px 12px",textAlign:e.align[o]??"left",borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:hi(n,t,`${r}-h-${o}`)},o))})}),/* @__PURE__ */Ve("tbody",{children:e.rows.map((n,o)=>/* @__PURE__ */Ve("tr",{children:n.map((n,i)=>/* @__PURE__ */Ve("td",{style:{padding:"8px 12px",textAlign:e.align[i]??"left",borderBottom:`1px solid ${t.theme.border}`},children:hi(n,t,`${r}-r-${o}-${i}`)},i))},o))})]})},r)}})}function gi({source:e,src:t,maxWidth:n="100%",compact:o=!1,copyableCode:r=!0,onLinkClick:i,externalLinkRel:l="noopener noreferrer",externalLinkTarget:a="_blank",loadingFallback:s,errorFallback:d,className:c,style:u}){const h=b(),[p,f]=Oe({text:null,error:null,loading:!!t&&void 0===e}),m=je(null);Ae(()=>{if(void 0!==e||!t)return;m.current?.abort();const n=new AbortController;return m.current=n,f({text:null,error:null,loading:!0}),fetch(t,{signal:n.signal}).then(async e=>{if(!e.ok)throw new Error(`Failed to load markdown (HTTP ${e.status})`);f({text:await e.text(),error:null,loading:!1})}).catch(e=>{"AbortError"!==e.name&&f({text:null,error:e.message,loading:!1})}),()=>n.abort()},[t,e]);const g=e??p.text??"",x=Ee(()=>g?ii(g):[],[g]),y={theme:h,compact:o,copyableCode:r,externalLinkRel:l,externalLinkTarget:a,onLinkClick:i},v={maxWidth:n,width:"100%",color:h.text,fontFamily:"inherit",fontSize:o?14:15,lineHeight:1.65,wordBreak:"break-word",overflowWrap:"anywhere",boxSizing:"border-box",...u};if(void 0===e&&t){if(p.loading)/* @__PURE__ */return Ve("div",{className:c,style:v,"aria-busy":"true","aria-live":"polite",children:s??/* @__PURE__ */Ve("span",{style:{color:h.textMuted},children:"Loading…"})});if(p.error)/* @__PURE__ */return Ve("div",{className:c,style:v,role:"alert",children:d?d(p.error):/* @__PURE__ */Ve("span",{style:{color:h.danger},children:E(p.error)})})}/* @__PURE__ */
343
- return Ve("div",{className:c,style:v,children:mi(x,y)})}gi.displayName="TkxMarkdown";var xi={sm:576,md:768,lg:992,xl:1200};function bi(e){return"number"==typeof e?`${e}px`:e}var yi=We({h:0,v:0}),vi=Re(({children:e,hasSider:t=!1,className:n,style:o,...r},i)=>{const l=b(),a=V("flex min-h-0 w-full font-sans"),s=t?{flexDirection:"row"}:{flexDirection:"column"};/* @__PURE__ */
344
- return Ve("section",{ref:i,className:le("tkx-layout",a,n),style:{minHeight:"100%",color:l.text,backgroundColor:l.bg,...s,...o},...r,children:e})});vi.displayName="TkxLayout";var wi=Re(({children:e,height:t=64,fixed:n=!1,className:o,style:r,...i},l)=>{const a=b(),s=bi(t),d=V("flex items-center px-6 shrink-0 w-full"),c=n?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};/* @__PURE__ */
345
- return Ve("header",{ref:l,className:le("tkx-layout-header",d,o),style:{height:s,minHeight:s,backgroundColor:a.surface,borderBottom:`1px solid ${a.border}`,...c,...r},...i,children:e})});function ki({collapsed:e,onClick:t,color:n}){const o=me();/* @__PURE__ */
346
- return Ve("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:t,className:V("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:n},children:/* @__PURE__ */Ve("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:/* @__PURE__ */Ve("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}wi.displayName="TkxHeader";var Ci=Re(({children:e,width:t=240,collapsedWidth:n=64,collapsed:o,onCollapse:r,collapsible:i=!1,breakpoint:l,trigger:a,className:s,style:d,...c},u)=>{const h=b(),p=me(),[f,m]=Oe(!1),g=o??f,x=Te(e=>{void 0===o&&m(e),r?.(e)},[o,r]);Ae(()=>{if(!l)return;const e=xi[l];if(!e)return;const t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{x(e.matches)};return x(t.matches),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[l,x]);const y=bi(t),v=g?`${n}px`:y,w=i&&null!==a,k=p?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";/* @__PURE__ */
347
- return Ye("aside",{ref:u,className:le("tkx-layout-sider",V("shrink-0 overflow-hidden flex flex-col"),s),style:{width:v,minWidth:v,maxWidth:v,backgroundColor:h.surface,borderRight:`1px solid ${h.border}`,transition:k,...d},...c,children:[/* @__PURE__ */Ve("div",{className:V("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:v,transition:k},children:e}),w&&/* @__PURE__ */Ve("div",{className:V("shrink-0"),style:{borderTop:`1px solid ${h.border}`},children:void 0!==a?a:/* @__PURE__ */Ve(ki,{collapsed:g,onClick:()=>x(!g),color:h.textMuted})})]})});Ci.displayName="TkxSider";var Si=Re(({children:e,className:t,style:n,...o},r)=>{const i=b();/* @__PURE__ */
348
- return Ve("main",{ref:r,className:le("tkx-layout-content",V("flex-1 min-w-0 min-h-0"),t),style:{backgroundColor:i.bg,padding:"24px",...n},...o,children:e})});Si.displayName="TkxContent";var $i=Re(({children:e,className:t,style:n,...o},r)=>{const i=b();/* @__PURE__ */
349
- return Ve("footer",{ref:r,className:le("tkx-layout-footer",V("flex items-center px-6 py-4 shrink-0"),t),style:{backgroundColor:i.surface,borderTop:`1px solid ${i.border}`,color:i.textMuted,...n},...o,children:e})});$i.displayName="TkxFooter";var zi={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},Ni={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Mi=Re(({children:e,gutter:t,justify:n="start",align:o="top",wrap:r=!0,className:i,style:l,...a},s)=>{const[d,c]=Array.isArray(t)?t:[t??0,0],u=d/2,h=c/2,p=d||c?{marginLeft:-u,marginRight:-u,marginTop:-h,marginBottom:-h}:{},f={h:u,v:h};/* @__PURE__ */
350
- return Ve(yi.Provider,{value:f,children:/* @__PURE__ */Ve("div",{ref:s,className:le("tkx-row",V("flex w-full"),i),style:{flexWrap:r?"wrap":"nowrap",justifyContent:zi[n]??"flex-start",alignItems:Ni[o]??"flex-start",...p,...l},...a,children:e})})});Mi.displayName="TkxRow";var Ii=!1;function Li(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var Wi=Re(({children:e,span:t,offset:n=0,push:o,pull:r,order:i,sm:l,md:a,lg:s,xl:d,className:c,style:u,...h},p)=>{Ae(()=>{!function(){if(Ii||"undefined"==typeof document)return;Ii=!0;const e=[];for(const[n,o]of Object.entries(xi)){for(let t=1;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${t} { flex: 0 0 ${r} !important; max-width: ${r} !important; } }`)}for(let t=0;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${t} { margin-left: ${r} !important; } }`)}}const t=document.createElement("style");t.id="tkx-col-responsive",t.textContent=e.join("\n"),document.head.appendChild(t)}()},[]);const f=Be(yi),m=void 0!==t?t/24*100+"%":void 0,g=n?n/24*100+"%":void 0,x=[],b=[["sm",l],["md",a],["lg",s],["xl",d]];for(const[v,w]of b){const e=Li(w);e&&(x.push(`tkx-col-${v}-${e.span}`),void 0!==e.offset&&e.offset>0&&x.push(`tkx-col-${v}-offset-${e.offset}`))}const y={};return void 0!==o&&(y.left=o/24*100+"%",y.position="relative"),void 0!==r&&(y.right=r/24*100+"%",y.position="relative"),void 0!==i&&(y.order=i),/* @__PURE__ */Ve("div",{ref:p,className:le("tkx-col",V("box-border min-h-[1px]"),...x,c),style:{flex:m?`0 0 ${m}`:"1",maxWidth:m??"100%",marginLeft:g,paddingLeft:f.h||void 0,paddingRight:f.h||void 0,paddingTop:f.v||void 0,paddingBottom:f.v||void 0,...y,...u},...h,children:e})});Wi.displayName="TkxCol";var Di=We({locale:"en-US",direction:"ltr",componentDefaults:{size:"md",variant:"default",animation:!0,bordered:!0},componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0});function Ri({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const l=Be(Di),a=Ee(()=>({size:o?.size??l.componentDefaults.size,variant:o?.variant??l.componentDefaults.variant,animation:o?.animation??l.componentDefaults.animation,bordered:o?.bordered??l.componentDefaults.bordered}),[o,l.componentDefaults]),s=Ee(()=>{const e=l.componentOverrides,t=r??{};return{button:{...e.button,...t.button},input:{...e.input,...t.input},table:{...e.table,...t.table},modal:{...e.modal,...t.modal}}},[r,l.componentOverrides]),d=t??l.locale,c=n??l.direction,u=i??l.prefixCls,h=Te(e=>`${u}-${e}`,[u]),p=Te((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(t?.size)return t.size}return a.size},[a.size,s]),f=Te(e=>void 0!==e?e:a.animation,[a.animation]),m=Te((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(void 0!==t?.bordered)return t.bordered}return a.bordered},[a.bordered,s]),g=Ee(()=>({locale:d,direction:c,componentDefaults:a,componentOverrides:s,prefixCls:u,configured:!0,cls:h,getSize:p,getAnimation:f,getBordered:m}),[d,c,a,s,u,h,p,f,m]);/* @__PURE__ */
351
- return Ve(Di.Provider,{value:g,children:/* @__PURE__ */Ve("div",{dir:c,lang:d,className:`${u}-config-root`,style:{direction:c},children:e})})}function Ti(){return Be(Di)}function Bi(e,t){const{prefixCls:n}=Ti();return`${t??n}-${e}`}function Ai(e,t){const{getSize:n}=Ti();return n(e,t)}Ri.displayName="TkxConfigProvider";var Fi={sm:32,md:40,lg:48},Ei={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Hi={sm:8,md:12,lg:16},ji={sm:4,md:8,lg:12},Oi={sm:4,md:6,lg:8},Pi={sm:14,md:16,lg:20};function Vi(){const{direction:e}=Ti();if("rtl"===e)return{transform:"scaleX(-1)"}}function Yi(e,t=0){const{direction:n}=Ti(),o="number"==typeof e?`${e}px`:e,r="number"==typeof t?`${t}px`:t;return"rtl"===n?{marginRight:o,marginLeft:r}:{marginLeft:o,marginRight:r}}var Ui={"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"},Ki=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function Xi(e){return Ki.has(e)||Ki.has(e.split("-")[0])}function qi(e){if(Ui[e])return Ui[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function Gi(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Gi).join(""):e&&"object"==typeof e&&"props"in e?Gi(e.props.children):""}function _i({text:e}){const t=b(),[n,o]=Oe(!1);return De("button",{type:"button",onClick:Te(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]),"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?t.success:t.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function Zi(e="default"){const t=b();return{default:t.text,secondary:t.textMuted,success:t.success,warning:t.warning,danger:t.danger}[e]}var Ji={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 Qi({level:e=1,children:t,copyable:n=!1,type:o="default",style:r}){const i=Zi(o);b();const l=Ji[e],a=`h${e}`,s="string"==typeof t?E(t):t,d=Gi(t);return De(a,{style:{color:i,fontSize:l.fontSize,lineHeight:l.lineHeight,fontWeight:l.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...r}},s,n&&De(_i,{text:d}))}function el({children:e,type:t="default",strong:n=!1,italic:o=!1,underline:r=!1,delete:i=!1,code:l=!1,mark:a=!1,copyable:s=!1,style:d}){const c=Zi(t),u=b(),h=Gi(e),p="string"==typeof e?E(e):e,f=[];r&&f.push("underline"),i&&f.push("line-through");let m=p;return l&&(m=De("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:u.surfaceAlt,border:`1px solid ${u.border}`,borderRadius:"4px",fontFamily:"monospace"}},m)),a&&(m=De("mark",{style:{backgroundColor:`${u.warning}33`,color:c,padding:"0 2px",borderRadius:"2px"}},m)),De(n?"strong":o?"em":"span",{style:{color:c,fontStyle:o?"italic":"normal",textDecoration:f.length>0?f.join(" "):"none",...d}},m,s&&De(_i,{text:h}))}function tl({children:e,type:t="default",copyable:n=!1,ellipsis:o=!1,style:r}){const i=b(),l="secondary"===t?i.textMuted:i.text,a=Gi(e),s="string"==typeof e?E(e):e,d={};if(o){const e="object"==typeof o?o.rows??3:3;d.display="-webkit-box",d.WebkitLineClamp=e,d.WebkitBoxOrient="vertical",d.overflow="hidden"}return De("div",{style:{color:l,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...d,...r}},s,n&&De(_i,{text:a}))}var nl={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ol=!1;function rl({size:e,color:t}){return De("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},De("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),De("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function il({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?De(rl,{size:e,color:n}):(function(){if(ol||"undefined"==typeof document)return;ol=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent="\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}(),De("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function ll({spinning:e=!0,size:t="md",tip:n,indicator:o,children:r,fullscreen:i=!1,delay:l=0,style:a}){const s=b(),d=me(),[c,u]=Oe(0===l&&e),h=je(null);if(Ae(()=>(e&&l>0?h.current=setTimeout(()=>u(!0),l):u(e),()=>{null!==h.current&&clearTimeout(h.current)}),[e,l]),!c)return r?De("div",{style:a},r):null;const p=nl[t],f=n?E(n):void 0,m=De("div",{role:"status","aria-live":"polite","aria-label":f??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??De(il,{size:p.dimension,borderWidth:p.borderWidth,color:s.primary,reducedMotion:d}),f&&De("span",{style:{color:s.primary,fontSize:p.fontSize,marginTop:"4px"}},f));return i?De("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}cc`,zIndex:9999,...a}},m):r?De("div",{style:{position:"relative",...a}},De("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:d?"none":"opacity 0.2s, filter 0.2s"}},r),De("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}66`,borderRadius:"4px"}},m)):De("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...a}},m)}function al({color:e,mutedColor:t}){return De("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},De("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),De("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),De("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),De("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),De("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function sl({mutedColor:e}){return De("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},De("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),De("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),De("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),De("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),De("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),De("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function dl({image:e="default",description:t="No data",children:n,style:o}){const r=b(),i="string"==typeof t?E(t):t;let l;return l="default"===e?De(al,{color:r.primary,mutedColor:r.textMuted}):"simple"===e?De(sl,{mutedColor:r.textMuted}):e,De("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},De("div",{style:{marginBottom:"12px",opacity:.85}},l),i&&De("div",{style:{color:r.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},i),n&&De("div",{style:{marginTop:"16px"}},n))}function cl({direction:e,color:t}){return De("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},De("path",{d:"up"===e?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4",stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}var ul=!1;function hl({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(ul||"undefined"==typeof document)return;ul=!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)}(),De("div",{"aria-hidden":"true",style:{width:e,height:t,borderRadius:"4px",background:r?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:r?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}function pl({title:e,value:t,prefix:n,suffix:o,precision:r,groupSeparator:i=",",valueStyle:l,loading:a=!1,trend:s,trendValue:d,style:c}){const u=b(),h=me(),p=E(e),f=d?E(d):void 0,m="up"===s?u.success:"down"===s?u.danger:void 0;return De("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},De("div",{style:{color:u.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},p),a?De(hl,{w:"120px",h:"32px",alt:u.surfaceAlt,bdr:u.border,rm:h}):De("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u.text,fontVariantNumeric:"tabular-nums",...l}},n&&De("span",{style:{fontSize:"0.75em",fontWeight:400}},n),De("span",null,function(e,t,n=","){if("string"==typeof e)return e;const[o,r]=(void 0!==t?e.toFixed(t):String(e)).split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return void 0!==r?`${i}.${r}`:i}(t,r,i)),o&&De("span",{style:{fontSize:"0.6em",fontWeight:400,color:u.textMuted}},o)),s&&De("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:m,marginTop:"2px"}},De(cl,{direction:s,color:m}),f&&De("span",null,f)))}function fl({title:e,value:t,format:n="HH:mm:ss",onFinish:o,prefix:r,suffix:i,style:l}){const a=b(),s=E(e),d=je(o);d.current=o;const c=je(!1),[u,h]=Oe(()=>Math.max(0,t-Date.now()));Ae(()=>{c.current=!1;const e=()=>{const e=Math.max(0,t-Date.now());h(e),e<=0&&!c.current&&(c.current=!0,d.current?.())};e();const n=setInterval(e,1e3);return()=>clearInterval(n)},[t]);const p=function(e,t){if(e<=0)return t.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),r=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),l=n%60,a=e=>String(e).padStart(2,"0");return t.replace(/DD/g,a(o)).replace(/D/g,String(o)).replace(/HH/g,a(r)).replace(/H/g,String(r)).replace(/mm/g,a(i)).replace(/m/g,String(i)).replace(/ss/g,a(l)).replace(/s/g,String(l))}(u,n);return De("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...l}},De("div",{style:{color:a.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},s),De("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u<=0?a.danger:a.text,fontVariantNumeric:"tabular-nums"}},r&&De("span",{style:{fontSize:"0.75em",fontWeight:400}},r),De("span",null,p),i&&De("span",{style:{fontSize:"0.6em",fontWeight:400,color:a.textMuted}},i)))}var ml={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function gl({options:e,value:t,onChange:n,size:o="md",block:r=!1}){const i=b(),l=me(),a=je(null),[s,d]=Oe(()=>Math.max(0,e.findIndex(e=>e.value===t))),[c,u]=Oe({}),h=ml[o];Ae(()=>{const n=e.findIndex(e=>e.value===t);n>=0&&d(n)},[t,e]),Ae(()=>{const e=a.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[s];t&&u({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:l?"none":"left 0.2s ease, width 0.2s ease"})},[s,e,l]);const p=Te(t=>{const o=e[t];o&&!o.disabled&&(d(t),n?.(o.value))},[e,n]),f=Te(t=>{let n=s;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(s+1)%e.length;e[n]?.disabled&&n!==s;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(s-1+e.length)%e.length;e[n]?.disabled&&n!==s;)n=(n-1+e.length)%e.length;n!==s&&(p(n),(a.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[s,e,p]);/* @__PURE__ */
352
- return Ye("div",{ref:a,role:"radiogroup","aria-label":"Segmented control",className:V("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:i.surfaceAlt,border:`1px solid ${i.border}`,width:r?"100%":void 0},onKeyDown:f,children:[/* @__PURE__ */Ve("div",{"aria-hidden":"true",className:V("absolute top-1 rounded-md"),style:{...c,backgroundColor:i.surface,boxShadow:`0 1px 3px ${i.border}`,zIndex:0}}),e.map((e,t)=>{const n=t===s,o=E(e.label);/* @__PURE__ */
353
- return Ye("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":n,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:n?0:-1,className:V("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:h.height,fontSize:h.fontSize,padding:`0 ${h.px}px`,flex:r?1:void 0,color:n?i.text:i.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:n?600:400,transition:l?"none":"color 0.15s ease"},onClick:()=>p(t),children:[e.icon&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",children:e.icon}),o]},e.value)})]})}function xl({options:e,value:t="",onChange:n,trigger:o="@",placeholder:r,label:i}){const l=b(),a=me(),s=je(null),d=je(null),[c,u]=Oe(t),[h,p]=Oe(!1),[f,m]=Oe(""),[g,x]=Oe(0),[y,v]=Oe(-1);Ae(()=>{void 0!==t&&u(t)},[t]);const w=e.filter(e=>e.label.toLowerCase().includes(f.toLowerCase())),k=Te(e=>{const t=e.target.value;u(t),n?.(t);const r=e.target.selectionStart??t.length,i=t.slice(0,r),l=i.lastIndexOf(o);if(l>=0){const e=i.slice(l+o.length);if(!/\s/.test(e))return m(e),v(l),p(!0),void x(0)}p(!1)},[o,n]),C=Te(e=>{const t=c.slice(0,y),r=c.slice(y+o.length+f.length),i=`${t}${o}${e.value} ${r}`;u(i),n?.(i),p(!1),s.current?.focus()},[c,y,o,f,n]),S=Te(e=>{h&&("ArrowDown"===e.key?(e.preventDefault(),x(e=>(e+1)%w.length)):"ArrowUp"===e.key?(e.preventDefault(),x(e=>(e-1+w.length)%w.length)):"Enter"===e.key&&w[g]?(e.preventDefault(),C(w[g])):"Escape"===e.key&&p(!1))},[h,w,g,C]);Ae(()=>{h&&d.current&&d.current.children[g]?.scrollIntoView({block:"nearest"})},[g,h]);const $=i?E(i):void 0,z=r?E(r):void 0;/* @__PURE__ */
354
- return Ye("div",{className:V("relative font-sans"),style:{width:"100%"},children:[$&&/* @__PURE__ */Ve("label",{className:V("block text-sm font-medium mb-1"),style:{color:l.text},children:$}),
355
- /* @__PURE__ */Ve("textarea",{ref:s,role:"combobox","aria-expanded":h,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":$??"Mentions input",value:c,placeholder:z,onChange:k,onKeyDown:S,onBlur:()=>setTimeout(()=>p(!1),200),className:V("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:l.surface,borderColor:l.border,color:l.text,minHeight:80,outline:"none"},rows:3}),h&&w.length>0&&/* @__PURE__ */Ve("ul",{ref:d,role:"listbox","aria-label":"Mention suggestions",className:V("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:l.surface,borderColor:l.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${l.bg}80`,animation:a?"none":"tkxFadeIn 0.15s ease"},children:w.map((e,t)=>/* @__PURE__ */Ye("li",{role:"option","aria-selected":t===g,className:V("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:t===g?l.surfaceAlt:"transparent",color:l.text},onMouseDown:t=>{t.preventDefault(),C(e)},onMouseEnter:()=>x(t),children:[e.avatar&&/* @__PURE__ */Ve("img",{src:E(e.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:V("rounded-full"),style:{objectFit:"cover"}}),
356
- /* @__PURE__ */Ve("span",{children:E(e.label)}),
357
- /* @__PURE__ */Ye("span",{style:{color:l.textMuted,marginLeft:"auto"},children:[o,E(e.value)]})]},e.value))})]})}var bl={L:.38,M:.42,Q:.48,H:.55};function yl({value:e,size:t=160,color:n,bgColor:o,errorLevel:r="M",icon:i,bordered:l=!0}){const a=b(),s=me(),d=je(null),c=E(e),u=n??a.text,h=o??a.surface,p=Ee(()=>function(e,t,n){const o=function(e){let t=e;return()=>(t=1664525*t+1013904223|0,(t>>>0)/4294967295)}(function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return Math.abs(t)}(e)),r=bl[n]??.42,i=Array.from({length:t},()=>Array.from({length:t},()=>!1)),l=(e,t)=>{for(let n=0;n<7;n++)for(let o=0;o<7;o++){const r=0===n||6===n||0===o||6===o,l=n>=2&&n<=4&&o>=2&&o<=4;i[e+n][t+o]=r||l}};l(0,0),l(0,18),l(18,0);for(let a=7;a<18;a++)i[6][a]=a%2==0,i[a][6]=a%2==0;for(let a=0;a<t;a++)for(let e=0;e<t;e++)a<8&&e<8||a<8&&e>=17||a>=17&&e<8||6===a||6===e||(i[a][e]=o()<r);return i}(c,25,r),[c,r]);return Ae(()=>{const e=d.current;if(!e)return;const n=e.getContext("2d");if(!n)return;const o=window.devicePixelRatio||1;e.width=t*o,e.height=t*o,n.scale(o,o);const r=t/25;n.fillStyle=h,n.fillRect(0,0,t,t),n.fillStyle=u;for(let t=0;t<25;t++)for(let e=0;e<25;e++)p[t][e]&&n.fillRect(e*r,t*r,r,r);if(i){const e=.22*t,o=(t-e)/2;n.fillStyle=h,n.fillRect(o-2,o-2,e+4,e+4);const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{n.drawImage(r,o,o,e,e)},r.src=E(i)}},[p,t,u,h,i]),/* @__PURE__ */Ve("div",{role:"img","aria-label":`QR code for: ${c}`,className:V("inline-block rounded-lg"),style:{padding:l?12:0,backgroundColor:l?h:"transparent",border:l?`1px solid ${a.border}`:"none",lineHeight:0,animation:s?"none":"tkxFadeIn 0.2s ease"},children:/* @__PURE__ */Ve("canvas",{ref:d,"aria-hidden":"true",style:{width:t,height:t,display:"block"}})})}var vl={success:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ve("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ve("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
358
- /* @__PURE__ */Ve("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),
359
- /* @__PURE__ */Ve("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),
360
- /* @__PURE__ */Ve("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
361
- /* @__PURE__ */Ve("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),
362
- /* @__PURE__ */Ve("path",{d:"M36 32v18",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),
363
- /* @__PURE__ */Ve("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ve("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
364
- /* @__PURE__ */Ve("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),
365
- /* @__PURE__ */Ve("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),
366
- /* @__PURE__ */Ve("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ve("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ve("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function wl({status:e,title:t,subTitle:n,icon:o,extra:r}){const i=b(),l=me(),a=function(e,t){switch(e){case"success":return t.success;case"error":case"500":return t.danger;case"warning":return t.warning;case"info":return t.info;case"404":case"403":return t.textMuted}}(e,i),s=E(t),d=n?E(n):void 0;/* @__PURE__ */
367
- return Ye("div",{role:"status","aria-live":"polite",className:V("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:l?"none":"tkxFadeIn 0.3s ease"},children:[
368
- /* @__PURE__ */Ve("div",{className:V("mb-6"),children:o??vl[e](a)}),
369
- /* @__PURE__ */Ve("h2",{className:V("text-xl font-semibold m-0 mb-2"),style:{color:i.text},children:s}),d&&/* @__PURE__ */Ve("p",{className:V("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:i.textMuted},children:d}),r&&/* @__PURE__ */Ve("div",{className:V("flex items-center gap-3 mt-4"),children:r})]})}function kl({steps:e,isOpen:t=!1,onClose:n,current:o,onChange:r}){const i=b(),l=me(),[a,s]=Oe(0),d=o??a,c=je(null),[u,h]=Oe({top:0,left:0}),[p,f]=Oe(null),m=e[d],g=Te(()=>{if(!m)return;const e=function(e){const t=document.querySelector(e);return t?t.getBoundingClientRect():null}(m.target);if(f(e),e&&c.current){const t=c.current.offsetWidth,n=c.current.offsetHeight;h(function(e,t,n,o){switch(t){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}}}(e,m.placement??"bottom",t,n))}},[m]);Ae(()=>{if(t)return g(),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[t,d,g]),Ae(()=>{t&&c.current?.focus()},[t,d]);const x=Te(e=>{s(e),r?.(e)},[r]),y=Te(()=>{d<e.length-1?x(d+1):n?.()},[d,e.length,x,n]),v=Te(()=>{d>0&&x(d-1)},[d,x]);if(!t||!m)return null;const w=E(m.title),k=E(m.description);return Ue(/* @__PURE__ */Ye("div",{"aria-hidden":"true",children:[/* @__PURE__ */Ve("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:p?`polygon(0% 0%, 0% 100%, ${p.left-6}px 100%, ${p.left-6}px ${p.top-6}px, ${p.right+6}px ${p.top-6}px, ${p.right+6}px ${p.bottom+6}px, ${p.left-6}px ${p.bottom+6}px, ${p.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:l?"none":"clip-path 0.25s ease"},onClick:n}),/* @__PURE__ */Ye("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":`Tour step ${d+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:u.top,left:u.left,width:300,backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${i.bg}80`,animation:l?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:e=>{"Escape"===e.key&&n?.()},children:[
370
- /* @__PURE__ */Ve("h3",{className:V("m-0 mb-2 text-base font-semibold"),style:{color:i.text},children:w}),
371
- /* @__PURE__ */Ve("p",{className:V("m-0 mb-4 text-sm leading-relaxed"),style:{color:i.textMuted},children:k}),
372
- /* @__PURE__ */Ve("div",{className:V("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((e,t)=>/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:t===d?i.primary:i.border,transition:l?"none":"background-color 0.2s"}},t))}),
373
- /* @__PURE__ */Ye("div",{className:V("flex items-center justify-between gap-2"),children:[/* @__PURE__ */Ve("button",{type:"button","aria-label":"Skip tour",onClick:n,className:V("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:i.textMuted},children:"Skip"}),/* @__PURE__ */Ye("div",{className:V("flex gap-2"),children:[d>0&&/* @__PURE__ */Ve("button",{type:"button","aria-label":"Previous step",onClick:v,className:V("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:i.border,color:i.text},children:"Prev"}),/* @__PURE__ */Ve("button",{type:"button","aria-label":d===e.length-1?"Finish tour":"Next step",onClick:y,className:V("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:i.primary,color:"#fff"},children:d===e.length-1?"Finish":"Next"})]})]})]})]}),document.body)}function Cl({text:e,children:t,rotate:n=-22,gap:o=[100,100],fontSize:r=14,color:i,zIndex:l=10}){const a=b(),s=me(),d=je(null),[c,u]=Oe(""),h=Ee(()=>(Array.isArray(e)?e:[e]).map(e=>E(e)),[e]),p=i??`${a.textMuted}22`,f=Te(()=>function(e,t,n,o,r){const i=document.createElement("canvas"),l=i.getContext("2d");if(!l)return"";const a=1.5*o,s=e.length*a,d=Math.max(...e.map(e=>e.length))*o*.6,c=n[0]+d,u=n[1]+s;return i.width=2*c,i.height=2*u,l.scale(2,2),l.translate(c/2,u/2),l.rotate(t*Math.PI/180),l.font=`${o}px sans-serif`,l.fillStyle=r,l.textAlign="center",l.textBaseline="middle",e.forEach((t,n)=>{const o=(n-(e.length-1)/2)*a;l.fillText(t,0,o)}),i.toDataURL()}(h,n,o,r,p),[h,n,o,r,p]);return Ae(()=>{const e=f();e&&u(`url(${e})`)},[f]),Ae(()=>{const e=d.current?.querySelector("[data-watermark]");if(!e)return;const t=new MutationObserver(()=>{const t=f();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[f]),/* @__PURE__ */Ye("div",{ref:d,className:V("relative"),style:{overflow:"hidden"},children:[t,/* @__PURE__ */Ve("div",{"data-watermark":!0,"aria-hidden":"true",className:V("absolute inset-0 pointer-events-none"),style:{zIndex:l,backgroundImage:c,backgroundRepeat:"repeat",animation:s?"none":"tkxFadeIn 0.3s ease"}})]})}function Sl(e){if(e)try{return e()}catch{return window}return window}function $l({children:e,offsetTop:t,offsetBottom:n,onChange:o,target:r}){const i=b(),l=me(),a=je(null),s=je(null),[d,c]=Oe(!1),[u,h]=Oe({width:0,height:0}),p=je(!1),f=Ee(()=>E("Sticky content"),[]),m=Te(()=>{const e=a.current;if(!e)return;const i=e.getBoundingClientRect(),l=function(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}(Sl(r));let s=!1;void 0!==t?s=i.top-l.top<=t:void 0!==n&&(s=l.bottom-i.bottom<=n),s!==p.current&&(p.current=s,c(s),h({width:i.width,height:i.height}),o?.(s))},[t,n,o,r]);Ae(()=>{const e=Sl(r);return m(),e.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m),()=>{e.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[m,r]);const g=d?{position:"fixed",zIndex:100,...void 0!==t?{top:t}:{},...void 0!==n?{bottom:n}:{},width:u.width||void 0,transition:l?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${i.border}`}:{};/* @__PURE__ */
374
- return Ye(Pe,{children:[/* @__PURE__ */Ve("div",{ref:a,"aria-hidden":d,style:d?{height:u.height,width:u.width}:{}}),/* @__PURE__ */Ve("div",{ref:s,role:"region","aria-label":f,className:V(d?"tkx-affixed":""),style:g,children:e})]})}function zl(e){const t=[];for(const n of e)t.push(n),n.children&&t.push(...zl(n.children));return t}function Nl(e){return e.startsWith("#")?e.slice(1):e}function Ml({item:e,activeKey:t,depth:n,onClick:o,theme:r,reducedMotion:i}){const l=e.key===t,a=E(e.title);/* @__PURE__ */
375
- return Ye("li",{role:"none",style:{listStyle:"none"},children:[/* @__PURE__ */Ve("a",{role:"treeitem","aria-current":l?"location":void 0,href:e.href,onClick:t=>{t.preventDefault(),o(e.href)},className:V("block text-sm py-1 no-underline"),style:{paddingLeft:12+16*n,color:l?r.primary:r.textMuted,fontWeight:l?600:400,borderLeft:`2px solid ${l?r.primary:"transparent"}`,transition:i?"none":"color 0.15s ease, border-color 0.15s ease"},children:a}),e.children&&e.children.length>0&&/* @__PURE__ */Ve("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(e=>/* @__PURE__ */Ve(Ml,{item:e,activeKey:t,depth:n+1,onClick:o,theme:r,reducedMotion:i},e.key))})]})}function Il({items:e,offsetTop:t=0,getCurrentAnchor:n,onChange:o}){const r=b(),i=me(),[l,a]=Oe(e[0]?.key??""),s=je(!1),d=zl(e),c=Te(()=>{if(s.current)return;let e=d[0]?.key??"";for(const n of d){const o=Nl(n.href),r=document.getElementById(o);r&&r.getBoundingClientRect().top<=t+10&&(e=n.key)}n&&(e=n(e)),e!==l&&(a(e),o?.(e))},[d,t,n,l,o]);Ae(()=>(window.addEventListener("scroll",c,{passive:!0}),c(),()=>window.removeEventListener("scroll",c)),[c]);const u=Te(e=>{const n=Nl(e),r=document.getElementById(n);if(!r)return;s.current=!0;const l=r.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:l,behavior:i?"auto":"smooth"});const c=d.find(t=>t.href===e);c&&(a(c.key),o?.(c.key)),setTimeout(()=>{s.current=!1},800)},[d,t,i,o]);/* @__PURE__ */
376
- return Ve("nav",{role:"tree","aria-label":"Anchor navigation",className:V("font-sans"),style:{borderLeft:`1px solid ${r.border}`,padding:"4px 0"},children:/* @__PURE__ */Ve("ul",{role:"group",style:{margin:0,padding:0},children:e.map(e=>/* @__PURE__ */Ve(Ml,{item:e,activeKey:l,depth:0,onClick:u,theme:r,reducedMotion:i},e.key))})})}function Ll(e,t){const n=[];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e)break;n.push(e),o=e.children??[]}return n}function Wl({options:e,value:t=[],onChange:n,placeholder:o="Select...",label:r,multiple:i=!1}){const l=b(),a=me(),s=je(null),d=je(null),[c,u]=Oe(!1),[h,p]=Oe(t),[f,m]=Oe({top:0,left:0,width:0}),g=r?E(r):void 0,x=E(o),y=t.length>0?function(e,t){return Ll(e,t).map(e=>E(e.label)).join(" / ")}(e,t):"";Ae(()=>{if(!c||!s.current)return;const e=s.current.getBoundingClientRect();m({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[c]),Ae(()=>{if(!c)return;const e=e=>{s.current?.contains(e.target)||d.current?.contains(e.target)||u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);const v=Te((t,o)=>{if(o.disabled)return;const r=[...h.slice(0,t),o.value];if(p(r),!o.children?.length){const t=Ll(e,r);n?.(r,t),i||u(!1)}},[h,e,n,i]),w=Te(e=>{"Escape"===e.key?(u(!1),s.current?.focus()):"Enter"!==e.key&&" "!==e.key||c||(e.preventDefault(),u(!0))},[c]),k=function(e,t){const n=[e];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e?.children?.length)break;n.push(e.children),o=e.children}return n}(e,h),C=c?Ue(/* @__PURE__ */Ve("div",{ref:d,role:"tree","aria-label":g??"Cascader options",className:V("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:f.top,left:f.left,backgroundColor:l.surface,borderColor:l.border,boxShadow:`0 4px 16px ${l.bg}80`,animation:a?"none":"tkxFadeIn 0.15s ease"},children:k.map((e,t)=>/* @__PURE__ */Ve("ul",{role:"group",className:V("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:t<k.length-1?`1px solid ${l.border}`:"none"},children:e.map(e=>{const n=h[t]===e.value,o=E(e.label);/* @__PURE__ */
377
- return Ye("li",{role:"treeitem","aria-selected":n,"aria-disabled":e.disabled||void 0,"aria-expanded":e.children?.length?n:void 0,className:V("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:n?l.surfaceAlt:"transparent",color:e.disabled?l.textMuted:l.text,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:()=>v(t,e),onMouseEnter:()=>{e.disabled||p(n=>[...n.slice(0,t),e.value])},children:[/* @__PURE__ */Ve("span",{children:o}),e.children&&e.children.length>0&&/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:l.textMuted,flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M10 6l6 6-6 6V6z"})})]},e.value)})},t))}),document.body):null;/* @__PURE__ */
378
- return Ye("div",{className:V("relative font-sans"),onKeyDown:w,children:[g&&/* @__PURE__ */Ve("label",{className:V("block text-sm font-medium mb-1"),style:{color:l.text},children:g}),
379
- /* @__PURE__ */Ye("button",{ref:s,type:"button",role:"combobox","aria-expanded":c,"aria-haspopup":"tree","aria-label":g??"Cascader",className:V("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:l.surface,borderColor:c?l.primary:l.border,color:y?l.text:l.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>u(e=>!e),children:[/* @__PURE__ */Ve("span",{className:V("truncate"),children:y||x}),/* @__PURE__ */Ve("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:l.textMuted,transform:c?"rotate(180deg)":"rotate(0deg)",transition:a?"none":"transform 0.2s ease",flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M7 10l5 5 5-5H7z"})})]}),C]})}var Dl={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Rl({theme:e,reducedMotion:t}){/* @__PURE__ */
380
- return Ye("div",{className:V("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[/* @__PURE__ */Ve("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ye("div",{className:V("flex-1"),children:[/* @__PURE__ */Ve("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ve("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function Tl({items:e,header:t,footer:n,bordered:o=!0,size:r="md",loading:i=!1,emptyText:l="No data",grid:a}){const s=b(),d=me(),c=E(l),u=Dl[r],h=!!a,p=a?.column??1,f=a?.gutter??16;/* @__PURE__ */
381
- return Ye("div",{role:"list","aria-label":"List","aria-busy":i,className:V("font-sans rounded-lg overflow-hidden"),style:{border:o?`1px solid ${s.border}`:"none",backgroundColor:s.surface},children:[t&&/* @__PURE__ */Ve("div",{className:V("font-semibold text-sm"),style:{padding:u,color:s.text,borderBottom:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:t}),i&&/* @__PURE__ */Ve("div",{children:Array.from({length:3}).map((e,t)=>/* @__PURE__ */Ve(Rl,{theme:s,reducedMotion:d},t))}),!i&&0===e.length&&/* @__PURE__ */Ve("div",{role:"status",className:V("text-center py-12 text-sm"),style:{color:s.textMuted},children:c}),!i&&e.length>0&&/* @__PURE__ */Ve("div",{style:h?{display:"grid",gridTemplateColumns:`repeat(${p}, 1fr)`,gap:f,padding:f}:void 0,children:e.map((t,n)=>{const o=E(t.title),r=t.description?E(t.description):void 0;/* @__PURE__ */
382
- return Ye("div",{role:"listitem",className:V("flex items-start gap-3"),style:{padding:u,borderBottom:!h&&n<e.length-1?`1px solid ${s.border}`:"none",...h?{border:`1px solid ${s.border}`,borderRadius:8,backgroundColor:s.surface}:{},animation:d?"none":`tkxFadeIn 0.2s ease ${.03*n}s both`},children:[t.avatar&&/* @__PURE__ */Ve("div",{"aria-hidden":"true",className:V("shrink-0"),children:t.avatar}),
383
- /* @__PURE__ */Ye("div",{className:V("flex-1 min-w-0"),children:[/* @__PURE__ */Ve("div",{className:V("text-sm font-medium"),style:{color:s.text},children:o}),r&&/* @__PURE__ */Ve("div",{className:V("text-xs mt-1 leading-relaxed"),style:{color:s.textMuted},children:r})]}),t.extra&&/* @__PURE__ */Ve("div",{className:V("shrink-0 ml-auto"),style:{color:s.textMuted},children:t.extra}),t.actions&&/* @__PURE__ */Ve("div",{className:V("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),n&&/* @__PURE__ */Ve("div",{className:V("text-sm"),style:{padding:u,color:s.textMuted,borderTop:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:n})]})}function Bl(e,t,n,o,r){if("vertical"===r){const r=e.x+n/2,i=e.y+o,l=t.x+n/2,a=t.y,s=(i+a)/2;return`M${r},${i} C${r},${s} ${l},${s} ${l},${a}`}const i=e.x+n,l=e.y+o/2,a=t.x,s=t.y+o/2,d=(i+a)/2;return`M${i},${l} C${d},${l} ${d},${s} ${a},${s}`}function Al({node:e,w:t,h:n,isActive:o,theme:r}){const i=e.accent??r.primary,l=function(e){if(!e)return;const t=e.trim();return!t||/^javascript:/i.test(t)||/^vbscript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)?void 0:t}(e.avatar),a=E(e.label),s=e.subLabel?E(e.subLabel):"",d=e.badge?E(e.badge):"";/* @__PURE__ */
311
+ /* @__PURE__ */Ue("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||t?n.primary:"transparent",stroke:e||t?n.primary:n.border,strokeWidth:"1.5"}),t&&/* @__PURE__ */Ue("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!t&&/* @__PURE__ */Ue("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr(e,t){return"function"==typeof t?t(e):String(e[t])}function Xr(e,t){return e[t]}function qr(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function _r({colCount:e}){const t=N();/* @__PURE__ */
312
+ return Ue("tbody",{children:Array.from({length:5},(n,o)=>/* @__PURE__ */Ue("tr",{children:Array.from({length:e},(e,n)=>/* @__PURE__ */Ue("td",{className:K("px-3 py-2"),style:{borderBottom:`1px solid ${t.border}`},children:/* @__PURE__ */Ue(Dt,{height:16})},n))},o))})}function Zr({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[/* @__PURE__ */Ue("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&/* @__PURE__ */Ye("button",{onClick:n,"aria-label":`Export ${e} as CSV`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 12px",fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer"},children:[/* @__PURE__ */Ye("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[
313
+ /* @__PURE__ */Ue("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),
314
+ /* @__PURE__ */Ue("polyline",{points:"7 10 12 15 17 10"}),
315
+ /* @__PURE__ */Ue("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function Gr({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const a=(e-1)*n+1,l=Math.min(e*n,o),s={display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer",fontSize:13,fontWeight:500};/* @__PURE__ */
316
+ return Ye("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderTop:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8,flexWrap:"wrap"},role:"navigation","aria-label":"Pagination",children:[/* @__PURE__ */Ue("span",{style:{fontSize:13,color:i.textMuted},children:0===o?"0 rows":`${a}–${l} of ${o}`}),/* @__PURE__ */Ye("div",{style:{display:"flex",gap:4},children:[
317
+ /* @__PURE__ */Ue("button",{onClick:()=>r(1),disabled:1===e,"aria-label":"First page",style:{...s,opacity:1===e?.4:1},children:"«"}),
318
+ /* @__PURE__ */Ue("button",{onClick:()=>r(e-1),disabled:1===e,"aria-label":"Previous page",style:{...s,opacity:1===e?.4:1},children:"‹"}),Array.from({length:Math.min(5,t)},(n,o)=>{let a=o+1;return t>5&&(a=Math.max(1,Math.min(e-Math.floor(2.5),t-4))+o),/* @__PURE__ */Ue("button",{onClick:()=>r(a),"aria-label":`Page ${a}`,"aria-current":a===e?"page":void 0,style:{...s,backgroundColor:a===e?i.primary:"transparent",color:a===e?i.bg:i.text,borderColor:a===e?i.primary:i.border},children:a},a)}),
319
+ /* @__PURE__ */Ue("button",{onClick:()=>r(e+1),disabled:e===t,"aria-label":"Next page",style:{...s,opacity:e===t?.4:1},children:"›"}),
320
+ /* @__PURE__ */Ue("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...s,opacity:e===t?.4:1},children:"»"})]})]})}function Jr({columns:e,data:t,rowKey:n,selectable:o=!1,selectedRows:r=[],onSelectionChange:i,sortable:a=!1,onSort:l,loading:s=!1,emptyMessage:d,stickyHeader:c=!1,striped:u=!1,bordered:h=!1,compact:p=!1,maxHeight:f,onRowClick:m,virtualScroll:g,rowHeight:x=40,showFilters:y=!1,filterValues:b,onFilterChange:v,pageSize:w=0,showExport:k=!1,exportFileName:S="export",onLoadMore:C,hasMore:$,loadingMore:z=!1,loadMoreThreshold:M=200}){const I=N(),D=$e(),W=d??D.noRows??D.noData??"No data to display",L=ge(),R=Ee(),[T,A]=Ve(null),[B,F]=Ve("asc"),E=Ae(e=>{const t=T===e&&"asc"===B?"desc":"asc";A(e),F(t),l?.(e,t)},[T,B,l]),H=He(()=>l||!T?t:[...t].sort((e,t)=>{const n=function(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}(Xr(e,T),Xr(t,T));return"asc"===B?n:-n}),[t,T,B,l]),[P,O]=Ve({}),V=b??P,U=Ae((e,t)=>{v?v(e,t):O(n=>({...n,[e]:t}))},[v]),Y=He(()=>{const e=Object.entries(V).filter(([,e])=>""!==e.trim());return 0===e.length?H:H.filter(t=>e.every(([e,n])=>{const o=Xr(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[H,V]),[X,q]=Ve(1),_=w>0,Z=Y.length,G=_?Math.max(1,Math.ceil(Z/w)):1;Fe(()=>{q(1)},[V,T,B]);const J=He(()=>_?Y.slice((X-1)*w,X*w):Y,[Y,_,X,w]),Q=void 0!==g?g:!_&&void 0!==f&&J.length>=50,ee=Oe(null),[te,ne]=Ve(0),[oe,re]=Ve(0),ie=Ae(()=>{ee.current&&ne(ee.current.scrollTop)},[]);Fe(()=>{if(!Q||!ee.current)return;const e=ee.current;re(e.clientHeight);const t=new ResizeObserver(()=>re(e.clientHeight));return t.observe(e),()=>t.disconnect()},[Q]),J.length;const ae=Q?Math.max(0,Math.floor(te/x)-10):0,le=Q?Math.min(J.length,Math.ceil((te+oe)/x)+10):J.length,se=Q?J.slice(ae,le):J,de=ae*x,ce=Oe(null),ue=Oe(!1);Fe(()=>{ue.current=!1},[t.length]),Fe(()=>{if(!C)return;const e=ce.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!ue.current&&!1!==$&&(ue.current=!0,C())},{root:ee.current,rootMargin:`0px 0px ${M}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[C,$,M]);const he=He(()=>new Set(r),[r]),pe=He(()=>Y.map(e=>Yr(e,n)),[Y,n]),fe=pe.length>0&&pe.every(e=>he.has(e)),me=pe.some(e=>he.has(e)),xe=Ae(()=>{i?.(fe?[]:pe)},[fe,pe,i]),ye=Ae(e=>{const t=he.has(e)?r.filter(t=>t!==e):[...r,e];i?.(t)},[he,r,i]),[be,ve]=Ve({}),we=Oe(null),ke=Ae((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=be[e]||n.getBoundingClientRect().width;we.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!we.current)return;const t=Math.max(50,we.current.startWidth+e.clientX-we.current.startX);ve(e=>({...e,[we.current.key]:t}))},i=()=>{we.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[be]),Se=Ae(()=>{const t=[e.map(e=>qr(e.header)).join(","),...Y.map(t=>e.map(e=>qr(Xr(t,e.key))).join(","))].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=`${S}.csv`,r.click(),URL.revokeObjectURL(o)},[e,Y,S]),Ce=p?"4px":"8px",ze=p?"8px":"12px",Ne=e=>{const t=be[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${Ce} ${ze}`}},Me=h?`1px solid ${I.border}`:"none",Ie=j(W),De=e.length+(o?1:0),We=e.some(e=>e.filterable);/* @__PURE__ */
321
+ return Ye("div",{role:"grid","aria-label":"Data grid","aria-rowcount":Z,id:R,className:K("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${I.border}`,backgroundColor:I.bg},children:[
322
+ /* @__PURE__ */Ue(Zr,{label:"data grid",showExport:k,onExport:Se,totalRows:Z,selectedCount:r.length,theme:I}),
323
+ /* @__PURE__ */Ye("div",{ref:ee,onScroll:Q?ie:void 0,style:{maxHeight:f??"none",overflowX:"auto",overflowY:f?"auto":"visible"},children:[
324
+ /* @__PURE__ */Ye("table",{className:K("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[
325
+ /* @__PURE__ */Ye("thead",{children:[/* @__PURE__ */Ye("tr",{role:"row",children:[o&&/* @__PURE__ */Ue("th",{scope:"col",role:"columnheader",style:{position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,borderBottom:`2px solid ${I.border}`,borderRight:Me,padding:`${Ce} ${ze}`,width:40,textAlign:"center"},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[/* @__PURE__ */Ue("input",{type:"checkbox",checked:fe,ref:e=>{e&&(e.indeterminate=me&&!fe)},onChange:xe,"aria-label":fe?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ue(Ur,{checked:fe,indeterminate:me&&!fe})]})}),e.map(e=>{const t=(e.sortable??a)&&!1!==e.sortable,n=T===e.key,o=j(e.header);/* @__PURE__ */
326
+ return Ue("th",{scope:"col",role:"columnheader","aria-sort":n?"asc"===B?"ascending":"descending":t?"none":void 0,className:K("text-xs font-semibold uppercase tracking-wider"),style:{...Ne(e),position:c?"sticky":"static",top:0,zIndex:2,backgroundColor:I.surface,color:I.textMuted,borderBottom:`2px solid ${I.border}`,borderRight:Me,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:L?"none":"background-color 150ms ease"},onClick:t?()=>E(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),E(e.key))}:void 0,tabIndex:t?0:void 0,children:/* @__PURE__ */Ye("div",{className:K("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):o,t&&/* @__PURE__ */Ue(Kr,{direction:n?B:null}),e.resizable&&/* @__PURE__ */Ue("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${o}`,className:K("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>ke(e.key,t)})]})},e.key)})]}),(y||We)&&/* @__PURE__ */Ye("tr",{role:"row","aria-label":"Column filters",children:[o&&/* @__PURE__ */Ue("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`,width:40}}),e.map(e=>/* @__PURE__ */Ue("th",{scope:"col",style:{backgroundColor:I.surfaceAlt,borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`4px ${ze}`},children:(e.filterable||y)&&/* @__PURE__ */Ue("input",{type:"text",value:V[e.key]??"",onChange:t=>U(e.key,t.target.value),placeholder:`${D.filterPlaceholder.replace(/[.…]+$/,"")} ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${I.border}`,backgroundColor:I.bg,color:I.text,outline:"none"}})},e.key))]})]}),s&&/* @__PURE__ */Ue(_r,{colCount:De}),!s&&/* @__PURE__ */Ue("tbody",{children:0===J.length?/* @__PURE__ */Ue("tr",{children:/* @__PURE__ */Ue("td",{colSpan:De,className:K("text-center py-10"),style:{color:I.textMuted},children:Ie})}):/* @__PURE__ */Ye(Ke,{children:[Q&&de>0&&/* @__PURE__ */Ue("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ue("td",{colSpan:De,style:{height:de,padding:0,border:"none"}})}),se.map((t,r)=>{const i=ae+r,a=Yr(t,n),l=he.has(a),s=u&&i%2==1;let d="transparent";return l?d=`${I.primary}22`:s&&(d=I.surfaceAlt),/* @__PURE__ */Ye("tr",{role:"row","aria-rowindex":i+1,"aria-selected":o?l:void 0,onClick:m?()=>m(t):void 0,onKeyDown:m?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m(t))}:void 0,tabIndex:m?0:void 0,className:K(m?"cursor-pointer":""),style:{backgroundColor:d,transition:L?"none":"background-color 120ms ease",...Q?{height:x,boxSizing:"border-box"}:{}},onMouseEnter:m?e=>{e.currentTarget.style.backgroundColor=l?`${I.primary}30`:I.surfaceAlt}:void 0,onMouseLeave:m?e=>{e.currentTarget.style.backgroundColor=d}:void 0,children:[o&&/* @__PURE__ */Ue("td",{role:"gridcell",style:{borderBottom:`1px solid ${I.border}`,borderRight:Me,padding:`${Ce} ${ze}`,textAlign:"center",width:40},children:/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[/* @__PURE__ */Ue("input",{type:"checkbox",checked:l,onChange:()=>ye(a),"aria-label":l?`Deselect row ${a}`:`Select row ${a}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),/* @__PURE__ */Ue(Ur,{checked:l})]})}),e.map(e=>{const n=Xr(t,e.key),o=e.renderCell?e.renderCell(n,t):"string"==typeof n?j(n):String(n??"");/* @__PURE__ */
327
+ return Ue("td",{role:"gridcell",className:K("text-sm"),style:{...Ne(e),borderBottom:`1px solid ${I.border}`,borderRight:Me,color:I.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o},e.key)})]},a)}),Q&&le<J.length&&/* @__PURE__ */Ue("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ue("td",{colSpan:De,style:{height:(J.length-le)*x,padding:0,border:"none"}})})]})})]}),($||z)&&/* @__PURE__ */Ue("div",{ref:ce,style:{height:1,width:"100%"},children:z&&/* @__PURE__ */Ue("table",{style:{width:"100%",borderCollapse:"collapse"},children:/* @__PURE__ */Ue("tbody",{children:Array.from({length:3},(t,n)=>/* @__PURE__ */Ue("tr",{children:e.map(e=>/* @__PURE__ */Ue("td",{style:{padding:"10px 16px"},children:/* @__PURE__ */Ue(Dt,{variant:"text",height:"16px"})},e.key))},n))})})}),!$&&C&&/* @__PURE__ */Ue("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:I.textMuted},children:"✓ All rows loaded"})]}),_&&!s&&/* @__PURE__ */Ue(Gr,{page:X,totalPages:G,pageSize:w,totalRows:Z,onPageChange:q,theme:I})]})}var Qr=!1;function ei({columns:e,gap:t=16,children:n}){N();const o=ge(),r=function(){const[e,t]=Ve(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return Fe(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth;t(e>=1024?"lg":e>=768?"md":"sm")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}();Fe(()=>{!function(){if(Qr||"undefined"==typeof document)return;Qr=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent="\n @keyframes tkx-masonry-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}()},[]);const i=function(e,t){return void 0===e?3:"number"==typeof e?Math.max(1,e):"lg"===t?e.lg??e.md??e.sm??3:"md"===t?e.md??e.sm??2:e.sm??1}(e,r),a=De.toArray(n),l=He(()=>{const e=Array.from({length:i},()=>[]);return a.forEach((t,n)=>{e[n%i].push(t)}),e},[a,i]);/* @__PURE__ */
328
+ return Ue("div",{role:"list","aria-label":"Masonry grid",className:K("flex w-full"),style:{gap:t,alignItems:"flex-start"},children:l.map((e,n)=>/* @__PURE__ */Ue("div",{className:K("flex flex-col"),style:{flex:1,gap:t,minWidth:0},children:e.map((e,t)=>{/* @__PURE__ */
329
+ return Ue("div",{role:"listitem",style:(r=t*i+n,o?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*r,400)}ms`}),children:e},t);var r})},n))})}var ti={info:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */Ue("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"})})},ni={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}},oi={heading:function({block:e}){const t=N(),n=e.level??1,o=`h${n}`,r=j(e.content??"");/* @__PURE__ */
330
+ return Ue(o,{className:K("m-0"),style:{...ni[n],color:t.text},children:r})},paragraph:function({block:e}){const t=N(),n=j(e.content??"");/* @__PURE__ */
331
+ return Ue("p",{className:K("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:t.text,marginBottom:12},children:n})},blockquote:function({block:e}){const t=N(),n=j(e.content??"");/* @__PURE__ */
332
+ return Ue("blockquote",{className:K("m-0"),style:{borderLeft:`3px solid ${t.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${t.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:t.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:n})},code:function({block:e}){const t=N(),n=j(e.content??""),o=e.language?j(e.language):null;/* @__PURE__ */
333
+ return Ye("div",{className:K("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${t.border}`,backgroundColor:t.surfaceAlt},children:[o&&/* @__PURE__ */Ue("div",{className:K("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:t.textMuted,borderBottom:`1px solid ${t.border}`,backgroundColor:t.surface},children:o}),/* @__PURE__ */Ue("pre",{className:K("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:t.text,tabSize:2},children:/* @__PURE__ */Ue("code",{"aria-label":o?`Code block in ${o}`:"Code block",children:n})})]})},list:function({block:e}){const t=N(),n=e.ordered?"ol":"ul",o=(e.items??[]).map(e=>j(e));/* @__PURE__ */
334
+ return Ue(n,{className:K("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:t.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:o.map((e,t)=>/* @__PURE__ */Ue("li",{role:"listitem",style:{marginBottom:4},children:e},t))})},divider:function(){/* @__PURE__ */
335
+ return Ue("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${N().border}`,marginTop:20,marginBottom:20}})},image:function({block:e}){const t=N(),n=j(e.src??""),o=j(e.alt??"Image");/* @__PURE__ */
336
+ return Ye("figure",{className:K("m-0"),style:{marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ue("img",{src:n,alt:o,loading:"lazy",className:K("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${t.border}`}}),e.alt&&/* @__PURE__ */Ue("figcaption",{className:K("text-xs mt-2 text-center"),style:{color:t.textMuted},children:o})]})},callout:function({block:e}){const t=N(),n=e.variant??"info",o=j(e.content??""),r={info:t.info,warning:t.warning,success:t.success,danger:t.danger}[n],i=ti[n];/* @__PURE__ */
337
+ return Ye("div",{role:{info:"note",warning:"alert",success:"status",danger:"alert"}[n],className:K("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${r}12`,border:`1px solid ${r}33`,marginTop:12,marginBottom:12},children:[/* @__PURE__ */Ue("span",{className:K("shrink-0 mt-[2px]"),style:{color:r},children:i}),/* @__PURE__ */Ue("div",{className:K("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:t.text},children:o})]})}};function ri({blocks:e,className:t,style:n}){const o=N(),r=$e(),i=ge(),a=He(()=>e.map((e,t)=>{const n=oi[e.type];return n?/* @__PURE__ */Ue("div",{style:i?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(30*t,300)}ms`},children:/* @__PURE__ */Ue(n,{block:e,index:t})},t):null}),[e,i]);return He(()=>{if("undefined"==typeof document)return;if(document.getElementById("tkx-rich-text-kf"))return;const e=document.createElement("style");e.id="tkx-rich-text-kf",e.textContent="\n @keyframes tkx-rich-text-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n ",document.head.appendChild(e)},[]),/* @__PURE__ */Ue("article",{"aria-label":r.richTextContent??"Rich text content",className:K("font-sans",t??""),style:{color:o.text,maxWidth:720,...n},children:a})}function ii(e){const t=[];let n=0,o="";const r=()=>{o&&(t.push({kind:"text",value:o}),o="")};for(;n<e.length;){const i=e[n];if("\\"===i&&n+1<e.length)o+=e[n+1],n+=2;else{if("!"===i&&"["===e[n+1]){const o=e.indexOf("]",n+2);if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"image",alt:e.slice(n+2,o),src:e.slice(o+2,i)}),n=i+1;continue}}}if("["===i){const o=ai(e,n,"[","]");if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"link",href:e.slice(o+2,i).trim(),children:ii(e.slice(n+1,o))}),n=i+1;continue}}}if("<"===i){const o=e.indexOf(">",n+1);if(-1!==o){const i=e.slice(n+1,o);if(/^(https?:\/\/|mailto:)/i.test(i)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)){r();const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)?`mailto:${i}`:i;t.push({kind:"link",href:e,children:[{kind:"text",value:i}]}),n=o+1;continue}}}if("`"===i){const o=e.indexOf("`",n+1);if(-1!==o){r(),t.push({kind:"code",value:e.slice(n+1,o)}),n=o+1;continue}}if("~"===i&&"~"===e[n+1]){const o=e.indexOf("~~",n+2);if(-1!==o){r(),t.push({kind:"strike",children:ii(e.slice(n+2,o))}),n=o+2;continue}}if("*"===i&&"*"===e[n+1]||"_"===i&&"_"===e[n+1]){const o=i+i,a=e.indexOf(o,n+2);if(-1!==a){r(),t.push({kind:"bold",children:ii(e.slice(n+2,a))}),n=a+2;continue}}if(("*"===i||"_"===i)&&e[n+1]!==i){const o=e.indexOf(i,n+1);if(-1!==o&&e.slice(n+1,o).trim().length>0){r(),t.push({kind:"italic",children:ii(e.slice(n+1,o))}),n=o+1;continue}}o+=i,n++}}return r(),t}function ai(e,t,n,o){let r=0;for(let i=t;i<e.length;i++)if("\\"!==e[i]){if(e[i]===n)r++;else if(e[i]===o&&(r--,0===r))return i}else i++;return-1}function li(e){const t=e.replace(/^\uFEFF/,"").replace(/\r\n?/g,"\n").split("\n"),n=[];let o=0;for(;o<t.length;){const e=t[o];if(/^\s*$/.test(e)){o++;continue}const r=e.match(/^\s*```(.*)$/);if(r){const e=r[1].trim();o++;const i=[];for(;o<t.length&&!/^\s*```\s*$/.test(t[o]);)i.push(t[o]),o++;o<t.length&&o++,n.push({kind:"code",language:e,value:i.join("\n")});continue}const i=e.match(/^(#{1,6})\s+(.*?)\s*#*\s*$/);if(i){n.push({kind:"heading",level:i[1].length,inline:ii(i[2])}),o++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:"hr"}),o++;continue}if(ci(e)&&o+1<t.length&&ui(t[o+1])){const r=hi(e).map(ii),i=pi(t[o+1]);o+=2;const a=[];for(;o<t.length&&ci(t[o]);)a.push(hi(t[o]).map(ii)),o++;n.push({kind:"table",headers:r,rows:a,align:i});continue}if(/^\s*>/.test(e)){const e=[];for(;o<t.length&&/^\s*>/.test(t[o]);)e.push(t[o].replace(/^\s*>\s?/,"")),o++;n.push({kind:"blockquote",children:li(e.join("\n"))});continue}if(si(e)){const[e,r]=di(t,o);n.push(e),o=r;continue}const a=[e];for(o++;o<t.length&&!/^\s*$/.test(t[o])&&!/^#{1,6}\s/.test(t[o])&&!/^\s*```/.test(t[o])&&!/^\s*>/.test(t[o])&&!si(t[o])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[o]);)a.push(t[o]),o++;n.push({kind:"paragraph",inline:ii(a.join(" "))})}return n}function si(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function di(e,t){const n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),o=n[1].length,r=/\d/.test(n[2]),i=[];let a=t;for(;a<e.length;){const t=e[a].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==o)break;const n=t[3];let r=null,l=n;const s=n.match(/^\[([ xX])\]\s+(.*)$/);s&&(r="x"===s[1].toLowerCase()?"checked":"unchecked",l=s[2]);const d=[l];for(a++;a<e.length;){if(/^\s*$/.test(e[a])){if(a+1<e.length&&/^\s+\S/.test(e[a+1])){d.push(""),a++;continue}break}const t=e[a].match(/^(\s*)(\S)/);if(!(t&&t[1].length>o))break;d.push(e[a].slice(o+2)),a++}i.push({blocks:li(d.join("\n")),task:r})}return[{kind:"list",ordered:r,items:i},a]}function ci(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes("|")&&e.trim().startsWith("|")}function ui(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function hi(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}function pi(e){return hi(e).map(e=>{const t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function fi(e,t,n="i"){return e.map((e,o)=>{const r=`${n}-${o}`;switch(e.kind){case"text":/* @__PURE__ */return Ue("span",{children:j(e.value)},r);case"bold":/* @__PURE__ */return Ue("strong",{children:fi(e.children,t,r)},r);case"italic":/* @__PURE__ */return Ue("em",{children:fi(e.children,t,r)},r);case"strike":/* @__PURE__ */return Ue("s",{children:fi(e.children,t,r)},r);case"code":/* @__PURE__ */return Ue("code",{style:{background:t.theme.surfaceAlt,border:`1px solid ${t.theme.border}`,borderRadius:4,padding:"0.15em 0.4em",fontSize:"0.9em",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",wordBreak:"break-word"},children:j(e.value)},r);case"link":{const n=mi(e.href);if(!n)/* @__PURE__ */return Ue("span",{children:fi(e.children,t,r)},r);const o=/^(https?:)?\/\//i.test(n)||n.startsWith("mailto:");/* @__PURE__ */
338
+ return Ue("a",{href:n,target:o?t.externalLinkTarget:void 0,rel:o?t.externalLinkRel:void 0,onClick:e=>{!1===t.onLinkClick?.(n,e)&&e.preventDefault()},style:{color:t.theme.primary,textDecoration:"underline",wordBreak:"break-word"},children:fi(e.children,t,r)},r)}case"image":/* @__PURE__ */return Ue("img",{src:mi(e.src)||"",alt:j(e.alt),loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto",borderRadius:6,display:"inline-block"}},r)}})}function mi(e){const t=e.trim();return t?/^javascript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)||/^vbscript:/i.test(t)?null:t:null}function gi({text:e,theme:t}){const[n,o]=Ve(!1);/* @__PURE__ */
339
+ return Ue("button",{type:"button",onClick:()=>{"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},"aria-label":n?"Copied to clipboard":"Copy code",style:{position:"absolute",top:6,right:6,padding:"2px 8px",fontSize:11,background:t.surface,color:n?t.success:t.textMuted,border:`1px solid ${t.border}`,borderRadius:4,cursor:"pointer",fontFamily:"inherit",transition:"color 120ms"},children:n?"Copied":"Copy"})}function xi(e,t,n="b"){return e.map((e,o)=>{const r=`${n}-${o}`;switch(e.kind){case"heading":{const n=`h${e.level}`,o={1:{fs:t.compact?"1.75rem":"2rem",lh:"1.2",mt:"0.6em",mb:"0.5em",fw:700},2:{fs:t.compact?"1.4rem":"1.6rem",lh:"1.25",mt:"1em",mb:"0.5em",fw:700},3:{fs:t.compact?"1.2rem":"1.3rem",lh:"1.3",mt:"1em",mb:"0.4em",fw:600},4:{fs:"1.1rem",lh:"1.35",mt:"1em",mb:"0.4em",fw:600},5:{fs:"1rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600},6:{fs:"0.9rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600}}[e.level];/* @__PURE__ */
340
+ return Ue(n,{style:{fontSize:o.fs,lineHeight:o.lh,marginTop:o.mt,marginBottom:o.mb,fontWeight:o.fw,color:t.theme.text,scrollMarginTop:"1em"},children:fi(e.inline,t,r)},r)}case"paragraph":/* @__PURE__ */return Ue("p",{style:{margin:"0 0 "+(t.compact?"0.7em":"1em"),lineHeight:1.65,color:t.theme.text,wordBreak:"break-word"},children:fi(e.inline,t,r)},r);case"blockquote":/* @__PURE__ */return Ue("blockquote",{style:{margin:"0 0 1em",padding:"0.5em 1em",borderLeft:`4px solid ${t.theme.primary}`,background:`${t.theme.surfaceAlt}`,color:t.theme.textMuted,borderRadius:"0 6px 6px 0"},children:xi(e.children,t,r)},r);case"code":{const n=e.value;/* @__PURE__ */
341
+ return Ye("div",{style:{position:"relative",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:8,background:t.theme.surfaceAlt,overflow:"hidden"},children:[e.language&&/* @__PURE__ */Ue("div",{style:{padding:"4px 10px",fontSize:11,color:t.theme.textMuted,borderBottom:`1px solid ${t.theme.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:j(e.language)}),t.copyableCode&&/* @__PURE__ */Ue(gi,{text:n,theme:t.theme}),
342
+ /* @__PURE__ */Ue("pre",{style:{margin:0,padding:12,overflowX:"auto",fontSize:13,lineHeight:1.55,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:t.theme.text,whiteSpace:"pre"},children:/* @__PURE__ */Ue("code",{children:j(n)})})]},r)}case"list":/* @__PURE__ */return Ue(e.ordered?"ol":"ul",{style:{margin:"0 0 1em",paddingLeft:"1.5em",color:t.theme.text,lineHeight:1.65},children:e.items.map((e,n)=>/* @__PURE__ */Ye("li",{style:{listStyle:null!==e.task?"none":void 0,marginLeft:null!==e.task?"-1.25em":void 0},children:[null!==e.task&&/* @__PURE__ */Ue("input",{type:"checkbox",disabled:!0,checked:"checked"===e.task,readOnly:!0,style:{marginRight:6,verticalAlign:"middle"},"aria-label":"checked"===e.task?"Completed task":"Uncompleted task"}),xi(e.blocks,t,`${r}-${n}`)]},`${r}-${n}`))},r);case"hr":/* @__PURE__ */return Ue("hr",{style:{border:"none",borderTop:`1px solid ${t.theme.border}`,margin:"1.5em 0"}},r);case"table":/* @__PURE__ */return Ue("div",{style:{overflowX:"auto",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:"touch"},children:/* @__PURE__ */Ye("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,color:t.theme.text},children:[/* @__PURE__ */Ue("thead",{children:/* @__PURE__ */Ue("tr",{children:e.headers.map((n,o)=>/* @__PURE__ */Ue("th",{style:{padding:"8px 12px",textAlign:e.align[o]??"left",borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:fi(n,t,`${r}-h-${o}`)},o))})}),/* @__PURE__ */Ue("tbody",{children:e.rows.map((n,o)=>/* @__PURE__ */Ue("tr",{children:n.map((n,i)=>/* @__PURE__ */Ue("td",{style:{padding:"8px 12px",textAlign:e.align[i]??"left",borderBottom:`1px solid ${t.theme.border}`},children:fi(n,t,`${r}-r-${o}-${i}`)},i))},o))})]})},r)}})}function yi({source:e,src:t,maxWidth:n="100%",compact:o=!1,copyableCode:r=!0,onLinkClick:i,externalLinkRel:a="noopener noreferrer",externalLinkTarget:l="_blank",loadingFallback:s,errorFallback:d,className:c,style:u}){const h=N(),[p,f]=Ve({text:null,error:null,loading:!!t&&void 0===e}),m=Oe(null);Fe(()=>{if(void 0!==e||!t)return;m.current?.abort();const n=new AbortController;return m.current=n,f({text:null,error:null,loading:!0}),fetch(t,{signal:n.signal}).then(async e=>{if(!e.ok)throw new Error(`Failed to load markdown (HTTP ${e.status})`);f({text:await e.text(),error:null,loading:!1})}).catch(e=>{"AbortError"!==e.name&&f({text:null,error:e.message,loading:!1})}),()=>n.abort()},[t,e]);const g=e??p.text??"",x=He(()=>g?li(g):[],[g]),y={theme:h,compact:o,copyableCode:r,externalLinkRel:a,externalLinkTarget:l,onLinkClick:i},b={maxWidth:n,width:"100%",color:h.text,fontFamily:"inherit",fontSize:o?14:15,lineHeight:1.65,wordBreak:"break-word",overflowWrap:"anywhere",boxSizing:"border-box",...u};if(void 0===e&&t){if(p.loading)/* @__PURE__ */return Ue("div",{className:c,style:b,"aria-busy":"true","aria-live":"polite",children:s??/* @__PURE__ */Ue("span",{style:{color:h.textMuted},children:"Loading…"})});if(p.error)/* @__PURE__ */return Ue("div",{className:c,style:b,role:"alert",children:d?d(p.error):/* @__PURE__ */Ue("span",{style:{color:h.danger},children:j(p.error)})})}/* @__PURE__ */
343
+ return Ue("div",{className:c,style:b,children:xi(x,y)})}yi.displayName="TkxMarkdown";var bi={sm:576,md:768,lg:992,xl:1200};function vi(e){return"number"==typeof e?`${e}px`:e}var wi=Le({h:0,v:0}),ki=Te(({children:e,hasSider:t=!1,className:n,style:o,...r},i)=>{const a=N(),l=K("flex min-h-0 w-full font-sans"),s=t?{flexDirection:"row"}:{flexDirection:"column"};/* @__PURE__ */
344
+ return Ue("section",{ref:i,className:le("tkx-layout",l,n),style:{minHeight:"100%",color:a.text,backgroundColor:a.bg,...s,...o},...r,children:e})});ki.displayName="TkxLayout";var Si=Te(({children:e,height:t=64,fixed:n=!1,className:o,style:r,...i},a)=>{const l=N(),s=vi(t),d=K("flex items-center px-6 shrink-0 w-full"),c=n?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};/* @__PURE__ */
345
+ return Ue("header",{ref:a,className:le("tkx-layout-header",d,o),style:{height:s,minHeight:s,backgroundColor:l.surface,borderBottom:`1px solid ${l.border}`,...c,...r},...i,children:e})});function Ci({collapsed:e,onClick:t,color:n}){const o=ge();/* @__PURE__ */
346
+ return Ue("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:t,className:K("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:n},children:/* @__PURE__ */Ue("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:/* @__PURE__ */Ue("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}Si.displayName="TkxHeader";var $i=Te(({children:e,width:t=240,collapsedWidth:n=64,collapsed:o,onCollapse:r,collapsible:i=!1,breakpoint:a,trigger:l,className:s,style:d,...c},u)=>{const h=N(),p=ge(),[f,m]=Ve(!1),g=o??f,x=Ae(e=>{void 0===o&&m(e),r?.(e)},[o,r]);Fe(()=>{if(!a)return;const e=bi[a];if(!e)return;const t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{x(e.matches)};return x(t.matches),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[a,x]);const y=vi(t),b=g?`${n}px`:y,v=i&&null!==l,w=p?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";/* @__PURE__ */
347
+ return Ye("aside",{ref:u,className:le("tkx-layout-sider",K("shrink-0 overflow-hidden flex flex-col"),s),style:{width:b,minWidth:b,maxWidth:b,backgroundColor:h.surface,borderRight:`1px solid ${h.border}`,transition:w,...d},...c,children:[/* @__PURE__ */Ue("div",{className:K("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:b,transition:w},children:e}),v&&/* @__PURE__ */Ue("div",{className:K("shrink-0"),style:{borderTop:`1px solid ${h.border}`},children:void 0!==l?l:/* @__PURE__ */Ue(Ci,{collapsed:g,onClick:()=>x(!g),color:h.textMuted})})]})});$i.displayName="TkxSider";var zi=Te(({children:e,className:t,style:n,...o},r)=>{const i=N();/* @__PURE__ */
348
+ return Ue("main",{ref:r,className:le("tkx-layout-content",K("flex-1 min-w-0 min-h-0"),t),style:{backgroundColor:i.bg,padding:"24px",...n},...o,children:e})});zi.displayName="TkxContent";var Ni=Te(({children:e,className:t,style:n,...o},r)=>{const i=N();/* @__PURE__ */
349
+ return Ue("footer",{ref:r,className:le("tkx-layout-footer",K("flex items-center px-6 py-4 shrink-0"),t),style:{backgroundColor:i.surface,borderTop:`1px solid ${i.border}`,color:i.textMuted,...n},...o,children:e})});Ni.displayName="TkxFooter";var Mi={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},Ii={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Di=Te(({children:e,gutter:t,justify:n="start",align:o="top",wrap:r=!0,className:i,style:a,...l},s)=>{const[d,c]=Array.isArray(t)?t:[t??0,0],u=d/2,h=c/2,p=d||c?{marginLeft:-u,marginRight:-u,marginTop:-h,marginBottom:-h}:{},f={h:u,v:h};/* @__PURE__ */
350
+ return Ue(wi.Provider,{value:f,children:/* @__PURE__ */Ue("div",{ref:s,className:le("tkx-row",K("flex w-full"),i),style:{flexWrap:r?"wrap":"nowrap",justifyContent:Mi[n]??"flex-start",alignItems:Ii[o]??"flex-start",...p,...a},...l,children:e})})});Di.displayName="TkxRow";var Wi=!1;function Li(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var Ri=Te(({children:e,span:t,offset:n=0,push:o,pull:r,order:i,sm:a,md:l,lg:s,xl:d,className:c,style:u,...h},p)=>{Fe(()=>{!function(){if(Wi||"undefined"==typeof document)return;Wi=!0;const e=[];for(const[n,o]of Object.entries(bi)){for(let t=1;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${t} { flex: 0 0 ${r} !important; max-width: ${r} !important; } }`)}for(let t=0;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${t} { margin-left: ${r} !important; } }`)}}const t=document.createElement("style");t.id="tkx-col-responsive",t.textContent=e.join("\n"),document.head.appendChild(t)}()},[]);const f=Be(wi),m=void 0!==t?t/24*100+"%":void 0,g=n?n/24*100+"%":void 0,x=[],y=[["sm",a],["md",l],["lg",s],["xl",d]];for(const[v,w]of y){const e=Li(w);e&&(x.push(`tkx-col-${v}-${e.span}`),void 0!==e.offset&&e.offset>0&&x.push(`tkx-col-${v}-offset-${e.offset}`))}const b={};return void 0!==o&&(b.left=o/24*100+"%",b.position="relative"),void 0!==r&&(b.right=r/24*100+"%",b.position="relative"),void 0!==i&&(b.order=i),/* @__PURE__ */Ue("div",{ref:p,className:le("tkx-col",K("box-border min-h-[1px]"),...x,c),style:{flex:m?`0 0 ${m}`:"1",maxWidth:m??"100%",marginLeft:g,paddingLeft:f.h||void 0,paddingRight:f.h||void 0,paddingTop:f.v||void 0,paddingBottom:f.v||void 0,...b,...u},...h,children:e})});Ri.displayName="TkxCol";var Ti=Le({locale:"en-US",direction:"ltr",componentDefaults:{size:"md",variant:"default",animation:!0,bordered:!0},componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0});function Ai({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const a=Be(Ti),l=He(()=>({size:o?.size??a.componentDefaults.size,variant:o?.variant??a.componentDefaults.variant,animation:o?.animation??a.componentDefaults.animation,bordered:o?.bordered??a.componentDefaults.bordered}),[o,a.componentDefaults]),s=He(()=>{const e=a.componentOverrides,t=r??{};return{button:{...e.button,...t.button},input:{...e.input,...t.input},table:{...e.table,...t.table},modal:{...e.modal,...t.modal}}},[r,a.componentOverrides]),d=t??a.locale,c=n??a.direction,u=i??a.prefixCls,h=Ae(e=>`${u}-${e}`,[u]),p=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(t?.size)return t.size}return l.size},[l.size,s]),f=Ae(e=>void 0!==e?e:l.animation,[l.animation]),m=Ae((e,t)=>{if(void 0!==t)return t;if(e){const t=s[e];if(void 0!==t?.bordered)return t.bordered}return l.bordered},[l.bordered,s]),g=He(()=>({locale:d,direction:c,componentDefaults:l,componentOverrides:s,prefixCls:u,configured:!0,cls:h,getSize:p,getAnimation:f,getBordered:m}),[d,c,l,s,u,h,p,f,m]);/* @__PURE__ */
351
+ return Ue(Ti.Provider,{value:g,children:/* @__PURE__ */Ue("div",{dir:c,lang:d,className:`${u}-config-root`,style:{direction:c},children:e})})}function Bi(){return Be(Ti)}function Fi(e,t){const{prefixCls:n}=Bi();return`${t??n}-${e}`}function Ei(e,t){const{getSize:n}=Bi();return n(e,t)}Ai.displayName="TkxConfigProvider";var ji={sm:32,md:40,lg:48},Hi={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Pi={sm:8,md:12,lg:16},Oi={sm:4,md:8,lg:12},Vi={sm:4,md:6,lg:8},Ki={sm:14,md:16,lg:20};function Ui(){const{direction:e}=Bi();if("rtl"===e)return{transform:"scaleX(-1)"}}function Yi(e,t=0){const{direction:n}=Bi(),o="number"==typeof e?`${e}px`:e,r="number"==typeof t?`${t}px`:t;return"rtl"===n?{marginRight:o,marginLeft:r}:{marginLeft:o,marginRight:r}}var Xi={"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"},qi=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function _i(e){return qi.has(e)||qi.has(e.split("-")[0])}function Zi(e){if(Xi[e])return Xi[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function Gi(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Gi).join(""):e&&"object"==typeof e&&"props"in e?Gi(e.props.children):""}function Ji({text:e}){const t=N(),[n,o]=Ve(!1);return Re("button",{type:"button",onClick:Ae(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]),"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?t.success:t.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function Qi(e="default"){const t=N();return{default:t.text,secondary:t.textMuted,success:t.success,warning:t.warning,danger:t.danger}[e]}var ea={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 ta({level:e=1,children:t,copyable:n=!1,type:o="default",style:r}){const i=Qi(o);N();const a=ea[e],l=`h${e}`,s="string"==typeof t?j(t):t,d=Gi(t);return Re(l,{style:{color:i,fontSize:a.fontSize,lineHeight:a.lineHeight,fontWeight:a.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...r}},s,n&&Re(Ji,{text:d}))}function na({children:e,type:t="default",strong:n=!1,italic:o=!1,underline:r=!1,delete:i=!1,code:a=!1,mark:l=!1,copyable:s=!1,style:d}){const c=Qi(t),u=N(),h=Gi(e),p="string"==typeof e?j(e):e,f=[];r&&f.push("underline"),i&&f.push("line-through");let m=p;return a&&(m=Re("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:u.surfaceAlt,border:`1px solid ${u.border}`,borderRadius:"4px",fontFamily:"monospace"}},m)),l&&(m=Re("mark",{style:{backgroundColor:`${u.warning}33`,color:c,padding:"0 2px",borderRadius:"2px"}},m)),Re(n?"strong":o?"em":"span",{style:{color:c,fontStyle:o?"italic":"normal",textDecoration:f.length>0?f.join(" "):"none",...d}},m,s&&Re(Ji,{text:h}))}function oa({children:e,type:t="default",copyable:n=!1,ellipsis:o=!1,style:r}){const i=N(),a="secondary"===t?i.textMuted:i.text,l=Gi(e),s="string"==typeof e?j(e):e,d={};if(o){const e="object"==typeof o?o.rows??3:3;d.display="-webkit-box",d.WebkitLineClamp=e,d.WebkitBoxOrient="vertical",d.overflow="hidden"}return Re("div",{style:{color:a,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...d,...r}},s,n&&Re(Ji,{text:l}))}var ra={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ia=!1;function aa({size:e,color:t}){return Re("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},Re("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),Re("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function la({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?Re(aa,{size:e,color:n}):(function(){if(ia||"undefined"==typeof document)return;ia=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent="\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}(),Re("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function sa({spinning:e=!0,size:t="md",tip:n,indicator:o,children:r,fullscreen:i=!1,delay:a=0,style:l}){const s=N(),d=ge(),[c,u]=Ve(0===a&&e),h=Oe(null);if(Fe(()=>(e&&a>0?h.current=setTimeout(()=>u(!0),a):u(e),()=>{null!==h.current&&clearTimeout(h.current)}),[e,a]),!c)return r?Re("div",{style:l},r):null;const p=ra[t],f=n?j(n):void 0,m=Re("div",{role:"status","aria-live":"polite","aria-label":f??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??Re(la,{size:p.dimension,borderWidth:p.borderWidth,color:s.primary,reducedMotion:d}),f&&Re("span",{style:{color:s.primary,fontSize:p.fontSize,marginTop:"4px"}},f));return i?Re("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}cc`,zIndex:9999,...l}},m):r?Re("div",{style:{position:"relative",...l}},Re("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:d?"none":"opacity 0.2s, filter 0.2s"}},r),Re("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${s.bg}66`,borderRadius:"4px"}},m)):Re("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...l}},m)}function da({color:e,mutedColor:t}){return Re("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},Re("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),Re("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),Re("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function ca({mutedColor:e}){return Re("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},Re("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),Re("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),Re("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),Re("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function ua({image:e="default",description:t="No data",children:n,style:o}){const r=N(),i="string"==typeof t?j(t):t;let a;return a="default"===e?Re(da,{color:r.primary,mutedColor:r.textMuted}):"simple"===e?Re(ca,{mutedColor:r.textMuted}):e,Re("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},Re("div",{style:{marginBottom:"12px",opacity:.85}},a),i&&Re("div",{style:{color:r.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},i),n&&Re("div",{style:{marginTop:"16px"}},n))}function ha({direction:e,color:t}){return Re("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},Re("path",{d:"up"===e?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4",stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}var pa=!1;function fa({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(pa||"undefined"==typeof document)return;pa=!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)}(),Re("div",{"aria-hidden":"true",style:{width:e,height:t,borderRadius:"4px",background:r?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:r?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}function ma({title:e,value:t,prefix:n,suffix:o,precision:r,groupSeparator:i=",",valueStyle:a,loading:l=!1,trend:s,trendValue:d,style:c}){const u=N(),h=ge(),p=j(e),f=d?j(d):void 0,m="up"===s?u.success:"down"===s?u.danger:void 0;return Re("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},Re("div",{style:{color:u.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},p),l?Re(fa,{w:"120px",h:"32px",alt:u.surfaceAlt,bdr:u.border,rm:h}):Re("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u.text,fontVariantNumeric:"tabular-nums",...a}},n&&Re("span",{style:{fontSize:"0.75em",fontWeight:400}},n),Re("span",null,function(e,t,n=","){if("string"==typeof e)return e;const[o,r]=(void 0!==t?e.toFixed(t):String(e)).split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return void 0!==r?`${i}.${r}`:i}(t,r,i)),o&&Re("span",{style:{fontSize:"0.6em",fontWeight:400,color:u.textMuted}},o)),s&&Re("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:m,marginTop:"2px"}},Re(ha,{direction:s,color:m}),f&&Re("span",null,f)))}function ga({title:e,value:t,format:n="HH:mm:ss",onFinish:o,prefix:r,suffix:i,style:a}){const l=N(),s=j(e),d=Oe(o);d.current=o;const c=Oe(!1),[u,h]=Ve(()=>Math.max(0,t-Date.now()));Fe(()=>{c.current=!1;const e=()=>{const e=Math.max(0,t-Date.now());h(e),e<=0&&!c.current&&(c.current=!0,d.current?.())};e();const n=setInterval(e,1e3);return()=>clearInterval(n)},[t]);const p=function(e,t){if(e<=0)return t.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),r=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),a=n%60,l=e=>String(e).padStart(2,"0");return t.replace(/DD/g,l(o)).replace(/D/g,String(o)).replace(/HH/g,l(r)).replace(/H/g,String(r)).replace(/mm/g,l(i)).replace(/m/g,String(i)).replace(/ss/g,l(a)).replace(/s/g,String(a))}(u,n);return Re("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...a}},Re("div",{style:{color:l.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},s),Re("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:u<=0?l.danger:l.text,fontVariantNumeric:"tabular-nums"}},r&&Re("span",{style:{fontSize:"0.75em",fontWeight:400}},r),Re("span",null,p),i&&Re("span",{style:{fontSize:"0.6em",fontWeight:400,color:l.textMuted}},i)))}var xa={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function ya({options:e,value:t,onChange:n,size:o="md",block:r=!1}){const i=N(),a=ge(),l=Oe(null),[s,d]=Ve(()=>Math.max(0,e.findIndex(e=>e.value===t))),[c,u]=Ve({}),h=xa[o];Fe(()=>{const n=e.findIndex(e=>e.value===t);n>=0&&d(n)},[t,e]),Fe(()=>{const e=l.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[s];t&&u({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:a?"none":"left 0.2s ease, width 0.2s ease"})},[s,e,a]);const p=Ae(t=>{const o=e[t];o&&!o.disabled&&(d(t),n?.(o.value))},[e,n]),f=Ae(t=>{let n=s;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(s+1)%e.length;e[n]?.disabled&&n!==s;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(s-1+e.length)%e.length;e[n]?.disabled&&n!==s;)n=(n-1+e.length)%e.length;n!==s&&(p(n),(l.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[s,e,p]);/* @__PURE__ */
352
+ return Ye("div",{ref:l,role:"radiogroup","aria-label":"Segmented control",className:K("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:i.surfaceAlt,border:`1px solid ${i.border}`,width:r?"100%":void 0},onKeyDown:f,children:[/* @__PURE__ */Ue("div",{"aria-hidden":"true",className:K("absolute top-1 rounded-md"),style:{...c,backgroundColor:i.surface,boxShadow:`0 1px 3px ${i.border}`,zIndex:0}}),e.map((e,t)=>{const n=t===s,o=j(e.label);/* @__PURE__ */
353
+ return Ye("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":n,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:n?0:-1,className:K("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:h.height,fontSize:h.fontSize,padding:`0 ${h.px}px`,flex:r?1:void 0,color:n?i.text:i.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:n?600:400,transition:a?"none":"color 0.15s ease"},onClick:()=>p(t),children:[e.icon&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",children:e.icon}),o]},e.value)})]})}function ba({options:e,value:t="",onChange:n,trigger:o="@",placeholder:r,label:i}){const a=N(),l=ge(),s=Oe(null),d=Oe(null),[c,u]=Ve(t),[h,p]=Ve(!1),[f,m]=Ve(""),[g,x]=Ve(0),[y,b]=Ve(-1);Fe(()=>{void 0!==t&&u(t)},[t]);const v=e.filter(e=>e.label.toLowerCase().includes(f.toLowerCase())),w=Ae(e=>{const t=e.target.value;u(t),n?.(t);const r=e.target.selectionStart??t.length,i=t.slice(0,r),a=i.lastIndexOf(o);if(a>=0){const e=i.slice(a+o.length);if(!/\s/.test(e))return m(e),b(a),p(!0),void x(0)}p(!1)},[o,n]),k=Ae(e=>{const t=c.slice(0,y),r=c.slice(y+o.length+f.length),i=`${t}${o}${e.value} ${r}`;u(i),n?.(i),p(!1),s.current?.focus()},[c,y,o,f,n]),S=Ae(e=>{h&&("ArrowDown"===e.key?(e.preventDefault(),x(e=>(e+1)%v.length)):"ArrowUp"===e.key?(e.preventDefault(),x(e=>(e-1+v.length)%v.length)):"Enter"===e.key&&v[g]?(e.preventDefault(),k(v[g])):"Escape"===e.key&&p(!1))},[h,v,g,k]);Fe(()=>{h&&d.current&&d.current.children[g]?.scrollIntoView({block:"nearest"})},[g,h]);const C=i?j(i):void 0,$=r?j(r):void 0;/* @__PURE__ */
354
+ return Ye("div",{className:K("relative font-sans"),style:{width:"100%"},children:[C&&/* @__PURE__ */Ue("label",{className:K("block text-sm font-medium mb-1"),style:{color:a.text},children:C}),
355
+ /* @__PURE__ */Ue("textarea",{ref:s,role:"combobox","aria-expanded":h,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":C??"Mentions input",value:c,placeholder:$,onChange:w,onKeyDown:S,onBlur:()=>setTimeout(()=>p(!1),200),className:K("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:a.surface,borderColor:a.border,color:a.text,minHeight:80,outline:"none"},rows:3}),h&&v.length>0&&/* @__PURE__ */Ue("ul",{ref:d,role:"listbox","aria-label":"Mention suggestions",className:K("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:a.surface,borderColor:a.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${a.bg}80`,animation:l?"none":"tkxFadeIn 0.15s ease"},children:v.map((e,t)=>/* @__PURE__ */Ye("li",{role:"option","aria-selected":t===g,className:K("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:t===g?a.surfaceAlt:"transparent",color:a.text},onMouseDown:t=>{t.preventDefault(),k(e)},onMouseEnter:()=>x(t),children:[e.avatar&&/* @__PURE__ */Ue("img",{src:j(e.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:K("rounded-full"),style:{objectFit:"cover"}}),
356
+ /* @__PURE__ */Ue("span",{children:j(e.label)}),
357
+ /* @__PURE__ */Ye("span",{style:{color:a.textMuted,marginLeft:"auto"},children:[o,j(e.value)]})]},e.value))})]})}var va={L:.38,M:.42,Q:.48,H:.55};function wa({value:e,size:t=160,color:n,bgColor:o,errorLevel:r="M",icon:i,bordered:a=!0}){const l=N(),s=ge(),d=Oe(null),c=j(e),u=n??l.text,h=o??l.surface,p=He(()=>function(e,t,n){const o=function(e){let t=e;return()=>(t=1664525*t+1013904223|0,(t>>>0)/4294967295)}(function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return Math.abs(t)}(e)),r=va[n]??.42,i=Array.from({length:t},()=>Array.from({length:t},()=>!1)),a=(e,t)=>{for(let n=0;n<7;n++)for(let o=0;o<7;o++){const r=0===n||6===n||0===o||6===o,a=n>=2&&n<=4&&o>=2&&o<=4;i[e+n][t+o]=r||a}};a(0,0),a(0,18),a(18,0);for(let l=7;l<18;l++)i[6][l]=l%2==0,i[l][6]=l%2==0;for(let l=0;l<t;l++)for(let e=0;e<t;e++)l<8&&e<8||l<8&&e>=17||l>=17&&e<8||6===l||6===e||(i[l][e]=o()<r);return i}(c,25,r),[c,r]);return Fe(()=>{const e=d.current;if(!e)return;const n=e.getContext("2d");if(!n)return;const o=window.devicePixelRatio||1;e.width=t*o,e.height=t*o,n.scale(o,o);const r=t/25;n.fillStyle=h,n.fillRect(0,0,t,t),n.fillStyle=u;for(let t=0;t<25;t++)for(let e=0;e<25;e++)p[t][e]&&n.fillRect(e*r,t*r,r,r);if(i){const e=.22*t,o=(t-e)/2;n.fillStyle=h,n.fillRect(o-2,o-2,e+4,e+4);const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{n.drawImage(r,o,o,e,e)},r.src=j(i)}},[p,t,u,h,i]),/* @__PURE__ */Ue("div",{role:"img","aria-label":`QR code for: ${c}`,className:K("inline-block rounded-lg"),style:{padding:a?12:0,backgroundColor:a?h:"transparent",border:a?`1px solid ${l.border}`:"none",lineHeight:0,animation:s?"none":"tkxFadeIn 0.2s ease"},children:/* @__PURE__ */Ue("canvas",{ref:d,"aria-hidden":"true",style:{width:t,height:t,display:"block"}})})}var ka={success:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ue("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ue("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
358
+ /* @__PURE__ */Ue("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),
359
+ /* @__PURE__ */Ue("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),
360
+ /* @__PURE__ */Ue("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
361
+ /* @__PURE__ */Ue("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),
362
+ /* @__PURE__ */Ue("path",{d:"M36 32v18",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),
363
+ /* @__PURE__ */Ue("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ue("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[
364
+ /* @__PURE__ */Ue("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),
365
+ /* @__PURE__ */Ue("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),
366
+ /* @__PURE__ */Ue("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>/* @__PURE__ */Ye("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[/* @__PURE__ */Ue("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),/* @__PURE__ */Ue("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function Sa({status:e,title:t,subTitle:n,icon:o,extra:r}){const i=N(),a=ge(),l=function(e,t){switch(e){case"success":return t.success;case"error":case"500":return t.danger;case"warning":return t.warning;case"info":return t.info;case"404":case"403":return t.textMuted}}(e,i),s=j(t),d=n?j(n):void 0;/* @__PURE__ */
367
+ return Ye("div",{role:"status","aria-live":"polite",className:K("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:a?"none":"tkxFadeIn 0.3s ease"},children:[
368
+ /* @__PURE__ */Ue("div",{className:K("mb-6"),children:o??ka[e](l)}),
369
+ /* @__PURE__ */Ue("h2",{className:K("text-xl font-semibold m-0 mb-2"),style:{color:i.text},children:s}),d&&/* @__PURE__ */Ue("p",{className:K("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:i.textMuted},children:d}),r&&/* @__PURE__ */Ue("div",{className:K("flex items-center gap-3 mt-4"),children:r})]})}function Ca({steps:e,isOpen:t=!1,onClose:n,current:o,onChange:r}){const i=N(),a=ge(),[l,s]=Ve(0),d=o??l,c=Oe(null),[u,h]=Ve({top:0,left:0}),[p,f]=Ve(null),m=e[d],g=Ae(()=>{if(!m)return;const e=function(e){const t=document.querySelector(e);return t?t.getBoundingClientRect():null}(m.target);if(f(e),e&&c.current){const t=c.current.offsetWidth,n=c.current.offsetHeight;h(function(e,t,n,o){switch(t){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}}}(e,m.placement??"bottom",t,n))}},[m]);Fe(()=>{if(t)return g(),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[t,d,g]),Fe(()=>{t&&c.current?.focus()},[t,d]);const x=Ae(e=>{s(e),r?.(e)},[r]),y=Ae(()=>{d<e.length-1?x(d+1):n?.()},[d,e.length,x,n]),b=Ae(()=>{d>0&&x(d-1)},[d,x]);if(!t||!m)return null;const v=j(m.title),w=j(m.description);return Xe(/* @__PURE__ */Ye("div",{"aria-hidden":"true",children:[/* @__PURE__ */Ue("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:p?`polygon(0% 0%, 0% 100%, ${p.left-6}px 100%, ${p.left-6}px ${p.top-6}px, ${p.right+6}px ${p.top-6}px, ${p.right+6}px ${p.bottom+6}px, ${p.left-6}px ${p.bottom+6}px, ${p.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:a?"none":"clip-path 0.25s ease"},onClick:n}),/* @__PURE__ */Ye("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":`Tour step ${d+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:u.top,left:u.left,width:300,backgroundColor:i.surface,border:`1px solid ${i.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${i.bg}80`,animation:a?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:e=>{"Escape"===e.key&&n?.()},children:[
370
+ /* @__PURE__ */Ue("h3",{className:K("m-0 mb-2 text-base font-semibold"),style:{color:i.text},children:v}),
371
+ /* @__PURE__ */Ue("p",{className:K("m-0 mb-4 text-sm leading-relaxed"),style:{color:i.textMuted},children:w}),
372
+ /* @__PURE__ */Ue("div",{className:K("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((e,t)=>/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:t===d?i.primary:i.border,transition:a?"none":"background-color 0.2s"}},t))}),
373
+ /* @__PURE__ */Ye("div",{className:K("flex items-center justify-between gap-2"),children:[/* @__PURE__ */Ue("button",{type:"button","aria-label":"Skip tour",onClick:n,className:K("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:i.textMuted},children:"Skip"}),/* @__PURE__ */Ye("div",{className:K("flex gap-2"),children:[d>0&&/* @__PURE__ */Ue("button",{type:"button","aria-label":"Previous step",onClick:b,className:K("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:i.border,color:i.text},children:"Prev"}),/* @__PURE__ */Ue("button",{type:"button","aria-label":d===e.length-1?"Finish tour":"Next step",onClick:y,className:K("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:i.primary,color:"#fff"},children:d===e.length-1?"Finish":"Next"})]})]})]})]}),document.body)}function $a(){if("undefined"==typeof window)return!1;const e=window.outerWidth-window.innerWidth,t=window.outerHeight-window.innerHeight;return e>160||t>160}function za(){const[e,t]=Ve(!1);return Fe(()=>{if("undefined"==typeof window)return;t($a());const e=()=>t($a());window.addEventListener("resize",e);const n=window.setInterval(e,1e3);return()=>{window.removeEventListener("resize",e),window.clearInterval(n)}},[]),e}function Na({text:e,children:t,rotate:n=-22,gap:o=[100,100],fontSize:r=14,color:i,zIndex:a=10,pattern:l="tiled",dynamic:s=!1,refreshMs:d=0,intensifyOnDevtools:c=!1,fingerprintId:u}){const h=N(),p=ge(),f=Oe(null),[m,g]=Ve(""),[x,y]=Ve(0),b=za(),v=He(()=>{const t=(Array.isArray(e)?e:[e]).map(e=>j(e));return"fingerprint"===l?function(e,t){return[...e,`id:${t||("undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10))} • ${/* @__PURE__ */(new Date).toISOString().slice(0,16).replace("T"," ")}`]}(t,u):t},[e,l,u,x]),w=c&&b?"66":"22",k=i??`${h.textMuted}${w}`,S=Ae(()=>function(e,t,n,o,r,i){if("undefined"==typeof document)return"";const a=document.createElement("canvas"),l=a.getContext("2d");if(!l)return"";const s=1.5*o,d=e.length*s,c=Math.max(...e.map(e=>e.length))*o*.6;let u,h;return"single"===i?(u=Math.max(800,1.6*c),h=Math.max(600,4*d)):(u=n[0]+c,h=n[1]+d),a.width=2*u,a.height=2*h,l.scale(2,2),l.translate(u/2,h/2),l.rotate(t*Math.PI/180),l.font=`${o}px sans-serif`,l.fillStyle=r,l.textAlign="center",l.textBaseline="middle",e.forEach((t,n)=>{const o=(n-(e.length-1)/2)*s;l.fillText(t,0,o)}),a.toDataURL()}(v,n,o,r,k,l),[v,n,o,r,k,l]);Fe(()=>{const e=S();e&&g(`url(${e})`)},[S]),Fe(()=>{if(!d||d<=0)return;const e=window.setInterval(()=>y(e=>e+1),d);return()=>window.clearInterval(e)},[d]),Fe(()=>{if(!s||"undefined"==typeof document)return;const e=()=>{"visible"===document.visibilityState&&y(e=>e+1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[s]),Fe(()=>{const e=f.current?.querySelector("[data-watermark]");if(!e)return;const t=new MutationObserver(()=>{const t=S();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[S]);const C={zIndex:a,backgroundImage:m,backgroundRepeat:"single"===l?"no-repeat":"repeat",backgroundPosition:"single"===l?"center center":void 0,animation:p?"none":"tkxFadeIn 0.3s ease"},$=c&&b?{filter:"blur(4px)",transition:"filter 0.2s"}:{};/* @__PURE__ */
374
+ return Ye("div",{ref:f,className:K("relative"),style:{overflow:"hidden"},children:[
375
+ /* @__PURE__ */Ue("div",{style:$,children:t}),
376
+ /* @__PURE__ */Ue("div",{"data-watermark":!0,"aria-hidden":"true",className:K("absolute inset-0 pointer-events-none"),style:C}),c&&b&&/* @__PURE__ */Ue("div",{"aria-live":"polite",style:{position:"absolute",top:12,right:12,padding:"6px 12px",background:h.danger,color:"#fff",fontSize:12,fontWeight:600,borderRadius:6,zIndex:a+1,pointerEvents:"none"},children:"Developer Tools detected — content protected"})]})}function Ma(e){if(e)try{return e()}catch{return window}return window}function Ia({children:e,offsetTop:t,offsetBottom:n,onChange:o,target:r}){const i=N(),a=ge(),l=Oe(null),s=Oe(null),[d,c]=Ve(!1),[u,h]=Ve({width:0,height:0}),p=Oe(!1),f=He(()=>j("Sticky content"),[]),m=Ae(()=>{const e=l.current;if(!e)return;const i=e.getBoundingClientRect(),a=function(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}(Ma(r));let s=!1;void 0!==t?s=i.top-a.top<=t:void 0!==n&&(s=a.bottom-i.bottom<=n),s!==p.current&&(p.current=s,c(s),h({width:i.width,height:i.height}),o?.(s))},[t,n,o,r]);Fe(()=>{const e=Ma(r);return m(),e.addEventListener("scroll",m,{passive:!0}),window.addEventListener("resize",m),()=>{e.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[m,r]);const g=d?{position:"fixed",zIndex:100,...void 0!==t?{top:t}:{},...void 0!==n?{bottom:n}:{},width:u.width||void 0,transition:a?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${i.border}`}:{};/* @__PURE__ */
377
+ return Ye(Ke,{children:[/* @__PURE__ */Ue("div",{ref:l,"aria-hidden":d,style:d?{height:u.height,width:u.width}:{}}),/* @__PURE__ */Ue("div",{ref:s,role:"region","aria-label":f,className:K(d?"tkx-affixed":""),style:g,children:e})]})}function Da(e){const t=[];for(const n of e)t.push(n),n.children&&t.push(...Da(n.children));return t}function Wa(e){return e.startsWith("#")?e.slice(1):e}function La({item:e,activeKey:t,depth:n,onClick:o,theme:r,reducedMotion:i}){const a=e.key===t,l=j(e.title);/* @__PURE__ */
378
+ return Ye("li",{role:"none",style:{listStyle:"none"},children:[/* @__PURE__ */Ue("a",{role:"treeitem","aria-current":a?"location":void 0,href:e.href,onClick:t=>{t.preventDefault(),o(e.href)},className:K("block text-sm py-1 no-underline"),style:{paddingLeft:12+16*n,color:a?r.primary:r.textMuted,fontWeight:a?600:400,borderLeft:`2px solid ${a?r.primary:"transparent"}`,transition:i?"none":"color 0.15s ease, border-color 0.15s ease"},children:l}),e.children&&e.children.length>0&&/* @__PURE__ */Ue("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(e=>/* @__PURE__ */Ue(La,{item:e,activeKey:t,depth:n+1,onClick:o,theme:r,reducedMotion:i},e.key))})]})}function Ra({items:e,offsetTop:t=0,getCurrentAnchor:n,onChange:o}){const r=N(),i=ge(),[a,l]=Ve(e[0]?.key??""),s=Oe(!1),d=Da(e),c=Ae(()=>{if(s.current)return;let e=d[0]?.key??"";for(const n of d){const o=Wa(n.href),r=document.getElementById(o);r&&r.getBoundingClientRect().top<=t+10&&(e=n.key)}n&&(e=n(e)),e!==a&&(l(e),o?.(e))},[d,t,n,a,o]);Fe(()=>(window.addEventListener("scroll",c,{passive:!0}),c(),()=>window.removeEventListener("scroll",c)),[c]);const u=Ae(e=>{const n=Wa(e),r=document.getElementById(n);if(!r)return;s.current=!0;const a=r.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:a,behavior:i?"auto":"smooth"});const c=d.find(t=>t.href===e);c&&(l(c.key),o?.(c.key)),setTimeout(()=>{s.current=!1},800)},[d,t,i,o]);/* @__PURE__ */
379
+ return Ue("nav",{role:"tree","aria-label":"Anchor navigation",className:K("font-sans"),style:{borderLeft:`1px solid ${r.border}`,padding:"4px 0"},children:/* @__PURE__ */Ue("ul",{role:"group",style:{margin:0,padding:0},children:e.map(e=>/* @__PURE__ */Ue(La,{item:e,activeKey:a,depth:0,onClick:u,theme:r,reducedMotion:i},e.key))})})}function Ta(e,t){const n=[];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e)break;n.push(e),o=e.children??[]}return n}function Aa({options:e,value:t=[],onChange:n,placeholder:o="Select...",label:r,multiple:i=!1}){const a=N(),l=ge(),s=Oe(null),d=Oe(null),[c,u]=Ve(!1),[h,p]=Ve(t),[f,m]=Ve({top:0,left:0,width:0}),g=r?j(r):void 0,x=j(o),y=t.length>0?function(e,t){return Ta(e,t).map(e=>j(e.label)).join(" / ")}(e,t):"";Fe(()=>{if(!c||!s.current)return;const e=s.current.getBoundingClientRect();m({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[c]),Fe(()=>{if(!c)return;const e=e=>{s.current?.contains(e.target)||d.current?.contains(e.target)||u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);const b=Ae((t,o)=>{if(o.disabled)return;const r=[...h.slice(0,t),o.value];if(p(r),!o.children?.length){const t=Ta(e,r);n?.(r,t),i||u(!1)}},[h,e,n,i]),v=Ae(e=>{"Escape"===e.key?(u(!1),s.current?.focus()):"Enter"!==e.key&&" "!==e.key||c||(e.preventDefault(),u(!0))},[c]),w=function(e,t){const n=[e];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e?.children?.length)break;n.push(e.children),o=e.children}return n}(e,h),k=c?Xe(/* @__PURE__ */Ue("div",{ref:d,role:"tree","aria-label":g??"Cascader options",className:K("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:f.top,left:f.left,backgroundColor:a.surface,borderColor:a.border,boxShadow:`0 4px 16px ${a.bg}80`,animation:l?"none":"tkxFadeIn 0.15s ease"},children:w.map((e,t)=>/* @__PURE__ */Ue("ul",{role:"group",className:K("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:t<w.length-1?`1px solid ${a.border}`:"none"},children:e.map(e=>{const n=h[t]===e.value,o=j(e.label);/* @__PURE__ */
380
+ return Ye("li",{role:"treeitem","aria-selected":n,"aria-disabled":e.disabled||void 0,"aria-expanded":e.children?.length?n:void 0,className:K("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:n?a.surfaceAlt:"transparent",color:e.disabled?a.textMuted:a.text,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:()=>b(t,e),onMouseEnter:()=>{e.disabled||p(n=>[...n.slice(0,t),e.value])},children:[/* @__PURE__ */Ue("span",{children:o}),e.children&&e.children.length>0&&/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:a.textMuted,flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M10 6l6 6-6 6V6z"})})]},e.value)})},t))}),document.body):null;/* @__PURE__ */
381
+ return Ye("div",{className:K("relative font-sans"),onKeyDown:v,children:[g&&/* @__PURE__ */Ue("label",{className:K("block text-sm font-medium mb-1"),style:{color:a.text},children:g}),
382
+ /* @__PURE__ */Ye("button",{ref:s,type:"button",role:"combobox","aria-expanded":c,"aria-haspopup":"tree","aria-label":g??"Cascader",className:K("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:a.surface,borderColor:c?a.primary:a.border,color:y?a.text:a.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>u(e=>!e),children:[/* @__PURE__ */Ue("span",{className:K("truncate"),children:y||x}),/* @__PURE__ */Ue("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:a.textMuted,transform:c?"rotate(180deg)":"rotate(0deg)",transition:l?"none":"transform 0.2s ease",flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M7 10l5 5 5-5H7z"})})]}),k]})}var Ba={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Fa({theme:e,reducedMotion:t}){/* @__PURE__ */
383
+ return Ye("div",{className:K("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[/* @__PURE__ */Ue("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ye("div",{className:K("flex-1"),children:[/* @__PURE__ */Ue("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),/* @__PURE__ */Ue("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function Ea({items:e,header:t,footer:n,bordered:o=!0,size:r="md",loading:i=!1,emptyText:a="No data",grid:l}){const s=N(),d=ge(),c=j(a),u=Ba[r],h=!!l,p=l?.column??1,f=l?.gutter??16;/* @__PURE__ */
384
+ return Ye("div",{role:"list","aria-label":"List","aria-busy":i,className:K("font-sans rounded-lg overflow-hidden"),style:{border:o?`1px solid ${s.border}`:"none",backgroundColor:s.surface},children:[t&&/* @__PURE__ */Ue("div",{className:K("font-semibold text-sm"),style:{padding:u,color:s.text,borderBottom:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:t}),i&&/* @__PURE__ */Ue("div",{children:Array.from({length:3}).map((e,t)=>/* @__PURE__ */Ue(Fa,{theme:s,reducedMotion:d},t))}),!i&&0===e.length&&/* @__PURE__ */Ue("div",{role:"status",className:K("text-center py-12 text-sm"),style:{color:s.textMuted},children:c}),!i&&e.length>0&&/* @__PURE__ */Ue("div",{style:h?{display:"grid",gridTemplateColumns:`repeat(${p}, 1fr)`,gap:f,padding:f}:void 0,children:e.map((t,n)=>{const o=j(t.title),r=t.description?j(t.description):void 0;/* @__PURE__ */
385
+ return Ye("div",{role:"listitem",className:K("flex items-start gap-3"),style:{padding:u,borderBottom:!h&&n<e.length-1?`1px solid ${s.border}`:"none",...h?{border:`1px solid ${s.border}`,borderRadius:8,backgroundColor:s.surface}:{},animation:d?"none":`tkxFadeIn 0.2s ease ${.03*n}s both`},children:[t.avatar&&/* @__PURE__ */Ue("div",{"aria-hidden":"true",className:K("shrink-0"),children:t.avatar}),
386
+ /* @__PURE__ */Ye("div",{className:K("flex-1 min-w-0"),children:[/* @__PURE__ */Ue("div",{className:K("text-sm font-medium"),style:{color:s.text},children:o}),r&&/* @__PURE__ */Ue("div",{className:K("text-xs mt-1 leading-relaxed"),style:{color:s.textMuted},children:r})]}),t.extra&&/* @__PURE__ */Ue("div",{className:K("shrink-0 ml-auto"),style:{color:s.textMuted},children:t.extra}),t.actions&&/* @__PURE__ */Ue("div",{className:K("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),n&&/* @__PURE__ */Ue("div",{className:K("text-sm"),style:{padding:u,color:s.textMuted,borderTop:`1px solid ${s.border}`,backgroundColor:s.surfaceAlt},children:n})]})}var ja={turnstile:"https://challenges.cloudflare.com/turnstile/v0/api.js",hcaptcha:"https://js.hcaptcha.com/1/api.js",recaptcha:"https://www.google.com/recaptcha/api.js"},Ha={turnstile:"turnstile",hcaptcha:"hcaptcha",recaptcha:"grecaptcha"},Pa=/^[A-Za-z0-9_-]{20,80}$/,Oa={},Va=Te(function({provider:e="turnstile",sitekey:t,theme:n="auto",size:o="normal",language:r,execution:i="render",onVerify:a,onExpire:l,onError:s,className:d,style:c,testMode:u=!1},h){const p=Oe(null),f=Oe(null),m=Oe(null);return"string"!=typeof t||Pa.test(t),je(h,()=>({reset:()=>{if(u)return void(m.current=null);const t=window[Ha[e]];if(t&&null!=f.current){try{t.reset?.(f.current)}catch{}m.current=null}},execute:()=>{if(u)return void setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);const t=window[Ha[e]];if(t&&null!=f.current)try{t.execute?.(f.current)}catch{}},getResponse:()=>m.current}),[e,a,u]),Fe(()=>{if(u){const e=window.setTimeout(()=>{m.current="TEST_TOKEN",a("TEST_TOKEN")},200);return()=>window.clearTimeout(e)}let d=!1,c=null;const h=p.current;if(h)return function(e,t){if("undefined"==typeof window)return Promise.resolve();if(window[Ha[e]])return Promise.resolve();if(Oa[e])return Oa[e];const n=new Promise((n,o)=>{const r=document.querySelector(`script[data-tkx-captcha="${e}"]`);if(r)return r.addEventListener("load",()=>n()),void r.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed")));const i=document.createElement("script");let a=ja[e];t&&"turnstile"!==e&&(a+=`?hl=${encodeURIComponent(t)}`),i.src=a,i.async=!0,i.defer=!0,i.dataset.tkxCaptcha=e,i.addEventListener("load",()=>n()),i.addEventListener("error",()=>o(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(i)});return Oa[e]=n,n}(e,r).then(()=>{if(d||!h)return;const u=window[Ha[e]];if(!u)return;const p={callback:e=>{m.current=e,a(e)},"expired-callback":()=>{m.current=null,l?.()},"error-callback":e=>{m.current=null,s?.("string"==typeof e?e:"unknown")}};try{"turnstile"===e?c=u.render(h,{sitekey:t,theme:n,size:"flexible"===o?"flexible":"compact"===o?"compact":"normal",execution:i,language:r||"auto",...p}):"hcaptcha"===e?c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"compact"===o?"compact":"normal",...p}):"recaptcha"===e&&(c=u.render(h,{sitekey:t,theme:"auto"===n?"light":n,size:"invisible"===o?"invisible":"normal",...p})),f.current=c}catch(g){s?.(g?.message||"render-failed")}}).catch(()=>{d||s?.("script-load-failed")}),()=>{d=!0;const t=window[Ha[e]];if(t&&null!=c)try{t.remove?.(c)}catch{}f.current=null,m.current=null}},[]),/* @__PURE__ */Ue("div",{ref:p,className:d,style:c,"data-tkx-captcha-provider":e,children:u&&/* @__PURE__ */Ue("div",{"aria-live":"polite",style:{padding:"12px 16px",border:"1px dashed currentColor",borderRadius:8,fontSize:13,opacity:.7,display:"inline-block"},children:"[TkxCaptcha test mode — auto-verifying with TEST_TOKEN]"})})});Va.displayName="TkxCaptcha";var Ka={latin:{id:"tkx-font-latin",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},"latin-ext":{id:"tkx-font-latin-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=latin-ext"},devanagari:{id:"tkx-font-devanagari",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap"},tamil:{id:"tkx-font-tamil",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;500;600;700&display=swap"},telugu:{id:"tkx-font-telugu",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Telugu:wght@400;500;600;700&display=swap"},kannada:{id:"tkx-font-kannada",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Kannada:wght@400;500;600;700&display=swap"},malayalam:{id:"tkx-font-malayalam",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Malayalam:wght@400;500;600;700&display=swap"},bengali:{id:"tkx-font-bengali",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;500;600;700&display=swap"},gujarati:{id:"tkx-font-gujarati",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap"},gurmukhi:{id:"tkx-font-gurmukhi",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Gurmukhi:wght@400;500;600;700&display=swap"},oriya:{id:"tkx-font-oriya",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Oriya:wght@400;500;600;700&display=swap"},sinhala:{id:"tkx-font-sinhala",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap"},arabic:{id:"tkx-font-arabic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&display=swap"},hebrew:{id:"tkx-font-hebrew",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600;700&display=swap"},thai:{id:"tkx-font-thai",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap"},vietnamese:{id:"tkx-font-vietnamese",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=vietnamese"},cyrillic:{id:"tkx-font-cyrillic",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic"},"cyrillic-ext":{id:"tkx-font-cyrillic-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=cyrillic-ext"},greek:{id:"tkx-font-greek",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek"},"greek-ext":{id:"tkx-font-greek-ext",href:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap&subset=greek-ext"},jp:{id:"tkx-font-jp",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&display=swap"},kr:{id:"tkx-font-kr",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap"},sc:{id:"tkx-font-sc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap"},tc:{id:"tkx-font-tc",href:"https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700&display=swap"}},Ua={en:["latin"],hi:["devanagari"],mr:["devanagari"],sa:["devanagari"],ne:["devanagari"],ta:["tamil"],te:["telugu"],kn:["kannada"],ml:["malayalam"],bn:["bengali"],as:["bengali"],gu:["gujarati"],pa:["gurmukhi"],or:["oriya"],si:["sinhala"],ar:["arabic"],ur:["arabic"],fa:["arabic"],he:["hebrew"],th:["thai"],vi:["vietnamese","latin"],ru:["cyrillic"],uk:["cyrillic"],bg:["cyrillic"],el:["greek"],ja:["jp"],ko:["kr"],zh:["sc"],"zh-CN":["sc"],"zh-TW":["tc"],"zh-HK":["tc"]},Ya=!1;function Xa(e){if("undefined"==typeof document)return;const t=Ka[e];if(!t)return;if(document.getElementById(t.id))return;const n=document.createElement("link");n.id=t.id,n.rel="stylesheet",n.href=t.href,document.head.appendChild(n)}function qa(e){return e&&(Ua[e]||Ua[e.split("-")[0]])||["latin"]}function _a({scripts:e,language:t,preconnect:n=!0,children:o}){const r=e&&e.length>0?e:t?qa(t):["latin"];return Fe(()=>{n&&function(){if(Ya||"undefined"==typeof document)return;const e=document.head,t=(t,n)=>{if(e.querySelector(`link[rel="preconnect"][href="${t}"]`))return;const o=document.createElement("link");o.rel="preconnect",o.href=t,n&&(o.crossOrigin="anonymous"),e.appendChild(o)};t("https://fonts.googleapis.com"),t("https://fonts.gstatic.com",!0),Ya=!0}(),r.forEach(Xa)},[r.join(","),n]),null==o?null:/* @__PURE__ */Ue(Ke,{children:o})}function Za(e){Xa(e)}function Ga(e){!function(e){if("undefined"==typeof document)return;const t=Ka[e];if(!t)return;const n=document.getElementById(t.id);n&&n.remove()}(e)}var Ja=[{iso2:"in",name:"India",dial:"91",length:10,format:"##### #####",flag:"🇮🇳"},{iso2:"us",name:"United States",dial:"1",length:10,format:"(###) ###-####",flag:"🇺🇸"},{iso2:"gb",name:"United Kingdom",dial:"44",length:[9,10],format:"#### ######",flag:"🇬🇧"},{iso2:"ca",name:"Canada",dial:"1",length:10,format:"(###) ###-####",flag:"🇨🇦"},{iso2:"au",name:"Australia",dial:"61",length:9,format:"### ### ###",flag:"🇦🇺"},{iso2:"de",name:"Germany",dial:"49",length:[10,11],format:"#### ########",flag:"🇩🇪"},{iso2:"fr",name:"France",dial:"33",length:9,format:"# ## ## ## ##",flag:"🇫🇷"},{iso2:"es",name:"Spain",dial:"34",length:9,format:"### ### ###",flag:"🇪🇸"},{iso2:"it",name:"Italy",dial:"39",length:[9,10],format:"### ### ####",flag:"🇮🇹"},{iso2:"nl",name:"Netherlands",dial:"31",length:9,format:"# #### ####",flag:"🇳🇱"},{iso2:"se",name:"Sweden",dial:"46",length:[7,9],format:"## ### ## ##",flag:"🇸🇪"},{iso2:"no",name:"Norway",dial:"47",length:8,format:"### ## ###",flag:"🇳🇴"},{iso2:"dk",name:"Denmark",dial:"45",length:8,format:"## ## ## ##",flag:"🇩🇰"},{iso2:"fi",name:"Finland",dial:"358",length:[9,10],format:"## ### ####",flag:"🇫🇮"},{iso2:"pl",name:"Poland",dial:"48",length:9,format:"### ### ###",flag:"🇵🇱"},{iso2:"ie",name:"Ireland",dial:"353",length:9,format:"## ### ####",flag:"🇮🇪"},{iso2:"pt",name:"Portugal",dial:"351",length:9,format:"### ### ###",flag:"🇵🇹"},{iso2:"ch",name:"Switzerland",dial:"41",length:9,format:"## ### ## ##",flag:"🇨🇭"},{iso2:"at",name:"Austria",dial:"43",length:[10,11],format:"### ### ####",flag:"🇦🇹"},{iso2:"be",name:"Belgium",dial:"32",length:9,format:"### ## ## ##",flag:"🇧🇪"},{iso2:"jp",name:"Japan",dial:"81",length:10,format:"## #### ####",flag:"🇯🇵"},{iso2:"kr",name:"South Korea",dial:"82",length:[9,10],format:"## #### ####",flag:"🇰🇷"},{iso2:"cn",name:"China",dial:"86",length:11,format:"### #### ####",flag:"🇨🇳"},{iso2:"hk",name:"Hong Kong",dial:"852",length:8,format:"#### ####",flag:"🇭🇰"},{iso2:"sg",name:"Singapore",dial:"65",length:8,format:"#### ####",flag:"🇸🇬"},{iso2:"my",name:"Malaysia",dial:"60",length:[9,10],format:"## ### ####",flag:"🇲🇾"},{iso2:"id",name:"Indonesia",dial:"62",length:[9,12],format:"### ### ####",flag:"🇮🇩"},{iso2:"th",name:"Thailand",dial:"66",length:9,format:"## ### ####",flag:"🇹🇭"},{iso2:"vn",name:"Vietnam",dial:"84",length:[9,10],format:"### ### ####",flag:"🇻🇳"},{iso2:"ph",name:"Philippines",dial:"63",length:10,format:"### ### ####",flag:"🇵🇭"},{iso2:"pk",name:"Pakistan",dial:"92",length:10,format:"### #######",flag:"🇵🇰"},{iso2:"bd",name:"Bangladesh",dial:"880",length:10,format:"#### ######",flag:"🇧🇩"},{iso2:"lk",name:"Sri Lanka",dial:"94",length:9,format:"## ### ####",flag:"🇱🇰"},{iso2:"np",name:"Nepal",dial:"977",length:10,format:"###-#######",flag:"🇳🇵"},{iso2:"ae",name:"UAE",dial:"971",length:9,format:"## ### ####",flag:"🇦🇪"},{iso2:"sa",name:"Saudi Arabia",dial:"966",length:9,format:"## ### ####",flag:"🇸🇦"},{iso2:"qa",name:"Qatar",dial:"974",length:8,format:"#### ####",flag:"🇶🇦"},{iso2:"kw",name:"Kuwait",dial:"965",length:8,format:"#### ####",flag:"🇰🇼"},{iso2:"om",name:"Oman",dial:"968",length:8,format:"#### ####",flag:"🇴🇲"},{iso2:"bh",name:"Bahrain",dial:"973",length:8,format:"#### ####",flag:"🇧🇭"},{iso2:"il",name:"Israel",dial:"972",length:9,format:"## ### ####",flag:"🇮🇱"},{iso2:"tr",name:"Turkey",dial:"90",length:10,format:"### ### ####",flag:"🇹🇷"},{iso2:"ru",name:"Russia",dial:"7",length:10,format:"### ### ####",flag:"🇷🇺"},{iso2:"ua",name:"Ukraine",dial:"380",length:9,format:"## ### ####",flag:"🇺🇦"},{iso2:"br",name:"Brazil",dial:"55",length:[10,11],format:"## ##### ####",flag:"🇧🇷"},{iso2:"mx",name:"Mexico",dial:"52",length:10,format:"## #### ####",flag:"🇲🇽"},{iso2:"ar",name:"Argentina",dial:"54",length:10,format:"## #### ####",flag:"🇦🇷"},{iso2:"cl",name:"Chile",dial:"56",length:9,format:"# #### ####",flag:"🇨🇱"},{iso2:"co",name:"Colombia",dial:"57",length:10,format:"### ### ####",flag:"🇨🇴"},{iso2:"pe",name:"Peru",dial:"51",length:9,format:"### ### ###",flag:"🇵🇪"},{iso2:"za",name:"South Africa",dial:"27",length:9,format:"## ### ####",flag:"🇿🇦"},{iso2:"ng",name:"Nigeria",dial:"234",length:10,format:"### ### ####",flag:"🇳🇬"},{iso2:"ke",name:"Kenya",dial:"254",length:9,format:"### ### ###",flag:"🇰🇪"},{iso2:"eg",name:"Egypt",dial:"20",length:10,format:"### ### ####",flag:"🇪🇬"},{iso2:"ma",name:"Morocco",dial:"212",length:9,format:"## ### ####",flag:"🇲🇦"},{iso2:"nz",name:"New Zealand",dial:"64",length:[8,9],format:"## ### ####",flag:"🇳🇿"}];function Qa(e){return e.replace(/\D+/g,"")}function el(e,t){if(!t)return e;let n="",o=0;for(const r of t)if("#"===r){if(o>=e.length)break;n+=e[o++]}else o<e.length&&(n+=r);return o<e.length&&(n+=e.slice(o)),n}function tl(e,t){return Array.isArray(t)?e.length>=t[0]&&e.length<=t[1]:e.length===t}function nl(e){return Array.isArray(e)?`${e[0]}–${e[1]}`:`${e}`}var ol=Te(function({defaultCountry:e="in",value:t,defaultValue:n,onChange:o,onValid:r,label:i,placeholder:a,disabled:l,required:s,id:d,name:c,extraCountries:u=[],className:h,style:p},f){const m=N(),g=Ee(),x=Ee(),y=He(()=>[...Ja,...u].sort((e,t)=>e.name.localeCompare(t.name)),[u]),b=e=>y.find(t=>t.iso2===e.toLowerCase())||y[0],v=t=>{if(!t.startsWith("+"))return{country:b(e),digits:Qa(t)};const n=Qa(t);for(const e of[4,3,2,1]){const t=n.slice(0,e),o=y.find(e=>e.dial===t);if(o)return{country:o,digits:n.slice(e)}}return{country:b(e),digits:n}},w=t?v(t):{country:b(e),digits:Qa(n||"")},[k,S]=Ve(w.country),[C,$]=Ve(w.digits),[z,M]=Ve(!1),[I,D]=Ve(""),[W,L]=Ve(0),R=Oe(null),T=Oe(null);Fe(()=>{if(void 0===t)return;const e=v(t);S(e.country),$(e.digits)},[t]);const A=el(C,k.format),B=tl(C,k.length),F=C?`+${k.dial}${C}`:"",E=(e,t)=>{const n={raw:el(e,t.format),digits:e,e164:e?`+${t.dial}${e}`:"",country:t,valid:tl(e,t.length)};o?.(n)},j=e=>{S(e),M(!1),E(C,e),R.current?.focus()},H=He(()=>{const e=I.trim().toLowerCase();return e?y.filter(t=>t.name.toLowerCase().includes(e)||t.iso2.includes(e)||t.dial.includes(e.replace(/^\+/,""))):y},[y,I]);Fe(()=>{L(0)},[I]),Fe(()=>{if(z){const e=setTimeout(()=>T.current?.focus(),0);return()=>clearTimeout(e)}},[z]);const P=a??nl(k.length).replace(/\d/g,"#"),O={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...p},V={fontSize:13,fontWeight:600,color:m.text},K={display:"flex",alignItems:"stretch",border:`1px solid ${m.border}`,borderRadius:8,background:m.surface,overflow:"visible",position:"relative"},U={display:"inline-flex",alignItems:"center",gap:6,padding:"0 10px",background:"transparent",border:"none",borderRight:`1px solid ${m.border}`,cursor:l?"not-allowed":"pointer",color:m.text,fontSize:14,minHeight:40,fontWeight:500},Y={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:m.text,background:"transparent",minHeight:40,minWidth:0},X={position:"absolute",top:"calc(100% + 4px)",left:0,right:0,maxHeight:280,overflow:"auto",background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,zIndex:1e3,padding:6,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},q={width:"100%",padding:"8px 10px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,fontSize:13,marginBottom:6,outline:"none"},_={fontSize:12,color:m.danger,marginTop:2};/* @__PURE__ */
387
+ return Ye("div",{className:h,style:O,onKeyDown:e=>{z&&("ArrowDown"===e.key?(e.preventDefault(),L(e=>Math.min(H.length-1,e+1))):"ArrowUp"===e.key?(e.preventDefault(),L(e=>Math.max(0,e-1))):"Enter"===e.key?(e.preventDefault(),H[W]&&j(H[W])):"Escape"===e.key&&(e.preventDefault(),M(!1),R.current?.focus()))},children:[i&&/* @__PURE__ */Ye("label",{htmlFor:d||g,style:V,children:[i,s&&/* @__PURE__ */Ue("span",{style:{color:m.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),
388
+ /* @__PURE__ */Ye("div",{style:K,children:[
389
+ /* @__PURE__ */Ye("button",{ref:R,type:"button",style:U,onClick:()=>!l&&M(e=>!e),"aria-haspopup":"listbox","aria-expanded":z,"aria-controls":x,"aria-label":`Country: ${k.name}, dial code +${k.dial}`,disabled:l,children:[
390
+ /* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{fontSize:18,lineHeight:1},children:k.flag}),
391
+ /* @__PURE__ */Ye("span",{"aria-hidden":"true",children:["+",k.dial]}),
392
+ /* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{fontSize:10,opacity:.6,marginLeft:2},children:"▾"})]}),
393
+ /* @__PURE__ */Ue("input",{ref:f,id:d||g,name:c,type:"tel",inputMode:"tel",autoComplete:"tel-national",value:A,onChange:e=>{const t=Qa(e.target.value).slice(0,15);$(t),E(t,k)},onBlur:()=>{B&&r&&r({raw:A,digits:C,e164:F,country:k,valid:!0})},placeholder:P,disabled:l,required:s,"aria-invalid":C.length>0&&!B,"aria-describedby":C.length>0&&!B?`${g}-err`:void 0,style:Y}),z&&!l&&/* @__PURE__ */Ye("div",{id:x,role:"listbox","aria-label":"Select country",style:X,children:[
394
+ /* @__PURE__ */Ue("input",{ref:T,type:"text",placeholder:"Search country or dial code…",value:I,onChange:e=>D(e.target.value),style:q,"aria-label":"Filter countries"}),0===H.length&&/* @__PURE__ */Ye("div",{style:{padding:"12px 10px",fontSize:13,color:m.textMuted},children:['No country matches "',I,'"']}),H.map((e,t)=>{/* @__PURE__ */return Ye("div",{role:"option","aria-selected":t===W,onMouseEnter:()=>L(t),onClick:()=>j(e),style:(n=t===W,{display:"flex",alignItems:"center",gap:10,padding:"8px 10px",borderRadius:6,cursor:"pointer",background:n?m.surfaceAlt:"transparent",color:m.text,fontSize:13}),children:[
395
+ /* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{fontSize:16},children:e.flag}),
396
+ /* @__PURE__ */Ue("span",{style:{flex:1},children:e.name}),
397
+ /* @__PURE__ */Ye("span",{style:{color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:["+",e.dial]})]},e.iso2);var n})]})]}),C.length>0&&!B&&/* @__PURE__ */Ye("div",{id:`${g}-err`,role:"alert",style:_,children:["Expected ",nl(k.length)," digits for ",k.name,"."]})]})});ol.displayName="TkxPhoneInput";var rl={free:null,"1:1":1,"3:4":3/4,"4:5":.8,"16:9":16/9,"4:3":4/3,"3:2":1.5},il={drop:"Drop an image here, or",browse:"browse",rotate:"Rotate",apply:"Apply",cancel:"Cancel",brightness:"Brightness",contrast:"Contrast",aspect:"Aspect",free:"Free"},al=Te(function({src:e,aspectRatio:t="free",ratios:n=["free","1:1","3:4","4:5","16:9"],mimeType:o="image/png",quality:r=.92,maxOutputSize:i=2048,outputFilename:a="edited.png",onChange:l,onResult:s,onCancel:d,className:c,style:u,labels:h},p){const f={...il,...h},m=N(),g=Oe(null),x=Oe(null),y=Oe(null),b=Oe(null),[v,w]=Ve(e??null),[k,S]=Ve(null),[C,$]=Ve(t),[z,M]=Ve(0),[I,D]=Ve(100),[W,L]=Ve(100),[R,T]=Ve({x:0,y:0,w:0,h:0}),[A,B]=Ve(!1),F=Oe({mode:null,startX:0,startY:0,startCrop:{x:0,y:0,w:0,h:0}});Fe(()=>{if(!v)return b.current=null,void S(null);const e=new Image;e.crossOrigin="anonymous",e.onload=()=>{b.current=e,S({w:e.naturalWidth,h:e.naturalHeight});const t=rl[C];if(t){const n=Math.min(e.naturalWidth,e.naturalHeight*t),o=n/t;T({x:(e.naturalWidth-n)/2,y:(e.naturalHeight-o)/2,w:n,h:o})}else T({x:0,y:0,w:e.naturalWidth,h:e.naturalHeight})},e.src=v},[v,C]),Fe(()=>{l?.({rotation:z,brightness:I,contrast:W})},[z,I,W,l]);const E=Ae(()=>{const e=x.current,t=b.current,n=k;if(!e||!t||!n)return;const o=e.getContext("2d");if(!o)return;const r=y.current,i=r?Math.min(r.clientWidth,800):600,a=z%180!=0,l=a?n.h:n.w,s=a?n.w:n.h,d=Math.min(i/l,600/s,1),c=Math.floor(l*d),u=Math.floor(s*d);e.width=c,e.height=u,o.save(),o.filter=`brightness(${I}%) contrast(${W}%)`,o.translate(c/2,u/2),o.rotate(z*Math.PI/180),o.drawImage(t,-n.w*d/2,-n.h*d/2,n.w*d,n.h*d),o.restore()},[z,I,W,k]);Fe(()=>{E()},[E]),Fe(()=>{const e=k;if(!e)return;const t=rl[C];t&&T(n=>{const o=n.x+n.w/2,r=n.y+n.h/2;let i=n.w,a=i/t;return a>e.h&&(a=e.h,i=a*t),i>e.w&&(i=e.w,a=i/t),{x:Math.max(0,Math.min(e.w-i,o-i/2)),y:Math.max(0,Math.min(e.h-a,r-a/2)),w:i,h:a}})},[C,k]);const j=e=>{const t=new FileReader;t.onload=()=>{"string"==typeof t.result&&(w(t.result),M(0),D(100),L(100))},t.readAsDataURL(e)},H=e=>t=>{t.preventDefault(),t.stopPropagation();const n="touches"in t?t.touches[0]:t;F.current={mode:e,startX:n.clientX,startY:n.clientY,startCrop:{...R}};const o=e=>{e.preventDefault();const t="touches"in e?e.touches[0]:e,n=t.clientX-F.current.startX,o=t.clientY-F.current.startY,r=k;if(!r)return;const i=x.current;if(!i)return;const a=n*(r.w/i.width),l=o*(r.h/i.height),s=F.current.startCrop,d=rl[C];let c={...s};if("move"===F.current.mode)c.x=Math.max(0,Math.min(r.w-s.w,s.x+a)),c.y=Math.max(0,Math.min(r.h-s.h,s.y+l));else{const e=F.current.mode;if("se"===e)c.w=Math.max(20,Math.min(r.w-s.x,s.w+a)),c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+l));else if("sw"===e){const e=Math.max(20,s.w-a);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x,c.h=d?c.w/d:Math.max(20,Math.min(r.h-s.y,s.h+l))}else if("ne"===e){c.w=Math.max(20,Math.min(r.w-s.x,s.w+a));const e=d?c.w/d:Math.max(20,s.h-l);c.y=Math.max(0,s.y+s.h-e),c.h=s.y+s.h-c.y}else if("nw"===e){const e=Math.max(20,s.w-a);c.x=Math.max(0,s.x+s.w-e),c.w=s.x+s.w-c.x;const t=d?c.w/d:Math.max(20,s.h-l);c.y=Math.max(0,s.y+s.h-t),c.h=s.y+s.h-c.y}}T(c)},r=()=>{F.current.mode=null,window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",r)};window.addEventListener("mousemove",o,{passive:!1}),window.addEventListener("mouseup",r),window.addEventListener("touchmove",o,{passive:!1}),window.addEventListener("touchend",r)},P=Ae(()=>new Promise(e=>{const t=b.current,n=k;if(!t||!n)return e(null);const l=document.createElement("canvas"),s=z%180!=0,d=s?R.h:R.w,c=s?R.w:R.h,u=Math.min(1,i/Math.max(d,c));l.width=Math.round(d*u),l.height=Math.round(c*u);const h=l.getContext("2d");if(!h)return e(null);h.filter=`brightness(${I}%) contrast(${W}%)`;const p=document.createElement("canvas");p.width=s?n.h:n.w,p.height=s?n.w:n.h;const f=p.getContext("2d");if(!f)return e(null);f.translate(p.width/2,p.height/2),f.rotate(z*Math.PI/180),f.drawImage(t,-n.w/2,-n.h/2,n.w,n.h),h.drawImage(p,R.x,R.y,R.w,R.h,0,0,l.width,l.height),l.toBlob(t=>{if(!t)return e(null);const n="image/jpeg"===o?"jpg":"image/webp"===o?"webp":"png",r=a.endsWith(`.${n}`)?a:a.replace(/\.\w+$/,"")+`.${n}`;e({blob:t,file:new File([t],r,{type:o,lastModified:Date.now()}),url:URL.createObjectURL(t),width:l.width,height:l.height})},o,r)}),[R,z,I,W,k,o,r,i,a]);je(p,()=>({getResult:P,reset:()=>{if(M(0),D(100),L(100),k){const e=rl[C];if(e){const t=Math.min(k.w,k.h*e),n=t/e;T({x:(k.w-t)/2,y:(k.h-n)/2,w:t,h:n})}else T({x:0,y:0,w:k.w,h:k.h})}},loadSource:e=>w(e)}),[P,C,k]);const O={border:`1px solid ${m.border}`,borderRadius:12,background:m.surface,padding:16,...u},V={border:`2px dashed ${A?m.primary:m.border}`,borderRadius:10,padding:48,textAlign:"center",color:m.textMuted,cursor:"pointer",transition:"border-color 0.15s",background:A?`${m.primary}10`:"transparent"},K={padding:"8px 14px",border:`1px solid ${m.border}`,borderRadius:6,background:m.bg,color:m.text,cursor:"pointer",fontSize:13,fontWeight:600,minHeight:36},U=He(()=>{const e=x.current,t=k;if(!e||!t)return null;const n=z%180!=0,o=n?t.h:t.w,r=n?t.w:t.h,i=e.width/o,a=e.height/r;return{left:R.x*i,top:R.y*a,width:R.w*i,height:R.h*a}},[R,k,z]);return v?/* @__PURE__ */Ye("div",{ref:y,className:c,style:O,children:[
398
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12,alignItems:"center"},children:[
399
+ /* @__PURE__ */Ye("span",{style:{fontSize:13,fontWeight:600,marginRight:4},children:[f.aspect,":"]}),n.map(e=>{/* @__PURE__ */return Ue("button",{type:"button",onClick:()=>$(e),style:(t=C===e,{...K,background:t?m.primary:m.bg,color:t?m.bg:m.text,borderColor:t?m.primary:m.border}),"aria-pressed":C===e,children:"free"===e?f.free:e},e);var t}),
400
+ /* @__PURE__ */Ue("div",{style:{width:1,height:24,background:m.border,margin:"0 4px"}}),
401
+ /* @__PURE__ */Ye("button",{type:"button",onClick:()=>M(e=>(e-90+360)%360),style:K,"aria-label":`${f.rotate} 90 degrees left`,children:["↺ ",f.rotate]}),
402
+ /* @__PURE__ */Ye("button",{type:"button",onClick:()=>M(e=>(e+90)%360),style:K,"aria-label":`${f.rotate} 90 degrees right`,children:["↻ ",f.rotate]})]}),
403
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:16,marginBottom:12,flexWrap:"wrap"},children:[/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[
404
+ /* @__PURE__ */Ue("span",{style:{minWidth:80},children:f.brightness}),
405
+ /* @__PURE__ */Ue("input",{type:"range",min:50,max:150,value:I,onChange:e=>D(Number(e.target.value)),"aria-label":f.brightness,style:{width:140}}),
406
+ /* @__PURE__ */Ye("span",{style:{minWidth:40,color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:[I,"%"]})]}),/* @__PURE__ */Ye("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13},children:[
407
+ /* @__PURE__ */Ue("span",{style:{minWidth:80},children:f.contrast}),
408
+ /* @__PURE__ */Ue("input",{type:"range",min:50,max:150,value:W,onChange:e=>L(Number(e.target.value)),"aria-label":f.contrast,style:{width:140}}),
409
+ /* @__PURE__ */Ye("span",{style:{minWidth:40,color:m.textMuted,fontVariantNumeric:"tabular-nums"},children:[W,"%"]})]})]}),
410
+ /* @__PURE__ */Ye("div",{style:{position:"relative",display:"inline-block",maxWidth:"100%",userSelect:"none",touchAction:"none"},children:[/* @__PURE__ */Ue("canvas",{ref:x,style:{display:"block",maxWidth:"100%"}}),U&&/* @__PURE__ */Ue("div",{role:"region","aria-label":"Crop area",style:{position:"absolute",left:U.left,top:U.top,width:U.width,height:U.height,border:`2px solid ${m.primary}`,boxShadow:`0 0 0 9999px ${m.bg}aa`,cursor:"move",touchAction:"none"},onMouseDown:H("move"),onTouchStart:H("move"),tabIndex:0,onKeyDown:e=>{const t=k;if(!t)return;const n=e.shiftKey?20:5;"ArrowLeft"===e.key?T(e=>({...e,x:Math.max(0,e.x-n)})):"ArrowRight"===e.key?T(e=>({...e,x:Math.min(t.w-e.w,e.x+n)})):"ArrowUp"===e.key?T(e=>({...e,y:Math.max(0,e.y-n)})):"ArrowDown"===e.key&&T(e=>({...e,y:Math.min(t.h-e.h,e.y+n)}))},children:["nw","ne","sw","se"].map(e=>/* @__PURE__ */Ue("div",{onMouseDown:H(e),onTouchStart:H(e),style:{position:"absolute",width:14,height:14,background:m.primary,border:`2px solid ${m.bg}`,borderRadius:2,cursor:`${e}-resize`,top:e.startsWith("n")?-7:void 0,bottom:e.startsWith("s")?-7:void 0,left:e.endsWith("w")?-7:void 0,right:e.endsWith("e")?-7:void 0,touchAction:"none"},"aria-hidden":"true"},e))})]}),
411
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,marginTop:16,justifyContent:"flex-end"},children:[d&&/* @__PURE__ */Ue("button",{type:"button",onClick:d,style:K,children:f.cancel}),/* @__PURE__ */Ue("button",{type:"button",onClick:async()=>{const e=await P();e&&s&&s(e)},style:{...K,background:m.primary,color:m.bg,borderColor:m.primary},children:f.apply})]})]}):/* @__PURE__ */Ue("div",{className:c,style:O,children:/* @__PURE__ */Ye("div",{style:V,onClick:()=>g.current?.click(),onDrop:e=>{e.preventDefault(),B(!1);const t=e.dataTransfer.files?.[0];t&&t.type.startsWith("image/")&&j(t)},onDragOver:e=>{e.preventDefault(),B(!0)},onDragLeave:()=>B(!1),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g.current?.click())},"aria-label":"Upload image to edit",children:[
412
+ /* @__PURE__ */Ue("div",{style:{fontSize:14,marginBottom:6},children:f.drop}),
413
+ /* @__PURE__ */Ue("button",{type:"button",style:{...K,color:m.primary,borderColor:m.primary},children:f.browse}),
414
+ /* @__PURE__ */Ue("input",{ref:g,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>{const t=e.target.files?.[0];t&&j(t)}})]})})});al.displayName="TkxImageEditor";var ll={razorpay:"https://checkout.razorpay.com/v1/checkout.js",stripe:"https://js.stripe.com/v3/",square:"https://web.squarecdn.com/v1/square.js"},sl={razorpay:"Razorpay",stripe:"Stripe",square:"Square"},dl=/^[A-Za-z0-9_-]{20,200}$/,cl={},ul=Te(function({config:e,onSuccess:t,onFailure:n,onDismiss:o,children:r,variant:i="primary",size:a="md",disabled:l,className:s,style:d},c){const u=N(),h=$e(),[p,f]=Ve(!1),m="razorpay"===e.provider||"stripe"===e.provider?e.publicKey:e.applicationId;dl.test(m);const g="sm"===a?13:"lg"===a?16:14,x="sm"===a?32:"lg"===a?48:40,y={padding:`${"sm"===a?6:"lg"===a?12:9}px ${"sm"===a?12:"lg"===a?22:16}px`,borderRadius:8,border:"outline"===i?`1.5px solid ${u.primary}`:"none",background:"outline"===i?"transparent":u.primary,color:"outline"===i?u.primary:u.bg,fontSize:g,fontWeight:600,cursor:l?"not-allowed":p?"progress":"pointer",opacity:l?.5:1,minHeight:x,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,transition:"opacity 0.15s, transform 0.05s",...d};/* @__PURE__ */
415
+ return Ue("button",{ref:c,type:"button",onClick:async()=>{if(!p&&!l){f(!0);try{if(await function(e){if("undefined"==typeof window)return Promise.resolve();if(window[sl[e]])return Promise.resolve();if(cl[e])return cl[e];const t=new Promise((t,n)=>{const o=document.querySelector(`script[data-tkx-payment="${e}"]`);if(o)return o.addEventListener("load",()=>t()),void o.addEventListener("error",()=>n(/* @__PURE__ */new Error("script-load-failed")));const r=document.createElement("script");r.src=ll[e],r.async=!0,r.dataset.tkxPayment=e,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(/* @__PURE__ */new Error("script-load-failed"))),document.head.appendChild(r)});return cl[e]=t,t}(e.provider),"razorpay"===e.provider){const r=window.Razorpay;if(!r)throw new Error("Razorpay script loaded but global missing");const i=new r({key:e.publicKey,amount:e.amount,currency:e.currency,order_id:e.orderId,name:j(e.brand?.name??"Payment"),description:j(e.brand?.description??""),image:e.brand?.image,prefill:e.prefill,notes:e.notes,theme:{color:e.themeColor??u.primary},handler:e=>{t({provider:"razorpay",paymentId:e.razorpay_payment_id,orderId:e.razorpay_order_id,signature:e.razorpay_signature,raw:e})},modal:{ondismiss:()=>{f(!1),o?.()}}});return i.on("payment.failed",e=>{f(!1),n?.({provider:"razorpay",code:e?.error?.code??"unknown",message:e?.error?.description??"Payment failed",raw:e})}),void i.open()}if("stripe"===e.provider){const t=window.Stripe;if(!t)throw new Error("Stripe script loaded but global missing");const o=await t(e.publicKey).redirectToCheckout({sessionId:e.sessionId});return void(o?.error&&(f(!1),n?.({provider:"stripe",code:o.error.code??"unknown",message:o.error.message??"Stripe checkout failed",raw:o})))}if("square"===e.provider){if(!window.Square)throw new Error("Square script loaded but global missing");const o={applicationId:e.applicationId,locationId:e.locationId,orderId:e.orderId,amount:e.amount,currency:e.currency,success:(n,o)=>t({provider:"square",paymentId:n,orderId:e.orderId,raw:o}),failure:(e,t,o)=>n?.({provider:"square",code:e,message:t,raw:o})};return void window.dispatchEvent(new CustomEvent("tkx-payment-square-init",{detail:o}))}}catch(r){f(!1),n?.({provider:e.provider,code:"sdk-load-failed",message:r?.message??"Unable to load payment SDK",raw:r})}}},disabled:l||p,"aria-busy":p,className:s,style:y,"data-tkx-payment-provider":e.provider,children:p?/* @__PURE__ */Ue("span",{"aria-hidden":"true",children:h.loading}):r??"Pay"})});ul.displayName="TkxPaymentButton";var hl=Te(function({label:e,width:t,height:n=180,strokeColor:o,strokeWidth:r=2,backgroundColor:i,onChange:a,disabled:l,className:s,style:d},c){const u=N(),h=$e(),p=Oe(null),f=Oe(null),m=Oe([]),g=Oe(null),x=Oe(1),[y,b]=Ve(t??320),v=o??u.text,w=i??u.surface;Fe(()=>{if(void 0!==t)return;const e=p.current;if(!e||"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(e=>{for(const t of e){const e=Math.floor(t.contentRect.width);e>0&&b(e)}});return n.observe(e),()=>n.disconnect()},[t]);const k=Ae(()=>{const e=f.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=x.current;t.fillStyle=w,t.fillRect(0,0,e.width,e.height),t.strokeStyle=v,t.lineWidth=r*n,t.lineCap="round",t.lineJoin="round";for(const o of m.current){if(o.length<2){1===o.length&&(t.beginPath(),t.arc(o[0].x*n,o[0].y*n,r*n/2,0,2*Math.PI),t.fillStyle=v,t.fill());continue}t.beginPath(),t.moveTo(o[0].x*n,o[0].y*n);for(let r=1;r<o.length-1;r++){const e=(o[r].x+o[r+1].x)/2,i=(o[r].y+o[r+1].y)/2;t.quadraticCurveTo(o[r].x*n,o[r].y*n,e*n,i*n)}const e=o[o.length-1];t.lineTo(e.x*n,e.y*n),t.stroke()}},[w,v,r]);Fe(()=>{const e=f.current;if(!e)return;const t=window.devicePixelRatio||1;x.current=t,e.width=y*t,e.height=n*t,e.style.width=`${y}px`,e.style.height=`${n}px`,k()},[y,n,k]);const S=e=>{const t=e.currentTarget.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},C=e=>{if(g.current){try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}g.current=null,a?.(f.current?.toDataURL("image/png")??"")}};je(c,()=>({clear:()=>{m.current=[],g.current=null,k(),a?.(f.current?.toDataURL("image/png")??"")},undo:()=>{m.current.pop(),k(),a?.(f.current?.toDataURL("image/png")??"")},isEmpty:()=>0===m.current.length,toDataURL:(e="image/png",t=.92)=>f.current?.toDataURL(e,t)??"",toBlob:(e="image/png",t=.92)=>new Promise(n=>{f.current?.toBlob(e=>n(e),e,t)})}),[k,a]);const $={display:"inline-flex",flexDirection:"column",gap:6,width:t??"100%",...d},z={fontSize:13,fontWeight:600,color:u.text},M={borderRadius:8,border:`1px solid ${u.border}`,background:w,cursor:l?"not-allowed":"crosshair",touchAction:"none",display:"block",width:"100%"};/* @__PURE__ */
416
+ return Ye("div",{ref:p,className:s,style:$,children:[e&&/* @__PURE__ */Ue("label",{style:z,children:e}),/* @__PURE__ */Ue("canvas",{ref:f,role:"img","aria-label":e??h.uploadFiles??"Signature pad",style:M,onPointerDown:e=>{l||(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),g.current=[S(e)],m.current.push(g.current))},onPointerMove:e=>{if(!g.current||l)return;e.preventDefault();const t=S(e),n=g.current,o=n[n.length-1];Math.abs(o.x-t.x)<1&&Math.abs(o.y-t.y)<1||(n.push(t),k())},onPointerUp:C,onPointerCancel:C})]})});hl.displayName="TkxSignaturePad";var pl=async(e,t)=>{const n=await fetch(`https://api.postalpincode.in/pincode/${e}`,{signal:t});if(!n.ok)throw new Error(`HTTP ${n.status}`);const o=await n.json();return Array.isArray(o)&&o[0]&&"Success"===o[0].Status&&o[0].PostOffice?o[0].PostOffice:[]},fl=/^\d{6}$/,ml=Te(function({value:e,onChange:t,lookup:n=pl,label:o,showAddressLines:r=!0,disabled:i,className:a,style:l},s){const d=N(),c=$e(),u=Ee(),[h,p]=Ve([]),[f,m]=Ve(!1),[g,x]=Ve(null);Fe(()=>{if(!e.pin||!fl.test(e.pin))return p([]),void x(null);const t=new AbortController;return m(!0),x(null),n(e.pin,t.signal).then(e=>{p(e),0===e.length&&x(c.noResults)}).catch(e=>{"AbortError"!==e?.name&&(x(e?.message||"Lookup failed"),p([]))}).finally(()=>m(!1)),()=>t.abort()},[e.pin]);const y=n=>{t({...e,pin:n.Pincode,postOffice:n.Name,city:n.District,state:n.State,country:n.Country}),p([])},b=(n,o)=>{t({...e,pin:e.pin??"",[n]:o})},v={display:"flex",flexDirection:"column",gap:8,width:"100%",...l},w={flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},k={width:"100%",padding:"8px 10px",border:`1px solid ${d.border}`,borderRadius:8,background:d.surface,color:d.text,fontSize:14,outline:"none",minHeight:40},S={border:`1px solid ${d.border}`,borderRadius:8,background:d.surface,maxHeight:200,overflow:"auto",padding:4},C={padding:"8px 10px",borderRadius:6,cursor:"pointer",fontSize:13,color:d.text},$={fontSize:12,color:d.textMuted};/* @__PURE__ */
417
+ return Ye("div",{className:a,style:v,children:[o&&/* @__PURE__ */Ue("label",{htmlFor:`${u}-pin`,style:{fontSize:13,fontWeight:600},children:o}),
418
+ /* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[
419
+ /* @__PURE__ */Ye("div",{style:{...w,flex:"0 0 140px"},children:[/* @__PURE__ */Ue("span",{style:$,children:"PIN code"}),/* @__PURE__ */Ue("input",{ref:s,id:`${u}-pin`,type:"text",inputMode:"numeric",maxLength:6,autoComplete:"postal-code",value:e.pin??"",onChange:n=>(n=>{const o=n.replace(/\D+/g,"").slice(0,6);t({...e,pin:o})})(n.target.value),disabled:i,"aria-busy":f,"aria-invalid":null!==g,style:k,placeholder:"000000"})]}),
420
+ /* @__PURE__ */Ye("div",{style:w,children:[/* @__PURE__ */Ue("span",{style:$,children:"City"}),/* @__PURE__ */Ue("input",{type:"text",autoComplete:"address-level2",value:e.city??"",onChange:n=>t({...e,city:n.target.value,pin:e.pin??""}),disabled:i,style:k})]}),
421
+ /* @__PURE__ */Ye("div",{style:w,children:[/* @__PURE__ */Ue("span",{style:$,children:"State"}),/* @__PURE__ */Ue("input",{type:"text",autoComplete:"address-level1",value:e.state??"",onChange:n=>t({...e,state:n.target.value,pin:e.pin??""}),disabled:i,style:k})]})]}),h.length>1&&/* @__PURE__ */Ue("div",{role:"listbox","aria-label":"Matching post offices",style:S,children:h.map(t=>/* @__PURE__ */Ye("div",{role:"option","aria-selected":e.postOffice===t.Name,onClick:()=>y(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),y(t))},tabIndex:0,style:{...C,background:e.postOffice===t.Name?d.surfaceAlt:"transparent"},children:[
422
+ /* @__PURE__ */Ue("strong",{children:t.Name})," ",
423
+ /* @__PURE__ */Ye("span",{style:{color:d.textMuted},children:["· ",t.District,", ",t.State]})]},`${t.Pincode}-${t.Name}`))}),g&&/* @__PURE__ */Ue("div",{role:"alert",style:{fontSize:12,color:d.danger},children:g}),r&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("input",{type:"text",autoComplete:"address-line1",placeholder:"Address line 1",value:e.line1??"",onChange:e=>b("line1",e.target.value),disabled:i,style:k}),/* @__PURE__ */Ue("input",{type:"text",autoComplete:"address-line2",placeholder:"Address line 2 (optional)",value:e.line2??"",onChange:e=>b("line2",e.target.value),disabled:i,style:k})]})]})});ml.displayName="TkxAddressInput";var gl=new Set(["JPY","KRW"]),xl=Te(function({value:e,onChange:t,currency:n="INR",locale:o,label:r,min:i,max:a,precision:l,required:s,disabled:d,showSymbol:c=!0,id:u,name:h,className:p,style:f},m){const g=N(),x=Ee(),y=u??x,b=o??function(e){return"INR"===e?"en-IN":"PKR"===e?"ur-PK":"BDT"===e?"bn-BD":"JPY"===e?"ja-JP":"KRW"===e?"ko-KR":"CNY"===e?"zh-CN":"undefined"!=typeof navigator&&navigator.language?navigator.language:"en-US"}(n),v=l??(gl.has(n)?0:2),w=He(()=>new Intl.NumberFormat(b,{minimumFractionDigits:0,maximumFractionDigits:v,useGrouping:!0}),[b,v]),k=He(()=>{try{return new Intl.NumberFormat(b,{style:"currency",currency:n,currencyDisplay:"narrowSymbol",minimumFractionDigits:0,maximumFractionDigits:0}).formatToParts(0).find(e=>"currency"===e.type)?.value??n}catch{return n}},[b,n]),S=null===e||Number.isNaN(e)?"":w.format(e),C=Ae(e=>{const n=e.replace(/[^\d.,\-]/g,""),o=w.format(1.5),r=o.includes(",")&&!o.includes(".")?",":".",l=n.replace(new RegExp(`[^\\d\\-${r}]`,"g"),"").replace(r,".");if(""===l||"-"===l)return void t(null);const s=Number(l);if(Number.isNaN(s))return;let d=s;void 0!==i&&d<i&&(d=i),void 0!==a&&d>a&&(d=a),t(d)},[w,i,a,t]),$={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:320,...f},z={display:"flex",alignItems:"stretch",border:`1px solid ${g.border}`,borderRadius:8,background:g.surface,overflow:"hidden"},M={display:"inline-flex",alignItems:"center",padding:"0 12px",borderRight:`1px solid ${g.border}`,color:g.textMuted,fontSize:14,fontVariantNumeric:"tabular-nums",background:g.bg},I={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:g.text,background:"transparent",minHeight:40,minWidth:0,textAlign:"right",fontVariantNumeric:"tabular-nums"};/* @__PURE__ */
424
+ return Ye("div",{className:p,style:$,children:[r&&/* @__PURE__ */Ye("label",{htmlFor:y,style:{fontSize:13,fontWeight:600,color:g.text},children:[r,s&&/* @__PURE__ */Ue("span",{style:{color:g.danger,marginLeft:4},"aria-hidden":"true",children:"*"})]}),/* @__PURE__ */Ye("div",{style:z,children:[c&&/* @__PURE__ */Ue("span",{style:M,"aria-hidden":"true",children:k}),/* @__PURE__ */Ue("input",{ref:m,id:y,name:h,type:"text",inputMode:v>0?"decimal":"numeric",value:S,onChange:e=>C(e.target.value),disabled:d,required:s,"aria-label":r??`Amount in ${n}`,style:I})]})]})});xl.displayName="TkxCurrencyInput";var yl=Te(function({items:e,onChange:t,renderItem:n,orientation:o="vertical",disabled:r,className:i,style:a,ariaLabel:l},s){const d=N(),c=Ee(),[u,h]=Ve(null),[p,f]=Ve(null),m=Oe(null),g=Ae((n,o)=>{if(n===o||n<0||o<0||o>=e.length)return;const r=[...e],[i]=r.splice(n,1);r.splice(o,0,i),t(r),m.current&&(m.current.textContent=`Moved item ${n+1} to position ${o+1}`)},[e,t]),x=e=>t=>{!r&&u&&(t.preventDefault(),t.dataTransfer.dropEffect="move",f(e))},y=()=>{h(null),f(null)},b=(t,n)=>t=>{if(r)return;const i="vertical"===o,a=i?"ArrowUp"===t.key:"ArrowLeft"===t.key,l=i?"ArrowDown"===t.key:"ArrowRight"===t.key;a&&n>0?(t.preventDefault(),g(n,n-1)):l&&n<e.length-1&&(t.preventDefault(),g(n,n+1))},v={display:"flex",flexDirection:"vertical"===o?"column":"row",gap:8,...a},w=e=>({cursor:r?"not-allowed":"grab",opacity:u===e?.5:1,transition:"opacity 0.15s, transform 0.05s",outline:p===e&&u!==e?`2px dashed ${d.primary}`:"none",outlineOffset:4,borderRadius:8});/* @__PURE__ */
425
+ return Ye(Ke,{children:[/* @__PURE__ */Ue("div",{ref:s,id:c,role:"list","aria-label":l??"Sortable list","aria-orientation":o,className:i,style:v,children:e.map((t,o)=>{/* @__PURE__ */return Ue("div",{role:"listitem",tabIndex:r?-1:0,draggable:!r,"data-tkx-sortable-handle":"true","aria-grabbed":u===t.id,"aria-posinset":o+1,"aria-setsize":e.length,onDragStart:(a=t.id,e=>{r||(h(a),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",a))}),onDragOver:x(t.id),onDragEnd:y,onDrop:(i=t.id,t=>{t.preventDefault(),!r&&u&&(g(e.findIndex(e=>e.id===u),e.findIndex(e=>e.id===i)),h(null),f(null))}),onKeyDown:b(t.id,o),style:w(t.id),children:n(t,o)},t.id);var i,a})}),/* @__PURE__ */Ue("div",{ref:m,role:"status","aria-live":"polite","aria-atomic":"true",style:{position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0}})]})});yl.displayName="TkxSortable";var bl=["#00f5d4","#7b2ff7","#f72585","#ffbe0b","#06d6a0","#3a86ff"],vl=Te(function({trigger:e,particleCount:t=80,spread:n=60,origin:o,colors:r=bl,zIndex:i=9999,className:a,style:l},s){const d=Oe(null),c=Oe([]),u=Oe(null),h=ge(),p=Ae(()=>{const e=d.current;if(!e)return;const t=window.devicePixelRatio||1;e.width=window.innerWidth*t,e.height=window.innerHeight*t,e.style.width="100vw",e.style.height="100vh";const n=e.getContext("2d");n&&n.scale(t,t)},[]);Fe(()=>(p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)),[p]);const f=Ae(()=>{const e=d.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const n=window.devicePixelRatio||1;t.clearRect(0,0,e.width/n,e.height/n);const o=c.current;for(const r of o)t.save(),t.globalAlpha=r.alpha,t.translate(r.x,r.y),t.rotate(r.rot*Math.PI/180),t.fillStyle=r.color,t.fillRect(-r.size/2,-r.size/4,r.size,r.size/2),t.restore()},[]),m=Ae(()=>{const e=c.current;let t=!1;for(const n of e)n.ttl<=0||(n.x+=n.vx,n.y+=n.vy,n.vy+=.18,n.vx*=.99,n.rot+=n.vRot,n.ttl-=1,n.ttl<30&&(n.alpha=n.ttl/30),t=!0);e.length>1e3&&(c.current=e.filter(e=>e.ttl>0)),f(),u.current=t?requestAnimationFrame(m):null},[f]),g=Ae(e=>{if(!d.current)return;const i=e?.x??o?.x??window.innerWidth/2,a=e?.y??o?.y??window.innerHeight/3,l=[];for(let o=0;o<t;o++){const e=((Math.random()-.5)*n-90)*(Math.PI/180),t=6+6*Math.random();l.push({x:i,y:a,vx:Math.cos(e)*t,vy:Math.sin(e)*t,rot:360*Math.random(),vRot:14*(Math.random()-.5),size:6+6*Math.random(),color:r[Math.floor(Math.random()*r.length)],alpha:1,ttl:90+Math.floor(30*Math.random())})}if(c.current.push(...l),h)return f(),void window.setTimeout(()=>{c.current=[],f()},1500);null===u.current&&(u.current=requestAnimationFrame(m))},[t,n,o,r,h,m,f]);return je(s,()=>({fire:g}),[g]),Fe(()=>{e&&g()},[e]),Fe(()=>()=>{null!==u.current&&cancelAnimationFrame(u.current)},[]),/* @__PURE__ */Ue("canvas",{ref:d,"aria-hidden":"true",className:a,style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:i,...l}})});vl.displayName="TkxConfetti";var wl="data-tkx-seo";function kl(){"undefined"!=typeof document&&document.querySelectorAll(`[${wl}]`).forEach(e=>e.remove())}function Sl(e,t,n="name"){if("undefined"==typeof document||!t)return;const o=document.createElement("meta");o.setAttribute(n,e),o.content=t,o.setAttribute(wl,"1"),document.head.appendChild(o)}function Cl({title:e,description:t,canonical:n,keywords:o,image:r,twitterSite:i,twitterCreator:a,ogType:l="website",locale:s,robots:d="index, follow, max-snippet:-1, max-image-preview:large",schema:c}){return Fe(()=>{if("undefined"!=typeof document)return kl(),e&&(document.title=e),t&&Sl("description",t),o&&Sl("keywords",o),Sl("robots",d),e&&Sl("og:title",e,"property"),t&&Sl("og:description",t,"property"),Sl("og:type",l,"property"),n&&Sl("og:url",n,"property"),r&&(Sl("og:image",r,"property"),Sl("og:image:width","1200","property"),Sl("og:image:height","630","property")),s&&Sl("og:locale",s,"property"),Sl("twitter:card",r?"summary_large_image":"summary"),e&&Sl("twitter:title",e),t&&Sl("twitter:description",t),r&&Sl("twitter:image",r),i&&Sl("twitter:site",i),a&&Sl("twitter:creator",a),n&&function(e,t){if("undefined"==typeof document||!t)return;const n=document.createElement("link");n.rel="canonical",n.href=t,n.setAttribute(wl,"1"),document.head.appendChild(n)}(0,n),c&&function(e){if("undefined"==typeof document)return;const t=Array.isArray(e)?e:[e];for(const n of t){const e=document.createElement("script");e.type="application/ld+json",e.text=JSON.stringify(n),e.setAttribute(wl,"1"),document.head.appendChild(e)}}(c),()=>kl()},[e,t,n,o,r,i,a,l,s,d,c]),null}var $l={softwareApplication:e=>({"@context":"https://schema.org","@type":"SoftwareApplication",name:e.name,description:e.description,url:e.url,applicationCategory:"DeveloperApplication",operatingSystem:"Web",...e.version&&{softwareVersion:e.version,version:e.version},...e.license&&{license:e.license},...e.repository&&{codeRepository:e.repository},...e.downloadUrl&&{downloadUrl:e.downloadUrl},...void 0!==e.price&&{offers:{"@type":"Offer",price:e.price,priceCurrency:e.currency??"USD"}}}),article:e=>({"@context":"https://schema.org","@type":"Article",headline:e.headline,description:e.description,mainEntityOfPage:e.url,...e.image&&{image:e.image},author:{"@type":"Person",name:e.author},datePublished:e.datePublished,...e.dateModified&&{dateModified:e.dateModified}}),faqPage:e=>({"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))}),breadcrumbList:e=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((e,t)=>({"@type":"ListItem",position:t+1,name:e.name,item:e.url}))}),product:e=>({"@context":"https://schema.org","@type":"Product",name:e.name,description:e.description,image:e.image,brand:{"@type":"Brand",name:e.brand},...e.sku&&{sku:e.sku},offers:{"@type":"Offer",price:e.price,priceCurrency:e.currency,availability:`https://schema.org/${e.availability??"InStock"}`},...e.rating&&{aggregateRating:{"@type":"AggregateRating",ratingValue:e.rating.value,reviewCount:e.rating.count}}})},zl=["Pratipada","Dwitiya","Tritiya","Chaturthi","Panchami","Shashthi","Saptami","Ashtami","Navami","Dashami","Ekadashi","Dwadashi","Trayodashi","Chaturdashi","Purnima","Pratipada","Dwitiya","Tritiya","Chaturthi","Panchami","Shashthi","Saptami","Ashtami","Navami","Dashami","Ekadashi","Dwadashi","Trayodashi","Chaturdashi","Amavasya"],Nl=["Ashwini","Bharani","Krittika","Rohini","Mrigashira","Ardra","Punarvasu","Pushya","Ashlesha","Magha","Purva Phalguni","Uttara Phalguni","Hasta","Chitra","Swati","Vishakha","Anuradha","Jyeshtha","Mula","Purva Ashadha","Uttara Ashadha","Shravana","Dhanishtha","Shatabhisha","Purva Bhadrapada","Uttara Bhadrapada","Revati"];function Ml(e,t,n){try{return{gregorian:e,display:new Intl.DateTimeFormat(`${t}-u-ca-${n}`,{day:"numeric",month:"long",year:"numeric"}).format(e)}}catch{return{gregorian:e,display:e.toISOString().slice(0,10)}}}function Il(e,t,n,o){switch(t){case"hindu":return function(e,t,n){const{tithi:o,nakshatra:r}=n?n(e):function(e){const t=function(e){return e.getTime()/864e5-10957.5}(e),n=function(e){return(280.46+.9856474*e)%360}(t),o=function(e){return(218.316+13.176396*e)%360}(t);let r=(o-n+360)%360;const i=Math.floor(r/12)+1,a=Math.floor(o%360/(360/27))+1;return{tithi:Math.max(1,Math.min(30,i)),nakshatra:a}}(e);return{gregorian:e,display:`${new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(e)} · ${o<=15?"Shukla":"Krishna"} ${zl[o-1]} · ${Nl[r-1]}`,tithi:o,nakshatra:r}}(e,n,o);case"hijri":return Ml(e,n,"islamic-civil");case"hebrew":return Ml(e,n,"hebrew");case"buddhist":return Ml(e,n,"buddhist");default:return function(e,t){return{gregorian:e,display:new Intl.DateTimeFormat(t,{dateStyle:"long"}).format(e)}}(e,n)}}var Dl=Te(function({value:e,onChange:t,calendar:n="gregorian",locale:o,tithiResolver:r,label:i,minDate:a,maxDate:l,disabled:s,className:d,style:c},u){const h=N(),p=$e(),f=o??("undefined"!=typeof navigator?navigator.language:"en-US"),[m,g]=Ve(!1),x=He(()=>e?Il(e,n,f,r).display:"",[e,n,f,r]),y={display:"inline-flex",flexDirection:"column",gap:6,width:"100%",maxWidth:360,...c},b={display:"flex",alignItems:"stretch",border:`1px solid ${h.border}`,borderRadius:8,background:h.surface,overflow:"hidden"},v={flex:1,border:"none",outline:"none",padding:"0 12px",fontSize:14,color:h.text,background:"transparent",minHeight:40,minWidth:0};/* @__PURE__ */
426
+ return Ye("div",{className:d,style:y,children:[i&&/* @__PURE__ */Ue("label",{style:{fontSize:13,fontWeight:600,color:h.text},children:i}),
427
+ /* @__PURE__ */Ye("div",{style:b,children:[/* @__PURE__ */Ue("input",{ref:u,type:"text",readOnly:!0,value:x,onClick:()=>!s&&g(!0),onFocus:()=>!s&&g(!0),disabled:s,placeholder:p.selectDate,"aria-label":i??p.selectDate,style:v}),/* @__PURE__ */Ue("input",{type:"date",value:e?e.toISOString().slice(0,10):"",onChange:e=>(e=>{if(!e)return;const o=/* @__PURE__ */new Date(`${e}T00:00:00`);Number.isNaN(o.getTime())||a&&o<a||l&&o>l||(t(Il(o,n,f,r)),g(!1))})(e.target.value),min:a?a.toISOString().slice(0,10):void 0,max:l?l.toISOString().slice(0,10):void 0,disabled:s,"aria-hidden":"true",tabIndex:-1,style:{width:36,border:"none",borderLeft:`1px solid ${h.border}`,padding:0,background:h.bg,color:h.text,cursor:s?"not-allowed":"pointer"}})]}),m&&e&&"gregorian"!==n&&/* @__PURE__ */Ye("div",{role:"status",style:{padding:"6px 10px",borderRadius:6,background:h.surfaceAlt,fontSize:12,color:h.textMuted},children:[
428
+ /* @__PURE__ */Ye("strong",{style:{color:h.text},children:[n,":"]})," ",x]})]})});Dl.displayName="TkxCalendarLunar";var Wl=Te(function({items:e,currency:t,locale:n,taxRate:o=0,shipping:r=0,paymentConfigFor:i,onComplete:a,onCancel:l,initialAddress:s={},className:d,style:c},u){const h=N(),p=$e(),[f,m]=Ve("address"),[g,x]=Ve(s),[y,b]=Ve(null),[v,w]=Ve(null),k=e.reduce((e,t)=>e+t.quantity*t.unitPrice,0),S=k*o,C=k+S+r,$=e=>{try{return new Intl.NumberFormat(n??"en-IN",{style:"currency",currency:t}).format(e)}catch{return`${t} ${e.toFixed(2)}`}},z=Boolean(g.pin&&6===g.pin.length&&g.line1&&g.city),M={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 320px",gap:24,maxWidth:960,width:"100%",...c},I={border:`1px solid ${h.border}`,borderRadius:12,padding:20,background:h.surface},D={...I,position:"sticky",top:16,height:"fit-content"},W={fontSize:11,fontWeight:600,letterSpacing:"0.05em",textTransform:"uppercase",color:h.textMuted,marginBottom:12};/* @__PURE__ */
429
+ return Ye("div",{ref:u,className:d,style:M,children:[/* @__PURE__ */Ye("div",{style:I,children:[
430
+ /* @__PURE__ */Ye("div",{style:W,children:["Step ","address"===f?1:"payment"===f?2:3," of 3"]}),"address"===f&&/* @__PURE__ */Ye(Ke,{children:[
431
+ /* @__PURE__ */Ue("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Shipping address"}),
432
+ /* @__PURE__ */Ue(ml,{value:g,onChange:x}),v&&/* @__PURE__ */Ue("div",{role:"alert",style:{marginTop:12,fontSize:13,color:h.danger},children:v}),
433
+ /* @__PURE__ */Ye("div",{style:{marginTop:20,display:"flex",justifyContent:"flex-end",gap:8},children:[l&&/* @__PURE__ */Ue("button",{type:"button",onClick:l,style:{padding:"8px 14px",borderRadius:6,border:`1px solid ${h.border}`,background:"transparent",color:h.text,cursor:"pointer",fontSize:13,fontWeight:600},children:p.cancel}),/* @__PURE__ */Ue("button",{type:"button",onClick:async()=>{if(z){w(null);try{b(await i(g)),m("payment")}catch(e){w(e?.message??"Could not initialise payment")}}else w(p.fieldRequired??"Address incomplete")},disabled:!z,style:{padding:"8px 14px",borderRadius:6,border:"none",background:z?h.primary:h.border,color:z?h.bg:h.textMuted,cursor:z?"pointer":"not-allowed",fontSize:13,fontWeight:600,minHeight:36},children:"Continue to payment"})]})]}),"payment"===f&&y&&/* @__PURE__ */Ye(Ke,{children:[
434
+ /* @__PURE__ */Ue("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Payment"}),
435
+ /* @__PURE__ */Ye("p",{style:{margin:"0 0 16px",color:h.textMuted,fontSize:14},children:["Total ",/* @__PURE__ */Ue("strong",{style:{color:h.text,fontSize:18},children:$(C)})]}),
436
+ /* @__PURE__ */Ye(ul,{config:y,onSuccess:e=>{m("confirm"),a({address:g,payment:e})},onFailure:e=>{w(e.message)},size:"lg",children:["Pay ",$(C)]}),v&&/* @__PURE__ */Ue("div",{role:"alert",style:{marginTop:12,fontSize:13,color:h.danger},children:v}),
437
+ /* @__PURE__ */Ue("div",{style:{marginTop:20},children:/* @__PURE__ */Ue("button",{type:"button",onClick:()=>m("address"),style:{padding:"6px 10px",border:"none",background:"transparent",color:h.textMuted,cursor:"pointer",fontSize:13},children:"← Back to address"})})]}),"confirm"===f&&/* @__PURE__ */Ye(Ke,{children:[/* @__PURE__ */Ue("h2",{style:{margin:"0 0 16px",fontSize:20,fontWeight:700},children:"Order confirmed"}),/* @__PURE__ */Ue("p",{style:{color:h.textMuted,fontSize:14,lineHeight:1.6},children:"Thank you. A receipt has been emailed to you. Your order will ship shortly."})]})]}),/* @__PURE__ */Ye("div",{style:D,children:[
438
+ /* @__PURE__ */Ue("div",{style:W,children:"Order summary"}),e.map(e=>/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",padding:"6px 0",fontSize:13},children:[/* @__PURE__ */Ye("span",{style:{color:h.text},children:[e.label," ",
439
+ /* @__PURE__ */Ye("span",{style:{color:h.textMuted},children:["×",e.quantity]})]}),/* @__PURE__ */Ue("span",{style:{color:h.text,fontVariantNumeric:"tabular-nums"},children:$(e.quantity*e.unitPrice)})]},e.id)),
440
+ /* @__PURE__ */Ue("hr",{style:{margin:"12px 0",border:0,borderTop:`1px solid ${h.border}`}}),o>0&&/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:h.textMuted},children:[/* @__PURE__ */Ye("span",{children:["Tax (",(100*o).toFixed(0),"%)"]}),/* @__PURE__ */Ue("span",{children:$(S)})]}),r>0&&/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13,color:h.textMuted},children:[/* @__PURE__ */Ue("span",{children:"Shipping"}),/* @__PURE__ */Ue("span",{children:$(r)})]}),
441
+ /* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",marginTop:12,paddingTop:12,borderTop:`2px solid ${h.text}`,fontSize:16,fontWeight:700},children:[/* @__PURE__ */Ue("span",{children:"Total"}),/* @__PURE__ */Ue("span",{children:$(C)})]})]})]})});Wl.displayName="TkxCheckout";var Ll=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],Rl=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]];function Tl(e){const t=e.replace(/\D+/g,"");if(12!==t.length)return!1;let n=0;const o=t.split("").reverse();for(let r=0;r<o.length;r++)n=Ll[n][Rl[r%8][parseInt(o[r],10)]];return 0===n}function Al(e){const t=e.replace(/\D+/g,"").slice(0,12);return[t.slice(0,4),t.slice(4,8),t.slice(8,12)].filter(Boolean).join(" ")}function Bl(e){const t=e.replace(/\D+/g,"").slice(0,12);return 0===t.length?"":t.length<=8?"X".repeat(t.length).match(/.{1,4}/g).join(" "):`XXXX XXXX ${t.slice(8,12)}`}var Fl=Te(function({value:e,defaultValue:t,onChange:n,label:o,mask:r=!0,disabled:i,required:a,id:l,name:s,className:d,style:c},u){const h=N(),p=$e(),f=Ee(),m=l??f,g=void 0!==e,[x,y]=Ve(()=>(t??"").replace(/\D+/g,"").slice(0,12)),b=g?(e??"").replace(/\D+/g,"").slice(0,12):x,v=r?Bl(b):Al(b),w=Tl(b),k={fontSize:13,fontWeight:600,color:h.text},S={width:"100%",padding:"0 12px",border:`1px solid ${12!==b.length||w?h.border:h.danger}`,borderRadius:8,background:h.surface,color:h.text,fontSize:14,minHeight:40,outline:"none",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",letterSpacing:1.5};/* @__PURE__ */
442
+ return Ye("div",{className:d,style:{display:"flex",flexDirection:"column",gap:6,...c},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:m,style:k,children:[o,a&&/* @__PURE__ */Ue("span",{style:{color:h.danger,marginLeft:4},children:"*"})]}),
443
+ /* @__PURE__ */Ue("input",{ref:u,id:m,name:s,type:"text",inputMode:"numeric",autoComplete:"off",maxLength:14,value:v,onChange:e=>(e=>{const t=e.replace(/\D+/g,"").slice(0,12);g||y(t),n?.({raw:Al(t),digits:t,display:r?Bl(t):Al(t),valid:Tl(t)})})(e.target.value),disabled:i,required:a,"aria-invalid":12===b.length&&!w,"aria-describedby":12!==b.length||w?void 0:`${m}-err`,style:S,placeholder:"XXXX XXXX XXXX"}),12===b.length&&!w&&/* @__PURE__ */Ue("div",{id:`${m}-err`,role:"alert",style:{fontSize:12,color:h.danger},children:p.invalidFormat??"Invalid Aadhaar — checksum mismatch."}),b.length>0&&b.length<12&&/* @__PURE__ */Ye("div",{style:{fontSize:12,color:h.textMuted},children:[12-b.length," digit",12-b.length==1?"":"s"," remaining"]})]})});Fl.displayName="TkxAadhaarInput";var El=/^[A-Z]{5}[0-9]{4}[A-Z]$/;function jl(e){const t=e.toUpperCase().trim();return!!El.test(t)&&"PFCHATBLJG".includes(t[3])}var Hl=Te(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=N(),h=$e(),p=Ee(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase().slice(0,10)),y=(m?e??"":g).toUpperCase().slice(0,10),b=jl(y);/* @__PURE__ */
444
+ return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ue("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
445
+ /* @__PURE__ */Ue("input",{ref:c,id:f,name:l,type:"text",inputMode:"text",autoComplete:"off",maxLength:10,value:y,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);m||x(t),n?.({raw:e,normalised:t,valid:jl(t)})})(e.target.value),disabled:r,required:i,"aria-invalid":10===y.length&&!b,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==y.length||b?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:2,outline:"none",textTransform:"uppercase"},placeholder:"ABCDE1234F"}),10===y.length&&!b&&/* @__PURE__ */Ue("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid PAN format."})]})});Hl.displayName="TkxPanInput";var Pl=/^[A-Z]{3}[0-9]{7}$/;function Ol(e){const t=e.toUpperCase().trim();return Pl.test(t)}var Vl=Te(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=N(),h=$e(),p=Ee(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase().slice(0,10)),y=(m?e??"":g).toUpperCase().slice(0,10),b=Ol(y);/* @__PURE__ */
446
+ return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ue("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
447
+ /* @__PURE__ */Ue("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:10,value:y,onChange:e=>(e=>{const t=e.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,10);m||x(t),n?.({raw:e,normalised:t,valid:Ol(t)})})(e.target.value),disabled:r,required:i,"aria-invalid":10===y.length&&!b,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${10!==y.length||b?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.5,outline:"none",textTransform:"uppercase"},placeholder:"ABC1234567"}),10===y.length&&!b&&/* @__PURE__ */Ue("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Voter ID format."})]})});Vl.displayName="TkxVoterIdInput";var Kl=15;function Ul(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return t.length===Kl&&/^[A-Z]{2}[0-9]{13}$/.test(t)}function Yl(e){const t=e.toUpperCase().replace(/[\s-]/g,"");return 0===t.length?"":[t.slice(0,2),t.slice(2,4),t.slice(4,8),t.slice(8)].filter(Boolean).join("-")}var Xl=Te(function({value:e,defaultValue:t,onChange:n,label:o,disabled:r,required:i,id:a,name:l,className:s,style:d},c){const u=N(),h=$e(),p=Ee(),f=a??p,m=void 0!==e,[g,x]=Ve((t??"").toUpperCase()),y=m?e??"":g,b=y.toUpperCase().replace(/[\s-]/g,"").slice(0,Kl),v=Ul(b);/* @__PURE__ */
448
+ return Ye("div",{className:s,style:{display:"flex",flexDirection:"column",gap:6,...d},children:[o&&/* @__PURE__ */Ye("label",{htmlFor:f,style:{fontSize:13,fontWeight:600,color:u.text},children:[o,i&&/* @__PURE__ */Ue("span",{style:{color:u.danger,marginLeft:4},children:"*"})]}),
449
+ /* @__PURE__ */Ue("input",{ref:c,id:f,name:l,type:"text",autoComplete:"off",maxLength:20,value:y,onChange:e=>(e=>{const t=e.toUpperCase();m||x(t);const o=t.replace(/[\s-]/g,"").slice(0,Kl);n?.({raw:e,normalised:o,pretty:Yl(o),valid:Ul(o)})})(e.target.value),disabled:r,required:i,"aria-invalid":b.length===Kl&&!v,style:{width:"100%",padding:"0 12px",minHeight:40,border:`1px solid ${b.length!==Kl||v?u.border:u.danger}`,borderRadius:8,background:u.surface,color:u.text,fontSize:14,fontFamily:"ui-monospace, monospace",letterSpacing:1.2,outline:"none",textTransform:"uppercase"},placeholder:"MH-12-2010-0012345"}),b.length===Kl&&!v&&/* @__PURE__ */Ue("div",{role:"alert",style:{fontSize:12,color:u.danger},children:h.invalidFormat??"Invalid Driving Licence format."})]})});function ql(e,t,n){try{return new Intl.NumberFormat(n??"en-US",{style:"currency",currency:t,maximumFractionDigits:e%1==0?0:2}).format(e)}catch{return`${t} ${e.toFixed(2)}`}}Xl.displayName="TkxDrivingLicenceInput";var _l=Te(function({plans:e,cycle:t,selectedId:n,onSelect:o,className:r,style:i},a){const l=N();/* @__PURE__ */
450
+ return Ue("div",{ref:a,className:r,style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:16,...i},role:"radiogroup","aria-label":"Plans",children:e.map(e=>{const r=e.id===n;/* @__PURE__ */
451
+ return Ye("button",{type:"button",role:"radio","aria-checked":r,disabled:e.disabled,onClick:()=>!e.disabled&&o?.(e),style:{position:"relative",padding:20,borderRadius:12,border:`${e.highlighted?2:1}px solid ${r||e.highlighted?l.primary:l.border}`,background:l.surface,color:l.text,textAlign:"left",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1,transition:"border-color 0.15s, transform 0.05s",fontFamily:"inherit",fontSize:"inherit",width:"100%"},children:[e.highlighted&&/* @__PURE__ */Ue("span",{style:{position:"absolute",top:-10,right:16,background:l.primary,color:l.bg,fontSize:11,fontWeight:700,padding:"2px 8px",borderRadius:4,letterSpacing:.4,textTransform:"uppercase"},"aria-hidden":"true",children:"Most popular"}),
452
+ /* @__PURE__ */Ue("div",{style:{fontSize:12,fontWeight:700,color:l.textMuted,textTransform:"uppercase",letterSpacing:.5},children:e.name}),e.tagline&&/* @__PURE__ */Ue("div",{style:{fontSize:12,color:l.textMuted,marginTop:2},children:e.tagline}),
453
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"baseline",gap:4,marginTop:12},children:[/* @__PURE__ */Ue("span",{style:{fontSize:32,fontWeight:800,color:l.text},children:ql(e.prices[t],e.currency,e.locale)}),/* @__PURE__ */Ye("span",{style:{fontSize:12,color:l.textMuted},children:["/ ","monthly"===t?"mo":"yr"]})]}),
454
+ /* @__PURE__ */Ue("ul",{style:{listStyle:"none",padding:0,margin:"16px 0 0",fontSize:13,lineHeight:1.7},children:e.features.map(e=>/* @__PURE__ */Ye("li",{style:{display:"flex",gap:6,alignItems:"flex-start",color:l.text},children:[/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{color:l.success},children:"✓"}),/* @__PURE__ */Ue("span",{children:e})]},e))}),
455
+ /* @__PURE__ */Ue("div",{style:{marginTop:16,padding:"8px 12px",borderRadius:6,background:r?l.primary:"transparent",color:r?l.bg:l.primary,border:`1px solid ${l.primary}`,textAlign:"center",fontWeight:600,fontSize:13},children:e.ctaLabel??(r?"Selected":`Choose ${e.name}`)})]},e.id)})})});function Zl({value:e,onChange:t,annualSavingsLabel:n,className:o,style:r}){const i=N(),a={display:"inline-flex",alignItems:"center",gap:8,padding:4,border:`1px solid ${i.border}`,borderRadius:999,background:i.surface,...r},l=e=>({padding:"6px 16px",borderRadius:999,fontSize:13,fontWeight:600,background:e?i.primary:"transparent",color:e?i.bg:i.text,border:"none",cursor:"pointer",transition:"background 0.15s, color 0.15s",display:"inline-flex",alignItems:"center",gap:6});/* @__PURE__ */
456
+ return Ye("div",{role:"radiogroup","aria-label":"Billing cycle",className:o,style:a,children:[/* @__PURE__ */Ue("button",{type:"button",role:"radio","aria-checked":"monthly"===e,onClick:()=>t("monthly"),style:l("monthly"===e),children:"Monthly"}),/* @__PURE__ */Ye("button",{type:"button",role:"radio","aria-checked":"annual"===e,onClick:()=>t("annual"),style:l("annual"===e),children:["Annual",n&&/* @__PURE__ */Ue("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:4,background:"annual"===e?i.bg:i.success,color:"annual"===e?i.success:i.bg,fontWeight:700},children:n})]})]})}function Gl({newPlan:e,currentPlan:t,cycle:n,daysRemaining:o,cycleDays:r,className:i,style:a,children:l}){const s=N(),d=r>0?o/r:0,c=t.prices[n]*d,u=e.prices[n]*d,h=Math.max(0,u-c),p=Math.max(0,c-u),f={border:`1px solid ${s.border}`,borderRadius:12,padding:20,background:s.surface,...a},m={display:"flex",justifyContent:"space-between",fontSize:13,padding:"6px 0"},g=t=>ql(t,e.currency,e.locale);/* @__PURE__ */
457
+ return Ye("div",{className:i,style:f,children:[
458
+ /* @__PURE__ */Ue("div",{style:{fontSize:12,fontWeight:700,color:s.textMuted,textTransform:"uppercase",letterSpacing:.5,marginBottom:12},children:"Plan change"}),
459
+ /* @__PURE__ */Ye("div",{style:{...m,color:s.textMuted},children:[
460
+ /* @__PURE__ */Ye("span",{children:["From ",/* @__PURE__ */Ue("strong",{style:{color:s.text},children:t.name})]}),
461
+ /* @__PURE__ */Ue("span",{children:"→"}),
462
+ /* @__PURE__ */Ye("span",{children:["To ",/* @__PURE__ */Ue("strong",{style:{color:s.primary},children:e.name})]})]}),
463
+ /* @__PURE__ */Ue("hr",{style:{border:0,borderTop:`1px solid ${s.border}`,margin:"8px 0"}}),
464
+ /* @__PURE__ */Ye("div",{style:{...m,color:s.textMuted},children:[/* @__PURE__ */Ue("span",{children:"Days remaining in cycle"}),/* @__PURE__ */Ye("span",{children:[o," / ",r]})]}),
465
+ /* @__PURE__ */Ye("div",{style:{...m,color:s.textMuted},children:[/* @__PURE__ */Ye("span",{children:["Credit from ",t.name]}),/* @__PURE__ */Ye("span",{children:["−",g(c)]})]}),
466
+ /* @__PURE__ */Ye("div",{style:{...m,color:s.textMuted},children:[/* @__PURE__ */Ye("span",{children:["Charge for ",e.name," (prorated)"]}),/* @__PURE__ */Ue("span",{children:g(u)})]}),
467
+ /* @__PURE__ */Ue("hr",{style:{border:0,borderTop:`1px solid ${s.border}`,margin:"8px 0"}}),/* @__PURE__ */Ye("div",h>0?{style:{...m,fontSize:16,fontWeight:700},children:[/* @__PURE__ */Ue("span",{style:{color:s.text},children:"Due today"}),/* @__PURE__ */Ue("span",{style:{color:s.primary},children:g(h)})]}:{style:{...m,fontSize:14,color:s.success},children:[/* @__PURE__ */Ue("span",{children:"Credit applied at next billing"}),/* @__PURE__ */Ue("span",{children:g(p)})]}),
468
+ /* @__PURE__ */Ue("div",{style:{...m,color:s.textMuted,fontSize:12,marginTop:6},children:/* @__PURE__ */Ye("span",{children:["Then ",g(e.prices[n])," / ","monthly"===n?"month":"year"]})}),l&&/* @__PURE__ */Ue("div",{style:{marginTop:16},children:l})]})}function Jl(e,t,n,o,r){if("vertical"===r){const r=e.x+n/2,i=e.y+o,a=t.x+n/2,l=t.y,s=(i+l)/2;return`M${r},${i} C${r},${s} ${a},${s} ${a},${l}`}const i=e.x+n,a=e.y+o/2,l=t.x,s=t.y+o/2,d=(i+l)/2;return`M${i},${a} C${d},${a} ${d},${s} ${l},${s}`}function Ql({node:e,w:t,h:n,isActive:o,theme:r}){const i=e.accent??r.primary,a=function(e){if(!e)return;const t=e.trim();return!t||/^javascript:/i.test(t)||/^vbscript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)?void 0:t}(e.avatar),l=j(e.label),s=e.subLabel?j(e.subLabel):"",d=e.badge?j(e.badge):"";/* @__PURE__ */
384
469
  return Ye("div",{style:{width:t,height:n,boxSizing:"border-box",background:r.surface,border:`1.5px solid ${o?i:r.border}`,borderRadius:12,padding:"10px 12px",display:"flex",alignItems:"center",gap:10,boxShadow:o?`0 8px 24px -8px ${i}66`:`0 2px 8px -4px ${r.border}88`,transition:"border-color 0.15s ease, box-shadow 0.15s ease",overflow:"hidden"},children:[
385
- /* @__PURE__ */Ve("div",{style:{width:40,height:40,minWidth:40,borderRadius:"50%",overflow:"hidden",background:`${i}22`,color:i,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,border:`1.5px solid ${i}44`},"aria-hidden":"true",children:l?/* @__PURE__ */Ve("img",{src:l,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",style:{width:"100%",height:"100%",objectFit:"cover"}}):a.slice(0,2).toUpperCase()}),
386
- /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ve("div",{style:{fontSize:13.5,fontWeight:700,color:r.text,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),s&&/* @__PURE__ */Ve("div",{style:{fontSize:11.5,color:r.textMuted,lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:1},children:s})]}),d&&/* @__PURE__ */Ve("span",{style:{fontSize:10,fontWeight:700,padding:"3px 7px",borderRadius:999,color:i,background:`${i}18`,border:`1px solid ${i}33`,letterSpacing:"0.04em",textTransform:"uppercase",flexShrink:0},children:d})]})}function Fl({collapsed:e,onClick:t,theme:n,direction:o,w:r,h:i}){const l={position:"absolute",..."vertical"===o?{left:r/2-10,top:i-10}:{left:r-10,top:i/2-10},width:20,height:20,borderRadius:"50%",background:n.surfaceAlt,border:`1.5px solid ${n.border}`,color:n.text,fontSize:12,fontWeight:700,cursor:"pointer",padding:0,lineHeight:1,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"};/* @__PURE__ */
387
- return Ve("button",{type:"button","aria-label":e?"Expand subtree":"Collapse subtree","aria-expanded":!e,onClick:e=>{e.stopPropagation(),t(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.stopPropagation(),t(e))},style:l,children:e?"+":"−"})}function El({data:e,direction:t="vertical",interactive:n=!0,initialZoom:o=1,nodeWidth:r=200,nodeHeight:i=84,siblingGap:l=28,levelGap:a=64,onNodeClick:s,renderNode:d,collapsedByDefault:c=!1,height:u=560,ariaLabel:h="Organization chart",className:p,style:f}){const m=b(),g=je(null),x=je(null),[y,v]=Oe(()=>{if(!c)/* @__PURE__ */return new Set;const t=/* @__PURE__ */new Set;return function n(o){o.id!==e.id&&t.add(o.id),(o.children??[]).forEach(n)}(e),t}),[w,k]=Oe(Hl(o)),[C,S]=Oe({x:0,y:0}),[$,z]=Oe(e.id),N=Ee(()=>function(e,t,n){const{nodeWidth:o,nodeHeight:r,siblingGap:i,levelGap:l,direction:a}=n,s=[],d=function e(n,o,r){const i=t.has(n.id),l={id:n.id,node:n,x:0,y:0,depth:o,parent:r,children:[],collapsed:i};if(!i)for(const t of n.children??[])l.children.push(e(t,o+1,l));return s.push(l),l}(e,0,null);let c=0;!function e(t){if(0===t.children.length)return t.x=c,void(c+=o+i);t.children.forEach(e),t.x=(t.children[0].x+t.children[t.children.length-1].x)/2}(d);for(const m of s)m.y=m.depth*(r+l);if("horizontal"===a)for(const m of s){const e=m.x;m.x=m.y,m.y=e}let u=1/0,h=1/0,p=-1/0,f=-1/0;for(const m of s)m.x<u&&(u=m.x),m.y<h&&(h=m.y),m.x>p&&(p=m.x),m.y>f&&(f=m.y);Number.isFinite(u)||(u=0,h=0,p=0,f=0);for(const m of s)m.x-=u,m.y-=h;return{nodes:s,width:p-u+o,height:f-h+r}}(e,y,{nodeWidth:r,nodeHeight:i,siblingGap:l,levelGap:a,direction:t}),[e,y,r,i,l,a,t]),M=Te(e=>{v(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Ae(()=>{if(!n)return;const e=g.current;if(!e)return;const t=e=>{if(!e.ctrlKey&&!e.metaKey){if(Math.abs(e.deltaY)<4&&Math.abs(e.deltaX)<4)return;return S(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY})),void e.preventDefault()}e.preventDefault();const t=e.deltaY<0?.1:-.1;k(e=>Hl(e+t))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[n]),Ae(()=>{if(!n)return;const e=g.current;if(!e)return;let t=!1,o=0,r=0,i=0,l=0;const a=n=>{n.target.closest('button, [role="treeitem"], a, input')||(t=!0,o=n.clientX,r=n.clientY,i=C.x,l=C.y,e.setPointerCapture(n.pointerId))},s=e=>{t&&S({x:i+(e.clientX-o),y:l+(e.clientY-r)})},d=n=>{t=!1;try{e.releasePointerCapture(n.pointerId)}catch{}};return e.addEventListener("pointerdown",a),e.addEventListener("pointermove",s),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointermove",s),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d)}},[n,C]);const I=Te(e=>{const t=N.nodes.find(e=>e.id===$);if(t)if("ArrowRight"===e.key||"ArrowDown"===e.key){const n=t.children[0];n&&(z(n.id),e.preventDefault())}else"ArrowLeft"===e.key||"ArrowUp"===e.key?t.parent&&(z(t.parent.id),e.preventDefault()):"Enter"===e.key||" "===e.key?(s?.(t.node),e.preventDefault()):"+"===e.key||"="===e.key?k(e=>Hl(e+.1)):"-"===e.key?k(e=>Hl(e-.1)):"0"===e.key&&(k(1),S({x:0,y:0}))},[$,N,s]),L=Ee(()=>{const e=[];for(const n of N.nodes)for(const o of n.children)e.push({id:`${n.id}→${o.id}`,d:Bl(n,o,r,i,t)});return e},[N,r,i,t]),W={position:"relative",width:"100%",height:u,overflow:"hidden",borderRadius:12,background:m.bg,border:`1px solid ${m.border}`,touchAction:"none",cursor:n?"grab":"default",boxSizing:"border-box",...f},D={position:"absolute",left:"50%",top:24,width:N.width,height:N.height,transform:`translate(calc(-50% + ${C.x}px), ${C.y}px) scale(${w})`,transformOrigin:"top center",transition:"transform 0.08s ease-out"};/* @__PURE__ */
388
- return Ye("div",{ref:g,className:p,style:W,role:"tree","aria-label":E(h),tabIndex:0,onKeyDown:I,children:[n&&/* @__PURE__ */Ye("div",{style:{position:"absolute",top:12,right:12,zIndex:3,display:"flex",gap:6,background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:4,boxShadow:`0 4px 12px -6px ${m.border}88`},children:[
389
- /* @__PURE__ */Ve(jl,{theme:m,label:"Zoom out",onClick:()=>k(e=>Hl(e-.1)),children:"−"}),
390
- /* @__PURE__ */Ve(jl,{theme:m,label:"Reset zoom",onClick:()=>{k(1),S({x:0,y:0})},children:"⟳"}),
391
- /* @__PURE__ */Ve(jl,{theme:m,label:"Zoom in",onClick:()=>k(e=>Hl(e+.1)),children:"+"})]}),/* @__PURE__ */Ye("div",{ref:x,style:D,children:[/* @__PURE__ */Ve("svg",{width:N.width,height:N.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none"},"aria-hidden":"true",children:L.map(e=>/* @__PURE__ */Ve("path",{d:e.d,fill:"none",stroke:m.border,strokeWidth:1.5},e.id))}),N.nodes.map(e=>{const n=(e.node.children?.length??0)>0,o=e.id===$;/* @__PURE__ */
392
- return Ye("div",{role:"treeitem","aria-label":E(e.node.label),"aria-selected":o,"aria-level":e.depth+1,"aria-expanded":n?!e.collapsed:void 0,tabIndex:-1,onClick:t=>{t.stopPropagation(),z(e.id),s?.(e.node)},style:{position:"absolute",left:e.x,top:e.y,width:r,height:i,cursor:s?"pointer":"default"},children:[d?d(e.node,o):/* @__PURE__ */Ve(Al,{node:e.node,w:r,h:i,isActive:o,theme:m}),n&&/* @__PURE__ */Ve(Fl,{collapsed:e.collapsed,onClick:()=>M(e.id),theme:m,direction:t,w:r,h:i})]},e.id)})]})]})}function Hl(e){return e<.25?.25:e>4?4:e}function jl({children:e,onClick:t,label:n,theme:o}){/* @__PURE__ */
393
- return Ve("button",{type:"button","aria-label":n,onClick:t,style:{width:28,height:28,borderRadius:6,background:"transparent",border:"none",color:o.text,fontSize:14,fontWeight:700,cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:e=>{e.currentTarget.style.background=o.surfaceAlt},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:e})}function Ol({locale:e="en-US",direction:t,strings:n,children:o}){const r=Ee(()=>{const o=ke[e]??Ce,r=n?{...o,...n}:o;return{locale:e,direction:t??(Se(e)?"rtl":"ltr"),strings:r}},[e,t,n]);/* @__PURE__ */
394
- return Ve(we.Provider,{value:r,children:/* @__PURE__ */Ve("div",{dir:r.direction,style:{direction:r.direction,display:"contents"},children:o})})}function Pl({contentId:e="tkx-main-content",label:t="Skip to main content"}){/* @__PURE__ */
395
- return Ve("a",{href:`#${e}`,className:"tkx-skip-nav",children:t})}function Vl({politeness:e="polite",children:t,atomic:n=!0}){/* @__PURE__ */
396
- return Ve("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:t})}function Yl({active:e,children:t,as:n="div"}){/* @__PURE__ */
397
- return Ve(n,{ref:pe(e),children:t})}function Ul({as:e,children:t,...n}){/* @__PURE__ */
398
- return Ve(e??"span",{className:"tkx-sr-only",...n,children:t})}function Kl(e,t,n,o){const r=e.getBoundingClientRect(),i=t?t.offsetHeight:320,l=t?t.offsetWidth:200,a=window.innerWidth,s=window.innerHeight,d=window.scrollX,c=window.scrollY;let u=0,h=0;switch(n){case"bottom-start":default:u=r.bottom+c+o,h=r.left+d;break;case"bottom-end":u=r.bottom+c+o,h=r.right+d-l;break;case"top-start":u=r.top+c-o-i,h=r.left+d;break;case"top-end":u=r.top+c-o-i,h=r.right+d-l;break;case"right":u=r.top+c,h=r.right+d+o;break;case"left":u=r.top+c,h=r.left+d-o-l}return n.startsWith("bottom")&&r.bottom+i>s&&(u=r.top+c-o-i),n.startsWith("top")&&r.top-i<0&&(u=r.bottom+c+o),h+l>a+d&&(h=a+d-l-8),h<d&&(h=d+8),{top:u,left:h,minWidth:r.width}}function Xl(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?e:/* @__PURE__ */Ye(Pe,{children:[e.slice(0,n),
399
- /* @__PURE__ */Ve("mark",{style:{background:"rgba(0,245,212,0.3)",color:"inherit",borderRadius:2},children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function ql({groups:e,position:t,maxHeight:n,minWidth:o,selectedKeys:r,multiSelect:i,searchable:l,searchPlaceholder:a,onSelect:s,onClose:d,renderItem:c,menuRef:u,isPortal:h,menuId:p}){const f=b(),[m,g]=Oe(""),[x,y]=Oe(0),[v,w]=Oe(null),[k,C]=Oe(0),S=je(null),$=je([]),z=je([]),N=m?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(m.toLowerCase())||e.description?.toLowerCase().includes(m.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(m.toLowerCase())))})).filter(e=>e.items.length>0):e,M=function(e,t){const n=[];for(const o of e)for(const e of o.items)e.disabled||t&&!e.label.toLowerCase().includes(t.toLowerCase())||n.push(e);return n}(N,m);Ae(()=>{l&&S.current?S.current.focus():$.current[0]?.focus(),y(0)},[l]),Ae(()=>{l&&""===m||$.current[x]?.focus()},[x,l,m]);const I=Te(e=>{switch(e.key){case"ArrowDown":if(e.preventDefault(),v){const e=(M.find(e=>e.key===v)?.children??[]).filter(e=>!e.disabled);C(t=>Math.min(t+1,e.length-1))}else y(e=>Math.min(e+1,M.length-1));break;case"ArrowUp":e.preventDefault(),v?C(e=>Math.max(e-1,0)):y(e=>Math.max(e-1,0));break;case"ArrowRight":{e.preventDefault();const t=M[x];t?.children?.length&&(w(t.key),C(0));break}case"ArrowLeft":e.preventDefault(),w(null);break;case"Enter":case" ":if(e.preventDefault(),v){const e=(M.find(e=>e.key===v)?.children??[]).filter(e=>!e.disabled)[k];e&&s(e.key,e)}else{const e=M[x];e&&s(e.key,e)}break;case"Escape":e.preventDefault(),v?w(null):d();break;case"Tab":d()}},[M,x,d,s,v,k]);Ae(()=>{v&&z.current[k]?.focus()},[k,v]);const L={position:h?"fixed":"absolute",top:h?t.top:void 0,left:h?t.left:void 0,minWidth:Math.max(o,t.minWidth),maxHeight:n,overflowY:"auto",background:f.surface,border:`1px solid ${f.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:9999,outline:"none",transformOrigin:"top left",animation:"tkx-dropdown-in 150ms ease forwards"};let W=0;/* @__PURE__ */
400
- return Ye("div",{ref:u,id:p,role:"menu","aria-label":"Dropdown menu",tabIndex:-1,style:L,onKeyDown:I,children:[
401
- /* @__PURE__ */Ve("style",{children:"\n @keyframes tkx-dropdown-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "}),l&&/* @__PURE__ */Ve("div",{style:{padding:"8px 8px 4px"},children:/* @__PURE__ */Ve("input",{ref:S,type:"text",value:m,onChange:e=>{g(e.target.value),y(0)},placeholder:a,"aria-label":"Search items",style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",background:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:6,color:f.text,fontSize:13,outline:"none"}})}),0===N.length&&/* @__PURE__ */Ve("div",{style:{padding:"12px 16px",color:f.textMuted,fontSize:13,textAlign:"center"},children:"No results found"}),N.map((e,t)=>/* @__PURE__ */Ye("div",{role:"group","aria-label":e.label,children:[e.label&&/* @__PURE__ */Ve("div",{style:{padding:"8px 12px 4px",fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:f.textMuted},children:E(e.label)}),e.items.map(e=>{const t=W;e.disabled||W++;const n=r.includes(e.key),o=t===x&&!e.disabled,l=!!e.children?.length,a=v===e.key,d=c?c(e,n):/* @__PURE__ */Ve(Gl,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:m,theme:f,hasSubmenu:l});/* @__PURE__ */
402
- return Ye("div",{children:[e.divider&&/* @__PURE__ */Ve("div",{role:"separator",style:{height:1,background:f.border,margin:"4px 0"}}),/* @__PURE__ */Ye("div",{ref:e=>{$.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-checked":i?n:void 0,"aria-selected":i?void 0:n,"aria-haspopup":l?"menu":void 0,"aria-expanded":l?a:void 0,tabIndex:e.disabled?-1:0,style:{position:"relative",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:()=>{e.disabled||(l?(w(a?null:e.key),C(0)):s(e.key,e))},onMouseEnter:()=>{e.disabled||(y(t),l?(w(e.key),C(0)):w(null))},onFocus:()=>{e.disabled||y(t)},children:[d,l&&a&&/* @__PURE__ */Ve("div",{role:"menu",style:{position:"absolute",top:0,left:"100%",minWidth:180,background:f.surface,border:`1px solid ${f.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:1e4,animation:"tkx-dropdown-in 120ms ease forwards"},children:e.children.map((e,t)=>{const n=r.includes(e.key),o=t===k;/* @__PURE__ */
403
- return Ve("div",{ref:e=>{z.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-selected":n,tabIndex:e.disabled?-1:0,style:{cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:t=>{t.stopPropagation(),e.disabled||s(e.key,e)},onMouseEnter:()=>C(t),children:/* @__PURE__ */Ve(Gl,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:m,theme:f,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function Gl({item:e,isSelected:t,isFocused:n,multiSelect:o,query:r,theme:i,hasSubmenu:l}){/* @__PURE__ */
404
- return Ye("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:n?e.danger?`${i.danger}20`:`${i.primary}18`:"transparent",transition:"background 80ms",color:e.danger?i.danger:i.text,fontSize:14,userSelect:"none"},children:[o&&/* @__PURE__ */Ve("div",{style:{width:16,height:16,border:`2px solid ${t?i.primary:i.border}`,borderRadius:4,background:t?i.primary:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 120ms"},children:t&&/* @__PURE__ */Ve("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:/* @__PURE__ */Ve("path",{d:"M1 4l3 3L9 1",stroke:i.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.icon&&/* @__PURE__ */Ve("span",{style:{display:"flex",alignItems:"center",flexShrink:0,color:e.danger?i.danger:i.textMuted},children:e.icon}),
405
- /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ve("div",{style:{fontWeight:t&&!o?600:400},children:Xl(e.label,r)}),e.description&&/* @__PURE__ */Ve("div",{style:{fontSize:12,color:i.textMuted,marginTop:1},children:Xl(e.description,r)})]}),void 0!==e.badge&&/* @__PURE__ */Ve("span",{style:{background:i.primary,color:i.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:"1px 7px",flexShrink:0},children:e.badge}),e.shortcut&&!l&&/* @__PURE__ */Ve("span",{style:{fontSize:12,color:i.textMuted,flexShrink:0},children:e.shortcut}),l&&/* @__PURE__ */Ve("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M4 2l4 4-4 4",stroke:i.textMuted,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),!o&&t&&/* @__PURE__ */Ve("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ve("path",{d:"M2 7l4 4L12 3",stroke:i.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function _l({trigger:e,items:t,groups:n,placement:o="bottom-start",onSelect:r,selectedKeys:i,multiSelect:l=!1,searchable:a=!1,searchPlaceholder:s="Search…",closeOnSelect:d,disabled:c=!1,maxHeight:u=320,minWidth:h=200,open:p,onOpenChange:f,portal:m=!0,offset:g=6,renderItem:x}){const[b,y]=Oe(!1),[v,w]=Oe([]),[k,C]=Oe({top:0,left:0,minWidth:h}),S=je(null),$=je(null),z=Fe(),N=void 0!==p?p:b,M=void 0!==i?i:v,I=void 0!==d?d:!l,L=n??(t?[{items:t}]:[{items:[]}]),W=Te(e=>{void 0===p&&y(e),f?.(e)},[p,f]),D=Te((e,t)=>{l&&void 0===i&&w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),r?.(e,t),I&&W(!1)},[l,i,r,I,W]),R=Te(()=>W(!1),[W]);Ae(()=>{N&&S.current&&C(Kl(S.current,$.current,o,g))},[N,o,g]),Ae(()=>{N&&S.current&&$.current&&C(Kl(S.current,$.current,o,g))},[N,o,g]),Ae(()=>{if(!N)return;const e=e=>{const t=e.target;S.current&&!S.current.contains(t)&&$.current&&!$.current.contains(t)&&W(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N,W]);const T=N?/* @__PURE__ */Ve(ql,{groups:L,position:k,maxHeight:u,minWidth:h,selectedKeys:M,multiSelect:l,searchable:a,searchPlaceholder:s,onSelect:D,onClose:R,renderItem:x,menuRef:$,isPortal:m,menuId:z}):null;/* @__PURE__ */
406
- return Ye("div",{style:{display:"inline-block",position:"relative"},children:[/* @__PURE__ */Ve("div",{ref:S,onClick:()=>{c||W(!N)},"aria-haspopup":"menu","aria-expanded":N,"aria-controls":N?z:void 0,"aria-disabled":c,style:{cursor:c?"not-allowed":"pointer",opacity:c?.5:1,display:"inline-block"},children:e}),m&&"undefined"!=typeof document?Ue(T,document.body):T]})}El.displayName="TkxOrgChart";var Zl={sm:4,md:8,lg:12};function Jl({value:e,label:t,showLabel:n=!0,size:o="md",animate:r=!0,className:i,style:l}){const a=b(),s=je(null),d=Math.max(0,Math.min(100,e)),c=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(d,a.primary),u=Zl[o];Ae(()=>{if(!r||!s.current)return;const e=s.current;e.style.width="0%";const t=requestAnimationFrame(()=>{e.style.transition="width 0.9s cubic-bezier(0.4, 0, 0.2, 1)",e.style.width=`${d}%`});return()=>cancelAnimationFrame(t)},[d,r]);const h="number"==typeof d?`${d.toFixed(0)}% AI confidence${t?` for ${t}`:""}`:t;/* @__PURE__ */
407
- return Ye("div",{className:le(V("flex flex-col gap-1"),i),style:l,role:"meter","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100,"aria-label":h,children:[(t||n)&&/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[t&&/* @__PURE__ */Ve("span",{style:{fontSize:12,fontWeight:600,color:a.textMuted},children:t}),n&&/* @__PURE__ */Ye("span",{style:{fontSize:12,fontWeight:700,color:c,marginLeft:"auto"},children:[d.toFixed(0),"%"]})]}),
408
- /* @__PURE__ */Ye("div",{style:{height:u,borderRadius:u,background:`${a.border}`,overflow:"hidden",position:"relative"},children:[/* @__PURE__ */Ve("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"tkx-ai-shimmer 2s linear infinite",pointerEvents:"none",zIndex:1}}),/* @__PURE__ */Ve("div",{ref:s,style:{height:"100%",width:r?"0%":`${d}%`,background:`linear-gradient(90deg, ${c}cc, ${c})`,borderRadius:u,boxShadow:`0 0 8px ${c}66`,transition:r?void 0:"width 0.3s ease"}})]}),
409
- /* @__PURE__ */Ye("div",{style:{fontSize:10,color:a.textMuted,marginTop:2,display:"flex",gap:4,alignItems:"center"},children:[/* @__PURE__ */Ve("span",{style:{width:6,height:6,borderRadius:"50%",background:c,display:"inline-block",flexShrink:0}}),d>=80?"High confidence":d>=55?"Moderate confidence":d>=30?"Low confidence":"Very low — review manually"]}),
410
- /* @__PURE__ */Ve("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})}function Ql({src:e,name:t,size:n=32}){const o=b(),r=t?t.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?/* @__PURE__ */Ve("img",{src:e,alt:t??"avatar",width:n,height:n,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ve("div",{style:{width:n,height:n,borderRadius:"50%",flexShrink:0,background:`${o.primary}22`,border:`1px solid ${o.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*n,fontWeight:700,color:o.primary},children:r})}function ea({role:e,content:t,avatar:n,name:o,timestamp:r,streaming:i=!1,confidence:l,copyable:a=!1,className:s,style:d}){const c=b(),u="user"===e,h="system"===e,p="string"==typeof t?E(t):"",[f,m]=Oe(i?"":p),[g,x]=Oe(!1),[y,v]=Oe(i?"":p),w=je(0),k=je(null);if(Ae(()=>{if(!i||"string"!=typeof t)return void v(p);w.current=0,m(""),v("");const e=setInterval(()=>{w.current++;const t=p.slice(0,w.current);m(t),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>v(t),350),w.current>=p.length&&(clearInterval(e),k.current&&clearTimeout(k.current),v(p))},18);return()=>{clearInterval(e),k.current&&clearTimeout(k.current)}},[p,i,t]),h)/* @__PURE__ */return Ve("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:/* @__PURE__ */Ve("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${c.border}`,color:c.textMuted,fontStyle:"italic"},children:"string"==typeof t?E(t):t})});const C={maxWidth:"75%",padding:"12px 16px",borderRadius:u?"18px 18px 4px 18px":"18px 18px 18px 4px",background:u?`linear-gradient(135deg, ${c.primary}, ${c.primary}cc)`:`${c.surface}`,border:u?"none":`1px solid ${c.border}`,color:u?"#fff":c.text,fontSize:14,lineHeight:1.65,boxShadow:u?`0 4px 16px -4px ${c.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};/* @__PURE__ */
411
- return Ye("div",{className:le(V("flex gap-2"),s),style:{flexDirection:u?"row-reverse":"row",alignItems:"flex-end",...d},children:[
412
- /* @__PURE__ */Ve(Ql,{src:n,name:o??(u?"You":"AI")}),
413
- /* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:u?"flex-end":"flex-start"},children:[(o||r)&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,alignItems:"center",paddingInline:4},children:[o&&/* @__PURE__ */Ve("span",{style:{fontSize:11,fontWeight:700,color:c.textMuted},children:o}),r&&/* @__PURE__ */Ve("span",{style:{fontSize:10,color:c.textMuted},children:r})]}),
414
- /* @__PURE__ */Ye("div",{style:C,role:"article","aria-label":u?"Your message":"Assistant message",children:["string"==typeof t?/* @__PURE__ */Ye(Pe,{children:[
415
- /* @__PURE__ */Ve("span",{"aria-hidden":i?"true":void 0,children:i?f:E(t)}),i&&f.length<p.length&&/* @__PURE__ */Ve("span",{"aria-hidden":"true",style:{display:"inline-block",width:2,height:14,background:u?"#fff":c.primary,marginLeft:2,animation:"tkx-blink 1s step-end infinite",verticalAlign:"text-bottom"}}),i&&/* @__PURE__ */Ve("span",{"aria-live":"polite","aria-atomic":"false",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:y})]}):t,a&&!u&&/* @__PURE__ */Ve("button",{onClick:()=>{navigator.clipboard?.writeText(p),x(!0),setTimeout(()=>x(!1),2e3)},title:"Copy message",style:{position:"absolute",top:8,right:8,background:"none",border:"none",cursor:"pointer",fontSize:13,color:g?"#10b981":c.textMuted,padding:"2px 4px",borderRadius:4,transition:"color 0.2s"},children:g?"✓":"⎘"})]}),!u&&void 0!==l&&/* @__PURE__ */Ve("div",{style:{paddingInline:4,width:"100%",maxWidth:240},children:/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */Ve("div",{style:{flex:1,height:3,borderRadius:3,background:c.border,overflow:"hidden"},children:/* @__PURE__ */Ve("div",{style:{height:"100%",width:`${l}%`,background:(S=l,$=c.primary,S>=80?"#10b981":S>=55?$:S>=30?"#f59e0b":"#ef4444"),borderRadius:3,transition:"width 0.8s ease"}})}),/* @__PURE__ */Ye("span",{style:{fontSize:10,color:c.textMuted,whiteSpace:"nowrap"},children:[l,"% confident"]})]})})]}),
416
- /* @__PURE__ */Ve("style",{children:"\n @keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }\n "})]});var S,$}function ta({color:e}){/* @__PURE__ */
417
- return Ve("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(t=>/* @__PURE__ */Ve("div",{style:{width:7,height:7,borderRadius:"50%",background:e,animation:`tkx-thinking-dot 1.2s ease-in-out ${.18*t}s infinite`}},t))})}function na({color:e}){/* @__PURE__ */
470
+ /* @__PURE__ */Ue("div",{style:{width:40,height:40,minWidth:40,borderRadius:"50%",overflow:"hidden",background:`${i}22`,color:i,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,border:`1.5px solid ${i}44`},"aria-hidden":"true",children:a?/* @__PURE__ */Ue("img",{src:a,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",style:{width:"100%",height:"100%",objectFit:"cover"}}):l.slice(0,2).toUpperCase()}),
471
+ /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ue("div",{style:{fontSize:13.5,fontWeight:700,color:r.text,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l}),s&&/* @__PURE__ */Ue("div",{style:{fontSize:11.5,color:r.textMuted,lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:1},children:s})]}),d&&/* @__PURE__ */Ue("span",{style:{fontSize:10,fontWeight:700,padding:"3px 7px",borderRadius:999,color:i,background:`${i}18`,border:`1px solid ${i}33`,letterSpacing:"0.04em",textTransform:"uppercase",flexShrink:0},children:d})]})}function es({collapsed:e,onClick:t,theme:n,direction:o,w:r,h:i}){const a={position:"absolute",..."vertical"===o?{left:r/2-10,top:i-10}:{left:r-10,top:i/2-10},width:20,height:20,borderRadius:"50%",background:n.surfaceAlt,border:`1.5px solid ${n.border}`,color:n.text,fontSize:12,fontWeight:700,cursor:"pointer",padding:0,lineHeight:1,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"};/* @__PURE__ */
472
+ return Ue("button",{type:"button","aria-label":e?"Expand subtree":"Collapse subtree","aria-expanded":!e,onClick:e=>{e.stopPropagation(),t(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.stopPropagation(),t(e))},style:a,children:e?"+":"−"})}function ts({data:e,direction:t="vertical",interactive:n=!0,initialZoom:o=1,nodeWidth:r=200,nodeHeight:i=84,siblingGap:a=28,levelGap:l=64,onNodeClick:s,renderNode:d,collapsedByDefault:c=!1,height:u=560,ariaLabel:h="Organization chart",className:p,style:f}){const m=N(),g=Oe(null),x=Oe(null),[y,b]=Ve(()=>{if(!c)/* @__PURE__ */return new Set;const t=/* @__PURE__ */new Set;return function n(o){o.id!==e.id&&t.add(o.id),(o.children??[]).forEach(n)}(e),t}),[v,w]=Ve(ns(o)),[k,S]=Ve({x:0,y:0}),[C,$]=Ve(e.id),z=He(()=>function(e,t,n){const{nodeWidth:o,nodeHeight:r,siblingGap:i,levelGap:a,direction:l}=n,s=[],d=function e(n,o,r){const i=t.has(n.id),a={id:n.id,node:n,x:0,y:0,depth:o,parent:r,children:[],collapsed:i};if(!i)for(const t of n.children??[])a.children.push(e(t,o+1,a));return s.push(a),a}(e,0,null);let c=0;!function e(t){if(0===t.children.length)return t.x=c,void(c+=o+i);t.children.forEach(e),t.x=(t.children[0].x+t.children[t.children.length-1].x)/2}(d);for(const m of s)m.y=m.depth*(r+a);if("horizontal"===l)for(const m of s){const e=m.x;m.x=m.y,m.y=e}let u=1/0,h=1/0,p=-1/0,f=-1/0;for(const m of s)m.x<u&&(u=m.x),m.y<h&&(h=m.y),m.x>p&&(p=m.x),m.y>f&&(f=m.y);Number.isFinite(u)||(u=0,h=0,p=0,f=0);for(const m of s)m.x-=u,m.y-=h;return{nodes:s,width:p-u+o,height:f-h+r}}(e,y,{nodeWidth:r,nodeHeight:i,siblingGap:a,levelGap:l,direction:t}),[e,y,r,i,a,l,t]),M=Ae(e=>{b(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Fe(()=>{if(!n)return;const e=g.current;if(!e)return;const t=e=>{if(!e.ctrlKey&&!e.metaKey){if(Math.abs(e.deltaY)<4&&Math.abs(e.deltaX)<4)return;return S(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY})),void e.preventDefault()}e.preventDefault();const t=e.deltaY<0?.1:-.1;w(e=>ns(e+t))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[n]),Fe(()=>{if(!n)return;const e=g.current;if(!e)return;let t=!1,o=0,r=0,i=0,a=0;const l=n=>{n.target.closest('button, [role="treeitem"], a, input')||(t=!0,o=n.clientX,r=n.clientY,i=k.x,a=k.y,e.setPointerCapture(n.pointerId))},s=e=>{t&&S({x:i+(e.clientX-o),y:a+(e.clientY-r)})},d=n=>{t=!1;try{e.releasePointerCapture(n.pointerId)}catch{}};return e.addEventListener("pointerdown",l),e.addEventListener("pointermove",s),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",l),e.removeEventListener("pointermove",s),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d)}},[n,k]);const I=Ae(e=>{const t=z.nodes.find(e=>e.id===C);if(t)if("ArrowRight"===e.key||"ArrowDown"===e.key){const n=t.children[0];n&&($(n.id),e.preventDefault())}else"ArrowLeft"===e.key||"ArrowUp"===e.key?t.parent&&($(t.parent.id),e.preventDefault()):"Enter"===e.key||" "===e.key?(s?.(t.node),e.preventDefault()):"+"===e.key||"="===e.key?w(e=>ns(e+.1)):"-"===e.key?w(e=>ns(e-.1)):"0"===e.key&&(w(1),S({x:0,y:0}))},[C,z,s]),D=He(()=>{const e=[];for(const n of z.nodes)for(const o of n.children)e.push({id:`${n.id}→${o.id}`,d:Jl(n,o,r,i,t)});return e},[z,r,i,t]),W={position:"relative",width:"100%",height:u,overflow:"hidden",borderRadius:12,background:m.bg,border:`1px solid ${m.border}`,touchAction:"none",cursor:n?"grab":"default",boxSizing:"border-box",...f},L={position:"absolute",left:"50%",top:24,width:z.width,height:z.height,transform:`translate(calc(-50% + ${k.x}px), ${k.y}px) scale(${v})`,transformOrigin:"top center",transition:"transform 0.08s ease-out"};/* @__PURE__ */
473
+ return Ye("div",{ref:g,className:p,style:W,role:"tree","aria-label":j(h),tabIndex:0,onKeyDown:I,children:[n&&/* @__PURE__ */Ye("div",{style:{position:"absolute",top:12,right:12,zIndex:3,display:"flex",gap:6,background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:4,boxShadow:`0 4px 12px -6px ${m.border}88`},children:[
474
+ /* @__PURE__ */Ue(os,{theme:m,label:"Zoom out",onClick:()=>w(e=>ns(e-.1)),children:"−"}),
475
+ /* @__PURE__ */Ue(os,{theme:m,label:"Reset zoom",onClick:()=>{w(1),S({x:0,y:0})},children:"⟳"}),
476
+ /* @__PURE__ */Ue(os,{theme:m,label:"Zoom in",onClick:()=>w(e=>ns(e+.1)),children:"+"})]}),/* @__PURE__ */Ye("div",{ref:x,style:L,children:[/* @__PURE__ */Ue("svg",{width:z.width,height:z.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none"},"aria-hidden":"true",children:D.map(e=>/* @__PURE__ */Ue("path",{d:e.d,fill:"none",stroke:m.border,strokeWidth:1.5},e.id))}),z.nodes.map(e=>{const n=(e.node.children?.length??0)>0,o=e.id===C;/* @__PURE__ */
477
+ return Ye("div",{role:"treeitem","aria-label":j(e.node.label),"aria-selected":o,"aria-level":e.depth+1,"aria-expanded":n?!e.collapsed:void 0,tabIndex:-1,onClick:t=>{t.stopPropagation(),$(e.id),s?.(e.node)},style:{position:"absolute",left:e.x,top:e.y,width:r,height:i,cursor:s?"pointer":"default"},children:[d?d(e.node,o):/* @__PURE__ */Ue(Ql,{node:e.node,w:r,h:i,isActive:o,theme:m}),n&&/* @__PURE__ */Ue(es,{collapsed:e.collapsed,onClick:()=>M(e.id),theme:m,direction:t,w:r,h:i})]},e.id)})]})]})}function ns(e){return e<.25?.25:e>4?4:e}function os({children:e,onClick:t,label:n,theme:o}){/* @__PURE__ */
478
+ return Ue("button",{type:"button","aria-label":n,onClick:t,style:{width:28,height:28,borderRadius:6,background:"transparent",border:"none",color:o.text,fontSize:14,fontWeight:700,cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:e=>{e.currentTarget.style.background=o.surfaceAlt},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:e})}function rs({locale:e="en-US",direction:t,strings:n,children:o}){const r=He(()=>{const o=ve[e]??we,r=n?{...o,...n}:o;return{locale:e,direction:t??(ke(e)?"rtl":"ltr"),strings:r}},[e,t,n]);/* @__PURE__ */
479
+ return Ue(be.Provider,{value:r,children:/* @__PURE__ */Ue("div",{dir:r.direction,style:{direction:r.direction,display:"contents"},children:o})})}function is({contentId:e="tkx-main-content",label:t="Skip to main content"}){/* @__PURE__ */
480
+ return Ue("a",{href:`#${e}`,className:"tkx-skip-nav",children:t})}function as({politeness:e="polite",children:t,atomic:n=!0}){/* @__PURE__ */
481
+ return Ue("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:t})}function ls({active:e,children:t,as:n="div"}){/* @__PURE__ */
482
+ return Ue(n,{ref:fe(e),children:t})}function ss({as:e,children:t,...n}){/* @__PURE__ */
483
+ return Ue(e??"span",{className:"tkx-sr-only",...n,children:t})}function ds(e,t,n,o){const r=e.getBoundingClientRect(),i=t?t.offsetHeight:320,a=t?t.offsetWidth:200,l=window.innerWidth,s=window.innerHeight,d=window.scrollX,c=window.scrollY;let u=0,h=0;switch(n){case"bottom-start":default:u=r.bottom+c+o,h=r.left+d;break;case"bottom-end":u=r.bottom+c+o,h=r.right+d-a;break;case"top-start":u=r.top+c-o-i,h=r.left+d;break;case"top-end":u=r.top+c-o-i,h=r.right+d-a;break;case"right":u=r.top+c,h=r.right+d+o;break;case"left":u=r.top+c,h=r.left+d-o-a}return n.startsWith("bottom")&&r.bottom+i>s&&(u=r.top+c-o-i),n.startsWith("top")&&r.top-i<0&&(u=r.bottom+c+o),h+a>l+d&&(h=l+d-a-8),h<d&&(h=d+8),{top:u,left:h,minWidth:r.width}}function cs(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?e:/* @__PURE__ */Ye(Ke,{children:[e.slice(0,n),
484
+ /* @__PURE__ */Ue("mark",{style:{background:"rgba(0,245,212,0.3)",color:"inherit",borderRadius:2},children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function us({groups:e,position:t,maxHeight:n,minWidth:o,selectedKeys:r,multiSelect:i,searchable:a,searchPlaceholder:l,onSelect:s,onClose:d,renderItem:c,menuRef:u,isPortal:h,menuId:p}){const f=N(),m=$e(),g=l??`${m.search}…`,[x,y]=Ve(""),[b,v]=Ve(0),[w,k]=Ve(null),[S,C]=Ve(0),$=Oe(null),z=Oe([]),M=Oe([]),I=x?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(x.toLowerCase())||e.description?.toLowerCase().includes(x.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(x.toLowerCase())))})).filter(e=>e.items.length>0):e,D=function(e,t){const n=[];for(const o of e)for(const e of o.items)e.disabled||t&&!e.label.toLowerCase().includes(t.toLowerCase())||n.push(e);return n}(I,x);Fe(()=>{a&&$.current?$.current.focus():z.current[0]?.focus(),v(0)},[a]),Fe(()=>{a&&""===x||z.current[b]?.focus()},[b,a,x]);const W=Ae(e=>{switch(e.key){case"ArrowDown":if(e.preventDefault(),w){const e=(D.find(e=>e.key===w)?.children??[]).filter(e=>!e.disabled);C(t=>Math.min(t+1,e.length-1))}else v(e=>Math.min(e+1,D.length-1));break;case"ArrowUp":e.preventDefault(),w?C(e=>Math.max(e-1,0)):v(e=>Math.max(e-1,0));break;case"ArrowRight":{e.preventDefault();const t=D[b];t?.children?.length&&(k(t.key),C(0));break}case"ArrowLeft":e.preventDefault(),k(null);break;case"Enter":case" ":if(e.preventDefault(),w){const e=(D.find(e=>e.key===w)?.children??[]).filter(e=>!e.disabled)[S];e&&s(e.key,e)}else{const e=D[b];e&&s(e.key,e)}break;case"Escape":e.preventDefault(),w?k(null):d();break;case"Tab":d()}},[D,b,d,s,w,S]);Fe(()=>{w&&M.current[S]?.focus()},[S,w]);const L={position:h?"fixed":"absolute",top:h?t.top:void 0,left:h?t.left:void 0,minWidth:Math.max(o,t.minWidth),maxHeight:n,overflowY:"auto",background:f.surface,border:`1px solid ${f.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:9999,outline:"none",transformOrigin:"top left",animation:"tkx-dropdown-in 150ms ease forwards"};let R=0;/* @__PURE__ */
485
+ return Ye("div",{ref:u,id:p,role:"menu","aria-label":"Dropdown menu",tabIndex:-1,style:L,onKeyDown:W,children:[
486
+ /* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-dropdown-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "}),a&&/* @__PURE__ */Ue("div",{style:{padding:"8px 8px 4px"},children:/* @__PURE__ */Ue("input",{ref:$,type:"text",value:x,onChange:e=>{y(e.target.value),v(0)},placeholder:g,"aria-label":`${m.search} items`,style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",background:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:6,color:f.text,fontSize:13,outline:"none"}})}),0===I.length&&/* @__PURE__ */Ue("div",{style:{padding:"12px 16px",color:f.textMuted,fontSize:13,textAlign:"center"},children:"No results found"}),I.map((e,t)=>/* @__PURE__ */Ye("div",{role:"group","aria-label":e.label,children:[e.label&&/* @__PURE__ */Ue("div",{style:{padding:"8px 12px 4px",fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:f.textMuted},children:j(e.label)}),e.items.map(e=>{const t=R;e.disabled||R++;const n=r.includes(e.key),o=t===b&&!e.disabled,a=!!e.children?.length,l=w===e.key,d=c?c(e,n):/* @__PURE__ */Ue(hs,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:x,theme:f,hasSubmenu:a});/* @__PURE__ */
487
+ return Ye("div",{children:[e.divider&&/* @__PURE__ */Ue("div",{role:"separator",style:{height:1,background:f.border,margin:"4px 0"}}),/* @__PURE__ */Ye("div",{ref:e=>{z.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-checked":i?n:void 0,"aria-selected":i?void 0:n,"aria-haspopup":a?"menu":void 0,"aria-expanded":a?l:void 0,tabIndex:e.disabled?-1:0,style:{position:"relative",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:()=>{e.disabled||(a?(k(l?null:e.key),C(0)):s(e.key,e))},onMouseEnter:()=>{e.disabled||(v(t),a?(k(e.key),C(0)):k(null))},onFocus:()=>{e.disabled||v(t)},children:[d,a&&l&&/* @__PURE__ */Ue("div",{role:"menu",style:{position:"absolute",top:0,left:"100%",minWidth:180,background:f.surface,border:`1px solid ${f.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:1e4,animation:"tkx-dropdown-in 120ms ease forwards"},children:e.children.map((e,t)=>{const n=r.includes(e.key),o=t===S;/* @__PURE__ */
488
+ return Ue("div",{ref:e=>{M.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-selected":n,tabIndex:e.disabled?-1:0,style:{cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:t=>{t.stopPropagation(),e.disabled||s(e.key,e)},onMouseEnter:()=>C(t),children:/* @__PURE__ */Ue(hs,{item:e,isSelected:n,isFocused:o,multiSelect:i,query:x,theme:f,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function hs({item:e,isSelected:t,isFocused:n,multiSelect:o,query:r,theme:i,hasSubmenu:a}){/* @__PURE__ */
489
+ return Ye("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:n?e.danger?`${i.danger}20`:`${i.primary}18`:"transparent",transition:"background 80ms",color:e.danger?i.danger:i.text,fontSize:14,userSelect:"none"},children:[o&&/* @__PURE__ */Ue("div",{style:{width:16,height:16,border:`2px solid ${t?i.primary:i.border}`,borderRadius:4,background:t?i.primary:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 120ms"},children:t&&/* @__PURE__ */Ue("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:/* @__PURE__ */Ue("path",{d:"M1 4l3 3L9 1",stroke:i.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.icon&&/* @__PURE__ */Ue("span",{style:{display:"flex",alignItems:"center",flexShrink:0,color:e.danger?i.danger:i.textMuted},children:e.icon}),
490
+ /* @__PURE__ */Ye("div",{style:{flex:1,minWidth:0},children:[/* @__PURE__ */Ue("div",{style:{fontWeight:t&&!o?600:400},children:cs(e.label,r)}),e.description&&/* @__PURE__ */Ue("div",{style:{fontSize:12,color:i.textMuted,marginTop:1},children:cs(e.description,r)})]}),void 0!==e.badge&&/* @__PURE__ */Ue("span",{style:{background:i.primary,color:i.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:"1px 7px",flexShrink:0},children:e.badge}),e.shortcut&&!a&&/* @__PURE__ */Ue("span",{style:{fontSize:12,color:i.textMuted,flexShrink:0},children:e.shortcut}),a&&/* @__PURE__ */Ue("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M4 2l4 4-4 4",stroke:i.textMuted,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),!o&&t&&/* @__PURE__ */Ue("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{flexShrink:0},children:/* @__PURE__ */Ue("path",{d:"M2 7l4 4L12 3",stroke:i.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function ps({trigger:e,items:t,groups:n,placement:o="bottom-start",onSelect:r,selectedKeys:i,multiSelect:a=!1,searchable:l=!1,searchPlaceholder:s,closeOnSelect:d,disabled:c=!1,maxHeight:u=320,minWidth:h=200,open:p,onOpenChange:f,portal:m=!0,offset:g=6,renderItem:x}){const[y,b]=Ve(!1),[v,w]=Ve([]),[k,S]=Ve({top:0,left:0,minWidth:h}),C=Oe(null),$=Oe(null),z=Ee(),N=void 0!==p?p:y,M=void 0!==i?i:v,I=void 0!==d?d:!a,D=n??(t?[{items:t}]:[{items:[]}]),W=Ae(e=>{void 0===p&&b(e),f?.(e)},[p,f]),L=Ae((e,t)=>{a&&void 0===i&&w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),r?.(e,t),I&&W(!1)},[a,i,r,I,W]),R=Ae(()=>W(!1),[W]);Fe(()=>{N&&C.current&&S(ds(C.current,$.current,o,g))},[N,o,g]),Fe(()=>{N&&C.current&&$.current&&S(ds(C.current,$.current,o,g))},[N,o,g]),Fe(()=>{if(!N)return;const e=e=>{const t=e.target;C.current&&!C.current.contains(t)&&$.current&&!$.current.contains(t)&&W(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N,W]);const T=N?/* @__PURE__ */Ue(us,{groups:D,position:k,maxHeight:u,minWidth:h,selectedKeys:M,multiSelect:a,searchable:l,searchPlaceholder:s,onSelect:L,onClose:R,renderItem:x,menuRef:$,isPortal:m,menuId:z}):null;/* @__PURE__ */
491
+ return Ye("div",{style:{display:"inline-block",position:"relative"},children:[/* @__PURE__ */Ue("div",{ref:C,onClick:()=>{c||W(!N)},"aria-haspopup":"menu","aria-expanded":N,"aria-controls":N?z:void 0,"aria-disabled":c,style:{cursor:c?"not-allowed":"pointer",opacity:c?.5:1,display:"inline-block"},children:e}),m&&"undefined"!=typeof document?Xe(T,document.body):T]})}ts.displayName="TkxOrgChart";var fs={sm:4,md:8,lg:12};function ms({value:e,label:t,showLabel:n=!0,size:o="md",animate:r=!0,className:i,style:a}){const l=N(),s=Oe(null),d=Math.max(0,Math.min(100,e)),c=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(d,l.primary),u=fs[o];Fe(()=>{if(!r||!s.current)return;const e=s.current;e.style.width="0%";const t=requestAnimationFrame(()=>{e.style.transition="width 0.9s cubic-bezier(0.4, 0, 0.2, 1)",e.style.width=`${d}%`});return()=>cancelAnimationFrame(t)},[d,r]);const h="number"==typeof d?`${d.toFixed(0)}% AI confidence${t?` for ${t}`:""}`:t;/* @__PURE__ */
492
+ return Ye("div",{className:le(K("flex flex-col gap-1"),i),style:a,role:"meter","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100,"aria-label":h,children:[(t||n)&&/* @__PURE__ */Ye("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[t&&/* @__PURE__ */Ue("span",{style:{fontSize:12,fontWeight:600,color:l.textMuted},children:t}),n&&/* @__PURE__ */Ye("span",{style:{fontSize:12,fontWeight:700,color:c,marginLeft:"auto"},children:[d.toFixed(0),"%"]})]}),
493
+ /* @__PURE__ */Ye("div",{style:{height:u,borderRadius:u,background:`${l.border}`,overflow:"hidden",position:"relative"},children:[/* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"tkx-ai-shimmer 2s linear infinite",pointerEvents:"none",zIndex:1}}),/* @__PURE__ */Ue("div",{ref:s,style:{height:"100%",width:r?"0%":`${d}%`,background:`linear-gradient(90deg, ${c}cc, ${c})`,borderRadius:u,boxShadow:`0 0 8px ${c}66`,transition:r?void 0:"width 0.3s ease"}})]}),
494
+ /* @__PURE__ */Ye("div",{style:{fontSize:10,color:l.textMuted,marginTop:2,display:"flex",gap:4,alignItems:"center"},children:[/* @__PURE__ */Ue("span",{style:{width:6,height:6,borderRadius:"50%",background:c,display:"inline-block",flexShrink:0}}),d>=80?"High confidence":d>=55?"Moderate confidence":d>=30?"Low confidence":"Very low — review manually"]}),
495
+ /* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})}function gs({src:e,name:t,size:n=32}){const o=N(),r=t?t.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?/* @__PURE__ */Ue("img",{src:e,alt:t??"avatar",width:n,height:n,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):/* @__PURE__ */Ue("div",{style:{width:n,height:n,borderRadius:"50%",flexShrink:0,background:`${o.primary}22`,border:`1px solid ${o.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*n,fontWeight:700,color:o.primary},children:r})}function xs({role:e,content:t,avatar:n,name:o,timestamp:r,streaming:i=!1,confidence:a,copyable:l=!1,className:s,style:d}){const c=N(),u="user"===e,h="system"===e,p="string"==typeof t?j(t):"",[f,m]=Ve(i?"":p),[g,x]=Ve(!1),[y,b]=Ve(i?"":p),v=Oe(0),w=Oe(null);if(Fe(()=>{if(!i||"string"!=typeof t)return void b(p);v.current=0,m(""),b("");const e=setInterval(()=>{v.current++;const t=p.slice(0,v.current);m(t),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>b(t),350),v.current>=p.length&&(clearInterval(e),w.current&&clearTimeout(w.current),b(p))},18);return()=>{clearInterval(e),w.current&&clearTimeout(w.current)}},[p,i,t]),h)/* @__PURE__ */return Ue("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:/* @__PURE__ */Ue("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${c.border}`,color:c.textMuted,fontStyle:"italic"},children:"string"==typeof t?j(t):t})});const k={maxWidth:"75%",padding:"12px 16px",borderRadius:u?"18px 18px 4px 18px":"18px 18px 18px 4px",background:u?`linear-gradient(135deg, ${c.primary}, ${c.primary}cc)`:`${c.surface}`,border:u?"none":`1px solid ${c.border}`,color:u?"#fff":c.text,fontSize:14,lineHeight:1.65,boxShadow:u?`0 4px 16px -4px ${c.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};/* @__PURE__ */
496
+ return Ye("div",{className:le(K("flex gap-2"),s),style:{flexDirection:u?"row-reverse":"row",alignItems:"flex-end",...d},children:[
497
+ /* @__PURE__ */Ue(gs,{src:n,name:o??(u?"You":"AI")}),
498
+ /* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:u?"flex-end":"flex-start"},children:[(o||r)&&/* @__PURE__ */Ye("div",{style:{display:"flex",gap:8,alignItems:"center",paddingInline:4},children:[o&&/* @__PURE__ */Ue("span",{style:{fontSize:11,fontWeight:700,color:c.textMuted},children:o}),r&&/* @__PURE__ */Ue("span",{style:{fontSize:10,color:c.textMuted},children:r})]}),
499
+ /* @__PURE__ */Ye("div",{style:k,role:"article","aria-label":u?"Your message":"Assistant message",children:["string"==typeof t?/* @__PURE__ */Ye(Ke,{children:[
500
+ /* @__PURE__ */Ue("span",{"aria-hidden":i?"true":void 0,children:i?f:j(t)}),i&&f.length<p.length&&/* @__PURE__ */Ue("span",{"aria-hidden":"true",style:{display:"inline-block",width:2,height:14,background:u?"#fff":c.primary,marginLeft:2,animation:"tkx-blink 1s step-end infinite",verticalAlign:"text-bottom"}}),i&&/* @__PURE__ */Ue("span",{"aria-live":"polite","aria-atomic":"false",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:y})]}):t,l&&!u&&/* @__PURE__ */Ue("button",{onClick:()=>{navigator.clipboard?.writeText(p),x(!0),setTimeout(()=>x(!1),2e3)},title:"Copy message",style:{position:"absolute",top:8,right:8,background:"none",border:"none",cursor:"pointer",fontSize:13,color:g?"#10b981":c.textMuted,padding:"2px 4px",borderRadius:4,transition:"color 0.2s"},children:g?"✓":"⎘"})]}),!u&&void 0!==a&&/* @__PURE__ */Ue("div",{style:{paddingInline:4,width:"100%",maxWidth:240},children:/* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:6},children:[/* @__PURE__ */Ue("div",{style:{flex:1,height:3,borderRadius:3,background:c.border,overflow:"hidden"},children:/* @__PURE__ */Ue("div",{style:{height:"100%",width:`${a}%`,background:(S=a,C=c.primary,S>=80?"#10b981":S>=55?C:S>=30?"#f59e0b":"#ef4444"),borderRadius:3,transition:"width 0.8s ease"}})}),/* @__PURE__ */Ye("span",{style:{fontSize:10,color:c.textMuted,whiteSpace:"nowrap"},children:[a,"% confident"]})]})})]}),
501
+ /* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }\n "})]});var S,C}function ys({color:e}){/* @__PURE__ */
502
+ return Ue("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(t=>/* @__PURE__ */Ue("div",{style:{width:7,height:7,borderRadius:"50%",background:e,animation:`tkx-thinking-dot 1.2s ease-in-out ${.18*t}s infinite`}},t))})}function bs({color:e}){/* @__PURE__ */
418
503
  return Ye("div",{style:{position:"relative",width:24,height:24},children:[
419
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.15,animation:"tkx-thinking-pulse 1.5s ease-out infinite"}}),
420
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:4,borderRadius:"50%",background:e,opacity:.6,animation:"tkx-thinking-pulse 1.5s ease-out 0.3s infinite"}}),
421
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:8,borderRadius:"50%",background:e}})]})}function oa({color:e}){/* @__PURE__ */
422
- return Ve("div",{style:{display:"flex",gap:3,alignItems:"center",height:20},children:[0,1,2,3,4].map(t=>/* @__PURE__ */Ve("div",{style:{width:3,borderRadius:3,background:e,animation:`tkx-thinking-wave 1s ease-in-out ${.1*t}s infinite`}},t))})}function ra({color:e}){/* @__PURE__ */
504
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.15,animation:"tkx-thinking-pulse 1.5s ease-out infinite"}}),
505
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:4,borderRadius:"50%",background:e,opacity:.6,animation:"tkx-thinking-pulse 1.5s ease-out 0.3s infinite"}}),
506
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:8,borderRadius:"50%",background:e}})]})}function vs({color:e}){/* @__PURE__ */
507
+ return Ue("div",{style:{display:"flex",gap:3,alignItems:"center",height:20},children:[0,1,2,3,4].map(t=>/* @__PURE__ */Ue("div",{style:{width:3,borderRadius:3,background:e,animation:`tkx-thinking-wave 1s ease-in-out ${.1*t}s infinite`}},t))})}function ws({color:e}){/* @__PURE__ */
423
508
  return Ye("div",{style:{position:"relative",width:28,height:28},children:[
424
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:`2px solid ${e}33`}}),
425
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:e,animation:"tkx-thinking-orbit 0.8s linear infinite"}}),
426
- /* @__PURE__ */Ve("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var ia={sm:12,md:14,lg:16};function la({label:e="Thinking…",steps:t,size:n="md",variant:o="dots",active:r=!0,className:i,style:l}){const a=b(),[s,d]=Oe(0);Ae(()=>{if(!t?.length||!r)return;const e=setInterval(()=>{d(e=>(e+1)%t.length)},1800);return()=>clearInterval(e)},[t,r]);const c=a.primary,u=ia[n],h={dots:/* @__PURE__ */Ve(ta,{color:c}),pulse:/* @__PURE__ */Ve(na,{color:c}),wave:/* @__PURE__ */Ve(oa,{color:c}),orbit:/* @__PURE__ */Ve(ra,{color:c})}[o];/* @__PURE__ */
427
- return Ye("div",{className:le(V("inline-flex flex-col gap-2"),i),style:l,role:"status","aria-live":"polite","aria-label":r?e:"Done thinking",children:[
428
- /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:10},children:[/* @__PURE__ */Ve("div",{style:{opacity:r?1:.35,transition:"opacity 0.3s"},children:r?h:/* @__PURE__ */Ve("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:/* @__PURE__ */Ve("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[/* @__PURE__ */Ve("span",{style:{fontSize:u,fontWeight:600,color:r?a.text:a.textMuted,transition:"color 0.3s"},children:r?t?t[s]:e:"Done"}),r&&/* @__PURE__ */Ve("span",{style:{fontSize:u-2,color:a.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),t&&t.length>1&&/* @__PURE__ */Ve("div",{style:{display:"flex",gap:4,paddingLeft:2},children:t.map((e,t)=>/* @__PURE__ */Ve("div",{style:{width:t===s?16:6,height:4,borderRadius:4,background:t===s?c:`${c}44`,transition:"all 0.3s ease"}},t))}),
429
- /* @__PURE__ */Ve("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})}export{Yl as FocusTrap,we as I18nContext,Ol as I18nProvider,s as LRUCache,Vl as LiveRegion,c as Quantum,Oi as SIZE_BORDER_RADIUS,Ei as SIZE_FONT,Fi as SIZE_HEIGHT,Pi as SIZE_ICON,Hi as SIZE_PADDING_X,ji as SIZE_PADDING_Y,ae as SecurityCore,K as Shield,Pl as SkipNav,D as TKX,I as ThemeContext,S as ThemeProvider,ea as TkxAIChatBubble,Jl as TkxAIConfidenceBar,la as TkxAIThinking,sn as TkxAccordion,$l as TkxAffix,pt as TkxAlert,Il as TkxAnchor,Br as TkxAppBar,yr as TkxAutocomplete,Wt as TkxAvatar,lt as TkxBadge,Fr as TkxBottomNav,mr as TkxBreadcrumb,Ze as TkxButton,Qe as TkxCard,tt as TkxCardBody,nt as TkxCardFooter,et as TkxCardHeader,hr as TkxCarousel,Wl as TkxCascader,to as TkxChat,eo as TkxChatBubble,jt as TkxCheckbox,No as TkxClock,Wi as TkxCol,_o as TkxColorPicker,cr as TkxCommand,Ri as TkxConfigProvider,Si as TkxContent,fl as TkxCountdown,_r as TkxDataGrid,$n as TkxDatePicker,Tt as TkxDivider,pn as TkxDrawer,_l as TkxDropdown,dl as TkxEmpty,On as TkxFileUpload,$i as TkxFooter,ve as TkxForm,be as TkxFormField,wi as TkxHeader,Fn as TkxImage,ot as TkxInput,vi as TkxLayout,Tl as TkxList,gi as TkxMarkdown,Jr as TkxMasonry,xl as TkxMentions,ko as TkxMenu,xt as TkxModal,tr as TkxNumberInput,ir as TkxOTP,El as TkxOrgChart,Rn as TkxPagination,tl as TkxParagraph,gr as TkxPopover,dt as TkxProgress,yl as TkxQRCode,Vt as TkxRadio,Yt as TkxRadioGroup,Gn as TkxRating,wl as TkxResult,ni as TkxRichTextDisplay,Mi as TkxRow,gl as TkxSegmented,Et as TkxSelect,Ci as TkxSider,Mt as TkxSkeleton,Wn as TkxSlider,Or as TkxSnackbar,Rr as TkxSpeedDial,ll as TkxSpin,pl as TkxStatistic,Ho as TkxStepper,kt as TkxTab,wt as TkxTabList,St as TkxTabPanel,Ct as TkxTabPanels,Rt as TkxTable,vt as TkxTabs,lo as TkxTag,ao as TkxTagInput,el as TkxText,Qn as TkxThinkingIndicator,fo as TkxTimeline,Qi as TkxTitle,on as TkxToastProvider,ut as TkxToggle,Sr as TkxToolbar,zt as TkxTooltip,kl as TkxTour,Lr as TkxTransferList,kr as TkxTreeView,Ro as TkxVideoPlayer,Cl as TkxWatermark,Ul as VisuallyHidden,C as WCAGEngine,X as audit,N as auroraLight,r as batchUpdate,v as breakpoints,oe as buildTkxCSP,y as contrastRatio,p as createFocusTrap,ee as createRateLimiter,f as createTheme,h as css,o as cssVar,le as cx,G as deepFreeze,te as extractAtomicCSS,n as extractCSS,i as fnv1aHash,d as fromObject,$ as generatePalette,W as getAccessibleForeground,q as getAuditLog,qi as getLocaleDisplayName,w as injectStyles,P as installFrameBuster,se as installTrustedTypes,ue as isFramed,Se as isRTL,Xi as isRtlLocale,Y as isSafeAttrName,e as keyframes,m as meetsAA,R as meetsAAA,l as memoize,u as prefersHighContrast,t as prefersReducedMotion,M as quantumDark,g as radii,re as resetAtomicCSS,_ as resolvePluginUtility,a as responsive,ce as sanitizeCSS,j as sanitizeHTML,A as sanitizeHref,de as sanitizeJSON,O as sanitizeProps,E as sanitizeString,F as sanitizeUnicode,H as scrubPII,k as shadows,J as sniffMimeType,L as spacing,V as tkx,ne as tkxListPlugins,ie as tkxPlugin,U as tkxRemovePlugin,Q as tx,x as typography,xe as useAnnounce,fe as useClickOutside,Ai as useComponentSize,Ti as useConfig,$e as useDirection,ge as useEscapeKey,pe as useFocusTrap,he as useHighContrast,ze as useI18n,Ne as useLocale,Yi as useLogicalSpacing,Bi as usePrefixCls,me as useReducedMotion,Vi as useRtlFlip,b as useTheme,lr as useTkxCommand,ye as useTkxForm,Jt as useToast,B as validateProps,Z as verifyAuditIntegrity,z as zIndex};
509
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:`2px solid ${e}33`}}),
510
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:e,animation:"tkx-thinking-orbit 0.8s linear infinite"}}),
511
+ /* @__PURE__ */Ue("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var ks={sm:12,md:14,lg:16};function Ss({label:e="Thinking…",steps:t,size:n="md",variant:o="dots",active:r=!0,className:i,style:a}){const l=N(),[s,d]=Ve(0);Fe(()=>{if(!t?.length||!r)return;const e=setInterval(()=>{d(e=>(e+1)%t.length)},1800);return()=>clearInterval(e)},[t,r]);const c=l.primary,u=ks[n],h={dots:/* @__PURE__ */Ue(ys,{color:c}),pulse:/* @__PURE__ */Ue(bs,{color:c}),wave:/* @__PURE__ */Ue(vs,{color:c}),orbit:/* @__PURE__ */Ue(ws,{color:c})}[o];/* @__PURE__ */
512
+ return Ye("div",{className:le(K("inline-flex flex-col gap-2"),i),style:a,role:"status","aria-live":"polite","aria-label":r?e:"Done thinking",children:[
513
+ /* @__PURE__ */Ye("div",{style:{display:"flex",alignItems:"center",gap:10},children:[/* @__PURE__ */Ue("div",{style:{opacity:r?1:.35,transition:"opacity 0.3s"},children:r?h:/* @__PURE__ */Ue("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:/* @__PURE__ */Ue("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),/* @__PURE__ */Ye("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[/* @__PURE__ */Ue("span",{style:{fontSize:u,fontWeight:600,color:r?l.text:l.textMuted,transition:"color 0.3s"},children:r?t?t[s]:e:"Done"}),r&&/* @__PURE__ */Ue("span",{style:{fontSize:u-2,color:l.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),t&&t.length>1&&/* @__PURE__ */Ue("div",{style:{display:"flex",gap:4,paddingLeft:2},children:t.map((e,t)=>/* @__PURE__ */Ue("div",{style:{width:t===s?16:6,height:4,borderRadius:4,background:t===s?c:`${c}44`,transition:"all 0.3s ease"}},t))}),
514
+ /* @__PURE__ */Ue("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})}export{Ja as COUNTRIES,ls as FocusTrap,be as I18nContext,rs as I18nProvider,d as LRUCache,as as LiveRegion,r as Quantum,Vi as SIZE_BORDER_RADIUS,Hi as SIZE_FONT,ji as SIZE_HEIGHT,Ki as SIZE_ICON,Pi as SIZE_PADDING_X,Oi as SIZE_PADDING_Y,se as SecurityCore,X as Shield,is as SkipNav,h as TKX,D as ThemeContext,$ as ThemeProvider,xs as TkxAIChatBubble,ms as TkxAIConfidenceBar,Ss as TkxAIThinking,Fl as TkxAadhaarInput,cn as TkxAccordion,ml as TkxAddressInput,Ia as TkxAffix,mt as TkxAlert,Ra as TkxAnchor,Fr as TkxAppBar,wr as TkxAutocomplete,Rt as TkxAvatar,st as TkxBadge,Zl as TkxBillingCycleToggle,jr as TkxBottomNav,xr as TkxBreadcrumb,Qe as TkxButton,Dl as TkxCalendarLunar,Va as TkxCaptcha,tt as TkxCard,ot as TkxCardBody,rt as TkxCardFooter,nt as TkxCardHeader,fr as TkxCarousel,Aa as TkxCascader,oo as TkxChat,no as TkxChatBubble,Ot as TkxCheckbox,Wl as TkxCheckout,Io as TkxClock,Ri as TkxCol,Jo as TkxColorPicker,hr as TkxCommand,vl as TkxConfetti,Ai as TkxConfigProvider,zi as TkxContent,ga as TkxCountdown,xl as TkxCurrencyInput,Jr as TkxDataGrid,Nn as TkxDatePicker,Bt as TkxDivider,mn as TkxDrawer,Xl as TkxDrivingLicenceInput,ps as TkxDropdown,ua as TkxEmpty,Vn as TkxFileUpload,_a as TkxFontProvider,Ni as TkxFooter,Me as TkxForm,ze as TkxFormField,Si as TkxHeader,jn as TkxImage,al as TkxImageEditor,it as TkxInput,ki as TkxLayout,Ea as TkxList,yi as TkxMarkdown,ei as TkxMasonry,ba as TkxMentions,Co as TkxMenu,bt as TkxModal,or as TkxNumberInput,lr as TkxOTP,ts as TkxOrgChart,An as TkxPagination,Hl as TkxPanInput,oa as TkxParagraph,ul as TkxPaymentButton,ol as TkxPhoneInput,_l as TkxPlanSelector,yr as TkxPopover,ut as TkxProgress,Gl as TkxProrationPreview,wa as TkxQRCode,Ut as TkxRadio,Yt as TkxRadioGroup,Gn as TkxRating,Sa as TkxResult,ri as TkxRichTextDisplay,Di as TkxRow,Cl as TkxSEO,ya as TkxSegmented,Ht as TkxSelect,$i as TkxSider,hl as TkxSignaturePad,Dt as TkxSkeleton,Rn as TkxSlider,Vr as TkxSnackbar,yl as TkxSortable,Ar as TkxSpeedDial,sa as TkxSpin,ma as TkxStatistic,Po as TkxStepper,Ct as TkxTab,St as TkxTabList,zt as TkxTabPanel,$t as TkxTabPanels,At as TkxTable,kt as TkxTabs,so as TkxTag,co as TkxTagInput,na as TkxText,to as TkxThinkingIndicator,go as TkxTimeline,ta as TkxTitle,an as TkxToastProvider,pt as TkxToggle,zr as TkxToolbar,Mt as TkxTooltip,Ca as TkxTour,Lr as TkxTransferList,Cr as TkxTreeView,Ao as TkxVideoPlayer,Vl as TkxVoterIdInput,Na as TkxWatermark,ss as VisuallyHidden,b as WCAGEngine,q as audit,M as auroraLight,i as batchUpdate,v as breakpoints,re as buildTkxCSP,y as contrastRatio,L as createFocusTrap,te as createRateLimiter,p as createTheme,o as css,n as cssVar,le as cx,Z as deepFreeze,ne as extractAtomicCSS,s as extractCSS,a as fnv1aHash,k as fromObject,z as generatePalette,A as getAccessibleForeground,_ as getAuditLog,Zi as getLocaleDisplayName,e as injectStyles,V as installFrameBuster,de as installTrustedTypes,he as isFramed,ke as isRTL,_i as isRtlLocale,U as isSafeAttrName,Tl as isValidAadhaar,Ul as isValidDrivingLicence,jl as isValidPan,Ol as isValidVoterId,w as keyframes,Za as loadFontScript,T as meetsAA,u as meetsAAA,c as memoize,t as prefersHighContrast,R as prefersReducedMotion,I as quantumDark,m as radii,ie as resetAtomicCSS,G as resolvePluginUtility,l as responsive,ue as sanitizeCSS,P as sanitizeHTML,F as sanitizeHref,ce as sanitizeJSON,O as sanitizeProps,j as sanitizeString,E as sanitizeUnicode,qa as scriptsForLanguage,H as scrubPII,$l as seoSchema,S as shadows,Q as sniffMimeType,W as spacing,K as tkx,oe as tkxListPlugins,ae as tkxPlugin,Y as tkxRemovePlugin,ee as tx,g as typography,Ga as unloadFontScript,ye as useAnnounce,me as useClickOutside,Ei as useComponentSize,Bi as useConfig,za as useDevtoolsOpen,Se as useDirection,xe as useEscapeKey,fe as useFocusTrap,pe as useHighContrast,Ce as useI18n,$e as useLocale,Yi as useLogicalSpacing,x as usePrefersColorScheme,Fi as usePrefixCls,ge as useReducedMotion,Ui as useRtlFlip,N as useTheme,sr as useTkxCommand,Ne as useTkxForm,en as useToast,B as validateProps,J as verifyAuditIntegrity,C as zIndex};