aha-components 1.4.6 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import i,{createContext as o,useMemo as r,useContext as l,useState as a,useEffect as s,useCallback as c,useRef as d,forwardRef as u,useImperativeHandle as p}from"react";import{createPortal as f}from"react-dom";var h=function(){return h=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},h.apply(this,arguments)};function g(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}function v(e,t,n,i){return new(n||(n=Promise))(function(o,r){function l(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(l,a)}s((i=i.apply(e,t||[])).next())})}function x(e,t){var n,i,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(r=0)),r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function m(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var y={primaryColor:"#FB6011"},b=o(y),w=function(t){var n=t.theme,i=t.children,o=r(function(){return h(h({},y),n)},[n]);return e(b.Provider,{value:o,children:i})},C=function(){var e=l(b);return e||y},F={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},k=function(i){var o=i.size,r=i.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},S=function(n){var i,o=n.children,r=n.type,l=void 0===r?"default":r,s=n.size,c=void 0===s?"medium":s,d=n.disabled,u=void 0!==d&&d,p=n.loading,f=void 0!==p&&p,v=n.onClick,x=n.htmlType,m=void 0===x?"button":x,y=n.className,b=void 0===y?"":y,w=n.style,S=n.icon,E=n.iconPosition,A=void 0===E?"left":E,z=g(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),L=C().primaryColor,D=void 0===L?"#FB6011":L,B=a(!1),T=B[0],N=B[1],M=a(!1),W=M[0],I=M[1],R=F[c],j=u||f,H=function(){if(f){var t="primary"===l?"#FFFFFF":"#101828",n=parseInt(R.iconSize.replace("px",""));return e(k,{size:n,color:t})}return S?e("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:R.iconSize,height:R.iconSize,flexShrink:0},children:S}):null},O=(i=h({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:R.gap,height:R.height,paddingLeft:R.paddingLeft,paddingRight:R.paddingRight,fontSize:R.fontSize,lineHeight:R.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:j?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},w),"primary"===l?(i.color="#FFFFFF",i.backgroundColor=D,u?(i.opacity=.4,i.cursor="not-allowed"):f?i.backgroundColor=D:W?i.backgroundColor="#EC470A":T&&(i.backgroundColor="#FD843A")):u?(i.backgroundColor="#FAFAF9",i.color="#D6D3D1",i.border="1px solid #E7E5E4"):f?(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):W?(i.backgroundColor="#F5F5F4",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):T?(i.backgroundColor="#FAFAF9",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),i);return t("button",h({type:m,className:"aha-button aha-button--".concat(l," aha-button--").concat(c," ").concat(j?"aha-button--disabled":""," ").concat(f?"aha-button--loading":""," ").concat(b),disabled:j,onClick:function(e){j?e.preventDefault():null==v||v(e)},onMouseEnter:function(){return!j&&N(!0)},onMouseLeave:function(){N(!1),I(!1)},onMouseDown:function(){return!j&&I(!0)},onMouseUp:function(){return I(!1)},style:O},z,{children:[f&&H(),!f&&"left"===A&&H(),o&&e("span",{style:{display:"inline-block"},children:o}),!f&&"right"===A&&H()]}))};S.displayName="Button";var E={success:e("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("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("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("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("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("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("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("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"})})},A=e("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("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"})}),z=function(n){var i=n.className,o=void 0===i?"":i,r=n.type,l=void 0===r?"info":r,s=n.title,c=n.description,d=n.icon,u=void 0===d?E[l]:d,p=n.showIcon,f=void 0===p||p,h=n.closeable,g=void 0!==h&&h,v=n.action,x=n.children,m=n.onClose,y=a(!0),b=y[0],w=y[1];return b?t("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").concat(o),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[l],children:[f&&u,t("div",{className:"flex flex-col gap-1",style:g?{paddingRight:"2rem"}:{},children:[s&&e("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:s}),c&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:c}),x&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:x}),v&&g&&e("div",{className:"mt-3",children:v})]}),v&&!g&&e("div",{className:"ml-3",children:v}),g&&e("div",{className:"absolute right-4 top-3 cursor-pointer",onClick:function(){w(!1),null==m||m()},children:A})]}):null},L={success:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})})},D=function(t){var n=t.className;return e("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("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"})})},B=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 m([],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}(),T=new B,N=function(){var i=a([]),o=i[0],r=i[1];s(function(){console.log("Toast: ToastContainer 组件已挂载");var e=T.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),r(e);var t=T.subscribe(function(){var e=T.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),r(e)});return t},[]);var l=o.filter(function(e){return"top-left"===e.props.position}),c=o.filter(function(e){return"top-right"===e.props.position}),d=o.filter(function(e){return"bottom-left"===e.props.position}),u=o.filter(function(e){return"bottom-right"===e.props.position});return t(n,{children:[e("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:l.map(function(t){return e(M,h({},t),t.id)})}),e("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e(M,h({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:d.map(function(t){return e(M,h({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:u.map(function(t){return e(M,h({},t),t.id)})})]})},M=function(n){var i=n.id,o=n.props,r=a(!1),l=r[0],d=r[1],u=a(!1),p=u[0],f=u[1],h=o.message,g=o.type,v=void 0===g?"info":g,x=o.duration,m=void 0===x?3e3:x,y=o.icon,b=o.action,w=o.showClose,C=void 0===w||w,F=o.onClose,k=o.onClick;o.className;var S=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:L.success};case"error":return{bgColor:"#E7000B",defaultIcon:L.error};case"question":return{bgColor:"#1C1917",defaultIcon:L.question};default:return{bgColor:"#1447E6",defaultIcon:L.info}}}(v);s(function(){var e=setTimeout(function(){d(!0)},10);return function(){return clearTimeout(e)}},[]),s(function(){if(m>0){var e=setTimeout(function(){E()},m);return function(){return clearTimeout(e)}}},[m,i]);var E=c(function(){f(!0),setTimeout(function(){T.removeToast(i),null==F||F()},300)},[i,F]),A=c(function(){null==k||k()},[k]);return e("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:l&&!p?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:l&&!p?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:A,children:t("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:S.bgColor,color:"white"},children:[e("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:y||S.defaultIcon}),t("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:h}),b&&e("div",{style:{marginTop:"12px"},children:b})]}),C&&e("button",{onClick:function(e){e.stopPropagation(),E()},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(D,{})})]})})},W=function(t){return e(M,{id:"direct",props:t})},I=function(e){return console.log("Toast: 调用 toast 函数",e),X(),setTimeout(function(){var t=T.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},R=function(e){T.removeToast(e)},j=function(){T.clearAll()},H=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 管理器状态:",T.getToasts()),console.log("容器根节点:",Z),console.log("是否正在初始化:",Y),console.log("====================")},O=function(e,t){return X(),I(h(h({},t),{message:e,type:"success"}))},V=function(e,t){return X(),I(h(h({},t),{message:e,type:"error"}))},P=function(e,t){return X(),I(h(h({},t),{message:e,type:"info"}))},q=function(e,t){return X(),I(h(h({},t),{message:e,type:"question"}))},K=null,Z=null,Y=!1,X=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(Y)console.log("Toast: 容器正在初始化中,跳过");else if(K)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),Y=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),K=t,void(Y=!1);console.log("Toast: 创建容器元素"),(K=document.createElement("div")).id="aha-toast-container",document.body.appendChild(K),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),Z=n(K),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(N,{})),console.log("Toast: 容器渲染完成"),Y=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),Z=n(K),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(N,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}Y=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),Y=!1})}}catch(e){console.error("Toast: 创建容器失败",e),Y=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},G=function(i){var o=i.children,r=a(!1),l=r[0],c=r[1];return s(function(){c(!0)},[]),t(n,{children:[o,l&&f(e(N,{}),document.body)]})},_={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"}}},U={large:{padding:"px-2 py-0.5",textSize:"text-sm",iconSize:"w-4 h-4",gap:"gap-1"},small:{padding:"px-2 py-0.5",textSize:"text-xs",iconSize:"w-3 h-3",gap:"gap-0.5"}},J=function(n){var o=n.children,r=n.color,l=n.variant,a=void 0===l?"light":l,s=n.size,c=void 0===s?"large":s,d=n.stroke,u=void 0!==d&&d,p=n.icon,f=n.iconPosition,v=void 0===f?"none":f,x=n.className,m=void 0===x?"":x,y=n.onClick,b=g(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=C().primaryColor,F=function(e,t){if("string"==typeof e&&e in _){var n=_[e];return"Orange"===e&&t?h(h({},n),{fill:h(h({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var i=e.replace("#",""),o=parseInt(i.substr(0,2),16),r=parseInt(i.substr(2,2),16),l=parseInt(i.substr(4,2),16);return{light:{bg:"rgba(".concat(o,", ").concat(r,", ").concat(l,", 0.1)"),text:e,border:"rgba(".concat(o,", ").concat(r,", ").concat(l,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return _.Green}(r,w),k=U[c],S={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===c?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===c?"1.375":"1",transition:"all 0.2s",fontSize:"large"===c?"14px":"12px",height:"small"===c?"20px":"24px"};"light"===a&&(S.backgroundColor=F.light.bg,S.color=F.light.text,u&&(S.outline="1px solid",S.outlineOffset="-1px",S.outlineColor=function(e){if("string"==typeof e&&e in _)switch(e){case"Green":default:return"#A4F4CF";case"Red":return"#FFC9C9";case"Orange":case"Yellow":return"#FFD1A9";case"Blue":return"#BEDBFF";case"Cyan":return"#A2F4FD";case"Violet":return"#DDD6FF";case"Pink":return"#FCCEE8";case"Gray":return"#E7E5E4"}if("string"==typeof e&&e.startsWith("#")){var t=e.replace("#",""),n=parseInt(t.substr(0,2),16),i=parseInt(t.substr(2,2),16),o=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(i,", ").concat(o,", 0.3)")}return"#A4F4CF"}(r))),y&&(S.cursor="pointer",S.opacity="1");var E=["rounded-md","inline-flex","justify-start","items-center",k.padding,k.gap,"font-medium","font-dm-sans","large"===c?"leading-snug":"leading-none","transition-colors","duration-200","small"===c?"h-5":"h-6"].filter(Boolean);"fill"===a&&(S.backgroundColor=F.fill.bg,S.color=F.fill.text),y&&E.push("cursor-pointer","hover:opacity-80"),m&&E.push(m);var A=E.join(" "),z=function(){if(!p)return null;var t=function(e,t){if("string"==typeof e&&e in _)switch(e){case"Green":default:return"#009966";case"Red":return"#E7000B";case"Orange":return t||"#E17100";case"Blue":return"#155DFC";case"Yellow":return"#EC470A";case"Cyan":return"#0092B8";case"Violet":return"#7F22FE";case"Pink":return"#E60076";case"Gray":return"#57534D"}return"string"==typeof e&&e.startsWith("#")?e:"#009966"}(r,w),n="small"===c?"14px":"16px";return e("div",{className:"flex items-center justify-center",style:{width:n,height:n},children:"svg"===p.type?i.cloneElement(p,{width:n,height:n,style:{fill:t}}):p})};return t("div",h({className:A,style:S,onClick:y},b,{children:["leading"===v&&z(),e("div",{className:"px-1 flex justify-center items-center",children:e("div",{className:"justify-center ".concat(k.textSize," font-medium font-dm-sans ").concat("large"===c?"leading-snug":"leading-none"),children:o})}),"after"===v&&z()]}))},Q=function(t){var n=t.className,i=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:i,children:e("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},$=function(t){var n=t.className,i=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:i,children:e("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ee=function(t){var n=t.className,i=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:i,children:e("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"})})},te=function(n){var i=n.className,o=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,style:o,children:[e("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},ne=function(n){var i=n.className,o=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,style:o,children:[e("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},ie=function(t){var n=t.className,i=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:i,children:e("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"})})},oe=function(t){var n=t.className,i=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:i,children:e("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"})})},re=function(n){var i=n.className,o=n.style;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i,style:o,children:[e("g",{clipPath:"url(#clip0_54_1653)",children:e("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("defs",{children:e("clipPath",{id:"clip0_54_1653",children:e("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},le=function(n){var i=n.current,o=n.defaultCurrent,l=void 0===o?1:o,c=n.total,d=void 0===c?0:c,u=n.pageSize,p=n.defaultPageSize,f=void 0===p?10:p,g=n.showSizeChanger,v=void 0!==g&&g,x=n.pageSizeOptions,m=void 0===x?["10","20","50","100"]:x,y=n.showQuickJumper,b=void 0!==y&&y,w=n.showTotal,F=n.onChange,k=n.onShowSizeChange,E=n.simple,A=void 0!==E&&E,z=n.disabled,L=void 0!==z&&z,D=n.hideOnSinglePage,B=void 0!==D&&D,T=n.className,N=void 0===T?"":T,M=n.style,W=n.size,I=void 0===W?"default":W,R=n.responsive,j=void 0!==R&&R;n.showLessItems;var H=n.itemRender,O=C().primaryColor,V=void 0===O?"#FB6011":O,P=a(l),q=P[0],K=P[1],Z=a(f),Y=Z[0],X=Z[1],G=a(""),_=G[0],U=G[1],J=null!=i?i:q,Q=null!=u?u:Y,$=r(function(){return Math.ceil(d/Q)},[d,Q]);s(function(){void 0!==i&&K(i)},[i]),s(function(){void 0!==u&&X(u)},[u]);var ee=function(e){e<1||e>$||e===J||L||(void 0===i&&K(e),null==F||F(e,Q))},te=function(){var e=parseInt(_,10);e>=1&&e<=$&&(ee(e),U(""))};if(B&&$<=1)return null;if(A)return t("div",{className:"aha-pagination aha-pagination-simple ".concat(N),style:M,children:[e(S,{onClick:function(){return ee(J-1)},disabled:L||1===J,type:"default",size:"default"===I?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"上一页"}),t("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[J," / ",$]}),e(S,{onClick:function(){return ee(J+1)},disabled:L||J===$,type:"default",size:"default"===I?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var ne=(J-1)*Q+1,re=Math.min(J*Q,d);return t("div",{className:"aha-pagination w-full ".concat(N),style:h({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:j?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},M),children:[w&&e("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:w(d,[ne,re])}),t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[H?H(J-1,"prev",e(S,{onClick:function(){return ee(J-1)},disabled:L||1===J,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e(ie,{})," ",e("span",{children:"Previous"})]})})):e(S,{onClick:function(){return ee(J-1)},disabled:L||1===J,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e(ie,{})," ",e("span",{children:"Previous"})]})}),e("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if($<=7)return Array.from({length:$},function(e,t){return t+1});var e=[];if(J<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push($)}else if(J>=$-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=J-1;t<=J+1;t++)e.push(t);e.push("jump-next"),e.push($)}return e}().map(function(t,n){return function(t){if("number"==typeof t){var n=t===J,i=e(S,{onClick:function(){return ee(t)},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:"none",background:n?"#FAFAF9":"white",backgroundColor:n?"#FAFAF9":"white",color:n?V:"#79716B",boxShadow:"none",borderRadius:"8px"},children:t},t);return H?H(t,"page",i):i}if("jump-prev"===t)return i=e(S,{onClick:function(){return ee(Math.max(1,J-5))},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),H?H(J-5,"jump-prev",i):i;if("jump-next"===t)return i=e(S,{onClick:function(){return ee(Math.min($,J+5))},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),H?H(J+5,"jump-next",i):i;return null}(t)})}),H?H(J+1,"next",e(S,{onClick:function(){return ee(J+1)},disabled:L||J===$,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e("span",{children:"Next"})," ",e(oe,{})]})})):e(S,{onClick:function(){return ee(J+1)},disabled:L||J===$,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e("span",{children:"Next"})," ",e(oe,{})]})}),v&&e("select",{value:Q,onChange:function(e){return t=Number(e.target.value),n=Math.ceil(d/t),o=J>n?n:J,void 0===u&&X(t),void 0===i&&K(o),null==k||k(o,t),void(null==F||F(o,t));var t,n,o},disabled:L,style:{padding:"small"===I?"6px 12px":"8px 12px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"small"===I?"12px":"14px",lineHeight:"small"===I?"18px":"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",cursor:L?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){L||(e.currentTarget.style.borderColor=V)},onMouseLeave:function(e){e.currentTarget.style.borderColor="#EAECF0"},children:m.map(function(e){return t("option",{value:e,children:[e," 条/页"]},e)})}),b&&t("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"跳至"}),e("input",{type:"number",min:"1",value:_,onChange:function(e){return U(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&te()},disabled:L,style:{width:"56px",height:"small"===I?"28px":"36px",padding:"0 8px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",outline:"none",transition:"all 0.2s"},onFocus:function(e){e.currentTarget.style.borderColor=V},onBlur:function(e){e.currentTarget.style.borderColor="#EAECF0"}}),e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"页"}),"object"==typeof b&&b.goButton?e(S,{onClick:te,disabled:L,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:b.goButton}):e(S,{onClick:te,disabled:L,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},ae=function(n){var i=n.checked,o=void 0!==i&&i,r=n.indeterminate,l=void 0!==r&&r,a=n.disabled,s=void 0!==a&&a,c=n.onChange,d=n.className,u=void 0===d?"":d,p=n.style,f=n.children,g=C().primaryColor,v=o||l,x=s?"#FAFAF9":v?g:"white",m=s?"#FAFAF9":v?g:"#D7D3D0";return t("div",{className:"aha-checkbox ".concat(u),style:h({display:"inline-flex",alignItems:"center",gap:"8px",cursor:s?"not-allowed":"pointer"},p),onClick:function(e){s||(null==c||c({target:{checked:!o},currentTarget:{checked:!o}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:v?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:e(l?$:Q,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:s?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),e("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=l)},onChange:c,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};ae.displayName="Checkbox";var se=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)},ce=function(e,t){var n,i;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=se(e,t))&&void 0!==n?n:"":null!==(i=e.key)&&void 0!==i?i:""},de=function(t){var n=t.order,i=C().primaryColor;return"ascend"===n?e(ne,{style:{color:i}}):"descend"===n?e(te,{style:{color:i}}):e(ee,{})},ue=function(n){var o,l,u,p,f=n.columns,v=void 0===f?[]:f,x=n.dataSource,y=void 0===x?[]:x,b=n.rowKey,w=void 0===b?"key":b,C=n.rowSelection,F=n.pagination,k=void 0!==F&&F,S=n.size,E=void 0===S?"middle":S,A=n.bordered,z=void 0!==A&&A;n.loading;var L=n.locale,D=n.showHeader,B=void 0===D||D,T=n.title,N=n.footer,M=n.summary,W=n.scroll,I=n.tableLayout,R=void 0===I?"auto":I,j=n.onChange,H=n.onSorterChange,O=n.onPaginationChange,V=n.onRow,P=n.className,q=void 0===P?"":P,K=n.style,Z=n.expandable,Y=n.rowClassName,X=n.onHeaderRow;n.sticky;var G=g(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","style","expandable","rowClassName","onHeaderRow","sticky"]),_=a((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),U=_[0],J=_[1];s(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&J(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var Q=a(new Map),$=Q[0],ee=Q[1],te=a((null==Z?void 0:Z.defaultExpandedRowKeys)||[]),ne=te[0],ie=te[1],oe=a(k&&"object"==typeof k&&(k.current||k.defaultCurrent)||1),re=oe[0],ue=oe[1],pe=a(k&&"object"==typeof k&&(k.pageSize||k.defaultPageSize)||10),fe=pe[0],he=pe[1];s(function(){k&&"object"==typeof k&&(void 0!==k.current&&ue(k.current),void 0!==k.pageSize&&he(k.pageSize))},[k]);var ge=a(null),ve=ge[0],xe=ge[1],me=a(null),ye=me[0],be=me[1],we=a(!1),Ce=we[0],Fe=we[1],ke=d(null),Se=d(null);s(function(){var e=function(){Fe(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Ee=c(function(e,t){var n,i,o,r=null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e);if(!(null==r?void 0:r.disabled)){var l,a=ce(e,w);l="radio"===(null==C?void 0:C.type)?t?[a]:[]:t?m(m([],U,!0),[a],!1):U.filter(function(e){return e!==a}),J(l);var s=y.filter(function(e){return l.includes(ce(e,w))});null===(i=null==C?void 0:C.onChange)||void 0===i||i.call(C,l,s),null===(o=null==C?void 0:C.onSelect)||void 0===o||o.call(C,e,t,s,new Event("select"))}},[U,w,C,y]),Ae=c(function(e,t){var n,i,o=t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}).map(function(e){return ce(e,w)}),r=e?o:[];J(r);var l=y.filter(function(e){return r.includes(ce(e,w))}),a=e?t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}):[];null===(n=null==C?void 0:C.onChange)||void 0===n||n.call(C,r,l),null===(i=null==C?void 0:C.onSelectAll)||void 0===i||i.call(C,e,l,a)},[w,C,y]),ze=c(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var i=new Map($);null===t?i.delete(n):i.set(n,t),ee(i);var o=Array.from(i.entries()).map(function(t){var n=t[0],i=t[1];return{column:v.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:i,field:n,columnKey:n}}),r={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(r),H&&H(1===o.length?o[0]:o),j&&j({current:re,pageSize:fe},{},1===o.length?o[0]:o,{currentDataSource:y,action:"sort"})}},[$,j,H,re,fe,y,v]);c(function(e,t){var n,i,o,r=ce(e,w);o=t?m(m([],ne,!0),[r],!1):ne.filter(function(e){return e!==r}),ie(o),null===(n=null==Z?void 0:Z.onExpand)||void 0===n||n.call(Z,t,e),null===(i=null==Z?void 0:Z.onExpandedRowsChange)||void 0===i||i.call(Z,o)},[ne,w,Z]);var Le=c(function(){var e=m([],y,!0);return $.size>0&&e.sort(function(e,t){for(var n=function(n,i){var o=v.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!o)return"continue";var r=0;if("function"==typeof o.sorter)r=o.sorter(e,t);else if(!0===o.sorter){var l=se(e,o.dataIndex||n),a=se(t,o.dataIndex||n);l<a?r=-1:l>a&&(r=1)}return 0!==r?{value:"ascend"===i?r:-r}:void 0},i=0,o=Array.from($.entries());i<o.length;i++){var r=o[i],l=n(r[0],r[1]);if("object"==typeof l)return l.value}return 0}),e},[y,$,v]),De=Le(),Be=r(function(){if(!1===k||!k)return De;var e=(re-1)*fe,t=e+fe;return De.slice(e,t)},[De,re,fe,k]),Te=c(function(e,t){var n,i,o=null!=t?t:fe;if(ue(e),t&&he(t),O&&O(e,o),k&&"object"==typeof k&&(null===(n=k.onChange)||void 0===n||n.call(k,e,t),t&&(null===(i=k.onShowSizeChange)||void 0===i||i.call(k,e,t))),j){var r=Array.from($.entries()).map(function(e){var t=e[0],n=e[1];return{column:v.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});j({current:e,pageSize:o},{},1===r.length?r[0]:r,{currentDataSource:De,action:"paginate"})}},[k,O,j,fe,$,v,De]),Ne=c(function(e,t,n){var i=se(t,e.dataIndex||"");return e.render?e.render(i,t,n):i},[]),Me=c(function(e,t,n){if(t){var i=!0===t?"left":t,o=0;if("left"===i){if(C&&("left"===C.fixed||!0===C.fixed))o+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=v[r]).fixed||!0===l.fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}return o}if("right"===i){for(r=e+1;r<v.length;r++){var l;if("right"===(l=v[r]).fixed)o+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(C&&"right"===C.fixed)o+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return o}}},[v,C]),We=c(function(){if(!B)return null;var n,i,o,r,l=v.map(function(n,i){var o,r=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||i,l=$.get(r)||null,a=Me(i,n.fixed,!0),s=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e("th",h({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:s,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:s||void 0,maxWidth:s,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,right:"right"===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=n.onHeaderCell)||void 0===o?void 0:o.call(n,n))||{},{children:t("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:l,sortColumn:n}):n.title}),n.sorter&&e("button",{onClick:function(){ze(n,null===l?"ascend":"ascend"===l?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:l?"#475467":"#98A2B3"},children:e(de,{order:l||void 0})})]})}),r)});if(C){var a="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",s=e("th",{style:{width:a,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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:t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!C.hideSelectAll&&"radio"!==C.type&&(n=Be.filter(function(e){var t;return!(null===(t=C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}),i=n.map(function(e){return ce(e,w)}),o=n.length>0&&i.every(function(e){return U.includes(e)}),r=i.some(function(e){return U.includes(e)}),e(ae,{checked:o,indeterminate:r&&!o,onChange:function(e){return Ae(e.target.checked,Be)}})),C.columnTitle&&e("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");l.unshift(s)}var c=null==X?void 0:X(v,0);return e("thead",{ref:Se,children:e("tr",h({},c||{},{children:l}))})},[v,B,$,C,U,Be,w,ze,Ae,L,X,Me]),Ie=c(function(e){xe(e)},[]),Re=c(function(e,t){e.preventDefault(),be(t)},[]),je=c(function(e,t){if(e.preventDefault(),null===ve||ve===t)return xe(null),void be(null);var n=m([],Be,!0),i=n[ve];n.splice(ve,1),n.splice(t,0,i),xe(null),be(null)},[ve,Be]),He=c(function(){xe(null),be(null)},[]),Oe=c(function(){return Be.map(function(n,o){var r,l=ce(n,w),a=U.includes(l),s=ne.includes(l),c=(null==V?void 0:V(n,o))||{},d=o===Be.length-1;return t(i.Fragment,{children:[t("tr",h({className:"".concat("function"==typeof Y?Y(n,o):Y||""," ").concat(ve===o?"dragging":""," ").concat(ye===o?"drag-over":""),draggable:!0,onDragStart:function(){return Ie(o)},onDragOver:function(e){return Re(e,o)},onDrop:function(e){return je(e,o)},onDragEnd:He,style:h({cursor:"move",opacity:ve===o?.5:1,backgroundColor:ye===o?"#F9FAFB":"white",transition:"background-color 0.2s"},c.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")}},c,{children:[C&&e("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e(ae,{checked:a,onChange:function(e){return Ee(n,e.target.checked)},disabled:null===(r=C.getCheckboxProps)||void 0===r?void 0:r.call(C,n).disabled})})}),v.map(function(t,i){var r,l=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,a=(null===(r=t.onCell)||void 0===r?void 0:r.call(t,n,o))||{},s=Me(i,t.fixed,!1),c=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e("td",h({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:h({width:c,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:c||void 0,maxWidth:c,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,right:"right"===t.fixed?void 0!==s?"".concat(s,"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:d?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},a.style),colSpan:t.colSpan,rowSpan:t.rowSpan},a,{children:Ne(t,n,o)}),l)})]})),(null==Z?void 0:Z.expandedRowRender)&&s&&e("tr",{children:e("td",{colSpan:v.length+(C?1:0),children:Z.expandedRowRender(n,o,0,!0)})})]},l)})},[Be,w,U,ne,C,v,V,Y,Ee,Ne,Z,ve,ye,Ie,Re,je,He,Me]),Ve=function(){var t;if(!1===k||!k)return null;var n=null!==(t=k.total)&&void 0!==t?t:De.length,i=k.position||"bottomRight";return e("div",{style:{marginTop:"16px",display:"flex",justifyContent:i.includes("Right")?"flex-end":i.includes("Left")?"flex-start":"center"},children:e(le,{current:re,total:n,pageSize:fe,showSizeChanger:k.showSizeChanger,pageSizeOptions:k.pageSizeOptions,showQuickJumper:k.showQuickJumper,showTotal:k.showTotal,onChange:Te,onShowSizeChange:Te,simple:k.simple,responsive:k.responsive,size:"small"===E?"small":"default"})})},Pe=r(function(){return v.some(function(e){return e.fixed})||C&&C.fixed},[v,C]),qe=r(function(){return v.every(function(e){return e.width})&&(!C||C.columnWidth)},[v,C]),Ke=r(function(){if(null==W?void 0:W.x){if("number"==typeof W.x)return W.x;if(!0===W.x)return v.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if(Pe)return v.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)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[v,null==W?void 0:W.x,C,Pe]),Ze=r(function(){return"fixed"===R||Pe||qe||v.some(function(e){return e.width})?"fixed":R},[R,Pe,qe,v]),Ye={width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ze,backgroundColor:"white",borderRadius:"8px",border:"1px solid #EAECF0"},Xe=h({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==W?void 0:W.y)?"".concat(W.y,"px"):void 0,borderRadius:"8px"},K);if(Ce)return t("div",h({ref:ke,className:"aha-table aha-table-mobile-wrapper ".concat(q),style:Xe},G,{children:[T&&e("div",{style:{marginBottom:"16px"},children:T(De)}),k&&"object"==typeof k&&(null===(o=k.position)||void 0===o?void 0:o.startsWith("top"))&&Ve(),e("div",{className:"aha-table-mobile",children:Be.map(function(n,i){var o,r=ce(n,w),l=U.includes(r);return t("div",{className:"aha-table-mobile-row ".concat(l?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:l?"#e6f7ff":"white"},children:[C&&e("div",{style:{marginBottom:"8px"},children:e(ae,{checked:l,onChange:function(e){return Ee(n,e.target.checked)},disabled:null===(o=C.getCheckboxProps)||void 0===o?void 0:o.call(C,n).disabled})}),v.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),l=se(n,o.dataIndex||""),a=o.render?o.render(l,n,i):l;return t("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[t("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})}),N&&e("div",{style:{marginTop:"16px"},children:N(De)}),k&&("object"!=typeof k||!(null===(l=k.position)||void 0===l?void 0:l.startsWith("top")))&&Ve()]}));var Ge={position:"relative",overflowX:(null==W?void 0:W.x)||Pe?"auto":"visible",overflowY:(null==W?void 0:W.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==W?void 0:W.x)?"100%":"number"==typeof(null==W?void 0:W.x)?"".concat(W.x,"px"):void 0,maxHeight:"number"==typeof(null==W?void 0:W.y)?"".concat(W.y,"px"):void 0,borderRadius:"8px"};return t("div",h({ref:ke,className:"aha-table ".concat(q),style:Xe},G,{children:[T&&e("div",{style:{marginBottom:"16px"},children:T(De)}),k&&"object"==typeof k&&(null===(u=k.position)||void 0===u?void 0:u.startsWith("top"))&&Ve(),e("div",{style:Ge,children:e("div",{style:{width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",display:"block"},children:t("table",{style:Ye,className:z?"bordered":"",children:[We(),e("tbody",{children:Oe()}),M&&e("tfoot",{children:e("tr",{children:e("td",{colSpan:v.length+(C?1:0),children:M(De)})})})]})})}),N&&e("div",{style:{marginTop:"16px"},children:N(De)}),k&&("object"!=typeof k||!(null===(p=k.position)||void 0===p?void 0:p.startsWith("top")))&&Ve()]}))},pe=function(n){var i=n.checked,o=void 0!==i&&i,r=n.disabled,l=void 0!==r&&r,a=n.onChange,s=n.className,c=void 0===s?"":s,d=n.style,u=n.children,p=n.value,f=n.name,g=C().primaryColor,v=void 0===g?"#FB6011":g,x=l?"#FAFAF9":o?v:"white",m=l?"#FAFAF9":o?v:"#D7D3D0";return t("div",{className:"aha-radio ".concat(c),style:h({display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer"},d),onClick:function(e){l||(null==a||a({target:{checked:!o,value:p},currentTarget:{checked:!o,value:p}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"white",opacity:o?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),u&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:l?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:u}),e("input",{type:"radio",checked:o,onChange:a,disabled:l,value:p,name:f,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};pe.displayName="Radio";var fe=function(n){var o=n.items,l=void 0===o?[]:o,u=n.variant,p=void 0===u?"underline":u,f=n.layout,v=void 0===f?"equal":f,x=n.defaultValue,m=n.value,y=n.onChange,b=n.className,w=void 0===b?"":b,F=n.mode,k=void 0===F?"children":F,S=n.scrollable,E=void 0!==S&&S,A=g(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),z=C().primaryColor;if(!l||0===l.length)return null;var L=r(function(){if(0===l.length)return[];var e=l[0];return"string"==typeof e||"number"==typeof e?l.map(function(e,t){return{key:String(e),label:String(e)}}):l},[l]),D=void 0!==m,B=L.length>0?L[0].key:"",T=function(e){if(void 0===e)return B;var t=L.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),i=Number(e);return!isNaN(n)&&!isNaN(i)&&n===i});return t?t.key:B},N=a(function(){var e,t=null!==(e=null!=m?m:x)&&void 0!==e?e:B;return T(t)}),M=N[0],W=N[1],I=D?void 0!==m?T(m):B:M;s(function(){console.log("[Tab Debug] currentValue:",I,"type:",typeof I),console.log("[Tab Debug] normalizedItems:",L.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",m,"isControlled:",D)},[I,L,m,D]);var R=c(function(e,t){if(!t){D||W(e);var n="number"==typeof l[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==y||y(n),E&&"underline"===p){var i=O.current[V(e)],o=K.current;if(i&&o){X.current=!0;var r,a=function(){if(o&&P.current&&i){var e=o.getBoundingClientRect(),t=i.getBoundingClientRect();if(e.width>0&&t.width>0){var n=o.scrollLeft||0,r=t.left-e.left+n,l=t.width;U({width:"".concat(l,"px"),left:"".concat(r,"px"),opacity:1})}}},s=function(){a(),clearTimeout(r),r=setTimeout(function(){a(),X.current=!1,o.removeEventListener("scroll",s)},150)};o.addEventListener("scroll",s,{passive:!0}),i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){a()})})}}}},[D,y,l,E,p]),j=L.find(function(e){if(e.key===I)return!0;if(String(e.key)===String(I))return!0;var t=Number(e.key),n=Number(I);return!isNaN(t)&&!isNaN(n)&&t===n}),H=z||"#FB6011",O=d({}),V=function(e){return String(e)},P=d(null),q=d(null),K=d(null),Z=d(null),Y=d("");d(new Set);var X=d(!1),G=a({width:0,left:0,opacity:0}),_=G[0],U=G[1],J=a({width:0,left:0,opacity:0}),Q=J[0],$=J[1],ee=c(function(){"underline"===p&&K.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(P.current&&K.current){var e=O.current[V(I)];if(!e&&L.length>0){var t=L[0].key;e=O.current[V(t)]}if(e){var n=K.current.getBoundingClientRect(),i=e.getBoundingClientRect();if(0!==n.width&&0!==i.width){var o=K.current.scrollLeft||0,r=i.left-n.left+o,l=i.width,a="".concat(r,"px"),s="".concat(l,"px");U(function(e){return e.left===a&&e.width===s&&1===e.opacity?e:{width:s,left:a,opacity:1}})}}}})})},[p,I,L]),te=c(function(){"background"===p&&Z.current&&q.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(q.current&&Z.current){var e=O.current[V(I)];if(!e&&L.length>0){var t=L[0].key;e=O.current[V(t)]}if(e){var n=Z.current.getBoundingClientRect(),i=e.getBoundingClientRect();if(0!==n.width&&0!==i.width){var o=i.left-n.left,r=i.width,l="".concat(o,"px"),a="".concat(r,"px");$(function(e){return e.left===l&&e.width===a&&1===e.opacity?e:{width:a,left:l,opacity:1}})}}}})})},[p,I,L]);s(function(){I?Y.current!==I&&(Y.current=I,"underline"===p&&K.current&&!X.current&&ee(),"background"===p&&Z.current&&q.current&&te()):Y.current=""},[I,p,L.length,D,ee,te]),s(function(){if(I){var e=setTimeout(function(){if("underline"===p)(e=O.current[V(I)])&&K.current&&P.current&&(ee(),E&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===p){var e;if((e=O.current[V(I)])&&Z.current&&q.current){var t=Z.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var i=n.left-t.left,o=n.width,r="".concat(i,"px"),l="".concat(o,"px");$({width:l,left:r,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),s(function(){if(E&&"underline"===p&&I&&!X.current){var e=setTimeout(function(){var e=O.current[V(I)],t=K.current;if(e&&t){X.current=!0;var n,i=function(){if(t&&P.current&&e){var n=t.getBoundingClientRect(),i=e.getBoundingClientRect();if(n.width>0&&i.width>0){var o=t.scrollLeft||0,r=i.left-n.left+o,l=i.width;U({width:"".concat(l,"px"),left:"".concat(r,"px"),opacity:1})}}},o=function(){i(),clearTimeout(n),n=setTimeout(function(){i(),X.current=!1,t.removeEventListener("scroll",o)},150)};t.addEventListener("scroll",o,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){i()})})}},50);return function(){return clearTimeout(e)}}},[I,E,p]);var ne;return t("div",{className:"aha-tab-container",children:["underline"===p?(ne={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},E&&(ne.overflowX="auto",ne.overflowY="hidden",ne.scrollBehavior="smooth",ne.scrollbarWidth="none",ne.WebkitOverflowScrolling="touch"),t("div",h({ref:K,className:"aha-tab aha-tab--underline ".concat(E?"aha-tab--scrollable":""," ").concat(w),style:ne},A,{children:[e("div",{ref:P,style:h({position:"absolute",bottom:"-1px",height:"2px",backgroundColor:H,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"},_)}),L.map(function(n){var o=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===L[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:o,variant:p}),t("div",{ref:function(e){O.current[V(n.key)]=e},onClick:function(){return R(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:E?0:void 0,whiteSpace:E?"nowrap":void 0},children:[n.icon&&function(){var t,r=typeof n.icon,l=i.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:r,isReactElement:l,iconValue:n.icon}),i.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?H:"#79716B",transition:"color 0.2s ease-in-out"},children:i.cloneElement(n.icon,{width:20,height:20,style:h(h({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:o?H:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?H:"#79716B",transition:"color 0.2s ease-in-out"},children:i.createElement(n.icon,{width:20,height:20,style:{color:o?H:"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?H:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?H:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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"===v?"100%":"fit-content",t("div",h({ref:Z,className:"aha-tab aha-tab--background aha-tab--".concat(v," ").concat(w),style:n},A,{children:[e("div",{ref:q,style:h({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"},Q)}),L.map(function(n){var o=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===L[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:o,variant:p});var r={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"===v?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return t("div",{ref:function(e){O.current[V(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:r,children:[n.icon&&function(){var t;return i.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:i.cloneElement(n.icon,{width:16,height:16,style:h(h({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:i.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e("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("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("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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)})]}))}(),E&&"underline"===p&&e("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===k&&(null==j?void 0:j.children)&&e("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:j.children})]})},he=function(i){var o=i.percent,r=void 0===o?0:o,l=i.type,c=void 0===l?"circle":l,u=i.width,p=void 0===u?120:u,f=i.title,v=i.titlePosition,x=i.showPercent,m=void 0===x||x,y=i.animated,b=void 0!==y&&y,w=i.status,F=void 0===w?"normal":w,k=i.className,S=void 0===k?"":k,E=i.style,A=i.strokeColor,z=i.trailColor,L=void 0===z?"#F5F5F4":z,D=g(i,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),B=C().primaryColor,T=Math.min(100,Math.max(0,r)),N=d(!0),M=a(!1),W=M[0],I=M[1],R=a(0),j=R[0],H=R[1];s(function(){if(b&&N.current&&T>0){N.current=!1,H(0),I(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){H(T)})});var e=setTimeout(function(){I(!1),H(T)},300);return function(){return clearTimeout(e)}}N.current?(N.current=!1,I(!1),H(T)):H(T)},[b,T]);var O=A||B||"#FB6011";"success"===F?O="#00BC7D":"exception"===F&&(O="#FB2C36");var V=v||"inside",P=Math.max(4,Math.round(.06*p)),q=(p-P)/2,K="semicircle"===c?p/2:p,Z="14px",Y="12px",X=function(){var i=f&&"outside"===V?p+4+18+4:p,o=2*Math.PI*q,r=o-(W?j:T)/100*o;return t("div",{style:{position:"relative",width:p,height:i,display:"flex",alignItems:"center",justifyContent:"center"},children:[t("svg",{width:p,height:p,style:{position:"absolute",top:0,left:0},children:[e("circle",{cx:p/2,cy:p/2,r:q,fill:"none",stroke:L,strokeWidth:P,strokeLinecap:"round"}),e("circle",{cx:p/2,cy:p/2,r:q,fill:"none",stroke:O,strokeWidth:P,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:r,transform:"rotate(-90 ".concat(p/2," ").concat(p/2,")"),style:{transition:W?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===V?t("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("div",{style:{fontSize:Z,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Y,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(T),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Y,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(T),"%")}),f&&"outside"===V&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:Z,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]})},G=h({display:"inline-flex",flexDirection:"column",alignItems:"center",width:p},E);return e("div",h({className:"aha-progress aha-progress--".concat(c," ").concat(S),style:G},D,{children:function(){switch(c){case"circle":return X();case"semicircle":return o=P/2,r=p-P/2,l=(i=K+P)-P/2,a=K/2+P/2+P/2,s=f&&"outside"===V?i+4+18+4:i,d=Math.PI*q,u=d-(W?j:T)/100*d,t("div",{style:{position:"relative",width:p,height:s,overflow:"hidden"},children:[t("svg",{width:p,height:i,viewBox:"0 0 ".concat(p," ").concat(i),style:{position:"absolute",top:0,left:0},children:[e("path",{d:"M ".concat(o," ").concat(l," A ").concat(q," ").concat(q," 0 0 1 ").concat(r," ").concat(l),fill:"none",stroke:L,strokeWidth:P,strokeLinecap:"round"}),e("path",{d:"M ".concat(o," ").concat(l," A ").concat(q," ").concat(q," 0 0 1 ").concat(r," ").concat(l),fill:"none",stroke:O,strokeWidth:P,strokeLinecap:"round",strokeDasharray:d,strokeDashoffset:u,style:{transition:W?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===V?t("div",{style:{position:"absolute",left:"50%",top:"".concat(a,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:Z,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Y,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(T),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(a,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Y,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(T),"%")}),f&&"outside"===V&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:Z,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]});default:return console.warn('Progress type "'.concat(c,'" is not supported yet, using "circle" as fallback')),X()}var i,o,r,l,a,s,d,u}()}))},ge=u(function(o,r){var l=o.size,a=void 0===l?"medium":l,c=o.disabled,u=void 0!==c&&c,p=o.error,f=void 0!==p&&p,v=o.readOnly,x=void 0!==v&&v,m=o.prefix,y=o.suffix,b=o.allowClear,w=void 0!==b&&b,F=o.onClear,k=o.className,S=void 0===k?"":k,E=o.style,A=o.type,z=void 0===A?"text":A,L=o.placeholder,D=o.value,B=o.defaultValue,T=o.onChange,N=o.onFocus,M=o.onBlur,W=o.onPressEnter,I=g(o,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),R=C().primaryColor,j=void 0===R?"#FB6011":R,H=d(null),O=i.useState(B||D||""),V=O[0],P=O[1],q=i.useState(!1),K=q[0],Z=q[1];s(function(){"function"==typeof r?r(H.current):r&&(r.current=H.current)},[r]);var Y=void 0!==D,X=Y?D:V,G=function(e){var t;e.stopPropagation(),Y||P("");null==T||T({target:{value:""},currentTarget:{value:""}}),null==F||F(),null===(t=H.current)||void 0===t||t.focus()},_=w&&X&&!u,U={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},J=y||_?"40px":"12px",Q=h({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(f?"#F04438":K?j:"#D7D3D0"),backgroundColor:u||x?"#FAFAF9":"#FFFFFF",color:u?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:m?"40px":"12px",paddingRight:J,paddingTop:U[a].paddingTop,paddingBottom:U[a].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},E);return t(n,{children:[e("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-moz-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input:-ms-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\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"] {\n -moz-appearance: textfield;\n }\n '}),t("div",{className:"aha-input-wrapper ".concat(S),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[m&&e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:u?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:m}),e("input",h({ref:H,type:z,value:X,placeholder:L,disabled:u,readOnly:x,onChange:function(e){Y||P(e.target.value),null==T||T(e)},onFocus:function(e){Z(!0),null==N||N(e)},onBlur:function(e){Z(!1),null==M||M(e)},onKeyDown:function(e){var t;"Enter"===e.key&&W&&W(e),null===(t=I.onKeyDown)||void 0===t||t.call(I,e)},style:Q,autoComplete:I.autoComplete||"off",autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1},I)),(y||_)&&t("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:u?"#98A2B3":"#78716C",zIndex:1},children:[_&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:G,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),y&&e("span",{style:{pointerEvents:"none"},children:y})]})]})]})});ge.displayName="Input";var ve=u(function(o,r){var l=o.disabled,a=void 0!==l&&l,c=o.error,u=void 0!==c&&c,p=o.readOnly,f=void 0!==p&&p,v=o.showCount,x=void 0!==v&&v,m=o.maxLength,y=o.className,b=void 0===y?"":y,w=o.style,F=o.placeholder,k=o.value,S=o.defaultValue,E=o.rows,A=void 0===E?3:E,z=o.autoSize,L=void 0!==z&&z,D=o.onChange,B=o.onFocus,T=o.onBlur,N=g(o,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),M=C().primaryColor,W=void 0===M?"#FB6011":M,I=d(null),R=i.useState(S||k||""),j=R[0],H=R[1],O=i.useState(!1),V=O[0],P=O[1],q=i.useState(void 0),K=q[0],Z=q[1];s(function(){"function"==typeof r?r(I.current):r&&(r.current=I.current)},[r]);var Y=void 0!==k,X=Y?k:j,G=String(X||"").length;s(function(){if(L&&I.current){var e=I.current,t="object"==typeof L&&L.minRows||1,n="object"==typeof L?L.maxRows:void 0;e.style.height="auto";var i=e.scrollHeight,o=parseInt(window.getComputedStyle(e).lineHeight||"22",10),r=t*o,l=n?n*o:void 0,a=Math.max(i,r);l&&(a=Math.min(a,l)),e.style.height="".concat(a,"px"),Z(a)}},[X,L]);var _=h(h({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(u?"#F04438":V?W:"#D7D3D0"),backgroundColor:a||f?"#FAFAF9":"#FFFFFF",color:a?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",padding:"12px 14px",boxShadow:"0 1px 2px rgba(10, 13, 18, 0.05)",transition:"all 0.2s",outline:"none",resize:L?"none":"vertical",cursor:a?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==K&&L?{height:"".concat(K,"px")}:{}),w);return t(n,{children:[e("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-moz-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea:-ms-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n "}),t("div",{className:"aha-textarea-wrapper ".concat(b),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e("textarea",h({ref:I,value:X,placeholder:F,disabled:a,readOnly:f,rows:L?void 0:A,maxLength:m,onChange:function(e){Y||H(e.target.value),null==D||D(e)},onFocus:function(e){P(!0),null==B||B(e)},onBlur:function(e){P(!1),null==T||T(e)},style:_,autoComplete:N.autoComplete||"off",autoCorrect:N.autoCorrect||"off",autoCapitalize:N.autoCapitalize||"off",spellCheck:N.spellCheck||!1},N)),(x||m)&&e("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:a?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:m?t("span",{children:[G," / ",m]}):e("span",{children:G})})]})]})});ve.displayName="Textarea";var xe=function(n){var o=n.checked,r=n.defaultChecked,l=void 0!==r&&r,a=n.disabled,s=void 0!==a&&a,c=n.onChange,d=n.onClick,u=n.checkedChildren,p=n.unCheckedChildren,f=n.size,g=void 0===f?"default":f,v=n.loading,x=void 0!==v&&v,m=n.className,y=void 0===m?"":m,b=n.style,w=C().primaryColor,F=void 0===w?"#FB6011":w,k=i.useState(l),S=k[0],E=k[1],A=void 0!==o,z=A?o:S,L={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[g],D=z||x,B=s?"#E7E5E4":D?F:"#F5F5F4",T=D?"calc(100% - ".concat(L.thumbSize," - ").concat(L.thumbOffset,")"):L.thumbOffset;return t("button",{type:"button",role:"switch","aria-checked":z,disabled:s||x,onClick:function(e){if(!s&&!x){var t=!z;A||E(t),null==c||c(t,e),null==d||d(t,e)}},className:"aha-switch ".concat(y),style:h({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:D?"flex-end":"flex-start",width:L.width,height:L.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===g?"10px":"12px",backgroundColor:B,cursor:s||x?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(u||p)&&e("span",{style:{position:"absolute",left:D?"6px":"auto",right:D?"auto":"6px",fontSize:L.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:D?u:p}),e("span",{style:{position:"absolute",left:T,top:"50%",transform:"translateY(-50%)",width:L.thumbSize,height:L.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:x&&t("svg",{width:"small"===g?"8":"10",height:"small"===g?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};xe.displayName="Switch";var me=function(o){var l,u=o.value,p=o.defaultValue,g=o.options,v=void 0===g?[]:g,x=o.mode,y=o.disabled,b=void 0!==y&&y,w=o.error,F=void 0!==w&&w,k=o.placeholder,S=void 0===k?"Please select":k,E=o.size,A=void 0===E?"medium":E,z=o.showSearch,L=void 0!==z&&z,D=o.filterOption,B=void 0===D||D,T=o.allowClear,N=void 0!==T&&T,M=o.onChange,W=o.onSelect,I=o.onDeselect,R=o.onSearch,j=o.onFocus,H=o.onBlur,O=o.onDropdownVisibleChange,V=o.className,P=void 0===V?"":V,q=o.style,K=o.dropdownClassName,Z=void 0===K?"":K,Y=o.dropdownStyle,X=o.defaultOpen,G=void 0!==X&&X,_=o.open,U=o.maxTagCount,J=o.tagRender,Q=o.optionRender,$=C().primaryColor,ee=void 0===$?"#FB6011":$,te=a(void 0!==p?p:x?[]:void 0),ne=te[0],ie=te[1],oe=a(G),re=oe[0],le=oe[1],ae=a(""),se=ae[0],ce=ae[1],de=a(-1),ue=de[0],pe=de[1],fe=d(null),he=d(null),ge=d(null),ve=a(null),xe=ve[0],me=ve[1],ye=void 0!==u,be=void 0!==_,we=ye?u:ne,Ce=be?_:re,Fe="multiple"===x||"tags"===x,ke=c(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return v.filter(function(t){return e.includes(t.value)})},[we,v]),Se=c(function(){return L&&se?!1===B?v:"function"==typeof B?v.filter(function(e){return B(se,e)}):v.filter(function(e){var t=String(e.label||"").toLowerCase(),n=se.toLowerCase();return t.includes(n)}):v},[v,se,L,B]),Ee=r(function(){return Se()},[Se]);s(function(){if(Ce&&fe.current){var e=function(){if(fe.current){var e=fe.current.getBoundingClientRect();me({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[Ce]),s(function(){var e=function(e){var t=e.target;fe.current&&!fe.current.contains(t)&&ge.current&&!ge.current.contains(t)&&(be||le(!1),null==O||O(!1),ce(""))};if(Ce)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Ce,be,O]),s(function(){if(Ce){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<Ee.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),pe(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ue>=0){e.preventDefault();var n=Ee[ue];n&&!n.disabled&&Ae(n)}else"Escape"===e.key&&(e.preventDefault(),be||le(!1),null==O||O(!1),null===(t=fe.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Ce,Ee,ue,be,O]),s(function(){if(ue>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var Ae=c(function(e){var t;if(!e.disabled)if(Fe){var n,i=Array.isArray(we)?we:[];i.includes(e.value)?(n=i.filter(function(t){return t!==e.value}),null==I||I(e.value,e)):(n=m(m([],i,!0),[e.value],!1),null==W||W(e.value,e)),ye||ie(n);var o=v.filter(function(e){return n.includes(e.value)});null==M||M(n,o)}else ye||ie(e.value),null==M||M(e.value,e),null==W||W(e.value,e),be||le(!1),null==O||O(!1),ce(""),null===(t=fe.current)||void 0===t||t.focus()},[Fe,we,ye,be,v,M,W,I,O]),ze=c(function(e,t){if(e.stopPropagation(),Fe&&Array.isArray(we)){var n=we.filter(function(e){return e!==t}),i=v.find(function(e){return e.value===t});ye||ie(n),null==M||M(n,ke()),null==I||I(t,i)}},[Fe,we,ye,v,M,I,ke]),Le=function(e){e.stopPropagation();var t=Fe?[]:void 0;ye||ie(t),null==M||M(t,[]),ce("")},De={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"}},Be=r(function(){return ke()},[ke]),Te=r(function(){return N&&we&&!b},[N,we,b]),Ne=r(function(){return Fe?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Fe,we]),Me=r(function(){if(!Fe||!Array.isArray(we)||0===we.length)return null;var n="responsive"===U?Be.slice(0,2):U?Be.slice(0,U):Be,o=U&&Be.length>n.length?Be.length-n.length:0;return t("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:!b,onClose:function(){return ze({},n.value)}};return J?e(i.Fragment,{children:J(o)},n.value):t("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("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!b&&e("span",{onClick:function(e){return ze(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),o>0&&t("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[Fe,we,Be,U,b,J]);return t(n,{children:[e("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 "}),t("div",{ref:fe,className:"aha-select ".concat(P),style:h({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(F?"#F04438":Ce?ee:"#D7D3D0"),backgroundColor:b?"#FAFAF9":"#FFFFFF",cursor:b?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:De[A].paddingTop,paddingBottom:De[A].paddingBottom,fontSize:De[A].fontSize,lineHeight:De[A].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},q),onClick:function(){if(!b){var e=!Ce;be||le(e),null==O||O(e),e&&L?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):ce("")}},onFocus:function(e){null==j||j(e)},onBlur:function(e){null==H||H(e)},onTouchStart:function(e){b||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:b?-1:0,children:[e("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:Fe?Me||e("span",S?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:S}:{style:{flex:1,minHeight:"24px"}}):L&&Ce?e("input",{ref:he,type:"text",value:se,onChange:function(e){var t=e.target.value;ce(t),null==R||R(t),pe(-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:b?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Ne?void 0:S,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Ne?b?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Ne?(null===(l=Be[0])||void 0===l?void 0:l.label)||we:S||" "})}),t("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Te&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Le,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e(function(t){var n=t.isOpen;return e("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("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Ce})]})]}),Ce&&xe&&f(e("div",{ref:ge,className:"aha-select-dropdown ".concat(Z),style:h({position:"absolute",top:"".concat(xe.top,"px"),left:"".concat(xe.left,"px"),width:"".concat(xe.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:"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},Y),children:0===Ee.length?e("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Ee.map(function(n,i){var o=Fe?Array.isArray(we)&&we.includes(n.value):we===n.value,r=i===ue;return Q?e("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&Ae(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Q(n,{selected:o,focused:r,disabled:n.disabled||!1})},n.value):t("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return Ae(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.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("span",{children:n.label}),o&&e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};me.displayName="Select";var ye=o(null),be=i.forwardRef(function(t,n){var i=t.initialValues,o=void 0===i?{}:i,l=t.onValuesChange,u=t.onFinish,f=t.onFinishFailed,g=t.labelWidth,m=void 0===g?"120px":g,y=t.labelAlign,b=void 0===y?"right":y,w=t.layout,C=void 0===w?"horizontal":w;t.size;var F=t.className,k=void 0===F?"":F,S=t.style,E=t.children,A=a(function(){var e={};return Object.keys(o).forEach(function(t){e[t]={value:o[t],error:void 0,touched:!1,validating:!1}}),e}),z=A[0],L=A[1],D=d(z);s(function(){D.current=z},[z]);var B=c(function(e){var t;return null===(t=D.current[e])||void 0===t?void 0:t.value},[]),T=c(function(e,t){L(function(n){var i=h({},n);if(i[e]?i[e]=h(h({},i[e]),{value:t}):i[e]={value:t,error:void 0,touched:!1,validating:!1},D.current[e]?D.current[e]=h(h({},D.current[e]),{value:t}):D.current[e]={value:t,error:void 0,touched:!1,validating:!1},l){var o={};o[e]=t;var r={};Object.keys(i).forEach(function(e){r[e]=i[e].value}),l(o,r)}return i})},[l]),N=c(function(e){var t;return null===(t=D.current[e])||void 0===t?void 0:t.error},[]),M=c(function(e,t){D.current[e]&&(D.current[e]=h(h({},D.current[e]),{error:t})),L(function(n){var i=h({},n);return i[e]?i[e]=h(h({},i[e]),{error:t}):i[e]={value:void 0,error:t,touched:!1,validating:!1},i})},[]),W=c(function(e){var t;return(null===(t=D.current[e])||void 0===t?void 0:t.touched)||!1},[]),I=c(function(e,t){D.current[e]&&(D.current[e]=h(h({},D.current[e]),{touched:t})),L(function(n){var i=h({},n);return i[e]?i[e]=h(h({},i[e]),{touched:t}):i[e]={value:void 0,error:void 0,touched:t,validating:!1},i})},[]),R=c(function(e){var t;return(null===(t=D.current[e])||void 0===t?void 0:t.validating)||!1},[]),j=c(function(e,t){D.current[e]&&(D.current[e]=h(h({},D.current[e]),{validating:t})),L(function(n){var i=h({},n);return i[e]?i[e]=h(h({},i[e]),{validating:t}):i[e]={value:void 0,error:void 0,touched:!1,validating:t},i})},[]),H=d();H.current=function(e,t){L(function(n){if(n[e]){var i=n[e].rules||[],r=t.rules||[],l=i.length===r.length;if(l&&i.length>0)for(var a=0;a<i.length;a++){var s=i[a],c=r[a];if((null==s?void 0:s.required)!==(null==c?void 0:c.required)||(null==s?void 0:s.message)!==(null==c?void 0:c.message)||(null==s?void 0:s.type)!==(null==c?void 0:c.type)||(null==s?void 0:s.pattern)!==(null==c?void 0:c.pattern)||(null==s?void 0:s.min)!==(null==c?void 0:c.min)||(null==s?void 0:s.max)!==(null==c?void 0:c.max)||(null==s?void 0:s.len)!==(null==c?void 0:c.len)||(null==s?void 0:s.whitespace)!==(null==c?void 0:c.whitespace)){l=!1;break}}if(l&&n[e].required===t.required)return n}var d=h({},n);return d[e]?d[e]=h(h({},d[e]),{rules:t.rules,required:t.required}):d[e]={value:o[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},d})};var O=c(function(e,t){var n;null===(n=H.current)||void 0===n||n.call(H,e,t)},[]),V=c(function(e){L(function(t){var n=h({},t);return delete n[e],n})},[]),P=c(function(e){return v(void 0,void 0,void 0,function(){var t,n,i,o,r,l,a,s,c;return x(this,function(d){switch(d.label){case 0:if(!(t=D.current[e]))return[2,void 0];j(e,!0),n=t.rules||[],o=0,r=n,d.label=1;case 1:if(!(o<r.length))return[3,6];if(l=r[o],a=t.value,l.required&&(null==a||""===a))return i=l.message||"".concat(e," is required"),[3,6];if(l.type&&null!=a&&""!==a&&(s={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}}}[l.type])&&!s(a))return i=l.message||"".concat(e," must be a valid ").concat(l.type),[3,6];if(l.pattern&&null!=a&&""!==a&&!l.pattern.test(String(a)))return i=l.message||"".concat(e," format is invalid"),[3,6];if(void 0!==l.min&&null!=a&&""!==a&&("string"==typeof a?a.length:Number(a))<l.min)return i=l.message||"".concat(e," must be at least ").concat(l.min),[3,6];if(void 0!==l.max&&null!=a&&""!==a&&("string"==typeof a?a.length:Number(a))>l.max)return i=l.message||"".concat(e," must be at most ").concat(l.max),[3,6];if(void 0!==l.len&&null!=a&&""!==a&&("string"==typeof a?a.length:Number(a))!==l.len)return i=l.message||"".concat(e," must be exactly ").concat(l.len),[3,6];if(l.whitespace&&"string"==typeof a&&a.trim()!==a)return i=l.message||"".concat(e," cannot be whitespace"),[3,6];if(!l.validator)return[3,5];d.label=2;case 2:return d.trys.push([2,4,,5]),[4,l.validator(l,a)];case 3:return d.sent(),[3,5];case 4:return c=d.sent(),i=(null==c?void 0:c.message)||l.message||"".concat(e," validation failed"),[3,6];case 5:return o++,[3,1];case 6:return D.current[e]?D.current[e]=h(h({},D.current[e]),{error:i,validating:!1,touched:!0}):D.current[e]={value:t.value,error:i,touched:!0,validating:!1,rules:t.rules,required:t.required},L(function(n){var o=h({},n);return o[e]?o[e]=h(h({},o[e]),{error:i,validating:!1,touched:!0}):o[e]={value:t.value,error:i,touched:!0,validating:!1,rules:t.rules,required:t.required},o}),[2,i]}})})},[]),q=c(function(e){var t=D.current,n={};return(e||Object.keys(t)).forEach(function(e){var i;n[e]=null===(i=t[e])||void 0===i?void 0:i.value}),n},[]),K=c(function(e){return v(void 0,void 0,void 0,function(){var t,n,i,o;return x(this,function(r){switch(r.label){case 0:return t=D.current,n=e||Object.keys(t),i=[],[4,Promise.all(n.map(function(e){return v(void 0,void 0,void 0,function(){var n,i;return x(this,function(o){switch(o.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,P(e)]:[3,2];case 1:return i=o.sent(),[2,{name:e,error:i}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return r.sent().forEach(function(e){var t=e.name,n=e.error;n&&i.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(r.sent(),i.length>0)throw o={values:q(),errorFields:i},null==f||f(o),o;return[2,q()]}})})},[P,q,f]),Z=c(function(e){L(function(t){var n=h({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=h(h({},n[e]),{value:o[e],error:void 0,touched:!1,validating:!1}))}),n})},[o]),Y=c(function(e){L(function(t){var n=h({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=h(h({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1}}),l){var i={};Object.keys(n).forEach(function(e){i[e]=n[e].value}),l(e,i)}return n})},[l]),X=c(function(){return v(void 0,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,K()];case 1:return e=t.sent(),null==u||u(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[K,u]);p(n,function(){return{getFieldValue:B,getFieldsValue:q,setFieldValue:T,setFieldsValue:Y,getFieldError:N,validateField:P,validateFields:K,resetFields:Z,submit:X}});var G=r(function(){return{fields:z,getFieldValue:B,setFieldValue:T,getFieldError:N,setFieldError:M,isFieldTouched:W,setFieldTouched:I,isFieldValidating:R,setFieldValidating:j,registerField:O,unregisterField:V,validateField:P,validateFields:K,resetFields:Z,getFieldsValue:q,setFieldsValue:Y,submit:X,labelWidth:m,labelAlign:b}},[z,B,T,N,M,W,I,R,j,O,V,P,K,Z,q,Y,X,m,b]),_=h({},S);return"vertical"===C?(_.display="flex",_.flexDirection="column"):"inline"===C&&(_.display="inline-flex",_.flexWrap="wrap",_.gap="16px"),e(ye.Provider,{value:G,children:e("form",{className:"aha-form ".concat(k),style:_,onSubmit:function(e){return v(void 0,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,K()];case 2:return t=n.sent(),null==u||u(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:E})})});be.displayName="Form";var we=be;we.Item=function(n){var o=n.name,a=n.label,c=n.htmlFor;n.labelCol,n.wrapperCol;var u=n.required,p=void 0!==u&&u,f=n.rules,g=void 0===f?[]:f;n.hasFeedback;var v=n.validateStatus,x=n.help,m=n.extra,y=n.className,b=void 0===y?"":y,w=n.style,C=n.children;n.labelAlign,n.labelWidth;var F=n.hidden,k=void 0!==F&&F,S=n.tooltip,E=l(ye),A=d(null),z=(null==E?void 0:E.fields)||{};o&&E&&E.getFieldValue(o);var L=o&&E?E.getFieldError(o):void 0,D=!(!o||!E)&&E.isFieldTouched(o),B=!(!o||!E)&&E.isFieldValidating(o);o&&z[o];var T=v||(L?"error":B?"validating":D&&!L?"success":void 0),N=void 0!==x?x:L||void 0,M=d(g),W=d(p),I=d(!1),R=p||g.some(function(e){return e.required}),j=r(function(){if(!I.current)return I.current=!0,!0;if(M.current.length!==g.length)return!0;if(M.current===g)return!1;for(var e=0;e<g.length;e++){var t=M.current[e],n=g[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},[g]);s(function(){if(o&&E)return(!M.current||j||W.current!==p)&&(M.current=g,W.current=p,E.registerField(o,{rules:g,required:R})),function(){o&&E&&E.unregisterField(o)}},[o]);if(k)return null;return t("div",{ref:A,className:"aha-form-item ".concat(b),style:h({display:"flex",flexDirection:"column",marginBottom:"16px"},w),children:[a&&t("label",{htmlFor:c,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[a,R&&e("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),S&&e(function(n){var o=n.content,r=i.useState(!1),l=r[0],a=r[1],s=i.useRef(null);return i.useEffect(function(){var e=function(e){s.current&&!s.current.contains(e.target)&&a(!1)};if(l)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[l]),t("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e("div",{onClick:function(e){e.stopPropagation(),a(!l)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e(re,{})}),l&&t("div",{ref:s,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("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:S})]}),t("div",{style:{width:"100%"},children:[e("div",{children:i.Children.map(C,function(e){return i.isValidElement(e)?function(e){var t,n,r,l,a,s,c,d,u;if(!i.isValidElement(e))return e;var p=h({},e.props);if(o&&E){var f=E.getFieldValue(o),g=E.setFieldValue;if(!g)return e;if(e.type&&"object"==typeof e.type&&"displayName"in e.type){var v=e.type.displayName;if("Input"===v||"Textarea"===v){p.value=f||"";var x=null===(t=e.props)||void 0===t?void 0:t.onChange,m=null===(n=e.props)||void 0===n?void 0:n.onBlur;p.onChange=function(e){g(o,e.target.value),null==x||x(e),o&&E&&setTimeout(function(){E.validateField(o)},0)},p.onBlur=function(e){o&&E&&(E.setFieldTouched(o,!0),E.validateField(o)),null==m||m(e)},p.error="error"===T}else if("Select"===v){p.value=f;var y=null===(r=e.props)||void 0===r?void 0:r.onChange,b=null===(l=e.props)||void 0===l?void 0:l.onBlur;p.onChange=function(e,t){g(o,e),null==y||y(e,t),o&&E&&(E.setFieldTouched(o,!0),setTimeout(function(){E.validateField(o)},0))},p.onBlur=function(e){o&&E&&(E.setFieldTouched(o,!0),E.validateField(o)),null==b||b(e)},p.error="error"===T}else if("Switch"===v){p.checked=f||!1;var w=null===(a=e.props)||void 0===a?void 0:a.onChange;p.onChange=function(e,t){g(o,e),null==w||w(e,t),o&&E&&(E.setFieldTouched(o,!0),setTimeout(function(){E.validateField(o)},0))}}else if("Checkbox"===v){p.checked=f||!1;var C=null===(s=e.props)||void 0===s?void 0:s.onChange;p.onChange=function(e){g(o,e.target.checked),null==C||C(e),o&&E&&(E.setFieldTouched(o,!0),setTimeout(function(){E.validateField(o)},0))}}else if("Radio"===v){var F=null===(c=e.props)||void 0===c?void 0:c.value;if(void 0!==F){p.checked=f===F;var k=null===(d=e.props)||void 0===d?void 0:d.onChange;p.onChange=function(e){g(o,F),null==k||k(e),o&&E&&(E.setFieldTouched(o,!0),setTimeout(function(){E.validateField(o)},0))}}}}else{void 0!==f&&(p.value=f);var S=null===(u=e.props)||void 0===u?void 0:u.onChange;p.onChange=function(e){var t,n,i=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;g(o,i),null==S||S(e)}}}return"error"===T&&"error"in p&&(p.error=!0),i.cloneElement(e,p)}(e):e})}),N&&e("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===T?"#D92D20":"warning"===T?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:N}),m&&!N&&e("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:m})]})]})};var Ce=function(n){var o=n.items,r=void 0===o?[]:o,l=n.userProfile,s=n.selectedKeys,u=n.defaultSelectedKeys,p=void 0===u?[]:u,f=n.onSelect,g=n.onDeselect,v=n.onClick,x=n.className,y=void 0===x?"":x,b=n.style,w=n.width,F=void 0===w?320:w;C().primaryColor;var k=d(null),S=d({}),E=void 0!==s,A=a(p),z=A[0],L=A[1],D=E?s:z,B=function(e){return"children"in e&&Array.isArray(e.children)},T=c(function(e,t,n){void 0===n&&(n=[]);for(var i=0,o=t;i<o.length;i++){var r=o[i];if(B(r)){var l=T(e,r.children,n);if(l)return l}else{var a=r,s=m(m([],n,!0),[a.key],!1);if(a.key===e)return s}}return null},[]),N=c(function(e){var t;if(!e.disabled){var n,i=T(e.key,r)||[e.key];D.includes(e.key)?(n=D.filter(function(t){return t!==e.key}),null==g||g({key:e.key,keyPath:i,selectedKeys:n})):(n=[e.key],null==f||f({key:e.key,keyPath:i,selectedKeys:n})),E||L(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:i}),e.skipGlobalClick||null==v||v({key:e.key,keyPath:i})}},[D,E,f,g,v,r,T]),M=function(n){var i=D.includes(n.key);if(n.render)return e("div",{className:n.className,style:n.style,children:n.render(n,i)},n.key);var o=h({display:"flex",alignItems:"center",padding:"10px 16px",cursor:n.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:n.disabled?.5:1},n.style);return t("div",{ref:function(e){S.current[n.key]=e},className:"aha-menu-item ".concat(n.className||""),style:o,onClick:function(){return N(n)},onMouseEnter:function(e){n.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[n.icon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.icon}),e("span",{style:{flex:1},children:n.label})]},n.key)},W=h({width:"number"==typeof F?"".concat(F,"px"):F,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"},b),I=function(e,t){if(0===e)return!1;var n=t[e],i=t[e-1];return!!B(i)||!(!B(n)||B(i))};return t("div",{ref:k,className:"aha-menu-list ".concat(y),style:W,children:[l&&(l?l.render?l.render(l):e("div",{onClick:l.onClick,style:{padding:"16px",cursor:l.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t("div",{style:{position:"relative",flexShrink:0},children:[l.avatar||e("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof l.name?l.name.charAt(0).toUpperCase():"U"}),void 0!==l.online&&e("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:l.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),t("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.name}),l.email&&e("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.email})]})]})}):null),e("div",{children:r.map(function(n,o){return t(i.Fragment,{children:[I(o,r)&&e("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),B(n)?(l=n,e("div",{className:"aha-menu-group ".concat(l.className||""),children:l.children.map(function(e){return M(e)})},"group-".concat(l.title))):M(n)]},o);var l})})]})};Ce.displayName="MenuList";var Fe=function(e,t,n,i){void 0===i&&(i=6);var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,l=e.left+e.width/2,a=e.top+e.height/2,s=i+6,c=0,d=0;switch(n){case"top":c=e.top-t.height-s+r,d=l-t.width/2+o;break;case"bottom":default:c=e.bottom+s+r,d=l-t.width/2+o;break;case"left":c=a-t.height/2+r,d=e.left-t.width-s+o;break;case"right":c=a-t.height/2+r,d=e.right+s+o;break;case"top-left":c=e.top-t.height-s+r,d=e.left+o;break;case"top-right":c=e.top-t.height-s+r,d=e.right-t.width+o;break;case"bottom-left":c=e.bottom+s+r,d=e.left+o;break;case"bottom-right":c=e.bottom+s+r,d=e.right-t.width+o}var u=window.innerWidth,p=window.innerHeight;return d<o+8?d=o+8:d+t.width>o+u-8&&(d=o+u-t.width-8),c<r+8?c=r+8:c+t.height>r+p-8&&(c=r+p-t.height-8),{top:c,left:d}},ke=function(e,t,n,i){void 0===i&&(i=6);var o=Fe(e,t,n,i),r=o.top,l=o.left,a=window.scrollX||window.pageXOffset,s=r-(window.scrollY||window.pageYOffset),c=l-a,d=s+t.height,u=c+t.width,p=s,f=c,h=Math.max(p,e.top),g=Math.min(d,e.bottom),v=Math.max(f,e.left),x=Math.min(u,e.right);return g>h+1&&x>v+1},Se=function(t,n){var i=h({position:"absolute",width:0,height:0,borderStyle:"solid"},n),o={top:h(h({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:h(h({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:h(h({},i),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:h(h({},i),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":h(h({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":h(h({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":h(h({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":h(h({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e("div",{style:o[t]})},Ee=function(i){var o=i.content,r=i.children,l=i.position,u=void 0===l?"top":l,p=i.trigger,g=void 0===p?"hover":p,v=i.delay,x=void 0===v?200:v,m=i.disabled,y=void 0!==m&&m,b=i.className,w=void 0===b?"":b,C=i.tooltipClassName,F=void 0===C?"":C,k=i.gap,S=void 0===k?6:k,E=i.showArrow,A=void 0===E||E,z=i.width,L=i.defaultVisible,D=void 0!==L&&L,B=i.visible,T=i.onVisibleChange,N=void 0!==B,M=a(D),W=M[0],I=M[1],R=N?B:W,j=a(N?null!=B&&B:D),H=j[0],O=j[1],V=c(function(e){N||I(e),null==T||T(e)},[N,T]);s(function(){N&&(B?requestAnimationFrame(function(){O(!0)}):O(!1))},[N,B]);var P=a(u),q=P[0],K=P[1],Z=a("320px"),Y=Z[0],X=Z[1],G=a({position:"absolute",top:0,left:0,pointerEvents:"hover"===g?"auto":"none"}),_=G[0],U=G[1],J=a({}),Q=J[0],$=J[1],ee=d(null),te=d(null),ne=d(null),ie=d(null),oe=c(function(){if(ee.current&&te.current&&R&&H){var e=ee.current.getBoundingClientRect(),t=te.current.getBoundingClientRect(),n=function(e,t,n,i){if(void 0===i&&(i=6),!ke(e,t,n,i))return n;for(var o=0,r=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);o<r.length;o++){var l=r[o];if(!ke(e,t,l,i))return l}return n}(e,t,u,S);K(n);var i=Fe(e,t,n,S),o=i.top,r=i.left;if(U(function(e){return h(h({},e),{position:"absolute",top:"".concat(o,"px"),left:"".concat(r,"px"),pointerEvents:"hover"===g?"auto":"none",zIndex:9999})}),A){var l=function(e,t,n,i,o){var r=window.scrollX||window.pageXOffset,l=window.scrollY||window.pageYOffset,a=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,c=i-r,d=o-l;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(a-c,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(a-c,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-d,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,r,o);$(l)}}},[R,u,S,A,H,g]),re=c(function(){y||(ie.current&&(clearTimeout(ie.current),ie.current=null),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){V(!0),N||requestAnimationFrame(function(){O(!0)})},x))},[y,x,V,N]),le=c(function(){ne.current&&(clearTimeout(ne.current),ne.current=null),ie.current&&clearTimeout(ie.current),N?V(!1):(O(!1),ie.current=setTimeout(function(){V(!1),ie.current=null},150))},[V,N]),ae=c(function(){"hover"===g&&(ie.current&&(clearTimeout(ie.current),ie.current=null),R||(V(!0),requestAnimationFrame(function(){O(!0)})))},[g,R]),se=c(function(e){y||"click"!==g||(e.stopPropagation(),R?le():(ne.current&&(clearTimeout(ne.current),ne.current=null),V(!0),requestAnimationFrame(function(){O(!0)})))},[y,g,R,le]);s(function(){if(D&&R&&H){var e=function(){ee.current&&te.current?oe():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[D,R,H,oe]),s(function(){if(R)return requestAnimationFrame(function(){oe()}),window.addEventListener("scroll",oe,!0),window.addEventListener("resize",oe),function(){window.removeEventListener("scroll",oe,!0),window.removeEventListener("resize",oe)}},[R,oe]),s(function(){if(R&&"click"===g){var e=function(e){ee.current&&te.current&&!ee.current.contains(e.target)&&!te.current.contains(e.target)&&le()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[R,g,le]),s(function(){return function(){ne.current&&clearTimeout(ne.current),ie.current&&clearTimeout(ie.current)}},[]);var ce={position:"absolute",top:0,left:0,opacity:H?1:0,transform:H?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===g?"auto":"none",zIndex:9999},de=c(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);s(function(){var e=function(){X(de())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[de]);var ue=h(h({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==z?{width:"number"==typeof z?"".concat(z,"px"):z,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"}),pe=t("div",{style:h(h(h({},ce),_),{pointerEvents:"hover"===g?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(F),onMouseEnter:"hover"===g?ae:void 0,onMouseLeave:"hover"===g?le:void 0,children:[e("div",{ref:te,className:"aha-tooltip ".concat(F),style:ue,role:"tooltip",children:o}),A&&Se(q,Q)]}),fe=c(function(){"hover"===g&&(ie.current=setTimeout(function(){le()},100))},[g,le]),he="click"===g?{onClick:se}:{onMouseEnter:re,onMouseLeave:fe,onFocus:re,onBlur:le};return t(n,{children:[e("div",h({ref:ee,className:"aha-tooltip-trigger ".concat(w),style:{display:"inline-block",cursor:"click"===g?"pointer":"default"}},he,{children:r})),R&&"undefined"!=typeof document&&f(pe,document.body)]})};export{z as Alert,S as Button,Q as CheckIcon,ae as Checkbox,we as Form,ge as Input,Ce as MenuList,$ as MinusIcon,le as Pagination,he as Progress,pe as Radio,me as Select,xe as Switch,fe as Tab,ue as Table,J as Tag,ve as Textarea,w as ThemeProvider,W as Toast,G as ToastProvider,Ee as Tooltip,j as clearAllToasts,R as closeToast,H as debugToast,I as toast,V as toastError,P as toastInfo,q as toastQuestion,O as toastSuccess,C as useTheme};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import o,{createContext as r,useMemo as i,useContext as a,useState as l,useEffect as s,useCallback as d,useRef as c,forwardRef as u,useImperativeHandle as p}from"react";import{createPortal as f}from"react-dom";var h=function(){return h=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},h.apply(this,arguments)};function g(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 v(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 x(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 m(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 y={primaryColor:"#FB6011"},b=r(y),w=function(t){var n=t.theme,o=t.children,r=i(function(){return h(h({},y),n)},[n]);return e(b.Provider,{value:r,children:o})},C=function(){var e=a(b);return e||y},F={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},k=function(o){var r=o.size,i=o.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},S=function(n){var o,r=n.children,i=n.type,a=void 0===i?"default":i,s=n.size,d=void 0===s?"medium":s,c=n.disabled,u=void 0!==c&&c,p=n.loading,f=void 0!==p&&p,v=n.onClick,x=n.htmlType,m=void 0===x?"button":x,y=n.className,b=void 0===y?"":y,w=n.style,S=n.icon,D=n.iconPosition,E=void 0===D?"left":D,A=g(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),L=C().primaryColor,M=void 0===L?"#FB6011":L,z=l(!1),B=z[0],T=z[1],W=l(!1),N=W[0],I=W[1],R=F[d],j=u||f,H=function(){if(f){var t="primary"===a?"#FFFFFF":"#101828",n=parseInt(R.iconSize.replace("px",""));return e(k,{size:n,color:t})}return S?e("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:R.iconSize,height:R.iconSize,flexShrink:0},children:S}):null},V=(o=h({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:R.gap,height:R.height,paddingLeft:R.paddingLeft,paddingRight:R.paddingRight,fontSize:R.fontSize,lineHeight:R.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:j?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},w),"primary"===a?(o.color="#FFFFFF",o.backgroundColor=M,u?(o.opacity=.4,o.cursor="not-allowed"):f?o.backgroundColor=M:N?o.backgroundColor="#EC470A":B&&(o.backgroundColor="#FD843A")):u?(o.backgroundColor="#FAFAF9",o.color="#D6D3D1",o.border="1px solid #E7E5E4"):f?(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):N?(o.backgroundColor="#F5F5F4",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):B?(o.backgroundColor="#FAFAF9",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),o);return t("button",h({type:m,className:"aha-button aha-button--".concat(a," aha-button--").concat(d," ").concat(j?"aha-button--disabled":""," ").concat(f?"aha-button--loading":""," ").concat(b),disabled:j,onClick:function(e){j?e.preventDefault():null==v||v(e)},onMouseEnter:function(){return!j&&T(!0)},onMouseLeave:function(){T(!1),I(!1)},onMouseDown:function(){return!j&&I(!0)},onMouseUp:function(){return I(!1)},style:V},A,{children:[f&&H(),!f&&"left"===E&&H(),r&&e("span",{style:{display:"inline-block"},children:r}),!f&&"right"===E&&H()]}))};S.displayName="Button";var D={success:e("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("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("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("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("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("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("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("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"})})},E=e("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("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"})}),A=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,s=n.title,d=n.description,c=n.icon,u=void 0===c?D[a]:c,p=n.showIcon,f=void 0===p||p,h=n.closeable,g=void 0!==h&&h,v=n.action,x=n.children,m=n.onClose,y=l(!0),b=y[0],w=y[1];return b?t("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[f&&u,t("div",{className:"flex flex-col gap-1",style:g?{paddingRight:"2rem"}:{},children:[s&&e("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:s}),d&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:d}),x&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:x}),v&&g&&e("div",{className:"mt-3",children:v})]}),v&&!g&&e("div",{className:"ml-3",children:v}),g&&e("div",{className:"absolute right-4 top-3 cursor-pointer",onClick:function(){w(!1),null==m||m()},children:E})]}):null},L={success:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})})},M=function(t){var n=t.className;return e("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("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"})})},z=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 m([],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}(),B=new z,T=function(){var o=l([]),r=o[0],i=o[1];s(function(){console.log("Toast: ToastContainer 组件已挂载");var e=B.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=B.subscribe(function(){var e=B.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=r.filter(function(e){return"top-left"===e.props.position}),d=r.filter(function(e){return"top-right"===e.props.position}),c=r.filter(function(e){return"bottom-left"===e.props.position}),u=r.filter(function(e){return"bottom-right"===e.props.position});return t(n,{children:[e("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(W,h({},t),t.id)})}),e("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:d.map(function(t){return e(W,h({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e(W,h({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:u.map(function(t){return e(W,h({},t),t.id)})})]})},W=function(n){var o=n.id,r=n.props,i=l(!1),a=i[0],c=i[1],u=l(!1),p=u[0],f=u[1],h=r.message,g=r.type,v=void 0===g?"info":g,x=r.duration,m=void 0===x?3e3:x,y=r.icon,b=r.action,w=r.showClose,C=void 0===w||w,F=r.onClose,k=r.onClick;r.className;var S=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:L.success};case"error":return{bgColor:"#E7000B",defaultIcon:L.error};case"question":return{bgColor:"#1C1917",defaultIcon:L.question};default:return{bgColor:"#1447E6",defaultIcon:L.info}}}(v);s(function(){var e=setTimeout(function(){c(!0)},10);return function(){return clearTimeout(e)}},[]),s(function(){if(m>0){var e=setTimeout(function(){D()},m);return function(){return clearTimeout(e)}}},[m,o]);var D=d(function(){f(!0),setTimeout(function(){B.removeToast(o),null==F||F()},300)},[o,F]),E=d(function(){null==k||k()},[k]);return e("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&&!p?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!p?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:E,children:t("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:S.bgColor,color:"white"},children:[e("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:y||S.defaultIcon}),t("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:h}),b&&e("div",{style:{marginTop:"12px"},children:b})]}),C&&e("button",{onClick:function(e){e.stopPropagation(),D()},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(M,{})})]})})},N=function(t){return e(W,{id:"direct",props:t})},I=function(e){return console.log("Toast: 调用 toast 函数",e),X(),setTimeout(function(){var t=B.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},R=function(e){B.removeToast(e)},j=function(){B.clearAll()},H=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 管理器状态:",B.getToasts()),console.log("容器根节点:",Z),console.log("是否正在初始化:",K),console.log("====================")},V=function(e,t){return X(),I(h(h({},t),{message:e,type:"success"}))},O=function(e,t){return X(),I(h(h({},t),{message:e,type:"error"}))},P=function(e,t){return X(),I(h(h({},t),{message:e,type:"info"}))},Y=function(e,t){return X(),I(h(h({},t),{message:e,type:"question"}))},q=null,Z=null,K=!1,X=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(K)console.log("Toast: 容器正在初始化中,跳过");else if(q)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),K=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),q=t,void(K=!1);console.log("Toast: 创建容器元素"),(q=document.createElement("div")).id="aha-toast-container",document.body.appendChild(q),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),Z=n(q),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(T,{})),console.log("Toast: 容器渲染完成"),K=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),Z=n(q),console.log("Toast: 渲染 ToastContainer 组件"),Z.render(e(T,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}K=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),K=!1})}}catch(e){console.error("Toast: 创建容器失败",e),K=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},G=function(o){var r=o.children,i=l(!1),a=i[0],d=i[1];return s(function(){d(!0)},[]),t(n,{children:[r,a&&f(e(T,{}),document.body)]})},J={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"}}},_={large:{padding:"px-2 py-0.5",textSize:"text-sm",iconSize:"w-4 h-4",gap:"gap-1"},small:{padding:"px-2 py-0.5",textSize:"text-xs",iconSize:"w-3 h-3",gap:"gap-0.5"}},U=function(n){var r=n.children,i=n.color,a=n.variant,l=void 0===a?"light":a,s=n.size,d=void 0===s?"large":s,c=n.stroke,u=void 0!==c&&c,p=n.icon,f=n.iconPosition,v=void 0===f?"none":f,x=n.className,m=void 0===x?"":x,y=n.onClick,b=g(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=C().primaryColor,F=function(e,t){if("string"==typeof e&&e in J){var n=J[e];return"Orange"===e&&t?h(h({},n),{fill:h(h({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var o=e.replace("#",""),r=parseInt(o.substr(0,2),16),i=parseInt(o.substr(2,2),16),a=parseInt(o.substr(4,2),16);return{light:{bg:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return J.Green}(i,w),k=_[d],S={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===d?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===d?"1.375":"1",transition:"all 0.2s",fontSize:"large"===d?"14px":"12px",height:"small"===d?"20px":"24px"};"light"===l&&(S.backgroundColor=F.light.bg,S.color=F.light.text,u&&(S.outline="1px solid",S.outlineOffset="-1px",S.outlineColor=function(e){if("string"==typeof e&&e in J)switch(e){case"Green":default:return"#A4F4CF";case"Red":return"#FFC9C9";case"Orange":case"Yellow":return"#FFD1A9";case"Blue":return"#BEDBFF";case"Cyan":return"#A2F4FD";case"Violet":return"#DDD6FF";case"Pink":return"#FCCEE8";case"Gray":return"#E7E5E4"}if("string"==typeof e&&e.startsWith("#")){var t=e.replace("#",""),n=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(o,", ").concat(r,", 0.3)")}return"#A4F4CF"}(i))),y&&(S.cursor="pointer",S.opacity="1");var D=["rounded-md","inline-flex","justify-start","items-center",k.padding,k.gap,"font-medium","font-dm-sans","large"===d?"leading-snug":"leading-none","transition-colors","duration-200","small"===d?"h-5":"h-6"].filter(Boolean);"fill"===l&&(S.backgroundColor=F.fill.bg,S.color=F.fill.text),y&&D.push("cursor-pointer","hover:opacity-80"),m&&D.push(m);var E=D.join(" "),A=function(){if(!p)return null;var t=function(e,t){if("string"==typeof e&&e in J)switch(e){case"Green":default:return"#009966";case"Red":return"#E7000B";case"Orange":return t||"#E17100";case"Blue":return"#155DFC";case"Yellow":return"#EC470A";case"Cyan":return"#0092B8";case"Violet":return"#7F22FE";case"Pink":return"#E60076";case"Gray":return"#57534D"}return"string"==typeof e&&e.startsWith("#")?e:"#009966"}(i,w),n="small"===d?"14px":"16px";return e("div",{className:"flex items-center justify-center",style:{width:n,height:n},children:"svg"===p.type?o.cloneElement(p,{width:n,height:n,style:{fill:t}}):p})};return t("div",h({className:E,style:S,onClick:y},b,{children:["leading"===v&&A(),e("div",{className:"px-1 flex justify-center items-center",children:e("div",{className:"justify-center ".concat(k.textSize," font-medium font-dm-sans ").concat("large"===d?"leading-snug":"leading-none"),children:r})}),"after"===v&&A()]}))},Q=function(t){var n=t.className,o=t.style;return e("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("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},$=function(t){var n=t.className,o=t.style;return e("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("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ee=function(t){var n=t.className,o=t.style;return e("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("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"})})},te=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},ne=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},oe=function(t){var n=t.className,o=t.style;return e("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("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"})})},re=function(t){var n=t.className,o=t.style;return e("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("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"})})},ie=function(n){var o=n.className,r=n.style;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("g",{clipPath:"url(#clip0_54_1653)",children:e("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("defs",{children:e("clipPath",{id:"clip0_54_1653",children:e("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},ae=function(n){var o=n.current,r=n.defaultCurrent,a=void 0===r?1:r,d=n.total,c=void 0===d?0:d,u=n.pageSize,p=n.defaultPageSize,f=void 0===p?10:p,g=n.showSizeChanger,v=void 0!==g&&g,x=n.pageSizeOptions,m=void 0===x?["10","20","50","100"]:x,y=n.showQuickJumper,b=void 0!==y&&y,w=n.showTotal,F=n.onChange,k=n.onShowSizeChange,D=n.simple,E=void 0!==D&&D,A=n.disabled,L=void 0!==A&&A,M=n.hideOnSinglePage,z=void 0!==M&&M,B=n.className,T=void 0===B?"":B,W=n.style,N=n.size,I=void 0===N?"default":N,R=n.responsive,j=void 0!==R&&R;n.showLessItems;var H=n.itemRender,V=C().primaryColor,O=void 0===V?"#FB6011":V,P=l(a),Y=P[0],q=P[1],Z=l(f),K=Z[0],X=Z[1],G=l(""),J=G[0],_=G[1],U=null!=o?o:Y,Q=null!=u?u:K,$=i(function(){return Math.ceil(c/Q)},[c,Q]);s(function(){void 0!==o&&q(o)},[o]),s(function(){void 0!==u&&X(u)},[u]);var ee=function(e){e<1||e>$||e===U||L||(void 0===o&&q(e),null==F||F(e,Q))},te=function(){var e=parseInt(J,10);e>=1&&e<=$&&(ee(e),_(""))};if(z&&$<=1)return null;if(E)return t("div",{className:"aha-pagination aha-pagination-simple ".concat(T),style:W,children:[e(S,{onClick:function(){return ee(U-1)},disabled:L||1===U,type:"default",size:"default"===I?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"上一页"}),t("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[U," / ",$]}),e(S,{onClick:function(){return ee(U+1)},disabled:L||U===$,type:"default",size:"default"===I?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var ne=(U-1)*Q+1,ie=Math.min(U*Q,c);return t("div",{className:"aha-pagination w-full ".concat(T),style:h({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:j?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},W),children:[w&&e("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:w(c,[ne,ie])}),t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[H?H(U-1,"prev",e(S,{onClick:function(){return ee(U-1)},disabled:L||1===U,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e(oe,{})," ",e("span",{children:"Previous"})]})})):e(S,{onClick:function(){return ee(U-1)},disabled:L||1===U,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e(oe,{})," ",e("span",{children:"Previous"})]})}),e("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if($<=7)return Array.from({length:$},function(e,t){return t+1});var e=[];if(U<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push($)}else if(U>=$-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=U-1;t<=U+1;t++)e.push(t);e.push("jump-next"),e.push($)}return e}().map(function(t,n){return function(t){if("number"==typeof t){var n=t===U,o=e(S,{onClick:function(){return ee(t)},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:"none",background:n?"#FAFAF9":"white",backgroundColor:n?"#FAFAF9":"white",color:n?O:"#79716B",boxShadow:"none",borderRadius:"8px"},children:t},t);return H?H(t,"page",o):o}if("jump-prev"===t)return o=e(S,{onClick:function(){return ee(Math.max(1,U-5))},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),H?H(U-5,"jump-prev",o):o;if("jump-next"===t)return o=e(S,{onClick:function(){return ee(Math.min($,U+5))},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),H?H(U+5,"jump-next",o):o;return null}(t)})}),H?H(U+1,"next",e(S,{onClick:function(){return ee(U+1)},disabled:L||U===$,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e("span",{children:"Next"})," ",e(re,{})]})})):e(S,{onClick:function(){return ee(U+1)},disabled:L||U===$,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:t("div",{className:"flex items-center gap-1",children:[e("span",{children:"Next"})," ",e(re,{})]})}),v&&e("select",{value:Q,onChange:function(e){return t=Number(e.target.value),n=Math.ceil(c/t),r=U>n?n:U,void 0===u&&X(t),void 0===o&&q(r),null==k||k(r,t),void(null==F||F(r,t));var t,n,r},disabled:L,style:{padding:"small"===I?"6px 12px":"8px 12px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"small"===I?"12px":"14px",lineHeight:"small"===I?"18px":"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",cursor:L?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){L||(e.currentTarget.style.borderColor=O)},onMouseLeave:function(e){e.currentTarget.style.borderColor="#EAECF0"},children:m.map(function(e){return t("option",{value:e,children:[e," 条/页"]},e)})}),b&&t("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"跳至"}),e("input",{type:"number",min:"1",value:J,onChange:function(e){return _(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&te()},disabled:L,style:{width:"56px",height:"small"===I?"28px":"36px",padding:"0 8px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",outline:"none",transition:"all 0.2s"},onFocus:function(e){e.currentTarget.style.borderColor=O},onBlur:function(e){e.currentTarget.style.borderColor="#EAECF0"}}),e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"页"}),"object"==typeof b&&b.goButton?e(S,{onClick:te,disabled:L,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:b.goButton}):e(S,{onClick:te,disabled:L,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},le=function(n){var o=n.checked,r=void 0!==o&&o,i=n.indeterminate,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,d=n.onChange,c=n.className,u=void 0===c?"":c,p=n.style,f=n.children,g=C().primaryColor,v=r||a,x=s?"#FAFAF9":v?g:"white",m=s?"#FAFAF9":v?g:"#D7D3D0";return t("div",{className:"aha-checkbox ".concat(u),style:h({display:"inline-flex",alignItems:"center",gap:"8px",cursor:s?"not-allowed":"pointer"},p),onClick:function(e){s||(null==d||d({target:{checked:!r},currentTarget:{checked:!r}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:v?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:e(a?$:Q,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:s?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),e("input",{type:"checkbox",checked:r,ref:function(e){e&&(e.indeterminate=a)},onChange:d,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};le.displayName="Checkbox";var se=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)},de=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=se(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},ce=function(t){var n=t.order,o=C().primaryColor;return"ascend"===n?e(ne,{style:{color:o}}):"descend"===n?e(te,{style:{color:o}}):e(ee,{})},ue=function(n){var r,a,u,p,f=n.columns,v=void 0===f?[]:f,x=n.dataSource,y=void 0===x?[]:x,b=n.rowKey,w=void 0===b?"key":b,C=n.rowSelection,F=n.pagination,k=void 0!==F&&F,S=n.size,D=void 0===S?"middle":S,E=n.bordered,A=void 0!==E&&E;n.loading;var L=n.locale,M=n.showHeader,z=void 0===M||M,B=n.title,T=n.footer,W=n.summary,N=n.scroll,I=n.tableLayout,R=void 0===I?"auto":I,j=n.onChange,H=n.onSorterChange,V=n.onPaginationChange,O=n.onRow,P=n.className,Y=void 0===P?"":P,q=n.style,Z=n.expandable,K=n.rowClassName,X=n.onHeaderRow;n.sticky;var G=g(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","style","expandable","rowClassName","onHeaderRow","sticky"]),J=l((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),_=J[0],U=J[1];s(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&U(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var Q=l(new Map),$=Q[0],ee=Q[1],te=l((null==Z?void 0:Z.defaultExpandedRowKeys)||[]),ne=te[0],oe=te[1],re=l(k&&"object"==typeof k&&(k.current||k.defaultCurrent)||1),ie=re[0],ue=re[1],pe=l(k&&"object"==typeof k&&(k.pageSize||k.defaultPageSize)||10),fe=pe[0],he=pe[1];s(function(){k&&"object"==typeof k&&(void 0!==k.current&&ue(k.current),void 0!==k.pageSize&&he(k.pageSize))},[k]);var ge=l(null),ve=ge[0],xe=ge[1],me=l(null),ye=me[0],be=me[1],we=l(!1),Ce=we[0],Fe=we[1],ke=c(null),Se=c(null);s(function(){var e=function(){Fe(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var De=d(function(e,t){var n,o,r,i=null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e);if(!(null==i?void 0:i.disabled)){var a,l=de(e,w);a="radio"===(null==C?void 0:C.type)?t?[l]:[]:t?m(m([],_,!0),[l],!1):_.filter(function(e){return e!==l}),U(a);var s=y.filter(function(e){return a.includes(de(e,w))});null===(o=null==C?void 0:C.onChange)||void 0===o||o.call(C,a,s),null===(r=null==C?void 0:C.onSelect)||void 0===r||r.call(C,e,t,s,new Event("select"))}},[_,w,C,y]),Ee=d(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}).map(function(e){return de(e,w)}),i=e?r:[];U(i);var a=y.filter(function(e){return i.includes(de(e,w))}),l=e?t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}):[];null===(n=null==C?void 0:C.onChange)||void 0===n||n.call(C,i,a),null===(o=null==C?void 0:C.onSelectAll)||void 0===o||o.call(C,e,a,l)},[w,C,y]),Ae=d(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:v.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),H&&H(1===r.length?r[0]:r),j&&j({current:ie,pageSize:fe},{},1===r.length?r[0]:r,{currentDataSource:y,action:"sort"})}},[$,j,H,ie,fe,y,v]);d(function(e,t){var n,o,r,i=de(e,w);r=t?m(m([],ne,!0),[i],!1):ne.filter(function(e){return e!==i}),oe(r),null===(n=null==Z?void 0:Z.onExpand)||void 0===n||n.call(Z,t,e),null===(o=null==Z?void 0:Z.onExpandedRowsChange)||void 0===o||o.call(Z,r)},[ne,w,Z]);var Le=d(function(){var e=m([],y,!0);return $.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=v.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=se(e,r.dataIndex||n),l=se(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},[y,$,v]),Me=Le(),ze=i(function(){if(!1===k||!k)return Me;var e=(ie-1)*fe,t=e+fe;return Me.slice(e,t)},[Me,ie,fe,k]),Be=d(function(e,t){var n,o,r=null!=t?t:fe;if(ue(e),t&&he(t),V&&V(e,r),k&&"object"==typeof k&&(null===(n=k.onChange)||void 0===n||n.call(k,e,t),t&&(null===(o=k.onShowSizeChange)||void 0===o||o.call(k,e,t))),j){var i=Array.from($.entries()).map(function(e){var t=e[0],n=e[1];return{column:v.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});j({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:Me,action:"paginate"})}},[k,V,j,fe,$,v,Me]),Te=d(function(e,t,n){var o=se(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),We=d(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(C&&("left"===C.fixed||!0===C.fixed))r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=v[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<v.length;i++){var a;if("right"===(a=v[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(C&&"right"===C.fixed)r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return r}}},[v,C]),Ne=d(function(){if(!z)return null;var n,o,r,i,a=v.map(function(n,o){var r,i=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||o,a=$.get(i)||null,l=We(o,n.fixed,!0),s=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e("th",h({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:s,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:s||void 0,maxWidth:s,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(r=n.onHeaderCell)||void 0===r?void 0:r.call(n,n))||{},{children:t("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:a,sortColumn:n}):n.title}),n.sorter&&e("button",{onClick:function(){Ae(n,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(ce,{order:a||void 0})})]})}),i)});if(C){var l="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",s=e("th",{style:{width:l,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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:t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!C.hideSelectAll&&"radio"!==C.type&&(n=ze.filter(function(e){var t;return!(null===(t=C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}),o=n.map(function(e){return de(e,w)}),r=n.length>0&&o.every(function(e){return _.includes(e)}),i=o.some(function(e){return _.includes(e)}),e(le,{checked:r,indeterminate:i&&!r,onChange:function(e){return Ee(e.target.checked,ze)}})),C.columnTitle&&e("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");a.unshift(s)}var d=null==X?void 0:X(v,0);return e("thead",{ref:Se,children:e("tr",h({},d||{},{children:a}))})},[v,z,$,C,_,ze,w,Ae,Ee,L,X,We]),Ie=d(function(e){xe(e)},[]),Re=d(function(e,t){e.preventDefault(),be(t)},[]),je=d(function(e,t){if(e.preventDefault(),null===ve||ve===t)return xe(null),void be(null);var n=m([],ze,!0),o=n[ve];n.splice(ve,1),n.splice(t,0,o),xe(null),be(null)},[ve,ze]),He=d(function(){xe(null),be(null)},[]),Ve=d(function(){return ze.map(function(n,r){var i,a=de(n,w),l=_.includes(a),s=ne.includes(a),d=(null==O?void 0:O(n,r))||{},c=r===ze.length-1;return t(o.Fragment,{children:[t("tr",h({className:"".concat("function"==typeof K?K(n,r):K||""," ").concat(ve===r?"dragging":""," ").concat(ye===r?"drag-over":""),draggable:!0,onDragStart:function(){return Ie(r)},onDragOver:function(e){return Re(e,r)},onDrop:function(e){return je(e,r)},onDragEnd:He,style:h({cursor:"move",opacity:ve===r?.5:1,backgroundColor:ye===r?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ve!==r&&ye!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==r&&ye!==r&&(e.currentTarget.style.backgroundColor="white")}},d,{children:[C&&e("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e(le,{checked:l,onChange:function(e){return De(n,e.target.checked)},disabled:null===(i=C.getCheckboxProps)||void 0===i?void 0:i.call(C,n).disabled})})}),v.map(function(t,o){var i,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||o,l=(null===(i=t.onCell)||void 0===i?void 0:i.call(t,n,r))||{},s=We(o,t.fixed,!1),d=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e("td",h({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:h({width:d,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:d||void 0,maxWidth:d,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,right:"right"===t.fixed?void 0!==s?"".concat(s,"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"},l.style),colSpan:t.colSpan,rowSpan:t.rowSpan},l,{children:Te(t,n,r)}),a)})]})),(null==Z?void 0:Z.expandedRowRender)&&s&&e("tr",{children:e("td",{colSpan:v.length+(C?1:0),children:Z.expandedRowRender(n,r,0,!0)})})]},a)})},[ze,w,_,ne,C,v,O,K,De,Te,Z,ve,ye,Ie,Re,je,He,We]),Oe=function(){var t;if(!1===k||!k)return null;var n=null!==(t=k.total)&&void 0!==t?t:Me.length,o=k.position||"bottomRight";return e("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e(ae,{current:ie,total:n,pageSize:fe,showSizeChanger:k.showSizeChanger,pageSizeOptions:k.pageSizeOptions,showQuickJumper:k.showQuickJumper,showTotal:k.showTotal,onChange:Be,onShowSizeChange:Be,simple:k.simple,responsive:k.responsive,size:"small"===D?"small":"default"})})},Pe=i(function(){return v.some(function(e){return e.fixed})||C&&C.fixed},[v,C]),Ye=i(function(){return v.every(function(e){return e.width})&&(!C||C.columnWidth)},[v,C]),qe=i(function(){if(null==N?void 0:N.x){if("number"==typeof N.x)return N.x;if(!0===N.x)return v.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if(Pe)return v.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)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[v,null==N?void 0:N.x,C,Pe]),Ze=i(function(){return"fixed"===R||Pe||Ye||v.some(function(e){return e.width})?"fixed":R},[R,Pe,Ye,v]),Ke={width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ze,backgroundColor:"white",borderRadius:"8px",border:"1px solid #EAECF0"},Xe=h({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==N?void 0:N.y)?"".concat(N.y,"px"):void 0,borderRadius:"8px"},q);if(Ce)return t("div",h({ref:ke,className:"aha-table aha-table-mobile-wrapper ".concat(Y),style:Xe},G,{children:[B&&e("div",{style:{marginBottom:"16px"},children:B(Me)}),k&&"object"==typeof k&&(null===(r=k.position)||void 0===r?void 0:r.startsWith("top"))&&Oe(),e("div",{className:"aha-table-mobile",children:ze.map(function(n,o){var r,i=de(n,w),a=_.includes(i);return t("div",{className:"aha-table-mobile-row ".concat(a?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:a?"#e6f7ff":"white"},children:[C&&e("div",{style:{marginBottom:"8px"},children:e(le,{checked:a,onChange:function(e){return De(n,e.target.checked)},disabled:null===(r=C.getCheckboxProps)||void 0===r?void 0:r.call(C,n).disabled})}),v.map(function(r){var i=r.key||(Array.isArray(r.dataIndex)?r.dataIndex.join("."):r.dataIndex),a=se(n,r.dataIndex||""),l=r.render?r.render(a,n,o):a;return t("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[t("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof r.title?r.title({}):r.title,":"]}),e("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})}),T&&e("div",{style:{marginTop:"16px"},children:T(Me)}),k&&("object"!=typeof k||!(null===(a=k.position)||void 0===a?void 0:a.startsWith("top")))&&Oe()]}));var Ge={position:"relative",overflowX:(null==N?void 0:N.x)||Pe?"auto":"visible",overflowY:(null==N?void 0:N.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==N?void 0:N.x)?"100%":"number"==typeof(null==N?void 0:N.x)?"".concat(N.x,"px"):void 0,maxHeight:"number"==typeof(null==N?void 0:N.y)?"".concat(N.y,"px"):void 0,borderRadius:"8px"};return t("div",h({ref:ke,className:"aha-table ".concat(Y),style:Xe},G,{children:[B&&e("div",{style:{marginBottom:"16px"},children:B(Me)}),k&&"object"==typeof k&&(null===(u=k.position)||void 0===u?void 0:u.startsWith("top"))&&Oe(),e("div",{style:Ge,children:e("div",{style:{width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",display:"block"},children:t("table",{style:Ke,className:A?"bordered":"",children:[Ne(),e("tbody",{children:Ve()}),W&&e("tfoot",{children:e("tr",{children:e("td",{colSpan:v.length+(C?1:0),children:W(Me)})})})]})})}),T&&e("div",{style:{marginTop:"16px"},children:T(Me)}),k&&("object"!=typeof k||!(null===(p=k.position)||void 0===p?void 0:p.startsWith("top")))&&Oe()]}))},pe=function(n){var o=n.checked,r=void 0!==o&&o,i=n.disabled,a=void 0!==i&&i,l=n.onChange,s=n.className,d=void 0===s?"":s,c=n.style,u=n.children,p=n.value,f=n.name,g=C().primaryColor,v=void 0===g?"#FB6011":g,x=a?"#FAFAF9":r?v:"white",m=a?"#FAFAF9":r?v:"#D7D3D0";return t("div",{className:"aha-radio ".concat(d),style:h({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},c),onClick:function(e){a||(null==l||l({target:{checked:!r,value:p},currentTarget:{checked:!r,value:p}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"white",opacity:r?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),u&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:u}),e("input",{type:"radio",checked:r,onChange:l,disabled:a,value:p,name:f,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};pe.displayName="Radio";var fe=function(n){var r=n.items,a=void 0===r?[]:r,u=n.variant,p=void 0===u?"underline":u,f=n.layout,v=void 0===f?"equal":f,x=n.defaultValue,m=n.value,y=n.onChange,b=n.className,w=void 0===b?"":b,F=n.mode,k=void 0===F?"children":F,S=n.scrollable,D=void 0!==S&&S,E=g(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),A=C().primaryColor;if(!a||0===a.length)return null;var L=i(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]),M=void 0!==m,z=L.length>0?L[0].key:"",B=function(e){if(void 0===e)return z;var t=L.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:z},T=l(function(){var e,t=null!==(e=null!=m?m:x)&&void 0!==e?e:z;return B(t)}),W=T[0],N=T[1],I=M?void 0!==m?B(m):z:W;s(function(){console.log("[Tab Debug] currentValue:",I,"type:",typeof I),console.log("[Tab Debug] normalizedItems:",L.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",m,"isControlled:",M)},[I,L,m,M]);var R=d(function(e,t){if(!t){M||N(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==y||y(n),D&&"underline"===p){var o=V.current[O(e)],r=q.current;if(o&&r){X.current=!0;var i,l=function(){if(r&&P.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;_({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},s=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),X.current=!1,r.removeEventListener("scroll",s)},150)};r.addEventListener("scroll",s,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[M,y,a,D,p]),j=L.find(function(e){if(e.key===I)return!0;if(String(e.key)===String(I))return!0;var t=Number(e.key),n=Number(I);return!isNaN(t)&&!isNaN(n)&&t===n}),H=A||"#FB6011",V=c({}),O=function(e){return String(e)},P=c(null),Y=c(null),q=c(null),Z=c(null),K=c("");c(new Set);var X=c(!1),G=l({width:0,left:0,opacity:0}),J=G[0],_=G[1],U=l({width:0,left:0,opacity:0}),Q=U[0],$=U[1],ee=d(function(){"underline"===p&&q.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(P.current&&q.current){var e=V.current[O(I)];if(!e&&L.length>0){var t=L[0].key;e=V.current[O(t)]}if(e){var n=q.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=q.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),s="".concat(a,"px");_(function(e){return e.left===l&&e.width===s&&1===e.opacity?e:{width:s,left:l,opacity:1}})}}}})})},[p,I,L]),te=d(function(){"background"===p&&Z.current&&Y.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(Y.current&&Z.current){var e=V.current[O(I)];if(!e&&L.length>0){var t=L[0].key;e=V.current[O(t)]}if(e){var n=Z.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");$(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[p,I,L]);s(function(){I?K.current!==I&&(K.current=I,"underline"===p&&q.current&&!X.current&&ee(),"background"===p&&Z.current&&Y.current&&te()):K.current=""},[I,p,L.length,M,ee,te]),s(function(){if(I){var e=setTimeout(function(){if("underline"===p)(e=V.current[O(I)])&&q.current&&P.current&&(ee(),D&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===p){var e;if((e=V.current[O(I)])&&Z.current&&Y.current){var t=Z.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");$({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),s(function(){if(D&&"underline"===p&&I&&!X.current){var e=setTimeout(function(){var e=V.current[O(I)],t=q.current;if(e&&t){X.current=!0;var n,o=function(){if(t&&P.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;_({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),X.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)}}},[I,D,p]);var ne;return t("div",{className:"aha-tab-container",children:["underline"===p?(ne={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},D&&(ne.overflowX="auto",ne.overflowY="hidden",ne.scrollBehavior="smooth",ne.scrollbarWidth="none",ne.WebkitOverflowScrolling="touch"),t("div",h({ref:q,className:"aha-tab aha-tab--underline ".concat(D?"aha-tab--scrollable":""," ").concat(w),style:ne},E,{children:[e("div",{ref:P,style:h({position:"absolute",bottom:"-1px",height:"2px",backgroundColor:H,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"},J)}),L.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===L[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p}),t("div",{ref:function(e){V.current[O(n.key)]=e},onClick:function(){return R(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:D?0:void 0,whiteSpace:D?"nowrap":void 0},children:[n.icon&&function(){var t,i=typeof n.icon,a=o.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:i,isReactElement:a,iconValue:n.icon}),o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:20,height:20,style:h(h({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?H:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:20,height:20,style:{color:r?H:"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?H:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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"===v?"100%":"fit-content",t("div",h({ref:Z,className:"aha-tab aha-tab--background aha-tab--".concat(v," ").concat(w),style:n},E,{children:[e("div",{ref:Y,style:h({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"},Q)}),L.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===L[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p});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"===v?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return t("div",{ref:function(e){V.current[O(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:i,children:[n.icon&&function(){var t;return o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:16,height:16,style:h(h({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:16,height:16,style:{color:r?"#44403C":"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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)})]}))}(),D&&"underline"===p&&e("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===k&&(null==j?void 0:j.children)&&e("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:j.children})]})},he=function(o){var r=o.percent,i=void 0===r?0:r,a=o.type,d=void 0===a?"circle":a,u=o.width,p=void 0===u?120:u,f=o.title,v=o.titlePosition,x=o.showPercent,m=void 0===x||x,y=o.animated,b=void 0!==y&&y,w=o.status,F=void 0===w?"normal":w,k=o.className,S=void 0===k?"":k,D=o.style,E=o.strokeColor,A=o.trailColor,L=void 0===A?"#F5F5F4":A,M=g(o,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),z=C().primaryColor,B=Math.min(100,Math.max(0,i)),T=c(!0),W=l(!1),N=W[0],I=W[1],R=l(0),j=R[0],H=R[1];s(function(){if(b&&T.current&&B>0){T.current=!1,H(0),I(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){H(B)})});var e=setTimeout(function(){I(!1),H(B)},300);return function(){return clearTimeout(e)}}T.current?(T.current=!1,I(!1),H(B)):H(B)},[b,B]);var V=E||z||"#FB6011";"success"===F?V="#00BC7D":"exception"===F&&(V="#FB2C36");var O=v||"inside",P=Math.max(4,Math.round(.06*p)),Y=(p-P)/2,q="semicircle"===d?p/2:p,Z="14px",K="12px",X=function(){var o=f&&"outside"===O?p+4+18+4:p,r=2*Math.PI*Y,i=r-(N?j:B)/100*r;return t("div",{style:{position:"relative",width:p,height:o,display:"flex",alignItems:"center",justifyContent:"center"},children:[t("svg",{width:p,height:p,style:{position:"absolute",top:0,left:0},children:[e("circle",{cx:p/2,cy:p/2,r:Y,fill:"none",stroke:L,strokeWidth:P,strokeLinecap:"round"}),e("circle",{cx:p/2,cy:p/2,r:Y,fill:"none",stroke:V,strokeWidth:P,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:i,transform:"rotate(-90 ".concat(p/2," ").concat(p/2,")"),style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("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("div",{style:{fontSize:Z,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:K,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:K,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:Z,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]})},G=h({display:"inline-flex",flexDirection:"column",alignItems:"center",width:p},D);return e("div",h({className:"aha-progress aha-progress--".concat(d," ").concat(S),style:G},M,{children:function(){switch(d){case"circle":return X();case"semicircle":return r=P/2,i=p-P/2,a=(o=q+P)-P/2,l=q/2+P/2+P/2,s=f&&"outside"===O?o+4+18+4:o,c=Math.PI*Y,u=c-(N?j:B)/100*c,t("div",{style:{position:"relative",width:p,height:s,overflow:"hidden"},children:[t("svg",{width:p,height:o,viewBox:"0 0 ".concat(p," ").concat(o),style:{position:"absolute",top:0,left:0},children:[e("path",{d:"M ".concat(r," ").concat(a," A ").concat(Y," ").concat(Y," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:L,strokeWidth:P,strokeLinecap:"round"}),e("path",{d:"M ".concat(r," ").concat(a," A ").concat(Y," ").concat(Y," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:V,strokeWidth:P,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:u,style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:Z,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:K,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:K,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(o,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:Z,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]});default:return console.warn('Progress type "'.concat(d,'" is not supported yet, using "circle" as fallback')),X()}var o,r,i,a,l,s,c,u}()}))},ge=u(function(r,i){var a=r.size,l=void 0===a?"medium":a,d=r.disabled,u=void 0!==d&&d,p=r.error,f=void 0!==p&&p,v=r.readOnly,x=void 0!==v&&v,m=r.prefix,y=r.suffix,b=r.allowClear,w=void 0!==b&&b,F=r.onClear,k=r.className,S=void 0===k?"":k,D=r.style,E=r.type,A=void 0===E?"text":E,L=r.placeholder,M=r.value,z=r.defaultValue,B=r.onChange,T=r.onFocus,W=r.onBlur,N=r.onPressEnter,I=g(r,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),R=C().primaryColor,j=void 0===R?"#FB6011":R,H=c(null),V=o.useState(z||M||""),O=V[0],P=V[1],Y=o.useState(!1),q=Y[0],Z=Y[1];s(function(){"function"==typeof i?i(H.current):i&&(i.current=H.current)},[i]);var K=void 0!==M,X=K?M:O,G=function(e){var t;e.stopPropagation(),K||P("");null==B||B({target:{value:""},currentTarget:{value:""}}),null==F||F(),null===(t=H.current)||void 0===t||t.focus()},J=w&&X&&!u,_={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},U=y||J?"40px":"12px",Q=h({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(f?"#F04438":q?j:"#D7D3D0"),backgroundColor:u||x?"#FAFAF9":"#FFFFFF",color:u?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:m?"40px":"12px",paddingRight:U,paddingTop:_[l].paddingTop,paddingBottom:_[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},D);return t(n,{children:[e("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-moz-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input:-ms-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\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"] {\n -moz-appearance: textfield;\n }\n '}),t("div",{className:"aha-input-wrapper ".concat(S),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[m&&e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:u?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:m}),e("input",h({ref:H,type:A,value:X,placeholder:L,disabled:u,readOnly:x,onChange:function(e){K||P(e.target.value),null==B||B(e)},onFocus:function(e){Z(!0),null==T||T(e)},onBlur:function(e){Z(!1),null==W||W(e)},onKeyDown:function(e){var t;"Enter"===e.key&&N&&N(e),null===(t=I.onKeyDown)||void 0===t||t.call(I,e)},style:Q,autoComplete:I.autoComplete||"off",autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1},I)),(y||J)&&t("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:u?"#98A2B3":"#78716C",zIndex:1},children:[J&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:G,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),y&&e("span",{style:{pointerEvents:"none"},children:y})]})]})]})});ge.displayName="Input";var ve=u(function(r,i){var a=r.disabled,l=void 0!==a&&a,d=r.error,u=void 0!==d&&d,p=r.readOnly,f=void 0!==p&&p,v=r.showCount,x=void 0!==v&&v,m=r.maxLength,y=r.className,b=void 0===y?"":y,w=r.style,F=r.placeholder,k=r.value,S=r.defaultValue,D=r.rows,E=void 0===D?3:D,A=r.autoSize,L=void 0!==A&&A,M=r.onChange,z=r.onFocus,B=r.onBlur,T=g(r,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),W=C().primaryColor,N=void 0===W?"#FB6011":W,I=c(null),R=o.useState(S||k||""),j=R[0],H=R[1],V=o.useState(!1),O=V[0],P=V[1],Y=o.useState(void 0),q=Y[0],Z=Y[1];s(function(){"function"==typeof i?i(I.current):i&&(i.current=I.current)},[i]);var K=void 0!==k,X=K?k:j,G=String(X||"").length;s(function(){if(L&&I.current){var e=I.current,t="object"==typeof L&&L.minRows||1,n="object"==typeof L?L.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"),Z(l)}},[X,L]);var J=h(h({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(u?"#F04438":O?N:"#D7D3D0"),backgroundColor:l||f?"#FAFAF9":"#FFFFFF",color:l?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",padding:"12px 14px",boxShadow:"0 1px 2px rgba(10, 13, 18, 0.05)",transition:"all 0.2s",outline:"none",resize:L?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==q&&L?{height:"".concat(q,"px")}:{}),w);return t(n,{children:[e("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-moz-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea:-ms-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n "}),t("div",{className:"aha-textarea-wrapper ".concat(b),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e("textarea",h({ref:I,value:X,placeholder:F,disabled:l,readOnly:f,rows:L?void 0:E,maxLength:m,onChange:function(e){K||H(e.target.value),null==M||M(e)},onFocus:function(e){P(!0),null==z||z(e)},onBlur:function(e){P(!1),null==B||B(e)},style:J,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(x||m)&&e("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:m?t("span",{children:[G," / ",m]}):e("span",{children:G})})]})]})});ve.displayName="Textarea";var xe=function(n){var r=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,d=n.onChange,c=n.onClick,u=n.checkedChildren,p=n.unCheckedChildren,f=n.size,g=void 0===f?"default":f,v=n.loading,x=void 0!==v&&v,m=n.className,y=void 0===m?"":m,b=n.style,w=C().primaryColor,F=void 0===w?"#FB6011":w,k=o.useState(a),S=k[0],D=k[1],E=void 0!==r,A=E?r:S,L={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[g],M=A||x,z=s?"#E7E5E4":M?F:"#F5F5F4",B=M?"calc(100% - ".concat(L.thumbSize," - ").concat(L.thumbOffset,")"):L.thumbOffset;return t("button",{type:"button",role:"switch","aria-checked":A,disabled:s||x,onClick:function(e){if(!s&&!x){var t=!A;E||D(t),null==d||d(t,e),null==c||c(t,e)}},className:"aha-switch ".concat(y),style:h({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:L.width,height:L.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===g?"10px":"12px",backgroundColor:z,cursor:s||x?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(u||p)&&e("span",{style:{position:"absolute",left:M?"6px":"auto",right:M?"auto":"6px",fontSize:L.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?u:p}),e("span",{style:{position:"absolute",left:B,top:"50%",transform:"translateY(-50%)",width:L.thumbSize,height:L.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:x&&t("svg",{width:"small"===g?"8":"10",height:"small"===g?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};xe.displayName="Switch";var me=function(r){var a,u=r.value,p=r.defaultValue,g=r.options,v=void 0===g?[]:g,x=r.mode,y=r.disabled,b=void 0!==y&&y,w=r.error,F=void 0!==w&&w,k=r.placeholder,S=void 0===k?"Please select":k,D=r.size,E=void 0===D?"medium":D,A=r.showSearch,L=void 0!==A&&A,M=r.filterOption,z=void 0===M||M,B=r.allowClear,T=void 0!==B&&B,W=r.onChange,N=r.onSelect,I=r.onDeselect,R=r.onSearch,j=r.onFocus,H=r.onBlur,V=r.onDropdownVisibleChange,O=r.className,P=void 0===O?"":O,Y=r.style,q=r.dropdownClassName,Z=void 0===q?"":q,K=r.dropdownStyle,X=r.defaultOpen,G=void 0!==X&&X,J=r.open,_=r.maxTagCount,U=r.tagRender,Q=r.optionRender,$=C().primaryColor,ee=void 0===$?"#FB6011":$,te=l(void 0!==p?p:x?[]:void 0),ne=te[0],oe=te[1],re=l(G),ie=re[0],ae=re[1],le=l(""),se=le[0],de=le[1],ce=l(-1),ue=ce[0],pe=ce[1],fe=c(null),he=c(null),ge=c(null),ve=l(null),xe=ve[0],me=ve[1],ye=void 0!==u,be=void 0!==J,we=ye?u:ne,Ce=be?J:ie,Fe="multiple"===x||"tags"===x,ke=d(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return v.filter(function(t){return e.includes(t.value)})},[we,v]),Se=d(function(){return L&&se?!1===z?v:"function"==typeof z?v.filter(function(e){return z(se,e)}):v.filter(function(e){var t=String(e.label||"").toLowerCase(),n=se.toLowerCase();return t.includes(n)}):v},[v,se,L,z]),De=i(function(){return Se()},[Se]);s(function(){if(Ce&&fe.current){var e=function(){if(fe.current){var e=fe.current.getBoundingClientRect();me({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[Ce]),s(function(){var e=function(e){var t=e.target;fe.current&&!fe.current.contains(t)&&ge.current&&!ge.current.contains(t)&&(be||ae(!1),null==V||V(!1),de(""))};if(Ce)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Ce,be,V]),s(function(){if(Ce){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<De.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),pe(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ue>=0){e.preventDefault();var n=De[ue];n&&!n.disabled&&Ee(n)}else"Escape"===e.key&&(e.preventDefault(),be||ae(!1),null==V||V(!1),null===(t=fe.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Ce,De,ue,be,V]),s(function(){if(ue>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var Ee=d(function(e){var t;if(!e.disabled)if(Fe){var n,o=Array.isArray(we)?we:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==I||I(e.value,e)):(n=m(m([],o,!0),[e.value],!1),null==N||N(e.value,e)),ye||oe(n);var r=v.filter(function(e){return n.includes(e.value)});null==W||W(n,r)}else ye||oe(e.value),null==W||W(e.value,e),null==N||N(e.value,e),be||ae(!1),null==V||V(!1),de(""),null===(t=fe.current)||void 0===t||t.focus()},[Fe,we,ye,be,v,W,N,I,V]),Ae=d(function(e,t){if(e.stopPropagation(),Fe&&Array.isArray(we)){var n=we.filter(function(e){return e!==t}),o=v.find(function(e){return e.value===t});ye||oe(n),null==W||W(n,ke()),null==I||I(t,o)}},[Fe,we,ye,v,W,I,ke]),Le=function(e){e.stopPropagation();var t=Fe?[]:void 0;ye||oe(t),null==W||W(t,[]),de("")},Me={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"}},ze=i(function(){return ke()},[ke]),Be=i(function(){return T&&we&&!b},[T,we,b]),Te=i(function(){return Fe?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Fe,we]),We=i(function(){if(!Fe||!Array.isArray(we)||0===we.length)return null;var n="responsive"===_?ze.slice(0,2):_?ze.slice(0,_):ze,r=_&&ze.length>n.length?ze.length-n.length:0;return t("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var r={label:n.label,value:n.value,closable:!b,onClose:function(){return Ae({},n.value)}};return U?e(o.Fragment,{children:U(r)},n.value):t("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("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!b&&e("span",{onClick:function(e){return Ae(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),r>0&&t("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",r]})]})},[Fe,we,ze,_,b,U]);return t(n,{children:[e("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 "}),t("div",{ref:fe,className:"aha-select ".concat(P),style:h({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(F?"#F04438":Ce?ee:"#D7D3D0"),backgroundColor:b?"#FAFAF9":"#FFFFFF",cursor:b?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Me[E].paddingTop,paddingBottom:Me[E].paddingBottom,fontSize:Me[E].fontSize,lineHeight:Me[E].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},Y),onClick:function(){if(!b){var e=!Ce;be||ae(e),null==V||V(e),e&&L?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):de("")}},onFocus:function(e){null==j||j(e)},onBlur:function(e){null==H||H(e)},onTouchStart:function(e){b||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:b?-1:0,children:[e("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:Fe?We||e("span",S?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:S}:{style:{flex:1,minHeight:"24px"}}):L&&Ce?e("input",{ref:he,type:"text",value:se,onChange:function(e){var t=e.target.value;de(t),null==R||R(t),pe(-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:b?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Te?void 0:S,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Te?b?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Te?(null===(a=ze[0])||void 0===a?void 0:a.label)||we:S||" "})}),t("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Be&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Le,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e(function(t){var n=t.isOpen;return e("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("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Ce})]})]}),Ce&&xe&&f(e("div",{ref:ge,className:"aha-select-dropdown ".concat(Z),style:h({position:"absolute",top:"".concat(xe.top,"px"),left:"".concat(xe.left,"px"),width:"".concat(xe.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:"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},K),children:0===De.length?e("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):De.map(function(n,o){var r=Fe?Array.isArray(we)&&we.includes(n.value):we===n.value,i=o===ue;return Q?e("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&Ee(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Q(n,{selected:r,focused:i,disabled:n.disabled||!1})},n.value):t("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return Ee(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.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("span",{children:n.label}),r&&e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:e("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};me.displayName="Select";var ye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],be=["January","February","March","April","May","June","July","August","September","October","November","December"],we=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"),be[o]).replace(new RegExp("","g"),ye[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},Ce=function(e,t){return new Date(e,t+1,0).getDate()},Fe=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},ke=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},Se=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i},De=function(o){var r=o.mode,a=void 0===r?"date":r,u=o.disabled,p=void 0!==u&&u,g=o.error,v=void 0!==g&&g,x=o.placeholder,m=void 0===x?"Select date":x,y=o.startPlaceholder,b=void 0===y?"Start date":y,w=o.endPlaceholder,F=void 0===w?"End date":w,k=o.size,S=void 0===k?"medium":k,D=o.allowClear,E=void 0!==D&&D,A=o.format,L=void 0===A?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":A,M=o.onFocus,z=o.onBlur,B=o.onOpenChange,T=o.className,W=void 0===T?"":T,N=o.style,I=o.dropdownClassName,R=void 0===I?"":I,j=o.dropdownStyle,H=o.defaultOpen,V=void 0!==H&&H,O=o.open,P=o.minDate,Y=o.maxDate,q=o.separator,Z=void 0===q?" - ":q,K=o.presetRanges,X=void 0!==K&&K,G=o.calendarCount,J=void 0===G?1:G,_=o.showApplyCancel,U=void 0!==_&&_,Q=o.applyText,$=void 0===Q?"Apply":Q,ee=o.cancelText,te=void 0===ee?"Cancel":ee,ne=o.onApply,oe=o.onCancel,re=C().primaryColor,ie=void 0===re?"#FB6011":re,ae="range"===a,le=l(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),se=le[0],de=le[1],ce=l(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),ue=ce[0],pe=ce[1],fe=l(V),he=fe[0],ge=fe[1],ve=l(!0),xe=ve[0],me=ve[1],ye=l(null),De=ye[0],Ee=ye[1],Ae=l(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()}}),Le=Ae[0],Me=Ae[1],ze=l(function(){if(2===J&&ae){var e=new Date(Le.year,Le.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Be=ze[0],Te=ze[1];s(function(){if(2===J&&ae){var e=new Date(Le.year,Le.month+1,1);Te({year:e.getFullYear(),month:e.getMonth()})}else Te(null)},[Le,J,ae]);var We=c(null),Ne=c(null),Ie=c(null),Re=c(null),je=c(null),He=l(null),Ve=He[0],Oe=He[1],Pe=c(!1),Ye="value"in o&&void 0!==o.value,qe=void 0!==O,Ze=ae?null:Ye&&"date"===a&&"value"in o?o.value:se,Ke=ae?Ye&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:ue:{startDate:null,endDate:null},Xe=qe?O:he;s(function(){if(Xe&&!Pe.current){if(ae){var e=Ke.startDate||Ke.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Le.year===t&&Le.month===n||Me({year:t,month:n})}}else if(Ze){t=Ze.getFullYear(),n=Ze.getMonth();Le.year===t&&Le.month===n||Me({year:t,month:n})}Pe.current=!0}else Xe||(Pe.current=!1)},[Xe,Ze,Ke,ae,Le]),s(function(){if(Xe&&We.current){var e=function(){if(We.current){var e=We.current.getBoundingClientRect();Oe({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Oe(null)},[Xe]),s(function(){var e=function(e){var t=e.target;We.current&&!We.current.contains(t)&&je.current&&!je.current.contains(t)&&(qe||ge(!1),null==B||B(!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,qe,B]);var Ge,Je=d(function(e){var t;ke(e,P,Y)&&(Ye||de(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),qe||ge(!1),null==B||B(!1))},[Ye,qe,a,o,B,P,Y]),_e=d(function(e){var t;if(ke(e,P,Y)){var n,r=U&&De?De:Ke;xe?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},me(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(me(!0),U||(qe||ge(!1),null==B||B(!1))):me(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},me(!1)):(n={startDate:r.startDate,endDate:e},me(!0),U||(qe||ge(!1),null==B||B(!1))),U?Ee(n):(Ye||pe(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[xe,Ke,De,U,Ye,qe,a,o,B,P,Y]),Ue=function(e){var t,n;if(e.stopPropagation(),ae){var r={startDate:null,endDate:null};Ye||pe(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),me(!0)}else Ye||de(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null))},Qe=function(){if(!p){var e=!Xe;qe||ge(e),null==B||B(e),e&&ae?(me(!Ke.startDate),U&&Ee(Ke)):!e&&U&&Ee(null)}},$e=i(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}}]},[]),et=function(e){var t;U?Ee(e):(Ye||pe(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),qe||ge(!1),null==B||B(!1))},tt=function(){Me(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},nt=function(){Me(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},ot=d(function(e,t){for(var n=Ce(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),rt=i(function(){return ot(Le.year,Le.month)},[Le,ot]),it=i(function(){return 2===J&&ae&&Be?ot(Be.year,Be.month):null},[J,ae,Be,ot]),at=function(){Be&&Te(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},lt=function(){Be&&Te(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},st={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"}},dt=E&&!p&&(ae?Ke.startDate||Ke.endDate:Ze),ct=Ze?we(Ze,L):"",ut=Ke.startDate?we(Ke.startDate,L):"",pt=Ke.endDate?we(Ke.endDate,L):"",ft=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return t(n,{children:[e("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 "}),t("div",{ref:We,className:"aha-date-picker ".concat(W),style:h({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(v?"#F04438":Xe?ie:"#D7D3D0"),backgroundColor:p?"#FAFAF9":"#FFFFFF",cursor:p?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:"36px",paddingTop:st[S].paddingTop,paddingBottom:st[S].paddingBottom,fontSize:st[S].fontSize,lineHeight:st[S].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:Qe,onFocus:function(e){null==M||M(e)},onBlur:function(e){null==z||z(e)},tabIndex:p?-1:0,children:[e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:p?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})})},{})}),ae?t("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e("input",{ref:Ie,type:"text",value:ut,readOnly:!0,placeholder:b,disabled:p,onClick:function(e){e.stopPropagation(),p||(me(!0),Xe||Qe())},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":Ke.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e("span",{style:{color:p?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:Z}),e("input",{ref:Re,type:"text",value:pt,readOnly:!0,placeholder:F,disabled:p,onClick:function(e){e.stopPropagation(),p||(me(!1),Xe||Qe())},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":Ke.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e("input",{ref:Ne,type:"text",value:ct,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||Qe()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":Ze?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),t("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[dt&&e(function(){return e("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("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e(function(t){var n=t.isOpen;return e("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("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Xe})]})]}),Xe&&Ve&&f(e("div",{ref:je,className:"aha-date-picker-dropdown ".concat(R),style:h({position:"absolute",top:"".concat(Ve.top,"px"),left:"".concat(Ve.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:"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},j),children:t("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:ae&&X&&1===J?"column":"row"},children:[ae&&X&&2===J&&e("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:U?"0":"8px"},children:$e.map(function(t,n){var o=De?Fe(t.range.startDate,De.startDate)&&Fe(t.range.endDate,De.endDate):Fe(t.range.startDate,Ke.startDate)&&Fe(t.range.endDate,Ke.endDate);return e("div",{onClick:function(){return et(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?ie:"#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)})}),t("div",{children:[e("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===J?"row":"column",gap:2===J?"24px":"0"},children:(Ge=function(n,o,r,i,a){return void 0===a&&(a=0),t("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:2===J&&ae?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===J&&ae&&1===a)&&e("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===J&&ae?"absolute":"relative",left:2===J&&ae?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[be[n.month]," ",n.year]}),!(2===J&&ae&&0===a)&&e("button",{type:"button",onClick:i,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===J&&ae?"absolute":"relative",right:2===J&&ae?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),ae&&X&&1===J&&e("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:$e.map(function(t,n){var o=De?Fe(t.range.startDate,De.startDate)&&Fe(t.range.endDate,De.endDate):Fe(t.range.startDate,Ke.startDate)&&Fe(t.range.endDate,Ke.endDate);return e("button",{type:"button",onClick:function(){return et(t.range)},style:{padding:"4px 9px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?ie:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:ft.map(function(t){return e("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var r,i,a=(r=n.year,i=n.month,new Date(r,i,1).getDay()),l=(0===a?7:a)-1,s=[],d=0;d<l;d++)s.push(e("div",{},"empty-".concat(d)));return o.forEach(function(r,i){if(r){var a=l+i,d=r.getMonth()===n.month,c=Fe(r,new Date),u=!ke(r,P,Y);if(ae){var p=U&&De?De:Ke,f=Fe(r,p.startDate),h=Fe(r,p.endDate),g=Se(r,p.startDate,p.endDate),v=a%7==0,x=a%7==6,m=f,y=h,b=i>0?o[i-1]:null,w=i<o.length-1?o[i+1]:null;b&&Se(b,p.startDate,p.endDate),w&&Se(w,p.startDate,p.endDate);var C=i-7,F=i+7,k=C>=0?o[C]:null,S=F<o.length?o[F]:null;k&&Se(k,p.startDate,p.endDate),S&&Se(S,p.startDate,p.endDate);var D={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:u?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:u?.4:1,position:"relative",padding:0,margin:0};if(m||y)D.background=ie,D.borderRadius="50%",D.color="#FFFFFF",D.fontWeight=500;else if(g){D.background="#F5F5F4",D.color=d?u?"#D7D3D0":"#1C1917":"#78716C",D.fontWeight=400;var E=1===r.getDate(),A=Ce(n.year,n.month),L=r.getDate()===A,M=v||E,z=x||L;M&&z?D.borderRadius="18px":M?(D.borderTopLeftRadius="18px",D.borderBottomLeftRadius="18px",D.borderTopRightRadius="0",D.borderBottomRightRadius="0"):z?(D.borderTopRightRadius="18px",D.borderBottomRightRadius="18px",D.borderTopLeftRadius="0",D.borderBottomLeftRadius="0"):D.borderRadius="0"}else D.background="transparent",D.borderRadius="50%",D.color=d?u?"#D7D3D0":"#1C1917":"#78716C",D.fontWeight=400;s.push(t("button",{type:"button",disabled:u,onClick:function(){return _e(r)},style:D,onMouseEnter:function(e){u||m||y||(e.currentTarget.style.backgroundColor=g?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){m||y||(e.currentTarget.style.backgroundColor=g?"#F5F5F4":"transparent")},children:[r.getDate(),c&&!m&&!y&&!g&&e("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:ie}})]},"date-".concat(i)))}else{var B=Fe(r,Ze);s.push(t("button",{type:"button",disabled:u,onClick:function(){return Je(r)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:B?ie:"transparent",cursor:u?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:B?500:400,color:B?"#FFFFFF":d?u?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:u?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){u||B||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){B||(e.currentTarget.style.backgroundColor="transparent")},children:[r.getDate(),c&&!B&&e("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:ie}})]},"date-".concat(i)))}}}),s}()})]},a)},t(n,{children:[Ge(Le,rt,tt,nt,0),2===J&&ae&&Be&&it&&Ge(Be,it,at,lt,1)]}))}),ae&&U&&t("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[e("button",{type:"button",onClick:function(){Ee(null),null==oe||oe(),qe||ge(!1),null==B||B(!1)},style:{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:te}),e("button",{type:"button",onClick:function(){var e;De&&(Ye||pe(De),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,De)),null==ne||ne(De),qe||ge(!1),null==B||B(!1),Ee(null))},disabled:!De||!De.startDate||!De.endDate,style:{padding:"8px 16px",border:"none",borderRadius:"8px",background:De&&De.startDate&&De.endDate?ie:"#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=ie)},children:$})]})]})]})}),document.body)]})};De.displayName="DatePicker";var Ee=r(null),Ae=o.forwardRef(function(t,n){var o=t.initialValues,r=void 0===o?{}:o,a=t.onValuesChange,u=t.onFinish,f=t.onFinishFailed,g=t.labelWidth,m=void 0===g?"120px":g,y=t.labelAlign,b=void 0===y?"right":y,w=t.layout,C=void 0===w?"horizontal":w;t.size;var F=t.className,k=void 0===F?"":F,S=t.style,D=t.children,E=l(function(){var e={};return Object.keys(r).forEach(function(t){e[t]={value:r[t],error:void 0,touched:!1,validating:!1}}),e}),A=E[0],L=E[1],M=c(A);s(function(){M.current=A},[A]);var z=d(function(e){var t;return null===(t=M.current[e])||void 0===t?void 0:t.value},[]),B=d(function(e,t){L(function(n){var o=h({},n);if(o[e]?o[e]=h(h({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},M.current[e]?M.current[e]=h(h({},M.current[e]),{value:t}):M.current[e]={value:t,error:void 0,touched:!1,validating:!1},a){var r={};r[e]=t;var i={};Object.keys(o).forEach(function(e){i[e]=o[e].value}),a(r,i)}return o})},[a]),T=d(function(e){var t;return null===(t=M.current[e])||void 0===t?void 0:t.error},[]),W=d(function(e,t){M.current[e]&&(M.current[e]=h(h({},M.current[e]),{error:t})),L(function(n){var o=h({},n);return o[e]?o[e]=h(h({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),N=d(function(e){var t;return(null===(t=M.current[e])||void 0===t?void 0:t.touched)||!1},[]),I=d(function(e,t){M.current[e]&&(M.current[e]=h(h({},M.current[e]),{touched:t})),L(function(n){var o=h({},n);return o[e]?o[e]=h(h({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),R=d(function(e){var t;return(null===(t=M.current[e])||void 0===t?void 0:t.validating)||!1},[]),j=d(function(e,t){M.current[e]&&(M.current[e]=h(h({},M.current[e]),{validating:t})),L(function(n){var o=h({},n);return o[e]?o[e]=h(h({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),H=c();H.current=function(e,t){L(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 s=o[l],d=i[l];if((null==s?void 0:s.required)!==(null==d?void 0:d.required)||(null==s?void 0:s.message)!==(null==d?void 0:d.message)||(null==s?void 0:s.type)!==(null==d?void 0:d.type)||(null==s?void 0:s.pattern)!==(null==d?void 0:d.pattern)||(null==s?void 0:s.min)!==(null==d?void 0:d.min)||(null==s?void 0:s.max)!==(null==d?void 0:d.max)||(null==s?void 0:s.len)!==(null==d?void 0:d.len)||(null==s?void 0:s.whitespace)!==(null==d?void 0:d.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var c=h({},n);return c[e]?c[e]=h(h({},c[e]),{rules:t.rules,required:t.required}):c[e]={value:r[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},c})};var V=d(function(e,t){var n;null===(n=H.current)||void 0===n||n.call(H,e,t)},[]),O=d(function(e){L(function(t){var n=h({},t);return delete n[e],n})},[]),P=d(function(e){return v(void 0,void 0,void 0,function(){var t,n,o,r,i,a,l,s,d;return x(this,function(c){switch(c.label){case 0:if(!(t=M.current[e]))return[2,void 0];j(e,!0),n=t.rules||[],r=0,i=n,c.label=1;case 1:if(!(r<i.length))return[3,6];if(a=i[r],l=t.value,a.required&&(null==l||""===l))return o=a.message||"".concat(e," is required"),[3,6];if(a.type&&null!=l&&""!==l&&(s={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}}}[a.type])&&!s(l))return o=a.message||"".concat(e," must be a valid ").concat(a.type),[3,6];if(a.pattern&&null!=l&&""!==l&&!a.pattern.test(String(l)))return o=a.message||"".concat(e," format is invalid"),[3,6];if(void 0!==a.min&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))<a.min)return o=a.message||"".concat(e," must be at least ").concat(a.min),[3,6];if(void 0!==a.max&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))>a.max)return o=a.message||"".concat(e," must be at most ").concat(a.max),[3,6];if(void 0!==a.len&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))!==a.len)return o=a.message||"".concat(e," must be exactly ").concat(a.len),[3,6];if(a.whitespace&&"string"==typeof l&&l.trim()!==l)return o=a.message||"".concat(e," cannot be whitespace"),[3,6];if(!a.validator)return[3,5];c.label=2;case 2:return c.trys.push([2,4,,5]),[4,a.validator(a,l)];case 3:return c.sent(),[3,5];case 4:return d=c.sent(),o=(null==d?void 0:d.message)||a.message||"".concat(e," validation failed"),[3,6];case 5:return r++,[3,1];case 6:return M.current[e]?M.current[e]=h(h({},M.current[e]),{error:o,validating:!1,touched:!0}):M.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},L(function(n){var r=h({},n);return r[e]?r[e]=h(h({},r[e]),{error:o,validating:!1,touched:!0}):r[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},r}),[2,o]}})})},[]),Y=d(function(e){var t=M.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},[]),q=d(function(e){return v(void 0,void 0,void 0,function(){var t,n,o,r;return x(this,function(i){switch(i.label){case 0:return t=M.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return v(void 0,void 0,void 0,function(){var n,o;return x(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,P(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 i.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(i.sent(),o.length>0)throw r={values:Y(),errorFields:o},null==f||f(r),r;return[2,Y()]}})})},[P,Y,f]),Z=d(function(e){L(function(t){var n=h({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=h(h({},n[e]),{value:r[e],error:void 0,touched:!1,validating:!1}))}),n})},[r]),K=d(function(e){L(function(t){var n=h({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=h(h({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1}}),a){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),a(e,o)}return n})},[a]),X=d(function(){return v(void 0,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,q()];case 1:return e=t.sent(),null==u||u(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[q,u]);p(n,function(){return{getFieldValue:z,getFieldsValue:Y,setFieldValue:B,setFieldsValue:K,getFieldError:T,validateField:P,validateFields:q,resetFields:Z,submit:X}});var G=i(function(){return{fields:A,getFieldValue:z,setFieldValue:B,getFieldError:T,setFieldError:W,isFieldTouched:N,setFieldTouched:I,isFieldValidating:R,setFieldValidating:j,registerField:V,unregisterField:O,validateField:P,validateFields:q,resetFields:Z,getFieldsValue:Y,setFieldsValue:K,submit:X,labelWidth:m,labelAlign:b}},[A,z,B,T,W,N,I,R,j,V,O,P,q,Z,Y,K,X,m,b]),J=h({},S);return"vertical"===C?(J.display="flex",J.flexDirection="column"):"inline"===C&&(J.display="inline-flex",J.flexWrap="wrap",J.gap="16px"),e(Ee.Provider,{value:G,children:e("form",{className:"aha-form ".concat(k),style:J,onSubmit:function(e){return v(void 0,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,q()];case 2:return t=n.sent(),null==u||u(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:D})})});Ae.displayName="Form";var Le=Ae;Le.Item=function(n){var r=n.name,l=n.label,d=n.htmlFor;n.labelCol,n.wrapperCol;var u=n.required,p=void 0!==u&&u,f=n.rules,g=void 0===f?[]:f;n.hasFeedback;var v=n.validateStatus,x=n.help,m=n.extra,y=n.className,b=void 0===y?"":y,w=n.style,C=n.children;n.labelAlign,n.labelWidth;var F=n.hidden,k=void 0!==F&&F,S=n.tooltip,D=a(Ee),E=c(null),A=(null==D?void 0:D.fields)||{};r&&D&&D.getFieldValue(r);var L=r&&D?D.getFieldError(r):void 0,M=!(!r||!D)&&D.isFieldTouched(r),z=!(!r||!D)&&D.isFieldValidating(r);r&&A[r];var B=v||(L?"error":z?"validating":M&&!L?"success":void 0),T=void 0!==x?x:L||void 0,W=c(g),N=c(p),I=c(!1),R=p||g.some(function(e){return e.required}),j=i(function(){if(!I.current)return I.current=!0,!0;if(W.current.length!==g.length)return!0;if(W.current===g)return!1;for(var e=0;e<g.length;e++){var t=W.current[e],n=g[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},[g]);s(function(){if(r&&D)return(!W.current||j||N.current!==p)&&(W.current=g,N.current=p,D.registerField(r,{rules:g,required:R})),function(){r&&D&&D.unregisterField(r)}},[r]);if(k)return null;return t("div",{ref:E,className:"aha-form-item ".concat(b),style:h({display:"flex",flexDirection:"column",marginBottom:"16px"},w),children:[l&&t("label",{htmlFor:d,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[l,R&&e("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),S&&e(function(n){var r=n.content,i=o.useState(!1),a=i[0],l=i[1],s=o.useRef(null);return o.useEffect(function(){var e=function(e){s.current&&!s.current.contains(e.target)&&l(!1)};if(a)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[a]),t("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e("div",{onClick:function(e){e.stopPropagation(),l(!a)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e(ie,{})}),a&&t("div",{ref:s,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:[r,e("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:S})]}),t("div",{style:{width:"100%"},children:[e("div",{children:o.Children.map(C,function(e){return o.isValidElement(e)?function(e){var t,n,i,a,l,s,d,c,u;if(!o.isValidElement(e))return e;var p=h({},e.props);if(r&&D){var f=D.getFieldValue(r),g=D.setFieldValue;if(!g)return e;if(e.type&&"object"==typeof e.type&&"displayName"in e.type){var v=e.type.displayName;if("Input"===v||"Textarea"===v){p.value=f||"";var x=null===(t=e.props)||void 0===t?void 0:t.onChange,m=null===(n=e.props)||void 0===n?void 0:n.onBlur;p.onChange=function(e){g(r,e.target.value),null==x||x(e),r&&D&&setTimeout(function(){D.validateField(r)},0)},p.onBlur=function(e){r&&D&&(D.setFieldTouched(r,!0),D.validateField(r)),null==m||m(e)},p.error="error"===B}else if("Select"===v){p.value=f;var y=null===(i=e.props)||void 0===i?void 0:i.onChange,b=null===(a=e.props)||void 0===a?void 0:a.onBlur;p.onChange=function(e,t){g(r,e),null==y||y(e,t),r&&D&&(D.setFieldTouched(r,!0),setTimeout(function(){D.validateField(r)},0))},p.onBlur=function(e){r&&D&&(D.setFieldTouched(r,!0),D.validateField(r)),null==b||b(e)},p.error="error"===B}else if("Switch"===v){p.checked=f||!1;var w=null===(l=e.props)||void 0===l?void 0:l.onChange;p.onChange=function(e,t){g(r,e),null==w||w(e,t),r&&D&&(D.setFieldTouched(r,!0),setTimeout(function(){D.validateField(r)},0))}}else if("Checkbox"===v){p.checked=f||!1;var C=null===(s=e.props)||void 0===s?void 0:s.onChange;p.onChange=function(e){g(r,e.target.checked),null==C||C(e),r&&D&&(D.setFieldTouched(r,!0),setTimeout(function(){D.validateField(r)},0))}}else if("Radio"===v){var F=null===(d=e.props)||void 0===d?void 0:d.value;if(void 0!==F){p.checked=f===F;var k=null===(c=e.props)||void 0===c?void 0:c.onChange;p.onChange=function(e){g(r,F),null==k||k(e),r&&D&&(D.setFieldTouched(r,!0),setTimeout(function(){D.validateField(r)},0))}}}}else{void 0!==f&&(p.value=f);var S=null===(u=e.props)||void 0===u?void 0:u.onChange;p.onChange=function(e){var t,n,o=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;g(r,o),null==S||S(e)}}}return"error"===B&&"error"in p&&(p.error=!0),o.cloneElement(e,p)}(e):e})}),T&&e("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===B?"#D92D20":"warning"===B?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:T}),m&&!T&&e("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:m})]})]})};var Me=function(n){var r=n.items,i=void 0===r?[]:r,a=n.userProfile,s=n.selectedKeys,u=n.defaultSelectedKeys,p=void 0===u?[]:u,f=n.onSelect,g=n.onDeselect,v=n.onClick,x=n.className,y=void 0===x?"":x,b=n.style,w=n.width,F=void 0===w?320:w;C().primaryColor;var k=c(null),S=c({}),D=void 0!==s,E=l(p),A=E[0],L=E[1],M=D?s:A,z=function(e){return"children"in e&&Array.isArray(e.children)},B=d(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(z(i)){var a=B(e,i.children,n);if(a)return a}else{var l=i,s=m(m([],n,!0),[l.key],!1);if(l.key===e)return s}}return null},[]),T=d(function(e){var t;if(!e.disabled){var n,o=B(e.key,i)||[e.key];M.includes(e.key)?(n=M.filter(function(t){return t!==e.key}),null==g||g({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==f||f({key:e.key,keyPath:o,selectedKeys:n})),D||L(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==v||v({key:e.key,keyPath:o})}},[M,D,f,g,v,i,B]),W=function(n){var o=M.includes(n.key);if(n.render)return e("div",{className:n.className,style:n.style,children:n.render(n,o)},n.key);var r=h({display:"flex",alignItems:"center",padding:"10px 16px",cursor:n.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:n.disabled?.5:1},n.style);return t("div",{ref:function(e){S.current[n.key]=e},className:"aha-menu-item ".concat(n.className||""),style:r,onClick:function(){return T(n)},onMouseEnter:function(e){n.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[n.icon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.icon}),e("span",{style:{flex:1},children:n.label})]},n.key)},N=h({width:"number"==typeof F?"".concat(F,"px"):F,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"},b),I=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!z(o)||!(!z(n)||z(o))};return t("div",{ref:k,className:"aha-menu-list ".concat(y),style:N,children:[a&&(a?a.render?a.render(a):e("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e("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("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),t("div",{style:{flex:1,minWidth:0},children:[e("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("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e("div",{children:i.map(function(n,r){return t(o.Fragment,{children:[I(r,i)&&e("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),z(n)?(a=n,e("div",{className:"aha-menu-group ".concat(a.className||""),children:a.children.map(function(e){return W(e)})},"group-".concat(a.title))):W(n)]},r);var a})})]})};Me.displayName="MenuList";var ze=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}},Be=function(e,t,n,o){void 0===o&&(o=6);var r=ze(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),g=Math.min(c,e.bottom),v=Math.max(f,e.left),x=Math.min(u,e.right);return g>h+1&&x>v+1},Te=function(t,n){var o=h({position:"absolute",width:0,height:0,borderStyle:"solid"},n),r={top:h(h({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:h(h({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:h(h({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:h(h({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":h(h({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":h(h({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":h(h({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":h(h({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e("div",{style:r[t]})},We=function(o){var r=o.content,i=o.children,a=o.position,u=void 0===a?"top":a,p=o.trigger,g=void 0===p?"hover":p,v=o.delay,x=void 0===v?200:v,m=o.disabled,y=void 0!==m&&m,b=o.className,w=void 0===b?"":b,C=o.tooltipClassName,F=void 0===C?"":C,k=o.gap,S=void 0===k?6:k,D=o.showArrow,E=void 0===D||D,A=o.width,L=o.defaultVisible,M=void 0!==L&&L,z=o.visible,B=o.onVisibleChange,T=void 0!==z,W=l(M),N=W[0],I=W[1],R=T?z:N,j=l(T?null!=z&&z:M),H=j[0],V=j[1],O=d(function(e){T||I(e),null==B||B(e)},[T,B]);s(function(){T&&(z?requestAnimationFrame(function(){V(!0)}):V(!1))},[T,z]);var P=l(u),Y=P[0],q=P[1],Z=l("320px"),K=Z[0],X=Z[1],G=l({position:"absolute",top:0,left:0,pointerEvents:"hover"===g?"auto":"none"}),J=G[0],_=G[1],U=l({}),Q=U[0],$=U[1],ee=c(null),te=c(null),ne=c(null),oe=c(null),re=d(function(){if(ee.current&&te.current&&R&&H){var e=ee.current.getBoundingClientRect(),t=te.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!Be(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(!Be(e,t,a,o))return a}return n}(e,t,u,S);q(n);var o=ze(e,t,n,S),r=o.top,i=o.left;if(_(function(e){return h(h({},e),{position:"absolute",top:"".concat(r,"px"),left:"".concat(i,"px"),pointerEvents:"hover"===g?"auto":"none",zIndex:9999})}),E){var a=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,i,r);$(a)}}},[R,u,S,E,H,g]),ie=d(function(){y||(oe.current&&(clearTimeout(oe.current),oe.current=null),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){O(!0),T||requestAnimationFrame(function(){V(!0)})},x))},[y,x,O,T]),ae=d(function(){ne.current&&(clearTimeout(ne.current),ne.current=null),oe.current&&clearTimeout(oe.current),T?O(!1):(V(!1),oe.current=setTimeout(function(){O(!1),oe.current=null},150))},[O,T]),le=d(function(){"hover"===g&&(oe.current&&(clearTimeout(oe.current),oe.current=null),R||(O(!0),requestAnimationFrame(function(){V(!0)})))},[g,R]),se=d(function(e){y||"click"!==g||(e.stopPropagation(),R?ae():(ne.current&&(clearTimeout(ne.current),ne.current=null),O(!0),requestAnimationFrame(function(){V(!0)})))},[y,g,R,ae]);s(function(){if(M&&R&&H){var e=function(){ee.current&&te.current?re():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[M,R,H,re]),s(function(){if(R)return requestAnimationFrame(function(){re()}),window.addEventListener("scroll",re,!0),window.addEventListener("resize",re),function(){window.removeEventListener("scroll",re,!0),window.removeEventListener("resize",re)}},[R,re]),s(function(){if(R&&"click"===g){var e=function(e){ee.current&&te.current&&!ee.current.contains(e.target)&&!te.current.contains(e.target)&&ae()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[R,g,ae]),s(function(){return function(){ne.current&&clearTimeout(ne.current),oe.current&&clearTimeout(oe.current)}},[]);var de={position:"absolute",top:0,left:0,opacity:H?1:0,transform:H?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===g?"auto":"none",zIndex:9999},ce=d(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);s(function(){var e=function(){X(ce())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ce]);var ue=h(h({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==A?{width:"number"==typeof A?"".concat(A,"px"):A,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:K,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"}),pe=t("div",{style:h(h(h({},de),J),{pointerEvents:"hover"===g?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(F),onMouseEnter:"hover"===g?le:void 0,onMouseLeave:"hover"===g?ae:void 0,children:[e("div",{ref:te,className:"aha-tooltip ".concat(F),style:ue,role:"tooltip",children:r}),E&&Te(Y,Q)]}),fe=d(function(){"hover"===g&&(oe.current=setTimeout(function(){ae()},100))},[g,ae]),he="click"===g?{onClick:se}:{onMouseEnter:ie,onMouseLeave:fe,onFocus:ie,onBlur:ae};return t(n,{children:[e("div",h({ref:ee,className:"aha-tooltip-trigger ".concat(w),style:{display:"inline-block",cursor:"click"===g?"pointer":"default"}},he,{children:i})),R&&"undefined"!=typeof document&&f(pe,document.body)]})};export{A as Alert,S as Button,Q as CheckIcon,le as Checkbox,De as DatePicker,Le as Form,ge as Input,Me as MenuList,$ as MinusIcon,ae as Pagination,he as Progress,pe as Radio,me as Select,xe as Switch,fe as Tab,ue as Table,U as Tag,ve as Textarea,w as ThemeProvider,N as Toast,G as ToastProvider,We as Tooltip,j as clearAllToasts,R as closeToast,H as debugToast,I as toast,O as toastError,P as toastInfo,Y as toastQuestion,V as toastSuccess,C as useTheme};
2
2
  //# sourceMappingURL=index.esm.js.map