@vacano/ui 1.7.0 → 1.9.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-BIgkmQPR.cjs"),be=require("@emotion/react"),p=require("react"),t=require("./media-BuwIclXE.cjs"),A=require("./tooling-Dflq0Y98.cjs"),ge=require("react-dom");function no(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Re=no(p);function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var i in o)({}).hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},Ct.apply(null,arguments)}const ao=be.css`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-BIgkmQPR.cjs"),be=require("@emotion/react"),u=require("react"),t=require("./media-BuwIclXE.cjs"),I=require("./tooling-Dflq0Y98.cjs"),ge=require("react-dom");function no(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Re=no(u);function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Ct.apply(null,arguments)}const ao=be.css`
2
2
  *,
3
3
  *::before,
4
4
  *::after {
@@ -14,6 +14,9 @@
14
14
  -webkit-text-size-adjust: 100%;
15
15
  -moz-tab-size: 4;
16
16
  tab-size: 4;
17
+ font-family:
18
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif,
19
+ 'Apple Color Emoji', 'Segoe UI Emoji';
17
20
  }
18
21
 
19
22
  body {
@@ -73,50 +76,6 @@
73
76
  border-spacing: 0;
74
77
  }
75
78
 
76
- /*
77
- * Inter Font Configuration
78
- * Optimized for UI with modern CSS features
79
- */
80
-
81
- html {
82
- font-family:
83
- 'Inter',
84
- -apple-system,
85
- BlinkMacSystemFont,
86
- 'Segoe UI',
87
- Roboto,
88
- 'Helvetica Neue',
89
- Arial,
90
- sans-serif;
91
-
92
- /* Variable font optical sizing */
93
- font-optical-sizing: auto;
94
-
95
- /*
96
- * OpenType features for Inter:
97
- * - cv01: alternate 1 (distinguishable from l/I)
98
- * - cv02: alternate 4 (open top)
99
- * - cv03: alternate 6 (straight tail)
100
- * - cv04: alternate 9 (straight tail)
101
- * - ss01: open digits
102
- * - ss02: disambiguation (alt a, g)
103
- * - tnum: tabular numbers (monospaced digits for alignment)
104
- * - zero: slashed zero
105
- */
106
- font-feature-settings:
107
- 'cv01' 1,
108
- 'cv02' 1,
109
- 'ss01' 1,
110
- 'tnum' 1,
111
- 'zero' 1;
112
-
113
- /* Improved kerning */
114
- font-kerning: normal;
115
-
116
- /* Slight negative tracking for Inter at UI sizes */
117
- letter-spacing: -0.011em;
118
- }
119
-
120
79
  /* Tabular figures for numbers in data contexts */
121
80
  .tabular-nums {
122
81
  font-variant-numeric: tabular-nums;
@@ -141,11 +100,11 @@
141
100
  :focus:not(:focus-visible) {
142
101
  outline: none;
143
102
  }
144
- `,lo=()=>a.jsx(be.Global,{styles:ao});var co=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,so=a.memoize(function(e){return co.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),po=so,uo=function(r){return r!=="theme"},Tt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?po:uo},Nt=function(r,o,i){var n;if(o){var l=o.shouldForwardProp;n=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof n!="function"&&i&&(n=r.__emotion_forwardProp),n},ho=function(r){var o=r.cache,i=r.serialized,n=r.isStringTag;return a.registerStyles(o,i,n),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,i,n)}),null},bo=function e(r,o){var i=r.__emotion_real===r,n=i&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=Nt(r,o,i),u=d||Tt(n),b=!u("as");return function(){var h=arguments,f=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),h[0]==null||h[0].raw===void 0)f.push.apply(f,h);else{var $=h[0];f.push($[0]);for(var m=h.length,S=1;S<m;S++)f.push(h[S],$[S])}var x=be.withEmotionCache(function(C,O,y){var g=b&&C.as||n,L="",z=[],N=C;if(C.theme==null){N={};for(var V in C)N[V]=C[V];N.theme=Re.useContext(be.ThemeContext)}typeof C.className=="string"?L=a.getRegisteredStyles(O.registered,z,C.className):C.className!=null&&(L=C.className+" ");var P=a.serializeStyles(f.concat(z),O.registered,N);L+=O.key+"-"+P.name,c!==void 0&&(L+=" "+c);var _=b&&d===void 0?Tt(g):u,j={};for(var w in C)b&&w==="as"||_(w)&&(j[w]=C[w]);return j.className=L,y&&(j.ref=y),Re.createElement(Re.Fragment,null,Re.createElement(ho,{cache:O,serialized:P,isStringTag:typeof g=="string"}),Re.createElement(g,j))});return x.displayName=l!==void 0?l:"Styled("+(typeof n=="string"?n:n.displayName||n.name||"Component")+")",x.defaultProps=r.defaultProps,x.__emotion_real=x,x.__emotion_base=n,x.__emotion_styles=f,x.__emotion_forwardProp=d,Object.defineProperty(x,"toString",{value:function(){return"."+c}}),x.withComponent=function(C,O){var y=e(C,Ct({},o,O,{shouldForwardProp:Nt(x,O,!0)}));return y.apply(void 0,f)},x}},go=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],s=bo.bind(null);go.forEach(function(e){s[e]=s(e)});const fo=s.span`
103
+ `,lo=()=>a.jsx(be.Global,{styles:ao});var co=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,so=a.memoize(function(e){return co.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),po=so,uo=function(r){return r!=="theme"},Tt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?po:uo},Nt=function(r,o,n){var i;if(o){var l=o.shouldForwardProp;i=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof i!="function"&&n&&(i=r.__emotion_forwardProp),i},ho=function(r){var o=r.cache,n=r.serialized,i=r.isStringTag;return a.registerStyles(o,n,i),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,n,i)}),null},bo=function e(r,o){var n=r.__emotion_real===r,i=n&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=Nt(r,o,n),p=d||Tt(i),b=!p("as");return function(){var h=arguments,f=n&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),h[0]==null||h[0].raw===void 0)f.push.apply(f,h);else{var $=h[0];f.push($[0]);for(var m=h.length,O=1;O<m;O++)f.push(h[O],$[O])}var x=be.withEmotionCache(function(C,S,y){var g=b&&C.as||i,L="",T=[],j=C;if(C.theme==null){j={};for(var Y in C)j[Y]=C[Y];j.theme=Re.useContext(be.ThemeContext)}typeof C.className=="string"?L=a.getRegisteredStyles(S.registered,T,C.className):C.className!=null&&(L=C.className+" ");var P=a.serializeStyles(f.concat(T),S.registered,j);L+=S.key+"-"+P.name,c!==void 0&&(L+=" "+c);var _=b&&d===void 0?Tt(g):p,M={};for(var E in C)b&&E==="as"||_(E)&&(M[E]=C[E]);return M.className=L,y&&(M.ref=y),Re.createElement(Re.Fragment,null,Re.createElement(ho,{cache:S,serialized:P,isStringTag:typeof g=="string"}),Re.createElement(g,M))});return x.displayName=l!==void 0?l:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",x.defaultProps=r.defaultProps,x.__emotion_real=x,x.__emotion_base=i,x.__emotion_styles=f,x.__emotion_forwardProp=d,Object.defineProperty(x,"toString",{value:function(){return"."+c}}),x.withComponent=function(C,S){var y=e(C,Ct({},o,S,{shouldForwardProp:Nt(x,S,!0)}));return y.apply(void 0,f)},x}},go=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],s=bo.bind(null);go.forEach(function(e){s[e]=s(e)});const fo=s.span`
145
104
  font-size: 12px;
146
105
  font-weight: 500;
147
106
  color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
148
- `,xo=A.newClassNameGetter("field-label"),ie=({children:e,className:r,ref:o,required:i,variant:n="normal",...l})=>e?a.jsxs(fo,{...l,ref:o,className:xo("container",r),$variant:n,children:[e," ",i&&"*"]}):null,ot={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ne={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Oo=s.div`
107
+ `,xo=I.newClassNameGetter("field-label"),ie=({children:e,className:r,ref:o,required:n,variant:i="normal",...l})=>e?a.jsxs(fo,{...l,ref:o,className:xo("container",r),$variant:i,children:[e," ",n&&"*"]}):null,ot={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ne={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Oo=s.div`
149
108
  position: relative;
150
109
  display: grid;
151
110
  gap: 2px;
@@ -194,7 +153,7 @@
194
153
  display: flex;
195
154
  align-items: center;
196
155
  justify-content: center;
197
- `,mo=s.div`
156
+ `,vo=s.div`
198
157
  position: absolute;
199
158
  top: 100%;
200
159
  left: 0;
@@ -214,7 +173,7 @@
214
173
  opacity 0.15s ease,
215
174
  transform 0.15s ease,
216
175
  visibility 0.15s;
217
- `,vo=s.div`
176
+ `,mo=s.div`
218
177
  display: flex;
219
178
  align-items: center;
220
179
  gap: 10px;
@@ -270,13 +229,13 @@
270
229
  border-top-color: ${At.indicator};
271
230
  border-radius: 50%;
272
231
  animation: ${Lo} 0.8s linear infinite;
273
- `,Po=A.newClassNameGetter("spinner"),kt=({"aria-label":e="Loading",className:r,ref:o,size:i="md",...n})=>a.jsx(Eo,{...n,ref:o,className:Po("container",r),role:"status","aria-label":e,$size:i}),ke=A.newClassNameGetter("autocomplete"),zo=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",value:u,onChange:b,onSearch:h,debounceMs:f=300,minChars:$=1,noResultsMessage:m="No results found",...S})=>{const[x,C]=p.useState((u==null?void 0:u.value)??""),[O,y]=p.useState([]),[g,L]=p.useState(!1),[z,N]=p.useState(!1),[V,P]=p.useState(!1),_=p.useRef(null),j=p.useRef(null);p.useEffect(()=>{(u==null?void 0:u.value)!==void 0&&C(u.value)},[u==null?void 0:u.value]);const w=p.useCallback(async T=>{if(T.length<$){y([]),P(!1);return}L(!0),P(!0);try{const F=await h(T);y(F),N(!0)}catch{y([])}finally{L(!1)}},[h,$]),M=p.useCallback(T=>{const F=T.target.value;C(F),b==null||b({value:F,image_url:null}),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{w(F)},f)},[b,w,f]),v=p.useCallback(T=>{C(T.value),y([]),N(!1),P(!1),b==null||b({value:T.value,image_url:T.image_url})},[b]),I=p.useCallback(()=>{setTimeout(()=>{N(!1)},150)},[]),k=p.useCallback(()=>{O.length>0&&N(!0)},[O.length]);return p.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),a.jsxs(Oo,{ref:_,className:ke("container",e),$fullWidth:!!i,children:[n&&a.jsx($o,{variant:d,className:ke("label",r==null?void 0:r.label),children:n}),a.jsxs(So,{children:[a.jsx(yo,{...S,ref:l,type:"text",value:x,onChange:M,onBlur:I,onFocus:k,disabled:o,$size:c,$variant:d,className:ke("input",r==null?void 0:r.input)}),g&&a.jsx(Co,{children:a.jsx(kt,{size:"xs"})})]}),a.jsx(mo,{$open:z&&V,className:ke("dropdown",r==null?void 0:r.dropdown),children:O.length>0?O.map(T=>a.jsxs(vo,{onClick:()=>v(T),className:ke("item",r==null?void 0:r.item),children:[T.image_url&&a.jsx(wo,{src:T.image_url,alt:T.value}),a.jsx(Ro,{children:T.value})]},T.id)):!g&&a.jsx(ko,{children:m})})]})},Dt={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},_t={normal:{background:{static:t.COLORS["steel-blue"],hover:t.alpha(t.COLORS["steel-blue"],90),active:t.alpha(t.COLORS["steel-blue"],80),disabled:t.alpha(t.COLORS["steel-blue"],50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},system:{background:{static:t.COLORS.black,hover:t.alpha(t.COLORS.black,90),active:t.alpha(t.COLORS.black,80),disabled:t.alpha(t.COLORS.black,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},success:{background:{static:t.COLORS.green,hover:t.alpha(t.COLORS.green,90),active:t.alpha(t.COLORS.green,80),disabled:t.alpha(t.COLORS.green,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},warning:{background:{static:t.COLORS.yellow,hover:t.alpha(t.COLORS.yellow,90),active:t.alpha(t.COLORS.yellow,80),disabled:t.alpha(t.COLORS.yellow,50)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.COLORS.black},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},danger:{background:{static:t.COLORS.red,hover:t.alpha(t.COLORS.red,90),active:t.alpha(t.COLORS.red,80),disabled:t.alpha(t.COLORS.red,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},transparent:{background:{static:t.alpha(t.COLORS["iron-grey"],1),hover:t.alpha(t.COLORS["iron-grey"],5),active:t.alpha(t.COLORS["iron-grey"],10),disabled:t.alpha(t.COLORS["iron-grey"],5)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:t.alpha(t.COLORS["iron-grey"],20),hover:t.alpha(t.COLORS["iron-grey"],20),active:t.alpha(t.COLORS["iron-grey"],20),disabled:t.alpha(t.COLORS["iron-grey"],10)}}},J=e=>{const r=_t[e];return r||_t.normal},re=e=>{const r=Dt[e];return r||Dt.default},jo=e=>e?"auto":"fit-content",To=s.button`
232
+ `,Po=I.newClassNameGetter("spinner"),kt=({"aria-label":e="Loading",className:r,ref:o,size:n="md",...i})=>a.jsx(Eo,{...i,ref:o,className:Po("container",r),role:"status","aria-label":e,$size:n}),ke=I.newClassNameGetter("autocomplete"),jo=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,size:c="default",variant:d="normal",value:p,onChange:b,onSearch:h,debounceMs:f=300,minChars:$=1,noResultsMessage:m="No results found",...O})=>{const[x,C]=u.useState((p==null?void 0:p.value)??""),[S,y]=u.useState([]),[g,L]=u.useState(!1),[T,j]=u.useState(!1),[Y,P]=u.useState(!1),_=u.useRef(null),M=u.useRef(null);u.useEffect(()=>{(p==null?void 0:p.value)!==void 0&&C(p.value)},[p==null?void 0:p.value]);const E=u.useCallback(async z=>{if(z.length<$){y([]),P(!1);return}L(!0),P(!0);try{const B=await h(z);y(B),j(!0)}catch{y([])}finally{L(!1)}},[h,$]),A=u.useCallback(z=>{const B=z.target.value;C(B),b==null||b({value:B,image_url:null}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{E(B)},f)},[b,E,f]),v=u.useCallback(z=>{C(z.value),y([]),j(!1),P(!1),b==null||b({value:z.value,image_url:z.image_url})},[b]),N=u.useCallback(()=>{setTimeout(()=>{j(!1)},150)},[]),R=u.useCallback(()=>{S.length>0&&j(!0)},[S.length]);return u.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]),a.jsxs(Oo,{ref:_,className:ke("container",e),$fullWidth:!!n,children:[i&&a.jsx($o,{variant:d,className:ke("label",r==null?void 0:r.label),children:i}),a.jsxs(So,{children:[a.jsx(yo,{...O,ref:l,type:"text",value:x,onChange:A,onBlur:N,onFocus:R,disabled:o,$size:c,$variant:d,className:ke("input",r==null?void 0:r.input)}),g&&a.jsx(Co,{children:a.jsx(kt,{size:"xs"})})]}),a.jsx(vo,{$open:T&&Y,className:ke("dropdown",r==null?void 0:r.dropdown),children:S.length>0?S.map(z=>a.jsxs(mo,{onClick:()=>v(z),className:ke("item",r==null?void 0:r.item),children:[z.image_url&&a.jsx(wo,{src:z.image_url,alt:z.value}),a.jsx(Ro,{children:z.value})]},z.id)):!g&&a.jsx(ko,{children:m})})]})},Dt={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},_t={normal:{background:{static:t.COLORS["steel-blue"],hover:t.alpha(t.COLORS["steel-blue"],90),active:t.alpha(t.COLORS["steel-blue"],80),disabled:t.alpha(t.COLORS["steel-blue"],50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},system:{background:{static:t.COLORS.black,hover:t.alpha(t.COLORS.black,90),active:t.alpha(t.COLORS.black,80),disabled:t.alpha(t.COLORS.black,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},success:{background:{static:t.COLORS.green,hover:t.alpha(t.COLORS.green,90),active:t.alpha(t.COLORS.green,80),disabled:t.alpha(t.COLORS.green,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},warning:{background:{static:t.COLORS.yellow,hover:t.alpha(t.COLORS.yellow,90),active:t.alpha(t.COLORS.yellow,80),disabled:t.alpha(t.COLORS.yellow,50)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.COLORS.black},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},danger:{background:{static:t.COLORS.red,hover:t.alpha(t.COLORS.red,90),active:t.alpha(t.COLORS.red,80),disabled:t.alpha(t.COLORS.red,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},transparent:{background:{static:t.alpha(t.COLORS["iron-grey"],1),hover:t.alpha(t.COLORS["iron-grey"],5),active:t.alpha(t.COLORS["iron-grey"],10),disabled:t.alpha(t.COLORS["iron-grey"],5)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:t.alpha(t.COLORS["iron-grey"],20),hover:t.alpha(t.COLORS["iron-grey"],20),active:t.alpha(t.COLORS["iron-grey"],20),disabled:t.alpha(t.COLORS["iron-grey"],10)}}},J=e=>{const r=_t[e];return r||_t.normal},re=e=>{const r=Dt[e];return r||Dt.default},zo=e=>e?"auto":"fit-content",To=s.button`
274
233
  display: flex;
275
234
  gap: 6px;
276
235
  text-decoration: none;
277
236
  align-items: center;
278
237
  justify-content: center;
279
- width: ${e=>e.$iconOnly?re(e.$size).height:jo(!!e.$fullWidth)};
238
+ width: ${e=>e.$iconOnly?re(e.$size).height:zo(!!e.$fullWidth)};
280
239
  color: ${e=>J(e.$variant).color.static};
281
240
  background-color: ${e=>J(e.$variant).background.static};
282
241
  height: ${e=>re(e.$size).height};
@@ -337,12 +296,12 @@
337
296
  border-radius: 4px;
338
297
  width: fit-content;
339
298
  background-color: ${e=>e.$variant==="light"?t.alpha(t.COLORS.white,25):t.alpha(t.COLORS.black,25)};
340
- `,Mo=A.newClassNameGetter("key-symbol"),yr=({className:e,ref:r,symbol:o,variant:i="light",...n})=>o?a.jsx(_o,{...n,ref:r,className:Mo("container",e),$variant:i,children:o}):null,Mt=A.newClassNameGetter("key-bindings"),Cr=({className:e,classnames:r,keys:o,ref:i,variant:n,...l})=>{const c=p.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(Do,{...l,ref:i,className:Mt("container",e),children:c.map(d=>a.jsx(yr,{symbol:d,className:Mt("item",r==null?void 0:r.item),variant:n},d))})},Ft=A.newClassNameGetter("button"),De=({children:e,className:r,classnames:o,disabled:i,fullWidth:n,icon:l,loading:c,onClick:d,ref:u=null,keyBindings:b=[],size:h="default",type:f="button",variant:$="normal",...m})=>{const S=p.useRef(null);p.useImperativeHandle(u,()=>S.current,[]),t.useKeyBinding(b,()=>{var C;(C=S.current)==null||C.click()});const x=p.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(To,{...m,onClick:d,ref:S,type:x,disabled:i,className:Ft("container",r),$variant:$,$size:h,$fullWidth:!!n,$iconOnly:!!l&&!(e||(b==null?void 0:b.length)>0),children:[c&&a.jsx(Ao,{$size:h}),l&&!c&&a.jsx(No,{$size:h,children:l}),e&&a.jsx(Io,{className:Ft("label",o==null?void 0:o.label),children:e}),a.jsx(Cr,{keys:b,variant:$==="system"?"light":"dark"})]})},Fo=s.div`
299
+ `,Mo=I.newClassNameGetter("key-symbol"),yr=({className:e,ref:r,symbol:o,variant:n="light",...i})=>o?a.jsx(_o,{...i,ref:r,className:Mo("container",e),$variant:n,children:o}):null,Mt=I.newClassNameGetter("key-bindings"),Cr=({className:e,classnames:r,keys:o,ref:n,variant:i,...l})=>{const c=u.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(Do,{...l,ref:n,className:Mt("container",e),children:c.map(d=>a.jsx(yr,{symbol:d,className:Mt("item",r==null?void 0:r.item),variant:i},d))})},Ft=I.newClassNameGetter("button"),De=({children:e,className:r,classnames:o,disabled:n,fullWidth:i,icon:l,loading:c,onClick:d,ref:p=null,keyBindings:b=[],size:h="default",type:f="button",variant:$="normal",...m})=>{const O=u.useRef(null);u.useImperativeHandle(p,()=>O.current,[]),t.useKeyBinding(b,()=>{var C;(C=O.current)==null||C.click()});const x=u.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(To,{...m,onClick:d,ref:O,type:x,disabled:n,className:Ft("container",r),$variant:$,$size:h,$fullWidth:!!i,$iconOnly:!!l&&!(e||(b==null?void 0:b.length)>0),children:[c&&a.jsx(Ao,{$size:h}),l&&!c&&a.jsx(No,{$size:h,children:l}),e&&a.jsx(Io,{className:Ft("label",o==null?void 0:o.label),children:e}),a.jsx(Cr,{keys:b,variant:$==="system"?"light":"dark"})]})},Fo=s.div`
341
300
  background-color: ${t.COLORS.white};
