aha-components 1.8.4 → 1.8.5
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/Avatar.esm.js +1 -1
- package/dist/Avatar.esm.js.map +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/Badge.esm.js +1 -1
- package/dist/Badge.esm.js.map +1 -1
- package/dist/Badge.js +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Button.esm.js +1 -1
- package/dist/Button.esm.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.esm.js +1 -1
- package/dist/Checkbox.esm.js.map +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/Input.esm.js +1 -1
- package/dist/Input.esm.js.map +1 -1
- package/dist/Input.js +1 -1
- package/dist/Input.js.map +1 -1
- package/dist/Loading.esm.js +1 -1
- package/dist/Loading.esm.js.map +1 -1
- package/dist/Loading.js +1 -1
- package/dist/Loading.js.map +1 -1
- package/dist/Pagination.esm.js +1 -1
- package/dist/Pagination.esm.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/Popover.esm.js +1 -1
- package/dist/Popover.esm.js.map +1 -1
- package/dist/Popover.js +1 -1
- package/dist/Popover.js.map +1 -1
- package/dist/Radio.esm.js +1 -1
- package/dist/Radio.esm.js.map +1 -1
- package/dist/Radio.js +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/Table.esm.js +1 -1
- package/dist/Table.esm.js.map +1 -1
- package/dist/Table.js +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/Textarea.esm.js +1 -1
- package/dist/Textarea.esm.js.map +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.js.map +1 -1
- package/dist/components/Badge/index.d.ts +2 -1
- package/dist/components/shared/badgeColors.d.ts +25 -0
- package/dist/components/shared/buttonStyles.d.ts +18 -0
- package/dist/components/shared/colorUtils.d.ts +6 -0
- package/dist/components/shared/controlStyles.d.ts +27 -0
- package/dist/components/shared/fieldStyles.d.ts +37 -0
- package/dist/index.css +1924 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.esm.css +1924 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tokens.d.ts +14 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function s(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var d={primaryColor:"#FB6011"},c=t.createContext(d),u=function(){var e=t.useContext(c);return e||d},p={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},f={default:"default",primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link"},h={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},x=function(t){var n=t.size,o=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:o,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},g=function(n){var o=n.children,a=n.type,l=void 0===a?"default":a,s=n.size,d=void 0===s?"md":s,c=n.disabled,g=void 0!==c&&c,v=n.loading,m=void 0!==v&&v,b=n.iconOnly,y=n.focused,w=void 0!==y&&y,C=n.onClick,k=n.htmlType,F=void 0===k?"button":k,j=n.className,S=void 0===j?"":j,D=n.style,z=n.icon,M=n.iconPosition,E=void 0===M?"left":M,L=i(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),T=u().primaryColor,B=t.useState(!1),A=B[0],R=B[1],I=t.useState(!1),W=I[0],N=I[1],H=f[l]||"default",Y=h[p[d]||"md"],O=null!=b?b:!!z&&null==o,P="link-color"===H||"link-gray"===H||"destructive-link"===H,V=g||m,q=w,_=T,X=function(){if(g)return"default"===H||"primary"===H||"secondary"===H||"destructive-primary"===H||"destructive-secondary"===H?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=A||W;return"default"===H?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-brand-secondary, #ec470a)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-brand-secondary_alt, #fb6011)":"var(--color-fg-quaternary, #a9a29d)",border:e?"1px solid var(--color-border-brand, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",boxShadow:"none"}:"primary"===H?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":_||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===H?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===H?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===H?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===H?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===H?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===H?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===H?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),Z=function(){if(q)return"destructive-primary"===H||"destructive-secondary"===H||"destructive-tertiary"===H||"destructive-link"===H?"destructive-primary"===H||"destructive-secondary"===H?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===H||"secondary"===H?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),K=r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Y.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:Y.fontSize,lineHeight:"".concat(Y.lineHeight,"px"),cursor:V?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:X.bg,color:X.color,border:X.border,boxShadow:null!=Z?Z:X.boxShadow,textDecoration:X.textDecoration},D);P?(K.borderRadius="4px",K.overflow="hidden",O?(K.width=Y.height,K.height=Y.height,K.padding=0):(K.height=Y.height,K.paddingLeft=Y.paddingX,K.paddingRight=Y.paddingX)):(K.borderRadius="var(--radius-md, 8px)",O?(K.width=Y.height,K.height=Y.height,K.padding=0):(K.height=Y.height,K.paddingLeft=Y.paddingX,K.paddingRight=Y.paddingX));var G=function(){return m?e.jsx(x,{size:Y.iconSize,color:X.iconColor}):z?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:Y.iconSize,height:Y.iconSize,color:X.iconColor,flexShrink:0},children:z}):null},J=m||z&&"left"===E,U=!m&&z&&"right"===E;return e.jsxs("button",r({type:F,className:["aha-button","aha-button--".concat(H),"aha-button--".concat(p[d]||"md"),O&&"aha-button--icon-only",V&&"aha-button--disabled",m&&"aha-button--loading",q&&"aha-button--focused",S].filter(Boolean).join(" "),disabled:V,onClick:function(e){V?e.preventDefault():null==C||C(e)},onMouseEnter:function(){return!V&&R(!0)},onMouseLeave:function(){R(!1),N(!1)},onMouseDown:function(){return!V&&N(!0)},onMouseUp:function(){return N(!1)},style:K},L,{children:[J&&G(),!O&&o,U&&G(),O&&!z&&!m&&o]}))};g.displayName="Button";var v={success:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},m=e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),b={success:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},y=function(t){var n=t.className;return e.jsx("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},w=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return s([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),C=new w,k=function(){var n=t.useState([]),o=n[0],i=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=C.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=C.subscribe(function(){var e=C.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=o.filter(function(e){return"top-left"===e.props.position}),l=o.filter(function(e){return"top-right"===e.props.position}),s=o.filter(function(e){return"bottom-left"===e.props.position}),d=o.filter(function(e){return"bottom-right"===e.props.position});return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e.jsx(F,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:l.map(function(t){return e.jsx(F,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e.jsx(F,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:d.map(function(t){return e.jsx(F,r({},t),t.id)})})]})},F=function(n){var o=n.id,r=n.props,i=t.useState(!1),a=i[0],l=i[1],s=t.useState(!1),d=s[0],c=s[1],u=r.message,p=r.type,f=void 0===p?"info":p,h=r.duration,x=void 0===h?3e3:h,g=r.icon,v=r.action,m=r.showClose,w=void 0===m||m,k=r.onClose,F=r.onClick;r.className;var j=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:b.success};case"error":return{bgColor:"#E7000B",defaultIcon:b.error};case"question":return{bgColor:"#1C1917",defaultIcon:b.question};default:return{bgColor:"#1447E6",defaultIcon:b.info}}}(f);t.useEffect(function(){var e=setTimeout(function(){l(!0)},10);return function(){return clearTimeout(e)}},[]),t.useEffect(function(){if(x>0){var e=setTimeout(function(){S()},x);return function(){return clearTimeout(e)}}},[x,o]);var S=t.useCallback(function(){c(!0),setTimeout(function(){C.removeToast(o),null==k||k()},300)},[o,k]),D=t.useCallback(function(){null==F||F()},[F]);return e.jsx("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!d?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!d?1:0,transition:"all 300ms ease-out",position:"relative",cursor:F?"pointer":"default"},onClick:D,children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:j.bgColor,color:"white"},children:[e.jsx("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:g||j.defaultIcon}),e.jsxs("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e.jsx("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:u}),v&&e.jsx("div",{style:{marginTop:"12px"},children:v})]}),w&&e.jsx("button",{onClick:function(e){e.stopPropagation(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e.jsx(y,{})})]})})},j=function(e){return console.log("Toast: 调用 toast 函数",e),M(),setTimeout(function(){var t=C.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},S=null,D=null,z=!1,M=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(z)console.log("Toast: 容器正在初始化中,跳过");else if(S)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),z=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),S=t,void(z=!1);console.log("Toast: 创建容器元素"),(S=document.createElement("div")).id="aha-toast-container",document.body.appendChild(S),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),D=n(S),console.log("Toast: 渲染 ToastContainer 组件"),D.render(e.jsx(k,{})),console.log("Toast: 容器渲染完成"),z=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),D=n(S),console.log("Toast: 渲染 ToastContainer 组件"),D.render(e.jsx(k,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}z=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),z=!1})}}catch(e){console.error("Toast: 创建容器失败",e),z=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},E={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},L={sm:{basePx:8,basePy:3,plCheckbox:5,plAvatar:4,plDot:6,plIcon:4,prClose:4,prCount:4,fontSize:12,lineHeight:"18px",height:24,avatarSize:16,checkboxSize:14,contentGap:4,rootGap:3,countPx:4,countFontSize:12,closeSize:10,closePad:2},md:{basePx:9,basePy:2,plCheckbox:4,plAvatar:5,plDot:7,plIcon:5,prClose:4,prCount:3,fontSize:14,lineHeight:"20px",height:24,avatarSize:16,checkboxSize:16,contentGap:5,rootGap:4,countPx:5,countFontSize:12,closeSize:12,closePad:2},lg:{basePx:10,basePy:4,plCheckbox:5,plAvatar:7,plDot:9,plIcon:7,prClose:4,prCount:4,fontSize:14,lineHeight:"20px",height:28,avatarSize:18,checkboxSize:18,contentGap:6,rootGap:4,countPx:6,countFontSize:14,closeSize:14,closePad:3}},T=function(n){var o=n.src,r=n.alt,i=void 0===r?"Avatar":r,a=n.size,l=void 0===a?16:a,s=t.useState(!1),d=s[0],c=s[1];return e.jsx("div",{style:{width:l,height:l,borderRadius:"50%",overflow:"hidden",flexShrink:0,border:"0.667px solid rgba(0,0,0,0.08)",background:"#e5e5e4",display:"flex",alignItems:"center",justifyContent:"center"},children:o&&!d?e.jsx("img",{src:o,alt:i,onError:function(){return c(!0)},style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):e.jsxs("svg",{width:.625*l,height:.625*l,viewBox:"0 0 10 10",fill:"none",children:[e.jsx("circle",{cx:"5",cy:"3.5",r:"2",stroke:"#999",strokeWidth:"1.2"}),e.jsx("path",{d:"M1 9.5c0-2.2 1.8-4 4-4s4 1.8 4 4",stroke:"#999",strokeWidth:"1.2",strokeLinecap:"round"})]})})},B=function(n){var o=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,d=n.size,c=void 0===d?"md":d,p=n.stroke,f=void 0!==p&&p,h=n.iconType,x=n.icon,g=n.avatarSrc,v=n.dotColor,m=n.action,b=void 0===m?"none":m,y=n.count,w=n.onClose,C=n.checkbox,k=void 0!==C&&C,F=n.checked,j=n.onCheckedChange,S=n.iconPosition,D=n.className,z=void 0===D?"":D,M=n.onClick,B=i(n,["children","color","variant","size","stroke","iconType","icon","avatarSrc","dotColor","action","count","onClose","checkbox","checked","onCheckedChange","iconPosition","className","onClick"]),A=u().primaryColor,R=t.useState(!1),I=R[0],W=R[1],N=function(e){return"large"===e?"lg":"small"===e?"sm":e}(c),H=L[N],Y=void 0!==F?F:I,O=null!=h?h:x&&"leading"===S?"icon":"none",P="none"!==b?b:void 0,V=k?H.plCheckbox:"dot"===O?H.plDot:"avatar"===O||"icon"===O?H.plAvatar:H.basePx,q="x-close"===P?H.prClose:"count"===P?H.prCount:H.basePx,_={display:"inline-flex",alignItems:"center",gap:"x-close"===P?H.rootGap:0,paddingLeft:V,paddingRight:q,paddingTop:H.basePy,paddingBottom:H.basePy,height:H.height,borderRadius:6,fontFamily:"DM Sans, sans-serif",fontWeight:500,fontSize:H.fontSize,lineHeight:H.lineHeight,transition:"all 0.2s",cursor:M?"pointer":"default",boxSizing:"border-box",backgroundColor:"#ffffff",color:"#44403c",outline:"1px solid #d7d3d0",outlineOffset:"-1px"};if(a){var X=function(e,t){if(e in E){var n=E[e];return"Orange"===e&&t?r(r({},n),{fill:r(r({},n.fill),{bg:t})}):n}if(e.startsWith("#")){var o=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return{light:{bg:"rgba(".concat(o,",").concat(i,",").concat(a,",0.1)"),text:e,border:"rgba(".concat(o,",").concat(i,",").concat(a,",0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return E.Gray}(a,A);"light"===s?(_.backgroundColor=X.light.bg,_.color=X.light.text,_.outline=f?"1px solid ".concat(function(e){var t={Green:"#A4F4CF",Red:"#FFC9C9",Orange:"#FFD1A9",Blue:"#BEDBFF",Yellow:"#FFD1A9",Cyan:"#A2F4FD",Violet:"#DDD6FF",Pink:"#FCCEE8",Gray:"#E7E5E4"};if(e in t)return t[e];if(e.startsWith("#")){var n=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"rgba(".concat(n,",").concat(o,",").concat(r,",0.3)")}return"#E7E5E4"}(a)):"none",_.outlineOffset=f?"-1px":void 0):(_.backgroundColor=X.fill.bg,_.color=X.fill.text,_.outline="none")}M&&(_.cursor="pointer");return e.jsxs("div",r({className:z,style:_,onClick:M},B,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:H.contentGap,flexShrink:0},children:[k&&e.jsx("div",{role:"checkbox","aria-checked":Y,onClick:function(e){e.stopPropagation();var t=!Y;void 0===F&&W(t),null==j||j(t)},style:{width:H.checkboxSize,height:H.checkboxSize,borderRadius:4,flexShrink:0,border:Y?"none":"1px solid #d7d3d0",background:Y?A||"#7F56D9":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:Y&&e.jsx("svg",{width:Math.round(.65*H.checkboxSize),height:Math.round(.65*H.checkboxSize),viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M8.5 2L4 7.5 1.5 5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),"avatar"===O?e.jsx(T,{src:g,size:H.avatarSize}):"dot"===O?e.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:4,cy:4,r:3.5,fill:v||"currentColor"})}):"icon"===O&&x?e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0},children:t.cloneElement(x,{width:H.avatarSize,height:H.avatarSize})}):null,e.jsx("span",{style:{whiteSpace:"nowrap"},children:o}),"count"===P&&"number"==typeof y&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingLeft:H.countPx,paddingRight:H.countPx,paddingTop:1,paddingBottom:1,background:"rgba(0,0,0,0.07)",borderRadius:3,fontSize:H.countFontSize,fontWeight:500,lineHeight:"16px",flexShrink:0},children:y})]}),"x-close"===P&&e.jsx("button",{"aria-label":"Remove",onClick:function(e){e.stopPropagation(),null==w||w()},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:H.closePad,borderRadius:3,border:"none",background:"transparent",cursor:"pointer",flexShrink:0,color:"inherit",opacity:.55,lineHeight:0},children:e.jsx("svg",{width:H.closeSize,height:H.closeSize,viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M7.5 2.5l-5 5M2.5 2.5l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),"after"===S&&x&&!h&&e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0,marginLeft:H.contentGap},children:x})]}))},A="var(--shadow-xs)",R={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}},I=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"mediumSmall":a,s=n.error,d=void 0!==s&&s,c=n.disabled,u=void 0!==c&&c,p=n.readOnly,f=void 0!==p&&p,h=n.prefix,x=n.suffix,g=n.leadingText,v=n.trailingText,m=n.leadingAddon,b=n.trailingAddon,y=n.className,w=void 0===y?"":y,C=n.style,k=n.onFocus,F=n.onBlur,j=n.onKeyDown,S=n.onPressEnter,D=n.value,z=n.defaultValue,M=n.onChange,E=n.placeholder,L=n.type,T=void 0===L?"text":L,B=n.label,I=n.required,W=n.hintText,N=i(n,["size","error","disabled","readOnly","prefix","suffix","leadingText","trailingText","leadingAddon","trailingAddon","className","style","onFocus","onBlur","onKeyDown","onPressEnter","value","defaultValue","onChange","placeholder","type","label","required","hintText"]),H=t.useRef(null),Y=t.useState(!1),O=Y[0],P=Y[1],V=t.useState(null!=z?z:""),q=V[0],_=V[1];t.useEffect(function(){"function"==typeof o?o(H.current):o&&(o.current=H.current)},[o]);var X=void 0!==D,Z=X?D:q,K=u?{border:"1px solid var(--color-border-disabled)",boxShadow:A,outline:"none"}:d&&O?{border:"1px solid var(--color-border-error)",boxShadow:A,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:d?{border:"1px solid var(--color-border-error_subtle)",boxShadow:A,outline:"none"}:O?{border:"1px solid var(--color-border-brand)",boxShadow:A,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:A,outline:"none"},G=K.border,J=K.boxShadow,U=K.outline,Q=K.outlineOffset,$=R[l],ee=$.pt,te=$.pb,ne=u?"var(--color-border-disabled)":"var(--color-border-primary)",oe=!!h,re=!!x,ie={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:u?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1,pointerEvents:"none"},ae={display:"flex",alignItems:"center",paddingTop:ee,paddingBottom:te,paddingLeft:"14px",paddingRight:"12px",color:"var(--color-text-tertiary)",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",whiteSpace:"nowrap",flexShrink:0,backgroundColor:u?"var(--color-bg-disabled_subtle)":"transparent"},le=e.jsxs("div",{className:"aha-input-group ".concat(w),style:r({display:"flex",alignItems:"stretch",width:"100%",border:G,boxShadow:J,outline:U,outlineOffset:Q,borderRadius:"var(--radius-md)",backgroundColor:u||f?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",overflow:"hidden",boxSizing:"border-box",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},C),children:[void 0!==g&&e.jsx("div",{style:r(r({},ae),{borderRight:"1px solid ".concat(ne)}),children:g}),void 0!==m&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(ne)},children:m}),e.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[oe&&e.jsx("span",{style:r(r({},ie),{left:"14px"}),children:h}),e.jsx("input",r({ref:H,type:T,value:Z,placeholder:E,disabled:u,readOnly:f,onChange:function(e){X||_(e.target.value),null==M||M(e)},onFocus:function(e){P(!0),null==k||k(e)},onBlur:function(e){P(!1),null==F||F(e)},onKeyDown:function(e){"Enter"===e.key&&S&&S(e),null==j||j(e)},style:{flex:1,border:"none",outline:"none",width:"100%",boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",backgroundColor:"transparent",color:u?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ee,paddingBottom:te,paddingLeft:oe?"40px":"14px",paddingRight:re?"40px":"14px"},autoComplete:N.autoComplete||"off"},N)),re&&e.jsx("span",{style:r(r({},ie),{right:"14px"}),children:x})]}),void 0!==v&&e.jsx("div",{style:r(r({},ae),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(ne)}),children:v}),void 0!==b&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(ne)},children:b})]});if(!B&&!W)return le;var se={margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:d?"var(--color-error-600)":"var(--color-text-tertiary)"};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[B&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[B,I&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),le,W&&e.jsx("p",{style:se,children:W})]})});I.displayName="InputGroup";var W="var(--shadow-xs)",N={small:"4px",mediumSmall:"6px",medium:"8px",large:"10px"},H={small:"sm",mediumSmall:"sm",medium:"md",large:"lg"},Y=function(n){var o=n.value,i=n.defaultValue,a=void 0===i?[]:i,l=n.onChange,d=n.placeholder,c=void 0===d?"Add tag...":d,u=n.disabled,p=void 0!==u&&u,f=n.error,h=void 0!==f&&f,x=n.size,g=void 0===x?"mediumSmall":x,v=n.className,m=void 0===v?"":v,b=n.style,y=n.label,w=n.required,C=n.hintText,k=t.useState(a),F=k[0],j=k[1],S=t.useState(""),D=S[0],z=S[1],M=t.useState(!1),E=M[0],L=M[1],T=t.useRef(null),A=void 0!==o,R=A?o:F,I=function(e){A||j(e),null==l||l(e)},Y=function(e){var t=e.trim();t&&!R.includes(t)&&(I(s(s([],R,!0),[t],!1)),z(""))},O=function(e){I(R.filter(function(t,n){return n!==e}))},P=p?{border:"1px solid var(--color-border-disabled)",boxShadow:W,outline:"none"}:h&&E?{border:"1px solid var(--color-border-error)",boxShadow:W,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:h?{border:"1px solid var(--color-border-error_subtle)",boxShadow:W,outline:"none"}:E?{border:"1px solid var(--color-border-brand)",boxShadow:W,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:W,outline:"none"},V=P.border,q=P.boxShadow,_=P.outline,X=P.outlineOffset,Z=N[g],K=H[g],G=e.jsxs("div",{className:"aha-input-tags ".concat(m),onClick:function(){var e;return null===(e=T.current)||void 0===e?void 0:e.focus()},style:r({display:"flex",flexWrap:"wrap",alignItems:"center",gap:"6px",padding:Z,border:V,boxShadow:q,outline:_,outlineOffset:X,borderRadius:"var(--radius-md)",backgroundColor:p?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",boxSizing:"border-box",width:"100%",transition:"border-color 0.15s ease, box-shadow 0.15s ease",cursor:p?"not-allowed":"text"},b),children:[R.map(function(t,n){return e.jsx(B,{size:K,action:p?"none":"x-close",onClose:function(){return O(n)},children:t},n)}),e.jsx("input",{ref:T,value:D,onChange:function(e){return z(e.target.value)},onKeyDown:function(e){"Enter"!==e.key&&","!==e.key||!D||(e.preventDefault(),Y(D)),"Backspace"===e.key&&!D&&R.length>0&&O(R.length-1)},onFocus:function(){return L(!0)},onBlur:function(){L(!1),D&&Y(D)},disabled:p,placeholder:0===R.length?c:"",style:{flex:1,minWidth:"80px",border:"none",outline:"none",padding:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",color:p?"var(--color-text-disabled)":"var(--color-text-primary)",backgroundColor:"transparent"}}),e.jsx("style",{children:"\n .aha-input-tags input::placeholder { color: var(--color-text-placeholder); }\n "})]});return y||C?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[y&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[y,w&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),G,C&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:h?"var(--color-error-600)":"var(--color-text-tertiary)"},children:C})]}):G},O={small:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},mediumSmall:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},medium:{height:"44px",paddingTop:"9px",paddingBottom:"9px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},P="var(--shadow-xs)",V=function(t){var n=t.onClick;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:n,style:{cursor:"pointer",flexShrink:0},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},q=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"mediumSmall":a,s=n.disabled,d=void 0!==s&&s,c=n.error,u=void 0!==c&&c,p=n.readOnly,f=void 0!==p&&p,h=n.prefix,x=n.suffix,g=n.allowClear,v=void 0!==g&&g,m=n.onClear,b=n.className,y=void 0===b?"":b,w=n.style,C=n.type,k=void 0===C?"text":C,F=n.placeholder,j=n.value,S=n.defaultValue,D=n.onChange,z=n.onFocus,M=n.onBlur,E=n.onPressEnter,L=n.label,T=n.required,B=n.hintText,A=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),R=t.useRef(null),I=t.useState(S||j||""),W=I[0],N=I[1],H=t.useState(!1),Y=H[0],q=H[1];t.useEffect(function(){"function"==typeof o?o(R.current):o&&(o.current=R.current)},[o]);var _=void 0!==j,X=_?j:W,Z=v&&X&&!d,K=d?{border:"1px solid var(--color-border-disabled)",boxShadow:P,outline:"none"}:u&&Y?{border:"1px solid var(--color-border-error)",boxShadow:P,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:u?{border:"1px solid var(--color-border-error_subtle)",boxShadow:P,outline:"none"}:Y?{border:"1px solid var(--color-border-brand)",boxShadow:P,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:P,outline:"none"},G=K.border,J=K.boxShadow,U=K.outline,Q=K.outlineOffset,$=O[l],ee=$.height,te=$.paddingTop,ne=$.paddingBottom,oe=r({width:"100%",height:ee,boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",borderRadius:"var(--radius-md)",border:G,boxShadow:J,backgroundColor:d||f?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",color:d?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:te,paddingBottom:ne,paddingLeft:h?"40px":"14px",paddingRight:x||Z?"40px":"14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",outline:U,outlineOffset:Q,WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},w),re={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:d?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1},ie=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: var(--color-text-placeholder);\n font-size: var(--font-size-text-md);\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input::-moz-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input:-ms-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] { -moz-appearance: textfield; }\n '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(y),style:{position:"relative",display:"block",width:"100%"},children:[h&&e.jsx("span",{style:r(r({},re),{left:"14px",pointerEvents:"none"}),children:h}),e.jsx("input",r({ref:R,type:k,value:X,placeholder:F,disabled:d,readOnly:f,onChange:function(e){_||N(e.target.value),null==D||D(e)},onFocus:function(e){q(!0),null==z||z(e)},onBlur:function(e){q(!1),null==M||M(e)},onKeyDown:function(e){var t;"Enter"===e.key&&E&&E(e),null===(t=A.onKeyDown)||void 0===t||t.call(A,e)},style:oe,autoComplete:A.autoComplete||"off",autoCorrect:A.autoCorrect||"off",autoCapitalize:A.autoCapitalize||"off",spellCheck:A.spellCheck||!1},A)),(x||Z)&&e.jsxs("span",{style:r(r({},re),{right:"14px",gap:"var(--spacing-xs)"}),children:[Z&&e.jsx(V,{onClick:function(e){var t;e.stopPropagation(),_||N("");null==D||D({target:{value:""},currentTarget:{value:""}}),null==m||m(),null===(t=R.current)||void 0===t||t.focus()}}),x]})]})]});return L||B?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[L&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[L,T&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),ie,B&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:u?"var(--color-error-600)":"var(--color-text-tertiary)"},children:B})]}):ie});q.displayName="Input";var _=function(o){var i,a=o.value,l=o.defaultValue,d=o.options,c=void 0===d?[]:d,p=o.mode,f=o.disabled,h=void 0!==f&&f,x=o.error,g=void 0!==x&&x,v=o.placeholder,m=void 0===v?"Please select":v,b=o.size,y=void 0===b?"medium":b,w=o.showSearch,C=void 0!==w&&w,k=o.filterOption,F=void 0===k||k,j=o.allowClear,S=void 0!==j&&j,D=o.onChange,z=o.onSelect,M=o.onDeselect,E=o.onSearch,L=o.onFocus,T=o.onBlur,B=o.onDropdownVisibleChange,A=o.className,R=void 0===A?"":A,I=o.style,W=o.dropdownClassName,N=void 0===W?"":W,H=o.dropdownStyle,Y=o.defaultOpen,O=void 0!==Y&&Y,P=o.open,V=o.maxTagCount,q=o.tagRender,_=o.optionRender,X=u().primaryColor,Z=void 0===X?"#FB6011":X,K=t.useState(void 0!==l?l:p?[]:void 0),G=K[0],J=K[1],U=t.useState(O),Q=U[0],$=U[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),re=oe[0],ie=oe[1],ae=t.useRef(null),le=t.useRef(null),se=t.useRef(null),de=t.useState(null),ce=de[0],ue=de[1],pe=void 0!==a,fe=void 0!==P,he=pe?a:G,xe=fe?P:Q,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!he)return[];var e=Array.isArray(he)?he:[he];return c.filter(function(t){return e.includes(t.value)})},[he,c]),me=t.useCallback(function(){return C&&te?!1===F?c:"function"==typeof F?c.filter(function(e){return F(te,e)}):c.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):c},[c,te,C,F]),be=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&ae.current){var e=function(){var e,t;if(ae.current){var n=ae.current.getBoundingClientRect(),o=null!==(t=null===(e=se.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*be.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-4:n.bottom+window.scrollY+4;ue({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}ue(null)},[xe,be.length]),t.useEffect(function(){var e=function(e){var t=e.target;ae.current&&!ae.current.contains(t)&&se.current&&!se.current.contains(t)&&(fe||$(!1),null==B||B(!1),ne(""))};if(xe)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[xe,fe,B]),t.useEffect(function(){if(xe){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),ie(function(e){return e<be.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ie(function(e){return e>0?e-1:0});else if("Enter"===e.key&&re>=0){e.preventDefault();var n=be[re];n&&!n.disabled&&ye(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==B||B(!1),null===(t=ae.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,be,re,fe,B]),t.useEffect(function(){if(re>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var ye=t.useCallback(function(e){var t;if(!e.disabled)if(ge){var n,o=Array.isArray(he)?he:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==M||M(e.value,e)):(n=s(s([],o,!0),[e.value],!1),null==z||z(e.value,e)),pe||J(n);var r=c.filter(function(e){return n.includes(e.value)});null==D||D(n,r)}else pe||J(e.value),null==D||D(e.value,e),null==z||z(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,he,pe,fe,c,D,z,M,B]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(he)){var n=he.filter(function(e){return e!==t}),o=c.find(function(e){return e.value===t});pe||J(n),null==D||D(n,ve()),null==M||M(t,o)}},[ge,he,pe,c,D,M,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||J(t),null==D||D(t,[]),ne("")},ke={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Fe=t.useMemo(function(){return ve()},[ve]),je=t.useMemo(function(){return S&&he&&!h},[S,he,h]),Se=t.useMemo(function(){return ge?Array.isArray(he)&&he.length>0:null!=he&&""!==he},[ge,he]),De=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===V?Fe.slice(0,2):V?Fe.slice(0,V):Fe,o=V&&Fe.length>n.length?Fe.length-n.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var o={label:n.label,value:n.value,closable:!h,onClose:function(){return we({},n.value)}};return q?e.jsx(t.Fragment,{children:q(o)},n.value):e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!h&&e.jsx("span",{onClick:function(e){return we(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ge,he,Fe,V,h,q]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:ae,className:"aha-select ".concat(R),style:r({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":xe?Z:"#D7D3D0"),backgroundColor:h?"#FAFAF9":"#FFFFFF",cursor:h?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:ke[y].paddingTop,paddingBottom:ke[y].paddingBottom,fontSize:ke[y].fontSize,lineHeight:ke[y].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},I),onClick:function(){if(!h){var e=!xe;fe||$(e),null==B||B(e),e&&C?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==L||L(e)},onBlur:function(e){null==T||T(e)},onTouchStart:function(e){h||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:h?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?De||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):C&&xe?e.jsx("input",{ref:le,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==E||E(t),ie(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:h?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Se?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Se?h?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Se?(null===(i=Fe[0])||void 0===i?void 0:i.label)||he:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[je&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ce,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(t){var n=t.isOpen;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:xe})]})]}),xe&&ce&&n.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(N),style:r({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===ce.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ce.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},H),children:0===be.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):be.map(function(t,n){var o=ge?Array.isArray(he)&&he.includes(t.value):he===t.value,r=n===re;return _?e.jsx("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&ye(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:_(t,{selected:o,focused:r,disabled:t.disabled||!1})},t.value):e.jsxs("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return ye(t)},style:{padding:"8px 16px",cursor:t.disabled?"not-allowed":"pointer",color:t.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e.jsx("span",{children:t.label}),o&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:Z,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};_.displayName="Select";var X=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},Z=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},K=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},G=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},J=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},U=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("g",{clipPath:"url(#clip0_54_1653)",children:e.jsx("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_54_1653",children:e.jsx("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},Q=function(n){var o=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,d=n.pageSize,c=n.defaultPageSize,p=void 0===c?10:c,f=n.showSizeChanger,h=void 0!==f&&f,x=n.pageSizeOptions,v=void 0===x?["10","20","50","100"]:x,m=n.showQuickJumper,b=void 0!==m&&m,y=n.showTotal,w=n.onChange,C=n.onShowSizeChange,k=n.simple,F=void 0!==k&&k,j=n.disabled,S=void 0!==j&&j,D=n.hideOnSinglePage,z=void 0!==D&&D,M=n.className,E=void 0===M?"":M,L=n.style,T=n.size,B=void 0===T?"default":T,A=n.responsive,R=void 0!==A&&A;n.showLessItems;var I=n.itemRender,W=u().primaryColor,N=void 0===W?"#FB6011":W,H=t.useState(a),Y=H[0],O=H[1],P=t.useState(p),V=P[0],X=P[1],Z=t.useState(""),K=Z[0],U=Z[1],Q=null!=o?o:Y,$=null!=d?d:V,ee=t.useMemo(function(){return Math.ceil(s/$)},[s,$]);t.useEffect(function(){void 0!==o&&O(o)},[o]),t.useEffect(function(){void 0!==d&&X(d)},[d]);var te=function(e){e<1||e>ee||e===Q||S||(void 0===o&&O(e),null==w||w(e,$))},ne=function(){var e=parseInt(K,10);e>=1&&e<=ee&&(te(e),U(""))};if(z&&ee<=1)return null;if(F)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(E),style:L,children:[e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===B?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(G,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ee]}),e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===B?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(J,{})})]});var oe=(Q-1)*$+1,re=Math.min(Q*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(E),style:r({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:R?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},L),children:[y&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:y(s,[oe,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:I?I(Q-1,"prev",e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(G,{})})):e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(G,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ee)}else if(Q>=ee-3){e.push(1),e.push("jump-prev");for(t=ee-4;t<=ee;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ee)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e.jsx(g,{onClick:function(){return te(t)},disabled:S,type:n?"primary":"default",size:"default"===B?"medium":"small",style:{minWidth:"small"===B?"32px":"36px",height:"small"===B?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(N):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return I?I(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(g,{onClick:function(){return te(Math.max(1,Q-5))},disabled:S,type:"default",size:"default"===B?"medium":"small",style:{minWidth:"small"===B?"32px":"36px",height:"small"===B?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),I?I(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(g,{onClick:function(){return te(Math.min(ee,Q+5))},disabled:S,type:"default",size:"default"===B?"medium":"small",style:{minWidth:"small"===B?"32px":"36px",height:"small"===B?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),I?I(Q+5,"jump-next",o):o;return null}(t)})}),s>0&&e.jsx(e.Fragment,{children:I?I(Q+1,"next",e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(J,{})})):e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(J,{})})}),h&&e.jsx(_,{value:$,options:v.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(s/t),r=Q>n?n:Q,void 0===d&&X(t),void 0===o&&O(r),null==C||C(r,t),void(null==w||w(r,t));var t,n,r},disabled:S,size:"small"===B?"small":"medium",style:{minWidth:"small"===B?80:96}}),b&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(q,{type:"number",min:1,value:K,onChange:function(e){return U(e.target.value)},onPressEnter:ne,disabled:S,size:"small"===B?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof b&&b.goButton?e.jsx(g,{onClick:ne,disabled:S,type:"default",size:"default"===B?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:b.goButton}):e.jsx(g,{onClick:ne,disabled:S,type:"default",size:"default"===B?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},$=function(n){var o=n.checked,i=void 0!==o&&o,a=n.indeterminate,l=void 0!==a&&a,s=n.disabled,d=void 0!==s&&s,c=n.onChange,u=n.className,p=void 0===u?"":u,f=n.style,h=n.children,x=n.size,g=void 0===x?"sm":x,v=n.hint,m=n.isFocused,b=t.useState(!1),y=b[0],w=b[1],C=t.useState(!1),k=C[0],F=C[1],j=i||l,S=null!=m?m:k,D=function(){d||(null==c||c({target:{checked:!i},currentTarget:{checked:!i}}))},z="sm"===g?"16px":"20px",M="sm"===g?"12px":"14px",E="sm"===g?"var(--radius-xs, 4px)":"var(--radius-sm, 6px)",L="sm"===g?"var(--font-size-text-sm, 14px)":"var(--font-size-text-md, 16px)",T="sm"===g?"var(--line-height-text-sm, 20px)":"var(--line-height-text-md, 24px)",B="sm"===g?"var(--spacing-md, 8px)":"var(--spacing-lg, 12px)",A=d&&j?"var(--color-fg-disabled_subtle, #d7d3d0)":"var(--color-fg-white, #ffffff)",R=h||v;return e.jsxs("div",{className:"aha-checkbox ".concat(p),role:"checkbox","aria-checked":l?"mixed":i,"aria-disabled":d,tabIndex:d?-1:0,style:r({display:"inline-flex",alignItems:"flex-start",gap:B,cursor:d?"not-allowed":"pointer",outline:"none"},f),onClick:D,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),D())},onMouseEnter:function(){return!d&&w(!0)},onMouseLeave:function(){return w(!1)},onFocus:function(){return!d&&F(!0)},onBlur:function(){return F(!1)},children:[e.jsxs("div",{style:{position:"relative",width:z,height:z,minWidth:z,minHeight:z,flexShrink:0,borderRadius:E,border:d?"1px solid var(--color-border-disabled, #d7d3d0)":j?y?"1px solid var(--color-bg-brand-solid_hover, #ec470a)":"1px solid var(--color-bg-brand-solid, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",backgroundColor:d?"var(--color-bg-disabled_subtle, #fafaf9)":j?y?"var(--color-bg-brand-solid_hover, #ec470a)":"var(--color-bg-brand-solid, #fb6011)":y?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:S?"var(--focus-ring, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px #fb6011)":"none",marginTop:R?"2px":"0"},children:[e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:M,height:M,color:A,opacity:l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M2.91675 7H11.0834",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:M,height:M,color:A,opacity:i&&!l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),R&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"md"===g?"var(--spacing-xxs, 2px)":"0"},children:[h&&e.jsx("span",{style:{fontSize:L,lineHeight:T,fontWeight:"var(--font-weight-medium, 500)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:d?"var(--color-text-disabled, #79716b)":"var(--color-text-secondary, #44403c)",userSelect:"none"},children:h}),v&&e.jsx("span",{style:{fontSize:L,lineHeight:T,fontWeight:"var(--font-weight-regular, 400)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:"var(--color-text-tertiary, #57534e)"},onClick:function(e){return e.stopPropagation()},children:v})]})]})};$.displayName="Checkbox";var ee=function(t){var n=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},te=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e.jsx(ee,{color:o}):n;return e.jsx("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},ne=function(e,t){return"string"==typeof t?null==e?void 0:e[t]:t.reduce(function(e,t){return null==e?void 0:e[t]},e)},oe=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=ne(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},re=function(t){var n=t.order,o=u().primaryColor;return"ascend"===n?e.jsx(K,{style:{color:o}}):"descend"===n?e.jsx(Z,{style:{color:o}}):e.jsx(X,{})},ie=function(n){var o=n.checked,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,s=n.onChange,d=n.className,c=void 0===d?"":d,u=n.style,p=n.children,f=n.value;n.name;var h=n.size,x=void 0===h?"sm":h,g=n.hint,v=n.isFocused,m=t.useState(!1),b=m[0],y=m[1],w=t.useState(!1),C=w[0],k=w[1],F=null!=v?v:C,j=function(){l||i||(null==s||s({target:{checked:!0,value:f},currentTarget:{checked:!0,value:f}}))},S="sm"===x?"16px":"20px",D="sm"===x?"6px":"8px",z="sm"===x?"var(--font-size-text-sm, 14px)":"var(--font-size-text-md, 16px)",M="sm"===x?"var(--line-height-text-sm, 20px)":"var(--line-height-text-md, 24px)",E="sm"===x?"var(--spacing-md, 8px)":"var(--spacing-lg, 12px)",L=p||g,T=l&&i?"var(--color-fg-disabled_subtle, #d7d3d0)":"var(--color-fg-white, #ffffff)";return e.jsxs("div",{className:"aha-radio ".concat(c),role:"radio","aria-checked":i,"aria-disabled":l,tabIndex:l?-1:0,style:r({display:"inline-flex",alignItems:"flex-start",gap:E,cursor:l?"not-allowed":"pointer",outline:"none"},u),onClick:j,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),j())},onMouseEnter:function(){return!l&&y(!0)},onMouseLeave:function(){return y(!1)},onFocus:function(){return!l&&k(!0)},onBlur:function(){return k(!1)},children:[e.jsx("div",{style:{position:"relative",width:S,height:S,minWidth:S,minHeight:S,flexShrink:0,borderRadius:"50%",border:l?"1px solid var(--color-border-disabled, #d7d3d0)":i?b?"1px solid var(--color-bg-brand-solid_hover, #ec470a)":"1px solid var(--color-bg-brand-solid, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",backgroundColor:l?"var(--color-bg-disabled_subtle, #fafaf9)":i?b?"var(--color-bg-brand-solid_hover, #ec470a)":"var(--color-bg-brand-solid, #fb6011)":b?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:F?"var(--focus-ring, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px #fb6011)":"none",marginTop:L?"2px":"0"},children:e.jsx("div",{style:{width:D,height:D,borderRadius:"50%",backgroundColor:T,opacity:i?1:0,transition:"opacity 0.15s",pointerEvents:"none",flexShrink:0}})}),L&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"md"===x?"var(--spacing-xxs, 2px)":"0"},children:[p&&e.jsx("span",{style:{fontSize:z,lineHeight:M,fontWeight:"var(--font-weight-medium, 500)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:l?"var(--color-text-disabled, #79716b)":"var(--color-text-secondary, #44403c)",userSelect:"none"},children:p}),g&&e.jsx("span",{style:{fontSize:z,lineHeight:M,fontWeight:"var(--font-weight-regular, 400)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:"var(--color-text-tertiary, #57534e)"},onClick:function(e){return e.stopPropagation()},children:g})]})]})};ie.displayName="Radio";var ae=/^(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,le=/(https?:\/\/[^\s<]+|www\.[^\s<]+|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[^\s<]*)?)/gi,se=new Set(["com","cn","net","org","io","co","edu","gov","ai","app","dev","me","info","biz","tech","cc","tv","xyz","top","vip","pro","store","site","online","cloud"]),de=function(e,t,n,o){if(void 0===t&&(t=!0),void 0===n&&(n=!0),!e||"string"!=typeof e)return!1;var r=e.trim();if(!r)return!1;var i=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(r);if(t&&!i)return!1;var a=i?r:"https://".concat(r);try{var l=new URL(a),s=l.protocol.toLowerCase();if("http:"!==s&&"https:"!==s)return!1;if(n){var d=l.hostname.toLowerCase();if(!d)return!1;if("localhost"===d)return!0;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(d))return d.split(".").every(function(e){var t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255});if(!ae.test(d))return!1;var c=d.split(".").pop()||"";if(!(o?new Set(o.map(function(e){return e.toLowerCase()})):se).has(c))return!1}return!0}catch(e){return!1}},ce=function(e){var t=e.match(/^(.*?)([),.;!?]+)?$/);return{core:(null==t?void 0:t[1])||e,suffix:(null==t?void 0:t[2])||""}},ue=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},pe=function(e){return e.replace(new RegExp("","g"),"")},fe=function(e,t,n){var o=function(e,t){var n,o;if(!e)return[];for(var r=[],i=0,a=new RegExp(le),l=a.exec(e);l;){var s=l[0],d=l.index,c=d+s.length;d>i&&r.push({type:"text",text:e.slice(i,d)});var u=ce(s),p=u.core,f=u.suffix,h=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(p)?p:"https://".concat(p),x=de(p,null!==(n=null==t?void 0:t.needProtocol)&&void 0!==n&&n,null===(o=null==t?void 0:t.needHost)||void 0===o||o,null==t?void 0:t.allowedTlds);((null==t?void 0:t.validate)?t.validate(h):x)&&p?(r.push({type:"url",text:p,href:h}),f&&r.push({type:"text",text:f})):r.push({type:"text",text:s}),i=c,l=a.exec(e)}return i<e.length&&r.push({type:"text",text:e.slice(i)}),r}(e,t);if(0===o.length)return"";var r=o.map(function(e){if("text"===e.type)return ue(e.text);var o=(null==t?void 0:t.className)?' class="'.concat(t.className,'"'):"",r=n?"pointer-events: none;":"";return'<a href="'.concat(ue(e.href),'" target="_blank" rel="noopener noreferrer"').concat(o,' style="color: #2563EB; text-decoration: underline; ').concat(r,'">').concat(ue(e.text),"</a>")}).join("");return e.endsWith("\n")?"".concat(r,'<span data-aha-zwsp="true">').concat("","</span>"):r},he=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return 0;var n=t.getRangeAt(0);if(!e.contains(n.startContainer))return 0;var o=n.cloneRange();return o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),pe(o.toString()).length},xe=t.forwardRef(function(n,o){var a=n.disabled,l=void 0!==a&&a,s=n.error,d=void 0!==s&&s,c=n.readOnly,u=void 0!==c&&c,p=n.showCount,f=void 0!==p&&p,h=n.maxLength,x=n.className,g=void 0===x?"":x,v=n.style,m=n.placeholder,b=n.value,y=n.defaultValue,w=n.rows,C=void 0===w?3:w,k=n.autoSize,F=void 0!==k&&k,j=n.onChange,S=n.onFocus,D=n.onBlur,z=n.linkify,M=void 0!==z&&z,E=n.linkifyOptions,L=n.label,T=n.required,B=n.hintText,A=n.helpIcon,R=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur","linkify","linkifyOptions","label","required","hintText","helpIcon"]),I=t.useRef(null),W=t.useRef(null),N=t.useRef(!1),H=t.useRef(null),Y=t.useState(y||b||""),O=Y[0],P=Y[1],V=t.useState(!1),q=V[0],_=V[1],X=t.useState(void 0),Z=X[0],K=X[1];t.useEffect(function(){"function"==typeof o?o(M?null:I.current):o&&(o.current=M?null:I.current)},[o,M]);var G=void 0!==b,J=G?b:O,U=String(J||"").length,Q=function(e){_(!0),null==S||S(e)},$=function(e){_(!1),null==D||D(e)},ee=t.useMemo(function(){return"number"==typeof h?h:void 0},[h]);t.useEffect(function(){if(!M&&F&&I.current){var e=I.current,t="object"==typeof F&&F.minRows||1,n="object"==typeof F?F.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),K(l)}},[J,F,M]),t.useEffect(function(){if(M&&F&&W.current){var e=W.current,t="object"==typeof F&&F.minRows||1,n="object"==typeof F?F.maxRows:void 0,o=parseInt(window.getComputedStyle(e).lineHeight||"24",10),r=t*o+24,i=n?n*o+24:void 0;e.style.height="auto";var a=Math.max(e.scrollHeight,r);i&&(a=Math.min(a,i)),e.style.height="".concat(a,"px"),e.style.overflowY=i&&e.scrollHeight>i?"auto":"hidden",K(a)}},[F,J,M]),t.useLayoutEffect(function(){var e;if(M&&W.current&&!N.current){var t=W.current,n=document.activeElement===t,o=n?he(t):0,r=null!==(e=H.current)&&void 0!==e?e:o,i=fe(String(J||""),E,l);if(t.innerHTML!==i&&(t.innerHTML=i),n){var a=String(J||"").length;!function(e,t){var n=document.createRange(),o=window.getSelection();if(o){for(var r=Math.max(0,t),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=i.nextNode();a;){for(var l=a.textContent||"",s=0,d=-1,c=0;c<l.length;c+=1)if(""!==l[c]&&(s+=1),s===r){d=c+1;break}if(0===r)return n.setStart(a,0),n.collapse(!0),o.removeAllRanges(),void o.addRange(n);if(-1!==d)return n.setStart(a,d),n.collapse(!0),o.removeAllRanges(),void o.addRange(n);r-=s,a=i.nextNode()}n.selectNodeContents(e),n.collapse(!1),o.removeAllRanges(),o.addRange(n)}}(t,Math.min(r,a))}H.current=null}},[J,l,M,E]);var te=function(e){null==j||j({target:{value:e},currentTarget:{value:e}})},ne=function(){if(W.current&&!N.current){H.current=he(W.current);var e=pe(W.current.textContent||""),t=ee?e.slice(0,ee):e;G||P(t),te(t)}},oe="var(--shadow-xs)",re=r(r(r(r({width:"100%",boxSizing:"border-box",fontFamily:"var(--font-family-body)",borderRadius:"var(--radius-md)"},l?{border:"1px solid var(--color-border-disabled)",boxShadow:oe,outline:"none"}:d&&q?{border:"1px solid var(--color-border-error)",boxShadow:oe,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:d?{border:"1px solid var(--color-border-error_subtle)",boxShadow:oe,outline:"none"}:q?{border:"1px solid var(--color-border-brand)",boxShadow:oe,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:oe,outline:"none"}),{backgroundColor:l||u?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",color:l?"var(--color-text-disabled)":"var(--color-text-primary)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",padding:"12px 14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",resize:F||M?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"}),void 0!==Z&&F?{height:"".concat(Z,"px")}:{}),v),ie=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: var(--color-text-placeholder);\n font-size: var(--font-size-text-md);\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder { color: var(--color-text-placeholder); }\n .aha-textarea-wrapper textarea::-moz-placeholder { color: var(--color-text-placeholder); }\n .aha-textarea-wrapper textarea:-ms-input-placeholder { color: var(--color-text-placeholder); }\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-textarea-wrapper .aha-textarea-editable {\n white-space: pre-wrap;\n word-break: break-word;\n }\n .aha-textarea-wrapper .aha-textarea-editable:empty::before {\n content: attr(data-placeholder);\n color: var(--color-text-placeholder);\n }\n .aha-textarea-wrapper .aha-textarea-editable a {\n color: #2563EB;\n }\n "}),e.jsxs("div",{className:"aha-textarea-wrapper ".concat(g),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[M?e.jsx("div",{ref:W,className:"aha-textarea-editable",contentEditable:!l&&!u,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-disabled":l,"data-placeholder":m||"",onInput:ne,onPaste:function(e){var t;if(e.preventDefault(),!u&&!l){var n,o,r=e.clipboardData.getData("text/plain"),i=String(J||""),a=window.getSelection(),s="".concat(i).concat(r),d=i.length+r.length;if(a&&a.rangeCount>0&&(null===(t=W.current)||void 0===t?void 0:t.contains(a.anchorNode))){var c=he(W.current),p=(n=a.getRangeAt(0),(o=n.cloneRange()).selectNodeContents(W.current),o.setEnd(n.endContainer,n.endOffset),o.toString().length);s=i.slice(0,c)+r+i.slice(p),d=c+r.length}ee&&(s=s.slice(0,ee),d=Math.min(d,s.length)),H.current=d,G||P(s),te(s)}},onKeyDown:function(e){var t,n;if("Enter"===e.key&&!e.nativeEvent.isComposing&&!l&&!u&&W.current){e.preventDefault();var o=String(J||""),r=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.getRangeAt(0);if(!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;var o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset);var r=n.cloneRange();return r.selectNodeContents(e),r.setEnd(n.endContainer,n.endOffset),{start:pe(o.toString()).length,end:pe(r.toString()).length}}(W.current),i=null!==(t=null==r?void 0:r.start)&&void 0!==t?t:o.length,a=null!==(n=null==r?void 0:r.end)&&void 0!==n?n:i,s="".concat(o.slice(0,i),"\n").concat(o.slice(a));ee&&(s=s.slice(0,ee));var d=Math.min(i+1,s.length);H.current=d,G||P(s),te(s)}},onFocus:function(e){return Q(e)},onBlur:function(e){return $(e)},onCompositionStart:function(){N.current=!0},onCompositionEnd:function(){N.current=!1,ne()},style:r(r({},re),{minHeight:F?void 0:"".concat(24*C+24,"px"),overflowY:F?"hidden":"auto"}),autoCorrect:R.autoCorrect||"off",autoCapitalize:R.autoCapitalize||"off",spellCheck:R.spellCheck||!1}):e.jsx("textarea",r({ref:I,value:J,placeholder:m,disabled:l,readOnly:u,rows:F?void 0:C,maxLength:h,onChange:function(e){G||P(e.target.value),null==j||j(e)},onFocus:Q,onBlur:$,style:re,autoComplete:R.autoComplete||"off",autoCorrect:R.autoCorrect||"off",autoCapitalize:R.autoCapitalize||"off",spellCheck:R.spellCheck||!1},R)),(f||h)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"var(--font-size-text-xs)",lineHeight:"var(--line-height-text-xs)",color:l?"var(--color-text-disabled)":"var(--color-text-tertiary)",fontFamily:"var(--font-family-body)"},children:h?e.jsxs("span",{children:[U," / ",h]}):e.jsx("span",{children:U})})]})]});return L||B?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[L&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)",display:"flex",alignItems:"center",gap:"2px"},children:[L,T&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"}),A&&e.jsx("span",{style:{marginLeft:"4px",display:"inline-flex",alignItems:"center",color:"var(--color-fg-quaternary)"},children:A})]}),ie,B&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:d?"var(--color-error-600)":"var(--color-text-tertiary)"},children:B})]}):ie});xe.displayName="Textarea";var ge=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,d=n.onChange,c=n.onClick,p=n.checkedChildren,f=n.unCheckedChildren,h=n.size,x=void 0===h?"default":h,g=n.loading,v=void 0!==g&&g,m=n.className,b=void 0===m?"":m,y=n.style,w=u().primaryColor,C=void 0===w?"#FB6011":w,k=t.useState(a),F=k[0],j=k[1],S=void 0!==o,D=S?o:F,z={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],M=D||v,E=s?"#E7E5E4":M?C:"#F5F5F4",L=M?"calc(100% - ".concat(z.thumbSize," - ").concat(z.thumbOffset,")"):z.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":D,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!D;S||j(t),null==d||d(t,e),null==c||c(t,e)}},className:"aha-switch ".concat(b),style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:z.width,height:z.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===x?"10px":"12px",backgroundColor:E,cursor:s||v?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},y),children:[(p||f)&&e.jsx("span",{style:{position:"absolute",left:M?"6px":"auto",right:M?"auto":"6px",fontSize:z.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:s?.5:1,zIndex:1,pointerEvents:"none"},children:M?p:f}),e.jsx("span",{style:{position:"absolute",left:L,top:"50%",transform:"translateY(-50%)",width:z.thumbSize,height:z.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:v&&e.jsxs("svg",{width:"small"===x?"8":"10",height:"small"===x?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};ge.displayName="Switch";var ve=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],me=["January","February","March","April","May","June","July","August","September","October","November","December"],be=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),o=e.getMonth(),r=String(o+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),me[o]).replace(new RegExp("","g"),ve[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},ye=function(e,t){return new Date(e,t+1,0).getDate()},we=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},Ce=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},ke=function(o){var i=o.mode,a=void 0===i?"date":i,l=o.disabled,s=void 0!==l&&l,d=o.error,c=void 0!==d&&d,p=o.placeholder,f=void 0===p?"Select date":p,h=o.startPlaceholder,x=void 0===h?"Start date":h,g=o.endPlaceholder,v=void 0===g?"End date":g,m=o.size,b=void 0===m?"medium":m,y=o.allowClear,w=void 0!==y&&y,C=o.format,k=void 0===C?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":C,F=o.onFocus,j=o.onBlur,S=o.onOpenChange,D=o.className,z=void 0===D?"":D,M=o.style,E=o.dropdownClassName,L=void 0===E?"":E,T=o.dropdownStyle,B=o.defaultOpen,A=void 0!==B&&B,R=o.open,I=o.minDate,W=o.maxDate,N=o.separator,H=void 0===N?" - ":N,Y=o.presetRanges,O=void 0!==Y&&Y,P=o.calendarCount,V=void 0===P?1:P,q=o.showApplyCancel,_=void 0!==q&&q,X=o.applyText,Z=void 0===X?"Apply":X,K=o.cancelText,G=void 0===K?"Cancel":K,J=o.onApply,U=o.onCancel,Q=o.showSelectedRange,$=void 0!==Q&&Q,ee=o.startSelectedRangeText,te=void 0===ee?"Select dates":ee,ne=o.endSelectedRangeText,oe=void 0===ne?"Select dates":ne,re=o.rangeDisplayMode,ie=void 0===re?"range":re,ae=u().primaryColor,le=void 0===ae?"#FB6011":ae,se="range"===a,de=t.useState(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),ce=de[0],ue=de[1],pe=t.useState(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),fe=pe[0],he=pe[1],xe=t.useState(A),ge=xe[0],ve=xe[1],ke=t.useState(!0),Fe=ke[0],je=ke[1],Se=t.useState(null),De=Se[0],ze=Se[1],Me=t.useState(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ee=Me[0],Le=Me[1],Te=t.useState(function(){if(2===V&&se){var e=new Date(Ee.year,Ee.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Be=Te[0],Ae=Te[1];t.useEffect(function(){if(2===V&&se){var e=new Date(Ee.year,Ee.month+1,1);Ae({year:e.getFullYear(),month:e.getMonth()})}else Ae(null)},[Ee,V,se]);var Re=t.useRef(null),Ie=t.useRef(null),We=t.useRef(null),Ne=t.useRef(null),He=t.useRef(null),Ye=t.useState(null),Oe=Ye[0],Pe=Ye[1],Ve=t.useRef(!1),qe=t.useRef(!1),_e=t.useRef(null),Xe="value"in o&&void 0!==o.value,Ze=void 0!==R,Ke=se?null:Xe&&"date"===a&&"value"in o?o.value:ce,Ge=se?Xe&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:fe:{startDate:null,endDate:null},Je=Ze?R:ge;t.useEffect(function(){if(Je&&!Ve.current){if(se){var e=Ge.startDate||Ge.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Le({year:t,month:n})}else{var o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}}else if(Ke){t=Ke.getFullYear(),n=Ke.getMonth();Le({year:t,month:n})}else{o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}Ve.current=!0}else Je||(Ve.current=!1)},[Je,Ke,Ge,se]),t.useEffect(function(){if(Je&&Re.current){qe.current=!1,_e.current=null;var e=function(){if(Re.current){var e=Re.current.getBoundingClientRect();if(qe.current&&null!==_e.current){var t,n=_e.current;if(He.current){var o=He.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Pe({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";Pe({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(He.current){var t=He.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),qe.current=!0,_e.current=i}Pe({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Pe(null),qe.current=!1,_e.current=null},[Je]),t.useEffect(function(){var e=function(e){var t=e.target;Re.current&&!Re.current.contains(t)&&He.current&&!He.current.contains(t)&&(Ze||ve(!1),null==S||S(!1))};if(Je)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Je,Ze,S]);var Ue,Qe,$e,et,tt=t.useCallback(function(e){var t;Ce(e,I,W)&&(Xe||ue(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ze||ve(!1),null==S||S(!1))},[Xe,Ze,a,o,S,I,W]),nt=t.useCallback(function(e){var t;if(Ce(e,I,W)){var n,r=_&&De?De:Ge;r.startDate&&r.endDate?(n={startDate:e,endDate:null},je(!1)):Fe?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},je(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(je(!0),_||(Ze||ve(!1),null==S||S(!1))):je(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},je(!1)):(n={startDate:r.startDate,endDate:e},je(!0),_||(Ze||ve(!1),null==S||S(!1))),_?ze(n):(Xe||he(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[Fe,Ge,De,_,Xe,Ze,a,o,S,I,W]),ot=function(e){var t,n;if(e.stopPropagation(),se){var r={startDate:null,endDate:null};Xe||he(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),je(!0)}else Xe||ue(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!Je){var i=new Date;Le({year:i.getFullYear(),month:i.getMonth()})}},rt=function(){if(!s){var e=!Je;if(Ze||ve(e),null==S||S(e),e){if(se){if(je(!Ge.startDate),_&&ze(Ge),!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else if(!Ke){t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else!e&&_&&ze(null)}},it=t.useMemo(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),at=t.useMemo(function(){return Array.isArray(O)?O:!0===O?it:[]},[O,it]),lt=at.length>0,st=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Le({year:n,month:r})}_?ze(e):(Xe||he(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ze||ve(!1),null==S||S(!1))},dt=function(){Le(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},ct=function(){Le(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},ut=t.useCallback(function(e,t){for(var n=ye(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),pt=t.useMemo(function(){return ut(Ee.year,Ee.month)},[Ee,ut]),ft=t.useMemo(function(){return 2===V&&se&&Be?ut(Be.year,Be.month):null},[V,se,Be,ut]),ht=function(){Be&&Ae(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},xt=function(){Be&&Ae(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},gt={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},vt=w&&!s&&(se?Ge.startDate||Ge.endDate:Ke),mt=Ke?be(Ke,k):"",bt=Ge.startDate?be(Ge.startDate,k):"",yt=Ge.endDate?be(Ge.endDate,k):"",wt=t.useMemo(function(){if(!se||"text"!==ie)return"";if(Ge.startDate&&Ge.endDate){var e=be(Ge.startDate,"MMM D, YYYY"),t=be(Ge.endDate,"MMM D, YYYY");return"".concat(e," ").concat(H," ").concat(t)}return Ge.startDate?be(Ge.startDate,"MMM D, YYYY"):Ge.endDate?be(Ge.endDate,"MMM D, YYYY"):""},[se,ie,Ge,H]),Ct=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:Re,className:"aha-date-picker ".concat(z),style:r({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":Je?le:"#D7D3D0"),backgroundColor:s?"#FAFAF9":"#FFFFFF",cursor:s?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:vt?"30px":"12px",paddingTop:gt[b].paddingTop,paddingBottom:gt[b].paddingBottom,fontSize:gt[b].fontSize,lineHeight:gt[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},M),onClick:rt,onFocus:function(e){null==F||F(e)},onBlur:function(e){null==j||j(e)},tabIndex:s?-1:0,children:[e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:s?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),se?"text"===ie?e.jsx("input",{ref:Ie,type:"text",value:wt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate||Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):e.jsxs("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e.jsx("input",{ref:We,type:"text",value:bt,readOnly:!0,placeholder:x,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!0),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e.jsx("span",{style:{color:s?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:H}),e.jsx("input",{ref:Ne,type:"text",value:yt,readOnly:!0,placeholder:v,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!1),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e.jsx("input",{ref:Ie,type:"text",value:mt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ke?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),vt&&e.jsx("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:ot,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),Je&&Oe&&n.createPortal(e.jsx("div",{ref:He,className:"aha-date-picker-dropdown ".concat(L),style:r({position:"absolute",top:"".concat(Oe.top,"px"),left:"".concat(Oe.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Oe.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Oe.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},T),children:e.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:se&<&&1===V?"column":"row"},children:[se&<&&2===V&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:_?"0":"8px"},children:at.map(function(t,n){var o=De?we(t.range.startDate,De.startDate)&&we(t.range.endDate,De.endDate):we(t.range.startDate,Ge.startDate)&&we(t.range.endDate,Ge.endDate);return e.jsx("div",{onClick:function(){return st(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?le:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),e.jsxs("div",{children:[e.jsx("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===V?"row":"column",gap:2===V?"24px":"0"},children:(et=function(t,n,o,r,i){return void 0===i&&(i=0),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:2===V&&se?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===V&&se&&1===i)&&e.jsx("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&se?"absolute":"relative",left:2===V&&se?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[me[t.month]," ",t.year]}),!(2===V&&se&&0===i)&&e.jsx("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&se?"absolute":"relative",right:2===V&&se?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),se&&$&&1===V&&0===i&&(a=_&&De?De:Ge,l=a.startDate?be(a.startDate,"MMM D, YYYY"):te,s=a.endDate?be(a.endDate,"MMM D, YYYY"):oe,e.jsxs("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.startDate?"text-[#44403C]":"text-[#79716B]"),children:l}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),se&<&&1===V&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:at.map(function(t,n){var o=De?we(t.range.startDate,De.startDate)&&we(t.range.endDate,De.endDate):we(t.range.startDate,Ge.startDate)&&we(t.range.endDate,Ge.endDate);return e.jsx("button",{type:"button",onClick:function(){return st(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?le:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Ct.map(function(t){return e.jsx("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var o,r,i=(o=t.year,r=t.month,new Date(o,r,1).getDay()),a=(0===i?7:i)-1,l=[],s=0;s<a;s++)l.push(e.jsx("div",{},"empty-".concat(s)));return n.forEach(function(n,o){if(n){var r=a+o,i=n.getMonth()===t.month,s=we(n,new Date),d=!Ce(n,I,W);if(se){var c=_&&De?De:Ge,u=we(n,c.startDate),p=we(n,c.endDate),f=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(n,c.startDate,c.endDate),h=r%7==0,x=r%7==6,g=u,v=p,m={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:d?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.4:1,position:"relative",padding:0,margin:0};if(g||v)m.background=le,m.borderRadius="50%",m.color="#FFFFFF",m.fontWeight=500;else if(f){m.background="#F5F5F4",m.color=i?d?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;var b=1===n.getDate(),y=ye(t.year,t.month),w=n.getDate()===y,C=h||b,k=x||w;C&&k?m.borderRadius="18px":C?(m.borderTopLeftRadius="18px",m.borderBottomLeftRadius="18px",m.borderTopRightRadius="0",m.borderBottomRightRadius="0"):k?(m.borderTopRightRadius="18px",m.borderBottomRightRadius="18px",m.borderTopLeftRadius="0",m.borderBottomLeftRadius="0"):m.borderRadius="0"}else m.background="transparent",m.borderRadius="50%",m.color=i?d?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return nt(n)},style:m,onMouseEnter:function(e){d||g||v||(e.currentTarget.style.backgroundColor=f?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){g||v||(e.currentTarget.style.backgroundColor=f?"#F5F5F4":"transparent")},children:[n.getDate(),s&&e.jsx("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:g||v?"#FFFFFF":le}})]},"date-".concat(o)))}else{var F=we(n,Ke);l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return tt(n)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:F?le:"transparent",cursor:d?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:F?500:400,color:F?"#FFFFFF":i?d?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){d||F||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){F||(e.currentTarget.style.backgroundColor="transparent")},children:[n.getDate(),s&&!F&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:le}})]},"date-".concat(o)))}}}),l}()})]},i);var a,l,s},e.jsxs(e.Fragment,{children:[et(Ee,pt,dt,ct,0),2===V&&se&&Be&&ft&&et(Be,ft,ht,xt,1)]}))}),se&&$&&2===V&&!_&&(Ue=Ge,Qe=Ue.startDate?be(Ue.startDate,"MMM D, YYYY"):te,$e=Ue.endDate?be(Ue.endDate,"MMM D, YYYY"):oe,e.jsx("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.startDate?"text-[#44403C]":"text-[#79716B]"),children:Qe}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.endDate?"text-[#44403C]":"text-[#79716B]"),children:$e})]})})),se&&_&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[$&&2===V&&function(){var t=De||Ge,n=t.startDate?be(t.startDate,"MMM D, YYYY"):te,o=t.endDate?be(t.endDate,"MMM D, YYYY"):oe;return e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.startDate?"text-[#44403C]":"text-[#79716B]"),children:n}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),e.jsxs("div",{className:"".concat(2===V?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e.jsx("button",{type:"button",onClick:function(){ze(null),null==U||U(),Ze||ve(!1),null==S||S(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:G}),e.jsx("button",{type:"button",onClick:function(){var e;De&&(Xe||he(De),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,De)),null==J||J(De),Ze||ve(!1),null==S||S(!1),ze(null))},disabled:!De||!De.startDate||!De.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:De&&De.startDate&&De.endDate?le:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:De&&De.startDate&&De.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){De&&De.startDate&&De.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){De&&De.startDate&&De.endDate&&(e.currentTarget.style.backgroundColor=le)},children:Z})]})]})]})]})}),document.body)]})};ke.displayName="DatePicker";var Fe=t.createContext(null),je=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),Se=t.forwardRef(function(n,o){var i=n.initialValues,s=void 0===i?{}:i,d=n.onValuesChange,c=n.onFinish,u=n.onFinishFailed,p=n.labelWidth,f=void 0===p?"120px":p,h=n.labelAlign,x=void 0===h?"right":h,g=n.layout,v=void 0===g?"horizontal":g;n.size;var m=n.className,b=void 0===m?"":m,y=n.style,w=n.children,C=t.useState(function(){var e={};return Object.keys(s).forEach(function(t){e[t]={value:s[t],error:void 0,touched:!1,validating:!1}}),e}),k=C[0],F=C[1],j=t.useRef(k);t.useEffect(function(){j.current=k},[k]);var S=t.useRef({}),D=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),z=t.useCallback(function(e,t){F(function(n){var o=r({},n);if(o[e]?o[e]=r(r({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},j.current[e]?j.current[e]=r(r({},j.current[e]),{value:t}):j.current[e]={value:t,error:void 0,touched:!1,validating:!1},d){var i={};i[e]=t;var a={};Object.keys(o).forEach(function(e){a[e]=o[e].value}),d(i,a)}return o})},[d]),M=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),E=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{error:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),T=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{touched:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),B=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.validating)||!1},[]),A=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{validating:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),R=t.useRef();R.current=function(e,t){F(function(n){if(n[e]){var o=n[e].rules||[],i=t.rules||[],a=o.length===i.length;if(a&&o.length>0)for(var l=0;l<o.length;l++){var d=o[l],c=i[l];if((null==d?void 0:d.required)!==(null==c?void 0:c.required)||(null==d?void 0:d.message)!==(null==c?void 0:c.message)||(null==d?void 0:d.type)!==(null==c?void 0:c.type)||(null==d?void 0:d.pattern)!==(null==c?void 0:c.pattern)||(null==d?void 0:d.min)!==(null==c?void 0:c.min)||(null==d?void 0:d.max)!==(null==c?void 0:c.max)||(null==d?void 0:d.len)!==(null==c?void 0:c.len)||(null==d?void 0:d.whitespace)!==(null==c?void 0:c.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var u=r({},n);return u[e]?u[e]=r(r({},u[e]),{rules:t.rules,required:t.required}):u[e]={value:s[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},u})};var I=t.useCallback(function(e,t){var n;null===(n=R.current)||void 0===n||n.call(R,e,t)},[]),W=t.useCallback(function(e){delete S.current[e],F(function(t){var n=r({},t);return delete n[e],n}),delete j.current[e]},[]),N=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,i,a,s,d,c,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];A(e,!0),n=t.rules||[],i=0,a=n,l.label=1;case 1:if(!(i<a.length))return[3,6];if(s=a[i],d=t.value,s.required&&(null==d||""===d))return o=s.message||"".concat(e," is required"),[3,6];if(s.type&&null!=d&&""!==d&&(c={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[s.type])&&!c(d))return o=s.message||"".concat(e," must be a valid ").concat(s.type),[3,6];if(s.pattern&&null!=d&&""!==d&&!s.pattern.test(String(d)))return o=s.message||"".concat(e," format is invalid"),[3,6];if(void 0!==s.min&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))<s.min)return o=s.message||"".concat(e," must be at least ").concat(s.min),[3,6];if(void 0!==s.max&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))>s.max)return o=s.message||"".concat(e," must be at most ").concat(s.max),[3,6];if(void 0!==s.len&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))!==s.len)return o=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof d&&d.trim()!==d)return o=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,d)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),o=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return i++,[3,1];case 6:return j.current[e]?j.current[e]=r(r({},j.current[e]),{error:o,validating:!1,touched:!0}):j.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},F(function(n){var i=r({},n);return i[e]?i[e]=r(r({},i[e]),{error:o,validating:!1,touched:!0}):i[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},i}),[2,o]}})})},[]),H=t.useCallback(function(e){var t=j.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),Y=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,r,i;return l(this,function(s){switch(s.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return a(void 0,void 0,void 0,function(){var n,o;return l(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,N(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return s.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(s.sent(),o.length>0)throw r=H(),i={values:r,errorFields:o},null==u||u(i),new je("Form validation failed",r,o);return[2,H()]}})})},[N,H,u]),O=t.useCallback(function(e){F(function(t){var n=r({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=r(r({},n[e]),{value:s[e],error:void 0,touched:!1,validating:!1}),j.current[e]=r({},n[e]))}),n})},[s]),P=t.useCallback(function(e){F(function(t){var n=r({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=r(r({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},j.current[t]=r({},n[t])}),d){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),d(e,o)}return n})},[d]),V=t.useCallback(function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Y()];case 1:return e=t.sent(),null==c||c(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[Y,c]),q=t.useCallback(function(e){if(F(function(t){var n=r({},t);return e.forEach(function(e){var t=e.name,o=e.value,i=e.errors,a=i&&i.length>0?i[0]:void 0;n[t]?n[t]=r(r(r({},n[t]),void 0!==o&&{value:o}),{error:a,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:a,touched:!0,validating:!1},j.current[t]=r({},n[t])}),n}),d&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return d(t,H())},0)}},[d,H]),_=t.useCallback(function(e,t){t?S.current[e]=t:delete S.current[e]},[]),X=t.useCallback(function(e,t){var n=S.current[e];null==n||n.scrollIntoView(r({behavior:"smooth",block:"center"},t))},[]);t.useImperativeHandle(o,function(){return{getFieldValue:D,getFieldsValue:H,setFieldValue:z,setFieldsValue:P,setFields:q,getFieldError:M,validateField:N,validateFields:Y,resetFields:O,submit:V,scrollToField:X}});var Z=t.useMemo(function(){return{fields:k,getFieldValue:D,setFieldValue:z,getFieldError:M,setFieldError:E,isFieldTouched:L,setFieldTouched:T,isFieldValidating:B,setFieldValidating:A,registerField:I,unregisterField:W,validateField:N,validateFields:Y,resetFields:O,getFieldsValue:H,setFieldsValue:P,setFields:q,submit:V,scrollToField:X,registerFieldRef:_,labelWidth:f,labelAlign:x}},[k,D,z,M,E,L,T,B,A,I,W,N,Y,O,H,P,q,V,X,_,f,x]),K=r({},y);return"vertical"===v?(K.display="flex",K.flexDirection="column"):"inline"===v&&(K.display="inline-flex",K.flexWrap="wrap",K.gap="16px"),e.jsx(Fe.Provider,{value:Z,children:e.jsx("form",{className:"aha-form ".concat(b),style:K,onSubmit:function(e){return a(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Y()];case 2:return t=n.sent(),null==c||c(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:w})})});Se.displayName="Form";var De=Se;De.Item=function(n){var o=n.name,i=n.label,a=n.htmlFor;n.labelCol,n.wrapperCol;var l=n.required,s=void 0!==l&&l,d=n.rules,c=void 0===d?[]:d;n.hasFeedback;var u=n.validateStatus,p=n.help,f=n.extra,h=n.className,x=void 0===h?"":h,g=n.style,v=n.children;n.labelAlign,n.labelWidth;var m=n.hidden,b=void 0!==m&&m,y=n.tooltip,w=t.useContext(Fe),C=t.useRef(null),k=t.useCallback(function(e){C.current=e,o&&(null==w?void 0:w.registerFieldRef)&&w.registerFieldRef(o,e)},[o,w]),F=(null==w?void 0:w.fields)||{};o&&w&&w.getFieldValue(o);var j=o&&w?w.getFieldError(o):void 0,S=!(!o||!w)&&w.isFieldTouched(o),D=!(!o||!w)&&w.isFieldValidating(o);o&&F[o];var z=u||(j?"error":D?"validating":S&&!j?"success":void 0),M=void 0!==p?p:j||void 0,E=t.useRef(c),L=t.useRef(s),T=t.useRef(!1),B=s||c.some(function(e){return e.required}),A=t.useMemo(function(){if(!T.current)return T.current=!0,!0;if(E.current.length!==c.length)return!0;if(E.current===c)return!1;for(var e=0;e<c.length;e++){var t=E.current[e],n=c[e];if((null==t?void 0:t.required)!==(null==n?void 0:n.required)||(null==t?void 0:t.message)!==(null==n?void 0:n.message)||(null==t?void 0:t.type)!==(null==n?void 0:n.type)||(null==t?void 0:t.pattern)!==(null==n?void 0:n.pattern)||(null==t?void 0:t.min)!==(null==n?void 0:n.min)||(null==t?void 0:t.max)!==(null==n?void 0:n.max)||(null==t?void 0:t.len)!==(null==n?void 0:n.len)||(null==t?void 0:t.whitespace)!==(null==n?void 0:n.whitespace))return!0}return!1},[c]);t.useEffect(function(){if(o&&w)return(!E.current||A||L.current!==s)&&(E.current=c,L.current=s,w.registerField(o,{rules:c,required:B})),function(){o&&w&&w.unregisterField(o)}},[o]);if(b)return null;return e.jsxs("div",{ref:k,className:"aha-form-item ".concat(x),style:r({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[i&&e.jsxs("label",{htmlFor:a,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[i,B&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),y&&e.jsx(function(n){var o=n.content,r=t.useState(!1),i=r[0],a=r[1],l=t.useRef(null);return t.useEffect(function(){var e=function(e){l.current&&!l.current.contains(e.target)&&a(!1)};if(i)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),a(!i)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(U,{})}),i&&e.jsxs("div",{ref:l,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[o,e.jsx("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:y})]}),e.jsxs("div",{style:{width:"100%"},children:[e.jsx("div",{children:t.Children.map(v,function(e){return t.isValidElement(e)?function(e){var n,i,a,l,s,d,c,u,p;if(!t.isValidElement(e))return e;var f=r({},e.props);if(o&&w){var h=w.getFieldValue(o),x=w.setFieldValue;if(!x)return e;var g=e.type;if(g&&("object"==typeof g||"function"==typeof g)&&"displayName"in g){var v=g.displayName;if("Input"===v||"Textarea"===v){f.value=h||"";var m=null===(n=e.props)||void 0===n?void 0:n.onChange,b=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){x(o,e.target.value),null==m||m(e),o&&w&&setTimeout(function(){w.validateField(o)},0)},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==b||b(e)},f.error="error"===z}else if("Select"===v){f.value=h;var y=null===(a=e.props)||void 0===a?void 0:a.onChange,C=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){x(o,e),null==y||y(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==C||C(e)},f.error="error"===z}else if("Switch"===v){f.checked=h||!1;var k=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(o,e),null==k||k(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Checkbox"===v){f.checked=h||!1;var F=null===(d=e.props)||void 0===d?void 0:d.onChange;f.onChange=function(e){x(o,e.target.checked),null==F||F(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Radio"===v){var j=null===(c=e.props)||void 0===c?void 0:c.value;if(void 0!==j){f.checked=h===j;var S=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){x(o,j),null==S||S(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}}}else{void 0!==h&&(f.value=h);var D=null===(p=e.props)||void 0===p?void 0:p.onChange;f.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;x(o,r),null==D||D(e)}}}return"error"===z&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),M&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===z?"#D92D20":"warning"===z?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:M}),f&&!M&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})},De.useForm=function(){return[t.useRef(null)]};var ze=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,l=n.selectedKeys,d=n.defaultSelectedKeys,c=void 0===d?[]:d,p=n.onSelect,f=n.onDeselect,h=n.onClick,x=n.className,g=void 0===x?"":x,v=n.style,m=n.width,b=void 0===m?320:m;u().primaryColor;var y=t.useRef(null),w=t.useRef({}),C=void 0!==l,k=t.useState(c),F=k[0],j=k[1],S=C?l:F,D=function(e){return"children"in e&&Array.isArray(e.children)},z=t.useCallback(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(D(i)){var a=z(e,i.children,n);if(a)return a}else{var l=i,d=s(s([],n,!0),[l.key],!1);if(l.key===e)return d}}return null},[]),M=t.useCallback(function(e){var t;if(!e.disabled){var n,o=z(e.key,i)||[e.key];S.includes(e.key)?(n=S.filter(function(t){return t!==e.key}),null==f||f({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==p||p({key:e.key,keyPath:o,selectedKeys:n})),C||j(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==h||h({key:e.key,keyPath:o})}},[S,C,p,f,h,i,z]),E=function(t){var n=S.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var o=r({display:"flex",alignItems:"center",padding:"10px 16px",cursor:t.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:t.disabled?.5:1},t.style);return e.jsxs("div",{ref:function(e){w.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:o,onClick:function(){return M(t)},onMouseEnter:function(e){t.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[t.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.icon}),e.jsx("span",{style:{flex:1},children:t.label}),t.suffixIcon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.suffixIcon})]},t.key)},L=r({width:"number"==typeof b?"".concat(b,"px"):b,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},v),T=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!D(o)||!(!D(n)||D(o))};return e.jsxs("div",{ref:y,className:"aha-menu-list ".concat(g),style:L,children:[a&&(a?a.render?a.render(a):e.jsx("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e.jsx("div",{children:i.map(function(n,o){return e.jsxs(t.Fragment,{children:[T(o,i)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),D(n)?(r=n,e.jsx("div",{className:"aha-menu-group ".concat(r.className||""),children:r.children.map(function(e){return E(e)})},"group-".concat(r.title))):E(n)]},o);var r})})]})};ze.displayName="MenuList";var Me=function(e,t,n,o){void 0===o&&(o=6);var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,s=o+6,d=0,c=0;switch(n){case"top":d=e.top-t.height-s+i,c=a-t.width/2+r;break;case"bottom":default:d=e.bottom+s+i,c=a-t.width/2+r;break;case"left":d=l-t.height/2+i,c=e.left-t.width-s+r;break;case"right":d=l-t.height/2+i,c=e.right+s+r;break;case"top-left":d=e.top-t.height-s+i,c=e.left+r;break;case"top-right":d=e.top-t.height-s+i,c=e.right-t.width+r;break;case"bottom-left":d=e.bottom+s+i,c=e.left+r;break;case"bottom-right":d=e.bottom+s+i,c=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return c<r+8?c=r+8:c+t.width>r+u-8&&(c=r+u-t.width-8),d<i+8?d=i+8:d+t.height>i+p-8&&(d=i+p-t.height-8),{top:d,left:c}},Ee=function(e,t,n,o){void 0===o&&(o=6);var r=Me(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,s=i-(window.scrollY||window.pageYOffset),d=a-l,c=s+t.height,u=d+t.width,p=s,f=d,h=Math.max(p,e.top),x=Math.min(c,e.bottom),g=Math.max(f,e.left),v=Math.min(u,e.right);return x>h+1&&v>g+1},Le=function(t,n){var o=r({position:"absolute",width:0,height:0,borderStyle:"solid"},n),i={top:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:r(r({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:i[t]})},Te=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},Be=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},Ae=function(o){var i,a=o.children,l=o.content,s=o.trigger,d=void 0===s?"click":s,c=o.open,u=o.defaultOpen,p=void 0!==u&&u,f=o.onOpenChange,h=o.placement,x=void 0===h?"right":h,g=o.width,v=o.offset,m=void 0===v?8:v,b=o.className,y=void 0===b?"":b,w=o.popoverClassName,C=void 0===w?"":w,k=o.disabled,F=void 0!==k&&k,j=o.destroyOnHide,S=o.destroyTooltipOnHide,D=null===(i=null!=j?j:S)||void 0===i||i,z=void 0!==c,M=t.useState(p),E=M[0],L=M[1],T=z?!!c:E,B=t.useState({top:0,left:0,opacity:0}),A=B[0],R=B[1],I=t.useRef(null),W=t.useRef(null),N=t.useCallback(function(e){z||L(e),null==f||f(e)},[z,f]),H=t.useCallback(function(){if(T&&I.current&&W.current){var e=I.current.getBoundingClientRect(),t=W.current.getBoundingClientRect(),n=function(){if(Te(e,t,x,m))return x;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(x);return Te(e,t,n,m)||Be(e,n)>Be(e,x)?n:x}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,m),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,s=t;return s<o+8&&(s=o+8),s+n.width>o+i-8&&(s=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:s}}(o.top,o.left,t);R({top:r.top,left:r.left,opacity:1})}},[T,x,m]),Y=t.useCallback(function(){F||N(!0)},[F,N]),O=t.useCallback(function(){N(!1)},[N]),P=t.useCallback(function(){F||N(!T)},[F,T,N]);t.useEffect(function(){if(T)return requestAnimationFrame(function(){H()}),window.addEventListener("resize",H),window.addEventListener("scroll",H,!0),function(){window.removeEventListener("resize",H),window.removeEventListener("scroll",H,!0)}},[T,H]),t.useEffect(function(){if(T&&"click"===d){var e=function(e){var t=e.target;I.current&&W.current&&!I.current.contains(t)&&!W.current.contains(t)&&O()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}},[T,d,O]);var V="hover"===d?{onMouseEnter:Y,onMouseLeave:O,onFocus:Y,onBlur:O}:{onClick:function(e){e.stopPropagation(),P()}},q=T||!D?e.jsx("div",{ref:W,className:"aha-popover ".concat(C),style:{position:"absolute",zIndex:9999,top:A.top,left:A.left,opacity:T?A.opacity:0,visibility:T?"visible":"hidden",pointerEvents:T?"auto":"none",transition:"opacity 120ms ease-out",width:"number"==typeof g?"".concat(g,"px"):g,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===d?Y:void 0,onMouseLeave:"hover"===d?O:void 0,onMouseDown:"click"===d?function(e){return e.stopPropagation()}:void 0,children:l}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:I,className:"aha-popover-trigger ".concat(y),style:{display:"inline-block",cursor:F?"not-allowed":"pointer"}},V,{children:a})),q&&"undefined"!=typeof document&&n.createPortal(q,document.body)]})};Ae.displayName="Popover";var Re=240,Ie=function(o){var i=o.open,a=o.defaultOpen,l=void 0!==a&&a,s=o.onClose,d=o.afterOpenChange,c=o.title,u=o.extra,p=o.footer,f=o.children,h=o.placement,x=void 0===h?"right":h,g=o.width,v=void 0===g?378:g,m=o.height,b=void 0===m?378:m,y=o.mask,w=void 0===y||y,C=o.maskClosable,k=void 0===C||C,F=o.closable,j=void 0===F||F,S=o.closeIcon,D=o.keyboard,z=void 0===D||D,M=o.destroyOnClose,E=void 0!==M&&M,L=o.zIndex,T=void 0===L?1e3:L,B=o.mobileBreakpoint,A=void 0===B?768:B,R=o.className,I=void 0===R?"":R,W=o.style,N=o.drawerStyle,H=o.headerStyle,Y=o.bodyStyle,O=o.footerStyle,P=o.maskStyle,V=void 0!==i,q=t.useState(l),_=q[0],X=q[1],Z=V?!!i:_,K=t.useState(Z),G=K[0],J=K[1],U=t.useState(Z),Q=U[0],$=U[1],ee=t.useState(!1),te=ee[0],ne=ee[1],oe=t.useState(!1),re=oe[0],ie=oe[1];t.useEffect(function(){ne(!0)},[]),t.useEffect(function(){var e=function(){ie(window.innerWidth<A)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[A]),t.useEffect(function(){if(Z){J(!0),$(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){$(!0)})}),t=window.setTimeout(function(){null==d||d(!0)},Re);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}$(!1);var n=window.setTimeout(function(){E&&J(!1),null==d||d(!1)},Re);return function(){return window.clearTimeout(n)}},[Z,E,d]),t.useEffect(function(){if(Z&&z){var e=function(e){"Escape"===e.key&&(null==s||s(e),V||X(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[Z,z,s,V]),t.useEffect(function(){if(te&&Z){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[Z,te]);var ae=t.useCallback(function(e){null==s||s(e),V||X(!1)},[s,V]),le=t.useMemo(function(){return re?"100vw":"left"===x||"right"===x?"number"==typeof v?"".concat(v,"px"):v:"100vw"},[x,re,v]),se=t.useMemo(function(){return"top"===x||"bottom"===x?"number"==typeof b?"".concat(b,"px"):b:"100vh"},[x,b]),de=t.useMemo(function(){return re&&("left"===x||"right"===x)?"bottom":x},[re,x]),ce=t.useMemo(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(Re,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:T+1};switch(de){case"left":return r(r({},e),{top:0,left:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(-100%)"});case"right":return r(r({},e),{top:0,right:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(100%)"});case"top":return r(r({},e),{top:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(-100%)"});default:return r(r({},e),{bottom:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(100%)"})}},[de,le,se,Q,T]);if(!te||!G&&!Z)return null;var ue=e.jsxs("div",{className:"aha-drawer-root ".concat(I),style:r({position:"fixed",inset:0,zIndex:T,pointerEvents:Z||Q?"auto":"none"},W),children:[w&&e.jsx("div",{"aria-hidden":!0,onClick:k?function(e){return ae(e)}:void 0,style:r({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:Q?1:0,transition:"opacity ".concat(Re,"ms cubic-bezier(0.2, 0, 0, 1)")},P)}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:r(r({},ce),N),children:[(void 0!==c||j||u)&&e.jsxs("div",{style:r({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},H),children:[e.jsx("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:c}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u,j&&e.jsx("button",{type:"button",onClick:function(e){return ae(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:S||e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsx("div",{style:r({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},Y),children:f}),void 0!==p&&e.jsx("div",{style:r({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},O),children:p})]},"".concat(de,"-").concat(Z?"open":"closed"))]});return n.createPortal(ue,document.body)};Ie.displayName="Drawer";var We={name:"Thinking Five",tag:"Custom Rose Trail",rotate:!0,particleCount:62,trailSpan:.38,durationMs:3900,rotationDurationMs:28e3,pulseDurationMs:3e3,strokeWidth:5.5,baseRadius:7,detailAmplitude:3,petalCount:5,curveScale:3};function Ne(e,t,n){var o=e*Math.PI*2,r=Math.round(n.petalCount),i=n.baseRadius*Math.cos(o)-n.detailAmplitude*t*Math.cos(r*o),a=n.baseRadius*Math.sin(o)-n.detailAmplitude*t*Math.sin(r*o);return{x:50+i*n.curveScale,y:50+a*n.curveScale}}function He(e,t,n,o){var r=e/Math.max(1,o.particleCount-1),i=Ne(function(e){return(e%1+1)%1}(t-r*o.trailSpan),n,o),a=Math.pow(1-r,.56);return{x:i.x,y:i.y,radius:.9+2.7*a,opacity:.04+.96*a}}var Ye={gray:{bg:"var(--color-gray-50)",text:"var(--color-gray-700)",ring:"var(--color-gray-200)",dot:"var(--color-gray-500)",btnText:"var(--color-gray-400)",btnHoverBg:"var(--color-gray-100)",btnHoverText:"var(--color-gray-500)"},brand:{bg:"var(--color-brand-50)",text:"var(--color-brand-700)",ring:"var(--color-brand-200)",dot:"var(--color-brand-500)",btnText:"var(--color-brand-400)",btnHoverBg:"var(--color-brand-100)",btnHoverText:"var(--color-brand-500)"},error:{bg:"var(--color-error-50)",text:"var(--color-error-700)",ring:"var(--color-error-200)",dot:"var(--color-error-500)",btnText:"var(--color-error-400)",btnHoverBg:"var(--color-error-100)",btnHoverText:"var(--color-error-500)"},warning:{bg:"var(--color-warning-50)",text:"var(--color-warning-700)",ring:"var(--color-warning-200)",dot:"var(--color-warning-500)",btnText:"var(--color-warning-400)",btnHoverBg:"var(--color-warning-100)",btnHoverText:"var(--color-warning-500)"},success:{bg:"var(--color-success-50)",text:"var(--color-success-700)",ring:"var(--color-success-200)",dot:"var(--color-success-500)",btnText:"var(--color-success-400)",btnHoverBg:"var(--color-success-100)",btnHoverText:"var(--color-success-500)"},grayBlue:{bg:"var(--color-gray-blue-50)",text:"var(--color-gray-blue-700)",ring:"var(--color-gray-blue-200)",dot:"var(--color-gray-blue-500)",btnText:"var(--color-gray-blue-400)",btnHoverBg:"var(--color-gray-blue-100)",btnHoverText:"var(--color-gray-blue-500)"},blueLight:{bg:"var(--color-blue-light-50)",text:"var(--color-blue-light-700)",ring:"var(--color-blue-light-200)",dot:"var(--color-blue-light-500)",btnText:"var(--color-blue-light-400)",btnHoverBg:"var(--color-blue-light-100)",btnHoverText:"var(--color-blue-light-500)"},blue:{bg:"var(--color-blue-50)",text:"var(--color-blue-700)",ring:"var(--color-blue-200)",dot:"var(--color-blue-500)",btnText:"var(--color-blue-400)",btnHoverBg:"var(--color-blue-100)",btnHoverText:"var(--color-blue-500)"},indigo:{bg:"var(--color-indigo-50)",text:"var(--color-indigo-700)",ring:"var(--color-indigo-200)",dot:"var(--color-indigo-500)",btnText:"var(--color-indigo-400)",btnHoverBg:"var(--color-indigo-100)",btnHoverText:"var(--color-indigo-500)"},purple:{bg:"var(--color-purple-50)",text:"var(--color-purple-700)",ring:"var(--color-purple-200)",dot:"var(--color-purple-500)",btnText:"var(--color-purple-400)",btnHoverBg:"var(--color-purple-100)",btnHoverText:"var(--color-purple-500)"},pink:{bg:"var(--color-pink-50)",text:"var(--color-pink-700)",ring:"var(--color-pink-200)",dot:"var(--color-pink-500)",btnText:"var(--color-pink-400)",btnHoverBg:"var(--color-pink-100)",btnHoverText:"var(--color-pink-500)"},orange:{bg:"var(--color-orange-50)",text:"var(--color-orange-700)",ring:"var(--color-orange-200)",dot:"var(--color-orange-500)",btnText:"var(--color-orange-400)",btnHoverBg:"var(--color-orange-100)",btnHoverText:"var(--color-orange-500)"}},Oe={sm:"2px 8px",md:"2px 10px",lg:"4px 12px"},Pe={sm:"2px 6px",md:"2px 8px",lg:"4px 10px"},Ve={sm:"12px",md:"14px",lg:"14px"};function qe(e,t){return"modern"===e?r(r({},Ye[t]),{bg:"var(--color-bg-primary)",text:"var(--color-text-secondary)",ring:"var(--color-border-secondary)"}):Ye[t]}function _e(e,t,n,o){var i=qe(e,t),a="pill"===e,l="lg"===n&&!a,s="inset 0 0 0 1px ".concat(i.ring),d="modern"===e?"".concat(s,", 0px 1px 2px 0px rgba(10, 13, 18, 0.05)"):s;return r({display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",width:"max-content",borderRadius:a?"9999px":l?"8px":"6px",backgroundColor:i.bg,color:i.text,boxShadow:d,fontFamily:"DM Sans, system-ui, sans-serif",fontWeight:500,fontSize:Ve[n],lineHeight:"sm"===n?"18px":"20px",padding:a?Oe[n]:Pe[n]},o)}var Xe=function(t){var n=t.color;return e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:"4",cy:"4",r:"3",fill:n})})},Ze=function(t){var n=t.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",style:n,children:e.jsx("path",{d:"M9 3L3 9M3 3l6 6"})})},Ke={xs:{size:24,border:.5,fontSize:"var(--font-size-text-xs)",lineHeight:"var(--line-height-text-xs)",iconSize:16,onlineIndicator:{size:6,offset:-.5},companyIcon:{size:10,offset:-2.5,border:1.5},verifiedTick:{size:10,offset:-1.5}},sm:{size:32,border:.75,fontSize:"var(--font-size-text-sm)",lineHeight:"var(--line-height-text-sm)",iconSize:20,onlineIndicator:{size:8,offset:-.75},companyIcon:{size:12,offset:-2.75,border:1.5},verifiedTick:{size:12,offset:-.75}},md:{size:40,border:1,fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",iconSize:24,onlineIndicator:{size:10,offset:-1},companyIcon:{size:14,offset:-3,border:1.5},verifiedTick:{size:14,offset:-1}},lg:{size:48,border:1,fontSize:"var(--font-size-text-lg)",lineHeight:"var(--line-height-text-lg)",iconSize:28,onlineIndicator:{size:12,offset:-1},companyIcon:{size:16,offset:-3,border:1.5},verifiedTick:{size:16,offset:-1}},xl:{size:56,border:1,fontSize:"var(--font-size-text-xl)",lineHeight:"var(--line-height-text-xl)",iconSize:32,onlineIndicator:{size:14,offset:-1},companyIcon:{size:18,offset:-3,border:1.5},verifiedTick:{size:18,offset:-1}},"2xl":{size:64,border:1,fontSize:"var(--font-size-display-xs)",lineHeight:"var(--line-height-display-xs)",iconSize:32,onlineIndicator:{size:16,offset:-1},companyIcon:{size:20,offset:-3,border:1.667},verifiedTick:{size:20,offset:-1}}},Ge={sm:{gap:"var(--spacing-md)",nameFontSize:"var(--font-size-text-sm)",nameLineHeight:"var(--line-height-text-sm)",subFontSize:"var(--font-size-text-xs)",subLineHeight:"var(--line-height-text-xs)"},md:{gap:"var(--spacing-md)",nameFontSize:"var(--font-size-text-sm)",nameLineHeight:"var(--line-height-text-sm)",subFontSize:"var(--font-size-text-sm)",subLineHeight:"var(--line-height-text-sm)"},lg:{gap:"var(--spacing-lg)",nameFontSize:"var(--font-size-text-md)",nameLineHeight:"var(--line-height-text-md)",subFontSize:"var(--font-size-text-md)",subLineHeight:"var(--line-height-text-md)"},xl:{gap:"var(--spacing-xl)",nameFontSize:"var(--font-size-text-lg)",nameLineHeight:"var(--line-height-text-lg)",subFontSize:"var(--font-size-text-md)",subLineHeight:"var(--line-height-text-md)"}},Je=function(t){var n=t.style;return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:n,children:e.jsx("path",{d:"M20 21C20 19.6044 20 18.9067 19.8278 18.3389C19.44 17.0605 18.4395 16.06 17.1611 15.6722C16.5933 15.5 15.8956 15.5 14.5 15.5H9.5C8.10444 15.5 7.40665 15.5 6.83886 15.6722C5.56045 16.06 4.56004 17.0605 4.17224 18.3389C4 18.9067 4 19.6044 4 21M16.5 7.5C16.5 9.98528 14.4853 12 12 12C9.51472 12 7.5 9.98528 7.5 7.5C7.5 5.01472 9.51472 3 12 3C14.4853 3 16.5 5.01472 16.5 7.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},Ue=function(t){var n=t.size,o=t.offset;return e.jsxs("svg",{viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",bottom:o,right:o,width:n,height:n,flexShrink:0,color:"var(--color-blue-500)",overflow:"hidden",zIndex:1},children:[e.jsx("path",{d:"M7.72237 1.77098C7.81734 2.00068 7.99965 2.18326 8.2292 2.27858L9.03413 2.61199C9.26384 2.70714 9.44635 2.88965 9.5415 3.11936C9.63665 3.34908 9.63665 3.60718 9.5415 3.83689L9.20833 4.64125C9.11313 4.87106 9.113 5.12943 9.20863 5.35913L9.54122 6.16325C9.58839 6.27702 9.61268 6.39897 9.6127 6.52214C9.61272 6.6453 9.58847 6.76726 9.54134 6.88105C9.4942 6.99484 9.42511 7.09823 9.33801 7.18531C9.2509 7.27238 9.14749 7.34144 9.03369 7.38854L8.22934 7.72171C7.99964 7.81669 7.81706 7.99899 7.72174 8.22855L7.38833 9.03348C7.29318 9.26319 7.11067 9.4457 6.88096 9.54085C6.65124 9.636 6.39314 9.636 6.16343 9.54085L5.35907 9.20767C5.12935 9.11276 4.87134 9.11295 4.64177 9.20821L3.83684 9.54115C3.60725 9.63608 3.34937 9.636 3.11984 9.54092C2.89032 9.44585 2.70791 9.26356 2.6127 9.03409L2.27918 8.22892C2.18421 7.99923 2.0019 7.81665 1.77235 7.72133L0.967421 7.38792C0.737807 7.29281 0.555355 7.11041 0.460169 6.88083C0.364983 6.65125 0.364854 6.39327 0.45981 6.16359L0.792984 5.35924C0.8879 5.12952 0.887707 4.87151 0.792445 4.64193L0.459749 3.83642C0.41258 3.72265 0.388291 3.60069 0.388272 3.47753C0.388252 3.35436 0.412501 3.2324 0.459634 3.11861C0.506767 3.00482 0.57586 2.90144 0.662965 2.81436C0.75007 2.72728 0.853479 2.65822 0.967283 2.61113L1.77164 2.27795C2.00113 2.18306 2.1836 2.00099 2.27899 1.7717L2.6124 0.966768C2.70755 0.737054 2.89006 0.554547 3.11978 0.459397C3.34949 0.364246 3.60759 0.364246 3.83731 0.459397L4.64166 0.792571C4.87138 0.887487 5.12939 0.887293 5.35897 0.792031L6.16424 0.459913C6.39392 0.364816 6.65197 0.364836 6.88164 0.459968C7.11131 0.555099 7.29379 0.737554 7.38895 0.967208L7.72247 1.77238L7.72237 1.77098Z",fill:"currentColor"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95829 3.68932C7.02509 3.58439 7.04747 3.45723 7.02051 3.3358C6.99356 3.21437 6.91946 3.10862 6.81454 3.04182C6.70961 2.97502 6.58245 2.95264 6.46102 2.97959C6.33959 3.00655 6.23384 3.08064 6.16704 3.18557L4.33141 6.06995L3.49141 5.01995C3.41375 4.92281 3.30069 4.8605 3.17709 4.84673C3.05349 4.83296 2.92949 4.86885 2.83235 4.94651C2.73522 5.02417 2.67291 5.13723 2.65914 5.26083C2.64536 5.38443 2.68125 5.50843 2.75891 5.60557L4.00891 7.16807C4.0555 7.22638 4.11533 7.27271 4.18344 7.30323C4.25154 7.33375 4.32595 7.34757 4.40047 7.34353C4.47499 7.3395 4.54747 7.31773 4.61188 7.28004C4.67629 7.24234 4.73077 7.18981 4.77079 7.12682L6.95829 3.68932Z",fill:"white"})]})},Qe=function(n){var o=n.size,i=void 0===o?"md":o,a=n.src,l=n.alt,s=n.initials,d=n.placeholderIcon,c=n.status,u=n.companyIcon,p=n.verified,f=n.style,h=n.className,x=t.useState(!1),g=x[0],v=x[1],m=Ke[i],b=Boolean(a&&!g),y=!b,w=Boolean(c||u||p);return e.jsxs("div",{className:h,style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:m.size,height:m.size,borderRadius:"50%",border:"".concat(m.border,"px solid ").concat(y?"var(--color-border-secondary)":"rgba(0, 0, 0, 0.08)"),backgroundColor:y?"var(--color-bg-tertiary)":void 0,overflow:w?void 0:"hidden",flexShrink:0},f),children:[b?e.jsx("img",{src:a,alt:l,onError:function(){return v(!0)},style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%",pointerEvents:"none"}}):s?e.jsx("span",{style:{fontSize:m.fontSize,lineHeight:m.lineHeight,fontWeight:600,color:"var(--color-text-quaternary)",fontFamily:"var(--font-family-body)",userSelect:"none"},children:s}):d?e.jsx(d,{style:{width:m.iconSize,height:m.iconSize,color:"var(--color-fg-quaternary)",flexShrink:0}}):e.jsx(Je,{style:{width:m.iconSize,height:m.iconSize,color:"var(--color-fg-quaternary)",flexShrink:0}}),function(){if("online"===c||"offline"===c){var t=m.onlineIndicator,n=t.size,o=t.offset;return e.jsx("span",{style:{position:"absolute",bottom:o,right:o,width:n,height:n,borderRadius:"50%",backgroundColor:"online"===c?"var(--color-fg-success-secondary)":"var(--color-fg-quaternary)",border:"1.5px solid var(--color-bg-primary)",flexShrink:0}})}if(u){var r=m.companyIcon,i=r.size,a=(o=r.offset,r.border);return e.jsx("img",{src:u.src,alt:u.alt,style:{position:"absolute",bottom:o,right:o,width:i,height:i,borderRadius:"50%",border:"".concat(a,"px solid var(--color-bg-primary)"),objectFit:"cover",pointerEvents:"none"}})}return p?e.jsx(Ue,{size:m.verifiedTick.size,offset:m.verifiedTick.offset}):null}()]})};exports.Alert=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,l=n.title,s=n.description,d=n.icon,c=void 0===d?v[a]:d,u=n.showIcon,p=void 0===u||u,f=n.closeable,h=void 0!==f&&f,x=n.action,g=n.children,b=n.onClose,y=t.useState(!0),w=y[0],C=y[1],k=function(){C(!1),null==b||b()};return w?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[p&&c,e.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[l&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:l}),s&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),g&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:g}),x&&h&&x]}),x&&!h&&e.jsx("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:x}),h&&e.jsx("div",{className:"flex-shrink-0 self-start mt-1 cursor-pointer",onClick:k,onKeyDown:function(e){return"Enter"===e.key&&k()},role:"button",tabIndex:0,"aria-label":"关闭",children:m})]}):null},exports.Avatar=Qe,exports.AvatarLabelGroup=function(t){var n=t.size,o=void 0===n?"sm":n,i=t.name,a=t.supportingText,l=t.avatarSrc,s=t.avatarInitials,d=t.status,c=t.companyIcon,u=t.verified,p=t.style,f=t.className,h=Ge[o];return e.jsxs("div",{className:f,style:r({display:"inline-flex",alignItems:"center",gap:h.gap,position:"relative"},p),children:[e.jsx(Qe,{size:o,src:l,initials:s,status:d,companyIcon:c,verified:u}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",flexShrink:0,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{fontSize:h.nameFontSize,lineHeight:h.nameLineHeight,fontWeight:600,color:"var(--color-text-primary)",fontFamily:"var(--font-family-body)"},children:i}),a&&e.jsx("span",{style:{fontSize:h.subFontSize,lineHeight:h.subLineHeight,fontWeight:400,color:"var(--color-text-tertiary)",fontFamily:"var(--font-family-body)"},children:a})]})]})},exports.Badge=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.children,c=t.style,u=t.className;return e.jsx("span",{style:r(r({},_e(o,s,a)),c),className:u,children:d})},exports.BadgeIcon=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.icon,c=t.style,u=t.className,p=qe(o,s),f="modern"===o?Ye[s].dot:p.dot,h={sm:"12px",md:"12px",lg:"14px"};return e.jsx("span",{style:r(r(r({},_e(o,s,a)),{padding:{sm:"5px",md:"6px",lg:"8px"}[a]}),c),className:u,children:e.jsx(d,{style:{width:h[a],height:h[a],color:f}})})},exports.BadgeWithButton=function(n){var o=n.variant,i=void 0===o?"pill":o,a=n.size,l=void 0===a?"md":a,s=n.color,d=void 0===s?"gray":s,c=n.icon,u=n.buttonLabel,p=n.onButtonClick,f=n.children,h=n.style,x=n.className,g=t.useState(!1),v=g[0],m=g[1],b=qe(i,d),y="pill"===i,w={sm:y?"8px":"6px",md:y?"10px":"8px",lg:y?"12px":"10px"},C={sm:"3px",md:"4px",lg:"6px"},k=y?"9999px":"3px";return e.jsxs("span",{style:r(r(r({},_e(i,d,l)),{gap:{sm:"2px",md:"2px",lg:"2px"}[l],paddingLeft:w[l],paddingRight:C[l],paddingTop:"lg"===l?"4px":"2px",paddingBottom:"lg"===l?"4px":"2px"}),h),className:x,children:[f,e.jsx("button",{type:"button","aria-label":u,onClick:p,onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"2px",border:"none",cursor:"pointer",borderRadius:k,backgroundColor:v?b.btnHoverBg:"transparent",color:v?b.btnHoverText:b.btnText,transition:"background-color 100ms linear, color 100ms linear",outline:"none",flexShrink:0},children:c?e.jsx(c,{style:{width:"12px",height:"12px"}}):e.jsx(Ze,{})})]})},exports.BadgeWithDot=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.children,c=t.style,u=t.className,p=qe(o,s),f="modern"===o?Ye[s].dot:p.dot,h="pill"===o,x={sm:"6px",md:"8px",lg:"10px"},g={sm:h?"8px":"6px",md:h?"10px":"8px",lg:h?"12px":"10px"};return e.jsxs("span",{style:r(r(r({},_e(o,s,a)),{gap:{sm:"4px",md:"6px",lg:"6px"}[a],paddingLeft:x[a],paddingRight:g[a],paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),c),className:u,children:[e.jsx(Xe,{color:f}),d]})},exports.BadgeWithIcon=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.iconLeading,c=t.iconTrailing,u=t.children,p=t.style,f=t.className,h=qe(o,s),x="modern"===o?Ye[s].dot:h.dot,g={sm:"12px",md:"12px",lg:"14px"},v="pill"===o,m=!!d,b={sm:{pl:m?"6px":"8px",pr:m?"8px":"6px"},md:{pl:v?m?"8px":"10px":"8px",pr:v&&m?"10px":"8px"},lg:{pl:v?m?"10px":"12px":"10px",pr:v&&m?"12px":"10px"}};return e.jsxs("span",{style:r(r(r({},_e(o,s,a)),{gap:{sm:"2px",md:"4px",lg:"4px"}[a],paddingLeft:b[a].pl,paddingRight:b[a].pr,paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),p),className:f,children:[d&&e.jsx(d,{style:{width:g[a],height:g[a],color:x,flexShrink:0}}),u,c&&e.jsx(c,{style:{width:g[a],height:g[a],color:x,flexShrink:0}})]})},exports.BadgeWithImage=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.imgSrc,c=t.imgAlt,u=void 0===c?"avatar":c,p=t.children,f=t.style,h=t.className,x="pill"===o,g={sm:x?"3px":"4px",md:x?"4px":"6px",lg:x?"6px":"8px"},v={sm:x?"8px":"6px",md:x?"10px":"8px",lg:x?"12px":"10px"},m={sm:"16px",md:"16px",lg:"18px"};return e.jsxs("span",{style:r(r(r({},_e(o,s,a)),{gap:{sm:"4px",md:"6px",lg:"6px"}[a],paddingLeft:g[a],paddingRight:v[a],paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),f),className:h,children:[e.jsx("img",{src:d,alt:u,style:{width:m[a],height:m[a],borderRadius:"9999px",objectFit:"cover",flexShrink:0}}),p]})},exports.Button=g,exports.CheckIcon=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},exports.Checkbox=$,exports.DatePicker=ke,exports.Drawer=Ie,exports.Form=De,exports.Input=q,exports.InputGroup=I,exports.InputTags=Y,exports.Loading=function(n){var o=n.width,r=void 0===o?80:o,i=n.height,a=void 0===i?80:i,l=n.strokeWidth,s=n.color,d=void 0===s?"var(--theme-color, #5A31F0)":s,c=n.className,u=t.useState(0),p=u[0],f=u[1],h=t.useRef(null);t.useEffect(function(){var e,t=function(n){null===h.current&&(h.current=n),f(n-h.current),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),function(){return cancelAnimationFrame(e)}},[]);for(var x,g,v=p,m=(g=v%(x=We).pulseDurationMs/x.pulseDurationMs*Math.PI*2,.52+(Math.sin(g+.55)+1)/2*.48),b=v%We.durationMs/We.durationMs,y=function(e,t){return t.rotate?-e%t.rotationDurationMs/t.rotationDurationMs*360:0}(v,We),w=null!=l?l:We.strokeWidth,C=w/We.strokeWidth,k=function(e,t,n){void 0===n&&(n=480);for(var o=[],r=0;r<=n;r+=1){var i=Ne(r/n,e,t);o.push("".concat(0===r?"M":"L"," ").concat(i.x.toFixed(2)," ").concat(i.y.toFixed(2)))}return o.join(" ")}(m,We),F=[],j=0;j<We.particleCount;j+=1){var S=He(j,b,m,We);F.push({cx:S.x,cy:S.y,opacity:S.opacity,r:S.radius*C})}return e.jsx("div",{className:c,style:{width:r,height:a,display:"inline-block",color:d},role:"status","aria-label":"Loading",children:e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",preserveAspectRatio:"xMidYMid meet",style:{overflow:"visible"},children:[e.jsx("title",{children:"Thinking Five"}),e.jsxs("g",{transform:"rotate(".concat(y," 50 50)"),children:[e.jsx("path",{d:k,stroke:"currentColor",strokeWidth:w,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.1}),F.map(function(t,n){return e.jsx("circle",{cx:t.cx,cy:t.cy,r:t.r,fill:"currentColor",opacity:t.opacity},n)})]})]})})},exports.MenuList=ze,exports.MinusIcon=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},exports.Pagination=Q,exports.Popover=Ae,exports.Progress=function(n){var o=n.percent,a=void 0===o?0:o,l=n.type,s=void 0===l?"circle":l,d=n.width,c=void 0===d?120:d,p=n.title,f=n.titlePosition,h=n.showPercent,x=void 0===h||h,g=n.animated,v=void 0!==g&&g,m=n.status,b=void 0===m?"normal":m,y=n.className,w=void 0===y?"":y,C=n.style,k=n.strokeColor,F=n.trailColor,j=void 0===F?"#F5F5F4":F,S=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),D=u().primaryColor,z=Math.min(100,Math.max(0,a)),M=t.useRef(!0),E=t.useState(!1),L=E[0],T=E[1],B=t.useState(0),A=B[0],R=B[1];t.useEffect(function(){if(v&&M.current&&z>0){M.current=!1,R(0),T(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){R(z)})});var e=setTimeout(function(){T(!1),R(z)},300);return function(){return clearTimeout(e)}}M.current?(M.current=!1,T(!1),R(z)):R(z)},[v,z]);var I=k||D||"#FB6011";"success"===b?I="#00BC7D":"exception"===b&&(I="#FB2C36");var W=f||"inside",N=Math.max(4,Math.round(.06*c)),H=(c-N)/2,Y="semicircle"===s?c/2:c,O="14px",P="12px",V=function(){var t=p&&"outside"===W?c+4+18+4:c,n=2*Math.PI*H,o=n-(L?A:z)/100*n;return e.jsxs("div",{style:{position:"relative",width:c,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:c,height:c,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:c/2,cy:c/2,r:H,fill:"none",stroke:j,strokeWidth:N,strokeLinecap:"round"}),e.jsx("circle",{cx:c/2,cy:c/2,r:H,fill:"none",stroke:I,strokeWidth:N,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(c/2," ").concat(c/2,")"),style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===W?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(c/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")}),p&&"outside"===W&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(c,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=r({display:"inline-flex",flexDirection:"column",alignItems:"center",width:c},C);return e.jsx("div",r({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},S,{children:function(){switch(s){case"circle":return V();case"semicircle":return n=N/2,o=c-N/2,r=(t=Y+N)-N/2,i=Y/2+N/2+N/2,a=p&&"outside"===W?t+4+18+4:t,l=Math.PI*H,d=l-(L?A:z)/100*l,e.jsxs("div",{style:{position:"relative",width:c,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:c,height:t,viewBox:"0 0 ".concat(c," ").concat(t),style:{position:"absolute",top:0,left:0},children:[e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:j,strokeWidth:N,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:I,strokeWidth:N,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:d,style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===W?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")}),p&&"outside"===W&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),V()}var t,n,o,r,i,a,l,d}()}))},exports.Radio=ie,exports.Select=_,exports.Switch=ge,exports.Tab=function(n){var o=n.items,a=void 0===o?[]:o,l=n.variant,s=void 0===l?"underline":l,d=n.layout,c=void 0===d?"equal":d,p=n.defaultValue,f=n.value,h=n.onChange,x=n.className,g=void 0===x?"":x,v=n.mode,m=void 0===v?"children":v,b=n.scrollable,y=void 0!==b&&b,w=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=u().primaryColor;if(!a||0===a.length)return null;var k=t.useMemo(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),F=void 0!==f,j=k.length>0?k[0].key:"",S=function(e){if(void 0===e)return j;var t=k.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:j},D=t.useState(function(){var e,t=null!==(e=null!=f?f:p)&&void 0!==e?e:j;return S(t)}),z=D[0],M=D[1],E=F?void 0!==f?S(f):j:z;t.useEffect(function(){console.log("[Tab Debug] currentValue:",E,"type:",typeof E),console.log("[Tab Debug] normalizedItems:",k.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",f,"isControlled:",F)},[E,k,f,F]);var L=t.useCallback(function(e,t){if(!t){F||M(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==h||h(n),y&&"underline"===s){var o=A.current[R(e)],r=N.current;if(o&&r){O.current=!0;var i,l=function(){if(r&&I.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},d=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),O.current=!1,r.removeEventListener("scroll",d)},150)};r.addEventListener("scroll",d,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[F,h,a,y,s]),T=k.find(function(e){if(e.key===E)return!0;if(String(e.key)===String(E))return!0;var t=Number(e.key),n=Number(E);return!isNaN(t)&&!isNaN(n)&&t===n}),B=C||"#FB6011",A=t.useRef({}),R=function(e){return String(e)},I=t.useRef(null),W=t.useRef(null),N=t.useRef(null),H=t.useRef(null),Y=t.useRef("");t.useRef(new Set);var O=t.useRef(!1),P=t.useState({width:0,left:0,opacity:0}),V=P[0],q=P[1],_=t.useState({width:0,left:0,opacity:0}),X=_[0],Z=_[1],K=t.useCallback(function(){"underline"===s&&N.current&&E&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(I.current&&N.current){var e=A.current[R(E)];if(!e&&k.length>0){var t=k[0].key;e=A.current[R(t)]}if(e){var n=N.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=N.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),s="".concat(a,"px");q(function(e){return e.left===l&&e.width===s&&1===e.opacity?e:{width:s,left:l,opacity:1}})}}}})})},[s,E,k]),G=t.useCallback(function(){"background"===s&&H.current&&W.current&&E&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&H.current){var e=A.current[R(E)];if(!e&&k.length>0){var t=k[0].key;e=A.current[R(t)]}if(e){var n=H.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");Z(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[s,E,k]);t.useEffect(function(){E?Y.current!==E&&(Y.current=E,"underline"===s&&N.current&&!O.current&&K(),"background"===s&&H.current&&W.current&&G()):Y.current=""},[E,s,k.length,F,K,G]),t.useEffect(function(){if(E){var e=setTimeout(function(){if("underline"===s)(e=A.current[R(E)])&&N.current&&I.current&&(K(),y&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=A.current[R(E)])&&H.current&&W.current){var t=H.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");Z({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),t.useEffect(function(){if(y&&"underline"===s&&E&&!O.current){var e=setTimeout(function(){var e=A.current[R(E)],t=N.current;if(e&&t){O.current=!0;var n,o=function(){if(t&&I.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),O.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[E,y,s]);var J;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(J={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},y&&(J.overflowX="auto",J.overflowY="hidden",J.scrollBehavior="smooth",J.scrollbarWidth="none",J.WebkitOverflowScrolling="touch"),e.jsxs("div",r({ref:N,className:"aha-tab aha-tab--underline ".concat(y?"aha-tab--scrollable":""," ").concat(g),style:J},w,{children:[e.jsx("div",{ref:I,style:r({position:"absolute",bottom:"0px",height:"2px",backgroundColor:B,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},V)}),k.map(function(n){var o=function(){if(n.key===E)return!0;if(String(n.key)===String(E))return!0;var e=Number(n.key),t=Number(E);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===k[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:E,currentValueType:typeof E,isActive:o,variant:s}),e.jsxs("div",{ref:function(e){A.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:y?0:void 0,whiteSpace:y?"nowrap":void 0},children:[n.icon&&function(){var i,a=typeof n.icon,l=t.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:a,isReactElement:l,iconValue:n.icon}),t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:20,height:20,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?B:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:20,height:20,style:{color:o?B:"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?B:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===c?"100%":"fit-content",e.jsxs("div",r({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(c," ").concat(g),style:n},w,{children:[e.jsx("div",{ref:W,style:r({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},X)}),k.map(function(n){var o=function(){if(n.key===E)return!0;if(String(n.key)===String(E))return!0;var e=Number(n.key),t=Number(E);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===k[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:E,currentValueType:typeof E,isActive:o,variant:s});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===c?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return e.jsxs("div",{ref:function(e){A.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:i,children:[n.icon&&function(){var i;return t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:16,height:16,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),y&&"underline"===s&&e.jsx("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===m&&(null==T?void 0:T.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:T.children})]})},exports.Table=function(n){var o,a,l,d,c=n.columns,p=void 0===c?[]:c,f=n.dataSource,h=void 0===f?[]:f,x=n.rowKey,g=void 0===x?"key":x,v=n.rowSelection,m=n.pagination,b=void 0!==m&&m,y=n.size,w=void 0===y?"middle":y,C=n.bordered,k=void 0!==C&&C,F=n.loading,j=void 0!==F&&F,S=n.locale,D=n.showHeader,z=void 0===D||D,M=n.title,E=n.footer,L=n.summary,T=n.scroll,B=n.tableLayout,A=void 0===B?"auto":B,R=n.onChange,I=n.onSorterChange,W=n.onPaginationChange,N=n.onRow,H=n.className,Y=void 0===H?"":H,O=n.innerClassName,P=void 0===O?"":O,V=n.style,q=n.expandable,_=n.rowClassName,X=n.onHeaderRow;n.sticky;var Z=i(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),K=u().primaryColor||"#FB6011",G=t.useState((null==v?void 0:v.selectedRowKeys)||(null==v?void 0:v.defaultSelectedRowKeys)||[]),J=G[0],U=G[1];t.useEffect(function(){void 0!==(null==v?void 0:v.selectedRowKeys)&&U(v.selectedRowKeys)},[null==v?void 0:v.selectedRowKeys]);var ee=t.useState(new Map),ie=ee[0],ae=ee[1],le=t.useState((null==q?void 0:q.defaultExpandedRowKeys)||[]),se=le[0],de=le[1],ce=t.useState(b&&"object"==typeof b&&(b.current||b.defaultCurrent)||1),ue=ce[0],pe=ce[1],fe=t.useState(b&&"object"==typeof b&&(b.pageSize||b.defaultPageSize)||10),he=fe[0],xe=fe[1];t.useEffect(function(){b&&"object"==typeof b&&(void 0!==b.current&&pe(b.current),void 0!==b.pageSize&&xe(b.pageSize))},[b]);var ge=t.useState(null),ve=ge[0],me=ge[1],be=t.useState(null),ye=be[0],we=be[1],Ce=t.useState(!1),ke=Ce[0],Fe=Ce[1],je=t.useRef(null),Se=t.useRef(null);t.useEffect(function(){var e=function(){Fe(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var De=t.useCallback(function(e,t){var n,o,r,i=null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e);if(!(null==i?void 0:i.disabled)){var a,l=oe(e,g);a="radio"===(null==v?void 0:v.type)?t?[l]:[]:t?s(s([],J,!0),[l],!1):J.filter(function(e){return e!==l}),U(a);var d=h.filter(function(e){return a.includes(oe(e,g))});null===(o=null==v?void 0:v.onChange)||void 0===o||o.call(v,a,d),null===(r=null==v?void 0:v.onSelect)||void 0===r||r.call(v,e,t,d,new Event("select"))}},[J,g,v,h]),ze=t.useCallback(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}).map(function(e){return oe(e,g)}),i=e?r:[];U(i);var a=h.filter(function(e){return i.includes(oe(e,g))}),l=e?t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}):[];null===(n=null==v?void 0:v.onChange)||void 0===n||n.call(v,i,a),null===(o=null==v?void 0:v.onSelectAll)||void 0===o||o.call(v,e,a,l)},[g,v,h]),Me=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),I&&I(1===r.length?r[0]:r),R&&R({current:ue,pageSize:he},{},1===r.length?r[0]:r,{currentDataSource:h,action:"sort"})}},[ie,R,I,ue,he,h,p]);t.useCallback(function(e,t){var n,o,r,i=oe(e,g);r=t?s(s([],se,!0),[i],!1):se.filter(function(e){return e!==i}),de(r),null===(n=null==q?void 0:q.onExpand)||void 0===n||n.call(q,t,e),null===(o=null==q?void 0:q.onExpandedRowsChange)||void 0===o||o.call(q,r)},[se,g,q]);var Ee,Le=t.useCallback(function(){var e=s([],h,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,t);else if(!0===r.sorter){var a=ne(e,r.dataIndex||n),l=ne(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[h,ie,p]),Te=Le(),Be=Boolean(b&&"object"==typeof b&&void 0!==b.total),Ae=t.useMemo(function(){if(!1===b||!b)return Te;if(Be)return Te;var e=(ue-1)*he,t=e+he;return Te.slice(e,t)},[Te,ue,he,b,Be]),Re=t.useCallback(function(e,t){var n,o,r=null!=t?t:he;if(pe(e),t&&xe(t),W&&W(e,r),b&&"object"==typeof b&&(null===(n=b.onChange)||void 0===n||n.call(b,e,t),t&&(null===(o=b.onShowSizeChange)||void 0===o||o.call(b,e,t))),R){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});R({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:Te,action:"paginate"})}},[b,W,R,he,ie,p,Te]),Ie=t.useCallback(function(e,t,n){var o=ne(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),We=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(v&&("left"===v.fixed||!0===v.fixed))r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=p[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===o){for(i=e+1;i<p.length;i++){var a;if("right"===(a=p[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(v&&"right"===v.fixed)r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;return r}}},[p,v]),Ne=t.useCallback(function(){if(!z)return null;var t,n,o,i,a=p.map(function(t,n){var o,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=ie.get(i)||null,l=We(n,t.fixed,!0),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("th",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:a,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){Me(t,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e.jsx(re,{order:a||void 0})})]})}),i)});if(v){var l="number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!v.hideSelectAll&&"radio"!==v.type&&(t=Ae.filter(function(e){var t;return!(null===(t=v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}),n=t.map(function(e){return oe(e,g)}),o=t.length>0&&n.every(function(e){return J.includes(e)}),i=n.some(function(e){return J.includes(e)}),e.jsx($,{checked:o,indeterminate:i&&!o,onChange:function(e){return ze(e.target.checked,Ae)}})),v.columnTitle&&e.jsx("span",{style:{marginLeft:v.hideSelectAll?0:"8px"},children:v.columnTitle})]})},"selection");a.unshift(s)}var d=null==X?void 0:X(p,0);return e.jsx("thead",{ref:Se,children:e.jsx("tr",r({},d||{},{children:a}))})},[p,z,ie,v,J,Ae,g,Me,ze,S,X,We]),He=t.useCallback(function(e){me(e)},[]),Ye=t.useCallback(function(e,t){e.preventDefault(),we(t)},[]),Oe=t.useCallback(function(e,t){if(e.preventDefault(),null===ve||ve===t)return me(null),void we(null);var n=s([],Ae,!0),o=n[ve];n.splice(ve,1),n.splice(t,0,o),me(null),we(null)},[ve,Ae]),Pe=t.useCallback(function(){me(null),we(null)},[]),Ve=t.useCallback(function(){var t=null==S?void 0:S.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=p.length+(v?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==S?void 0:S.emptyText,p.length,v]),qe=t.useCallback(function(){return 0===Ae.length?Ve():Ae.map(function(n,o){var i,a=oe(n,g),l=J.includes(a),s=se.includes(a),d=(null==N?void 0:N(n,o))||{},c=o===Ae.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",r({className:"".concat("function"==typeof _?_(n,o):_||""," ").concat(ve===o?"dragging":""," ").concat(ye===o?"drag-over":""),draggable:!0,onDragStart:function(){return He(o)},onDragOver:function(e){return Ye(e,o)},onDrop:function(e){return Oe(e,o)},onDragEnd:Pe,style:r({cursor:"move",opacity:ve===o?.5:1,backgroundColor:ye===o?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ve!==o&&ye!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&ye!==o&&(e.currentTarget.style.backgroundColor="white")}},d,{children:[v&&e.jsx("td",{style:{width:"number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx($,{checked:l,onChange:function(e){return De(n,e.target.checked)},disabled:null===(i=v.getCheckboxProps)||void 0===i?void 0:i.call(v,n).disabled})})}),p.map(function(t,i){var a,l=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,s=(null===(a=t.onCell)||void 0===a?void 0:a.call(t,n,o))||{},d=We(i,t.fixed,!1),u=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("td",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:r({width:u,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:u||void 0,maxWidth:u,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,right:"right"===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},s.style),colSpan:t.colSpan,rowSpan:t.rowSpan},s,{children:Ie(t,n,o)}),l)})]})),(null==q?void 0:q.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:q.expandedRowRender(n,o,0,!0)})})]},a)})},[Ae,g,J,se,v,p,N,_,De,Ie,q,ve,ye,He,Ye,Oe,Pe,We,Ve]),_e=function(){var t;if(!1===b||!b)return null;var n=null!==(t=b.total)&&void 0!==t?t:Te.length,o=b.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e.jsx(Q,{current:ue,total:n,pageSize:he,showSizeChanger:b.showSizeChanger,pageSizeOptions:b.pageSizeOptions,showQuickJumper:b.showQuickJumper,showTotal:b.showTotal,onChange:Re,onShowSizeChange:Re,simple:b.simple,responsive:b.responsive,size:"small"===w?"small":"default"})})},Xe=t.useMemo(function(){return p.some(function(e){return e.fixed})||v&&v.fixed},[p,v]),Ze=t.useMemo(function(){return p.every(function(e){return e.width})&&(!v||v.columnWidth)},[p,v]),Ke=t.useMemo(function(){if(null==T?void 0:T.x){if("number"==typeof T.x)return T.x;if(!0===T.x)return p.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(v?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth||"60").replace("px",""))||60:0)}if(Xe)return p.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(v&&v.fixed&&v.columnWidth?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth).replace("px",""))||60:0)},[p,null==T?void 0:T.x,v,Xe]),Ge=t.useMemo(function(){return"fixed"===A||Xe||Ze||p.some(function(e){return e.width})?"fixed":A},[A,Xe,Ze,p]),Je=r(r({width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ge,backgroundColor:"white"},k&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=r({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"},V);if(ke)return e.jsxs("div",r({ref:je,className:"aha-table aha-table-mobile-wrapper ".concat(Y),style:Ue,"aria-busy":!!j||void 0},Z,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(Te)}),b&&"object"==typeof b&&(null===(o=b.position)||void 0===o?void 0:o.startsWith("top"))&&_e(),(Ee="function"==typeof(null==S?void 0:S.emptyText)?S.emptyText():void 0!==(null==S?void 0:S.emptyText)?S.emptyText:"No data",0===Ae.length?e.jsx("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Ee}):e.jsx("div",{className:"aha-table-mobile",children:Ae.map(function(t,n){var o,r=oe(t,g),i=J.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[v&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx($,{checked:i,onChange:function(e){return De(t,e.target.checked)},disabled:null===(o=v.getCheckboxProps)||void 0===o?void 0:o.call(v,t).disabled})}),p.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=ne(t,o.dataIndex||""),a=o.render?o.render(i,t,n):i;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(Te)}),b&&("object"!=typeof b||!(null===(a=b.position)||void 0===a?void 0:a.startsWith("top")))&&_e(),e.jsx(te,{loading:j,spinColor:K})]}));var Qe={position:"relative",overflowX:(null==T?void 0:T.x)||Xe?"auto":"visible",overflowY:(null==T?void 0:T.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==T?void 0:T.x)?"100%":"number"==typeof(null==T?void 0:T.x)?"".concat(T.x,"px"):void 0,maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",r({ref:je,className:"aha-table ".concat(Y),style:Ue,"aria-busy":!!j||void 0},Z,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(Te)}),b&&"object"==typeof b&&(null===(l=b.position)||void 0===l?void 0:l.startsWith("top"))&&_e(),e.jsx("div",{style:Qe,children:e.jsx("div",{style:{width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Je,className:P,children:[Ne(),e.jsx("tbody",{children:qe()}),L&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:L(Te)})})})]})})}),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(Te)}),b&&("object"!=typeof b||!(null===(d=b.position)||void 0===d?void 0:d.startsWith("top")))&&_e(),e.jsx(te,{loading:j,spinColor:K})]}))},exports.Tag=B,exports.Textarea=xe,exports.TextareaTags=function(t){var n=t.minHeight,o=void 0===n?120:n,a=t.style,l=t.label,s=t.required,d=t.hintText,c=t.helpIcon,u=t.error,p=i(t,["minHeight","style","label","required","hintText","helpIcon","error"]),f=e.jsx(Y,r({error:u,style:r({minHeight:"".concat(o,"px"),alignItems:"flex-start",overflow:"auto",resize:"vertical"},a)},p));return l||d?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[l&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)",display:"flex",alignItems:"center"},children:[l,s&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"}),c&&e.jsx("span",{style:{marginLeft:"4px",display:"inline-flex",alignItems:"center",color:"var(--color-fg-quaternary)"},children:c})]}),f,d&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:u?"var(--color-error-600)":"var(--color-text-tertiary)"},children:d})]}):f},exports.ThemeProvider=function(n){var o=n.theme,i=n.children,a=t.useMemo(function(){return r(r({},d),o)},[o]);return e.jsx(c.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(F,{id:"direct",props:t})},exports.ToastProvider=function(o){var r=o.children,i=t.useState(!1),a=i[0],l=i[1];return t.useEffect(function(){l(!0)},[]),e.jsxs(e.Fragment,{children:[r,a&&n.createPortal(e.jsx(k,{}),document.body)]})},exports.Tooltip=function(o){var i=o.content,a=o.children,l=o.position,s=void 0===l?"top":l,d=o.trigger,c=void 0===d?"hover":d,u=o.delay,p=void 0===u?200:u,f=o.disabled,h=void 0!==f&&f,x=o.className,g=void 0===x?"":x,v=o.tooltipClassName,m=void 0===v?"":v,b=o.gap,y=void 0===b?6:b,w=o.showArrow,C=void 0===w||w,k=o.width,F=o.defaultVisible,j=void 0!==F&&F,S=o.visible,D=o.onVisibleChange,z=void 0!==S,M=t.useState(j),E=M[0],L=M[1],T=z?S:E,B=t.useState(z?null!=S&&S:j),A=B[0],R=B[1],I=t.useCallback(function(e){z||L(e),null==D||D(e)},[z,D]);t.useEffect(function(){z&&(S?requestAnimationFrame(function(){R(!0)}):R(!1))},[z,S]);var W=t.useState(s),N=W[0],H=W[1],Y=t.useState("320px"),O=Y[0],P=Y[1],V=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===c?"auto":"none"}),q=V[0],_=V[1],X=t.useState({}),Z=X[0],K=X[1],G=t.useRef(null),J=t.useRef(null),U=t.useRef(null),Q=t.useRef(null),$=t.useCallback(function(){if(G.current&&J.current&&T&&A){var e=G.current.getBoundingClientRect(),t=J.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!Ee(e,t,n,o))return n;for(var r=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);r<i.length;r++){var a=i[r];if(!Ee(e,t,a,o))return a}return n}(e,t,s,y);H(n);var o=Me(e,t,n,y),i=o.top,a=o.left;if(_(function(e){return r(r({},e),{position:"absolute",top:"".concat(i,"px"),left:"".concat(a,"px"),pointerEvents:"hover"===c?"auto":"none",zIndex:9999})}),C){var l=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,d=o-i,c=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-d,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-d,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-c,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-c,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,a,i);K(l)}}},[T,s,y,C,A,c]),ee=t.useCallback(function(){h||(Q.current&&(clearTimeout(Q.current),Q.current=null),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){I(!0),z||requestAnimationFrame(function(){R(!0)})},p))},[h,p,I,z]),te=t.useCallback(function(){U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),z?I(!1):(R(!1),Q.current=setTimeout(function(){I(!1),Q.current=null},150))},[I,z]),ne=t.useCallback(function(){"hover"===c&&(Q.current&&(clearTimeout(Q.current),Q.current=null),T||(I(!0),requestAnimationFrame(function(){R(!0)})))},[c,T]),oe=t.useCallback(function(e){h||"click"!==c||(e.stopPropagation(),T?te():(U.current&&(clearTimeout(U.current),U.current=null),I(!0),requestAnimationFrame(function(){R(!0)})))},[h,c,T,te]);t.useEffect(function(){if(j&&T&&A){var e=function(){G.current&&J.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,T,A,$]),t.useEffect(function(){if(T)return requestAnimationFrame(function(){$()}),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),function(){window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[T,$]),t.useEffect(function(){if(T&&"click"===c){var e=function(e){G.current&&J.current&&!G.current.contains(e.target)&&!J.current.contains(e.target)&&te()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[T,c,te]),t.useEffect(function(){return function(){U.current&&clearTimeout(U.current),Q.current&&clearTimeout(Q.current)}},[]);var re={position:"absolute",top:0,left:0,opacity:A?1:0,transform:A?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===c?"auto":"none",zIndex:9999},ie=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){P(ie())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ie]);var ae=r(r({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==k?{width:"number"==typeof k?"".concat(k,"px"):k,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:O,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),le=e.jsxs("div",{style:r(r(r({},re),q),{pointerEvents:"hover"===c?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===c?ne:void 0,onMouseLeave:"hover"===c?te:void 0,children:[e.jsx("div",{ref:J,className:"aha-tooltip ".concat(m),style:ae,role:"tooltip",children:i}),C&&Le(N,Z)]}),se=t.useCallback(function(){"hover"===c&&(Q.current=setTimeout(function(){te()},100))},[c,te]),de="click"===c?{onClick:oe}:{onMouseEnter:ee,onMouseLeave:se,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:G,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===c?"pointer":"default"}},de,{children:a})),T&&"undefined"!=typeof document&&n.createPortal(le,document.body)]})},exports.clearAllToasts=function(){C.clearAll()},exports.closeToast=function(e){C.removeToast(e)},exports.debugToast=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",C.getToasts()),console.log("容器根节点:",D),console.log("是否正在初始化:",z),console.log("====================")},exports.toast=j,exports.toastError=function(e,t){return M(),j(r(r({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return M(),j(r(r({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return M(),j(r(r({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return M(),j(r(r({},t),{message:e,type:"success"}))},exports.useTheme=u;
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function s(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var d={primaryColor:"#FB6011"},c=t.createContext(d),u=function(){var e=t.useContext(c);return e||d},p={25:"#fff9f2",50:"#fff6ed",100:"#ffead5",200:"#ffd1a9",300:"#feb073",400:"#fd843a",500:"#fb6011",600:"#ec470a",700:"#c4330a",800:"#9b2911",900:"#7d2511",950:"#441006"},f={25:"#fffbfa",50:"#fef3f2",100:"#fee4e2",200:"#fecdca",300:"#fda29b",400:"#f97066",500:"#f04438",600:"#d92d20",700:"#b42318",800:"#912018",900:"#7a271a",950:"#55160c"},x={25:"#f5faff",50:"#eff8ff",100:"#d1e9ff",200:"#b2ddff",300:"#84caff",400:"#53b1fd",500:"#2e90fa",600:"#1570ef",700:"#175cd3",800:"#1849a9",900:"#194185",950:"#102a56"},h="#1c1917",g="#44403c",v="#57534e",m="#79716b",y="#79716b",b="#79716b",w="#ffffff",C="#d92d20",k="#d7d3d0",F="#e7e5e4",j="#fb6011",S="#f04438",D="#fda29b",z="#d7d3d0",M="#e7e5e4",E="#ffffff",L="#fafaf9",T="#f5f5f4",A="#f5f5f4",R="#fafaf9",B="#fef3f2",I="#a9a29d",W="#a9a29d",N="#d7d3d0",H="#ffffff",P="#f04438",Y="#17b26a",O={display:'"DM Sans", system-ui, -apple-system, sans-serif',body:'"DM Sans", system-ui, -apple-system, sans-serif',base:'"DM Sans", system-ui, -apple-system, sans-serif'},V={xs:"12px",sm:"14px",base:"16px",md:"16px",lg:"18px",xl:"20px",displayXs:"24px",displaySm:"30px",displayMd:"36px",displayLg:"48px",displayXl:"60px",display2xl:"72px"},q={regular:400,medium:500,semibold:600,bold:700},X={xs:"18px",sm:"20px",base:"24px",md:"24px",lg:"28px",xl:"30px",displayXs:"32px",displaySm:"38px",displayMd:"44px",displayLg:"60px",displayXl:"72px",display2xl:"90px"},Z="2px",K="4px",G="8px",_="12px",J="16px",Q="4px",U="6px",$="8px",ee="0px 1px 2px 0px #0a0d120d",te="inset 0px 0px 0px 1px #0a0d122e, inset 0px -2px 0px 0px #0a0d120d, 0px 1px 2px 0px #0a0d120d",ne="0px 12px 16px -4px #0a0d1214, 0px 4px 6px -2px #0a0d1208, 0px 2px 2px -1px #0a0d120a",oe={default:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(p[500]),shadowXs:"0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(p[500]),shadowXsSkeuomorphic:"inset 0px 0px 0px 1px #0a0d122e, inset 0px -2px 0px 0px #0a0d120d, 0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(p[500]),shadowSm:"0px 1px 3px 0px #0a0d121a, 0px 1px 2px 0px #0a0d121a, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(p[500]),error:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(f[500]),errorShadowXs:"0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(f[500]),errorShadowXsSkeuomorphic:"inset 0px 0px 0px 1px #0a0d122e, inset 0px -2px 0px 0px #0a0d120d, 0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(f[500])},re=p[500];function ie(e){return!e||e.toLowerCase()===re.toLowerCase()}function ae(e){return e||re}var le=p[600],se=p[500];var de=O.body,ce=$,ue={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},pe={default:"default",primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link"},fe={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},xe=function(t){var n=t.size,o=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:o,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},he=function(n){var o=n.children,a=n.type,l=void 0===a?"default":a,s=n.size,d=void 0===s?"md":s,c=n.disabled,x=void 0!==c&&c,h=n.loading,m=void 0!==h&&h,y=n.iconOnly,b=n.focused,F=void 0!==b&&b,j=n.onClick,S=n.htmlType,z=void 0===S?"button":S,T=n.className,R=void 0===T?"":T,N=n.style,H=n.icon,Y=n.iconPosition,O=void 0===Y?"left":Y,V=i(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),q=u().primaryColor,X=t.useState(!1),Z=X[0],K=X[1],G=t.useState(!1),_=G[0],J=G[1],Q=pe[l]||"default",U=fe[ue[d]||"md"],$=null!=y?y:!!H&&null==o,ee="link-color"===Q||"link-gray"===Q||"destructive-link"===Q,ne=x||m,re=F,he=q,ge=function(e){var t=e.hierarchy,n=e.disabled,o=e.interactive,r=ae(e.brandColor),i=le,a=p[600],l=p[700];return n?"default"===t||"primary"===t||"secondary"===t||"destructive-primary"===t||"destructive-secondary"===t?{bg:A,color:W,iconColor:W,border:"1px solid ".concat(M),boxShadow:"none"}:{bg:"transparent",color:W,iconColor:W,border:"none",boxShadow:"none"}:"default"===t?{bg:o?L:E,color:o?a:g,iconColor:o?se:I,border:"1px solid ".concat(o?se:k),boxShadow:"none"}:"primary"===t?{bg:o?i:r,color:w,iconColor:p[300],border:"none",boxShadow:te}:"secondary"===t?{bg:o?L:E,color:o?"#292524":g,iconColor:o?"#79716b":I,border:"none",boxShadow:te}:"tertiary"===t?{bg:o?L:"transparent",color:o?"#44403c":v,iconColor:o?"#79716b":I,border:"none",boxShadow:"none"}:"link-color"===t?{bg:"transparent",color:o?l:a,iconColor:se,border:"none",boxShadow:"none",textDecoration:o?"underline":"none"}:"link-gray"===t?{bg:"transparent",color:o?"#44403c":v,iconColor:I,border:"none",boxShadow:"none",textDecoration:o?"underline":"none"}:"destructive-primary"===t?{bg:o?f[600]:f[500],color:w,iconColor:o?f[200]:f[300],border:"none",boxShadow:te}:"destructive-secondary"===t?{bg:o?B:E,color:C,iconColor:P,border:"none",boxShadow:"inset 0 0 0 1px ".concat(D,", inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)")}:"destructive-tertiary"===t?{bg:o?B:"transparent",color:C,iconColor:P,border:"none",boxShadow:"none"}:{bg:"transparent",color:o?f[700]:C,iconColor:P,border:"none",boxShadow:"none",textDecoration:o?"underline":"none"}}({hierarchy:Q,disabled:x,interactive:Z||_,brandColor:he}),ve=function(e,t,n){if(t)return"destructive-primary"===e||"destructive-secondary"===e||"destructive-tertiary"===e||"destructive-link"===e?"destructive-primary"===e||"destructive-secondary"===e?oe.errorShadowXsSkeuomorphic:oe.error:"primary"===e||"secondary"===e?ie(n)?oe.shadowXsSkeuomorphic:"".concat(te,", 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ").concat(n):ie(n)?oe.default:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(n)}(Q,re,he),me=r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:U.gap,fontFamily:de,fontWeight:600,fontSize:U.fontSize,lineHeight:"".concat(U.lineHeight,"px"),cursor:ne?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:ge.bg,color:ge.color,border:ge.border,boxShadow:null!=ve?ve:ge.boxShadow,textDecoration:ge.textDecoration},N);ee?(me.borderRadius="4px",me.overflow="hidden",$?(me.width=U.height,me.height=U.height,me.padding=0):(me.height=U.height,me.paddingLeft=U.paddingX,me.paddingRight=U.paddingX)):(me.borderRadius=ce,$?(me.width=U.height,me.height=U.height,me.padding=0):(me.height=U.height,me.paddingLeft=U.paddingX,me.paddingRight=U.paddingX));var ye=function(){return m?e.jsx(xe,{size:U.iconSize,color:ge.iconColor}):H?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:U.iconSize,height:U.iconSize,color:ge.iconColor,flexShrink:0},children:H}):null},be=m||H&&"left"===O,we=!m&&H&&"right"===O;return e.jsxs("button",r({type:z,className:["aha-button","aha-button--".concat(Q),"aha-button--".concat(ue[d]||"md"),$&&"aha-button--icon-only",ne&&"aha-button--disabled",m&&"aha-button--loading",re&&"aha-button--focused",R].filter(Boolean).join(" "),disabled:ne,onClick:function(e){ne?e.preventDefault():null==j||j(e)},onMouseEnter:function(){return!ne&&K(!0)},onMouseLeave:function(){K(!1),J(!1)},onMouseDown:function(){return!ne&&J(!0)},onMouseUp:function(){return J(!1)},style:me},V,{children:[be&&ye(),!$&&o,we&&ye(),$&&!H&&!m&&o]}))};he.displayName="Button";var ge={success:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},ve=e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),me={success:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},ye=function(t){var n=t.className;return e.jsx("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},be=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return s([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),we=new be,Ce=function(){var n=t.useState([]),o=n[0],i=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=we.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=we.subscribe(function(){var e=we.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=o.filter(function(e){return"top-left"===e.props.position}),l=o.filter(function(e){return"top-right"===e.props.position}),s=o.filter(function(e){return"bottom-left"===e.props.position}),d=o.filter(function(e){return"bottom-right"===e.props.position});return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e.jsx(ke,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:l.map(function(t){return e.jsx(ke,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e.jsx(ke,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:d.map(function(t){return e.jsx(ke,r({},t),t.id)})})]})},ke=function(n){var o=n.id,r=n.props,i=t.useState(!1),a=i[0],l=i[1],s=t.useState(!1),d=s[0],c=s[1],u=r.message,p=r.type,f=void 0===p?"info":p,x=r.duration,h=void 0===x?3e3:x,g=r.icon,v=r.action,m=r.showClose,y=void 0===m||m,b=r.onClose,w=r.onClick;r.className;var C=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:me.success};case"error":return{bgColor:"#E7000B",defaultIcon:me.error};case"question":return{bgColor:"#1C1917",defaultIcon:me.question};default:return{bgColor:"#1447E6",defaultIcon:me.info}}}(f);t.useEffect(function(){var e=setTimeout(function(){l(!0)},10);return function(){return clearTimeout(e)}},[]),t.useEffect(function(){if(h>0){var e=setTimeout(function(){k()},h);return function(){return clearTimeout(e)}}},[h,o]);var k=t.useCallback(function(){c(!0),setTimeout(function(){we.removeToast(o),null==b||b()},300)},[o,b]),F=t.useCallback(function(){null==w||w()},[w]);return e.jsx("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!d?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!d?1:0,transition:"all 300ms ease-out",position:"relative",cursor:w?"pointer":"default"},onClick:F,children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:C.bgColor,color:"white"},children:[e.jsx("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:g||C.defaultIcon}),e.jsxs("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e.jsx("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:u}),v&&e.jsx("div",{style:{marginTop:"12px"},children:v})]}),y&&e.jsx("button",{onClick:function(e){e.stopPropagation(),k()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e.jsx(ye,{})})]})})},Fe=function(e){return console.log("Toast: 调用 toast 函数",e),ze(),setTimeout(function(){var t=we.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},je=null,Se=null,De=!1,ze=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(De)console.log("Toast: 容器正在初始化中,跳过");else if(je)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),De=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),je=t,void(De=!1);console.log("Toast: 创建容器元素"),(je=document.createElement("div")).id="aha-toast-container",document.body.appendChild(je),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),Se=n(je),console.log("Toast: 渲染 ToastContainer 组件"),Se.render(e.jsx(Ce,{})),console.log("Toast: 容器渲染完成"),De=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),Se=n(je),console.log("Toast: 渲染 ToastContainer 组件"),Se.render(e.jsx(Ce,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}De=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),De=!1})}}catch(e){console.error("Toast: 创建容器失败",e),De=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},Me={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},Ee={sm:{basePx:8,basePy:3,plCheckbox:5,plAvatar:4,plDot:6,plIcon:4,prClose:4,prCount:4,fontSize:12,lineHeight:"18px",height:24,avatarSize:16,checkboxSize:14,contentGap:4,rootGap:3,countPx:4,countFontSize:12,closeSize:10,closePad:2},md:{basePx:9,basePy:2,plCheckbox:4,plAvatar:5,plDot:7,plIcon:5,prClose:4,prCount:3,fontSize:14,lineHeight:"20px",height:24,avatarSize:16,checkboxSize:16,contentGap:5,rootGap:4,countPx:5,countFontSize:12,closeSize:12,closePad:2},lg:{basePx:10,basePy:4,plCheckbox:5,plAvatar:7,plDot:9,plIcon:7,prClose:4,prCount:4,fontSize:14,lineHeight:"20px",height:28,avatarSize:18,checkboxSize:18,contentGap:6,rootGap:4,countPx:6,countFontSize:14,closeSize:14,closePad:3}},Le=function(n){var o=n.src,r=n.alt,i=void 0===r?"Avatar":r,a=n.size,l=void 0===a?16:a,s=t.useState(!1),d=s[0],c=s[1];return e.jsx("div",{style:{width:l,height:l,borderRadius:"50%",overflow:"hidden",flexShrink:0,border:"0.667px solid rgba(0,0,0,0.08)",background:"#e5e5e4",display:"flex",alignItems:"center",justifyContent:"center"},children:o&&!d?e.jsx("img",{src:o,alt:i,onError:function(){return c(!0)},style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):e.jsxs("svg",{width:.625*l,height:.625*l,viewBox:"0 0 10 10",fill:"none",children:[e.jsx("circle",{cx:"5",cy:"3.5",r:"2",stroke:"#999",strokeWidth:"1.2"}),e.jsx("path",{d:"M1 9.5c0-2.2 1.8-4 4-4s4 1.8 4 4",stroke:"#999",strokeWidth:"1.2",strokeLinecap:"round"})]})})},Te=function(n){var o=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,d=n.size,c=void 0===d?"md":d,p=n.stroke,f=void 0!==p&&p,x=n.iconType,h=n.icon,g=n.avatarSrc,v=n.dotColor,m=n.action,y=void 0===m?"none":m,b=n.count,w=n.onClose,C=n.checkbox,k=void 0!==C&&C,F=n.checked,j=n.onCheckedChange,S=n.iconPosition,D=n.className,z=void 0===D?"":D,M=n.onClick,E=i(n,["children","color","variant","size","stroke","iconType","icon","avatarSrc","dotColor","action","count","onClose","checkbox","checked","onCheckedChange","iconPosition","className","onClick"]),L=u().primaryColor,T=t.useState(!1),A=T[0],R=T[1],B=function(e){return"large"===e?"lg":"small"===e?"sm":e}(c),I=Ee[B],W=void 0!==F?F:A,N=null!=x?x:h&&"leading"===S?"icon":"none",H="none"!==y?y:void 0,P=k?I.plCheckbox:"dot"===N?I.plDot:"avatar"===N||"icon"===N?I.plAvatar:I.basePx,Y="x-close"===H?I.prClose:"count"===H?I.prCount:I.basePx,O={display:"inline-flex",alignItems:"center",gap:"x-close"===H?I.rootGap:0,paddingLeft:P,paddingRight:Y,paddingTop:I.basePy,paddingBottom:I.basePy,height:I.height,borderRadius:6,fontFamily:"DM Sans, sans-serif",fontWeight:500,fontSize:I.fontSize,lineHeight:I.lineHeight,transition:"all 0.2s",cursor:M?"pointer":"default",boxSizing:"border-box",backgroundColor:"#ffffff",color:"#44403c",outline:"1px solid #d7d3d0",outlineOffset:"-1px"};if(a){var V=function(e,t){if(e in Me){var n=Me[e];return"Orange"===e&&t?r(r({},n),{fill:r(r({},n.fill),{bg:t})}):n}if(e.startsWith("#")){var o=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return{light:{bg:"rgba(".concat(o,",").concat(i,",").concat(a,",0.1)"),text:e,border:"rgba(".concat(o,",").concat(i,",").concat(a,",0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return Me.Gray}(a,L);"light"===s?(O.backgroundColor=V.light.bg,O.color=V.light.text,O.outline=f?"1px solid ".concat(function(e){var t={Green:"#A4F4CF",Red:"#FFC9C9",Orange:"#FFD1A9",Blue:"#BEDBFF",Yellow:"#FFD1A9",Cyan:"#A2F4FD",Violet:"#DDD6FF",Pink:"#FCCEE8",Gray:"#E7E5E4"};if(e in t)return t[e];if(e.startsWith("#")){var n=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"rgba(".concat(n,",").concat(o,",").concat(r,",0.3)")}return"#E7E5E4"}(a)):"none",O.outlineOffset=f?"-1px":void 0):(O.backgroundColor=V.fill.bg,O.color=V.fill.text,O.outline="none")}M&&(O.cursor="pointer");return e.jsxs("div",r({className:z,style:O,onClick:M},E,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:I.contentGap,flexShrink:0},children:[k&&e.jsx("div",{role:"checkbox","aria-checked":W,onClick:function(e){e.stopPropagation();var t=!W;void 0===F&&R(t),null==j||j(t)},style:{width:I.checkboxSize,height:I.checkboxSize,borderRadius:4,flexShrink:0,border:W?"none":"1px solid #d7d3d0",background:W?L||"#7F56D9":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:W&&e.jsx("svg",{width:Math.round(.65*I.checkboxSize),height:Math.round(.65*I.checkboxSize),viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M8.5 2L4 7.5 1.5 5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),"avatar"===N?e.jsx(Le,{src:g,size:I.avatarSize}):"dot"===N?e.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:4,cy:4,r:3.5,fill:v||"currentColor"})}):"icon"===N&&h?e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0},children:t.cloneElement(h,{width:I.avatarSize,height:I.avatarSize})}):null,e.jsx("span",{style:{whiteSpace:"nowrap"},children:o}),"count"===H&&"number"==typeof b&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingLeft:I.countPx,paddingRight:I.countPx,paddingTop:1,paddingBottom:1,background:"rgba(0,0,0,0.07)",borderRadius:3,fontSize:I.countFontSize,fontWeight:500,lineHeight:"16px",flexShrink:0},children:b})]}),"x-close"===H&&e.jsx("button",{"aria-label":"Remove",onClick:function(e){e.stopPropagation(),null==w||w()},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:I.closePad,borderRadius:3,border:"none",background:"transparent",cursor:"pointer",flexShrink:0,color:"inherit",opacity:.55,lineHeight:0},children:e.jsx("svg",{width:I.closeSize,height:I.closeSize,viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M7.5 2.5l-5 5M2.5 2.5l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),"after"===S&&h&&!x&&e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0,marginLeft:I.contentGap},children:h})]}))},Ae=O.body,Re=V.md,Be=V.sm,Ie=V.xs,We=X.md,Ne=X.sm,He=X.xs,Pe=$,Ye=ee,Oe=K,Ve={textPrimary:h,textSecondary:g,textTertiary:v,textDisabled:y,textPlaceholder:b,borderPrimary:k,borderDisabled:z,borderBrand:j,borderError:S,borderErrorSubtle:D,bgPrimary:E,bgDisabledSubtle:R,fgDisabled:W,fgQuaternary:I,error600:f[600]};function qe(e){var t=e.disabled,n=void 0!==t&&t,o=e.error,r=void 0!==o&&o,i=e.focused,a=void 0!==i&&i,l=e.brandColor,s=Ve,d=Ye,c=l||s.borderBrand;return n?{border:"1px solid ".concat(s.borderDisabled),boxShadow:d,outline:"none"}:r&&a?{border:"1px solid ".concat(s.borderError),boxShadow:d,outline:"2px solid ".concat(s.borderError),outlineOffset:"-2px"}:r?{border:"1px solid ".concat(s.borderErrorSubtle),boxShadow:d,outline:"none"}:a?{border:"1px solid ".concat(c),boxShadow:d,outline:"2px solid ".concat(c),outlineOffset:"-2px"}:{border:"1px solid ".concat(s.borderPrimary),boxShadow:d,outline:"none"}}function Xe(){return{fontFamily:Ae,fontSize:Be,fontWeight:500,lineHeight:Ne,color:Ve.textSecondary}}function Ze(e){return void 0===e&&(e=!1),{margin:0,fontFamily:Ae,fontSize:Be,fontWeight:400,lineHeight:Ne,color:e?Ve.error600:Ve.textTertiary}}function Ke(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=Ve.textPlaceholder),"\n ".concat(e,"::placeholder {\n color: ").concat(n,";\n font-size: ").concat(Re,";\n font-weight: 400;\n opacity: 1;\n }\n ").concat(e,"::-webkit-input-placeholder { color: ").concat(n,"; }\n ").concat(e,"::-moz-placeholder { color: ").concat(n,"; }\n ").concat(e,":-ms-input-placeholder { color: ").concat(n,"; }\n ").concat(t,"\n ")}var Ge={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}},_e=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"mediumSmall":a,s=n.error,d=void 0!==s&&s,c=n.disabled,p=void 0!==c&&c,f=n.readOnly,x=void 0!==f&&f,h=n.prefix,g=n.suffix,v=n.leadingText,m=n.trailingText,y=n.leadingAddon,b=n.trailingAddon,w=n.className,C=void 0===w?"":w,k=n.style,F=n.onFocus,j=n.onBlur,S=n.onKeyDown,D=n.onPressEnter,z=n.value,M=n.defaultValue,E=n.onChange,L=n.placeholder,T=n.type,A=void 0===T?"text":T,R=n.label,B=n.required,I=n.hintText,W=i(n,["size","error","disabled","readOnly","prefix","suffix","leadingText","trailingText","leadingAddon","trailingAddon","className","style","onFocus","onBlur","onKeyDown","onPressEnter","value","defaultValue","onChange","placeholder","type","label","required","hintText"]),N=t.useRef(null),H=t.useState(!1),P=H[0],Y=H[1],O=t.useState(null!=M?M:""),V=O[0],q=O[1],X=u().primaryColor;t.useEffect(function(){"function"==typeof o?o(N.current):o&&(o.current=N.current)},[o]);var Z=void 0!==z,K=Z?z:V,G=qe({disabled:p,error:d,focused:P,brandColor:X}),_=G.border,J=G.boxShadow,Q=G.outline,U=G.outlineOffset,$=Ge[l],ee=$.pt,te=$.pb,ne=p?Ve.borderDisabled:Ve.borderPrimary,oe=!!h,re=!!g,ie={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:p?Ve.fgDisabled:Ve.fgQuaternary,zIndex:1,pointerEvents:"none"},ae={display:"flex",alignItems:"center",paddingTop:ee,paddingBottom:te,paddingLeft:"14px",paddingRight:"12px",color:Ve.textTertiary,fontFamily:Ae,fontSize:Re,lineHeight:We,whiteSpace:"nowrap",flexShrink:0,backgroundColor:p?Ve.bgDisabledSubtle:"transparent"},le=e.jsxs("div",{className:"aha-input-group ".concat(C),style:r({display:"flex",alignItems:"stretch",width:"100%",border:_,boxShadow:J,outline:Q,outlineOffset:U,borderRadius:Pe,backgroundColor:p||x?Ve.bgDisabledSubtle:Ve.bgPrimary,overflow:"hidden",boxSizing:"border-box",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},k),children:[void 0!==v&&e.jsx("div",{style:r(r({},ae),{borderRight:"1px solid ".concat(ne)}),children:v}),void 0!==y&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(ne)},children:y}),e.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[oe&&e.jsx("span",{style:r(r({},ie),{left:"14px"}),children:h}),e.jsx("input",r({ref:N,type:A,value:K,placeholder:L,disabled:p,readOnly:x,onChange:function(e){Z||q(e.target.value),null==E||E(e)},onFocus:function(e){Y(!0),null==F||F(e)},onBlur:function(e){Y(!1),null==j||j(e)},onKeyDown:function(e){"Enter"===e.key&&D&&D(e),null==S||S(e)},style:{flex:1,border:"none",outline:"none",width:"100%",boxSizing:"border-box",fontFamily:Ae,fontSize:Re,fontWeight:400,lineHeight:We,backgroundColor:"transparent",color:p?Ve.textDisabled:Ve.textPrimary,paddingTop:ee,paddingBottom:te,paddingLeft:oe?"40px":"14px",paddingRight:re?"40px":"14px"},autoComplete:W.autoComplete||"off"},W)),re&&e.jsx("span",{style:r(r({},ie),{right:"14px"}),children:g})]}),void 0!==m&&e.jsx("div",{style:r(r({},ae),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(ne)}),children:m}),void 0!==b&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(ne)},children:b})]});return R||I?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e.jsxs("label",{style:Xe(),children:[R,B&&e.jsx("span",{style:{color:Ve.error600,marginLeft:"2px"},children:"*"})]}),le,I&&e.jsx("p",{style:Ze(d),children:I})]}):le});_e.displayName="InputGroup";var Je={small:"4px",mediumSmall:"6px",medium:"8px",large:"10px"},Qe={small:"sm",mediumSmall:"sm",medium:"md",large:"lg"},Ue=function(n){var o=n.value,i=n.defaultValue,a=void 0===i?[]:i,l=n.onChange,d=n.placeholder,c=void 0===d?"Add tag...":d,p=n.disabled,f=void 0!==p&&p,x=n.error,h=void 0!==x&&x,g=n.size,v=void 0===g?"mediumSmall":g,m=n.className,y=void 0===m?"":m,b=n.style,w=n.label,C=n.required,k=n.hintText,F=t.useState(a),j=F[0],S=F[1],D=t.useState(""),z=D[0],M=D[1],E=t.useState(!1),L=E[0],T=E[1],A=t.useRef(null),R=u().primaryColor,B=void 0!==o,I=B?o:j,W=function(e){B||S(e),null==l||l(e)},N=function(e){var t=e.trim();t&&!I.includes(t)&&(W(s(s([],I,!0),[t],!1)),M(""))},H=function(e){W(I.filter(function(t,n){return n!==e}))},P=qe({disabled:f,error:h,focused:L,brandColor:R}),Y=P.border,O=P.boxShadow,V=P.outline,q=P.outlineOffset,X=Je[v],Z=Qe[v],K=e.jsxs("div",{className:"aha-input-tags ".concat(y),onClick:function(){var e;return null===(e=A.current)||void 0===e?void 0:e.focus()},style:r({display:"flex",flexWrap:"wrap",alignItems:"center",gap:"6px",padding:X,border:Y,boxShadow:O,outline:V,outlineOffset:q,borderRadius:Pe,backgroundColor:f?Ve.bgDisabledSubtle:Ve.bgPrimary,boxSizing:"border-box",width:"100%",transition:"border-color 0.15s ease, box-shadow 0.15s ease",cursor:f?"not-allowed":"text"},b),children:[I.map(function(t,n){return e.jsx(Te,{size:Z,action:f?"none":"x-close",onClose:function(){return H(n)},children:t},n)}),e.jsx("input",{ref:A,value:z,onChange:function(e){return M(e.target.value)},onKeyDown:function(e){"Enter"!==e.key&&","!==e.key||!z||(e.preventDefault(),N(z)),"Backspace"===e.key&&!z&&I.length>0&&H(I.length-1)},onFocus:function(){return T(!0)},onBlur:function(){T(!1),z&&N(z)},disabled:f,placeholder:0===I.length?c:"",style:{flex:1,minWidth:"80px",border:"none",outline:"none",padding:0,fontFamily:Ae,fontSize:Re,lineHeight:We,color:f?Ve.textDisabled:Ve.textPrimary,backgroundColor:"transparent"}}),e.jsx("style",{children:Ke(".aha-input-tags input")})]});return w||k?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[w&&e.jsxs("label",{style:Xe(),children:[w,C&&e.jsx("span",{style:{color:Ve.error600,marginLeft:"2px"},children:"*"})]}),K,k&&e.jsx("p",{style:Ze(h),children:k})]}):K},$e={small:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},mediumSmall:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},medium:{height:"44px",paddingTop:"9px",paddingBottom:"9px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},et=function(t){var n=t.onClick;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:n,style:{cursor:"pointer",flexShrink:0},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},tt=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"mediumSmall":a,s=n.disabled,d=void 0!==s&&s,c=n.error,p=void 0!==c&&c,f=n.readOnly,x=void 0!==f&&f,h=n.prefix,g=n.suffix,v=n.allowClear,m=void 0!==v&&v,y=n.onClear,b=n.className,w=void 0===b?"":b,C=n.style,k=n.type,F=void 0===k?"text":k,j=n.placeholder,S=n.value,D=n.defaultValue,z=n.onChange,M=n.onFocus,E=n.onBlur,L=n.onPressEnter,T=n.label,A=n.required,R=n.hintText,B=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),I=t.useRef(null),W=t.useState(D||S||""),N=W[0],H=W[1],P=t.useState(!1),Y=P[0],O=P[1],V=u().primaryColor;t.useEffect(function(){"function"==typeof o?o(I.current):o&&(o.current=I.current)},[o]);var q=void 0!==S,X=q?S:N,Z=m&&X&&!d,K=qe({disabled:d,error:p,focused:Y,brandColor:V}),G=$e[l],_=G.height,J=G.paddingTop,Q=G.paddingBottom,U=h?"40px":"14px",$=g||Z?"40px":"14px",ee=r(r(r({width:"100%",height:_,boxSizing:"border-box",fontFamily:Ae,fontSize:Re,fontWeight:400,lineHeight:We,borderRadius:Pe},K),{backgroundColor:d||x?Ve.bgDisabledSubtle:Ve.bgPrimary,color:d?Ve.textDisabled:Ve.textPrimary,paddingTop:J,paddingBottom:Q,paddingLeft:U,paddingRight:$,transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"}),C),te=Ke(".aha-input-wrapper input",'\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] { -moz-appearance: textfield; }\n '),ne={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:d?Ve.fgDisabled:Ve.fgQuaternary,zIndex:1},oe=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:te}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"block",width:"100%"},children:[h&&e.jsx("span",{style:r(r({},ne),{left:"14px",pointerEvents:"none"}),children:h}),e.jsx("input",r({ref:I,type:F,value:X,placeholder:j,disabled:d,readOnly:x,onChange:function(e){q||H(e.target.value),null==z||z(e)},onFocus:function(e){O(!0),null==M||M(e)},onBlur:function(e){O(!1),null==E||E(e)},onKeyDown:function(e){var t;"Enter"===e.key&&L&&L(e),null===(t=B.onKeyDown)||void 0===t||t.call(B,e)},style:ee,autoComplete:B.autoComplete||"off",autoCorrect:B.autoCorrect||"off",autoCapitalize:B.autoCapitalize||"off",spellCheck:B.spellCheck||!1},B)),(g||Z)&&e.jsxs("span",{style:r(r({},ne),{right:"14px",gap:Oe}),children:[Z&&e.jsx(et,{onClick:function(e){var t;e.stopPropagation(),q||H("");null==z||z({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=I.current)||void 0===t||t.focus()}}),g]})]})]});return T||R?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[T&&e.jsxs("label",{style:Xe(),children:[T,A&&e.jsx("span",{style:{color:Ve.error600,marginLeft:"2px"},children:"*"})]}),oe,R&&e.jsx("p",{style:Ze(p),children:R})]}):oe});tt.displayName="Input";var nt=function(o){var i,a=o.value,l=o.defaultValue,d=o.options,c=void 0===d?[]:d,p=o.mode,f=o.disabled,x=void 0!==f&&f,h=o.error,g=void 0!==h&&h,v=o.placeholder,m=void 0===v?"Please select":v,y=o.size,b=void 0===y?"medium":y,w=o.showSearch,C=void 0!==w&&w,k=o.filterOption,F=void 0===k||k,j=o.allowClear,S=void 0!==j&&j,D=o.onChange,z=o.onSelect,M=o.onDeselect,E=o.onSearch,L=o.onFocus,T=o.onBlur,A=o.onDropdownVisibleChange,R=o.className,B=void 0===R?"":R,I=o.style,W=o.dropdownClassName,N=void 0===W?"":W,H=o.dropdownStyle,P=o.defaultOpen,Y=void 0!==P&&P,O=o.open,V=o.maxTagCount,q=o.tagRender,X=o.optionRender,Z=u().primaryColor,K=void 0===Z?"#FB6011":Z,G=t.useState(void 0!==l?l:p?[]:void 0),_=G[0],J=G[1],Q=t.useState(Y),U=Q[0],$=Q[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),re=oe[0],ie=oe[1],ae=t.useRef(null),le=t.useRef(null),se=t.useRef(null),de=t.useState(null),ce=de[0],ue=de[1],pe=void 0!==a,fe=void 0!==O,xe=pe?a:_,he=fe?O:U,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!xe)return[];var e=Array.isArray(xe)?xe:[xe];return c.filter(function(t){return e.includes(t.value)})},[xe,c]),me=t.useCallback(function(){return C&&te?!1===F?c:"function"==typeof F?c.filter(function(e){return F(te,e)}):c.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):c},[c,te,C,F]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(he&&ae.current){var e=function(){var e,t;if(ae.current){var n=ae.current.getBoundingClientRect(),o=null!==(t=null===(e=se.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-4:n.bottom+window.scrollY+4;ue({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}ue(null)},[he,ye.length]),t.useEffect(function(){var e=function(e){var t=e.target;ae.current&&!ae.current.contains(t)&&se.current&&!se.current.contains(t)&&(fe||$(!1),null==A||A(!1),ne(""))};if(he)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[he,fe,A]),t.useEffect(function(){if(he){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),ie(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ie(function(e){return e>0?e-1:0});else if("Enter"===e.key&&re>=0){e.preventDefault();var n=ye[re];n&&!n.disabled&&be(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==A||A(!1),null===(t=ae.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[he,ye,re,fe,A]),t.useEffect(function(){if(re>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=t.useCallback(function(e){var t;if(!e.disabled)if(ge){var n,o=Array.isArray(xe)?xe:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==M||M(e.value,e)):(n=s(s([],o,!0),[e.value],!1),null==z||z(e.value,e)),pe||J(n);var r=c.filter(function(e){return n.includes(e.value)});null==D||D(n,r)}else pe||J(e.value),null==D||D(e.value,e),null==z||z(e.value,e),fe||$(!1),null==A||A(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,xe,pe,fe,c,D,z,M,A]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(xe)){var n=xe.filter(function(e){return e!==t}),o=c.find(function(e){return e.value===t});pe||J(n),null==D||D(n,ve()),null==M||M(t,o)}},[ge,xe,pe,c,D,M,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||J(t),null==D||D(t,[]),ne("")},ke={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Fe=t.useMemo(function(){return ve()},[ve]),je=t.useMemo(function(){return S&&xe&&!x},[S,xe,x]),Se=t.useMemo(function(){return ge?Array.isArray(xe)&&xe.length>0:null!=xe&&""!==xe},[ge,xe]),De=t.useMemo(function(){if(!ge||!Array.isArray(xe)||0===xe.length)return null;var n="responsive"===V?Fe.slice(0,2):V?Fe.slice(0,V):Fe,o=V&&Fe.length>n.length?Fe.length-n.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var o={label:n.label,value:n.value,closable:!x,onClose:function(){return we({},n.value)}};return q?e.jsx(t.Fragment,{children:q(o)},n.value):e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!x&&e.jsx("span",{onClick:function(e){return we(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ge,xe,Fe,V,x,q]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:ae,className:"aha-select ".concat(B),style:r({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":he?K:"#D7D3D0"),backgroundColor:x?"#FAFAF9":"#FFFFFF",cursor:x?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:ke[b].paddingTop,paddingBottom:ke[b].paddingBottom,fontSize:ke[b].fontSize,lineHeight:ke[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},I),onClick:function(){if(!x){var e=!he;fe||$(e),null==A||A(e),e&&C?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==L||L(e)},onBlur:function(e){null==T||T(e)},onTouchStart:function(e){x||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:x?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?De||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):C&&he?e.jsx("input",{ref:le,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==E||E(t),ie(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:x?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Se?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Se?x?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Se?(null===(i=Fe[0])||void 0===i?void 0:i.label)||xe:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[je&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ce,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(t){var n=t.isOpen;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:he})]})]}),he&&ce&&n.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(N),style:r({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===ce.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ce.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},H),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(t,n){var o=ge?Array.isArray(xe)&&xe.includes(t.value):xe===t.value,r=n===re;return X?e.jsx("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&be(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:X(t,{selected:o,focused:r,disabled:t.disabled||!1})},t.value):e.jsxs("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return be(t)},style:{padding:"8px 16px",cursor:t.disabled?"not-allowed":"pointer",color:t.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e.jsx("span",{children:t.label}),o&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:K,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};nt.displayName="Select";var ot=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},rt=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},it=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},at=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},lt=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},st=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("g",{clipPath:"url(#clip0_54_1653)",children:e.jsx("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_54_1653",children:e.jsx("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},dt=function(n){var o=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,d=n.pageSize,c=n.defaultPageSize,p=void 0===c?10:c,f=n.showSizeChanger,x=void 0!==f&&f,h=n.pageSizeOptions,g=void 0===h?["10","20","50","100"]:h,v=n.showQuickJumper,m=void 0!==v&&v,y=n.showTotal,b=n.onChange,w=n.onShowSizeChange,C=n.simple,k=void 0!==C&&C,F=n.disabled,j=void 0!==F&&F,S=n.hideOnSinglePage,D=void 0!==S&&S,z=n.className,M=void 0===z?"":z,E=n.style,L=n.size,T=void 0===L?"default":L,A=n.responsive,R=void 0!==A&&A;n.showLessItems;var B=n.itemRender,I=u().primaryColor,W=void 0===I?"#FB6011":I,N=t.useState(a),H=N[0],P=N[1],Y=t.useState(p),O=Y[0],V=Y[1],q=t.useState(""),X=q[0],Z=q[1],K=null!=o?o:H,G=null!=d?d:O,_=t.useMemo(function(){return Math.ceil(s/G)},[s,G]);t.useEffect(function(){void 0!==o&&P(o)},[o]),t.useEffect(function(){void 0!==d&&V(d)},[d]);var J=function(e){e<1||e>_||e===K||j||(void 0===o&&P(e),null==b||b(e,G))},Q=function(){var e=parseInt(X,10);e>=1&&e<=_&&(J(e),Z(""))};if(D&&_<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(M),style:E,children:[e.jsx(he,{onClick:function(){return J(K-1)},disabled:j||1===K,type:"default",size:"default"===T?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(at,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[K," / ",_]}),e.jsx(he,{onClick:function(){return J(K+1)},disabled:j||K===_,type:"default",size:"default"===T?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(lt,{})})]});var U=(K-1)*G+1,$=Math.min(K*G,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(M),style:r({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:R?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},E),children:[y&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:y(s,[U,$])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:B?B(K-1,"prev",e.jsx(he,{onClick:function(){return J(K-1)},disabled:j||1===K,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(at,{})})):e.jsx(he,{onClick:function(){return J(K-1)},disabled:j||1===K,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(at,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(_<=7)return Array.from({length:_},function(e,t){return t+1});var e=[];if(K<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(_)}else if(K>=_-3){e.push(1),e.push("jump-prev");for(t=_-4;t<=_;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=K-1;t<=K+1;t++)e.push(t);e.push("jump-next"),e.push(_)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===K,o=e.jsx(he,{onClick:function(){return J(t)},disabled:j,type:n?"primary":"default",size:"default"===T?"medium":"small",style:{minWidth:"small"===T?"32px":"36px",height:"small"===T?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(W):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return B?B(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(he,{onClick:function(){return J(Math.max(1,K-5))},disabled:j,type:"default",size:"default"===T?"medium":"small",style:{minWidth:"small"===T?"32px":"36px",height:"small"===T?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),B?B(K-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(he,{onClick:function(){return J(Math.min(_,K+5))},disabled:j,type:"default",size:"default"===T?"medium":"small",style:{minWidth:"small"===T?"32px":"36px",height:"small"===T?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),B?B(K+5,"jump-next",o):o;return null}(t)})}),s>0&&e.jsx(e.Fragment,{children:B?B(K+1,"next",e.jsx(he,{onClick:function(){return J(K+1)},disabled:j||K===_,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(lt,{})})):e.jsx(he,{onClick:function(){return J(K+1)},disabled:j||K===_,type:"default",size:"default"===T?"medium":"small",style:{height:"small"===T?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(lt,{})})}),x&&e.jsx(nt,{value:G,options:g.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(s/t),r=K>n?n:K,void 0===d&&V(t),void 0===o&&P(r),null==w||w(r,t),void(null==b||b(r,t));var t,n,r},disabled:j,size:"small"===T?"small":"medium",style:{minWidth:"small"===T?80:96}}),m&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(tt,{type:"number",min:1,value:X,onChange:function(e){return Z(e.target.value)},onPressEnter:Q,disabled:j,size:"small"===T?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof m&&m.goButton?e.jsx(he,{onClick:Q,disabled:j,type:"default",size:"default"===T?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:m.goButton}):e.jsx(he,{onClick:Q,disabled:j,type:"default",size:"default"===T?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},ct=O.body,ut=q.medium,pt=q.regular;function ft(e){return{fontSize:"sm"===e?V.sm:V.md,lineHeight:"sm"===e?X.sm:X.md,gap:"sm"===e?G:_,hintGap:"md"===e?Z:"0"}}function xt(e){var t=e.disabled,n=e.active,o=e.hovered,r=ae(e.brandColor);return{bg:t?R:n?o?le:r:o?L:E,border:"1px solid ".concat(t?z:n?o?le:r:k)}}function ht(e,t){return e?ie(t)?oe.default:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(t):"none"}function gt(e){var t=ft(e.size);return{fontSize:t.fontSize,lineHeight:t.lineHeight,fontWeight:ut,fontFamily:ct,color:e.disabled?y:g,userSelect:"none"}}function vt(e){var t=ft(e);return{fontSize:t.fontSize,lineHeight:t.lineHeight,fontWeight:pt,fontFamily:ct,color:v}}function mt(e,t){return e&&t?N:H}var yt=function(n){var o=n.checked,i=void 0!==o&&o,a=n.indeterminate,l=void 0!==a&&a,s=n.disabled,d=void 0!==s&&s,c=n.onChange,p=n.className,f=void 0===p?"":p,x=n.style,h=n.children,g=n.size,v=void 0===g?"sm":g,m=n.hint,y=n.isFocused,b=u().primaryColor,w=t.useState(!1),C=w[0],k=w[1],F=t.useState(!1),j=F[0],S=F[1],D=i||l,z=null!=y?y:j,M=function(){d||(null==c||c({target:{checked:!i},currentTarget:{checked:!i}}))},E="sm"===v?"16px":"20px",L="sm"===v?"12px":"14px",T=function(e){return"sm"===e?Q:U}(v),A=ft(v),R=A.gap,B=A.hintGap,I=xt({disabled:d,active:D,hovered:C,brandColor:b}),W=I.bg,N=I.border,H=mt(d,D),P=h||m;return e.jsxs("div",{className:"aha-checkbox ".concat(f),role:"checkbox","aria-checked":l?"mixed":i,"aria-disabled":d,tabIndex:d?-1:0,style:r({display:"inline-flex",alignItems:"flex-start",gap:R,cursor:d?"not-allowed":"pointer",outline:"none"},x),onClick:M,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),M())},onMouseEnter:function(){return!d&&k(!0)},onMouseLeave:function(){return k(!1)},onFocus:function(){return!d&&S(!0)},onBlur:function(){return S(!1)},children:[e.jsxs("div",{style:{position:"relative",width:E,height:E,minWidth:E,minHeight:E,flexShrink:0,borderRadius:T,border:N,backgroundColor:W,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:ht(z,b),marginTop:P?"2px":"0"},children:[e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:L,height:L,color:H,opacity:l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M2.91675 7H11.0834",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:L,height:L,color:H,opacity:i&&!l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),P&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:B},children:[h&&e.jsx("span",{style:gt({size:v,disabled:d}),children:h}),m&&e.jsx("span",{style:vt(v),onClick:function(e){return e.stopPropagation()},children:m})]})]})};yt.displayName="Checkbox";var bt=function(t){var n=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},wt=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e.jsx(bt,{color:o}):n;return e.jsx("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},Ct=function(e,t){return"string"==typeof t?null==e?void 0:e[t]:t.reduce(function(e,t){return null==e?void 0:e[t]},e)},kt=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=Ct(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},Ft=function(t){var n=t.order,o=u().primaryColor;return"ascend"===n?e.jsx(it,{style:{color:o}}):"descend"===n?e.jsx(rt,{style:{color:o}}):e.jsx(ot,{})},jt=function(n){var o=n.checked,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,s=n.onChange,d=n.className,c=void 0===d?"":d,p=n.style,f=n.children,x=n.value;n.name;var h=n.size,g=void 0===h?"sm":h,v=n.hint,m=n.isFocused,y=u().primaryColor,b=t.useState(!1),w=b[0],C=b[1],k=t.useState(!1),F=k[0],j=k[1],S=null!=m?m:F,D=function(){l||i||(null==s||s({target:{checked:!0,value:x},currentTarget:{checked:!0,value:x}}))},z="sm"===g?"16px":"20px",M="sm"===g?"6px":"8px",E=ft(g),L=E.gap,T=E.hintGap,A=xt({disabled:l,active:i,hovered:w,brandColor:y}),R=A.bg,B=A.border,I=mt(l,i),W=f||v;return e.jsxs("div",{className:"aha-radio ".concat(c),role:"radio","aria-checked":i,"aria-disabled":l,tabIndex:l?-1:0,style:r({display:"inline-flex",alignItems:"flex-start",gap:L,cursor:l?"not-allowed":"pointer",outline:"none"},p),onClick:D,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),D())},onMouseEnter:function(){return!l&&C(!0)},onMouseLeave:function(){return C(!1)},onFocus:function(){return!l&&j(!0)},onBlur:function(){return j(!1)},children:[e.jsx("div",{style:{position:"relative",width:z,height:z,minWidth:z,minHeight:z,flexShrink:0,borderRadius:"50%",border:B,backgroundColor:R,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:ht(S,y),marginTop:W?"2px":"0"},children:e.jsx("div",{style:{width:M,height:M,borderRadius:"50%",backgroundColor:I,opacity:i?1:0,transition:"opacity 0.15s",pointerEvents:"none",flexShrink:0}})}),W&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:T},children:[f&&e.jsx("span",{style:gt({size:g,disabled:l}),children:f}),v&&e.jsx("span",{style:vt(g),onClick:function(e){return e.stopPropagation()},children:v})]})]})};jt.displayName="Radio";var St=/^(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,Dt=/(https?:\/\/[^\s<]+|www\.[^\s<]+|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[^\s<]*)?)/gi,zt=new Set(["com","cn","net","org","io","co","edu","gov","ai","app","dev","me","info","biz","tech","cc","tv","xyz","top","vip","pro","store","site","online","cloud"]),Mt=function(e,t,n,o){if(void 0===t&&(t=!0),void 0===n&&(n=!0),!e||"string"!=typeof e)return!1;var r=e.trim();if(!r)return!1;var i=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(r);if(t&&!i)return!1;var a=i?r:"https://".concat(r);try{var l=new URL(a),s=l.protocol.toLowerCase();if("http:"!==s&&"https:"!==s)return!1;if(n){var d=l.hostname.toLowerCase();if(!d)return!1;if("localhost"===d)return!0;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(d))return d.split(".").every(function(e){var t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255});if(!St.test(d))return!1;var c=d.split(".").pop()||"";if(!(o?new Set(o.map(function(e){return e.toLowerCase()})):zt).has(c))return!1}return!0}catch(e){return!1}},Et=function(e){var t=e.match(/^(.*?)([),.;!?]+)?$/);return{core:(null==t?void 0:t[1])||e,suffix:(null==t?void 0:t[2])||""}},Lt=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},Tt=function(e){return e.replace(new RegExp("","g"),"")},At=function(e,t,n){var o=function(e,t){var n,o;if(!e)return[];for(var r=[],i=0,a=new RegExp(Dt),l=a.exec(e);l;){var s=l[0],d=l.index,c=d+s.length;d>i&&r.push({type:"text",text:e.slice(i,d)});var u=Et(s),p=u.core,f=u.suffix,x=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(p)?p:"https://".concat(p),h=Mt(p,null!==(n=null==t?void 0:t.needProtocol)&&void 0!==n&&n,null===(o=null==t?void 0:t.needHost)||void 0===o||o,null==t?void 0:t.allowedTlds);((null==t?void 0:t.validate)?t.validate(x):h)&&p?(r.push({type:"url",text:p,href:x}),f&&r.push({type:"text",text:f})):r.push({type:"text",text:s}),i=c,l=a.exec(e)}return i<e.length&&r.push({type:"text",text:e.slice(i)}),r}(e,t);if(0===o.length)return"";var r=o.map(function(e){if("text"===e.type)return Lt(e.text);var o=(null==t?void 0:t.className)?' class="'.concat(t.className,'"'):"",r=n?"pointer-events: none;":"";return'<a href="'.concat(Lt(e.href),'" target="_blank" rel="noopener noreferrer"').concat(o,' style="color: #2563EB; text-decoration: underline; ').concat(r,'">').concat(Lt(e.text),"</a>")}).join("");return e.endsWith("\n")?"".concat(r,'<span data-aha-zwsp="true">').concat("","</span>"):r},Rt=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return 0;var n=t.getRangeAt(0);if(!e.contains(n.startContainer))return 0;var o=n.cloneRange();return o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),Tt(o.toString()).length},Bt=t.forwardRef(function(n,o){var a=n.disabled,l=void 0!==a&&a,s=n.error,d=void 0!==s&&s,c=n.readOnly,p=void 0!==c&&c,f=n.showCount,x=void 0!==f&&f,h=n.maxLength,g=n.className,v=void 0===g?"":g,m=n.style,y=n.placeholder,b=n.value,w=n.defaultValue,C=n.rows,k=void 0===C?3:C,F=n.autoSize,j=void 0!==F&&F,S=n.onChange,D=n.onFocus,z=n.onBlur,M=n.linkify,E=void 0!==M&&M,L=n.linkifyOptions,T=n.label,A=n.required,R=n.hintText,B=n.helpIcon,I=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur","linkify","linkifyOptions","label","required","hintText","helpIcon"]),W=t.useRef(null),N=t.useRef(null),H=t.useRef(!1),P=t.useRef(null),Y=t.useState(w||b||""),O=Y[0],V=Y[1],q=t.useState(!1),X=q[0],Z=q[1],K=t.useState(void 0),G=K[0],_=K[1],J=u().primaryColor;t.useEffect(function(){"function"==typeof o?o(E?null:W.current):o&&(o.current=E?null:W.current)},[o,E]);var Q=void 0!==b,U=Q?b:O,$=String(U||"").length,ee=function(e){Z(!0),null==D||D(e)},te=function(e){Z(!1),null==z||z(e)},ne=t.useMemo(function(){return"number"==typeof h?h:void 0},[h]);t.useEffect(function(){if(!E&&j&&W.current){var e=W.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),_(l)}},[U,j,E]),t.useEffect(function(){if(E&&j&&N.current){var e=N.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0,o=parseInt(window.getComputedStyle(e).lineHeight||"24",10),r=t*o+24,i=n?n*o+24:void 0;e.style.height="auto";var a=Math.max(e.scrollHeight,r);i&&(a=Math.min(a,i)),e.style.height="".concat(a,"px"),e.style.overflowY=i&&e.scrollHeight>i?"auto":"hidden",_(a)}},[j,U,E]),t.useLayoutEffect(function(){var e;if(E&&N.current&&!H.current){var t=N.current,n=document.activeElement===t,o=n?Rt(t):0,r=null!==(e=P.current)&&void 0!==e?e:o,i=At(String(U||""),L,l);if(t.innerHTML!==i&&(t.innerHTML=i),n){var a=String(U||"").length;!function(e,t){var n=document.createRange(),o=window.getSelection();if(o){for(var r=Math.max(0,t),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=i.nextNode();a;){for(var l=a.textContent||"",s=0,d=-1,c=0;c<l.length;c+=1)if(""!==l[c]&&(s+=1),s===r){d=c+1;break}if(0===r)return n.setStart(a,0),n.collapse(!0),o.removeAllRanges(),void o.addRange(n);if(-1!==d)return n.setStart(a,d),n.collapse(!0),o.removeAllRanges(),void o.addRange(n);r-=s,a=i.nextNode()}n.selectNodeContents(e),n.collapse(!1),o.removeAllRanges(),o.addRange(n)}}(t,Math.min(r,a))}P.current=null}},[U,l,E,L]);var oe=function(e){null==S||S({target:{value:e},currentTarget:{value:e}})},re=function(){if(N.current&&!H.current){P.current=Rt(N.current);var e=Tt(N.current.textContent||""),t=ne?e.slice(0,ne):e;Q||V(t),oe(t)}},ie=r(r(r(r({width:"100%",boxSizing:"border-box",fontFamily:Ae,borderRadius:Pe},qe({disabled:l,error:d,focused:X,brandColor:J})),{backgroundColor:l||p?Ve.bgDisabledSubtle:Ve.bgPrimary,color:l?Ve.textDisabled:Ve.textPrimary,fontSize:Re,fontWeight:400,lineHeight:We,padding:"12px 14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",resize:j||E?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"}),void 0!==G&&j?{height:"".concat(G,"px")}:{}),m),ae=Ke(".aha-textarea-wrapper textarea","\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-textarea-wrapper .aha-textarea-editable {\n white-space: pre-wrap;\n word-break: break-word;\n }\n .aha-textarea-wrapper .aha-textarea-editable:empty::before {\n content: attr(data-placeholder);\n color: ".concat(Ve.textPlaceholder,";\n }\n .aha-textarea-wrapper .aha-textarea-editable a {\n color: #2563EB;\n }\n ")),le=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ae}),e.jsxs("div",{className:"aha-textarea-wrapper ".concat(v),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[E?e.jsx("div",{ref:N,className:"aha-textarea-editable",contentEditable:!l&&!p,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-disabled":l,"data-placeholder":y||"",onInput:re,onPaste:function(e){var t;if(e.preventDefault(),!p&&!l){var n,o,r=e.clipboardData.getData("text/plain"),i=String(U||""),a=window.getSelection(),s="".concat(i).concat(r),d=i.length+r.length;if(a&&a.rangeCount>0&&(null===(t=N.current)||void 0===t?void 0:t.contains(a.anchorNode))){var c=Rt(N.current),u=(n=a.getRangeAt(0),(o=n.cloneRange()).selectNodeContents(N.current),o.setEnd(n.endContainer,n.endOffset),o.toString().length);s=i.slice(0,c)+r+i.slice(u),d=c+r.length}ne&&(s=s.slice(0,ne),d=Math.min(d,s.length)),P.current=d,Q||V(s),oe(s)}},onKeyDown:function(e){var t,n;if("Enter"===e.key&&!e.nativeEvent.isComposing&&!l&&!p&&N.current){e.preventDefault();var o=String(U||""),r=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.getRangeAt(0);if(!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;var o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset);var r=n.cloneRange();return r.selectNodeContents(e),r.setEnd(n.endContainer,n.endOffset),{start:Tt(o.toString()).length,end:Tt(r.toString()).length}}(N.current),i=null!==(t=null==r?void 0:r.start)&&void 0!==t?t:o.length,a=null!==(n=null==r?void 0:r.end)&&void 0!==n?n:i,s="".concat(o.slice(0,i),"\n").concat(o.slice(a));ne&&(s=s.slice(0,ne));var d=Math.min(i+1,s.length);P.current=d,Q||V(s),oe(s)}},onFocus:function(e){return ee(e)},onBlur:function(e){return te(e)},onCompositionStart:function(){H.current=!0},onCompositionEnd:function(){H.current=!1,re()},style:r(r({},ie),{minHeight:j?void 0:"".concat(24*k+24,"px"),overflowY:j?"hidden":"auto"}),autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1}):e.jsx("textarea",r({ref:W,value:U,placeholder:y,disabled:l,readOnly:p,rows:j?void 0:k,maxLength:h,onChange:function(e){Q||V(e.target.value),null==S||S(e)},onFocus:ee,onBlur:te,style:ie,autoComplete:I.autoComplete||"off",autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1},I)),(x||h)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:Ie,lineHeight:He,color:l?Ve.textDisabled:Ve.textTertiary,fontFamily:Ae},children:h?e.jsxs("span",{children:[$," / ",h]}):e.jsx("span",{children:$})})]})]});return T||R?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[T&&e.jsxs("label",{style:r(r({},Xe()),{display:"flex",alignItems:"center",gap:"2px"}),children:[T,A&&e.jsx("span",{style:{color:Ve.error600,marginLeft:"2px"},children:"*"}),B&&e.jsx("span",{style:{marginLeft:"4px",display:"inline-flex",alignItems:"center",color:Ve.fgQuaternary},children:B})]}),le,R&&e.jsx("p",{style:Ze(d),children:R})]}):le});Bt.displayName="Textarea";var It=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,d=n.onChange,c=n.onClick,p=n.checkedChildren,f=n.unCheckedChildren,x=n.size,h=void 0===x?"default":x,g=n.loading,v=void 0!==g&&g,m=n.className,y=void 0===m?"":m,b=n.style,w=u().primaryColor,C=void 0===w?"#FB6011":w,k=t.useState(a),F=k[0],j=k[1],S=void 0!==o,D=S?o:F,z={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[h],M=D||v,E=s?"#E7E5E4":M?C:"#F5F5F4",L=M?"calc(100% - ".concat(z.thumbSize," - ").concat(z.thumbOffset,")"):z.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":D,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!D;S||j(t),null==d||d(t,e),null==c||c(t,e)}},className:"aha-switch ".concat(y),style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:z.width,height:z.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===h?"10px":"12px",backgroundColor:E,cursor:s||v?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(p||f)&&e.jsx("span",{style:{position:"absolute",left:M?"6px":"auto",right:M?"auto":"6px",fontSize:z.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:s?.5:1,zIndex:1,pointerEvents:"none"},children:M?p:f}),e.jsx("span",{style:{position:"absolute",left:L,top:"50%",transform:"translateY(-50%)",width:z.thumbSize,height:z.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:v&&e.jsxs("svg",{width:"small"===h?"8":"10",height:"small"===h?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};It.displayName="Switch";var Wt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Nt=["January","February","March","April","May","June","July","August","September","October","November","December"],Ht=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),o=e.getMonth(),r=String(o+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),Nt[o]).replace(new RegExp("","g"),Wt[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},Pt=function(e,t){return new Date(e,t+1,0).getDate()},Yt=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},Ot=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},Vt=function(o){var i=o.mode,a=void 0===i?"date":i,l=o.disabled,s=void 0!==l&&l,d=o.error,c=void 0!==d&&d,p=o.placeholder,f=void 0===p?"Select date":p,x=o.startPlaceholder,h=void 0===x?"Start date":x,g=o.endPlaceholder,v=void 0===g?"End date":g,m=o.size,y=void 0===m?"medium":m,b=o.allowClear,w=void 0!==b&&b,C=o.format,k=void 0===C?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":C,F=o.onFocus,j=o.onBlur,S=o.onOpenChange,D=o.className,z=void 0===D?"":D,M=o.style,E=o.dropdownClassName,L=void 0===E?"":E,T=o.dropdownStyle,A=o.defaultOpen,R=void 0!==A&&A,B=o.open,I=o.minDate,W=o.maxDate,N=o.separator,H=void 0===N?" - ":N,P=o.presetRanges,Y=void 0!==P&&P,O=o.calendarCount,V=void 0===O?1:O,q=o.showApplyCancel,X=void 0!==q&&q,Z=o.applyText,K=void 0===Z?"Apply":Z,G=o.cancelText,_=void 0===G?"Cancel":G,J=o.onApply,Q=o.onCancel,U=o.showSelectedRange,$=void 0!==U&&U,ee=o.startSelectedRangeText,te=void 0===ee?"Select dates":ee,ne=o.endSelectedRangeText,oe=void 0===ne?"Select dates":ne,re=o.rangeDisplayMode,ie=void 0===re?"range":re,ae=u().primaryColor,le=void 0===ae?"#FB6011":ae,se="range"===a,de=t.useState(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),ce=de[0],ue=de[1],pe=t.useState(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),fe=pe[0],xe=pe[1],he=t.useState(R),ge=he[0],ve=he[1],me=t.useState(!0),ye=me[0],be=me[1],we=t.useState(null),Ce=we[0],ke=we[1],Fe=t.useState(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),je=Fe[0],Se=Fe[1],De=t.useState(function(){if(2===V&&se){var e=new Date(je.year,je.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),ze=De[0],Me=De[1];t.useEffect(function(){if(2===V&&se){var e=new Date(je.year,je.month+1,1);Me({year:e.getFullYear(),month:e.getMonth()})}else Me(null)},[je,V,se]);var Ee=t.useRef(null),Le=t.useRef(null),Te=t.useRef(null),Ae=t.useRef(null),Re=t.useRef(null),Be=t.useState(null),Ie=Be[0],We=Be[1],Ne=t.useRef(!1),He=t.useRef(!1),Pe=t.useRef(null),Ye="value"in o&&void 0!==o.value,Oe=void 0!==B,Ve=se?null:Ye&&"date"===a&&"value"in o?o.value:ce,qe=se?Ye&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:fe:{startDate:null,endDate:null},Xe=Oe?B:ge;t.useEffect(function(){if(Xe&&!Ne.current){if(se){var e=qe.startDate||qe.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Se({year:t,month:n})}else{var o=new Date;Se({year:o.getFullYear(),month:o.getMonth()})}}else if(Ve){t=Ve.getFullYear(),n=Ve.getMonth();Se({year:t,month:n})}else{o=new Date;Se({year:o.getFullYear(),month:o.getMonth()})}Ne.current=!0}else Xe||(Ne.current=!1)},[Xe,Ve,qe,se]),t.useEffect(function(){if(Xe&&Ee.current){He.current=!1,Pe.current=null;var e=function(){if(Ee.current){var e=Ee.current.getBoundingClientRect();if(He.current&&null!==Pe.current){var t,n=Pe.current;if(Re.current){var o=Re.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void We({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";We({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(Re.current){var t=Re.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),He.current=!0,Pe.current=i}We({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}We(null),He.current=!1,Pe.current=null},[Xe]),t.useEffect(function(){var e=function(e){var t=e.target;Ee.current&&!Ee.current.contains(t)&&Re.current&&!Re.current.contains(t)&&(Oe||ve(!1),null==S||S(!1))};if(Xe)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Xe,Oe,S]);var Ze,Ke,Ge,_e,Je=t.useCallback(function(e){var t;Ot(e,I,W)&&(Ye||ue(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Oe||ve(!1),null==S||S(!1))},[Ye,Oe,a,o,S,I,W]),Qe=t.useCallback(function(e){var t;if(Ot(e,I,W)){var n,r=X&&Ce?Ce:qe;r.startDate&&r.endDate?(n={startDate:e,endDate:null},be(!1)):ye?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},be(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(be(!0),X||(Oe||ve(!1),null==S||S(!1))):be(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},be(!1)):(n={startDate:r.startDate,endDate:e},be(!0),X||(Oe||ve(!1),null==S||S(!1))),X?ke(n):(Ye||xe(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[ye,qe,Ce,X,Ye,Oe,a,o,S,I,W]),Ue=function(e){var t,n;if(e.stopPropagation(),se){var r={startDate:null,endDate:null};Ye||xe(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),be(!0)}else Ye||ue(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!Xe){var i=new Date;Se({year:i.getFullYear(),month:i.getMonth()})}},$e=function(){if(!s){var e=!Xe;if(Oe||ve(e),null==S||S(e),e){if(se){if(be(!qe.startDate),X&&ke(qe),!qe.startDate&&!qe.endDate){var t=new Date;Se({year:t.getFullYear(),month:t.getMonth()})}}else if(!Ve){t=new Date;Se({year:t.getFullYear(),month:t.getMonth()})}}else!e&&X&&ke(null)}},et=t.useMemo(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),tt=t.useMemo(function(){return Array.isArray(Y)?Y:!0===Y?et:[]},[Y,et]),nt=tt.length>0,ot=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Se({year:n,month:r})}X?ke(e):(Ye||xe(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Oe||ve(!1),null==S||S(!1))},rt=function(){Se(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},it=function(){Se(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},at=t.useCallback(function(e,t){for(var n=Pt(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),lt=t.useMemo(function(){return at(je.year,je.month)},[je,at]),st=t.useMemo(function(){return 2===V&&se&&ze?at(ze.year,ze.month):null},[V,se,ze,at]),dt=function(){ze&&Me(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},ct=function(){ze&&Me(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},ut={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},pt=w&&!s&&(se?qe.startDate||qe.endDate:Ve),ft=Ve?Ht(Ve,k):"",xt=qe.startDate?Ht(qe.startDate,k):"",ht=qe.endDate?Ht(qe.endDate,k):"",gt=t.useMemo(function(){if(!se||"text"!==ie)return"";if(qe.startDate&&qe.endDate){var e=Ht(qe.startDate,"MMM D, YYYY"),t=Ht(qe.endDate,"MMM D, YYYY");return"".concat(e," ").concat(H," ").concat(t)}return qe.startDate?Ht(qe.startDate,"MMM D, YYYY"):qe.endDate?Ht(qe.endDate,"MMM D, YYYY"):""},[se,ie,qe,H]),vt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:Ee,className:"aha-date-picker ".concat(z),style:r({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":Xe?le:"#D7D3D0"),backgroundColor:s?"#FAFAF9":"#FFFFFF",cursor:s?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:pt?"30px":"12px",paddingTop:ut[y].paddingTop,paddingBottom:ut[y].paddingBottom,fontSize:ut[y].fontSize,lineHeight:ut[y].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},M),onClick:$e,onFocus:function(e){null==F||F(e)},onBlur:function(e){null==j||j(e)},tabIndex:s?-1:0,children:[e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:s?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),se?"text"===ie?e.jsx("input",{ref:Le,type:"text",value:gt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||$e()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":qe.startDate||qe.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):e.jsxs("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e.jsx("input",{ref:Te,type:"text",value:xt,readOnly:!0,placeholder:h,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(be(!0),Xe){if(!qe.startDate&&!qe.endDate){var t=new Date;Se({year:t.getFullYear(),month:t.getMonth()})}}else $e()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":qe.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e.jsx("span",{style:{color:s?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:H}),e.jsx("input",{ref:Ae,type:"text",value:ht,readOnly:!0,placeholder:v,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(be(!1),Xe){if(!qe.startDate&&!qe.endDate){var t=new Date;Se({year:t.getFullYear(),month:t.getMonth()})}}else $e()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":qe.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e.jsx("input",{ref:Le,type:"text",value:ft,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||$e()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ve?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),pt&&e.jsx("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ue,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),Xe&&Ie&&n.createPortal(e.jsx("div",{ref:Re,className:"aha-date-picker-dropdown ".concat(L),style:r({position:"absolute",top:"".concat(Ie.top,"px"),left:"".concat(Ie.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Ie.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Ie.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},T),children:e.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:se&&nt&&1===V?"column":"row"},children:[se&&nt&&2===V&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:X?"0":"8px"},children:tt.map(function(t,n){var o=Ce?Yt(t.range.startDate,Ce.startDate)&&Yt(t.range.endDate,Ce.endDate):Yt(t.range.startDate,qe.startDate)&&Yt(t.range.endDate,qe.endDate);return e.jsx("div",{onClick:function(){return ot(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?le:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),e.jsxs("div",{children:[e.jsx("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===V?"row":"column",gap:2===V?"24px":"0"},children:(_e=function(t,n,o,r,i){return void 0===i&&(i=0),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:2===V&&se?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===V&&se&&1===i)&&e.jsx("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&se?"absolute":"relative",left:2===V&&se?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[Nt[t.month]," ",t.year]}),!(2===V&&se&&0===i)&&e.jsx("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&se?"absolute":"relative",right:2===V&&se?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),se&&$&&1===V&&0===i&&(a=X&&Ce?Ce:qe,l=a.startDate?Ht(a.startDate,"MMM D, YYYY"):te,s=a.endDate?Ht(a.endDate,"MMM D, YYYY"):oe,e.jsxs("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.startDate?"text-[#44403C]":"text-[#79716B]"),children:l}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),se&&nt&&1===V&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:tt.map(function(t,n){var o=Ce?Yt(t.range.startDate,Ce.startDate)&&Yt(t.range.endDate,Ce.endDate):Yt(t.range.startDate,qe.startDate)&&Yt(t.range.endDate,qe.endDate);return e.jsx("button",{type:"button",onClick:function(){return ot(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?le:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:vt.map(function(t){return e.jsx("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var o,r,i=(o=t.year,r=t.month,new Date(o,r,1).getDay()),a=(0===i?7:i)-1,l=[],s=0;s<a;s++)l.push(e.jsx("div",{},"empty-".concat(s)));return n.forEach(function(n,o){if(n){var r=a+o,i=n.getMonth()===t.month,s=Yt(n,new Date),d=!Ot(n,I,W);if(se){var c=X&&Ce?Ce:qe,u=Yt(n,c.startDate),p=Yt(n,c.endDate),f=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(n,c.startDate,c.endDate),x=r%7==0,h=r%7==6,g=u,v=p,m={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:d?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.4:1,position:"relative",padding:0,margin:0};if(g||v)m.background=le,m.borderRadius="50%",m.color="#FFFFFF",m.fontWeight=500;else if(f){m.background="#F5F5F4",m.color=i?d?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;var y=1===n.getDate(),b=Pt(t.year,t.month),w=n.getDate()===b,C=x||y,k=h||w;C&&k?m.borderRadius="18px":C?(m.borderTopLeftRadius="18px",m.borderBottomLeftRadius="18px",m.borderTopRightRadius="0",m.borderBottomRightRadius="0"):k?(m.borderTopRightRadius="18px",m.borderBottomRightRadius="18px",m.borderTopLeftRadius="0",m.borderBottomLeftRadius="0"):m.borderRadius="0"}else m.background="transparent",m.borderRadius="50%",m.color=i?d?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return Qe(n)},style:m,onMouseEnter:function(e){d||g||v||(e.currentTarget.style.backgroundColor=f?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){g||v||(e.currentTarget.style.backgroundColor=f?"#F5F5F4":"transparent")},children:[n.getDate(),s&&e.jsx("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:g||v?"#FFFFFF":le}})]},"date-".concat(o)))}else{var F=Yt(n,Ve);l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return Je(n)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:F?le:"transparent",cursor:d?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:F?500:400,color:F?"#FFFFFF":i?d?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){d||F||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){F||(e.currentTarget.style.backgroundColor="transparent")},children:[n.getDate(),s&&!F&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:le}})]},"date-".concat(o)))}}}),l}()})]},i);var a,l,s},e.jsxs(e.Fragment,{children:[_e(je,lt,rt,it,0),2===V&&se&&ze&&st&&_e(ze,st,dt,ct,1)]}))}),se&&$&&2===V&&!X&&(Ze=qe,Ke=Ze.startDate?Ht(Ze.startDate,"MMM D, YYYY"):te,Ge=Ze.endDate?Ht(Ze.endDate,"MMM D, YYYY"):oe,e.jsx("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ze.startDate?"text-[#44403C]":"text-[#79716B]"),children:Ke}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ze.endDate?"text-[#44403C]":"text-[#79716B]"),children:Ge})]})})),se&&X&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[$&&2===V&&function(){var t=Ce||qe,n=t.startDate?Ht(t.startDate,"MMM D, YYYY"):te,o=t.endDate?Ht(t.endDate,"MMM D, YYYY"):oe;return e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.startDate?"text-[#44403C]":"text-[#79716B]"),children:n}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),e.jsxs("div",{className:"".concat(2===V?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e.jsx("button",{type:"button",onClick:function(){ke(null),null==Q||Q(),Oe||ve(!1),null==S||S(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:_}),e.jsx("button",{type:"button",onClick:function(){var e;Ce&&(Ye||xe(Ce),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,Ce)),null==J||J(Ce),Oe||ve(!1),null==S||S(!1),ke(null))},disabled:!Ce||!Ce.startDate||!Ce.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Ce&&Ce.startDate&&Ce.endDate?le:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Ce&&Ce.startDate&&Ce.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Ce&&Ce.startDate&&Ce.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Ce&&Ce.startDate&&Ce.endDate&&(e.currentTarget.style.backgroundColor=le)},children:K})]})]})]})]})}),document.body)]})};Vt.displayName="DatePicker";var qt=t.createContext(null),Xt=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),Zt=t.forwardRef(function(n,o){var i=n.initialValues,s=void 0===i?{}:i,d=n.onValuesChange,c=n.onFinish,u=n.onFinishFailed,p=n.labelWidth,f=void 0===p?"120px":p,x=n.labelAlign,h=void 0===x?"right":x,g=n.layout,v=void 0===g?"horizontal":g;n.size;var m=n.className,y=void 0===m?"":m,b=n.style,w=n.children,C=t.useState(function(){var e={};return Object.keys(s).forEach(function(t){e[t]={value:s[t],error:void 0,touched:!1,validating:!1}}),e}),k=C[0],F=C[1],j=t.useRef(k);t.useEffect(function(){j.current=k},[k]);var S=t.useRef({}),D=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),z=t.useCallback(function(e,t){F(function(n){var o=r({},n);if(o[e]?o[e]=r(r({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},j.current[e]?j.current[e]=r(r({},j.current[e]),{value:t}):j.current[e]={value:t,error:void 0,touched:!1,validating:!1},d){var i={};i[e]=t;var a={};Object.keys(o).forEach(function(e){a[e]=o[e].value}),d(i,a)}return o})},[d]),M=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),E=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{error:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),T=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{touched:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),A=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.validating)||!1},[]),R=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{validating:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),B=t.useRef();B.current=function(e,t){F(function(n){if(n[e]){var o=n[e].rules||[],i=t.rules||[],a=o.length===i.length;if(a&&o.length>0)for(var l=0;l<o.length;l++){var d=o[l],c=i[l];if((null==d?void 0:d.required)!==(null==c?void 0:c.required)||(null==d?void 0:d.message)!==(null==c?void 0:c.message)||(null==d?void 0:d.type)!==(null==c?void 0:c.type)||(null==d?void 0:d.pattern)!==(null==c?void 0:c.pattern)||(null==d?void 0:d.min)!==(null==c?void 0:c.min)||(null==d?void 0:d.max)!==(null==c?void 0:c.max)||(null==d?void 0:d.len)!==(null==c?void 0:c.len)||(null==d?void 0:d.whitespace)!==(null==c?void 0:c.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var u=r({},n);return u[e]?u[e]=r(r({},u[e]),{rules:t.rules,required:t.required}):u[e]={value:s[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},u})};var I=t.useCallback(function(e,t){var n;null===(n=B.current)||void 0===n||n.call(B,e,t)},[]),W=t.useCallback(function(e){delete S.current[e],F(function(t){var n=r({},t);return delete n[e],n}),delete j.current[e]},[]),N=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,i,a,s,d,c,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];R(e,!0),n=t.rules||[],i=0,a=n,l.label=1;case 1:if(!(i<a.length))return[3,6];if(s=a[i],d=t.value,s.required&&(null==d||""===d))return o=s.message||"".concat(e," is required"),[3,6];if(s.type&&null!=d&&""!==d&&(c={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[s.type])&&!c(d))return o=s.message||"".concat(e," must be a valid ").concat(s.type),[3,6];if(s.pattern&&null!=d&&""!==d&&!s.pattern.test(String(d)))return o=s.message||"".concat(e," format is invalid"),[3,6];if(void 0!==s.min&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))<s.min)return o=s.message||"".concat(e," must be at least ").concat(s.min),[3,6];if(void 0!==s.max&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))>s.max)return o=s.message||"".concat(e," must be at most ").concat(s.max),[3,6];if(void 0!==s.len&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))!==s.len)return o=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof d&&d.trim()!==d)return o=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,d)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),o=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return i++,[3,1];case 6:return j.current[e]?j.current[e]=r(r({},j.current[e]),{error:o,validating:!1,touched:!0}):j.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},F(function(n){var i=r({},n);return i[e]?i[e]=r(r({},i[e]),{error:o,validating:!1,touched:!0}):i[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},i}),[2,o]}})})},[]),H=t.useCallback(function(e){var t=j.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),P=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,r,i;return l(this,function(s){switch(s.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return a(void 0,void 0,void 0,function(){var n,o;return l(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,N(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return s.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(s.sent(),o.length>0)throw r=H(),i={values:r,errorFields:o},null==u||u(i),new Xt("Form validation failed",r,o);return[2,H()]}})})},[N,H,u]),Y=t.useCallback(function(e){F(function(t){var n=r({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=r(r({},n[e]),{value:s[e],error:void 0,touched:!1,validating:!1}),j.current[e]=r({},n[e]))}),n})},[s]),O=t.useCallback(function(e){F(function(t){var n=r({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=r(r({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},j.current[t]=r({},n[t])}),d){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),d(e,o)}return n})},[d]),V=t.useCallback(function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,P()];case 1:return e=t.sent(),null==c||c(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[P,c]),q=t.useCallback(function(e){if(F(function(t){var n=r({},t);return e.forEach(function(e){var t=e.name,o=e.value,i=e.errors,a=i&&i.length>0?i[0]:void 0;n[t]?n[t]=r(r(r({},n[t]),void 0!==o&&{value:o}),{error:a,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:a,touched:!0,validating:!1},j.current[t]=r({},n[t])}),n}),d&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return d(t,H())},0)}},[d,H]),X=t.useCallback(function(e,t){t?S.current[e]=t:delete S.current[e]},[]),Z=t.useCallback(function(e,t){var n=S.current[e];null==n||n.scrollIntoView(r({behavior:"smooth",block:"center"},t))},[]);t.useImperativeHandle(o,function(){return{getFieldValue:D,getFieldsValue:H,setFieldValue:z,setFieldsValue:O,setFields:q,getFieldError:M,validateField:N,validateFields:P,resetFields:Y,submit:V,scrollToField:Z}});var K=t.useMemo(function(){return{fields:k,getFieldValue:D,setFieldValue:z,getFieldError:M,setFieldError:E,isFieldTouched:L,setFieldTouched:T,isFieldValidating:A,setFieldValidating:R,registerField:I,unregisterField:W,validateField:N,validateFields:P,resetFields:Y,getFieldsValue:H,setFieldsValue:O,setFields:q,submit:V,scrollToField:Z,registerFieldRef:X,labelWidth:f,labelAlign:h}},[k,D,z,M,E,L,T,A,R,I,W,N,P,Y,H,O,q,V,Z,X,f,h]),G=r({},b);return"vertical"===v?(G.display="flex",G.flexDirection="column"):"inline"===v&&(G.display="inline-flex",G.flexWrap="wrap",G.gap="16px"),e.jsx(qt.Provider,{value:K,children:e.jsx("form",{className:"aha-form ".concat(y),style:G,onSubmit:function(e){return a(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,P()];case 2:return t=n.sent(),null==c||c(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:w})})});Zt.displayName="Form";var Kt=Zt;Kt.Item=function(n){var o=n.name,i=n.label,a=n.htmlFor;n.labelCol,n.wrapperCol;var l=n.required,s=void 0!==l&&l,d=n.rules,c=void 0===d?[]:d;n.hasFeedback;var u=n.validateStatus,p=n.help,f=n.extra,x=n.className,h=void 0===x?"":x,g=n.style,v=n.children;n.labelAlign,n.labelWidth;var m=n.hidden,y=void 0!==m&&m,b=n.tooltip,w=t.useContext(qt),C=t.useRef(null),k=t.useCallback(function(e){C.current=e,o&&(null==w?void 0:w.registerFieldRef)&&w.registerFieldRef(o,e)},[o,w]),F=(null==w?void 0:w.fields)||{};o&&w&&w.getFieldValue(o);var j=o&&w?w.getFieldError(o):void 0,S=!(!o||!w)&&w.isFieldTouched(o),D=!(!o||!w)&&w.isFieldValidating(o);o&&F[o];var z=u||(j?"error":D?"validating":S&&!j?"success":void 0),M=void 0!==p?p:j||void 0,E=t.useRef(c),L=t.useRef(s),T=t.useRef(!1),A=s||c.some(function(e){return e.required}),R=t.useMemo(function(){if(!T.current)return T.current=!0,!0;if(E.current.length!==c.length)return!0;if(E.current===c)return!1;for(var e=0;e<c.length;e++){var t=E.current[e],n=c[e];if((null==t?void 0:t.required)!==(null==n?void 0:n.required)||(null==t?void 0:t.message)!==(null==n?void 0:n.message)||(null==t?void 0:t.type)!==(null==n?void 0:n.type)||(null==t?void 0:t.pattern)!==(null==n?void 0:n.pattern)||(null==t?void 0:t.min)!==(null==n?void 0:n.min)||(null==t?void 0:t.max)!==(null==n?void 0:n.max)||(null==t?void 0:t.len)!==(null==n?void 0:n.len)||(null==t?void 0:t.whitespace)!==(null==n?void 0:n.whitespace))return!0}return!1},[c]);t.useEffect(function(){if(o&&w)return(!E.current||R||L.current!==s)&&(E.current=c,L.current=s,w.registerField(o,{rules:c,required:A})),function(){o&&w&&w.unregisterField(o)}},[o]);if(y)return null;return e.jsxs("div",{ref:k,className:"aha-form-item ".concat(h),style:r({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[i&&e.jsxs("label",{htmlFor:a,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[i,A&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),b&&e.jsx(function(n){var o=n.content,r=t.useState(!1),i=r[0],a=r[1],l=t.useRef(null);return t.useEffect(function(){var e=function(e){l.current&&!l.current.contains(e.target)&&a(!1)};if(i)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),a(!i)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(st,{})}),i&&e.jsxs("div",{ref:l,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[o,e.jsx("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:b})]}),e.jsxs("div",{style:{width:"100%"},children:[e.jsx("div",{children:t.Children.map(v,function(e){return t.isValidElement(e)?function(e){var n,i,a,l,s,d,c,u,p;if(!t.isValidElement(e))return e;var f=r({},e.props);if(o&&w){var x=w.getFieldValue(o),h=w.setFieldValue;if(!h)return e;var g=e.type;if(g&&("object"==typeof g||"function"==typeof g)&&"displayName"in g){var v=g.displayName;if("Input"===v||"Textarea"===v){f.value=x||"";var m=null===(n=e.props)||void 0===n?void 0:n.onChange,y=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){h(o,e.target.value),null==m||m(e),o&&w&&setTimeout(function(){w.validateField(o)},0)},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==y||y(e)},f.error="error"===z}else if("Select"===v){f.value=x;var b=null===(a=e.props)||void 0===a?void 0:a.onChange,C=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){h(o,e),null==b||b(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==C||C(e)},f.error="error"===z}else if("Switch"===v){f.checked=x||!1;var k=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){h(o,e),null==k||k(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Checkbox"===v){f.checked=x||!1;var F=null===(d=e.props)||void 0===d?void 0:d.onChange;f.onChange=function(e){h(o,e.target.checked),null==F||F(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Radio"===v){var j=null===(c=e.props)||void 0===c?void 0:c.value;if(void 0!==j){f.checked=x===j;var S=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){h(o,j),null==S||S(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}}}else{void 0!==x&&(f.value=x);var D=null===(p=e.props)||void 0===p?void 0:p.onChange;f.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;h(o,r),null==D||D(e)}}}return"error"===z&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),M&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===z?"#D92D20":"warning"===z?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:M}),f&&!M&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})},Kt.useForm=function(){return[t.useRef(null)]};var Gt=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,l=n.selectedKeys,d=n.defaultSelectedKeys,c=void 0===d?[]:d,p=n.onSelect,f=n.onDeselect,x=n.onClick,h=n.className,g=void 0===h?"":h,v=n.style,m=n.width,y=void 0===m?320:m;u().primaryColor;var b=t.useRef(null),w=t.useRef({}),C=void 0!==l,k=t.useState(c),F=k[0],j=k[1],S=C?l:F,D=function(e){return"children"in e&&Array.isArray(e.children)},z=t.useCallback(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(D(i)){var a=z(e,i.children,n);if(a)return a}else{var l=i,d=s(s([],n,!0),[l.key],!1);if(l.key===e)return d}}return null},[]),M=t.useCallback(function(e){var t;if(!e.disabled){var n,o=z(e.key,i)||[e.key];S.includes(e.key)?(n=S.filter(function(t){return t!==e.key}),null==f||f({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==p||p({key:e.key,keyPath:o,selectedKeys:n})),C||j(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==x||x({key:e.key,keyPath:o})}},[S,C,p,f,x,i,z]),E=function(t){var n=S.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var o=r({display:"flex",alignItems:"center",padding:"10px 16px",cursor:t.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:t.disabled?.5:1},t.style);return e.jsxs("div",{ref:function(e){w.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:o,onClick:function(){return M(t)},onMouseEnter:function(e){t.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[t.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.icon}),e.jsx("span",{style:{flex:1},children:t.label}),t.suffixIcon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.suffixIcon})]},t.key)},L=r({width:"number"==typeof y?"".concat(y,"px"):y,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},v),T=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!D(o)||!(!D(n)||D(o))};return e.jsxs("div",{ref:b,className:"aha-menu-list ".concat(g),style:L,children:[a&&(a?a.render?a.render(a):e.jsx("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e.jsx("div",{children:i.map(function(n,o){return e.jsxs(t.Fragment,{children:[T(o,i)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),D(n)?(r=n,e.jsx("div",{className:"aha-menu-group ".concat(r.className||""),children:r.children.map(function(e){return E(e)})},"group-".concat(r.title))):E(n)]},o);var r})})]})};Gt.displayName="MenuList";var _t=function(e,t,n,o){void 0===o&&(o=6);var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,s=o+6,d=0,c=0;switch(n){case"top":d=e.top-t.height-s+i,c=a-t.width/2+r;break;case"bottom":default:d=e.bottom+s+i,c=a-t.width/2+r;break;case"left":d=l-t.height/2+i,c=e.left-t.width-s+r;break;case"right":d=l-t.height/2+i,c=e.right+s+r;break;case"top-left":d=e.top-t.height-s+i,c=e.left+r;break;case"top-right":d=e.top-t.height-s+i,c=e.right-t.width+r;break;case"bottom-left":d=e.bottom+s+i,c=e.left+r;break;case"bottom-right":d=e.bottom+s+i,c=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return c<r+8?c=r+8:c+t.width>r+u-8&&(c=r+u-t.width-8),d<i+8?d=i+8:d+t.height>i+p-8&&(d=i+p-t.height-8),{top:d,left:c}},Jt=function(e,t,n,o){void 0===o&&(o=6);var r=_t(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,s=i-(window.scrollY||window.pageYOffset),d=a-l,c=s+t.height,u=d+t.width,p=s,f=d,x=Math.max(p,e.top),h=Math.min(c,e.bottom),g=Math.max(f,e.left),v=Math.min(u,e.right);return h>x+1&&v>g+1},Qt=function(t,n){var o=r({position:"absolute",width:0,height:0,borderStyle:"solid"},n),i={top:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:r(r({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:i[t]})},Ut=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},$t=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},en=function(o){var i,a=o.children,l=o.content,s=o.trigger,d=void 0===s?"click":s,c=o.open,u=o.defaultOpen,p=void 0!==u&&u,f=o.onOpenChange,x=o.placement,h=void 0===x?"right":x,g=o.width,v=o.offset,m=void 0===v?8:v,y=o.className,b=void 0===y?"":y,w=o.popoverClassName,C=void 0===w?"":w,k=o.disabled,F=void 0!==k&&k,j=o.destroyOnHide,S=o.destroyTooltipOnHide,D=null===(i=null!=j?j:S)||void 0===i||i,z=void 0!==c,M=t.useState(p),E=M[0],L=M[1],T=z?!!c:E,A=t.useState({top:0,left:0,opacity:0}),R=A[0],B=A[1],I=t.useRef(null),W=t.useRef(null),N=t.useCallback(function(e){z||L(e),null==f||f(e)},[z,f]),H=t.useCallback(function(){if(T&&I.current&&W.current){var e=I.current.getBoundingClientRect(),t=W.current.getBoundingClientRect(),n=function(){if(Ut(e,t,h,m))return h;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(h);return Ut(e,t,n,m)||$t(e,n)>$t(e,h)?n:h}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,m),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,s=t;return s<o+8&&(s=o+8),s+n.width>o+i-8&&(s=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:s}}(o.top,o.left,t);B({top:r.top,left:r.left,opacity:1})}},[T,h,m]),P=t.useCallback(function(){F||N(!0)},[F,N]),Y=t.useCallback(function(){N(!1)},[N]),O=t.useCallback(function(){F||N(!T)},[F,T,N]);t.useEffect(function(){if(T)return requestAnimationFrame(function(){H()}),window.addEventListener("resize",H),window.addEventListener("scroll",H,!0),function(){window.removeEventListener("resize",H),window.removeEventListener("scroll",H,!0)}},[T,H]),t.useEffect(function(){if(T&&"click"===d){var e=function(e){var t=e.target;I.current&&W.current&&!I.current.contains(t)&&!W.current.contains(t)&&Y()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}},[T,d,Y]);var V="hover"===d?{onMouseEnter:P,onMouseLeave:Y,onFocus:P,onBlur:Y}:{onClick:function(e){e.stopPropagation(),O()}},q=T||!D?e.jsx("div",{ref:W,className:"aha-popover ".concat(C),style:{position:"absolute",zIndex:9999,top:R.top,left:R.left,opacity:T?R.opacity:0,visibility:T?"visible":"hidden",pointerEvents:T?"auto":"none",transition:"opacity 120ms ease-out",width:"number"==typeof g?"".concat(g,"px"):g,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:ne},onMouseEnter:"hover"===d?P:void 0,onMouseLeave:"hover"===d?Y:void 0,onMouseDown:"click"===d?function(e){return e.stopPropagation()}:void 0,children:l}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:I,className:"aha-popover-trigger ".concat(b),style:{display:"inline-block",cursor:F?"not-allowed":"pointer"}},V,{children:a})),q&&"undefined"!=typeof document&&n.createPortal(q,document.body)]})};en.displayName="Popover";var tn=240,nn=function(o){var i=o.open,a=o.defaultOpen,l=void 0!==a&&a,s=o.onClose,d=o.afterOpenChange,c=o.title,u=o.extra,p=o.footer,f=o.children,x=o.placement,h=void 0===x?"right":x,g=o.width,v=void 0===g?378:g,m=o.height,y=void 0===m?378:m,b=o.mask,w=void 0===b||b,C=o.maskClosable,k=void 0===C||C,F=o.closable,j=void 0===F||F,S=o.closeIcon,D=o.keyboard,z=void 0===D||D,M=o.destroyOnClose,E=void 0!==M&&M,L=o.zIndex,T=void 0===L?1e3:L,A=o.mobileBreakpoint,R=void 0===A?768:A,B=o.className,I=void 0===B?"":B,W=o.style,N=o.drawerStyle,H=o.headerStyle,P=o.bodyStyle,Y=o.footerStyle,O=o.maskStyle,V=void 0!==i,q=t.useState(l),X=q[0],Z=q[1],K=V?!!i:X,G=t.useState(K),_=G[0],J=G[1],Q=t.useState(K),U=Q[0],$=Q[1],ee=t.useState(!1),te=ee[0],ne=ee[1],oe=t.useState(!1),re=oe[0],ie=oe[1];t.useEffect(function(){ne(!0)},[]),t.useEffect(function(){var e=function(){ie(window.innerWidth<R)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[R]),t.useEffect(function(){if(K){J(!0),$(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){$(!0)})}),t=window.setTimeout(function(){null==d||d(!0)},tn);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}$(!1);var n=window.setTimeout(function(){E&&J(!1),null==d||d(!1)},tn);return function(){return window.clearTimeout(n)}},[K,E,d]),t.useEffect(function(){if(K&&z){var e=function(e){"Escape"===e.key&&(null==s||s(e),V||Z(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[K,z,s,V]),t.useEffect(function(){if(te&&K){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[K,te]);var ae=t.useCallback(function(e){null==s||s(e),V||Z(!1)},[s,V]),le=t.useMemo(function(){return re?"100vw":"left"===h||"right"===h?"number"==typeof v?"".concat(v,"px"):v:"100vw"},[h,re,v]),se=t.useMemo(function(){return"top"===h||"bottom"===h?"number"==typeof y?"".concat(y,"px"):y:"100vh"},[h,y]),de=t.useMemo(function(){return re&&("left"===h||"right"===h)?"bottom":h},[re,h]),ce=t.useMemo(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(tn,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:T+1};switch(de){case"left":return r(r({},e),{top:0,left:0,width:le,height:"100vh",transform:U?"translateX(0)":"translateX(-100%)"});case"right":return r(r({},e),{top:0,right:0,width:le,height:"100vh",transform:U?"translateX(0)":"translateX(100%)"});case"top":return r(r({},e),{top:0,left:0,width:"100vw",height:se,transform:U?"translateY(0)":"translateY(-100%)"});default:return r(r({},e),{bottom:0,left:0,width:"100vw",height:se,transform:U?"translateY(0)":"translateY(100%)"})}},[de,le,se,U,T]);if(!te||!_&&!K)return null;var ue=e.jsxs("div",{className:"aha-drawer-root ".concat(I),style:r({position:"fixed",inset:0,zIndex:T,pointerEvents:K||U?"auto":"none"},W),children:[w&&e.jsx("div",{"aria-hidden":!0,onClick:k?function(e){return ae(e)}:void 0,style:r({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:U?1:0,transition:"opacity ".concat(tn,"ms cubic-bezier(0.2, 0, 0, 1)")},O)}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:r(r({},ce),N),children:[(void 0!==c||j||u)&&e.jsxs("div",{style:r({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},H),children:[e.jsx("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:c}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u,j&&e.jsx("button",{type:"button",onClick:function(e){return ae(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:S||e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsx("div",{style:r({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},P),children:f}),void 0!==p&&e.jsx("div",{style:r({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},Y),children:p})]},"".concat(de,"-").concat(K?"open":"closed"))]});return n.createPortal(ue,document.body)};nn.displayName="Drawer";var on={name:"Thinking Five",tag:"Custom Rose Trail",rotate:!0,particleCount:62,trailSpan:.38,durationMs:3900,rotationDurationMs:28e3,pulseDurationMs:3e3,strokeWidth:5.5,baseRadius:7,detailAmplitude:3,petalCount:5,curveScale:3};function rn(e,t,n){var o=e*Math.PI*2,r=Math.round(n.petalCount),i=n.baseRadius*Math.cos(o)-n.detailAmplitude*t*Math.cos(r*o),a=n.baseRadius*Math.sin(o)-n.detailAmplitude*t*Math.sin(r*o);return{x:50+i*n.curveScale,y:50+a*n.curveScale}}function an(e,t,n,o){var r=e/Math.max(1,o.particleCount-1),i=rn(function(e){return(e%1+1)%1}(t-r*o.trailSpan),n,o),a=Math.pow(1-r,.56);return{x:i.x,y:i.y,radius:.9+2.7*a,opacity:.04+.96*a}}function ln(e){return{bg:e[50],text:e[700],ring:e[200],dot:e[500],btnText:e[400],btnHoverBg:e[100],btnHoverText:e[500]}}var sn={gray:ln({25:"#fdfdfc",50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d7d3d0",400:"#a9a29d",500:"#79716b",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#171412"}),brand:ln(p),error:ln(f),warning:ln({25:"#fffcf5",50:"#fffaeb",100:"#fef0c7",200:"#fedf89",300:"#fec84b",400:"#fdb022",500:"#f79009",600:"#dc6803",700:"#b54708",800:"#93370d",900:"#7a2e0e",950:"#4e1d09"}),success:ln({25:"#f6fef9",50:"#ecfdf3",100:"#dcfae6",200:"#abefc6",300:"#75e0a7",400:"#47cd89",500:"#17b26a",600:"#079455",700:"#067647",800:"#085d3a",900:"#074d31",950:"#053321"}),grayBlue:ln({25:"#fcfcfd",50:"#f8f9fc",100:"#eaecf5",200:"#d5d9eb",300:"#b3b8db",400:"#717bbc",500:"#4e5ba6",600:"#3e4784",700:"#363f72",800:"#293056",900:"#101323",950:"#0d0f1c"}),blueLight:ln({25:"#f5fbff",50:"#f0f9ff",100:"#e0f2fe",200:"#b9e6fe",300:"#7cd4fd",400:"#36bffa",500:"#0ba5ec",600:"#0086c9",700:"#026aa2",800:"#065986",900:"#0b4a6f",950:"#062c41"}),blue:ln(x),indigo:ln({25:"#f5f8ff",50:"#eef4ff",100:"#e0eaff",200:"#c7d7fe",300:"#a4bcfd",400:"#8098f9",500:"#6172f3",600:"#444ce7",700:"#3538cd",800:"#2d31a6",900:"#2d3282",950:"#1f235b"}),purple:ln({25:"#fafaff",50:"#f4f3ff",100:"#ebe9fe",200:"#d9d6fe",300:"#bdb4fe",400:"#9b8afb",500:"#7a5af8",600:"#6938ef",700:"#5925dc",800:"#4a1fb8",900:"#3e1c96",950:"#27115f"}),pink:ln({25:"#fef6fb",50:"#fdf2fa",100:"#fce7f6",200:"#fcceee",300:"#faa7e0",400:"#f670c7",500:"#ee46bc",600:"#dd2590",700:"#c11574",800:"#9e165f",900:"#851651",950:"#4e0d30"}),orange:ln({25:"#fefaf5",50:"#fef6ee",100:"#fdead7",200:"#f9dbaf",300:"#f7b27a",400:"#f38744",500:"#ef6820",600:"#e04f16",700:"#b93815",800:"#932f19",900:"#772917",950:"#511c10"})};var dn={sm:"2px 8px",md:"2px 10px",lg:"4px 12px"},cn={sm:"2px 6px",md:"2px 8px",lg:"4px 10px"},un={sm:"12px",md:"14px",lg:"14px"};function pn(e,t){return function(e,t){return"modern"===e?r(r({},sn[t]),{bg:E,text:g,ring:F}):sn[t]}(e,t)}function fn(e,t,n,o){var i=pn(e,t),a="pill"===e,l="lg"===n&&!a,s="inset 0 0 0 1px ".concat(i.ring),d="modern"===e?"".concat(s,", 0px 1px 2px 0px rgba(10, 13, 18, 0.05)"):s;return r({display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",width:"max-content",borderRadius:a?"9999px":l?"8px":"6px",backgroundColor:i.bg,color:i.text,boxShadow:d,fontFamily:"DM Sans, system-ui, sans-serif",fontWeight:500,fontSize:un[n],lineHeight:"sm"===n?"18px":"20px",padding:a?dn[n]:cn[n]},o)}var xn=function(t){var n=t.color;return e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:"4",cy:"4",r:"3",fill:n})})},hn=function(t){var n=t.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",style:n,children:e.jsx("path",{d:"M9 3L3 9M3 3l6 6"})})},gn={xs:{size:24,border:.5,fontSize:V.xs,lineHeight:X.xs,iconSize:16,onlineIndicator:{size:6,offset:-.5},companyIcon:{size:10,offset:-2.5,border:1.5},verifiedTick:{size:10,offset:-1.5}},sm:{size:32,border:.75,fontSize:V.sm,lineHeight:X.sm,iconSize:20,onlineIndicator:{size:8,offset:-.75},companyIcon:{size:12,offset:-2.75,border:1.5},verifiedTick:{size:12,offset:-.75}},md:{size:40,border:1,fontSize:V.md,lineHeight:X.md,iconSize:24,onlineIndicator:{size:10,offset:-1},companyIcon:{size:14,offset:-3,border:1.5},verifiedTick:{size:14,offset:-1}},lg:{size:48,border:1,fontSize:V.lg,lineHeight:X.lg,iconSize:28,onlineIndicator:{size:12,offset:-1},companyIcon:{size:16,offset:-3,border:1.5},verifiedTick:{size:16,offset:-1}},xl:{size:56,border:1,fontSize:V.xl,lineHeight:X.xl,iconSize:32,onlineIndicator:{size:14,offset:-1},companyIcon:{size:18,offset:-3,border:1.5},verifiedTick:{size:18,offset:-1}},"2xl":{size:64,border:1,fontSize:V.displayXs,lineHeight:X.displayXs,iconSize:32,onlineIndicator:{size:16,offset:-1},companyIcon:{size:20,offset:-3,border:1.667},verifiedTick:{size:20,offset:-1}}},vn={sm:{gap:G,nameFontSize:V.sm,nameLineHeight:X.sm,subFontSize:V.xs,subLineHeight:X.xs},md:{gap:G,nameFontSize:V.sm,nameLineHeight:X.sm,subFontSize:V.sm,subLineHeight:X.sm},lg:{gap:_,nameFontSize:V.md,nameLineHeight:X.md,subFontSize:V.md,subLineHeight:X.md},xl:{gap:J,nameFontSize:V.lg,nameLineHeight:X.lg,subFontSize:V.md,subLineHeight:X.md}},mn=function(t){var n=t.style;return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:n,children:e.jsx("path",{d:"M20 21C20 19.6044 20 18.9067 19.8278 18.3389C19.44 17.0605 18.4395 16.06 17.1611 15.6722C16.5933 15.5 15.8956 15.5 14.5 15.5H9.5C8.10444 15.5 7.40665 15.5 6.83886 15.6722C5.56045 16.06 4.56004 17.0605 4.17224 18.3389C4 18.9067 4 19.6044 4 21M16.5 7.5C16.5 9.98528 14.4853 12 12 12C9.51472 12 7.5 9.98528 7.5 7.5C7.5 5.01472 9.51472 3 12 3C14.4853 3 16.5 5.01472 16.5 7.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},yn=function(t){var n=t.size,o=t.offset;return e.jsxs("svg",{viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",bottom:o,right:o,width:n,height:n,flexShrink:0,color:x[500],overflow:"hidden",zIndex:1},children:[e.jsx("path",{d:"M7.72237 1.77098C7.81734 2.00068 7.99965 2.18326 8.2292 2.27858L9.03413 2.61199C9.26384 2.70714 9.44635 2.88965 9.5415 3.11936C9.63665 3.34908 9.63665 3.60718 9.5415 3.83689L9.20833 4.64125C9.11313 4.87106 9.113 5.12943 9.20863 5.35913L9.54122 6.16325C9.58839 6.27702 9.61268 6.39897 9.6127 6.52214C9.61272 6.6453 9.58847 6.76726 9.54134 6.88105C9.4942 6.99484 9.42511 7.09823 9.33801 7.18531C9.2509 7.27238 9.14749 7.34144 9.03369 7.38854L8.22934 7.72171C7.99964 7.81669 7.81706 7.99899 7.72174 8.22855L7.38833 9.03348C7.29318 9.26319 7.11067 9.4457 6.88096 9.54085C6.65124 9.636 6.39314 9.636 6.16343 9.54085L5.35907 9.20767C5.12935 9.11276 4.87134 9.11295 4.64177 9.20821L3.83684 9.54115C3.60725 9.63608 3.34937 9.636 3.11984 9.54092C2.89032 9.44585 2.70791 9.26356 2.6127 9.03409L2.27918 8.22892C2.18421 7.99923 2.0019 7.81665 1.77235 7.72133L0.967421 7.38792C0.737807 7.29281 0.555355 7.11041 0.460169 6.88083C0.364983 6.65125 0.364854 6.39327 0.45981 6.16359L0.792984 5.35924C0.8879 5.12952 0.887707 4.87151 0.792445 4.64193L0.459749 3.83642C0.41258 3.72265 0.388291 3.60069 0.388272 3.47753C0.388252 3.35436 0.412501 3.2324 0.459634 3.11861C0.506767 3.00482 0.57586 2.90144 0.662965 2.81436C0.75007 2.72728 0.853479 2.65822 0.967283 2.61113L1.77164 2.27795C2.00113 2.18306 2.1836 2.00099 2.27899 1.7717L2.6124 0.966768C2.70755 0.737054 2.89006 0.554547 3.11978 0.459397C3.34949 0.364246 3.60759 0.364246 3.83731 0.459397L4.64166 0.792571C4.87138 0.887487 5.12939 0.887293 5.35897 0.792031L6.16424 0.459913C6.39392 0.364816 6.65197 0.364836 6.88164 0.459968C7.11131 0.555099 7.29379 0.737554 7.38895 0.967208L7.72247 1.77238L7.72237 1.77098Z",fill:"currentColor"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95829 3.68932C7.02509 3.58439 7.04747 3.45723 7.02051 3.3358C6.99356 3.21437 6.91946 3.10862 6.81454 3.04182C6.70961 2.97502 6.58245 2.95264 6.46102 2.97959C6.33959 3.00655 6.23384 3.08064 6.16704 3.18557L4.33141 6.06995L3.49141 5.01995C3.41375 4.92281 3.30069 4.8605 3.17709 4.84673C3.05349 4.83296 2.92949 4.86885 2.83235 4.94651C2.73522 5.02417 2.67291 5.13723 2.65914 5.26083C2.64536 5.38443 2.68125 5.50843 2.75891 5.60557L4.00891 7.16807C4.0555 7.22638 4.11533 7.27271 4.18344 7.30323C4.25154 7.33375 4.32595 7.34757 4.40047 7.34353C4.47499 7.3395 4.54747 7.31773 4.61188 7.28004C4.67629 7.24234 4.73077 7.18981 4.77079 7.12682L6.95829 3.68932Z",fill:"white"})]})},bn=function(n){var o=n.size,i=void 0===o?"md":o,a=n.src,l=n.alt,s=n.initials,d=n.placeholderIcon,c=n.status,u=n.companyIcon,p=n.verified,f=n.style,x=n.className,h=t.useState(!1),g=h[0],v=h[1],y=gn[i],b=Boolean(a&&!g),w=!b,C=Boolean(c||u||p);return e.jsxs("div",{className:x,style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:y.size,height:y.size,borderRadius:"50%",border:"".concat(y.border,"px solid ").concat(w?F:"rgba(0, 0, 0, 0.08)"),backgroundColor:w?T:void 0,overflow:C?void 0:"hidden",flexShrink:0},f),children:[b?e.jsx("img",{src:a,alt:l,onError:function(){return v(!0)},style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%",pointerEvents:"none"}}):s?e.jsx("span",{style:{fontSize:y.fontSize,lineHeight:y.lineHeight,fontWeight:600,color:m,fontFamily:O.body,userSelect:"none"},children:s}):d?e.jsx(d,{style:{width:y.iconSize,height:y.iconSize,color:I,flexShrink:0}}):e.jsx(mn,{style:{width:y.iconSize,height:y.iconSize,color:I,flexShrink:0}}),function(){if("online"===c||"offline"===c){var t=y.onlineIndicator,n=t.size,o=t.offset;return e.jsx("span",{style:{position:"absolute",bottom:o,right:o,width:n,height:n,borderRadius:"50%",backgroundColor:"online"===c?Y:I,border:"1.5px solid ".concat(E),flexShrink:0}})}if(u){var r=y.companyIcon,i=r.size,a=(o=r.offset,r.border);return e.jsx("img",{src:u.src,alt:u.alt,style:{position:"absolute",bottom:o,right:o,width:i,height:i,borderRadius:"50%",border:"".concat(a,"px solid ").concat(E),objectFit:"cover",pointerEvents:"none"}})}return p?e.jsx(yn,{size:y.verifiedTick.size,offset:y.verifiedTick.offset}):null}()]})};exports.Alert=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,l=n.title,s=n.description,d=n.icon,c=void 0===d?ge[a]:d,u=n.showIcon,p=void 0===u||u,f=n.closeable,x=void 0!==f&&f,h=n.action,g=n.children,v=n.onClose,m=t.useState(!0),y=m[0],b=m[1],w=function(){b(!1),null==v||v()};return y?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[p&&c,e.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[l&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:l}),s&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),g&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:g}),h&&x&&h]}),h&&!x&&e.jsx("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:h}),x&&e.jsx("div",{className:"flex-shrink-0 self-start mt-1 cursor-pointer",onClick:w,onKeyDown:function(e){return"Enter"===e.key&&w()},role:"button",tabIndex:0,"aria-label":"关闭",children:ve})]}):null},exports.Avatar=bn,exports.AvatarLabelGroup=function(t){var n=t.size,o=void 0===n?"sm":n,i=t.name,a=t.supportingText,l=t.avatarSrc,s=t.avatarInitials,d=t.status,c=t.companyIcon,u=t.verified,p=t.style,f=t.className,x=vn[o];return e.jsxs("div",{className:f,style:r({display:"inline-flex",alignItems:"center",gap:x.gap,position:"relative"},p),children:[e.jsx(bn,{size:o,src:l,initials:s,status:d,companyIcon:c,verified:u}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",flexShrink:0,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{fontSize:x.nameFontSize,lineHeight:x.nameLineHeight,fontWeight:600,color:h,fontFamily:O.body},children:i}),a&&e.jsx("span",{style:{fontSize:x.subFontSize,lineHeight:x.subLineHeight,fontWeight:400,color:v,fontFamily:O.body},children:a})]})]})},exports.Badge=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.children,c=t.style,u=t.className;return e.jsx("span",{style:r(r({},fn(o,s,a)),c),className:u,children:d})},exports.BadgeIcon=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.icon,c=t.style,u=t.className,p=pn(o,s),f="modern"===o?sn[s].dot:p.dot,x={sm:"12px",md:"12px",lg:"14px"};return e.jsx("span",{style:r(r(r({},fn(o,s,a)),{padding:{sm:"5px",md:"6px",lg:"8px"}[a]}),c),className:u,children:e.jsx(d,{style:{width:x[a],height:x[a],color:f}})})},exports.BadgeWithButton=function(n){var o=n.variant,i=void 0===o?"pill":o,a=n.size,l=void 0===a?"md":a,s=n.color,d=void 0===s?"gray":s,c=n.icon,u=n.buttonLabel,p=n.onButtonClick,f=n.children,x=n.style,h=n.className,g=t.useState(!1),v=g[0],m=g[1],y=pn(i,d),b="pill"===i,w={sm:b?"8px":"6px",md:b?"10px":"8px",lg:b?"12px":"10px"},C={sm:"3px",md:"4px",lg:"6px"},k=b?"9999px":"3px";return e.jsxs("span",{style:r(r(r({},fn(i,d,l)),{gap:{sm:"2px",md:"2px",lg:"2px"}[l],paddingLeft:w[l],paddingRight:C[l],paddingTop:"lg"===l?"4px":"2px",paddingBottom:"lg"===l?"4px":"2px"}),x),className:h,children:[f,e.jsx("button",{type:"button","aria-label":u,onClick:p,onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"2px",border:"none",cursor:"pointer",borderRadius:k,backgroundColor:v?y.btnHoverBg:"transparent",color:v?y.btnHoverText:y.btnText,transition:"background-color 100ms linear, color 100ms linear",outline:"none",flexShrink:0},children:c?e.jsx(c,{style:{width:"12px",height:"12px"}}):e.jsx(hn,{})})]})},exports.BadgeWithDot=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.children,c=t.style,u=t.className,p=pn(o,s),f="modern"===o?sn[s].dot:p.dot,x="pill"===o,h={sm:"6px",md:"8px",lg:"10px"},g={sm:x?"8px":"6px",md:x?"10px":"8px",lg:x?"12px":"10px"};return e.jsxs("span",{style:r(r(r({},fn(o,s,a)),{gap:{sm:"4px",md:"6px",lg:"6px"}[a],paddingLeft:h[a],paddingRight:g[a],paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),c),className:u,children:[e.jsx(xn,{color:f}),d]})},exports.BadgeWithIcon=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.iconLeading,c=t.iconTrailing,u=t.children,p=t.style,f=t.className,x=pn(o,s),h="modern"===o?sn[s].dot:x.dot,g={sm:"12px",md:"12px",lg:"14px"},v="pill"===o,m=!!d,y={sm:{pl:m?"6px":"8px",pr:m?"8px":"6px"},md:{pl:v?m?"8px":"10px":"8px",pr:v&&m?"10px":"8px"},lg:{pl:v?m?"10px":"12px":"10px",pr:v&&m?"12px":"10px"}};return e.jsxs("span",{style:r(r(r({},fn(o,s,a)),{gap:{sm:"2px",md:"4px",lg:"4px"}[a],paddingLeft:y[a].pl,paddingRight:y[a].pr,paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),p),className:f,children:[d&&e.jsx(d,{style:{width:g[a],height:g[a],color:h,flexShrink:0}}),u,c&&e.jsx(c,{style:{width:g[a],height:g[a],color:h,flexShrink:0}})]})},exports.BadgeWithImage=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,d=t.imgSrc,c=t.imgAlt,u=void 0===c?"avatar":c,p=t.children,f=t.style,x=t.className,h="pill"===o,g={sm:h?"3px":"4px",md:h?"4px":"6px",lg:h?"6px":"8px"},v={sm:h?"8px":"6px",md:h?"10px":"8px",lg:h?"12px":"10px"},m={sm:"16px",md:"16px",lg:"18px"};return e.jsxs("span",{style:r(r(r({},fn(o,s,a)),{gap:{sm:"4px",md:"6px",lg:"6px"}[a],paddingLeft:g[a],paddingRight:v[a],paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),f),className:x,children:[e.jsx("img",{src:d,alt:u,style:{width:m[a],height:m[a],borderRadius:"9999px",objectFit:"cover",flexShrink:0}}),p]})},exports.Button=he,exports.CheckIcon=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},exports.Checkbox=yt,exports.DatePicker=Vt,exports.Drawer=nn,exports.Form=Kt,exports.Input=tt,exports.InputGroup=_e,exports.InputTags=Ue,exports.Loading=function(n){var o=n.width,r=void 0===o?80:o,i=n.height,a=void 0===i?80:i,l=n.strokeWidth,s=n.color,d=void 0===s?"#5A31F0":s,c=n.className,u=t.useState(0),p=u[0],f=u[1],x=t.useRef(null);t.useEffect(function(){var e,t=function(n){null===x.current&&(x.current=n),f(n-x.current),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),function(){return cancelAnimationFrame(e)}},[]);for(var h,g,v=p,m=(g=v%(h=on).pulseDurationMs/h.pulseDurationMs*Math.PI*2,.52+(Math.sin(g+.55)+1)/2*.48),y=v%on.durationMs/on.durationMs,b=function(e,t){return t.rotate?-e%t.rotationDurationMs/t.rotationDurationMs*360:0}(v,on),w=null!=l?l:on.strokeWidth,C=w/on.strokeWidth,k=function(e,t,n){void 0===n&&(n=480);for(var o=[],r=0;r<=n;r+=1){var i=rn(r/n,e,t);o.push("".concat(0===r?"M":"L"," ").concat(i.x.toFixed(2)," ").concat(i.y.toFixed(2)))}return o.join(" ")}(m,on),F=[],j=0;j<on.particleCount;j+=1){var S=an(j,y,m,on);F.push({cx:S.x,cy:S.y,opacity:S.opacity,r:S.radius*C})}return e.jsx("div",{className:c,style:{width:r,height:a,display:"inline-block",color:d},role:"status","aria-label":"Loading",children:e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",preserveAspectRatio:"xMidYMid meet",style:{overflow:"visible"},children:[e.jsx("title",{children:"Thinking Five"}),e.jsxs("g",{transform:"rotate(".concat(b," 50 50)"),children:[e.jsx("path",{d:k,stroke:"currentColor",strokeWidth:w,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.1}),F.map(function(t,n){return e.jsx("circle",{cx:t.cx,cy:t.cy,r:t.r,fill:"currentColor",opacity:t.opacity},n)})]})]})})},exports.MenuList=Gt,exports.MinusIcon=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},exports.Pagination=dt,exports.Popover=en,exports.Progress=function(n){var o=n.percent,a=void 0===o?0:o,l=n.type,s=void 0===l?"circle":l,d=n.width,c=void 0===d?120:d,p=n.title,f=n.titlePosition,x=n.showPercent,h=void 0===x||x,g=n.animated,v=void 0!==g&&g,m=n.status,y=void 0===m?"normal":m,b=n.className,w=void 0===b?"":b,C=n.style,k=n.strokeColor,F=n.trailColor,j=void 0===F?"#F5F5F4":F,S=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),D=u().primaryColor,z=Math.min(100,Math.max(0,a)),M=t.useRef(!0),E=t.useState(!1),L=E[0],T=E[1],A=t.useState(0),R=A[0],B=A[1];t.useEffect(function(){if(v&&M.current&&z>0){M.current=!1,B(0),T(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){B(z)})});var e=setTimeout(function(){T(!1),B(z)},300);return function(){return clearTimeout(e)}}M.current?(M.current=!1,T(!1),B(z)):B(z)},[v,z]);var I=k||D||"#FB6011";"success"===y?I="#00BC7D":"exception"===y&&(I="#FB2C36");var W=f||"inside",N=Math.max(4,Math.round(.06*c)),H=(c-N)/2,P="semicircle"===s?c/2:c,Y="14px",O="12px",V=function(){var t=p&&"outside"===W?c+4+18+4:c,n=2*Math.PI*H,o=n-(L?R:z)/100*n;return e.jsxs("div",{style:{position:"relative",width:c,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:c,height:c,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:c/2,cy:c/2,r:H,fill:"none",stroke:j,strokeWidth:N,strokeLinecap:"round"}),e.jsx("circle",{cx:c/2,cy:c/2,r:H,fill:"none",stroke:I,strokeWidth:N,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(c/2," ").concat(c/2,")"),style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===W?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:Y,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),h&&e.jsx("div",{style:{fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")})]}):e.jsxs(e.Fragment,{children:[h&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(c/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")}),p&&"outside"===W&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(c,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:Y,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=r({display:"inline-flex",flexDirection:"column",alignItems:"center",width:c},C);return e.jsx("div",r({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},S,{children:function(){switch(s){case"circle":return V();case"semicircle":return n=N/2,o=c-N/2,r=(t=P+N)-N/2,i=P/2+N/2+N/2,a=p&&"outside"===W?t+4+18+4:t,l=Math.PI*H,d=l-(L?R:z)/100*l,e.jsxs("div",{style:{position:"relative",width:c,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:c,height:t,viewBox:"0 0 ".concat(c," ").concat(t),style:{position:"absolute",top:0,left:0},children:[e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:j,strokeWidth:N,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:I,strokeWidth:N,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:d,style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===W?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:Y,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),h&&e.jsx("div",{style:{fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")})]}):e.jsxs(e.Fragment,{children:[h&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")}),p&&"outside"===W&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:Y,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),V()}var t,n,o,r,i,a,l,d}()}))},exports.Radio=jt,exports.Select=nt,exports.Switch=It,exports.Tab=function(n){var o=n.items,a=void 0===o?[]:o,l=n.variant,s=void 0===l?"underline":l,d=n.layout,c=void 0===d?"equal":d,p=n.defaultValue,f=n.value,x=n.onChange,h=n.className,g=void 0===h?"":h,v=n.mode,m=void 0===v?"children":v,y=n.scrollable,b=void 0!==y&&y,w=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=u().primaryColor;if(!a||0===a.length)return null;var k=t.useMemo(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),F=void 0!==f,j=k.length>0?k[0].key:"",S=function(e){if(void 0===e)return j;var t=k.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:j},D=t.useState(function(){var e,t=null!==(e=null!=f?f:p)&&void 0!==e?e:j;return S(t)}),z=D[0],M=D[1],E=F?void 0!==f?S(f):j:z;t.useEffect(function(){console.log("[Tab Debug] currentValue:",E,"type:",typeof E),console.log("[Tab Debug] normalizedItems:",k.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",f,"isControlled:",F)},[E,k,f,F]);var L=t.useCallback(function(e,t){if(!t){F||M(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==x||x(n),b&&"underline"===s){var o=R.current[B(e)],r=N.current;if(o&&r){Y.current=!0;var i,l=function(){if(r&&I.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},d=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),Y.current=!1,r.removeEventListener("scroll",d)},150)};r.addEventListener("scroll",d,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[F,x,a,b,s]),T=k.find(function(e){if(e.key===E)return!0;if(String(e.key)===String(E))return!0;var t=Number(e.key),n=Number(E);return!isNaN(t)&&!isNaN(n)&&t===n}),A=C||"#FB6011",R=t.useRef({}),B=function(e){return String(e)},I=t.useRef(null),W=t.useRef(null),N=t.useRef(null),H=t.useRef(null),P=t.useRef("");t.useRef(new Set);var Y=t.useRef(!1),O=t.useState({width:0,left:0,opacity:0}),V=O[0],q=O[1],X=t.useState({width:0,left:0,opacity:0}),Z=X[0],K=X[1],G=t.useCallback(function(){"underline"===s&&N.current&&E&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(I.current&&N.current){var e=R.current[B(E)];if(!e&&k.length>0){var t=k[0].key;e=R.current[B(t)]}if(e){var n=N.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=N.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),s="".concat(a,"px");q(function(e){return e.left===l&&e.width===s&&1===e.opacity?e:{width:s,left:l,opacity:1}})}}}})})},[s,E,k]),_=t.useCallback(function(){"background"===s&&H.current&&W.current&&E&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&H.current){var e=R.current[B(E)];if(!e&&k.length>0){var t=k[0].key;e=R.current[B(t)]}if(e){var n=H.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");K(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[s,E,k]);t.useEffect(function(){E?P.current!==E&&(P.current=E,"underline"===s&&N.current&&!Y.current&&G(),"background"===s&&H.current&&W.current&&_()):P.current=""},[E,s,k.length,F,G,_]),t.useEffect(function(){if(E){var e=setTimeout(function(){if("underline"===s)(e=R.current[B(E)])&&N.current&&I.current&&(G(),b&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=R.current[B(E)])&&H.current&&W.current){var t=H.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");K({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),t.useEffect(function(){if(b&&"underline"===s&&E&&!Y.current){var e=setTimeout(function(){var e=R.current[B(E)],t=N.current;if(e&&t){Y.current=!0;var n,o=function(){if(t&&I.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),Y.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[E,b,s]);var J;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(J={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},b&&(J.overflowX="auto",J.overflowY="hidden",J.scrollBehavior="smooth",J.scrollbarWidth="none",J.WebkitOverflowScrolling="touch"),e.jsxs("div",r({ref:N,className:"aha-tab aha-tab--underline ".concat(b?"aha-tab--scrollable":""," ").concat(g),style:J},w,{children:[e.jsx("div",{ref:I,style:r({position:"absolute",bottom:"0px",height:"2px",backgroundColor:A,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},V)}),k.map(function(n){var o=function(){if(n.key===E)return!0;if(String(n.key)===String(E))return!0;var e=Number(n.key),t=Number(E);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===k[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:E,currentValueType:typeof E,isActive:o,variant:s}),e.jsxs("div",{ref:function(e){R.current[B(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:b?0:void 0,whiteSpace:b?"nowrap":void 0},children:[n.icon&&function(){var i,a=typeof n.icon,l=t.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:a,isReactElement:l,iconValue:n.icon}),t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?A:"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:20,height:20,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?A:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?A:"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:20,height:20,style:{color:o?A:"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?A:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?A:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===c?"100%":"fit-content",e.jsxs("div",r({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(c," ").concat(g),style:n},w,{children:[e.jsx("div",{ref:W,style:r({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},Z)}),k.map(function(n){var o=function(){if(n.key===E)return!0;if(String(n.key)===String(E))return!0;var e=Number(n.key),t=Number(E);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===k[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:E,currentValueType:typeof E,isActive:o,variant:s});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===c?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return e.jsxs("div",{ref:function(e){R.current[B(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:i,children:[n.icon&&function(){var i;return t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:16,height:16,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),b&&"underline"===s&&e.jsx("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===m&&(null==T?void 0:T.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:T.children})]})},exports.Table=function(n){var o,a,l,d,c=n.columns,p=void 0===c?[]:c,f=n.dataSource,x=void 0===f?[]:f,h=n.rowKey,g=void 0===h?"key":h,v=n.rowSelection,m=n.pagination,y=void 0!==m&&m,b=n.size,w=void 0===b?"middle":b,C=n.bordered,k=void 0!==C&&C,F=n.loading,j=void 0!==F&&F,S=n.locale,D=n.showHeader,z=void 0===D||D,M=n.title,E=n.footer,L=n.summary,T=n.scroll,A=n.tableLayout,R=void 0===A?"auto":A,B=n.onChange,I=n.onSorterChange,W=n.onPaginationChange,N=n.onRow,H=n.className,P=void 0===H?"":H,Y=n.innerClassName,O=void 0===Y?"":Y,V=n.style,q=n.expandable,X=n.rowClassName,Z=n.onHeaderRow;n.sticky;var K=i(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),G=u().primaryColor||"#FB6011",_=t.useState((null==v?void 0:v.selectedRowKeys)||(null==v?void 0:v.defaultSelectedRowKeys)||[]),J=_[0],Q=_[1];t.useEffect(function(){void 0!==(null==v?void 0:v.selectedRowKeys)&&Q(v.selectedRowKeys)},[null==v?void 0:v.selectedRowKeys]);var U=t.useState(new Map),$=U[0],ee=U[1],te=t.useState((null==q?void 0:q.defaultExpandedRowKeys)||[]),ne=te[0],oe=te[1],re=t.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ie=re[0],ae=re[1],le=t.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),se=le[0],de=le[1];t.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&ae(y.current),void 0!==y.pageSize&&de(y.pageSize))},[y]);var ce=t.useState(null),ue=ce[0],pe=ce[1],fe=t.useState(null),xe=fe[0],he=fe[1],ge=t.useState(!1),ve=ge[0],me=ge[1],ye=t.useRef(null),be=t.useRef(null);t.useEffect(function(){var e=function(){me(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var we=t.useCallback(function(e,t){var n,o,r,i=null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e);if(!(null==i?void 0:i.disabled)){var a,l=kt(e,g);a="radio"===(null==v?void 0:v.type)?t?[l]:[]:t?s(s([],J,!0),[l],!1):J.filter(function(e){return e!==l}),Q(a);var d=x.filter(function(e){return a.includes(kt(e,g))});null===(o=null==v?void 0:v.onChange)||void 0===o||o.call(v,a,d),null===(r=null==v?void 0:v.onSelect)||void 0===r||r.call(v,e,t,d,new Event("select"))}},[J,g,v,x]),Ce=t.useCallback(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}).map(function(e){return kt(e,g)}),i=e?r:[];Q(i);var a=x.filter(function(e){return i.includes(kt(e,g))}),l=e?t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}):[];null===(n=null==v?void 0:v.onChange)||void 0===n||n.call(v,i,a),null===(o=null==v?void 0:v.onSelectAll)||void 0===o||o.call(v,e,a,l)},[g,v,x]),ke=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map($);null===t?o.delete(n):o.set(n,t),ee(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),I&&I(1===r.length?r[0]:r),B&&B({current:ie,pageSize:se},{},1===r.length?r[0]:r,{currentDataSource:x,action:"sort"})}},[$,B,I,ie,se,x,p]);t.useCallback(function(e,t){var n,o,r,i=kt(e,g);r=t?s(s([],ne,!0),[i],!1):ne.filter(function(e){return e!==i}),oe(r),null===(n=null==q?void 0:q.onExpand)||void 0===n||n.call(q,t,e),null===(o=null==q?void 0:q.onExpandedRowsChange)||void 0===o||o.call(q,r)},[ne,g,q]);var Fe,je=t.useCallback(function(){var e=s([],x,!0);return $.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,t);else if(!0===r.sorter){var a=Ct(e,r.dataIndex||n),l=Ct(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from($.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[x,$,p]),Se=je(),De=Boolean(y&&"object"==typeof y&&void 0!==y.total),ze=t.useMemo(function(){if(!1===y||!y)return Se;if(De)return Se;var e=(ie-1)*se,t=e+se;return Se.slice(e,t)},[Se,ie,se,y,De]),Me=t.useCallback(function(e,t){var n,o,r=null!=t?t:se;if(ae(e),t&&de(t),W&&W(e,r),y&&"object"==typeof y&&(null===(n=y.onChange)||void 0===n||n.call(y,e,t),t&&(null===(o=y.onShowSizeChange)||void 0===o||o.call(y,e,t))),B){var i=Array.from($.entries()).map(function(e){var t=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});B({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:Se,action:"paginate"})}},[y,W,B,se,$,p,Se]),Ee=t.useCallback(function(e,t,n){var o=Ct(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Le=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(v&&("left"===v.fixed||!0===v.fixed))r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=p[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===o){for(i=e+1;i<p.length;i++){var a;if("right"===(a=p[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(v&&"right"===v.fixed)r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;return r}}},[p,v]),Te=t.useCallback(function(){if(!z)return null;var t,n,o,i,a=p.map(function(t,n){var o,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=$.get(i)||null,l=Le(n,t.fixed,!0),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("th",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:a,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){ke(t,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e.jsx(Ft,{order:a||void 0})})]})}),i)});if(v){var l="number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!v.hideSelectAll&&"radio"!==v.type&&(t=ze.filter(function(e){var t;return!(null===(t=v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}),n=t.map(function(e){return kt(e,g)}),o=t.length>0&&n.every(function(e){return J.includes(e)}),i=n.some(function(e){return J.includes(e)}),e.jsx(yt,{checked:o,indeterminate:i&&!o,onChange:function(e){return Ce(e.target.checked,ze)}})),v.columnTitle&&e.jsx("span",{style:{marginLeft:v.hideSelectAll?0:"8px"},children:v.columnTitle})]})},"selection");a.unshift(s)}var d=null==Z?void 0:Z(p,0);return e.jsx("thead",{ref:be,children:e.jsx("tr",r({},d||{},{children:a}))})},[p,z,$,v,J,ze,g,ke,Ce,S,Z,Le]),Ae=t.useCallback(function(e){pe(e)},[]),Re=t.useCallback(function(e,t){e.preventDefault(),he(t)},[]),Be=t.useCallback(function(e,t){if(e.preventDefault(),null===ue||ue===t)return pe(null),void he(null);var n=s([],ze,!0),o=n[ue];n.splice(ue,1),n.splice(t,0,o),pe(null),he(null)},[ue,ze]),Ie=t.useCallback(function(){pe(null),he(null)},[]),We=t.useCallback(function(){var t=null==S?void 0:S.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=p.length+(v?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==S?void 0:S.emptyText,p.length,v]),Ne=t.useCallback(function(){return 0===ze.length?We():ze.map(function(n,o){var i,a=kt(n,g),l=J.includes(a),s=ne.includes(a),d=(null==N?void 0:N(n,o))||{},c=o===ze.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",r({className:"".concat("function"==typeof X?X(n,o):X||""," ").concat(ue===o?"dragging":""," ").concat(xe===o?"drag-over":""),draggable:!0,onDragStart:function(){return Ae(o)},onDragOver:function(e){return Re(e,o)},onDrop:function(e){return Be(e,o)},onDragEnd:Ie,style:r({cursor:"move",opacity:ue===o?.5:1,backgroundColor:xe===o?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ue!==o&&xe!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ue!==o&&xe!==o&&(e.currentTarget.style.backgroundColor="white")}},d,{children:[v&&e.jsx("td",{style:{width:"number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(yt,{checked:l,onChange:function(e){return we(n,e.target.checked)},disabled:null===(i=v.getCheckboxProps)||void 0===i?void 0:i.call(v,n).disabled})})}),p.map(function(t,i){var a,l=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,s=(null===(a=t.onCell)||void 0===a?void 0:a.call(t,n,o))||{},d=Le(i,t.fixed,!1),u=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("td",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:r({width:u,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:u||void 0,maxWidth:u,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,right:"right"===t.fixed?void 0!==d?"".concat(d,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},s.style),colSpan:t.colSpan,rowSpan:t.rowSpan},s,{children:Ee(t,n,o)}),l)})]})),(null==q?void 0:q.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:q.expandedRowRender(n,o,0,!0)})})]},a)})},[ze,g,J,ne,v,p,N,X,we,Ee,q,ue,xe,Ae,Re,Be,Ie,Le,We]),He=function(){var t;if(!1===y||!y)return null;var n=null!==(t=y.total)&&void 0!==t?t:Se.length,o=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e.jsx(dt,{current:ie,total:n,pageSize:se,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:Me,onShowSizeChange:Me,simple:y.simple,responsive:y.responsive,size:"small"===w?"small":"default"})})},Pe=t.useMemo(function(){return p.some(function(e){return e.fixed})||v&&v.fixed},[p,v]),Ye=t.useMemo(function(){return p.every(function(e){return e.width})&&(!v||v.columnWidth)},[p,v]),Oe=t.useMemo(function(){if(null==T?void 0:T.x){if("number"==typeof T.x)return T.x;if(!0===T.x)return p.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(v?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth||"60").replace("px",""))||60:0)}if(Pe)return p.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(v&&v.fixed&&v.columnWidth?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth).replace("px",""))||60:0)},[p,null==T?void 0:T.x,v,Pe]),Ve=t.useMemo(function(){return"fixed"===R||Pe||Ye||p.some(function(e){return e.width})?"fixed":R},[R,Pe,Ye,p]),qe=r(r({width:"100%",minWidth:Oe?"".concat(Oe,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ve,backgroundColor:"white"},k&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Xe=r({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"},V);if(ve)return e.jsxs("div",r({ref:ye,className:"aha-table aha-table-mobile-wrapper ".concat(P),style:Xe,"aria-busy":!!j||void 0},K,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(Se)}),y&&"object"==typeof y&&(null===(o=y.position)||void 0===o?void 0:o.startsWith("top"))&&He(),(Fe="function"==typeof(null==S?void 0:S.emptyText)?S.emptyText():void 0!==(null==S?void 0:S.emptyText)?S.emptyText:"No data",0===ze.length?e.jsx("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Fe}):e.jsx("div",{className:"aha-table-mobile",children:ze.map(function(t,n){var o,r=kt(t,g),i=J.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[v&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(yt,{checked:i,onChange:function(e){return we(t,e.target.checked)},disabled:null===(o=v.getCheckboxProps)||void 0===o?void 0:o.call(v,t).disabled})}),p.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=Ct(t,o.dataIndex||""),a=o.render?o.render(i,t,n):i;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(Se)}),y&&("object"!=typeof y||!(null===(a=y.position)||void 0===a?void 0:a.startsWith("top")))&&He(),e.jsx(wt,{loading:j,spinColor:G})]}));var Ze={position:"relative",overflowX:(null==T?void 0:T.x)||Pe?"auto":"visible",overflowY:(null==T?void 0:T.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==T?void 0:T.x)?"100%":"number"==typeof(null==T?void 0:T.x)?"".concat(T.x,"px"):void 0,maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",r({ref:ye,className:"aha-table ".concat(P),style:Xe,"aria-busy":!!j||void 0},K,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(Se)}),y&&"object"==typeof y&&(null===(l=y.position)||void 0===l?void 0:l.startsWith("top"))&&He(),e.jsx("div",{style:Ze,children:e.jsx("div",{style:{width:"100%",minWidth:Oe?"".concat(Oe,"px"):"100%",display:"block"},children:e.jsxs("table",{style:qe,className:O,children:[Te(),e.jsx("tbody",{children:Ne()}),L&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:L(Se)})})})]})})}),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(Se)}),y&&("object"!=typeof y||!(null===(d=y.position)||void 0===d?void 0:d.startsWith("top")))&&He(),e.jsx(wt,{loading:j,spinColor:G})]}))},exports.Tag=Te,exports.Textarea=Bt,exports.TextareaTags=function(t){var n=t.minHeight,o=void 0===n?120:n,a=t.style,l=t.label,s=t.required,d=t.hintText,c=t.helpIcon,u=t.error,p=i(t,["minHeight","style","label","required","hintText","helpIcon","error"]),f=e.jsx(Ue,r({error:u,style:r({minHeight:"".concat(o,"px"),alignItems:"flex-start",overflow:"auto",resize:"vertical"},a)},p));return l||d?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[l&&e.jsxs("label",{style:r(r({},Xe()),{display:"flex",alignItems:"center"}),children:[l,s&&e.jsx("span",{style:{color:Ve.error600,marginLeft:"2px"},children:"*"}),c&&e.jsx("span",{style:{marginLeft:"4px",display:"inline-flex",alignItems:"center",color:Ve.fgQuaternary},children:c})]}),f,d&&e.jsx("p",{style:Ze(u),children:d})]}):f},exports.ThemeProvider=function(n){var o=n.theme,i=n.children,a=t.useMemo(function(){return r(r({},d),o)},[o]);return e.jsx(c.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(ke,{id:"direct",props:t})},exports.ToastProvider=function(o){var r=o.children,i=t.useState(!1),a=i[0],l=i[1];return t.useEffect(function(){l(!0)},[]),e.jsxs(e.Fragment,{children:[r,a&&n.createPortal(e.jsx(Ce,{}),document.body)]})},exports.Tooltip=function(o){var i=o.content,a=o.children,l=o.position,s=void 0===l?"top":l,d=o.trigger,c=void 0===d?"hover":d,u=o.delay,p=void 0===u?200:u,f=o.disabled,x=void 0!==f&&f,h=o.className,g=void 0===h?"":h,v=o.tooltipClassName,m=void 0===v?"":v,y=o.gap,b=void 0===y?6:y,w=o.showArrow,C=void 0===w||w,k=o.width,F=o.defaultVisible,j=void 0!==F&&F,S=o.visible,D=o.onVisibleChange,z=void 0!==S,M=t.useState(j),E=M[0],L=M[1],T=z?S:E,A=t.useState(z?null!=S&&S:j),R=A[0],B=A[1],I=t.useCallback(function(e){z||L(e),null==D||D(e)},[z,D]);t.useEffect(function(){z&&(S?requestAnimationFrame(function(){B(!0)}):B(!1))},[z,S]);var W=t.useState(s),N=W[0],H=W[1],P=t.useState("320px"),Y=P[0],O=P[1],V=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===c?"auto":"none"}),q=V[0],X=V[1],Z=t.useState({}),K=Z[0],G=Z[1],_=t.useRef(null),J=t.useRef(null),Q=t.useRef(null),U=t.useRef(null),$=t.useCallback(function(){if(_.current&&J.current&&T&&R){var e=_.current.getBoundingClientRect(),t=J.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!Jt(e,t,n,o))return n;for(var r=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);r<i.length;r++){var a=i[r];if(!Jt(e,t,a,o))return a}return n}(e,t,s,b);H(n);var o=_t(e,t,n,b),i=o.top,a=o.left;if(X(function(e){return r(r({},e),{position:"absolute",top:"".concat(i,"px"),left:"".concat(a,"px"),pointerEvents:"hover"===c?"auto":"none",zIndex:9999})}),C){var l=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,d=o-i,c=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-d,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-d,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-c,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-c,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,a,i);G(l)}}},[T,s,b,C,R,c]),ee=t.useCallback(function(){x||(U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(function(){I(!0),z||requestAnimationFrame(function(){B(!0)})},p))},[x,p,I,z]),te=t.useCallback(function(){Q.current&&(clearTimeout(Q.current),Q.current=null),U.current&&clearTimeout(U.current),z?I(!1):(B(!1),U.current=setTimeout(function(){I(!1),U.current=null},150))},[I,z]),ne=t.useCallback(function(){"hover"===c&&(U.current&&(clearTimeout(U.current),U.current=null),T||(I(!0),requestAnimationFrame(function(){B(!0)})))},[c,T]),oe=t.useCallback(function(e){x||"click"!==c||(e.stopPropagation(),T?te():(Q.current&&(clearTimeout(Q.current),Q.current=null),I(!0),requestAnimationFrame(function(){B(!0)})))},[x,c,T,te]);t.useEffect(function(){if(j&&T&&R){var e=function(){_.current&&J.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,T,R,$]),t.useEffect(function(){if(T)return requestAnimationFrame(function(){$()}),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),function(){window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[T,$]),t.useEffect(function(){if(T&&"click"===c){var e=function(e){_.current&&J.current&&!_.current.contains(e.target)&&!J.current.contains(e.target)&&te()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[T,c,te]),t.useEffect(function(){return function(){Q.current&&clearTimeout(Q.current),U.current&&clearTimeout(U.current)}},[]);var re={position:"absolute",top:0,left:0,opacity:R?1:0,transform:R?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===c?"auto":"none",zIndex:9999},ie=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){O(ie())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ie]);var ae=r(r({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==k?{width:"number"==typeof k?"".concat(k,"px"):k,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:Y,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),le=e.jsxs("div",{style:r(r(r({},re),q),{pointerEvents:"hover"===c?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===c?ne:void 0,onMouseLeave:"hover"===c?te:void 0,children:[e.jsx("div",{ref:J,className:"aha-tooltip ".concat(m),style:ae,role:"tooltip",children:i}),C&&Qt(N,K)]}),se=t.useCallback(function(){"hover"===c&&(U.current=setTimeout(function(){te()},100))},[c,te]),de="click"===c?{onClick:oe}:{onMouseEnter:ee,onMouseLeave:se,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:_,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===c?"pointer":"default"}},de,{children:a})),T&&"undefined"!=typeof document&&n.createPortal(le,document.body)]})},exports.clearAllToasts=function(){we.clearAll()},exports.closeToast=function(e){we.removeToast(e)},exports.debugToast=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",we.getToasts()),console.log("容器根节点:",Se),console.log("是否正在初始化:",De),console.log("====================")},exports.toast=Fe,exports.toastError=function(e,t){return ze(),Fe(r(r({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return ze(),Fe(r(r({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return ze(),Fe(r(r({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return ze(),Fe(r(r({},t),{message:e,type:"success"}))},exports.useTheme=u;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|