@agentatom/design-system 1.4.83 → 1.4.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -63,4 +63,4 @@ import appearance from '@agentatom/design-system/appearance.json';
63
63
 
64
64
  ## Version
65
65
 
66
- `1.4.83` — dual-brand publish from one monorepo commit. Package contents = applicable surface for this brand only.
66
+ `1.4.84` — dual-brand publish from one monorepo commit. Package contents = applicable surface for this brand only.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),T=require("lucide-react"),ne=require("react-dom"),z={1:16,2:20,3:24,4:28,5:48};var Se={exports:{}},ve={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),T=require("lucide-react"),ne=require("react-dom"),W={1:16,2:20,3:24,4:28,5:48};var Se={exports:{}},ve={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -14,9 +14,9 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ce;function it(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===L?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case w:return"Fragment";case k:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case y:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case g:return"Portal";case j:return p.displayName||"Context";case R:return(p._context.displayName||"Context")+".Consumer";case _:var v=p.render;return p=p.displayName,p||(p=v.displayName||v.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case P:return v=p.displayName||null,v!==null?v:t(p.type)||"Memo";case F:v=p._payload,p=p._init;try{return t(p(v))}catch{}}return null}function s(p){return""+p}function n(p){try{s(p);var v=!1}catch{v=!0}if(v){v=console;var A=v.error,M=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return A.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",M),s(p)}}function a(p){if(p===w)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===F)return"<...>";try{var v=t(p);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function r(){var p=O.A;return p===null?null:p.getOwner()}function o(){return Error("react-stack-top-frame")}function i(p){if(q.call(p,"key")){var v=Object.getOwnPropertyDescriptor(p,"key").get;if(v&&v.isReactWarning)return!1}return p.key!==void 0}function l(p,v){function A(){B||(B=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}A.isReactWarning=!0,Object.defineProperty(p,"key",{get:A,configurable:!0})}function d(){var p=t(this.type);return $[p]||($[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function f(p,v,A,M,Z,re){var H=A.ref;return p={$$typeof:b,type:p,key:v,props:A,_owner:M},(H!==void 0?H:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:d}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,v,A,M,Z,re){var H=v.children;if(H!==void 0)if(M)if(V(H)){for(M=0;M<H.length;M++)h(H[M]);Object.freeze&&Object.freeze(H)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(H);if(q.call(v,"key")){H=t(p);var K=Object.keys(v).filter(function(he){return he!=="key"});M=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",W[H+M]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Ce;function it(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===L?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case w:return"Fragment";case k:return"Profiler";case y:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case R:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case N:return"Portal";case g:return p.displayName||"Context";case E:return(p._context.displayName||"Context")+".Consumer";case _:var v=p.render;return p=p.displayName,p||(p=v.displayName||v.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case P:return v=p.displayName||null,v!==null?v:t(p.type)||"Memo";case F:v=p._payload,p=p._init;try{return t(p(v))}catch{}}return null}function s(p){return""+p}function n(p){try{s(p);var v=!1}catch{v=!0}if(v){v=console;var A=v.error,M=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return A.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",M),s(p)}}function a(p){if(p===w)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===F)return"<...>";try{var v=t(p);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function r(){var p=z.A;return p===null?null:p.getOwner()}function o(){return Error("react-stack-top-frame")}function i(p){if(q.call(p,"key")){var v=Object.getOwnPropertyDescriptor(p,"key").get;if(v&&v.isReactWarning)return!1}return p.key!==void 0}function l(p,v){function A(){B||(B=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}A.isReactWarning=!0,Object.defineProperty(p,"key",{get:A,configurable:!0})}function d(){var p=t(this.type);return $[p]||($[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function f(p,v,A,M,Z,re){var H=A.ref;return p={$$typeof:b,type:p,key:v,props:A,_owner:M},(H!==void 0?H:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:d}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Z}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:re}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,v,A,M,Z,re){var H=v.children;if(H!==void 0)if(M)if(V(H)){for(M=0;M<H.length;M++)h(H[M]);Object.freeze&&Object.freeze(H)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(H);if(q.call(v,"key")){H=t(p);var K=Object.keys(v).filter(function(he){return he!=="key"});M=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",O[H+M]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,M,H,K,H),W[H+M]=!0)}if(H=null,A!==void 0&&(n(A),H=""+A),i(v)&&(n(v.key),H=""+v.key),"key"in v){A={};for(var ie in v)ie!=="key"&&(A[ie]=v[ie])}else A=v;return H&&l(A,typeof p=="function"?p.displayName||p.name||"Unknown":p),f(p,H,A,r(),Z,re)}function h(p){x(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===F&&(p._payload.status==="fulfilled"?x(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function x(p){return typeof p=="object"&&p!==null&&p.$$typeof===b}var m=c,b=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),j=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),O=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,V=Array.isArray,N=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(p){return p()}};var B,$={},X=m.react_stack_bottom_frame.bind(m,o)(),U=N(a(o)),W={};be.Fragment=w,be.jsx=function(p,v,A){var M=1e4>O.recentlyCreatedOwnerStacks++;return u(p,v,A,!1,M?Error("react-stack-top-frame"):X,M?N(a(p)):U)},be.jsxs=function(p,v,A){var M=1e4>O.recentlyCreatedOwnerStacks++;return u(p,v,A,!0,M?Error("react-stack-top-frame"):X,M?N(a(p)):U)}}()),be}process.env.NODE_ENV==="production"?Se.exports=ot():Se.exports=it();var e=Se.exports;const _e={close:"Close",closeModal:"Close modal",closeAlert:"Close alert",dismiss:"Dismiss",loading:"Loading",next:"Next",back:"Back",skipTour:"Skip tour",done:"Done",previousPage:"Previous page",nextPage:"Next page",pagination:"Pagination",pageN:"Page {n}",breadcrumb:"Breadcrumb",recents:"Recents",steps:"Steps",stepN:"Step {n}",stepOf:"Step {current} of {total}",copyToClipboard:"Copy to clipboard",selectOption:"Select option",like:"Like",dislike:"Dislike",removeImage:"Remove image",attachFiles:"Attach files",stop:"Stop",send:"Send",toggleVisibility:"Toggle visibility",decrease:"Decrease",increase:"Increase",sources:"Sources",moreSources:"+{n} more sources",pageAbbrev:"p. {pages}",code:"Code",promptPlaceholder:"Let's get things done...",dropFilesHere:"Drop files here",fileTooLarge:"File(s) too large{maxHint}: {names}",fileTooLargeMaxHint:" (max {maxMb}MB)",filesSkipped:"Skipped unsupported file(s): {names}",maxImages:"Max {n} images per message",uploading:"Uploading...",removeAttachment:"Remove attachment"};function Ae(t,s={}){return typeof t=="function"?t(s):typeof t!="string"?"":t.replace(/\{(\w+)\}/g,(n,a)=>s[a]!==void 0&&s[a]!==null?String(s[a]):"")}const Ie=c.createContext({strings:_e,t:(t,s)=>Ae(_e[t]??t,s)});function lt({strings:t,children:s}){const n=c.useMemo(()=>{const a={..._e,...t};return{strings:a,t:(r,o)=>Ae(a[r]??_e[r]??r,o)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function me(){return c.useContext(Ie)}function Y(){return c.useContext(Ie).strings}function Xe({size:t="m",color:s="default",className:n="","aria-label":a,...r}){const o=Y();return e.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${s}`,n].filter(Boolean).join(" "),role:"status","aria-label":a??o.loading,...r})}const ct={xs:12,s:14,m:16,l:20};function se({children:t,variant:s="primary",size:n="m",fullWidth:a=!1,icon:r,disabled:o=!1,state:i="idle",onClick:l,type:d="button",href:f,"aria-label":u,className:h="",...x}){const m=r&&!t,b=i==="loading",g=i==="success",w=i==="error",E=b||g||w,k=n==="xs"?"s":"m",R=s==="danger"?"on-accent":"default",j=ct[n]??16,_=b?e.jsx(Xe,{size:k,color:R}):g?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(T.Check,{size:j,strokeWidth:2.5})}):w?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(T.X,{size:j,strokeWidth:2.5})}):null,I=["ds-button",`ds-button--${s}`,`ds-button--${n}`,a&&"ds-button--full",m&&"ds-button--icon-only",h].filter(Boolean).join(" "),D=i!=="idle"?i:void 0,P=e.jsxs(e.Fragment,{children:[E?_:r&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:r}),t]});if(f){const F=y=>{if(o||b){y.preventDefault();return}y.metaKey||y.ctrlKey||y.button===1||(y.preventDefault(),l==null||l(y))};return e.jsx("a",{className:I,href:o||b?void 0:f,onClick:F,"aria-label":u,"aria-disabled":o||b?"true":void 0,"aria-busy":b?"true":void 0,"data-state":D,...x,children:P})}return e.jsx("button",{type:d,className:I,disabled:o,onClick:b?void 0:l,"aria-label":u,"aria-busy":b?"true":void 0,"data-state":D,...x,children:P})}function dt({label:t,error:s,hint:n,fullWidth:a=!0,icon:r,iconRight:o,onIconRightClick:i,size:l="m",disabled:d,id:f,iconRightLabel:u,...h}){const x=Y(),m=f||`input-${c.useId()}`,b=n?`${m}-hint`:void 0,g=s?`${m}-error`:void 0,w=g||b;return e.jsxs("div",{className:`ds-input-wrapper ${a?"ds-input-wrapper--full":""} ${d?"ds-input-wrapper--disabled":""} ${s?"ds-input-wrapper--error":""}`,children:[t&&e.jsx("label",{className:"ds-input-label",htmlFor:m,children:t}),e.jsxs("div",{className:"ds-input-container",children:[r&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:r}),e.jsx("input",{id:m,className:`ds-input ds-input--${l} ${r?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":w,...h}),o&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":u??x.toggleVisibility,children:o})]}),n&&!s&&e.jsx("span",{id:b,className:"ds-input-hint",children:n}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:s&&e.jsx("span",{id:g,className:"ds-input-error",role:"alert",children:s})})})]})}function ut({label:t,error:s,hint:n,fullWidth:a=!0,size:r="m",disabled:o,id:i,resize:l=!0,rows:d=3,...f}){const u=i||`textarea-${c.useId()}`,h=n?`${u}-hint`:void 0,x=s?`${u}-error`:void 0,m=x||h;return e.jsxs("div",{className:`ds-textarea-wrapper ${a?"ds-textarea-wrapper--full":""} ${o?"ds-textarea-wrapper--disabled":""}`,children:[t&&e.jsx("label",{className:"ds-textarea-label",htmlFor:u,children:t}),e.jsx("textarea",{id:u,className:`ds-textarea ds-textarea--${r} ${s?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":m,rows:d,...f}),n&&!s&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:s})]})}function ft({label:t,value:s,onChange:n,options:a=[],placeholder:r,error:o,fullWidth:i=!0,size:l="m",disabled:d=!1,id:f,...u}){const h=Y(),x=r??h.selectOption,[m,b]=c.useState(!1),[g,w]=c.useState(!1),[E,k]=c.useState({}),[R,j]=c.useState("down"),[_,I]=c.useState(-1),D=c.useRef(null),P=c.useRef(null),F=c.useRef(null),y=c.useRef(null),L=f||`select-${c.useId()}`,O=`${L}-label`,q=o?`${L}-error`:void 0,V=150,N=(v=!1)=>{g||(w(!0),I(-1),y.current=setTimeout(()=>{var A;b(!1),w(!1),v&&((A=F.current)==null||A.focus())},V))},B=v=>{clearTimeout(y.current),w(!1);const A=v!==void 0?v:Math.max(a.findIndex(M=>M.value===s),0);I(A),b(!0)};c.useEffect(()=>()=>clearTimeout(y.current),[]);const $=()=>{var K;const v=(K=D.current)==null?void 0:K.getBoundingClientRect();if(!v)return;const A=window.innerHeight,M=A-v.bottom,Z=v.top,H=M<300&&Z>M;j(H?"up":"down"),k(H?{bottom:A-v.top+4,left:v.left,width:v.width}:{top:v.bottom+4,left:v.left,width:v.width})};c.useEffect(()=>{if(m)return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[m]),c.useEffect(()=>{const v=A=>{D.current&&!D.current.contains(A.target)&&P.current&&!P.current.contains(A.target)&&N()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[g]),c.useEffect(()=>{var A;if(!m||_<0||!P.current)return;(A=P.current.querySelectorAll(".ds-select-option")[_])==null||A.scrollIntoView({block:"nearest"})},[_,m]);const X=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),m?I(A=>Math.min(A+1,a.length-1)):B();break;case"ArrowUp":v.preventDefault(),m?I(A=>Math.max(A-1,0)):B(a.length-1);break;case"Home":m&&(v.preventDefault(),I(0));break;case"End":m&&(v.preventDefault(),I(a.length-1));break;case"Enter":case" ":v.preventDefault(),m?_>=0&&(n==null||n(a[_].value),N(!0)):B();break;case"Escape":m&&(v.preventDefault(),N(!0));break;case"Tab":m&&N(!1);break}},U=a.find(v=>v.value===s),W=l==="xs"?z[1]:l==="small"?z[2]:z[3],p=m&&e.jsx("div",{ref:P,"data-ds-portal":"",role:"listbox","aria-labelledby":t?O:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${R}`,g&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:E,children:a.map((v,A)=>e.jsx("button",{id:`${L}-opt-${A}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===v.value,className:["ds-select-option",`ds-select-option--${l}`,s===v.value&&"ds-select-option--selected",A===_&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(v.value),N(!0)},children:v.label},v.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${d?"ds-select-wrapper--disabled":""}`,children:[t&&e.jsx("label",{id:O,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:D,children:e.jsxs("button",{ref:F,type:"button",id:L,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&_>=0?`${L}-opt-${_}`:void 0,"aria-labelledby":t?O:void 0,"aria-invalid":o?"true":"false","aria-describedby":q,className:`ds-select-trigger ds-select-trigger--${l} ${o?"ds-select-trigger--error":""}`,onClick:()=>{d||(m?N():B())},onKeyDown:X,disabled:d,...u,children:[e.jsx("span",{className:U?"":"ds-select-placeholder",children:(U==null?void 0:U.label)||x}),e.jsx(T.ChevronDown,{size:W,strokeWidth:1.5,className:`ds-select-icon ${m&&R==="down"?"ds-select-icon--open":""} ${m&&R==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),o&&e.jsx("span",{id:q,className:"ds-select-error",role:"alert",children:o}),typeof document<"u"&&ne.createPortal(p,document.body)]})}function mt({label:t,value:s=0,onChange:n,min:a=0,max:r=100,step:o=1,size:i="m",disabled:l=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:h,...x}){const m=Y(),b=()=>{if(l)return;const j=Math.min(Number(s)+o,r);n==null||n(j)},g=()=>{if(l)return;const j=Math.max(Number(s)-o,a);n==null||n(j)},w=j=>{if(l)return;const _=j.target.value;if(_===""){n==null||n(a);return}const I=Number(_);if(!isNaN(I)){const D=Math.min(Math.max(I,a),r);n==null||n(D)}},E=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),k=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),R=i==="xs"?z[1]:i==="small"?z[2]:z[3];return e.jsxs("div",{className:E,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:k,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:g,disabled:l||s<=a,"aria-label":u??m.decrease,children:e.jsx(T.Minus,{size:R,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:w,min:a,max:r,step:o,disabled:l,...x}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:b,disabled:l||s>=r,"aria-label":h??m.increase,children:e.jsx(T.Plus,{size:R,strokeWidth:1.5})})]}),d&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:d}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function pt({children:t,padding:s="m",variant:n="default",hover:a=!1,onClick:r,href:o,disabled:i=!1,className:l="",...d}){const u=(a?"interactive":n)==="interactive"||r||o,h=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",l].filter(Boolean).join(" ");if(o){const b=g=>{if(i){g.preventDefault();return}g.metaKey||g.ctrlKey||g.button===1||(g.preventDefault(),r==null||r(g))};return e.jsx("a",{className:h,href:i?void 0:o,onClick:b,"aria-disabled":i?"true":void 0,...d,children:t})}const x=u&&r?"button":"div",m=u&&r?{type:"button",onClick:r,disabled:i}:{};return e.jsx(x,{className:h,role:u&&!r?"article":void 0,...m,...d,children:t})}function ht({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function xt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function vt({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function bt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function _t({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Ye({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p2 ${s?"ds-p2--secondary":""}`,...n,children:t})}function Be({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p3 ${s?"ds-p3--secondary":""}`,...n,children:t})}function ce({children:t,variant:s="default",size:n="m",role:a,...r}){const o=["ds-badge",`ds-badge--${s}`,`ds-badge--${n}`].filter(Boolean).join(" "),i=a||(["info","success","warning","error"].includes(s)?"status":void 0);return e.jsx("span",{className:o,role:i,...r,children:t})}const jt={info:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle},gt=c.forwardRef(function({children:s,variant:n="info",title:a,onClose:r,role:o,closeLabel:i,...l},d){const f=Y(),u=jt[n],h=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${a?"":"ds-alert--no-title"}`,role:h,...l,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:z[3],strokeWidth:1.5})}),e.jsxs("div",{className:"ds-alert__content",children:[a&&e.jsx("div",{className:"ds-alert__title",children:a}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),r&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:r,"aria-label":i??f.closeAlert,children:e.jsx(T.X,{size:z[3],strokeWidth:1.5})})]})}),Nt=200;function wt({children:t,title:s,onClose:n,size:a="m",scrollable:r=!1,subHeader:o,closeLabel:i,...l}){const d=Y(),f=c.useRef(null),u=c.useId(),[h,x]=c.useState(!1),m=()=>{!n||h||(x(!0),setTimeout(()=>{x(!1),n()},Nt))};c.useEffect(()=>{const k=j=>{j.key==="Escape"&&m()},R=j=>{var I,D,P;const _=((D=(I=j.composedPath)==null?void 0:I.call(j))==null?void 0:D[0])??j.target;f.current&&!f.current.contains(_)&&!((P=_.closest)!=null&&P.call(_,"[data-ds-portal]"))&&m()};return document.addEventListener("keydown",k),document.addEventListener("mousedown",R),()=>{document.removeEventListener("keydown",k),document.removeEventListener("mousedown",R)}},[n,h]);const b=c.Children.toArray(t),g=b.find(k=>(k==null?void 0:k.type)===de),w=b.filter(k=>(k==null?void 0:k.type)!==de),E=e.jsx("div",{className:["ds-modal-overlay",h&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,children:e.jsxs("div",{className:[`ds-modal ds-modal--${a}`,r&&"ds-modal--scrollable"].filter(Boolean).join(" "),ref:f,role:"dialog","aria-modal":"true","aria-labelledby":s?u:void 0,children:[n&&e.jsx(se,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(T.X,{size:z[2],strokeWidth:1.5}),onClick:m,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:u,className:"ds-modal__title",children:s}),o&&e.jsx("div",{className:"ds-modal__subheader",children:o})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:w}),g]})});return typeof document>"u"?E:ne.createPortal(E,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const yt=320;function kt({children:t,title:s,onClose:n,subHeader:a,closeLabel:r,...o}){const i=Y(),l=c.useRef(null),d=c.useId(),[f,u]=c.useState(!1),h=()=>{!n||f||(u(!0),setTimeout(()=>{u(!1),n()},yt))};c.useEffect(()=>{const w=k=>{k.key==="Escape"&&h()},E=k=>{var j,_,I;const R=((_=(j=k.composedPath)==null?void 0:j.call(k))==null?void 0:_[0])??k.target;l.current&&!l.current.contains(R)&&!((I=R.closest)!=null&&I.call(R,"[data-ds-portal]"))&&h()};return document.addEventListener("keydown",w),document.addEventListener("mousedown",E),()=>{document.removeEventListener("keydown",w),document.removeEventListener("mousedown",E)}},[n,f]);const x=c.Children.toArray(t),m=x.find(w=>(w==null?void 0:w.type)===de),b=x.filter(w=>(w==null?void 0:w.type)!==de),g=e.jsx("div",{className:["ds-bottom-sheet-overlay",f&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,children:e.jsxs("div",{ref:l,className:["ds-bottom-sheet",f&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":s?d:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),n&&e.jsx(se,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(T.X,{size:z[2],strokeWidth:1.5}),onClick:h,"aria-label":r??i.close}),(s||a)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:d,className:"ds-bottom-sheet__title",children:s}),a&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:a})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:b}),m]})});return typeof document>"u"?g:ne.createPortal(g,document.body)}function qe({children:t,title:s,defaultExpanded:n=!1,expanded:a,onToggle:r,padding:o="s",className:i="",...l}){const d=Y(),f=s??d.code,[u,h]=c.useState(n),x=a!==void 0,m=x?a:u,b=()=>{x?r==null||r(!a):h(w=>!w)},g=["ds-code-accordion",`ds-code-accordion--${o}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:g,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:b,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(T.ChevronDown,{size:z[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre ds-scrollable",children:e.jsx("code",{children:t})})})})]})}function Et({children:t,block:s=!1,collapsible:n=!1,title:a,defaultExpanded:r=!1,...o}){const i=Y(),l=a??i.code;return s?n?e.jsx(qe,{title:l,defaultExpanded:r,...o,children:t}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...o,children:e.jsx("code",{children:t})}):e.jsx("code",{className:"ds-code-inline",...o,children:t})}function Rt({href:t,children:s,onClick:n,target:a,rel:r,...o}){const l=a==="_blank"?r?`${r} noopener noreferrer`:"noopener noreferrer":r;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:a,rel:l,...o,children:s})}function St({children:t,size:s="m",variant:n="ghost",...a}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...a,children:c.Children.map(t,r=>c.isValidElement(r)?c.cloneElement(r,{size:s,variant:n}):r)})}function Tt({children:t,selected:s=!1,onClick:n,size:a="m",variant:r="ghost",disabled:o=!1,icon:i,href:l,...d}){const f=i&&!t,u=["ds-tab",`ds-tab--${a}`,`ds-tab--${r}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const x=m=>{if(o){m.preventDefault();return}m.metaKey||m.ctrlKey||m.button===1||(m.preventDefault(),n==null||n(m))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":o?"true":void 0,className:u,href:o?void 0:l,onClick:x,...d,children:h})}return e.jsx("button",{role:"tab","aria-selected":s,className:u,onClick:n,disabled:o,...d,children:h})}function $t({options:t,value:s,onChange:n,size:a="m",disabled:r=!1}){const o=c.useRef(null),i=c.useRef(null),[l,d]=c.useState(!1),f=c.useRef(!1),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!o.current)return;const m=o.current.querySelector(`[data-value="${s}"]`);if(!m)return;const b=o.current.getBoundingClientRect(),g=m.getBoundingClientRect(),w=g.left-b.left,E=g.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=w+"px",i.current.style.width=E+"px",f.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const k=o.current.querySelector(`[data-value="${s}"]`);if(!k)return;const R=o.current.getBoundingClientRect(),j=k.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=j.left-R.left+"px",i.current.style.width=j.width+"px"}))};return h.current=x,c.useLayoutEffect(()=>{const m=u.current!==s;u.current=s,f.current=l&&m,x()}),c.useEffect(()=>{if(!o.current)return;const m=new ResizeObserver(()=>{f.current=!1,h.current()});return m.observe(o.current),()=>m.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${a}`,r&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:o,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(m=>e.jsxs("button",{type:"button","data-value":m.value,className:["ds-seg__btn",s===m.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!r&&n(m.value),"aria-pressed":s===m.value,disabled:r,children:[m.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:m.icon}),m.label]},m.value))]})}function Ne({children:t,title:s,defaultExpanded:n=!1,expanded:a,onToggle:r,padding:o="m",...i}){const[l,d]=c.useState(n),f=a!==void 0,u=f?a:l,h=()=>{f?r==null||r(!a):d(m=>!m)},x=["ds-accordion",`ds-accordion--${o}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:h,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(T.ChevronDown,{size:z[2],strokeWidth:1.5,className:`ds-accordion__icon ${u?"ds-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-accordion__content",children:e.jsx("div",{className:"ds-accordion__content-inner",children:e.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const ae=8,ue=8;function At(t,s,n){const a=window.innerWidth;let r,o;switch(t){case"top":r=s.top-n.height-ae,o=s.left+s.width/2-n.width/2;break;case"bottom":r=s.bottom+ae,o=s.left+s.width/2-n.width/2;break;case"left":r=s.top+s.height/2-n.height/2,o=s.left-n.width-ae;break;case"right":r=s.top+s.height/2-n.height/2,o=s.right+ae;break;default:r=s.bottom+ae,o=s.left}const i=Math.max(ue,Math.min(a-n.width-ue,o)),l=o-i;return{top:r,left:i,arrowOffset:l}}function It(t,s,n){const a=window.innerWidth,r=window.innerHeight;if(t.top>=s+ae+ue)return"top";if(r-t.bottom>=s+ae+ue)return"bottom";if(a-t.right>=n+ae+ue)return"right";if(t.left>=n+ae+ue)return"left";const o=Math.max(t.top,r-t.bottom,t.left,a-t.right);return o===t.top?"top":o===r-t.bottom?"bottom":o===a-t.right?"right":"left"}function we({children:t,content:s,position:n,...a}){const[r,o]=c.useState(!1),[i,l]=c.useState({visibility:"hidden"}),[d,f]=c.useState(n||"top"),u=c.useRef(null),h=c.useRef(null),x=c.useRef(!1),m=()=>{if(!u.current||!h.current)return;const g=u.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),E=n||It(g,w.height,w.width),{top:k,left:R,arrowOffset:j}=At(E,g,w);f(E),l({position:"fixed",top:k,left:R,visibility:"visible","--arrow-offset":`${j}px`})};if(c.useEffect(()=>{if(!r)return;l({position:"fixed",visibility:"hidden"});const g=requestAnimationFrame(m);return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(g),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[r,n]),c.useEffect(()=>{if(!r)return;const g=w=>{u.current&&!u.current.contains(w.target)&&o(!1)};return document.addEventListener("touchstart",g),()=>document.removeEventListener("touchstart",g)},[r]),!s)return t;const b=r&&e.jsx("div",{ref:h,"data-ds-portal":"",className:`ds-tooltip ds-tooltip--${d}`,role:"tooltip",style:i,children:s});return e.jsxs("div",{ref:u,className:"ds-tooltip-wrapper",onMouseEnter:()=>{x.current||o(!0)},onMouseLeave:()=>{x.current||o(!1)},onTouchStart:()=>{x.current=!0,o(g=>!g)},...a,children:[t,typeof document<"u"&&ne.createPortal(b,document.body)]})}function Bt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,id:o,...i}){const l=o||`toggle-${c.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,a&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:t,onChange:f=>s==null?void 0:s(f.target.checked),disabled:a,...i}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),r&&e.jsx("span",{className:"ds-toggle__label",children:r})]})}function Dt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,id:o,...i}){const l=o||`checkbox-${c.useId()}`,d=["ds-checkbox",`ds-checkbox--${n}`,a&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=n==="xs"?10:n==="small"?14:n==="large"?20:16;return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:t,onChange:u=>s==null?void 0:s(u.target.checked),disabled:a,...i}),e.jsx("span",{className:"ds-checkbox__box",children:t&&e.jsx(T.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),r&&e.jsx("span",{className:"ds-checkbox__label",children:r})]})}function Pt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,name:o,value:i,id:l,...d}){const f=l||`radio-${c.useId()}`,u=["ds-radio",`ds-radio--${n}`,a&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:u,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:h=>s==null?void 0:s(h.target.checked),disabled:a,name:o,value:i,...d}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),r&&e.jsx("span",{className:"ds-radio__label",children:r})]})}function Ge({width:t,height:s,shape:n="rect",aspectRatio:a,className:r="",style:o={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${n}`,r].filter(Boolean).join(" "),style:{width:t,height:s,aspectRatio:a,...o},"aria-hidden":"true",...i})}function Lt({lines:t=1,lastLineWidth:s="70%",gap:n,className:a="",style:r={},...o}){return e.jsx("span",{className:["ds-skeleton-text",a].filter(Boolean).join(" "),style:{gap:n,...r},"aria-hidden":"true",...o,children:Array.from({length:t},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===t-1&&t>1?{width:s}:void 0},l))})}Ge.Text=Lt;function Ct(t){let s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s%360}function Mt(t){if(!t)return"";const s=t.trim().split(/\s+/);return s.length>=2?(s[0][0]+s[1][0]).toUpperCase():t[0].toUpperCase()}function Ft({seed:t,icon:s,src:n,size:a=32,className:r="",style:o={},...i}){const l=Ct(t??""),[d,f]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Mt(t)});return e.jsx("div",{className:["ds-avatar",r].filter(Boolean).join(" "),style:{width:a,height:a,"--ds-avatar-h":l,...o},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function zt({children:t,size:s="compact",stickyTop:n,maxHeight:a,className:r="",style:o={},...i}){const l={...a?{maxHeight:a}:{},...n!==void 0?{"--ds-table-sticky-top":typeof n=="number"?`${n}px`:n}:{},...o};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",a?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,r].filter(Boolean).join(" "),...i,children:t})})}function Wt({children:t,...s}){return e.jsx("thead",{...s,children:t})}function Ot({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function Ut({children:t,interactive:s,selected:n,subheader:a,exiting:r,updated:o,className:i="",onClick:l,...d}){return e.jsx("tr",{className:["ds-table-row",s||l?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",a?"ds-table-row--subheader":"",r?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...d,children:t})}function Ht({children:t,colSpan:s=999,...n}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...n,children:e.jsx("td",{colSpan:s,children:t})})}function Vt({children:t,align:s="left",sortDir:n,onSort:a,width:r,className:o="",style:i={},...l}){const d=!!a||n!==void 0,f=n==="asc"?T.ChevronUp:n==="desc"?T.ChevronDown:T.ChevronsUpDown;return e.jsx("th",{className:["ds-th",d?"ds-th--sortable":"",n?"ds-th--sorted":"",s!=="left"?`ds-table-cell--${s}`:"",o].filter(Boolean).join(" "),onClick:a,style:{width:r,...i},...l,children:d?e.jsxs("span",{className:"ds-th__inner",children:[t,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function Xt({children:t,align:s="left",secondary:n,muted:a,truncate:r,nowrap:o,className:i="",...l}){return e.jsx("td",{className:["ds-td",s!=="left"?`ds-table-cell--${s}`:"",n?"ds-table-cell--secondary":"",a?"ds-table-cell--muted":"",r?"ds-table-cell--truncate":"",o?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:t})}function Yt({icon:t,title:s,description:n,action:a,size:r="m",className:o="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${r}`,o].filter(Boolean).join(" "),...i,children:[t&&e.jsx("div",{className:"ds-empty-state__icon",children:t}),e.jsx("div",{className:"ds-empty-state__title",children:s}),n&&e.jsx("div",{className:"ds-empty-state__description",children:n}),a&&e.jsx("div",{className:"ds-empty-state__action",children:a})]})}function qt({label:t,hint:s,error:n,required:a=!1,disabled:r=!1,htmlFor:o,children:i,className:l="",style:d,...f}){const u=c.useId(),h=o??u,x=`${h}-hint`,m=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":n?"error":void 0,"data-required":a?"":void 0,"data-disabled":r?"":void 0,style:d,...f,children:[t&&e.jsx("label",{className:"ds-field-label",htmlFor:h,children:t}),e.jsx("div",{className:"ds-field-control",children:i}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:x,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:m,role:"alert",children:n})]})}function Gt({label:t,value:s,delta:n,size:a="m",inline:r=!1,className:o="",style:i,...l}){const d=n!=null&&n.startsWith("+")?"up":n!=null&&n.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${a}`,r&&"ds-stat--inline",o].filter(Boolean).join(" "),style:i,...l,children:[t&&e.jsx("span",{className:"ds-stat-label",children:t}),s!=null&&e.jsx("span",{className:"ds-stat-value",children:s}),n!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${d}`,children:n})]})}function Kt({children:t,separator:s="/","aria-label":n,className:a="",style:r,...o}){const i=Y(),l=c.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${a?` ${a}`:""}`,"aria-label":n??i.breadcrumb,style:r,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:l.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<l.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function Jt({page:t,total:s,onChange:n,siblings:a=1,"aria-label":r,previousLabel:o,nextLabel:i,className:l="",style:d,...f}){const u=Y(),{t:h}=me(),x=Zt(t,s,a);return e.jsxs("nav",{className:`ds-pagination${l?` ${l}`:""}`,"aria-label":r??u.pagination,style:d,...f,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t-1),disabled:t<=1,"aria-label":o??u.previousPage,children:e.jsx(T.ChevronLeft,{size:16})}),x.map((m,b)=>m==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${b}`):e.jsx("button",{className:`ds-pagination-page${m===t?" ds-pagination-page--current":""}`,onClick:()=>m!==t&&(n==null?void 0:n(m)),"aria-current":m===t?"page":void 0,"aria-label":h("pageN",{n:m}),children:m},m)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t+1),disabled:t>=s,"aria-label":i??u.nextPage,children:e.jsx(T.ChevronRight,{size:16})})]})}function Zt(t,s,n){if(s<=7)return Array.from({length:s},(i,l)=>l+1);const a=Math.max(2,t-n),r=Math.min(s-1,t+n),o=[1];a>2&&o.push("…");for(let i=a;i<=r;i++)o.push(i);return r<s-1&&o.push("…"),o.push(s),o}const Qt=300;function es({children:t,title:s,onClose:n,subHeader:a,side:r="right",size:o="wide",offsetLeft:i=0,offsetRight:l=0,keepOpenRef:d,closeLabel:f,...u}){const h=Y(),x=c.useRef(null),m=c.useId(),[b,g]=c.useState(!1),w=()=>{!n||b||(g(!0),setTimeout(()=>{g(!1),n()},Qt))};c.useEffect(()=>{const _=D=>{D.key==="Escape"&&w()},I=D=>{var F,y,L,O;const P=((y=(F=D.composedPath)==null?void 0:F.call(D))==null?void 0:y[0])??D.target;(L=d==null?void 0:d.current)!=null&&L.contains(P)||x.current&&!x.current.contains(P)&&!((O=P.closest)!=null&&O.call(P,"[data-ds-portal]"))&&w()};return document.addEventListener("keydown",_),document.addEventListener("mousedown",I),()=>{document.removeEventListener("keydown",_),document.removeEventListener("mousedown",I)}},[n,b,d]);const E=c.Children.toArray(t),k=E.find(_=>(_==null?void 0:_.type)===Te||(_==null?void 0:_.type)===de),R=E.filter(_=>(_==null?void 0:_.type)!==Te&&(_==null?void 0:_.type)!==de),j=e.jsx("div",{className:["ds-side-page-overlay",b&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":r,style:{"--ds-side-page-offset-left":`${i}px`,"--ds-side-page-offset-right":`${l}px`},...u,children:e.jsxs("div",{ref:x,className:["ds-side-page",b&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-side":r,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,children:[n&&e.jsx(se,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(T.X,{size:z[2],strokeWidth:1.5}),onClick:w,"aria-label":f??h.close}),(s||a)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:m,className:"ds-side-page__title",children:s}),a&&e.jsx("div",{className:"ds-side-page__subheader",children:a})]}),e.jsx("div",{className:"ds-side-page__body ds-scrollable",children:R}),k]})});return typeof document>"u"?j:ne.createPortal(j,document.body)}function Te({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=c.createContext({collapsed:!1,side:"left"}),ye=c.createContext(!1),ts=c.forwardRef(function({children:s,collapsed:n=!1,side:a="left",onExpand:r,onCollapse:o,className:i="",...l},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${a}`,i].filter(Boolean).join(" "),u=c.useCallback(h=>{if(!h.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')){if(n&&r){r();return}!n&&o&&o()}},[n,r,o]);return e.jsx(pe.Provider,{value:{collapsed:n,side:a},children:e.jsx("nav",{ref:d,className:f,onClick:u,"data-expandable":n&&r?"":void 0,"data-collapsible":!n&&o?"":void 0,...l,children:s})})});function ss({icon:t,label:s,selected:n=!1,disabled:a=!1,href:r,onClick:o,count:i,updated:l=!1,open:d=!1,onboarding:f=!1,className:u="",...h}){const{collapsed:x,side:m}=c.useContext(pe),b=c.useContext(ye),E={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:a?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":a?"true":void 0,"aria-label":x?s:void 0,tabIndex:a?-1:void 0,...{"data-selected":n||void 0,"data-disabled":a||void 0,"data-open":d||void 0,"data-onboarding":f||void 0},...h},k=i!=null,R=m==="left"?"right":"left",j=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!x&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!x&&k&&e.jsx("span",{className:["ds-nav-rail__count",i===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":l&&i!==0||void 0,children:i}),!x&&l&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&k&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),_=r?e.jsx("a",{href:a?void 0:r,...E,children:j}):e.jsx("button",{type:"button",...E,children:j});return x&&!b?e.jsx(we,{content:s,position:R,children:_}):_}function ns({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function rs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function as({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function os({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function is({children:t,label:s,defaultOpen:n=!0,className:a="",...r}){const{collapsed:o}=c.useContext(pe),i=Y(),l=s??i.recents,[d,f]=c.useState(n);return e.jsxs("div",{className:["ds-nav-rail__recents",a].filter(Boolean).join(" "),...r,children:[!o&&e.jsxs("button",{type:"button",className:["ds-nav-rail__recents-toggle",!d&&"ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),onClick:()=>f(u=>!u),"aria-expanded":d,children:[e.jsx("span",{className:"ds-nav-rail__recents-label",children:l}),e.jsx(T.ChevronDown,{size:12,strokeWidth:2,className:"ds-nav-rail__recents-chevron","aria-hidden":"true"})]}),(d||o)&&e.jsx("div",{className:"ds-nav-rail__recents-body",children:t})]})}const ls=c.forwardRef(function({as:s="button",avatar:n,label:a,className:r="",...o},i){const{collapsed:l,side:d}=c.useContext(pe),f=c.useContext(ye),u=d==="left"?"right":"left",h=["ds-nav-rail__item","ds-nav-rail__agent",r].filter(Boolean).join(" "),x=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!l&&e.jsx("span",{className:"ds-nav-rail__label",children:a})]}),m=e.jsx(s,{ref:i,className:h,"aria-label":l?a:void 0,...s==="button"?{type:"button"}:{},...o,children:x});return l&&!f?e.jsx(we,{content:a,position:u,children:m}):m});function cs({avatar:t,label:s,selected:n=!1,disabled:a=!1,href:r,onClick:o,className:i="",...l}){const{collapsed:d,side:f}=c.useContext(pe),u=c.useContext(ye),m={className:["ds-nav-rail__item","ds-nav-rail__agent",i].filter(Boolean).join(" "),onClick:a?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":a?"true":void 0,tabIndex:a?-1:void 0,...{"data-selected":n||void 0,"data-disabled":a||void 0},...l},b=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!d&&e.jsx("span",{className:"ds-nav-rail__label",children:s})]}),g=f==="left"?"right":"left",w=r?e.jsx("a",{href:a?void 0:r,...m,children:b}):e.jsx("button",{type:"button",...m,children:b});return d&&!u?e.jsx(we,{content:s,position:g,children:w}):w}const Me=240,Fe=6,ze=8;function ds({trigger:t,title:s,children:n,open:a,onOpenChange:r,defaultOpen:o=!1,closeLabel:i}){const l=Y(),{side:d}=c.useContext(pe),[f,u]=c.useState(o),h=a!==void 0,x=h?a:f,[m,b]=c.useState(!1),g=c.useRef(null),w=c.useRef(null),[E,k]=c.useState({}),R=c.useCallback(()=>{h?r==null||r(!0):u(!0)},[h,r]),j=c.useCallback(()=>{h?r==null||r(!1):u(!1)},[h,r]),_=c.useCallback(()=>x?j():R(),[x,R,j]),I=c.useCallback(()=>{var q;const P=g.current;if(!P)return;const F=P.getBoundingClientRect(),y=window.innerHeight,L=((q=w.current)==null?void 0:q.offsetHeight)??300,O=Math.max(ze,Math.min(y-L-ze,F.top));k(d==="right"?{position:"fixed",top:O,right:window.innerWidth-F.left+Fe,width:Me}:{position:"fixed",top:O,left:F.right+Fe,width:Me})},[d]);c.useEffect(()=>{if(!x){b(!1);return}return I(),requestAnimationFrame(()=>b(!0)),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[x,I]),c.useEffect(()=>{if(!x)return;const P=y=>{var L,O;!((L=w.current)!=null&&L.contains(y.target))&&!((O=g.current)!=null&&O.contains(y.target))&&j()},F=y=>{y.key==="Escape"&&j()};return document.addEventListener("mousedown",P),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",P),document.removeEventListener("keydown",F)}},[x,j]);const D=x&&e.jsxs("div",{ref:w,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,m&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:E,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:j,"aria-label":i??l.close,children:e.jsx(T.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(ye.Provider,{value:x,children:e.jsx("div",{ref:g,onClick:_,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ne.createPortal(D,document.body)]})}const us={info:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};function fs({children:t,variant:s="info",action:n,onAction:a,onDismiss:r,role:o,dismissLabel:i,...l}){const d=Y(),f=us[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...l,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:z[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:t}),n&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:a,children:n}),r&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:r,"aria-label":i??d.dismiss,children:e.jsx(T.X,{size:z[2],strokeWidth:1.5})})]})}function ms({trigger:t,items:s=[],open:n,onOpenChange:a,align:r="left",fullWidth:o=!1,className:i="",style:l,...d}){const[f,u]=c.useState(!1),[h,x]=c.useState(!1),m=n!==void 0,b=m?n:f,g=c.useRef(null),w=c.useRef(null),E=c.useRef(null),k=c.useRef(null),[R,j]=c.useState({}),_=c.useRef(null),I=150,D=()=>{if(m)a==null||a(!1);else{if(h)return;x(!0),_.current=setTimeout(()=>{u(!1),x(!1)},I)}},P=()=>{const N=!b;m?a==null||a(N):N?(clearTimeout(_.current),x(!1),u(!0)):D()},F=()=>{b||(m?a==null||a(!0):(clearTimeout(_.current),x(!1),u(!0)))};c.useEffect(()=>()=>clearTimeout(_.current),[]),c.useEffect(()=>{if(!b)return;const N=300,B=()=>{var W;const $=(W=g.current)==null?void 0:W.getBoundingClientRect();if(!$)return;const X=window.innerHeight-$.bottom,U=X<N+8&&$.top>X;j(r==="right"?U?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:U?{bottom:window.innerHeight-$.top+4,top:"auto",left:$.left}:{top:$.bottom+4,bottom:"auto",left:$.left})};return B(),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B)}},[b,r]);const y=()=>{var B;const N=(B=E.current)==null?void 0:B.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');N==null||N.focus()};c.useEffect(()=>{if(!b)return;const N=$=>{var X,U;!((X=g.current)!=null&&X.contains($.target))&&!((U=w.current)!=null&&U.contains($.target))&&D()},B=$=>{$.key==="Escape"&&(D(),y())};return document.addEventListener("mousedown",N),document.addEventListener("keydown",B),()=>{document.removeEventListener("mousedown",N),document.removeEventListener("keydown",B)}},[b]),c.useEffect(()=>{if(!b||!k.current||!w.current)return;const N=L(),B=k.current==="last"?N[N.length-1]:N[0];B==null||B.focus(),k.current=null},[b]);const L=()=>w.current?[...w.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],O=N=>{var B,$;if(N.key==="ArrowDown")N.preventDefault(),b?(B=L()[0])==null||B.focus():(k.current="first",F());else if(N.key==="ArrowUp")if(N.preventDefault(),!b)k.current="last",F();else{const X=L();($=X[X.length-1])==null||$.focus()}},q=N=>{var X,U,W,p;const B=L(),$=B.findIndex(v=>v===document.activeElement);switch(N.key){case"ArrowDown":N.preventDefault(),(X=B[Math.min($+1,B.length-1)])==null||X.focus();break;case"ArrowUp":N.preventDefault(),$<=0?y():(U=B[$-1])==null||U.focus();break;case"Home":N.preventDefault(),(W=B[0])==null||W.focus();break;case"End":N.preventDefault(),(p=B[B.length-1])==null||p.focus();break;case"Tab":D();break}},V=b&&e.jsx("div",{ref:w,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${r}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:R,onKeyDown:q,children:s.map((N,B)=>{if(N.separator)return e.jsx("div",{className:"ds-dropdown__separator"},B);if(N.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[N.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:N.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:N.content})]},B);const $=!!N.href,X=$?"a":"button",U=$?{href:N.disabled?void 0:N.href,"aria-disabled":N.disabled?"true":void 0}:{type:"button",disabled:N.disabled};return e.jsxs(X,{role:"menuitem",className:["ds-dropdown__item",N.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...U,onClick:()=>{var W;(W=N.onClick)==null||W.call(N),D()},children:[N.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:N.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:N.label}),N.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:N.shortcut})]},B)})});return e.jsxs("div",{ref:g,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:E,className:"ds-dropdown__trigger",onClick:P,onKeyDown:O,children:t}),typeof document<"u"&&ne.createPortal(V,document.body)]})}function ps({value:t=0,size:s="m",variant:n="default",showValue:a=!1,min:r=2,animate:o=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(r,i),d=n==="auto"?i>=70?"success":i>=50?"warning":"danger":n;return e.jsxs("div",{className:["ds-progress",`ds-progress--${s}`,!o&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("div",{className:"ds-progress__track",children:e.jsx("div",{className:`ds-progress__fill ds-progress__fill--${d}`,style:{width:`${l}%`}})}),a&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const hs=t=>1-Math.pow(1-t,3),xs=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Ke(t,{duration:s=600}={}){const[n,a]=c.useState(t),r=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(xs()){a(t),r.current=t;return}const i=r.current,l=t-i;if(l===0)return;let d=null;const f=u=>{d||(d=u);const h=Math.min((u-d)/s,1);a(i+l*hs(h)),h<1?o.current=requestAnimationFrame(f):r.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function vs({value:t,duration:s=600,decimals:n=0,prefix:a="",suffix:r=""}){const i=Ke(t,{duration:s}).toFixed(n);return`${a}${i}${r}`}function Je({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const a=c.useRef(null),[r,o]=c.useState(!1);return c.useEffect(()=>{const i=a.current;if(!i)return;const l=new IntersectionObserver(([d])=>{d.isIntersecting?(o(!0),n&&l.disconnect()):n||o(!1)},{threshold:t,rootMargin:s});return l.observe(i),()=>l.disconnect()},[t,s,n]),{ref:a,inView:r}}function bs({children:t,as:s="div",once:n=!1,threshold:a=.1,rootMargin:r="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:f}=Je({threshold:a,rootMargin:r,once:n}),u=c.useRef(!1);return c.useEffect(()=>{f&&!u.current&&(o==null||o()),!f&&u.current&&(i==null||i()),u.current=f},[f]),e.jsx(s,{ref:d,...l,children:typeof t=="function"?t(f):t})}const We={default:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};let fe=[];const $e=new Set;function Ze(){$e.forEach(t=>t([...fe]))}function _s(t){fe=[...fe,t],Ze()}function js(t){fe=fe.filter(s=>s.id!==t),Ze()}function gs(){const t=(s,n={})=>{_s({id:`${Date.now()}-${Math.random()}`,message:s,type:"default",duration:4e3,...n})};return t.success=(s,n)=>t(s,{...n,type:"success"}),t.error=(s,n)=>t(s,{...n,type:"error"}),t.warning=(s,n)=>t(s,{...n,type:"warning"}),{toast:t}}function Ns({data:t,onDismiss:s}){const n=Y(),[a,r]=c.useState(!1),o=c.useRef(null);c.useEffect(()=>(requestAnimationFrame(()=>r(!0)),t.duration>0&&(o.current=setTimeout(()=>i(),t.duration)),()=>clearTimeout(o.current)),[]);function i(){r(!1),setTimeout(()=>s(t.id),250)}const l=We[t.type]??We.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,a&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(l,{size:z[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:t.message}),e.jsx("button",{className:"ds-toast__close",onClick:i,"aria-label":n.close,children:e.jsx(T.X,{size:z[3],strokeWidth:1.5})})]})}function ws({position:t="bottom-right"}){const[s,n]=c.useState(()=>[...fe]);return c.useEffect(()=>($e.add(n),()=>$e.delete(n)),[]),!s.length||typeof document>"u"?null:ne.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(a=>e.jsx(Ns,{data:a,onDismiss:js},a.id))}),document.body)}const ys={running:e.jsx(ce,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(ce,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(ce,{size:"xs",variant:"error",children:"Error"})};function Qe({label:t,status:s="idle",icon:n,badge:a,defaultExpanded:r=!1,expanded:o,onToggle:i,children:l,className:d="",...f}){const u=s==="running",h=e.jsxs("span",{className:"ds-tool-card__title-row",children:[n&&e.jsx("span",{className:"ds-tool-card__icon",children:n}),e.jsx("span",{className:"ds-tool-card__label",children:t}),ys[s],a]});return l?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(Ne,{title:h,padding:"s",defaultExpanded:r,expanded:u?!1:o,onToggle:u?void 0:i,children:e.jsx("div",{className:"ds-tool-card__body",children:l})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:h})}function et({text:t,size:s="xs",timeout:n=800,"aria-label":a,...r}){const o=Y(),[i,l]=c.useState(!1),d=f=>{f.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{l(!0),setTimeout(()=>l(!1),n)})};return e.jsx(se,{variant:"ghost",size:s,state:i?"success":"idle",icon:e.jsx(T.Copy,{size:z[1],strokeWidth:1.5}),"aria-label":a??o.copyToClipboard,onClick:d,...r})}function ks({content:t,streaming:s=!1,...n}){const[a,r]=c.useState(s);return c.useEffect(()=>{r(!!s)},[s]),e.jsx(Ne,{expanded:a,onToggle:r,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(T.Brain,{size:z[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ye,{secondary:!0,children:"Thinking"})]}),...n,children:e.jsxs(Be,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[t,s&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Es({count:t,current:s=0,done:n=[],onChange:a,showCounter:r=!0,className:o="","aria-label":i,...l}){const d=Y(),{t:f}=me();return e.jsxs("div",{className:["ds-step-indicator",o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i??d.steps,children:Array.from({length:t},(u,h)=>{const x=h===s,m=n.includes(h)&&!x,b=a&&(h<=s||n.includes(h)),g=["ds-step-indicator__dot",x&&"ds-step-indicator__dot--active",m&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:g,role:"tab","aria-selected":x,"aria-label":f("stepN",{n:h+1}),disabled:!b||h===s,onClick:()=>a==null?void 0:a(h),children:m?e.jsx(T.Check,{size:8,strokeWidth:3}):null},h)})}),r&&e.jsxs(Be,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Rs({content:t,isStreaming:s=!1,cursor:n="line",onChunk:a,className:r="",...o}){const i=c.useRef(t);return c.useEffect(()=>{t!==i.current&&(a==null||a(t),i.current=t)},[t,a]),e.jsxs("span",{className:["ds-streaming-text",r].filter(Boolean).join(" "),...o,children:[t,s&&n!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${n}`,"aria-hidden":"true"})]})}function Ss({role:t="assistant",header:s,footer:n,attachments:a,isStreaming:r=!1,children:o,className:i="",...l}){const d=["ds-chat-message",`ds-chat-message--${t}`,r&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:o})}):t==="user"?e.jsxs("div",{className:d,...l,children:[a&&e.jsx("div",{className:"ds-chat-message__attachments",children:a}),e.jsx("div",{className:"ds-chat-message__bubble",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]}):e.jsxs("div",{className:d,...l,children:[s&&e.jsx("div",{className:"ds-chat-message__header",children:s}),a&&e.jsx("div",{className:"ds-chat-message__attachments",children:a}),e.jsx("div",{className:"ds-chat-message__body",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]})}function Ts(t,{containerRef:s,smartPause:n=!0}={}){const a=c.useRef(!1),r=c.useRef(0);c.useEffect(()=>{const o=s==null?void 0:s.current;if(!o)return;const i=()=>{const l=o.scrollHeight-o.scrollTop-o.clientHeight<64;!l&&o.scrollTop<r.current&&(a.current=!0),l&&(a.current=!1),r.current=o.scrollTop};return o.addEventListener("scroll",i,{passive:!0}),()=>o.removeEventListener("scroll",i)},[s]),c.useEffect(()=>{const o=s==null?void 0:s.current;o&&(n&&a.current||(o.scrollTop=o.scrollHeight))},t)}function tt({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:a=18,holdTime:r=2200,betweenTime:o=380,manualPauseMs:i=5e3}){const[l,d]=c.useState(0),[f,u]=c.useState(""),h=c.useRef("typing"),x=c.useRef(0),m=c.useRef(0),b=c.useRef(null),g=c.useRef(0);c.useEffect(()=>{m.current=l},[l]),c.useEffect(()=>{if(b.current&&(clearTimeout(b.current),b.current=null),!s||t.length===0){u(""),x.current=0,h.current="typing";return}const j=()=>{const _=Date.now();if(g.current>_){b.current=setTimeout(j,g.current-_);return}const I=t[m.current%t.length]??"";h.current==="typing"?(x.current+=1,u(I.slice(0,x.current)),x.current>=I.length?(h.current="holding",b.current=setTimeout(j,r)):b.current=setTimeout(j,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",b.current=setTimeout(j,a)):(x.current=Math.max(0,x.current-1),u(I.slice(0,x.current)),x.current<=0?(h.current="typing",m.current=(m.current+1)%t.length,d(m.current),b.current=setTimeout(j,o)):b.current=setTimeout(j,a))};return b.current=setTimeout(j,260),()=>{b.current&&clearTimeout(b.current)}},[s,t,n,a,r,o]);const w=j=>{if(t.length===0)return;const _=(j%t.length+t.length)%t.length,I=t[_];m.current=_,x.current=I.length,h.current="holding",g.current=Date.now()+i,d(_),u(I)},E=()=>w(m.current+1),k=()=>w(m.current-1),R=t[l%t.length]??"";return{displayed:f,currentPrompt:R,index:l,next:E,prev:k}}let $s=0;function As({value:t="",onChange:s,onSubmit:n,onStop:a,onKeyDown:r,loading:o=!1,disabled:i=!1,placeholder:l,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:m,onRemoveImage:b,acceptImage:g,acceptFile:w,maxImages:E,maxImageSize:k,leftSlot:R,rightSlot:j,className:_="",...I}){const D=Y(),{t:P}=me(),F=c.useRef(null),y=c.useRef(null),L=c.useRef(0),[O,q]=c.useState(!1),[V,N]=c.useState([]),B=l??D.promptPlaceholder,$=S=>{const C=++$s;N(G=>[...G,{id:C,msg:S}]),setTimeout(()=>N(G=>G.filter(J=>J.id!==C)),6e3)},X=S=>N(C=>C.filter(G=>G.id!==S)),U=S=>S.type.startsWith("image/"),W=()=>!0,p=g??U,v=w??W,A=S=>{const C=[],G=[],J=[],Q=[];let ee=0,le=E!=null?E-((u==null?void 0:u.length)??0):1/0;for(const te of S)p(te)?k&&te.size>k?J.push(te.name):le>0?(C.push(te),le--):ee++:v(te)?G.push(te):Q.push(te.name);return{imageFiles:C,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:ee}},M=S=>{const C=k?P("fileTooLargeMaxHint",{maxMb:k/1024/1024}):"";$(P("fileTooLarge",{maxHint:C,names:S.join(", ")}))},Z=S=>{const{imageFiles:C,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:ee}=A(S);J.length&&M(J),Q.length&&$(P("filesSkipped",{names:Q.join(", ")})),ee&&$(P("maxImages",{n:E})),x&&C.length&&x(C);const le=G.concat(x?[]:C);h&&le.length&&h(le)};c.useEffect(()=>{const S=y.current;S&&(S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const S=C=>{var J,Q,ee;if(o||i)return;const G=(J=C.target)==null?void 0:J.tagName;G==="INPUT"||G==="TEXTAREA"||G==="SELECT"||(Q=C.target)!=null&&Q.isContentEditable||C.ctrlKey||C.metaKey||C.altKey||C.key.length!==1&&C.key!=="Backspace"&&C.key!=="Delete"||(ee=y.current)==null||ee.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[o,i]);const re=S=>{S.preventDefault(),L.current++,S.dataTransfer.types.includes("Files")&&q(!0)},H=S=>{S.preventDefault(),L.current--,L.current===0&&q(!1)},K=S=>S.preventDefault(),ie=S=>{S.preventDefault(),L.current=0,q(!1);const C=Array.from(S.dataTransfer.files);C.length&&Z(C)},he=S=>{const C=Array.from(S.target.files||[]);F.current&&(F.current.value=""),C.length&&Z(C)},ke=S=>{var te;if(!x)return;const C=(te=S.clipboardData)==null?void 0:te.items;if(!C)return;const G=[];for(const at of C){const Pe=at.getAsFile();Pe&&G.push(Pe)}if(G.length===0)return;const{imageFiles:J,tooLarge:Q,skipped:ee,limitExceeded:le}=A(G);Q.length&&M(Q),ee.length&&$(P("filesSkipped",{names:ee.join(", ")})),le&&$(P("maxImages",{n:E})),J.length&&(S.preventDefault(),x(J))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=tt({prompts:d??[],enabled:xe}),nt=S=>{if(xe){if(S.key==="ArrowDown"||S.key==="ArrowRight"){S.preventDefault(),je.next();return}if(S.key==="ArrowUp"||S.key==="ArrowLeft"){S.preventDefault(),je.prev();return}if(S.key==="Tab"&&!S.shiftKey){S.preventDefault(),s==null||s(je.currentPrompt);return}}r==null||r(S)},rt=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,De=h||x;return e.jsxs("div",{className:["ds-prompt-input",_].filter(Boolean).join(" "),...I,children:[De&&e.jsx("input",{ref:F,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:he}),e.jsxs("div",{className:["ds-prompt-input__box",O&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:re,onDragLeave:H,onDragOver:K,onDrop:ie,children:[O&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:D.dropFilesHere}),e.jsx("textarea",{ref:y,value:t,onChange:S=>s==null?void 0:s(S.target.value),onKeyDown:nt,onPaste:ke,placeholder:xe?"":B,disabled:o||i,rows:1,className:["ds-prompt-input__textarea",xe&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),xe&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:je.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),u&&u.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:u.map((S,C)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:S.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>b==null?void 0:b(C),"aria-label":D.removeImage,type:"button",children:e.jsx(T.X,{size:12,strokeWidth:2})})]},C))}),V.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:V.map(S=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:S.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>X(S.id),"aria-label":D.dismiss,children:e.jsx(T.X,{size:z[1],strokeWidth:1.5})})]},S.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((S,C)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[S.uploading?e.jsx(T.Loader,{size:z[1],strokeWidth:1.5,className:"spin"}):e.jsx(T.Paperclip,{size:z[1],strokeWidth:1.5}),S.filename,S.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:D.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>m==null?void 0:m(C),"aria-label":D.removeAttachment,children:e.jsx(T.X,{size:z[1],strokeWidth:1.5})})]})},C))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[De&&e.jsx(se,{variant:"ghost",size:"xs",icon:e.jsx(T.Paperclip,{size:z[2],strokeWidth:1.5}),"aria-label":D.attachFiles,onClick:()=>{var S;return(S=F.current)==null?void 0:S.click()}}),R,j,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(se,{variant:"primary",size:"xs",icon:e.jsx(T.Square,{size:z[2],strokeWidth:1.5}),onClick:a,"aria-label":D.stop}):e.jsx(se,{variant:"primary",size:"xs",icon:e.jsx(T.ArrowUp,{size:z[2],strokeWidth:1.5}),onClick:n,disabled:!rt,"aria-label":D.send})]})]})]})}const Oe={fast:0,standard:1,premium:2},Ue={fast:"data-5",standard:"data-3",premium:"data-6"};function Is({models:t=[],value:s,onChange:n,size:a="xs",minTier:r,showAutoOption:o=!1,groupByTier:i=!0,className:l="",...d}){const[f,u]=c.useState(!1),h=c.useRef(null),x=c.useRef(null),m=c.useRef(null),[b,g]=c.useState({}),w=t.filter(y=>!r||y.name==="auto"?!0:(Oe[y.tier]??1)>=(Oe[r]??1)),E=w.find(y=>y.name==="auto"),k=w.filter(y=>y.name!=="auto"),R=t.find(y=>y.name===s),_=new Set(k.map(y=>y.tier).filter(Boolean)).size>1;c.useEffect(()=>{if(!f)return;const y=320,L=()=>{var $;const V=($=x.current)==null?void 0:$.getBoundingClientRect();if(!V)return;const N=window.innerHeight-V.bottom,B=N<y+8&&V.top>N;g({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:V.left,...B?{bottom:window.innerHeight-V.top+4,top:"auto"}:{top:V.bottom+4,bottom:"auto"}})};L(),window.addEventListener("scroll",L,!0),window.addEventListener("resize",L);const O=V=>{var N,B;!((N=h.current)!=null&&N.contains(V.target))&&!((B=m.current)!=null&&B.contains(V.target))&&u(!1)},q=V=>{V.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",O),document.addEventListener("keydown",q),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L),document.removeEventListener("mousedown",O),document.removeEventListener("keydown",q)}},[f]);const I=y=>{n==null||n(y),u(!1)},D=y=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",y.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I(y.name),children:[y.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:y.icon}):e.jsx(T.Cpu,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:y.displayName||y.name}),_&&y.tier&&e.jsx(ce,{size:"xs",variant:Ue[y.tier]||"default",children:y.tier})]},y.name),P=()=>!i||!_?k.map(D):["fast","standard","premium"].flatMap(y=>{const L=k.filter(O=>O.tier===y);return L.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":y,children:y.charAt(0).toUpperCase()+y.slice(1)},`lbl-${y}`),...L.map(D)]:[]}),F=f&&e.jsxs("div",{ref:m,className:"ds-model-picker__menu ds-scrollable","data-ds-portal":"",style:b,children:[o&&E&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",s==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I("auto"),children:[e.jsx(T.Zap,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),k.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),P()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:x,type:"button",className:"ds-model-picker__trigger",onClick:()=>u(y=>!y),"aria-haspopup":"listbox","aria-expanded":f,children:[R!=null&&R.icon?e.jsx("span",{children:R.icon}):e.jsx(T.Cpu,{size:12,strokeWidth:1.5}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(R==null?void 0:R.displayName)||(R==null?void 0:R.name)||s}),_&&(R==null?void 0:R.tier)&&e.jsx(ce,{size:"xs",variant:Ue[R.tier]||"default",children:R.tier})]}),typeof document<"u"&&ne.createPortal(F,document.body)]})}const Bs=({filename:t,pagesLabel:s})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:t}),s&&e.jsx("span",{className:"ds-sources-panel__pages",children:s})]});function Ds(t){const s=new Map;for(const n of t)s.has(n.filename)||s.set(n.filename,{filename:n.filename,url:n.url,items:[]}),s.get(n.filename).items.push(n);return[...s.values()]}function Ps({sources:t=[],layout:s="list",title:n,maxVisible:a=5,onSourceClick:r}){const o=Y(),{t:i}=me(),l=n??o.sources,[d,f]=c.useState(!1),u=Ds(t),h=u.length>a,x=d?u:u.slice(0,a),m=t.some(E=>E.snippet),b=E=>E!=null&&E.length?i("pageAbbrev",{pages:E.join(", ")}):null,g=i("moreSources",{n:u.length-a}),w=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:w,children:[x.map(E=>{const k=E.items.map(_=>_.page).filter(Boolean),R=b(k),j=!!r;return e.jsxs("div",{className:`ds-sources-panel__compact-row${j?" ds-sources-panel__compact-row--clickable":""}`,onClick:j?()=>r(E.items[0]):void 0,children:[e.jsx(T.FileText,{size:z[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:E.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},E.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:g})]}):e.jsxs("div",{className:w,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(E=>{const k=E.items.map(_=>_.page).filter(Boolean),R=b(k),j=!!r;return m?e.jsx(Ne,{title:e.jsx(Bs,{filename:E.filename,pagesLabel:R}),padding:"s",children:E.items.map((_,I)=>e.jsx("div",{className:`ds-sources-panel__snippet${j?" ds-sources-panel__snippet--clickable":""}`,onClick:j?()=>r(_):void 0,children:_.snippet??i("pageAbbrev",{pages:_.page})},I))},E.filename):e.jsxs("div",{className:`ds-sources-panel__row${j?" ds-sources-panel__row--clickable":""}`,onClick:j?()=>r(E.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:E.filename}),R&&e.jsx("span",{className:"ds-sources-panel__pages",children:R})]},E.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:g})]})}function He(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function Ls({used:t,limit:s,size:n="s",showCount:a=!0,showPercent:r=!1,warningThreshold:o=.8,errorThreshold:i=1}){const l=s>0?t/s:0,d=Math.min(l*100,100),f=l>=i?"error":l>=o?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${n}`,role:"meter","aria-valuenow":t,"aria-valuemax":s,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${f}`,style:{width:`${d}%`}})}),(a||r)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${f}`,children:[a&&e.jsxs("span",{children:[He(t)," / ",He(s)]}),r&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const Ve=5;function Cs(t){return t<.34?"low":t<.67?"medium":"high"}function Ms({value:t=0,size:s="xs",showLabel:n="none",layout:a="inline"}){const r=Math.max(0,Math.min(1,t)),o=Math.round(r*Ve),i=Cs(r);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${s}`,`ds-confidence-bar--${i}`,a==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Ve},(l,d)=>e.jsx("div",{className:`ds-confidence-bar__seg${d<o?" ds-confidence-bar__seg--filled":""}`},d))}),n==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:i})]})}const Fs={add:"+",remove:"-",context:" "};function Ee({line:t,lineNumbers:s}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${t.type}`,children:[s&&t.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:t.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:Fs[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function zs({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:a=!0,maxHeight:r,title:o}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=r?{maxHeight:r,overflowY:"auto"}:void 0;if(s==="split"){const d=t.filter(u=>u.type==="remove"||u.type==="context"),f=t.filter(u=>u.type==="add"||u.type==="context");return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,h)=>e.jsx(Ee,{line:u,lineNumbers:a},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,h)=>e.jsx(Ee,{line:u,lineNumbers:a},h))})]})]})}return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:t.map((d,f)=>e.jsx(Ee,{line:d,lineNumbers:a},f))})]})}function st({value:t="idle",onLike:s,onDislike:n,className:a="",likeLabel:r,dislikeLabel:o,...i}){const l=Y(),d=t!=="idle";return e.jsxs("div",{className:["ds-message-feedback",d&&"ds-message-feedback--voted",a].filter(Boolean).join(" "),...i,children:[(!d||t==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:s,disabled:d,"aria-label":r??l.like,"aria-pressed":t==="liked",children:e.jsx(T.ThumbsUp,{size:z[1],strokeWidth:1.5,fill:t==="liked"?"currentColor":"none"})}),(!d||t==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:n,disabled:d,"aria-label":o??l.dislike,"aria-pressed":t==="disliked",children:e.jsx(T.ThumbsDown,{size:z[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function Ws(t){const s=t instanceof Date?t:new Date(t);if(isNaN(s))return null;const n=new Date,a=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(r-864e5);if(s>=r)return a;if(s>=o)return`Yesterday ${a}`;const i=s.getDate(),l=s.toLocaleString([],{month:"short"});return`${i} ${l} ${a}`}function Os({role:t="assistant",text:s,timestamp:n,feedbackValue:a="idle",onLike:r,onDislike:o,className:i="",...l}){const d=t==="assistant"&&(r||o),f=!!s,u=n?Ws(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,i].filter(Boolean).join(" "),...l,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(st,{className:"ds-message-action",value:a,onLike:r,onDislike:o}),f&&e.jsx(et,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function Us({label:t,className:s="",...n}){return e.jsxs("span",{className:["ds-thinking-dot",s].filter(Boolean).join(" "),...n,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),t&&e.jsx("span",{className:"ds-thinking-dot__label",children:t})]})}function Hs({variant:t="light",glow:s,mask:n=!0,style:a,...r}){const o=t==="dark",i=s??o,l=o?"rgba(255,250,250,0.05)":"var(--color-border-light)",d=o?"rgba(255,250,250,0.025)":"color-mix(in srgb, var(--color-border-light) 50%, transparent)";return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden",zIndex:0,...i&&{background:"radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"},...a},...r,children:e.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:[`linear-gradient(${l} 1px, transparent 1px)`,`linear-gradient(90deg, ${l} 1px, transparent 1px)`,`linear-gradient(${d} 1px, transparent 1px)`,`linear-gradient(90deg, ${d} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...n&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function Vs({children:t,axis:s="y",style:n,className:a="",...r}){const o=s==="x"?{overflowX:"auto",overflowY:"hidden"}:s==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${a}`,style:{...o,...n},...r,children:t})}const Re=280,Xs=22,Ys=14,oe=8,ge=6,qs=200;function Gs(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function Ks(t,s,n,a){const r=window.innerWidth,o=window.innerHeight;if(o-t.bottom>=s+a+oe)return"bottom";if(t.top>=s+a+oe)return"top";if(r-t.right>=n+a+oe)return"right";if(t.left>=n+a+oe)return"left";const i=Math.max(t.top,o-t.bottom,r-t.right,t.left);return i===o-t.bottom?"bottom":i===t.top?"top":i===r-t.right?"right":"left"}function Js(t,s,n,a,r){const o=window.innerWidth,i=window.innerHeight;let l,d;switch(t){case"top":l=s.top-n-r,d=s.left+s.width/2-a/2;break;case"bottom":l=s.bottom+r,d=s.left+s.width/2-a/2;break;case"left":l=s.top+s.height/2-n/2,d=s.left-a-r;break;default:l=s.top+s.height/2-n/2,d=s.right+r}const f=Math.max(oe,Math.min(o-a-oe,d)),u=Math.max(oe,Math.min(i-n-oe,l));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:l-u}}function Zs({steps:t,currentStep:s,onNext:n,onBack:a,onSkip:r,onFinish:o,overlay:i=!0,ring:l=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:h,statePrimary:x="idle",stateBack:m="idle"}){const b=Y(),{t:g}=me(),w=d??b.next,E=f??b.back,k=u??b.skipTour,R=h??b.done,j=c.useRef(null),_=c.useRef(t),I=c.useRef(s),D=c.useRef(l);_.current=t,I.current=s,D.current=l;const[P,F]=c.useState(!1),[y,L]=c.useState({position:"fixed",visibility:"hidden",width:Re}),[O,q]=c.useState("bottom"),[V,N]=c.useState(null),B=c.useRef(!1),$=t[s],X=s===t.length-1,U=c.useCallback(()=>{const W=_.current[I.current];if(!W||!j.current)return;const p=Gs(W.target);if(!p)return;const v=p.getBoundingClientRect(),M=j.current.getBoundingClientRect().height||160,Z=Re,re=D.current?Xs:Ys,H=W.position||Ks(v,M,Z,re),{top:K,left:ie,arrowOffset:he,arrowOffsetY:ke}=Js(H,v,M,Z,re);q(H),L({position:"fixed",top:K,left:ie,width:Re,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${ke}px`}),N({top:v.top-ge,left:v.left-ge,width:v.width+ge*2,height:v.height+ge*2})},[]);return c.useEffect(()=>{window.addEventListener("scroll",U,!0),window.addEventListener("resize",U);const W=requestAnimationFrame(()=>{U(),F(!0),B.current=!0});return()=>{cancelAnimationFrame(W),window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U)}},[]),c.useEffect(()=>{if(!B.current)return;F(!1);const W=setTimeout(()=>{L(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{U(),F(!0)})},qs+20);return()=>clearTimeout(W)},[s]),c.useEffect(()=>{P&&j.current&&j.current.focus({preventScroll:!0})},[P]),c.useEffect(()=>{const W=p=>{p.key==="Escape"&&r()};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[r]),c.useEffect(()=>{if(!P)return;const W=p=>{if(p.key!=="Tab"||!j.current)return;const v=Array.from(j.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!v.length)return;const A=v[0],M=v[v.length-1];p.shiftKey&&document.activeElement===A?(p.preventDefault(),M.focus()):!p.shiftKey&&document.activeElement===M&&(p.preventDefault(),A.focus())};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[P]),!$||typeof document>"u"?null:ne.createPortal(e.jsxs(e.Fragment,{children:[V&&e.jsx("div",{className:["ds-coachmark__spotlight",i&&"ds-coachmark__spotlight--overlay",!l&&"ds-coachmark__spotlight--no-ring",P&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:V,"aria-hidden":"true"}),e.jsxs("div",{ref:j,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":$.title??g("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${O}`,P&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:y,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:r,"aria-label":k,children:e.jsx(T.X,{size:16,strokeWidth:2})}),$.title&&e.jsx("div",{className:"ds-coachmark__title",children:$.title}),e.jsx("div",{className:"ds-coachmark__body",children:$.content}),e.jsxs("div",{className:"ds-coachmark__footer",children:[t.length>1&&e.jsxs("span",{className:"ds-coachmark__counter",children:[s+1," / ",t.length]}),e.jsxs("div",{className:"ds-coachmark__footer-nav",children:[s>0&&e.jsx(se,{variant:"secondary",size:"s",state:m,onClick:a,children:E}),e.jsx(se,{variant:"primary",size:"s",state:x,onClick:X?o:n,children:X?R:w})]})]})]})]}),document.body)}function Qs(t,s={}){const{storageKey:n}=s,[a,r]=c.useState(0),[o,i]=c.useState(!1),l=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=c.useCallback(()=>{i(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:a,isActive:o,start:()=>{l()||(r(0),i(!0))},next:()=>r(f=>Math.min(f+1,t.length-1)),back:()=>r(f=>Math.max(f-1,0)),skip:d,finish:d}}function en(){const t=c.useRef(null),s=c.useCallback(()=>{const n=t.current;if(!n)return;n.classList.remove("ds-shake"),n.offsetWidth,n.classList.add("ds-shake");const a=()=>{n.classList.remove("ds-shake"),n.removeEventListener("animationend",a)};n.addEventListener("animationend",a)},[]);return{ref:t,shake:s}}exports.Accordion=Ne;exports.Alert=gt;exports.AnimatedNumber=vs;exports.Avatar=Ft;exports.Badge=ce;exports.Banner=fs;exports.BottomSheet=kt;exports.Breadcrumb=Kt;exports.Button=se;exports.Card=pt;exports.ChatMessage=Ss;exports.Checkbox=Dt;exports.Coachmark=Zs;exports.Code=Et;exports.CodeAccordion=qe;exports.ConfidenceBar=Ms;exports.CopyButton=et;exports.DiffView=zs;exports.Dropdown=ms;exports.EmptyState=Yt;exports.EngineerGrid=Hs;exports.FormField=qt;exports.H1=ht;exports.H2=xt;exports.H3=vt;exports.H4=bt;exports.InView=bs;exports.Input=dt;exports.Link=Rt;exports.LocaleProvider=lt;exports.MessageFeedback=st;exports.MessageFooter=Os;exports.Modal=wt;exports.ModalFooter=de;exports.ModelPicker=Is;exports.NavRail=ts;exports.NavRailAgent=cs;exports.NavRailBody=ns;exports.NavRailCustomItem=ls;exports.NavRailDivider=os;exports.NavRailFlyout=ds;exports.NavRailFooter=as;exports.NavRailHeader=rs;exports.NavRailItem=ss;exports.NavRailRecents=is;exports.P1=_t;exports.P2=Ye;exports.P3=Be;exports.Pagination=Jt;exports.ProgressBar=ps;exports.PromptInput=As;exports.Radio=Pt;exports.ReasoningBlock=ks;exports.Scrollable=Vs;exports.SegmentedControl=$t;exports.Select=ft;exports.SidePage=es;exports.SidePageFooter=Te;exports.Skeleton=Ge;exports.SourcesPanel=Ps;exports.Spinner=Xe;exports.Stat=Gt;exports.StepIndicator=Es;exports.Stepper=mt;exports.StreamingText=Rs;exports.Tab=Tt;exports.Table=zt;exports.TableBody=Ot;exports.TableHead=Wt;exports.TableRow=Ut;exports.TableSubheaderRow=Ht;exports.Tabs=St;exports.Td=Xt;exports.Textarea=ut;exports.Th=Vt;exports.ThinkingDot=Us;exports.ToastContainer=ws;exports.Toggle=Bt;exports.TokenCounter=Ls;exports.ToolCallBubble=Qe;exports.ToolCallCard=Qe;exports.Tooltip=we;exports.defaultStrings=_e;exports.formatString=Ae;exports.iconSizes=z;exports.useAnimatedNumber=Ke;exports.useAnimatedPlaceholder=tt;exports.useCoachmark=Qs;exports.useInView=Je;exports.useLocale=me;exports.useShake=en;exports.useStreamScroll=Ts;exports.useStrings=Y;exports.useToast=gs;
22
+ <%s key={someKey} {...props} />`,M,H,K,H),O[H+M]=!0)}if(H=null,A!==void 0&&(n(A),H=""+A),i(v)&&(n(v.key),H=""+v.key),"key"in v){A={};for(var ie in v)ie!=="key"&&(A[ie]=v[ie])}else A=v;return H&&l(A,typeof p=="function"?p.displayName||p.name||"Unknown":p),f(p,H,A,r(),Z,re)}function h(p){x(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===F&&(p._payload.status==="fulfilled"?x(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function x(p){return typeof p=="object"&&p!==null&&p.$$typeof===b}var m=c,b=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),g=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),z=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,V=Array.isArray,j=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(p){return p()}};var B,$={},X=m.react_stack_bottom_frame.bind(m,o)(),U=j(a(o)),O={};be.Fragment=w,be.jsx=function(p,v,A){var M=1e4>z.recentlyCreatedOwnerStacks++;return u(p,v,A,!1,M?Error("react-stack-top-frame"):X,M?j(a(p)):U)},be.jsxs=function(p,v,A){var M=1e4>z.recentlyCreatedOwnerStacks++;return u(p,v,A,!0,M?Error("react-stack-top-frame"):X,M?j(a(p)):U)}}()),be}process.env.NODE_ENV==="production"?Se.exports=ot():Se.exports=it();var e=Se.exports;const _e={close:"Close",closeModal:"Close modal",closeAlert:"Close alert",dismiss:"Dismiss",loading:"Loading",next:"Next",back:"Back",skipTour:"Skip tour",done:"Done",previousPage:"Previous page",nextPage:"Next page",pagination:"Pagination",pageN:"Page {n}",breadcrumb:"Breadcrumb",recents:"Recents",steps:"Steps",stepN:"Step {n}",stepOf:"Step {current} of {total}",copyToClipboard:"Copy to clipboard",selectOption:"Select option",like:"Like",dislike:"Dislike",removeImage:"Remove image",attachFiles:"Attach files",stop:"Stop",send:"Send",toggleVisibility:"Toggle visibility",decrease:"Decrease",increase:"Increase",sources:"Sources",moreSources:"+{n} more sources",pageAbbrev:"p. {pages}",code:"Code",promptPlaceholder:"Let's get things done...",dropFilesHere:"Drop files here",fileTooLarge:"File(s) too large{maxHint}: {names}",fileTooLargeMaxHint:" (max {maxMb}MB)",filesSkipped:"Skipped unsupported file(s): {names}",maxImages:"Max {n} images per message",uploading:"Uploading...",removeAttachment:"Remove attachment"};function Ae(t,s={}){return typeof t=="function"?t(s):typeof t!="string"?"":t.replace(/\{(\w+)\}/g,(n,a)=>s[a]!==void 0&&s[a]!==null?String(s[a]):"")}const Ie=c.createContext({strings:_e,t:(t,s)=>Ae(_e[t]??t,s)});function lt({strings:t,children:s}){const n=c.useMemo(()=>{const a={..._e,...t};return{strings:a,t:(r,o)=>Ae(a[r]??_e[r]??r,o)}},[t]);return e.jsx(Ie.Provider,{value:n,children:s})}function me(){return c.useContext(Ie)}function Y(){return c.useContext(Ie).strings}function Xe({size:t="m",color:s="default",className:n="","aria-label":a,...r}){const o=Y();return e.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${s}`,n].filter(Boolean).join(" "),role:"status","aria-label":a??o.loading,...r})}const ct={xs:12,s:14,m:16,l:20};function se({children:t,variant:s="primary",size:n="m",fullWidth:a=!1,icon:r,disabled:o=!1,state:i="idle",active:l=!1,pressed:d=!1,onClick:f,type:u="button",href:h,"aria-label":x,"aria-pressed":m,className:b="",...N}){const w=r&&!t,y=i==="loading",k=i==="success",E=i==="error",g=y||k||E,_=!!(l||d),I=n==="xs"?"s":"m",D=s==="danger"?"on-accent":"default",P=ct[n]??16,F=y?e.jsx(Xe,{size:I,color:D}):k?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(T.Check,{size:P,strokeWidth:2.5})}):E?e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:e.jsx(T.X,{size:P,strokeWidth:2.5})}):null,R=["ds-button",`ds-button--${s}`,`ds-button--${n}`,a&&"ds-button--full",w&&"ds-button--icon-only",b].filter(Boolean).join(" "),L=i!=="idle"?i:void 0,z=m!==void 0?m:_?!0:void 0,q=e.jsxs(e.Fragment,{children:[g?F:r&&e.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:r}),t]});if(h){const V=j=>{if(o||y){j.preventDefault();return}j.metaKey||j.ctrlKey||j.button===1||(j.preventDefault(),f==null||f(j))};return e.jsx("a",{className:R,href:o||y?void 0:h,onClick:V,"aria-label":x,"aria-disabled":o||y?"true":void 0,"aria-busy":y?"true":void 0,"aria-pressed":z,"data-state":L,"data-active":_?"true":void 0,...N,children:q})}return e.jsx("button",{type:u,className:R,disabled:o,onClick:y?void 0:f,"aria-label":x,"aria-busy":y?"true":void 0,"aria-pressed":z,"data-state":L,"data-active":_?"true":void 0,...N,children:q})}function dt({label:t,error:s,hint:n,fullWidth:a=!0,icon:r,iconRight:o,onIconRightClick:i,size:l="m",disabled:d,id:f,iconRightLabel:u,...h}){const x=Y(),m=f||`input-${c.useId()}`,b=n?`${m}-hint`:void 0,N=s?`${m}-error`:void 0,w=N||b;return e.jsxs("div",{className:`ds-input-wrapper ${a?"ds-input-wrapper--full":""} ${d?"ds-input-wrapper--disabled":""} ${s?"ds-input-wrapper--error":""}`,children:[t&&e.jsx("label",{className:"ds-input-label",htmlFor:m,children:t}),e.jsxs("div",{className:"ds-input-container",children:[r&&e.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:r}),e.jsx("input",{id:m,className:`ds-input ds-input--${l} ${r?"ds-input--with-icon":""} ${o?"ds-input--with-icon-right":""} ${s?"ds-input--error":""}`,disabled:d,"aria-invalid":s?"true":"false","aria-describedby":w,...h}),o&&e.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":u??x.toggleVisibility,children:o})]}),n&&!s&&e.jsx("span",{id:b,className:"ds-input-hint",children:n}),e.jsx("div",{className:"ds-input-error-wrap",children:e.jsx("div",{className:"ds-input-error-inner",children:s&&e.jsx("span",{id:N,className:"ds-input-error",role:"alert",children:s})})})]})}function ut({label:t,error:s,hint:n,fullWidth:a=!0,size:r="m",disabled:o,id:i,resize:l=!0,rows:d=3,...f}){const u=i||`textarea-${c.useId()}`,h=n?`${u}-hint`:void 0,x=s?`${u}-error`:void 0,m=x||h;return e.jsxs("div",{className:`ds-textarea-wrapper ${a?"ds-textarea-wrapper--full":""} ${o?"ds-textarea-wrapper--disabled":""}`,children:[t&&e.jsx("label",{className:"ds-textarea-label",htmlFor:u,children:t}),e.jsx("textarea",{id:u,className:`ds-textarea ds-textarea--${r} ${s?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:o,"aria-invalid":s?"true":"false","aria-describedby":m,rows:d,...f}),n&&!s&&e.jsx("span",{id:h,className:"ds-textarea-hint",children:n}),s&&e.jsx("span",{id:x,className:"ds-textarea-error",role:"alert",children:s})]})}function ft({label:t,value:s,onChange:n,options:a=[],placeholder:r,error:o,fullWidth:i=!0,size:l="m",disabled:d=!1,id:f,...u}){const h=Y(),x=r??h.selectOption,[m,b]=c.useState(!1),[N,w]=c.useState(!1),[y,k]=c.useState({}),[E,g]=c.useState("down"),[_,I]=c.useState(-1),D=c.useRef(null),P=c.useRef(null),F=c.useRef(null),R=c.useRef(null),L=f||`select-${c.useId()}`,z=`${L}-label`,q=o?`${L}-error`:void 0,V=150,j=(v=!1)=>{N||(w(!0),I(-1),R.current=setTimeout(()=>{var A;b(!1),w(!1),v&&((A=F.current)==null||A.focus())},V))},B=v=>{clearTimeout(R.current),w(!1);const A=v!==void 0?v:Math.max(a.findIndex(M=>M.value===s),0);I(A),b(!0)};c.useEffect(()=>()=>clearTimeout(R.current),[]);const $=()=>{var K;const v=(K=D.current)==null?void 0:K.getBoundingClientRect();if(!v)return;const A=window.innerHeight,M=A-v.bottom,Z=v.top,H=M<300&&Z>M;g(H?"up":"down"),k(H?{bottom:A-v.top+4,left:v.left,width:v.width}:{top:v.bottom+4,left:v.left,width:v.width})};c.useEffect(()=>{if(m)return $(),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),()=>{window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[m]),c.useEffect(()=>{const v=A=>{D.current&&!D.current.contains(A.target)&&P.current&&!P.current.contains(A.target)&&j()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[N]),c.useEffect(()=>{var A;if(!m||_<0||!P.current)return;(A=P.current.querySelectorAll(".ds-select-option")[_])==null||A.scrollIntoView({block:"nearest"})},[_,m]);const X=v=>{switch(v.key){case"ArrowDown":v.preventDefault(),m?I(A=>Math.min(A+1,a.length-1)):B();break;case"ArrowUp":v.preventDefault(),m?I(A=>Math.max(A-1,0)):B(a.length-1);break;case"Home":m&&(v.preventDefault(),I(0));break;case"End":m&&(v.preventDefault(),I(a.length-1));break;case"Enter":case" ":v.preventDefault(),m?_>=0&&(n==null||n(a[_].value),j(!0)):B();break;case"Escape":m&&(v.preventDefault(),j(!0));break;case"Tab":m&&j(!1);break}},U=a.find(v=>v.value===s),O=l==="xs"?W[1]:l==="small"?W[2]:W[3],p=m&&e.jsx("div",{ref:P,"data-ds-portal":"",role:"listbox","aria-labelledby":t?z:void 0,tabIndex:-1,className:["ds-select-dropdown ds-scrollable",`ds-select-dropdown--${l}`,`ds-select-dropdown--${E}`,N&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:y,children:a.map((v,A)=>e.jsx("button",{id:`${L}-opt-${A}`,type:"button",role:"option",tabIndex:-1,"aria-selected":s===v.value,className:["ds-select-option",`ds-select-option--${l}`,s===v.value&&"ds-select-option--selected",A===_&&"ds-select-option--active"].filter(Boolean).join(" "),onClick:()=>{n==null||n(v.value),j(!0)},children:v.label},v.value))});return e.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${d?"ds-select-wrapper--disabled":""}`,children:[t&&e.jsx("label",{id:z,className:"ds-select-label",children:t}),e.jsx("div",{className:"ds-select-container",ref:D,children:e.jsxs("button",{ref:F,type:"button",id:L,role:"combobox","aria-haspopup":"listbox","aria-expanded":m,"aria-activedescendant":m&&_>=0?`${L}-opt-${_}`:void 0,"aria-labelledby":t?z:void 0,"aria-invalid":o?"true":"false","aria-describedby":q,className:`ds-select-trigger ds-select-trigger--${l} ${o?"ds-select-trigger--error":""}`,onClick:()=>{d||(m?j():B())},onKeyDown:X,disabled:d,...u,children:[e.jsx("span",{className:U?"":"ds-select-placeholder",children:(U==null?void 0:U.label)||x}),e.jsx(T.ChevronDown,{size:O,strokeWidth:1.5,className:`ds-select-icon ${m&&E==="down"?"ds-select-icon--open":""} ${m&&E==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),o&&e.jsx("span",{id:q,className:"ds-select-error",role:"alert",children:o}),typeof document<"u"&&ne.createPortal(p,document.body)]})}function mt({label:t,value:s=0,onChange:n,min:a=0,max:r=100,step:o=1,size:i="m",disabled:l=!1,hint:d,error:f,decreaseLabel:u,increaseLabel:h,...x}){const m=Y(),b=()=>{if(l)return;const g=Math.min(Number(s)+o,r);n==null||n(g)},N=()=>{if(l)return;const g=Math.max(Number(s)-o,a);n==null||n(g)},w=g=>{if(l)return;const _=g.target.value;if(_===""){n==null||n(a);return}const I=Number(_);if(!isNaN(I)){const D=Math.min(Math.max(I,a),r);n==null||n(D)}},y=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),k=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),E=i==="xs"?W[1]:i==="small"?W[2]:W[3];return e.jsxs("div",{className:y,children:[t&&e.jsx("label",{className:"ds-stepper-label",children:t}),e.jsxs("div",{className:k,children:[e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:N,disabled:l||s<=a,"aria-label":u??m.decrease,children:e.jsx(T.Minus,{size:E,strokeWidth:1.5})}),e.jsx("input",{type:"number",className:"ds-stepper-input",value:s,onChange:w,min:a,max:r,step:o,disabled:l,...x}),e.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:b,disabled:l||s>=r,"aria-label":h??m.increase,children:e.jsx(T.Plus,{size:E,strokeWidth:1.5})})]}),d&&!f&&e.jsx("div",{className:"ds-stepper-hint",children:d}),f&&e.jsx("div",{className:"ds-stepper-error",children:f})]})}function pt({children:t,padding:s="m",variant:n="default",hover:a=!1,onClick:r,href:o,disabled:i=!1,className:l="",...d}){const u=(a?"interactive":n)==="interactive"||r||o,h=["ds-card",`ds-card--${s}`,u&&"ds-card--interactive",l].filter(Boolean).join(" ");if(o){const b=N=>{if(i){N.preventDefault();return}N.metaKey||N.ctrlKey||N.button===1||(N.preventDefault(),r==null||r(N))};return e.jsx("a",{className:h,href:i?void 0:o,onClick:b,"aria-disabled":i?"true":void 0,...d,children:t})}const x=u&&r?"button":"div",m=u&&r?{type:"button",onClick:r,disabled:i}:{};return e.jsx(x,{className:h,role:u&&!r?"article":void 0,...m,...d,children:t})}function ht({children:t,...s}){return e.jsx("h1",{className:"ds-h1",...s,children:t})}function xt({children:t,...s}){return e.jsx("h2",{className:"ds-h2",...s,children:t})}function vt({children:t,...s}){return e.jsx("h3",{className:"ds-h3",...s,children:t})}function bt({children:t,...s}){return e.jsx("h4",{className:"ds-h4",...s,children:t})}function _t({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p1 ${s?"ds-p1--secondary":""}`,...n,children:t})}function Ye({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p2 ${s?"ds-p2--secondary":""}`,...n,children:t})}function Be({children:t,secondary:s=!1,...n}){return e.jsx("p",{className:`ds-p3 ${s?"ds-p3--secondary":""}`,...n,children:t})}function ce({children:t,variant:s="default",size:n="m",role:a,...r}){const o=["ds-badge",`ds-badge--${s}`,`ds-badge--${n}`].filter(Boolean).join(" "),i=a||(["info","success","warning","error"].includes(s)?"status":void 0);return e.jsx("span",{className:o,role:i,...r,children:t})}const jt={info:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle},gt=c.forwardRef(function({children:s,variant:n="info",title:a,onClose:r,role:o,closeLabel:i,...l},d){const f=Y(),u=jt[n],h=o||(n==="error"?"alert":"status");return e.jsxs("div",{ref:d,className:`ds-alert ds-alert--${n} ${a?"":"ds-alert--no-title"}`,role:h,...l,children:[u&&e.jsx("div",{className:"ds-alert__icon",children:e.jsx(u,{size:W[3],strokeWidth:1.5})}),e.jsxs("div",{className:"ds-alert__content",children:[a&&e.jsx("div",{className:"ds-alert__title",children:a}),s&&e.jsx("div",{className:"ds-alert__message",children:s})]}),r&&e.jsx("button",{type:"button",className:"ds-alert__close",onClick:r,"aria-label":i??f.closeAlert,children:e.jsx(T.X,{size:W[3],strokeWidth:1.5})})]})}),Nt=200;function wt({children:t,title:s,onClose:n,size:a="m",scrollable:r=!1,subHeader:o,closeLabel:i,...l}){const d=Y(),f=c.useRef(null),u=c.useId(),[h,x]=c.useState(!1),m=()=>{!n||h||(x(!0),setTimeout(()=>{x(!1),n()},Nt))};c.useEffect(()=>{const k=g=>{g.key==="Escape"&&m()},E=g=>{var I,D,P;const _=((D=(I=g.composedPath)==null?void 0:I.call(g))==null?void 0:D[0])??g.target;f.current&&!f.current.contains(_)&&!((P=_.closest)!=null&&P.call(_,"[data-ds-portal]"))&&m()};return document.addEventListener("keydown",k),document.addEventListener("mousedown",E),()=>{document.removeEventListener("keydown",k),document.removeEventListener("mousedown",E)}},[n,h]);const b=c.Children.toArray(t),N=b.find(k=>(k==null?void 0:k.type)===de),w=b.filter(k=>(k==null?void 0:k.type)!==de),y=e.jsx("div",{className:["ds-modal-overlay",h&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...l,children:e.jsxs("div",{className:[`ds-modal ds-modal--${a}`,r&&"ds-modal--scrollable"].filter(Boolean).join(" "),ref:f,role:"dialog","aria-modal":"true","aria-labelledby":s?u:void 0,children:[n&&e.jsx(se,{className:"ds-modal__close",variant:"ghost",size:"small",icon:e.jsx(T.X,{size:W[2],strokeWidth:1.5}),onClick:m,"aria-label":i??d.closeModal}),(s||o)&&e.jsxs("div",{className:"ds-modal__header",children:[s&&e.jsx("h3",{id:u,className:"ds-modal__title",children:s}),o&&e.jsx("div",{className:"ds-modal__subheader",children:o})]}),e.jsx("div",{className:"ds-modal__body ds-scrollable",children:w}),N]})});return typeof document>"u"?y:ne.createPortal(y,document.body)}function de({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-modal__footer",children:t})}const yt=320;function kt({children:t,title:s,onClose:n,subHeader:a,closeLabel:r,...o}){const i=Y(),l=c.useRef(null),d=c.useId(),[f,u]=c.useState(!1),h=()=>{!n||f||(u(!0),setTimeout(()=>{u(!1),n()},yt))};c.useEffect(()=>{const w=k=>{k.key==="Escape"&&h()},y=k=>{var g,_,I;const E=((_=(g=k.composedPath)==null?void 0:g.call(k))==null?void 0:_[0])??k.target;l.current&&!l.current.contains(E)&&!((I=E.closest)!=null&&I.call(E,"[data-ds-portal]"))&&h()};return document.addEventListener("keydown",w),document.addEventListener("mousedown",y),()=>{document.removeEventListener("keydown",w),document.removeEventListener("mousedown",y)}},[n,f]);const x=c.Children.toArray(t),m=x.find(w=>(w==null?void 0:w.type)===de),b=x.filter(w=>(w==null?void 0:w.type)!==de),N=e.jsx("div",{className:["ds-bottom-sheet-overlay",f&&"ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),...o,children:e.jsxs("div",{ref:l,className:["ds-bottom-sheet",f&&"ds-bottom-sheet--closing"].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-labelledby":s?d:void 0,children:[e.jsx("div",{className:"ds-bottom-sheet__handle","aria-hidden":"true"}),n&&e.jsx(se,{className:"ds-bottom-sheet__close",variant:"ghost",size:"small",icon:e.jsx(T.X,{size:W[2],strokeWidth:1.5}),onClick:h,"aria-label":r??i.close}),(s||a)&&e.jsxs("div",{className:"ds-bottom-sheet__header",children:[s&&e.jsx("h3",{id:d,className:"ds-bottom-sheet__title",children:s}),a&&e.jsx("div",{className:"ds-bottom-sheet__subheader",children:a})]}),e.jsx("div",{className:"ds-bottom-sheet__body ds-scrollable",children:b}),m]})});return typeof document>"u"?N:ne.createPortal(N,document.body)}function qe({children:t,title:s,defaultExpanded:n=!1,expanded:a,onToggle:r,padding:o="s",className:i="",...l}){const d=Y(),f=s??d.code,[u,h]=c.useState(n),x=a!==void 0,m=x?a:u,b=()=>{x?r==null||r(!a):h(w=>!w)},N=["ds-code-accordion",`ds-code-accordion--${o}`,m&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return e.jsxs("div",{className:N,...l,children:[e.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:b,"aria-expanded":m,children:[e.jsx("span",{className:"ds-code-accordion__title",children:f}),e.jsx(T.ChevronDown,{size:W[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${m?"ds-code-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-code-accordion__content",children:e.jsx("div",{className:"ds-code-accordion__inner",children:e.jsx("pre",{className:"ds-code-accordion__pre ds-scrollable",children:e.jsx("code",{children:t})})})})]})}function Et({children:t,block:s=!1,collapsible:n=!1,title:a,defaultExpanded:r=!1,...o}){const i=Y(),l=a??i.code;return s?n?e.jsx(qe,{title:l,defaultExpanded:r,...o,children:t}):e.jsx("pre",{className:"ds-code-block ds-scrollable",...o,children:e.jsx("code",{children:t})}):e.jsx("code",{className:"ds-code-inline",...o,children:t})}function Rt({href:t,children:s,onClick:n,target:a,rel:r,...o}){const l=a==="_blank"?r?`${r} noopener noreferrer`:"noopener noreferrer":r;return e.jsx("a",{href:t,className:"ds-link",onClick:n,target:a,rel:l,...o,children:s})}function St({children:t,size:s="m",variant:n="ghost",...a}){return e.jsx("div",{className:"ds-tabs",role:"tablist",...a,children:c.Children.map(t,r=>c.isValidElement(r)?c.cloneElement(r,{size:s,variant:n}):r)})}function Tt({children:t,selected:s=!1,onClick:n,size:a="m",variant:r="ghost",disabled:o=!1,icon:i,href:l,...d}){const f=i&&!t,u=["ds-tab",`ds-tab--${a}`,`ds-tab--${r}`,s&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const x=m=>{if(o){m.preventDefault();return}m.metaKey||m.ctrlKey||m.button===1||(m.preventDefault(),n==null||n(m))};return e.jsx("a",{role:"tab","aria-current":s?"page":void 0,"aria-disabled":o?"true":void 0,className:u,href:o?void 0:l,onClick:x,...d,children:h})}return e.jsx("button",{role:"tab","aria-selected":s,className:u,onClick:n,disabled:o,...d,children:h})}function $t({options:t,value:s,onChange:n,size:a="m",disabled:r=!1}){const o=c.useRef(null),i=c.useRef(null),[l,d]=c.useState(!1),f=c.useRef(!1),u=c.useRef(null),h=c.useRef(null),x=()=>{if(!o.current)return;const m=o.current.querySelector(`[data-value="${s}"]`);if(!m)return;const b=o.current.getBoundingClientRect(),N=m.getBoundingClientRect(),w=N.left-b.left,y=N.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=w+"px",i.current.style.width=y+"px",f.current=!1):(d(!0),requestAnimationFrame(()=>{if(!i.current||!o.current)return;const k=o.current.querySelector(`[data-value="${s}"]`);if(!k)return;const E=o.current.getBoundingClientRect(),g=k.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=g.left-E.left+"px",i.current.style.width=g.width+"px"}))};return h.current=x,c.useLayoutEffect(()=>{const m=u.current!==s;u.current=s,f.current=l&&m,x()}),c.useEffect(()=>{if(!o.current)return;const m=new ResizeObserver(()=>{f.current=!1,h.current()});return m.observe(o.current),()=>m.disconnect()},[]),e.jsxs("div",{className:["ds-seg",`ds-seg--${a}`,r&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:o,role:"group",children:[l&&e.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(m=>e.jsxs("button",{type:"button","data-value":m.value,className:["ds-seg__btn",s===m.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!r&&n(m.value),"aria-pressed":s===m.value,disabled:r,children:[m.icon&&e.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:m.icon}),m.label]},m.value))]})}function Ne({children:t,title:s,defaultExpanded:n=!1,expanded:a,onToggle:r,padding:o="m",...i}){const[l,d]=c.useState(n),f=a!==void 0,u=f?a:l,h=()=>{f?r==null||r(!a):d(m=>!m)},x=["ds-accordion",`ds-accordion--${o}`,u&&"ds-accordion--expanded"].filter(Boolean).join(" ");return e.jsxs("div",{className:x,...i,children:[e.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:h,"aria-expanded":u,children:[e.jsx("span",{className:"ds-accordion__title",children:s}),e.jsx(T.ChevronDown,{size:W[2],strokeWidth:1.5,className:`ds-accordion__icon ${u?"ds-accordion__icon--expanded":""}`})]}),e.jsx("div",{className:"ds-accordion__content",children:e.jsx("div",{className:"ds-accordion__content-inner",children:e.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const ae=8,ue=8;function At(t,s,n){const a=window.innerWidth;let r,o;switch(t){case"top":r=s.top-n.height-ae,o=s.left+s.width/2-n.width/2;break;case"bottom":r=s.bottom+ae,o=s.left+s.width/2-n.width/2;break;case"left":r=s.top+s.height/2-n.height/2,o=s.left-n.width-ae;break;case"right":r=s.top+s.height/2-n.height/2,o=s.right+ae;break;default:r=s.bottom+ae,o=s.left}const i=Math.max(ue,Math.min(a-n.width-ue,o)),l=o-i;return{top:r,left:i,arrowOffset:l}}function It(t,s,n){const a=window.innerWidth,r=window.innerHeight;if(t.top>=s+ae+ue)return"top";if(r-t.bottom>=s+ae+ue)return"bottom";if(a-t.right>=n+ae+ue)return"right";if(t.left>=n+ae+ue)return"left";const o=Math.max(t.top,r-t.bottom,t.left,a-t.right);return o===t.top?"top":o===r-t.bottom?"bottom":o===a-t.right?"right":"left"}function we({children:t,content:s,position:n,...a}){const[r,o]=c.useState(!1),[i,l]=c.useState({visibility:"hidden"}),[d,f]=c.useState(n||"top"),u=c.useRef(null),h=c.useRef(null),x=c.useRef(!1),m=()=>{if(!u.current||!h.current)return;const N=u.current.getBoundingClientRect(),w=h.current.getBoundingClientRect(),y=n||It(N,w.height,w.width),{top:k,left:E,arrowOffset:g}=At(y,N,w);f(y),l({position:"fixed",top:k,left:E,visibility:"visible","--arrow-offset":`${g}px`})};if(c.useEffect(()=>{if(!r)return;l({position:"fixed",visibility:"hidden"});const N=requestAnimationFrame(m);return window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{cancelAnimationFrame(N),window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[r,n]),c.useEffect(()=>{if(!r)return;const N=w=>{u.current&&!u.current.contains(w.target)&&o(!1)};return document.addEventListener("touchstart",N),()=>document.removeEventListener("touchstart",N)},[r]),!s)return t;const b=r&&e.jsx("div",{ref:h,"data-ds-portal":"",className:`ds-tooltip ds-tooltip--${d}`,role:"tooltip",style:i,children:s});return e.jsxs("div",{ref:u,className:"ds-tooltip-wrapper",onMouseEnter:()=>{x.current||o(!0)},onMouseLeave:()=>{x.current||o(!1)},onTouchStart:()=>{x.current=!0,o(N=>!N)},...a,children:[t,typeof document<"u"&&ne.createPortal(b,document.body)]})}function Bt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,id:o,...i}){const l=o||`toggle-${c.useId()}`,d=["ds-toggle",`ds-toggle--${n}`,a&&"ds-toggle--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:t,onChange:f=>s==null?void 0:s(f.target.checked),disabled:a,...i}),e.jsx("span",{className:"ds-toggle__track",children:e.jsx("span",{className:"ds-toggle__thumb"})}),r&&e.jsx("span",{className:"ds-toggle__label",children:r})]})}function Dt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,id:o,...i}){const l=o||`checkbox-${c.useId()}`,d=["ds-checkbox",`ds-checkbox--${n}`,a&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=n==="xs"?10:n==="small"?14:n==="large"?20:16;return e.jsxs("label",{className:d,htmlFor:l,children:[e.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:t,onChange:u=>s==null?void 0:s(u.target.checked),disabled:a,...i}),e.jsx("span",{className:"ds-checkbox__box",children:t&&e.jsx(T.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),r&&e.jsx("span",{className:"ds-checkbox__label",children:r})]})}function Pt({checked:t=!1,onChange:s,size:n="m",disabled:a=!1,label:r,name:o,value:i,id:l,...d}){const f=l||`radio-${c.useId()}`,u=["ds-radio",`ds-radio--${n}`,a&&"ds-radio--disabled"].filter(Boolean).join(" ");return e.jsxs("label",{className:u,htmlFor:f,children:[e.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:h=>s==null?void 0:s(h.target.checked),disabled:a,name:o,value:i,...d}),e.jsx("span",{className:"ds-radio__circle",children:e.jsx("span",{className:"ds-radio__dot"})}),r&&e.jsx("span",{className:"ds-radio__label",children:r})]})}function Ge({width:t,height:s,shape:n="rect",aspectRatio:a,className:r="",style:o={},...i}){return e.jsx("span",{className:["ds-skeleton",`ds-skeleton--${n}`,r].filter(Boolean).join(" "),style:{width:t,height:s,aspectRatio:a,...o},"aria-hidden":"true",...i})}function Lt({lines:t=1,lastLineWidth:s="70%",gap:n,className:a="",style:r={},...o}){return e.jsx("span",{className:["ds-skeleton-text",a].filter(Boolean).join(" "),style:{gap:n,...r},"aria-hidden":"true",...o,children:Array.from({length:t},(i,l)=>e.jsx("span",{className:"ds-skeleton ds-skeleton--text",style:l===t-1&&t>1?{width:s}:void 0},l))})}Ge.Text=Lt;function Ct(t){let s=2166136261;for(let n=0;n<t.length;n++)s^=t.charCodeAt(n),s=Math.imul(s,16777619)>>>0;return s%360}function Mt(t){if(!t)return"";const s=t.trim().split(/\s+/);return s.length>=2?(s[0][0]+s[1][0]).toUpperCase():t[0].toUpperCase()}function Ft({seed:t,icon:s,src:n,size:a=32,className:r="",style:o={},...i}){const l=Ct(t??""),[d,f]=c.useState(!1),u=s??e.jsx("span",{className:"ds-avatar__initials",children:Mt(t)});return e.jsx("div",{className:["ds-avatar",r].filter(Boolean).join(" "),style:{width:a,height:a,"--ds-avatar-h":l,...o},"aria-hidden":"true",...i,children:n&&!d?e.jsx("img",{src:n,alt:"",onError:()=>f(!0)}):u})}function zt({children:t,size:s="compact",stickyTop:n,maxHeight:a,className:r="",style:o={},...i}){const l={...a?{maxHeight:a}:{},...n!==void 0?{"--ds-table-sticky-top":typeof n=="number"?`${n}px`:n}:{},...o};return e.jsx("div",{className:["ds-table-wrap","ds-scrollable",a?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:e.jsx("table",{className:["ds-table",`ds-table--${s}`,r].filter(Boolean).join(" "),...i,children:t})})}function Wt({children:t,...s}){return e.jsx("thead",{...s,children:t})}function Ot({children:t,...s}){return e.jsx("tbody",{...s,children:t})}function Ut({children:t,interactive:s,selected:n,subheader:a,exiting:r,updated:o,className:i="",onClick:l,...d}){return e.jsx("tr",{className:["ds-table-row",s||l?"ds-table-row--interactive":"",n?"ds-table-row--selected":"",a?"ds-table-row--subheader":"",r?"ds-table-row--exiting":"",o?"ds-table-row--updated":"",i].filter(Boolean).join(" "),onClick:l,...d,children:t})}function Ht({children:t,colSpan:s=999,...n}){return e.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...n,children:e.jsx("td",{colSpan:s,children:t})})}function Vt({children:t,align:s="left",sortDir:n,onSort:a,width:r,className:o="",style:i={},...l}){const d=!!a||n!==void 0,f=n==="asc"?T.ChevronUp:n==="desc"?T.ChevronDown:T.ChevronsUpDown;return e.jsx("th",{className:["ds-th",d?"ds-th--sortable":"",n?"ds-th--sorted":"",s!=="left"?`ds-table-cell--${s}`:"",o].filter(Boolean).join(" "),onClick:a,style:{width:r,...i},...l,children:d?e.jsxs("span",{className:"ds-th__inner",children:[t,e.jsx("span",{className:"ds-th__sort-icon",children:e.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function Xt({children:t,align:s="left",secondary:n,muted:a,truncate:r,nowrap:o,className:i="",...l}){return e.jsx("td",{className:["ds-td",s!=="left"?`ds-table-cell--${s}`:"",n?"ds-table-cell--secondary":"",a?"ds-table-cell--muted":"",r?"ds-table-cell--truncate":"",o?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:t})}function Yt({icon:t,title:s,description:n,action:a,size:r="m",className:o="",...i}){return e.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${r}`,o].filter(Boolean).join(" "),...i,children:[t&&e.jsx("div",{className:"ds-empty-state__icon",children:t}),e.jsx("div",{className:"ds-empty-state__title",children:s}),n&&e.jsx("div",{className:"ds-empty-state__description",children:n}),a&&e.jsx("div",{className:"ds-empty-state__action",children:a})]})}function qt({label:t,hint:s,error:n,required:a=!1,disabled:r=!1,htmlFor:o,children:i,className:l="",style:d,...f}){const u=c.useId(),h=o??u,x=`${h}-hint`,m=`${h}-error`;return e.jsxs("div",{className:`ds-field${l?` ${l}`:""}`,"data-state":n?"error":void 0,"data-required":a?"":void 0,"data-disabled":r?"":void 0,style:d,...f,children:[t&&e.jsx("label",{className:"ds-field-label",htmlFor:h,children:t}),e.jsx("div",{className:"ds-field-control",children:i}),s&&!n&&e.jsx("p",{className:"ds-field-hint",id:x,children:s}),n&&e.jsx("p",{className:"ds-field-error",id:m,role:"alert",children:n})]})}function Gt({label:t,value:s,delta:n,size:a="m",inline:r=!1,className:o="",style:i,...l}){const d=n!=null&&n.startsWith("+")?"up":n!=null&&n.startsWith("-")?"down":"neutral";return e.jsxs("div",{className:["ds-stat",`ds-stat--${a}`,r&&"ds-stat--inline",o].filter(Boolean).join(" "),style:i,...l,children:[t&&e.jsx("span",{className:"ds-stat-label",children:t}),s!=null&&e.jsx("span",{className:"ds-stat-value",children:s}),n!=null&&e.jsx("span",{className:`ds-stat-delta ds-stat-delta--${d}`,children:n})]})}function Kt({children:t,separator:s="/","aria-label":n,className:a="",style:r,...o}){const i=Y(),l=c.Children.toArray(t).filter(Boolean);return e.jsx("nav",{className:`ds-breadcrumb${a?` ${a}`:""}`,"aria-label":n??i.breadcrumb,style:r,...o,children:e.jsx("ol",{className:"ds-breadcrumb-list",children:l.map((d,f)=>e.jsxs("li",{className:"ds-breadcrumb-item",children:[d,f<l.length-1&&e.jsx("span",{className:"ds-breadcrumb-sep","aria-hidden":"true",children:s})]},f))})})}function Jt({page:t,total:s,onChange:n,siblings:a=1,"aria-label":r,previousLabel:o,nextLabel:i,className:l="",style:d,...f}){const u=Y(),{t:h}=me(),x=Zt(t,s,a);return e.jsxs("nav",{className:`ds-pagination${l?` ${l}`:""}`,"aria-label":r??u.pagination,style:d,...f,children:[e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t-1),disabled:t<=1,"aria-label":o??u.previousPage,children:e.jsx(T.ChevronLeft,{size:16})}),x.map((m,b)=>m==="…"?e.jsx("span",{className:"ds-pagination-gap","aria-hidden":"true",children:"…"},`gap-${b}`):e.jsx("button",{className:`ds-pagination-page${m===t?" ds-pagination-page--current":""}`,onClick:()=>m!==t&&(n==null?void 0:n(m)),"aria-current":m===t?"page":void 0,"aria-label":h("pageN",{n:m}),children:m},m)),e.jsx("button",{className:"ds-pagination-arrow",onClick:()=>n==null?void 0:n(t+1),disabled:t>=s,"aria-label":i??u.nextPage,children:e.jsx(T.ChevronRight,{size:16})})]})}function Zt(t,s,n){if(s<=7)return Array.from({length:s},(i,l)=>l+1);const a=Math.max(2,t-n),r=Math.min(s-1,t+n),o=[1];a>2&&o.push("…");for(let i=a;i<=r;i++)o.push(i);return r<s-1&&o.push("…"),o.push(s),o}const Qt=300;function es({children:t,title:s,onClose:n,subHeader:a,side:r="right",size:o="wide",offsetLeft:i=0,offsetRight:l=0,keepOpenRef:d,closeLabel:f,...u}){const h=Y(),x=c.useRef(null),m=c.useId(),[b,N]=c.useState(!1),w=()=>{!n||b||(N(!0),setTimeout(()=>{N(!1),n()},Qt))};c.useEffect(()=>{const _=D=>{D.key==="Escape"&&w()},I=D=>{var F,R,L,z;const P=((R=(F=D.composedPath)==null?void 0:F.call(D))==null?void 0:R[0])??D.target;(L=d==null?void 0:d.current)!=null&&L.contains(P)||x.current&&!x.current.contains(P)&&!((z=P.closest)!=null&&z.call(P,"[data-ds-portal]"))&&w()};return document.addEventListener("keydown",_),document.addEventListener("mousedown",I),()=>{document.removeEventListener("keydown",_),document.removeEventListener("mousedown",I)}},[n,b,d]);const y=c.Children.toArray(t),k=y.find(_=>(_==null?void 0:_.type)===Te||(_==null?void 0:_.type)===de),E=y.filter(_=>(_==null?void 0:_.type)!==Te&&(_==null?void 0:_.type)!==de),g=e.jsx("div",{className:["ds-side-page-overlay",b&&"ds-side-page-overlay--closing"].filter(Boolean).join(" "),"data-side":r,style:{"--ds-side-page-offset-left":`${i}px`,"--ds-side-page-offset-right":`${l}px`},...u,children:e.jsxs("div",{ref:x,className:["ds-side-page",b&&"ds-side-page--closing"].filter(Boolean).join(" "),"data-side":r,"data-size":o,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,children:[n&&e.jsx(se,{className:"ds-side-page__close",variant:"ghost",size:"small",icon:e.jsx(T.X,{size:W[2],strokeWidth:1.5}),onClick:w,"aria-label":f??h.close}),(s||a)&&e.jsxs("div",{className:"ds-side-page__header",children:[s&&e.jsx("h3",{id:m,className:"ds-side-page__title",children:s}),a&&e.jsx("div",{className:"ds-side-page__subheader",children:a})]}),e.jsx("div",{className:"ds-side-page__body ds-scrollable",children:E}),k]})});return typeof document>"u"?g:ne.createPortal(g,document.body)}function Te({children:t}){return!t||c.Children.count(t)===0?null:e.jsx("div",{className:"ds-side-page__footer",children:t})}const pe=c.createContext({collapsed:!1,side:"left"}),ye=c.createContext(!1),ts=c.forwardRef(function({children:s,collapsed:n=!1,side:a="left",onExpand:r,onCollapse:o,className:i="",...l},d){const f=["ds-nav-rail",n&&"ds-nav-rail--collapsed",`ds-nav-rail--${a}`,i].filter(Boolean).join(" "),u=c.useCallback(h=>{if(!h.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')){if(n&&r){r();return}!n&&o&&o()}},[n,r,o]);return e.jsx(pe.Provider,{value:{collapsed:n,side:a},children:e.jsx("nav",{ref:d,className:f,onClick:u,"data-expandable":n&&r?"":void 0,"data-collapsible":!n&&o?"":void 0,...l,children:s})})});function ss({icon:t,label:s,selected:n=!1,disabled:a=!1,href:r,onClick:o,count:i,updated:l=!1,open:d=!1,onboarding:f=!1,className:u="",...h}){const{collapsed:x,side:m}=c.useContext(pe),b=c.useContext(ye),y={className:["ds-nav-rail__item",u].filter(Boolean).join(" "),onClick:a?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":a?"true":void 0,"aria-label":x?s:void 0,tabIndex:a?-1:void 0,...{"data-selected":n||void 0,"data-disabled":a||void 0,"data-open":d||void 0,"data-onboarding":f||void 0},...h},k=i!=null,E=m==="left"?"right":"left",g=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!x&&e.jsx("span",{className:"ds-nav-rail__label",children:s}),!x&&k&&e.jsx("span",{className:["ds-nav-rail__count",i===0&&"ds-nav-rail__count--zero"].filter(Boolean).join(" "),"data-updated":l&&i!==0||void 0,children:i}),!x&&l&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot ds-nav-rail__dot--inline","aria-hidden":"true"}),x&&k&&i!==0&&e.jsx("span",{className:"ds-nav-rail__count-collapsed","data-updated":l||void 0,children:i>99?"99+":i}),x&&l&&(!k||i===0)&&e.jsx("span",{className:"ds-nav-rail__dot","aria-hidden":"true"})]}),_=r?e.jsx("a",{href:a?void 0:r,...y,children:g}):e.jsx("button",{type:"button",...y,children:g});return x&&!b?e.jsx(we,{content:s,position:E,children:_}):_}function ns({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__body","ds-scrollable",s].filter(Boolean).join(" "),...n,children:t})}function rs({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__header",s].filter(Boolean).join(" "),...n,children:t})}function as({children:t,className:s="",...n}){return e.jsx("div",{className:["ds-nav-rail__footer",s].filter(Boolean).join(" "),...n,children:t})}function os({className:t="",...s}){return e.jsx("hr",{className:["ds-nav-rail__divider",t].filter(Boolean).join(" "),...s})}function is({children:t,label:s,defaultOpen:n=!0,className:a="",...r}){const{collapsed:o}=c.useContext(pe),i=Y(),l=s??i.recents,[d,f]=c.useState(n);return e.jsxs("div",{className:["ds-nav-rail__recents",a].filter(Boolean).join(" "),...r,children:[!o&&e.jsxs("button",{type:"button",className:["ds-nav-rail__recents-toggle",!d&&"ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),onClick:()=>f(u=>!u),"aria-expanded":d,children:[e.jsx("span",{className:"ds-nav-rail__recents-label",children:l}),e.jsx(T.ChevronDown,{size:12,strokeWidth:2,className:"ds-nav-rail__recents-chevron","aria-hidden":"true"})]}),(d||o)&&e.jsx("div",{className:"ds-nav-rail__recents-body",children:t})]})}const ls=c.forwardRef(function({as:s="button",avatar:n,label:a,className:r="",...o},i){const{collapsed:l,side:d}=c.useContext(pe),f=c.useContext(ye),u=d==="left"?"right":"left",h=["ds-nav-rail__item","ds-nav-rail__agent",r].filter(Boolean).join(" "),x=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:n}),!l&&e.jsx("span",{className:"ds-nav-rail__label",children:a})]}),m=e.jsx(s,{ref:i,className:h,"aria-label":l?a:void 0,...s==="button"?{type:"button"}:{},...o,children:x});return l&&!f?e.jsx(we,{content:a,position:u,children:m}):m});function cs({avatar:t,label:s,selected:n=!1,disabled:a=!1,href:r,onClick:o,className:i="",...l}){const{collapsed:d,side:f}=c.useContext(pe),u=c.useContext(ye),m={className:["ds-nav-rail__item","ds-nav-rail__agent",i].filter(Boolean).join(" "),onClick:a?void 0:o,"aria-current":n?"page":void 0,"aria-disabled":a?"true":void 0,tabIndex:a?-1:void 0,...{"data-selected":n||void 0,"data-disabled":a||void 0},...l},b=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"ds-nav-rail__icon","aria-hidden":"true",children:t}),!d&&e.jsx("span",{className:"ds-nav-rail__label",children:s})]}),N=f==="left"?"right":"left",w=r?e.jsx("a",{href:a?void 0:r,...m,children:b}):e.jsx("button",{type:"button",...m,children:b});return d&&!u?e.jsx(we,{content:s,position:N,children:w}):w}const Me=240,Fe=6,ze=8;function ds({trigger:t,title:s,children:n,open:a,onOpenChange:r,defaultOpen:o=!1,closeLabel:i}){const l=Y(),{side:d}=c.useContext(pe),[f,u]=c.useState(o),h=a!==void 0,x=h?a:f,[m,b]=c.useState(!1),N=c.useRef(null),w=c.useRef(null),[y,k]=c.useState({}),E=c.useCallback(()=>{h?r==null||r(!0):u(!0)},[h,r]),g=c.useCallback(()=>{h?r==null||r(!1):u(!1)},[h,r]),_=c.useCallback(()=>x?g():E(),[x,E,g]),I=c.useCallback(()=>{var q;const P=N.current;if(!P)return;const F=P.getBoundingClientRect(),R=window.innerHeight,L=((q=w.current)==null?void 0:q.offsetHeight)??300,z=Math.max(ze,Math.min(R-L-ze,F.top));k(d==="right"?{position:"fixed",top:z,right:window.innerWidth-F.left+Fe,width:Me}:{position:"fixed",top:z,left:F.right+Fe,width:Me})},[d]);c.useEffect(()=>{if(!x){b(!1);return}return I(),requestAnimationFrame(()=>b(!0)),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[x,I]),c.useEffect(()=>{if(!x)return;const P=R=>{var L,z;!((L=w.current)!=null&&L.contains(R.target))&&!((z=N.current)!=null&&z.contains(R.target))&&g()},F=R=>{R.key==="Escape"&&g()};return document.addEventListener("mousedown",P),document.addEventListener("keydown",F),()=>{document.removeEventListener("mousedown",P),document.removeEventListener("keydown",F)}},[x,g]);const D=x&&e.jsxs("div",{ref:w,className:["ds-nav-rail-flyout",`ds-nav-rail-flyout--${d}`,m&&"ds-nav-rail-flyout--visible"].filter(Boolean).join(" "),style:y,"data-ds-portal":"",role:"dialog","aria-modal":"false",children:[s!=null&&e.jsxs("div",{className:"ds-nav-rail-flyout__header",children:[e.jsx("span",{className:"ds-nav-rail-flyout__title",children:s}),e.jsx("button",{type:"button",className:"ds-nav-rail-flyout__close",onClick:g,"aria-label":i??l.close,children:e.jsx(T.X,{size:16,strokeWidth:2})})]}),e.jsx("div",{className:"ds-nav-rail-flyout__body",children:n})]});return e.jsxs(e.Fragment,{children:[e.jsx(ye.Provider,{value:x,children:e.jsx("div",{ref:N,onClick:_,style:{display:"flex",flexDirection:"column",width:"100%"},children:t})}),typeof document<"u"&&ne.createPortal(D,document.body)]})}const us={info:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};function fs({children:t,variant:s="info",action:n,onAction:a,onDismiss:r,role:o,dismissLabel:i,...l}){const d=Y(),f=us[s],u=o||(s==="error"?"alert":"status");return e.jsxs("div",{className:`ds-banner ds-banner--${s}`,role:u,...l,children:[f&&e.jsx("span",{className:"ds-banner-icon","aria-hidden":"true",children:e.jsx(f,{size:W[2],strokeWidth:1.5})}),e.jsx("span",{className:"ds-banner-text",children:t}),n&&e.jsx("button",{type:"button",className:"ds-banner-action",onClick:a,children:n}),r&&e.jsx("button",{type:"button",className:"ds-banner-dismiss",onClick:r,"aria-label":i??d.dismiss,children:e.jsx(T.X,{size:W[2],strokeWidth:1.5})})]})}function ms({trigger:t,items:s=[],open:n,onOpenChange:a,align:r="left",fullWidth:o=!1,className:i="",style:l,...d}){const[f,u]=c.useState(!1),[h,x]=c.useState(!1),m=n!==void 0,b=m?n:f,N=c.useRef(null),w=c.useRef(null),y=c.useRef(null),k=c.useRef(null),[E,g]=c.useState({}),_=c.useRef(null),I=150,D=()=>{if(m)a==null||a(!1);else{if(h)return;x(!0),_.current=setTimeout(()=>{u(!1),x(!1)},I)}},P=()=>{const j=!b;m?a==null||a(j):j?(clearTimeout(_.current),x(!1),u(!0)):D()},F=()=>{b||(m?a==null||a(!0):(clearTimeout(_.current),x(!1),u(!0)))};c.useEffect(()=>()=>clearTimeout(_.current),[]),c.useEffect(()=>{if(!b)return;const j=300,B=()=>{var O;const $=(O=N.current)==null?void 0:O.getBoundingClientRect();if(!$)return;const X=window.innerHeight-$.bottom,U=X<j+8&&$.top>X;g(r==="right"?U?{bottom:window.innerHeight-$.top+4,top:"auto",right:window.innerWidth-$.right}:{top:$.bottom+4,bottom:"auto",right:window.innerWidth-$.right}:U?{bottom:window.innerHeight-$.top+4,top:"auto",left:$.left}:{top:$.bottom+4,bottom:"auto",left:$.left})};return B(),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B)}},[b,r]);const R=()=>{var B;const j=(B=y.current)==null?void 0:B.querySelector('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea');j==null||j.focus()};c.useEffect(()=>{if(!b)return;const j=$=>{var X,U;!((X=N.current)!=null&&X.contains($.target))&&!((U=w.current)!=null&&U.contains($.target))&&D()},B=$=>{$.key==="Escape"&&(D(),R())};return document.addEventListener("mousedown",j),document.addEventListener("keydown",B),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",B)}},[b]),c.useEffect(()=>{if(!b||!k.current||!w.current)return;const j=L(),B=k.current==="last"?j[j.length-1]:j[0];B==null||B.focus(),k.current=null},[b]);const L=()=>w.current?[...w.current.querySelectorAll('button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])')]:[],z=j=>{var B,$;if(j.key==="ArrowDown")j.preventDefault(),b?(B=L()[0])==null||B.focus():(k.current="first",F());else if(j.key==="ArrowUp")if(j.preventDefault(),!b)k.current="last",F();else{const X=L();($=X[X.length-1])==null||$.focus()}},q=j=>{var X,U,O,p;const B=L(),$=B.findIndex(v=>v===document.activeElement);switch(j.key){case"ArrowDown":j.preventDefault(),(X=B[Math.min($+1,B.length-1)])==null||X.focus();break;case"ArrowUp":j.preventDefault(),$<=0?R():(U=B[$-1])==null||U.focus();break;case"Home":j.preventDefault(),(O=B[0])==null||O.focus();break;case"End":j.preventDefault(),(p=B[B.length-1])==null||p.focus();break;case"Tab":D();break}},V=b&&e.jsx("div",{ref:w,role:"menu","data-ds-portal":"",className:["ds-dropdown__menu",`ds-dropdown__menu--${r}`,h&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:E,onKeyDown:q,children:s.map((j,B)=>{if(j.separator)return e.jsx("div",{className:"ds-dropdown__separator"},B);if(j.type==="section")return e.jsxs("div",{className:"ds-dropdown__section",children:[j.label&&e.jsx("div",{className:"ds-dropdown__section-label",children:j.label}),e.jsx("div",{className:"ds-dropdown__section-content",children:j.content})]},B);const $=!!j.href,X=$?"a":"button",U=$?{href:j.disabled?void 0:j.href,"aria-disabled":j.disabled?"true":void 0}:{type:"button",disabled:j.disabled};return e.jsxs(X,{role:"menuitem",className:["ds-dropdown__item",j.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...U,onClick:()=>{var O;(O=j.onClick)==null||O.call(j),D()},children:[j.icon&&e.jsx("span",{className:"ds-dropdown__item-icon",children:j.icon}),e.jsx("span",{className:"ds-dropdown__item-label",children:j.label}),j.shortcut&&e.jsx("span",{className:"ds-dropdown__item-shortcut",children:j.shortcut})]},B)})});return e.jsxs("div",{ref:N,className:["ds-dropdown",o&&"ds-dropdown--full-width",i].filter(Boolean).join(" "),style:l,...d,children:[e.jsx("div",{ref:y,className:"ds-dropdown__trigger",onClick:P,onKeyDown:z,children:t}),typeof document<"u"&&ne.createPortal(V,document.body)]})}function ps({value:t=0,size:s="m",variant:n="default",showValue:a=!1,min:r=2,animate:o=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(r,i),d=n==="auto"?i>=70?"success":i>=50?"warning":"danger":n;return e.jsxs("div",{className:["ds-progress",`ds-progress--${s}`,!o&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[e.jsx("div",{className:"ds-progress__track",children:e.jsx("div",{className:`ds-progress__fill ds-progress__fill--${d}`,style:{width:`${l}%`}})}),a&&e.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const hs=t=>1-Math.pow(1-t,3),xs=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Ke(t,{duration:s=600}={}){const[n,a]=c.useState(t),r=c.useRef(t),o=c.useRef(null);return c.useEffect(()=>{if(xs()){a(t),r.current=t;return}const i=r.current,l=t-i;if(l===0)return;let d=null;const f=u=>{d||(d=u);const h=Math.min((u-d)/s,1);a(i+l*hs(h)),h<1?o.current=requestAnimationFrame(f):r.current=t};return o.current=requestAnimationFrame(f),()=>cancelAnimationFrame(o.current)},[t,s]),n}function vs({value:t,duration:s=600,decimals:n=0,prefix:a="",suffix:r=""}){const i=Ke(t,{duration:s}).toFixed(n);return`${a}${i}${r}`}function Je({threshold:t=.1,rootMargin:s="0px",once:n=!1}={}){const a=c.useRef(null),[r,o]=c.useState(!1);return c.useEffect(()=>{const i=a.current;if(!i)return;const l=new IntersectionObserver(([d])=>{d.isIntersecting?(o(!0),n&&l.disconnect()):n||o(!1)},{threshold:t,rootMargin:s});return l.observe(i),()=>l.disconnect()},[t,s,n]),{ref:a,inView:r}}function bs({children:t,as:s="div",once:n=!1,threshold:a=.1,rootMargin:r="0px",onEnter:o,onLeave:i,...l}){const{ref:d,inView:f}=Je({threshold:a,rootMargin:r,once:n}),u=c.useRef(!1);return c.useEffect(()=>{f&&!u.current&&(o==null||o()),!f&&u.current&&(i==null||i()),u.current=f},[f]),e.jsx(s,{ref:d,...l,children:typeof t=="function"?t(f):t})}const We={default:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};let fe=[];const $e=new Set;function Ze(){$e.forEach(t=>t([...fe]))}function _s(t){fe=[...fe,t],Ze()}function js(t){fe=fe.filter(s=>s.id!==t),Ze()}function gs(){const t=(s,n={})=>{_s({id:`${Date.now()}-${Math.random()}`,message:s,type:"default",duration:4e3,...n})};return t.success=(s,n)=>t(s,{...n,type:"success"}),t.error=(s,n)=>t(s,{...n,type:"error"}),t.warning=(s,n)=>t(s,{...n,type:"warning"}),{toast:t}}function Ns({data:t,onDismiss:s}){const n=Y(),[a,r]=c.useState(!1),o=c.useRef(null);c.useEffect(()=>(requestAnimationFrame(()=>r(!0)),t.duration>0&&(o.current=setTimeout(()=>i(),t.duration)),()=>clearTimeout(o.current)),[]);function i(){r(!1),setTimeout(()=>s(t.id),250)}const l=We[t.type]??We.default;return e.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,a&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[e.jsx("div",{className:"ds-toast__icon",children:e.jsx(l,{size:W[3],strokeWidth:1.5})}),e.jsx("span",{className:"ds-toast__message",children:t.message}),e.jsx("button",{className:"ds-toast__close",onClick:i,"aria-label":n.close,children:e.jsx(T.X,{size:W[3],strokeWidth:1.5})})]})}function ws({position:t="bottom-right"}){const[s,n]=c.useState(()=>[...fe]);return c.useEffect(()=>($e.add(n),()=>$e.delete(n)),[]),!s.length||typeof document>"u"?null:ne.createPortal(e.jsx("div",{"data-ds-portal":"",className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:s.map(a=>e.jsx(Ns,{data:a,onDismiss:js},a.id))}),document.body)}const ys={running:e.jsx(ce,{size:"xs",variant:"info",children:"Running..."}),success:e.jsx(ce,{size:"xs",variant:"success",children:"Done"}),error:e.jsx(ce,{size:"xs",variant:"error",children:"Error"})};function Qe({label:t,status:s="idle",icon:n,badge:a,defaultExpanded:r=!1,expanded:o,onToggle:i,children:l,className:d="",...f}){const u=s==="running",h=e.jsxs("span",{className:"ds-tool-card__title-row",children:[n&&e.jsx("span",{className:"ds-tool-card__icon",children:n}),e.jsx("span",{className:"ds-tool-card__label",children:t}),ys[s],a]});return l?e.jsx("div",{className:["ds-tool-card",u&&"ds-tool-card--running",d].filter(Boolean).join(" "),...f,children:e.jsx(Ne,{title:h,padding:"s",defaultExpanded:r,expanded:u?!1:o,onToggle:u?void 0:i,children:e.jsx("div",{className:"ds-tool-card__body",children:l})})}):e.jsx("div",{className:["ds-tool-card","ds-tool-card--bubble",d].filter(Boolean).join(" "),...f,children:h})}function et({text:t,size:s="xs",timeout:n=800,"aria-label":a,...r}){const o=Y(),[i,l]=c.useState(!1),d=f=>{f.currentTarget.blur(),navigator.clipboard.writeText(t).then(()=>{l(!0),setTimeout(()=>l(!1),n)})};return e.jsx(se,{variant:"ghost",size:s,state:i?"success":"idle",icon:e.jsx(T.Copy,{size:W[1],strokeWidth:1.5}),"aria-label":a??o.copyToClipboard,onClick:d,...r})}function ks({content:t,streaming:s=!1,...n}){const[a,r]=c.useState(s);return c.useEffect(()=>{r(!!s)},[s]),e.jsx(Ne,{expanded:a,onToggle:r,padding:"s",title:e.jsxs("div",{className:"ds-reasoning__title",children:[e.jsx(T.Brain,{size:W[1],strokeWidth:1.5,className:"ds-reasoning__icon"}),e.jsx(Ye,{secondary:!0,children:"Thinking"})]}),...n,children:e.jsxs(Be,{secondary:!0,style:{whiteSpace:"pre-wrap"},children:[t,s&&e.jsx("span",{className:"ds-cursor ds-cursor--line"})]})})}function Es({count:t,current:s=0,done:n=[],onChange:a,showCounter:r=!0,className:o="","aria-label":i,...l}){const d=Y(),{t:f}=me();return e.jsxs("div",{className:["ds-step-indicator",o].filter(Boolean).join(" "),...l,children:[e.jsx("div",{className:"ds-step-indicator__dots",role:"tablist","aria-label":i??d.steps,children:Array.from({length:t},(u,h)=>{const x=h===s,m=n.includes(h)&&!x,b=a&&(h<=s||n.includes(h)),N=["ds-step-indicator__dot",x&&"ds-step-indicator__dot--active",m&&"ds-step-indicator__dot--done"].filter(Boolean).join(" ");return e.jsx("button",{type:"button",className:N,role:"tab","aria-selected":x,"aria-label":f("stepN",{n:h+1}),disabled:!b||h===s,onClick:()=>a==null?void 0:a(h),children:m?e.jsx(T.Check,{size:8,strokeWidth:3}):null},h)})}),r&&e.jsxs(Be,{secondary:!0,className:"ds-step-indicator__counter",children:[s+1," / ",t]})]})}function Rs({content:t,isStreaming:s=!1,cursor:n="line",onChunk:a,className:r="",...o}){const i=c.useRef(t);return c.useEffect(()=>{t!==i.current&&(a==null||a(t),i.current=t)},[t,a]),e.jsxs("span",{className:["ds-streaming-text",r].filter(Boolean).join(" "),...o,children:[t,s&&n!=="none"&&e.jsx("span",{className:`ds-cursor ds-cursor--${n}`,"aria-hidden":"true"})]})}function Ss({role:t="assistant",header:s,footer:n,attachments:a,isStreaming:r=!1,children:o,className:i="",...l}){const d=["ds-chat-message",`ds-chat-message--${t}`,r&&"ds-chat-message--streaming",i].filter(Boolean).join(" ");return t==="system"?e.jsx("div",{className:d,...l,children:e.jsx("span",{className:"ds-chat-message__system-label",children:o})}):t==="user"?e.jsxs("div",{className:d,...l,children:[a&&e.jsx("div",{className:"ds-chat-message__attachments",children:a}),e.jsx("div",{className:"ds-chat-message__bubble",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]}):e.jsxs("div",{className:d,...l,children:[s&&e.jsx("div",{className:"ds-chat-message__header",children:s}),a&&e.jsx("div",{className:"ds-chat-message__attachments",children:a}),e.jsx("div",{className:"ds-chat-message__body",children:o}),n&&e.jsx("div",{className:"ds-chat-message__footer",children:n})]})}function Ts(t,{containerRef:s,smartPause:n=!0}={}){const a=c.useRef(!1),r=c.useRef(0);c.useEffect(()=>{const o=s==null?void 0:s.current;if(!o)return;const i=()=>{const l=o.scrollHeight-o.scrollTop-o.clientHeight<64;!l&&o.scrollTop<r.current&&(a.current=!0),l&&(a.current=!1),r.current=o.scrollTop};return o.addEventListener("scroll",i,{passive:!0}),()=>o.removeEventListener("scroll",i)},[s]),c.useEffect(()=>{const o=s==null?void 0:s.current;o&&(n&&a.current||(o.scrollTop=o.scrollHeight))},t)}function tt({prompts:t,enabled:s,typingSpeed:n=38,erasingSpeed:a=18,holdTime:r=2200,betweenTime:o=380,manualPauseMs:i=5e3}){const[l,d]=c.useState(0),[f,u]=c.useState(""),h=c.useRef("typing"),x=c.useRef(0),m=c.useRef(0),b=c.useRef(null),N=c.useRef(0);c.useEffect(()=>{m.current=l},[l]),c.useEffect(()=>{if(b.current&&(clearTimeout(b.current),b.current=null),!s||t.length===0){u(""),x.current=0,h.current="typing";return}const g=()=>{const _=Date.now();if(N.current>_){b.current=setTimeout(g,N.current-_);return}const I=t[m.current%t.length]??"";h.current==="typing"?(x.current+=1,u(I.slice(0,x.current)),x.current>=I.length?(h.current="holding",b.current=setTimeout(g,r)):b.current=setTimeout(g,n+Math.random()*28)):h.current==="holding"?(h.current="erasing",b.current=setTimeout(g,a)):(x.current=Math.max(0,x.current-1),u(I.slice(0,x.current)),x.current<=0?(h.current="typing",m.current=(m.current+1)%t.length,d(m.current),b.current=setTimeout(g,o)):b.current=setTimeout(g,a))};return b.current=setTimeout(g,260),()=>{b.current&&clearTimeout(b.current)}},[s,t,n,a,r,o]);const w=g=>{if(t.length===0)return;const _=(g%t.length+t.length)%t.length,I=t[_];m.current=_,x.current=I.length,h.current="holding",N.current=Date.now()+i,d(_),u(I)},y=()=>w(m.current+1),k=()=>w(m.current-1),E=t[l%t.length]??"";return{displayed:f,currentPrompt:E,index:l,next:y,prev:k}}let $s=0;function As({value:t="",onChange:s,onSubmit:n,onStop:a,onKeyDown:r,loading:o=!1,disabled:i=!1,placeholder:l,animatedPlaceholders:d,attachments:f,images:u,onAttachFiles:h,onAttachImages:x,onRemoveAttachment:m,onRemoveImage:b,acceptImage:N,acceptFile:w,maxImages:y,maxImageSize:k,leftSlot:E,rightSlot:g,className:_="",...I}){const D=Y(),{t:P}=me(),F=c.useRef(null),R=c.useRef(null),L=c.useRef(0),[z,q]=c.useState(!1),[V,j]=c.useState([]),B=l??D.promptPlaceholder,$=S=>{const C=++$s;j(G=>[...G,{id:C,msg:S}]),setTimeout(()=>j(G=>G.filter(J=>J.id!==C)),6e3)},X=S=>j(C=>C.filter(G=>G.id!==S)),U=S=>S.type.startsWith("image/"),O=()=>!0,p=N??U,v=w??O,A=S=>{const C=[],G=[],J=[],Q=[];let ee=0,le=y!=null?y-((u==null?void 0:u.length)??0):1/0;for(const te of S)p(te)?k&&te.size>k?J.push(te.name):le>0?(C.push(te),le--):ee++:v(te)?G.push(te):Q.push(te.name);return{imageFiles:C,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:ee}},M=S=>{const C=k?P("fileTooLargeMaxHint",{maxMb:k/1024/1024}):"";$(P("fileTooLarge",{maxHint:C,names:S.join(", ")}))},Z=S=>{const{imageFiles:C,docFiles:G,tooLarge:J,skipped:Q,limitExceeded:ee}=A(S);J.length&&M(J),Q.length&&$(P("filesSkipped",{names:Q.join(", ")})),ee&&$(P("maxImages",{n:y})),x&&C.length&&x(C);const le=G.concat(x?[]:C);h&&le.length&&h(le)};c.useEffect(()=>{const S=R.current;S&&(S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,200)}px`)},[t]),c.useEffect(()=>{const S=C=>{var J,Q,ee;if(o||i)return;const G=(J=C.target)==null?void 0:J.tagName;G==="INPUT"||G==="TEXTAREA"||G==="SELECT"||(Q=C.target)!=null&&Q.isContentEditable||C.ctrlKey||C.metaKey||C.altKey||C.key.length!==1&&C.key!=="Backspace"&&C.key!=="Delete"||(ee=R.current)==null||ee.focus()};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[o,i]);const re=S=>{S.preventDefault(),L.current++,S.dataTransfer.types.includes("Files")&&q(!0)},H=S=>{S.preventDefault(),L.current--,L.current===0&&q(!1)},K=S=>S.preventDefault(),ie=S=>{S.preventDefault(),L.current=0,q(!1);const C=Array.from(S.dataTransfer.files);C.length&&Z(C)},he=S=>{const C=Array.from(S.target.files||[]);F.current&&(F.current.value=""),C.length&&Z(C)},ke=S=>{var te;if(!x)return;const C=(te=S.clipboardData)==null?void 0:te.items;if(!C)return;const G=[];for(const at of C){const Pe=at.getAsFile();Pe&&G.push(Pe)}if(G.length===0)return;const{imageFiles:J,tooLarge:Q,skipped:ee,limitExceeded:le}=A(G);Q.length&&M(Q),ee.length&&$(P("filesSkipped",{names:ee.join(", ")})),le&&$(P("maxImages",{n:y})),J.length&&(S.preventDefault(),x(J))},xe=!o&&!i&&!!(d!=null&&d.length)&&t.length===0,je=tt({prompts:d??[],enabled:xe}),nt=S=>{if(xe){if(S.key==="ArrowDown"||S.key==="ArrowRight"){S.preventDefault(),je.next();return}if(S.key==="ArrowUp"||S.key==="ArrowLeft"){S.preventDefault(),je.prev();return}if(S.key==="Tab"&&!S.shiftKey){S.preventDefault(),s==null||s(je.currentPrompt);return}}r==null||r(S)},rt=(t.trim()||(u==null?void 0:u.length)>0||(f==null?void 0:f.length)>0)&&!i,De=h||x;return e.jsxs("div",{className:["ds-prompt-input",_].filter(Boolean).join(" "),...I,children:[De&&e.jsx("input",{ref:F,type:"file",multiple:!0,accept:"*/*",className:"ds-prompt-input__file-input",onChange:he}),e.jsxs("div",{className:["ds-prompt-input__box",z&&"ds-prompt-input__box--dragging"].filter(Boolean).join(" "),onDragEnter:re,onDragLeave:H,onDragOver:K,onDrop:ie,children:[z&&e.jsx("div",{className:"ds-prompt-input__drag-overlay",children:D.dropFilesHere}),e.jsx("textarea",{ref:R,value:t,onChange:S=>s==null?void 0:s(S.target.value),onKeyDown:nt,onPaste:ke,placeholder:xe?"":B,disabled:o||i,rows:1,className:["ds-prompt-input__textarea",xe&&"ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")}),xe&&e.jsxs("div",{className:"ds-prompt-input__anim","aria-hidden":"true",children:[e.jsx("span",{className:"ds-prompt-input__anim-text",children:je.displayed}),e.jsx("span",{className:"ds-prompt-input__anim-cursor"})]}),u&&u.length>0&&e.jsx("div",{className:"ds-prompt-input__images",children:u.map((S,C)=>e.jsxs("div",{className:"ds-prompt-input__image-thumb",children:[e.jsx("img",{src:S.preview,alt:""}),e.jsx("button",{className:"ds-prompt-input__image-remove",onClick:()=>b==null?void 0:b(C),"aria-label":D.removeImage,type:"button",children:e.jsx(T.X,{size:12,strokeWidth:2})})]},C))}),V.length>0&&e.jsx("div",{className:"ds-prompt-input__warnings",children:V.map(S=>e.jsxs("div",{className:"ds-prompt-input__warning",role:"alert",children:[e.jsx("span",{children:S.msg}),e.jsx("button",{type:"button",className:"ds-prompt-input__warning-close",onClick:()=>X(S.id),"aria-label":D.dismiss,children:e.jsx(T.X,{size:W[1],strokeWidth:1.5})})]},S.id))}),f&&f.length>0&&e.jsx("div",{className:"ds-prompt-input__attachments",children:f.map((S,C)=>e.jsx(ce,{size:"xs",children:e.jsxs("span",{className:"ds-prompt-input__badge-content",children:[S.uploading?e.jsx(T.Loader,{size:W[1],strokeWidth:1.5,className:"spin"}):e.jsx(T.Paperclip,{size:W[1],strokeWidth:1.5}),S.filename,S.uploading?e.jsx("span",{className:"ds-prompt-input__uploading",children:D.uploading}):e.jsx("button",{type:"button",className:"ds-prompt-input__remove-btn",onClick:()=>m==null?void 0:m(C),"aria-label":D.removeAttachment,children:e.jsx(T.X,{size:W[1],strokeWidth:1.5})})]})},C))}),e.jsxs("div",{className:"ds-prompt-input__toolbar",children:[De&&e.jsx(se,{variant:"ghost",size:"xs",icon:e.jsx(T.Paperclip,{size:W[2],strokeWidth:1.5}),"aria-label":D.attachFiles,onClick:()=>{var S;return(S=F.current)==null?void 0:S.click()}}),E,g,e.jsx("div",{className:"ds-prompt-input__spacer"}),o?e.jsx(se,{variant:"primary",size:"xs",icon:e.jsx(T.Square,{size:W[2],strokeWidth:1.5}),onClick:a,"aria-label":D.stop}):e.jsx(se,{variant:"primary",size:"xs",icon:e.jsx(T.ArrowUp,{size:W[2],strokeWidth:1.5}),onClick:n,disabled:!rt,"aria-label":D.send})]})]})]})}const Oe={fast:0,standard:1,premium:2},Ue={fast:"data-5",standard:"data-3",premium:"data-6"};function Is({models:t=[],value:s,onChange:n,size:a="xs",minTier:r,showAutoOption:o=!1,groupByTier:i=!0,className:l="",...d}){const[f,u]=c.useState(!1),h=c.useRef(null),x=c.useRef(null),m=c.useRef(null),[b,N]=c.useState({}),w=t.filter(R=>!r||R.name==="auto"?!0:(Oe[R.tier]??1)>=(Oe[r]??1)),y=w.find(R=>R.name==="auto"),k=w.filter(R=>R.name!=="auto"),E=t.find(R=>R.name===s),_=new Set(k.map(R=>R.tier).filter(Boolean)).size>1;c.useEffect(()=>{if(!f)return;const R=320,L=()=>{var $;const V=($=x.current)==null?void 0:$.getBoundingClientRect();if(!V)return;const j=window.innerHeight-V.bottom,B=j<R+8&&V.top>j;N({position:"fixed",zIndex:"var(--z-dropdown, 500)",left:V.left,...B?{bottom:window.innerHeight-V.top+4,top:"auto"}:{top:V.bottom+4,bottom:"auto"}})};L(),window.addEventListener("scroll",L,!0),window.addEventListener("resize",L);const z=V=>{var j,B;!((j=h.current)!=null&&j.contains(V.target))&&!((B=m.current)!=null&&B.contains(V.target))&&u(!1)},q=V=>{V.key==="Escape"&&u(!1)};return document.addEventListener("mousedown",z),document.addEventListener("keydown",q),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L),document.removeEventListener("mousedown",z),document.removeEventListener("keydown",q)}},[f]);const I=R=>{n==null||n(R),u(!1)},D=R=>e.jsxs("button",{type:"button",className:["ds-model-picker__item",R.name===s&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I(R.name),children:[R.icon?e.jsx("span",{className:"ds-model-picker__item-icon",children:R.icon}):e.jsx(T.Cpu,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:R.displayName||R.name}),_&&R.tier&&e.jsx(ce,{size:"xs",variant:Ue[R.tier]||"default",children:R.tier})]},R.name),P=()=>!i||!_?k.map(D):["fast","standard","premium"].flatMap(R=>{const L=k.filter(z=>z.tier===R);return L.length?[e.jsx("div",{className:"ds-model-picker__group-label","data-tier":R,children:R.charAt(0).toUpperCase()+R.slice(1)},`lbl-${R}`),...L.map(D)]:[]}),F=f&&e.jsxs("div",{ref:m,className:"ds-model-picker__menu ds-scrollable","data-ds-portal":"",style:b,children:[o&&y&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:["ds-model-picker__item","ds-model-picker__item--auto",s==="auto"&&"ds-model-picker__item--active"].filter(Boolean).join(" "),onClick:()=>I("auto"),children:[e.jsx(T.Zap,{size:12,strokeWidth:1.5,className:"ds-model-picker__item-icon"}),e.jsx("span",{className:"ds-model-picker__item-name",children:"Auto (smart routing)"})]}),k.length>0&&e.jsx("div",{className:"ds-model-picker__separator"})]}),P()]});return e.jsxs("div",{ref:h,className:["ds-model-picker",l].filter(Boolean).join(" "),...d,children:[e.jsxs("button",{ref:x,type:"button",className:"ds-model-picker__trigger",onClick:()=>u(R=>!R),"aria-haspopup":"listbox","aria-expanded":f,children:[E!=null&&E.icon?e.jsx("span",{children:E.icon}):e.jsx(T.Cpu,{size:12,strokeWidth:1.5}),e.jsx("span",{className:"ds-model-picker__trigger-name",children:(E==null?void 0:E.displayName)||(E==null?void 0:E.name)||s}),_&&(E==null?void 0:E.tier)&&e.jsx(ce,{size:"xs",variant:Ue[E.tier]||"default",children:E.tier})]}),typeof document<"u"&&ne.createPortal(F,document.body)]})}const Bs=({filename:t,pagesLabel:s})=>e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0},children:[e.jsx("span",{className:"ds-sources-panel__filename",children:t}),s&&e.jsx("span",{className:"ds-sources-panel__pages",children:s})]});function Ds(t){const s=new Map;for(const n of t)s.has(n.filename)||s.set(n.filename,{filename:n.filename,url:n.url,items:[]}),s.get(n.filename).items.push(n);return[...s.values()]}function Ps({sources:t=[],layout:s="list",title:n,maxVisible:a=5,onSourceClick:r}){const o=Y(),{t:i}=me(),l=n??o.sources,[d,f]=c.useState(!1),u=Ds(t),h=u.length>a,x=d?u:u.slice(0,a),m=t.some(y=>y.snippet),b=y=>y!=null&&y.length?i("pageAbbrev",{pages:y.join(", ")}):null,N=i("moreSources",{n:u.length-a}),w=["ds-sources-panel",s==="compact"&&"ds-sources-panel--compact"].filter(Boolean).join(" ");return s==="compact"?e.jsxs("div",{className:w,children:[x.map(y=>{const k=y.items.map(_=>_.page).filter(Boolean),E=b(k),g=!!r;return e.jsxs("div",{className:`ds-sources-panel__compact-row${g?" ds-sources-panel__compact-row--clickable":""}`,onClick:g?()=>r(y.items[0]):void 0,children:[e.jsx(T.FileText,{size:W[1],strokeWidth:1.5,className:"ds-sources-panel__compact-icon"}),e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),E&&e.jsx("span",{className:"ds-sources-panel__pages",children:E})]},y.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]}):e.jsxs("div",{className:w,children:[l&&e.jsx("div",{className:"ds-sources-panel__title",children:l}),x.map(y=>{const k=y.items.map(_=>_.page).filter(Boolean),E=b(k),g=!!r;return m?e.jsx(Ne,{title:e.jsx(Bs,{filename:y.filename,pagesLabel:E}),padding:"s",children:y.items.map((_,I)=>e.jsx("div",{className:`ds-sources-panel__snippet${g?" ds-sources-panel__snippet--clickable":""}`,onClick:g?()=>r(_):void 0,children:_.snippet??i("pageAbbrev",{pages:_.page})},I))},y.filename):e.jsxs("div",{className:`ds-sources-panel__row${g?" ds-sources-panel__row--clickable":""}`,onClick:g?()=>r(y.items[0]):void 0,children:[e.jsx("span",{className:"ds-sources-panel__filename",children:y.filename}),E&&e.jsx("span",{className:"ds-sources-panel__pages",children:E})]},y.filename)}),h&&!d&&e.jsx("button",{className:"ds-sources-panel__more",onClick:()=>f(!0),children:N})]})}function He(t){return t>=1e6?(t/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e3?(t/1e3).toFixed(1).replace(/\.0$/,"")+"K":String(t)}function Ls({used:t,limit:s,size:n="s",showCount:a=!0,showPercent:r=!1,warningThreshold:o=.8,errorThreshold:i=1}){const l=s>0?t/s:0,d=Math.min(l*100,100),f=l>=i?"error":l>=o?"warning":"normal";return e.jsxs("div",{className:`ds-token-counter ds-token-counter--${n}`,role:"meter","aria-valuenow":t,"aria-valuemax":s,children:[e.jsx("div",{className:"ds-token-counter__track",children:e.jsx("div",{className:`ds-token-counter__fill ds-token-counter__fill--${f}`,style:{width:`${d}%`}})}),(a||r)&&e.jsxs("div",{className:`ds-token-counter__label ds-token-counter__label--${f}`,children:[a&&e.jsxs("span",{children:[He(t)," / ",He(s)]}),r&&e.jsxs("span",{style:{marginLeft:"auto"},children:[Math.round(l*100),"%"]})]})]})}const Ve=5;function Cs(t){return t<.34?"low":t<.67?"medium":"high"}function Ms({value:t=0,size:s="xs",showLabel:n="none",layout:a="inline"}){const r=Math.max(0,Math.min(1,t)),o=Math.round(r*Ve),i=Cs(r);return e.jsxs("div",{className:["ds-confidence-bar",`ds-confidence-bar--${s}`,`ds-confidence-bar--${i}`,a==="block"&&"ds-confidence-bar--block"].filter(Boolean).join(" "),children:[e.jsx("div",{className:"ds-confidence-bar__segments","aria-hidden":"true",children:Array.from({length:Ve},(l,d)=>e.jsx("div",{className:`ds-confidence-bar__seg${d<o?" ds-confidence-bar__seg--filled":""}`},d))}),n==="text"&&e.jsx("span",{className:"ds-confidence-bar__label",children:i})]})}const Fs={add:"+",remove:"-",context:" "};function Ee({line:t,lineNumbers:s}){return e.jsxs("div",{className:`ds-diff-view__line ds-diff-view__line--${t.type}`,children:[s&&t.lineNo!=null&&e.jsx("span",{className:"ds-diff-view__lineno",children:t.lineNo}),e.jsx("span",{className:"ds-diff-view__prefix",children:Fs[t.type]}),e.jsx("span",{className:"ds-diff-view__text",children:t.text})]})}function zs({lines:t=[],layout:s="inline",wordWrap:n=!1,lineNumbers:a=!0,maxHeight:r,title:o}){const i=["ds-diff-view",`ds-diff-view--${s}`,n&&"ds-diff-view--wrap"].filter(Boolean).join(" "),l=r?{maxHeight:r,overflowY:"auto"}:void 0;if(s==="split"){const d=t.filter(u=>u.type==="remove"||u.type==="context"),f=t.filter(u=>u.type==="add"||u.type==="context");return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsxs("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:[e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:d.map((u,h)=>e.jsx(Ee,{line:u,lineNumbers:a},h))}),e.jsx("div",{className:"ds-diff-view__split-col ds-scrollable",children:f.map((u,h)=>e.jsx(Ee,{line:u,lineNumbers:a},h))})]})]})}return e.jsxs("div",{className:i,children:[o&&e.jsx("div",{className:"ds-diff-view__title",children:o}),e.jsx("div",{className:"ds-diff-view__body ds-scrollable",style:l,children:t.map((d,f)=>e.jsx(Ee,{line:d,lineNumbers:a},f))})]})}function st({value:t="idle",onLike:s,onDislike:n,className:a="",likeLabel:r,dislikeLabel:o,...i}){const l=Y(),d=t!=="idle";return e.jsxs("div",{className:["ds-message-feedback",d&&"ds-message-feedback--voted",a].filter(Boolean).join(" "),...i,children:[(!d||t==="liked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="liked"&&"ds-message-feedback__btn--liked"].filter(Boolean).join(" "),onClick:s,disabled:d,"aria-label":r??l.like,"aria-pressed":t==="liked",children:e.jsx(T.ThumbsUp,{size:W[1],strokeWidth:1.5,fill:t==="liked"?"currentColor":"none"})}),(!d||t==="disliked")&&e.jsx("button",{className:["ds-message-feedback__btn",t==="disliked"&&"ds-message-feedback__btn--disliked"].filter(Boolean).join(" "),onClick:n,disabled:d,"aria-label":o??l.dislike,"aria-pressed":t==="disliked",children:e.jsx(T.ThumbsDown,{size:W[1],strokeWidth:1.5,fill:t==="disliked"?"currentColor":"none"})})]})}function Ws(t){const s=t instanceof Date?t:new Date(t);if(isNaN(s))return null;const n=new Date,a=s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(r-864e5);if(s>=r)return a;if(s>=o)return`Yesterday ${a}`;const i=s.getDate(),l=s.toLocaleString([],{month:"short"});return`${i} ${l} ${a}`}function Os({role:t="assistant",text:s,timestamp:n,feedbackValue:a="idle",onLike:r,onDislike:o,className:i="",...l}){const d=t==="assistant"&&(r||o),f=!!s,u=n?Ws(n):null;return!d&&!f&&!u?null:e.jsxs("div",{className:["ds-message-footer",`ds-message-footer--${t}`,i].filter(Boolean).join(" "),...l,children:[t==="user"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u}),d&&e.jsx(st,{className:"ds-message-action",value:a,onLike:r,onDislike:o}),f&&e.jsx(et,{className:"ds-message-action",text:s}),t==="assistant"&&u&&e.jsx("span",{className:"ds-message-footer__timestamp ds-message-action",children:u})]})}function Us({label:t,className:s="",...n}){return e.jsxs("span",{className:["ds-thinking-dot",s].filter(Boolean).join(" "),...n,children:[e.jsx("span",{className:"ds-thinking-dot__pulse"}),t&&e.jsx("span",{className:"ds-thinking-dot__label",children:t})]})}function Hs({variant:t="light",glow:s,mask:n=!0,style:a,...r}){const o=t==="dark",i=s??o,l=o?"rgba(255,250,250,0.05)":"var(--color-border-light)",d=o?"rgba(255,250,250,0.025)":"color-mix(in srgb, var(--color-border-light) 50%, transparent)";return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden",zIndex:0,...i&&{background:"radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"},...a},...r,children:e.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:[`linear-gradient(${l} 1px, transparent 1px)`,`linear-gradient(90deg, ${l} 1px, transparent 1px)`,`linear-gradient(${d} 1px, transparent 1px)`,`linear-gradient(90deg, ${d} 1px, transparent 1px)`].join(", "),backgroundSize:"80px 80px, 80px 80px, 16px 16px, 16px 16px",backgroundPosition:"-1px -1px, -1px -1px, -1px -1px, -1px -1px",...n&&{WebkitMaskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)",maskImage:"radial-gradient(ellipse at center, #000 30%, transparent 85%)"}}})})}function Vs({children:t,axis:s="y",style:n,className:a="",...r}){const o=s==="x"?{overflowX:"auto",overflowY:"hidden"}:s==="both"?{overflow:"auto"}:{overflowY:"auto",overflowX:"hidden"};return e.jsx("div",{className:`ds-scrollable ${a}`,style:{...o,...n},...r,children:t})}const Re=280,Xs=22,Ys=14,oe=8,ge=6,qs=200;function Gs(t){return t?typeof t=="function"?t():typeof t=="string"?document.querySelector(t):null:null}function Ks(t,s,n,a){const r=window.innerWidth,o=window.innerHeight;if(o-t.bottom>=s+a+oe)return"bottom";if(t.top>=s+a+oe)return"top";if(r-t.right>=n+a+oe)return"right";if(t.left>=n+a+oe)return"left";const i=Math.max(t.top,o-t.bottom,r-t.right,t.left);return i===o-t.bottom?"bottom":i===t.top?"top":i===r-t.right?"right":"left"}function Js(t,s,n,a,r){const o=window.innerWidth,i=window.innerHeight;let l,d;switch(t){case"top":l=s.top-n-r,d=s.left+s.width/2-a/2;break;case"bottom":l=s.bottom+r,d=s.left+s.width/2-a/2;break;case"left":l=s.top+s.height/2-n/2,d=s.left-a-r;break;default:l=s.top+s.height/2-n/2,d=s.right+r}const f=Math.max(oe,Math.min(o-a-oe,d)),u=Math.max(oe,Math.min(i-n-oe,l));return{top:u,left:f,arrowOffset:d-f,arrowOffsetY:l-u}}function Zs({steps:t,currentStep:s,onNext:n,onBack:a,onSkip:r,onFinish:o,overlay:i=!0,ring:l=!0,labelNext:d,labelBack:f,labelSkip:u,labelFinish:h,statePrimary:x="idle",stateBack:m="idle"}){const b=Y(),{t:N}=me(),w=d??b.next,y=f??b.back,k=u??b.skipTour,E=h??b.done,g=c.useRef(null),_=c.useRef(t),I=c.useRef(s),D=c.useRef(l);_.current=t,I.current=s,D.current=l;const[P,F]=c.useState(!1),[R,L]=c.useState({position:"fixed",visibility:"hidden",width:Re}),[z,q]=c.useState("bottom"),[V,j]=c.useState(null),B=c.useRef(!1),$=t[s],X=s===t.length-1,U=c.useCallback(()=>{const O=_.current[I.current];if(!O||!g.current)return;const p=Gs(O.target);if(!p)return;const v=p.getBoundingClientRect(),M=g.current.getBoundingClientRect().height||160,Z=Re,re=D.current?Xs:Ys,H=O.position||Ks(v,M,Z,re),{top:K,left:ie,arrowOffset:he,arrowOffsetY:ke}=Js(H,v,M,Z,re);q(H),L({position:"fixed",top:K,left:ie,width:Re,visibility:"visible","--arrow-offset":`${he}px`,"--arrow-offset-y":`${ke}px`}),j({top:v.top-ge,left:v.left-ge,width:v.width+ge*2,height:v.height+ge*2})},[]);return c.useEffect(()=>{window.addEventListener("scroll",U,!0),window.addEventListener("resize",U);const O=requestAnimationFrame(()=>{U(),F(!0),B.current=!0});return()=>{cancelAnimationFrame(O),window.removeEventListener("scroll",U,!0),window.removeEventListener("resize",U)}},[]),c.useEffect(()=>{if(!B.current)return;F(!1);const O=setTimeout(()=>{L(p=>({...p,visibility:"hidden"})),requestAnimationFrame(()=>{U(),F(!0)})},qs+20);return()=>clearTimeout(O)},[s]),c.useEffect(()=>{P&&g.current&&g.current.focus({preventScroll:!0})},[P]),c.useEffect(()=>{const O=p=>{p.key==="Escape"&&r()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[r]),c.useEffect(()=>{if(!P)return;const O=p=>{if(p.key!=="Tab"||!g.current)return;const v=Array.from(g.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'));if(!v.length)return;const A=v[0],M=v[v.length-1];p.shiftKey&&document.activeElement===A?(p.preventDefault(),M.focus()):!p.shiftKey&&document.activeElement===M&&(p.preventDefault(),A.focus())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[P]),!$||typeof document>"u"?null:ne.createPortal(e.jsxs(e.Fragment,{children:[V&&e.jsx("div",{className:["ds-coachmark__spotlight",i&&"ds-coachmark__spotlight--overlay",!l&&"ds-coachmark__spotlight--no-ring",P&&"ds-coachmark__spotlight--visible"].filter(Boolean).join(" "),style:V,"aria-hidden":"true"}),e.jsxs("div",{ref:g,"data-ds-portal":"",role:"dialog","aria-modal":"false","aria-live":"polite","aria-label":$.title??N("stepOf",{current:s+1,total:t.length}),className:["ds-coachmark__bubble",`ds-coachmark__bubble--${z}`,P&&"ds-coachmark__bubble--visible"].filter(Boolean).join(" "),style:R,tabIndex:-1,children:[e.jsx("button",{type:"button",className:"ds-coachmark__close",onClick:r,"aria-label":k,children:e.jsx(T.X,{size:16,strokeWidth:2})}),$.title&&e.jsx("div",{className:"ds-coachmark__title",children:$.title}),e.jsx("div",{className:"ds-coachmark__body",children:$.content}),e.jsxs("div",{className:"ds-coachmark__footer",children:[t.length>1&&e.jsxs("span",{className:"ds-coachmark__counter",children:[s+1," / ",t.length]}),e.jsxs("div",{className:"ds-coachmark__footer-nav",children:[s>0&&e.jsx(se,{variant:"secondary",size:"s",state:m,onClick:a,children:y}),e.jsx(se,{variant:"primary",size:"s",state:x,onClick:X?o:n,children:X?E:w})]})]})]})]}),document.body)}function Qs(t,s={}){const{storageKey:n}=s,[a,r]=c.useState(0),[o,i]=c.useState(!1),l=()=>n&&typeof localStorage<"u"&&localStorage.getItem(n)==="done",d=c.useCallback(()=>{i(!1),n&&typeof localStorage<"u"&&localStorage.setItem(n,"done")},[n]);return{currentStep:a,isActive:o,start:()=>{l()||(r(0),i(!0))},next:()=>r(f=>Math.min(f+1,t.length-1)),back:()=>r(f=>Math.max(f-1,0)),skip:d,finish:d}}function en(){const t=c.useRef(null),s=c.useCallback(()=>{const n=t.current;if(!n)return;n.classList.remove("ds-shake"),n.offsetWidth,n.classList.add("ds-shake");const a=()=>{n.classList.remove("ds-shake"),n.removeEventListener("animationend",a)};n.addEventListener("animationend",a)},[]);return{ref:t,shake:s}}exports.Accordion=Ne;exports.Alert=gt;exports.AnimatedNumber=vs;exports.Avatar=Ft;exports.Badge=ce;exports.Banner=fs;exports.BottomSheet=kt;exports.Breadcrumb=Kt;exports.Button=se;exports.Card=pt;exports.ChatMessage=Ss;exports.Checkbox=Dt;exports.Coachmark=Zs;exports.Code=Et;exports.CodeAccordion=qe;exports.ConfidenceBar=Ms;exports.CopyButton=et;exports.DiffView=zs;exports.Dropdown=ms;exports.EmptyState=Yt;exports.EngineerGrid=Hs;exports.FormField=qt;exports.H1=ht;exports.H2=xt;exports.H3=vt;exports.H4=bt;exports.InView=bs;exports.Input=dt;exports.Link=Rt;exports.LocaleProvider=lt;exports.MessageFeedback=st;exports.MessageFooter=Os;exports.Modal=wt;exports.ModalFooter=de;exports.ModelPicker=Is;exports.NavRail=ts;exports.NavRailAgent=cs;exports.NavRailBody=ns;exports.NavRailCustomItem=ls;exports.NavRailDivider=os;exports.NavRailFlyout=ds;exports.NavRailFooter=as;exports.NavRailHeader=rs;exports.NavRailItem=ss;exports.NavRailRecents=is;exports.P1=_t;exports.P2=Ye;exports.P3=Be;exports.Pagination=Jt;exports.ProgressBar=ps;exports.PromptInput=As;exports.Radio=Pt;exports.ReasoningBlock=ks;exports.Scrollable=Vs;exports.SegmentedControl=$t;exports.Select=ft;exports.SidePage=es;exports.SidePageFooter=Te;exports.Skeleton=Ge;exports.SourcesPanel=Ps;exports.Spinner=Xe;exports.Stat=Gt;exports.StepIndicator=Es;exports.Stepper=mt;exports.StreamingText=Rs;exports.Tab=Tt;exports.Table=zt;exports.TableBody=Ot;exports.TableHead=Wt;exports.TableRow=Ut;exports.TableSubheaderRow=Ht;exports.Tabs=St;exports.Td=Xt;exports.Textarea=ut;exports.Th=Vt;exports.ThinkingDot=Us;exports.ToastContainer=ws;exports.Toggle=Bt;exports.TokenCounter=Ls;exports.ToolCallBubble=Qe;exports.ToolCallCard=Qe;exports.Tooltip=we;exports.defaultStrings=_e;exports.formatString=Ae;exports.iconSizes=W;exports.useAnimatedNumber=Ke;exports.useAnimatedPlaceholder=tt;exports.useCoachmark=Qs;exports.useInView=Je;exports.useLocale=me;exports.useShake=en;exports.useStreamScroll=Ts;exports.useStrings=Y;exports.useToast=gs;
package/dist/index.d.ts CHANGED
@@ -29,13 +29,22 @@ export interface ButtonProps extends Omit<HTMLAttributes<HTMLElement>, 'onClick'
29
29
  fullWidth?: boolean;
30
30
  icon?: ReactNode;
31
31
  disabled?: boolean;
32
+ /** Async feedback: loading spinner / success / error. */
32
33
  state?: 'idle' | 'loading' | 'success' | 'error';
34
+ /**
35
+ * Toggle-on / latched look (filters, toolbars). Sets `data-active` and
36
+ * defaults `aria-pressed`. Distinct from momentary CSS `:active` press.
37
+ */
38
+ active?: boolean;
39
+ /** Alias of `active`. */
40
+ pressed?: boolean;
33
41
  onClick?: (e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
34
42
  type?: 'button' | 'submit' | 'reset';
35
43
  href?: string;
36
44
  target?: string;
37
45
  rel?: string;
38
46
  'aria-label'?: string;
47
+ 'aria-pressed'?: boolean | 'true' | 'false' | 'mixed';
39
48
  }
40
49
 
41
50
  export declare function Button(props: ButtonProps): JSX.Element;