342
301
  border-radius: 16px;
343
302
  border: ${e=>e.$border?`1px solid ${t.alpha(t.COLORS["iron-grey"],15)}`:"none"};
344
303
  box-shadow: ${e=>e.$shadow?`0 2px 8px ${t.alpha(t.COLORS.black,10)}`:"none"};
345
- `,Bo=A.newClassNameGetter("card"),Yo=({children:e,className:r,ref:o,border:i=!1,shadow:n=!1,...l})=>a.jsx(Fo,{...l,ref:o,className:Bo("container",r),$border:i,$shadow:n,children:e}),Bt={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.black,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},label:t.COLORS.black,icon:t.COLORS.white},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.red,focusShadow:t.alpha(t.COLORS.red,30)},label:t.COLORS.red,icon:t.COLORS.white}},ye=e=>Bt[e]??Bt.normal,Vo=s.label`
304
+ `,Bo=I.newClassNameGetter("card"),Yo=({children:e,className:r,ref:o,border:n=!1,shadow:i=!1,...l})=>a.jsx(Fo,{...l,ref:o,className:Bo("container",r),$border:n,$shadow:i,children:e}),Bt={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.black,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},label:t.COLORS.black,icon:t.COLORS.white},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.red,focusShadow:t.alpha(t.COLORS.red,30)},label:t.COLORS.red,icon:t.COLORS.white}},ye=e=>Bt[e]??Bt.normal,Vo=s.label`
346
305
  display: inline-flex;
347
306
  align-items: flex-start;
348
307
  gap: 8px;
@@ -400,7 +359,7 @@
400
359
  text-decoration: none;
401
360
  }
402
361
  }
403
- `,Le=A.newClassNameGetter("checkbox"),et=({checked:e,className:r,classnames:o,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:u="normal",...b})=>a.jsxs(Vo,{className:Le("container",r),$disabled:!!i,$variant:u,children:[a.jsx(Ho,{...b,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Go,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:u,children:a.jsx(Wo,{className:Le("icon",o==null?void 0:o.icon),$visible:n||e,$variant:u,children:n?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Uo,{className:Le("label",o==null?void 0:o.label),$variant:u,children:l})]}),Yt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},ue=e=>Yt[e]??Yt.normal,Xo=s.label`
362
+ `,Le=I.newClassNameGetter("checkbox"),et=({checked:e,className:r,classnames:o,disabled:n,indeterminate:i=!1,label:l,onChange:c,ref:d,variant:p="normal",...b})=>a.jsxs(Vo,{className:Le("container",r),$disabled:!!n,$variant:p,children:[a.jsx(Ho,{...b,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:n,onChange:c}),a.jsx(Go,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:i,$variant:p,children:a.jsx(Wo,{className:Le("icon",o==null?void 0:o.icon),$visible:i||e,$variant:p,children:i?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Uo,{className:Le("label",o==null?void 0:o.label),$variant:p,children:l})]}),Yt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},ue=e=>Yt[e]??Yt.normal,Xo=s.label`
404
363
  display: grid;
405
364
  grid-template-columns: auto 1fr;
406
365
  align-items: start;
@@ -457,7 +416,7 @@
457
416
  label[data-disabled='true'] & {
458
417
  color: ${e=>ue(e.$variant).description.disabled};
459
418
  }
460
- `,Ye=A.newClassNameGetter("checkbox-card"),Qo=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:u,variant:b="normal",...h})=>a.jsxs(Xo,{className:Ye("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:b,"data-disabled":n,children:[a.jsx(qo,{...h,ref:u,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(et,{className:o==null?void 0:o.checkbox,checked:e,disabled:n,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Ko,{className:Ye("content",o==null?void 0:o.content),children:[a.jsx(Zo,{className:Ye("label",o==null?void 0:o.label),$variant:b,children:c}),i&&a.jsx(Jo,{className:Ye("description",o==null?void 0:o.description),$variant:b,children:i})]})]}),Vt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ei=s.div`
419
+ `,Ye=I.newClassNameGetter("checkbox-card"),Qo=({checked:e,className:r,classnames:o,description:n,disabled:i,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:b="normal",...h})=>a.jsxs(Xo,{className:Ye("container",r),$checked:e,$disabled:!!i,$fullWidth:l,$variant:b,"data-disabled":i,children:[a.jsx(qo,{...h,ref:p,type:"checkbox",checked:e,disabled:i,onChange:d}),a.jsx(et,{className:o==null?void 0:o.checkbox,checked:e,disabled:i,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Ko,{className:Ye("content",o==null?void 0:o.content),children:[a.jsx(Zo,{className:Ye("label",o==null?void 0:o.label),$variant:b,children:c}),n&&a.jsx(Jo,{className:Ye("description",o==null?void 0:o.description),$variant:b,children:n})]})]}),Vt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ei=s.div`
461
420
  display: flex;
462
421
  flex-direction: column;
463
422
  gap: 8px;
@@ -471,7 +430,7 @@
471
430
  display: flex;
472
431
  flex-direction: column;
473
432
  gap: 12px;
474
- `,nt=A.newClassNameGetter("checkbox-group"),oi=({className:e,classnames:r,disabled:o,label:i,onChange:n,options:l,ref:c,value:d,...u})=>{const b=(h,f)=>{n(f?[...d,h]:d.filter($=>$!==h))};return a.jsxs(ei,{...u,ref:c,className:nt("container",e),children:[i&&a.jsx(ti,{className:nt("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(ri,{className:nt("options",r==null?void 0:r.options),children:l.map(h=>a.jsx(et,{className:r==null?void 0:r.checkbox,checked:d.includes(h.value),label:h.label,disabled:o,onChange:f=>b(h.value,f.target.checked)},h.value))})]})},Ht={gray:{background:t.alpha(t.COLORS["iron-grey"],10),color:t.COLORS["iron-grey"],deleteHover:t.alpha(t.COLORS["iron-grey"],20)},red:{background:t.alpha(t.COLORS.red,10),color:t.COLORS.red,deleteHover:t.alpha(t.COLORS.red,20)},blue:{background:t.alpha(t.COLORS["steel-blue"],10),color:t.COLORS["steel-blue"],deleteHover:t.alpha(t.COLORS["steel-blue"],20)},black:{background:t.COLORS.black,color:t.COLORS.white,deleteHover:t.alpha(t.COLORS.white,20)}},mt=e=>Ht[e]??Ht.gray,ii=s.span`
433
+ `,nt=I.newClassNameGetter("checkbox-group"),oi=({className:e,classnames:r,disabled:o,label:n,onChange:i,options:l,ref:c,value:d,...p})=>{const b=(h,f)=>{i(f?[...d,h]:d.filter($=>$!==h))};return a.jsxs(ei,{...p,ref:c,className:nt("container",e),children:[n&&a.jsx(ti,{className:nt("label",r==null?void 0:r.label),$disabled:o,children:n}),a.jsx(ri,{className:nt("options",r==null?void 0:r.options),children:l.map(h=>a.jsx(et,{className:r==null?void 0:r.checkbox,checked:d.includes(h.value),label:h.label,disabled:o,onChange:f=>b(h.value,f.target.checked)},h.value))})]})},Ht={gray:{background:t.alpha(t.COLORS["iron-grey"],10),color:t.COLORS["iron-grey"],deleteHover:t.alpha(t.COLORS["iron-grey"],20)},red:{background:t.alpha(t.COLORS.red,10),color:t.COLORS.red,deleteHover:t.alpha(t.COLORS.red,20)},blue:{background:t.alpha(t.COLORS["steel-blue"],10),color:t.COLORS["steel-blue"],deleteHover:t.alpha(t.COLORS["steel-blue"],20)},black:{background:t.COLORS.black,color:t.COLORS.white,deleteHover:t.alpha(t.COLORS.white,20)}},vt=e=>Ht[e]??Ht.gray,ii=s.span`
475
434
  display: inline-flex;
476
435
  align-items: center;
477
436
  gap: 4px;
@@ -481,8 +440,8 @@
481
440
  font-size: 12px;
482
441
  font-weight: 500;
483
442
  line-height: 1.5;
484
- background-color: ${e=>mt(e.$variant).background};
485
- color: ${e=>mt(e.$variant).color};
443
+ background-color: ${e=>vt(e.$variant).background};
444
+ color: ${e=>vt(e.$variant).color};
486
445
  `,ni=s.button`
487
446
  display: inline-flex;
488
447
  align-items: center;
@@ -498,7 +457,7 @@
498
457
  transition: background-color 0.15s ease;
499
458
 
500
459
  &:hover {
501
- background-color: ${e=>mt(e.$variant).deleteHover};
460
+ background-color: ${e=>vt(e.$variant).deleteHover};
502
461
  }
503
462
 
