sparkdesign 0.4.4 → 0.4.6

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 (136) hide show
  1. package/README.md +74 -22
  2. package/cli/dist/commands/add.js +22 -12
  3. package/cli/dist/commands/diff.js +8 -4
  4. package/cli/dist/commands/init.js +84 -9
  5. package/cli/dist/commands/list.js +8 -4
  6. package/cli/dist/index.js +9 -6
  7. package/cli/dist/utils/config.js +16 -8
  8. package/cli/dist/utils/package-manager.js +75 -0
  9. package/cli/dist/utils/registry.js +8 -4
  10. package/cli/dist/utils/tokens.js +33 -25
  11. package/cli/dist/utils/transform.js +9 -5
  12. package/cli/dist/utils/tsconfig.js +182 -0
  13. package/cli/registry/AGENTS.md +18 -0
  14. package/cli/registry/__tests__/chat/thinking-indicator.test.tsx +2 -2
  15. package/cli/registry/chat/chat-input/chat-input-folder-selector.tsx +1 -1
  16. package/cli/registry/chat/chat-input/folder-permission-dialog.tsx +2 -2
  17. package/cli/registry/chat/image-generating.tsx +1 -1
  18. package/cli/registry/chat/response/context.tsx +1 -1
  19. package/cli/registry/chat/thinking-indicator.tsx +1 -1
  20. package/cli/registry/tokens/index.css +8 -5
  21. package/cli/registry/tokens/theme-base.css +235 -0
  22. package/{dist/tokens/themes/dark-qoder.css → cli/registry/tokens/themes/dark-mint.css} +1 -1
  23. package/cli/registry/tokens/themes/dark-parchment.css +104 -103
  24. package/{dist/tokens/themes/light-qoder.css → cli/registry/tokens/themes/light-mint.css} +1 -1
  25. package/cli/registry/tokens/themes/light-parchment.css +103 -102
  26. package/dist/registry/basic/alert-dialog.d.ts +7 -5
  27. package/dist/registry/basic/avatar.d.ts +7 -5
  28. package/dist/registry/basic/collapse.d.ts +7 -5
  29. package/dist/registry/basic/collapsible-card.d.ts +7 -6
  30. package/dist/registry/basic/collapsible.d.ts +7 -5
  31. package/dist/registry/basic/dropdown-menu.d.ts +7 -5
  32. package/dist/registry/basic/icons-inline.d.ts +7 -5
  33. package/dist/registry/basic/kbd.d.ts +7 -5
  34. package/dist/registry/basic/pagination.d.ts +7 -5
  35. package/dist/registry/basic/progress.d.ts +7 -5
  36. package/dist/registry/basic/radio-group.d.ts +7 -5
  37. package/dist/registry/basic/resizable.d.ts +7 -5
  38. package/dist/registry/basic/select.d.ts +7 -5
  39. package/dist/registry/basic/slider.d.ts +7 -5
  40. package/dist/registry/basic/sonner.d.ts +7 -5
  41. package/dist/registry/basic/switch.d.ts +7 -5
  42. package/dist/registry/basic/tabs.d.ts +7 -5
  43. package/dist/registry/basic/tag.d.ts +7 -5
  44. package/dist/registry/basic/theme-from-document.d.ts +7 -5
  45. package/dist/registry/basic/tooltip.d.ts +7 -5
  46. package/dist/registry/basic/typography.d.ts +7 -5
  47. package/dist/registry/chat/ask-user-part.d.ts +9 -3
  48. package/dist/registry/chat/browser-action-part.d.ts +9 -3
  49. package/dist/registry/chat/chat-input/compound.d.ts +7 -5
  50. package/dist/registry/chat/chat-input/context.d.ts +7 -5
  51. package/dist/registry/chat/chat-input/index.d.ts +7 -5
  52. package/dist/registry/chat/chat-input/types.d.ts +9 -3
  53. package/dist/registry/chat/chat-input/useAutoResizeTextarea.d.ts +9 -3
  54. package/dist/registry/chat/code-block-part.d.ts +9 -3
  55. package/dist/registry/chat/file-attachment.d.ts +7 -5
  56. package/dist/registry/chat/file-review-part.d.ts +9 -4
  57. package/dist/registry/chat/generated-images-grid.d.ts +9 -3
  58. package/dist/registry/chat/generation-status-bar.d.ts +8 -4
  59. package/dist/registry/chat/hint-banner.d.ts +9 -3
  60. package/dist/registry/chat/mermaid-part.d.ts +9 -3
  61. package/dist/registry/chat/plan-part.d.ts +9 -3
  62. package/dist/registry/chat/reasoning-step/index.d.ts +8 -6
  63. package/dist/registry/chat/reasoning-step/types.d.ts +9 -3
  64. package/dist/registry/chat/related-prompts.d.ts +9 -3
  65. package/dist/registry/chat/response/index.d.ts +8 -6
  66. package/dist/registry/chat/response/types.d.ts +9 -3
  67. package/dist/registry/chat/task-part.d.ts +9 -3
  68. package/dist/registry/chat/terminal-code-block-part.d.ts +9 -3
  69. package/dist/registry/chat/user-question/UserQuestionCard.d.ts +9 -3
  70. package/dist/registry/chat/user-question/UserQuestionFooter.d.ts +9 -3
  71. package/dist/registry/chat/user-question/UserQuestionHeader.d.ts +9 -3
  72. package/dist/registry/chat/user-question/types.d.ts +8 -5
  73. package/dist/registry/lib/file-icon-maps.d.ts +7 -7
  74. package/dist/registry/lib/utils.d.ts +8 -6
  75. package/dist/spark-design.cjs.js +6 -6
  76. package/dist/spark-design.es.js +10 -10
  77. package/dist/sparkdesign.css +2 -0
  78. package/dist/src/components/basic/AlertDialog/index.d.ts +7 -5
  79. package/dist/src/components/basic/Avatar/index.d.ts +9 -3
  80. package/dist/src/components/basic/Button/index.d.ts +9 -3
  81. package/dist/src/components/basic/Collapse/index.d.ts +7 -4
  82. package/dist/src/components/basic/Collapsible/index.d.ts +9 -4
  83. package/dist/src/components/basic/CollapsibleCard/index.d.ts +9 -3
  84. package/dist/src/components/basic/CollapsibleSection/index.d.ts +7 -7
  85. package/dist/src/components/basic/DropdownMenu/index.d.ts +7 -5
  86. package/dist/src/components/basic/EllipsisText/index.d.ts +7 -15
  87. package/dist/src/components/basic/IconButton/index.d.ts +9 -3
  88. package/dist/src/components/basic/Kbd/index.d.ts +9 -3
  89. package/dist/src/components/basic/OptionList/index.d.ts +9 -3
  90. package/dist/src/components/basic/Pagination/index.d.ts +9 -3
  91. package/dist/src/components/basic/Progress/index.d.ts +9 -3
  92. package/dist/src/components/basic/RadioGroup/index.d.ts +9 -3
  93. package/dist/src/components/basic/Resizable/index.d.ts +9 -3
  94. package/dist/src/components/basic/Scrollbar/index.d.ts +9 -3
  95. package/dist/src/components/basic/Select/index.d.ts +7 -4
  96. package/dist/src/components/basic/ShimmeringText/index.d.ts +9 -3
  97. package/dist/src/components/basic/Skeleton/index.d.ts +9 -3
  98. package/dist/src/components/basic/Slider/index.d.ts +9 -3
  99. package/dist/src/components/basic/Spinner/index.d.ts +9 -3
  100. package/dist/src/components/basic/Switch/index.d.ts +8 -5
  101. package/dist/src/components/basic/Table/index.d.ts +9 -3
  102. package/dist/src/components/basic/Tabs/index.d.ts +9 -3
  103. package/dist/src/components/basic/Tag/index.d.ts +7 -4
  104. package/dist/src/components/basic/Toggle/index.d.ts +9 -3
  105. package/dist/src/components/basic/Tooltip/index.d.ts +7 -4
  106. package/dist/src/components/basic/Typography/index.d.ts +9 -3
  107. package/dist/src/components/chat/GeneratedImagesGrid/index.d.ts +9 -3
  108. package/dist/src/components/chat/GenerationStatusBar/index.d.ts +9 -3
  109. package/dist/src/components/chat/Markdown/demo-content.d.ts +1 -1
  110. package/dist/src/components/chat/Markdown/index.d.ts +9 -3
  111. package/dist/src/components/chat/Response/StreamingMarkdownBlock.d.ts +9 -3
  112. package/dist/src/components/chat/Response/index.d.ts +8 -6
  113. package/dist/src/components/chat/UserMessage/index.d.ts +9 -3
  114. package/dist/src/components/index.d.ts +7 -9
  115. package/dist/src/icons/context.d.ts +7 -6
  116. package/dist/src/icons/types.d.ts +7 -5
  117. package/dist/src/lib/ThemeStyleContext.d.ts +9 -9
  118. package/dist/src/lib/file-icon.d.ts +7 -6
  119. package/dist/src/lib/i18n.d.ts +7 -6
  120. package/dist/src/lib/index.d.ts +9 -3
  121. package/dist/src/lib/utils.d.ts +7 -5
  122. package/dist/theme-base.css +7 -8
  123. package/dist/theme.css +2 -2
  124. package/dist/themes/{dark-qoder.css → dark-mint.css} +1 -1
  125. package/dist/themes/{light-qoder.css → light-mint.css} +1 -1
  126. package/dist/tokens/AGENTS.md +47 -0
  127. package/dist/tokens/index.css +10 -19
  128. package/dist/tokens/theme-base.css +7 -8
  129. package/dist/tokens/theme.css +2 -2
  130. package/dist/tokens/themes/dark-mint.css +133 -0
  131. package/dist/tokens/themes/light-mint.css +132 -0
  132. package/package.json +11 -5
  133. package/cli/registry/tokens/themes/dark-qoder.css +0 -132
  134. package/cli/registry/tokens/themes/light-qoder.css +0 -131
  135. package/dist/qoder-design.css +0 -2
  136. package/dist/tokens/CLAUDE.md +0 -305
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),x=require("react"),te=require("framer-motion"),Qi=require("@radix-ui/react-tooltip"),ke=require("clsx"),Yi=require("@radix-ui/react-dropdown-menu"),se=require("class-variance-authority"),Ki=require("@radix-ui/react-alert-dialog"),Xi=require("@radix-ui/react-switch"),ia=require("react-dom"),la=require("sonner"),Ji=require("@radix-ui/react-select"),el=require("react-markdown"),tl=require("remark-gfm"),nl=require("remark-math"),sl=require("rehype-katex"),ws=require("lottie-react"),ca=require("react-i18next"),al=require("@radix-ui/react-avatar"),rl=require("@radix-ui/react-accordion"),ol=require("@radix-ui/react-progress"),il=require("@radix-ui/react-radio-group"),jn=require("react-resizable-panels"),ll=require("@radix-ui/react-slider"),cl=require("@radix-ui/react-tabs"),dl=require("@radix-ui/react-toggle"),ul=require("@radix-ui/react-toggle-group");function ue(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const N=ue(x),qe=ue(Qi),K=ue(Yi),ce=ue(Ki),Ns=ue(Xi),ae=ue(Ji),Ye=ue(al),st=ue(rl),js=ue(ol),xn=ue(il),wt=ue(ll),Be=ue(cl),pl=ue(dl),hn=ue(ul),yn=se.cva("inline-flex items-center justify-center gap-1.5 font-medium transition-colors duration-200 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",{variants:{variant:{primary:"bg-primary text-text-on-primary hover:bg-primary-hover",secondary:"bg-bg-highlight text-text-on-primary hover:bg-bg-highlight-hover",tertiary:"bg-fill-secondary text-text hover:bg-fill",ghost:"bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text",text:"bg-transparent text-text-secondary hover:text-text"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-11 px-4 text-base"},rounded:{square:"rounded",pill:"rounded-full"},textOnly:{true:"h-auto px-0 py-0.5",false:""}},compoundVariants:[{textOnly:!0,size:"sm",className:"text-xs"},{textOnly:!0,size:"md",className:"text-sm"},{textOnly:!0,size:"lg",className:"text-base"}],defaultVariants:{variant:"ghost",size:"md",rounded:"square",textOnly:!1}}),ne=x.forwardRef(({variant:e="ghost",children:t,size:s="md",textButton:a=!1,prefixIcon:r,suffixIcon:o,rounded:i="square",disabled:l=!1,className:c,...d},p)=>n.jsxs("button",{ref:p,className:yn({variant:a?"text":e,size:s,rounded:i,textOnly:a,className:c}),disabled:l,...d,children:[r&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:r}),t,o&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:o})]}));ne.displayName="Button";const ml=(e,t)=>{const s=new Array(e.length+t.length);for(let a=0;a<e.length;a++)s[a]=e[a];for(let a=0;a<t.length;a++)s[e.length+a]=t[a];return s},fl=(e,t)=>({classGroupId:e,validator:t}),da=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),_t="-",Cs=[],gl="arbitrary..",xl=e=>{const t=yl(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return hl(i);const l=i.split(_t),c=l[0]===""&&l.length>1?1:0;return ua(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=s[i];return c?d?ml(d,c):c:d||Cs}return s[i]||Cs}}},ua=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],o=s.nextPart.get(r);if(o){const d=ua(e,t+1,o);if(d)return d}const i=s.validators;if(i===null)return;const l=t===0?e.join(_t):e.slice(t).join(_t),c=i.length;for(let d=0;d<c;d++){const p=i[d];if(p.validator(l))return p.classGroupId}},hl=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?gl+a:void 0})(),yl=e=>{const{theme:t,classGroups:s}=e;return bl(s,t)},bl=(e,t)=>{const s=da();for(const a in e){const r=e[a];Cn(r,s,a,t)}return s},Cn=(e,t,s,a)=>{const r=e.length;for(let o=0;o<r;o++){const i=e[o];vl(i,t,s,a)}},vl=(e,t,s,a)=>{if(typeof e=="string"){kl(e,t,s);return}if(typeof e=="function"){wl(e,t,s,a);return}Nl(e,t,s,a)},kl=(e,t,s)=>{const a=e===""?t:pa(t,e);a.classGroupId=s},wl=(e,t,s,a)=>{if(jl(e)){Cn(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(fl(s,e))},Nl=(e,t,s,a)=>{const r=Object.entries(e),o=r.length;for(let i=0;i<o;i++){const[l,c]=r[i];Cn(c,pa(t,l),s,a)}},pa=(e,t)=>{let s=e;const a=t.split(_t),r=a.length;for(let o=0;o<r;o++){const i=a[o];let l=s.nextPart.get(i);l||(l=da(),s.nextPart.set(i,l)),s=l}return s},jl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Cl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(o,i)=>{s[o]=i,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(o){let i=s[o];if(i!==void 0)return i;if((i=a[o])!==void 0)return r(o,i),i},set(o,i){o in s?s[o]=i:r(o,i)}}},bn="!",Ss=":",Sl=[],Is=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),Il=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const o=[];let i=0,l=0,c=0,d;const p=r.length;for(let g=0;g<p;g++){const f=r[g];if(i===0&&l===0){if(f===Ss){o.push(r.slice(c,g)),c=g+1;continue}if(f==="/"){d=g;continue}}f==="["?i++:f==="]"?i--:f==="("?l++:f===")"&&l--}const m=o.length===0?r:r.slice(c);let b=m,w=!1;m.endsWith(bn)?(b=m.slice(0,-1),w=!0):m.startsWith(bn)&&(b=m.slice(1),w=!0);const u=d&&d>c?d-c:void 0;return Is(o,w,b,u)};if(t){const r=t+Ss,o=a;a=i=>i.startsWith(r)?o(i.slice(r.length)):Is(Sl,!1,i,void 0,!0)}if(s){const r=a;a=o=>s({className:o,parseClassName:r})}return a},Rl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let o=0;o<s.length;o++){const i=s[o],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},Al=e=>({cache:Cl(e.cacheSize),parseClassName:Il(e),sortModifiers:Rl(e),...xl(e)}),El=/\s+/,Tl=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:o}=t,i=[],l=e.trim().split(El);let c="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{isExternal:m,modifiers:b,hasImportantModifier:w,baseClassName:u,maybePostfixModifierPosition:g}=s(p);if(m){c=p+(c.length>0?" "+c:c);continue}let f=!!g,k=a(f?u.substring(0,g):u);if(!k){if(!f){c=p+(c.length>0?" "+c:c);continue}if(k=a(u),!k){c=p+(c.length>0?" "+c:c);continue}f=!1}const h=b.length===0?"":b.length===1?b[0]:o(b).join(":"),v=w?h+bn:h,S=v+k;if(i.indexOf(S)>-1)continue;i.push(S);const C=r(k,f);for(let T=0;T<C.length;++T){const E=C[T];i.push(v+E)}c=p+(c.length>0?" "+c:c)}return c},Ll=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=ma(s))&&(r&&(r+=" "),r+=a);return r},ma=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=ma(e[a]))&&(s&&(s+=" "),s+=t);return s},_l=(e,...t)=>{let s,a,r,o;const i=c=>{const d=t.reduce((p,m)=>m(p),e());return s=Al(d),a=s.cache.get,r=s.cache.set,o=l,l(c)},l=c=>{const d=a(c);if(d)return d;const p=Tl(c,s);return r(c,p),p};return o=i,(...c)=>o(Ll(...c))},Pl=[],le=e=>{const t=s=>s[e]||Pl;return t.isThemeGetter=!0,t},fa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ga=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fl=/^\d+\/\d+$/,zl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ol=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$l=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ve=e=>Fl.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>!!e&&Number.isInteger(Number(e)),pn=e=>e.endsWith("%")&&B(e.slice(0,-1)),Se=e=>zl.test(e),xa=()=>!0,Bl=e=>Dl.test(e)&&!Ml.test(e),Sn=()=>!1,Gl=e=>Ol.test(e),Hl=e=>$l.test(e),Ul=e=>!L(e)&&!_(e),Vl=e=>Le(e,ba,Sn),L=e=>fa.test(e),De=e=>Le(e,va,Bl),Rs=e=>Le(e,Jl,B),ql=e=>Le(e,wa,xa),Wl=e=>Le(e,ka,Sn),As=e=>Le(e,ha,Sn),Zl=e=>Le(e,ya,Hl),Nt=e=>Le(e,Na,Gl),_=e=>ga.test(e),Xe=e=>Ge(e,va),Ql=e=>Ge(e,ka),Es=e=>Ge(e,ha),Yl=e=>Ge(e,ba),Kl=e=>Ge(e,ya),jt=e=>Ge(e,Na,!0),Xl=e=>Ge(e,wa,!0),Le=(e,t,s)=>{const a=fa.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Ge=(e,t,s=!1)=>{const a=ga.exec(e);return a?a[1]?t(a[1]):s:!1},ha=e=>e==="position"||e==="percentage",ya=e=>e==="image"||e==="url",ba=e=>e==="length"||e==="size"||e==="bg-size",va=e=>e==="length",Jl=e=>e==="number",ka=e=>e==="family-name",wa=e=>e==="number"||e==="weight",Na=e=>e==="shadow",ec=()=>{const e=le("color"),t=le("font"),s=le("text"),a=le("font-weight"),r=le("tracking"),o=le("leading"),i=le("breakpoint"),l=le("container"),c=le("spacing"),d=le("radius"),p=le("shadow"),m=le("inset-shadow"),b=le("text-shadow"),w=le("drop-shadow"),u=le("blur"),g=le("perspective"),f=le("aspect"),k=le("ease"),h=le("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),_,L],T=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],I=()=>[_,L,c],F=()=>[Ve,"full","auto",...I()],Q=()=>[Ee,"none","subgrid",_,L],z=()=>["auto",{span:["full",Ee,_,L]},Ee,_,L],G=()=>[Ee,"auto",_,L],re=()=>["auto","min","max","fr",_,L],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...I()],ee=()=>[Ve,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],A=()=>[e,_,L],O=()=>[...S(),Es,As,{position:[_,L]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",Yl,Vl,{size:[_,L]}],Z=()=>[pn,Xe,De],V=()=>["","none","full",d,_,L],ie=()=>["",B,Xe,De],he=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[B,pn,Es,As],Re=()=>["","none",u,_,L],ge=()=>["none",B,_,L],Ae=()=>["none",B,_,L],D=()=>[B,_,L],P=()=>[Ve,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Se],breakpoint:[Se],color:[xa],container:[Se],"drop-shadow":[Se],ease:["in","out","in-out"],font:[Ul],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Se],shadow:[Se],spacing:["px",B],text:[Se],"text-shadow":[Se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ve,L,_,f]}],container:["container"],columns:[{columns:[B,L,_,l]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Ee,"auto",_,L]}],basis:[{basis:[Ve,"full","auto",l,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[B,Ve,"auto","initial","none",L]}],grow:[{grow:["",B,_,L]}],shrink:[{shrink:["",B,_,L]}],order:[{order:[Ee,"first","last","none",_,L]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],w:[{w:[l,"screen",...ee()]}],"min-w":[{"min-w":[l,"screen","none",...ee()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",s,Xe,De]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Xl,ql]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pn,L]}],"font-family":[{font:[Ql,Wl,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,_,L]}],"line-clamp":[{"line-clamp":[B,"none",_,Rs]}],leading:[{leading:[o,...I()]}],"list-image":[{"list-image":["none",_,L]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_,L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[B,"from-font","auto",_,De]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[B,"auto",_,L]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_,L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_,L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ee,_,L],radial:["",_,L],conic:[Ee,_,L]},Kl,Zl]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[B,_,L]}],"outline-w":[{outline:["",B,Xe,De]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",p,jt,Nt]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",m,jt,Nt]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[B,De]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,jt,Nt]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[B,_,L]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[_,L]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_,L]}],filter:[{filter:["","none",_,L]}],blur:[{blur:Re()}],brightness:[{brightness:[B,_,L]}],contrast:[{contrast:[B,_,L]}],"drop-shadow":[{"drop-shadow":["","none",w,jt,Nt]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",B,_,L]}],"hue-rotate":[{"hue-rotate":[B,_,L]}],invert:[{invert:["",B,_,L]}],saturate:[{saturate:[B,_,L]}],sepia:[{sepia:["",B,_,L]}],"backdrop-filter":[{"backdrop-filter":["","none",_,L]}],"backdrop-blur":[{"backdrop-blur":Re()}],"backdrop-brightness":[{"backdrop-brightness":[B,_,L]}],"backdrop-contrast":[{"backdrop-contrast":[B,_,L]}],"backdrop-grayscale":[{"backdrop-grayscale":["",B,_,L]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,_,L]}],"backdrop-invert":[{"backdrop-invert":["",B,_,L]}],"backdrop-opacity":[{"backdrop-opacity":[B,_,L]}],"backdrop-saturate":[{"backdrop-saturate":[B,_,L]}],"backdrop-sepia":[{"backdrop-sepia":["",B,_,L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_,L]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[B,"initial",_,L]}],ease:[{ease:["linear","initial",k,_,L]}],delay:[{delay:[B,_,L]}],animate:[{animate:["none",h,_,L]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,_,L]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:D()}],"skew-x":[{"skew-x":D()}],"skew-y":[{"skew-y":D()}],transform:[{transform:[_,L,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_,L]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_,L]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[B,Xe,De,Rs]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tc=_l(ec);function y(...e){return tc(ke.clsx(e))}const nc=se.cva("flex-none shrink-0 inline-flex items-center justify-center box-border transition-colors duration-200 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer [&>*]:flex [&>*]:items-center [&>*]:justify-center [&>*]:size-full [&>*]:[&>svg]:block [&>*]:[&>svg]:leading-none",{variants:{variant:{primary:"bg-primary text-text-on-primary hover:bg-primary-hover",secondary:"bg-bg-highlight text-text-on-primary hover:bg-bg-highlight-hover",tertiary:"bg-fill-secondary text-text hover:bg-fill",ghost:"bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text",iconOnly:"bg-transparent text-text-secondary hover:text-text"},rounded:{square:"rounded",pill:"rounded-full"},size:{sm:"h-7 w-7 min-h-7 min-w-7 p-1.5",md:"h-9 w-9 min-h-9 min-w-9 p-1.5",lg:"h-11 w-11 min-h-11 min-w-11 p-2"}},defaultVariants:{variant:"secondary",size:"md",rounded:"square"}}),je=x.forwardRef(({variant:e="secondary",size:t="md",rounded:s="square",icon:a,disabled:r=!1,className:o,...i},l)=>n.jsx("button",{ref:l,className:y(nc({variant:e,size:t,rounded:s}),o),disabled:r,...i,children:n.jsx("span",{className:"inline-flex shrink-0 size-full items-center justify-center",children:a})}));je.displayName="IconButton";function Ke(){if(typeof document>"u")return{};const e=document.documentElement,t={},s=e.getAttribute("data-theme"),a=e.getAttribute("data-style");return s&&(t["data-theme"]=s),a&&(t["data-style"]=a),t}const sc=qe.Provider,ac=qe.Root,rc=qe.Trigger,ja=N.forwardRef(({className:e,sideOffset:t=8,children:s,dataStyle:a,dataTheme:r,...o},i)=>{const l=Ke(),c=a!==void 0?{"data-style":a,"data-theme":r??l["data-theme"]??""}:l;return n.jsx(qe.Portal,{children:n.jsx("div",{style:{display:"contents"},...c,children:n.jsx(qe.Content,{ref:i,sideOffset:t,className:y("z-50 max-w-60 overflow-hidden rounded px-2 py-1 text-xs leading-5","bg-bg-highlight text-text-on-primary shadow-sm",e),...o,children:n.jsx(te.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15},children:s})})})})});ja.displayName=qe.Content.displayName;function at({content:e,children:t,side:s="top",contentClassName:a,dataStyle:r,dataTheme:o}){return n.jsx(sc,{delayDuration:300,children:n.jsxs(ac,{children:[n.jsx(rc,{asChild:!0,children:t}),n.jsx(ja,{side:s,className:a,dataStyle:r,dataTheme:o,children:e})]})})}at.displayName="Tooltip";const Ca=x.createContext(null);function Sa(e){return typeof e=="object"&&"name"in e}function Ia(e){return typeof e=="object"&&"name"in e}function oc(e,t){return Sa(t)?`${e}-${t.name}`:t==="qoder"?e:`${e}-${t}`}function ic(e){return Ia(e)?e.name:e}function lc(e,t){const s={};if(Sa(e)){const{tokens:a}=e;for(const[r,o]of Object.entries(a))if(o!==void 0){const i=r.startsWith("--")?r:`--${r}`;s[i]=o}}if(Ia(t)){const{radius:a,spacing:r,fontSize:o}=t;a&&(a.sm&&(s["--radius-sm"]=a.sm),a.default&&(s["--radius-DEFAULT"]=a.default),a.md&&(s["--radius-md"]=a.md),a.lg&&(s["--radius-lg"]=a.lg),a.xl&&(s["--radius-xl"]=a.xl),a["2xl"]&&(s["--radius-2xl"]=a["2xl"]),a["3xl"]&&(s["--radius-3xl"]=a["3xl"])),r&&(r[3]&&(s["--spacing-3"]=r[3]),r[4]&&(s["--spacing-4"]=r[4]),r[9]&&(s["--spacing-9"]=r[9]),r[11]&&(s["--spacing-11"]=r[11])),o&&(o.sm&&(s["--font-size-sm"]=o.sm),o.lg&&(s["--font-size-lg"]=o.lg),o.xl&&(s["--font-size-xl"]=o.xl),o["2xl"]&&(s["--font-size-2xl"]=o["2xl"]),o["3xl"]&&(s["--font-size-3xl"]=o["3xl"]))}return s}function cc({children:e,appearance:t="light",theme:s="qoder",style:a="neutral"}){const r=x.useMemo(()=>oc(t,s),[t,s]),o=x.useMemo(()=>ic(a),[a]),i=x.useMemo(()=>lc(s,a),[s,a]),l=x.useMemo(()=>({appearance:t,themeConfig:s,styleConfig:a,dataTheme:r,dataStyle:o,theme:r,style:o}),[t,s,a,r,o]),c=Object.keys(i).length>0;return n.jsx(Ca.Provider,{value:l,children:n.jsx("div",{"data-theme":r,"data-style":o,style:c?i:void 0,children:e})})}function me(){const e=x.useContext(Ca);return e||{appearance:"light",themeConfig:"qoder",styleConfig:"neutral",dataTheme:"light",dataStyle:"neutral",theme:"light",style:"neutral"}}function In({placement:e,side:t=e??"top",...s}){const{style:a,theme:r}=me();return n.jsx(at,{side:t,dataStyle:a,dataTheme:r,...s})}In.displayName="Tooltip";function Ts(e,t){e&&(typeof e=="function"?e(t):e.current=t)}const Ra=x.forwardRef(({children:e,lines:t=1,className:s="",placement:a="top",tooltipClassName:r="",tooltipContent:o,disabled:i=!1,style:l,as:c="span"},d)=>{const p=x.useRef(null),[m,b]=x.useState(!1),w=x.useCallback(()=>{const h=p.current;if(!h)return;const v=t===1?h.scrollWidth>h.clientWidth:h.scrollHeight>h.clientHeight;b(v)},[t]);x.useEffect(()=>{const h=requestAnimationFrame(()=>w()),v=p.current;if(!v)return()=>cancelAnimationFrame(h);const S=new ResizeObserver(()=>w());return S.observe(v),window.addEventListener("resize",w),()=>{cancelAnimationFrame(h),S.disconnect(),window.removeEventListener("resize",w)}},[w,e]);const u=t===1?{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...l}:{overflow:"hidden",display:"-webkit-box",WebkitLineClamp:t,WebkitBoxOrient:"vertical",...l},g=x.useCallback(h=>{Ts(p,h),Ts(d,h)},[d]),f=n.jsx(c,{ref:g,className:s,style:u,children:e});return m&&!i?n.jsx(In,{content:o??e,placement:a,contentClassName:ke.clsx(r),children:n.jsx("span",{ref:g,className:s,style:u,children:e})}):f});Ra.displayName="EllipsisText";const dc="flex flex-col gap-1",uc=se.cva("w-full flex flex-col gap-0.5 items-start p-2 text-sm rounded text-left transition-colors outline-none focus-visible:bg-fill-tertiary focus-visible:ring-0",{variants:{selected:{true:"",false:""},disabled:{true:"opacity-50 cursor-not-allowed",false:"cursor-pointer hover:bg-fill-tertiary"},dimmed:{true:"opacity-40",false:""}},defaultVariants:{selected:!1,disabled:!1,dimmed:!1}}),pc=se.cva("flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-xs font-mono font-medium transition-colors",{variants:{selected:{true:"bg-primary-active text-text-on-primary",false:"bg-fill-secondary text-text-tertiary"}},defaultVariants:{selected:!1}}),Rn=x.forwardRef(({items:e,selectedIds:t=[],focusedId:s,onItemClick:a,showPrefix:r=!0,disabled:o=!1,className:i,...l},c)=>{const d=p=>String(p+1);return n.jsx("div",{ref:c,role:"listbox","aria-multiselectable":t.length>1,className:y(dc,i),...l,children:e.map((p,m)=>{const b=t.includes(p.id),w=s===p.id,u=o||p.disabled,f=t.length>0&&!b&&!u;return n.jsxs("button",{type:"button",role:"option","aria-selected":b,"aria-disabled":u,onClick:()=>{u||a?.(p,m)},disabled:u,className:y(uc({selected:b,disabled:u,dimmed:f}),w&&"bg-fill-tertiary"),children:[n.jsxs("div",{className:"flex items-center gap-3",children:[r&&n.jsx("div",{className:pc({selected:b}),children:d(m)}),n.jsx("span",{className:"font-medium text-text",children:p.label})]}),p.description&&n.jsx("div",{className:"ml-8 text-xs text-text-tertiary",children:p.description})]},p.id)})})});Rn.displayName="OptionList";const mc="0 0 24 24",fc="1em";function U(e,t){const s=N.forwardRef(({className:a,size:r=fc,...o},i)=>n.jsx("svg",{ref:i,viewBox:mc,width:r,height:r,fill:"currentColor",className:a,xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,...o,children:n.jsx("path",{d:e})}));return s.displayName=t,s}U("M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z","ArrowDownLine");const An=U("M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z","ArrowUpLine"),ot=U("M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z","ArrowRightLine"),gc=U("M7.82843 10.9999H20V12.9999H7.82843L13.1924 18.3638L11.7782 19.778L4 11.9999L11.7782 4.22168L13.1924 5.63589L7.82843 10.9999Z","ArrowLeftLine"),Ie=U("M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z","CheckLine"),_e=U("M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z","CloseLine"),Aa=U("M10.5859 12L2.79297 4.20706L4.20718 2.79285L12.0001 10.5857L19.793 2.79285L21.2072 4.20706L13.4143 12L21.2072 19.7928L19.793 21.2071L12.0001 13.4142L4.20718 21.2071L2.79297 19.7928L10.5859 12Z","CloseLargeLine"),xc=U("M24 12L18.3431 17.6569L16.9289 16.2426L21.1716 12L16.9289 7.75736L18.3431 6.34315L24 12ZM2.82843 12L7.07107 16.2426L5.65685 17.6569L0 12L5.65685 6.34315L7.07107 7.75736L2.82843 12ZM9.78845 21H7.66009L14.2116 3H16.3399L9.78845 21Z","CodeSSlashLine"),Ea=U("M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z","EyeLine"),Ta=U("M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z","LoaderLine"),hc=U("M1.946 9.315c-.946-.35-.946-1.09 0-1.436l18.108-6.732c.946-.35 1.704.21 1.573 1.236L20.1 21.894c-.117.932-.93 1.636 1.897 1.636.967 0 1.754-.704 1.636-1.636l-.527-4.18L10 12 20.073 7.264l-.527-4.18c-.117-.932.67-1.636 1.637-1.636.967 0 2.014.704 1.897 1.636L21.627 18.57c-.131 1.026-.627 1.586-1.573 1.236L1.946 9.315Z","SendPlaneLine"),yc=U("M6 6h12v12H6V6Zm2 2v8h8V8H8Z","StopLine"),bc=U("M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3Zm0 14a5 5 0 0 0 5-5v-1a1 1 0 1 1 2 0v1a7 7 0 0 1-14 0v-1a1 1 0 1 1 2 0v1a5 5 0 0 0 5 5Z","MicLine"),La=U("M3 3h8.828l2 2H21a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm2 2v12h14V7h-8.414l-2-2H5Z","FolderLine"),_a=U("M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2Z","FolderFillLine"),En=U("M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm4 18H6V4h7v5h5v11z","FileLine"),Pa=U("M12 2C6.477 2 2 6.477 2 12c0 1.5.328 2.932.917 4.215L1.5 21l4.785-1.417A9.966 9.966 0 0 0 12 22c5.523 0 10-4.477 10-10S17.523 2 12 2zm0 2a8 8 0 1 1 0 16 7.99 7.99 0 0 1-3.918-1.018l-.26-.15-2.683.795.795-2.683-.15-.26A7.99 7.99 0 0 1 4 12a8 8 0 0 1 8-8z","Chat3Line"),it=U("M12 7a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V8a1 1 0 0 1 1-1zm0 10a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5z","WarningLine"),ye=U("M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z","ArrowDownSLine"),Tn=U("M14 2l.5 2.5L17 5l-2.5.5L14 8l-.5-2.5L11 5l2.5-.5L14 2zM6 12l1 4 4 1 1-4-4-1-1-4zm8-2l.5 2.5 2.5.5-2.5.5-.5 2.5-.5-2.5-2.5-.5 2.5-.5.5-2.5z","SparklingLine"),Fa=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm1 2v5.586l3.707 3.707-1.414 1.414L11 11.414V6h2z","TimeLine"),Bt=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm3.536 5.536l-4.95 4.95-2.121-2.122-1.414 1.414 3.535 3.536 6.364-6.364-1.414-1.414z","CheckboxCircleLine"),za=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm3.536 2.464l-1.414 1.414L12 10.586 9.878 8.464 8.464 9.878 10.586 12l-2.122 2.121 1.414 1.415L12 13.414l2.121 2.122 1.415-1.414L13.414 12l2.122-2.121z","CloseCircleLine"),Da=U("M6 12c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z","MoreLine"),vc=U("M5.763 17H20V5H4v13.385L5.763 17zm.692 2L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455z","QuestionAnswerLine"),Ma=U("M7 14h10v2H7v-2zm0-4h10v2H7v-2zm0-4h10v2H7V6zm-4 12h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3V6z","RequestChangesLine"),Oa=U("M3 5h2v2H3V5zm4 0h14v2H7V5zm-4 6h2v2H3v-2zm4 0h14v2H7v-2zm-4 6h2v2H3v-2zm4 0h14v2H7v-2z","CatalogLine"),$a=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16z","CircleLine"),Ba=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm4 5v2H8V9h8z","IndeterminateCircleLine"),Ga=U("M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm4 10l-4-4v3H6v2h6v3l4-4z","ArrowRightCircleFillLine"),Gt=U("M3 4h14v2H3V4zm0 4h14v2H3V8zm0 4h10v2H3v-2zm0 4h8v2H3v-2z","FileList2Line"),Ha=U("M13 10h5l-6 6-6-6h5V3h2v7zM4 19h16v2H4v-2z","DownloadLine"),Ua=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm1 5v6h-2V9h2zm0-4v2h-2V6h2z","QuestionnaireLine"),Va=U("M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm2 2v12h14V5H5zm2 2h2v2H7V7zm4 0h6v2h-6V7zm-4 4h2v2H7v-2zm4 0h6v2h-6v-2z","TerminalBoxLine"),qa=U("M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v8h-2V6.413l-7.793 7.794-1.414-1.414L17.585 5H13V3h8z","ExternalLinkLine"),Wa=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm1 2.05v1.9c.93.13 1.8.44 2.57.9L14.5 7.2c-.55-.36-1.15-.65-1.78-.9L13 6.05zM6.05 11H4.1c.13.93.44 1.8.9 2.57L7.2 9.5c-.36-.55-.65-1.15-.9-1.78L6.05 11zm1.25 4.5L4.6 16.33c.77.57 1.64.88 2.57 1.01v1.9c.63-.25 1.23-.54 1.78-.9L7.3 15.5zm7.4 0c.55.36 1.15.65 1.78.9v1.9a8.1 8.1 0 0 1-2.57-.9L16.8 15.5l-1.25-1.25zM17.9 13h-1.95c-.25-.63-.54-1.23-.9-1.78L16.8 14.5c.57.77.88 1.64 1.01 2.57zm-5.4-5.4c-.36.55-.65 1.15-.9 1.78H6.05c.13-.93.44-1.8.9-2.57L9.5 7.2l1.25 1.25zm-.9 6.8l1.25 1.25c.77-.57 1.64-.88 2.57-1.01v1.95c-.63.25-1.23.54-1.78.9L9.5 16.8zm4.5-4.5l1.25 1.25L16.8 9.5c-.36-.55-.65-1.15-.9-1.78h1.95c.13.93.44 1.8.9 2.57z","GlobalLine"),Za=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm3.536 2.464l-9.072 9.072a8 8 0 0 1 9.072-9.072zM8.464 17.536a8 8 0 0 1 9.072-9.072l-9.072 9.072z","Forbid2Line"),Oe=K.Root,$e=K.Trigger,kc=K.Group,wc=K.Portal,Qa=K.Sub,Nc=K.RadioGroup,Ya="min-w-32 overflow-hidden rounded-lg border border-border-tertiary bg-bg-container p-1 text-text shadow-lg z-50 outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:!outline-none focus-visible:!ring-0",Te=N.forwardRef(({className:e,sideOffset:t=4,children:s,dataStyle:a,dataTheme:r,...o},i)=>{const l=Ke(),c=a!==void 0?{"data-style":a,"data-theme":r??l["data-theme"]??""}:l;return n.jsx(K.Portal,{children:n.jsx("div",{style:{display:"contents"},...c,children:n.jsx(K.Content,{ref:i,sideOffset:t,className:y(Ya,e),...o,children:n.jsx(te.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15,ease:[.4,0,.2,1]},children:s})})})})});Te.displayName=K.Content.displayName;const jc=se.cva("flex h-9 w-full cursor-pointer select-none items-center gap-2 rounded-sm px-3 text-sm outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:!outline-none hover:bg-fill-secondary focus:bg-fill-secondary data-[highlighted]:bg-fill-secondary data-[state=open]:bg-fill-secondary",{variants:{inset:{true:"pl-8 pr-3",false:""}},defaultVariants:{inset:!1}}),Ln=N.forwardRef(({className:e,inset:t=!1,children:s,subTriggerIcon:a,...r},o)=>n.jsxs(K.SubTrigger,{ref:o,className:jc({inset:t,className:e}),...r,children:[s,n.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center",children:a??n.jsx(ot,{className:"h-4 w-4"})})]}));Ln.displayName=K.SubTrigger.displayName;const _n=N.forwardRef(({className:e,sideOffset:t=-1,dataStyle:s,dataTheme:a,...r},o)=>{const i=Ke(),l=s!==void 0?{"data-style":s,"data-theme":a??i["data-theme"]??""}:i;return n.jsx(K.Portal,{children:n.jsx("div",{style:{display:"contents"},...l,children:n.jsx(K.SubContent,{ref:o,sideOffset:t,className:y(Ya,e),...r})})})});_n.displayName=K.SubContent.displayName;const Cc=se.cva("relative flex h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-3 text-sm outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:!outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{variant:{default:"hover:bg-fill-secondary focus:bg-fill-secondary focus:text-text data-[highlighted]:bg-fill-secondary data-[highlighted]:text-text",destructive:"text-error hover:bg-error-bg focus:bg-error-bg focus:text-error data-[highlighted]:bg-error-bg data-[highlighted]:text-error"},inset:{true:"pl-8 pr-3",false:""}},defaultVariants:{variant:"default",inset:!1}}),we=N.forwardRef(({className:e,inset:t=!1,variant:s="default",...a},r)=>n.jsx(K.Item,{ref:r,className:Cc({variant:s,inset:t,className:e}),...a}));we.displayName=K.Item.displayName;const Ka="relative flex h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm pl-8 pr-3 text-sm outline-none transition-colors hover:bg-fill-secondary focus:bg-fill-secondary focus:text-text data-[highlighted]:bg-fill-secondary data-[highlighted]:text-text data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Xa=N.forwardRef(({className:e,children:t,checked:s,checkIcon:a,...r},o)=>n.jsxs(K.CheckboxItem,{ref:o,className:y(Ka,e),checked:s,...r,children:[n.jsx("span",{className:"absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center",children:n.jsx(K.ItemIndicator,{children:a??n.jsx(Ie,{className:"h-4 w-4"})})}),t]}));Xa.displayName=K.CheckboxItem.displayName;const Ja=N.forwardRef(({className:e,children:t,...s},a)=>n.jsxs(K.RadioItem,{ref:a,className:y(Ka,e),...s,children:[n.jsx("span",{className:"absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center",children:n.jsx(K.ItemIndicator,{children:n.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));Ja.displayName=K.RadioItem.displayName;const Sc=se.cva("flex h-9 items-center px-3 text-sm font-semibold text-text-secondary",{variants:{inset:{true:"pl-8 pr-3",false:""}},defaultVariants:{inset:!1}}),er=N.forwardRef(({className:e,inset:t=!1,...s},a)=>n.jsx(K.Label,{ref:a,className:Sc({inset:t,className:e}),...s}));er.displayName=K.Label.displayName;const tr=N.forwardRef(({className:e,...t},s)=>n.jsx(K.Separator,{ref:s,className:y("my-1 mx-1 h-px bg-border-tertiary",e),...t}));tr.displayName=K.Separator.displayName;const nr=({className:e,...t})=>n.jsx("span",{className:y("ml-auto text-xs tracking-widest text-text-tertiary",e),...t});nr.displayName="DropdownMenuShortcut";const sr=x.createContext(null);function Ic({value:e,children:t}){return n.jsx(sr.Provider,{value:e,children:t})}function lt(){return x.useContext(sr)??{icons:{}}}function R(e,t){const{icons:s}=lt(),a=s[e];if(a)return n.jsx(a,{className:t,"aria-hidden":!0})}const ar=N.forwardRef((e,t)=>{const{style:s,theme:a}=me();return n.jsx(Te,{ref:t,dataStyle:s,dataTheme:a,...e})});ar.displayName="DropdownMenuContent";function Rc(e){const t=R("arrowRight","h-4 w-4 shrink-0"),s=e.subTriggerIcon??t;return n.jsx(Ln,{...e,subTriggerIcon:s})}const rr=N.forwardRef((e,t)=>{const{style:s,theme:a}=me();return n.jsx(_n,{ref:t,dataStyle:s,dataTheme:a,...e})});rr.displayName="DropdownMenuSubContent";const or=ce.Root,Ac=ce.Trigger,ir=ce.Portal,Pn=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Overlay,{ref:s,asChild:!0,...t,children:n.jsx(te.motion.div,{className:y("fixed inset-0 z-50 bg-bg-mask/60",e),initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})}));Pn.displayName=ce.Overlay.displayName;const Ec=se.cva("font-sans fixed left-1/2 top-1/2 z-50 w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-bg-base text-text shadow-lg p-6",{variants:{size:{default:"max-w-lg",sm:"max-w-sm"}},defaultVariants:{size:"default"}}),Fn=N.forwardRef(({className:e,children:t,size:s="default",dataStyle:a,dataTheme:r,...o},i)=>{const l=Ke(),c=a!==void 0?{"data-style":a,"data-theme":r??l["data-theme"]??""}:l;return n.jsx(ir,{children:n.jsxs("div",{style:{display:"contents"},...c,children:[n.jsx(Pn,{}),n.jsx(ce.Content,{ref:i,asChild:!0,...o,children:n.jsx(te.motion.div,{className:y(Ec({size:s}),e),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.4,0,.2,1]},children:t})})]})})});Fn.displayName=ce.Content.displayName;const zn=N.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:y("flex flex-col gap-2",e),...t}));zn.displayName="AlertDialogHeader";const Dn=N.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:y("mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t}));Dn.displayName="AlertDialogFooter";const Mn=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Title,{ref:s,className:y("font-sans text-base font-medium leading-6 text-text",e),...t}));Mn.displayName=ce.Title.displayName;const On=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Description,{ref:s,className:y("text-sm leading-6 text-text-tertiary",e),...t}));On.displayName=ce.Description.displayName;const Tc=se.cva("inline-flex h-9 items-center justify-center rounded px-4 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50 cursor-pointer",{variants:{destructive:{true:"bg-error text-text-on-primary hover:bg-error-hover active:bg-error",false:"bg-bg-highlight text-text-on-primary hover:bg-bg-highlight-hover"}},defaultVariants:{destructive:!1}}),lr=N.forwardRef(({className:e,destructive:t=!1,...s},a)=>n.jsx(ce.Action,{ref:a,className:y(Tc({destructive:t}),e),...s}));lr.displayName=ce.Action.displayName;const $n=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Cancel,{ref:s,className:y("inline-flex h-9 items-center justify-center rounded px-4 text-sm font-medium cursor-pointer","bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text","transition-colors focus:outline-none",e),...t}));$n.displayName=ce.Cancel.displayName;const cr=N.forwardRef((e,t)=>{const{style:s,theme:a}=me();return n.jsx(Fn,{ref:t,dataStyle:s,dataTheme:a,...e})});cr.displayName="AlertDialogContent";const dr=N.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:y("mb-4 inline-flex h-10 w-10 items-center justify-center rounded-lg bg-fill-tertiary text-text",e),...t}));dr.displayName="AlertDialogMedia";function ur({className:e,...t}){return n.jsx("kbd",{className:y("pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 !font-sans text-xs font-medium","bg-fill-secondary text-text-secondary","[.tooltip-content_&]:bg-bg-highlight-hover [.tooltip-content_&]:text-text-on-primary","dark:[.tooltip-content_&]:bg-[color:var(--color-bg-base)]/10 dark:[.tooltip-content_&]:text-[var(--color-bg-base)]",e),...t})}ur.displayName="Kbd";function pr({className:e,children:t,separator:s="+",...a}){const r=N.Children.toArray(t);return n.jsx("span",{className:y("inline-flex items-center gap-1",e),...a,children:r.map((o,i)=>n.jsxs(N.Fragment,{children:[o,i<r.length-1&&n.jsx("span",{className:"select-none !font-sans text-xs font-medium text-text-secondary",children:s})]},i))})}pr.displayName="KbdGroup";const et={fast:.15,base:.2,slow:.3},tt={standard:[.16,1,.3,1],emphasized:[.2,.8,.2,1],out:[0,0,.2,1]},mr={snappy:{type:"spring",stiffness:520,damping:34,mass:.7}},Lc=se.cva("peer inline-flex shrink-0 cursor-pointer items-center rounded-full overflow-hidden border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-border focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-fill-secondary",{variants:{size:{md:"h-5 w-9",lg:"h-6 w-11"}},defaultVariants:{size:"md"}}),_c=se.cva("pointer-events-none block rounded-full bg-text-on-primary ring-0 transition-transform data-[state=unchecked]:translate-x-0",{variants:{size:{md:"h-4 w-4 data-[state=checked]:translate-x-4",lg:"h-5 w-5 data-[state=checked]:translate-x-4.5"}},defaultVariants:{size:"md"}}),fr=N.forwardRef(({className:e,size:t="md",disabled:s=!1,...a},r)=>n.jsx(Ns.Root,{ref:r,className:y(Lc({size:t}),e),disabled:s,...a,children:n.jsx(Ns.Thumb,{className:_c({size:t})})}));fr.displayName="Switch";const Ls={sm:{buttonClass:"w-5 h-5",iconClass:"w-3.5 h-3.5",trackClass:"p-0.5 rounded-md gap-0.5",thumbClass:"w-5 h-5 rounded-sm top-0.5 bottom-0.5",buttonRounded:"rounded-sm"},md:{buttonClass:"w-6 h-6",iconClass:"w-4 h-4",trackClass:"p-0.5 rounded-lg gap-0.5",thumbClass:"w-6 h-6 rounded-md top-0.5 bottom-0.5",buttonRounded:"rounded-md"}};function Pc(e){if(e==="normal"||!e)return 0;const t=parseFloat(e);return e.endsWith("px")?t:e.endsWith("rem")?t*16:t}const Bn=N.forwardRef(({variant:e="toggle",className:t,size:s="md",options:a,value:r,defaultValue:o="preview",onValueChange:i,segmentSize:l="md",disabled:c=!1,...d},p)=>{const{style:m,theme:b}=me(),w={};if(m&&(w["data-style"]=m),b&&(w["data-theme"]=b),e==="toggle")return n.jsx("div",{ref:p,...w,className:"inline-flex",children:n.jsx(fr,{size:s,className:t,disabled:c,...d})});const u=Ls[l].iconClass,g=n.jsx(xc,{className:u}),f=n.jsx(Ea,{className:u}),[k,h]=N.useState(o),v=N.useRef(null),[S,C]=N.useState({buttonWidth:24,gapPx:2});N.useLayoutEffect(()=>{if(!v.current)return;const O=v.current,W=O.querySelector("button"),oe=W?Pc(getComputedStyle(O).gap):0,Z=W?.offsetWidth??24;C(V=>V.buttonWidth===Z&&V.gapPx===oe?V:{buttonWidth:Z,gapPx:oe})},[m,l,a?.length]);const T=[{value:"code",label:"Code",icon:g},{value:"preview",label:"Preview",icon:f}],E=a?.length?a:T,I=r!==void 0,F=(I?r:k)??o,Q=O=>{c||(I||h(O),i?.(O))},z=E.findIndex(O=>O.value===F),G=z>=0?z:0,re=Ls[l],{buttonClass:M,trackClass:$,thumbClass:q,buttonRounded:ee}=re,A=G*(S.buttonWidth+S.gapPx);return n.jsx("div",{ref:p,...w,className:"inline-flex",children:n.jsxs("div",{ref:v,role:"radiogroup","aria-disabled":c||void 0,className:ke.clsx("relative inline-flex items-center",$,"bg-fill-secondary",c?"opacity-50 cursor-not-allowed":"cursor-pointer",t),...d,children:[n.jsx(te.motion.span,{className:ke.clsx("absolute left-0.5 bg-bg-base shadow-sm",q),initial:!1,animate:{x:A},transition:{type:"tween",duration:et.base,ease:tt.out}}),E.map(O=>{const W=O.value===F;return n.jsx("button",{type:"button",role:"radio","aria-checked":W,"aria-label":O.label,disabled:c,onClick:()=>Q(O.value),className:ke.clsx("relative z-10 inline-flex items-center justify-center",ee,M,"transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-border",W?"text-primary-active":"text-text-secondary"),children:n.jsx("span",{className:"inline-flex items-center justify-center",children:O.icon})},O.value)})]})})});Bn.displayName="Switch";function Fc({size:e="md",value:t,defaultValue:s="preview",onValueChange:a,disabled:r=!1,className:o,...i}){return n.jsx(Bn,{variant:"segment",segmentSize:e,value:t,defaultValue:s,onValueChange:a,disabled:r,className:o,...i})}const gr=se.cva("inline-flex items-center justify-center gap-1.5 font-medium transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-border focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base disabled:pointer-events-none disabled:opacity-50 cursor-pointer data-[state=on]:bg-fill data-[state=on]:text-text",{variants:{variant:{default:"bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text data-[state=on]:bg-fill data-[state=on]:text-text",outline:"border border-border-tertiary bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text data-[state=on]:border-border-secondary data-[state=on]:bg-fill data-[state=on]:text-text"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-11 px-4 text-base"},rounded:{square:"rounded",pill:"rounded-full"}},defaultVariants:{variant:"default",size:"md",rounded:"square"}}),xr=x.forwardRef(({variant:e="default",size:t="md",rounded:s="square",className:a,prefixIcon:r,suffixIcon:o,children:i,...l},c)=>n.jsxs(pl.Root,{ref:c,className:gr({variant:e,size:t,rounded:s,className:a}),...l,children:[r&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:r}),i,o&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:o})]}));xr.displayName="Toggle";const hr=x.createContext(null),zc={none:"gap-0",sm:"gap-1",md:"gap-2"},Dc=["shrink-0","group-data-[spacing=0]/toggle-group:rounded-none","group-data-[spacing=0]/toggle-group:group-data-[orientation=horizontal]/toggle-group:first:rounded-l","group-data-[spacing=0]/toggle-group:group-data-[orientation=horizontal]/toggle-group:last:rounded-r","group-data-[spacing=0]/toggle-group:group-data-[orientation=vertical]/toggle-group:first:rounded-t","group-data-[spacing=0]/toggle-group:group-data-[orientation=vertical]/toggle-group:last:rounded-b","group-data-[spacing=0]/toggle-group:data-[variant=outline]:group-data-[orientation=horizontal]/toggle-group:[&:not(:first-child)]:border-l-0","group-data-[spacing=0]/toggle-group:data-[variant=outline]:group-data-[orientation=vertical]/toggle-group:[&:not(:first-child)]:border-t-0"].join(" "),yr=x.forwardRef(({type:e="single",variant:t="default",size:s="md",rounded:a="square",spacing:r="none",className:o,orientation:i="horizontal",children:l,...c},d)=>{const p=y("group/toggle-group inline-flex w-fit",i==="horizontal"?"flex-row":"flex-col",i==="vertical"&&"items-stretch",zc[r],o),m={ref:d,orientation:i,"data-spacing":r==="none"?"0":r,"data-orientation":i,"data-variant":t,"data-size":s,className:p};return n.jsx(hr.Provider,{value:{variant:t,size:s,rounded:a,spacing:r},children:e==="multiple"?n.jsx(hn.Root,{...m,...c,type:"multiple",children:l}):n.jsx(hn.Root,{...m,...c,type:"single",children:l})})});yr.displayName="ToggleGroup";const br=x.forwardRef(({variant:e,size:t,rounded:s,className:a,prefixIcon:r,suffixIcon:o,children:i,...l},c)=>{const d=x.useContext(hr),p=e??d?.variant??"default",m=t??d?.size??"md",b=s??d?.rounded??"square";return n.jsxs(hn.Item,{ref:c,"data-variant":p,"data-size":m,className:y(gr({variant:p,size:m,rounded:b}),d&&Dc,"focus-visible:z-10",a),...l,children:[r&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:r}),i,o&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:o})]})});br.displayName="ToggleGroupItem";const Mc=se.cva("grid gap-2",{variants:{orientation:{vertical:"grid-flow-row",horizontal:"grid-flow-col auto-cols-max"}},defaultVariants:{orientation:"vertical"}}),Oc=se.cva("shrink-0 rounded-full border border-border-tertiary outline-offset-2 cursor-pointer transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary-border disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-text data-[state=checked]:bg-text data-[state=checked]:text-bg-base",{variants:{size:{sm:"size-3.5",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}}),$c={sm:"size-1.5",md:"size-2",lg:"size-2.5"},vr=N.forwardRef(({className:e,orientation:t="vertical",...s},a)=>n.jsx(xn.Root,{ref:a,className:y(Mc({orientation:t,className:e})),orientation:t??"vertical",...s}));vr.displayName="RadioGroup";const kr=N.forwardRef(({className:e,size:t="md",...s},a)=>n.jsx(xn.Item,{ref:a,className:y(Oc({size:t,className:e})),...s,children:n.jsx(xn.Indicator,{className:"flex items-center justify-center",children:n.jsx("span",{className:y("rounded-full bg-current",$c[t??"md"])})})}));kr.displayName="RadioGroupItem";const _s=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),x=require("react"),te=require("framer-motion"),Qi=require("@radix-ui/react-tooltip"),ke=require("clsx"),Yi=require("@radix-ui/react-dropdown-menu"),se=require("class-variance-authority"),Ki=require("@radix-ui/react-alert-dialog"),Xi=require("@radix-ui/react-switch"),ia=require("react-dom"),la=require("sonner"),Ji=require("@radix-ui/react-select"),el=require("react-markdown"),tl=require("remark-gfm"),nl=require("remark-math"),sl=require("rehype-katex"),ws=require("lottie-react"),ca=require("react-i18next"),al=require("@radix-ui/react-avatar"),rl=require("@radix-ui/react-accordion"),ol=require("@radix-ui/react-progress"),il=require("@radix-ui/react-radio-group"),jn=require("react-resizable-panels"),ll=require("@radix-ui/react-slider"),cl=require("@radix-ui/react-tabs"),dl=require("@radix-ui/react-toggle"),ul=require("@radix-ui/react-toggle-group");function ue(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const N=ue(x),qe=ue(Qi),K=ue(Yi),ce=ue(Ki),Ns=ue(Xi),ae=ue(Ji),Ye=ue(al),st=ue(rl),js=ue(ol),xn=ue(il),wt=ue(ll),Be=ue(cl),pl=ue(dl),hn=ue(ul),yn=se.cva("inline-flex items-center justify-center gap-1.5 font-medium transition-colors duration-200 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",{variants:{variant:{primary:"bg-primary text-text-on-primary hover:bg-primary-hover",secondary:"bg-bg-highlight text-text-on-primary hover:bg-bg-highlight-hover",tertiary:"bg-fill-secondary text-text hover:bg-fill",ghost:"bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text",text:"bg-transparent text-text-secondary hover:text-text"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-11 px-4 text-base"},rounded:{square:"rounded",pill:"rounded-full"},textOnly:{true:"h-auto px-0 py-0.5",false:""}},compoundVariants:[{textOnly:!0,size:"sm",className:"text-xs"},{textOnly:!0,size:"md",className:"text-sm"},{textOnly:!0,size:"lg",className:"text-base"}],defaultVariants:{variant:"ghost",size:"md",rounded:"square",textOnly:!1}}),ne=x.forwardRef(({variant:e="ghost",children:t,size:s="md",textButton:a=!1,prefixIcon:r,suffixIcon:o,rounded:i="square",disabled:l=!1,className:c,...d},p)=>n.jsxs("button",{ref:p,className:yn({variant:a?"text":e,size:s,rounded:i,textOnly:a,className:c}),disabled:l,...d,children:[r&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:r}),t,o&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:o})]}));ne.displayName="Button";const ml=(e,t)=>{const s=new Array(e.length+t.length);for(let a=0;a<e.length;a++)s[a]=e[a];for(let a=0;a<t.length;a++)s[e.length+a]=t[a];return s},fl=(e,t)=>({classGroupId:e,validator:t}),da=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),_t="-",Cs=[],gl="arbitrary..",xl=e=>{const t=yl(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return hl(i);const l=i.split(_t),c=l[0]===""&&l.length>1?1:0;return ua(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=s[i];return c?d?ml(d,c):c:d||Cs}return s[i]||Cs}}},ua=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],o=s.nextPart.get(r);if(o){const d=ua(e,t+1,o);if(d)return d}const i=s.validators;if(i===null)return;const l=t===0?e.join(_t):e.slice(t).join(_t),c=i.length;for(let d=0;d<c;d++){const p=i[d];if(p.validator(l))return p.classGroupId}},hl=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?gl+a:void 0})(),yl=e=>{const{theme:t,classGroups:s}=e;return bl(s,t)},bl=(e,t)=>{const s=da();for(const a in e){const r=e[a];Cn(r,s,a,t)}return s},Cn=(e,t,s,a)=>{const r=e.length;for(let o=0;o<r;o++){const i=e[o];vl(i,t,s,a)}},vl=(e,t,s,a)=>{if(typeof e=="string"){kl(e,t,s);return}if(typeof e=="function"){wl(e,t,s,a);return}Nl(e,t,s,a)},kl=(e,t,s)=>{const a=e===""?t:pa(t,e);a.classGroupId=s},wl=(e,t,s,a)=>{if(jl(e)){Cn(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(fl(s,e))},Nl=(e,t,s,a)=>{const r=Object.entries(e),o=r.length;for(let i=0;i<o;i++){const[l,c]=r[i];Cn(c,pa(t,l),s,a)}},pa=(e,t)=>{let s=e;const a=t.split(_t),r=a.length;for(let o=0;o<r;o++){const i=a[o];let l=s.nextPart.get(i);l||(l=da(),s.nextPart.set(i,l)),s=l}return s},jl=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Cl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(o,i)=>{s[o]=i,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(o){let i=s[o];if(i!==void 0)return i;if((i=a[o])!==void 0)return r(o,i),i},set(o,i){o in s?s[o]=i:r(o,i)}}},bn="!",Ss=":",Sl=[],Is=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),Il=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const o=[];let i=0,l=0,c=0,d;const p=r.length;for(let g=0;g<p;g++){const f=r[g];if(i===0&&l===0){if(f===Ss){o.push(r.slice(c,g)),c=g+1;continue}if(f==="/"){d=g;continue}}f==="["?i++:f==="]"?i--:f==="("?l++:f===")"&&l--}const m=o.length===0?r:r.slice(c);let b=m,w=!1;m.endsWith(bn)?(b=m.slice(0,-1),w=!0):m.startsWith(bn)&&(b=m.slice(1),w=!0);const u=d&&d>c?d-c:void 0;return Is(o,w,b,u)};if(t){const r=t+Ss,o=a;a=i=>i.startsWith(r)?o(i.slice(r.length)):Is(Sl,!1,i,void 0,!0)}if(s){const r=a;a=o=>s({className:o,parseClassName:r})}return a},Rl=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let o=0;o<s.length;o++){const i=s[o],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},Al=e=>({cache:Cl(e.cacheSize),parseClassName:Il(e),sortModifiers:Rl(e),...xl(e)}),El=/\s+/,Tl=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:o}=t,i=[],l=e.trim().split(El);let c="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{isExternal:m,modifiers:b,hasImportantModifier:w,baseClassName:u,maybePostfixModifierPosition:g}=s(p);if(m){c=p+(c.length>0?" "+c:c);continue}let f=!!g,k=a(f?u.substring(0,g):u);if(!k){if(!f){c=p+(c.length>0?" "+c:c);continue}if(k=a(u),!k){c=p+(c.length>0?" "+c:c);continue}f=!1}const h=b.length===0?"":b.length===1?b[0]:o(b).join(":"),v=w?h+bn:h,S=v+k;if(i.indexOf(S)>-1)continue;i.push(S);const C=r(k,f);for(let T=0;T<C.length;++T){const E=C[T];i.push(v+E)}c=p+(c.length>0?" "+c:c)}return c},Ll=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=ma(s))&&(r&&(r+=" "),r+=a);return r},ma=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=ma(e[a]))&&(s&&(s+=" "),s+=t);return s},_l=(e,...t)=>{let s,a,r,o;const i=c=>{const d=t.reduce((p,m)=>m(p),e());return s=Al(d),a=s.cache.get,r=s.cache.set,o=l,l(c)},l=c=>{const d=a(c);if(d)return d;const p=Tl(c,s);return r(c,p),p};return o=i,(...c)=>o(Ll(...c))},Pl=[],le=e=>{const t=s=>s[e]||Pl;return t.isThemeGetter=!0,t},fa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ga=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fl=/^\d+\/\d+$/,zl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ml=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ol=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$l=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ve=e=>Fl.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),Ee=e=>!!e&&Number.isInteger(Number(e)),pn=e=>e.endsWith("%")&&B(e.slice(0,-1)),Se=e=>zl.test(e),xa=()=>!0,Bl=e=>Dl.test(e)&&!Ml.test(e),Sn=()=>!1,Gl=e=>Ol.test(e),Hl=e=>$l.test(e),Ul=e=>!L(e)&&!_(e),Vl=e=>Le(e,ba,Sn),L=e=>fa.test(e),De=e=>Le(e,va,Bl),Rs=e=>Le(e,Jl,B),ql=e=>Le(e,wa,xa),Wl=e=>Le(e,ka,Sn),As=e=>Le(e,ha,Sn),Zl=e=>Le(e,ya,Hl),Nt=e=>Le(e,Na,Gl),_=e=>ga.test(e),Xe=e=>Ge(e,va),Ql=e=>Ge(e,ka),Es=e=>Ge(e,ha),Yl=e=>Ge(e,ba),Kl=e=>Ge(e,ya),jt=e=>Ge(e,Na,!0),Xl=e=>Ge(e,wa,!0),Le=(e,t,s)=>{const a=fa.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Ge=(e,t,s=!1)=>{const a=ga.exec(e);return a?a[1]?t(a[1]):s:!1},ha=e=>e==="position"||e==="percentage",ya=e=>e==="image"||e==="url",ba=e=>e==="length"||e==="size"||e==="bg-size",va=e=>e==="length",Jl=e=>e==="number",ka=e=>e==="family-name",wa=e=>e==="number"||e==="weight",Na=e=>e==="shadow",ec=()=>{const e=le("color"),t=le("font"),s=le("text"),a=le("font-weight"),r=le("tracking"),o=le("leading"),i=le("breakpoint"),l=le("container"),c=le("spacing"),d=le("radius"),p=le("shadow"),m=le("inset-shadow"),b=le("text-shadow"),w=le("drop-shadow"),u=le("blur"),g=le("perspective"),f=le("aspect"),k=le("ease"),h=le("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),_,L],T=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],I=()=>[_,L,c],F=()=>[Ve,"full","auto",...I()],Q=()=>[Ee,"none","subgrid",_,L],z=()=>["auto",{span:["full",Ee,_,L]},Ee,_,L],G=()=>[Ee,"auto",_,L],re=()=>["auto","min","max","fr",_,L],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...I()],ee=()=>[Ve,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],A=()=>[e,_,L],O=()=>[...S(),Es,As,{position:[_,L]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",Yl,Vl,{size:[_,L]}],Z=()=>[pn,Xe,De],V=()=>["","none","full",d,_,L],ie=()=>["",B,Xe,De],he=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[B,pn,Es,As],Re=()=>["","none",u,_,L],ge=()=>["none",B,_,L],Ae=()=>["none",B,_,L],D=()=>[B,_,L],P=()=>[Ve,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Se],breakpoint:[Se],color:[xa],container:[Se],"drop-shadow":[Se],ease:["in","out","in-out"],font:[Ul],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Se],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Se],shadow:[Se],spacing:["px",B],text:[Se],"text-shadow":[Se],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ve,L,_,f]}],container:["container"],columns:[{columns:[B,L,_,l]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Ee,"auto",_,L]}],basis:[{basis:[Ve,"full","auto",l,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[B,Ve,"auto","initial","none",L]}],grow:[{grow:["",B,_,L]}],shrink:[{shrink:["",B,_,L]}],order:[{order:[Ee,"first","last","none",_,L]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],w:[{w:[l,"screen",...ee()]}],"min-w":[{"min-w":[l,"screen","none",...ee()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",s,Xe,De]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Xl,ql]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pn,L]}],"font-family":[{font:[Ql,Wl,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,_,L]}],"line-clamp":[{"line-clamp":[B,"none",_,Rs]}],leading:[{leading:[o,...I()]}],"list-image":[{"list-image":["none",_,L]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",_,L]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[B,"from-font","auto",_,De]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[B,"auto",_,L]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_,L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_,L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ee,_,L],radial:["",_,L],conic:[Ee,_,L]},Kl,Zl]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[B,_,L]}],"outline-w":[{outline:["",B,Xe,De]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",p,jt,Nt]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",m,jt,Nt]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[B,De]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,jt,Nt]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[B,_,L]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[_,L]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",_,L]}],filter:[{filter:["","none",_,L]}],blur:[{blur:Re()}],brightness:[{brightness:[B,_,L]}],contrast:[{contrast:[B,_,L]}],"drop-shadow":[{"drop-shadow":["","none",w,jt,Nt]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",B,_,L]}],"hue-rotate":[{"hue-rotate":[B,_,L]}],invert:[{invert:["",B,_,L]}],saturate:[{saturate:[B,_,L]}],sepia:[{sepia:["",B,_,L]}],"backdrop-filter":[{"backdrop-filter":["","none",_,L]}],"backdrop-blur":[{"backdrop-blur":Re()}],"backdrop-brightness":[{"backdrop-brightness":[B,_,L]}],"backdrop-contrast":[{"backdrop-contrast":[B,_,L]}],"backdrop-grayscale":[{"backdrop-grayscale":["",B,_,L]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,_,L]}],"backdrop-invert":[{"backdrop-invert":["",B,_,L]}],"backdrop-opacity":[{"backdrop-opacity":[B,_,L]}],"backdrop-saturate":[{"backdrop-saturate":[B,_,L]}],"backdrop-sepia":[{"backdrop-sepia":["",B,_,L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",_,L]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[B,"initial",_,L]}],ease:[{ease:["linear","initial",k,_,L]}],delay:[{delay:[B,_,L]}],animate:[{animate:["none",h,_,L]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,_,L]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:D()}],"skew-x":[{"skew-x":D()}],"skew-y":[{"skew-y":D()}],transform:[{transform:[_,L,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_,L]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_,L]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[B,Xe,De,Rs]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},tc=_l(ec);function y(...e){return tc(ke.clsx(e))}const nc=se.cva("flex-none shrink-0 inline-flex items-center justify-center box-border transition-colors duration-200 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer [&>*]:flex [&>*]:items-center [&>*]:justify-center [&>*]:size-full [&>*]:[&>svg]:block [&>*]:[&>svg]:leading-none",{variants:{variant:{primary:"bg-primary text-text-on-primary hover:bg-primary-hover",secondary:"bg-bg-highlight text-text-on-primary hover:bg-bg-highlight-hover",tertiary:"bg-fill-secondary text-text hover:bg-fill",ghost:"bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text",iconOnly:"bg-transparent text-text-secondary hover:text-text"},rounded:{square:"rounded",pill:"rounded-full"},size:{sm:"h-7 w-7 min-h-7 min-w-7 p-1.5",md:"h-9 w-9 min-h-9 min-w-9 p-1.5",lg:"h-11 w-11 min-h-11 min-w-11 p-2"}},defaultVariants:{variant:"secondary",size:"md",rounded:"square"}}),je=x.forwardRef(({variant:e="secondary",size:t="md",rounded:s="square",icon:a,disabled:r=!1,className:o,...i},l)=>n.jsx("button",{ref:l,className:y(nc({variant:e,size:t,rounded:s}),o),disabled:r,...i,children:n.jsx("span",{className:"inline-flex shrink-0 size-full items-center justify-center",children:a})}));je.displayName="IconButton";function Ke(){if(typeof document>"u")return{};const e=document.documentElement,t={},s=e.getAttribute("data-theme"),a=e.getAttribute("data-style");return s&&(t["data-theme"]=s),a&&(t["data-style"]=a),t}const sc=qe.Provider,ac=qe.Root,rc=qe.Trigger,ja=N.forwardRef(({className:e,sideOffset:t=8,children:s,dataStyle:a,dataTheme:r,...o},i)=>{const l=Ke(),c=a!==void 0?{"data-style":a,"data-theme":r??l["data-theme"]??""}:l;return n.jsx(qe.Portal,{children:n.jsx("div",{style:{display:"contents"},...c,children:n.jsx(qe.Content,{ref:i,sideOffset:t,className:y("z-50 max-w-60 overflow-hidden rounded px-2 py-1 text-xs leading-5","bg-bg-highlight text-text-on-primary shadow-sm",e),...o,children:n.jsx(te.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15},children:s})})})})});ja.displayName=qe.Content.displayName;function at({content:e,children:t,side:s="top",contentClassName:a,dataStyle:r,dataTheme:o}){return n.jsx(sc,{delayDuration:300,children:n.jsxs(ac,{children:[n.jsx(rc,{asChild:!0,children:t}),n.jsx(ja,{side:s,className:a,dataStyle:r,dataTheme:o,children:e})]})})}at.displayName="Tooltip";const Ca=x.createContext(null);function Sa(e){return typeof e=="object"&&"name"in e}function Ia(e){return typeof e=="object"&&"name"in e}function oc(e,t){return Sa(t)?`${e}-${t.name}`:t==="mint"?e:`${e}-${t}`}function ic(e){return Ia(e)?e.name:e}function lc(e,t){const s={};if(Sa(e)){const{tokens:a}=e;for(const[r,o]of Object.entries(a))if(o!==void 0){const i=r.startsWith("--")?r:`--${r}`;s[i]=o}}if(Ia(t)){const{radius:a,spacing:r,fontSize:o}=t;a&&(a.sm&&(s["--radius-sm"]=a.sm),a.default&&(s["--radius-DEFAULT"]=a.default),a.md&&(s["--radius-md"]=a.md),a.lg&&(s["--radius-lg"]=a.lg),a.xl&&(s["--radius-xl"]=a.xl),a["2xl"]&&(s["--radius-2xl"]=a["2xl"]),a["3xl"]&&(s["--radius-3xl"]=a["3xl"])),r&&(r[3]&&(s["--spacing-3"]=r[3]),r[4]&&(s["--spacing-4"]=r[4]),r[9]&&(s["--spacing-9"]=r[9]),r[11]&&(s["--spacing-11"]=r[11])),o&&(o.sm&&(s["--font-size-sm"]=o.sm),o.lg&&(s["--font-size-lg"]=o.lg),o.xl&&(s["--font-size-xl"]=o.xl),o["2xl"]&&(s["--font-size-2xl"]=o["2xl"]),o["3xl"]&&(s["--font-size-3xl"]=o["3xl"]))}return s}function cc({children:e,appearance:t="light",theme:s="mint",style:a="neutral"}){const r=x.useMemo(()=>oc(t,s),[t,s]),o=x.useMemo(()=>ic(a),[a]),i=x.useMemo(()=>lc(s,a),[s,a]),l=x.useMemo(()=>({appearance:t,themeConfig:s,styleConfig:a,dataTheme:r,dataStyle:o,theme:r,style:o}),[t,s,a,r,o]),c=Object.keys(i).length>0;return n.jsx(Ca.Provider,{value:l,children:n.jsx("div",{"data-theme":r,"data-style":o,style:c?i:void 0,children:e})})}function me(){const e=x.useContext(Ca);return e||{appearance:"light",themeConfig:"mint",styleConfig:"neutral",dataTheme:"light",dataStyle:"neutral",theme:"light",style:"neutral"}}function In({placement:e,side:t=e??"top",...s}){const{style:a,theme:r}=me();return n.jsx(at,{side:t,dataStyle:a,dataTheme:r,...s})}In.displayName="Tooltip";function Ts(e,t){e&&(typeof e=="function"?e(t):e.current=t)}const Ra=x.forwardRef(({children:e,lines:t=1,className:s="",placement:a="top",tooltipClassName:r="",tooltipContent:o,disabled:i=!1,style:l,as:c="span"},d)=>{const p=x.useRef(null),[m,b]=x.useState(!1),w=x.useCallback(()=>{const h=p.current;if(!h)return;const v=t===1?h.scrollWidth>h.clientWidth:h.scrollHeight>h.clientHeight;b(v)},[t]);x.useEffect(()=>{const h=requestAnimationFrame(()=>w()),v=p.current;if(!v)return()=>cancelAnimationFrame(h);const S=new ResizeObserver(()=>w());return S.observe(v),window.addEventListener("resize",w),()=>{cancelAnimationFrame(h),S.disconnect(),window.removeEventListener("resize",w)}},[w,e]);const u=t===1?{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...l}:{overflow:"hidden",display:"-webkit-box",WebkitLineClamp:t,WebkitBoxOrient:"vertical",...l},g=x.useCallback(h=>{Ts(p,h),Ts(d,h)},[d]),f=n.jsx(c,{ref:g,className:s,style:u,children:e});return m&&!i?n.jsx(In,{content:o??e,placement:a,contentClassName:ke.clsx(r),children:n.jsx("span",{ref:g,className:s,style:u,children:e})}):f});Ra.displayName="EllipsisText";const dc="flex flex-col gap-1",uc=se.cva("w-full flex flex-col gap-0.5 items-start p-2 text-sm rounded text-left transition-colors outline-none focus-visible:bg-fill-tertiary focus-visible:ring-0",{variants:{selected:{true:"",false:""},disabled:{true:"opacity-50 cursor-not-allowed",false:"cursor-pointer hover:bg-fill-tertiary"},dimmed:{true:"opacity-40",false:""}},defaultVariants:{selected:!1,disabled:!1,dimmed:!1}}),pc=se.cva("flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-xs font-mono font-medium transition-colors",{variants:{selected:{true:"bg-primary-active text-text-on-primary",false:"bg-fill-secondary text-text-tertiary"}},defaultVariants:{selected:!1}}),Rn=x.forwardRef(({items:e,selectedIds:t=[],focusedId:s,onItemClick:a,showPrefix:r=!0,disabled:o=!1,className:i,...l},c)=>{const d=p=>String(p+1);return n.jsx("div",{ref:c,role:"listbox","aria-multiselectable":t.length>1,className:y(dc,i),...l,children:e.map((p,m)=>{const b=t.includes(p.id),w=s===p.id,u=o||p.disabled,f=t.length>0&&!b&&!u;return n.jsxs("button",{type:"button",role:"option","aria-selected":b,"aria-disabled":u,onClick:()=>{u||a?.(p,m)},disabled:u,className:y(uc({selected:b,disabled:u,dimmed:f}),w&&"bg-fill-tertiary"),children:[n.jsxs("div",{className:"flex items-center gap-3",children:[r&&n.jsx("div",{className:pc({selected:b}),children:d(m)}),n.jsx("span",{className:"font-medium text-text",children:p.label})]}),p.description&&n.jsx("div",{className:"ml-8 text-xs text-text-tertiary",children:p.description})]},p.id)})})});Rn.displayName="OptionList";const mc="0 0 24 24",fc="1em";function U(e,t){const s=N.forwardRef(({className:a,size:r=fc,...o},i)=>n.jsx("svg",{ref:i,viewBox:mc,width:r,height:r,fill:"currentColor",className:a,xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,...o,children:n.jsx("path",{d:e})}));return s.displayName=t,s}U("M13.0001 16.1716L18.3641 10.8076L19.7783 12.2218L12.0001 20L4.22192 12.2218L5.63614 10.8076L11.0001 16.1716V4H13.0001V16.1716Z","ArrowDownLine");const An=U("M13.0001 7.82843V20H11.0001V7.82843L5.63614 13.1924L4.22192 11.7782L12.0001 4L19.7783 11.7782L18.3641 13.1924L13.0001 7.82843Z","ArrowUpLine"),ot=U("M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z","ArrowRightLine"),gc=U("M7.82843 10.9999H20V12.9999H7.82843L13.1924 18.3638L11.7782 19.778L4 11.9999L11.7782 4.22168L13.1924 5.63589L7.82843 10.9999Z","ArrowLeftLine"),Ie=U("M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z","CheckLine"),_e=U("M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z","CloseLine"),Aa=U("M10.5859 12L2.79297 4.20706L4.20718 2.79285L12.0001 10.5857L19.793 2.79285L21.2072 4.20706L13.4143 12L21.2072 19.7928L19.793 21.2071L12.0001 13.4142L4.20718 21.2071L2.79297 19.7928L10.5859 12Z","CloseLargeLine"),xc=U("M24 12L18.3431 17.6569L16.9289 16.2426L21.1716 12L16.9289 7.75736L18.3431 6.34315L24 12ZM2.82843 12L7.07107 16.2426L5.65685 17.6569L0 12L5.65685 6.34315L7.07107 7.75736L2.82843 12ZM9.78845 21H7.66009L14.2116 3H16.3399L9.78845 21Z","CodeSSlashLine"),Ea=U("M12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3ZM12.0003 19C16.2359 19 19.8603 16.052 20.7777 12C19.8603 7.94803 16.2359 5 12.0003 5C7.7646 5 4.14022 7.94803 3.22278 12C4.14022 16.052 7.7646 19 12.0003 19ZM12.0003 16.5C9.51498 16.5 7.50026 14.4853 7.50026 12C7.50026 9.51472 9.51498 7.5 12.0003 7.5C14.4855 7.5 16.5003 9.51472 16.5003 12C16.5003 14.4853 14.4855 16.5 12.0003 16.5ZM12.0003 14.5C13.381 14.5 14.5003 13.3807 14.5003 12C14.5003 10.6193 13.381 9.5 12.0003 9.5C10.6196 9.5 9.50026 10.6193 9.50026 12C9.50026 13.3807 10.6196 14.5 12.0003 14.5Z","EyeLine"),Ta=U("M11.9995 2C12.5518 2 12.9995 2.44772 12.9995 3V6C12.9995 6.55228 12.5518 7 11.9995 7C11.4472 7 10.9995 6.55228 10.9995 6V3C10.9995 2.44772 11.4472 2 11.9995 2ZM11.9995 17C12.5518 17 12.9995 17.4477 12.9995 18V21C12.9995 21.5523 12.5518 22 11.9995 22C11.4472 22 10.9995 21.5523 10.9995 21V18C10.9995 17.4477 11.4472 17 11.9995 17ZM20.6597 7C20.9359 7.47829 20.772 8.08988 20.2937 8.36602L17.6956 9.86602C17.2173 10.1422 16.6057 9.97829 16.3296 9.5C16.0535 9.02171 16.2173 8.41012 16.6956 8.13398L19.2937 6.63397C19.772 6.35783 20.3836 6.52171 20.6597 7ZM7.66935 14.5C7.94549 14.9783 7.78161 15.5899 7.30332 15.866L4.70525 17.366C4.22695 17.6422 3.61536 17.4783 3.33922 17C3.06308 16.5217 3.22695 15.9101 3.70525 15.634L6.30332 14.134C6.78161 13.8578 7.3932 14.0217 7.66935 14.5ZM20.6597 17C20.3836 17.4783 19.772 17.6422 19.2937 17.366L16.6956 15.866C16.2173 15.5899 16.0535 14.9783 16.3296 14.5C16.6057 14.0217 17.2173 13.8578 17.6956 14.134L20.2937 15.634C20.772 15.9101 20.9359 16.5217 20.6597 17ZM7.66935 9.5C7.3932 9.97829 6.78161 10.1422 6.30332 9.86602L3.70525 8.36602C3.22695 8.08988 3.06308 7.47829 3.33922 7C3.61536 6.52171 4.22695 6.35783 4.70525 6.63397L7.30332 8.13398C7.78161 8.41012 7.94549 9.02171 7.66935 9.5Z","LoaderLine"),hc=U("M1.946 9.315c-.946-.35-.946-1.09 0-1.436l18.108-6.732c.946-.35 1.704.21 1.573 1.236L20.1 21.894c-.117.932-.93 1.636 1.897 1.636.967 0 1.754-.704 1.636-1.636l-.527-4.18L10 12 20.073 7.264l-.527-4.18c-.117-.932.67-1.636 1.637-1.636.967 0 2.014.704 1.897 1.636L21.627 18.57c-.131 1.026-.627 1.586-1.573 1.236L1.946 9.315Z","SendPlaneLine"),yc=U("M6 6h12v12H6V6Zm2 2v8h8V8H8Z","StopLine"),bc=U("M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3Zm0 14a5 5 0 0 0 5-5v-1a1 1 0 1 1 2 0v1a7 7 0 0 1-14 0v-1a1 1 0 1 1 2 0v1a5 5 0 0 0 5 5Z","MicLine"),La=U("M3 3h8.828l2 2H21a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm2 2v12h14V7h-8.414l-2-2H5Z","FolderLine"),_a=U("M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2Z","FolderFillLine"),En=U("M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm4 18H6V4h7v5h5v11z","FileLine"),Pa=U("M12 2C6.477 2 2 6.477 2 12c0 1.5.328 2.932.917 4.215L1.5 21l4.785-1.417A9.966 9.966 0 0 0 12 22c5.523 0 10-4.477 10-10S17.523 2 12 2zm0 2a8 8 0 1 1 0 16 7.99 7.99 0 0 1-3.918-1.018l-.26-.15-2.683.795.795-2.683-.15-.26A7.99 7.99 0 0 1 4 12a8 8 0 0 1 8-8z","Chat3Line"),it=U("M12 7a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V8a1 1 0 0 1 1-1zm0 10a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5z","WarningLine"),ye=U("M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z","ArrowDownSLine"),Tn=U("M14 2l.5 2.5L17 5l-2.5.5L14 8l-.5-2.5L11 5l2.5-.5L14 2zM6 12l1 4 4 1 1-4-4-1-1-4zm8-2l.5 2.5 2.5.5-2.5.5-.5 2.5-.5-2.5-2.5-.5 2.5-.5.5-2.5z","SparklingLine"),Fa=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm1 2v5.586l3.707 3.707-1.414 1.414L11 11.414V6h2z","TimeLine"),Bt=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm3.536 5.536l-4.95 4.95-2.121-2.122-1.414 1.414 3.535 3.536 6.364-6.364-1.414-1.414z","CheckboxCircleLine"),za=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm3.536 2.464l-1.414 1.414L12 10.586 9.878 8.464 8.464 9.878 10.586 12l-2.122 2.121 1.414 1.415L12 13.414l2.121 2.122 1.415-1.414L13.414 12l2.122-2.121z","CloseCircleLine"),Da=U("M6 12c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z","MoreLine"),vc=U("M5.763 17H20V5H4v13.385L5.763 17zm.692 2L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455z","QuestionAnswerLine"),Ma=U("M7 14h10v2H7v-2zm0-4h10v2H7v-2zm0-4h10v2H7V6zm-4 12h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3v-2zm0-4h2v2H3V6z","RequestChangesLine"),Oa=U("M3 5h2v2H3V5zm4 0h14v2H7V5zm-4 6h2v2H3v-2zm4 0h14v2H7v-2zm-4 6h2v2H3v-2zm4 0h14v2H7v-2z","CatalogLine"),$a=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16z","CircleLine"),Ba=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm4 5v2H8V9h8z","IndeterminateCircleLine"),Ga=U("M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm4 10l-4-4v3H6v2h6v3l4-4z","ArrowRightCircleFillLine"),Gt=U("M3 4h14v2H3V4zm0 4h14v2H3V8zm0 4h10v2H3v-2zm0 4h8v2H3v-2z","FileList2Line"),Ha=U("M13 10h5l-6 6-6-6h5V3h2v7zM4 19h16v2H4v-2z","DownloadLine"),Ua=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm1 5v6h-2V9h2zm0-4v2h-2V6h2z","QuestionnaireLine"),Va=U("M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm2 2v12h14V5H5zm2 2h2v2H7V7zm4 0h6v2h-6V7zm-4 4h2v2H7v-2zm4 0h6v2h-6v-2z","TerminalBoxLine"),qa=U("M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v8h-2V6.413l-7.793 7.794-1.414-1.414L17.585 5H13V3h8z","ExternalLinkLine"),Wa=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm1 2.05v1.9c.93.13 1.8.44 2.57.9L14.5 7.2c-.55-.36-1.15-.65-1.78-.9L13 6.05zM6.05 11H4.1c.13.93.44 1.8.9 2.57L7.2 9.5c-.36-.55-.65-1.15-.9-1.78L6.05 11zm1.25 4.5L4.6 16.33c.77.57 1.64.88 2.57 1.01v1.9c.63-.25 1.23-.54 1.78-.9L7.3 15.5zm7.4 0c.55.36 1.15.65 1.78.9v1.9a8.1 8.1 0 0 1-2.57-.9L16.8 15.5l-1.25-1.25zM17.9 13h-1.95c-.25-.63-.54-1.23-.9-1.78L16.8 14.5c.57.77.88 1.64 1.01 2.57zm-5.4-5.4c-.36.55-.65 1.15-.9 1.78H6.05c.13-.93.44-1.8.9-2.57L9.5 7.2l1.25 1.25zm-.9 6.8l1.25 1.25c.77-.57 1.64-.88 2.57-1.01v1.95c-.63.25-1.23.54-1.78.9L9.5 16.8zm4.5-4.5l1.25 1.25L16.8 9.5c-.36-.55-.65-1.15-.9-1.78h1.95c.13.93.44 1.8.9 2.57z","GlobalLine"),Za=U("M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm3.536 2.464l-9.072 9.072a8 8 0 0 1 9.072-9.072zM8.464 17.536a8 8 0 0 1 9.072-9.072l-9.072 9.072z","Forbid2Line"),Oe=K.Root,$e=K.Trigger,kc=K.Group,wc=K.Portal,Qa=K.Sub,Nc=K.RadioGroup,Ya="min-w-32 overflow-hidden rounded-lg border border-border-tertiary bg-bg-container p-1 text-text shadow-lg z-50 outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:!outline-none focus-visible:!ring-0",Te=N.forwardRef(({className:e,sideOffset:t=4,children:s,dataStyle:a,dataTheme:r,...o},i)=>{const l=Ke(),c=a!==void 0?{"data-style":a,"data-theme":r??l["data-theme"]??""}:l;return n.jsx(K.Portal,{children:n.jsx("div",{style:{display:"contents"},...c,children:n.jsx(K.Content,{ref:i,sideOffset:t,className:y(Ya,e),...o,children:n.jsx(te.motion.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.15,ease:[.4,0,.2,1]},children:s})})})})});Te.displayName=K.Content.displayName;const jc=se.cva("flex h-9 w-full cursor-pointer select-none items-center gap-2 rounded-sm px-3 text-sm outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:!outline-none hover:bg-fill-secondary focus:bg-fill-secondary data-[highlighted]:bg-fill-secondary data-[state=open]:bg-fill-secondary",{variants:{inset:{true:"pl-8 pr-3",false:""}},defaultVariants:{inset:!1}}),Ln=N.forwardRef(({className:e,inset:t=!1,children:s,subTriggerIcon:a,...r},o)=>n.jsxs(K.SubTrigger,{ref:o,className:jc({inset:t,className:e}),...r,children:[s,n.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center",children:a??n.jsx(ot,{className:"h-4 w-4"})})]}));Ln.displayName=K.SubTrigger.displayName;const _n=N.forwardRef(({className:e,sideOffset:t=-1,dataStyle:s,dataTheme:a,...r},o)=>{const i=Ke(),l=s!==void 0?{"data-style":s,"data-theme":a??i["data-theme"]??""}:i;return n.jsx(K.Portal,{children:n.jsx("div",{style:{display:"contents"},...l,children:n.jsx(K.SubContent,{ref:o,sideOffset:t,className:y(Ya,e),...r})})})});_n.displayName=K.SubContent.displayName;const Cc=se.cva("relative flex h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm px-3 text-sm outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:!outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{variant:{default:"hover:bg-fill-secondary focus:bg-fill-secondary focus:text-text data-[highlighted]:bg-fill-secondary data-[highlighted]:text-text",destructive:"text-error hover:bg-error-bg focus:bg-error-bg focus:text-error data-[highlighted]:bg-error-bg data-[highlighted]:text-error"},inset:{true:"pl-8 pr-3",false:""}},defaultVariants:{variant:"default",inset:!1}}),we=N.forwardRef(({className:e,inset:t=!1,variant:s="default",...a},r)=>n.jsx(K.Item,{ref:r,className:Cc({variant:s,inset:t,className:e}),...a}));we.displayName=K.Item.displayName;const Ka="relative flex h-9 w-full min-w-0 cursor-pointer select-none items-center gap-2 rounded-sm pl-8 pr-3 text-sm outline-none transition-colors hover:bg-fill-secondary focus:bg-fill-secondary focus:text-text data-[highlighted]:bg-fill-secondary data-[highlighted]:text-text data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Xa=N.forwardRef(({className:e,children:t,checked:s,checkIcon:a,...r},o)=>n.jsxs(K.CheckboxItem,{ref:o,className:y(Ka,e),checked:s,...r,children:[n.jsx("span",{className:"absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center",children:n.jsx(K.ItemIndicator,{children:a??n.jsx(Ie,{className:"h-4 w-4"})})}),t]}));Xa.displayName=K.CheckboxItem.displayName;const Ja=N.forwardRef(({className:e,children:t,...s},a)=>n.jsxs(K.RadioItem,{ref:a,className:y(Ka,e),...s,children:[n.jsx("span",{className:"absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center",children:n.jsx(K.ItemIndicator,{children:n.jsx("div",{className:"h-2 w-2 rounded-full bg-primary"})})}),t]}));Ja.displayName=K.RadioItem.displayName;const Sc=se.cva("flex h-9 items-center px-3 text-sm font-semibold text-text-secondary",{variants:{inset:{true:"pl-8 pr-3",false:""}},defaultVariants:{inset:!1}}),er=N.forwardRef(({className:e,inset:t=!1,...s},a)=>n.jsx(K.Label,{ref:a,className:Sc({inset:t,className:e}),...s}));er.displayName=K.Label.displayName;const tr=N.forwardRef(({className:e,...t},s)=>n.jsx(K.Separator,{ref:s,className:y("my-1 mx-1 h-px bg-border-tertiary",e),...t}));tr.displayName=K.Separator.displayName;const nr=({className:e,...t})=>n.jsx("span",{className:y("ml-auto text-xs tracking-widest text-text-tertiary",e),...t});nr.displayName="DropdownMenuShortcut";const sr=x.createContext(null);function Ic({value:e,children:t}){return n.jsx(sr.Provider,{value:e,children:t})}function lt(){return x.useContext(sr)??{icons:{}}}function R(e,t){const{icons:s}=lt(),a=s[e];if(a)return n.jsx(a,{className:t,"aria-hidden":!0})}const ar=N.forwardRef((e,t)=>{const{style:s,theme:a}=me();return n.jsx(Te,{ref:t,dataStyle:s,dataTheme:a,...e})});ar.displayName="DropdownMenuContent";function Rc(e){const t=R("arrowRight","h-4 w-4 shrink-0"),s=e.subTriggerIcon??t;return n.jsx(Ln,{...e,subTriggerIcon:s})}const rr=N.forwardRef((e,t)=>{const{style:s,theme:a}=me();return n.jsx(_n,{ref:t,dataStyle:s,dataTheme:a,...e})});rr.displayName="DropdownMenuSubContent";const or=ce.Root,Ac=ce.Trigger,ir=ce.Portal,Pn=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Overlay,{ref:s,asChild:!0,...t,children:n.jsx(te.motion.div,{className:y("fixed inset-0 z-50 bg-bg-mask/60",e),initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})}));Pn.displayName=ce.Overlay.displayName;const Ec=se.cva("font-sans fixed left-1/2 top-1/2 z-50 w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-bg-base text-text shadow-lg p-6",{variants:{size:{default:"max-w-lg",sm:"max-w-sm"}},defaultVariants:{size:"default"}}),Fn=N.forwardRef(({className:e,children:t,size:s="default",dataStyle:a,dataTheme:r,...o},i)=>{const l=Ke(),c=a!==void 0?{"data-style":a,"data-theme":r??l["data-theme"]??""}:l;return n.jsx(ir,{children:n.jsxs("div",{style:{display:"contents"},...c,children:[n.jsx(Pn,{}),n.jsx(ce.Content,{ref:i,asChild:!0,...o,children:n.jsx(te.motion.div,{className:y(Ec({size:s}),e),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.4,0,.2,1]},children:t})})]})})});Fn.displayName=ce.Content.displayName;const zn=N.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:y("flex flex-col gap-2",e),...t}));zn.displayName="AlertDialogHeader";const Dn=N.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:y("mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t}));Dn.displayName="AlertDialogFooter";const Mn=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Title,{ref:s,className:y("font-sans text-base font-medium leading-6 text-text",e),...t}));Mn.displayName=ce.Title.displayName;const On=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Description,{ref:s,className:y("text-sm leading-6 text-text-tertiary",e),...t}));On.displayName=ce.Description.displayName;const Tc=se.cva("inline-flex h-9 items-center justify-center rounded px-4 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50 cursor-pointer",{variants:{destructive:{true:"bg-error text-text-on-primary hover:bg-error-hover active:bg-error",false:"bg-bg-highlight text-text-on-primary hover:bg-bg-highlight-hover"}},defaultVariants:{destructive:!1}}),lr=N.forwardRef(({className:e,destructive:t=!1,...s},a)=>n.jsx(ce.Action,{ref:a,className:y(Tc({destructive:t}),e),...s}));lr.displayName=ce.Action.displayName;const $n=N.forwardRef(({className:e,...t},s)=>n.jsx(ce.Cancel,{ref:s,className:y("inline-flex h-9 items-center justify-center rounded px-4 text-sm font-medium cursor-pointer","bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text","transition-colors focus:outline-none",e),...t}));$n.displayName=ce.Cancel.displayName;const cr=N.forwardRef((e,t)=>{const{style:s,theme:a}=me();return n.jsx(Fn,{ref:t,dataStyle:s,dataTheme:a,...e})});cr.displayName="AlertDialogContent";const dr=N.forwardRef(({className:e,...t},s)=>n.jsx("div",{ref:s,className:y("mb-4 inline-flex h-10 w-10 items-center justify-center rounded-lg bg-fill-tertiary text-text",e),...t}));dr.displayName="AlertDialogMedia";function ur({className:e,...t}){return n.jsx("kbd",{className:y("pointer-events-none inline-flex h-5 w-fit min-w-5 select-none items-center justify-center gap-1 rounded-sm px-1 !font-sans text-xs font-medium","bg-fill-secondary text-text-secondary","[.tooltip-content_&]:bg-bg-highlight-hover [.tooltip-content_&]:text-text-on-primary","dark:[.tooltip-content_&]:bg-[color:var(--color-bg-base)]/10 dark:[.tooltip-content_&]:text-[var(--color-bg-base)]",e),...t})}ur.displayName="Kbd";function pr({className:e,children:t,separator:s="+",...a}){const r=N.Children.toArray(t);return n.jsx("span",{className:y("inline-flex items-center gap-1",e),...a,children:r.map((o,i)=>n.jsxs(N.Fragment,{children:[o,i<r.length-1&&n.jsx("span",{className:"select-none !font-sans text-xs font-medium text-text-secondary",children:s})]},i))})}pr.displayName="KbdGroup";const et={fast:.15,base:.2,slow:.3},tt={standard:[.16,1,.3,1],emphasized:[.2,.8,.2,1],out:[0,0,.2,1]},mr={snappy:{type:"spring",stiffness:520,damping:34,mass:.7}},Lc=se.cva("peer inline-flex shrink-0 cursor-pointer items-center rounded-full overflow-hidden border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-border focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-fill-secondary",{variants:{size:{md:"h-5 w-9",lg:"h-6 w-11"}},defaultVariants:{size:"md"}}),_c=se.cva("pointer-events-none block rounded-full bg-text-on-primary ring-0 transition-transform data-[state=unchecked]:translate-x-0",{variants:{size:{md:"h-4 w-4 data-[state=checked]:translate-x-4",lg:"h-5 w-5 data-[state=checked]:translate-x-4.5"}},defaultVariants:{size:"md"}}),fr=N.forwardRef(({className:e,size:t="md",disabled:s=!1,...a},r)=>n.jsx(Ns.Root,{ref:r,className:y(Lc({size:t}),e),disabled:s,...a,children:n.jsx(Ns.Thumb,{className:_c({size:t})})}));fr.displayName="Switch";const Ls={sm:{buttonClass:"w-5 h-5",iconClass:"w-3.5 h-3.5",trackClass:"p-0.5 rounded-md gap-0.5",thumbClass:"w-5 h-5 rounded-sm top-0.5 bottom-0.5",buttonRounded:"rounded-sm"},md:{buttonClass:"w-6 h-6",iconClass:"w-4 h-4",trackClass:"p-0.5 rounded-lg gap-0.5",thumbClass:"w-6 h-6 rounded-md top-0.5 bottom-0.5",buttonRounded:"rounded-md"}};function Pc(e){if(e==="normal"||!e)return 0;const t=parseFloat(e);return e.endsWith("px")?t:e.endsWith("rem")?t*16:t}const Bn=N.forwardRef(({variant:e="toggle",className:t,size:s="md",options:a,value:r,defaultValue:o="preview",onValueChange:i,segmentSize:l="md",disabled:c=!1,...d},p)=>{const{style:m,theme:b}=me(),w={};if(m&&(w["data-style"]=m),b&&(w["data-theme"]=b),e==="toggle")return n.jsx("div",{ref:p,...w,className:"inline-flex",children:n.jsx(fr,{size:s,className:t,disabled:c,...d})});const u=Ls[l].iconClass,g=n.jsx(xc,{className:u}),f=n.jsx(Ea,{className:u}),[k,h]=N.useState(o),v=N.useRef(null),[S,C]=N.useState({buttonWidth:24,gapPx:2});N.useLayoutEffect(()=>{if(!v.current)return;const O=v.current,W=O.querySelector("button"),oe=W?Pc(getComputedStyle(O).gap):0,Z=W?.offsetWidth??24;C(V=>V.buttonWidth===Z&&V.gapPx===oe?V:{buttonWidth:Z,gapPx:oe})},[m,l,a?.length]);const T=[{value:"code",label:"Code",icon:g},{value:"preview",label:"Preview",icon:f}],E=a?.length?a:T,I=r!==void 0,F=(I?r:k)??o,Q=O=>{c||(I||h(O),i?.(O))},z=E.findIndex(O=>O.value===F),G=z>=0?z:0,re=Ls[l],{buttonClass:M,trackClass:$,thumbClass:q,buttonRounded:ee}=re,A=G*(S.buttonWidth+S.gapPx);return n.jsx("div",{ref:p,...w,className:"inline-flex",children:n.jsxs("div",{ref:v,role:"radiogroup","aria-disabled":c||void 0,className:ke.clsx("relative inline-flex items-center",$,"bg-fill-secondary",c?"opacity-50 cursor-not-allowed":"cursor-pointer",t),...d,children:[n.jsx(te.motion.span,{className:ke.clsx("absolute left-0.5 bg-bg-base shadow-sm",q),initial:!1,animate:{x:A},transition:{type:"tween",duration:et.base,ease:tt.out}}),E.map(O=>{const W=O.value===F;return n.jsx("button",{type:"button",role:"radio","aria-checked":W,"aria-label":O.label,disabled:c,onClick:()=>Q(O.value),className:ke.clsx("relative z-10 inline-flex items-center justify-center",ee,M,"transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-border",W?"text-primary-active":"text-text-secondary"),children:n.jsx("span",{className:"inline-flex items-center justify-center",children:O.icon})},O.value)})]})})});Bn.displayName="Switch";function Fc({size:e="md",value:t,defaultValue:s="preview",onValueChange:a,disabled:r=!1,className:o,...i}){return n.jsx(Bn,{variant:"segment",segmentSize:e,value:t,defaultValue:s,onValueChange:a,disabled:r,className:o,...i})}const gr=se.cva("inline-flex items-center justify-center gap-1.5 font-medium transition-colors duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-border focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base disabled:pointer-events-none disabled:opacity-50 cursor-pointer data-[state=on]:bg-fill data-[state=on]:text-text",{variants:{variant:{default:"bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text data-[state=on]:bg-fill data-[state=on]:text-text",outline:"border border-border-tertiary bg-transparent text-text-secondary hover:bg-fill-secondary hover:text-text data-[state=on]:border-border-secondary data-[state=on]:bg-fill data-[state=on]:text-text"},size:{sm:"h-7 px-2 text-xs",md:"h-9 px-3 text-sm",lg:"h-11 px-4 text-base"},rounded:{square:"rounded",pill:"rounded-full"}},defaultVariants:{variant:"default",size:"md",rounded:"square"}}),xr=x.forwardRef(({variant:e="default",size:t="md",rounded:s="square",className:a,prefixIcon:r,suffixIcon:o,children:i,...l},c)=>n.jsxs(pl.Root,{ref:c,className:gr({variant:e,size:t,rounded:s,className:a}),...l,children:[r&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:r}),i,o&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:o})]}));xr.displayName="Toggle";const hr=x.createContext(null),zc={none:"gap-0",sm:"gap-1",md:"gap-2"},Dc=["shrink-0","group-data-[spacing=0]/toggle-group:rounded-none","group-data-[spacing=0]/toggle-group:group-data-[orientation=horizontal]/toggle-group:first:rounded-l","group-data-[spacing=0]/toggle-group:group-data-[orientation=horizontal]/toggle-group:last:rounded-r","group-data-[spacing=0]/toggle-group:group-data-[orientation=vertical]/toggle-group:first:rounded-t","group-data-[spacing=0]/toggle-group:group-data-[orientation=vertical]/toggle-group:last:rounded-b","group-data-[spacing=0]/toggle-group:data-[variant=outline]:group-data-[orientation=horizontal]/toggle-group:[&:not(:first-child)]:border-l-0","group-data-[spacing=0]/toggle-group:data-[variant=outline]:group-data-[orientation=vertical]/toggle-group:[&:not(:first-child)]:border-t-0"].join(" "),yr=x.forwardRef(({type:e="single",variant:t="default",size:s="md",rounded:a="square",spacing:r="none",className:o,orientation:i="horizontal",children:l,...c},d)=>{const p=y("group/toggle-group inline-flex w-fit",i==="horizontal"?"flex-row":"flex-col",i==="vertical"&&"items-stretch",zc[r],o),m={ref:d,orientation:i,"data-spacing":r==="none"?"0":r,"data-orientation":i,"data-variant":t,"data-size":s,className:p};return n.jsx(hr.Provider,{value:{variant:t,size:s,rounded:a,spacing:r},children:e==="multiple"?n.jsx(hn.Root,{...m,...c,type:"multiple",children:l}):n.jsx(hn.Root,{...m,...c,type:"single",children:l})})});yr.displayName="ToggleGroup";const br=x.forwardRef(({variant:e,size:t,rounded:s,className:a,prefixIcon:r,suffixIcon:o,children:i,...l},c)=>{const d=x.useContext(hr),p=e??d?.variant??"default",m=t??d?.size??"md",b=s??d?.rounded??"square";return n.jsxs(hn.Item,{ref:c,"data-variant":p,"data-size":m,className:y(gr({variant:p,size:m,rounded:b}),d&&Dc,"focus-visible:z-10",a),...l,children:[r&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:r}),i,o&&n.jsx("span",{className:"inline-flex shrink-0 items-center justify-center [&>*]:block [&>*]:leading-none",children:o})]})});br.displayName="ToggleGroupItem";const Mc=se.cva("grid gap-2",{variants:{orientation:{vertical:"grid-flow-row",horizontal:"grid-flow-col auto-cols-max"}},defaultVariants:{orientation:"vertical"}}),Oc=se.cva("shrink-0 rounded-full border border-border-tertiary outline-offset-2 cursor-pointer transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary-border disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-text data-[state=checked]:bg-text data-[state=checked]:text-bg-base",{variants:{size:{sm:"size-3.5",md:"size-4",lg:"size-5"}},defaultVariants:{size:"md"}}),$c={sm:"size-1.5",md:"size-2",lg:"size-2.5"},vr=N.forwardRef(({className:e,orientation:t="vertical",...s},a)=>n.jsx(xn.Root,{ref:a,className:y(Mc({orientation:t,className:e})),orientation:t??"vertical",...s}));vr.displayName="RadioGroup";const kr=N.forwardRef(({className:e,size:t="md",...s},a)=>n.jsx(xn.Item,{ref:a,className:y(Oc({size:t,className:e})),...s,children:n.jsx(xn.Indicator,{className:"flex items-center justify-center",children:n.jsx("span",{className:y("rounded-full bg-current",$c[t??"md"])})})}));kr.displayName="RadioGroupItem";const _s=`
2
2
  .CollapsibleSection-scroll-list::-webkit-scrollbar { display: none; }
3
3
  .CollapsibleSection-scroll-list { scrollbar-width: none; -ms-overflow-style: none; }
4
4
  `;function Bc({maxHeight:e,children:t}){const s=x.useRef(null),[a,r]=x.useState(!1),[o,i]=x.useState(!1),l=x.useCallback(()=>{const c=s.current;if(!c)return;const{scrollTop:d,scrollHeight:p,clientHeight:m}=c;r(d>0),i(d+m<p-1)},[]);return x.useEffect(()=>{const c=s.current;if(!c)return;l();const d=new ResizeObserver(l);return d.observe(c),c.addEventListener("scroll",l,{passive:!0}),()=>{d.disconnect(),c.removeEventListener("scroll",l)}},[e,l]),n.jsxs("div",{className:"relative flex flex-1 min-h-0 flex-col overflow-hidden",children:[n.jsx("div",{ref:s,className:"CollapsibleSection-scroll-list flex flex-1 min-h-0 flex-col overflow-y-auto overflow-x-hidden",style:{maxHeight:e,scrollbarWidth:"none",msOverflowStyle:"none"},children:t}),a&&n.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 pointer-events-none",style:{background:"linear-gradient(to bottom, var(--color-bg-base) 0%, transparent 100%)"},"aria-hidden":!0}),o&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 z-10 pointer-events-none",style:{background:"linear-gradient(to top, var(--color-bg-base) 0%, transparent 100%)"},"aria-hidden":!0})]})}function Gc({children:e}){const t=x.useRef(null),[s,a]=x.useState(!1),[r,o]=x.useState(!1),i=x.useCallback(()=>{const l=t.current;if(!l)return;const{scrollTop:c,scrollHeight:d,clientHeight:p}=l;a(c>0),o(c+p<d-1)},[]);return x.useEffect(()=>{const l=t.current;if(!l)return;i();const c=new ResizeObserver(i);return c.observe(l),l.addEventListener("scroll",i,{passive:!0}),()=>{c.disconnect(),l.removeEventListener("scroll",i)}},[i]),n.jsxs("div",{className:"relative flex flex-1 min-h-0 flex-col overflow-hidden",children:[n.jsx("div",{ref:t,className:"CollapsibleSection-scroll-list flex flex-1 min-h-0 flex-col overflow-y-auto overflow-x-hidden",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e}),s&&n.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 pointer-events-none",style:{background:"linear-gradient(to bottom, var(--color-bg-base) 0%, transparent 100%)"},"aria-hidden":!0}),r&&n.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 z-10 pointer-events-none",style:{background:"linear-gradient(to top, var(--color-bg-base) 0%, transparent 100%)"},"aria-hidden":!0})]})}function wr({title:e,description:t,children:s,open:a,onToggle:r,isLast:o=!1,className:i,id:l,contentMaxHeight:c,footer:d}){const p=x.useId(),m=l??`collapsible-section-${p.replace(/:/g,"")}`,b=R("arrowRight","w-4 h-4 text-text-secondary")??n.jsx(ot,{className:"w-4 h-4 text-text-secondary"}),w=s!=null?c!=null?d!=null?n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:_s}}),n.jsxs("div",{className:"flex flex-col flex-1 min-h-0",style:{maxHeight:c},children:[n.jsx(Gc,{children:s}),n.jsx("div",{className:"shrink-0",children:d})]})]}):n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:_s}}),n.jsx(Bc,{maxHeight:c,children:s})]}):n.jsx("div",{className:"flex flex-1 min-h-0 flex-col",children:s}):void 0;return n.jsxs("div",{className:ke.clsx("flex flex-col justify-center self-stretch border-border-tertiary",!o&&"border-b border-dashed",a?"gap-1.5 py-4":"py-4",i),children:[n.jsxs("button",{type:"button",onClick:r,className:ke.clsx("flex flex-row items-center justify-between self-stretch w-full","bg-transparent border-0 cursor-pointer p-0","hover:opacity-90 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1 rounded"),"aria-expanded":a,"aria-controls":m,"aria-label":`${a?"收起":"展开"} ${e}`,children:[n.jsx("span",{className:"font-medium text-sm leading-[var(--font-size-sm--line-height)] text-text-secondary",children:e}),n.jsx("span",{className:ke.clsx("inline-flex items-center justify-center p-1.5 rounded-full","hover:bg-fill-tertiary active:bg-fill-secondary"),"aria-hidden":!0,children:n.jsx(te.motion.span,{className:"inline-flex items-center justify-center",animate:{rotate:a?90:0},transition:mr.snappy,children:b})})]}),n.jsx(te.AnimatePresence,{initial:!1,children:a&&n.jsx(te.motion.div,{id:m,className:"overflow-hidden",initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:et.base,ease:tt.emphasized},children:n.jsxs(te.motion.div,{className:"flex flex-col gap-1.5",initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:et.fast,ease:tt.emphasized},children:[t!=null&&n.jsx(te.motion.p,{className:"text-xs leading-[var(--font-size-xs--line-height)] text-text-quaternary w-full max-w-54",initial:{opacity:0},animate:{opacity:1},transition:{duration:et.fast,ease:tt.emphasized},children:t}),w]})},"content")})]})}wr.displayName="CollapsibleSection";function Hc(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function Uc(e,t=[]){let s=[];function a(o,i){const l=N.createContext(i),c=s.length;s=[...s,i];const d=m=>{const{scope:b,children:w,...u}=m,g=b?.[e]?.[c]||l,f=N.useMemo(()=>u,Object.values(u));return n.jsx(g.Provider,{value:f,children:w})};d.displayName=o+"Provider";function p(m,b){const w=b?.[e]?.[c]||l,u=N.useContext(w);if(u)return u;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,p]}const r=()=>{const o=s.map(i=>N.createContext(i));return function(l){const c=l?.[e]||o;return N.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return r.scopeName=e,[a,Vc(r,...t)]}function Vc(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(o){const i=a.reduce((l,{useScope:c,scopeName:d})=>{const m=c(o)[`__scope${d}`];return{...l,...m}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return s.scopeName=t.scopeName,s}var rt=globalThis?.document?N.useLayoutEffect:()=>{},qc=N[" useInsertionEffect ".trim().toString()]||rt;function Wc({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,o,i]=Zc({defaultProp:t,onChange:s}),l=e!==void 0,c=l?e:r;{const p=N.useRef(e!==void 0);N.useEffect(()=>{const m=p.current;m!==l&&console.warn(`${a} is changing from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,a])}const d=N.useCallback(p=>{if(l){const m=Qc(p)?p(e):p;m!==e&&i.current?.(m)}else o(p)},[l,e,o,i]);return[c,d]}function Zc({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),o=N.useRef(t);return qc(()=>{o.current=t},[t]),N.useEffect(()=>{r.current!==s&&(o.current?.(s),r.current=s)},[s,r]),[s,a,o]}function Qc(e){return typeof e=="function"}function Ps(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nr(...e){return t=>{let s=!1;const a=e.map(r=>{const o=Ps(r,t);return!s&&typeof o=="function"&&(s=!0),o});if(s)return()=>{for(let r=0;r<a.length;r++){const o=a[r];typeof o=="function"?o():Ps(e[r],null)}}}}function jr(...e){return N.useCallback(Nr(...e),e)}function Yc(e){const t=Kc(e),s=N.forwardRef((a,r)=>{const{children:o,...i}=a,l=N.Children.toArray(o),c=l.find(Jc);if(c){const d=c.props.children,p=l.map(m=>m===c?N.Children.count(d)>1?N.Children.only(null):N.isValidElement(d)?d.props.children:null:m);return n.jsx(t,{...i,ref:r,children:N.isValidElement(d)?N.cloneElement(d,void 0,p):null})}return n.jsx(t,{...i,ref:r,children:o})});return s.displayName=`${e}.Slot`,s}function Kc(e){const t=N.forwardRef((s,a)=>{const{children:r,...o}=s;if(N.isValidElement(r)){const i=td(r),l=ed(o,r.props);return r.type!==N.Fragment&&(l.ref=a?Nr(a,i):i),N.cloneElement(r,l)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xc=Symbol("radix.slottable");function Jc(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xc}function ed(e,t){const s={...t};for(const a in t){const r=e[a],o=t[a];/^on[A-Z]/.test(a)?r&&o?s[a]=(...l)=>{const c=o(...l);return r(...l),c}:r&&(s[a]=r):a==="style"?s[a]={...r,...o}:a==="className"&&(s[a]=[r,o].filter(Boolean).join(" "))}return{...e,...s}}function td(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var nd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gn=nd.reduce((e,t)=>{const s=Yc(`Primitive.${t}`),a=N.forwardRef((r,o)=>{const{asChild:i,...l}=r,c=i?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function sd(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Cr=e=>{const{present:t,children:s}=e,a=ad(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),o=jr(a.ref,rd(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:o}):null};Cr.displayName="Presence";function ad(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),o=N.useRef("none"),i=e?"mounted":"unmounted",[l,c]=sd(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const d=Ct(a.current);o.current=l==="mounted"?d:"none"},[l]),rt(()=>{const d=a.current,p=r.current;if(p!==e){const b=o.current,w=Ct(d);e?c("MOUNT"):w==="none"||d?.display==="none"?c("UNMOUNT"):c(p&&b!==w?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),rt(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=w=>{const g=Ct(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&g&&(c("ANIMATION_END"),!r.current)){const f=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=f)})}},b=w=>{w.target===t&&(o.current=Ct(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:N.useCallback(d=>{a.current=d?getComputedStyle(d):null,s(d)},[])}}function Ct(e){return e?.animationName||"none"}function rd(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var od=N[" useId ".trim().toString()]||(()=>{}),id=0;function ld(e){const[t,s]=N.useState(od());return rt(()=>{s(a=>a??String(id++))},[e]),e||(t?`radix-${t}`:"")}var Ht="Collapsible",[cd]=Uc(Ht),[dd,Hn]=cd(Ht),Sr=N.forwardRef((e,t)=>{const{__scopeCollapsible:s,open:a,defaultOpen:r,disabled:o,onOpenChange:i,...l}=e,[c,d]=Wc({prop:a,defaultProp:r??!1,onChange:i,caller:Ht});return n.jsx(dd,{scope:s,disabled:o,contentId:ld(),open:c,onOpenToggle:N.useCallback(()=>d(p=>!p),[d]),children:n.jsx(Gn.div,{"data-state":qn(c),"data-disabled":o?"":void 0,...l,ref:t})})});Sr.displayName=Ht;var Ir="CollapsibleTrigger",Rr=N.forwardRef((e,t)=>{const{__scopeCollapsible:s,...a}=e,r=Hn(Ir,s);return n.jsx(Gn.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":qn(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...a,ref:t,onClick:Hc(e.onClick,r.onOpenToggle)})});Rr.displayName=Ir;var Un="CollapsibleContent",Vn=N.forwardRef((e,t)=>{const{forceMount:s,...a}=e,r=Hn(Un,e.__scopeCollapsible);return n.jsx(Cr,{present:s||r.open,children:({present:o})=>n.jsx(ud,{...a,ref:t,present:o})})});Vn.displayName=Un;var ud=N.forwardRef((e,t)=>{const{__scopeCollapsible:s,present:a,children:r,...o}=e,i=Hn(Un,s),[l,c]=N.useState(a),d=N.useRef(null),p=jr(t,d),m=N.useRef(0),b=m.current,w=N.useRef(0),u=w.current,g=i.open||l,f=N.useRef(g),k=N.useRef(void 0);return N.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),rt(()=>{const h=d.current;if(h){k.current=k.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const v=h.getBoundingClientRect();m.current=v.height,w.current=v.width,f.current||(h.style.transitionDuration=k.current.transitionDuration,h.style.animationName=k.current.animationName),c(a)}},[i.open,a]),n.jsx(Gn.div,{"data-state":qn(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!g,...o,ref:p,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":u?`${u}px`:void 0,...e.style},children:g&&r})});function qn(e){return e?"open":"closed"}var pd=Sr;const md=pd,fd=Rr,Ar=N.forwardRef(({className:e,...t},s)=>n.jsx(Vn,{ref:s,className:y("overflow-hidden",e),...t}));Ar.displayName=Vn.displayName;const Er=N.forwardRef(function({direction:t="horizontal",className:s,...a},r){return n.jsx(jn.Group,{elementRef:r,orientation:t,className:y("flex h-full w-full",t==="vertical"&&"flex-col",s),...a})});Er.displayName="ResizablePanelGroup";const Tr=N.forwardRef(function({className:t,...s},a){return n.jsx(jn.Panel,{elementRef:a,className:y(t),...s})});Tr.displayName="ResizablePanel";const Lr=N.forwardRef(function({withHandle:t=!1,className:s,...a},r){return n.jsx(jn.Separator,{elementRef:r,className:y("relative flex shrink-0 items-center justify-center bg-border-tertiary","after:absolute after:inset-0 after:transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1","data-[resize-handle-active]:bg-border-secondary","aria-[orientation=vertical]:h-full aria-[orientation=vertical]:w-px aria-[orientation=vertical]:cursor-col-resize","aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:cursor-row-resize","[&[aria-orientation=vertical]>div]:h-6 [&[aria-orientation=vertical]>div]:w-1","[&[aria-orientation=horizontal]>div]:h-1 [&[aria-orientation=horizontal]>div]:w-6",s),...a,children:t&&n.jsx("div",{className:"z-10 shrink-0 rounded-lg bg-border-secondary","data-resize-handle":!0})})});Lr.displayName="ResizableHandle";const be=x.forwardRef(function({children:t,className:s,style:a,maxHeight:r,scrollbarVisibility:o="auto",scrollbarWidth:i=6},l){const d=`Scrollbar-${x.useId().replace(/:/g,"")}`,p=x.useRef(null),[m,b]=x.useState(!1),w=x.useCallback(()=>{o==="auto"&&(b(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null,b(!1)},800))},[o]);x.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const u=()=>{if(o==="hidden")return`
@@ -37,7 +37,7 @@
37
37
  .status-dots-anim {
38
38
  animation: status-dots 1.2s ease-in-out infinite;
39
39
  }
40
- `}),s&&n.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-primary-active",children:s}),o!=null&&n.jsx(Ld,{content:String(o)}),o==null&&e!=null&&n.jsx("span",{className:"font-medium text-primary-active",children:e}),a&&n.jsx("span",{className:"ml-auto font-medium font-mono text-primary-active",children:a})]})};es.displayName="GenerationStatusBar";function _d(e,t,s){x.useEffect(()=>{const a=e.current;if(!a)return;a.style.height="auto";const o=(parseFloat(getComputedStyle(a).lineHeight)||24)*s;a.scrollHeight<=o?a.style.height=`${a.scrollHeight}px`:a.style.height=`${o}px`},[e,t,s])}const Mo=x.forwardRef(({value:e,onChange:t,placeholder:s="What can I help you with today?",disabled:a=!1,maxRows:r=6,onKeyDown:o,className:i,style:l,...c},d)=>{const p=x.useRef(null);_d(p,e,r);const m=x.useCallback(g=>{p.current=g,typeof d=="function"?d(g):d&&(d.current=g)},[d]),b=x.useCallback(g=>t?.(g.target.value),[t]),w={outline:"none",border:"none",boxShadow:"none"},u="w-full resize-none border-none bg-transparent text-sm leading-sm font-normal placeholder:text-text-tertiary overflow-y-auto scrollbar-auto outline-none shadow-none focus:outline-none focus:ring-0 focus:shadow-none focus-visible:outline-none focus-visible:ring-0 focus-visible:shadow-none [&:focus-visible]:outline-none [&:focus-visible]:ring-0 [&:focus-visible]:ring-offset-0 [&:focus-visible]:shadow-none "+(e?.trim()?"text-text":"text-text-quaternary");return n.jsx("textarea",{ref:m,value:e,onChange:b,onKeyDown:o,placeholder:s,disabled:a,rows:1,className:u,...c,style:{...l??{},...w}})});Mo.displayName="ChatInputTextarea";function Oo({open:e,onOpenChange:t,projectName:s,onAllowOnce:a,onAllowAlways:r}){return n.jsx(or,{open:e,onOpenChange:t,children:n.jsxs(Fn,{className:"p-6",children:[n.jsxs(zn,{children:[n.jsxs(Mn,{className:"text-xl leading-xl font-semibold text-text",children:['Allow Qoder Work to access and modify files in "',s,'"?']}),n.jsx(On,{className:"mt-2 text-sm leading-sm text-text-tertiary",children:"This permission applies to all files and subfolders in this directory. Qoder Work may read, update, and permanently delete files here, and may share relevant file contents with connected tools when needed. Only allow access to folders you trust."})]}),n.jsxs(Dn,{className:"mt-6 flex flex-row justify-end gap-2",children:[n.jsx($n,{className:"h-9 rounded-full px-4",children:"Cancel"}),n.jsx("button",{type:"button",className:"inline-flex h-9 items-center justify-center rounded-full px-4 text-sm leading-sm font-medium border border-border bg-bg-base text-text transition-colors hover:bg-fill-tertiary active:bg-fill-secondary",onClick:r,children:"Always Allow"}),n.jsx("button",{type:"button",className:"inline-flex h-9 items-center justify-center rounded-full px-4 text-sm leading-sm font-medium bg-text text-text-on-primary transition-opacity hover:opacity-90 active:opacity-95",onClick:a,children:"Allow"})]})]})})}Oo.displayName="FolderPermissionDialog";const Pd=["~/Projects/qoder-work-ui","~/Documents/workspace","~/Desktop/demo","~/code/my-app"],fn="mr-2 w-4 h-4 shrink-0";function $o({disabled:e,folderButtonLabel:t,folderPermission:s,onFolderButtonClick:a,onFolderClear:r,onFolderSelect:o,hasFolderSelected:i,dataStyle:l,dataTheme:c,folderIcon:d=n.jsx(La,{className:fn}),folderOpenIcon:p=n.jsx(_a,{className:fn}),historyIcon:m=n.jsx(Fa,{className:fn}),subMenuArrowIcon:b,folderFillIcon:w,closeIcon:u}){const g=s?.enable??!1,f=s?.projectName??"04_代码",[k,h]=x.useState(!1),[v,S]=x.useState(!1),[C,T]=x.useState(!1),E=x.useRef(null),I=a??(()=>{}),F=()=>{E.current?.click()},Q=()=>{E.current&&(E.current.value=""),r?.()},z=x.useCallback(M=>{M==="always"&&S(!0),h(!1),T(!0)},[]),G=M=>{if(!g){T(M);return}if(!M){T(!1);return}if(v){T(!0);return}h(!0),T(!1)},re=M=>{const $=M.target.files;$&&$.length>0&&o($)};return a?n.jsx(Pt,{label:t,onClick:I,disabled:e,folderIcon:d,folderFillIcon:w}):n.jsxs(n.Fragment,{children:[n.jsxs(Oe,{open:C,onOpenChange:G,children:[n.jsx($e,{asChild:!0,children:n.jsx(Pt,{label:t,disabled:e,selected:i,onClear:Q,folderIcon:d,folderFillIcon:w,closeIcon:u,className:"focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0"})}),n.jsxs(Te,{align:"start",side:"top",className:"min-w-50",dataStyle:l,dataTheme:c,children:[n.jsxs(we,{onClick:F,children:[d,"Add folder"]}),i&&n.jsxs(we,{onClick:F,children:[p,"Replace folder"]}),n.jsxs(Qa,{children:[n.jsxs(Ln,{subTriggerIcon:b,children:[m,"Recent folders"]}),n.jsx(_n,{collisionPadding:{bottom:24,left:8},dataStyle:l,dataTheme:c,children:Pd.map(M=>n.jsx(we,{onClick:()=>{},children:M},M))})]})]})]}),n.jsx("input",{ref:E,type:"file",webkitdirectory:"",multiple:!0,style:{display:"none"},onChange:re}),g&&n.jsx(Oo,{open:k,onOpenChange:h,projectName:f,onAllowOnce:()=>z("once"),onAllowAlways:()=>z("always")})]})}$o.displayName="ChatInputFolderSelector";function Bo({config:e,disabled:t,dataStyle:s,dataTheme:a,arrowDownIcon:r=n.jsx(ye,{className:"h-3.5 w-3.5 shrink-0 text-text-secondary"})}){const i=e.modeSwitch.options.find(l=>l.value===e.modeSwitch.value)?.icon??e.modeSwitch.icon;return n.jsxs("div",{className:"flex items-center gap-3 text-sm leading-sm text-text-secondary",children:[n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md bg-fill-secondary px-2.5 py-1.5 text-sm leading-sm text-text hover:bg-fill focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",disabled:t,children:[i!=null&&n.jsx("span",{className:"flex shrink-0 items-center [&>*]:block [&>*]:leading-none",children:i}),n.jsx("span",{children:e.modeSwitch.label}),r]})}),n.jsx(Te,{align:"start",side:"top",className:"min-w-30",dataStyle:s,dataTheme:a,children:e.modeSwitch.options.map(l=>n.jsxs(we,{onClick:()=>e.modeSwitch.onChange(l.value),className:"flex items-center justify-between gap-2",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[l.icon!=null&&n.jsx("span",{className:"flex shrink-0 [&>*]:block [&>*]:leading-none [&>*]:size-4",children:l.icon}),l.label]}),e.modeSwitch.value===l.value&&n.jsx(Ie,{className:"h-4 w-4 shrink-0 text-primary"})]},l.value))})]}),n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-text-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded px-1 py-0.5 disabled:opacity-50",disabled:t,children:[n.jsx("span",{children:e.modelSwitch.label}),r]})}),n.jsx(Te,{align:"start",side:"top",className:"min-w-25",dataStyle:s,dataTheme:a,children:e.modelSwitch.options.map(l=>n.jsxs(we,{onClick:()=>e.modelSwitch.onChange(l.value),className:"flex items-center justify-between gap-2",children:[l.label,e.modelSwitch.value===l.value&&n.jsx(Ie,{className:"h-4 w-4 shrink-0 text-primary"})]},l.value))})]}),e.consumptionMultiplier.options!=null&&e.consumptionMultiplier.options.length>0&&e.consumptionMultiplier.onChange!=null?n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsx("button",{type:"button",className:"inline-flex items-center text-text-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded px-1 py-0.5 disabled:opacity-50",disabled:t,children:e.consumptionMultiplier.value})}),n.jsx(Te,{align:"start",side:"top",className:"min-w-20",dataStyle:s,dataTheme:a,children:e.consumptionMultiplier.options.map(l=>n.jsxs(we,{onClick:()=>e.consumptionMultiplier.onChange?.(l.value),className:"flex items-center justify-between gap-2",children:[l.label,e.consumptionMultiplier.value===l.value&&n.jsx(Ie,{className:"h-4 w-4 shrink-0 text-primary"})]},l.value))})]}):n.jsx("span",{className:"text-text-secondary",children:e.consumptionMultiplier.value})]})}Bo.displayName="ChatInputModelSwitcher";const Fd=se.cva(["flex flex-col w-full bg-bg-base border border-primary-border rounded-xl transition-all duration-200","shadow-[0_0.25rem_1.25rem_var(--color-shadow-secondary)]","hover:shadow-[0_0.25rem_1.25rem_var(--color-shadow-secondary)]","focus-within:shadow-[0_0.25rem_1.25rem_var(--color-shadow-quaternary)]","hover:focus-within:shadow-[0_0.25rem_1.25rem_var(--color-shadow-quaternary)]"].join(" "),{variants:{disabled:{true:"opacity-50 cursor-not-allowed",false:""}},defaultVariants:{disabled:!1}}),Lt="flex flex-wrap items-center gap-2 px-3 pt-3 pb-2",zd="flex flex-1 items-center min-h-6 p-3",Dd="flex shrink-0 items-center justify-between w-full self-stretch gap-2 p-3";function ct({className:e,style:t,children:s}){return n.jsx("div",{className:y("flex min-h-9 h-9 w-[calc(100%-2*var(--radius-xl))] mx-auto items-center overflow-hidden rounded-t-xl text-sm leading-sm",e),style:t,children:s})}ct.displayName="ChatInputAbove";function dt({className:e,children:t}){const s=Pe();return n.jsx("div",{className:Fd({disabled:s.disabled,className:y("relative",e)}),children:t})}dt.displayName="ChatInputBox";function Vt({className:e,children:t}){return t?n.jsx("div",{className:y(Lt,e),children:t}):null}Vt.displayName="ChatInputAttachments";const ut=x.forwardRef(({placeholder:e="What can I help you with today?",maxRows:t=6,...s},a)=>{const r=Pe(),o=x.useCallback(i=>{r.setTextareaRef(i),typeof a=="function"?a(i):a&&(a.current=i)},[r,a]);return n.jsx("div",{className:zd,children:n.jsx(Mo,{ref:o,value:r.value,onChange:r.onChange,onKeyDown:r.handleKeyDown,placeholder:e,disabled:r.disabled,maxRows:t,...s})})});ut.displayName="ChatInputInput";function pt({className:e,children:t}){return n.jsx("div",{className:y(Dd,e),children:t})}pt.displayName="ChatInputActions";function mt({className:e,children:t}){return n.jsx("div",{className:y("flex items-center gap-2",e),children:t})}mt.displayName="ChatInputActionsLeft";function Ze({className:e,children:t}){return n.jsx("div",{className:y("flex items-center gap-2",e),children:t})}Ze.displayName="ChatInputActionsRight";function qt({className:e,style:t,...s}){return n.jsx("button",{type:"button",className:y("absolute top-2 right-2 z-10 flex h-8 w-8 items-center justify-center rounded-lg text-text-secondary hover:bg-fill-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",e),style:{...t},...s})}qt.displayName="ChatInputExpandButton";function ft(){const e=Pe();return e.showFolderButton?n.jsx($o,{disabled:e.disabled,folderButtonLabel:e.folderButtonLabel,folderPermission:e.folderPermission,onFolderButtonClick:e.onFolderButtonClick,onFolderClear:e.handleFolderClear,onFolderSelect:e.handleFolderSelect,hasFolderSelected:e.hasFolderSelected,dataStyle:e.dataStyle,dataTheme:e.dataTheme,folderIcon:e.folderIcon,folderOpenIcon:e.folderOpenIcon,historyIcon:e.historyIcon,subMenuArrowIcon:e.subMenuArrowIcon,folderFillIcon:e.folderFillIcon,closeIcon:e.closeIcon}):null}ft.displayName="ChatInputFolderButton";function gt(){const e=Pe();return e.showMoreButton?n.jsx(je,{variant:"ghost",icon:e.addLargeIcon??n.jsx(Da,{className:"h-5 w-5"}),onClick:e.onMoreButtonClick,disabled:e.disabled}):null}gt.displayName="ChatInputMoreButton";function Ft(){const e=Pe();return n.jsx(Jn,{disabled:!e.canSend||e.disabled,status:e.sendButtonStatus,...e.form?{type:"submit",form:e.form}:{onClick:e.handleSend}})}Ft.displayName="ChatInputSendButton";function xt(){const e=Pe();return e.footerLeftConfig?n.jsx(Bo,{config:e.footerLeftConfig,disabled:e.disabled,arrowDownIcon:e.arrowDownIcon,dataStyle:e.dataStyle,dataTheme:e.dataTheme}):n.jsxs(n.Fragment,{children:[n.jsx(ft,{}),n.jsx(gt,{})]})}xt.displayName="ChatInputFooterLeft";const Go=x.forwardRef(function({className:t,hasAbove:s=!1,hasAttachments:a=!1,hasFooter:r=!0,aboveOverlap:o=!0},i){const l=Pe(),c=()=>{if(!a||l.attachments==null||l.attachments===!1)return null;const m=l.attachments;return typeof m=="object"&&!x.isValidElement(m)&&("files"in m||"images"in m)?n.jsxs(n.Fragment,{children:[m.files&&n.jsx("div",{className:Lt,children:m.files}),m.images&&n.jsx("div",{className:Lt,children:m.images})]}):n.jsx("div",{className:Lt,children:m})},d=()=>n.jsx(xt,{}),p=n.jsxs(dt,{className:y(!r&&!a&&"min-h-14"),children:[c(),n.jsx(ut,{ref:i}),n.jsx(pt,{children:r?n.jsxs(n.Fragment,{children:[n.jsx(mt,{children:d()}),n.jsx("div",{className:"flex-1 h-5"}),n.jsx(Ze,{children:n.jsx(Ft,{})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1 h-5"}),n.jsx(Ze,{children:n.jsx(Ft,{})})]})})]});return s&&l.showGenerationStatus&&l.generationStatus?n.jsxs("div",{className:y("flex flex-col w-full",t),children:[n.jsx(ct,{children:n.jsx(es,{status:typeof l.generationStatus?.content=="string"?l.generationStatus.content:void 0,icon:l.generationStatus?.icon,time:l.generationStatus?.time,children:l.generationStatus?.content})}),p]}):n.jsx("div",{className:t,children:p})});Go.displayName="ChatInputDefaultLayout";function Md(e){return e==null||e===!1?!1:typeof e=="object"&&!x.isValidElement(e)?!!e.files||!!e.images:!0}const Od=x.forwardRef(function(t,s){const a=Md(t.attachments);return n.jsx(Ut,{...t,children:n.jsx(Go,{ref:s,className:t.className,hasAbove:t.showGenerationStatus,hasAttachments:a,hasFooter:t.showFooter,aboveOverlap:!0})})}),de=Od;de.displayName="ChatInput";de.Root=Ut;de.Above=ct;de.Box=dt;de.Attachments=Vt;de.Input=ut;de.Actions=pt;de.ActionsLeft=mt;de.ActionsRight=Ze;de.ExpandButton=qt;de.FolderButton=ft;de.MoreButton=gt;de.SendButton=Ft;de.FooterLeft=xt;const $d=de,gn="w-4 h-4",ts=x.forwardRef((e,t)=>{const s=R("send",gn),a=R("stop",gn),r=R("mic",gn);return n.jsx(Jn,{ref:t,sendIcon:s,stopIcon:a,micIcon:r,...e})});ts.displayName="SendButton";function ns(e){const{style:t,theme:s}=me(),a=R("more","h-5 w-5 shrink-0"),r=R("folder","mr-2 w-4 h-4 shrink-0"),o=R("folderOpen","mr-2 w-4 h-4 shrink-0"),i=R("history","mr-2 w-4 h-4 shrink-0"),l=R("arrowDownS","h-3.5 w-3.5 shrink-0 text-text-secondary"),c=R("arrowRight","h-4 w-4 shrink-0"),d=R("folderFill","w-4 h-4 shrink-0"),p=R("close","w-4 h-4 shrink-0");return n.jsx(Ut,{...e,dataStyle:t,dataTheme:s,addLargeIcon:a,folderIcon:r,folderOpenIcon:o,historyIcon:i,arrowDownIcon:l,subMenuArrowIcon:c,folderFillIcon:d,closeIcon:p})}ns.displayName="ChatInputRoot";const Ho=x.forwardRef(function(t,s){const{style:a,theme:r}=me(),o=R("more","h-5 w-5 shrink-0"),i=R("folder","mr-2 w-4 h-4 shrink-0"),l=R("folderOpen","mr-2 w-4 h-4 shrink-0"),c=R("history","mr-2 w-4 h-4 shrink-0"),d=R("arrowDownS","h-3.5 w-3.5 shrink-0 text-text-secondary"),p=R("arrowRight","h-4 w-4 shrink-0"),m=R("folderFill","w-4 h-4 shrink-0"),b=R("close","w-4 h-4 shrink-0");return n.jsx($d,{ref:s,dataStyle:a,dataTheme:r,addLargeIcon:o,folderIcon:i,folderOpenIcon:l,historyIcon:c,arrowDownIcon:d,subMenuArrowIcon:p,folderFillIcon:m,closeIcon:b,...t})});Ho.displayName="ChatInput";function ss(){const e=Pe();return n.jsx(ts,{disabled:!e.canSend||e.disabled,status:e.sendButtonStatus,...e.form?{type:"submit",form:e.form}:{onClick:e.handleSend}})}ss.displayName="ChatInputSendButton";const Bd=Object.assign(Ho,{Root:ns,Above:ct,Box:dt,Attachments:Vt,Input:ut,Actions:pt,ActionsLeft:mt,ActionsRight:Ze,ExpandButton:qt,FolderButton:ft,MoreButton:gt,SendButton:ss,FooterLeft:xt}),Gd="w-3.5 h-3.5 shrink-0 text-text-tertiary";function Uo({items:e,onSelect:t,singleLineText:s=!1,className:a,defaultIcon:r}){const o=e.slice(0,3),i=r??n.jsx(Pa,{className:Gd});return o.length===0?null:n.jsx("div",{className:y("flex flex-col gap-3 w-full min-w-0",!s&&"max-w-lg",a),role:"list","aria-label":"Related prompt suggestions",children:o.map((l,c)=>{const d=l.icon??i,p=n.jsxs("button",{type:"button",onClick:()=>t?.(l),className:y("flex items-center gap-2 w-full min-w-0 text-left","rounded-md px-0 py-0 min-h-0","text-xs leading-xs font-normal text-text-tertiary","transition-colors",t&&"cursor-pointer hover:text-text",!t&&"cursor-default"),role:"listitem",children:[n.jsx("span",{className:"w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center",children:d}),n.jsx("span",{className:y("min-w-0 flex-1",s?"truncate":"line-clamp-2"),children:l.text})]});return s?n.jsx(at,{content:l.text,side:"top",children:p},`${l.prompt}-${c}`):n.jsx(x.Fragment,{children:p},`${l.prompt}-${c}`)})})}Uo.displayName="RelatedPrompts";const Hd="w-3.5 h-3.5 shrink-0 text-text-tertiary";function Vo(e){const t=R("chat3",Hd);return n.jsx(Uo,{defaultIcon:t,...e})}Vo.displayName="RelatedPrompts";const Ud="Repo Wiki",Vd=["English","中文","日本語","한국어"],qd="h-3.5 w-3.5",Wd="h-3 w-3",Ms="h-4 w-4";function qo({type:e="wiki",title:t,description:s,highlightText:a=Ud,language:r="English",rechargeText:o,onClose:i,onGenerate:l,onRecharge:c,onLanguageChange:d,closeIcon:p,arrowDownSIcon:m,suggestionIcon:b,dataStyle:w,dataTheme:u}){const g=e==="credits",f=p??n.jsx(_e,{className:qd}),k=m??n.jsx(ye,{className:Wd}),h=b??(g?n.jsx(it,{className:Ms}):n.jsx(Tn,{className:Ms})),v=t??(g?"Credits Exhausted":"Free Wiki Generation Available"),S=g?"Your credits have been exhausted. Please recharge to continue using.":`Generate ${a} for this repository to boost AI agent with structured context.`,C=s??S,T=()=>{if(!C.includes(a))return n.jsx("span",{children:C});const E=C.split(a),I=[];for(let F=0;F<E.length;F++)E[F]&&I.push(n.jsx("span",{children:E[F]},`text-${F}`)),F<E.length-1&&I.push(n.jsx("span",{className:"text-[var(--color-link)]",children:a},`highlight-${F}`));return n.jsx(n.Fragment,{children:I})};return n.jsxs("div",{className:"relative rounded-lg border border-border-tertiary bg-bg-base p-3",children:[i&&n.jsx("button",{type:"button",onClick:i,className:"absolute top-3 right-3 flex h-4 w-4 cursor-pointer items-center justify-center text-text-secondary transition-colors duration-200 hover:text-text","aria-label":"Close",children:f}),n.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[n.jsx("div",{className:y("flex h-4 w-4 shrink-0 items-center justify-center",g?"text-warning":"text-primary"),children:h}),n.jsx("h3",{className:"min-w-0 flex-1 text-base leading-base font-semibold text-text",children:v})]}),n.jsx(n.Fragment,{children:n.jsx(be,{scrollbarVisibility:"auto",maxHeight:96,className:"mb-2 ml-6 text-xs leading-xs text-text-tertiary",children:T()})}),n.jsx("div",{className:"flex items-center justify-end gap-2",children:g?o&&n.jsx(ne,{variant:"secondary",onClick:c,children:o??"前往充值"}):n.jsxs(n.Fragment,{children:[n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsxs(ne,{variant:"ghost",className:"flex items-center gap-1",children:[n.jsx("span",{children:r}),k]})}),n.jsx(Te,{dataStyle:w,dataTheme:u,children:Vd.map(E=>n.jsx(we,{onSelect:()=>d?.(E),children:E},E))})]}),n.jsx(ne,{variant:"secondary",onClick:l,children:"Generate"})]})})]})}qo.displayName="HintBanner";const Zd="h-3.5 w-3.5",Qd="h-3 w-3",Yd="h-4 w-4";function Wo(e){const{style:t,theme:s}=me(),a=R("close",Zd),r=R("arrowDownS",Qd),o=e.type==="credits",i=R(o?"warning":"sparkling",Yd);return n.jsx(qo,{closeIcon:a,arrowDownSIcon:r,suggestionIcon:i,dataStyle:t,dataTheme:s,...e})}Wo.displayName="HintBanner";function Kd(){return n.jsxs("span",{className:"relative block w-5 h-5 shrink-0 flex items-center justify-center","aria-hidden":!0,children:[n.jsx("style",{children:`
40
+ `}),s&&n.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-primary-active",children:s}),o!=null&&n.jsx(Ld,{content:String(o)}),o==null&&e!=null&&n.jsx("span",{className:"font-medium text-primary-active",children:e}),a&&n.jsx("span",{className:"ml-auto font-medium font-mono text-primary-active",children:a})]})};es.displayName="GenerationStatusBar";function _d(e,t,s){x.useEffect(()=>{const a=e.current;if(!a)return;a.style.height="auto";const o=(parseFloat(getComputedStyle(a).lineHeight)||24)*s;a.scrollHeight<=o?a.style.height=`${a.scrollHeight}px`:a.style.height=`${o}px`},[e,t,s])}const Mo=x.forwardRef(({value:e,onChange:t,placeholder:s="What can I help you with today?",disabled:a=!1,maxRows:r=6,onKeyDown:o,className:i,style:l,...c},d)=>{const p=x.useRef(null);_d(p,e,r);const m=x.useCallback(g=>{p.current=g,typeof d=="function"?d(g):d&&(d.current=g)},[d]),b=x.useCallback(g=>t?.(g.target.value),[t]),w={outline:"none",border:"none",boxShadow:"none"},u="w-full resize-none border-none bg-transparent text-sm leading-sm font-normal placeholder:text-text-tertiary overflow-y-auto scrollbar-auto outline-none shadow-none focus:outline-none focus:ring-0 focus:shadow-none focus-visible:outline-none focus-visible:ring-0 focus-visible:shadow-none [&:focus-visible]:outline-none [&:focus-visible]:ring-0 [&:focus-visible]:ring-offset-0 [&:focus-visible]:shadow-none "+(e?.trim()?"text-text":"text-text-quaternary");return n.jsx("textarea",{ref:m,value:e,onChange:b,onKeyDown:o,placeholder:s,disabled:a,rows:1,className:u,...c,style:{...l??{},...w}})});Mo.displayName="ChatInputTextarea";function Oo({open:e,onOpenChange:t,projectName:s,onAllowOnce:a,onAllowAlways:r}){return n.jsx(or,{open:e,onOpenChange:t,children:n.jsxs(Fn,{className:"p-6",children:[n.jsxs(zn,{children:[n.jsxs(Mn,{className:"text-xl leading-xl font-semibold text-text",children:['Allow Spark Design to access and modify files in "',s,'"?']}),n.jsx(On,{className:"mt-2 text-sm leading-sm text-text-tertiary",children:"This permission applies to all files and subfolders in this directory. Spark Design may read, update, and permanently delete files here, and may share relevant file contents with connected tools when needed. Only allow access to folders you trust."})]}),n.jsxs(Dn,{className:"mt-6 flex flex-row justify-end gap-2",children:[n.jsx($n,{className:"h-9 rounded-full px-4",children:"Cancel"}),n.jsx("button",{type:"button",className:"inline-flex h-9 items-center justify-center rounded-full px-4 text-sm leading-sm font-medium border border-border bg-bg-base text-text transition-colors hover:bg-fill-tertiary active:bg-fill-secondary",onClick:r,children:"Always Allow"}),n.jsx("button",{type:"button",className:"inline-flex h-9 items-center justify-center rounded-full px-4 text-sm leading-sm font-medium bg-text text-text-on-primary transition-opacity hover:opacity-90 active:opacity-95",onClick:a,children:"Allow"})]})]})})}Oo.displayName="FolderPermissionDialog";const Pd=["~/Projects/spark-design-app","~/Documents/workspace","~/Desktop/demo","~/code/my-app"],fn="mr-2 w-4 h-4 shrink-0";function $o({disabled:e,folderButtonLabel:t,folderPermission:s,onFolderButtonClick:a,onFolderClear:r,onFolderSelect:o,hasFolderSelected:i,dataStyle:l,dataTheme:c,folderIcon:d=n.jsx(La,{className:fn}),folderOpenIcon:p=n.jsx(_a,{className:fn}),historyIcon:m=n.jsx(Fa,{className:fn}),subMenuArrowIcon:b,folderFillIcon:w,closeIcon:u}){const g=s?.enable??!1,f=s?.projectName??"04_代码",[k,h]=x.useState(!1),[v,S]=x.useState(!1),[C,T]=x.useState(!1),E=x.useRef(null),I=a??(()=>{}),F=()=>{E.current?.click()},Q=()=>{E.current&&(E.current.value=""),r?.()},z=x.useCallback(M=>{M==="always"&&S(!0),h(!1),T(!0)},[]),G=M=>{if(!g){T(M);return}if(!M){T(!1);return}if(v){T(!0);return}h(!0),T(!1)},re=M=>{const $=M.target.files;$&&$.length>0&&o($)};return a?n.jsx(Pt,{label:t,onClick:I,disabled:e,folderIcon:d,folderFillIcon:w}):n.jsxs(n.Fragment,{children:[n.jsxs(Oe,{open:C,onOpenChange:G,children:[n.jsx($e,{asChild:!0,children:n.jsx(Pt,{label:t,disabled:e,selected:i,onClear:Q,folderIcon:d,folderFillIcon:w,closeIcon:u,className:"focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0"})}),n.jsxs(Te,{align:"start",side:"top",className:"min-w-50",dataStyle:l,dataTheme:c,children:[n.jsxs(we,{onClick:F,children:[d,"Add folder"]}),i&&n.jsxs(we,{onClick:F,children:[p,"Replace folder"]}),n.jsxs(Qa,{children:[n.jsxs(Ln,{subTriggerIcon:b,children:[m,"Recent folders"]}),n.jsx(_n,{collisionPadding:{bottom:24,left:8},dataStyle:l,dataTheme:c,children:Pd.map(M=>n.jsx(we,{onClick:()=>{},children:M},M))})]})]})]}),n.jsx("input",{ref:E,type:"file",webkitdirectory:"",multiple:!0,style:{display:"none"},onChange:re}),g&&n.jsx(Oo,{open:k,onOpenChange:h,projectName:f,onAllowOnce:()=>z("once"),onAllowAlways:()=>z("always")})]})}$o.displayName="ChatInputFolderSelector";function Bo({config:e,disabled:t,dataStyle:s,dataTheme:a,arrowDownIcon:r=n.jsx(ye,{className:"h-3.5 w-3.5 shrink-0 text-text-secondary"})}){const i=e.modeSwitch.options.find(l=>l.value===e.modeSwitch.value)?.icon??e.modeSwitch.icon;return n.jsxs("div",{className:"flex items-center gap-3 text-sm leading-sm text-text-secondary",children:[n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-md bg-fill-secondary px-2.5 py-1.5 text-sm leading-sm text-text hover:bg-fill focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",disabled:t,children:[i!=null&&n.jsx("span",{className:"flex shrink-0 items-center [&>*]:block [&>*]:leading-none",children:i}),n.jsx("span",{children:e.modeSwitch.label}),r]})}),n.jsx(Te,{align:"start",side:"top",className:"min-w-30",dataStyle:s,dataTheme:a,children:e.modeSwitch.options.map(l=>n.jsxs(we,{onClick:()=>e.modeSwitch.onChange(l.value),className:"flex items-center justify-between gap-2",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[l.icon!=null&&n.jsx("span",{className:"flex shrink-0 [&>*]:block [&>*]:leading-none [&>*]:size-4",children:l.icon}),l.label]}),e.modeSwitch.value===l.value&&n.jsx(Ie,{className:"h-4 w-4 shrink-0 text-primary"})]},l.value))})]}),n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 text-text-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded px-1 py-0.5 disabled:opacity-50",disabled:t,children:[n.jsx("span",{children:e.modelSwitch.label}),r]})}),n.jsx(Te,{align:"start",side:"top",className:"min-w-25",dataStyle:s,dataTheme:a,children:e.modelSwitch.options.map(l=>n.jsxs(we,{onClick:()=>e.modelSwitch.onChange(l.value),className:"flex items-center justify-between gap-2",children:[l.label,e.modelSwitch.value===l.value&&n.jsx(Ie,{className:"h-4 w-4 shrink-0 text-primary"})]},l.value))})]}),e.consumptionMultiplier.options!=null&&e.consumptionMultiplier.options.length>0&&e.consumptionMultiplier.onChange!=null?n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsx("button",{type:"button",className:"inline-flex items-center text-text-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded px-1 py-0.5 disabled:opacity-50",disabled:t,children:e.consumptionMultiplier.value})}),n.jsx(Te,{align:"start",side:"top",className:"min-w-20",dataStyle:s,dataTheme:a,children:e.consumptionMultiplier.options.map(l=>n.jsxs(we,{onClick:()=>e.consumptionMultiplier.onChange?.(l.value),className:"flex items-center justify-between gap-2",children:[l.label,e.consumptionMultiplier.value===l.value&&n.jsx(Ie,{className:"h-4 w-4 shrink-0 text-primary"})]},l.value))})]}):n.jsx("span",{className:"text-text-secondary",children:e.consumptionMultiplier.value})]})}Bo.displayName="ChatInputModelSwitcher";const Fd=se.cva(["flex flex-col w-full bg-bg-base border border-primary-border rounded-xl transition-all duration-200","shadow-[0_0.25rem_1.25rem_var(--color-shadow-secondary)]","hover:shadow-[0_0.25rem_1.25rem_var(--color-shadow-secondary)]","focus-within:shadow-[0_0.25rem_1.25rem_var(--color-shadow-quaternary)]","hover:focus-within:shadow-[0_0.25rem_1.25rem_var(--color-shadow-quaternary)]"].join(" "),{variants:{disabled:{true:"opacity-50 cursor-not-allowed",false:""}},defaultVariants:{disabled:!1}}),Lt="flex flex-wrap items-center gap-2 px-3 pt-3 pb-2",zd="flex flex-1 items-center min-h-6 p-3",Dd="flex shrink-0 items-center justify-between w-full self-stretch gap-2 p-3";function ct({className:e,style:t,children:s}){return n.jsx("div",{className:y("flex min-h-9 h-9 w-[calc(100%-2*var(--radius-xl))] mx-auto items-center overflow-hidden rounded-t-xl text-sm leading-sm",e),style:t,children:s})}ct.displayName="ChatInputAbove";function dt({className:e,children:t}){const s=Pe();return n.jsx("div",{className:Fd({disabled:s.disabled,className:y("relative",e)}),children:t})}dt.displayName="ChatInputBox";function Vt({className:e,children:t}){return t?n.jsx("div",{className:y(Lt,e),children:t}):null}Vt.displayName="ChatInputAttachments";const ut=x.forwardRef(({placeholder:e="What can I help you with today?",maxRows:t=6,...s},a)=>{const r=Pe(),o=x.useCallback(i=>{r.setTextareaRef(i),typeof a=="function"?a(i):a&&(a.current=i)},[r,a]);return n.jsx("div",{className:zd,children:n.jsx(Mo,{ref:o,value:r.value,onChange:r.onChange,onKeyDown:r.handleKeyDown,placeholder:e,disabled:r.disabled,maxRows:t,...s})})});ut.displayName="ChatInputInput";function pt({className:e,children:t}){return n.jsx("div",{className:y(Dd,e),children:t})}pt.displayName="ChatInputActions";function mt({className:e,children:t}){return n.jsx("div",{className:y("flex items-center gap-2",e),children:t})}mt.displayName="ChatInputActionsLeft";function Ze({className:e,children:t}){return n.jsx("div",{className:y("flex items-center gap-2",e),children:t})}Ze.displayName="ChatInputActionsRight";function qt({className:e,style:t,...s}){return n.jsx("button",{type:"button",className:y("absolute top-2 right-2 z-10 flex h-8 w-8 items-center justify-center rounded-lg text-text-secondary hover:bg-fill-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",e),style:{...t},...s})}qt.displayName="ChatInputExpandButton";function ft(){const e=Pe();return e.showFolderButton?n.jsx($o,{disabled:e.disabled,folderButtonLabel:e.folderButtonLabel,folderPermission:e.folderPermission,onFolderButtonClick:e.onFolderButtonClick,onFolderClear:e.handleFolderClear,onFolderSelect:e.handleFolderSelect,hasFolderSelected:e.hasFolderSelected,dataStyle:e.dataStyle,dataTheme:e.dataTheme,folderIcon:e.folderIcon,folderOpenIcon:e.folderOpenIcon,historyIcon:e.historyIcon,subMenuArrowIcon:e.subMenuArrowIcon,folderFillIcon:e.folderFillIcon,closeIcon:e.closeIcon}):null}ft.displayName="ChatInputFolderButton";function gt(){const e=Pe();return e.showMoreButton?n.jsx(je,{variant:"ghost",icon:e.addLargeIcon??n.jsx(Da,{className:"h-5 w-5"}),onClick:e.onMoreButtonClick,disabled:e.disabled}):null}gt.displayName="ChatInputMoreButton";function Ft(){const e=Pe();return n.jsx(Jn,{disabled:!e.canSend||e.disabled,status:e.sendButtonStatus,...e.form?{type:"submit",form:e.form}:{onClick:e.handleSend}})}Ft.displayName="ChatInputSendButton";function xt(){const e=Pe();return e.footerLeftConfig?n.jsx(Bo,{config:e.footerLeftConfig,disabled:e.disabled,arrowDownIcon:e.arrowDownIcon,dataStyle:e.dataStyle,dataTheme:e.dataTheme}):n.jsxs(n.Fragment,{children:[n.jsx(ft,{}),n.jsx(gt,{})]})}xt.displayName="ChatInputFooterLeft";const Go=x.forwardRef(function({className:t,hasAbove:s=!1,hasAttachments:a=!1,hasFooter:r=!0,aboveOverlap:o=!0},i){const l=Pe(),c=()=>{if(!a||l.attachments==null||l.attachments===!1)return null;const m=l.attachments;return typeof m=="object"&&!x.isValidElement(m)&&("files"in m||"images"in m)?n.jsxs(n.Fragment,{children:[m.files&&n.jsx("div",{className:Lt,children:m.files}),m.images&&n.jsx("div",{className:Lt,children:m.images})]}):n.jsx("div",{className:Lt,children:m})},d=()=>n.jsx(xt,{}),p=n.jsxs(dt,{className:y(!r&&!a&&"min-h-14"),children:[c(),n.jsx(ut,{ref:i}),n.jsx(pt,{children:r?n.jsxs(n.Fragment,{children:[n.jsx(mt,{children:d()}),n.jsx("div",{className:"flex-1 h-5"}),n.jsx(Ze,{children:n.jsx(Ft,{})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-1 h-5"}),n.jsx(Ze,{children:n.jsx(Ft,{})})]})})]});return s&&l.showGenerationStatus&&l.generationStatus?n.jsxs("div",{className:y("flex flex-col w-full",t),children:[n.jsx(ct,{children:n.jsx(es,{status:typeof l.generationStatus?.content=="string"?l.generationStatus.content:void 0,icon:l.generationStatus?.icon,time:l.generationStatus?.time,children:l.generationStatus?.content})}),p]}):n.jsx("div",{className:t,children:p})});Go.displayName="ChatInputDefaultLayout";function Md(e){return e==null||e===!1?!1:typeof e=="object"&&!x.isValidElement(e)?!!e.files||!!e.images:!0}const Od=x.forwardRef(function(t,s){const a=Md(t.attachments);return n.jsx(Ut,{...t,children:n.jsx(Go,{ref:s,className:t.className,hasAbove:t.showGenerationStatus,hasAttachments:a,hasFooter:t.showFooter,aboveOverlap:!0})})}),de=Od;de.displayName="ChatInput";de.Root=Ut;de.Above=ct;de.Box=dt;de.Attachments=Vt;de.Input=ut;de.Actions=pt;de.ActionsLeft=mt;de.ActionsRight=Ze;de.ExpandButton=qt;de.FolderButton=ft;de.MoreButton=gt;de.SendButton=Ft;de.FooterLeft=xt;const $d=de,gn="w-4 h-4",ts=x.forwardRef((e,t)=>{const s=R("send",gn),a=R("stop",gn),r=R("mic",gn);return n.jsx(Jn,{ref:t,sendIcon:s,stopIcon:a,micIcon:r,...e})});ts.displayName="SendButton";function ns(e){const{style:t,theme:s}=me(),a=R("more","h-5 w-5 shrink-0"),r=R("folder","mr-2 w-4 h-4 shrink-0"),o=R("folderOpen","mr-2 w-4 h-4 shrink-0"),i=R("history","mr-2 w-4 h-4 shrink-0"),l=R("arrowDownS","h-3.5 w-3.5 shrink-0 text-text-secondary"),c=R("arrowRight","h-4 w-4 shrink-0"),d=R("folderFill","w-4 h-4 shrink-0"),p=R("close","w-4 h-4 shrink-0");return n.jsx(Ut,{...e,dataStyle:t,dataTheme:s,addLargeIcon:a,folderIcon:r,folderOpenIcon:o,historyIcon:i,arrowDownIcon:l,subMenuArrowIcon:c,folderFillIcon:d,closeIcon:p})}ns.displayName="ChatInputRoot";const Ho=x.forwardRef(function(t,s){const{style:a,theme:r}=me(),o=R("more","h-5 w-5 shrink-0"),i=R("folder","mr-2 w-4 h-4 shrink-0"),l=R("folderOpen","mr-2 w-4 h-4 shrink-0"),c=R("history","mr-2 w-4 h-4 shrink-0"),d=R("arrowDownS","h-3.5 w-3.5 shrink-0 text-text-secondary"),p=R("arrowRight","h-4 w-4 shrink-0"),m=R("folderFill","w-4 h-4 shrink-0"),b=R("close","w-4 h-4 shrink-0");return n.jsx($d,{ref:s,dataStyle:a,dataTheme:r,addLargeIcon:o,folderIcon:i,folderOpenIcon:l,historyIcon:c,arrowDownIcon:d,subMenuArrowIcon:p,folderFillIcon:m,closeIcon:b,...t})});Ho.displayName="ChatInput";function ss(){const e=Pe();return n.jsx(ts,{disabled:!e.canSend||e.disabled,status:e.sendButtonStatus,...e.form?{type:"submit",form:e.form}:{onClick:e.handleSend}})}ss.displayName="ChatInputSendButton";const Bd=Object.assign(Ho,{Root:ns,Above:ct,Box:dt,Attachments:Vt,Input:ut,Actions:pt,ActionsLeft:mt,ActionsRight:Ze,ExpandButton:qt,FolderButton:ft,MoreButton:gt,SendButton:ss,FooterLeft:xt}),Gd="w-3.5 h-3.5 shrink-0 text-text-tertiary";function Uo({items:e,onSelect:t,singleLineText:s=!1,className:a,defaultIcon:r}){const o=e.slice(0,3),i=r??n.jsx(Pa,{className:Gd});return o.length===0?null:n.jsx("div",{className:y("flex flex-col gap-3 w-full min-w-0",!s&&"max-w-lg",a),role:"list","aria-label":"Related prompt suggestions",children:o.map((l,c)=>{const d=l.icon??i,p=n.jsxs("button",{type:"button",onClick:()=>t?.(l),className:y("flex items-center gap-2 w-full min-w-0 text-left","rounded-md px-0 py-0 min-h-0","text-xs leading-xs font-normal text-text-tertiary","transition-colors",t&&"cursor-pointer hover:text-text",!t&&"cursor-default"),role:"listitem",children:[n.jsx("span",{className:"w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center",children:d}),n.jsx("span",{className:y("min-w-0 flex-1",s?"truncate":"line-clamp-2"),children:l.text})]});return s?n.jsx(at,{content:l.text,side:"top",children:p},`${l.prompt}-${c}`):n.jsx(x.Fragment,{children:p},`${l.prompt}-${c}`)})})}Uo.displayName="RelatedPrompts";const Hd="w-3.5 h-3.5 shrink-0 text-text-tertiary";function Vo(e){const t=R("chat3",Hd);return n.jsx(Uo,{defaultIcon:t,...e})}Vo.displayName="RelatedPrompts";const Ud="Repo Wiki",Vd=["English","中文","日本語","한국어"],qd="h-3.5 w-3.5",Wd="h-3 w-3",Ms="h-4 w-4";function qo({type:e="wiki",title:t,description:s,highlightText:a=Ud,language:r="English",rechargeText:o,onClose:i,onGenerate:l,onRecharge:c,onLanguageChange:d,closeIcon:p,arrowDownSIcon:m,suggestionIcon:b,dataStyle:w,dataTheme:u}){const g=e==="credits",f=p??n.jsx(_e,{className:qd}),k=m??n.jsx(ye,{className:Wd}),h=b??(g?n.jsx(it,{className:Ms}):n.jsx(Tn,{className:Ms})),v=t??(g?"Credits Exhausted":"Free Wiki Generation Available"),S=g?"Your credits have been exhausted. Please recharge to continue using.":`Generate ${a} for this repository to boost AI agent with structured context.`,C=s??S,T=()=>{if(!C.includes(a))return n.jsx("span",{children:C});const E=C.split(a),I=[];for(let F=0;F<E.length;F++)E[F]&&I.push(n.jsx("span",{children:E[F]},`text-${F}`)),F<E.length-1&&I.push(n.jsx("span",{className:"text-[var(--color-link)]",children:a},`highlight-${F}`));return n.jsx(n.Fragment,{children:I})};return n.jsxs("div",{className:"relative rounded-lg border border-border-tertiary bg-bg-base p-3",children:[i&&n.jsx("button",{type:"button",onClick:i,className:"absolute top-3 right-3 flex h-4 w-4 cursor-pointer items-center justify-center text-text-secondary transition-colors duration-200 hover:text-text","aria-label":"Close",children:f}),n.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[n.jsx("div",{className:y("flex h-4 w-4 shrink-0 items-center justify-center",g?"text-warning":"text-primary"),children:h}),n.jsx("h3",{className:"min-w-0 flex-1 text-base leading-base font-semibold text-text",children:v})]}),n.jsx(n.Fragment,{children:n.jsx(be,{scrollbarVisibility:"auto",maxHeight:96,className:"mb-2 ml-6 text-xs leading-xs text-text-tertiary",children:T()})}),n.jsx("div",{className:"flex items-center justify-end gap-2",children:g?o&&n.jsx(ne,{variant:"secondary",onClick:c,children:o??"前往充值"}):n.jsxs(n.Fragment,{children:[n.jsxs(Oe,{children:[n.jsx($e,{asChild:!0,children:n.jsxs(ne,{variant:"ghost",className:"flex items-center gap-1",children:[n.jsx("span",{children:r}),k]})}),n.jsx(Te,{dataStyle:w,dataTheme:u,children:Vd.map(E=>n.jsx(we,{onSelect:()=>d?.(E),children:E},E))})]}),n.jsx(ne,{variant:"secondary",onClick:l,children:"Generate"})]})})]})}qo.displayName="HintBanner";const Zd="h-3.5 w-3.5",Qd="h-3 w-3",Yd="h-4 w-4";function Wo(e){const{style:t,theme:s}=me(),a=R("close",Zd),r=R("arrowDownS",Qd),o=e.type==="credits",i=R(o?"warning":"sparkling",Yd);return n.jsx(qo,{closeIcon:a,arrowDownSIcon:r,suggestionIcon:i,dataStyle:t,dataTheme:s,...e})}Wo.displayName="HintBanner";function Kd(){return n.jsxs("span",{className:"relative block w-5 h-5 shrink-0 flex items-center justify-center","aria-hidden":!0,children:[n.jsx("style",{children:`
41
41
  .thinking-dots span { animation: thinking-dot 1.4s ease-in-out infinite both; }
42
42
  .thinking-dots span:nth-child(1) { animation-delay: 0s; }
43
43
  .thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
@@ -46,7 +46,7 @@
46
46
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
47
47
  40% { transform: scale(1); opacity: 1; }
48
48
  }
49
- `}),n.jsxs("span",{className:"thinking-dots inline-flex gap-0.5",children:[n.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70"}),n.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70"}),n.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70"})]})]})}function as({text:e="Qoder is Thinking...",textClassName:t,shimmer:s=!0,shimmerDuration:a=2,shimmerSpread:r=2,className:o,loader:i,...l}){const c=x.useMemo(()=>(e||"").length*r,[e,r]),d=i??n.jsx(Kd,{});return n.jsxs("div",{className:y("inline-flex items-center gap-1.5 max-w-full",o),...l,children:[n.jsx("span",{className:"shrink-0 -translate-x-0.5","aria-hidden":!0,children:d}),n.jsx("div",{className:"flex-1 min-w-0 flex items-center",children:s?n.jsx(te.motion.span,{className:y("text-sm leading-sm relative inline-block bg-clip-text text-transparent","bg-[length:250%_100%,auto] bg-no-repeat truncate",t),style:{backgroundImage:`linear-gradient(90deg, transparent calc(50% - ${c}px), var(--color-text), transparent calc(50% + ${c}px)), linear-gradient(var(--color-text-secondary), var(--color-text-secondary))`},initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:1/0,duration:a,ease:"linear"},children:e}):n.jsx("span",{className:y("text-sm leading-sm text-text-secondary truncate",t),children:e})})]})}as.displayName="ThinkingIndicator";const Xd={text:"Scanning local photo library",description:"Indexing metadata and building a rename plan",details:[{type:"action",action:"Discover photos",desc:"Found 1,000 images in /Pictures/Unsorted"},{type:"action",action:"Extract metadata",desc:"Read EXIF timestamps, GPS, and camera model"},{type:"action",action:"Detect duplicates",desc:"Hash-based matching + perceptual similarity"}]},Jd={text:"Classifying photos into albums",description:"Clustering by time, location, and scene",details:[{type:"action",action:"Time buckets",desc:"Group into events using temporal gaps"},{type:"action",action:"Location clusters",desc:"Reverse geocode GPS into city/area labels"},{type:"action",action:"Scene tags",desc:"Detect indoor/outdoor, portraits, food, and documents"}]},eu={text:"Renaming files safely",description:"Dry-run, collision check, then atomic move",details:[{type:"action",action:"Dry run",desc:"Preview 1,000 rename operations"},{type:"action",action:"Collision handling",desc:"Append counter suffix to avoid overwrites"},{type:"action",action:"Write changes",desc:"Move files into album folders"}]},tu=[{step:Xd,simpleMd:"I'm **scanning** your library and building the index. Found 1,000 photos in `Pictures/Unsorted`; EXIF and duplicates are being analyzed.\n\n"},{step:Jd,simpleMd:`**Classifying** into albums by time, location, and scene. Time buckets and GPS labels are done; next I'll tag indoor/outdoor and document vs. portrait.
49
+ `}),n.jsxs("span",{className:"thinking-dots inline-flex gap-0.5",children:[n.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70"}),n.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70"}),n.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70"})]})]})}function as({text:e="Spark is Thinking...",textClassName:t,shimmer:s=!0,shimmerDuration:a=2,shimmerSpread:r=2,className:o,loader:i,...l}){const c=x.useMemo(()=>(e||"").length*r,[e,r]),d=i??n.jsx(Kd,{});return n.jsxs("div",{className:y("inline-flex items-center gap-1.5 max-w-full",o),...l,children:[n.jsx("span",{className:"shrink-0 -translate-x-0.5","aria-hidden":!0,children:d}),n.jsx("div",{className:"flex-1 min-w-0 flex items-center",children:s?n.jsx(te.motion.span,{className:y("text-sm leading-sm relative inline-block bg-clip-text text-transparent","bg-[length:250%_100%,auto] bg-no-repeat truncate",t),style:{backgroundImage:`linear-gradient(90deg, transparent calc(50% - ${c}px), var(--color-text), transparent calc(50% + ${c}px)), linear-gradient(var(--color-text-secondary), var(--color-text-secondary))`},initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:1/0,duration:a,ease:"linear"},children:e}):n.jsx("span",{className:y("text-sm leading-sm text-text-secondary truncate",t),children:e})})]})}as.displayName="ThinkingIndicator";const Xd={text:"Scanning local photo library",description:"Indexing metadata and building a rename plan",details:[{type:"action",action:"Discover photos",desc:"Found 1,000 images in /Pictures/Unsorted"},{type:"action",action:"Extract metadata",desc:"Read EXIF timestamps, GPS, and camera model"},{type:"action",action:"Detect duplicates",desc:"Hash-based matching + perceptual similarity"}]},Jd={text:"Classifying photos into albums",description:"Clustering by time, location, and scene",details:[{type:"action",action:"Time buckets",desc:"Group into events using temporal gaps"},{type:"action",action:"Location clusters",desc:"Reverse geocode GPS into city/area labels"},{type:"action",action:"Scene tags",desc:"Detect indoor/outdoor, portraits, food, and documents"}]},eu={text:"Renaming files safely",description:"Dry-run, collision check, then atomic move",details:[{type:"action",action:"Dry run",desc:"Preview 1,000 rename operations"},{type:"action",action:"Collision handling",desc:"Append counter suffix to avoid overwrites"},{type:"action",action:"Write changes",desc:"Move files into album folders"}]},tu=[{step:Xd,simpleMd:"I'm **scanning** your library and building the index. Found 1,000 photos in `Pictures/Unsorted`; EXIF and duplicates are being analyzed.\n\n"},{step:Jd,simpleMd:`**Classifying** into albums by time, location, and scene. Time buckets and GPS labels are done; next I'll tag indoor/outdoor and document vs. portrait.
50
50
 
51
51
  `},{step:eu,simpleMd:`**Dry-run** is done and collision handling is in place. No overwrites; an audit log (CSV) is ready. Pending your confirmation to run the renames.
52
52
 
@@ -86,9 +86,9 @@ Example:
86
86
  ## Next step
87
87
 
88
88
  If you want, I can generate a **preview report** first (top 50 renames + album summary) before applying changes.
89
- `;function su(e,t){const s=[];for(const a of e)s.push({type:"think"}),s.push({type:"composer",step:a.step}),s.push({type:"md",md:a.simpleMd});return s.push({type:"think"}),s.push({type:"md",md:t}),s}const rs=x.createContext(null);rs.displayName="ResponseContext";function os(){const e=x.useContext(rs);if(!e)throw new Error("Response compound components must be used within Response.Root");return e}const au=n.jsx(as,{text:"Qoder is thinking..."});function Wt({simulate:e=!0,phase:t="thinking",rounds:s,finalMarkdown:a,onSimulateComplete:r,onStepChange:o,thinkingIndicator:i,children:l}){const c=s??tu,d=a??nu,p=i??au,m=x.useMemo(()=>su(c,d),[c,d]),[b,w]=x.useState(0),u=x.useRef(m.length),g=e?b>=m.length-1:t==="done",f=m[b]??null,k=f?.type==="think";x.useEffect(()=>{if(!e||m.length===0)return;const v=m[b]??null;v?.type==="composer"&&v.step?o?.(v.step.text,v.step.toolType):v?.type==="think"&&o?.("Thinking..."),b>=m.length&&r?.()},[e,m,b,o,r]),x.useEffect(()=>{!e||m.length===0||u.current!==m.length&&(u.current=m.length,requestAnimationFrame(()=>w(0)))},[e,m.length]),x.useEffect(()=>{if(!e||m.length===0)return;const v=m[b]??null;if(v?.type==="think"||v?.type==="composer"){const S=window.setTimeout(()=>w(C=>Math.min(C+1,m.length)),580);return()=>window.clearTimeout(S)}},[e,m,b]);const h={phase:t,simulate:e,rounds:c,finalMarkdown:d,blocks:m,visibleIndex:b,setVisibleIndex:w,isSimDone:g,currentBlock:f,showThink:k,onSimulateComplete:r,onStepChange:o,thinkingIndicator:p};return n.jsx(rs.Provider,{value:h,children:l})}Wt.displayName="ResponseRoot";const ru={p:({children:e})=>n.jsx("p",{className:"text-sm leading-sm text-text [&:not(:first-child)]:mt-6 last:mb-0",children:e}),h1:({children:e})=>n.jsx("h1",{className:"scroll-m-20 text-4xl font-medium tracking-tight text-text",children:e}),h2:({children:e})=>n.jsx("h2",{className:"scroll-m-20 border-b border-border-secondary pb-2 text-3xl font-semibold tracking-tight text-text first:mt-0 [&:not(:first-child)]:mt-10",children:e}),h3:({children:e})=>n.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight text-text [&:not(:first-child)]:mt-8",children:e}),h4:({children:e})=>n.jsx("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight text-text [&:not(:first-child)]:mt-6",children:e}),h5:({children:e})=>n.jsx("h5",{className:"scroll-m-20 text-lg font-semibold tracking-tight text-text-secondary [&:not(:first-child)]:mt-4",children:e}),h6:({children:e})=>n.jsx("h6",{className:"scroll-m-20 text-base font-semibold tracking-tight text-text-tertiary uppercase [&:not(:first-child)]:mt-4",children:e}),blockquote:({children:e})=>n.jsx("blockquote",{className:"mt-6 border-l-2 border-border-secondary pl-6 italic text-text-secondary",children:e}),ul:({className:e,children:t})=>n.jsx("ul",{className:y("my-6 ml-6 text-text [&>li]:mt-2",String(e??"").includes("contains-task-list")?"list-none":"list-disc"),children:t}),ol:({children:e})=>n.jsx("ol",{className:"my-6 ml-6 list-decimal text-text [&>li]:mt-2",children:e}),li:({className:e,children:t})=>n.jsx("li",{className:y("leading-sm",String(e??"").includes("task-list-item")&&"list-none flex items-start gap-2 [&>input]:mt-0.5 [&>input]:shrink-0"),children:t}),pre:({children:e})=>n.jsx(be,{scrollbarVisibility:"auto",className:"my-6 rounded-lg border border-border-tertiary bg-bg-base p-4 font-mono text-sm leading-sm text-text",children:n.jsx("pre",{className:"m-0 font-mono text-sm leading-sm text-text border-0 bg-transparent p-0",children:e})}),code:({className:e,children:t,...s})=>typeof e=="string"&&e.startsWith("language-")?n.jsx("code",{className:y(e,"font-mono text-sm leading-sm"),...s,children:t}):n.jsx("code",{className:"relative rounded bg-fill-tertiary px-[0.3rem] py-[0.2rem] font-mono text-sm leading-sm font-semibold text-text",...s,children:t}),table:({children:e})=>n.jsx(be,{scrollbarVisibility:"auto",className:"my-6 w-full rounded-md border border-border-secondary",children:n.jsx("table",{className:"w-full border-collapse text-sm leading-sm text-text",children:e})}),thead:({children:e})=>n.jsx("thead",{className:"border-b border-border-secondary bg-fill-tertiary",children:e}),tbody:({children:e})=>n.jsx("tbody",{className:"[&>tr]:border-b [&>tr]:border-border-tertiary",children:e}),tr:({children:e})=>n.jsx("tr",{children:e}),th:({children:e})=>n.jsx("th",{className:"px-4 py-2 text-left font-semibold text-text",children:e}),td:({children:e})=>n.jsx("td",{className:"px-4 py-2 text-text",children:e}),a:({href:e,children:t})=>n.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t}),hr:()=>n.jsx("hr",{className:"my-6 border-0 border-t border-border-secondary"}),strong:({children:e})=>n.jsx("strong",{className:"font-semibold text-text",children:e}),em:({children:e})=>n.jsx("em",{className:"italic text-text",children:e})};function Qe({children:e,className:t}){return n.jsx("div",{className:y("markdown-body text-sm leading-sm text-text",t),children:n.jsx(el,{remarkPlugins:[tl,nl],rehypePlugins:[sl],components:ru,children:e})})}Qe.displayName="MarkdownBody";const ou="w-full h-full text-text-tertiary transition-transform duration-200 ease-in-out",iu="w-full h-full transition-transform duration-200 ease-in-out",is=x.createContext(null);is.displayName="ReasoningStepContext";function Zt(){const e=x.useContext(is);if(!e)throw new Error("ReasoningStep compound components must be used within ReasoningStep.Root");return e}function Qt({text:e,description:t,status:s="completed",icon:a,showIcon:r=!0,details:o,children:i,detailsChildren:l,duration:c=2,spread:d=2,disableExpandAnimation:p=!1,defaultExpanded:m,expanded:b,onExpandedChange:w,eyeIcon:u,arrowRightIcon:g}){const f=b!==void 0,[k,h]=x.useState(m??!1),v=f?b:k,[S,C]=x.useState(!1),T=p&&m!==void 0?m:v,E=r&&typeof e=="string",I=E?"var(--spacing-1.5)":"var(--spacing-2.5)",Q=o!=null&&o.length>0||l!=null,z=x.useCallback(()=>{Q&&(f?w?.(!b):h(A=>!A))},[Q,f,b,w]),[G,re]=x.useState(new Set),M=x.useCallback(A=>{re(O=>{const W=new Set(O);return W.has(A)?W.delete(A):W.add(A),W})},[]),$=x.useMemo(()=>u??n.jsx(Ea,{className:ou}),[u]),q=x.useMemo(()=>g??n.jsx(ot,{className:iu}),[g]),ee={status:s,isExpanded:v,isHovered:S,setIsHovered:C,toggleExpanded:z,effectiveExpanded:T,effectiveShowIcon:E,hasExpandableContent:Q,text:e,description:t,details:o,detailsChildren:l,duration:c,spread:d,disableExpandAnimation:p,detailIndent:I,expandedNestedKeys:G,toggleNested:M,icon:a,eyeIcon:$,arrowRightIcon:q};return n.jsx(is.Provider,{value:ee,children:i})}Qt.displayName="ReasoningStepRoot";const zt={width:"var(--font-size-xs)",height:"var(--font-size-xs)"},lu={ts:"text-info",tsx:"text-info",js:"text-info",jsx:"text-info",py:"text-teal",md:"text-text-secondary",mdx:"text-text-secondary"};function cu(e,t){const s=(e??t?.split(".").pop()??"").toLowerCase();return lu[s]??"text-text-tertiary"}const du=x.memo(function({className:t}){return n.jsx("span",{className:y("inline-flex items-center justify-center text-xs leading-xs font-mono",t),style:zt,"aria-hidden":!0,children:"⎔"})}),uu=x.memo(function({prefix:t,primary:s,secondary:a}){return n.jsxs("div",{className:"flex flex-row items-center gap-1.5 min-w-0 flex-1",children:[t?n.jsx("div",{className:"flex items-center justify-center shrink-0",children:t}):null,n.jsxs("div",{className:"flex flex-row items-center gap-1 min-w-0 overflow-hidden flex-1",children:[n.jsx("span",{className:"text-xs leading-xs font-normal text-text-tertiary truncate",title:s,children:s}),a?n.jsx("span",{className:"text-xs leading-xs font-normal text-text-quaternary truncate",title:a,children:a}):null]})]})});function Yt({className:e}){const t=Zt(),s=x.useMemo(()=>typeof t.text=="string"?t.text.length*t.spread:10*t.spread,[t.text,t.spread]),a=()=>t.icon?t.icon:t.eyeIcon,r=()=>typeof t.text!="string"?t.text:t.status==="in-progress"?n.jsx(te.motion.span,{className:"text-xs leading-xs font-normal relative inline-block bg-clip-text text-transparent bg-[length:250%_100%,auto] bg-no-repeat truncate",style:{backgroundImage:`linear-gradient(90deg, transparent calc(50% - ${s}px), var(--color-text), transparent calc(50% + ${s}px)), linear-gradient(var(--color-text-tertiary), var(--color-text-tertiary))`},initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:1/0,duration:t.duration,ease:"linear"},children:t.text}):n.jsx("span",{className:"text-xs leading-xs font-normal text-text-tertiary truncate",children:t.text}),o=()=>t.description?n.jsx("span",{className:"text-xs leading-xs font-normal text-text-quaternary truncate",children:t.description}):null;return n.jsxs("div",{className:y("flex flex-row items-center gap-1.5",t.hasExpandableContent&&"cursor-pointer",e),onClick:t.toggleExpanded,children:[t.effectiveShowIcon&&n.jsx("div",{className:"flex items-center justify-center shrink-0",style:zt,children:a()}),n.jsxs("div",{className:"flex flex-row items-center gap-1 flex-1 min-w-0",children:[r(),t.description?o():null,t.hasExpandableContent&&n.jsx("div",{className:y("flex items-center justify-center shrink-0 text-text-tertiary transition-opacity duration-200 ease-in-out",t.effectiveExpanded||t.isHovered?"opacity-100":"opacity-0",t.effectiveExpanded?"rotate-90":"rotate-0"),style:zt,children:t.arrowRightIcon})]})]})}Yt.displayName="ReasoningStepHeader";const Zo=x.memo(function e({detail:t,depth:s,pathKey:a,detailIndent:r,expandedNestedKeys:o,onToggleNested:i,arrowRightIcon:l}){const c=t.details!=null&&t.details.length>0,d=o.has(a),p=!c,m=t.type==="action"?t.action:t.filename,b=t.type==="action"?t.desc:[t.lines,t.path].filter(Boolean).join(" "),w=p&&t.type==="file"?n.jsx(du,{className:cu(t.fileType,t.filename)}):void 0,u=x.useCallback(()=>{c&&i(a)},[c,i,a]),g=n.jsxs("div",{className:y("flex flex-row items-center gap-1.5 self-stretch min-h-5 min-w-0",c&&"cursor-pointer"),onClick:c?u:void 0,children:[n.jsx(uu,{prefix:w,primary:m,secondary:b}),c&&n.jsx("div",{className:y("flex items-center justify-center shrink-0 text-text-tertiary",d?"rotate-90":"rotate-0"),style:zt,children:l})]}),f=n.jsxs("div",{className:"flex flex-row items-center gap-0 self-stretch",style:{marginLeft:r},children:[n.jsx("div",{className:"shrink-0 w-[var(--font-size-xs)] h-5 border-l border-border-tertiary"}),g]});if(!c)return n.jsx(x.Fragment,{children:f},a);const h=s===1?"rounded-lg border border-border-tertiary bg-bg-base p-2 flex flex-col gap-0":"flex flex-col";return n.jsxs("div",{className:"flex flex-col self-stretch",children:[f,n.jsx("div",{className:y("grid transition-[grid-template-rows,opacity] duration-150 ease-out",d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:n.jsx("div",{className:"overflow-hidden",children:n.jsx("div",{className:y(h),children:t.details?.map((v,S)=>n.jsx(e,{detail:v,depth:s+1,pathKey:`${a}-${S}`,detailIndent:r,disableExpandAnimation:!1,expandedNestedKeys:o,onToggleNested:i,arrowRightIcon:l},`${a}-${S}`))})})})]},a)});function ls({detail:e,depth:t=0,pathKey:s="0"}){const a=Zt();return n.jsx(Zo,{detail:e,depth:t,pathKey:s,detailIndent:a.detailIndent,disableExpandAnimation:a.disableExpandAnimation,expandedNestedKeys:a.expandedNestedKeys,onToggleNested:a.toggleNested,arrowRightIcon:a.arrowRightIcon})}ls.displayName="ReasoningStepDetailRow";function Kt({className:e,children:t}){const s=Zt(),a=s.details!=null&&s.details.length>0;return n.jsx("div",{className:y("grid transition-[grid-template-rows,opacity] duration-200 ease-out",s.effectiveExpanded?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0",e),children:n.jsx("div",{className:"overflow-hidden",children:a?n.jsx("div",{className:"flex flex-col",children:s.details?.map((r,o)=>n.jsx(Zo,{detail:r,depth:0,pathKey:String(o),detailIndent:s.detailIndent,disableExpandAnimation:s.disableExpandAnimation,expandedNestedKeys:s.expandedNestedKeys,onToggleNested:s.toggleNested,arrowRightIcon:s.arrowRightIcon},String(o)))}):t??s.detailsChildren})})}Kt.displayName="ReasoningStepDetails";function Qo(){const e=Zt();return n.jsxs("div",{"data-reasoning-step":!0,className:"flex flex-col gap-1 py-0.5",onMouseEnter:()=>e.setIsHovered(!0),onMouseLeave:()=>e.setIsHovered(!1),children:[n.jsx(Yt,{}),e.hasExpandableContent&&n.jsx(Kt,{})]})}Qo.displayName="ReasoningStepDefaultLayout";function Yo(e){return n.jsx(Qt,{...e,children:n.jsx(Qo,{})})}Yo.displayName="ReasoningStep";const ht=Yo;ht.Root=Qt;ht.Header=Yt;ht.Details=Kt;ht.DetailRow=ls;const Dt=ht;function pu(e){const t=[];let s=0;const a=o=>/[\u4e00-\u9fff\u3040-\u30ff]/.test(o),r=o=>/[a-zA-Z0-9']/.test(o);for(;s<e.length;){const o=e[s];if(a(o))t.push(o),s+=1;else if(r(o)){let i=s;for(;i<e.length&&r(e[i]);)i+=1;t.push(e.slice(s,i)),s=i}else{let i=s;for(;i<e.length&&!a(e[i])&&!r(e[i]);)i+=1;t.push(e.slice(s,i)),s=i}}return t}function mu(e){const t=e.split(/\n\n+/);if(t.length<=1)return{completed:"",partial:e};const s=t.pop()??"";return{completed:t.join(`
89
+ `;function su(e,t){const s=[];for(const a of e)s.push({type:"think"}),s.push({type:"composer",step:a.step}),s.push({type:"md",md:a.simpleMd});return s.push({type:"think"}),s.push({type:"md",md:t}),s}const rs=x.createContext(null);rs.displayName="ResponseContext";function os(){const e=x.useContext(rs);if(!e)throw new Error("Response compound components must be used within Response.Root");return e}const au=n.jsx(as,{text:"Spark is thinking..."});function Wt({simulate:e=!0,phase:t="thinking",rounds:s,finalMarkdown:a,onSimulateComplete:r,onStepChange:o,thinkingIndicator:i,children:l}){const c=s??tu,d=a??nu,p=i??au,m=x.useMemo(()=>su(c,d),[c,d]),[b,w]=x.useState(0),u=x.useRef(m.length),g=e?b>=m.length-1:t==="done",f=m[b]??null,k=f?.type==="think";x.useEffect(()=>{if(!e||m.length===0)return;const v=m[b]??null;v?.type==="composer"&&v.step?o?.(v.step.text,v.step.toolType):v?.type==="think"&&o?.("Thinking..."),b>=m.length&&r?.()},[e,m,b,o,r]),x.useEffect(()=>{!e||m.length===0||u.current!==m.length&&(u.current=m.length,requestAnimationFrame(()=>w(0)))},[e,m.length]),x.useEffect(()=>{if(!e||m.length===0)return;const v=m[b]??null;if(v?.type==="think"||v?.type==="composer"){const S=window.setTimeout(()=>w(C=>Math.min(C+1,m.length)),580);return()=>window.clearTimeout(S)}},[e,m,b]);const h={phase:t,simulate:e,rounds:c,finalMarkdown:d,blocks:m,visibleIndex:b,setVisibleIndex:w,isSimDone:g,currentBlock:f,showThink:k,onSimulateComplete:r,onStepChange:o,thinkingIndicator:p};return n.jsx(rs.Provider,{value:h,children:l})}Wt.displayName="ResponseRoot";const ru={p:({children:e})=>n.jsx("p",{className:"text-sm leading-sm text-text [&:not(:first-child)]:mt-6 last:mb-0",children:e}),h1:({children:e})=>n.jsx("h1",{className:"scroll-m-20 text-4xl font-medium tracking-tight text-text",children:e}),h2:({children:e})=>n.jsx("h2",{className:"scroll-m-20 border-b border-border-secondary pb-2 text-3xl font-semibold tracking-tight text-text first:mt-0 [&:not(:first-child)]:mt-10",children:e}),h3:({children:e})=>n.jsx("h3",{className:"scroll-m-20 text-2xl font-semibold tracking-tight text-text [&:not(:first-child)]:mt-8",children:e}),h4:({children:e})=>n.jsx("h4",{className:"scroll-m-20 text-xl font-semibold tracking-tight text-text [&:not(:first-child)]:mt-6",children:e}),h5:({children:e})=>n.jsx("h5",{className:"scroll-m-20 text-lg font-semibold tracking-tight text-text-secondary [&:not(:first-child)]:mt-4",children:e}),h6:({children:e})=>n.jsx("h6",{className:"scroll-m-20 text-base font-semibold tracking-tight text-text-tertiary uppercase [&:not(:first-child)]:mt-4",children:e}),blockquote:({children:e})=>n.jsx("blockquote",{className:"mt-6 border-l-2 border-border-secondary pl-6 italic text-text-secondary",children:e}),ul:({className:e,children:t})=>n.jsx("ul",{className:y("my-6 ml-6 text-text [&>li]:mt-2",String(e??"").includes("contains-task-list")?"list-none":"list-disc"),children:t}),ol:({children:e})=>n.jsx("ol",{className:"my-6 ml-6 list-decimal text-text [&>li]:mt-2",children:e}),li:({className:e,children:t})=>n.jsx("li",{className:y("leading-sm",String(e??"").includes("task-list-item")&&"list-none flex items-start gap-2 [&>input]:mt-0.5 [&>input]:shrink-0"),children:t}),pre:({children:e})=>n.jsx(be,{scrollbarVisibility:"auto",className:"my-6 rounded-lg border border-border-tertiary bg-bg-base p-4 font-mono text-sm leading-sm text-text",children:n.jsx("pre",{className:"m-0 font-mono text-sm leading-sm text-text border-0 bg-transparent p-0",children:e})}),code:({className:e,children:t,...s})=>typeof e=="string"&&e.startsWith("language-")?n.jsx("code",{className:y(e,"font-mono text-sm leading-sm"),...s,children:t}):n.jsx("code",{className:"relative rounded bg-fill-tertiary px-[0.3rem] py-[0.2rem] font-mono text-sm leading-sm font-semibold text-text",...s,children:t}),table:({children:e})=>n.jsx(be,{scrollbarVisibility:"auto",className:"my-6 w-full rounded-md border border-border-secondary",children:n.jsx("table",{className:"w-full border-collapse text-sm leading-sm text-text",children:e})}),thead:({children:e})=>n.jsx("thead",{className:"border-b border-border-secondary bg-fill-tertiary",children:e}),tbody:({children:e})=>n.jsx("tbody",{className:"[&>tr]:border-b [&>tr]:border-border-tertiary",children:e}),tr:({children:e})=>n.jsx("tr",{children:e}),th:({children:e})=>n.jsx("th",{className:"px-4 py-2 text-left font-semibold text-text",children:e}),td:({children:e})=>n.jsx("td",{className:"px-4 py-2 text-text",children:e}),a:({href:e,children:t})=>n.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t}),hr:()=>n.jsx("hr",{className:"my-6 border-0 border-t border-border-secondary"}),strong:({children:e})=>n.jsx("strong",{className:"font-semibold text-text",children:e}),em:({children:e})=>n.jsx("em",{className:"italic text-text",children:e})};function Qe({children:e,className:t}){return n.jsx("div",{className:y("markdown-body text-sm leading-sm text-text",t),children:n.jsx(el,{remarkPlugins:[tl,nl],rehypePlugins:[sl],components:ru,children:e})})}Qe.displayName="MarkdownBody";const ou="w-full h-full text-text-tertiary transition-transform duration-200 ease-in-out",iu="w-full h-full transition-transform duration-200 ease-in-out",is=x.createContext(null);is.displayName="ReasoningStepContext";function Zt(){const e=x.useContext(is);if(!e)throw new Error("ReasoningStep compound components must be used within ReasoningStep.Root");return e}function Qt({text:e,description:t,status:s="completed",icon:a,showIcon:r=!0,details:o,children:i,detailsChildren:l,duration:c=2,spread:d=2,disableExpandAnimation:p=!1,defaultExpanded:m,expanded:b,onExpandedChange:w,eyeIcon:u,arrowRightIcon:g}){const f=b!==void 0,[k,h]=x.useState(m??!1),v=f?b:k,[S,C]=x.useState(!1),T=p&&m!==void 0?m:v,E=r&&typeof e=="string",I=E?"var(--spacing-1.5)":"var(--spacing-2.5)",Q=o!=null&&o.length>0||l!=null,z=x.useCallback(()=>{Q&&(f?w?.(!b):h(A=>!A))},[Q,f,b,w]),[G,re]=x.useState(new Set),M=x.useCallback(A=>{re(O=>{const W=new Set(O);return W.has(A)?W.delete(A):W.add(A),W})},[]),$=x.useMemo(()=>u??n.jsx(Ea,{className:ou}),[u]),q=x.useMemo(()=>g??n.jsx(ot,{className:iu}),[g]),ee={status:s,isExpanded:v,isHovered:S,setIsHovered:C,toggleExpanded:z,effectiveExpanded:T,effectiveShowIcon:E,hasExpandableContent:Q,text:e,description:t,details:o,detailsChildren:l,duration:c,spread:d,disableExpandAnimation:p,detailIndent:I,expandedNestedKeys:G,toggleNested:M,icon:a,eyeIcon:$,arrowRightIcon:q};return n.jsx(is.Provider,{value:ee,children:i})}Qt.displayName="ReasoningStepRoot";const zt={width:"var(--font-size-xs)",height:"var(--font-size-xs)"},lu={ts:"text-info",tsx:"text-info",js:"text-info",jsx:"text-info",py:"text-teal",md:"text-text-secondary",mdx:"text-text-secondary"};function cu(e,t){const s=(e??t?.split(".").pop()??"").toLowerCase();return lu[s]??"text-text-tertiary"}const du=x.memo(function({className:t}){return n.jsx("span",{className:y("inline-flex items-center justify-center text-xs leading-xs font-mono",t),style:zt,"aria-hidden":!0,children:"⎔"})}),uu=x.memo(function({prefix:t,primary:s,secondary:a}){return n.jsxs("div",{className:"flex flex-row items-center gap-1.5 min-w-0 flex-1",children:[t?n.jsx("div",{className:"flex items-center justify-center shrink-0",children:t}):null,n.jsxs("div",{className:"flex flex-row items-center gap-1 min-w-0 overflow-hidden flex-1",children:[n.jsx("span",{className:"text-xs leading-xs font-normal text-text-tertiary truncate",title:s,children:s}),a?n.jsx("span",{className:"text-xs leading-xs font-normal text-text-quaternary truncate",title:a,children:a}):null]})]})});function Yt({className:e}){const t=Zt(),s=x.useMemo(()=>typeof t.text=="string"?t.text.length*t.spread:10*t.spread,[t.text,t.spread]),a=()=>t.icon?t.icon:t.eyeIcon,r=()=>typeof t.text!="string"?t.text:t.status==="in-progress"?n.jsx(te.motion.span,{className:"text-xs leading-xs font-normal relative inline-block bg-clip-text text-transparent bg-[length:250%_100%,auto] bg-no-repeat truncate",style:{backgroundImage:`linear-gradient(90deg, transparent calc(50% - ${s}px), var(--color-text), transparent calc(50% + ${s}px)), linear-gradient(var(--color-text-tertiary), var(--color-text-tertiary))`},initial:{backgroundPosition:"100% center"},animate:{backgroundPosition:"0% center"},transition:{repeat:1/0,duration:t.duration,ease:"linear"},children:t.text}):n.jsx("span",{className:"text-xs leading-xs font-normal text-text-tertiary truncate",children:t.text}),o=()=>t.description?n.jsx("span",{className:"text-xs leading-xs font-normal text-text-quaternary truncate",children:t.description}):null;return n.jsxs("div",{className:y("flex flex-row items-center gap-1.5",t.hasExpandableContent&&"cursor-pointer",e),onClick:t.toggleExpanded,children:[t.effectiveShowIcon&&n.jsx("div",{className:"flex items-center justify-center shrink-0",style:zt,children:a()}),n.jsxs("div",{className:"flex flex-row items-center gap-1 flex-1 min-w-0",children:[r(),t.description?o():null,t.hasExpandableContent&&n.jsx("div",{className:y("flex items-center justify-center shrink-0 text-text-tertiary transition-opacity duration-200 ease-in-out",t.effectiveExpanded||t.isHovered?"opacity-100":"opacity-0",t.effectiveExpanded?"rotate-90":"rotate-0"),style:zt,children:t.arrowRightIcon})]})]})}Yt.displayName="ReasoningStepHeader";const Zo=x.memo(function e({detail:t,depth:s,pathKey:a,detailIndent:r,expandedNestedKeys:o,onToggleNested:i,arrowRightIcon:l}){const c=t.details!=null&&t.details.length>0,d=o.has(a),p=!c,m=t.type==="action"?t.action:t.filename,b=t.type==="action"?t.desc:[t.lines,t.path].filter(Boolean).join(" "),w=p&&t.type==="file"?n.jsx(du,{className:cu(t.fileType,t.filename)}):void 0,u=x.useCallback(()=>{c&&i(a)},[c,i,a]),g=n.jsxs("div",{className:y("flex flex-row items-center gap-1.5 self-stretch min-h-5 min-w-0",c&&"cursor-pointer"),onClick:c?u:void 0,children:[n.jsx(uu,{prefix:w,primary:m,secondary:b}),c&&n.jsx("div",{className:y("flex items-center justify-center shrink-0 text-text-tertiary",d?"rotate-90":"rotate-0"),style:zt,children:l})]}),f=n.jsxs("div",{className:"flex flex-row items-center gap-0 self-stretch",style:{marginLeft:r},children:[n.jsx("div",{className:"shrink-0 w-[var(--font-size-xs)] h-5 border-l border-border-tertiary"}),g]});if(!c)return n.jsx(x.Fragment,{children:f},a);const h=s===1?"rounded-lg border border-border-tertiary bg-bg-base p-2 flex flex-col gap-0":"flex flex-col";return n.jsxs("div",{className:"flex flex-col self-stretch",children:[f,n.jsx("div",{className:y("grid transition-[grid-template-rows,opacity] duration-150 ease-out",d?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"),children:n.jsx("div",{className:"overflow-hidden",children:n.jsx("div",{className:y(h),children:t.details?.map((v,S)=>n.jsx(e,{detail:v,depth:s+1,pathKey:`${a}-${S}`,detailIndent:r,disableExpandAnimation:!1,expandedNestedKeys:o,onToggleNested:i,arrowRightIcon:l},`${a}-${S}`))})})})]},a)});function ls({detail:e,depth:t=0,pathKey:s="0"}){const a=Zt();return n.jsx(Zo,{detail:e,depth:t,pathKey:s,detailIndent:a.detailIndent,disableExpandAnimation:a.disableExpandAnimation,expandedNestedKeys:a.expandedNestedKeys,onToggleNested:a.toggleNested,arrowRightIcon:a.arrowRightIcon})}ls.displayName="ReasoningStepDetailRow";function Kt({className:e,children:t}){const s=Zt(),a=s.details!=null&&s.details.length>0;return n.jsx("div",{className:y("grid transition-[grid-template-rows,opacity] duration-200 ease-out",s.effectiveExpanded?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0",e),children:n.jsx("div",{className:"overflow-hidden",children:a?n.jsx("div",{className:"flex flex-col",children:s.details?.map((r,o)=>n.jsx(Zo,{detail:r,depth:0,pathKey:String(o),detailIndent:s.detailIndent,disableExpandAnimation:s.disableExpandAnimation,expandedNestedKeys:s.expandedNestedKeys,onToggleNested:s.toggleNested,arrowRightIcon:s.arrowRightIcon},String(o)))}):t??s.detailsChildren})})}Kt.displayName="ReasoningStepDetails";function Qo(){const e=Zt();return n.jsxs("div",{"data-reasoning-step":!0,className:"flex flex-col gap-1 py-0.5",onMouseEnter:()=>e.setIsHovered(!0),onMouseLeave:()=>e.setIsHovered(!1),children:[n.jsx(Yt,{}),e.hasExpandableContent&&n.jsx(Kt,{})]})}Qo.displayName="ReasoningStepDefaultLayout";function Yo(e){return n.jsx(Qt,{...e,children:n.jsx(Qo,{})})}Yo.displayName="ReasoningStep";const ht=Yo;ht.Root=Qt;ht.Header=Yt;ht.Details=Kt;ht.DetailRow=ls;const Dt=ht;function pu(e){const t=[];let s=0;const a=o=>/[\u4e00-\u9fff\u3040-\u30ff]/.test(o),r=o=>/[a-zA-Z0-9']/.test(o);for(;s<e.length;){const o=e[s];if(a(o))t.push(o),s+=1;else if(r(o)){let i=s;for(;i<e.length&&r(e[i]);)i+=1;t.push(e.slice(s,i)),s=i}else{let i=s;for(;i<e.length&&!a(e[i])&&!r(e[i]);)i+=1;t.push(e.slice(s,i)),s=i}}return t}function mu(e){const t=e.split(/\n\n+/);if(t.length<=1)return{completed:"",partial:e};const s=t.pop()??"";return{completed:t.join(`
90
90
 
91
- `),partial:s}}const fu=3;function Ko({content:e,isActive:t,onStreamComplete:s,tokenDelayMs:a=14,className:r}){const o=x.useMemo(()=>pu(e),[e]),[i,l]=x.useState(0),c=x.useRef(s);c.current=s;const d=x.useMemo(()=>o.slice(0,i).join(""),[o,i]),{completed:p,partial:m}=x.useMemo(()=>mu(d),[d]);x.useEffect(()=>{if(!t)return;l(0);const w=o.length;if(w===0){c.current?.();return}let u=0;const g=setInterval(()=>{u=Math.min(u+fu,w),l(u),u>=w&&(clearInterval(g),c.current?.())},a);return()=>clearInterval(g)},[t,e,o.length,a]);const b=t&&i<o.length;return o.length===0?null:b?n.jsxs("div",{className:r,children:[p?n.jsx("div",{className:"streaming-completed",children:n.jsx(Qe,{children:p})}):null,m?n.jsx("span",{className:"streaming-partial text-sm leading-sm text-text streaming-token-fade-in",children:m}):null]}):n.jsx("div",{className:r,children:n.jsx(Qe,{children:e})})}function Os(...e){return e.filter(Boolean).join(" ")}const gu=n.jsx(Tn,{className:"h-5 w-5 text-text-on-primary"});function cs({width:e="var(--spacing-80)",height:t="var(--spacing-60)",speed:s=1,caption:a="Qoder is drawing...",captionClassName:r,className:o,style:i,showOverlay:l=!1,overlayText:c,sparklingIcon:d=gu,...p}){const m=x.useRef(null);return x.useEffect(()=>{if(typeof CSS<"u"&&CSS.registerProperty)try{CSS.registerProperty({name:"--a",syntax:"<angle>",inherits:!0,initialValue:"0deg"}),CSS.registerProperty({name:"--l",syntax:"<number>",inherits:!0,initialValue:"0"}),CSS.registerProperty({name:"--x",syntax:"<length>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:"--y",syntax:"<length>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:"--o",syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:"--value",syntax:"<angle>",inherits:!0,initialValue:"0deg"}),CSS.registerProperty({name:"--width-ratio",syntax:"<number>",inherits:!0,initialValue:"0"}),CSS.registerProperty({name:"--scale",syntax:"<number>",inherits:!0,initialValue:"0"})}catch{}},[]),x.useEffect(()=>{const b=m.current;if(!b)return;const w=()=>{const k=b.getBoundingClientRect();if(k.width>0&&k.height>0){const h=Math.max(k.width,k.height);b.style.setProperty("--actual-size",`${h}px`)}},u=typeof e=="string"&&e.includes("%")||typeof t=="string"&&t.includes("%");let g=null;const f=()=>{w(),g=new ResizeObserver(w),g.observe(b)};if(u){const k=requestAnimationFrame(()=>f());return()=>{cancelAnimationFrame(k),g?.disconnect()}}return f(),()=>g?.disconnect()},[e,t]),n.jsxs(n.Fragment,{children:[n.jsx("style",{children:`
91
+ `),partial:s}}const fu=3;function Ko({content:e,isActive:t,onStreamComplete:s,tokenDelayMs:a=14,className:r}){const o=x.useMemo(()=>pu(e),[e]),[i,l]=x.useState(0),c=x.useRef(s);c.current=s;const d=x.useMemo(()=>o.slice(0,i).join(""),[o,i]),{completed:p,partial:m}=x.useMemo(()=>mu(d),[d]);x.useEffect(()=>{if(!t)return;l(0);const w=o.length;if(w===0){c.current?.();return}let u=0;const g=setInterval(()=>{u=Math.min(u+fu,w),l(u),u>=w&&(clearInterval(g),c.current?.())},a);return()=>clearInterval(g)},[t,e,o.length,a]);const b=t&&i<o.length;return o.length===0?null:b?n.jsxs("div",{className:r,children:[p?n.jsx("div",{className:"streaming-completed",children:n.jsx(Qe,{children:p})}):null,m?n.jsx("span",{className:"streaming-partial text-sm leading-sm text-text streaming-token-fade-in",children:m}):null]}):n.jsx("div",{className:r,children:n.jsx(Qe,{children:e})})}function Os(...e){return e.filter(Boolean).join(" ")}const gu=n.jsx(Tn,{className:"h-5 w-5 text-text-on-primary"});function cs({width:e="var(--spacing-80)",height:t="var(--spacing-60)",speed:s=1,caption:a="Spark is drawing...",captionClassName:r,className:o,style:i,showOverlay:l=!1,overlayText:c,sparklingIcon:d=gu,...p}){const m=x.useRef(null);return x.useEffect(()=>{if(typeof CSS<"u"&&CSS.registerProperty)try{CSS.registerProperty({name:"--a",syntax:"<angle>",inherits:!0,initialValue:"0deg"}),CSS.registerProperty({name:"--l",syntax:"<number>",inherits:!0,initialValue:"0"}),CSS.registerProperty({name:"--x",syntax:"<length>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:"--y",syntax:"<length>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:"--o",syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:"--value",syntax:"<angle>",inherits:!0,initialValue:"0deg"}),CSS.registerProperty({name:"--width-ratio",syntax:"<number>",inherits:!0,initialValue:"0"}),CSS.registerProperty({name:"--scale",syntax:"<number>",inherits:!0,initialValue:"0"})}catch{}},[]),x.useEffect(()=>{const b=m.current;if(!b)return;const w=()=>{const k=b.getBoundingClientRect();if(k.width>0&&k.height>0){const h=Math.max(k.width,k.height);b.style.setProperty("--actual-size",`${h}px`)}},u=typeof e=="string"&&e.includes("%")||typeof t=="string"&&t.includes("%");let g=null;const f=()=>{w(),g=new ResizeObserver(w),g.observe(b)};if(u){const k=requestAnimationFrame(()=>f());return()=>{cancelAnimationFrame(k),g?.disconnect()}}return f(),()=>g?.disconnect()},[e,t]),n.jsxs(n.Fragment,{children:[n.jsx("style",{children:`
92
92
  @keyframes ai {
93
93
  from { --a: 360deg; --l: 0.35; --o: 1; }
94
94
  30% { --l: 1.5; }
@@ -248,7 +248,7 @@ If you want, I can generate a **preview report** first (top 50 renames + album s
248
248
  .thinking-dark { display: none; }
249
249
  html[data-theme="dark"] .thinking-light, html[data-theme="classic-dark"] .thinking-light { display: none; }
250
250
  html[data-theme="dark"] .thinking-dark, html[data-theme="classic-dark"] .thinking-dark { display: block; }
251
- `})]})}function fs(e){return n.jsx(as,{loader:n.jsx(Du,{}),...e})}fs.displayName="ThinkingIndicator";function Jo(e){return n.jsx(xu,{...e,thinkingIndicator:e.thinkingIndicator??n.jsx(fs,{text:"Qoder is thinking..."})})}Jo.displayName="Response";const ze=Jo;ze.Root=Wt;ze.Thinking=ds;ze.Steps=us;ze.Step=ps;ze.Content=ms;ze.ImageGenerating=Xt;ze.DefaultLayout=Jt;const Mu=ze,ei=x.forwardRef(({children:e,className:t,maxWidth:s="752px",...a},r)=>{const o=y("w-full","bg-sage-bg","rounded-lg","p-3","text-sm leading-sm","font-normal","text-text",t);return n.jsx("div",{ref:r,className:o,style:{maxWidth:typeof s=="number"?`${s}px`:s},...a,children:e})});ei.displayName="UserMessage";const $s="w-5 h-5 text-text-secondary",ti=x.forwardRef(({filename:e,iconFilename:t,size:s,icon:a,getFileIcon:r,onClick:o,className:i,...l},c)=>{const p=a??(r?r(t??e,$s):n.jsx(En,{className:$s}));return n.jsxs("div",{ref:c,role:o?"button":void 0,tabIndex:o?0:void 0,onClick:o,onKeyDown:o?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o())}:void 0,className:y("flex flex-row items-center gap-4 w-full max-w-96","py-5 px-5 rounded-lg","bg-bg-base border border-border-tertiary","text-sm leading-sm","transition-colors cursor-pointer hover:border-border-secondary",i),...l,children:[n.jsx("div",{className:y("flex items-center justify-center w-10 h-10 shrink-0 rounded-md","bg-fill-tertiary"),children:p}),n.jsxs("div",{className:"flex flex-row items-center gap-3 min-w-0",children:[n.jsx("span",{className:"font-medium text-text truncate",children:e}),s!=null&&s!==""&&n.jsxs("span",{className:"shrink-0 text-text-tertiary",children:["(",s,")"]})]})]})});ti.displayName="FileCard";function Ou({className:e}){return n.jsxs("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),n.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),n.jsx("polyline",{points:"10 9 9 9 8 9"})]})}function ni(e,t){return n.jsx(Ou,{className:t})}const si=x.forwardRef((e,t)=>{const{getFileIcon:s}=lt(),a=s??((r,o)=>ni(r,o));return n.jsx(ti,{ref:t,getFileIcon:a,...e})});si.displayName="FileCard";const Bs="h-3.5 w-3.5 shrink-0 text-current",ai=x.forwardRef(({filename:e,iconFilename:t,onRemove:s,icon:a,getFileIcon:r,className:o,...i},l)=>{const d=a??(r?r(t??e,Bs):n.jsx(En,{className:Bs})),{color:p,...m}=i;return n.jsx(Xn,{ref:l,appearance:"filled",color:"mauve",closable:typeof s=="function",onClose:s,closeAriaLabel:"移除",className:o,...m,children:n.jsxs("span",{className:"inline-flex items-center gap-1.5 shrink-0",children:[d,e]})})});ai.displayName="FileAttachment";const ri=x.forwardRef((e,t)=>{const{getFileIcon:s}=lt(),a=s??((r,o)=>ni(r,o));return n.jsx(ai,{ref:t,getFileIcon:a,...e})});ri.displayName="FileAttachment";const $u={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20"},Bu="max-w-[90vw] max-h-[90vh] object-contain",Gu="h-2.5 w-2.5 text-text-secondary",Hu="h-4 w-4 text-text-secondary",oi=x.forwardRef(({src:e,alt:t="",onRemove:s,previewable:a=!0,onClick:r,size:o="sm",className:i,closeIcon:l,closeLargeIcon:c,...d},p)=>{const[m,b]=x.useState(!1),w=l??n.jsx(_e,{className:Gu}),u=c??n.jsx(Aa,{className:Hu}),g=typeof s=="function",f=x.useCallback(()=>{a&&b(!0)},[a]),k=x.useCallback(()=>b(!1),[]),h=x.useCallback(C=>{r?.(C),!C.defaultPrevented&&a&&f()},[r,a,f]),v=x.useCallback(C=>{C.stopPropagation(),s?.(C)},[s]);x.useEffect(()=>{if(!m)return;const C=T=>{T.key==="Escape"&&k()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[m,k]);const S=m&&typeof document<"u"?ia.createPortal(n.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-bg-mask",role:"dialog","aria-modal":"true","aria-label":"图片预览",onClick:C=>{C.target===C.currentTarget&&k()},onKeyDown:C=>C.key==="Escape"&&k(),children:[n.jsx("img",{src:e,alt:t,className:y("rounded-lg shadow-xl",Bu),onClick:C=>C.stopPropagation(),draggable:!1}),n.jsx(je,{variant:"tertiary",size:"md",rounded:"pill",icon:u,onClick:k,"aria-label":"关闭预览",className:"absolute top-4 right-4 bg-bg-base border border-border-tertiary shadow-sm"})]}),document.body):null;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:p,role:a?"button":void 0,tabIndex:a?0:void 0,className:y("relative group shrink-0",a&&"cursor-pointer",i),onClick:h,onKeyDown:a?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f())}:void 0,...d,children:[n.jsx("img",{src:e,alt:t,className:y("rounded-lg object-cover border border-border-tertiary",$u[o]),draggable:!1}),g&&n.jsx("button",{type:"button",onClick:v,"aria-label":"移除",className:"absolute -top-0.5 -right-0.5 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-bg-base border border-border-tertiary shadow-sm opacity-0 group-hover:opacity-100 transition-opacity hover:bg-fill-secondary",children:w})]}),S]})});oi.displayName="ImageAttachment";const Uu="h-2.5 w-2.5 text-text-secondary",Vu="h-4 w-4 text-text-secondary",ii=x.forwardRef((e,t)=>{const s=R("close",Uu),a=R("closeLarge",Vu);return n.jsx(oi,{ref:t,closeIcon:s,closeLargeIcon:a,...e})});ii.displayName="ImageAttachment";const li="w-3.5 h-3.5 text-text-tertiary",ci="w-3.5 h-3.5 transition-transform duration-200 ease-in-out";function di(e){const t=R("eye",li),s=R("arrowRight",ci);return n.jsx(Qt,{eyeIcon:t,arrowRightIcon:s,...e})}di.displayName="ReasoningStepRoot";function ui(e){const t=R("eye",li),s=R("arrowRight",ci);return n.jsx(Dt,{eyeIcon:t,arrowRightIcon:s,...e})}ui.displayName="ReasoningStep";const yt=ui;yt.Root=di;yt.Header=Yt;yt.Details=Kt;yt.DetailRow=ls;const qu=yt,gs="size-[1em] shrink-0",Wu=`${gs} text-text-tertiary`,Zu=`${gs} text-success`,Qu=`${gs} text-text-tertiary`,Yu="w-3.5 h-3.5 text-text-tertiary transition-all duration-200",pi=x.memo(function({toolName:t,params:s,status:a,response:r,defaultExpanded:o=!1,statusText:i,className:l,timeIcon:c,checkboxCircleIcon:d,closeCircleIcon:p,arrowDownIcon:m,runningText:b="Running",ranText:w="Ran",failedText:u="Failed",responseLabel:g="Response"}){const[f,k]=x.useState(o),h=r!=null&&r.length>0,v=a==="running",S=a==="success",C=a==="error",E=i!==void 0?i:v?b:S?w:u,I=E!=="",F=c??n.jsx(Fa,{className:Wu}),Q=d??n.jsx(Bt,{className:Zu}),z=p??n.jsx(za,{className:Qu}),G=m??n.jsx(ye,{className:Yu});return n.jsxs("div",{className:y("flex flex-col",l),children:[n.jsxs("div",{onClick:()=>h&&!v&&k(!f),className:y("group flex items-center gap-1.5 min-h-5",h&&!v&&"cursor-pointer hover:opacity-80 transition-opacity"),children:[n.jsxs("div",{className:"shrink-0 flex items-center justify-center text-xs",children:[v&&F,S&&Q,C&&z]}),I&&n.jsx("span",{className:"text-xs leading-xs text-text-tertiary shrink-0",children:E}),n.jsx("span",{className:"text-xs leading-xs text-text-secondary shrink-0",children:t}),s!=null&&s!==""&&n.jsx("span",{className:"text-xs leading-xs text-text-tertiary min-w-0 shrink truncate",title:s,children:s}),h&&!v&&n.jsx("div",{className:y("shrink-0 inline-flex items-center justify-center","opacity-0 group-hover:opacity-100",f&&"!opacity-100",f?"rotate-180":"rotate-0"),children:G})]}),h&&f&&n.jsxs("div",{className:"mt-1 ml-4.5 rounded-md border border-border-tertiary bg-bg-base overflow-hidden font-mono text-xs leading-xs",children:[n.jsx("div",{className:"text-text-tertiary px-2 pt-1 pb-0 leading-xs",children:g}),n.jsx(be,{scrollbarVisibility:"auto",maxHeight:208,className:"px-2 pb-1 leading-xs",children:n.jsx("pre",{className:y("whitespace-pre-wrap break-words leading-xs",C?"text-error":"text-text-tertiary"),children:r})})]})]})});pi.displayName="ToolInvocationCard";const Ku="size-[1em] text-text-tertiary",Xu="size-[1em] text-success",Ju="size-[1em] text-text-tertiary",ep="w-3.5 h-3.5 text-text-tertiary transition-all duration-200",mi=x.memo(function(t){const{t:s}=ca.useTranslation(),a=R("time",Ku),r=R("checkboxCircle",Xu),o=R("closeCircle",Ju),i=R("arrowDownS",ep);return n.jsx(pi,{timeIcon:a,checkboxCircleIcon:r,closeCircleIcon:o,arrowDownIcon:i,runningText:s("tools.status.running","Running"),ranText:s("tools.status.ran","Ran"),failedText:s("tools.status.failed","Failed"),...t})});mi.displayName="ToolInvocationCard";const tp=80;function Gs(e){if(!e)return{};const{label:t,...s}=e;return s}const np="Permission required",sp="This action requires your permission.",ap="Expand",rp="Collapse",op=", ",fi=x.forwardRef(({title:e,description:t,command:s,commandIntent:a,isLoadingIntent:r=!1,onClose:o,actions:i,className:l,closeIcon:c,warningIcon:d,expandLabel:p=ap,collapseLabel:m=rp,commaLabel:b=op,...w},u)=>{const g=e??np,f=t??sp,k=s.length>tp,[h,v]=x.useState(!k),S=c??n.jsx(_e,{className:"h-3.5 w-3.5"}),C=d??n.jsx(it,{className:"h-4 w-4"});return n.jsxs("div",{ref:u,className:y("relative rounded-lg border border-border-tertiary bg-bg-base p-3",l),...w,children:[o&&n.jsx("button",{type:"button",onClick:o,className:"absolute top-3 right-3 flex h-4 w-4 cursor-pointer items-center justify-center text-text-secondary transition-colors duration-200 hover:text-text","aria-label":"Close",children:S}),n.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[n.jsx("div",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-warning",children:C}),n.jsx("h3",{className:"min-w-0 flex-1 text-base leading-base font-semibold text-text",children:g})]}),n.jsx("p",{className:"mb-2 ml-6 text-xs leading-xs text-text-tertiary",children:r?n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx("div",{className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-text-tertiary border-t-transparent"}),n.jsx("span",{children:f})]}):n.jsxs(n.Fragment,{children:[f,a&&n.jsxs("span",{children:[b,a]})]})}),n.jsx("div",{className:"mb-4 ml-6",children:n.jsxs("div",{className:"rounded p-2 bg-fill-tertiary",children:[h||!k?n.jsx("div",{title:s,children:n.jsx(be,{scrollbarVisibility:"auto",maxHeight:240,className:"text-xs leading-xs font-medium text-text break-all",style:{fontFamily:"Fira Code, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:s})}):n.jsx("div",{className:"text-xs leading-xs font-medium text-text break-all line-clamp-2 overflow-hidden",style:{fontFamily:"Fira Code, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},title:s,children:s}),k&&n.jsx("button",{type:"button",onClick:()=>v(!h),className:"mt-1 flex items-center gap-1 text-xs leading-xs text-text-tertiary hover:text-text transition-colors",children:h?m:p})]})}),n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i?.deny&&n.jsx(ne,{variant:"ghost",...Gs(i.deny),children:i.deny.label}),i?.allowOnce&&n.jsx("button",{type:"button",className:y("rounded-full inline-flex items-center justify-center","px-3 py-1 text-sm leading-sm font-medium","text-text-on-primary bg-error","cursor-pointer hover:opacity-90 active:opacity-95 transition-opacity","disabled:opacity-50 disabled:cursor-not-allowed"),...Gs(i.allowOnce),children:i.allowOnce.label})]})]})});fi.displayName="PermissionCard";const gi=x.forwardRef((e,t)=>{const{t:s}=ca.useTranslation(),a=R("close","h-3.5 w-3.5"),r=R("warning","h-4 w-4");return n.jsx(fi,{ref:t,...e,closeIcon:a,warningIcon:r,title:e.title??s("permission.title"),description:e.description??s("permission.description.default",{toolName:"Tool"}),expandLabel:s("permission.expand"),collapseLabel:s("permission.collapse"),commaLabel:s("common.comma")})});gi.displayName="PermissionCard";const ip="h-5 w-5 text-text-on-primary";function xi(e){const t=R("sparkling",ip);return n.jsx(cs,{sparklingIcon:t,...e})}xi.displayName="ImageGenerating";const hi=x.memo(function({children:t,className:s="",gridClassName:a="",isGenerating:r=!1,maxVisibleWhenGenerating:o=6,formatRemaining:i=l=>`+${l}`}){const l=x.Children.toArray(t),c=l.length,d=r&&c>o,p=d?o:c,m=c-o+1,w=l.slice(0,p).map((u,g)=>d&&g===p-1&&x.isValidElement(u)?x.cloneElement(u,{showOverlay:!0,overlayText:i(m)}):u);return n.jsx("div",{className:y("mt-5 mb-2",s),children:n.jsx("div",{className:y("flex flex-wrap gap-3",a),children:w})})});hi.displayName="GeneratedImagesGrid";const lp={multiSelect:"Multi-select",singleSelect:"Single-select",questionHeader:"Question",skipAll:"Skip All",continue:"Continue",submit:"Submit",sending:"Sending...",customInputPlaceholder:"Other (please specify)",recommend:"Recommend"},cp="[No preference]",xs=x.createContext(null);xs.displayName="UserQuestionContext";function bt(){const e=x.useContext(xs);if(!e)throw new Error("UserQuestion compound components must be used within UserQuestion.Root");return e}const dp=n.jsx(Pa,{className:"w-4 h-4 shrink-0 text-text-tertiary"}),up=n.jsx(An,{}),pp=n.jsx(ye,{}),mp=n.jsx(Tn,{className:"w-4 h-4 mr-1"}),en=x.forwardRef(function({questions:t,resetKey:s,onAnswer:a,onSkip:r,hasCustomText:o=!1,labels:i,chat4Icon:l=dp,arrowUpSIcon:c=up,arrowDownSIcon:d=pp,sparklingIcon:p=mp,children:m},b){const w={...lp,...i},[u,g]=x.useState(0),[f,k]=x.useState({}),[h,v]=x.useState({}),[S,C]=x.useState(0),[T,E]=x.useState(!1),[I,F]=x.useState(void 0),Q=x.useRef(s),z=x.useRef(null),G=x.useRef(new Map),re=x.useRef(u),M=x.useRef(!1),$=x.useRef(!1),q=x.useRef(new Map),ee=x.useRef(u),A=t[u],O=A?.options||[],W=t.every(D=>(f[D.question]||[]).length>0||(h[D.question]?.trim()||"").length>0),oe=(f[A?.question]||[]).length>0||(h[A?.question]?.trim()||"").length>0,Z=x.useCallback(D=>{const P=t[D];if(!P)return 0;const H=f[P.question]||[];if(H.length===0)return 0;const J=(P.options||[]).findIndex(xe=>H.includes(xe.label));return J>=0?J:0},[t,f]);x.useImperativeHandle(b,()=>({getAnswers:()=>{const D={};for(const P of t){const H=f[P.question]||[],X=h[P.question]?.trim(),J=[];H.length>0&&J.push(...H),X&&J.push(X),J.length>0&&(D[P.question]=J.join(", "))}return D}}),[f,h,t]),x.useEffect(()=>{Q.current!==s&&(Q.current=s,G.current.clear(),q.current.clear(),re.current=0,requestAnimationFrame(()=>{E(!1),g(0),k({}),v({}),C(0)}))},[s]),x.useEffect(()=>{if(ee.current!==u){if(re.current=u,$.current){M.current=!0;const D=G.current.get(u),P=z.current;if(D&&P){const H=()=>{M.current=!1,$.current=!1,P.removeEventListener("scrollend",H)};P.addEventListener("scrollend",H,{once:!0}),D.scrollIntoView({behavior:"smooth",block:"nearest"})}else M.current=!1,$.current=!1}ee.current=u}},[u]),x.useEffect(()=>{const D=setTimeout(()=>{let P=0;G.current.forEach(H=>{const X=H.getBoundingClientRect().height;X>P&&(P=X)}),P>0&&F(P)},50);return()=>clearTimeout(D)},[t,s]),x.useEffect(()=>{const D=z.current;if(!D)return;const P=new IntersectionObserver(H=>{if(M.current)return;let X=0,J=re.current;H.forEach(xe=>{xe.isIntersecting&&xe.intersectionRatio>X&&(X=xe.intersectionRatio,G.current.forEach((ks,un)=>{ks===xe.target&&(J=un)}))}),J!==re.current&&X>.5&&(re.current=J,g(J),C(Z(J)))},{root:D,threshold:[0,.25,.5,.75,1]});return G.current.forEach(H=>{H?.isConnected&&P.observe(H)}),()=>P.disconnect()},[t,Z]);const V=x.useCallback((D,P,H)=>{const J=t[H]?.multiSelect??!1,xe=H===t.length-1,un=(f[D]||[]).includes(P);k(ve=>{const kt=ve[D]||[];return J?kt.includes(P)?{...ve,[D]:kt.filter(Zi=>Zi!==P)}:{...ve,[D]:[...kt,P]}:kt.includes(P)?{...ve,[D]:[]}:{...ve,[D]:[P]}}),J||v(ve=>({...ve,[D]:""})),!J&&!xe&&!un&&setTimeout(()=>{const ve=H+1;$.current=!0,g(ve),C(Z(ve))},150)},[t,f,Z]),ie=x.useCallback(()=>{if(u>0){const D=u-1;$.current=!0,g(D),C(Z(D))}},[u,Z]),he=x.useCallback(()=>{if(u<t.length-1){const D=u+1;$.current=!0,g(D),C(Z(D))}},[u,t.length,Z]),fe=x.useCallback(()=>{if(!T)if(W){E(!0);const D={};for(const P of t){const H=f[P.question]||[],X=h[P.question]?.trim(),J=[];H.length>0&&J.push(...H),X&&J.push(X),D[P.question]=J.join(", ")}a(D)}else{const D=X=>(f[X.question]||[]).length===0&&(h[X.question]?.trim()||"").length===0,P=t.length;let H=-1;for(let X=1;X<P;X++){const J=(u+X)%P;if(D(t[J])){H=J;break}}H>=0&&($.current=!0,g(H),C(Z(H)))}},[T,W,t,f,h,u,a,Z]),Y=x.useCallback(()=>{if(T)return;E(!0);const D={};for(const P of t){const H=f[P.question]||[],X=h[P.question]?.trim();if(H.length>0||!!X){const xe=[];H.length>0&&xe.push(...H),X&&xe.push(X),D[P.question]=xe.join(", ")}else D[P.question]=cp}a(D),r()},[T,t,f,h,a,r]),Re=x.useCallback(()=>{if(T)return;const D={};for(const P of t){const H=P.options?.[0];H&&(D[P.question]=[H.label])}k(D),v({}),$.current=!0,g(t.length-1),C(0),setTimeout(()=>{z.current&&z.current.scrollTo({top:z.current.scrollHeight,behavior:"smooth"})},50)},[T,t]),ge=x.useCallback(D=>{$.current=D},[]),Ae={questions:t,labels:w,currentQuestionIndex:u,setCurrentQuestionIndex:g,answers:f,setAnswers:k,customInputs:h,setCustomInputs:v,focusedOptionIndex:S,setFocusedOptionIndex:C,isSubmitting:T,setIsSubmitting:E,maxQuestionHeight:I,scrollContainerRef:z,questionRefs:G,setShouldScrollToQuestion:ge,customInputRefs:q,currentQuestion:A,currentOptions:O,allQuestionsAnswered:W,currentQuestionHasAnswer:oe,getSelectedOptionIndex:Z,handleOptionClick:V,handlePrevious:ie,handleNext:he,handleContinue:fe,handleSkip:Y,handleRecommend:Re,chat4Icon:l,arrowUpSIcon:c,arrowDownSIcon:d,sparklingIcon:p,hasCustomText:o};return t.length===0?null:n.jsx(xs.Provider,{value:Ae,children:m})});en.displayName="UserQuestionRoot";function tn({className:e}){const t=bt();return n.jsxs("div",{className:y("flex items-center justify-between mb-2 -mt-2 px-3 pt-2 pb-2 rounded-t-xl bg-fill-tertiary",e),children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[t.chat4Icon,n.jsx("span",{className:"text-xs leading-xs text-text-tertiary",children:t.currentQuestion?.header||t.labels.questionHeader}),n.jsx("span",{className:"text-text-tertiary/50",children:"•"}),n.jsx("span",{className:"text-xs leading-xs text-text-tertiary",children:t.currentQuestion?.multiSelect?t.labels.multiSelect:t.labels.singleSelect})]}),t.questions.length>1&&n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(je,{size:"sm",variant:"ghost",onClick:t.handlePrevious,disabled:t.currentQuestionIndex===0,icon:t.arrowUpSIcon}),n.jsxs("span",{className:"text-xs leading-xs text-text-tertiary px-1",children:[t.currentQuestionIndex+1," / ",t.questions.length]}),n.jsx(je,{size:"sm",variant:"ghost",onClick:t.handleNext,disabled:t.currentQuestionIndex===t.questions.length-1,icon:t.arrowDownSIcon})]})]})}tn.displayName="UserQuestionHeader";function nn({question:e,qIndex:t,className:s}){const a=bt(),r=e.options||[],[o,i]=x.useState(!1),l=!!a.customInputs[e.question]?.trim(),c=o||l,d=t===a.currentQuestionIndex;return n.jsxs("div",{ref:p=>{p?a.questionRefs.current.set(t,p):a.questionRefs.current.delete(t)},className:y("transition-opacity duration-200",d?"opacity-100":"opacity-40",s),children:[n.jsxs("div",{className:"flex items-start gap-3 pl-2 mb-3",children:[n.jsxs("div",{className:"flex-shrink-0 w-5 flex items-center justify-center text-sm leading-sm font-medium text-text-tertiary",children:[t+1,"."]}),n.jsx("div",{className:"text-sm leading-sm font-medium text-text min-w-0 flex-1",children:e.question})]}),n.jsx(Rn,{items:r.map(p=>({id:p.label,label:p.label,description:p.description})),selectedIds:a.answers[e.question]?.map(p=>p)||[],focusedId:d?r[a.focusedOptionIndex]?.label:void 0,disabled:a.isSubmitting||!d,onItemClick:(p,m)=>{if(!d){a.setCurrentQuestionIndex(t),a.setFocusedOptionIndex(a.getSelectedOptionIndex(t));return}a.handleOptionClick(e.question,p.label,t),a.setFocusedOptionIndex(m)}}),e.allowCustomInput!==!1&&n.jsxs("div",{className:y("w-full flex gap-3 pl-2 mt-3 transition-colors",!d&&"opacity-40",a.isSubmitting&&"opacity-50"),children:[n.jsx("div",{className:y("flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-xs leading-xs font-medium transition-colors",d&&a.focusedOptionIndex===r.length||a.customInputs[e.question]?.trim()?"bg-primary-active text-text-on-primary":"bg-fill-secondary text-text-tertiary"),children:r.length+1}),n.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[n.jsx("div",{className:"h-5 flex items-center",children:n.jsx("input",{ref:p=>{p?a.customInputRefs.current.set(e.question,p):a.customInputRefs.current.delete(e.question)},type:"text",value:a.customInputs[e.question]||"",style:{outline:"none",outlineOffset:0,boxShadow:"none",border:"none"},onChange:p=>{const m=p.target.value;a.setCustomInputs(b=>({...b,[e.question]:m})),!e.multiSelect&&m.trim()&&a.setAnswers(b=>({...b,[e.question]:[]}))},onFocus:()=>{i(!0),d&&(a.setFocusedOptionIndex(r.length),e.multiSelect||a.setAnswers(p=>({...p,[e.question]:[]})))},onBlur:()=>i(!1),onKeyDown:p=>{if(p.key==="Enter"&&!p.shiftKey){p.preventDefault(),p.stopPropagation();const m=a.customInputs[e.question]?.trim();if((a.answers[e.question]||[]).length>0||!!m)if(a.allQuestionsAnswered)a.handleContinue();else if(t<a.questions.length-1){const u=t+1;a.setShouldScrollToQuestion(!0),a.setCurrentQuestionIndex(u),a.setFocusedOptionIndex(0)}else a.handleContinue()}},placeholder:a.labels.customInputPlaceholder,disabled:a.isSubmitting||!d,className:y("w-full h-full py-0 bg-transparent text-sm leading-sm font-medium text-text","placeholder:text-text-tertiary placeholder:font-normal","border-0 rounded-none outline-none outline-offset-0","focus:outline-none focus:outline-offset-0","focus-visible:outline-none focus-visible:outline-offset-0","ring-0 focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none","disabled:cursor-not-allowed")})}),n.jsx("div",{className:"mt-1.5 overflow-hidden origin-left transition-[width] duration-200 ease-out",style:{width:c?"100%":"0%"},"aria-hidden":!0,children:n.jsx("div",{className:"h-px bg-[var(--color-border-tertiary)]"})})]})]})]},e.question)}nn.displayName="UserQuestionCard";function sn({className:e,children:t}){const s=bt(),{scrollContainerRef:a,maxQuestionHeight:r,questions:o}=s;return n.jsx(be,{ref:a,scrollbarVisibility:"auto",maxHeight:r||void 0,className:y("scroll-smooth",e),children:n.jsx("div",{className:"space-y-4 px-3",children:t??o.map((i,l)=>n.jsx(nn,{question:i,qIndex:l},i.question))})})}sn.displayName="UserQuestionCards";function an({className:e}){const t=bt();return n.jsxs("div",{className:y("flex items-center justify-between px-3 py-2",e),children:[n.jsxs(ne,{variant:"ghost",size:"sm",onClick:t.handleRecommend,disabled:t.isSubmitting,children:[t.sparklingIcon,t.labels.recommend]}),n.jsxs("div",{className:"flex items-center gap-2",children:[!t.allQuestionsAnswered&&n.jsx(ne,{variant:"ghost",size:"sm",onClick:t.handleSkip,disabled:t.isSubmitting,children:t.labels.skipAll}),n.jsx(ne,{size:"sm",variant:"secondary",onClick:t.handleContinue,disabled:t.isSubmitting||t.hasCustomText||!t.allQuestionsAnswered,children:t.isSubmitting?t.labels.sending:n.jsxs(n.Fragment,{children:[t.allQuestionsAnswered?t.labels.submit:t.labels.continue,n.jsx("span",{className:"opacity-70",children:" ↵"})]})})]})]})}an.displayName="UserQuestionFooter";function rn(){return n.jsxs(te.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.16,1,.3,1]},className:y("border rounded-t-xl border-b-0 border-border border-border-tertiary bg-bg-base overflow-hidden pt-2 pb-2"),children:[n.jsx(tn,{}),n.jsx(sn,{}),n.jsx(an,{})]})}rn.displayName="UserQuestionDefaultLayout";function fp(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e?.getAttribute("contenteditable")==="true"}function gp({isSubmitting:e,currentQuestion:t,currentOptions:s,currentQuestionIndex:a,questions:r,focusedOptionIndex:o,setFocusedOptionIndex:i,currentQuestionHasAnswer:l,getSelectedOptionIndex:c,setShouldScrollToQuestion:d,setCurrentQuestionIndex:p,handleOptionClick:m,handleContinue:b}){x.useEffect(()=>{const w={ArrowDown(g){if(g.preventDefault(),o<s.length-1)i(o+1);else if(a<r.length-1){const f=a+1;d(!0),p(f),i(c(f))}},ArrowUp(g){if(g.preventDefault(),o>0)i(o-1);else if(a>0){const f=a-1;d(!0),p(f),i(c(f))}},Enter(g){g.preventDefault(),l?b():t&&s[o]&&m(t.question,s[o].label,a)}},u=g=>{if(e||fp(document.activeElement))return;const f=w[g.key];if(f){f(g);return}if(g.key>="1"&&g.key<="9"){const k=parseInt(g.key,10)-1;k>=0&&k<s.length&&t&&(g.preventDefault(),m(t.question,s[k].label,a),i(k))}};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,t,s,a,r.length,o,i,l,c,p,m,b,d])}function xp(){const e=bt();return gp({isSubmitting:e.isSubmitting,currentQuestion:e.currentQuestion,currentOptions:e.currentOptions,currentQuestionIndex:e.currentQuestionIndex,questions:e.questions,focusedOptionIndex:e.focusedOptionIndex,setFocusedOptionIndex:e.setFocusedOptionIndex,currentQuestionHasAnswer:e.currentQuestionHasAnswer,getSelectedOptionIndex:e.getSelectedOptionIndex,setShouldScrollToQuestion:e.setShouldScrollToQuestion,setCurrentQuestionIndex:e.setCurrentQuestionIndex,handleOptionClick:e.handleOptionClick,handleContinue:e.handleContinue}),null}const yi=x.forwardRef(function(t,s){return n.jsxs(en,{ref:s,...t,children:[n.jsx(xp,{}),n.jsx(rn,{})]})});yi.displayName="UserQuestion";const He=yi;He.Root=en;He.Header=tn;He.Card=nn;He.Cards=sn;He.Footer=an;He.DefaultLayout=rn;const hp=He;function yp(e,t){const s=R("chat4","w-4 h-4 shrink-0 text-text-tertiary"),a=R("arrowUpS"),r=R("arrowDownS"),o=R("sparkling","w-4 h-4 mr-1");return n.jsx(en,{ref:t,chat4Icon:s,arrowUpSIcon:a,arrowDownSIcon:r,sparklingIcon:o,...e})}const bi=x.forwardRef(yp);bi.displayName="UserQuestionRoot";const vi=x.forwardRef(function(t,s){const a=R("chat4","w-4 h-4 shrink-0 text-text-tertiary"),r=R("arrowUpS"),o=R("arrowDownS"),i=R("sparkling","w-4 h-4 mr-1");return n.jsx(hp,{ref:s,chat4Icon:a,arrowUpSIcon:r,arrowDownSIcon:o,sparklingIcon:i,...t})});vi.displayName="UserQuestion";const Ue=vi;Ue.Root=bi;Ue.Header=tn;Ue.Card=nn;Ue.Cards=sn;Ue.Footer=an;Ue.DefaultLayout=rn;const bp=Ue,vp={answer:"Answer",answers:"Answers"},kp="w-4 h-4 shrink-0 text-text-tertiary",ki=x.memo(function({answers:t,showHeader:s=!0,labels:a,className:r="",questionAnswerIcon:o}){const i={...vp,...a},l=Object.entries(t),c=o??n.jsx(vc,{className:kp});return l.length===0?null:n.jsxs("div",{className:`rounded-lg border border-border-tertiary bg-bg-container overflow-hidden mx-2 ${r}`.trim(),children:[s&&n.jsxs("div",{className:"flex items-center gap-2 pl-3 pr-3 h-8 border-b border-border-tertiary",children:[c,n.jsx("span",{className:"text-xs leading-xs text-text-tertiary",children:l.length===1?i.answer:i.answers})]}),n.jsx("div",{className:"flex flex-col gap-3 p-3 text-xs leading-xs",children:l.map(([d,p],m)=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:"font-medium text-text",children:d}),n.jsx("span",{className:"text-text-tertiary",children:p})]},m))})]})});ki.displayName="UserQuestionAnswer";const wp="w-4 h-4 shrink-0 text-text-tertiary",wi=x.memo(function(t){const s=R("questionAnswer",wp);return n.jsx(ki,{questionAnswerIcon:s,...t})});wi.displayName="UserQuestionAnswer";const Np={title:"In queue",sendNowTip:"Send now",removeTip:"Remove",fileLabel:"file",filesLabel:"files"},jp="w-3.5 h-3.5",Cp="w-3.5 h-3.5",Sp="w-4 h-4 text-text-tertiary transition-transform duration-200",Ip=x.memo(function({item:t,onRemove:s,onSendNow:a,labels:r,arrowUpIcon:o,closeIcon:i}){const l=x.useCallback(m=>{m.stopPropagation(),s?.(t.id)},[t.id,s]),c=x.useCallback(m=>{m.stopPropagation(),a?.(t.id)},[t.id,a]),d=t.attachmentCount??0,p=d===1?r.fileLabel:r.filesLabel;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs leading-xs hover:bg-fill-tertiary transition-colors cursor-default",children:[n.jsx("span",{className:"truncate flex-1 text-text",children:t.label}),d>0&&n.jsxs("span",{className:"shrink-0 text-xs leading-xs text-text-tertiary",children:["+",d," ",p]}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[a&&n.jsx(at,{content:r.sendNowTip,side:"top",children:n.jsx(je,{size:"sm",variant:"ghost",icon:o,"aria-label":r.sendNowTip,className:"shrink-0",onClick:c})}),s&&n.jsx(at,{content:r.removeTip,side:"top",children:n.jsx(je,{size:"sm",variant:"ghost",icon:i,"aria-label":r.removeTip,className:"shrink-0",onClick:l})})]})]})}),Ni=x.memo(function({items:t,onRemoveItem:s,onSendNow:a,isStreaming:r=!1,hasStatusCardBelow:o=!1,labels:i,defaultExpanded:l=!0,storageKey:c,arrowUpIcon:d,closeIcon:p,arrowDownSIcon:m}){const b={...Np,...i},w=d??n.jsx(An,{className:jp}),u=p??n.jsx(_e,{className:Cp}),g=m??n.jsx(ye,{className:Sp}),[f,k]=x.useState(()=>{if(typeof window>"u")return l;if(c){const v=localStorage.getItem(c);return v!==null?v==="true":l}return l});if(x.useEffect(()=>{c&&localStorage.setItem(c,String(f))},[c,f]),t.length===0)return null;const h=y("w-full overflow-hidden flex flex-col","border border-b-0 border-border border-border-tertiary bg-bg-base",!o&&"rounded-t-xl");return n.jsxs(te.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.16,1,.3,1]},className:h,children:[n.jsx("div",{role:"button",tabIndex:0,onClick:()=>k(!f),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),k(!f))},"aria-expanded":f,"aria-label":`${f?"Collapse":"Expand"} queue`,className:"flex items-center justify-between px-3 py-1 h-7 cursor-pointer bg-fill-tertiary hover:bg-fill-secondary transition-colors duration-150 focus:outline-none",children:n.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[n.jsx("span",{className:y("inline-flex items-center justify-center",!f&&"-rotate-90"),children:g}),n.jsx("span",{className:"text-xs leading-xs font-medium text-text-secondary",children:b.title})]})}),n.jsx(te.AnimatePresence,{initial:!1,children:f&&n.jsx(te.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:[.23,1,.32,1]},className:"overflow-hidden",children:n.jsx(be,{scrollbarVisibility:"auto",maxHeight:208,className:"border-t border-border-tertiary scroll-smooth",children:t.map(v=>n.jsx(Ip,{item:v,onRemove:s,onSendNow:a,labels:b,arrowUpIcon:w,closeIcon:u},v.id))})})})]})});Ni.displayName="QueueIndicator";const Rp="w-3.5 h-3.5",Ap="w-3.5 h-3.5",Ep="w-4 h-4 text-text-tertiary transition-transform duration-200",ji=x.memo(function(t){const s=R("arrowUp",Rp),a=R("close",Ap),r=R("arrowDownS",Ep);return n.jsx(Ni,{arrowUpIcon:s,closeIcon:a,arrowDownSIcon:r,...t})});ji.displayName="QueueIndicator";const Hs="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",Tp="font-['Seti'] shrink-0 inline-flex items-center justify-center w-4 h-4 text-[16px] leading-[16px]",kn={javascript:"",typescript:"",react:"",json:"",html:"",css:"",python:"",java:"",go:"",rust:"",php:"",ruby:"",vue:"",svelte:"",markdown:"",yaml:"",xml:"",shell:"",sass:"",settings:"",default:""},Us={javascript:"#F8CA3E",typescript:"#1E8DEE",react:"#1E8DEE",json:"#F8CA3E",html:"#1E8DEE",css:"#1E8DEE",python:"#1E8DEE",java:"#E84654",go:"#1E8DEE",rust:"#6A89E6",php:"#AE4EE2",ruby:"#E84654",vue:"#4EBD35",svelte:"#E84654",markdown:"#1E8DEE",yaml:"#AE4EE2",xml:"#F18745",shell:"#4EBD35",sass:"#E84654",settings:"#6A89E6",default:"#6A89E6"},Rt={js:"javascript",jsx:"react",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"sass",sass:"sass",less:"css",py:"python",java:"java",go:"go",rs:"rust",php:"php",rb:"ruby",vue:"vue",svelte:"svelte",md:"markdown",yml:"yaml",yaml:"yaml",xml:"xml",sh:"shell",bash:"shell",zsh:"shell",config:"settings",conf:"settings"};function Ci(e,t){let s=null;if(t&&typeof t=="string"&&t.trim()){const a=t.lastIndexOf(".");if(a>0&&a<t.length-1){const r=t.substring(a+1).toLowerCase().trim();r&&Rt[r]&&(s=Rt[r])}}if(!s&&e&&typeof e=="string"&&e.trim()){const a=e.toLowerCase().trim();Rt[a]?s=Rt[a]:kn[a]&&(s=a)}return s||"default"}function Lp(e,t){const s=Ci(e,t);return kn[s]??kn.default}function _p(e,t){const s=Ci(e,t);return Us[s]??Us.default}function Si({files:e=[],defaultExpanded:t=!0,className:s,headerIcon:a,acceptIcon:r,rejectIcon:o,getFileIcon:i}){const[l,c]=x.useState(null),d=n.jsx(Ma,{className:y(Hs,"text-text-secondary")}),p="w-[var(--font-size-sm)] h-[var(--font-size-sm)]",m=n.jsx(Ie,{className:p}),b=n.jsx(_e,{className:p}),w="flex items-center justify-center shrink-0 rounded cursor-pointer transition-colors duration-200 text-text-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-primary";return n.jsx(Ce,{headerIcon:a??d,headerTitle:n.jsxs("span",{className:"font-normal",children:[e.length," ",e.length===1?"File":"Files"]}),headerRight:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(ne,{variant:"ghost",size:"sm",onClick:u=>u.stopPropagation(),children:"Undo All"}),n.jsx(ne,{variant:"ghost",size:"sm",onClick:u=>u.stopPropagation(),children:"Keep All"}),n.jsx(ne,{variant:"secondary",size:"sm",onClick:u=>u.stopPropagation(),children:"Review"})]}),defaultExpanded:t,contentPadding:"var(--spacing-1\\.5) var(--spacing-1) var(--spacing-1\\.5)",className:s,children:n.jsx("div",{className:"flex flex-col gap-0.5",children:e.map((u,g)=>{const f=l===g,k=u.additions!=null&&Number.isFinite(u.additions)?u.additions:null,h=u.deletions!=null&&Number.isFinite(u.deletions)?u.deletions:null;return n.jsxs("div",{className:y("flex items-center gap-1 px-1 py-1 rounded-sm cursor-pointer transition-colors duration-200 relative h-6",f?"bg-fill-secondary":"bg-transparent"),onMouseEnter:()=>c(g),onMouseLeave:()=>c(null),children:[i?n.jsx("span",{className:y("shrink-0",Hs),children:i(u.fileType,u.filename)}):n.jsx("span",{className:y("shrink-0",Tp),style:{color:_p(u.fileType,u.filename)},"aria-hidden":!0,children:Lp(u.fileType,u.filename)}),n.jsx("span",{className:y("flex-1 text-xs font-medium truncate pr-12",f?"text-text":"text-text-tertiary"),children:u.filename}),n.jsxs("div",{className:y("absolute right-1 flex items-center gap-0.5 text-xs font-medium shrink-0 transition-opacity duration-200",f?"opacity-0 pointer-events-none":"opacity-100"),children:[k!=null&&n.jsxs("span",{className:"text-success",children:["+",k]}),h!=null&&n.jsxs("span",{className:"text-error",children:["-",h]})]}),n.jsxs("div",{className:y("flex items-center gap-0.5 shrink-0 absolute right-1 transition-opacity duration-200",f?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:v=>v.stopPropagation(),children:[n.jsx("button",{type:"button",className:y(w,"h-6 min-w-6 [&_svg]:w-[var(--font-size-sm)] [&_svg]:h-[var(--font-size-sm)]"),title:"Reject","aria-label":"Reject",onClick:v=>v.stopPropagation(),children:o??b}),n.jsx("button",{type:"button",className:y(w,"h-6 min-w-6 [&_svg]:w-[var(--font-size-sm)] [&_svg]:h-[var(--font-size-sm)]"),title:"Accept","aria-label":"Accept",onClick:v=>v.stopPropagation(),children:r??m})]})]},g)})})})}Si.displayName="FileReviewPart";const Vs="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0 text-text-secondary",At="w-[var(--font-size-sm)] h-[var(--font-size-sm)]";function Ii(e){const t=R("requestChanges",Vs)??n.jsx(Ma,{className:Vs}),s=R("checkLine",At)??n.jsx(Ie,{className:At}),a=R("close",At)??n.jsx(_e,{className:At}),r=e.getFileIcon;return n.jsx(Si,{headerIcon:t,acceptIcon:s,rejectIcon:a,getFileIcon:r,...e})}Ii.displayName="FileReviewPart";const vt="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",Pp=n.jsx(Oa,{className:y(vt,"text-text-secondary")}),Fp=n.jsx($a,{className:y(vt,"text-text-tertiary")}),zp=n.jsx(Bt,{className:y(vt,"text-text-quaternary")}),Dp=n.jsx(Ba,{className:y(vt,"text-text-tertiary")}),Mp=n.jsx(Ga,{className:y(vt,"text-text")});function Op(e,t,s){return t?s.loaderIcon??Mp:e.status==="completed"?s.completedIcon??zp:e.status==="skipped"||e.status==="cancelled"?s.skippedIcon??Dp:s.uncompletedIcon??Fp}function Ri({tasks:e=[],title:t="To-dos",currentTaskId:s,defaultExpanded:a=!0,className:r,headerIcon:o,uncompletedIcon:i,completedIcon:l,skippedIcon:c,loaderIcon:d}){return n.jsx(Ce,{headerIcon:o??Pp,headerTitle:n.jsx("span",{className:"text-left",children:t}),defaultExpanded:a,contentPadding:"var(--spacing-1\\.5) var(--spacing-2)",showExpandAllBar:!0,maxHeight:124,className:r,children:n.jsx("div",{className:"flex flex-col gap-2",children:e.map((p,m)=>{const b=p.id??m,w=s!=null&&s===String(b),u=Op(p,w,{loaderIcon:d,completedIcon:l,skippedIcon:c,uncompletedIcon:i});return n.jsxs("div",{className:"flex flex-row gap-2 items-start",children:[n.jsx("div",{className:"flex items-center justify-center shrink-0 pt-0.5 [&>svg]:w-[var(--font-size-sm)] [&>svg]:h-[var(--font-size-sm)]",children:u}),n.jsx("span",{className:y("text-xs leading-xs flex-1 text-left",w?"text-text":p.status==="completed"?"text-text-quaternary line-through":"text-text-tertiary"),children:p.text})]},b)})})})}Ri.displayName="TaskPart";const on="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",qs=`${on} text-text-secondary`,Et=`${on} text-text-tertiary`,Ws=`${on} text-text-quaternary`,Zs=`${on} text-text`;function Ai(e){const t=R("catalog",qs)??n.jsx(Oa,{className:qs}),s=R("circle",Et)??n.jsx($a,{className:Et}),a=R("checkboxCircle",Ws)??n.jsx(Bt,{className:Ws}),r=R("indeterminateCircle",Et)??n.jsx(Ba,{className:Et}),o=R("arrowRightCircleFill",Zs)??n.jsx(Ga,{className:Zs});return n.jsx(Ri,{headerIcon:t,uncompletedIcon:s,completedIcon:a,skippedIcon:r,loaderIcon:o,...e})}Ai.displayName="TaskPart";const hs="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",$p=n.jsx(Gt,{className:`${hs} text-text-secondary`}),Bp=n.jsx(Ha,{className:hs}),Gp=n.jsx(Ie,{className:y(hs,"text-success")});function Ei({title:e="Plan",description:t,content:s,viewText:a="View",buildText:r="Build ⌘⏎",builtText:o="Built",isBuilt:i=!1,isGenerating:l=!1,onView:c,onBuild:d,onDownload:p,defaultExpanded:m=!0,contentMaxHeight:b,collapsible:w=!1,className:u,headerIcon:g,downloadIcon:f,builtIcon:k}){const h=s.split(`
251
+ `})]})}function fs(e){return n.jsx(as,{loader:n.jsx(Du,{}),...e})}fs.displayName="ThinkingIndicator";function Jo(e){return n.jsx(xu,{...e,thinkingIndicator:e.thinkingIndicator??n.jsx(fs,{text:"Spark is thinking..."})})}Jo.displayName="Response";const ze=Jo;ze.Root=Wt;ze.Thinking=ds;ze.Steps=us;ze.Step=ps;ze.Content=ms;ze.ImageGenerating=Xt;ze.DefaultLayout=Jt;const Mu=ze,ei=x.forwardRef(({children:e,className:t,maxWidth:s="752px",...a},r)=>{const o=y("w-full","bg-sage-bg","rounded-lg","p-3","text-sm leading-sm","font-normal","text-text",t);return n.jsx("div",{ref:r,className:o,style:{maxWidth:typeof s=="number"?`${s}px`:s},...a,children:e})});ei.displayName="UserMessage";const $s="w-5 h-5 text-text-secondary",ti=x.forwardRef(({filename:e,iconFilename:t,size:s,icon:a,getFileIcon:r,onClick:o,className:i,...l},c)=>{const p=a??(r?r(t??e,$s):n.jsx(En,{className:$s}));return n.jsxs("div",{ref:c,role:o?"button":void 0,tabIndex:o?0:void 0,onClick:o,onKeyDown:o?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),o())}:void 0,className:y("flex flex-row items-center gap-4 w-full max-w-96","py-5 px-5 rounded-lg","bg-bg-base border border-border-tertiary","text-sm leading-sm","transition-colors cursor-pointer hover:border-border-secondary",i),...l,children:[n.jsx("div",{className:y("flex items-center justify-center w-10 h-10 shrink-0 rounded-md","bg-fill-tertiary"),children:p}),n.jsxs("div",{className:"flex flex-row items-center gap-3 min-w-0",children:[n.jsx("span",{className:"font-medium text-text truncate",children:e}),s!=null&&s!==""&&n.jsxs("span",{className:"shrink-0 text-text-tertiary",children:["(",s,")"]})]})]})});ti.displayName="FileCard";function Ou({className:e}){return n.jsxs("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[n.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),n.jsx("polyline",{points:"14 2 14 8 20 8"}),n.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),n.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),n.jsx("polyline",{points:"10 9 9 9 8 9"})]})}function ni(e,t){return n.jsx(Ou,{className:t})}const si=x.forwardRef((e,t)=>{const{getFileIcon:s}=lt(),a=s??((r,o)=>ni(r,o));return n.jsx(ti,{ref:t,getFileIcon:a,...e})});si.displayName="FileCard";const Bs="h-3.5 w-3.5 shrink-0 text-current",ai=x.forwardRef(({filename:e,iconFilename:t,onRemove:s,icon:a,getFileIcon:r,className:o,...i},l)=>{const d=a??(r?r(t??e,Bs):n.jsx(En,{className:Bs})),{color:p,...m}=i;return n.jsx(Xn,{ref:l,appearance:"filled",color:"mauve",closable:typeof s=="function",onClose:s,closeAriaLabel:"移除",className:o,...m,children:n.jsxs("span",{className:"inline-flex items-center gap-1.5 shrink-0",children:[d,e]})})});ai.displayName="FileAttachment";const ri=x.forwardRef((e,t)=>{const{getFileIcon:s}=lt(),a=s??((r,o)=>ni(r,o));return n.jsx(ai,{ref:t,getFileIcon:a,...e})});ri.displayName="FileAttachment";const $u={sm:"w-12 h-12",md:"w-16 h-16",lg:"w-20 h-20"},Bu="max-w-[90vw] max-h-[90vh] object-contain",Gu="h-2.5 w-2.5 text-text-secondary",Hu="h-4 w-4 text-text-secondary",oi=x.forwardRef(({src:e,alt:t="",onRemove:s,previewable:a=!0,onClick:r,size:o="sm",className:i,closeIcon:l,closeLargeIcon:c,...d},p)=>{const[m,b]=x.useState(!1),w=l??n.jsx(_e,{className:Gu}),u=c??n.jsx(Aa,{className:Hu}),g=typeof s=="function",f=x.useCallback(()=>{a&&b(!0)},[a]),k=x.useCallback(()=>b(!1),[]),h=x.useCallback(C=>{r?.(C),!C.defaultPrevented&&a&&f()},[r,a,f]),v=x.useCallback(C=>{C.stopPropagation(),s?.(C)},[s]);x.useEffect(()=>{if(!m)return;const C=T=>{T.key==="Escape"&&k()};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[m,k]);const S=m&&typeof document<"u"?ia.createPortal(n.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-bg-mask",role:"dialog","aria-modal":"true","aria-label":"图片预览",onClick:C=>{C.target===C.currentTarget&&k()},onKeyDown:C=>C.key==="Escape"&&k(),children:[n.jsx("img",{src:e,alt:t,className:y("rounded-lg shadow-xl",Bu),onClick:C=>C.stopPropagation(),draggable:!1}),n.jsx(je,{variant:"tertiary",size:"md",rounded:"pill",icon:u,onClick:k,"aria-label":"关闭预览",className:"absolute top-4 right-4 bg-bg-base border border-border-tertiary shadow-sm"})]}),document.body):null;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:p,role:a?"button":void 0,tabIndex:a?0:void 0,className:y("relative group shrink-0",a&&"cursor-pointer",i),onClick:h,onKeyDown:a?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),f())}:void 0,...d,children:[n.jsx("img",{src:e,alt:t,className:y("rounded-lg object-cover border border-border-tertiary",$u[o]),draggable:!1}),g&&n.jsx("button",{type:"button",onClick:v,"aria-label":"移除",className:"absolute -top-0.5 -right-0.5 flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-bg-base border border-border-tertiary shadow-sm opacity-0 group-hover:opacity-100 transition-opacity hover:bg-fill-secondary",children:w})]}),S]})});oi.displayName="ImageAttachment";const Uu="h-2.5 w-2.5 text-text-secondary",Vu="h-4 w-4 text-text-secondary",ii=x.forwardRef((e,t)=>{const s=R("close",Uu),a=R("closeLarge",Vu);return n.jsx(oi,{ref:t,closeIcon:s,closeLargeIcon:a,...e})});ii.displayName="ImageAttachment";const li="w-3.5 h-3.5 text-text-tertiary",ci="w-3.5 h-3.5 transition-transform duration-200 ease-in-out";function di(e){const t=R("eye",li),s=R("arrowRight",ci);return n.jsx(Qt,{eyeIcon:t,arrowRightIcon:s,...e})}di.displayName="ReasoningStepRoot";function ui(e){const t=R("eye",li),s=R("arrowRight",ci);return n.jsx(Dt,{eyeIcon:t,arrowRightIcon:s,...e})}ui.displayName="ReasoningStep";const yt=ui;yt.Root=di;yt.Header=Yt;yt.Details=Kt;yt.DetailRow=ls;const qu=yt,gs="size-[1em] shrink-0",Wu=`${gs} text-text-tertiary`,Zu=`${gs} text-success`,Qu=`${gs} text-text-tertiary`,Yu="w-3.5 h-3.5 text-text-tertiary transition-all duration-200",pi=x.memo(function({toolName:t,params:s,status:a,response:r,defaultExpanded:o=!1,statusText:i,className:l,timeIcon:c,checkboxCircleIcon:d,closeCircleIcon:p,arrowDownIcon:m,runningText:b="Running",ranText:w="Ran",failedText:u="Failed",responseLabel:g="Response"}){const[f,k]=x.useState(o),h=r!=null&&r.length>0,v=a==="running",S=a==="success",C=a==="error",E=i!==void 0?i:v?b:S?w:u,I=E!=="",F=c??n.jsx(Fa,{className:Wu}),Q=d??n.jsx(Bt,{className:Zu}),z=p??n.jsx(za,{className:Qu}),G=m??n.jsx(ye,{className:Yu});return n.jsxs("div",{className:y("flex flex-col",l),children:[n.jsxs("div",{onClick:()=>h&&!v&&k(!f),className:y("group flex items-center gap-1.5 min-h-5",h&&!v&&"cursor-pointer hover:opacity-80 transition-opacity"),children:[n.jsxs("div",{className:"shrink-0 flex items-center justify-center text-xs",children:[v&&F,S&&Q,C&&z]}),I&&n.jsx("span",{className:"text-xs leading-xs text-text-tertiary shrink-0",children:E}),n.jsx("span",{className:"text-xs leading-xs text-text-secondary shrink-0",children:t}),s!=null&&s!==""&&n.jsx("span",{className:"text-xs leading-xs text-text-tertiary min-w-0 shrink truncate",title:s,children:s}),h&&!v&&n.jsx("div",{className:y("shrink-0 inline-flex items-center justify-center","opacity-0 group-hover:opacity-100",f&&"!opacity-100",f?"rotate-180":"rotate-0"),children:G})]}),h&&f&&n.jsxs("div",{className:"mt-1 ml-4.5 rounded-md border border-border-tertiary bg-bg-base overflow-hidden font-mono text-xs leading-xs",children:[n.jsx("div",{className:"text-text-tertiary px-2 pt-1 pb-0 leading-xs",children:g}),n.jsx(be,{scrollbarVisibility:"auto",maxHeight:208,className:"px-2 pb-1 leading-xs",children:n.jsx("pre",{className:y("whitespace-pre-wrap break-words leading-xs",C?"text-error":"text-text-tertiary"),children:r})})]})]})});pi.displayName="ToolInvocationCard";const Ku="size-[1em] text-text-tertiary",Xu="size-[1em] text-success",Ju="size-[1em] text-text-tertiary",ep="w-3.5 h-3.5 text-text-tertiary transition-all duration-200",mi=x.memo(function(t){const{t:s}=ca.useTranslation(),a=R("time",Ku),r=R("checkboxCircle",Xu),o=R("closeCircle",Ju),i=R("arrowDownS",ep);return n.jsx(pi,{timeIcon:a,checkboxCircleIcon:r,closeCircleIcon:o,arrowDownIcon:i,runningText:s("tools.status.running","Running"),ranText:s("tools.status.ran","Ran"),failedText:s("tools.status.failed","Failed"),...t})});mi.displayName="ToolInvocationCard";const tp=80;function Gs(e){if(!e)return{};const{label:t,...s}=e;return s}const np="Permission required",sp="This action requires your permission.",ap="Expand",rp="Collapse",op=", ",fi=x.forwardRef(({title:e,description:t,command:s,commandIntent:a,isLoadingIntent:r=!1,onClose:o,actions:i,className:l,closeIcon:c,warningIcon:d,expandLabel:p=ap,collapseLabel:m=rp,commaLabel:b=op,...w},u)=>{const g=e??np,f=t??sp,k=s.length>tp,[h,v]=x.useState(!k),S=c??n.jsx(_e,{className:"h-3.5 w-3.5"}),C=d??n.jsx(it,{className:"h-4 w-4"});return n.jsxs("div",{ref:u,className:y("relative rounded-lg border border-border-tertiary bg-bg-base p-3",l),...w,children:[o&&n.jsx("button",{type:"button",onClick:o,className:"absolute top-3 right-3 flex h-4 w-4 cursor-pointer items-center justify-center text-text-secondary transition-colors duration-200 hover:text-text","aria-label":"Close",children:S}),n.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[n.jsx("div",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-warning",children:C}),n.jsx("h3",{className:"min-w-0 flex-1 text-base leading-base font-semibold text-text",children:g})]}),n.jsx("p",{className:"mb-2 ml-6 text-xs leading-xs text-text-tertiary",children:r?n.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[n.jsx("div",{className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-text-tertiary border-t-transparent"}),n.jsx("span",{children:f})]}):n.jsxs(n.Fragment,{children:[f,a&&n.jsxs("span",{children:[b,a]})]})}),n.jsx("div",{className:"mb-4 ml-6",children:n.jsxs("div",{className:"rounded p-2 bg-fill-tertiary",children:[h||!k?n.jsx("div",{title:s,children:n.jsx(be,{scrollbarVisibility:"auto",maxHeight:240,className:"text-xs leading-xs font-medium text-text break-all",style:{fontFamily:"Fira Code, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:s})}):n.jsx("div",{className:"text-xs leading-xs font-medium text-text break-all line-clamp-2 overflow-hidden",style:{fontFamily:"Fira Code, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},title:s,children:s}),k&&n.jsx("button",{type:"button",onClick:()=>v(!h),className:"mt-1 flex items-center gap-1 text-xs leading-xs text-text-tertiary hover:text-text transition-colors",children:h?m:p})]})}),n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i?.deny&&n.jsx(ne,{variant:"ghost",...Gs(i.deny),children:i.deny.label}),i?.allowOnce&&n.jsx("button",{type:"button",className:y("rounded-full inline-flex items-center justify-center","px-3 py-1 text-sm leading-sm font-medium","text-text-on-primary bg-error","cursor-pointer hover:opacity-90 active:opacity-95 transition-opacity","disabled:opacity-50 disabled:cursor-not-allowed"),...Gs(i.allowOnce),children:i.allowOnce.label})]})]})});fi.displayName="PermissionCard";const gi=x.forwardRef((e,t)=>{const{t:s}=ca.useTranslation(),a=R("close","h-3.5 w-3.5"),r=R("warning","h-4 w-4");return n.jsx(fi,{ref:t,...e,closeIcon:a,warningIcon:r,title:e.title??s("permission.title"),description:e.description??s("permission.description.default",{toolName:"Tool"}),expandLabel:s("permission.expand"),collapseLabel:s("permission.collapse"),commaLabel:s("common.comma")})});gi.displayName="PermissionCard";const ip="h-5 w-5 text-text-on-primary";function xi(e){const t=R("sparkling",ip);return n.jsx(cs,{sparklingIcon:t,...e})}xi.displayName="ImageGenerating";const hi=x.memo(function({children:t,className:s="",gridClassName:a="",isGenerating:r=!1,maxVisibleWhenGenerating:o=6,formatRemaining:i=l=>`+${l}`}){const l=x.Children.toArray(t),c=l.length,d=r&&c>o,p=d?o:c,m=c-o+1,w=l.slice(0,p).map((u,g)=>d&&g===p-1&&x.isValidElement(u)?x.cloneElement(u,{showOverlay:!0,overlayText:i(m)}):u);return n.jsx("div",{className:y("mt-5 mb-2",s),children:n.jsx("div",{className:y("flex flex-wrap gap-3",a),children:w})})});hi.displayName="GeneratedImagesGrid";const lp={multiSelect:"Multi-select",singleSelect:"Single-select",questionHeader:"Question",skipAll:"Skip All",continue:"Continue",submit:"Submit",sending:"Sending...",customInputPlaceholder:"Other (please specify)",recommend:"Recommend"},cp="[No preference]",xs=x.createContext(null);xs.displayName="UserQuestionContext";function bt(){const e=x.useContext(xs);if(!e)throw new Error("UserQuestion compound components must be used within UserQuestion.Root");return e}const dp=n.jsx(Pa,{className:"w-4 h-4 shrink-0 text-text-tertiary"}),up=n.jsx(An,{}),pp=n.jsx(ye,{}),mp=n.jsx(Tn,{className:"w-4 h-4 mr-1"}),en=x.forwardRef(function({questions:t,resetKey:s,onAnswer:a,onSkip:r,hasCustomText:o=!1,labels:i,chat4Icon:l=dp,arrowUpSIcon:c=up,arrowDownSIcon:d=pp,sparklingIcon:p=mp,children:m},b){const w={...lp,...i},[u,g]=x.useState(0),[f,k]=x.useState({}),[h,v]=x.useState({}),[S,C]=x.useState(0),[T,E]=x.useState(!1),[I,F]=x.useState(void 0),Q=x.useRef(s),z=x.useRef(null),G=x.useRef(new Map),re=x.useRef(u),M=x.useRef(!1),$=x.useRef(!1),q=x.useRef(new Map),ee=x.useRef(u),A=t[u],O=A?.options||[],W=t.every(D=>(f[D.question]||[]).length>0||(h[D.question]?.trim()||"").length>0),oe=(f[A?.question]||[]).length>0||(h[A?.question]?.trim()||"").length>0,Z=x.useCallback(D=>{const P=t[D];if(!P)return 0;const H=f[P.question]||[];if(H.length===0)return 0;const J=(P.options||[]).findIndex(xe=>H.includes(xe.label));return J>=0?J:0},[t,f]);x.useImperativeHandle(b,()=>({getAnswers:()=>{const D={};for(const P of t){const H=f[P.question]||[],X=h[P.question]?.trim(),J=[];H.length>0&&J.push(...H),X&&J.push(X),J.length>0&&(D[P.question]=J.join(", "))}return D}}),[f,h,t]),x.useEffect(()=>{Q.current!==s&&(Q.current=s,G.current.clear(),q.current.clear(),re.current=0,requestAnimationFrame(()=>{E(!1),g(0),k({}),v({}),C(0)}))},[s]),x.useEffect(()=>{if(ee.current!==u){if(re.current=u,$.current){M.current=!0;const D=G.current.get(u),P=z.current;if(D&&P){const H=()=>{M.current=!1,$.current=!1,P.removeEventListener("scrollend",H)};P.addEventListener("scrollend",H,{once:!0}),D.scrollIntoView({behavior:"smooth",block:"nearest"})}else M.current=!1,$.current=!1}ee.current=u}},[u]),x.useEffect(()=>{const D=setTimeout(()=>{let P=0;G.current.forEach(H=>{const X=H.getBoundingClientRect().height;X>P&&(P=X)}),P>0&&F(P)},50);return()=>clearTimeout(D)},[t,s]),x.useEffect(()=>{const D=z.current;if(!D)return;const P=new IntersectionObserver(H=>{if(M.current)return;let X=0,J=re.current;H.forEach(xe=>{xe.isIntersecting&&xe.intersectionRatio>X&&(X=xe.intersectionRatio,G.current.forEach((ks,un)=>{ks===xe.target&&(J=un)}))}),J!==re.current&&X>.5&&(re.current=J,g(J),C(Z(J)))},{root:D,threshold:[0,.25,.5,.75,1]});return G.current.forEach(H=>{H?.isConnected&&P.observe(H)}),()=>P.disconnect()},[t,Z]);const V=x.useCallback((D,P,H)=>{const J=t[H]?.multiSelect??!1,xe=H===t.length-1,un=(f[D]||[]).includes(P);k(ve=>{const kt=ve[D]||[];return J?kt.includes(P)?{...ve,[D]:kt.filter(Zi=>Zi!==P)}:{...ve,[D]:[...kt,P]}:kt.includes(P)?{...ve,[D]:[]}:{...ve,[D]:[P]}}),J||v(ve=>({...ve,[D]:""})),!J&&!xe&&!un&&setTimeout(()=>{const ve=H+1;$.current=!0,g(ve),C(Z(ve))},150)},[t,f,Z]),ie=x.useCallback(()=>{if(u>0){const D=u-1;$.current=!0,g(D),C(Z(D))}},[u,Z]),he=x.useCallback(()=>{if(u<t.length-1){const D=u+1;$.current=!0,g(D),C(Z(D))}},[u,t.length,Z]),fe=x.useCallback(()=>{if(!T)if(W){E(!0);const D={};for(const P of t){const H=f[P.question]||[],X=h[P.question]?.trim(),J=[];H.length>0&&J.push(...H),X&&J.push(X),D[P.question]=J.join(", ")}a(D)}else{const D=X=>(f[X.question]||[]).length===0&&(h[X.question]?.trim()||"").length===0,P=t.length;let H=-1;for(let X=1;X<P;X++){const J=(u+X)%P;if(D(t[J])){H=J;break}}H>=0&&($.current=!0,g(H),C(Z(H)))}},[T,W,t,f,h,u,a,Z]),Y=x.useCallback(()=>{if(T)return;E(!0);const D={};for(const P of t){const H=f[P.question]||[],X=h[P.question]?.trim();if(H.length>0||!!X){const xe=[];H.length>0&&xe.push(...H),X&&xe.push(X),D[P.question]=xe.join(", ")}else D[P.question]=cp}a(D),r()},[T,t,f,h,a,r]),Re=x.useCallback(()=>{if(T)return;const D={};for(const P of t){const H=P.options?.[0];H&&(D[P.question]=[H.label])}k(D),v({}),$.current=!0,g(t.length-1),C(0),setTimeout(()=>{z.current&&z.current.scrollTo({top:z.current.scrollHeight,behavior:"smooth"})},50)},[T,t]),ge=x.useCallback(D=>{$.current=D},[]),Ae={questions:t,labels:w,currentQuestionIndex:u,setCurrentQuestionIndex:g,answers:f,setAnswers:k,customInputs:h,setCustomInputs:v,focusedOptionIndex:S,setFocusedOptionIndex:C,isSubmitting:T,setIsSubmitting:E,maxQuestionHeight:I,scrollContainerRef:z,questionRefs:G,setShouldScrollToQuestion:ge,customInputRefs:q,currentQuestion:A,currentOptions:O,allQuestionsAnswered:W,currentQuestionHasAnswer:oe,getSelectedOptionIndex:Z,handleOptionClick:V,handlePrevious:ie,handleNext:he,handleContinue:fe,handleSkip:Y,handleRecommend:Re,chat4Icon:l,arrowUpSIcon:c,arrowDownSIcon:d,sparklingIcon:p,hasCustomText:o};return t.length===0?null:n.jsx(xs.Provider,{value:Ae,children:m})});en.displayName="UserQuestionRoot";function tn({className:e}){const t=bt();return n.jsxs("div",{className:y("flex items-center justify-between mb-2 -mt-2 px-3 pt-2 pb-2 rounded-t-xl bg-fill-tertiary",e),children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[t.chat4Icon,n.jsx("span",{className:"text-xs leading-xs text-text-tertiary",children:t.currentQuestion?.header||t.labels.questionHeader}),n.jsx("span",{className:"text-text-tertiary/50",children:"•"}),n.jsx("span",{className:"text-xs leading-xs text-text-tertiary",children:t.currentQuestion?.multiSelect?t.labels.multiSelect:t.labels.singleSelect})]}),t.questions.length>1&&n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(je,{size:"sm",variant:"ghost",onClick:t.handlePrevious,disabled:t.currentQuestionIndex===0,icon:t.arrowUpSIcon}),n.jsxs("span",{className:"text-xs leading-xs text-text-tertiary px-1",children:[t.currentQuestionIndex+1," / ",t.questions.length]}),n.jsx(je,{size:"sm",variant:"ghost",onClick:t.handleNext,disabled:t.currentQuestionIndex===t.questions.length-1,icon:t.arrowDownSIcon})]})]})}tn.displayName="UserQuestionHeader";function nn({question:e,qIndex:t,className:s}){const a=bt(),r=e.options||[],[o,i]=x.useState(!1),l=!!a.customInputs[e.question]?.trim(),c=o||l,d=t===a.currentQuestionIndex;return n.jsxs("div",{ref:p=>{p?a.questionRefs.current.set(t,p):a.questionRefs.current.delete(t)},className:y("transition-opacity duration-200",d?"opacity-100":"opacity-40",s),children:[n.jsxs("div",{className:"flex items-start gap-3 pl-2 mb-3",children:[n.jsxs("div",{className:"flex-shrink-0 w-5 flex items-center justify-center text-sm leading-sm font-medium text-text-tertiary",children:[t+1,"."]}),n.jsx("div",{className:"text-sm leading-sm font-medium text-text min-w-0 flex-1",children:e.question})]}),n.jsx(Rn,{items:r.map(p=>({id:p.label,label:p.label,description:p.description})),selectedIds:a.answers[e.question]?.map(p=>p)||[],focusedId:d?r[a.focusedOptionIndex]?.label:void 0,disabled:a.isSubmitting||!d,onItemClick:(p,m)=>{if(!d){a.setCurrentQuestionIndex(t),a.setFocusedOptionIndex(a.getSelectedOptionIndex(t));return}a.handleOptionClick(e.question,p.label,t),a.setFocusedOptionIndex(m)}}),e.allowCustomInput!==!1&&n.jsxs("div",{className:y("w-full flex gap-3 pl-2 mt-3 transition-colors",!d&&"opacity-40",a.isSubmitting&&"opacity-50"),children:[n.jsx("div",{className:y("flex-shrink-0 w-5 h-5 rounded-full flex items-center justify-center text-xs leading-xs font-medium transition-colors",d&&a.focusedOptionIndex===r.length||a.customInputs[e.question]?.trim()?"bg-primary-active text-text-on-primary":"bg-fill-secondary text-text-tertiary"),children:r.length+1}),n.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[n.jsx("div",{className:"h-5 flex items-center",children:n.jsx("input",{ref:p=>{p?a.customInputRefs.current.set(e.question,p):a.customInputRefs.current.delete(e.question)},type:"text",value:a.customInputs[e.question]||"",style:{outline:"none",outlineOffset:0,boxShadow:"none",border:"none"},onChange:p=>{const m=p.target.value;a.setCustomInputs(b=>({...b,[e.question]:m})),!e.multiSelect&&m.trim()&&a.setAnswers(b=>({...b,[e.question]:[]}))},onFocus:()=>{i(!0),d&&(a.setFocusedOptionIndex(r.length),e.multiSelect||a.setAnswers(p=>({...p,[e.question]:[]})))},onBlur:()=>i(!1),onKeyDown:p=>{if(p.key==="Enter"&&!p.shiftKey){p.preventDefault(),p.stopPropagation();const m=a.customInputs[e.question]?.trim();if((a.answers[e.question]||[]).length>0||!!m)if(a.allQuestionsAnswered)a.handleContinue();else if(t<a.questions.length-1){const u=t+1;a.setShouldScrollToQuestion(!0),a.setCurrentQuestionIndex(u),a.setFocusedOptionIndex(0)}else a.handleContinue()}},placeholder:a.labels.customInputPlaceholder,disabled:a.isSubmitting||!d,className:y("w-full h-full py-0 bg-transparent text-sm leading-sm font-medium text-text","placeholder:text-text-tertiary placeholder:font-normal","border-0 rounded-none outline-none outline-offset-0","focus:outline-none focus:outline-offset-0","focus-visible:outline-none focus-visible:outline-offset-0","ring-0 focus:ring-0 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none","disabled:cursor-not-allowed")})}),n.jsx("div",{className:"mt-1.5 overflow-hidden origin-left transition-[width] duration-200 ease-out",style:{width:c?"100%":"0%"},"aria-hidden":!0,children:n.jsx("div",{className:"h-px bg-[var(--color-border-tertiary)]"})})]})]})]},e.question)}nn.displayName="UserQuestionCard";function sn({className:e,children:t}){const s=bt(),{scrollContainerRef:a,maxQuestionHeight:r,questions:o}=s;return n.jsx(be,{ref:a,scrollbarVisibility:"auto",maxHeight:r||void 0,className:y("scroll-smooth",e),children:n.jsx("div",{className:"space-y-4 px-3",children:t??o.map((i,l)=>n.jsx(nn,{question:i,qIndex:l},i.question))})})}sn.displayName="UserQuestionCards";function an({className:e}){const t=bt();return n.jsxs("div",{className:y("flex items-center justify-between px-3 py-2",e),children:[n.jsxs(ne,{variant:"ghost",size:"sm",onClick:t.handleRecommend,disabled:t.isSubmitting,children:[t.sparklingIcon,t.labels.recommend]}),n.jsxs("div",{className:"flex items-center gap-2",children:[!t.allQuestionsAnswered&&n.jsx(ne,{variant:"ghost",size:"sm",onClick:t.handleSkip,disabled:t.isSubmitting,children:t.labels.skipAll}),n.jsx(ne,{size:"sm",variant:"secondary",onClick:t.handleContinue,disabled:t.isSubmitting||t.hasCustomText||!t.allQuestionsAnswered,children:t.isSubmitting?t.labels.sending:n.jsxs(n.Fragment,{children:[t.allQuestionsAnswered?t.labels.submit:t.labels.continue,n.jsx("span",{className:"opacity-70",children:" ↵"})]})})]})]})}an.displayName="UserQuestionFooter";function rn(){return n.jsxs(te.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.16,1,.3,1]},className:y("border rounded-t-xl border-b-0 border-border border-border-tertiary bg-bg-base overflow-hidden pt-2 pb-2"),children:[n.jsx(tn,{}),n.jsx(sn,{}),n.jsx(an,{})]})}rn.displayName="UserQuestionDefaultLayout";function fp(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e?.getAttribute("contenteditable")==="true"}function gp({isSubmitting:e,currentQuestion:t,currentOptions:s,currentQuestionIndex:a,questions:r,focusedOptionIndex:o,setFocusedOptionIndex:i,currentQuestionHasAnswer:l,getSelectedOptionIndex:c,setShouldScrollToQuestion:d,setCurrentQuestionIndex:p,handleOptionClick:m,handleContinue:b}){x.useEffect(()=>{const w={ArrowDown(g){if(g.preventDefault(),o<s.length-1)i(o+1);else if(a<r.length-1){const f=a+1;d(!0),p(f),i(c(f))}},ArrowUp(g){if(g.preventDefault(),o>0)i(o-1);else if(a>0){const f=a-1;d(!0),p(f),i(c(f))}},Enter(g){g.preventDefault(),l?b():t&&s[o]&&m(t.question,s[o].label,a)}},u=g=>{if(e||fp(document.activeElement))return;const f=w[g.key];if(f){f(g);return}if(g.key>="1"&&g.key<="9"){const k=parseInt(g.key,10)-1;k>=0&&k<s.length&&t&&(g.preventDefault(),m(t.question,s[k].label,a),i(k))}};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,t,s,a,r.length,o,i,l,c,p,m,b,d])}function xp(){const e=bt();return gp({isSubmitting:e.isSubmitting,currentQuestion:e.currentQuestion,currentOptions:e.currentOptions,currentQuestionIndex:e.currentQuestionIndex,questions:e.questions,focusedOptionIndex:e.focusedOptionIndex,setFocusedOptionIndex:e.setFocusedOptionIndex,currentQuestionHasAnswer:e.currentQuestionHasAnswer,getSelectedOptionIndex:e.getSelectedOptionIndex,setShouldScrollToQuestion:e.setShouldScrollToQuestion,setCurrentQuestionIndex:e.setCurrentQuestionIndex,handleOptionClick:e.handleOptionClick,handleContinue:e.handleContinue}),null}const yi=x.forwardRef(function(t,s){return n.jsxs(en,{ref:s,...t,children:[n.jsx(xp,{}),n.jsx(rn,{})]})});yi.displayName="UserQuestion";const He=yi;He.Root=en;He.Header=tn;He.Card=nn;He.Cards=sn;He.Footer=an;He.DefaultLayout=rn;const hp=He;function yp(e,t){const s=R("chat4","w-4 h-4 shrink-0 text-text-tertiary"),a=R("arrowUpS"),r=R("arrowDownS"),o=R("sparkling","w-4 h-4 mr-1");return n.jsx(en,{ref:t,chat4Icon:s,arrowUpSIcon:a,arrowDownSIcon:r,sparklingIcon:o,...e})}const bi=x.forwardRef(yp);bi.displayName="UserQuestionRoot";const vi=x.forwardRef(function(t,s){const a=R("chat4","w-4 h-4 shrink-0 text-text-tertiary"),r=R("arrowUpS"),o=R("arrowDownS"),i=R("sparkling","w-4 h-4 mr-1");return n.jsx(hp,{ref:s,chat4Icon:a,arrowUpSIcon:r,arrowDownSIcon:o,sparklingIcon:i,...t})});vi.displayName="UserQuestion";const Ue=vi;Ue.Root=bi;Ue.Header=tn;Ue.Card=nn;Ue.Cards=sn;Ue.Footer=an;Ue.DefaultLayout=rn;const bp=Ue,vp={answer:"Answer",answers:"Answers"},kp="w-4 h-4 shrink-0 text-text-tertiary",ki=x.memo(function({answers:t,showHeader:s=!0,labels:a,className:r="",questionAnswerIcon:o}){const i={...vp,...a},l=Object.entries(t),c=o??n.jsx(vc,{className:kp});return l.length===0?null:n.jsxs("div",{className:`rounded-lg border border-border-tertiary bg-bg-container overflow-hidden mx-2 ${r}`.trim(),children:[s&&n.jsxs("div",{className:"flex items-center gap-2 pl-3 pr-3 h-8 border-b border-border-tertiary",children:[c,n.jsx("span",{className:"text-xs leading-xs text-text-tertiary",children:l.length===1?i.answer:i.answers})]}),n.jsx("div",{className:"flex flex-col gap-3 p-3 text-xs leading-xs",children:l.map(([d,p],m)=>n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:"font-medium text-text",children:d}),n.jsx("span",{className:"text-text-tertiary",children:p})]},m))})]})});ki.displayName="UserQuestionAnswer";const wp="w-4 h-4 shrink-0 text-text-tertiary",wi=x.memo(function(t){const s=R("questionAnswer",wp);return n.jsx(ki,{questionAnswerIcon:s,...t})});wi.displayName="UserQuestionAnswer";const Np={title:"In queue",sendNowTip:"Send now",removeTip:"Remove",fileLabel:"file",filesLabel:"files"},jp="w-3.5 h-3.5",Cp="w-3.5 h-3.5",Sp="w-4 h-4 text-text-tertiary transition-transform duration-200",Ip=x.memo(function({item:t,onRemove:s,onSendNow:a,labels:r,arrowUpIcon:o,closeIcon:i}){const l=x.useCallback(m=>{m.stopPropagation(),s?.(t.id)},[t.id,s]),c=x.useCallback(m=>{m.stopPropagation(),a?.(t.id)},[t.id,a]),d=t.attachmentCount??0,p=d===1?r.fileLabel:r.filesLabel;return n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs leading-xs hover:bg-fill-tertiary transition-colors cursor-default",children:[n.jsx("span",{className:"truncate flex-1 text-text",children:t.label}),d>0&&n.jsxs("span",{className:"shrink-0 text-xs leading-xs text-text-tertiary",children:["+",d," ",p]}),n.jsxs("div",{className:"flex items-center gap-0.5",children:[a&&n.jsx(at,{content:r.sendNowTip,side:"top",children:n.jsx(je,{size:"sm",variant:"ghost",icon:o,"aria-label":r.sendNowTip,className:"shrink-0",onClick:c})}),s&&n.jsx(at,{content:r.removeTip,side:"top",children:n.jsx(je,{size:"sm",variant:"ghost",icon:i,"aria-label":r.removeTip,className:"shrink-0",onClick:l})})]})]})}),Ni=x.memo(function({items:t,onRemoveItem:s,onSendNow:a,isStreaming:r=!1,hasStatusCardBelow:o=!1,labels:i,defaultExpanded:l=!0,storageKey:c,arrowUpIcon:d,closeIcon:p,arrowDownSIcon:m}){const b={...Np,...i},w=d??n.jsx(An,{className:jp}),u=p??n.jsx(_e,{className:Cp}),g=m??n.jsx(ye,{className:Sp}),[f,k]=x.useState(()=>{if(typeof window>"u")return l;if(c){const v=localStorage.getItem(c);return v!==null?v==="true":l}return l});if(x.useEffect(()=>{c&&localStorage.setItem(c,String(f))},[c,f]),t.length===0)return null;const h=y("w-full overflow-hidden flex flex-col","border border-b-0 border-border border-border-tertiary bg-bg-base",!o&&"rounded-t-xl");return n.jsxs(te.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:[.16,1,.3,1]},className:h,children:[n.jsx("div",{role:"button",tabIndex:0,onClick:()=>k(!f),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),k(!f))},"aria-expanded":f,"aria-label":`${f?"Collapse":"Expand"} queue`,className:"flex items-center justify-between px-3 py-1 h-7 cursor-pointer bg-fill-tertiary hover:bg-fill-secondary transition-colors duration-150 focus:outline-none",children:n.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[n.jsx("span",{className:y("inline-flex items-center justify-center",!f&&"-rotate-90"),children:g}),n.jsx("span",{className:"text-xs leading-xs font-medium text-text-secondary",children:b.title})]})}),n.jsx(te.AnimatePresence,{initial:!1,children:f&&n.jsx(te.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:[.23,1,.32,1]},className:"overflow-hidden",children:n.jsx(be,{scrollbarVisibility:"auto",maxHeight:208,className:"border-t border-border-tertiary scroll-smooth",children:t.map(v=>n.jsx(Ip,{item:v,onRemove:s,onSendNow:a,labels:b,arrowUpIcon:w,closeIcon:u},v.id))})})})]})});Ni.displayName="QueueIndicator";const Rp="w-3.5 h-3.5",Ap="w-3.5 h-3.5",Ep="w-4 h-4 text-text-tertiary transition-transform duration-200",ji=x.memo(function(t){const s=R("arrowUp",Rp),a=R("close",Ap),r=R("arrowDownS",Ep);return n.jsx(Ni,{arrowUpIcon:s,closeIcon:a,arrowDownSIcon:r,...t})});ji.displayName="QueueIndicator";const Hs="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",Tp="font-['Seti'] shrink-0 inline-flex items-center justify-center w-4 h-4 text-[16px] leading-[16px]",kn={javascript:"",typescript:"",react:"",json:"",html:"",css:"",python:"",java:"",go:"",rust:"",php:"",ruby:"",vue:"",svelte:"",markdown:"",yaml:"",xml:"",shell:"",sass:"",settings:"",default:""},Us={javascript:"#F8CA3E",typescript:"#1E8DEE",react:"#1E8DEE",json:"#F8CA3E",html:"#1E8DEE",css:"#1E8DEE",python:"#1E8DEE",java:"#E84654",go:"#1E8DEE",rust:"#6A89E6",php:"#AE4EE2",ruby:"#E84654",vue:"#4EBD35",svelte:"#E84654",markdown:"#1E8DEE",yaml:"#AE4EE2",xml:"#F18745",shell:"#4EBD35",sass:"#E84654",settings:"#6A89E6",default:"#6A89E6"},Rt={js:"javascript",jsx:"react",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"sass",sass:"sass",less:"css",py:"python",java:"java",go:"go",rs:"rust",php:"php",rb:"ruby",vue:"vue",svelte:"svelte",md:"markdown",yml:"yaml",yaml:"yaml",xml:"xml",sh:"shell",bash:"shell",zsh:"shell",config:"settings",conf:"settings"};function Ci(e,t){let s=null;if(t&&typeof t=="string"&&t.trim()){const a=t.lastIndexOf(".");if(a>0&&a<t.length-1){const r=t.substring(a+1).toLowerCase().trim();r&&Rt[r]&&(s=Rt[r])}}if(!s&&e&&typeof e=="string"&&e.trim()){const a=e.toLowerCase().trim();Rt[a]?s=Rt[a]:kn[a]&&(s=a)}return s||"default"}function Lp(e,t){const s=Ci(e,t);return kn[s]??kn.default}function _p(e,t){const s=Ci(e,t);return Us[s]??Us.default}function Si({files:e=[],defaultExpanded:t=!0,className:s,headerIcon:a,acceptIcon:r,rejectIcon:o,getFileIcon:i}){const[l,c]=x.useState(null),d=n.jsx(Ma,{className:y(Hs,"text-text-secondary")}),p="w-[var(--font-size-sm)] h-[var(--font-size-sm)]",m=n.jsx(Ie,{className:p}),b=n.jsx(_e,{className:p}),w="flex items-center justify-center shrink-0 rounded cursor-pointer transition-colors duration-200 text-text-secondary hover:text-text focus:outline-none focus-visible:ring-2 focus-visible:ring-primary";return n.jsx(Ce,{headerIcon:a??d,headerTitle:n.jsxs("span",{className:"font-normal",children:[e.length," ",e.length===1?"File":"Files"]}),headerRight:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(ne,{variant:"ghost",size:"sm",onClick:u=>u.stopPropagation(),children:"Undo All"}),n.jsx(ne,{variant:"ghost",size:"sm",onClick:u=>u.stopPropagation(),children:"Keep All"}),n.jsx(ne,{variant:"secondary",size:"sm",onClick:u=>u.stopPropagation(),children:"Review"})]}),defaultExpanded:t,contentPadding:"var(--spacing-1\\.5) var(--spacing-1) var(--spacing-1\\.5)",className:s,children:n.jsx("div",{className:"flex flex-col gap-0.5",children:e.map((u,g)=>{const f=l===g,k=u.additions!=null&&Number.isFinite(u.additions)?u.additions:null,h=u.deletions!=null&&Number.isFinite(u.deletions)?u.deletions:null;return n.jsxs("div",{className:y("flex items-center gap-1 px-1 py-1 rounded-sm cursor-pointer transition-colors duration-200 relative h-6",f?"bg-fill-secondary":"bg-transparent"),onMouseEnter:()=>c(g),onMouseLeave:()=>c(null),children:[i?n.jsx("span",{className:y("shrink-0",Hs),children:i(u.fileType,u.filename)}):n.jsx("span",{className:y("shrink-0",Tp),style:{color:_p(u.fileType,u.filename)},"aria-hidden":!0,children:Lp(u.fileType,u.filename)}),n.jsx("span",{className:y("flex-1 text-xs font-medium truncate pr-12",f?"text-text":"text-text-tertiary"),children:u.filename}),n.jsxs("div",{className:y("absolute right-1 flex items-center gap-0.5 text-xs font-medium shrink-0 transition-opacity duration-200",f?"opacity-0 pointer-events-none":"opacity-100"),children:[k!=null&&n.jsxs("span",{className:"text-success",children:["+",k]}),h!=null&&n.jsxs("span",{className:"text-error",children:["-",h]})]}),n.jsxs("div",{className:y("flex items-center gap-0.5 shrink-0 absolute right-1 transition-opacity duration-200",f?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:v=>v.stopPropagation(),children:[n.jsx("button",{type:"button",className:y(w,"h-6 min-w-6 [&_svg]:w-[var(--font-size-sm)] [&_svg]:h-[var(--font-size-sm)]"),title:"Reject","aria-label":"Reject",onClick:v=>v.stopPropagation(),children:o??b}),n.jsx("button",{type:"button",className:y(w,"h-6 min-w-6 [&_svg]:w-[var(--font-size-sm)] [&_svg]:h-[var(--font-size-sm)]"),title:"Accept","aria-label":"Accept",onClick:v=>v.stopPropagation(),children:r??m})]})]},g)})})})}Si.displayName="FileReviewPart";const Vs="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0 text-text-secondary",At="w-[var(--font-size-sm)] h-[var(--font-size-sm)]";function Ii(e){const t=R("requestChanges",Vs)??n.jsx(Ma,{className:Vs}),s=R("checkLine",At)??n.jsx(Ie,{className:At}),a=R("close",At)??n.jsx(_e,{className:At}),r=e.getFileIcon;return n.jsx(Si,{headerIcon:t,acceptIcon:s,rejectIcon:a,getFileIcon:r,...e})}Ii.displayName="FileReviewPart";const vt="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",Pp=n.jsx(Oa,{className:y(vt,"text-text-secondary")}),Fp=n.jsx($a,{className:y(vt,"text-text-tertiary")}),zp=n.jsx(Bt,{className:y(vt,"text-text-quaternary")}),Dp=n.jsx(Ba,{className:y(vt,"text-text-tertiary")}),Mp=n.jsx(Ga,{className:y(vt,"text-text")});function Op(e,t,s){return t?s.loaderIcon??Mp:e.status==="completed"?s.completedIcon??zp:e.status==="skipped"||e.status==="cancelled"?s.skippedIcon??Dp:s.uncompletedIcon??Fp}function Ri({tasks:e=[],title:t="To-dos",currentTaskId:s,defaultExpanded:a=!0,className:r,headerIcon:o,uncompletedIcon:i,completedIcon:l,skippedIcon:c,loaderIcon:d}){return n.jsx(Ce,{headerIcon:o??Pp,headerTitle:n.jsx("span",{className:"text-left",children:t}),defaultExpanded:a,contentPadding:"var(--spacing-1\\.5) var(--spacing-2)",showExpandAllBar:!0,maxHeight:124,className:r,children:n.jsx("div",{className:"flex flex-col gap-2",children:e.map((p,m)=>{const b=p.id??m,w=s!=null&&s===String(b),u=Op(p,w,{loaderIcon:d,completedIcon:l,skippedIcon:c,uncompletedIcon:i});return n.jsxs("div",{className:"flex flex-row gap-2 items-start",children:[n.jsx("div",{className:"flex items-center justify-center shrink-0 pt-0.5 [&>svg]:w-[var(--font-size-sm)] [&>svg]:h-[var(--font-size-sm)]",children:u}),n.jsx("span",{className:y("text-xs leading-xs flex-1 text-left",w?"text-text":p.status==="completed"?"text-text-quaternary line-through":"text-text-tertiary"),children:p.text})]},b)})})})}Ri.displayName="TaskPart";const on="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",qs=`${on} text-text-secondary`,Et=`${on} text-text-tertiary`,Ws=`${on} text-text-quaternary`,Zs=`${on} text-text`;function Ai(e){const t=R("catalog",qs)??n.jsx(Oa,{className:qs}),s=R("circle",Et)??n.jsx($a,{className:Et}),a=R("checkboxCircle",Ws)??n.jsx(Bt,{className:Ws}),r=R("indeterminateCircle",Et)??n.jsx(Ba,{className:Et}),o=R("arrowRightCircleFill",Zs)??n.jsx(Ga,{className:Zs});return n.jsx(Ri,{headerIcon:t,uncompletedIcon:s,completedIcon:a,skippedIcon:r,loaderIcon:o,...e})}Ai.displayName="TaskPart";const hs="w-[var(--font-size-sm)] h-[var(--font-size-sm)] shrink-0",$p=n.jsx(Gt,{className:`${hs} text-text-secondary`}),Bp=n.jsx(Ha,{className:hs}),Gp=n.jsx(Ie,{className:y(hs,"text-success")});function Ei({title:e="Plan",description:t,content:s,viewText:a="View",buildText:r="Build ⌘⏎",builtText:o="Built",isBuilt:i=!1,isGenerating:l=!1,onView:c,onBuild:d,onDownload:p,defaultExpanded:m=!0,contentMaxHeight:b,collapsible:w=!1,className:u,headerIcon:g,downloadIcon:f,builtIcon:k}){const h=s.split(`
252
252
  `),v=h.length>1&&h[1].trim()==="",S=v?h[0]:null,C=v?h.slice(2).join(`
253
253
  `):s;return n.jsx(Ce,{headerIcon:g??$p,headerTitle:n.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:l?n.jsx("span",{className:"text-left",children:"Planning..."}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-left",children:e}),t!=null&&n.jsx("span",{className:"text-left flex-1 truncate text-text-quaternary",children:t})]})}),titleShimmer:l,headerRight:!l&&p?n.jsx(je,{variant:"iconOnly",size:"sm",icon:f??Bp,onClick:T=>{T.stopPropagation(),p?.()},title:"Download as Markdown","aria-label":"Download",className:"!min-h-0 !min-w-0 h-[var(--font-size-sm)] w-[var(--font-size-sm)] text-text-secondary hover:text-text [&_svg]:w-[var(--font-size-sm)] [&_svg]:h-[var(--font-size-sm)]"}):void 0,contentPadding:"var(--spacing-1\\.5) var(--spacing-2)",defaultExpanded:m,contentMaxHeight:b,collapsible:w,footer:l?void 0:n.jsxs(n.Fragment,{children:[n.jsx(ne,{variant:"text",size:"sm",onClick:c,children:a}),n.jsx("div",{className:"flex-1"}),i?n.jsxs("div",{className:"flex items-center gap-1 text-xs text-success [&>svg]:w-[var(--font-size-sm)] [&>svg]:h-[var(--font-size-sm)]",children:[n.jsx("span",{children:o}),k??Gp]}):n.jsx(ne,{variant:"secondary",size:"sm",onClick:d,children:r})]}),className:u,children:l?n.jsxs("div",{className:"flex flex-col gap-1 relative overflow-hidden min-h-[var(--spacing-14)]",children:[n.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, var(--color-text-tertiary) 1px, transparent 1px)",backgroundSize:"16px 16px",backgroundRepeat:"repeat",opacity:.25}}),n.jsx("div",{className:"absolute inset-0 pointer-events-none plan-part-shimmer-layer",style:{backgroundImage:"radial-gradient(circle, var(--color-text-tertiary) 1px, transparent 1px)",backgroundSize:"16px 16px",backgroundRepeat:"repeat",maskImage:"linear-gradient(to bottom, transparent 0%, var(--color-mask-shimmer-weak) 15%, var(--color-mask-shimmer-strong) 30%, var(--color-mask-shimmer-full) 50%, var(--color-mask-shimmer-strong) 70%, var(--color-mask-shimmer-weak) 85%, transparent 100%)",maskSize:"100% 64px",WebkitMaskImage:"linear-gradient(to bottom, transparent 0%, var(--color-mask-shimmer-weak) 15%, var(--color-mask-shimmer-strong) 30%, var(--color-mask-shimmer-full) 50%, var(--color-mask-shimmer-strong) 70%, var(--color-mask-shimmer-weak) 85%, transparent 100%)",WebkitMaskSize:"100% 64px"}}),n.jsx("style",{children:`
254
254
  @keyframes plan-part-shimmer {