@donkit-ai/design-system 1.1.26 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),K=require("react-dom"),T=require("lucide-react"),P={1:16,2:20,3:24,4:28,5:48};var se={exports:{}},q={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),E=require("lucide-react"),K=require("react-dom"),P={1:16,2:20,3:24,4:28,5:48};var se={exports:{}},q={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ae;function be(){if(ae)return q;ae=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(o,n,a){var i=null;if(a!==void 0&&(i=""+a),n.key!==void 0&&(i=""+n.key),"key"in n){a={};for(var l in n)l!=="key"&&(a[l]=n[l])}else a=n;return n=a.ref,{$$typeof:t,type:o,key:i,ref:n!==void 0?n:null,props:a}}return q.Fragment=e,q.jsx=r,q.jsxs=r,q}var H={};/**
9
+ */var ae;function he(){if(ae)return q;ae=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(o,n,a){var i=null;if(a!==void 0&&(i=""+a),n.key!==void 0&&(i=""+n.key),"key"in n){a={};for(var l in n)l!=="key"&&(a[l]=n[l])}else a=n;return n=a.ref,{$$typeof:t,type:o,key:i,ref:n!==void 0?n:null,props:a}}return q.Fragment=e,q.jsx=r,q.jsxs=r,q}var H={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -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 oe;function he(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){function t(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===O?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case E:return"Fragment";case $:return"Profiler";case R:return"StrictMode";case F:return"Suspense";case v:return"SuspenseList";case C:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case _:return"Portal";case S:return c.displayName||"Context";case N:return(c._context.displayName||"Context")+".Consumer";case D:var x=c.render;return c=c.displayName,c||(c=x.displayName||x.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case I:return x=c.displayName||null,x!==null?x:t(c.type)||"Memo";case A:x=c._payload,c=c._init;try{return t(c(x))}catch{}}return null}function e(c){return""+c}function r(c){try{e(c);var x=!1}catch{x=!0}if(x){x=console;var y=x.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return y.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),e(c)}}function o(c){if(c===E)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===A)return"<...>";try{var x=t(c);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function n(){var c=B.A;return c===null?null:c.getOwner()}function a(){return Error("react-stack-top-frame")}function i(c){if(X.call(c,"key")){var x=Object.getOwnPropertyDescriptor(c,"key").get;if(x&&x.isReactWarning)return!1}return c.key!==void 0}function l(c,x){function y(){M||(M=!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)",x))}y.isReactWarning=!0,Object.defineProperty(c,"key",{get:y,configurable:!0})}function p(){var c=t(this.type);return Y[c]||(Y[c]=!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.")),c=this.props.ref,c!==void 0?c:null}function f(c,x,y,g,J,ee){var k=y.ref;return c={$$typeof:j,type:c,key:x,props:y,_owner:g},(k!==void 0?k:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:p}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function m(c,x,y,g,J,ee){var k=x.children;if(k!==void 0)if(g)if(Z(k)){for(g=0;g<k.length;g++)b(k[g]);Object.freeze&&Object.freeze(k)}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 b(k);if(X.call(x,"key")){k=t(c);var V=Object.keys(x).filter(function(pe){return pe!=="key"});g=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",U[k+g]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var oe;function be(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){function t(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===O?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case R:return"Fragment";case $:return"Profiler";case T:return"StrictMode";case L:return"Suspense";case b:return"SuspenseList";case M:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case j:return"Portal";case k:return c.displayName||"Context";case I:return(c._context.displayName||"Context")+".Consumer";case C:var x=c.render;return c=c.displayName,c||(c=x.displayName||x.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case w:return x=c.displayName||null,x!==null?x:t(c.type)||"Memo";case A:x=c._payload,c=c._init;try{return t(c(x))}catch{}}return null}function e(c){return""+c}function r(c){try{e(c);var x=!1}catch{x=!0}if(x){x=console;var y=x.error,g=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return y.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",g),e(c)}}function o(c){if(c===R)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===A)return"<...>";try{var x=t(c);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function n(){var c=B.A;return c===null?null:c.getOwner()}function a(){return Error("react-stack-top-frame")}function i(c){if(X.call(c,"key")){var x=Object.getOwnPropertyDescriptor(c,"key").get;if(x&&x.isReactWarning)return!1}return c.key!==void 0}function l(c,x){function y(){F||(F=!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)",x))}y.isReactWarning=!0,Object.defineProperty(c,"key",{get:y,configurable:!0})}function p(){var c=t(this.type);return Y[c]||(Y[c]=!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.")),c=this.props.ref,c!==void 0?c:null}function f(c,x,y,g,J,ee){var S=y.ref;return c={$$typeof:_,type:c,key:x,props:y,_owner:g},(S!==void 0?S:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:p}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function m(c,x,y,g,J,ee){var S=x.children;if(S!==void 0)if(g)if(Z(S)){for(g=0;g<S.length;g++)h(S[g]);Object.freeze&&Object.freeze(S)}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(S);if(X.call(x,"key")){S=t(c);var V=Object.keys(x).filter(function(pe){return pe!=="key"});g=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",U[S+g]||(V=0<V.length?"{"+V.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} />`,g,k,V,k),U[k+g]=!0)}if(k=null,y!==void 0&&(r(y),k=""+y),i(x)&&(r(x.key),k=""+x.key),"key"in x){y={};for(var te in x)te!=="key"&&(y[te]=x[te])}else y=x;return k&&l(y,typeof c=="function"?c.displayName||c.name||"Unknown":c),f(c,k,y,n(),J,ee)}function b(c){h(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===A&&(c._payload.status==="fulfilled"?h(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function h(c){return typeof c=="object"&&c!==null&&c.$$typeof===j}var d=u,j=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),S=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),B=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,Z=Array.isArray,w=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(c){return c()}};var M,Y={},G=d.react_stack_bottom_frame.bind(d,a)(),Q=w(o(a)),U={};H.Fragment=E,H.jsx=function(c,x,y){var g=1e4>B.recentlyCreatedOwnerStacks++;return m(c,x,y,!1,g?Error("react-stack-top-frame"):G,g?w(o(c)):Q)},H.jsxs=function(c,x,y){var g=1e4>B.recentlyCreatedOwnerStacks++;return m(c,x,y,!0,g?Error("react-stack-top-frame"):G,g?w(o(c)):Q)}}()),H}process.env.NODE_ENV==="production"?se.exports=be():se.exports=he();var s=se.exports;function ie({size:t="m",color:e="default",className:r="",...o}){return s.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${e}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...o})}function le({children:t,variant:e="primary",size:r="m",fullWidth:o=!1,icon:n,disabled:a=!1,state:i="idle",onClick:l,type:p="button",href:f,"aria-label":m,...b}){const h=n&&!t,d=i==="loading",j=r==="l"?"s":"xs",_=["ds-button",`ds-button--${e}`,`ds-button--${r}`,o&&"ds-button--full",h&&"ds-button--icon-only"].filter(Boolean).join(" "),E=i!=="idle"?i:void 0,R=s.jsxs(s.Fragment,{children:[d&&s.jsx(ie,{size:j}),!d&&n&&!h&&s.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n}),t,!d&&h&&s.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n})]});if(f){const $=N=>{if(a||d){N.preventDefault();return}N.metaKey||N.ctrlKey||N.button===1||(N.preventDefault(),l==null||l(N))};return s.jsx("a",{className:_,href:a||d?void 0:f,onClick:$,"aria-label":m,"aria-disabled":a||d?"true":void 0,"aria-busy":d?"true":void 0,"data-state":E,...b,children:R})}return s.jsx("button",{type:p,className:_,disabled:a,onClick:d?void 0:l,"aria-label":m,"aria-busy":d?"true":void 0,"data-state":E,...b,children:R})}function xe({label:t,error:e,hint:r,fullWidth:o=!0,icon:n,iconRight:a,onIconRightClick:i,size:l="m",disabled:p,id:f,...m}){const b=f||`input-${u.useId()}`,h=r?`${b}-hint`:void 0,d=e?`${b}-error`:void 0,j=d||h;return s.jsxs("div",{className:`ds-input-wrapper ${o?"ds-input-wrapper--full":""} ${p?"ds-input-wrapper--disabled":""} ${e?"ds-input-wrapper--error":""}`,children:[t&&s.jsx("label",{className:"ds-input-label",htmlFor:b,children:t}),s.jsxs("div",{className:"ds-input-container",children:[n&&s.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:n}),s.jsx("input",{id:b,className:`ds-input ds-input--${l} ${n?"ds-input--with-icon":""} ${a?"ds-input--with-icon-right":""} ${e?"ds-input--error":""}`,disabled:p,"aria-invalid":e?"true":"false","aria-describedby":j,...m}),a&&s.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":"Toggle visibility",children:a})]}),r&&!e&&s.jsx("span",{id:h,className:"ds-input-hint",children:r}),s.jsx("div",{className:"ds-input-error-wrap",children:s.jsx("div",{className:"ds-input-error-inner",children:e&&s.jsx("span",{id:d,className:"ds-input-error",role:"alert",children:e})})})]})}function ve({label:t,error:e,hint:r,fullWidth:o=!0,size:n="m",disabled:a,id:i,resize:l=!0,rows:p=3,...f}){const m=i||`textarea-${u.useId()}`,b=r?`${m}-hint`:void 0,h=e?`${m}-error`:void 0,d=h||b;return s.jsxs("div",{className:`ds-textarea-wrapper ${o?"ds-textarea-wrapper--full":""} ${a?"ds-textarea-wrapper--disabled":""}`,children:[t&&s.jsx("label",{className:"ds-textarea-label",htmlFor:m,children:t}),s.jsx("textarea",{id:m,className:`ds-textarea ds-textarea--${n} ${e?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:a,"aria-invalid":e?"true":"false","aria-describedby":d,rows:p,...f}),r&&!e&&s.jsx("span",{id:b,className:"ds-textarea-hint",children:r}),e&&s.jsx("span",{id:h,className:"ds-textarea-error",role:"alert",children:e})]})}function je({label:t,value:e,onChange:r,options:o=[],placeholder:n="Select option",error:a,fullWidth:i=!0,size:l="m",disabled:p=!1,id:f,...m}){const[b,h]=u.useState(!1),[d,j]=u.useState(!1),[_,E]=u.useState({}),[R,$]=u.useState("down"),N=u.useRef(null),S=u.useRef(null),D=u.useRef(null),F=f||`select-${u.useId()}`,v=`${F}-label`,I=a?`${F}-error`:void 0,A=150,C=()=>{d||(j(!0),D.current=setTimeout(()=>{h(!1),j(!1)},A))};u.useEffect(()=>()=>clearTimeout(D.current),[]);const O=()=>{var c;const w=(c=N.current)==null?void 0:c.getBoundingClientRect();if(!w)return;const M=window.innerHeight,Y=M-w.bottom,G=w.top,U=Y<300&&G>Y;$(U?"up":"down"),E(U?{bottom:M-w.top+4,left:w.left,width:w.width}:{top:w.bottom+4,left:w.left,width:w.width})};u.useEffect(()=>{if(b)return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[b]),u.useEffect(()=>{const w=M=>{N.current&&!N.current.contains(M.target)&&S.current&&!S.current.contains(M.target)&&C()};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[d]);const B=o.find(w=>w.value===e),X=l==="xs"?P[1]:l==="small"?P[2]:P[3],Z=b&&s.jsx("div",{ref:S,role:"listbox","aria-labelledby":t?v:void 0,className:["ds-select-dropdown",`ds-select-dropdown--${l}`,`ds-select-dropdown--${R}`,d&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:_,children:o.map(w=>s.jsx("button",{type:"button",role:"option","aria-selected":e===w.value,className:`ds-select-option ds-select-option--${l} ${e===w.value?"ds-select-option--selected":""}`,onClick:()=>{r==null||r(w.value),C()},children:w.label},w.value))});return s.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${p?"ds-select-wrapper--disabled":""}`,children:[t&&s.jsx("label",{id:v,className:"ds-select-label",children:t}),s.jsx("div",{className:"ds-select-container",ref:N,children:s.jsxs("button",{type:"button",id:F,role:"combobox","aria-haspopup":"listbox","aria-expanded":b,"aria-labelledby":t?v:void 0,"aria-invalid":a?"true":"false","aria-describedby":I,className:`ds-select-trigger ds-select-trigger--${l} ${a?"ds-select-trigger--error":""}`,onClick:()=>{p||(b?C():(clearTimeout(D.current),j(!1),h(!0)))},disabled:p,...m,children:[s.jsx("span",{className:B?"":"ds-select-placeholder",children:(B==null?void 0:B.label)||n}),s.jsx(T.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${b&&R==="down"?"ds-select-icon--open":""} ${b&&R==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),a&&s.jsx("span",{id:I,className:"ds-select-error",role:"alert",children:a}),typeof document<"u"&&K.createPortal(Z,document.body)]})}function _e({label:t,value:e=0,onChange:r,min:o=0,max:n=100,step:a=1,size:i="m",disabled:l=!1,hint:p,error:f,...m}){const b=()=>{if(l)return;const R=Math.min(Number(e)+a,n);r==null||r(R)},h=()=>{if(l)return;const R=Math.max(Number(e)-a,o);r==null||r(R)},d=R=>{if(l)return;const $=R.target.value;if($===""){r==null||r(o);return}const N=Number($);if(!isNaN(N)){const S=Math.min(Math.max(N,o),n);r==null||r(S)}},j=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),_=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),E=i==="xs"?P[1]:i==="small"?P[2]:P[3];return s.jsxs("div",{className:j,children:[t&&s.jsx("label",{className:"ds-stepper-label",children:t}),s.jsxs("div",{className:_,children:[s.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:h,disabled:l||e<=o,"aria-label":"Decrease",children:s.jsx(T.Minus,{size:E,strokeWidth:1.5})}),s.jsx("input",{type:"number",className:"ds-stepper-input",value:e,onChange:d,min:o,max:n,step:a,disabled:l,...m}),s.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:b,disabled:l||e>=n,"aria-label":"Increase",children:s.jsx(T.Plus,{size:E,strokeWidth:1.5})})]}),p&&!f&&s.jsx("div",{className:"ds-stepper-hint",children:p}),f&&s.jsx("div",{className:"ds-stepper-error",children:f})]})}function we({children:t,padding:e="m",variant:r="info",hover:o=!1,onClick:n,href:a,disabled:i=!1,...l}){const f=(o?"interactive":r)==="interactive"||n||a,m=["ds-card",`ds-card--${e}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(a){const d=j=>{if(i){j.preventDefault();return}j.metaKey||j.ctrlKey||j.button===1||(j.preventDefault(),n==null||n(j))};return s.jsx("a",{className:m,href:i?void 0:a,onClick:d,"aria-disabled":i?"true":void 0,...l,children:t})}const b=f&&n?"button":"div",h=f&&n?{type:"button",onClick:n,disabled:i}:{};return s.jsx(b,{className:m,role:f&&!n?"article":void 0,...h,...l,children:t})}function Ne({children:t,...e}){return s.jsx("h1",{className:"ds-h1",...e,children:t})}function ye({children:t,...e}){return s.jsx("h2",{className:"ds-h2",...e,children:t})}function Ee({children:t,...e}){return s.jsx("h3",{className:"ds-h3",...e,children:t})}function Re({children:t,...e}){return s.jsx("h4",{className:"ds-h4",...e,children:t})}function Te({children:t,secondary:e=!1,...r}){return s.jsx("p",{className:`ds-p1 ${e?"ds-p1--secondary":""}`,...r,children:t})}function ge({children:t,secondary:e=!1,...r}){return s.jsx("p",{className:`ds-p2 ${e?"ds-p2--secondary":""}`,...r,children:t})}function ke({children:t,secondary:e=!1,...r}){return s.jsx("p",{className:`ds-p3 ${e?"ds-p3--secondary":""}`,...r,children:t})}function $e({children:t,variant:e="default",size:r="m",role:o,...n}){const a=["ds-badge",`ds-badge--${e}`,`ds-badge--${r}`].filter(Boolean).join(" "),i=o||(["info","success","warning","error"].includes(e)?"status":void 0);return s.jsx("span",{className:a,role:i,...n,children:t})}const Se={info:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};function Ie({children:t,variant:e="info",title:r,onClose:o,role:n,...a}){const i=Se[e],l=n||(e==="error"?"alert":"status");return s.jsxs("div",{className:`ds-alert ds-alert--${e} ${r?"":"ds-alert--no-title"}`,role:l,...a,children:[i&&s.jsx("div",{className:"ds-alert__icon",children:s.jsx(i,{size:P[3],strokeWidth:1.5})}),s.jsxs("div",{className:"ds-alert__content",children:[r&&s.jsx("div",{className:"ds-alert__title",children:r}),t&&s.jsx("div",{className:"ds-alert__message",children:t})]}),o&&s.jsx("button",{type:"button",className:"ds-alert__close",onClick:o,"aria-label":"Close alert",children:s.jsx(T.X,{size:P[3],strokeWidth:1.5})})]})}const Ae=200;function Pe({children:t,title:e,onClose:r,size:o="m",...n}){const a=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),f=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},Ae))};u.useEffect(()=>{const d=_=>{_.key==="Escape"&&f()},j=_=>{a.current&&!a.current.contains(_.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",j),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",j)}},[r,l]);const m=u.Children.toArray(t),b=m.find(d=>(d==null?void 0:d.type)===re),h=m.filter(d=>(d==null?void 0:d.type)!==re);return s.jsx("div",{className:["ds-modal-overlay",l&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...n,children:s.jsxs("div",{className:`ds-modal ds-modal--${o}`,ref:a,role:"dialog","aria-modal":"true","aria-labelledby":e?i:void 0,children:[(e||r)&&s.jsxs("div",{className:"ds-modal__header",children:[e&&s.jsx("h3",{id:i,className:"ds-modal__title",children:e}),r&&s.jsx(le,{variant:"ghost",size:"small",icon:s.jsx(T.X,{size:P[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),s.jsx("div",{className:"ds-modal__body",children:h}),b]})})}function re({children:t}){return s.jsx("div",{className:"ds-modal__footer",children:t})}function de({children:t,title:e="Code",defaultExpanded:r=!1,expanded:o,onToggle:n,padding:a="s",className:i="",...l}){const[p,f]=u.useState(r),m=o!==void 0,b=m?o:p,h=()=>{m?n==null||n(!o):f(j=>!j)},d=["ds-code-accordion",`ds-code-accordion--${a}`,b&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return s.jsxs("div",{className:d,...l,children:[s.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:h,"aria-expanded":b,children:[s.jsx("span",{className:"ds-code-accordion__title",children:e}),s.jsx(T.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${b?"ds-code-accordion__icon--expanded":""}`})]}),s.jsx("div",{className:"ds-code-accordion__content",children:s.jsx("div",{className:"ds-code-accordion__inner",children:s.jsx("pre",{className:"ds-code-accordion__pre",children:s.jsx("code",{children:t})})})})]})}function Oe({children:t,block:e=!1,collapsible:r=!1,title:o="Code",defaultExpanded:n=!1,...a}){return e?r?s.jsx(de,{title:o,defaultExpanded:n,...a,children:t}):s.jsx("pre",{className:"ds-code-block",...a,children:s.jsx("code",{children:t})}):s.jsx("code",{className:"ds-code-inline",...a,children:t})}function Be({href:t,children:e,onClick:r,target:o,rel:n,...a}){const l=o==="_blank"?n?`${n} noopener noreferrer`:"noopener noreferrer":n;return s.jsx("a",{href:t,className:"ds-link",onClick:r,target:o,rel:l,...a,children:e})}function Ce({children:t,size:e="m",variant:r="ghost",...o}){return s.jsx("div",{className:"ds-tabs",role:"tablist",...o,children:u.Children.map(t,n=>u.isValidElement(n)?u.cloneElement(n,{size:e,variant:r}):n)})}function Le({children:t,selected:e=!1,onClick:r,size:o="m",variant:n="ghost",disabled:a=!1,icon:i,href:l,...p}){const f=i&&!t,m=["ds-tab",`ds-tab--${o}`,`ds-tab--${n}`,e&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),b=s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const h=d=>{if(a){d.preventDefault();return}d.metaKey||d.ctrlKey||d.button===1||(d.preventDefault(),r==null||r(d))};return s.jsx("a",{role:"tab","aria-current":e?"page":void 0,"aria-disabled":a?"true":void 0,className:m,href:a?void 0:l,onClick:h,...p,children:b})}return s.jsx("button",{role:"tab","aria-selected":e,className:m,onClick:r,disabled:a,...p,children:b})}function Me({options:t,value:e,onChange:r,size:o="m",disabled:n=!1}){const a=u.useRef(null),i=u.useRef(null),[l,p]=u.useState(!1),f=u.useRef(!1),m=u.useRef(null),b=u.useRef(null),h=()=>{if(!a.current)return;const d=a.current.querySelector(`[data-value="${e}"]`);if(!d)return;const j=a.current.getBoundingClientRect(),_=d.getBoundingClientRect(),E=_.left-j.left,R=_.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=E+"px",i.current.style.width=R+"px",f.current=!1):(p(!0),requestAnimationFrame(()=>{if(!i.current||!a.current)return;const $=a.current.querySelector(`[data-value="${e}"]`);if(!$)return;const N=a.current.getBoundingClientRect(),S=$.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=S.left-N.left+"px",i.current.style.width=S.width+"px"}))};return b.current=h,u.useLayoutEffect(()=>{const d=m.current!==e;m.current=e,f.current=l&&d,h()}),u.useEffect(()=>{if(!a.current)return;const d=new ResizeObserver(()=>{f.current=!1,b.current()});return d.observe(a.current),()=>d.disconnect()},[]),s.jsxs("div",{className:["ds-seg",`ds-seg--${o}`,n&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:a,role:"group",children:[l&&s.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(d=>s.jsxs("button",{type:"button","data-value":d.value,className:["ds-seg__btn",e===d.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!n&&r(d.value),"aria-pressed":e===d.value,disabled:n,children:[d.icon&&s.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:d.icon}),d.label]},d.value))]})}function De({children:t,title:e,defaultExpanded:r=!1,expanded:o,onToggle:n,padding:a="m",...i}){const[l,p]=u.useState(r),f=o!==void 0,m=f?o:l,b=()=>{f?n==null||n(!o):p(d=>!d)},h=["ds-accordion",`ds-accordion--${a}`,m&&"ds-accordion--expanded"].filter(Boolean).join(" ");return s.jsxs("div",{className:h,...i,children:[s.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:b,"aria-expanded":m,children:[s.jsx("span",{className:"ds-accordion__title",children:e}),s.jsx(T.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-accordion__icon ${m?"ds-accordion__icon--expanded":""}`})]}),s.jsx("div",{className:"ds-accordion__content",children:s.jsx("div",{className:"ds-accordion__content-inner",children:s.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const L=8,W=8;function Fe(t,e,r){const o=window.innerWidth;let n,a;switch(t){case"top":n=e.top-r.height-L,a=e.left+e.width/2-r.width/2;break;case"bottom":n=e.bottom+L,a=e.left+e.width/2-r.width/2;break;case"left":n=e.top+e.height/2-r.height/2,a=e.left-r.width-L;break;case"right":n=e.top+e.height/2-r.height/2,a=e.right+L;break;default:n=e.bottom+L,a=e.left}const i=Math.max(W,Math.min(o-r.width-W,a)),l=a-i;return{top:n,left:i,arrowOffset:l}}function Ve(t,e,r){const o=window.innerWidth,n=window.innerHeight;if(t.top>=e+L+W)return"top";if(n-t.bottom>=e+L+W)return"bottom";if(o-t.right>=r+L+W)return"right";if(t.left>=r+L+W)return"left";const a=Math.max(t.top,n-t.bottom,t.left,o-t.right);return a===t.top?"top":a===n-t.bottom?"bottom":a===o-t.right?"right":"left"}function We({children:t,content:e,position:r,...o}){const[n,a]=u.useState(!1),[i,l]=u.useState({visibility:"hidden"}),[p,f]=u.useState(r||"top"),m=u.useRef(null),b=u.useRef(null),h=u.useRef(!1),d=()=>{if(!m.current||!b.current)return;const _=m.current.getBoundingClientRect(),E=b.current.getBoundingClientRect(),R=r||Ve(_,E.height,E.width),{top:$,left:N,arrowOffset:S}=Fe(R,_,E);f(R),l({position:"fixed",top:$,left:N,visibility:"visible","--arrow-offset":`${S}px`})};if(u.useEffect(()=>{if(!n)return;l({position:"fixed",visibility:"hidden"});const _=requestAnimationFrame(d);return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(_),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n,r]),u.useEffect(()=>{if(!n)return;const _=E=>{m.current&&!m.current.contains(E.target)&&a(!1)};return document.addEventListener("touchstart",_),()=>document.removeEventListener("touchstart",_)},[n]),!e)return t;const j=n&&s.jsx("div",{ref:b,className:`ds-tooltip ds-tooltip--${p}`,role:"tooltip",style:i,children:e});return s.jsxs("div",{ref:m,className:"ds-tooltip-wrapper",onMouseEnter:()=>{h.current||a(!0)},onMouseLeave:()=>{h.current||a(!1)},onTouchStart:()=>{h.current=!0,a(_=>!_)},...o,children:[t,typeof document<"u"&&K.createPortal(j,document.body)]})}function ze({checked:t=!1,onChange:e,size:r="m",disabled:o=!1,label:n,id:a,...i}){const l=a||`toggle-${u.useId()}`,p=["ds-toggle",`ds-toggle--${r}`,o&&"ds-toggle--disabled"].filter(Boolean).join(" ");return s.jsxs("label",{className:p,htmlFor:l,children:[s.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:t,onChange:f=>e==null?void 0:e(f.target.checked),disabled:o,...i}),s.jsx("span",{className:"ds-toggle__track",children:s.jsx("span",{className:"ds-toggle__thumb"})}),n&&s.jsx("span",{className:"ds-toggle__label",children:n})]})}function Ye({checked:t=!1,onChange:e,size:r="m",disabled:o=!1,label:n,id:a,...i}){const l=a||`checkbox-${u.useId()}`,p=["ds-checkbox",`ds-checkbox--${r}`,o&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return s.jsxs("label",{className:p,htmlFor:l,children:[s.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:t,onChange:m=>e==null?void 0:e(m.target.checked),disabled:o,...i}),s.jsx("span",{className:"ds-checkbox__box",children:t&&s.jsx(T.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),n&&s.jsx("span",{className:"ds-checkbox__label",children:n})]})}function Ue({checked:t=!1,onChange:e,size:r="m",disabled:o=!1,label:n,name:a,value:i,id:l,...p}){const f=l||`radio-${u.useId()}`,m=["ds-radio",`ds-radio--${r}`,o&&"ds-radio--disabled"].filter(Boolean).join(" ");return s.jsxs("label",{className:m,htmlFor:f,children:[s.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:b=>e==null?void 0:e(b.target.checked),disabled:o,name:a,value:i,...p}),s.jsx("span",{className:"ds-radio__circle",children:s.jsx("span",{className:"ds-radio__dot"})}),n&&s.jsx("span",{className:"ds-radio__label",children:n})]})}function qe({width:t,height:e,shape:r="rect",className:o="",style:n={},...a}){return s.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,o].filter(Boolean).join(" "),style:{width:t,height:e,...n},"aria-hidden":"true",...a})}function He(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return e%360}function Xe(t){if(!t)return"";const e=t.trim().split(/\s+/);return e.length>=2?(e[0][0]+e[1][0]).toUpperCase():t[0].toUpperCase()}function Ge({seed:t,icon:e,src:r,size:o=32,className:n="",style:a={},...i}){const l=He(t??""),[p,f]=u.useState(!1),m=e??s.jsx("span",{className:"ds-avatar__initials",children:Xe(t)});return s.jsx("div",{className:["ds-avatar",n].filter(Boolean).join(" "),style:{width:o,height:o,"--ds-avatar-h":l,...a},"aria-hidden":"true",...i,children:r&&!p?s.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):m})}function Je({children:t,size:e="compact",stickyTop:r,maxHeight:o,className:n="",style:a={},...i}){const l={...o?{maxHeight:o}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...a};return s.jsx("div",{className:["ds-table-wrap",o?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:s.jsx("table",{className:["ds-table",`ds-table--${e}`,n].filter(Boolean).join(" "),...i,children:t})})}function Ke({children:t,...e}){return s.jsx("thead",{...e,children:t})}function Ze({children:t,...e}){return s.jsx("tbody",{...e,children:t})}function Qe({children:t,interactive:e,selected:r,subheader:o,className:n="",onClick:a,...i}){return s.jsx("tr",{className:["ds-table-row",e||a?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",o?"ds-table-row--subheader":"",n].filter(Boolean).join(" "),onClick:a,...i,children:t})}function et({children:t,colSpan:e=999,...r}){return s.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...r,children:s.jsx("td",{colSpan:e,children:t})})}function tt({children:t,align:e="left",sortDir:r,onSort:o,width:n,className:a="",style:i={},...l}){const p=!!o||r!==void 0,f=r==="asc"?T.ChevronUp:r==="desc"?T.ChevronDown:T.ChevronsUpDown;return s.jsx("th",{className:["ds-th",p?"ds-th--sortable":"",r?"ds-th--sorted":"",e!=="left"?`ds-table-cell--${e}`:"",a].filter(Boolean).join(" "),onClick:o,style:{width:n,...i},...l,children:p?s.jsxs("span",{className:"ds-th__inner",children:[t,s.jsx("span",{className:"ds-th__sort-icon",children:s.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function st({children:t,align:e="left",secondary:r,muted:o,truncate:n,nowrap:a,className:i="",...l}){return s.jsx("td",{className:["ds-td",e!=="left"?`ds-table-cell--${e}`:"",r?"ds-table-cell--secondary":"",o?"ds-table-cell--muted":"",n?"ds-table-cell--truncate":"",a?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:t})}function rt({icon:t,title:e,description:r,action:o,size:n="m",className:a="",...i}){return s.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${n}`,a].filter(Boolean).join(" "),...i,children:[t&&s.jsx("div",{className:"ds-empty-state__icon",children:t}),s.jsx("div",{className:"ds-empty-state__title",children:e}),r&&s.jsx("div",{className:"ds-empty-state__description",children:r}),o&&s.jsx("div",{className:"ds-empty-state__action",children:o})]})}function nt({trigger:t,items:e=[],open:r,onOpenChange:o,align:n="left",className:a="",style:i,...l}){const[p,f]=u.useState(!1),[m,b]=u.useState(!1),h=r!==void 0,d=h?r:p,j=u.useRef(null),_=u.useRef(null),[E,R]=u.useState({}),$=u.useRef(null),N=150,S=()=>{if(h)o==null||o(!1);else{if(m)return;b(!0),$.current=setTimeout(()=>{f(!1),b(!1)},N)}},D=()=>{const v=!d;h?o==null||o(v):v?(clearTimeout($.current),b(!1),f(!0)):S()};u.useEffect(()=>()=>clearTimeout($.current),[]),u.useEffect(()=>{if(!d)return;const v=()=>{var A;const I=(A=j.current)==null?void 0:A.getBoundingClientRect();I&&R(n==="right"?{top:I.bottom+4,right:window.innerWidth-I.right}:{top:I.bottom+4,left:I.left})};return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[d,n]),u.useEffect(()=>{if(!d)return;const v=A=>{var C,O;!((C=j.current)!=null&&C.contains(A.target))&&!((O=_.current)!=null&&O.contains(A.target))&&S()},I=A=>{A.key==="Escape"&&S()};return document.addEventListener("mousedown",v),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",I)}},[d]);const F=d&&s.jsx("div",{ref:_,className:["ds-dropdown__menu",`ds-dropdown__menu--${n}`,m&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:E,children:e.map((v,I)=>{if(v.separator)return s.jsx("div",{className:"ds-dropdown__separator"},I);if(v.type==="section")return s.jsxs("div",{className:"ds-dropdown__section",children:[v.label&&s.jsx("div",{className:"ds-dropdown__section-label",children:v.label}),s.jsx("div",{className:"ds-dropdown__section-content",children:v.content})]},I);const A=!!v.href,C=A?"a":"button",O=A?{href:v.disabled?void 0:v.href,"aria-disabled":v.disabled?"true":void 0}:{type:"button",disabled:v.disabled};return s.jsxs(C,{className:["ds-dropdown__item",v.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...O,onClick:()=>{var B;(B=v.onClick)==null||B.call(v),S()},children:[v.icon&&s.jsx("span",{className:"ds-dropdown__item-icon",children:v.icon}),s.jsx("span",{className:"ds-dropdown__item-label",children:v.label}),v.shortcut&&s.jsx("span",{className:"ds-dropdown__item-shortcut",children:v.shortcut})]},I)})});return s.jsxs("div",{ref:j,className:["ds-dropdown",a].filter(Boolean).join(" "),style:i,...l,children:[s.jsx("div",{className:"ds-dropdown__trigger",onClick:D,children:t}),typeof document<"u"&&K.createPortal(F,document.body)]})}function at({value:t=0,size:e="m",variant:r="default",showValue:o=!1,min:n=2,animate:a=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(n,i),p=r==="auto"?i>=70?"success":i>=50?"warning":"danger":r;return s.jsxs("div",{className:["ds-progress",`ds-progress--${e}`,!a&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[s.jsx("div",{className:"ds-progress__track",children:s.jsx("div",{className:`ds-progress__fill ds-progress__fill--${p}`,style:{width:`${l}%`}})}),o&&s.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const ot=t=>1-Math.pow(1-t,3),ct=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function ue(t,{duration:e=600}={}){const[r,o]=u.useState(t),n=u.useRef(t),a=u.useRef(null);return u.useEffect(()=>{if(ct()){o(t),n.current=t;return}const i=n.current,l=t-i;if(l===0)return;let p=null;const f=m=>{p||(p=m);const b=Math.min((m-p)/e,1);o(i+l*ot(b)),b<1?a.current=requestAnimationFrame(f):n.current=t};return a.current=requestAnimationFrame(f),()=>cancelAnimationFrame(a.current)},[t,e]),r}function it({value:t,duration:e=600,decimals:r=0,prefix:o="",suffix:n=""}){const i=ue(t,{duration:e}).toFixed(r);return`${o}${i}${n}`}function fe({threshold:t=.1,rootMargin:e="0px",once:r=!1}={}){const o=u.useRef(null),[n,a]=u.useState(!1);return u.useEffect(()=>{const i=o.current;if(!i)return;const l=new IntersectionObserver(([p])=>{p.isIntersecting?(a(!0),r&&l.disconnect()):r||a(!1)},{threshold:t,rootMargin:e});return l.observe(i),()=>l.disconnect()},[t,e,r]),{ref:o,inView:n}}function lt({children:t,as:e="div",once:r=!1,threshold:o=.1,rootMargin:n="0px",onEnter:a,onLeave:i,...l}){const{ref:p,inView:f}=fe({threshold:o,rootMargin:n,once:r}),m=u.useRef(!1);return u.useEffect(()=>{f&&!m.current&&(a==null||a()),!f&&m.current&&(i==null||i()),m.current=f},[f]),s.jsx(e,{ref:p,...l,children:typeof t=="function"?t(f):t})}const ce={default:T.Info,success:T.CheckCircle,warning:T.AlertTriangle,error:T.XCircle};let z=[];const ne=new Set;function me(){ne.forEach(t=>t([...z]))}function dt(t){z=[...z,t],me()}function ut(t){z=z.filter(e=>e.id!==t),me()}function ft(){const t=(e,r={})=>{dt({id:`${Date.now()}-${Math.random()}`,message:e,type:"default",duration:4e3,...r})};return t.success=(e,r)=>t(e,{...r,type:"success"}),t.error=(e,r)=>t(e,{...r,type:"error"}),t.warning=(e,r)=>t(e,{...r,type:"warning"}),{toast:t}}function mt({data:t,onDismiss:e}){const[r,o]=u.useState(!1),n=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>o(!0)),t.duration>0&&(n.current=setTimeout(()=>a(),t.duration)),()=>clearTimeout(n.current)),[]);function a(){o(!1),setTimeout(()=>e(t.id),250)}const i=ce[t.type]??ce.default;return s.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[s.jsx("div",{className:"ds-toast__icon",children:s.jsx(i,{size:P[3],strokeWidth:1.5})}),s.jsx("span",{className:"ds-toast__message",children:t.message}),s.jsx("button",{className:"ds-toast__close",onClick:a,"aria-label":"Закрыть",children:s.jsx(T.X,{size:P[3],strokeWidth:1.5})})]})}function pt({position:t="bottom-right"}){const[e,r]=u.useState(()=>[...z]);return u.useEffect(()=>(ne.add(r),()=>ne.delete(r)),[]),!e.length||typeof document>"u"?null:K.createPortal(s.jsx("div",{className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:e.map(o=>s.jsx(mt,{data:o,onDismiss:ut},o.id))}),document.body)}exports.Accordion=De;exports.Alert=Ie;exports.AnimatedNumber=it;exports.Avatar=Ge;exports.Badge=$e;exports.Button=le;exports.Card=we;exports.Checkbox=Ye;exports.Code=Oe;exports.CodeAccordion=de;exports.Dropdown=nt;exports.EmptyState=rt;exports.H1=Ne;exports.H2=ye;exports.H3=Ee;exports.H4=Re;exports.InView=lt;exports.Input=xe;exports.Link=Be;exports.Modal=Pe;exports.ModalFooter=re;exports.P1=Te;exports.P2=ge;exports.P3=ke;exports.ProgressBar=at;exports.Radio=Ue;exports.SegmentedControl=Me;exports.Select=je;exports.Skeleton=qe;exports.Spinner=ie;exports.Stepper=_e;exports.Tab=Le;exports.Table=Je;exports.TableBody=Ze;exports.TableHead=Ke;exports.TableRow=Qe;exports.TableSubheaderRow=et;exports.Tabs=Ce;exports.Td=st;exports.Textarea=ve;exports.Th=tt;exports.ToastContainer=pt;exports.Toggle=ze;exports.Tooltip=We;exports.iconSizes=P;exports.useAnimatedNumber=ue;exports.useInView=fe;exports.useToast=ft;
22
+ <%s key={someKey} {...props} />`,g,S,V,S),U[S+g]=!0)}if(S=null,y!==void 0&&(r(y),S=""+y),i(x)&&(r(x.key),S=""+x.key),"key"in x){y={};for(var te in x)te!=="key"&&(y[te]=x[te])}else y=x;return S&&l(y,typeof c=="function"?c.displayName||c.name||"Unknown":c),f(c,S,y,n(),J,ee)}function h(c){v(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===A&&(c._payload.status==="fulfilled"?v(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function v(c){return typeof c=="object"&&c!==null&&c.$$typeof===_}var d=u,_=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),B=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,Z=Array.isArray,N=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(c){return c()}};var F,Y={},G=d.react_stack_bottom_frame.bind(d,a)(),Q=N(o(a)),U={};H.Fragment=R,H.jsx=function(c,x,y){var g=1e4>B.recentlyCreatedOwnerStacks++;return m(c,x,y,!1,g?Error("react-stack-top-frame"):G,g?N(o(c)):Q)},H.jsxs=function(c,x,y){var g=1e4>B.recentlyCreatedOwnerStacks++;return m(c,x,y,!0,g?Error("react-stack-top-frame"):G,g?N(o(c)):Q)}}()),H}process.env.NODE_ENV==="production"?se.exports=he():se.exports=be();var s=se.exports;function ie({size:t="m",color:e="default",className:r="",...o}){return s.jsx("span",{className:["ds-spinner",`ds-spinner--${t}`,`ds-spinner--${e}`,r].filter(Boolean).join(" "),role:"status","aria-label":"Loading",...o})}const xe={xs:12,s:14,m:16,l:20};function le({children:t,variant:e="primary",size:r="m",fullWidth:o=!1,icon:n,disabled:a=!1,state:i="idle",onClick:l,type:p="button",href:f,"aria-label":m,...h}){const v=n&&!t,d=i==="loading",_=i==="success",j=i==="error",R=d||_||j,T=r==="l"?"s":"xs",$=xe[r]??16,I=d?s.jsx(ie,{size:T}):_?s.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:s.jsx(E.Check,{size:$,strokeWidth:2.5})}):j?s.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:s.jsx(E.X,{size:$,strokeWidth:2.5})}):null,k=["ds-button",`ds-button--${e}`,`ds-button--${r}`,o&&"ds-button--full",v&&"ds-button--icon-only"].filter(Boolean).join(" "),C=i!=="idle"?i:void 0,L=s.jsxs(s.Fragment,{children:[R?I:n&&s.jsx("span",{className:"ds-button__icon","aria-hidden":"true",children:n}),t]});if(f){const b=w=>{if(a||d){w.preventDefault();return}w.metaKey||w.ctrlKey||w.button===1||(w.preventDefault(),l==null||l(w))};return s.jsx("a",{className:k,href:a||d?void 0:f,onClick:b,"aria-label":m,"aria-disabled":a||d?"true":void 0,"aria-busy":d?"true":void 0,"data-state":C,...h,children:L})}return s.jsx("button",{type:p,className:k,disabled:a,onClick:d?void 0:l,"aria-label":m,"aria-busy":d?"true":void 0,"data-state":C,...h,children:L})}function ve({label:t,error:e,hint:r,fullWidth:o=!0,icon:n,iconRight:a,onIconRightClick:i,size:l="m",disabled:p,id:f,...m}){const h=f||`input-${u.useId()}`,v=r?`${h}-hint`:void 0,d=e?`${h}-error`:void 0,_=d||v;return s.jsxs("div",{className:`ds-input-wrapper ${o?"ds-input-wrapper--full":""} ${p?"ds-input-wrapper--disabled":""} ${e?"ds-input-wrapper--error":""}`,children:[t&&s.jsx("label",{className:"ds-input-label",htmlFor:h,children:t}),s.jsxs("div",{className:"ds-input-container",children:[n&&s.jsx("span",{className:`ds-input-icon ds-input-icon--${l}`,"aria-hidden":"true",children:n}),s.jsx("input",{id:h,className:`ds-input ds-input--${l} ${n?"ds-input--with-icon":""} ${a?"ds-input--with-icon-right":""} ${e?"ds-input--error":""}`,disabled:p,"aria-invalid":e?"true":"false","aria-describedby":_,...m}),a&&s.jsx("button",{type:"button",className:`ds-input-icon-right ds-input-icon-right--${l}`,onClick:i,tabIndex:-1,"aria-label":"Toggle visibility",children:a})]}),r&&!e&&s.jsx("span",{id:v,className:"ds-input-hint",children:r}),s.jsx("div",{className:"ds-input-error-wrap",children:s.jsx("div",{className:"ds-input-error-inner",children:e&&s.jsx("span",{id:d,className:"ds-input-error",role:"alert",children:e})})})]})}function _e({label:t,error:e,hint:r,fullWidth:o=!0,size:n="m",disabled:a,id:i,resize:l=!0,rows:p=3,...f}){const m=i||`textarea-${u.useId()}`,h=r?`${m}-hint`:void 0,v=e?`${m}-error`:void 0,d=v||h;return s.jsxs("div",{className:`ds-textarea-wrapper ${o?"ds-textarea-wrapper--full":""} ${a?"ds-textarea-wrapper--disabled":""}`,children:[t&&s.jsx("label",{className:"ds-textarea-label",htmlFor:m,children:t}),s.jsx("textarea",{id:m,className:`ds-textarea ds-textarea--${n} ${e?"ds-textarea--error":""} ${l?"":"ds-textarea--no-resize"}`,disabled:a,"aria-invalid":e?"true":"false","aria-describedby":d,rows:p,...f}),r&&!e&&s.jsx("span",{id:h,className:"ds-textarea-hint",children:r}),e&&s.jsx("span",{id:v,className:"ds-textarea-error",role:"alert",children:e})]})}function je({label:t,value:e,onChange:r,options:o=[],placeholder:n="Select option",error:a,fullWidth:i=!0,size:l="m",disabled:p=!1,id:f,...m}){const[h,v]=u.useState(!1),[d,_]=u.useState(!1),[j,R]=u.useState({}),[T,$]=u.useState("down"),I=u.useRef(null),k=u.useRef(null),C=u.useRef(null),L=f||`select-${u.useId()}`,b=`${L}-label`,w=a?`${L}-error`:void 0,A=150,M=()=>{d||(_(!0),C.current=setTimeout(()=>{v(!1),_(!1)},A))};u.useEffect(()=>()=>clearTimeout(C.current),[]);const O=()=>{var c;const N=(c=I.current)==null?void 0:c.getBoundingClientRect();if(!N)return;const F=window.innerHeight,Y=F-N.bottom,G=N.top,U=Y<300&&G>Y;$(U?"up":"down"),R(U?{bottom:F-N.top+4,left:N.left,width:N.width}:{top:N.bottom+4,left:N.left,width:N.width})};u.useEffect(()=>{if(h)return O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O),()=>{window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[h]),u.useEffect(()=>{const N=F=>{I.current&&!I.current.contains(F.target)&&k.current&&!k.current.contains(F.target)&&M()};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[d]);const B=o.find(N=>N.value===e),X=l==="xs"?P[1]:l==="small"?P[2]:P[3],Z=h&&s.jsx("div",{ref:k,role:"listbox","aria-labelledby":t?b:void 0,className:["ds-select-dropdown",`ds-select-dropdown--${l}`,`ds-select-dropdown--${T}`,d&&"ds-select-dropdown--closing"].filter(Boolean).join(" "),style:j,children:o.map(N=>s.jsx("button",{type:"button",role:"option","aria-selected":e===N.value,className:`ds-select-option ds-select-option--${l} ${e===N.value?"ds-select-option--selected":""}`,onClick:()=>{r==null||r(N.value),M()},children:N.label},N.value))});return s.jsxs("div",{className:`ds-select-wrapper ${i?"ds-select-wrapper--full":""} ${p?"ds-select-wrapper--disabled":""}`,children:[t&&s.jsx("label",{id:b,className:"ds-select-label",children:t}),s.jsx("div",{className:"ds-select-container",ref:I,children:s.jsxs("button",{type:"button",id:L,role:"combobox","aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":t?b:void 0,"aria-invalid":a?"true":"false","aria-describedby":w,className:`ds-select-trigger ds-select-trigger--${l} ${a?"ds-select-trigger--error":""}`,onClick:()=>{p||(h?M():(clearTimeout(C.current),_(!1),v(!0)))},disabled:p,...m,children:[s.jsx("span",{className:B?"":"ds-select-placeholder",children:(B==null?void 0:B.label)||n}),s.jsx(E.ChevronDown,{size:X,strokeWidth:1.5,className:`ds-select-icon ${h&&T==="down"?"ds-select-icon--open":""} ${h&&T==="up"?"ds-select-icon--up":""}`,"aria-hidden":"true"})]})}),a&&s.jsx("span",{id:w,className:"ds-select-error",role:"alert",children:a}),typeof document<"u"&&K.createPortal(Z,document.body)]})}function we({label:t,value:e=0,onChange:r,min:o=0,max:n=100,step:a=1,size:i="m",disabled:l=!1,hint:p,error:f,...m}){const h=()=>{if(l)return;const T=Math.min(Number(e)+a,n);r==null||r(T)},v=()=>{if(l)return;const T=Math.max(Number(e)-a,o);r==null||r(T)},d=T=>{if(l)return;const $=T.target.value;if($===""){r==null||r(o);return}const I=Number($);if(!isNaN(I)){const k=Math.min(Math.max(I,o),n);r==null||r(k)}},_=["ds-stepper-wrapper",l&&"ds-stepper-wrapper--disabled",f&&"ds-stepper-wrapper--error"].filter(Boolean).join(" "),j=["ds-stepper",`ds-stepper--${i}`,l&&"ds-stepper--disabled"].filter(Boolean).join(" "),R=i==="xs"?P[1]:i==="small"?P[2]:P[3];return s.jsxs("div",{className:_,children:[t&&s.jsx("label",{className:"ds-stepper-label",children:t}),s.jsxs("div",{className:j,children:[s.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--minus",onClick:v,disabled:l||e<=o,"aria-label":"Decrease",children:s.jsx(E.Minus,{size:R,strokeWidth:1.5})}),s.jsx("input",{type:"number",className:"ds-stepper-input",value:e,onChange:d,min:o,max:n,step:a,disabled:l,...m}),s.jsx("button",{type:"button",className:"ds-stepper-button ds-stepper-button--plus",onClick:h,disabled:l||e>=n,"aria-label":"Increase",children:s.jsx(E.Plus,{size:R,strokeWidth:1.5})})]}),p&&!f&&s.jsx("div",{className:"ds-stepper-hint",children:p}),f&&s.jsx("div",{className:"ds-stepper-error",children:f})]})}function Ne({children:t,padding:e="m",variant:r="info",hover:o=!1,onClick:n,href:a,disabled:i=!1,...l}){const f=(o?"interactive":r)==="interactive"||n||a,m=["ds-card",`ds-card--${e}`,f&&"ds-card--interactive"].filter(Boolean).join(" ");if(a){const d=_=>{if(i){_.preventDefault();return}_.metaKey||_.ctrlKey||_.button===1||(_.preventDefault(),n==null||n(_))};return s.jsx("a",{className:m,href:i?void 0:a,onClick:d,"aria-disabled":i?"true":void 0,...l,children:t})}const h=f&&n?"button":"div",v=f&&n?{type:"button",onClick:n,disabled:i}:{};return s.jsx(h,{className:m,role:f&&!n?"article":void 0,...v,...l,children:t})}function ye({children:t,...e}){return s.jsx("h1",{className:"ds-h1",...e,children:t})}function Ee({children:t,...e}){return s.jsx("h2",{className:"ds-h2",...e,children:t})}function Re({children:t,...e}){return s.jsx("h3",{className:"ds-h3",...e,children:t})}function Te({children:t,...e}){return s.jsx("h4",{className:"ds-h4",...e,children:t})}function ke({children:t,secondary:e=!1,...r}){return s.jsx("p",{className:`ds-p1 ${e?"ds-p1--secondary":""}`,...r,children:t})}function ge({children:t,secondary:e=!1,...r}){return s.jsx("p",{className:`ds-p2 ${e?"ds-p2--secondary":""}`,...r,children:t})}function Se({children:t,secondary:e=!1,...r}){return s.jsx("p",{className:`ds-p3 ${e?"ds-p3--secondary":""}`,...r,children:t})}function $e({children:t,variant:e="default",size:r="m",role:o,...n}){const a=["ds-badge",`ds-badge--${e}`,`ds-badge--${r}`].filter(Boolean).join(" "),i=o||(["info","success","warning","error"].includes(e)?"status":void 0);return s.jsx("span",{className:a,role:i,...n,children:t})}const Ie={info:E.Info,success:E.CheckCircle,warning:E.AlertTriangle,error:E.XCircle};function Ae({children:t,variant:e="info",title:r,onClose:o,role:n,...a}){const i=Ie[e],l=n||(e==="error"?"alert":"status");return s.jsxs("div",{className:`ds-alert ds-alert--${e} ${r?"":"ds-alert--no-title"}`,role:l,...a,children:[i&&s.jsx("div",{className:"ds-alert__icon",children:s.jsx(i,{size:P[3],strokeWidth:1.5})}),s.jsxs("div",{className:"ds-alert__content",children:[r&&s.jsx("div",{className:"ds-alert__title",children:r}),t&&s.jsx("div",{className:"ds-alert__message",children:t})]}),o&&s.jsx("button",{type:"button",className:"ds-alert__close",onClick:o,"aria-label":"Close alert",children:s.jsx(E.X,{size:P[3],strokeWidth:1.5})})]})}const Pe=200;function Oe({children:t,title:e,onClose:r,size:o="m",...n}){const a=u.useRef(null),i=u.useId(),[l,p]=u.useState(!1),f=()=>{!r||l||(p(!0),setTimeout(()=>{p(!1),r()},Pe))};u.useEffect(()=>{const d=j=>{j.key==="Escape"&&f()},_=j=>{a.current&&!a.current.contains(j.target)&&f()};return document.addEventListener("keydown",d),document.addEventListener("mousedown",_),()=>{document.removeEventListener("keydown",d),document.removeEventListener("mousedown",_)}},[r,l]);const m=u.Children.toArray(t),h=m.find(d=>(d==null?void 0:d.type)===re),v=m.filter(d=>(d==null?void 0:d.type)!==re);return s.jsx("div",{className:["ds-modal-overlay",l&&"ds-modal-overlay--closing"].filter(Boolean).join(" "),...n,children:s.jsxs("div",{className:`ds-modal ds-modal--${o}`,ref:a,role:"dialog","aria-modal":"true","aria-labelledby":e?i:void 0,children:[(e||r)&&s.jsxs("div",{className:"ds-modal__header",children:[e&&s.jsx("h3",{id:i,className:"ds-modal__title",children:e}),r&&s.jsx(le,{variant:"ghost",size:"small",icon:s.jsx(E.X,{size:P[2],strokeWidth:1.5}),onClick:f,"aria-label":"Close modal"})]}),s.jsx("div",{className:"ds-modal__body",children:v}),h]})})}function re({children:t}){return s.jsx("div",{className:"ds-modal__footer",children:t})}function de({children:t,title:e="Code",defaultExpanded:r=!1,expanded:o,onToggle:n,padding:a="s",className:i="",...l}){const[p,f]=u.useState(r),m=o!==void 0,h=m?o:p,v=()=>{m?n==null||n(!o):f(_=>!_)},d=["ds-code-accordion",`ds-code-accordion--${a}`,h&&"ds-code-accordion--expanded",i].filter(Boolean).join(" ");return s.jsxs("div",{className:d,...l,children:[s.jsxs("button",{type:"button",className:"ds-code-accordion__header",onClick:v,"aria-expanded":h,children:[s.jsx("span",{className:"ds-code-accordion__title",children:e}),s.jsx(E.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-code-accordion__icon ${h?"ds-code-accordion__icon--expanded":""}`})]}),s.jsx("div",{className:"ds-code-accordion__content",children:s.jsx("div",{className:"ds-code-accordion__inner",children:s.jsx("pre",{className:"ds-code-accordion__pre",children:s.jsx("code",{children:t})})})})]})}function Be({children:t,block:e=!1,collapsible:r=!1,title:o="Code",defaultExpanded:n=!1,...a}){return e?r?s.jsx(de,{title:o,defaultExpanded:n,...a,children:t}):s.jsx("pre",{className:"ds-code-block",...a,children:s.jsx("code",{children:t})}):s.jsx("code",{className:"ds-code-inline",...a,children:t})}function Ce({href:t,children:e,onClick:r,target:o,rel:n,...a}){const l=o==="_blank"?n?`${n} noopener noreferrer`:"noopener noreferrer":n;return s.jsx("a",{href:t,className:"ds-link",onClick:r,target:o,rel:l,...a,children:e})}function Le({children:t,size:e="m",variant:r="ghost",...o}){return s.jsx("div",{className:"ds-tabs",role:"tablist",...o,children:u.Children.map(t,n=>u.isValidElement(n)?u.cloneElement(n,{size:e,variant:r}):n)})}function Me({children:t,selected:e=!1,onClick:r,size:o="m",variant:n="ghost",disabled:a=!1,icon:i,href:l,...p}){const f=i&&!t,m=["ds-tab",`ds-tab--${o}`,`ds-tab--${n}`,e&&"ds-tab--selected",f&&"ds-tab--icon-only"].filter(Boolean).join(" "),h=s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{className:"ds-tab-icon",children:i}),t]});if(l){const v=d=>{if(a){d.preventDefault();return}d.metaKey||d.ctrlKey||d.button===1||(d.preventDefault(),r==null||r(d))};return s.jsx("a",{role:"tab","aria-current":e?"page":void 0,"aria-disabled":a?"true":void 0,className:m,href:a?void 0:l,onClick:v,...p,children:h})}return s.jsx("button",{role:"tab","aria-selected":e,className:m,onClick:r,disabled:a,...p,children:h})}function De({options:t,value:e,onChange:r,size:o="m",disabled:n=!1}){const a=u.useRef(null),i=u.useRef(null),[l,p]=u.useState(!1),f=u.useRef(!1),m=u.useRef(null),h=u.useRef(null),v=()=>{if(!a.current)return;const d=a.current.querySelector(`[data-value="${e}"]`);if(!d)return;const _=a.current.getBoundingClientRect(),j=d.getBoundingClientRect(),R=j.left-_.left,T=j.width;i.current?(i.current.style.transition=f.current?"left var(--transition-normal), width var(--transition-normal)":"none",i.current.style.left=R+"px",i.current.style.width=T+"px",f.current=!1):(p(!0),requestAnimationFrame(()=>{if(!i.current||!a.current)return;const $=a.current.querySelector(`[data-value="${e}"]`);if(!$)return;const I=a.current.getBoundingClientRect(),k=$.getBoundingClientRect();i.current.style.transition="none",i.current.style.left=k.left-I.left+"px",i.current.style.width=k.width+"px"}))};return h.current=v,u.useLayoutEffect(()=>{const d=m.current!==e;m.current=e,f.current=l&&d,v()}),u.useEffect(()=>{if(!a.current)return;const d=new ResizeObserver(()=>{f.current=!1,h.current()});return d.observe(a.current),()=>d.disconnect()},[]),s.jsxs("div",{className:["ds-seg",`ds-seg--${o}`,n&&"ds-seg--disabled"].filter(Boolean).join(" "),ref:a,role:"group",children:[l&&s.jsx("div",{ref:i,className:"ds-seg__pill","aria-hidden":"true"}),t.map(d=>s.jsxs("button",{type:"button","data-value":d.value,className:["ds-seg__btn",e===d.value&&"ds-seg__btn--active"].filter(Boolean).join(" "),onClick:()=>!n&&r(d.value),"aria-pressed":e===d.value,disabled:n,children:[d.icon&&s.jsx("span",{className:"ds-seg__btn-icon","aria-hidden":"true",children:d.icon}),d.label]},d.value))]})}function Fe({children:t,title:e,defaultExpanded:r=!1,expanded:o,onToggle:n,padding:a="m",...i}){const[l,p]=u.useState(r),f=o!==void 0,m=f?o:l,h=()=>{f?n==null||n(!o):p(d=>!d)},v=["ds-accordion",`ds-accordion--${a}`,m&&"ds-accordion--expanded"].filter(Boolean).join(" ");return s.jsxs("div",{className:v,...i,children:[s.jsxs("button",{type:"button",className:"ds-accordion__header",onClick:h,"aria-expanded":m,children:[s.jsx("span",{className:"ds-accordion__title",children:e}),s.jsx(E.ChevronDown,{size:P[2],strokeWidth:1.5,className:`ds-accordion__icon ${m?"ds-accordion__icon--expanded":""}`})]}),s.jsx("div",{className:"ds-accordion__content",children:s.jsx("div",{className:"ds-accordion__content-inner",children:s.jsx("div",{className:"ds-accordion__content-body",children:t})})})]})}const D=8,W=8;function Ve(t,e,r){const o=window.innerWidth;let n,a;switch(t){case"top":n=e.top-r.height-D,a=e.left+e.width/2-r.width/2;break;case"bottom":n=e.bottom+D,a=e.left+e.width/2-r.width/2;break;case"left":n=e.top+e.height/2-r.height/2,a=e.left-r.width-D;break;case"right":n=e.top+e.height/2-r.height/2,a=e.right+D;break;default:n=e.bottom+D,a=e.left}const i=Math.max(W,Math.min(o-r.width-W,a)),l=a-i;return{top:n,left:i,arrowOffset:l}}function We(t,e,r){const o=window.innerWidth,n=window.innerHeight;if(t.top>=e+D+W)return"top";if(n-t.bottom>=e+D+W)return"bottom";if(o-t.right>=r+D+W)return"right";if(t.left>=r+D+W)return"left";const a=Math.max(t.top,n-t.bottom,t.left,o-t.right);return a===t.top?"top":a===n-t.bottom?"bottom":a===o-t.right?"right":"left"}function ze({children:t,content:e,position:r,...o}){const[n,a]=u.useState(!1),[i,l]=u.useState({visibility:"hidden"}),[p,f]=u.useState(r||"top"),m=u.useRef(null),h=u.useRef(null),v=u.useRef(!1),d=()=>{if(!m.current||!h.current)return;const j=m.current.getBoundingClientRect(),R=h.current.getBoundingClientRect(),T=r||We(j,R.height,R.width),{top:$,left:I,arrowOffset:k}=Ve(T,j,R);f(T),l({position:"fixed",top:$,left:I,visibility:"visible","--arrow-offset":`${k}px`})};if(u.useEffect(()=>{if(!n)return;l({position:"fixed",visibility:"hidden"});const j=requestAnimationFrame(d);return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(j),window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[n,r]),u.useEffect(()=>{if(!n)return;const j=R=>{m.current&&!m.current.contains(R.target)&&a(!1)};return document.addEventListener("touchstart",j),()=>document.removeEventListener("touchstart",j)},[n]),!e)return t;const _=n&&s.jsx("div",{ref:h,className:`ds-tooltip ds-tooltip--${p}`,role:"tooltip",style:i,children:e});return s.jsxs("div",{ref:m,className:"ds-tooltip-wrapper",onMouseEnter:()=>{v.current||a(!0)},onMouseLeave:()=>{v.current||a(!1)},onTouchStart:()=>{v.current=!0,a(j=>!j)},...o,children:[t,typeof document<"u"&&K.createPortal(_,document.body)]})}function Ye({checked:t=!1,onChange:e,size:r="m",disabled:o=!1,label:n,id:a,...i}){const l=a||`toggle-${u.useId()}`,p=["ds-toggle",`ds-toggle--${r}`,o&&"ds-toggle--disabled"].filter(Boolean).join(" ");return s.jsxs("label",{className:p,htmlFor:l,children:[s.jsx("input",{type:"checkbox",id:l,className:"ds-toggle__input",checked:t,onChange:f=>e==null?void 0:e(f.target.checked),disabled:o,...i}),s.jsx("span",{className:"ds-toggle__track",children:s.jsx("span",{className:"ds-toggle__thumb"})}),n&&s.jsx("span",{className:"ds-toggle__label",children:n})]})}function Ue({checked:t=!1,onChange:e,size:r="m",disabled:o=!1,label:n,id:a,...i}){const l=a||`checkbox-${u.useId()}`,p=["ds-checkbox",`ds-checkbox--${r}`,o&&"ds-checkbox--disabled"].filter(Boolean).join(" "),f=r==="xs"?10:r==="small"?14:r==="large"?20:16;return s.jsxs("label",{className:p,htmlFor:l,children:[s.jsx("input",{type:"checkbox",id:l,className:"ds-checkbox__input",checked:t,onChange:m=>e==null?void 0:e(m.target.checked),disabled:o,...i}),s.jsx("span",{className:"ds-checkbox__box",children:t&&s.jsx(E.Check,{size:f,strokeWidth:2.5,className:"ds-checkbox__icon"})}),n&&s.jsx("span",{className:"ds-checkbox__label",children:n})]})}function qe({checked:t=!1,onChange:e,size:r="m",disabled:o=!1,label:n,name:a,value:i,id:l,...p}){const f=l||`radio-${u.useId()}`,m=["ds-radio",`ds-radio--${r}`,o&&"ds-radio--disabled"].filter(Boolean).join(" ");return s.jsxs("label",{className:m,htmlFor:f,children:[s.jsx("input",{type:"radio",id:f,className:"ds-radio__input",checked:t,onChange:h=>e==null?void 0:e(h.target.checked),disabled:o,name:a,value:i,...p}),s.jsx("span",{className:"ds-radio__circle",children:s.jsx("span",{className:"ds-radio__dot"})}),n&&s.jsx("span",{className:"ds-radio__label",children:n})]})}function He({width:t,height:e,shape:r="rect",className:o="",style:n={},...a}){return s.jsx("span",{className:["ds-skeleton",`ds-skeleton--${r}`,o].filter(Boolean).join(" "),style:{width:t,height:e,...n},"aria-hidden":"true",...a})}function Xe(t){let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return e%360}function Ge(t){if(!t)return"";const e=t.trim().split(/\s+/);return e.length>=2?(e[0][0]+e[1][0]).toUpperCase():t[0].toUpperCase()}function Je({seed:t,icon:e,src:r,size:o=32,className:n="",style:a={},...i}){const l=Xe(t??""),[p,f]=u.useState(!1),m=e??s.jsx("span",{className:"ds-avatar__initials",children:Ge(t)});return s.jsx("div",{className:["ds-avatar",n].filter(Boolean).join(" "),style:{width:o,height:o,"--ds-avatar-h":l,...a},"aria-hidden":"true",...i,children:r&&!p?s.jsx("img",{src:r,alt:"",onError:()=>f(!0)}):m})}function Ke({children:t,size:e="compact",stickyTop:r,maxHeight:o,className:n="",style:a={},...i}){const l={...o?{maxHeight:o}:{},...r!==void 0?{"--ds-table-sticky-top":typeof r=="number"?`${r}px`:r}:{},...a};return s.jsx("div",{className:["ds-table-wrap",o?"ds-table-wrap--scroll":""].filter(Boolean).join(" "),style:l,children:s.jsx("table",{className:["ds-table",`ds-table--${e}`,n].filter(Boolean).join(" "),...i,children:t})})}function Ze({children:t,...e}){return s.jsx("thead",{...e,children:t})}function Qe({children:t,...e}){return s.jsx("tbody",{...e,children:t})}function et({children:t,interactive:e,selected:r,subheader:o,className:n="",onClick:a,...i}){return s.jsx("tr",{className:["ds-table-row",e||a?"ds-table-row--interactive":"",r?"ds-table-row--selected":"",o?"ds-table-row--subheader":"",n].filter(Boolean).join(" "),onClick:a,...i,children:t})}function tt({children:t,colSpan:e=999,...r}){return s.jsx("tr",{className:"ds-table-row ds-table-row--subheader",...r,children:s.jsx("td",{colSpan:e,children:t})})}function st({children:t,align:e="left",sortDir:r,onSort:o,width:n,className:a="",style:i={},...l}){const p=!!o||r!==void 0,f=r==="asc"?E.ChevronUp:r==="desc"?E.ChevronDown:E.ChevronsUpDown;return s.jsx("th",{className:["ds-th",p?"ds-th--sortable":"",r?"ds-th--sorted":"",e!=="left"?`ds-table-cell--${e}`:"",a].filter(Boolean).join(" "),onClick:o,style:{width:n,...i},...l,children:p?s.jsxs("span",{className:"ds-th__inner",children:[t,s.jsx("span",{className:"ds-th__sort-icon",children:s.jsx(f,{size:11,strokeWidth:2.5})})]}):t})}function rt({children:t,align:e="left",secondary:r,muted:o,truncate:n,nowrap:a,className:i="",...l}){return s.jsx("td",{className:["ds-td",e!=="left"?`ds-table-cell--${e}`:"",r?"ds-table-cell--secondary":"",o?"ds-table-cell--muted":"",n?"ds-table-cell--truncate":"",a?"ds-table-cell--nowrap":"",i].filter(Boolean).join(" "),...l,children:t})}function nt({icon:t,title:e,description:r,action:o,size:n="m",className:a="",...i}){return s.jsxs("div",{className:["ds-empty-state",`ds-empty-state--${n}`,a].filter(Boolean).join(" "),...i,children:[t&&s.jsx("div",{className:"ds-empty-state__icon",children:t}),s.jsx("div",{className:"ds-empty-state__title",children:e}),r&&s.jsx("div",{className:"ds-empty-state__description",children:r}),o&&s.jsx("div",{className:"ds-empty-state__action",children:o})]})}function at({trigger:t,items:e=[],open:r,onOpenChange:o,align:n="left",className:a="",style:i,...l}){const[p,f]=u.useState(!1),[m,h]=u.useState(!1),v=r!==void 0,d=v?r:p,_=u.useRef(null),j=u.useRef(null),[R,T]=u.useState({}),$=u.useRef(null),I=150,k=()=>{if(v)o==null||o(!1);else{if(m)return;h(!0),$.current=setTimeout(()=>{f(!1),h(!1)},I)}},C=()=>{const b=!d;v?o==null||o(b):b?(clearTimeout($.current),h(!1),f(!0)):k()};u.useEffect(()=>()=>clearTimeout($.current),[]),u.useEffect(()=>{if(!d)return;const b=()=>{var A;const w=(A=_.current)==null?void 0:A.getBoundingClientRect();w&&T(n==="right"?{top:w.bottom+4,right:window.innerWidth-w.right}:{top:w.bottom+4,left:w.left})};return b(),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),()=>{window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b)}},[d,n]),u.useEffect(()=>{if(!d)return;const b=A=>{var M,O;!((M=_.current)!=null&&M.contains(A.target))&&!((O=j.current)!=null&&O.contains(A.target))&&k()},w=A=>{A.key==="Escape"&&k()};return document.addEventListener("mousedown",b),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",w)}},[d]);const L=d&&s.jsx("div",{ref:j,className:["ds-dropdown__menu",`ds-dropdown__menu--${n}`,m&&"ds-dropdown__menu--closing"].filter(Boolean).join(" "),style:R,children:e.map((b,w)=>{if(b.separator)return s.jsx("div",{className:"ds-dropdown__separator"},w);if(b.type==="section")return s.jsxs("div",{className:"ds-dropdown__section",children:[b.label&&s.jsx("div",{className:"ds-dropdown__section-label",children:b.label}),s.jsx("div",{className:"ds-dropdown__section-content",children:b.content})]},w);const A=!!b.href,M=A?"a":"button",O=A?{href:b.disabled?void 0:b.href,"aria-disabled":b.disabled?"true":void 0}:{type:"button",disabled:b.disabled};return s.jsxs(M,{className:["ds-dropdown__item",b.danger&&"ds-dropdown__item--danger"].filter(Boolean).join(" "),...O,onClick:()=>{var B;(B=b.onClick)==null||B.call(b),k()},children:[b.icon&&s.jsx("span",{className:"ds-dropdown__item-icon",children:b.icon}),s.jsx("span",{className:"ds-dropdown__item-label",children:b.label}),b.shortcut&&s.jsx("span",{className:"ds-dropdown__item-shortcut",children:b.shortcut})]},w)})});return s.jsxs("div",{ref:_,className:["ds-dropdown",a].filter(Boolean).join(" "),style:i,...l,children:[s.jsx("div",{className:"ds-dropdown__trigger",onClick:C,children:t}),typeof document<"u"&&K.createPortal(L,document.body)]})}function ot({value:t=0,size:e="m",variant:r="default",showValue:o=!1,min:n=2,animate:a=!0}){const i=Math.min(100,Math.max(0,t)),l=Math.max(n,i),p=r==="auto"?i>=70?"success":i>=50?"warning":"danger":r;return s.jsxs("div",{className:["ds-progress",`ds-progress--${e}`,!a&&"ds-progress--instant"].filter(Boolean).join(" "),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[s.jsx("div",{className:"ds-progress__track",children:s.jsx("div",{className:`ds-progress__fill ds-progress__fill--${p}`,style:{width:`${l}%`}})}),o&&s.jsxs("span",{className:"ds-progress__value",children:[Math.round(i),"%"]})]})}const ct=t=>1-Math.pow(1-t,3),it=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;function ue(t,{duration:e=600}={}){const[r,o]=u.useState(t),n=u.useRef(t),a=u.useRef(null);return u.useEffect(()=>{if(it()){o(t),n.current=t;return}const i=n.current,l=t-i;if(l===0)return;let p=null;const f=m=>{p||(p=m);const h=Math.min((m-p)/e,1);o(i+l*ct(h)),h<1?a.current=requestAnimationFrame(f):n.current=t};return a.current=requestAnimationFrame(f),()=>cancelAnimationFrame(a.current)},[t,e]),r}function lt({value:t,duration:e=600,decimals:r=0,prefix:o="",suffix:n=""}){const i=ue(t,{duration:e}).toFixed(r);return`${o}${i}${n}`}function fe({threshold:t=.1,rootMargin:e="0px",once:r=!1}={}){const o=u.useRef(null),[n,a]=u.useState(!1);return u.useEffect(()=>{const i=o.current;if(!i)return;const l=new IntersectionObserver(([p])=>{p.isIntersecting?(a(!0),r&&l.disconnect()):r||a(!1)},{threshold:t,rootMargin:e});return l.observe(i),()=>l.disconnect()},[t,e,r]),{ref:o,inView:n}}function dt({children:t,as:e="div",once:r=!1,threshold:o=.1,rootMargin:n="0px",onEnter:a,onLeave:i,...l}){const{ref:p,inView:f}=fe({threshold:o,rootMargin:n,once:r}),m=u.useRef(!1);return u.useEffect(()=>{f&&!m.current&&(a==null||a()),!f&&m.current&&(i==null||i()),m.current=f},[f]),s.jsx(e,{ref:p,...l,children:typeof t=="function"?t(f):t})}const ce={default:E.Info,success:E.CheckCircle,warning:E.AlertTriangle,error:E.XCircle};let z=[];const ne=new Set;function me(){ne.forEach(t=>t([...z]))}function ut(t){z=[...z,t],me()}function ft(t){z=z.filter(e=>e.id!==t),me()}function mt(){const t=(e,r={})=>{ut({id:`${Date.now()}-${Math.random()}`,message:e,type:"default",duration:4e3,...r})};return t.success=(e,r)=>t(e,{...r,type:"success"}),t.error=(e,r)=>t(e,{...r,type:"error"}),t.warning=(e,r)=>t(e,{...r,type:"warning"}),{toast:t}}function pt({data:t,onDismiss:e}){const[r,o]=u.useState(!1),n=u.useRef(null);u.useEffect(()=>(requestAnimationFrame(()=>o(!0)),t.duration>0&&(n.current=setTimeout(()=>a(),t.duration)),()=>clearTimeout(n.current)),[]);function a(){o(!1),setTimeout(()=>e(t.id),250)}const i=ce[t.type]??ce.default;return s.jsxs("div",{className:["ds-toast",`ds-toast--${t.type}`,r&&"ds-toast--visible"].filter(Boolean).join(" "),role:t.type==="error"?"alert":"status","aria-live":"polite",children:[s.jsx("div",{className:"ds-toast__icon",children:s.jsx(i,{size:P[3],strokeWidth:1.5})}),s.jsx("span",{className:"ds-toast__message",children:t.message}),s.jsx("button",{className:"ds-toast__close",onClick:a,"aria-label":"Закрыть",children:s.jsx(E.X,{size:P[3],strokeWidth:1.5})})]})}function ht({position:t="bottom-right"}){const[e,r]=u.useState(()=>[...z]);return u.useEffect(()=>(ne.add(r),()=>ne.delete(r)),[]),!e.length||typeof document>"u"?null:K.createPortal(s.jsx("div",{className:["ds-toast-container",`ds-toast-container--${t}`].join(" "),children:e.map(o=>s.jsx(pt,{data:o,onDismiss:ft},o.id))}),document.body)}exports.Accordion=Fe;exports.Alert=Ae;exports.AnimatedNumber=lt;exports.Avatar=Je;exports.Badge=$e;exports.Button=le;exports.Card=Ne;exports.Checkbox=Ue;exports.Code=Be;exports.CodeAccordion=de;exports.Dropdown=at;exports.EmptyState=nt;exports.H1=ye;exports.H2=Ee;exports.H3=Re;exports.H4=Te;exports.InView=dt;exports.Input=ve;exports.Link=Ce;exports.Modal=Oe;exports.ModalFooter=re;exports.P1=ke;exports.P2=ge;exports.P3=Se;exports.ProgressBar=ot;exports.Radio=qe;exports.SegmentedControl=De;exports.Select=je;exports.Skeleton=He;exports.Spinner=ie;exports.Stepper=we;exports.Tab=Me;exports.Table=Ke;exports.TableBody=Qe;exports.TableHead=Ze;exports.TableRow=et;exports.TableSubheaderRow=tt;exports.Tabs=Le;exports.Td=rt;exports.Textarea=_e;exports.Th=st;exports.ToastContainer=ht;exports.Toggle=Ye;exports.Tooltip=ze;exports.iconSizes=P;exports.useAnimatedNumber=ue;exports.useInView=fe;exports.useToast=mt;