504
463
  & svg {
@@ -508,7 +467,7 @@
508
467
  `,ai=s.span`
509
468
  flex: 1 0 auto;
510
469
  text-align: center;
511
- `,at=A.newClassNameGetter("chip"),Je=({children:e,className:r,classnames:o,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(ii,{...d,ref:l,className:at("container",r),$variant:c,$deletable:!!i,children:[a.jsx(ai,{className:at("label",o==null?void 0:o.label),children:e}),i&&a.jsx(ni,{type:"button",className:at("delete",o==null?void 0:o.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),li="Confirm",di="Cancel",ci=be.keyframes`
470
+ `,at=I.newClassNameGetter("chip"),Je=({children:e,className:r,classnames:o,deletable:n,onDelete:i,ref:l,variant:c="gray",...d})=>a.jsxs(ii,{...d,ref:l,className:at("container",r),$variant:c,$deletable:!!n,children:[a.jsx(ai,{className:at("label",o==null?void 0:o.label),children:e}),n&&a.jsx(ni,{type:"button",className:at("delete",o==null?void 0:o.delete),$variant:c,onClick:i,children:a.jsx(a.X,{})})]}),li="Confirm",di="Cancel",ci=be.keyframes`
512
471
  from {
513
472
  opacity: 0;
514
473
  transform: translateX(-50%) translateY(100%);
@@ -551,7 +510,7 @@
551
510
  display: flex;
552
511
  align-items: center;
553
512
  gap: 8px;
554
- `,bi=({confirmation:e,onDone:r})=>{const[o,i]=p.useState(!1),[n,l]=p.useState(!1),{message:c,onConfirm:d,onCancel:u,options:b}=e,h=b.confirmLabel||li,f=b.cancelLabel||di,$=p.useCallback(x=>{i(!0),setTimeout(()=>{x==null||x(),r()},200)},[r]),m=p.useCallback(async()=>{const x=d();if(x instanceof Promise){l(!0);try{await x}finally{l(!1)}}$()},[$,d]),S=p.useCallback(()=>{n||$(u)},[$,n,u]);return p.useEffect(()=>{const x=C=>{C.key==="Escape"&&!n&&S()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[S,n]),a.jsxs(pi,{$isExiting:o,children:[a.jsx(ui,{children:c}),a.jsxs(hi,{children:[a.jsx(De,{variant:"system",size:"compact",onClick:S,disabled:n,children:f}),a.jsx(De,{variant:"danger",size:"compact",onClick:m,loading:n,children:h})]})]})},mr=p.createContext(null),gi=()=>{},fi=({children:e})=>{const[r,o]=p.useState(null),i=p.useCallback((l,c,d,u)=>{o({open:!0,message:l,onConfirm:c,onCancel:d||gi,options:u||{}})},[]),n=p.useCallback(()=>{o(null)},[]);return a.jsxs(mr.Provider,{value:{show:i,hide:n},children:[e,r&&a.jsx(bi,{confirmation:r,onDone:n})]})},xi=()=>{const e=p.useContext(mr);if(!e)throw new Error("useConfirmation must be used within ConfirmationProvider");return e},Ee={sm:`${t.BREAKPOINTS.sm}px`,md:`${t.BREAKPOINTS.md}px`,lg:`${t.BREAKPOINTS.lg}px`,xl:`${t.BREAKPOINTS.xl}px`,"2xl":`${t.BREAKPOINTS["2xl"]}px`},Oi=s.div`
513
+ `,bi=({confirmation:e,onDone:r})=>{const[o,n]=u.useState(!1),[i,l]=u.useState(!1),{message:c,onConfirm:d,onCancel:p,options:b}=e,h=b.confirmLabel||li,f=b.cancelLabel||di,$=u.useCallback(x=>{n(!0),setTimeout(()=>{x==null||x(),r()},200)},[r]),m=u.useCallback(async()=>{const x=d();if(x instanceof Promise){l(!0);try{await x}finally{l(!1)}}$()},[$,d]),O=u.useCallback(()=>{i||$(p)},[$,i,p]);return u.useEffect(()=>{const x=C=>{C.key==="Escape"&&!i&&O()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[O,i]),a.jsxs(pi,{$isExiting:o,children:[a.jsx(ui,{children:c}),a.jsxs(hi,{children:[a.jsx(De,{variant:"system",size:"compact",onClick:O,disabled:i,children:f}),a.jsx(De,{variant:"danger",size:"compact",onClick:m,loading:i,children:h})]})]})},vr=u.createContext(null),gi=()=>{},fi=({children:e})=>{const[r,o]=u.useState(null),n=u.useCallback((l,c,d,p)=>{o({open:!0,message:l,onConfirm:c,onCancel:d||gi,options:p||{}})},[]),i=u.useCallback(()=>{o(null)},[]);return a.jsxs(vr.Provider,{value:{show:n,hide:i},children:[e,r&&a.jsx(bi,{confirmation:r,onDone:i})]})},xi=()=>{const e=u.useContext(vr);if(!e)throw new Error("useConfirmation must be used within ConfirmationProvider");return e},Ee={sm:`${t.BREAKPOINTS.sm}px`,md:`${t.BREAKPOINTS.md}px`,lg:`${t.BREAKPOINTS.lg}px`,xl:`${t.BREAKPOINTS.xl}px`,"2xl":`${t.BREAKPOINTS["2xl"]}px`},Oi=s.div`
555
514
  width: 100%;
556
515
 
557
516
  ${t.mediaUp("sm")} {
@@ -573,16 +532,16 @@
573
532
  ${t.mediaUp("2xl")} {
574
533
  max-width: ${Ee["2xl"]};
575
534
  }
576
- `,$i=A.newClassNameGetter("container"),Si=({children:e,className:r,ref:o,...i})=>a.jsx(Oi,{...i,ref:o,className:$i("container",r),children:e}),Ze={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},Pe={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},oe=36,tt=2,yi=12,vr=(e,r,o="en")=>{const i=e.getFullYear(),n=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),u=e.getSeconds(),b=c%12||12,h=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),$=new Intl.DateTimeFormat(o,{month:"short"}).format(e),m=new Intl.DateTimeFormat(o,{weekday:"long"}).format(e),S=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),x=L=>L.toString().padStart(2,"0"),C=L=>L.toString().padStart(2," "),O=L=>`\0${L}\0`,y=[["2006","YEARFOUR",i.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",$],["Mon","WEEKDAYSHORT",S],["06","YEARTWO",i.toString().slice(-2)],["01","MONTHPAD",x(n+1)],["_2","DAYSPACE",C(l)],["02","DAYPAD",x(l)],["15","HOURTWENTYFOUR",x(c)],["03","HOURTWELVEPAD",x(b)],["04","MINUTE",x(d)],["05","SECOND",x(u)],["PM","AMPMUP",h?"PM":"AM"],["pm","AMPMLOW",h?"pm":"am"],["1","MONTH",(n+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",b.toString()]];let g=r;for(const[L,z]of y)g=g.split(L).join(O(z));for(const[,L,z]of y)g=g.split(O(L)).join(z);return g},Ci=(e,r)=>new Date(e,r+1,0).getDate(),mi=(e,r)=>new Date(e,r,1).getDay(),vi=(e,r,o=1)=>{const i=Ci(e,r);let l=mi(e,r)-o;l<0&&(l+=7);const c=[];for(let d=0;d<l;d++)c.push(null);for(let d=1;d<=i;d++)c.push(d);for(;c.length<42;)c.push(null);return c},wi=(e,r=1)=>{const o=[];for(let i=0;i<7;i++){const n=(r+i)%7,l=new Date(2024,0,7+n);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},Ri=e=>{const r=[];for(let o=0;o<12;o++){const i=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(i))}return r},Gt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Wt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),ki=(e,r)=>e.getFullYear()===r.getFullYear(),Ut=(e,r,o,i,n)=>{const l=new Date(e,r,o);if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l<c)return!0}if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l>c)return!0}return!1},Xt=(e,r,o,i)=>{if(o){const n=o.getFullYear(),l=o.getMonth();if(e<n||e===n&&r<l)return!0}if(i){const n=i.getFullYear(),l=i.getMonth();if(e>n||e===n&&r>l)return!0}return!1},qt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),Li=(e,r=12)=>{const o=e-Math.floor(r/2),i=[];for(let n=0;n<r;n++)i.push(o+n);return i},Ei=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},Pi=s.div`
535
+ `,$i=I.newClassNameGetter("container"),Si=({children:e,className:r,ref:o,...n})=>a.jsx(Oi,{...n,ref:o,className:$i("container",r),children:e}),Ze={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},Pe={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},oe=36,tt=2,yi=12,mr=(e,r,o="en")=>{const n=e.getFullYear(),i=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),b=c%12||12,h=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),$=new Intl.DateTimeFormat(o,{month:"short"}).format(e),m=new Intl.DateTimeFormat(o,{weekday:"long"}).format(e),O=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),x=L=>L.toString().padStart(2,"0"),C=L=>L.toString().padStart(2," "),S=L=>`\0${L}\0`,y=[["2006","YEARFOUR",n.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",$],["Mon","WEEKDAYSHORT",O],["06","YEARTWO",n.toString().slice(-2)],["01","MONTHPAD",x(i+1)],["_2","DAYSPACE",C(l)],["02","DAYPAD",x(l)],["15","HOURTWENTYFOUR",x(c)],["03","HOURTWELVEPAD",x(b)],["04","MINUTE",x(d)],["05","SECOND",x(p)],["PM","AMPMUP",h?"PM":"AM"],["pm","AMPMLOW",h?"pm":"am"],["1","MONTH",(i+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",b.toString()]];let g=r;for(const[L,T]of y)g=g.split(L).join(S(T));for(const[,L,T]of y)g=g.split(S(L)).join(T);return g},Ci=(e,r)=>new Date(e,r+1,0).getDate(),vi=(e,r)=>new Date(e,r,1).getDay(),mi=(e,r,o=1)=>{const n=Ci(e,r);let l=vi(e,r)-o;l<0&&(l+=7);const c=[];for(let d=0;d<l;d++)c.push(null);for(let d=1;d<=n;d++)c.push(d);for(;c.length<42;)c.push(null);return c},wi=(e,r=1)=>{const o=[];for(let n=0;n<7;n++){const i=(r+n)%7,l=new Date(2024,0,7+i);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},Ri=e=>{const r=[];for(let o=0;o<12;o++){const n=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(n))}return r},Gt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Wt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),ki=(e,r)=>e.getFullYear()===r.getFullYear(),Ut=(e,r,o,n,i)=>{const l=new Date(e,r,o);if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l<c)return!0}if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l>c)return!0}return!1},Xt=(e,r,o,n)=>{if(o){const i=o.getFullYear(),l=o.getMonth();if(e<i||e===i&&r<l)return!0}if(n){const i=n.getFullYear(),l=n.getMonth();if(e>i||e===i&&r>l)return!0}return!1},qt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),Li=(e,r=12)=>{const o=e-Math.floor(r/2),n=[];for(let i=0;i<r;i++)n.push(o+i);return n},Ei=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},Pi=s.div`
577
536
  position: relative;
578
537
  display: inline-flex;
579
538
  flex-direction: column;
580
539
  gap: 2px;
581
540
  min-width: 180px;
582
541
  width: ${({$fullWidth:e})=>e?"100%":"fit-content"};
583
- `,zi=s(ie)`
542
+ `,ji=s(ie)`
584
543
  margin-left: 6px;
585
- `,ji=s.button`
544
+ `,zi=s.button`
586
545
  display: flex;
587
546
  align-items: center;
588
547
  justify-content: space-between;
@@ -789,7 +748,7 @@
789
748
  `,Gi=s.div`
790
749
  width: ${oe}px;
791
750
  height: ${oe}px;
792
- `,K=A.newClassNameGetter("date-picker"),Ve=4,Wi=300,Ui=({value:e,onChange:r,mode:o="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:u,size:b="default",variant:h="normal",disabled:f=!1,fullWidth:$=!1,label:m,portalRenderNode:S,open:x,onOpen:C,onClose:O,className:y,classnames:g,ref:L,...z})=>{const N=p.useMemo(()=>new Date,[]),[V,P]=p.useState(!1),[_,j]=p.useState({top:0,left:0}),[w,M]=p.useState("bottom"),[v,I]=p.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[k,T]=p.useState(()=>e??N),[F,B]=p.useState(()=>((e==null?void 0:e.getFullYear())??N.getFullYear())-6),H=p.useRef(null),E=p.useRef(null),D=p.useRef(null),X=x!==void 0,q=X?x:V,fe=i??Ei(o),_e=p.useMemo(()=>wi(l,c),[l,c]),rt=p.useMemo(()=>Ri(l),[l]),Br=p.useMemo(()=>vi(k.getFullYear(),k.getMonth(),c),[k,c]),Me=p.useMemo(()=>Li(F+6,12),[F]),Et=p.useMemo(()=>e?vr(e,fe,l):null,[e,fe,l]),Yr=n??fe.replace(/2006|06|January|Jan|01|02/g,"__"),me=p.useCallback(()=>{var we;if(!E.current)return;const R=E.current.getBoundingClientRect(),Y=((we=D.current)==null?void 0:we.offsetHeight)??Wi,ve=window.innerHeight-R.bottom-Ve,Fe=R.top-Ve,xe=ve<Y&&Fe>ve?"top":"bottom";if(M(xe),S){const Be=xe==="bottom"?R.bottom+Ve:R.top-Y-Ve;j({top:Be,left:R.left})}},[S]),Pt=p.useCallback(()=>{if(f)return;X||P(!0),C==null||C(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??N;T(R),B(R.getFullYear()-6)},[f,X,C,o,e,N]),Z=p.useCallback(()=>{X||P(!1),O==null||O()},[X,O]),Vr=p.useCallback(()=>{q?Z():Pt()},[q,Z,Pt]),Hr=p.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Gr=p.useCallback(R=>{if(o==="month"){const Y=new Date(k.getFullYear(),R,1);r==null||r(Y),Z()}else T(new Date(k.getFullYear(),R,1)),I("days")},[o,k,r,Z]),Wr=p.useCallback(R=>{if(o==="year"){const Y=new Date(R,0,1);r==null||r(Y),Z()}else o==="month"?(T(new Date(R,k.getMonth(),1)),I("months")):(T(new Date(R,k.getMonth(),1)),I("months"))},[o,k,r,Z]),Ur=p.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Xr=p.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),qr=p.useCallback(()=>{T(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Kr=p.useCallback(()=>{T(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Zr=p.useCallback(()=>{B(R=>R-12)},[]),Jr=p.useCallback(()=>{B(R=>R+12)},[]),zt=p.useCallback(()=>{v==="days"?I("months"):v==="months"&&I("years")},[v]);p.useLayoutEffect(()=>{q&&me()},[q,me]),p.useEffect(()=>{const R=xe=>{const we=xe.target,Be=H.current&&!H.current.contains(we),io=D.current&&!D.current.contains(we);S?Be&&io&&Z():Be&&Z()},Y=xe=>{xe.key==="Escape"&&Z()},ve=()=>{q&&S&&me()},Fe=()=>{q&&S&&me()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),S&&(window.addEventListener("scroll",ve,!0),window.addEventListener("resize",Fe))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",Fe)}},[q,Z,S,me]);const Qr=Ze[b].iconSize,eo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Ur,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Xr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Di,{children:_e.map((R,Y)=>a.jsx(_i,{children:R},Y))}),a.jsx(Mi,{className:K("grid",g==null?void 0:g.grid),children:Br.map((R,Y)=>R===null?a.jsx(Gi,{},Y):a.jsx(Fi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?Gt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Gt(N,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Ut(k.getFullYear(),k.getMonth(),R,d,u),disabled:Ut(k.getFullYear(),k.getMonth(),R,d,u),onClick:()=>Hr(R),children:R},Y))})]}),to=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:k.getFullYear()}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:qr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Kr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Bi,{className:K("grid",g==null?void 0:g.grid),children:rt.map((R,Y)=>a.jsx(Yi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?Wt(e,new Date(k.getFullYear(),Y,1)):!1,$current:Wt(N,new Date(k.getFullYear(),Y,1)),$disabled:Xt(k.getFullYear(),Y,d,u),disabled:Xt(k.getFullYear(),Y,d,u),onClick:()=>Gr(Y),children:R},Y))})]}),ro=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsxs(dt,{type:"button",style:{cursor:"default"},children:[Me[0]," - ",Me[Me.length-1]]}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Zr,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Jr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Vi,{className:K("grid",g==null?void 0:g.grid),children:Me.map(R=>a.jsx(Hi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?ki(e,new Date(R,0,1)):!1,$current:N.getFullYear()===R,$disabled:qt(R,d,u),disabled:qt(R,d,u),onClick:()=>Wr(R),children:R},R))})]}),jt=()=>{switch(v){case"days":return eo();case"months":return to();case"years":return ro()}},oo=S?ge.createPortal(a.jsx(Ai,{ref:D,$open:q,$position:w,className:K("calendar",g==null?void 0:g.calendar),style:{top:_.top,left:_.left},children:jt()}),S):a.jsx(Ii,{ref:D,$open:q,$position:w,className:K("calendar",g==null?void 0:g.calendar),children:jt()});return a.jsxs(Pi,{...z,ref:L??H,$fullWidth:$,className:K("container",y),children:[m&&a.jsx(zi,{children:m}),a.jsxs(ji,{ref:E,type:"button",onClick:Vr,disabled:f,$size:b,$variant:h,$disabled:f,$open:q,$hasValue:!!Et,className:K("trigger",g==null?void 0:g.trigger),children:[a.jsx(Ti,{children:Et??Yr}),a.jsx(Ni,{$open:q,children:a.jsx(a.ChevronDown,{size:Qr})})]}),oo]})},Xi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},qi=(e,r)=>{switch(e){case"left":return`
751
+ `,K=I.newClassNameGetter("date-picker"),Ve=4,Wi=300,Ui=({value:e,onChange:r,mode:o="date",displayFormat:n,placeholder:i,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:b="default",variant:h="normal",disabled:f=!1,fullWidth:$=!1,label:m,portalRenderNode:O,open:x,onOpen:C,onClose:S,className:y,classnames:g,ref:L,...T})=>{const j=u.useMemo(()=>new Date,[]),[Y,P]=u.useState(!1),[_,M]=u.useState({top:0,left:0}),[E,A]=u.useState("bottom"),[v,N]=u.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[R,z]=u.useState(()=>e??j),[B,F]=u.useState(()=>((e==null?void 0:e.getFullYear())??j.getFullYear())-6),H=u.useRef(null),k=u.useRef(null),D=u.useRef(null),X=x!==void 0,q=X?x:Y,fe=n??Ei(o),_e=u.useMemo(()=>wi(l,c),[l,c]),rt=u.useMemo(()=>Ri(l),[l]),Br=u.useMemo(()=>mi(R.getFullYear(),R.getMonth(),c),[R,c]),Me=u.useMemo(()=>Li(B+6,12),[B]),Et=u.useMemo(()=>e?mr(e,fe,l):null,[e,fe,l]),Yr=i??fe.replace(/2006|06|January|Jan|01|02/g,"__"),ve=u.useCallback(()=>{var we;if(!k.current)return;const w=k.current.getBoundingClientRect(),V=((we=D.current)==null?void 0:we.offsetHeight)??Wi,me=window.innerHeight-w.bottom-Ve,Fe=w.top-Ve,xe=me<V&&Fe>me?"top":"bottom";if(A(xe),O){const Be=xe==="bottom"?w.bottom+Ve:w.top-V-Ve;M({top:Be,left:w.left})}},[O]),Pt=u.useCallback(()=>{if(f)return;X||P(!0),C==null||C(),N(o==="year"?"years":o==="month"?"months":"days");const w=e??j;z(w),F(w.getFullYear()-6)},[f,X,C,o,e,j]),Z=u.useCallback(()=>{X||P(!1),S==null||S()},[X,S]),Vr=u.useCallback(()=>{q?Z():Pt()},[q,Z,Pt]),Hr=u.useCallback(w=>{const V=new Date(R.getFullYear(),R.getMonth(),w);r==null||r(V),Z()},[R,r,Z]),Gr=u.useCallback(w=>{if(o==="month"){const V=new Date(R.getFullYear(),w,1);r==null||r(V),Z()}else z(new Date(R.getFullYear(),w,1)),N("days")},[o,R,r,Z]),Wr=u.useCallback(w=>{if(o==="year"){const V=new Date(w,0,1);r==null||r(V),Z()}else o==="month"?(z(new Date(w,R.getMonth(),1)),N("months")):(z(new Date(w,R.getMonth(),1)),N("months"))},[o,R,r,Z]),Ur=u.useCallback(()=>{z(w=>new Date(w.getFullYear(),w.getMonth()-1,1))},[]),Xr=u.useCallback(()=>{z(w=>new Date(w.getFullYear(),w.getMonth()+1,1))},[]),qr=u.useCallback(()=>{z(w=>new Date(w.getFullYear()-1,w.getMonth(),1))},[]),Kr=u.useCallback(()=>{z(w=>new Date(w.getFullYear()+1,w.getMonth(),1))},[]),Zr=u.useCallback(()=>{F(w=>w-12)},[]),Jr=u.useCallback(()=>{F(w=>w+12)},[]),jt=u.useCallback(()=>{v==="days"?N("months"):v==="months"&&N("years")},[v]);u.useLayoutEffect(()=>{q&&ve()},[q,ve]),u.useEffect(()=>{const w=xe=>{const we=xe.target,Be=H.current&&!H.current.contains(we),io=D.current&&!D.current.contains(we);O?Be&&io&&Z():Be&&Z()},V=xe=>{xe.key==="Escape"&&Z()},me=()=>{q&&O&&ve()},Fe=()=>{q&&O&&ve()};return q&&(document.addEventListener("mousedown",w),document.addEventListener("keydown",V),O&&(window.addEventListener("scroll",me,!0),window.addEventListener("resize",Fe))),()=>{document.removeEventListener("mousedown",w),document.removeEventListener("keydown",V),window.removeEventListener("scroll",me,!0),window.removeEventListener("resize",Fe)}},[q,Z,O,ve]);const Qr=Ze[b].iconSize,eo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:jt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(R)}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Ur,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Xr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Di,{children:_e.map((w,V)=>a.jsx(_i,{children:w},V))}),a.jsx(Mi,{className:K("grid",g==null?void 0:g.grid),children:Br.map((w,V)=>w===null?a.jsx(Gi,{},V):a.jsx(Fi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?Gt(e,new Date(R.getFullYear(),R.getMonth(),w)):!1,$today:Gt(j,new Date(R.getFullYear(),R.getMonth(),w)),$disabled:Ut(R.getFullYear(),R.getMonth(),w,d,p),disabled:Ut(R.getFullYear(),R.getMonth(),w,d,p),onClick:()=>Hr(w),children:w},V))})]}),to=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsx(dt,{onClick:jt,type:"button",children:R.getFullYear()}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:qr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Kr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Bi,{className:K("grid",g==null?void 0:g.grid),children:rt.map((w,V)=>a.jsx(Yi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?Wt(e,new Date(R.getFullYear(),V,1)):!1,$current:Wt(j,new Date(R.getFullYear(),V,1)),$disabled:Xt(R.getFullYear(),V,d,p),disabled:Xt(R.getFullYear(),V,d,p),onClick:()=>Gr(V),children:w},V))})]}),ro=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",g==null?void 0:g.header),children:[a.jsxs(dt,{type:"button",style:{cursor:"default"},children:[Me[0]," - ",Me[Me.length-1]]}),a.jsxs(ct,{children:[a.jsx(Oe,{onClick:Zr,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Jr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Vi,{className:K("grid",g==null?void 0:g.grid),children:Me.map(w=>a.jsx(Hi,{type:"button",className:K("cell",g==null?void 0:g.cell),$selected:e?ki(e,new Date(w,0,1)):!1,$current:j.getFullYear()===w,$disabled:qt(w,d,p),disabled:qt(w,d,p),onClick:()=>Wr(w),children:w},w))})]}),zt=()=>{switch(v){case"days":return eo();case"months":return to();case"years":return ro()}},oo=O?ge.createPortal(a.jsx(Ai,{ref:D,$open:q,$position:E,className:K("calendar",g==null?void 0:g.calendar),style:{top:_.top,left:_.left},children:zt()}),O):a.jsx(Ii,{ref:D,$open:q,$position:E,className:K("calendar",g==null?void 0:g.calendar),children:zt()});return a.jsxs(Pi,{...T,ref:L??H,$fullWidth:$,className:K("container",y),children:[m&&a.jsx(ji,{children:m}),a.jsxs(zi,{ref:k,type:"button",onClick:Vr,disabled:f,$size:b,$variant:h,$disabled:f,$open:q,$hasValue:!!Et,className:K("trigger",g==null?void 0:g.trigger),children:[a.jsx(Ti,{children:Et??Yr}),a.jsx(Ni,{$open:q,children:a.jsx(a.ChevronDown,{size:Qr})})]}),oo]})},Xi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},qi=(e,r)=>{switch(e){case"left":return`
793
752
  top: 0;
794
753
  left: 0;
795
754
  height: 100%;
@@ -816,7 +775,7 @@
816
775
  box-shadow: 0 4px 24px ${t.alpha(t.COLORS.black,20)};
817
776
  ${e=>qi(e.$position,e.$size)}
818
777
  animation: ${e=>Xi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
819
- `,Zi=A.newClassNameGetter("drawer"),Ji=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?ge.createPortal(a.jsx(Ki,{...d,ref:l,className:Zi("container",o),$animated:!!e,$position:n,$size:c,children:r}),document.body):null,Qi=s.div`
778
+ `,Zi=I.newClassNameGetter("drawer"),Ji=({animated:e,children:r,className:o,open:n,position:i="right",ref:l,size:c="400px",...d})=>n?ge.createPortal(a.jsx(Ki,{...d,ref:l,className:Zi("container",o),$animated:!!e,$position:i,$size:c,children:r}),document.body):null,Qi=s.div`
820
779
  position: relative;
821
780
  display: inline-block;
822
781
  `,en=s.div`
@@ -851,7 +810,7 @@
851
810
  opacity 0.15s ease,
852
811
  transform 0.15s ease,
853
812
  visibility 0.15s;
854
- `,He=A.newClassNameGetter("dropdown"),Ge=4,on=100,nn=({align:e="left",children:r,className:o,classnames:i,onClose:n,onOpen:l,open:c,portalRenderNode:d,ref:u,trigger:b,...h})=>{const[f,$]=p.useState(!1),[m,S]=p.useState({top:0,left:0}),[x,C]=p.useState("bottom"),O=p.useRef(null),y=p.useRef(null),g=p.useRef(null),L=c!==void 0,z=L?c:f,N=p.useCallback(()=>{var T,F;if(!y.current)return;const j=y.current.getBoundingClientRect(),w=((T=g.current)==null?void 0:T.offsetHeight)??on,M=((F=g.current)==null?void 0:F.offsetWidth)??160,v=window.innerHeight-j.bottom-Ge,I=j.top-Ge,k=v<w&&I>v?"top":"bottom";if(C(k),d){let B;e==="left"?B=j.left:B=j.right-M;const H=k==="bottom"?j.bottom+Ge:j.top-w-Ge;S({top:H,left:B})}},[e,d]),V=p.useCallback(()=>{L?z?n==null||n():l==null||l():$(j=>{const w=!j;return w?l==null||l():n==null||n(),w})},[L,z,n,l]),P=p.useCallback(()=>{L||$(!1),n==null||n()},[L,n]);p.useLayoutEffect(()=>{z&&N()},[z,N]),p.useEffect(()=>{const j=I=>{const k=I.target,T=O.current&&!O.current.contains(k),F=g.current&&!g.current.contains(k);d?T&&F&&P():T&&P()},w=I=>{I.key==="Escape"&&P()},M=()=>{z&&d&&N()},v=()=>{z&&d&&N()};return z&&(document.addEventListener("mousedown",j),document.addEventListener("keydown",w),d&&(window.addEventListener("scroll",M,!0),window.addEventListener("resize",v))),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",w),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",v)}},[z,P,d,N]);const _=d?ge.createPortal(a.jsx(rn,{ref:g,$open:z,$position:x,className:He("content",i==null?void 0:i.content),style:{top:m.top,left:m.left},children:r}),d):a.jsx(tn,{ref:g,$align:e,$open:z,$position:x,className:He("content",i==null?void 0:i.content),children:r});return a.jsxs(Qi,{...h,ref:u??O,className:He("container",o),children:[a.jsx(en,{ref:y,onClick:V,className:He("trigger",i==null?void 0:i.trigger),children:p.cloneElement(b)}),_]})},an=s.div`
813
+ `,He=I.newClassNameGetter("dropdown"),Ge=4,on=100,nn=({align:e="left",autoClose:r=!0,children:o,className:n,classnames:i,onClose:l,onOpen:c,open:d,portalRenderNode:p,ref:b,trigger:h,...f})=>{const[$,m]=u.useState(!1),[O,x]=u.useState({top:0,left:0}),[C,S]=u.useState("bottom"),y=u.useRef(null),g=u.useRef(null),L=u.useRef(null),T=d!==void 0,j=T?d:$,Y=u.useCallback(()=>{var F,H;if(!g.current)return;const A=g.current.getBoundingClientRect(),v=((F=L.current)==null?void 0:F.offsetHeight)??on,N=((H=L.current)==null?void 0:H.offsetWidth)??160,R=window.innerHeight-A.bottom-Ge,z=A.top-Ge,B=R<v&&z>R?"top":"bottom";if(S(B),p){let k;e==="left"?k=A.left:k=A.right-N;const D=B==="bottom"?A.bottom+Ge:A.top-v-Ge;x({top:D,left:k})}},[e,p]),P=u.useCallback(()=>{T?j?l==null||l():c==null||c():m(A=>{const v=!A;return v?c==null||c():l==null||l(),v})},[T,j,l,c]),_=u.useCallback(()=>{T||m(!1),l==null||l()},[T,l]),M=u.useCallback(()=>{r&&_()},[r,_]);u.useLayoutEffect(()=>{j&&Y()},[j,Y]),u.useEffect(()=>{const A=z=>{const B=z.target,F=y.current&&!y.current.contains(B),H=L.current&&!L.current.contains(B);p?F&&H&&_():F&&_()},v=z=>{z.key==="Escape"&&_()},N=()=>{j&&p&&Y()},R=()=>{j&&p&&Y()};return j&&(document.addEventListener("mousedown",A),document.addEventListener("keydown",v),p&&(window.addEventListener("scroll",N,!0),window.addEventListener("resize",R))),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",v),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",R)}},[j,_,p,Y]);const E=p?ge.createPortal(a.jsx(rn,{ref:L,$open:j,$position:C,className:He("content",i==null?void 0:i.content),style:{top:O.top,left:O.left},onClick:M,children:o}),p):a.jsx(tn,{ref:L,$align:e,$open:j,$position:C,className:He("content",i==null?void 0:i.content),onClick:M,children:o});return a.jsxs(Qi,{...f,ref:b??y,className:He("container",n),children:[a.jsx(en,{ref:g,onClick:P,className:He("trigger",i==null?void 0:i.trigger),children:u.cloneElement(h)}),E]})},an=s.div`
855
814
  display: inline-flex;
856
815
  align-items: center;
857
816
  gap: 8px;
@@ -882,13 +841,13 @@
882
841
  &:hover {
883
842
  opacity: ${({$disabled:e})=>e?.5:1};
884
843
  }
885
- `,cn=({value:e,onChange:r,disabled:o=!1,placeholder:i,className:n,classnames:l,"data-test-id":c})=>{const[d,u]=p.useState(!1),b=p.useRef(null),h=p.useRef(null),f=p.useCallback(()=>{var x;u(!1);const S=((x=h.current)==null?void 0:x.textContent)||"";S!==e&&r(S)},[r,e]);p.useEffect(()=>{if(d&&h.current){h.current.focus();const S=document.createRange(),x=window.getSelection();S.selectNodeContents(h.current),S.collapse(!1),x==null||x.removeAllRanges(),x==null||x.addRange(S)}},[d]),p.useEffect(()=>{if(!d)return;const S=x=>{b.current&&!b.current.contains(x.target)&&f()};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[d,f]);const $=()=>{o||u(!0)},m=S=>{S.key==="Enter"&&S.metaKey?(S.preventDefault(),f()):S.key==="Escape"&&(h.current&&(h.current.textContent=e),u(!1))};return a.jsxs(an,{ref:b,className:n,"data-test-id":c,children:[a.jsx(ln,{ref:h,className:l==null?void 0:l.text,contentEditable:d,suppressContentEditableWarning:!0,onKeyDown:m,$isEmpty:!e,children:e||i}),a.jsx(dn,{type:"button",className:l==null?void 0:l.button,$disabled:o&&!d,onClick:d?f:$,disabled:o&&!d,"aria-label":d?"Save":"Edit",children:d?a.jsx(a.Check,{size:16}):a.jsx(a.Pencil,{size:14})})]})},sn={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},pn=s.span`
844
+ `,cn=({value:e,onChange:r,disabled:o=!1,placeholder:n,className:i,classnames:l,"data-test-id":c})=>{const[d,p]=u.useState(!1),b=u.useRef(null),h=u.useRef(null),f=u.useCallback(()=>{var x;p(!1);const O=((x=h.current)==null?void 0:x.textContent)||"";O!==e&&r(O)},[r,e]);u.useEffect(()=>{if(d&&h.current){h.current.focus();const O=document.createRange(),x=window.getSelection();O.selectNodeContents(h.current),O.collapse(!1),x==null||x.removeAllRanges(),x==null||x.addRange(O)}},[d]),u.useEffect(()=>{if(!d)return;const O=x=>{b.current&&!b.current.contains(x.target)&&f()};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[d,f]);const $=()=>{o||p(!0)},m=O=>{O.key==="Enter"&&O.metaKey?(O.preventDefault(),f()):O.key==="Escape"&&(h.current&&(h.current.textContent=e),p(!1))};return a.jsxs(an,{ref:b,className:i,"data-test-id":c,children:[a.jsx(ln,{ref:h,className:l==null?void 0:l.text,contentEditable:d,suppressContentEditableWarning:!0,onKeyDown:m,$isEmpty:!e,children:e||n}),a.jsx(dn,{type:"button",className:l==null?void 0:l.button,$disabled:o&&!d,onClick:d?f:$,disabled:o&&!d,"aria-label":d?"Save":"Edit",children:d?a.jsx(a.Check,{size:16}):a.jsx(a.Pencil,{size:14})})]})},sn={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},pn=s.span`
886
845
  display: block;
887
846
  font-size: 12px;
888
847
  font-weight: 500;
889
848
  line-height: 1.4;
890
849
  color: ${e=>sn[e.$variant]};
891
- `,un=A.newClassNameGetter("field-message"),hn=({children:e,className:r,ref:o,variant:i="normal",...n})=>e?a.jsx(pn,{...n,ref:o,className:un("container",r),$variant:i,children:e}):null,bn=s.div`
850
+ `,un=I.newClassNameGetter("field-message"),hn=({children:e,className:r,ref:o,variant:n="normal",...i})=>e?a.jsx(pn,{...i,ref:o,className:un("container",r),$variant:n,children:e}):null,bn=s.div`
892
851
  display: flex;
893
852
  flex-direction: column;
894
853
  gap: 12px;
@@ -1030,7 +989,7 @@
1030
989
  font-size: 14px;
1031
990
  }
1032
991
  }
1033
- `,mn=e=>`
992
+ `,vn=e=>`
1034
993
  .${e} {
1035
994
  display: block;
1036
995
  z-index: 101;
@@ -1048,7 +1007,7 @@
1048
1007
  position: absolute;
1049
1008
  touch-action: none;
1050
1009
  }
1051
- `,vn=e=>`
1010
+ `,mn=e=>`
1052
1011
  .${e} {
1053
1012
  position: absolute;
1054
1013
  z-index: 2;
@@ -1079,7 +1038,7 @@
1079
1038
  overflow: hidden;
1080
1039
  border-radius: 50%;
1081
1040
  }
1082
- `,Ln={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},En={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},We=(e,r)=>{const o=Ln[r],{h:i,v:n}=En[r];return`
1041
+ `,Ln={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},En={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},We=(e,r)=>{const o=Ln[r],{h:n,v:i}=En[r];return`
1083
1042
  .${e} {
1084
1043
  display: block;
1085
1044
  z-index: 102;
@@ -1089,8 +1048,8 @@
1089
1048
  -moz-user-select: none;
1090
1049
  -ms-user-select: none;
1091
1050
  user-select: none;
1092
- ${i}: -3px;
1093
1051
  ${n}: -3px;
1052
+ ${i}: -3px;
1094
1053
  position: absolute;
1095
1054
  width: 5px;
1096
1055
  height: 5px;
@@ -1101,8 +1060,8 @@
1101
1060
  .${e} {
1102
1061
  width: 24px;
1103
1062
  height: 24px;
1104
- ${i}: -12px;
1105
1063
  ${n}: -12px;
1064
+ ${i}: -12px;
1106
1065
  }
1107
1066
  }
1108
1067
  `},Pn=e=>`
@@ -1131,7 +1090,7 @@
1131
1090
  padding-bottom: env(safe-area-inset-bottom, 8px);
1132
1091
  }
1133
1092
  }
