aha-components 1.5.1 → 1.5.3

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 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};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{createContext as o,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,r=arguments.length;n<r;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 r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function v(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(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(a,l)}s((r=r.apply(e,t||[])).next())})}function x(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[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,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=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 r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var y={primaryColor:"#FB6011"},b=o(y),w=function(t){var n=t.theme,r=t.children,o=i(function(){return h(h({},y),n)},[n]);return e(b.Provider,{value:o,children:r})},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(r){var o=r.size,i=r.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: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"})]})]})},D=function(n){var r,o=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,D=n.icon,S=n.iconPosition,M=void 0===S?"left":S,E=g(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),A=C().primaryColor,L=void 0===A?"#FB6011":A,z=l(!1),B=z[0],T=z[1],W=l(!1),N=W[0],I=W[1],R=F[d],H=u||f,j=function(){if(f){var t="primary"===a?"#FFFFFF":"#101828",n=parseInt(R.iconSize.replace("px",""));return e(k,{size:n,color:t})}return D?e("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:R.iconSize,height:R.iconSize,flexShrink:0},children:D}):null},Y=(r=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:H?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},w),"primary"===a?(r.color="#FFFFFF",r.backgroundColor=L,u?(r.opacity=.4,r.cursor="not-allowed"):f?r.backgroundColor=L:N?r.backgroundColor="#EC470A":B&&(r.backgroundColor="#FD843A")):u?(r.backgroundColor="#FAFAF9",r.color="#D6D3D1",r.border="1px solid #E7E5E4"):f?(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):N?(r.backgroundColor="#F5F5F4",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):B?(r.backgroundColor="#FAFAF9",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),r);return t("button",h({type:m,className:"aha-button aha-button--".concat(a," aha-button--").concat(d," ").concat(H?"aha-button--disabled":""," ").concat(f?"aha-button--loading":""," ").concat(b),disabled:H,onClick:function(e){H?e.preventDefault():null==v||v(e)},onMouseEnter:function(){return!H&&T(!0)},onMouseLeave:function(){T(!1),I(!1)},onMouseDown:function(){return!H&&I(!0)},onMouseUp:function(){return I(!1)},style:Y},E,{children:[f&&j(),!f&&"left"===M&&j(),o&&e("span",{style:{display:"inline-block"},children:o}),!f&&"right"===M&&j()]}))};D.displayName="Button";var S={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"})})},M=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"})}),E=function(n){var r=n.className,o=void 0===r?"":r,i=n.type,a=void 0===i?"info":i,s=n.title,d=n.description,c=n.icon,u=void 0===c?S[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(o),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:M})]}):null},A={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"})})},L=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 r=l([]),o=r[0],i=r[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=o.filter(function(e){return"top-left"===e.props.position}),d=o.filter(function(e){return"top-right"===e.props.position}),c=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: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 r=n.id,o=n.props,i=l(!1),a=i[0],c=i[1],u=l(!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 D=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:A.success};case"error":return{bgColor:"#E7000B",defaultIcon:A.error};case"question":return{bgColor:"#1C1917",defaultIcon:A.question};default:return{bgColor:"#1447E6",defaultIcon:A.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(){S()},m);return function(){return clearTimeout(e)}}},[m,r]);var S=d(function(){f(!0),setTimeout(function(){B.removeToast(r),null==F||F()},300)},[r,F]),M=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:M,children:t("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:D.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||D.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(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e(L,{})})]})})},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)},H=function(){B.clearAll()},j=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("====================")},Y=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"}))},O=function(e,t){return X(),I(h(h({},t),{message:e,type:"info"}))},P=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(r){var o=r.children,i=l(!1),a=i[0],d=i[1];return s(function(){d(!0)},[]),t(n,{children:[o,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 o=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 r=e.replace("#",""),o=parseInt(r.substr(0,2),16),i=parseInt(r.substr(2,2),16),a=parseInt(r.substr(4,2),16);return{light:{bg:"rgba(".concat(o,", ").concat(i,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(o,", ").concat(i,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return J.Green}(i,w),k=_[d],D={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&&(D.backgroundColor=F.light.bg,D.color=F.light.text,u&&(D.outline="1px solid",D.outlineOffset="-1px",D.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),r=parseInt(t.substr(2,2),16),o=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(r,", ").concat(o,", 0.3)")}return"#A4F4CF"}(i))),y&&(D.cursor="pointer",D.opacity="1");var S=["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&&(D.backgroundColor=F.fill.bg,D.color=F.fill.text),y&&S.push("cursor-pointer","hover:opacity-80"),m&&S.push(m);var M=S.join(" "),E=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?r.cloneElement(p,{width:n,height:n,style:{fill:t}}):p})};return t("div",h({className:M,style:D,onClick:y},b,{children:["leading"===v&&E(),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:o})}),"after"===v&&E()]}))},Q=function(t){var n=t.className,r=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:r,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,r=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:r,children:e("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ee=function(t){var n=t.className,r=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:r,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 r=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:r,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 r=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:r,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"})]})},re=function(t){var n=t.className,r=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:r,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,r=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:r,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 r=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:r,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"})})})]})},ae=function(n){var r=n.current,o=n.defaultCurrent,a=void 0===o?1:o,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,S=n.simple,M=void 0!==S&&S,E=n.disabled,A=void 0!==E&&E,L=n.hideOnSinglePage,z=void 0!==L&&L,B=n.className,T=void 0===B?"":B,W=n.style,N=n.size,I=void 0===N?"default":N,R=n.responsive,H=void 0!==R&&R;n.showLessItems;var j=n.itemRender,Y=C().primaryColor,V=void 0===Y?"#FB6011":Y,O=l(a),P=O[0],q=O[1],Z=l(f),K=Z[0],X=Z[1],G=l(""),J=G[0],_=G[1],U=null!=r?r:P,Q=null!=u?u:K,$=i(function(){return Math.ceil(c/Q)},[c,Q]);s(function(){void 0!==r&&q(r)},[r]),s(function(){void 0!==u&&X(u)},[u]);var ee=function(e){e<1||e>$||e===U||A||(void 0===r&&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(M)return t("div",{className:"aha-pagination aha-pagination-simple ".concat(T),style:W,children:[e(D,{onClick:function(){return ee(U-1)},disabled:A||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(D,{onClick:function(){return ee(U+1)},disabled:A||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:H?"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:[j?j(U-1,"prev",e(D,{onClick:function(){return ee(U-1)},disabled:A||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(re,{})," ",e("span",{children:"Previous"})]})})):e(D,{onClick:function(){return ee(U-1)},disabled:A||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(re,{})," ",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,r=e(D,{onClick:function(){return ee(t)},disabled:A,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 j?j(t,"page",r):r}if("jump-prev"===t)return r=e(D,{onClick:function(){return ee(Math.max(1,U-5))},disabled:A,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"),j?j(U-5,"jump-prev",r):r;if("jump-next"===t)return r=e(D,{onClick:function(){return ee(Math.min($,U+5))},disabled:A,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"),j?j(U+5,"jump-next",r):r;return null}(t)})}),j?j(U+1,"next",e(D,{onClick:function(){return ee(U+1)},disabled:A||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(oe,{})]})})):e(D,{onClick:function(){return ee(U+1)},disabled:A||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(oe,{})]})}),v&&e("select",{value:Q,onChange:function(e){return t=Number(e.target.value),n=Math.ceil(c/t),o=U>n?n:U,void 0===u&&X(t),void 0===r&&q(o),null==k||k(o,t),void(null==F||F(o,t));var t,n,o},disabled:A,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:A?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){A||(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:J,onChange:function(e){return _(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&te()},disabled:A,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(D,{onClick:te,disabled:A,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:b.goButton}):e(D,{onClick:te,disabled:A,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},le=function(n){var r=n.checked,o=void 0!==r&&r,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=o||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:!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(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:o,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,r;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=se(e,t))&&void 0!==n?n:"":null!==(r=e.key)&&void 0!==r?r:""},ce=function(t){var n=t.order,r=C().primaryColor;return"ascend"===n?e(ne,{style:{color:r}}):"descend"===n?e(te,{style:{color:r}}):e(ee,{})},ue=function(n){var o,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,D=n.size,S=void 0===D?"middle":D,M=n.bordered,E=void 0!==M&&M;n.loading;var A=n.locale,L=n.showHeader,z=void 0===L||L,B=n.title,T=n.footer,W=n.summary,N=n.scroll,I=n.tableLayout,R=void 0===I?"auto":I,H=n.onChange,j=n.onSorterChange,Y=n.onPaginationChange,V=n.onRow,O=n.className,P=void 0===O?"":O,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],re=te[1],oe=l(k&&"object"==typeof k&&(k.current||k.defaultCurrent)||1),ie=oe[0],ue=oe[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),De=c(null);s(function(){var e=function(){Fe(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Se=d(function(e,t){var n,r,o,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===(r=null==C?void 0:C.onChange)||void 0===r||r.call(C,a,s),null===(o=null==C?void 0:C.onSelect)||void 0===o||o.call(C,e,t,s,new Event("select"))}},[_,w,C,y]),Me=d(function(e,t){var n,r,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 de(e,w)}),i=e?o:[];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===(r=null==C?void 0:C.onSelectAll)||void 0===r||r.call(C,e,a,l)},[w,C,y]),Ee=d(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var r=new Map($);null===t?r.delete(n):r.set(n,t),ee(r);var o=Array.from(r.entries()).map(function(t){var n=t[0],r=t[1];return{column:v.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:r,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),j&&j(1===o.length?o[0]:o),H&&H({current:ie,pageSize:fe},{},1===o.length?o[0]:o,{currentDataSource:y,action:"sort"})}},[$,H,j,ie,fe,y,v]);d(function(e,t){var n,r,o,i=de(e,w);o=t?m(m([],ne,!0),[i],!1):ne.filter(function(e){return e!==i}),re(o),null===(n=null==Z?void 0:Z.onExpand)||void 0===n||n.call(Z,t,e),null===(r=null==Z?void 0:Z.onExpandedRowsChange)||void 0===r||r.call(Z,o)},[ne,w,Z]);var Ae=d(function(){var e=m([],y,!0);return $.size>0&&e.sort(function(e,t){for(var n=function(n,r){var o=v.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!o)return"continue";var i=0;if("function"==typeof o.sorter)i=o.sorter(e,t);else if(!0===o.sorter){var a=se(e,o.dataIndex||n),l=se(t,o.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===r?i:-i}:void 0},r=0,o=Array.from($.entries());r<o.length;r++){var i=o[r],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[y,$,v]),Le=Ae(),ze=i(function(){if(!1===k||!k)return Le;var e=(ie-1)*fe,t=e+fe;return Le.slice(e,t)},[Le,ie,fe,k]),Be=d(function(e,t){var n,r,o=null!=t?t:fe;if(ue(e),t&&he(t),Y&&Y(e,o),k&&"object"==typeof k&&(null===(n=k.onChange)||void 0===n||n.call(k,e,t),t&&(null===(r=k.onShowSizeChange)||void 0===r||r.call(k,e,t))),H){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}});H({current:e,pageSize:o},{},1===i.length?i[0]:i,{currentDataSource:Le,action:"paginate"})}},[k,Y,H,fe,$,v,Le]),Te=d(function(e,t,n){var r=se(t,e.dataIndex||"");return e.render?e.render(r,t,n):r},[]),We=d(function(e,t,n){if(t){var r=!0===t?"left":t,o=0;if("left"===r){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 i=0;i<e;i++){if("left"===(a=v[i]).fixed||!0===a.fixed)o+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return o}if("right"===r){for(i=e+1;i<v.length;i++){var a;if("right"===(a=v[i]).fixed)o+=a.width?"number"==typeof a.width?a.width:parseInt(a.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]),Ne=d(function(){if(!z)return null;var n,r,o,i,a=v.map(function(n,r){var o,i=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||r,a=$.get(i)||null,l=We(r,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===(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:a,sortColumn:n}):n.title}),n.sorter&&e("button",{onClick:function(){Ee(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)}),r=n.map(function(e){return de(e,w)}),o=n.length>0&&r.every(function(e){return _.includes(e)}),i=r.some(function(e){return _.includes(e)}),e(le,{checked:o,indeterminate:i&&!o,onChange:function(e){return Me(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:De,children:e("tr",h({},d||{},{children:a}))})},[v,z,$,C,_,ze,w,Ee,Me,A,X,We]),Ie=d(function(e){xe(e)},[]),Re=d(function(e,t){e.preventDefault(),be(t)},[]),He=d(function(e,t){if(e.preventDefault(),null===ve||ve===t)return xe(null),void be(null);var n=m([],ze,!0),r=n[ve];n.splice(ve,1),n.splice(t,0,r),xe(null),be(null)},[ve,ze]),je=d(function(){xe(null),be(null)},[]),Ye=d(function(){return ze.map(function(n,o){var i,a=de(n,w),l=_.includes(a),s=ne.includes(a),d=(null==V?void 0:V(n,o))||{},c=o===ze.length-1;return t(r.Fragment,{children:[t("tr",h({className:"".concat("function"==typeof K?K(n,o):K||""," ").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 He(e,o)},onDragEnd:je,style:h({cursor:"move",opacity:ve===o?.5:1,backgroundColor:ye===o?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ve!==o&&ye!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&ye!==o&&(e.currentTarget.style.backgroundColor="white")}},d,{children:[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 Se(n,e.target.checked)},disabled:null===(i=C.getCheckboxProps)||void 0===i?void 0:i.call(C,n).disabled})})}),v.map(function(t,r){var i,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||r,l=(null===(i=t.onCell)||void 0===i?void 0:i.call(t,n,o))||{},s=We(r,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,o)}),a)})]})),(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)})})]},a)})},[ze,w,_,ne,C,v,V,K,Se,Te,Z,ve,ye,Ie,Re,He,je,We]),Ve=function(){var t;if(!1===k||!k)return null;var n=null!==(t=k.total)&&void 0!==t?t:Le.length,r=k.position||"bottomRight";return e("div",{style:{marginTop:"16px",display:"flex",justifyContent:r.includes("Right")?"flex-end":r.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"===S?"small":"default"})})},Oe=i(function(){return v.some(function(e){return e.fixed})||C&&C.fixed},[v,C]),Pe=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(Oe)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,Oe]),Ze=i(function(){return"fixed"===R||Oe||Pe||v.some(function(e){return e.width})?"fixed":R},[R,Oe,Pe,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(P),style:Xe},G,{children:[B&&e("div",{style:{marginBottom:"16px"},children:B(Le)}),k&&"object"==typeof k&&(null===(o=k.position)||void 0===o?void 0:o.startsWith("top"))&&Ve(),e("div",{className:"aha-table-mobile",children:ze.map(function(n,r){var o,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 Se(n,e.target.checked)},disabled:null===(o=C.getCheckboxProps)||void 0===o?void 0:o.call(C,n).disabled})}),v.map(function(o){var i=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),a=se(n,o.dataIndex||""),l=o.render?o.render(a,n,r):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 o.title?o.title({}):o.title,":"]}),e("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})}),T&&e("div",{style:{marginTop:"16px"},children:T(Le)}),k&&("object"!=typeof k||!(null===(a=k.position)||void 0===a?void 0:a.startsWith("top")))&&Ve()]}));var Ge={position:"relative",overflowX:(null==N?void 0:N.x)||Oe?"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(P),style:Xe},G,{children:[B&&e("div",{style:{marginBottom:"16px"},children:B(Le)}),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:qe?"".concat(qe,"px"):"100%",display:"block"},children:t("table",{style:Ke,className:E?"bordered":"",children:[Ne(),e("tbody",{children:Ye()}),W&&e("tfoot",{children:e("tr",{children:e("td",{colSpan:v.length+(C?1:0),children:W(Le)})})})]})})}),T&&e("div",{style:{marginTop:"16px"},children:T(Le)}),k&&("object"!=typeof k||!(null===(p=k.position)||void 0===p?void 0:p.startsWith("top")))&&Ve()]}))},pe=function(n){var r=n.checked,o=void 0!==r&&r,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":o?v:"white",m=a?"#FAFAF9":o?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:!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:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:u}),e("input",{type:"radio",checked:o,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 o=n.items,a=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,D=n.scrollable,S=void 0!==D&&D,M=g(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),E=C().primaryColor;if(!a||0===a.length)return null;var A=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]),L=void 0!==m,z=A.length>0?A[0].key:"",B=function(e){if(void 0===e)return z;var t=A.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),r=Number(e);return!isNaN(n)&&!isNaN(r)&&n===r});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=L?void 0!==m?B(m):z:W;s(function(){console.log("[Tab Debug] currentValue:",I,"type:",typeof I),console.log("[Tab Debug] normalizedItems:",A.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",m,"isControlled:",L)},[I,A,m,L]);var R=d(function(e,t){if(!t){L||N(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==y||y(n),S&&"underline"===p){var r=Y.current[V(e)],o=q.current;if(r&&o){X.current=!0;var i,l=function(){if(o&&O.current&&r){var e=o.getBoundingClientRect(),t=r.getBoundingClientRect();if(e.width>0&&t.width>0){var n=o.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,o.removeEventListener("scroll",s)},150)};o.addEventListener("scroll",s,{passive:!0}),r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[L,y,a,S,p]),H=A.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}),j=E||"#FB6011",Y=c({}),V=function(e){return String(e)},O=c(null),P=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(O.current&&q.current){var e=Y.current[V(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[V(t)]}if(e){var n=q.current.getBoundingClientRect(),r=e.getBoundingClientRect();if(0!==n.width&&0!==r.width){var o=q.current.scrollLeft||0,i=r.left-n.left+o,a=r.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,A]),te=d(function(){"background"===p&&Z.current&&P.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(P.current&&Z.current){var e=Y.current[V(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[V(t)]}if(e){var n=Z.current.getBoundingClientRect(),r=e.getBoundingClientRect();if(0!==n.width&&0!==r.width){var o=r.left-n.left,i=r.width,a="".concat(o,"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,A]);s(function(){I?K.current!==I&&(K.current=I,"underline"===p&&q.current&&!X.current&&ee(),"background"===p&&Z.current&&P.current&&te()):K.current=""},[I,p,A.length,L,ee,te]),s(function(){if(I){var e=setTimeout(function(){if("underline"===p)(e=Y.current[V(I)])&&q.current&&O.current&&(ee(),S&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===p){var e;if((e=Y.current[V(I)])&&Z.current&&P.current){var t=Z.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var r=n.left-t.left,o=n.width,i="".concat(r,"px"),a="".concat(o,"px");$({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),s(function(){if(S&&"underline"===p&&I&&!X.current){var e=setTimeout(function(){var e=Y.current[V(I)],t=q.current;if(e&&t){X.current=!0;var n,r=function(){if(t&&O.current&&e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();if(n.width>0&&r.width>0){var o=t.scrollLeft||0,i=r.left-n.left+o,a=r.width;_({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},o=function(){r(),clearTimeout(n),n=setTimeout(function(){r(),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(){r()})})}},50);return function(){return clearTimeout(e)}}},[I,S,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"},S&&(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(S?"aha-tab--scrollable":""," ").concat(w),style:ne},M,{children:[e("div",{ref:O,style:h({position:"absolute",bottom:"-1px",height:"2px",backgroundColor:j,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)}),A.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===A[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){Y.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:S?0:void 0,whiteSpace:S?"nowrap":void 0},children:[n.icon&&function(){var t,i=typeof n.icon,a=r.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:i,isReactElement:a,iconValue:n.icon}),r.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?j:"#79716B",transition:"color 0.2s ease-in-out"},children:r.cloneElement(n.icon,{width:20,height:20,style:h(h({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:o?j:"#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?j:"#79716B",transition:"color 0.2s ease-in-out"},children:r.createElement(n.icon,{width:20,height:20,style:{color:o?j:"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?j:"#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?j:"#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},M,{children:[e("div",{ref:P,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)}),A.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===A[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 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){Y.current[V(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:i,children:[n.icon&&function(){var t;return r.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:r.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:r.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)})]}))}(),S&&"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==H?void 0:H.children)&&e("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:H.children})]})},he=function(r){var o=r.percent,i=void 0===o?0:o,a=r.type,d=void 0===a?"circle":a,u=r.width,p=void 0===u?120:u,f=r.title,v=r.titlePosition,x=r.showPercent,m=void 0===x||x,y=r.animated,b=void 0!==y&&y,w=r.status,F=void 0===w?"normal":w,k=r.className,D=void 0===k?"":k,S=r.style,M=r.strokeColor,E=r.trailColor,A=void 0===E?"#F5F5F4":E,L=g(r,["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),H=R[0],j=R[1];s(function(){if(b&&T.current&&B>0){T.current=!1,j(0),I(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){j(B)})});var e=setTimeout(function(){I(!1),j(B)},300);return function(){return clearTimeout(e)}}T.current?(T.current=!1,I(!1),j(B)):j(B)},[b,B]);var Y=M||z||"#FB6011";"success"===F?Y="#00BC7D":"exception"===F&&(Y="#FB2C36");var V=v||"inside",O=Math.max(4,Math.round(.06*p)),P=(p-O)/2,q="semicircle"===d?p/2:p,Z="14px",K="12px",X=function(){var r=f&&"outside"===V?p+4+18+4:p,o=2*Math.PI*P,i=o-(N?H:B)/100*o;return t("div",{style:{position:"relative",width:p,height:r,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:P,fill:"none",stroke:A,strokeWidth:O,strokeLinecap:"round"}),e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:Y,strokeWidth:O,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:i,transform:"rotate(-90 ".concat(p/2," ").concat(p/2,")"),style:{transition:N?"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: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"===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},S);return e("div",h({className:"aha-progress aha-progress--".concat(d," ").concat(D),style:G},L,{children:function(){switch(d){case"circle":return X();case"semicircle":return o=O/2,i=p-O/2,a=(r=q+O)-O/2,l=q/2+O/2+O/2,s=f&&"outside"===V?r+4+18+4:r,c=Math.PI*P,u=c-(N?H:B)/100*c,t("div",{style:{position:"relative",width:p,height:s,overflow:"hidden"},children:[t("svg",{width:p,height:r,viewBox:"0 0 ".concat(p," ").concat(r),style:{position:"absolute",top:0,left:0},children:[e("path",{d:"M ".concat(o," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:A,strokeWidth:O,strokeLinecap:"round"}),e("path",{d:"M ".concat(o," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:Y,strokeWidth:O,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:u,style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===V?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"===V&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(r,"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 r,o,i,a,l,s,c,u}()}))},ge=u(function(o,i){var a=o.size,l=void 0===a?"medium":a,d=o.disabled,u=void 0!==d&&d,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,D=void 0===k?"":k,S=o.style,M=o.type,E=void 0===M?"text":M,A=o.placeholder,L=o.value,z=o.defaultValue,B=o.onChange,T=o.onFocus,W=o.onBlur,N=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,H=void 0===R?"#FB6011":R,j=c(null),Y=r.useState(z||L||""),V=Y[0],O=Y[1],P=r.useState(!1),q=P[0],Z=P[1];s(function(){"function"==typeof i?i(j.current):i&&(i.current=j.current)},[i]);var K=void 0!==L,X=K?L:V,G=function(e){var t;e.stopPropagation(),K||O("");null==B||B({target:{value:""},currentTarget:{value:""}}),null==F||F(),null===(t=j.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?H:"#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"},S);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(D),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:j,type:E,value:X,placeholder:A,disabled:u,readOnly:x,onChange:function(e){K||O(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(o,i){var a=o.disabled,l=void 0!==a&&a,d=o.error,u=void 0!==d&&d,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,D=o.defaultValue,S=o.rows,M=void 0===S?3:S,E=o.autoSize,A=void 0!==E&&E,L=o.onChange,z=o.onFocus,B=o.onBlur,T=g(o,["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=r.useState(D||k||""),H=R[0],j=R[1],Y=r.useState(!1),V=Y[0],O=Y[1],P=r.useState(void 0),q=P[0],Z=P[1];s(function(){"function"==typeof i?i(I.current):i&&(i.current=I.current)},[i]);var K=void 0!==k,X=K?k:H,G=String(X||"").length;s(function(){if(A&&I.current){var e=I.current,t="object"==typeof A&&A.minRows||1,n="object"==typeof A?A.maxRows:void 0;e.style.height="auto";var r=e.scrollHeight,o=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*o,a=n?n*o:void 0,l=Math.max(r,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),Z(l)}},[X,A]);var J=h(h({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(u?"#F04438":V?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:A?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==q&&A?{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:A?void 0:M,maxLength:m,onChange:function(e){K||j(e.target.value),null==L||L(e)},onFocus:function(e){O(!0),null==z||z(e)},onBlur:function(e){O(!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 o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,d=n.onChange,c=n.onClick,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=r.useState(a),D=k[0],S=k[1],M=void 0!==o,E=M?o:D,A={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[g],L=E||x,z=s?"#E7E5E4":L?F:"#F5F5F4",B=L?"calc(100% - ".concat(A.thumbSize," - ").concat(A.thumbOffset,")"):A.thumbOffset;return t("button",{type:"button",role:"switch","aria-checked":E,disabled:s||x,onClick:function(e){if(!s&&!x){var t=!E;M||S(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:L?"flex-end":"flex-start",width:A.width,height:A.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:L?"6px":"auto",right:L?"auto":"6px",fontSize:A.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:L?u:p}),e("span",{style:{position:"absolute",left:B,top:"50%",transform:"translateY(-50%)",width:A.thumbSize,height:A.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 a,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,D=void 0===k?"Please select":k,S=o.size,M=void 0===S?"medium":S,E=o.showSearch,A=void 0!==E&&E,L=o.filterOption,z=void 0===L||L,B=o.allowClear,T=void 0!==B&&B,W=o.onChange,N=o.onSelect,I=o.onDeselect,R=o.onSearch,H=o.onFocus,j=o.onBlur,Y=o.onDropdownVisibleChange,V=o.className,O=void 0===V?"":V,P=o.style,q=o.dropdownClassName,Z=void 0===q?"":q,K=o.dropdownStyle,X=o.defaultOpen,G=void 0!==X&&X,J=o.open,_=o.maxTagCount,U=o.tagRender,Q=o.optionRender,$=C().primaryColor,ee=void 0===$?"#FB6011":$,te=l(void 0!==p?p:x?[]:void 0),ne=te[0],re=te[1],oe=l(G),ie=oe[0],ae=oe[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]),De=d(function(){return A&&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,A,z]),Se=i(function(){return De()},[De]);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==Y||Y(!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,Y]),s(function(){if(Ce){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<Se.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=Se[ue];n&&!n.disabled&&Me(n)}else"Escape"===e.key&&(e.preventDefault(),be||ae(!1),null==Y||Y(!1),null===(t=fe.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Ce,Se,ue,be,Y]),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 Me=d(function(e){var t;if(!e.disabled)if(Fe){var n,r=Array.isArray(we)?we:[];r.includes(e.value)?(n=r.filter(function(t){return t!==e.value}),null==I||I(e.value,e)):(n=m(m([],r,!0),[e.value],!1),null==N||N(e.value,e)),ye||re(n);var o=v.filter(function(e){return n.includes(e.value)});null==W||W(n,o)}else ye||re(e.value),null==W||W(e.value,e),null==N||N(e.value,e),be||ae(!1),null==Y||Y(!1),de(""),null===(t=fe.current)||void 0===t||t.focus()},[Fe,we,ye,be,v,W,N,I,Y]),Ee=d(function(e,t){if(e.stopPropagation(),Fe&&Array.isArray(we)){var n=we.filter(function(e){return e!==t}),r=v.find(function(e){return e.value===t});ye||re(n),null==W||W(n,ke()),null==I||I(t,r)}},[Fe,we,ye,v,W,I,ke]),Ae=function(e){e.stopPropagation();var t=Fe?[]:void 0;ye||re(t),null==W||W(t,[]),de("")},Le={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,o=_&&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 o={label:n.label,value:n.value,closable:!b,onClose:function(){return Ee({},n.value)}};return U?e(r.Fragment,{children:U(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 Ee(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,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(O),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:Le[M].paddingTop,paddingBottom:Le[M].paddingBottom,fontSize:Le[M].fontSize,lineHeight:Le[M].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},P),onClick:function(){if(!b){var e=!Ce;be||ae(e),null==Y||Y(e),e&&A?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):de("")}},onFocus:function(e){null==H||H(e)},onBlur:function(e){null==j||j(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",D?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:D}:{style:{flex:1,minHeight:"24px"}}):A&&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:D,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:D||" "})}),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:Ae,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===Se.length?e("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Se.map(function(n,r){var o=Fe?Array.isArray(we)&&we.includes(n.value):we===n.value,i=r===ue;return Q?e("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&Me(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Q(n,{selected:o,focused:i,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 Me(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: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(),r=e.getMonth(),o=String(r+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[r]).replace(new RegExp("","g"),ye[r]).replace(new RegExp("","g"),o).replace(new RegExp("","g"),String(r+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)},De=function(r){var o=r.mode,a=void 0===o?"date":o,u=r.disabled,p=void 0!==u&&u,g=r.error,v=void 0!==g&&g,x=r.placeholder,m=void 0===x?"Select date":x,y=r.startPlaceholder,b=void 0===y?"Start date":y,w=r.endPlaceholder,F=void 0===w?"End date":w,k=r.size,D=void 0===k?"medium":k,S=r.allowClear,M=void 0!==S&&S,E=r.format,A=void 0===E?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":E,L=r.onFocus,z=r.onBlur,B=r.onOpenChange,T=r.className,W=void 0===T?"":T,N=r.style,I=r.dropdownClassName,R=void 0===I?"":I,H=r.dropdownStyle,j=r.defaultOpen,Y=void 0!==j&&j,V=r.open,O=r.minDate,P=r.maxDate,q=r.separator,Z=void 0===q?" - ":q,K=r.presetRanges,X=void 0!==K&&K,G=r.calendarCount,J=void 0===G?1:G,_=r.showApplyCancel,U=void 0!==_&&_,Q=r.applyText,$=void 0===Q?"Apply":Q,ee=r.cancelText,te=void 0===ee?"Cancel":ee,ne=r.onApply,re=r.onCancel,oe=r.showSelectedRange,ie=void 0!==oe&&oe,ae=r.startSelectedRangeText,le=void 0===ae?"Select dates":ae,se=r.endSelectedRangeText,de=void 0===se?"Select dates":se,ce=r.rangeDisplayMode,ue=void 0===ce?"range":ce,pe=C().primaryColor,fe=void 0===pe?"#FB6011":pe,he="range"===a,ge=l(function(){return"date"===a&&"defaultValue"in r&&r.defaultValue||null}),ve=ge[0],xe=ge[1],me=l(function(){return"range"===a&&"defaultValue"in r&&r.defaultValue||{startDate:null,endDate:null}}),ye=me[0],De=me[1],Se=l(Y),Me=Se[0],Ee=Se[1],Ae=l(!0),Le=Ae[0],ze=Ae[1],Be=l(null),Te=Be[0],We=Be[1],Ne=l(function(){var e,t;if("date"===a&&"value"in r&&r.value&&(t=r.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in r&&r.value&&(t=(e=r.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in r&&r.defaultValue&&(t=r.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in r&&r.defaultValue&&(t=(e=r.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ie=Ne[0],Re=Ne[1],He=l(function(){if(2===J&&he){var e=new Date(Ie.year,Ie.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),je=He[0],Ye=He[1];s(function(){if(2===J&&he){var e=new Date(Ie.year,Ie.month+1,1);Ye({year:e.getFullYear(),month:e.getMonth()})}else Ye(null)},[Ie,J,he]);var Ve=c(null),Oe=c(null),Pe=c(null),qe=c(null),Ze=c(null),Ke=l(null),Xe=Ke[0],Ge=Ke[1],Je=c(!1),_e=c(!1),Ue=c(null),Qe="value"in r&&void 0!==r.value,$e=void 0!==V,et=he?null:Qe&&"date"===a&&"value"in r?r.value:ve,tt=he?Qe&&"range"===a&&"value"in r?r.value||{startDate:null,endDate:null}:ye:{startDate:null,endDate:null},nt=$e?V:Me;s(function(){if(nt&&!Je.current){if(he){var e=tt.startDate||tt.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Re({year:t,month:n})}else{var r=new Date;Re({year:r.getFullYear(),month:r.getMonth()})}}else if(et){t=et.getFullYear(),n=et.getMonth();Re({year:t,month:n})}else{r=new Date;Re({year:r.getFullYear(),month:r.getMonth()})}Je.current=!0}else nt||(Je.current=!1)},[nt,et,tt,he]),s(function(){if(nt&&Ve.current){_e.current=!1,Ue.current=null;var e=function(){if(Ve.current){var e=Ve.current.getBoundingClientRect();if(_e.current&&null!==Ue.current){var t,n=Ue.current;if(Ze.current){var r=Ze.current.offsetHeight;t="top"===n?e.top+window.scrollY-r-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Ge({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var o=e.bottom+window.scrollY+4,i="bottom";Ge({top:o,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(Ze.current){var t=Ze.current.offsetHeight,n=window.innerHeight-e.bottom-4,r=e.top-4;(n<t&&r>=t||n<t&&r<t&&r>n)&&(o=e.top+window.scrollY-t-4,i="top"),_e.current=!0,Ue.current=i}Ge({top:o,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Ge(null),_e.current=!1,Ue.current=null},[nt]),s(function(){var e=function(e){var t=e.target;Ve.current&&!Ve.current.contains(t)&&Ze.current&&!Ze.current.contains(t)&&($e||Ee(!1),null==B||B(!1))};if(nt)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[nt,$e,B]);var rt,ot,it,at,lt=d(function(e){var t;ke(e,O,P)&&(Qe||xe(e),"date"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,e)),$e||Ee(!1),null==B||B(!1))},[Qe,$e,a,r,B,O,P]),st=d(function(e){var t;if(ke(e,O,P)){var n,o=U&&Te?Te:tt;o.startDate&&o.endDate?(n={startDate:e,endDate:null},ze(!1)):Le?o.endDate&&e>o.endDate?(n={startDate:o.endDate,endDate:e},ze(!1)):(n={startDate:e,endDate:o.endDate},o.endDate?(ze(!0),U||($e||Ee(!1),null==B||B(!1))):ze(!1)):o.startDate&&e<o.startDate?(n={startDate:e,endDate:o.startDate},ze(!1)):(n={startDate:o.startDate,endDate:e},ze(!0),U||($e||Ee(!1),null==B||B(!1))),U?We(n):(Qe||De(n),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,n)))}},[Le,tt,Te,U,Qe,$e,a,r,B,O,P]),dt=function(e){var t,n;if(e.stopPropagation(),he){var o={startDate:null,endDate:null};Qe||De(o),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,o)),ze(!0)}else Qe||xe(null),"date"===a&&"onChange"in r&&(null===(n=r.onChange)||void 0===n||n.call(r,null));if(!nt){var i=new Date;Re({year:i.getFullYear(),month:i.getMonth()})}},ct=function(){if(!p){var e=!nt;if($e||Ee(e),null==B||B(e),e){if(he){if(ze(!tt.startDate),U&&We(tt),!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else if(!et){t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else!e&&U&&We(null)}},ut=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 r=new Date(e),o=new Date(e),i=e.getDate();o.setMonth(e.getMonth()-1),o.getDate()!==i&&o.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:o,endDate:r}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),pt=i(function(){return Array.isArray(X)?X:!0===X?ut:[]},[X,ut]),ft=pt.length>0,ht=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),o=e.startDate.getMonth();Re({year:n,month:o})}U?We(e):(Qe||De(e),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,e)),$e||Ee(!1),null==B||B(!1))},gt=function(){Re(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},vt=function(){Re(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},xt=d(function(e,t){for(var n=Ce(e,t),r=[],o=1;o<=n;o++)r.push(new Date(e,t,o));return r},[]),mt=i(function(){return xt(Ie.year,Ie.month)},[Ie,xt]),yt=i(function(){return 2===J&&he&&je?xt(je.year,je.month):null},[J,he,je,xt]),bt=function(){je&&Ye(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},wt=function(){je&&Ye(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},Ct={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"}},Ft=M&&!p&&(he?tt.startDate||tt.endDate:et),kt=et?we(et,A):"",Dt=tt.startDate?we(tt.startDate,A):"",St=tt.endDate?we(tt.endDate,A):"",Mt=i(function(){if(!he||"text"!==ue)return"";if(tt.startDate&&tt.endDate){var e=we(tt.startDate,"MMM D, YYYY"),t=we(tt.endDate,"MMM D, YYYY");return"".concat(e," ").concat(Z," ").concat(t)}return tt.startDate?we(tt.startDate,"MMM D, YYYY"):tt.endDate?we(tt.endDate,"MMM D, YYYY"):""},[he,ue,tt,Z]),Et=["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 @keyframes dropdownFadeInTop {\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:Ve,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":nt?fe:"#D7D3D0"),backgroundColor:p?"#FAFAF9":"#FFFFFF",cursor:p?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:Ft?"30px":"12px",paddingTop:Ct[D].paddingTop,paddingBottom:Ct[D].paddingBottom,fontSize:Ct[D].fontSize,lineHeight:Ct[D].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:ct,onFocus:function(e){null==L||L(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"})})},{})}),he?"text"===ue?e("input",{ref:Oe,type:"text",value:Mt,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate||tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):t("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e("input",{ref:Pe,type:"text",value:Dt,readOnly:!0,placeholder:b,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!0),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.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:qe,type:"text",value:St,readOnly:!0,placeholder:F,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!1),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e("input",{ref:Oe,type:"text",value:kt,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":et?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),Ft&&e("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},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:dt,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"})})},{})})]}),nt&&Xe&&f(e("div",{ref:Ze,className:"aha-date-picker-dropdown ".concat(R),style:h({position:"absolute",top:"".concat(Xe.top,"px"),left:"".concat(Xe.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Xe.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Xe.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},H),children:t("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:he&&ft&&1===J?"column":"row"},children:[he&&ft&&2===J&&e("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:U?"0":"8px"},children:pt.map(function(t,n){var r=Te?Fe(t.range.startDate,Te.startDate)&&Fe(t.range.endDate,Te.endDate):Fe(t.range.startDate,tt.startDate)&&Fe(t.range.endDate,tt.endDate);return e("div",{onClick:function(){return ht(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:r?fe:"#1C1917",backgroundColor:r?"#FAFAF9":"transparent",fontWeight:r?500:400,transition:"all 0.2s"},onMouseEnter:function(e){r||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){r||(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:(at=function(n,r,o,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&&he?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===J&&he&&1===a)&&e("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===J&&he?"absolute":"relative",left:2===J&&he?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&&he&&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&&he?"absolute":"relative",right:2===J&&he?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"})})})]}),he&&ie&&1===J&&0===a&&(l=U&&Te?Te:tt,s=l.startDate?we(l.startDate,"MMM D, YYYY"):le,d=l.endDate?we(l.endDate,"MMM D, YYYY"):de,t("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.startDate?"text-[#44403C]":"text-[#79716B]"),children:s}),e("div",{children:Z}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.endDate?"text-[#44403C]":"text-[#79716B]"),children:d})]})),he&&ft&&1===J&&e("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:pt.map(function(t,n){var r=Te?Fe(t.range.startDate,Te.startDate)&&Fe(t.range.endDate,Te.endDate):Fe(t.range.startDate,tt.startDate)&&Fe(t.range.endDate,tt.endDate);return e("button",{type:"button",onClick:function(){return ht(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:r?fe:"#1C1917",backgroundColor:r?"#FAFAF9":"transparent",border:"none",fontWeight:r?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:Et.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 o,i,a=(o=n.year,i=n.month,new Date(o,i,1).getDay()),l=(0===a?7:a)-1,s=[],d=0;d<l;d++)s.push(e("div",{},"empty-".concat(d)));return r.forEach(function(r,o){if(r){var i=l+o,a=r.getMonth()===n.month,d=Fe(r,new Date),c=!ke(r,O,P);if(he){var u=U&&Te?Te:tt,p=Fe(r,u.startDate),f=Fe(r,u.endDate),h=function(e,t,n){if(!t||!n)return!1;var r=e.getTime(),o=t.getTime(),i=n.getTime();return r>=o&&r<=i}(r,u.startDate,u.endDate),g=i%7==0,v=i%7==6,x=p,m=f,y={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0};if(x||m)y.background=fe,y.borderRadius="50%",y.color="#FFFFFF",y.fontWeight=500;else if(h){y.background="#F5F5F4",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;var b=1===r.getDate(),w=Ce(n.year,n.month),C=r.getDate()===w,F=g||b,k=v||C;F&&k?y.borderRadius="18px":F?(y.borderTopLeftRadius="18px",y.borderBottomLeftRadius="18px",y.borderTopRightRadius="0",y.borderBottomRightRadius="0"):k?(y.borderTopRightRadius="18px",y.borderBottomRightRadius="18px",y.borderTopLeftRadius="0",y.borderBottomLeftRadius="0"):y.borderRadius="0"}else y.background="transparent",y.borderRadius="50%",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;s.push(t("button",{type:"button",disabled:c,onClick:function(){return st(r)},style:y,onMouseEnter:function(e){c||x||m||(e.currentTarget.style.backgroundColor=h?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){x||m||(e.currentTarget.style.backgroundColor=h?"#F5F5F4":"transparent")},children:[r.getDate(),d&&e("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:x||m?"#FFFFFF":fe}})]},"date-".concat(o)))}else{var D=Fe(r,et);s.push(t("button",{type:"button",disabled:c,onClick:function(){return lt(r)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:D?fe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:D?500:400,color:D?"#FFFFFF":a?c?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){c||D||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){D||(e.currentTarget.style.backgroundColor="transparent")},children:[r.getDate(),d&&!D&&e("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:fe}})]},"date-".concat(o)))}}}),s}()})]},a);var l,s,d},t(n,{children:[at(Ie,mt,gt,vt,0),2===J&&he&&je&&yt&&at(je,yt,bt,wt,1)]}))}),he&&ie&&2===J&&!U&&(rt=tt,ot=rt.startDate?we(rt.startDate,"MMM D, YYYY"):le,it=rt.endDate?we(rt.endDate,"MMM D, YYYY"):de,e("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(rt.startDate?"text-[#44403C]":"text-[#79716B]"),children:ot}),e("div",{children:Z}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(rt.endDate?"text-[#44403C]":"text-[#79716B]"),children:it})]})})),he&&U&&t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[ie&&2===J&&function(){var n=Te||tt,r=n.startDate?we(n.startDate,"MMM D, YYYY"):le,o=n.endDate?we(n.endDate,"MMM D, YYYY"):de;return t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.startDate?"text-[#44403C]":"text-[#79716B]"),children:r}),e("div",{children:Z}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),t("div",{className:"".concat(2===J?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e("button",{type:"button",onClick:function(){We(null),null==re||re(),$e||Ee(!1),null==B||B(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:te}),e("button",{type:"button",onClick:function(){var e;Te&&(Qe||De(Te),"range"===a&&"onChange"in r&&(null===(e=r.onChange)||void 0===e||e.call(r,Te)),null==ne||ne(Te),$e||Ee(!1),null==B||B(!1),We(null))},disabled:!Te||!Te.startDate||!Te.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Te&&Te.startDate&&Te.endDate?fe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Te&&Te.startDate&&Te.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor=fe)},children:$})]})]})]})]})}),document.body)]})};De.displayName="DatePicker";var Se=o(null),Me=r.forwardRef(function(t,n){var r=t.initialValues,o=void 0===r?{}:r,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,D=t.style,S=t.children,M=l(function(){var e={};return Object.keys(o).forEach(function(t){e[t]={value:o[t],error:void 0,touched:!1,validating:!1}}),e}),E=M[0],A=M[1],L=c(E);s(function(){L.current=E},[E]);var z=d(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.value},[]),B=d(function(e,t){A(function(n){var r=h({},n);if(r[e]?r[e]=h(h({},r[e]),{value:t}):r[e]={value:t,error:void 0,touched:!1,validating:!1},L.current[e]?L.current[e]=h(h({},L.current[e]),{value:t}):L.current[e]={value:t,error:void 0,touched:!1,validating:!1},a){var o={};o[e]=t;var i={};Object.keys(r).forEach(function(e){i[e]=r[e].value}),a(o,i)}return r})},[a]),T=d(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.error},[]),W=d(function(e,t){L.current[e]&&(L.current[e]=h(h({},L.current[e]),{error:t})),A(function(n){var r=h({},n);return r[e]?r[e]=h(h({},r[e]),{error:t}):r[e]={value:void 0,error:t,touched:!1,validating:!1},r})},[]),N=d(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.touched)||!1},[]),I=d(function(e,t){L.current[e]&&(L.current[e]=h(h({},L.current[e]),{touched:t})),A(function(n){var r=h({},n);return r[e]?r[e]=h(h({},r[e]),{touched:t}):r[e]={value:void 0,error:void 0,touched:t,validating:!1},r})},[]),R=d(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.validating)||!1},[]),H=d(function(e,t){L.current[e]&&(L.current[e]=h(h({},L.current[e]),{validating:t})),A(function(n){var r=h({},n);return r[e]?r[e]=h(h({},r[e]),{validating:t}):r[e]={value:void 0,error:void 0,touched:!1,validating:t},r})},[]),j=c();j.current=function(e,t){A(function(n){if(n[e]){var r=n[e].rules||[],i=t.rules||[],a=r.length===i.length;if(a&&r.length>0)for(var l=0;l<r.length;l++){var s=r[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:o[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},c})};var Y=d(function(e,t){var n;null===(n=j.current)||void 0===n||n.call(j,e,t)},[]),V=d(function(e){A(function(t){var n=h({},t);return delete n[e],n})},[]),O=d(function(e){return v(void 0,void 0,void 0,function(){var t,n,r,o,i,a,l,s,d;return x(this,function(c){switch(c.label){case 0:if(!(t=L.current[e]))return[2,void 0];H(e,!0),n=t.rules||[],o=0,i=n,c.label=1;case 1:if(!(o<i.length))return[3,6];if(a=i[o],l=t.value,a.required&&(null==l||""===l))return r=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 r=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 r=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 r=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 r=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 r=a.message||"".concat(e," must be exactly ").concat(a.len),[3,6];if(a.whitespace&&"string"==typeof l&&l.trim()!==l)return r=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(),r=(null==d?void 0:d.message)||a.message||"".concat(e," validation failed"),[3,6];case 5:return o++,[3,1];case 6:return L.current[e]?L.current[e]=h(h({},L.current[e]),{error:r,validating:!1,touched:!0}):L.current[e]={value:t.value,error:r,touched:!0,validating:!1,rules:t.rules,required:t.required},A(function(n){var o=h({},n);return o[e]?o[e]=h(h({},o[e]),{error:r,validating:!1,touched:!0}):o[e]={value:t.value,error:r,touched:!0,validating:!1,rules:t.rules,required:t.required},o}),[2,r]}})})},[]),P=d(function(e){var t=L.current,n={};return(e||Object.keys(t)).forEach(function(e){var r;n[e]=null===(r=t[e])||void 0===r?void 0:r.value}),n},[]),q=d(function(e){return v(void 0,void 0,void 0,function(){var t,n,r,o;return x(this,function(i){switch(i.label){case 0:return t=L.current,n=e||Object.keys(t),r=[],[4,Promise.all(n.map(function(e){return v(void 0,void 0,void 0,function(){var n,r;return x(this,function(o){switch(o.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,O(e)]:[3,2];case 1:return r=o.sent(),[2,{name:e,error:r}];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&&r.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(i.sent(),r.length>0)throw o={values:P(),errorFields:r},null==f||f(o),o;return[2,P()]}})})},[O,P,f]),Z=d(function(e){A(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]),K=d(function(e){A(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 r={};Object.keys(n).forEach(function(e){r[e]=n[e].value}),a(e,r)}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:P,setFieldValue:B,setFieldsValue:K,getFieldError:T,validateField:O,validateFields:q,resetFields:Z,submit:X}});var G=i(function(){return{fields:E,getFieldValue:z,setFieldValue:B,getFieldError:T,setFieldError:W,isFieldTouched:N,setFieldTouched:I,isFieldValidating:R,setFieldValidating:H,registerField:Y,unregisterField:V,validateField:O,validateFields:q,resetFields:Z,getFieldsValue:P,setFieldsValue:K,submit:X,labelWidth:m,labelAlign:b}},[E,z,B,T,W,N,I,R,H,Y,V,O,q,Z,P,K,X,m,b]),J=h({},D);return"vertical"===C?(J.display="flex",J.flexDirection="column"):"inline"===C&&(J.display="inline-flex",J.flexWrap="wrap",J.gap="16px"),e(Se.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:S})})});Me.displayName="Form";var Ee=Me;Ee.Item=function(n){var o=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,D=n.tooltip,S=a(Se),M=c(null),E=(null==S?void 0:S.fields)||{};o&&S&&S.getFieldValue(o);var A=o&&S?S.getFieldError(o):void 0,L=!(!o||!S)&&S.isFieldTouched(o),z=!(!o||!S)&&S.isFieldValidating(o);o&&E[o];var B=v||(A?"error":z?"validating":L&&!A?"success":void 0),T=void 0!==x?x:A||void 0,W=c(g),N=c(p),I=c(!1),R=p||g.some(function(e){return e.required}),H=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(o&&S)return(!W.current||H||N.current!==p)&&(W.current=g,N.current=p,S.registerField(o,{rules:g,required:R})),function(){o&&S&&S.unregisterField(o)}},[o]);if(k)return null;return t("div",{ref:M,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:"*"}),D&&e(function(n){var o=n.content,i=r.useState(!1),a=i[0],l=i[1],s=r.useRef(null);return r.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:[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:D})]}),t("div",{style:{width:"100%"},children:[e("div",{children:r.Children.map(C,function(e){return r.isValidElement(e)?function(e){var t,n,i,a,l,s,d,c,u;if(!r.isValidElement(e))return e;var p=h({},e.props);if(o&&S){var f=S.getFieldValue(o),g=S.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&&S&&setTimeout(function(){S.validateField(o)},0)},p.onBlur=function(e){o&&S&&(S.setFieldTouched(o,!0),S.validateField(o)),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(o,e),null==y||y(e,t),o&&S&&(S.setFieldTouched(o,!0),setTimeout(function(){S.validateField(o)},0))},p.onBlur=function(e){o&&S&&(S.setFieldTouched(o,!0),S.validateField(o)),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(o,e),null==w||w(e,t),o&&S&&(S.setFieldTouched(o,!0),setTimeout(function(){S.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&&S&&(S.setFieldTouched(o,!0),setTimeout(function(){S.validateField(o)},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(o,F),null==k||k(e),o&&S&&(S.setFieldTouched(o,!0),setTimeout(function(){S.validateField(o)},0))}}}}else{void 0!==f&&(p.value=f);var D=null===(u=e.props)||void 0===u?void 0:u.onChange;p.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;g(o,r),null==D||D(e)}}}return"error"===B&&"error"in p&&(p.error=!0),r.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 Ae=function(n){var o=n.items,i=void 0===o?[]:o,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),D=c({}),S=void 0!==s,M=l(p),E=M[0],A=M[1],L=S?s:E,z=function(e){return"children"in e&&Array.isArray(e.children)},B=d(function(e,t,n){void 0===n&&(n=[]);for(var r=0,o=t;r<o.length;r++){var i=o[r];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,r=B(e.key,i)||[e.key];L.includes(e.key)?(n=L.filter(function(t){return t!==e.key}),null==g||g({key:e.key,keyPath:r,selectedKeys:n})):(n=[e.key],null==f||f({key:e.key,keyPath:r,selectedKeys:n})),S||A(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:r}),e.skipGlobalClick||null==v||v({key:e.key,keyPath:r})}},[L,S,f,g,v,i,B]),W=function(n){var r=L.includes(n.key);if(n.render)return e("div",{className:n.className,style:n.style,children:n.render(n,r)},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){D.current[n.key]=e},className:"aha-menu-item ".concat(n.className||""),style:o,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],r=t[e-1];return!!z(r)||!(!z(n)||z(r))};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,o){return t(r.Fragment,{children:[I(o,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)]},o);var a})})]})};Ae.displayName="MenuList";var Le=function(e,t,n,r){void 0===r&&(r=6);var o=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,s=r+6,d=0,c=0;switch(n){case"top":d=e.top-t.height-s+i,c=a-t.width/2+o;break;case"bottom":default:d=e.bottom+s+i,c=a-t.width/2+o;break;case"left":d=l-t.height/2+i,c=e.left-t.width-s+o;break;case"right":d=l-t.height/2+i,c=e.right+s+o;break;case"top-left":d=e.top-t.height-s+i,c=e.left+o;break;case"top-right":d=e.top-t.height-s+i,c=e.right-t.width+o;break;case"bottom-left":d=e.bottom+s+i,c=e.left+o;break;case"bottom-right":d=e.bottom+s+i,c=e.right-t.width+o}var u=window.innerWidth,p=window.innerHeight;return c<o+8?c=o+8:c+t.width>o+u-8&&(c=o+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}},ze=function(e,t,n,r){void 0===r&&(r=6);var o=Le(e,t,n,r),i=o.top,a=o.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},Be=function(t,n){var r=h({position:"absolute",width:0,height:0,borderStyle:"solid"},n),o={top:h(h({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:h(h({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:h(h({},r),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:h(h({},r),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":h(h({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":h(h({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":h(h({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":h(h({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e("div",{style:o[t]})},Te=function(r){var o=r.content,i=r.children,a=r.position,u=void 0===a?"top":a,p=r.trigger,g=void 0===p?"hover":p,v=r.delay,x=void 0===v?200:v,m=r.disabled,y=void 0!==m&&m,b=r.className,w=void 0===b?"":b,C=r.tooltipClassName,F=void 0===C?"":C,k=r.gap,D=void 0===k?6:k,S=r.showArrow,M=void 0===S||S,E=r.width,A=r.defaultVisible,L=void 0!==A&&A,z=r.visible,B=r.onVisibleChange,T=void 0!==z,W=l(L),N=W[0],I=W[1],R=T?z:N,H=l(T?null!=z&&z:L),j=H[0],Y=H[1],V=d(function(e){T||I(e),null==B||B(e)},[T,B]);s(function(){T&&(z?requestAnimationFrame(function(){Y(!0)}):Y(!1))},[T,z]);var O=l(u),P=O[0],q=O[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),re=c(null),oe=d(function(){if(ee.current&&te.current&&R&&j){var e=ee.current.getBoundingClientRect(),t=te.current.getBoundingClientRect(),n=function(e,t,n,r){if(void 0===r&&(r=6),!ze(e,t,n,r))return n;for(var o=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);o<i.length;o++){var a=i[o];if(!ze(e,t,a,r))return a}return n}(e,t,u,D);q(n);var r=Le(e,t,n,D),o=r.top,i=r.left;if(_(function(e){return h(h({},e),{position:"absolute",top:"".concat(o,"px"),left:"".concat(i,"px"),pointerEvents:"hover"===g?"auto":"none",zIndex:9999})}),M){var a=function(e,t,n,r,o){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=r-i,c=o-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,o);$(a)}}},[R,u,D,M,j,g]),ie=d(function(){y||(re.current&&(clearTimeout(re.current),re.current=null),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){V(!0),T||requestAnimationFrame(function(){Y(!0)})},x))},[y,x,V,T]),ae=d(function(){ne.current&&(clearTimeout(ne.current),ne.current=null),re.current&&clearTimeout(re.current),T?V(!1):(Y(!1),re.current=setTimeout(function(){V(!1),re.current=null},150))},[V,T]),le=d(function(){"hover"===g&&(re.current&&(clearTimeout(re.current),re.current=null),R||(V(!0),requestAnimationFrame(function(){Y(!0)})))},[g,R]),se=d(function(e){y||"click"!==g||(e.stopPropagation(),R?ae():(ne.current&&(clearTimeout(ne.current),ne.current=null),V(!0),requestAnimationFrame(function(){Y(!0)})))},[y,g,R,ae]);s(function(){if(L&&R&&j){var e=function(){ee.current&&te.current?oe():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[L,R,j,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)&&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),re.current&&clearTimeout(re.current)}},[]);var de={position:"absolute",top:0,left:0,opacity:j?1:0,transform:j?"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!==E?{width:"number"==typeof E?"".concat(E,"px"):E,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:o}),M&&Be(P,Q)]}),fe=d(function(){"hover"===g&&(re.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{E as Alert,D as Button,Q as CheckIcon,le as Checkbox,De as DatePicker,Ee as Form,ge as Input,Ae 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,Te as Tooltip,H as clearAllToasts,R as closeToast,j as debugToast,I as toast,V as toastError,O as toastInfo,P as toastQuestion,Y as toastSuccess,C as useTheme};
2
2
  //# sourceMappingURL=index.esm.js.map