1134
- `,zn=e=>`
1093
+ `,jn=e=>`
1135
1094
  .${e} {
1136
1095
  backface-visibility: hidden;
1137
1096
  user-select: none;
@@ -1144,15 +1103,15 @@
1144
1103
  position: absolute;
1145
1104
  z-index: 1;
1146
1105
  }
1147
- `,jn=e=>{let r=5381;for(let o=0;o<e.length;o++)r=(r<<5)+r^e.charCodeAt(o);return Math.abs(r).toString(36)},G=e=>`hq-cropper__${jn(e)}`,W=e=>e||[],U=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Tn=e=>{const r={applyButton:[G("applyButton"),...W(e.applyButton)],cancelButton:[G("cancelButton"),...W(e.cancelButton)],container:[G("container"),...W(e.container)],handlerMove:[G("handlerMove"),...W(e.handlerMove)],handlerResizeTopLeft:[G("handlerResizeTopLeft"),...W(e.handlerResizeTopLeft)],handlerResizeTopRight:[G("handlerResizeTopRight"),...W(e.handlerResizeTopRight)],handlerResizeBottomLeft:[G("handlerResizeBottomLeft"),...W(e.handlerResizeBottomLeft)],handlerResizeBottomRight:[G("handlerResizeBottomRight"),...W(e.handlerResizeBottomRight)],sourceImage:[G("sourceImage"),...W(e.sourceImage)],portalArea:[G("portalArea"),...W(e.portalArea)],previewImage:[G("previewImage"),...W(e.previewImage)],body:[G("body"),...W(e.body)],header:[G("header"),...W(e.header)],footer:[G("footer"),...W(e.footer)],portal:[G("portal"),...W(e.portal)],preview:[G("preview"),...W(e.preview)],root:[G("root"),...W(e.root)]},o=`
1106
+ `,zn=e=>{let r=5381;for(let o=0;o<e.length;o++)r=(r<<5)+r^e.charCodeAt(o);return Math.abs(r).toString(36)},G=e=>`hq-cropper__${zn(e)}`,W=e=>e||[],U=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Tn=e=>{const r={applyButton:[G("applyButton"),...W(e.applyButton)],cancelButton:[G("cancelButton"),...W(e.cancelButton)],container:[G("container"),...W(e.container)],handlerMove:[G("handlerMove"),...W(e.handlerMove)],handlerResizeTopLeft:[G("handlerResizeTopLeft"),...W(e.handlerResizeTopLeft)],handlerResizeTopRight:[G("handlerResizeTopRight"),...W(e.handlerResizeTopRight)],handlerResizeBottomLeft:[G("handlerResizeBottomLeft"),...W(e.handlerResizeBottomLeft)],handlerResizeBottomRight:[G("handlerResizeBottomRight"),...W(e.handlerResizeBottomRight)],sourceImage:[G("sourceImage"),...W(e.sourceImage)],portalArea:[G("portalArea"),...W(e.portalArea)],previewImage:[G("previewImage"),...W(e.previewImage)],body:[G("body"),...W(e.body)],header:[G("header"),...W(e.header)],footer:[G("footer"),...W(e.footer)],portal:[G("portal"),...W(e.portal)],preview:[G("preview"),...W(e.preview)],root:[G("root"),...W(e.root)]},o=`
1148
1107
  ${xn(r.applyButton[0])}
1149
1108
  ${On(r.body[0])}
1150
1109
  ${$n(r.cancelButton[0])}
1151
1110
  ${Sn(r.container[0])}
1152
1111
  ${yn(r.footer[0])}
1153
1112
  ${Cn(r.header[0])}
1154
- ${mn(r.handlerMove[0])}
1155
- ${vn(r.portalArea[0])}
1113
+ ${vn(r.handlerMove[0])}
1114
+ ${mn(r.portalArea[0])}
1156
1115
  ${wn(r.portal[0])}
1157
1116
  ${Rn(r.previewImage[0])}
1158
1117
  ${kn(r.preview[0])}
@@ -1161,8 +1120,8 @@
1161
1120
  ${We(r.handlerResizeTopLeft[0],"tl")}
1162
1121
  ${We(r.handlerResizeTopRight[0],"tr")}
1163
1122
  ${Pn(r.root[0])}
1164
- ${zn(r.sourceImage[0])}
1165
- `,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let Nn=0;const In=e=>{const r=new Map,o=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(r.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...o}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(o[n]=l)}},subscribe:(i,n)=>{const l=String(++Nn),c=r.get(i)||[];return r.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of r.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){r.set(n,c);return}}},unsubscribeAll:()=>{r.clear()}}},vt={action:null,sourceBase64:"",fileName:"",sourceHeight:0,sourceWidth:0,frame:{left:0,top:0,width:0,height:0},portal:{left:0,top:0,size:0},emitted:{X:0,Y:0,left:0,top:0,size:0},config:{applyButtonLabel:"Apply",cancelButtonLabel:"Cancel",compression:1,framePadding:3,minPortalSize:50,portalPosition:"center",portalSize:150,outputSize:0,type:"jpeg",maxFileSize:0,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"]}},An=(e={},r={})=>In({...vt,config:{...vt.config,...e},css:Tn(r)}),Dn=(e,r)=>{var $;const o=e(),i=document.querySelector(`.${($=o.css)==null?void 0:$.body[0]}`);if(!i)return o.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=r.width/r.height;let u,b,h=0,f=0;return c>d?(u=l*d,b=l,f=(n-u)/2):(u=n,b=n*(r.height/r.width),h=(l-b)/2),{width:u,height:b,left:f,top:h}},_n=(e,r,o)=>{const[i,n]=r,l=i+e>o.width?(o.width-e)/2:i,c=n+e>o.height?(o.height-e)/2:n;return[l,c]},Mn=(e,r)=>{const{config:o}=e(),i=Math.min(r.width,r.height)-o.framePadding*2,n=o.portalSize>i?i:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=_n(n,o.portalPosition,r);return{left:l,top:c,size:n}}return o.portalPosition==="center"?{size:n,left:(r.width-n)/2,top:(r.height-n)/2}:{left:0,top:0,size:n}};var te=(e=>(e.MOVE="MOVE",e.RESIZE_TL="RESIZE_TL",e.RESIZE_TR="RESIZE_TR",e.RESIZE_BR="RESIZE_BR",e.RESIZE_BL="RESIZE_BL",e))(te||{});const Fn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerMove),o.setAttribute("data-action",te.MOVE),o},Bn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},Yn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},Vn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},Hn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},Gn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.previewImage),o},Wn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.preview),o.appendChild(Gn(e)),o},Un=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portal),o.appendChild(Wn(e)),o.appendChild(Fn(e)),o.appendChild(Vn(e)),o.appendChild(Hn(e)),o.appendChild(Bn(e)),o.appendChild(Yn(e)),o},Xn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Un(e)),o},qn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Kn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.body),o.appendChild(qn(e)),o.appendChild(Xn(e)),o},Zn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=o.config.applyButtonLabel,i.addEventListener("click",r),i},Jn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=o.config.cancelButtonLabel,i.addEventListener("click",r),i},Qn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.footer),n.appendChild(Jn(e,o)),n.appendChild(Zn(e,r)),n},ea=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.header),o},ta=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.container),n.appendChild(ea(e)),n.appendChild(Kn(e)),n.appendChild(Qn(e,r,o)),n},ra=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");U(n,(l=i.css)==null?void 0:l.root),n.appendChild(ta(e,r,o)),document.body.appendChild(n)},oa=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ie=new Map,ia={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},pe=(e,r)=>{if(Ie.has(e))return Ie.get(e);if(!r)return null;const o=r[ia[e]],i=document.querySelector(`.${o[0]}`);return Ie.set(e,i),i},na=()=>{Ie.clear()},aa=()=>{Ie.clear()},la=(e,r)=>{const o=pe("header",r.css);o&&(o.innerText=e)},da=(e,r)=>{const o=pe("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const i=pe("portalArea",r.css);i&&(i.style.height=`${r.frame.height}px`,i.style.width=`${r.frame.width}px`,i.style.left=`${r.frame.left}px`,i.style.top=`${r.frame.top}px`);const n=pe("portal",r.css);n&&(n.style.width=`${r.portal.size}px`,n.style.height=`${r.portal.size}px`,n.style.left=`${r.portal.left}px`,n.style.top=`${r.portal.top}px`);const l=pe("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},ca=(e,r)=>{const o=pe("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const i=pe("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},st=1,sa=e=>{var m,S;const r=e(),o=document.createElement("canvas"),i=r.frame.width||st,n=r.frame.height||st,l=r.sourceWidth/i,c=r.sourceHeight/n,d=r.portal.left*l,u=r.portal.top*c,b=Math.max(r.portal.size*Math.min(l,c),st),h=r.config.outputSize>0?r.config.outputSize:b;o.width=h,o.height=h;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((S=o.getContext("2d"))==null||S.drawImage(f,d,u,b,b,0,0,h,h));const $=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((x,C)=>{try{o.toBlob(O=>{if(o.remove(),!O){C(new Error(`Failed to create blob for type: image/${r.config.type}`));return}x([$,O])},`image/${r.config.type}`,r.config.compression)}catch(O){o.remove(),C(O)}})},pa=(e,r,o)=>{const{emitted:i,portal:n,frame:l,config:c}=r();let d=i.left-i.X+e.clientX,u=i.top-i.Y+e.clientY;const b=c.framePadding,h=l.width-c.framePadding-n.size,f=c.framePadding,$=l.height-c.framePadding-n.size;d<b&&(d=b),d>h&&(d=h),u<f&&(u=f),u>$&&(u=$),o({portal:{...n,left:d,top:u}})},ua=(e,r,o)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=r(),u=e.pageX-n.X,b=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let h=n.size+Math.max(u,b);return h<d.minPortalSize&&(h=d.minPortalSize),n.top+h>c.height-d.framePadding&&(h=c.height-n.top-d.framePadding),n.left+h>c.width-d.framePadding&&(h=c.width-n.left-d.framePadding),o({portal:{...l,size:h}})}case te.RESIZE_TR:{let h=u+b>0?n.size+u:n.size-b,f=u+b>0?n.top-u:n.top+b;return h<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,h=d.minPortalSize),n.left+h>c.width-d.framePadding&&(h=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(h=n.top+n.size,f=d.framePadding),o({portal:{...l,top:f,size:h}})}case te.RESIZE_TL:{const h=Math.min(u,b);let f=n.size-h,$=n.left+h,m=n.top+h;if(f<d.minPortalSize){const S=n.size-d.minPortalSize;f=d.minPortalSize,$=n.left+S,m=n.top+S}if(m<d.framePadding){const S=d.framePadding-m;m=d.framePadding,$=$+S,f=f-S}if($<d.framePadding){const S=d.framePadding-$;$=d.framePadding,m=m+S,f=f-S}return o({portal:{...l,top:m,left:$,size:f}})}case te.RESIZE_BL:{let h=u+b>0?n.size+b:n.size-u,f=u+b>0?n.left-b:n.left+u;return h<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,h=d.minPortalSize),h+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,h=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,h=n.left+n.size-d.framePadding),o({portal:{...l,left:f,size:h}})}default:return}},Kt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},ha=(e,r)=>{var $,m,S;const o=e(),i=document.querySelector(`.${($=o.css)==null?void 0:$.portal[0]}`),n=document.querySelector(`.${(m=o.css)==null?void 0:m.portalArea[0]}`),l=document.querySelector(`.${(S=o.css)==null?void 0:S.root[0]}`);let c=null,d=null;const u=x=>{x.preventDefault();const{portal:C}=e(),O=Kt(x);if(x.target){const y=x.target.getAttribute("data-action"),g={X:O.pageX,Y:O.pageY,left:C.left,top:C.top,size:C.size};r({action:y,emitted:g})}},b=()=>{const{action:x}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,x&&r({action:null})},h=()=>{if(c=null,!d)return;const x=d;d=null;const{action:C}=e();if(C)switch(C){case te.MOVE:pa(x,e,r);break;default:ua(x,e,r)}},f=x=>{const{action:C}=e();C&&(x.preventDefault(),d=Kt(x),c===null&&(c=requestAnimationFrame(h)))};return l&&(l.addEventListener("mouseup",b),l.addEventListener("touchend",b),l.addEventListener("touchcancel",b)),i&&(i.addEventListener("mousedown",u),i.addEventListener("touchstart",u,{passive:!1})),n&&(n.addEventListener("mousemove",f),n.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",b),l.removeEventListener("touchend",b),l.removeEventListener("touchcancel",b)),i&&(i.removeEventListener("mousedown",u),i.removeEventListener("touchstart",u)),n&&(n.removeEventListener("mousemove",f),n.removeEventListener("touchmove",f))}},Zt=1024*1024,ba=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Zt).toFixed(2);return`File size (${(e.size/Zt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},ga=(e,r,o,i,n,l,c)=>{const d=O=>{c?c(O):console.error(`HqCropper: ${O}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const u=e.target.files[0],{config:b}=r(),h=ba(u,b);if(h){d(h),e.target.value="";return}const f=new FileReader;let $=null;const m=()=>{var g;const O=r(),y=document.querySelector(`.${(g=O.css)==null?void 0:g.root[0]}`);y&&(y.remove(),document.removeEventListener("keydown",S),$==null||$(),aa(),l(),o(vt))},S=O=>{O.key==="Escape"&&r().sourceBase64&&x(O)},x=O=>{O.preventDefault(),m()},C=O=>{O.preventDefault();const y=r();sa(r).then(([g,L])=>{i(g,L,y),x(O)}).catch(g=>{d(g instanceof Error?g.message:"Failed to crop image")})};f.onload=O=>{const y=new Image;if(!O.target||typeof O.target.result!="string"){d("Can't load result image");return}y.src=O.target.result,y.onerror=()=>{d("Failed to load image")},y.onload=()=>{var z;ra(r,C,x),na(),n("fileName",la),n("sourceBase64",da),n("portal",ca);const g=Dn(r,y),L=Mn(r,g);o({frame:g,portal:L,fileName:u.name,sourceBase64:(z=O.target)==null?void 0:z.result,sourceHeight:y.height,sourceWidth:y.width}),$=ha(r,o),document.addEventListener("keydown",S)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(u),e.target.value=""},fa=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=An(r,o),u=oa(b=>ga(b,n,l,e,c,d,i));return{open:()=>u.click()}},ae={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Jt="vacano-image-cropper-styles",xa=`
1123
+ ${jn(r.sourceImage[0])}
1124
+ `,n=document.createElement("style");return n.innerHTML=o,document.getElementsByTagName("head")[0].prepend(n),r};let Nn=0;const In=e=>{const r=new Map,o=new Proxy({...e},{set(n,i,l){return Reflect.set(n,i,l),(r.get(i)||[]).forEach(c=>c.action(l,n,i)),!0}});return{getState:()=>({...o}),setState:n=>{for(const i of Object.keys(n)){const l=n[i];l!==void 0&&(o[i]=l)}},subscribe:(n,i)=>{const l=String(++Nn),c=r.get(n)||[];return r.set(n,[...c,{action:i,id:l}]),l},unsubscribe:n=>{for(const[i,l]of r.entries()){const c=l.filter(d=>d.id!==n);if(c.length!==l.length){r.set(i,c);return}}},unsubscribeAll:()=>{r.clear()}}},mt={action:null,sourceBase64:"",fileName:"",sourceHeight:0,sourceWidth:0,frame:{left:0,top:0,width:0,height:0},portal:{left:0,top:0,size:0},emitted:{X:0,Y:0,left:0,top:0,size:0},config:{applyButtonLabel:"Apply",cancelButtonLabel:"Cancel",compression:1,framePadding:3,minPortalSize:50,portalPosition:"center",portalSize:150,outputSize:0,type:"jpeg",maxFileSize:0,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"]}},An=(e={},r={})=>In({...mt,config:{...mt.config,...e},css:Tn(r)}),Dn=(e,r)=>{var $;const o=e(),n=document.querySelector(`.${($=o.css)==null?void 0:$.body[0]}`);if(!n)return o.frame;const{width:i,height:l}=n.getBoundingClientRect(),c=i/l,d=r.width/r.height;let p,b,h=0,f=0;return c>d?(p=l*d,b=l,f=(i-p)/2):(p=i,b=i*(r.height/r.width),h=(l-b)/2),{width:p,height:b,left:f,top:h}},_n=(e,r,o)=>{const[n,i]=r,l=n+e>o.width?(o.width-e)/2:n,c=i+e>o.height?(o.height-e)/2:i;return[l,c]},Mn=(e,r)=>{const{config:o}=e(),n=Math.min(r.width,r.height)-o.framePadding*2,i=o.portalSize>n?n:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=_n(i,o.portalPosition,r);return{left:l,top:c,size:i}}return o.portalPosition==="center"?{size:i,left:(r.width-i)/2,top:(r.height-i)/2}:{left:0,top:0,size:i}};var te=(e=>(e.MOVE="MOVE",e.RESIZE_TL="RESIZE_TL",e.RESIZE_TR="RESIZE_TR",e.RESIZE_BR="RESIZE_BR",e.RESIZE_BL="RESIZE_BL",e))(te||{});const Fn=e=>{var n;const r=e(),o=document.createElement("span");return U(o,(n=r.css)==null?void 0:n.handlerMove),o.setAttribute("data-action",te.MOVE),o},Bn=e=>{var n;const r=e(),o=document.createElement("span");return U(o,(n=r.css)==null?void 0:n.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},Yn=e=>{var n;const r=e(),o=document.createElement("span");return U(o,(n=r.css)==null?void 0:n.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},Vn=e=>{var n;const r=e(),o=document.createElement("span");return U(o,(n=r.css)==null?void 0:n.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},Hn=e=>{var n;const r=e(),o=document.createElement("span");return U(o,(n=r.css)==null?void 0:n.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},Gn=e=>{var n;const r=e(),o=document.createElement("img");return U(o,(n=r.css)==null?void 0:n.previewImage),o},Wn=e=>{var n;const r=e(),o=document.createElement("div");return U(o,(n=r.css)==null?void 0:n.preview),o.appendChild(Gn(e)),o},Un=e=>{var n;const r=e(),o=document.createElement("div");return U(o,(n=r.css)==null?void 0:n.portal),o.appendChild(Wn(e)),o.appendChild(Fn(e)),o.appendChild(Vn(e)),o.appendChild(Hn(e)),o.appendChild(Bn(e)),o.appendChild(Yn(e)),o},Xn=e=>{var n;const r=e(),o=document.createElement("div");return U(o,(n=r.css)==null?void 0:n.portalArea),o.appendChild(Un(e)),o},qn=e=>{var n;const r=e(),o=document.createElement("img");return U(o,(n=r.css)==null?void 0:n.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Kn=e=>{var n;const r=e(),o=document.createElement("div");return U(o,(n=r.css)==null?void 0:n.body),o.appendChild(qn(e)),o.appendChild(Xn(e)),o},Zn=(e,r)=>{var i;const o=e(),n=document.createElement("div");return U(n,(i=o.css)==null?void 0:i.applyButton),n.setAttribute("role","button"),n.innerText=o.config.applyButtonLabel,n.addEventListener("click",r),n},Jn=(e,r)=>{var i;const o=e(),n=document.createElement("div");return U(n,(i=o.css)==null?void 0:i.cancelButton),n.setAttribute("role","button"),n.innerText=o.config.cancelButtonLabel,n.addEventListener("click",r),n},Qn=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");return U(i,(l=n.css)==null?void 0:l.footer),i.appendChild(Jn(e,o)),i.appendChild(Zn(e,r)),i},ea=e=>{var n;const r=e(),o=document.createElement("div");return U(o,(n=r.css)==null?void 0:n.header),o},ta=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");return U(i,(l=n.css)==null?void 0:l.container),i.appendChild(ea(e)),i.appendChild(Kn(e)),i.appendChild(Qn(e,r,o)),i},ra=(e,r,o)=>{var l;const n=e(),i=document.createElement("div");U(i,(l=n.css)==null?void 0:l.root),i.appendChild(ta(e,r,o)),document.body.appendChild(i)},oa=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ie=new Map,ia={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},pe=(e,r)=>{if(Ie.has(e))return Ie.get(e);if(!r)return null;const o=r[ia[e]],n=document.querySelector(`.${o[0]}`);return Ie.set(e,n),n},na=()=>{Ie.clear()},aa=()=>{Ie.clear()},la=(e,r)=>{const o=pe("header",r.css);o&&(o.innerText=e)},da=(e,r)=>{const o=pe("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const n=pe("portalArea",r.css);n&&(n.style.height=`${r.frame.height}px`,n.style.width=`${r.frame.width}px`,n.style.left=`${r.frame.left}px`,n.style.top=`${r.frame.top}px`);const i=pe("portal",r.css);i&&(i.style.width=`${r.portal.size}px`,i.style.height=`${r.portal.size}px`,i.style.left=`${r.portal.left}px`,i.style.top=`${r.portal.top}px`);const l=pe("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},ca=(e,r)=>{const o=pe("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const n=pe("previewImage",r.css);n&&(n.style.marginLeft=`-${e.left}px`,n.style.marginTop=`-${e.top}px`)},st=1,sa=e=>{var m,O;const r=e(),o=document.createElement("canvas"),n=r.frame.width||st,i=r.frame.height||st,l=r.sourceWidth/n,c=r.sourceHeight/i,d=r.portal.left*l,p=r.portal.top*c,b=Math.max(r.portal.size*Math.min(l,c),st),h=r.config.outputSize>0?r.config.outputSize:b;o.width=h,o.height=h;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((O=o.getContext("2d"))==null||O.drawImage(f,d,p,b,b,0,0,h,h));const $=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((x,C)=>{try{o.toBlob(S=>{if(o.remove(),!S){C(new Error(`Failed to create blob for type: image/${r.config.type}`));return}x([$,S])},`image/${r.config.type}`,r.config.compression)}catch(S){o.remove(),C(S)}})},pa=(e,r,o)=>{const{emitted:n,portal:i,frame:l,config:c}=r();let d=n.left-n.X+e.clientX,p=n.top-n.Y+e.clientY;const b=c.framePadding,h=l.width-c.framePadding-i.size,f=c.framePadding,$=l.height-c.framePadding-i.size;d<b&&(d=b),d>h&&(d=h),p<f&&(p=f),p>$&&(p=$),o({portal:{...i,left:d,top:p}})},ua=(e,r,o)=>{const{action:n,emitted:i,portal:l,frame:c,config:d}=r(),p=e.pageX-i.X,b=e.pageY-i.Y;switch(n){case te.RESIZE_BR:{let h=i.size+Math.max(p,b);return h<d.minPortalSize&&(h=d.minPortalSize),i.top+h>c.height-d.framePadding&&(h=c.height-i.top-d.framePadding),i.left+h>c.width-d.framePadding&&(h=c.width-i.left-d.framePadding),o({portal:{...l,size:h}})}case te.RESIZE_TR:{let h=p+b>0?i.size+p:i.size-b,f=p+b>0?i.top-p:i.top+b;return h<d.minPortalSize&&(f=i.top+i.size-d.minPortalSize,h=d.minPortalSize),i.left+h>c.width-d.framePadding&&(h=c.width-i.left-d.framePadding,f=i.top-c.width+i.left+i.size),f<d.framePadding&&(h=i.top+i.size,f=d.framePadding),o({portal:{...l,top:f,size:h}})}case te.RESIZE_TL:{const h=Math.min(p,b);let f=i.size-h,$=i.left+h,m=i.top+h;if(f<d.minPortalSize){const O=i.size-d.minPortalSize;f=d.minPortalSize,$=i.left+O,m=i.top+O}if(m<d.framePadding){const O=d.framePadding-m;m=d.framePadding,$=$+O,f=f-O}if($<d.framePadding){const O=d.framePadding-$;$=d.framePadding,m=m+O,f=f-O}return o({portal:{...l,top:m,left:$,size:f}})}case te.RESIZE_BL:{let h=p+b>0?i.size+b:i.size-p,f=p+b>0?i.left-b:i.left+p;return h<d.minPortalSize&&(f=i.left+i.size-d.minPortalSize,h=d.minPortalSize),h+i.top>c.height-d.framePadding&&(f=i.left-c.height+i.top+i.size,h=c.height-i.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,h=i.left+i.size-d.framePadding),o({portal:{...l,left:f,size:h}})}default:return}},Kt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},ha=(e,r)=>{var $,m,O;const o=e(),n=document.querySelector(`.${($=o.css)==null?void 0:$.portal[0]}`),i=document.querySelector(`.${(m=o.css)==null?void 0:m.portalArea[0]}`),l=document.querySelector(`.${(O=o.css)==null?void 0:O.root[0]}`);let c=null,d=null;const p=x=>{x.preventDefault();const{portal:C}=e(),S=Kt(x);if(x.target){const y=x.target.getAttribute("data-action"),g={X:S.pageX,Y:S.pageY,left:C.left,top:C.top,size:C.size};r({action:y,emitted:g})}},b=()=>{const{action:x}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,x&&r({action:null})},h=()=>{if(c=null,!d)return;const x=d;d=null;const{action:C}=e();if(C)switch(C){case te.MOVE:pa(x,e,r);break;default:ua(x,e,r)}},f=x=>{const{action:C}=e();C&&(x.preventDefault(),d=Kt(x),c===null&&(c=requestAnimationFrame(h)))};return l&&(l.addEventListener("mouseup",b),l.addEventListener("touchend",b),l.addEventListener("touchcancel",b)),n&&(n.addEventListener("mousedown",p),n.addEventListener("touchstart",p,{passive:!1})),i&&(i.addEventListener("mousemove",f),i.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",b),l.removeEventListener("touchend",b),l.removeEventListener("touchcancel",b)),n&&(n.removeEventListener("mousedown",p),n.removeEventListener("touchstart",p)),i&&(i.removeEventListener("mousemove",f),i.removeEventListener("touchmove",f))}},Zt=1024*1024,ba=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Zt).toFixed(2);return`File size (${(e.size/Zt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},ga=(e,r,o,n,i,l,c)=>{const d=S=>{c?c(S):console.error(`HqCropper: ${S}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:b}=r(),h=ba(p,b);if(h){d(h),e.target.value="";return}const f=new FileReader;let $=null;const m=()=>{var g;const S=r(),y=document.querySelector(`.${(g=S.css)==null?void 0:g.root[0]}`);y&&(y.remove(),document.removeEventListener("keydown",O),$==null||$(),aa(),l(),o(mt))},O=S=>{S.key==="Escape"&&r().sourceBase64&&x(S)},x=S=>{S.preventDefault(),m()},C=S=>{S.preventDefault();const y=r();sa(r).then(([g,L])=>{n(g,L,y),x(S)}).catch(g=>{d(g instanceof Error?g.message:"Failed to crop image")})};f.onload=S=>{const y=new Image;if(!S.target||typeof S.target.result!="string"){d("Can't load result image");return}y.src=S.target.result,y.onerror=()=>{d("Failed to load image")},y.onload=()=>{var T;ra(r,C,x),na(),i("fileName",la),i("sourceBase64",da),i("portal",ca);const g=Dn(r,y),L=Mn(r,g);o({frame:g,portal:L,fileName:p.name,sourceBase64:(T=S.target)==null?void 0:T.result,sourceHeight:y.height,sourceWidth:y.width}),$=ha(r,o),document.addEventListener("keydown",O)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},fa=(e,r,o,n)=>{const{getState:i,setState:l,subscribe:c,unsubscribeAll:d}=An(r,o),p=oa(b=>ga(b,i,l,e,c,d,n));return{open:()=>p.click()}},ae={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Jt="vacano-image-cropper-styles",xa=`
1166
1125
  .vacano-cropper-root {
1167
1126
  background-color: rgba(0, 0, 0, 0.5);
1168
1127
  backdrop-filter: blur(4px);
@@ -1210,14 +1169,14 @@
1210
1169
  .vacano-cropper-apply-button:hover {
1211
1170
  background-color: ${t.COLORS["iron-grey"]};
1212
1171
  }
1213
- `,Oa=()=>{if(typeof document>"u"||document.getElementById(Jt))return;const e=document.createElement("style");e.id=Jt,e.textContent=xa,document.head.appendChild(e)},$a={root:["vacano-cropper-root"],container:["vacano-cropper-container"],header:["vacano-cropper-header"],body:["vacano-cropper-body"],footer:["vacano-cropper-footer"],cancelButton:["vacano-cropper-cancel-button"],applyButton:["vacano-cropper-apply-button"],portal:["vacano-cropper-portal"]},Er=(e={})=>{const{allowedTypes:r=ae.allowedTypes,applyLabel:o=ae.applyLabel,cancelLabel:i=ae.cancelLabel,compression:n=ae.compression,maxFileSize:l=ae.maxFileSize,onCrop:c,onError:d,outputSize:u=ae.outputSize,portalSize:b=ae.portalSize,type:h=ae.type}=e,f=p.useRef(null);return{open:p.useCallback(()=>{f.current||(Oa(),f.current=fa((m,S,x)=>{S&&(c==null||c({base64:m,blob:S,state:x}))},{portalSize:b,outputSize:u,compression:n,type:h,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:i},$a,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,i,n,l,c,d,u,b,h])}},pt=A.newClassNameGetter("image-cropper"),Sa=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:i,className:n,classnames:l,compression:c,maxFileSize:d,onCrop:u,onError:b,outputSize:h,portalSize:f,previewSize:$=120,ref:m,type:S,value:x,...C})=>{const[O,y]=p.useState(x??null),{open:g}=Er({allowedTypes:e,applyLabel:r,cancelLabel:i,compression:c,maxFileSize:d,onCrop:L=>{y(L.base64),u==null||u(L)},onError:b,outputSize:h,portalSize:f,type:S});return a.jsxs(bn,{...C,ref:m,className:pt("container",n),children:[a.jsx(gn,{$size:$,className:pt("preview",l==null?void 0:l.preview),children:O?a.jsx("img",{src:O,alt:"Preview"}):a.jsx(fn,{children:"No image"})}),a.jsx(De,{variant:"system",onClick:g,className:pt("button",l==null?void 0:l.button),style:{width:$},children:o})]})},Qt={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},er={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},le=e=>er[e]??er.normal,ut=e=>Qt[e]??Qt.default,ya=s.div`
1172
+ `,Oa=()=>{if(typeof document>"u"||document.getElementById(Jt))return;const e=document.createElement("style");e.id=Jt,e.textContent=xa,document.head.appendChild(e)},$a={root:["vacano-cropper-root"],container:["vacano-cropper-container"],header:["vacano-cropper-header"],body:["vacano-cropper-body"],footer:["vacano-cropper-footer"],cancelButton:["vacano-cropper-cancel-button"],applyButton:["vacano-cropper-apply-button"],portal:["vacano-cropper-portal"]},Er=(e={})=>{const{allowedTypes:r=ae.allowedTypes,applyLabel:o=ae.applyLabel,cancelLabel:n=ae.cancelLabel,compression:i=ae.compression,maxFileSize:l=ae.maxFileSize,onCrop:c,onError:d,outputSize:p=ae.outputSize,portalSize:b=ae.portalSize,type:h=ae.type}=e,f=u.useRef(null);return{open:u.useCallback(()=>{f.current||(Oa(),f.current=fa((m,O,x)=>{O&&(c==null||c({base64:m,blob:O,state:x}))},{portalSize:b,outputSize:p,compression:i,type:h,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:n},$a,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,n,i,l,c,d,p,b,h])}},pt=I.newClassNameGetter("image-cropper"),Sa=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:n,className:i,classnames:l,compression:c,maxFileSize:d,onCrop:p,onError:b,outputSize:h,portalSize:f,previewSize:$=120,ref:m,type:O,value:x,...C})=>{const[S,y]=u.useState(x??null),{open:g}=Er({allowedTypes:e,applyLabel:r,cancelLabel:n,compression:c,maxFileSize:d,onCrop:L=>{y(L.base64),p==null||p(L)},onError:b,outputSize:h,portalSize:f,type:O});return a.jsxs(bn,{...C,ref:m,className:pt("container",i),children:[a.jsx(gn,{$size:$,className:pt("preview",l==null?void 0:l.preview),children:S?a.jsx("img",{src:S,alt:"Preview"}):a.jsx(fn,{children:"No image"})}),a.jsx(De,{variant:"system",onClick:g,className:pt("button",l==null?void 0:l.button),style:{width:$},children:o})]})},Qt={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},er={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},le=e=>er[e]??er.normal,ut=e=>Qt[e]??Qt.default,ya=s.div`
1214
1173
  display: grid;
1215
1174
  flex-direction: column;
1216
1175
  gap: 2px;
1217
1176
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1218
1177
  `,Ca=s(ie)`
1219
1178
  margin-left: 6px;
1220
- `,ma=s.input`
1179
+ `,va=s.input`
1221
1180
  flex: 1;
1222
1181
  min-width: 0;
1223
1182
  outline: none;
@@ -1245,7 +1204,7 @@
1245
1204
  color: ${e=>le(e.$variant).placeholder.disabled};
1246
1205
  }
1247
1206
  }
1248
- `,ht=A.newClassNameGetter("input"),Pr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...u})=>a.jsxs(ya,{className:ht("container",e),$fullWidth:!!i,children:[a.jsx(Ca,{variant:d,className:ht("label",r==null?void 0:r.label),children:n}),a.jsx(ma,{...u,ref:l,disabled:o,$size:c,$variant:d,className:ht("input",r==null?void 0:r.input)})]}),va=s.div`
1207
+ `,ht=I.newClassNameGetter("input"),Pr=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(ya,{className:ht("container",e),$fullWidth:!!n,children:[a.jsx(Ca,{variant:d,className:ht("label",r==null?void 0:r.label),children:i}),a.jsx(va,{...p,ref:l,disabled:o,$size:c,$variant:d,className:ht("input",r==null?void 0:r.input)})]}),ma=s.div`
1249
1208
  position: fixed;
1250
1209
  inset: 0;
1251
1210
  z-index: 1000;
@@ -1265,13 +1224,13 @@
1265
1224
  border-radius: 16px;
1266
1225
  box-shadow: 0 8px 32px ${t.alpha(t.COLORS.black,20)};
1267
1226
  animation: ${t.KEYFRAMES.scaleIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
1268
- `,tr=A.newClassNameGetter("modal"),zr=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?ge.createPortal(a.jsx(va,{className:tr("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(wa,{...d,ref:l,className:tr("content",o,i==null?void 0:i.content),$animated:!!e,$width:c,children:r})}),document.body):null,jr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ra=s.div`
1227
+ `,tr=I.newClassNameGetter("modal"),jr=({animated:e,children:r,className:o,classnames:n,open:i,ref:l,width:c="500px",...d})=>i?ge.createPortal(a.jsx(ma,{className:tr("overlay",n==null?void 0:n.overlay),$animated:!!e,children:a.jsx(wa,{...d,ref:l,className:tr("content",o,n==null?void 0:n.content),$animated:!!e,$width:c,children:r})}),document.body):null,zr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ra=s.div`
1269
1228
  display: flex;
1270
1229
  flex-direction: column;
1271
1230
  gap: 4px;
1272
1231
  `,ka=s(ie)`
1273
1232
  margin-left: 6px;
1274
- color: ${e=>jr[e.$variant].label};
1233
+ color: ${e=>zr[e.$variant].label};
1275
1234
  `,La=s.button`
1276
1235
  display: flex;
1277
1236
  flex-wrap: wrap;
@@ -1279,7 +1238,7 @@
1279
1238
  gap: 6px;
1280
1239
  min-height: 44px;
1281
1240
  padding: 8px 12px;
1282
- border: 1px dashed ${e=>jr[e.$variant].border};
1241
+ border: 1px dashed ${e=>zr[e.$variant].border};
1283
1242
  border-radius: 8px;
1284
1243
  background: ${t.COLORS.white};
1285
1244
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
@@ -1298,11 +1257,11 @@
1298
1257
  flex-direction: column;
1299
1258
  padding: 20px;
1300
1259
  gap: 16px;
1301
- `,za=s.div`
1260
+ `,ja=s.div`
1302
1261
  display: flex;
1303
1262
  align-items: center;
1304
1263
  justify-content: space-between;
1305
- `,ja=s.h3`
1264
+ `,za=s.h3`
1306
1265
  margin: 0;
1307
1266
  font-size: 18px;
1308
1267
  font-weight: 600;
@@ -1338,7 +1297,7 @@
1338
1297
  color: ${t.COLORS["iron-grey"]};
1339
1298
  font-size: 14px;
1340
1299
  text-align: center;
1341
- `,Q=A.newClassNameGetter("multi-select"),Da=({className:e,classnames:r,disabled:o=!1,emptyMessage:i="No options found",label:n,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:u,placeholder:b="Select...",ref:h,searchPlaceholder:f="Search...",value:$,variant:m="normal",...S})=>{const[x,C]=p.useState(!1),[O,y]=p.useState(""),g=p.useMemo(()=>u.filter(w=>$.includes(w.value)),[u,$]),L=p.useMemo(()=>{if(!O.trim())return u;const w=O.toLowerCase().trim();return u.filter(M=>M.label.toLowerCase().includes(w))},[u,O]),z=l===1/0?g:g.slice(0,l),N=g.length-z.length,V=()=>{o||(C(!0),y(""))},P=()=>{C(!1),y("")},_=w=>{$.includes(w)?d($.filter(M=>M!==w)):d([...$,w])},j=w=>{d($.filter(M=>M!==w))};return a.jsxs(Ra,{...S,ref:h,className:Q("container",e),children:[n&&a.jsx(ka,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:n}),a.jsx(La,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:V,className:Q("trigger",r==null?void 0:r.trigger),children:g.length===0?a.jsx(Ea,{className:Q("placeholder",r==null?void 0:r.placeholder),children:b}):a.jsxs(a.Fragment,{children:[z.map(w=>a.jsx(Je,{deletable:!0,onDelete:()=>j(w.value),onClick:M=>M.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:w.label},w.value)),N>0&&a.jsxs(Je,{variant:"gray",onClick:w=>w.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",N]})]})}),a.jsx(zr,{open:x,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(Pa,{children:[a.jsxs(za,{children:[a.jsx(ja,{children:c}),a.jsx(De,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:P})]}),a.jsx(Pr,{type:"text",value:O,onChange:w=>y(w.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Ta,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(Aa,{className:Q("empty",r==null?void 0:r.empty),children:i}):L.map(w=>a.jsxs(Na,{$disabled:!!w.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(et,{checked:$.includes(w.value),disabled:w.disabled,onChange:()=>_(w.value)}),a.jsx(Ia,{children:w.label})]},w.value))})]})})]})},_a=5e3,rr={default:{background:"#374151",text:t.COLORS.white},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white},info:{background:t.COLORS["steel-blue"],text:t.COLORS.white}},Tr=p.createContext(null),or=e=>rr[e]??rr.default,Ma=s.div`
1300
+ `,Q=I.newClassNameGetter("multi-select"),Da=({className:e,classnames:r,disabled:o=!1,emptyMessage:n="No options found",label:i,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:p,placeholder:b="Select...",ref:h,searchPlaceholder:f="Search...",value:$,variant:m="normal",...O})=>{const[x,C]=u.useState(!1),[S,y]=u.useState(""),g=u.useMemo(()=>p.filter(E=>$.includes(E.value)),[p,$]),L=u.useMemo(()=>{if(!S.trim())return p;const E=S.toLowerCase().trim();return p.filter(A=>A.label.toLowerCase().includes(E))},[p,S]),T=l===1/0?g:g.slice(0,l),j=g.length-T.length,Y=()=>{o||(C(!0),y(""))},P=()=>{C(!1),y("")},_=E=>{$.includes(E)?d($.filter(A=>A!==E)):d([...$,E])},M=E=>{d($.filter(A=>A!==E))};return a.jsxs(Ra,{...O,ref:h,className:Q("container",e),children:[i&&a.jsx(ka,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:i}),a.jsx(La,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:Y,className:Q("trigger",r==null?void 0:r.trigger),children:g.length===0?a.jsx(Ea,{className:Q("placeholder",r==null?void 0:r.placeholder),children:b}):a.jsxs(a.Fragment,{children:[T.map(E=>a.jsx(Je,{deletable:!0,onDelete:()=>M(E.value),onClick:A=>A.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:E.label},E.value)),j>0&&a.jsxs(Je,{variant:"gray",onClick:E=>E.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",j]})]})}),a.jsx(jr,{open:x,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(Pa,{children:[a.jsxs(ja,{children:[a.jsx(za,{children:c}),a.jsx(De,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:P})]}),a.jsx(Pr,{type:"text",value:S,onChange:E=>y(E.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Ta,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(Aa,{className:Q("empty",r==null?void 0:r.empty),children:n}):L.map(E=>a.jsxs(Na,{$disabled:!!E.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(et,{checked:$.includes(E.value),disabled:E.disabled,onChange:()=>_(E.value)}),a.jsx(Ia,{children:E.label})]},E.value))})]})})]})},_a=5e3,rr={default:{background:"#374151",text:t.COLORS.white},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white},info:{background:t.COLORS["steel-blue"],text:t.COLORS.white}},Tr=u.createContext(null),or=e=>rr[e]??rr.default,Ma=s.div`
1342
1301
  position: fixed;
1343
1302
  top: 0;
1344
1303
  left: 0;
@@ -1385,7 +1344,7 @@
1385
1344
  }
1386
1345
  `,Va=s.div`
1387
1346
  position: relative;
1388
- `,Ha=({notification:e,onRemove:r,onAnimationEnd:o})=>{const[i,n]=p.useState(!1),l=()=>{n(!0)},c=()=>{i&&(r(),o())};return p.useEffect(()=>{const d=setTimeout(()=>{l()},e.duration);return()=>clearTimeout(d)},[e.duration,e.id]),a.jsx(Va,{children:a.jsxs(Fa,{$variant:e.variant,$isExiting:i,onAnimationEnd:c,children:[a.jsx(Ba,{children:e.message}),a.jsx(Ya,{onClick:l,children:a.jsx(a.X,{style:{width:18,height:18}})})]})})},Ga=(e,r)=>{switch(r.type){case"ADD_NOTIFICATION":{const o=r.payload;return e.current?{...e,queue:[...e.queue,o]}:{...e,current:o}}case"REMOVE_CURRENT":return{...e,current:null};case"SHOW_NEXT":{const o=e.queue[0];return o?{current:o,queue:e.queue.slice(1)}:e}default:return e}},Wa={current:null,queue:[]},Ua=({children:e})=>{const[r,o]=p.useReducer(Ga,Wa),i=p.useCallback((d,u="default",b=_a)=>{const h=`notification-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_NOTIFICATION",payload:{id:h,message:d,variant:u,duration:b}})},[]),n=p.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),l=p.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),c=p.useCallback(()=>{setTimeout(()=>{o({type:"SHOW_NEXT"})},100)},[]);return a.jsxs(Tr.Provider,{value:{show:i,hide:n},children:[e,a.jsx(Ma,{children:r.current&&a.jsx(Ha,{notification:r.current,onRemove:l,onAnimationEnd:c},r.current.id)})]})},Xa=()=>{const e=p.useContext(Tr);if(!e)throw new Error("useNotification must be used within NotificationProvider");return e},ir={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},nr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Ne=e=>ir[e]??ir.default,$e=e=>nr[e]??nr.normal,qa=s.div`
1347
+ `,Ha=({notification:e,onRemove:r,onAnimationEnd:o})=>{const[n,i]=u.useState(!1),l=()=>{i(!0)},c=()=>{n&&(r(),o())};return u.useEffect(()=>{const d=setTimeout(()=>{l()},e.duration);return()=>clearTimeout(d)},[e.duration,e.id]),a.jsx(Va,{children:a.jsxs(Fa,{$variant:e.variant,$isExiting:n,onAnimationEnd:c,children:[a.jsx(Ba,{children:e.message}),a.jsx(Ya,{onClick:l,children:a.jsx(a.X,{style:{width:18,height:18}})})]})})},Ga=(e,r)=>{switch(r.type){case"ADD_NOTIFICATION":{const o=r.payload;return e.current?{...e,queue:[...e.queue,o]}:{...e,current:o}}case"REMOVE_CURRENT":return{...e,current:null};case"SHOW_NEXT":{const o=e.queue[0];return o?{current:o,queue:e.queue.slice(1)}:e}default:return e}},Wa={current:null,queue:[]},Ua=({children:e})=>{const[r,o]=u.useReducer(Ga,Wa),n=u.useCallback((d,p="default",b=_a)=>{const h=`notification-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_NOTIFICATION",payload:{id:h,message:d,variant:p,duration:b}})},[]),i=u.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),l=u.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),c=u.useCallback(()=>{setTimeout(()=>{o({type:"SHOW_NEXT"})},100)},[]);return a.jsxs(Tr.Provider,{value:{show:n,hide:i},children:[e,a.jsx(Ma,{children:r.current&&a.jsx(Ha,{notification:r.current,onRemove:l,onAnimationEnd:c},r.current.id)})]})},Xa=()=>{const e=u.useContext(Tr);if(!e)throw new Error("useNotification must be used within NotificationProvider");return e},ir={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},nr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Ne=e=>ir[e]??ir.default,$e=e=>nr[e]??nr.normal,qa=s.div`
1389
1348
  display: inline-flex;
1390
1349
  flex-direction: column;
1391
1350
  gap: 2px;
@@ -1419,7 +1378,7 @@
1419
1378
  &::selection {
1420
1379
  background-color: transparent;
1421
1380
  }
1422
- `,bt=A.newClassNameGetter("otp-code"),Qa=({autoFocus:e,className:r,classnames:o,disabled:i,label:n,length:l=6,onChange:c,ref:d,size:u="default",value:b="",variant:h="normal",...f})=>{const $=p.useRef([]);p.useEffect(()=>{e&&$.current[0]&&$.current[0].focus()},[e]);const m=p.useCallback(O=>{const y=$.current[O];y&&(y.focus(),y.select())},[]),S=p.useCallback((O,y)=>{const L=y.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const z=b.padEnd(l," ").split(""),N=z.findIndex(j=>j===" "||j===""),V=N!==-1?N:O;z[V]=L;const P=z.join("").replace(/ /g,"");c==null||c(P);const _=V+1;_<l&&m(_)},[b,l,c,m]),x=p.useCallback((O,y)=>{if(y.key==="Backspace"){y.preventDefault();const g=b.split("");g[O]?(g[O]="",c==null||c(g.join(""))):O>0&&(g[O-1]="",c==null||c(g.join("")),m(O-1))}else y.key==="ArrowLeft"&&O>0?(y.preventDefault(),m(O-1)):y.key==="ArrowRight"&&O<l-1&&(y.preventDefault(),m(O+1))},[b,l,c,m]),C=p.useCallback(O=>{O.preventDefault();const y=O.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if(y){c==null||c(y);const g=Math.min(y.length,l-1);m(g)}},[l,c,m]);return a.jsxs(qa,{ref:d,className:bt("container",r),...f,children:[n&&a.jsx(Ka,{variant:h,className:bt("label",o==null?void 0:o.label),children:n}),a.jsx(Za,{$size:u,children:Array.from({length:l}).map((O,y)=>a.jsx(Ja,{ref:g=>{$.current[y]=g},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:i,value:b[y]??"",onChange:g=>S(y,g),onKeyDown:g=>x(y,g),onPaste:C,onFocus:g=>g.target.select(),$size:u,$variant:h,className:bt("input",o==null?void 0:o.input)},y))})]})},ar={light:{background:t.COLORS.white,border:t.alpha(t.COLORS.black,30),title:t.COLORS.black,description:t.COLORS["iron-grey"]},dark:{background:t.alpha(t.COLORS.white,5),border:t.alpha(t.COLORS.white,30),title:t.COLORS.white,description:"#9ca3af"}},Qe=e=>ar[e]??ar.light,el=s.div`
1381
+ `,bt=I.newClassNameGetter("otp-code"),Qa=({autoFocus:e,className:r,classnames:o,disabled:n,label:i,length:l=6,onChange:c,ref:d,size:p="default",value:b="",variant:h="normal",...f})=>{const $=u.useRef([]);u.useEffect(()=>{e&&$.current[0]&&$.current[0].focus()},[e]);const m=u.useCallback(S=>{const y=$.current[S];y&&(y.focus(),y.select())},[]),O=u.useCallback((S,y)=>{const L=y.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const T=b.padEnd(l," ").split(""),j=T.findIndex(M=>M===" "||M===""),Y=j!==-1?j:S;T[Y]=L;const P=T.join("").replace(/ /g,"");c==null||c(P);const _=Y+1;_<l&&m(_)},[b,l,c,m]),x=u.useCallback((S,y)=>{if(y.key==="Backspace"){y.preventDefault();const g=b.split("");g[S]?(g[S]="",c==null||c(g.join(""))):S>0&&(g[S-1]="",c==null||c(g.join("")),m(S-1))}else y.key==="ArrowLeft"&&S>0?(y.preventDefault(),m(S-1)):y.key==="ArrowRight"&&S<l-1&&(y.preventDefault(),m(S+1))},[b,l,c,m]),C=u.useCallback(S=>{S.preventDefault();const y=S.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if(y){c==null||c(y);const g=Math.min(y.length,l-1);m(g)}},[l,c,m]);return a.jsxs(qa,{ref:d,className:bt("container",r),...f,children:[i&&a.jsx(Ka,{variant:h,className:bt("label",o==null?void 0:o.label),children:i}),a.jsx(Za,{$size:p,children:Array.from({length:l}).map((S,y)=>a.jsx(Ja,{ref:g=>{$.current[y]=g},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:n,value:b[y]??"",onChange:g=>O(y,g),onKeyDown:g=>x(y,g),onPaste:C,onFocus:g=>g.target.select(),$size:p,$variant:h,className:bt("input",o==null?void 0:o.input)},y))})]})},ar={light:{background:t.COLORS.white,border:t.alpha(t.COLORS.black,30),title:t.COLORS.black,description:t.COLORS["iron-grey"]},dark:{background:t.alpha(t.COLORS.white,5),border:t.alpha(t.COLORS.white,30),title:t.COLORS.white,description:"#9ca3af"}},Qe=e=>ar[e]??ar.light,el=s.div`
1423
1382
  display: flex;
1424
1383
  flex-direction: column;
1425
1384
  gap: 16px;
@@ -1444,7 +1403,7 @@
1444
1403
  display: flex;
1445
1404
  flex-wrap: wrap;
1446
1405
  gap: 8px;
1447
- `,Ue=A.newClassNameGetter("panel"),nl=({children:e,className:r,classnames:o,description:i,ref:n,title:l,variant:c="light",...d})=>{const u=l||i;return a.jsxs(el,{...d,ref:n,className:Ue("container",r),$variant:c,children:[u&&a.jsxs(tl,{children:[l&&a.jsx(rl,{className:Ue("title",o==null?void 0:o.title),$variant:c,children:l}),i&&a.jsx(ol,{className:Ue("description",o==null?void 0:o.description),$variant:c,children:i})]}),a.jsx(il,{className:Ue("content",o==null?void 0:o.content),children:e})]})},wt={compact:{height:4,radius:2},default:{height:8,radius:4}},al=s.div`
1406
+ `,Ue=I.newClassNameGetter("panel"),nl=({children:e,className:r,classnames:o,description:n,ref:i,title:l,variant:c="light",...d})=>{const p=l||n;return a.jsxs(el,{...d,ref:i,className:Ue("container",r),$variant:c,children:[p&&a.jsxs(tl,{children:[l&&a.jsx(rl,{className:Ue("title",o==null?void 0:o.title),$variant:c,children:l}),n&&a.jsx(ol,{className:Ue("description",o==null?void 0:o.description),$variant:c,children:n})]}),a.jsx(il,{className:Ue("content",o==null?void 0:o.content),children:e})]})},wt={compact:{height:4,radius:2},default:{height:8,radius:4}},al=s.div`
1448
1407
  width: 100%;
1449
1408
  height: ${({$size:e})=>wt[e].height}px;
1450
1409
  border-radius: ${({$size:e})=>wt[e].radius}px;
@@ -1456,7 +1415,7 @@
1456
1415
  border-radius: ${({$size:e})=>wt[e].radius}px;
1457
1416
  background-color: ${t.COLORS.black};
1458
1417
  transition: width 0.2s ease;
1459
- `,lr=A.newClassNameGetter("progress"),dl=({value:e,size:r="default",className:o,classnames:i,ref:n,...l})=>a.jsx(al,{...l,ref:n,$size:r,className:lr("track",o,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(ll,{$size:r,$value:e,className:lr("bar",i==null?void 0:i.bar)})}),dr={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},dot:t.COLORS.black,label:t.COLORS.black},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS.red,30)},dot:t.COLORS.red,label:t.COLORS.red}},Ce=e=>dr[e]??dr.normal,cl=s.label`
1418
+ `,lr=I.newClassNameGetter("progress"),dl=({value:e,size:r="default",className:o,classnames:n,ref:i,...l})=>a.jsx(al,{...l,ref:i,$size:r,className:lr("track",o,n==null?void 0:n.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(ll,{$size:r,$value:e,className:lr("bar",n==null?void 0:n.bar)})}),dr={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},dot:t.COLORS.black,label:t.COLORS.black},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS.red,30)},dot:t.COLORS.red,label:t.COLORS.red}},Ce=e=>dr[e]??dr.normal,cl=s.label`
1460
1419
  display: inline-flex;
1461
1420
  align-items: flex-start;
1462
1421
  gap: 8px;
@@ -1509,7 +1468,7 @@
1509
1468
  text-decoration: none;
1510
1469
  }
1511
1470
  }
1512
- `,ze=A.newClassNameGetter("radio"),Lt=({checked:e,className:r,classnames:o,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...u})=>a.jsxs(cl,{className:ze("container",r),$disabled:!!i,$variant:d,children:[a.jsx(sl,{...u,ref:c,type:"radio",className:ze("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:l}),a.jsx(pl,{className:ze("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(ul,{className:ze("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),n&&a.jsx(hl,{className:ze("label",o==null?void 0:o.label),$variant:d,children:n})]}),cr={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},he=e=>cr[e]??cr.normal,bl=s.label`
1471
+ `,je=I.newClassNameGetter("radio"),Lt=({checked:e,className:r,classnames:o,disabled:n,label:i,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(cl,{className:je("container",r),$disabled:!!n,$variant:d,children:[a.jsx(sl,{...p,ref:c,type:"radio",className:je("input",o==null?void 0:o.input),checked:e,disabled:n,onChange:l}),a.jsx(pl,{className:je("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(ul,{className:je("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),i&&a.jsx(hl,{className:je("label",o==null?void 0:o.label),$variant:d,children:i})]}),cr={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},he=e=>cr[e]??cr.normal,bl=s.label`
1513
1472
  display: grid;
1514
1473
  grid-template-columns: auto 1fr;
1515
1474
  align-items: start;
@@ -1566,7 +1525,7 @@
1566
1525
  label[data-disabled='true'] & {
1567
1526
  color: ${e=>he(e.$variant).description.disabled};
1568
1527
  }
1569
- `,Xe=A.newClassNameGetter("radio-card"),$l=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:u,variant:b="normal",...h})=>a.jsxs(bl,{className:Xe("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:b,"data-disabled":n,children:[a.jsx(gl,{...h,ref:u,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(Lt,{className:o==null?void 0:o.radio,checked:e,disabled:n,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(fl,{className:Xe("content",o==null?void 0:o.content),children:[a.jsx(xl,{className:Xe("label",o==null?void 0:o.label),$variant:b,children:c}),i&&a.jsx(Ol,{className:Xe("description",o==null?void 0:o.description),$variant:b,children:i})]})]}),sr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Sl=s.div`
1528
+ `,Xe=I.newClassNameGetter("radio-card"),$l=({checked:e,className:r,classnames:o,description:n,disabled:i,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:b="normal",...h})=>a.jsxs(bl,{className:Xe("container",r),$checked:e,$disabled:!!i,$fullWidth:l,$variant:b,"data-disabled":i,children:[a.jsx(gl,{...h,ref:p,type:"radio",checked:e,disabled:i,onChange:d}),a.jsx(Lt,{className:o==null?void 0:o.radio,checked:e,disabled:i,variant:b,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(fl,{className:Xe("content",o==null?void 0:o.content),children:[a.jsx(xl,{className:Xe("label",o==null?void 0:o.label),$variant:b,children:c}),n&&a.jsx(Ol,{className:Xe("description",o==null?void 0:o.description),$variant:b,children:n})]})]}),sr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Sl=s.div`
1570
1529
  display: flex;
1571
1530
  flex-direction: column;
1572
1531
  gap: 8px;
@@ -1580,7 +1539,7 @@
1580
1539
  display: flex;
1581
1540
  flex-direction: column;
1582
1541
  gap: 12px;
1583
- `,gt=A.newClassNameGetter("radio-group"),ml=({className:e,classnames:r,disabled:o,label:i,name:n,onChange:l,options:c,ref:d,value:u,...b})=>a.jsxs(Sl,{...b,ref:d,className:gt("container",e),children:[i&&a.jsx(yl,{className:gt("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(Cl,{className:gt("options",r==null?void 0:r.options),children:c.map(h=>a.jsx(Lt,{className:r==null?void 0:r.radio,name:n,checked:u===h.value,label:h.label,disabled:o,onChange:()=>l(h.value)},h.value))})]}),Nr=p.createContext(null),vl=s.div`
1542
+ `,gt=I.newClassNameGetter("radio-group"),vl=({className:e,classnames:r,disabled:o,label:n,name:i,onChange:l,options:c,ref:d,value:p,...b})=>a.jsxs(Sl,{...b,ref:d,className:gt("container",e),children:[n&&a.jsx(yl,{className:gt("label",r==null?void 0:r.label),$disabled:o,children:n}),a.jsx(Cl,{className:gt("options",r==null?void 0:r.options),children:c.map(h=>a.jsx(Lt,{className:r==null?void 0:r.radio,name:i,checked:p===h.value,label:h.label,disabled:o,onChange:()=>l(h.value)},h.value))})]}),Nr=u.createContext(null),ml=s.div`
1584
1543
  position: fixed;
1585
1544
  bottom: 24px;
1586
1545
  right: 24px;
@@ -1599,7 +1558,7 @@
1599
1558
  font-size: 14px;
1600
1559
  font-weight: 500;
1601
1560
  white-space: nowrap;
1602
- `,Rl=({children:e,defaultMessage:r="Saving"})=>{const[o,i]=p.useState(!1),[n,l]=p.useState(r),c=p.useCallback(b=>{l(b??r),i(!0)},[r]),d=p.useCallback(()=>{i(!1)},[]),u=p.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(Nr.Provider,{value:u,children:[e,o&&a.jsxs(vl,{children:[a.jsx(kt,{size:"sm"}),a.jsx(wl,{children:n})]})]})},kl=()=>{const e=p.useContext(Nr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},ft=40,je=4,pr={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ur={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:t.alpha(t.COLORS.black,40),focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:t.alpha(t.COLORS.red,40),focus:t.alpha(t.COLORS.red,30)}},xt=e=>pr[e]??pr.default,se=e=>ur[e]??ur.normal,Ll=s.div`
1561
+ `,Rl=({children:e,defaultMessage:r="Saving"})=>{const[o,n]=u.useState(!1),[i,l]=u.useState(r),c=u.useCallback(b=>{l(b??r),n(!0)},[r]),d=u.useCallback(()=>{n(!1)},[]),p=u.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(Nr.Provider,{value:p,children:[e,o&&a.jsxs(ml,{children:[a.jsx(kt,{size:"sm"}),a.jsx(wl,{children:i})]})]})},kl=()=>{const e=u.useContext(Nr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},ft=40,ze=4,pr={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ur={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:t.alpha(t.COLORS.black,40),focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:t.alpha(t.COLORS.red,40),focus:t.alpha(t.COLORS.red,30)}},xt=e=>pr[e]??pr.default,se=e=>ur[e]??ur.normal,Ll=s.div`
1603
1562
  position: relative;
1604
1563
  display: grid;
1605
1564
  gap: 2px;
@@ -1626,13 +1585,13 @@
1626
1585
  border: 1px solid
1627
1586
  ${e=>e.$disabled?se(e.$variant).border.disabled:se(e.$variant).border.static};
1628
1587
  background-color: ${e=>e.$disabled?se(e.$variant).background.disabled:se(e.$variant).background.static};
1629
- `,zl=s.span`
1588
+ `,jl=s.span`
1630
1589
  flex: 1;
1631
1590
  min-width: 0;
1632
1591
  overflow: hidden;
1633
1592
  text-overflow: ellipsis;
1634
1593
  white-space: nowrap;
1635
- `,jl=s.span`
1594
+ `,zl=s.span`
1636
1595
  display: flex;
1637
1596
  align-items: center;
1638
1597
  justify-content: center;
@@ -1681,7 +1640,7 @@
1681
1640
  justify-content: center;
1682
1641
  flex-shrink: 0;
1683
1642
  color: ${t.COLORS.black};
1684
- `,Se=A.newClassNameGetter("select"),Dl=({className:e,classnames:r,disabled:o=!1,fullWidth:i=!1,label:n,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:u,ref:b,size:h="default",value:f,variant:$="normal",...m})=>{const[S,x]=p.useState(!1),[C,O]=p.useState({top:0,left:0,width:0}),y=p.useRef(null),g=p.useRef(null),L=p.useRef(null),z=c.find(v=>v.value===f),N=Math.max(0,c.findIndex(v=>v.value===f)),V=-(N*ft+je),P=()=>{if(!g.current||!u)return;const v=g.current.getBoundingClientRect(),I=N*ft+je;let k=v.top-I;const T=c.length*ft+je*2,F=8,B=window.innerHeight-T-8;k<F&&(k=F),k>B&&(k=B),O({top:k,left:v.left-je,width:v.width+je*2})},_=v=>{var I;l==null||l(v),x(!1),(I=g.current)==null||I.focus()},j=v=>{o||(v.key==="Enter"||v.key===" "?(v.preventDefault(),x(I=>!I)):v.key==="Escape"&&S?(v.preventDefault(),x(!1)):v.key==="ArrowDown"&&!S&&(v.preventDefault(),x(!0)))};p.useLayoutEffect(()=>{S&&u&&P()},[S,u,N,c.length]),p.useEffect(()=>{if(!S)return;const v=T=>{const F=T.target,B=y.current&&!y.current.contains(F),H=L.current&&!L.current.contains(F);u?B&&H&&x(!1):B&&x(!1)},I=()=>{u&&P()},k=()=>{u&&P()};return document.addEventListener("mousedown",v),u&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",k)),()=>{document.removeEventListener("mousedown",v),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",k)}},[S,u]);const w=()=>c.map(v=>a.jsxs(Il,{type:"button",role:"option",$selected:v.value===f,$disabled:v.disabled??!1,disabled:v.disabled,"aria-selected":v.value===f,onClick:()=>_(v.value),className:Se("option",r==null?void 0:r.option),children:[a.jsx("span",{children:v.label}),v.value===f&&a.jsx(Al,{children:a.jsx(a.Check,{size:16})})]},v.value)),M=u?ge.createPortal(a.jsx(Nl,{ref:L,role:"listbox",style:{top:C.top,left:C.left,width:C.width},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()}),u):a.jsx(Tl,{ref:L,role:"listbox",style:{top:V},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()});return a.jsxs(Ll,{...m,ref:v=>{y.current=v,typeof b=="function"?b(v):b&&(b.current=v)},$fullWidth:i,className:Se("container",e),children:[n&&a.jsx(El,{className:Se("label",r==null?void 0:r.label),children:n}),a.jsxs(Pl,{ref:g,type:"button",$size:h,$variant:$,$disabled:o,$hasValue:!!z,disabled:o,onClick:()=>!o&&x(v=>!v),onKeyDown:j,"aria-haspopup":"listbox","aria-expanded":S,className:Se("trigger",r==null?void 0:r.trigger),children:[a.jsx(zl,{children:(z==null?void 0:z.label)??d}),a.jsx(jl,{$open:S,children:a.jsx(a.ChevronDown,{size:16})})]}),S&&M]})},hr={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},_l=e=>hr[e]??hr.neutral,Ml=s.div`
1643
+ `,Se=I.newClassNameGetter("select"),Dl=({className:e,classnames:r,disabled:o=!1,fullWidth:n=!1,label:i,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:p,ref:b,size:h="default",value:f,variant:$="normal",...m})=>{const[O,x]=u.useState(!1),[C,S]=u.useState({top:0,left:0,width:0}),y=u.useRef(null),g=u.useRef(null),L=u.useRef(null),T=c.find(v=>v.value===f),j=Math.max(0,c.findIndex(v=>v.value===f)),Y=-(j*ft+ze),P=()=>{if(!g.current||!p)return;const v=g.current.getBoundingClientRect(),N=j*ft+ze;let R=v.top-N;const z=c.length*ft+ze*2,B=8,F=window.innerHeight-z-8;R<B&&(R=B),R>F&&(R=F),S({top:R,left:v.left-ze,width:v.width+ze*2})},_=v=>{var N;l==null||l(v),x(!1),(N=g.current)==null||N.focus()},M=v=>{o||(v.key==="Enter"||v.key===" "?(v.preventDefault(),x(N=>!N)):v.key==="Escape"&&O?(v.preventDefault(),x(!1)):v.key==="ArrowDown"&&!O&&(v.preventDefault(),x(!0)))};u.useLayoutEffect(()=>{O&&p&&P()},[O,p,j,c.length]),u.useEffect(()=>{if(!O)return;const v=z=>{const B=z.target,F=y.current&&!y.current.contains(B),H=L.current&&!L.current.contains(B);p?F&&H&&x(!1):F&&x(!1)},N=()=>{p&&P()},R=()=>{p&&P()};return document.addEventListener("mousedown",v),p&&(window.addEventListener("scroll",N,!0),window.addEventListener("resize",R)),()=>{document.removeEventListener("mousedown",v),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",R)}},[O,p]);const E=()=>c.map(v=>a.jsxs(Il,{type:"button",role:"option",$selected:v.value===f,$disabled:v.disabled??!1,disabled:v.disabled,"aria-selected":v.value===f,onClick:()=>_(v.value),className:Se("option",r==null?void 0:r.option),children:[a.jsx("span",{children:v.label}),v.value===f&&a.jsx(Al,{children:a.jsx(a.Check,{size:16})})]},v.value)),A=p?ge.createPortal(a.jsx(Nl,{ref:L,role:"listbox",style:{top:C.top,left:C.left,width:C.width},className:Se("dropdown",r==null?void 0:r.dropdown),children:E()}),p):a.jsx(Tl,{ref:L,role:"listbox",style:{top:Y},className:Se("dropdown",r==null?void 0:r.dropdown),children:E()});return a.jsxs(Ll,{...m,ref:v=>{y.current=v,typeof b=="function"?b(v):b&&(b.current=v)},$fullWidth:n,className:Se("container",e),children:[i&&a.jsx(El,{className:Se("label",r==null?void 0:r.label),children:i}),a.jsxs(Pl,{ref:g,type:"button",$size:h,$variant:$,$disabled:o,$hasValue:!!T,disabled:o,onClick:()=>!o&&x(v=>!v),onKeyDown:M,"aria-haspopup":"listbox","aria-expanded":O,className:Se("trigger",r==null?void 0:r.trigger),children:[a.jsx(jl,{children:(T==null?void 0:T.label)??d}),a.jsx(zl,{$open:O,children:a.jsx(a.ChevronDown,{size:16})})]}),O&&A]})},hr={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},_l=e=>hr[e]??hr.neutral,Ml=s.div`
1685
1644
  display: flex;
1686
1645
  flex-direction: column;
1687
1646
  gap: 4px;
@@ -1723,7 +1682,7 @@
1723
1682
  margin: 0;
1724
1683
  font-size: 12px;
1725
1684
  color: ${({$variant:e})=>_l(e)};
1726
- `,qe=A.newClassNameGetter("status-card"),Gl=({border:e=!1,className:r,classnames:o,icon:i,label:n,ref:l,shadow:c=!1,trend:d,trendVariant:u="neutral",value:b,...h})=>a.jsxs(Ml,{...h,ref:l,className:qe("container",r),$border:e,$shadow:c,children:[a.jsxs(Fl,{children:[a.jsx(Bl,{className:qe("label",o==null?void 0:o.label),children:n}),i&&a.jsx(Yl,{children:i})]}),a.jsx(Vl,{className:qe("value",o==null?void 0:o.value),children:b}),d&&a.jsx(Hl,{className:qe("trend",o==null?void 0:o.trend),$variant:u,children:d})]}),Wl=s.div`
1685
+ `,qe=I.newClassNameGetter("status-card"),Gl=({border:e=!1,className:r,classnames:o,icon:n,label:i,ref:l,shadow:c=!1,trend:d,trendVariant:p="neutral",value:b,...h})=>a.jsxs(Ml,{...h,ref:l,className:qe("container",r),$border:e,$shadow:c,children:[a.jsxs(Fl,{children:[a.jsx(Bl,{className:qe("label",o==null?void 0:o.label),children:i}),n&&a.jsx(Yl,{children:n})]}),a.jsx(Vl,{className:qe("value",o==null?void 0:o.value),children:b}),d&&a.jsx(Hl,{className:qe("trend",o==null?void 0:o.trend),$variant:p,children:d})]}),Wl=s.div`
1727
1686
  display: flex;
1728
1687
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1729
1688
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
@@ -1789,7 +1748,7 @@
1789
1748
  min-width: 16px;
1790
1749
  margin: 0 12px;
1791
1750
  `}
1792
- `,Te=A.newClassNameGetter("stepper"),Jl=({className:e,classnames:r,onChange:o,orientation:i="horizontal",ref:n,steps:l,value:c,...d})=>{const u=p.useMemo(()=>l.findIndex(b=>b.value===c),[l,c]);return a.jsx(Wl,{...d,ref:n,$orientation:i,className:Te("container",e),children:l.map((b,h)=>{const f=b.value===c,$=h<u,m=h===l.length-1;return a.jsxs(Ul,{$orientation:i,children:[a.jsxs(Xl,{type:"button",$active:f,$completed:$,$clickable:!!o,onClick:()=>o==null?void 0:o(b.value),className:Te("step",r==null?void 0:r.step),children:[a.jsx(ql,{$active:f,$completed:$,className:Te("circle",r==null?void 0:r.circle),children:h+1}),a.jsx(Kl,{$active:f,$completed:$,className:Te("label",r==null?void 0:r.label),children:b.label})]}),!m&&a.jsx(Zl,{$completed:$,$orientation:i,className:Te("line",r==null?void 0:r.line)})]},b.value)})})},Rt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ql=s.div`
1751
+ `,Te=I.newClassNameGetter("stepper"),Jl=({className:e,classnames:r,onChange:o,orientation:n="horizontal",ref:i,steps:l,value:c,...d})=>{const p=u.useMemo(()=>l.findIndex(b=>b.value===c),[l,c]);return a.jsx(Wl,{...d,ref:i,$orientation:n,className:Te("container",e),children:l.map((b,h)=>{const f=b.value===c,$=h<p,m=h===l.length-1;return a.jsxs(Ul,{$orientation:n,children:[a.jsxs(Xl,{type:"button",$active:f,$completed:$,$clickable:!!o,onClick:()=>o==null?void 0:o(b.value),className:Te("step",r==null?void 0:r.step),children:[a.jsx(ql,{$active:f,$completed:$,className:Te("circle",r==null?void 0:r.circle),children:h+1}),a.jsx(Kl,{$active:f,$completed:$,className:Te("label",r==null?void 0:r.label),children:b.label})]}),!m&&a.jsx(Zl,{$completed:$,$orientation:n,className:Te("line",r==null?void 0:r.line)})]},b.value)})})},Rt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ql=s.div`
1793
1752
  position: relative;
1794
1753
  display: flex;
1795
1754
  flex-direction: column;
@@ -1901,7 +1860,7 @@
1901
1860
  color: ${t.COLORS["iron-grey"]};
1902
1861
  font-size: 14px;
1903
1862
  text-align: center;
1904
- `,ee=A.newClassNameGetter("tags"),Ke=4,nd=({className:e,classnames:r,createKey:o="Tab",disabled:i=!1,emptyMessage:n="No options",freeSolo:l=!0,label:c,onChange:d,options:u=[],placeholder:b="Add tag...",portalRenderNode:h,ref:f,value:$,variant:m="normal",...S})=>{const x=p.useRef(null),C=p.useRef(null),O=p.useRef(null),y=p.useRef(null),[g,L]=p.useState(""),[z,N]=p.useState(!1),[V,P]=p.useState("bottom"),[_,j]=p.useState({top:0,left:0,width:0}),w=p.useMemo(()=>{const E=u.filter(X=>!$.includes(X.value));if(!g.trim())return E;const D=g.toLowerCase().trim();return E.filter(X=>X.label.toLowerCase().includes(D))},[u,$,g]),M=z&&u.length>0,v=p.useCallback(()=>{var _e;if(!C.current)return;const E=C.current.getBoundingClientRect(),D=((_e=O.current)==null?void 0:_e.offsetHeight)??200,X=window.innerHeight-E.bottom-Ke,q=E.top-Ke,fe=X<D&&q>X?"top":"bottom";if(P(fe),h){const rt=fe==="bottom"?E.bottom+Ke:E.top-D-Ke;j({top:rt,left:E.left,width:E.width})}},[h]);p.useEffect(()=>{if(z)return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[z,v]);const I=p.useCallback(E=>{const D=E.trim();return!D||$.includes(D)?!1:(d([...$,D]),L(""),!0)},[$,d]),k=E=>{if(E.key===o&&g.trim())if(E.preventDefault(),l)I(g);else{const D=w.find(X=>X.label.toLowerCase()===g.toLowerCase().trim());D&&I(D.value)}else E.key==="Backspace"&&!g&&$.length>0&&d($.slice(0,-1))},T=E=>{var D;I(E),(D=y.current)==null||D.focus()},F=E=>{d($.filter(D=>D!==E))},B=()=>{var E;i||(E=y.current)==null||E.focus()},H=E=>{const D=u.find(X=>X.value===E);return(D==null?void 0:D.label)??E};return a.jsxs(Ql,{...S,ref:f,className:ee("container",e),children:[c&&a.jsx(ed,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:x,style:{position:"relative"},children:[a.jsxs(td,{ref:C,$variant:m,$disabled:i,$focused:z,onClick:B,className:ee("trigger",r==null?void 0:r.trigger),children:[$.map(E=>a.jsx(Je,{deletable:!i,onDelete:()=>F(E),className:ee("chip",r==null?void 0:r.chip),children:H(E)},E)),a.jsx(rd,{ref:y,type:"text",value:g,onChange:E=>L(E.target.value),onFocus:()=>N(!0),onBlur:()=>setTimeout(()=>N(!1),150),onKeyDown:k,placeholder:$.length===0?b:"",disabled:i,$disabled:i,className:ee("input",r==null?void 0:r.input)})]}),u.length>0&&(h?ge.createPortal(a.jsx(id,{ref:O,$open:M,$position:V,style:{top:_.top,left:_.left,width:_.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(E=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(E.value),className:ee("option",r==null?void 0:r.option),children:E.label},E.value))}),h):a.jsx(od,{ref:O,$open:M,$position:V,className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(E=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(E.value),className:ee("option",r==null?void 0:r.option),children:E.label},E.value))}))]})]})},ad=s.div`
1863
+ `,ee=I.newClassNameGetter("tags"),Ke=4,nd=({className:e,classnames:r,createKey:o="Tab",disabled:n=!1,emptyMessage:i="No options",freeSolo:l=!0,label:c,onChange:d,options:p=[],placeholder:b="Add tag...",portalRenderNode:h,ref:f,value:$,variant:m="normal",...O})=>{const x=u.useRef(null),C=u.useRef(null),S=u.useRef(null),y=u.useRef(null),[g,L]=u.useState(""),[T,j]=u.useState(!1),[Y,P]=u.useState("bottom"),[_,M]=u.useState({top:0,left:0,width:0}),E=u.useMemo(()=>{const k=p.filter(X=>!$.includes(X.value));if(!g.trim())return k;const D=g.toLowerCase().trim();return k.filter(X=>X.label.toLowerCase().includes(D))},[p,$,g]),A=T&&p.length>0,v=u.useCallback(()=>{var _e;if(!C.current)return;const k=C.current.getBoundingClientRect(),D=((_e=S.current)==null?void 0:_e.offsetHeight)??200,X=window.innerHeight-k.bottom-Ke,q=k.top-Ke,fe=X<D&&q>X?"top":"bottom";if(P(fe),h){const rt=fe==="bottom"?k.bottom+Ke:k.top-D-Ke;M({top:rt,left:k.left,width:k.width})}},[h]);u.useEffect(()=>{if(T)return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[T,v]);const N=u.useCallback(k=>{const D=k.trim();return!D||$.includes(D)?!1:(d([...$,D]),L(""),!0)},[$,d]),R=k=>{if(k.key===o&&g.trim())if(k.preventDefault(),l)N(g);else{const D=E.find(X=>X.label.toLowerCase()===g.toLowerCase().trim());D&&N(D.value)}else k.key==="Backspace"&&!g&&$.length>0&&d($.slice(0,-1))},z=k=>{var D;N(k),(D=y.current)==null||D.focus()},B=k=>{d($.filter(D=>D!==k))},F=()=>{var k;n||(k=y.current)==null||k.focus()},H=k=>{const D=p.find(X=>X.value===k);return(D==null?void 0:D.label)??k};return a.jsxs(Ql,{...O,ref:f,className:ee("container",e),children:[c&&a.jsx(ed,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:x,style:{position:"relative"},children:[a.jsxs(td,{ref:C,$variant:m,$disabled:n,$focused:T,onClick:F,className:ee("trigger",r==null?void 0:r.trigger),children:[$.map(k=>a.jsx(Je,{deletable:!n,onDelete:()=>B(k),className:ee("chip",r==null?void 0:r.chip),children:H(k)},k)),a.jsx(rd,{ref:y,type:"text",value:g,onChange:k=>L(k.target.value),onFocus:()=>j(!0),onBlur:()=>setTimeout(()=>j(!1),150),onKeyDown:R,placeholder:$.length===0?b:"",disabled:n,$disabled:n,className:ee("input",r==null?void 0:r.input)})]}),p.length>0&&(h?ge.createPortal(a.jsx(id,{ref:S,$open:A,$position:Y,style:{top:_.top,left:_.left,width:_.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:E.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:i}):E.map(k=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>z(k.value),className:ee("option",r==null?void 0:r.option),children:k.label},k.value))}),h):a.jsx(od,{ref:S,$open:A,$position:Y,className:ee("dropdown",r==null?void 0:r.dropdown),children:E.length===0?a.jsx(gr,{className:ee("empty",r==null?void 0:r.empty),children:i}):E.map(k=>a.jsx(br,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>z(k.value),className:ee("option",r==null?void 0:r.option),children:k.label},k.value))}))]})]})},ad=s.div`
1905
1864
  display: flex;
1906
1865
  align-items: center;
1907
1866
  gap: 6px;
@@ -1923,7 +1882,7 @@
1923
1882
  &:hover:not(:disabled) {
1924
1883
  background-color: ${e=>e.$active?t.COLORS.gray:"rgba(0, 0, 0, 0.05)"};
1925
1884
  }
1926
- `,fr=A.newClassNameGetter("tabs"),dd=({className:e,classnames:r,onChange:o,ref:i,tabs:n,value:l,...c})=>a.jsx(ad,{...c,ref:i,className:fr("container",e),role:"tablist",children:n.map(d=>a.jsx(ld,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:fr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),xr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},de=e=>xr[e]??xr.normal,cd=s.div`
1885
+ `,fr=I.newClassNameGetter("tabs"),dd=({className:e,classnames:r,onChange:o,ref:n,tabs:i,value:l,...c})=>a.jsx(ad,{...c,ref:n,className:fr("container",e),role:"tablist",children:i.map(d=>a.jsx(ld,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:fr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),xr={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},de=e=>xr[e]??xr.normal,cd=s.div`
1927
1886
  display: grid;
1928
1887
  flex-direction: column;
1929
1888
  gap: 2px;
@@ -1960,7 +1919,7 @@
1960
1919
  color: ${e=>de(e.$variant).placeholder.disabled};
1961
1920
  }
1962
1921
  }
1963
- `,Ot=A.newClassNameGetter("textarea"),ud=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,variant:c="normal",rows:d=4,...u})=>a.jsxs(cd,{className:Ot("container",e),$fullWidth:!!i,children:[n&&a.jsx(sd,{variant:c,className:Ot("label",r==null?void 0:r.label),children:n}),a.jsx(pd,{...u,ref:l,rows:d,disabled:o,$variant:c,className:Ot("textarea",r==null?void 0:r.textarea)})]}),Mr=p.createContext(null),$t=3,Or={default:{background:"#374151",text:t.COLORS.white,border:"#374151"},success:{background:t.COLORS.green,text:t.COLORS.white,border:t.COLORS.green},warning:{background:t.COLORS.yellow,text:t.COLORS.white,border:t.COLORS.yellow},danger:{background:t.COLORS.red,text:t.COLORS.white,border:t.COLORS.red}},hd=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<$t?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,i=e.toasts.filter(l=>l.id!==o),n=e.queue[0];return n&&i.length<$t?{toasts:[...i,n],queue:e.queue.slice(1)}:{...e,toasts:i}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=$t?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},bd={toasts:[],queue:[]},St=e=>Or[e]??Or.default,gd=s.div`
1922
+ `,Ot=I.newClassNameGetter("textarea"),ud=({className:e,classnames:r,disabled:o,fullWidth:n,label:i,ref:l,variant:c="normal",rows:d=4,...p})=>a.jsxs(cd,{className:Ot("container",e),$fullWidth:!!n,children:[i&&a.jsx(sd,{variant:c,className:Ot("label",r==null?void 0:r.label),children:i}),a.jsx(pd,{...p,ref:l,rows:d,disabled:o,$variant:c,className:Ot("textarea",r==null?void 0:r.textarea)})]}),Mr=u.createContext(null),$t=3,Or={default:{background:"#374151",text:t.COLORS.white,border:"#374151"},success:{background:t.COLORS.green,text:t.COLORS.white,border:t.COLORS.green},warning:{background:t.COLORS.yellow,text:t.COLORS.white,border:t.COLORS.yellow},danger:{background:t.COLORS.red,text:t.COLORS.white,border:t.COLORS.red}},hd=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<$t?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,n=e.toasts.filter(l=>l.id!==o),i=e.queue[0];return i&&n.length<$t?{toasts:[...n,i],queue:e.queue.slice(1)}:{...e,toasts:n}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=$t?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},bd={toasts:[],queue:[]},St=e=>Or[e]??Or.default,gd=s.div`
1964
1923
  position: fixed;
1965
1924
  bottom: 24px;
1966
1925
  left: 24px;
@@ -2033,7 +1992,7 @@
2033
1992
  font-weight: 500;
2034
1993
  white-space: nowrap;
2035
1994
  margin-left: auto;
2036
- `,$r=({toast:e,onRemove:r})=>{const[o,i]=p.useState(!1),n=()=>{i(!0),setTimeout(()=>{r(e.id)},300)};return p.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{n()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(fd,{$variant:e.variant,$isExiting:o,children:[a.jsx(xd,{children:e.message}),a.jsx(Od,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},yd=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(gd,{children:e.map((n,l)=>l===i&&r>0?a.jsxs($d,{children:[a.jsx($r,{toast:n,onRemove:o}),a.jsxs(Sd,{children:["+",r]})]},n.id):a.jsx($r,{toast:n,onRemove:o},n.id))})},Cd=({children:e})=>{const[r,o]=p.useReducer(hd,bd),i=p.useCallback((l,c="default",d)=>{const u=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_TOAST",payload:{id:u,message:l,variant:c,duration:d}})},[]),n=p.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Mr.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(yd,{toasts:r.toasts,queueCount:r.queue.length,removeToast:n})]})},md=()=>{const e=p.useContext(Mr);if(!e)throw new Error("useToast must be used within ToastProvider");return e},Sr={dark:{background:t.COLORS.black,text:t.COLORS.white},light:{background:t.COLORS.white,text:t.COLORS.black,border:t.COLORS.gray},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white}},Ae=e=>Sr[e]??Sr.dark,vd=(e,r)=>{const o=Ae(r).background;switch(e){case"top":return`
1995
+ `,$r=({toast:e,onRemove:r})=>{const[o,n]=u.useState(!1),i=()=>{n(!0),setTimeout(()=>{r(e.id)},300)};return u.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{i()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(fd,{$variant:e.variant,$isExiting:o,children:[a.jsx(xd,{children:e.message}),a.jsx(Od,{onClick:i,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},yd=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const n=e.length-1;return a.jsx(gd,{children:e.map((i,l)=>l===n&&r>0?a.jsxs($d,{children:[a.jsx($r,{toast:i,onRemove:o}),a.jsxs(Sd,{children:["+",r]})]},i.id):a.jsx($r,{toast:i,onRemove:o},i.id))})},Cd=({children:e})=>{const[r,o]=u.useReducer(hd,bd),n=u.useCallback((l,c="default",d)=>{const p=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_TOAST",payload:{id:p,message:l,variant:c,duration:d}})},[]),i=u.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Mr.Provider,{value:{addToast:n,removeToast:i},children:[e,a.jsx(yd,{toasts:r.toasts,queueCount:r.queue.length,removeToast:i})]})},vd=()=>{const e=u.useContext(Mr);if(!e)throw new Error("useToast must be used within ToastProvider");return e},Sr={dark:{background:t.COLORS.black,text:t.COLORS.white},light:{background:t.COLORS.white,text:t.COLORS.black,border:t.COLORS.gray},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white}},Ae=e=>Sr[e]??Sr.dark,md=(e,r)=>{const o=Ae(r).background;switch(e){case"top":return`
2037
1996
  bottom: -12px;
2038
1997
  left: 50%;
2039
1998
  margin-left: -6px;
@@ -2107,7 +2066,7 @@
2107
2066
  width: 0;
2108
2067
  height: 0;
2109
2068
  border: 6px solid transparent;
2110
- ${vd(e.$placement,e.$variant)}
2069
+ ${md(e.$placement,e.$variant)}
2111
2070
  }
2112
2071
 
2113
2072
  ${e.$variant==="light"?`
@@ -2147,5 +2106,5 @@
2147
2106
  `,Ed=s.div`
2148
2107
  position: fixed;
2149
2108
  ${e=>Fr(e)}
2150
- `,yt=A.newClassNameGetter("tooltip"),ce=8,Pd=({children:e,className:r,classnames:o,content:i,delay:n=200,placement:l="top",portalRenderNode:c,ref:d,variant:u="dark",...b})=>{const[h,f]=p.useState(!1),[$,m]=p.useState(null),[S,x]=p.useState(l),[C,O]=p.useState({top:0,left:0}),y=p.useRef(null),g=p.useRef(null),L=p.useCallback(()=>{var T,F;if(!y.current)return;const P=y.current.getBoundingClientRect(),_=((T=g.current)==null?void 0:T.offsetWidth)??100,j=((F=g.current)==null?void 0:F.offsetHeight)??30,w=P.top-ce,M=window.innerHeight-P.bottom-ce,v=P.left-ce,I=window.innerWidth-P.right-ce;let k=l;if(l==="top"&&w<j&&M>w?k="bottom":l==="bottom"&&M<j&&w>M?k="top":l==="left"&&v<_&&I>v?k="right":l==="right"&&I<_&&v>I&&(k="left"),x(k),c){let B,H;switch(k){case"top":B=P.top-j-ce,H=P.left+P.width/2-_/2;break;case"bottom":B=P.bottom+ce,H=P.left+P.width/2-_/2;break;case"left":B=P.top+P.height/2-j/2,H=P.left-_-ce;break;case"right":B=P.top+P.height/2-j/2,H=P.right+ce;break;default:B=0,H=0}const E=8;H=Math.max(E,Math.min(H,window.innerWidth-_-E)),B=Math.max(E,Math.min(B,window.innerHeight-j-E)),O({top:B,left:H})}},[l,c]);p.useLayoutEffect(()=>{h&&L()},[h,L]);const z=()=>{const P=setTimeout(()=>{f(!0)},n);m(P)},N=()=>{$&&(clearTimeout($),m(null)),f(!1)},V=c?ge.createPortal(a.jsx(Ed,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:S,$variant:u,$visible:h,style:{top:C.top,left:C.left},children:i}),c):a.jsx(Ld,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:S,$variant:u,$visible:h,children:i});return a.jsxs(Rd,{...b,ref:P=>{y.current=P,typeof d=="function"?d(P):d&&(d.current=P)},className:yt("wrapper",r),onMouseEnter:z,onMouseLeave:N,children:[e,V]})};exports.Autocomplete=zo;exports.Button=De;exports.Card=Yo;exports.Checkbox=et;exports.CheckboxCard=Qo;exports.CheckboxGroup=oi;exports.Chip=Je;exports.ConfirmationProvider=fi;exports.Container=Si;exports.DatePicker=Ui;exports.Drawer=Ji;exports.Dropdown=nn;exports.EditableText=cn;exports.FieldLabel=ie;exports.FieldMessage=hn;exports.GlobalStyle=lo;exports.ImageCropper=Sa;exports.Input=Pr;exports.KeySymbol=yr;exports.KeysBindings=Cr;exports.Modal=zr;exports.MultiSelect=Da;exports.NotificationProvider=Ua;exports.OtpCode=Qa;exports.Panel=nl;exports.Progress=dl;exports.Radio=Lt;exports.RadioCard=$l;exports.RadioGroup=ml;exports.SaveProgressProvider=Rl;exports.Select=Dl;exports.Spinner=kt;exports.StatusCard=Gl;exports.Stepper=Jl;exports.Tabs=dd;exports.Tags=nd;exports.Textarea=ud;exports.ToastProvider=Cd;exports.Tooltip=Pd;exports.formatDateGo=vr;exports.useConfirmation=xi;exports.useImageCropper=Er;exports.useNotification=Xa;exports.useSaveProgress=kl;exports.useToast=md;
2109
+ `,yt=I.newClassNameGetter("tooltip"),ce=8,Pd=({children:e,className:r,classnames:o,content:n,delay:i=200,placement:l="top",portalRenderNode:c,ref:d,variant:p="dark",...b})=>{const[h,f]=u.useState(!1),[$,m]=u.useState(null),[O,x]=u.useState(l),[C,S]=u.useState({top:0,left:0}),y=u.useRef(null),g=u.useRef(null),L=u.useCallback(()=>{var z,B;if(!y.current)return;const P=y.current.getBoundingClientRect(),_=((z=g.current)==null?void 0:z.offsetWidth)??100,M=((B=g.current)==null?void 0:B.offsetHeight)??30,E=P.top-ce,A=window.innerHeight-P.bottom-ce,v=P.left-ce,N=window.innerWidth-P.right-ce;let R=l;if(l==="top"&&E<M&&A>E?R="bottom":l==="bottom"&&A<M&&E>A?R="top":l==="left"&&v<_&&N>v?R="right":l==="right"&&N<_&&v>N&&(R="left"),x(R),c){let F,H;switch(R){case"top":F=P.top-M-ce,H=P.left+P.width/2-_/2;break;case"bottom":F=P.bottom+ce,H=P.left+P.width/2-_/2;break;case"left":F=P.top+P.height/2-M/2,H=P.left-_-ce;break;case"right":F=P.top+P.height/2-M/2,H=P.right+ce;break;default:F=0,H=0}const k=8;H=Math.max(k,Math.min(H,window.innerWidth-_-k)),F=Math.max(k,Math.min(F,window.innerHeight-M-k)),S({top:F,left:H})}},[l,c]);u.useLayoutEffect(()=>{h&&L()},[h,L]);const T=()=>{const P=setTimeout(()=>{f(!0)},i);m(P)},j=()=>{$&&(clearTimeout($),m(null)),f(!1)},Y=c?ge.createPortal(a.jsx(Ed,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:O,$variant:p,$visible:h,style:{top:C.top,left:C.left},children:n}),c):a.jsx(Ld,{ref:g,className:yt("content",o==null?void 0:o.content),$placement:O,$variant:p,$visible:h,children:n});return a.jsxs(Rd,{...b,ref:P=>{y.current=P,typeof d=="function"?d(P):d&&(d.current=P)},className:yt("wrapper",r),onMouseEnter:T,onMouseLeave:j,children:[e,Y]})};exports.Autocomplete=jo;exports.Button=De;exports.Card=Yo;exports.Checkbox=et;exports.CheckboxCard=Qo;exports.CheckboxGroup=oi;exports.Chip=Je;exports.ConfirmationProvider=fi;exports.Container=Si;exports.DatePicker=Ui;exports.Drawer=Ji;exports.Dropdown=nn;exports.EditableText=cn;exports.FieldLabel=ie;exports.FieldMessage=hn;exports.GlobalStyle=lo;exports.ImageCropper=Sa;exports.Input=Pr;exports.KeySymbol=yr;exports.KeysBindings=Cr;exports.Modal=jr;exports.MultiSelect=Da;exports.NotificationProvider=Ua;exports.OtpCode=Qa;exports.Panel=nl;exports.Progress=dl;exports.Radio=Lt;exports.RadioCard=$l;exports.RadioGroup=vl;exports.SaveProgressProvider=Rl;exports.Select=Dl;exports.Spinner=kt;exports.StatusCard=Gl;exports.Stepper=Jl;exports.Tabs=dd;exports.Tags=nd;exports.Textarea=ud;exports.ToastProvider=Cd;exports.Tooltip=Pd;exports.formatDateGo=mr;exports.useConfirmation=xi;exports.useImageCropper=Er;exports.useNotification=Xa;exports.useSaveProgress=kl;exports.useToast=vd;
2151
2110
  //# sourceMappingURL=index.cjs.map