aha-components 1.7.1 → 1.7.2

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.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function s(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var c={primaryColor:"#FB6011"},d=t.createContext(c),u=function(){var e=t.useContext(d);return e||c},p={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"}},f=function(t){var n=t.size,o=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},h=function(n){var o,a=n.children,l=n.type,s=void 0===l?"default":l,c=n.size,d=void 0===c?"medium":c,h=n.disabled,x=void 0!==h&&h,g=n.loading,v=void 0!==g&&g,m=n.onClick,y=n.htmlType,b=void 0===y?"button":y,w=n.className,C=void 0===w?"":w,F=n.style,k=n.icon,j=n.iconPosition,D=void 0===j?"left":j,S=i(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),E=u().primaryColor,M=void 0===E?"#FB6011":E,A=t.useState(!1),L=A[0],z=A[1],B=t.useState(!1),T=B[0],R=B[1],W=p[d],N=x||v,I=function(){if(v){var t="primary"===s?"#FFFFFF":"#101828",n=parseInt(W.iconSize.replace("px",""));return e.jsx(f,{size:n,color:t})}return k?e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:W.iconSize,height:W.iconSize,flexShrink:0},children:k}):null},H=(o=r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:W.gap,height:W.height,paddingLeft:W.paddingLeft,paddingRight:W.paddingRight,fontSize:W.fontSize,lineHeight:W.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:N?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},F),"primary"===s?(o.color="#FFFFFF",o.backgroundColor=M,x?(o.opacity=.4,o.cursor="not-allowed"):v?o.backgroundColor=M:T?o.backgroundColor="#EC470A":L&&(o.backgroundColor="#FD843A")):x?(o.backgroundColor="#FAFAF9",o.color="#D6D3D1",o.border="1px solid #E7E5E4"):v?(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):T?(o.backgroundColor="#F5F5F4",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):L?(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 e.jsxs("button",r({type:b,className:"aha-button aha-button--".concat(s," aha-button--").concat(d," ").concat(N?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(C),disabled:N,onClick:function(e){N?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!N&&z(!0)},onMouseLeave:function(){z(!1),R(!1)},onMouseDown:function(){return!N&&R(!0)},onMouseUp:function(){return R(!1)},style:H},S,{children:[v&&I(),!v&&"left"===D&&I(),a&&e.jsx("span",{style:{display:"inline-block"},children:a}),!v&&"right"===D&&I()]}))};h.displayName="Button";var x={success:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},g=e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),v={success:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},m=function(t){var n=t.className;return e.jsx("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},y=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return s([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),b=new y,w=function(){var n=t.useState([]),o=n[0],i=n[1];t.useEffect(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}),l=o.filter(function(e){return"top-right"===e.props.position}),s=o.filter(function(e){return"bottom-left"===e.props.position}),c=o.filter(function(e){return"bottom-right"===e.props.position});return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e.jsx(C,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:l.map(function(t){return e.jsx(C,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e.jsx(C,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e.jsx(C,r({},t),t.id)})})]})},C=function(n){var o=n.id,r=n.props,i=t.useState(!1),a=i[0],l=i[1],s=t.useState(!1),c=s[0],d=s[1],u=r.message,p=r.type,f=void 0===p?"info":p,h=r.duration,x=void 0===h?3e3:h,g=r.icon,y=r.action,w=r.showClose,C=void 0===w||w,F=r.onClose,k=r.onClick;r.className;var j=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:v.success};case"error":return{bgColor:"#E7000B",defaultIcon:v.error};case"question":return{bgColor:"#1C1917",defaultIcon:v.question};default:return{bgColor:"#1447E6",defaultIcon:v.info}}}(f);t.useEffect(function(){var e=setTimeout(function(){l(!0)},10);return function(){return clearTimeout(e)}},[]),t.useEffect(function(){if(x>0){var e=setTimeout(function(){D()},x);return function(){return clearTimeout(e)}}},[x,o]);var D=t.useCallback(function(){d(!0),setTimeout(function(){b.removeToast(o),null==F||F()},300)},[o,F]),S=t.useCallback(function(){null==k||k()},[k]);return e.jsx("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!c?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!c?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:S,children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:j.bgColor,color:"white"},children:[e.jsx("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:g||j.defaultIcon}),e.jsxs("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e.jsx("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:u}),y&&e.jsx("div",{style:{marginTop:"12px"},children:y})]}),C&&e.jsx("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.jsx(m,{})})]})})},F=function(e){return console.log("Toast: 调用 toast 函数",e),S(),setTimeout(function(){var t=b.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},k=null,j=null,D=!1,S=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(D)console.log("Toast: 容器正在初始化中,跳过");else if(k)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),D=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),k=t,void(D=!1);console.log("Toast: 创建容器元素"),(k=document.createElement("div")).id="aha-toast-container",document.body.appendChild(k),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),j=n(k),console.log("Toast: 渲染 ToastContainer 组件"),j.render(e.jsx(w,{})),console.log("Toast: 容器渲染完成"),D=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),j=n(k),console.log("Toast: 渲染 ToastContainer 组件"),j.render(e.jsx(w,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}D=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),D=!1})}}catch(e){console.error("Toast: 创建容器失败",e),D=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},E={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},M={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"}},A=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"medium":a,s=n.disabled,c=void 0!==s&&s,d=n.error,p=void 0!==d&&d,f=n.readOnly,h=void 0!==f&&f,x=n.prefix,g=n.suffix,v=n.allowClear,m=void 0!==v&&v,y=n.onClear,b=n.className,w=void 0===b?"":b,C=n.style,F=n.type,k=void 0===F?"text":F,j=n.placeholder,D=n.value,S=n.defaultValue,E=n.onChange,M=n.onFocus,A=n.onBlur,L=n.onPressEnter,z=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),B=u().primaryColor,T=void 0===B?"#FB6011":B,R=t.useRef(null),W=t.useState(S||D||""),N=W[0],I=W[1],H=t.useState(!1),Y=H[0],O=H[1];t.useEffect(function(){"function"==typeof o?o(R.current):o&&(o.current=R.current)},[o]);var V=void 0!==D,P=V?D:N,q=function(e){var t;e.stopPropagation(),V||I("");null==E||E({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=R.current)||void 0===t||t.focus()},X=m&&P&&!c,Z={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"}},K=g||X?"40px":"12px",_=r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":Y?T:"#D7D3D0"),backgroundColor:c||h?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:K,paddingTop:Z[l].paddingTop,paddingBottom:Z[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},C);return e.jsxs(e.Fragment,{children:[e.jsx("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 '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[x&&e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:x}),e.jsx("input",r({ref:R,type:k,value:P,placeholder:j,disabled:c,readOnly:h,onChange:function(e){V||I(e.target.value),null==E||E(e)},onFocus:function(e){O(!0),null==M||M(e)},onBlur:function(e){O(!1),null==A||A(e)},onKeyDown:function(e){var t;"Enter"===e.key&&L&&L(e),null===(t=z.onKeyDown)||void 0===t||t.call(z,e)},style:_,autoComplete:z.autoComplete||"off",autoCorrect:z.autoCorrect||"off",autoCapitalize:z.autoCapitalize||"off",spellCheck:z.spellCheck||!1},z)),(g||X)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[X&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:q,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),g&&e.jsx("span",{style:{pointerEvents:"none"},children:g})]})]})]})});A.displayName="Input";var L=function(o){var i,a=o.value,l=o.defaultValue,c=o.options,d=void 0===c?[]:c,p=o.mode,f=o.disabled,h=void 0!==f&&f,x=o.error,g=void 0!==x&&x,v=o.placeholder,m=void 0===v?"Please select":v,y=o.size,b=void 0===y?"medium":y,w=o.showSearch,C=void 0!==w&&w,F=o.filterOption,k=void 0===F||F,j=o.allowClear,D=void 0!==j&&j,S=o.onChange,E=o.onSelect,M=o.onDeselect,A=o.onSearch,L=o.onFocus,z=o.onBlur,B=o.onDropdownVisibleChange,T=o.className,R=void 0===T?"":T,W=o.style,N=o.dropdownClassName,I=void 0===N?"":N,H=o.dropdownStyle,Y=o.defaultOpen,O=void 0!==Y&&Y,V=o.open,P=o.maxTagCount,q=o.tagRender,X=o.optionRender,Z=u().primaryColor,K=void 0===Z?"#FB6011":Z,_=t.useState(void 0!==l?l:p?[]:void 0),G=_[0],J=_[1],U=t.useState(O),Q=U[0],$=U[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),re=oe[0],ie=oe[1],ae=t.useRef(null),le=t.useRef(null),se=t.useRef(null),ce=t.useState(null),de=ce[0],ue=ce[1],pe=void 0!==a,fe=void 0!==V,he=pe?a:G,xe=fe?V:Q,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!he)return[];var e=Array.isArray(he)?he:[he];return d.filter(function(t){return e.includes(t.value)})},[he,d]),me=t.useCallback(function(){return C&&te?!1===k?d:"function"==typeof k?d.filter(function(e){return k(te,e)}):d.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):d},[d,te,C,k]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&ae.current){var e=function(){var e,t;if(ae.current){var n=ae.current.getBoundingClientRect(),o=null!==(t=null===(e=se.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-4:n.bottom+window.scrollY+4;ue({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}ue(null)},[xe,ye.length]),t.useEffect(function(){var e=function(e){var t=e.target;ae.current&&!ae.current.contains(t)&&se.current&&!se.current.contains(t)&&(fe||$(!1),null==B||B(!1),ne(""))};if(xe)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[xe,fe,B]),t.useEffect(function(){if(xe){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),ie(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ie(function(e){return e>0?e-1:0});else if("Enter"===e.key&&re>=0){e.preventDefault();var n=ye[re];n&&!n.disabled&&be(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==B||B(!1),null===(t=ae.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,ye,re,fe,B]),t.useEffect(function(){if(re>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=t.useCallback(function(e){var t;if(!e.disabled)if(ge){var n,o=Array.isArray(he)?he:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==M||M(e.value,e)):(n=s(s([],o,!0),[e.value],!1),null==E||E(e.value,e)),pe||J(n);var r=d.filter(function(e){return n.includes(e.value)});null==S||S(n,r)}else pe||J(e.value),null==S||S(e.value,e),null==E||E(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,he,pe,fe,d,S,E,M,B]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(he)){var n=he.filter(function(e){return e!==t}),o=d.find(function(e){return e.value===t});pe||J(n),null==S||S(n,ve()),null==M||M(t,o)}},[ge,he,pe,d,S,M,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||J(t),null==S||S(t,[]),ne("")},Fe={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"}},ke=t.useMemo(function(){return ve()},[ve]),je=t.useMemo(function(){return D&&he&&!h},[D,he,h]),De=t.useMemo(function(){return ge?Array.isArray(he)&&he.length>0:null!=he&&""!==he},[ge,he]),Se=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===P?ke.slice(0,2):P?ke.slice(0,P):ke,o=P&&ke.length>n.length?ke.length-n.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var o={label:n.label,value:n.value,closable:!h,onClose:function(){return we({},n.value)}};return q?e.jsx(t.Fragment,{children:q(o)},n.value):e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!h&&e.jsx("span",{onClick:function(e){return we(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ge,he,ke,P,h,q]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:ae,className:"aha-select ".concat(R),style:r({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":xe?K:"#D7D3D0"),backgroundColor:h?"#FAFAF9":"#FFFFFF",cursor:h?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Fe[b].paddingTop,paddingBottom:Fe[b].paddingBottom,fontSize:Fe[b].fontSize,lineHeight:Fe[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},W),onClick:function(){if(!h){var e=!xe;fe||$(e),null==B||B(e),e&&C?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==L||L(e)},onBlur:function(e){null==z||z(e)},onTouchStart:function(e){h||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:h?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?Se||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):C&&xe?e.jsx("input",{ref:le,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==A||A(t),ie(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:h?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:De?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:De?h?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:De?(null===(i=ke[0])||void 0===i?void 0:i.label)||he:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[je&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ce,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(t){var n=t.isOpen;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:xe})]})]}),xe&&de&&n.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(I),style:r({position:"absolute",top:"".concat(de.top,"px"),left:"".concat(de.left,"px"),width:"".concat(de.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===de.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===de.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},H),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(t,n){var o=ge?Array.isArray(he)&&he.includes(t.value):he===t.value,r=n===re;return X?e.jsx("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&be(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:X(t,{selected:o,focused:r,disabled:t.disabled||!1})},t.value):e.jsxs("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return be(t)},style:{padding:"8px 16px",cursor:t.disabled?"not-allowed":"pointer",color:t.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e.jsx("span",{children:t.label}),o&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:K,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};L.displayName="Select";var z=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},B=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},T=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},R=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},W=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},N=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},I=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},H=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("g",{clipPath:"url(#clip0_54_1653)",children:e.jsx("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_54_1653",children:e.jsx("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},Y=function(n){var o=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,c=n.pageSize,d=n.defaultPageSize,p=void 0===d?10:d,f=n.showSizeChanger,x=void 0!==f&&f,g=n.pageSizeOptions,v=void 0===g?["10","20","50","100"]:g,m=n.showQuickJumper,y=void 0!==m&&m,b=n.showTotal,w=n.onChange,C=n.onShowSizeChange,F=n.simple,k=void 0!==F&&F,j=n.disabled,D=void 0!==j&&j,S=n.hideOnSinglePage,E=void 0!==S&&S,M=n.className,z=void 0===M?"":M,B=n.style,T=n.size,R=void 0===T?"default":T,W=n.responsive,H=void 0!==W&&W;n.showLessItems;var Y=n.itemRender,O=u().primaryColor,V=void 0===O?"#FB6011":O,P=t.useState(a),q=P[0],X=P[1],Z=t.useState(p),K=Z[0],_=Z[1],G=t.useState(""),J=G[0],U=G[1],Q=null!=o?o:q,$=null!=c?c:K,ee=t.useMemo(function(){return Math.ceil(s/$)},[s,$]);t.useEffect(function(){void 0!==o&&X(o)},[o]),t.useEffect(function(){void 0!==c&&_(c)},[c]);var te=function(e){e<1||e>ee||e===Q||D||(void 0===o&&X(e),null==w||w(e,$))},ne=function(){var e=parseInt(J,10);e>=1&&e<=ee&&(te(e),U(""))};if(E&&ee<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(z),style:B,children:[e.jsx(h,{onClick:function(){return te(Q-1)},disabled:D||1===Q,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ee]}),e.jsx(h,{onClick:function(){return te(Q+1)},disabled:D||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(I,{})})]});var oe=(Q-1)*$+1,re=Math.min(Q*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(z),style:r({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:H?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},B),children:[b&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:b(s,[oe,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:Y?Y(Q-1,"prev",e.jsx(h,{onClick:function(){return te(Q-1)},disabled:D||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})})):e.jsx(h,{onClick:function(){return te(Q-1)},disabled:D||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ee)}else if(Q>=ee-3){e.push(1),e.push("jump-prev");for(t=ee-4;t<=ee;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ee)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e.jsx(h,{onClick:function(){return te(t)},disabled:D,type:n?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return Y?Y(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(h,{onClick:function(){return te(Math.max(1,Q-5))},disabled:D,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(h,{onClick:function(){return te(Math.min(ee,Q+5))},disabled:D,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y(Q+5,"jump-next",o):o;return null}(t)})}),s>0&&e.jsx(e.Fragment,{children:Y?Y(Q+1,"next",e.jsx(h,{onClick:function(){return te(Q+1)},disabled:D||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(I,{})})):e.jsx(h,{onClick:function(){return te(Q+1)},disabled:D||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(I,{})})}),x&&e.jsx(L,{value:$,options:v.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(s/t),r=Q>n?n:Q,void 0===c&&_(t),void 0===o&&X(r),null==C||C(r,t),void(null==w||w(r,t));var t,n,r},disabled:D,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),y&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(A,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:ne,disabled:D,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof y&&y.goButton?e.jsx(h,{onClick:ne,disabled:D,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:y.goButton}):e.jsx(h,{onClick:ne,disabled:D,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},O=function(t){var n=t.checked,o=void 0!==n&&n,i=t.indeterminate,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l,c=t.onChange,d=t.className,p=void 0===d?"":d,f=t.style,h=t.children,x=u().primaryColor,g=o||a,v=s?"#FAFAF9":g?x:"white",m=s?"#FAFAF9":g?x:"#D7D3D0";return e.jsxs("div",{className:"aha-checkbox ".concat(p),style:r({display:"inline-flex",alignItems:"center",gap:"8px",cursor:s?"not-allowed":"pointer"},f),onClick:function(e){s||(null==c||c({target:{checked:!o},currentTarget:{checked:!o}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:g?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:a?e.jsx(B,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(z,{style:{width:"14px",height:"14px",display:"block"}})})}),h&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:s?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:h}),e.jsx("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=a)},onChange:c,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};O.displayName="Checkbox";var V=function(t){var n=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},P=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e.jsx(V,{color:o}):n;return e.jsx("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},q=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)},X=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=q(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},Z=function(t){var n=t.order,o=u().primaryColor;return"ascend"===n?e.jsx(W,{style:{color:o}}):"descend"===n?e.jsx(R,{style:{color:o}}):e.jsx(T,{})},K=function(t){var n=t.checked,o=void 0!==n&&n,i=t.disabled,a=void 0!==i&&i,l=t.onChange,s=t.className,c=void 0===s?"":s,d=t.style,p=t.children,f=t.value,h=t.name,x=u().primaryColor,g=void 0===x?"#FB6011":x,v=a?"#FAFAF9":o?g:"white",m=a?"#FAFAF9":o?g:"#D7D3D0";return e.jsxs("div",{className:"aha-radio ".concat(c),style:r({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},d),onClick:function(e){a||(null==l||l({target:{checked:!o,value:f},currentTarget:{checked:!o,value:f}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("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"}})}),p&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:p}),e.jsx("input",{type:"radio",checked:o,onChange:l,disabled:a,value:f,name:h,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};K.displayName="Radio";var _=t.forwardRef(function(n,o){var a=n.disabled,l=void 0!==a&&a,s=n.error,c=void 0!==s&&s,d=n.readOnly,p=void 0!==d&&d,f=n.showCount,h=void 0!==f&&f,x=n.maxLength,g=n.className,v=void 0===g?"":g,m=n.style,y=n.placeholder,b=n.value,w=n.defaultValue,C=n.rows,F=void 0===C?3:C,k=n.autoSize,j=void 0!==k&&k,D=n.onChange,S=n.onFocus,E=n.onBlur,M=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),A=u().primaryColor,L=void 0===A?"#FB6011":A,z=t.useRef(null),B=t.useState(w||b||""),T=B[0],R=B[1],W=t.useState(!1),N=W[0],I=W[1],H=t.useState(void 0),Y=H[0],O=H[1];t.useEffect(function(){"function"==typeof o?o(z.current):o&&(o.current=z.current)},[o]);var V=void 0!==b,P=V?b:T,q=String(P||"").length;t.useEffect(function(){if(j&&z.current){var e=z.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),O(l)}},[P,j]);var X=r(r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":N?L:"#D7D3D0"),backgroundColor:l||p?"#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:j?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==Y&&j?{height:"".concat(Y,"px")}:{}),m);return e.jsxs(e.Fragment,{children:[e.jsx("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 "}),e.jsxs("div",{className:"aha-textarea-wrapper ".concat(v),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e.jsx("textarea",r({ref:z,value:P,placeholder:y,disabled:l,readOnly:p,rows:j?void 0:F,maxLength:x,onChange:function(e){V||R(e.target.value),null==D||D(e)},onFocus:function(e){I(!0),null==S||S(e)},onBlur:function(e){I(!1),null==E||E(e)},style:X,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(h||x)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:x?e.jsxs("span",{children:[q," / ",x]}):e.jsx("span",{children:q})})]})]})});_.displayName="Textarea";var G=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,c=n.onChange,d=n.onClick,p=n.checkedChildren,f=n.unCheckedChildren,h=n.size,x=void 0===h?"default":h,g=n.loading,v=void 0!==g&&g,m=n.className,y=void 0===m?"":m,b=n.style,w=u().primaryColor,C=void 0===w?"#FB6011":w,F=t.useState(a),k=F[0],j=F[1],D=void 0!==o,S=D?o:k,E={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],M=S||v,A=s?"#E7E5E4":M?C:"#F5F5F4",L=M?"calc(100% - ".concat(E.thumbSize," - ").concat(E.thumbOffset,")"):E.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":S,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!S;D||j(t),null==c||c(t,e),null==d||d(t,e)}},className:"aha-switch ".concat(y),style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:E.width,height:E.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===x?"10px":"12px",backgroundColor:A,cursor:s||v?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(p||f)&&e.jsx("span",{style:{position:"absolute",left:M?"6px":"auto",right:M?"auto":"6px",fontSize:E.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:s?.5:1,zIndex:1,pointerEvents:"none"},children:M?p:f}),e.jsx("span",{style:{position:"absolute",left:L,top:"50%",transform:"translateY(-50%)",width:E.thumbSize,height:E.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:v&&e.jsxs("svg",{width:"small"===x?"8":"10",height:"small"===x?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};G.displayName="Switch";var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],U=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=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"),U[o]).replace(new RegExp("","g"),J[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},$=function(e,t){return new Date(e,t+1,0).getDate()},ee=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},te=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},ne=function(o){var i=o.mode,a=void 0===i?"date":i,l=o.disabled,s=void 0!==l&&l,c=o.error,d=void 0!==c&&c,p=o.placeholder,f=void 0===p?"Select date":p,h=o.startPlaceholder,x=void 0===h?"Start date":h,g=o.endPlaceholder,v=void 0===g?"End date":g,m=o.size,y=void 0===m?"medium":m,b=o.allowClear,w=void 0!==b&&b,C=o.format,F=void 0===C?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":C,k=o.onFocus,j=o.onBlur,D=o.onOpenChange,S=o.className,E=void 0===S?"":S,M=o.style,A=o.dropdownClassName,L=void 0===A?"":A,z=o.dropdownStyle,B=o.defaultOpen,T=void 0!==B&&B,R=o.open,W=o.minDate,N=o.maxDate,I=o.separator,H=void 0===I?" - ":I,Y=o.presetRanges,O=void 0!==Y&&Y,V=o.calendarCount,P=void 0===V?1:V,q=o.showApplyCancel,X=void 0!==q&&q,Z=o.applyText,K=void 0===Z?"Apply":Z,_=o.cancelText,G=void 0===_?"Cancel":_,J=o.onApply,ne=o.onCancel,oe=o.showSelectedRange,re=void 0!==oe&&oe,ie=o.startSelectedRangeText,ae=void 0===ie?"Select dates":ie,le=o.endSelectedRangeText,se=void 0===le?"Select dates":le,ce=o.rangeDisplayMode,de=void 0===ce?"range":ce,ue=u().primaryColor,pe=void 0===ue?"#FB6011":ue,fe="range"===a,he=t.useState(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),xe=he[0],ge=he[1],ve=t.useState(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),me=ve[0],ye=ve[1],be=t.useState(T),we=be[0],Ce=be[1],Fe=t.useState(!0),ke=Fe[0],je=Fe[1],De=t.useState(null),Se=De[0],Ee=De[1],Me=t.useState(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ae=Me[0],Le=Me[1],ze=t.useState(function(){if(2===P&&fe){var e=new Date(Ae.year,Ae.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Be=ze[0],Te=ze[1];t.useEffect(function(){if(2===P&&fe){var e=new Date(Ae.year,Ae.month+1,1);Te({year:e.getFullYear(),month:e.getMonth()})}else Te(null)},[Ae,P,fe]);var Re=t.useRef(null),We=t.useRef(null),Ne=t.useRef(null),Ie=t.useRef(null),He=t.useRef(null),Ye=t.useState(null),Oe=Ye[0],Ve=Ye[1],Pe=t.useRef(!1),qe=t.useRef(!1),Xe=t.useRef(null),Ze="value"in o&&void 0!==o.value,Ke=void 0!==R,_e=fe?null:Ze&&"date"===a&&"value"in o?o.value:xe,Ge=fe?Ze&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:me:{startDate:null,endDate:null},Je=Ke?R:we;t.useEffect(function(){if(Je&&!Pe.current){if(fe){var e=Ge.startDate||Ge.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Le({year:t,month:n})}else{var o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}}else if(_e){t=_e.getFullYear(),n=_e.getMonth();Le({year:t,month:n})}else{o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}Pe.current=!0}else Je||(Pe.current=!1)},[Je,_e,Ge,fe]),t.useEffect(function(){if(Je&&Re.current){qe.current=!1,Xe.current=null;var e=function(){if(Re.current){var e=Re.current.getBoundingClientRect();if(qe.current&&null!==Xe.current){var t,n=Xe.current;if(He.current){var o=He.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Ve({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";Ve({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(He.current){var t=He.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),qe.current=!0,Xe.current=i}Ve({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Ve(null),qe.current=!1,Xe.current=null},[Je]),t.useEffect(function(){var e=function(e){var t=e.target;Re.current&&!Re.current.contains(t)&&He.current&&!He.current.contains(t)&&(Ke||Ce(!1),null==D||D(!1))};if(Je)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Je,Ke,D]);var Ue,Qe,$e,et,tt=t.useCallback(function(e){var t;te(e,W,N)&&(Ze||ge(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ke||Ce(!1),null==D||D(!1))},[Ze,Ke,a,o,D,W,N]),nt=t.useCallback(function(e){var t;if(te(e,W,N)){var n,r=X&&Se?Se:Ge;r.startDate&&r.endDate?(n={startDate:e,endDate:null},je(!1)):ke?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},je(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(je(!0),X||(Ke||Ce(!1),null==D||D(!1))):je(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},je(!1)):(n={startDate:r.startDate,endDate:e},je(!0),X||(Ke||Ce(!1),null==D||D(!1))),X?Ee(n):(Ze||ye(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[ke,Ge,Se,X,Ze,Ke,a,o,D,W,N]),ot=function(e){var t,n;if(e.stopPropagation(),fe){var r={startDate:null,endDate:null};Ze||ye(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),je(!0)}else Ze||ge(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!Je){var i=new Date;Le({year:i.getFullYear(),month:i.getMonth()})}},rt=function(){if(!s){var e=!Je;if(Ke||Ce(e),null==D||D(e),e){if(fe){if(je(!Ge.startDate),X&&Ee(Ge),!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else if(!_e){t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else!e&&X&&Ee(null)}},it=t.useMemo(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),at=t.useMemo(function(){return Array.isArray(O)?O:!0===O?it:[]},[O,it]),lt=at.length>0,st=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Le({year:n,month:r})}X?Ee(e):(Ze||ye(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ke||Ce(!1),null==D||D(!1))},ct=function(){Le(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},dt=function(){Le(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},ut=t.useCallback(function(e,t){for(var n=$(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),pt=t.useMemo(function(){return ut(Ae.year,Ae.month)},[Ae,ut]),ft=t.useMemo(function(){return 2===P&&fe&&Be?ut(Be.year,Be.month):null},[P,fe,Be,ut]),ht=function(){Be&&Te(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},xt=function(){Be&&Te(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},gt={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},vt=w&&!s&&(fe?Ge.startDate||Ge.endDate:_e),mt=_e?Q(_e,F):"",yt=Ge.startDate?Q(Ge.startDate,F):"",bt=Ge.endDate?Q(Ge.endDate,F):"",wt=t.useMemo(function(){if(!fe||"text"!==de)return"";if(Ge.startDate&&Ge.endDate){var e=Q(Ge.startDate,"MMM D, YYYY"),t=Q(Ge.endDate,"MMM D, YYYY");return"".concat(e," ").concat(H," ").concat(t)}return Ge.startDate?Q(Ge.startDate,"MMM D, YYYY"):Ge.endDate?Q(Ge.endDate,"MMM D, YYYY"):""},[fe,de,Ge,H]),Ct=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:Re,className:"aha-date-picker ".concat(E),style:r({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(d?"#F04438":Je?pe:"#D7D3D0"),backgroundColor:s?"#FAFAF9":"#FFFFFF",cursor:s?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:vt?"30px":"12px",paddingTop:gt[y].paddingTop,paddingBottom:gt[y].paddingBottom,fontSize:gt[y].fontSize,lineHeight:gt[y].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},M),onClick:rt,onFocus:function(e){null==k||k(e)},onBlur:function(e){null==j||j(e)},tabIndex:s?-1:0,children:[e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:s?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),fe?"text"===de?e.jsx("input",{ref:We,type:"text",value:wt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate||Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):e.jsxs("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e.jsx("input",{ref:Ne,type:"text",value:yt,readOnly:!0,placeholder:x,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!0),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e.jsx("span",{style:{color:s?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:H}),e.jsx("input",{ref:Ie,type:"text",value:bt,readOnly:!0,placeholder:v,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!1),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e.jsx("input",{ref:We,type:"text",value:mt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":_e?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),vt&&e.jsx("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:ot,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),Je&&Oe&&n.createPortal(e.jsx("div",{ref:He,className:"aha-date-picker-dropdown ".concat(L),style:r({position:"absolute",top:"".concat(Oe.top,"px"),left:"".concat(Oe.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Oe.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Oe.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},z),children:e.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:fe&&lt&&1===P?"column":"row"},children:[fe&&lt&&2===P&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:X?"0":"8px"},children:at.map(function(t,n){var o=Se?ee(t.range.startDate,Se.startDate)&&ee(t.range.endDate,Se.endDate):ee(t.range.startDate,Ge.startDate)&&ee(t.range.endDate,Ge.endDate);return e.jsx("div",{onClick:function(){return st(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),e.jsxs("div",{children:[e.jsx("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===P?"row":"column",gap:2===P?"24px":"0"},children:(et=function(t,n,o,r,i){return void 0===i&&(i=0),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:2===P&&fe?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===P&&fe&&1===i)&&e.jsx("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===P&&fe?"absolute":"relative",left:2===P&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[U[t.month]," ",t.year]}),!(2===P&&fe&&0===i)&&e.jsx("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===P&&fe?"absolute":"relative",right:2===P&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),fe&&re&&1===P&&0===i&&(a=X&&Se?Se:Ge,l=a.startDate?Q(a.startDate,"MMM D, YYYY"):ae,s=a.endDate?Q(a.endDate,"MMM D, YYYY"):se,e.jsxs("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.startDate?"text-[#44403C]":"text-[#79716B]"),children:l}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),fe&&lt&&1===P&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:at.map(function(t,n){var o=Se?ee(t.range.startDate,Se.startDate)&&ee(t.range.endDate,Se.endDate):ee(t.range.startDate,Ge.startDate)&&ee(t.range.endDate,Ge.endDate);return e.jsx("button",{type:"button",onClick:function(){return st(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Ct.map(function(t){return e.jsx("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var o,r,i=(o=t.year,r=t.month,new Date(o,r,1).getDay()),a=(0===i?7:i)-1,l=[],s=0;s<a;s++)l.push(e.jsx("div",{},"empty-".concat(s)));return n.forEach(function(n,o){if(n){var r=a+o,i=n.getMonth()===t.month,s=ee(n,new Date),c=!te(n,W,N);if(fe){var d=X&&Se?Se:Ge,u=ee(n,d.startDate),p=ee(n,d.endDate),f=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(n,d.startDate,d.endDate),h=r%7==0,x=r%7==6,g=u,v=p,m={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor: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(g||v)m.background=pe,m.borderRadius="50%",m.color="#FFFFFF",m.fontWeight=500;else if(f){m.background="#F5F5F4",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;var y=1===n.getDate(),b=$(t.year,t.month),w=n.getDate()===b,C=h||y,F=x||w;C&&F?m.borderRadius="18px":C?(m.borderTopLeftRadius="18px",m.borderBottomLeftRadius="18px",m.borderTopRightRadius="0",m.borderBottomRightRadius="0"):F?(m.borderTopRightRadius="18px",m.borderBottomRightRadius="18px",m.borderTopLeftRadius="0",m.borderBottomLeftRadius="0"):m.borderRadius="0"}else m.background="transparent",m.borderRadius="50%",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return nt(n)},style:m,onMouseEnter:function(e){c||g||v||(e.currentTarget.style.backgroundColor=f?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){g||v||(e.currentTarget.style.backgroundColor=f?"#F5F5F4":"transparent")},children:[n.getDate(),s&&e.jsx("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:g||v?"#FFFFFF":pe}})]},"date-".concat(o)))}else{var k=ee(n,_e);l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return tt(n)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:k?pe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:k?500:400,color:k?"#FFFFFF":i?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||k||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){k||(e.currentTarget.style.backgroundColor="transparent")},children:[n.getDate(),s&&!k&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:pe}})]},"date-".concat(o)))}}}),l}()})]},i);var a,l,s},e.jsxs(e.Fragment,{children:[et(Ae,pt,ct,dt,0),2===P&&fe&&Be&&ft&&et(Be,ft,ht,xt,1)]}))}),fe&&re&&2===P&&!X&&(Ue=Ge,Qe=Ue.startDate?Q(Ue.startDate,"MMM D, YYYY"):ae,$e=Ue.endDate?Q(Ue.endDate,"MMM D, YYYY"):se,e.jsx("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.startDate?"text-[#44403C]":"text-[#79716B]"),children:Qe}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.endDate?"text-[#44403C]":"text-[#79716B]"),children:$e})]})})),fe&&X&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[re&&2===P&&function(){var t=Se||Ge,n=t.startDate?Q(t.startDate,"MMM D, YYYY"):ae,o=t.endDate?Q(t.endDate,"MMM D, YYYY"):se;return e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.startDate?"text-[#44403C]":"text-[#79716B]"),children:n}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),e.jsxs("div",{className:"".concat(2===P?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e.jsx("button",{type:"button",onClick:function(){Ee(null),null==ne||ne(),Ke||Ce(!1),null==D||D(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:G}),e.jsx("button",{type:"button",onClick:function(){var e;Se&&(Ze||ye(Se),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,Se)),null==J||J(Se),Ke||Ce(!1),null==D||D(!1),Ee(null))},disabled:!Se||!Se.startDate||!Se.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Se&&Se.startDate&&Se.endDate?pe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Se&&Se.startDate&&Se.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Se&&Se.startDate&&Se.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Se&&Se.startDate&&Se.endDate&&(e.currentTarget.style.backgroundColor=pe)},children:K})]})]})]})]})}),document.body)]})};ne.displayName="DatePicker";var oe=t.createContext(null),re=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),ie=t.forwardRef(function(n,o){var i=n.initialValues,s=void 0===i?{}:i,c=n.onValuesChange,d=n.onFinish,u=n.onFinishFailed,p=n.labelWidth,f=void 0===p?"120px":p,h=n.labelAlign,x=void 0===h?"right":h,g=n.layout,v=void 0===g?"horizontal":g;n.size;var m=n.className,y=void 0===m?"":m,b=n.style,w=n.children,C=t.useState(function(){var e={};return Object.keys(s).forEach(function(t){e[t]={value:s[t],error:void 0,touched:!1,validating:!1}}),e}),F=C[0],k=C[1],j=t.useRef(F);t.useEffect(function(){j.current=F},[F]);var D=t.useRef({}),S=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),E=t.useCallback(function(e,t){k(function(n){var o=r({},n);if(o[e]?o[e]=r(r({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},j.current[e]?j.current[e]=r(r({},j.current[e]),{value:t}):j.current[e]={value:t,error:void 0,touched:!1,validating:!1},c){var i={};i[e]=t;var a={};Object.keys(o).forEach(function(e){a[e]=o[e].value}),c(i,a)}return o})},[c]),M=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),A=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{error:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),z=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{touched:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),B=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.validating)||!1},[]),T=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{validating:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),R=t.useRef();R.current=function(e,t){k(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 c=o[l],d=i[l];if((null==c?void 0:c.required)!==(null==d?void 0:d.required)||(null==c?void 0:c.message)!==(null==d?void 0:d.message)||(null==c?void 0:c.type)!==(null==d?void 0:d.type)||(null==c?void 0:c.pattern)!==(null==d?void 0:d.pattern)||(null==c?void 0:c.min)!==(null==d?void 0:d.min)||(null==c?void 0:c.max)!==(null==d?void 0:d.max)||(null==c?void 0:c.len)!==(null==d?void 0:d.len)||(null==c?void 0:c.whitespace)!==(null==d?void 0:d.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var u=r({},n);return u[e]?u[e]=r(r({},u[e]),{rules:t.rules,required:t.required}):u[e]={value:s[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},u})};var W=t.useCallback(function(e,t){var n;null===(n=R.current)||void 0===n||n.call(R,e,t)},[]),N=t.useCallback(function(e){delete D.current[e],k(function(t){var n=r({},t);return delete n[e],n}),delete j.current[e]},[]),I=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,i,a,s,c,d,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];T(e,!0),n=t.rules||[],i=0,a=n,l.label=1;case 1:if(!(i<a.length))return[3,6];if(s=a[i],c=t.value,s.required&&(null==c||""===c))return o=s.message||"".concat(e," is required"),[3,6];if(s.type&&null!=c&&""!==c&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[s.type])&&!d(c))return o=s.message||"".concat(e," must be a valid ").concat(s.type),[3,6];if(s.pattern&&null!=c&&""!==c&&!s.pattern.test(String(c)))return o=s.message||"".concat(e," format is invalid"),[3,6];if(void 0!==s.min&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))<s.min)return o=s.message||"".concat(e," must be at least ").concat(s.min),[3,6];if(void 0!==s.max&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))>s.max)return o=s.message||"".concat(e," must be at most ").concat(s.max),[3,6];if(void 0!==s.len&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))!==s.len)return o=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof c&&c.trim()!==c)return o=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,c)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),o=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return i++,[3,1];case 6:return j.current[e]?j.current[e]=r(r({},j.current[e]),{error:o,validating:!1,touched:!0}):j.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},k(function(n){var i=r({},n);return i[e]?i[e]=r(r({},i[e]),{error:o,validating:!1,touched:!0}):i[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},i}),[2,o]}})})},[]),H=t.useCallback(function(e){var t=j.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),Y=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,r,i;return l(this,function(s){switch(s.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return a(void 0,void 0,void 0,function(){var n,o;return l(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,I(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return s.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(s.sent(),o.length>0)throw r=H(),i={values:r,errorFields:o},null==u||u(i),new re("Form validation failed",r,o);return[2,H()]}})})},[I,H,u]),O=t.useCallback(function(e){k(function(t){var n=r({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=r(r({},n[e]),{value:s[e],error:void 0,touched:!1,validating:!1}),j.current[e]=r({},n[e]))}),n})},[s]),V=t.useCallback(function(e){k(function(t){var n=r({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=r(r({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},j.current[t]=r({},n[t])}),c){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),c(e,o)}return n})},[c]),P=t.useCallback(function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Y()];case 1:return e=t.sent(),null==d||d(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[Y,d]),q=t.useCallback(function(e){if(k(function(t){var n=r({},t);return e.forEach(function(e){var t=e.name,o=e.value,i=e.errors,a=i&&i.length>0?i[0]:void 0;n[t]?n[t]=r(r(r({},n[t]),void 0!==o&&{value:o}),{error:a,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:a,touched:!0,validating:!1},j.current[t]=r({},n[t])}),n}),c&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return c(t,H())},0)}},[c,H]),X=t.useCallback(function(e,t){t?D.current[e]=t:delete D.current[e]},[]),Z=t.useCallback(function(e,t){var n=D.current[e];null==n||n.scrollIntoView(r({behavior:"smooth",block:"center"},t))},[]);t.useImperativeHandle(o,function(){return{getFieldValue:S,getFieldsValue:H,setFieldValue:E,setFieldsValue:V,setFields:q,getFieldError:M,validateField:I,validateFields:Y,resetFields:O,submit:P,scrollToField:Z}});var K=t.useMemo(function(){return{fields:F,getFieldValue:S,setFieldValue:E,getFieldError:M,setFieldError:A,isFieldTouched:L,setFieldTouched:z,isFieldValidating:B,setFieldValidating:T,registerField:W,unregisterField:N,validateField:I,validateFields:Y,resetFields:O,getFieldsValue:H,setFieldsValue:V,setFields:q,submit:P,scrollToField:Z,registerFieldRef:X,labelWidth:f,labelAlign:x}},[F,S,E,M,A,L,z,B,T,W,N,I,Y,O,H,V,q,P,Z,X,f,x]),_=r({},b);return"vertical"===v?(_.display="flex",_.flexDirection="column"):"inline"===v&&(_.display="inline-flex",_.flexWrap="wrap",_.gap="16px"),e.jsx(oe.Provider,{value:K,children:e.jsx("form",{className:"aha-form ".concat(y),style:_,onSubmit:function(e){return a(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Y()];case 2:return t=n.sent(),null==d||d(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:w})})});ie.displayName="Form";var ae=ie;ae.Item=function(n){var o=n.name,i=n.label,a=n.htmlFor;n.labelCol,n.wrapperCol;var l=n.required,s=void 0!==l&&l,c=n.rules,d=void 0===c?[]:c;n.hasFeedback;var u=n.validateStatus,p=n.help,f=n.extra,h=n.className,x=void 0===h?"":h,g=n.style,v=n.children;n.labelAlign,n.labelWidth;var m=n.hidden,y=void 0!==m&&m,b=n.tooltip,w=t.useContext(oe),C=t.useRef(null),F=t.useCallback(function(e){C.current=e,o&&(null==w?void 0:w.registerFieldRef)&&w.registerFieldRef(o,e)},[o,w]),k=(null==w?void 0:w.fields)||{};o&&w&&w.getFieldValue(o);var j=o&&w?w.getFieldError(o):void 0,D=!(!o||!w)&&w.isFieldTouched(o),S=!(!o||!w)&&w.isFieldValidating(o);o&&k[o];var E=u||(j?"error":S?"validating":D&&!j?"success":void 0),M=void 0!==p?p:j||void 0,A=t.useRef(d),L=t.useRef(s),z=t.useRef(!1),B=s||d.some(function(e){return e.required}),T=t.useMemo(function(){if(!z.current)return z.current=!0,!0;if(A.current.length!==d.length)return!0;if(A.current===d)return!1;for(var e=0;e<d.length;e++){var t=A.current[e],n=d[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},[d]);t.useEffect(function(){if(o&&w)return(!A.current||T||L.current!==s)&&(A.current=d,L.current=s,w.registerField(o,{rules:d,required:B})),function(){o&&w&&w.unregisterField(o)}},[o]);if(y)return null;return e.jsxs("div",{ref:F,className:"aha-form-item ".concat(x),style:r({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[i&&e.jsxs("label",{htmlFor:a,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[i,B&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),b&&e.jsx(function(n){var o=n.content,r=t.useState(!1),i=r[0],a=r[1],l=t.useRef(null);return t.useEffect(function(){var e=function(e){l.current&&!l.current.contains(e.target)&&a(!1)};if(i)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),a(!i)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(H,{})}),i&&e.jsxs("div",{ref:l,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[o,e.jsx("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:b})]}),e.jsxs("div",{style:{width:"100%"},children:[e.jsx("div",{children:t.Children.map(v,function(e){return t.isValidElement(e)?function(e){var n,i,a,l,s,c,d,u,p;if(!t.isValidElement(e))return e;var f=r({},e.props);if(o&&w){var h=w.getFieldValue(o),x=w.setFieldValue;if(!x)return e;var g=e.type;if(g&&("object"==typeof g||"function"==typeof g)&&"displayName"in g){var v=g.displayName;if("Input"===v||"Textarea"===v){f.value=h||"";var m=null===(n=e.props)||void 0===n?void 0:n.onChange,y=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){x(o,e.target.value),null==m||m(e),o&&w&&setTimeout(function(){w.validateField(o)},0)},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==y||y(e)},f.error="error"===E}else if("Select"===v){f.value=h;var b=null===(a=e.props)||void 0===a?void 0:a.onChange,C=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){x(o,e),null==b||b(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==C||C(e)},f.error="error"===E}else if("Switch"===v){f.checked=h||!1;var F=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(o,e),null==F||F(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Checkbox"===v){f.checked=h||!1;var k=null===(c=e.props)||void 0===c?void 0:c.onChange;f.onChange=function(e){x(o,e.target.checked),null==k||k(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Radio"===v){var j=null===(d=e.props)||void 0===d?void 0:d.value;if(void 0!==j){f.checked=h===j;var D=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){x(o,j),null==D||D(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}}}else{void 0!==h&&(f.value=h);var S=null===(p=e.props)||void 0===p?void 0:p.onChange;f.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;x(o,r),null==S||S(e)}}}return"error"===E&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),M&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===E?"#D92D20":"warning"===E?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:M}),f&&!M&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})},ae.useForm=function(){return[t.useRef(null)]};var le=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,l=n.selectedKeys,c=n.defaultSelectedKeys,d=void 0===c?[]:c,p=n.onSelect,f=n.onDeselect,h=n.onClick,x=n.className,g=void 0===x?"":x,v=n.style,m=n.width,y=void 0===m?320:m;u().primaryColor;var b=t.useRef(null),w=t.useRef({}),C=void 0!==l,F=t.useState(d),k=F[0],j=F[1],D=C?l:k,S=function(e){return"children"in e&&Array.isArray(e.children)},E=t.useCallback(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(S(i)){var a=E(e,i.children,n);if(a)return a}else{var l=i,c=s(s([],n,!0),[l.key],!1);if(l.key===e)return c}}return null},[]),M=t.useCallback(function(e){var t;if(!e.disabled){var n,o=E(e.key,i)||[e.key];D.includes(e.key)?(n=D.filter(function(t){return t!==e.key}),null==f||f({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==p||p({key:e.key,keyPath:o,selectedKeys:n})),C||j(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==h||h({key:e.key,keyPath:o})}},[D,C,p,f,h,i,E]),A=function(t){var n=D.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var o=r({display:"flex",alignItems:"center",padding:"10px 16px",cursor:t.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:t.disabled?.5:1},t.style);return e.jsxs("div",{ref:function(e){w.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:o,onClick:function(){return M(t)},onMouseEnter:function(e){t.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[t.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.icon}),e.jsx("span",{style:{flex:1},children:t.label}),t.suffixIcon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.suffixIcon})]},t.key)},L=r({width:"number"==typeof y?"".concat(y,"px"):y,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},v),z=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!S(o)||!(!S(n)||S(o))};return e.jsxs("div",{ref:b,className:"aha-menu-list ".concat(g),style:L,children:[a&&(a?a.render?a.render(a):e.jsx("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e.jsx("div",{children:i.map(function(n,o){return e.jsxs(t.Fragment,{children:[z(o,i)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),S(n)?(r=n,e.jsx("div",{className:"aha-menu-group ".concat(r.className||""),children:r.children.map(function(e){return A(e)})},"group-".concat(r.title))):A(n)]},o);var r})})]})};le.displayName="MenuList";var se=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,c=0,d=0;switch(n){case"top":c=e.top-t.height-s+i,d=a-t.width/2+r;break;case"bottom":default:c=e.bottom+s+i,d=a-t.width/2+r;break;case"left":c=l-t.height/2+i,d=e.left-t.width-s+r;break;case"right":c=l-t.height/2+i,d=e.right+s+r;break;case"top-left":c=e.top-t.height-s+i,d=e.left+r;break;case"top-right":c=e.top-t.height-s+i,d=e.right-t.width+r;break;case"bottom-left":c=e.bottom+s+i,d=e.left+r;break;case"bottom-right":c=e.bottom+s+i,d=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return d<r+8?d=r+8:d+t.width>r+u-8&&(d=r+u-t.width-8),c<i+8?c=i+8:c+t.height>i+p-8&&(c=i+p-t.height-8),{top:c,left:d}},ce=function(e,t,n,o){void 0===o&&(o=6);var r=se(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,s=i-(window.scrollY||window.pageYOffset),c=a-l,d=s+t.height,u=c+t.width,p=s,f=c,h=Math.max(p,e.top),x=Math.min(d,e.bottom),g=Math.max(f,e.left),v=Math.min(u,e.right);return x>h+1&&v>g+1},de=function(t,n){var o=r({position:"absolute",width:0,height:0,borderStyle:"solid"},n),i={top:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:r(r({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:i[t]})},ue=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},pe=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},fe=function(o){var i=o.children,a=o.content,l=o.trigger,s=void 0===l?"click":l,c=o.placement,d=void 0===c?"right":c,u=o.width,p=o.offset,f=void 0===p?8:p,h=o.className,x=void 0===h?"":h,g=o.popoverClassName,v=void 0===g?"":g,m=o.disabled,y=void 0!==m&&m,b=t.useState(!1),w=b[0],C=b[1],F=t.useState({top:0,left:0,opacity:0}),k=F[0],j=F[1],D=t.useRef(null),S=t.useRef(null),E=t.useCallback(function(){if(w&&D.current&&S.current){var e=D.current.getBoundingClientRect(),t=S.current.getBoundingClientRect(),n=function(){if(ue(e,t,d,f))return d;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(d);return ue(e,t,n,f)||pe(e,n)>pe(e,d)?n:d}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,f),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,s=t;return s<o+8&&(s=o+8),s+n.width>o+i-8&&(s=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:s}}(o.top,o.left,t);j({top:r.top,left:r.left,opacity:1})}},[w,d,f]),M=t.useCallback(function(){y||C(!0)},[y]),A=t.useCallback(function(){C(!1)},[]),L=t.useCallback(function(){y||C(function(e){return!e})},[y]);t.useEffect(function(){if(w)return requestAnimationFrame(function(){E()}),window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),function(){window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[w,E]),t.useEffect(function(){if(w&&"click"===s){var e=function(e){var t=e.target;D.current&&S.current&&!D.current.contains(t)&&!S.current.contains(t)&&A()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[w,s,A]);var z="hover"===s?{onMouseEnter:M,onMouseLeave:A,onFocus:M,onBlur:A}:{onClick:function(e){e.stopPropagation(),L()}},B=w?e.jsx("div",{ref:S,className:"aha-popover ".concat(v),style:{position:"absolute",zIndex:9999,top:k.top,left:k.left,opacity:k.opacity,transition:"opacity 120ms ease-out",width:"number"==typeof u?"".concat(u,"px"):u,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===s?M:void 0,onMouseLeave:"hover"===s?A:void 0,children:a}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:D,className:"aha-popover-trigger ".concat(x),style:{display:"inline-block",cursor:y?"not-allowed":"pointer"}},z,{children:i})),B&&"undefined"!=typeof document&&n.createPortal(B,document.body)]})};fe.displayName="Popover";var he=240,xe=function(o){var i=o.open,a=o.defaultOpen,l=void 0!==a&&a,s=o.onClose,c=o.afterOpenChange,d=o.title,u=o.extra,p=o.footer,f=o.children,h=o.placement,x=void 0===h?"right":h,g=o.width,v=void 0===g?378:g,m=o.height,y=void 0===m?378:m,b=o.mask,w=void 0===b||b,C=o.maskClosable,F=void 0===C||C,k=o.closable,j=void 0===k||k,D=o.closeIcon,S=o.keyboard,E=void 0===S||S,M=o.destroyOnClose,A=void 0!==M&&M,L=o.zIndex,z=void 0===L?1e3:L,B=o.mobileBreakpoint,T=void 0===B?768:B,R=o.className,W=void 0===R?"":R,N=o.style,I=o.drawerStyle,H=o.headerStyle,Y=o.bodyStyle,O=o.footerStyle,V=o.maskStyle,P=void 0!==i,q=t.useState(l),X=q[0],Z=q[1],K=P?!!i:X,_=t.useState(K),G=_[0],J=_[1],U=t.useState(K),Q=U[0],$=U[1],ee=t.useState(!1),te=ee[0],ne=ee[1],oe=t.useState(!1),re=oe[0],ie=oe[1];t.useEffect(function(){ne(!0)},[]),t.useEffect(function(){var e=function(){ie(window.innerWidth<T)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[T]),t.useEffect(function(){if(K){J(!0),$(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){$(!0)})}),t=window.setTimeout(function(){null==c||c(!0)},he);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}$(!1);var n=window.setTimeout(function(){A&&J(!1),null==c||c(!1)},he);return function(){return window.clearTimeout(n)}},[K,A,c]),t.useEffect(function(){if(K&&E){var e=function(e){"Escape"===e.key&&(null==s||s(e),P||Z(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[K,E,s,P]),t.useEffect(function(){if(te&&K){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[K,te]);var ae=t.useCallback(function(e){null==s||s(e),P||Z(!1)},[s,P]),le=t.useMemo(function(){return re?"100vw":"left"===x||"right"===x?"number"==typeof v?"".concat(v,"px"):v:"100vw"},[x,re,v]),se=t.useMemo(function(){return"top"===x||"bottom"===x?"number"==typeof y?"".concat(y,"px"):y:"100vh"},[x,y]),ce=t.useMemo(function(){return re&&("left"===x||"right"===x)?"bottom":x},[re,x]),de=t.useMemo(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(he,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:z+1};switch(ce){case"left":return r(r({},e),{top:0,left:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(-100%)"});case"right":return r(r({},e),{top:0,right:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(100%)"});case"top":return r(r({},e),{top:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(-100%)"});default:return r(r({},e),{bottom:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(100%)"})}},[ce,le,se,Q,z]);if(!te||!G&&!K)return null;var ue=e.jsxs("div",{className:"aha-drawer-root ".concat(W),style:r({position:"fixed",inset:0,zIndex:z,pointerEvents:K||Q?"auto":"none"},N),children:[w&&e.jsx("div",{"aria-hidden":!0,onClick:F?function(e){return ae(e)}:void 0,style:r({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:Q?1:0,transition:"opacity ".concat(he,"ms cubic-bezier(0.2, 0, 0, 1)")},V)}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:r(r({},de),I),children:[(void 0!==d||j||u)&&e.jsxs("div",{style:r({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},H),children:[e.jsx("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:d}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u,j&&e.jsx("button",{type:"button",onClick:function(e){return ae(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:D||e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsx("div",{style:r({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},Y),children:f}),void 0!==p&&e.jsx("div",{style:r({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},O),children:p})]},"".concat(ce,"-").concat(K?"open":"closed"))]});return n.createPortal(ue,document.body)};xe.displayName="Drawer",exports.Alert=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,l=n.title,s=n.description,c=n.icon,d=void 0===c?x[a]:c,u=n.showIcon,p=void 0===u||u,f=n.closeable,h=void 0!==f&&f,v=n.action,m=n.children,y=n.onClose,b=t.useState(!0),w=b[0],C=b[1],F=function(){C(!1),null==y||y()},k=v||h;return w?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[p&&d,e.jsxs("div",{className:"flex flex-col gap-1 ".concat(k?"flex-1 min-w-0":""),children:[l&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:l}),s&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),m&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:m})]}),k&&e.jsxs("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[v,h&&e.jsx("div",{className:"cursor-pointer relative top-[-12px]",onClick:F,onKeyDown:function(e){return"Enter"===e.key&&F()},role:"button",tabIndex:0,"aria-label":"关闭",children:g})]})]}):null},exports.Button=h,exports.CheckIcon=z,exports.Checkbox=O,exports.DatePicker=ne,exports.Drawer=xe,exports.Form=ae,exports.Input=A,exports.MenuList=le,exports.MinusIcon=B,exports.Pagination=Y,exports.Popover=fe,exports.Progress=function(n){var o=n.percent,a=void 0===o?0:o,l=n.type,s=void 0===l?"circle":l,c=n.width,d=void 0===c?120:c,p=n.title,f=n.titlePosition,h=n.showPercent,x=void 0===h||h,g=n.animated,v=void 0!==g&&g,m=n.status,y=void 0===m?"normal":m,b=n.className,w=void 0===b?"":b,C=n.style,F=n.strokeColor,k=n.trailColor,j=void 0===k?"#F5F5F4":k,D=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),S=u().primaryColor,E=Math.min(100,Math.max(0,a)),M=t.useRef(!0),A=t.useState(!1),L=A[0],z=A[1],B=t.useState(0),T=B[0],R=B[1];t.useEffect(function(){if(v&&M.current&&E>0){M.current=!1,R(0),z(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){R(E)})});var e=setTimeout(function(){z(!1),R(E)},300);return function(){return clearTimeout(e)}}M.current?(M.current=!1,z(!1),R(E)):R(E)},[v,E]);var W=F||S||"#FB6011";"success"===y?W="#00BC7D":"exception"===y&&(W="#FB2C36");var N=f||"inside",I=Math.max(4,Math.round(.06*d)),H=(d-I)/2,Y="semicircle"===s?d/2:d,O="14px",V="12px",P=function(){var t=p&&"outside"===N?d+4+18+4:d,n=2*Math.PI*H,o=n-(L?T:E)/100*n;return e.jsxs("div",{style:{position:"relative",width:d,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:d,height:d,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(d/2," ").concat(d/2,")"),style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=r({display:"inline-flex",flexDirection:"column",alignItems:"center",width:d},C);return e.jsx("div",r({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},D,{children:function(){switch(s){case"circle":return P();case"semicircle":return n=I/2,o=d-I/2,r=(t=Y+I)-I/2,i=Y/2+I/2+I/2,a=p&&"outside"===N?t+4+18+4:t,l=Math.PI*H,c=l-(L?T:E)/100*l,e.jsxs("div",{style:{position:"relative",width:d,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:d,height:t,viewBox:"0 0 ".concat(d," ").concat(t),style:{position:"absolute",top:0,left:0},children:[e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:c,style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),P()}var t,n,o,r,i,a,l,c}()}))},exports.Radio=K,exports.Select=L,exports.Switch=G,exports.Tab=function(n){var o=n.items,a=void 0===o?[]:o,l=n.variant,s=void 0===l?"underline":l,c=n.layout,d=void 0===c?"equal":c,p=n.defaultValue,f=n.value,h=n.onChange,x=n.className,g=void 0===x?"":x,v=n.mode,m=void 0===v?"children":v,y=n.scrollable,b=void 0!==y&&y,w=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=u().primaryColor;if(!a||0===a.length)return null;var F=t.useMemo(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),k=void 0!==f,j=F.length>0?F[0].key:"",D=function(e){if(void 0===e)return j;var t=F.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:j},S=t.useState(function(){var e,t=null!==(e=null!=f?f:p)&&void 0!==e?e:j;return D(t)}),E=S[0],M=S[1],A=k?void 0!==f?D(f):j:E;t.useEffect(function(){console.log("[Tab Debug] currentValue:",A,"type:",typeof A),console.log("[Tab Debug] normalizedItems:",F.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",f,"isControlled:",k)},[A,F,f,k]);var L=t.useCallback(function(e,t){if(!t){k||M(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==h||h(n),b&&"underline"===s){var o=T.current[R(e)],r=I.current;if(o&&r){O.current=!0;var i,l=function(){if(r&&W.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},c=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),O.current=!1,r.removeEventListener("scroll",c)},150)};r.addEventListener("scroll",c,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[k,h,a,b,s]),z=F.find(function(e){if(e.key===A)return!0;if(String(e.key)===String(A))return!0;var t=Number(e.key),n=Number(A);return!isNaN(t)&&!isNaN(n)&&t===n}),B=C||"#FB6011",T=t.useRef({}),R=function(e){return String(e)},W=t.useRef(null),N=t.useRef(null),I=t.useRef(null),H=t.useRef(null),Y=t.useRef("");t.useRef(new Set);var O=t.useRef(!1),V=t.useState({width:0,left:0,opacity:0}),P=V[0],q=V[1],X=t.useState({width:0,left:0,opacity:0}),Z=X[0],K=X[1],_=t.useCallback(function(){"underline"===s&&I.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&I.current){var e=T.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=T.current[R(t)]}if(e){var n=I.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=I.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),s="".concat(a,"px");q(function(e){return e.left===l&&e.width===s&&1===e.opacity?e:{width:s,left:l,opacity:1}})}}}})})},[s,A,F]),G=t.useCallback(function(){"background"===s&&H.current&&N.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(N.current&&H.current){var e=T.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=T.current[R(t)]}if(e){var n=H.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");K(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[s,A,F]);t.useEffect(function(){A?Y.current!==A&&(Y.current=A,"underline"===s&&I.current&&!O.current&&_(),"background"===s&&H.current&&N.current&&G()):Y.current=""},[A,s,F.length,k,_,G]),t.useEffect(function(){if(A){var e=setTimeout(function(){if("underline"===s)(e=T.current[R(A)])&&I.current&&W.current&&(_(),b&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=T.current[R(A)])&&H.current&&N.current){var t=H.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");K({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),t.useEffect(function(){if(b&&"underline"===s&&A&&!O.current){var e=setTimeout(function(){var e=T.current[R(A)],t=I.current;if(e&&t){O.current=!0;var n,o=function(){if(t&&W.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),O.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[A,b,s]);var J;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(J={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},b&&(J.overflowX="auto",J.overflowY="hidden",J.scrollBehavior="smooth",J.scrollbarWidth="none",J.WebkitOverflowScrolling="touch"),e.jsxs("div",r({ref:I,className:"aha-tab aha-tab--underline ".concat(b?"aha-tab--scrollable":""," ").concat(g),style:J},w,{children:[e.jsx("div",{ref:W,style:r({position:"absolute",bottom:"0px",height:"2px",backgroundColor:B,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},P)}),F.map(function(n){var o=function(){if(n.key===A)return!0;if(String(n.key)===String(A))return!0;var e=Number(n.key),t=Number(A);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===F[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:A,currentValueType:typeof A,isActive:o,variant:s}),e.jsxs("div",{ref:function(e){T.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:b?0:void 0,whiteSpace:b?"nowrap":void 0},children:[n.icon&&function(){var i,a=typeof n.icon,l=t.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:a,isReactElement:l,iconValue:n.icon}),t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:20,height:20,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?B:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:20,height:20,style:{color:o?B:"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?B:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===d?"100%":"fit-content",e.jsxs("div",r({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(d," ").concat(g),style:n},w,{children:[e.jsx("div",{ref:N,style:r({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},Z)}),F.map(function(n){var o=function(){if(n.key===A)return!0;if(String(n.key)===String(A))return!0;var e=Number(n.key),t=Number(A);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===F[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:A,currentValueType:typeof A,isActive:o,variant:s});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===d?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return e.jsxs("div",{ref:function(e){T.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:i,children:[n.icon&&function(){var i;return t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:16,height:16,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),b&&"underline"===s&&e.jsx("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===m&&(null==z?void 0:z.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:z.children})]})},exports.Table=function(n){var o,a,l,c,d=n.columns,p=void 0===d?[]:d,f=n.dataSource,h=void 0===f?[]:f,x=n.rowKey,g=void 0===x?"key":x,v=n.rowSelection,m=n.pagination,y=void 0!==m&&m,b=n.size,w=void 0===b?"middle":b,C=n.bordered,F=void 0!==C&&C,k=n.loading,j=void 0!==k&&k,D=n.locale,S=n.showHeader,E=void 0===S||S,M=n.title,A=n.footer,L=n.summary,z=n.scroll,B=n.tableLayout,T=void 0===B?"auto":B,R=n.onChange,W=n.onSorterChange,N=n.onPaginationChange,I=n.onRow,H=n.className,V=void 0===H?"":H,K=n.innerClassName,_=void 0===K?"":K,G=n.style,J=n.expandable,U=n.rowClassName,Q=n.onHeaderRow;n.sticky;var $=i(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=u().primaryColor||"#FB6011",te=t.useState((null==v?void 0:v.selectedRowKeys)||(null==v?void 0:v.defaultSelectedRowKeys)||[]),ne=te[0],oe=te[1];t.useEffect(function(){void 0!==(null==v?void 0:v.selectedRowKeys)&&oe(v.selectedRowKeys)},[null==v?void 0:v.selectedRowKeys]);var re=t.useState(new Map),ie=re[0],ae=re[1],le=t.useState((null==J?void 0:J.defaultExpandedRowKeys)||[]),se=le[0],ce=le[1],de=t.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ue=de[0],pe=de[1],fe=t.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),he=fe[0],xe=fe[1];t.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&xe(y.pageSize))},[y]);var ge=t.useState(null),ve=ge[0],me=ge[1],ye=t.useState(null),be=ye[0],we=ye[1],Ce=t.useState(!1),Fe=Ce[0],ke=Ce[1],je=t.useRef(null),De=t.useRef(null);t.useEffect(function(){var e=function(){ke(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Se=t.useCallback(function(e,t){var n,o,r,i=null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e);if(!(null==i?void 0:i.disabled)){var a,l=X(e,g);a="radio"===(null==v?void 0:v.type)?t?[l]:[]:t?s(s([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),oe(a);var c=h.filter(function(e){return a.includes(X(e,g))});null===(o=null==v?void 0:v.onChange)||void 0===o||o.call(v,a,c),null===(r=null==v?void 0:v.onSelect)||void 0===r||r.call(v,e,t,c,new Event("select"))}},[ne,g,v,h]),Ee=t.useCallback(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}).map(function(e){return X(e,g)}),i=e?r:[];oe(i);var a=h.filter(function(e){return i.includes(X(e,g))}),l=e?t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}):[];null===(n=null==v?void 0:v.onChange)||void 0===n||n.call(v,i,a),null===(o=null==v?void 0:v.onSelectAll)||void 0===o||o.call(v,e,a,l)},[g,v,h]),Me=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),W&&W(1===r.length?r[0]:r),R&&R({current:ue,pageSize:he},{},1===r.length?r[0]:r,{currentDataSource:h,action:"sort"})}},[ie,R,W,ue,he,h,p]);t.useCallback(function(e,t){var n,o,r,i=X(e,g);r=t?s(s([],se,!0),[i],!1):se.filter(function(e){return e!==i}),ce(r),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(o=null==J?void 0:J.onExpandedRowsChange)||void 0===o||o.call(J,r)},[se,g,J]);var Ae,Le=t.useCallback(function(){var e=s([],h,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,t);else if(!0===r.sorter){var a=q(e,r.dataIndex||n),l=q(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[h,ie,p]),ze=Le(),Be=Boolean(y&&"object"==typeof y&&void 0!==y.total),Te=t.useMemo(function(){if(!1===y||!y)return ze;if(Be)return ze;var e=(ue-1)*he,t=e+he;return ze.slice(e,t)},[ze,ue,he,y,Be]),Re=t.useCallback(function(e,t){var n,o,r=null!=t?t:he;if(pe(e),t&&xe(t),N&&N(e,r),y&&"object"==typeof y&&(null===(n=y.onChange)||void 0===n||n.call(y,e,t),t&&(null===(o=y.onShowSizeChange)||void 0===o||o.call(y,e,t))),R){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});R({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:ze,action:"paginate"})}},[y,N,R,he,ie,p,ze]),We=t.useCallback(function(e,t,n){var o=q(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Ne=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(v&&("left"===v.fixed||!0===v.fixed))r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=p[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===o){for(i=e+1;i<p.length;i++){var a;if("right"===(a=p[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(v&&"right"===v.fixed)r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;return r}}},[p,v]),Ie=t.useCallback(function(){if(!E)return null;var t,n,o,i,a=p.map(function(t,n){var o,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=ie.get(i)||null,l=Ne(n,t.fixed,!0),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("th",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:a,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){Me(t,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e.jsx(Z,{order:a||void 0})})]})}),i)});if(v){var l="number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!v.hideSelectAll&&"radio"!==v.type&&(t=Te.filter(function(e){var t;return!(null===(t=v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}),n=t.map(function(e){return X(e,g)}),o=t.length>0&&n.every(function(e){return ne.includes(e)}),i=n.some(function(e){return ne.includes(e)}),e.jsx(O,{checked:o,indeterminate:i&&!o,onChange:function(e){return Ee(e.target.checked,Te)}})),v.columnTitle&&e.jsx("span",{style:{marginLeft:v.hideSelectAll?0:"8px"},children:v.columnTitle})]})},"selection");a.unshift(s)}var c=null==Q?void 0:Q(p,0);return e.jsx("thead",{ref:De,children:e.jsx("tr",r({},c||{},{children:a}))})},[p,E,ie,v,ne,Te,g,Me,Ee,D,Q,Ne]),He=t.useCallback(function(e){me(e)},[]),Ye=t.useCallback(function(e,t){e.preventDefault(),we(t)},[]),Oe=t.useCallback(function(e,t){if(e.preventDefault(),null===ve||ve===t)return me(null),void we(null);var n=s([],Te,!0),o=n[ve];n.splice(ve,1),n.splice(t,0,o),me(null),we(null)},[ve,Te]),Ve=t.useCallback(function(){me(null),we(null)},[]),Pe=t.useCallback(function(){var t=null==D?void 0:D.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=p.length+(v?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==D?void 0:D.emptyText,p.length,v]),qe=t.useCallback(function(){return 0===Te.length?Pe():Te.map(function(n,o){var i,a=X(n,g),l=ne.includes(a),s=se.includes(a),c=(null==I?void 0:I(n,o))||{},d=o===Te.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",r({className:"".concat("function"==typeof U?U(n,o):U||""," ").concat(ve===o?"dragging":""," ").concat(be===o?"drag-over":""),draggable:!0,onDragStart:function(){return He(o)},onDragOver:function(e){return Ye(e,o)},onDrop:function(e){return Oe(e,o)},onDragEnd:Ve,style:r({cursor:"move",opacity:ve===o?.5:1,backgroundColor:be===o?"#F9FAFB":"white",transition:"background-color 0.2s"},c.style),onMouseEnter:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="white")}},c,{children:[v&&e.jsx("td",{style:{width:"number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(O,{checked:l,onChange:function(e){return Se(n,e.target.checked)},disabled:null===(i=v.getCheckboxProps)||void 0===i?void 0:i.call(v,n).disabled})})}),p.map(function(t,i){var a,l=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,s=(null===(a=t.onCell)||void 0===a?void 0:a.call(t,n,o))||{},c=Ne(i,t.fixed,!1),u=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("td",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:r({width:u,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:u||void 0,maxWidth:u,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,right:"right"===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},s.style),colSpan:t.colSpan,rowSpan:t.rowSpan},s,{children:We(t,n,o)}),l)})]})),(null==J?void 0:J.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:J.expandedRowRender(n,o,0,!0)})})]},a)})},[Te,g,ne,se,v,p,I,U,Se,We,J,ve,be,He,Ye,Oe,Ve,Ne,Pe]),Xe=function(){var t;if(!1===y||!y)return null;var n=null!==(t=y.total)&&void 0!==t?t:ze.length,o=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e.jsx(Y,{current:ue,total:n,pageSize:he,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:Re,onShowSizeChange:Re,simple:y.simple,responsive:y.responsive,size:"small"===w?"small":"default"})})},Ze=t.useMemo(function(){return p.some(function(e){return e.fixed})||v&&v.fixed},[p,v]),Ke=t.useMemo(function(){return p.every(function(e){return e.width})&&(!v||v.columnWidth)},[p,v]),_e=t.useMemo(function(){if(null==z?void 0:z.x){if("number"==typeof z.x)return z.x;if(!0===z.x)return p.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(v?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth||"60").replace("px",""))||60:0)}if(Ze)return p.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(v&&v.fixed&&v.columnWidth?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth).replace("px",""))||60:0)},[p,null==z?void 0:z.x,v,Ze]),Ge=t.useMemo(function(){return"fixed"===T||Ze||Ke||p.some(function(e){return e.width})?"fixed":T},[T,Ze,Ke,p]),Je=r(r({width:"100%",minWidth:_e?"".concat(_e,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ge,backgroundColor:"white"},F&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=r({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"},G);if(Fe)return e.jsxs("div",r({ref:je,className:"aha-table aha-table-mobile-wrapper ".concat(V),style:Ue,"aria-busy":!!j||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(ze)}),y&&"object"==typeof y&&(null===(o=y.position)||void 0===o?void 0:o.startsWith("top"))&&Xe(),(Ae="function"==typeof(null==D?void 0:D.emptyText)?D.emptyText():void 0!==(null==D?void 0:D.emptyText)?D.emptyText:"No data",0===Te.length?e.jsx("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Ae}):e.jsx("div",{className:"aha-table-mobile",children:Te.map(function(t,n){var o,r=X(t,g),i=ne.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[v&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(O,{checked:i,onChange:function(e){return Se(t,e.target.checked)},disabled:null===(o=v.getCheckboxProps)||void 0===o?void 0:o.call(v,t).disabled})}),p.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=q(t,o.dataIndex||""),a=o.render?o.render(i,t,n):i;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),A&&e.jsx("div",{style:{marginTop:"16px"},children:A(ze)}),y&&("object"!=typeof y||!(null===(a=y.position)||void 0===a?void 0:a.startsWith("top")))&&Xe(),e.jsx(P,{loading:j,spinColor:ee})]}));var Qe={position:"relative",overflowX:(null==z?void 0:z.x)||Ze?"auto":"visible",overflowY:(null==z?void 0:z.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==z?void 0:z.x)?"100%":"number"==typeof(null==z?void 0:z.x)?"".concat(z.x,"px"):void 0,maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",r({ref:je,className:"aha-table ".concat(V),style:Ue,"aria-busy":!!j||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(ze)}),y&&"object"==typeof y&&(null===(l=y.position)||void 0===l?void 0:l.startsWith("top"))&&Xe(),e.jsx("div",{style:Qe,children:e.jsx("div",{style:{width:"100%",minWidth:_e?"".concat(_e,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Je,className:_,children:[Ie(),e.jsx("tbody",{children:qe()}),L&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:L(ze)})})})]})})}),A&&e.jsx("div",{style:{marginTop:"16px"},children:A(ze)}),y&&("object"!=typeof y||!(null===(c=y.position)||void 0===c?void 0:c.startsWith("top")))&&Xe(),e.jsx(P,{loading:j,spinColor:ee})]}))},exports.Tag=function(n){var o=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,c=n.size,d=void 0===c?"large":c,p=n.stroke,f=void 0!==p&&p,h=n.icon,x=n.iconPosition,g=void 0===x?"none":x,v=n.className,m=void 0===v?"":v,y=n.onClick,b=i(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=u().primaryColor,C=function(e,t){if("string"==typeof e&&e in E){var n=E[e];return"Orange"===e&&t?r(r({},n),{fill:r(r({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var o=e.replace("#",""),i=parseInt(o.substr(0,2),16),a=parseInt(o.substr(2,2),16),l=parseInt(o.substr(4,2),16);return{light:{bg:"rgba(".concat(i,", ").concat(a,", ").concat(l,", 0.1)"),text:e,border:"rgba(".concat(i,", ").concat(a,", ").concat(l,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return E.Green}(a,w),F=M[d],k={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"===s&&(k.backgroundColor=C.light.bg,k.color=C.light.text,f&&(k.outline="1px solid",k.outlineOffset="-1px",k.outlineColor=function(e){if("string"==typeof e&&e in E)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"}(a))),y&&(k.cursor="pointer",k.opacity="1");var j=["rounded-md","inline-flex","justify-start","items-center",F.padding,F.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"===s&&(k.backgroundColor=C.fill.bg,k.color=C.fill.text),y&&j.push("cursor-pointer","hover:opacity-80"),m&&j.push(m);var D=j.join(" "),S=function(){if(!h)return null;var n=function(e,t){if("string"==typeof e&&e in E)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"}(a,w),o="small"===d?"14px":"16px";return e.jsx("div",{className:"flex items-center justify-center",style:{width:o,height:o},children:"svg"===h.type?t.cloneElement(h,{width:o,height:o,style:{fill:n}}):h})};return e.jsxs("div",r({className:D,style:k,onClick:y},b,{children:["leading"===g&&S(),e.jsx("div",{className:"px-1 flex justify-center items-center",children:e.jsx("div",{className:"justify-center ".concat(F.textSize," font-medium font-dm-sans ").concat("large"===d?"leading-snug":"leading-none"),children:o})}),"after"===g&&S()]}))},exports.Textarea=_,exports.ThemeProvider=function(n){var o=n.theme,i=n.children,a=t.useMemo(function(){return r(r({},c),o)},[o]);return e.jsx(d.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(C,{id:"direct",props:t})},exports.ToastProvider=function(o){var r=o.children,i=t.useState(!1),a=i[0],l=i[1];return t.useEffect(function(){l(!0)},[]),e.jsxs(e.Fragment,{children:[r,a&&n.createPortal(e.jsx(w,{}),document.body)]})},exports.Tooltip=function(o){var i=o.content,a=o.children,l=o.position,s=void 0===l?"top":l,c=o.trigger,d=void 0===c?"hover":c,u=o.delay,p=void 0===u?200:u,f=o.disabled,h=void 0!==f&&f,x=o.className,g=void 0===x?"":x,v=o.tooltipClassName,m=void 0===v?"":v,y=o.gap,b=void 0===y?6:y,w=o.showArrow,C=void 0===w||w,F=o.width,k=o.defaultVisible,j=void 0!==k&&k,D=o.visible,S=o.onVisibleChange,E=void 0!==D,M=t.useState(j),A=M[0],L=M[1],z=E?D:A,B=t.useState(E?null!=D&&D:j),T=B[0],R=B[1],W=t.useCallback(function(e){E||L(e),null==S||S(e)},[E,S]);t.useEffect(function(){E&&(D?requestAnimationFrame(function(){R(!0)}):R(!1))},[E,D]);var N=t.useState(s),I=N[0],H=N[1],Y=t.useState("320px"),O=Y[0],V=Y[1],P=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===d?"auto":"none"}),q=P[0],X=P[1],Z=t.useState({}),K=Z[0],_=Z[1],G=t.useRef(null),J=t.useRef(null),U=t.useRef(null),Q=t.useRef(null),$=t.useCallback(function(){if(G.current&&J.current&&z&&T){var e=G.current.getBoundingClientRect(),t=J.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!ce(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(!ce(e,t,a,o))return a}return n}(e,t,s,b);H(n);var o=se(e,t,n,b),i=o.top,a=o.left;if(X(function(e){return r(r({},e),{position:"absolute",top:"".concat(i,"px"),left:"".concat(a,"px"),pointerEvents:"hover"===d?"auto":"none",zIndex:9999})}),C){var l=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,c=o-i,d=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,a,i);_(l)}}},[z,s,b,C,T,d]),ee=t.useCallback(function(){h||(Q.current&&(clearTimeout(Q.current),Q.current=null),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){W(!0),E||requestAnimationFrame(function(){R(!0)})},p))},[h,p,W,E]),te=t.useCallback(function(){U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),E?W(!1):(R(!1),Q.current=setTimeout(function(){W(!1),Q.current=null},150))},[W,E]),ne=t.useCallback(function(){"hover"===d&&(Q.current&&(clearTimeout(Q.current),Q.current=null),z||(W(!0),requestAnimationFrame(function(){R(!0)})))},[d,z]),oe=t.useCallback(function(e){h||"click"!==d||(e.stopPropagation(),z?te():(U.current&&(clearTimeout(U.current),U.current=null),W(!0),requestAnimationFrame(function(){R(!0)})))},[h,d,z,te]);t.useEffect(function(){if(j&&z&&T){var e=function(){G.current&&J.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,z,T,$]),t.useEffect(function(){if(z)return requestAnimationFrame(function(){$()}),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),function(){window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[z,$]),t.useEffect(function(){if(z&&"click"===d){var e=function(e){G.current&&J.current&&!G.current.contains(e.target)&&!J.current.contains(e.target)&&te()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[z,d,te]),t.useEffect(function(){return function(){U.current&&clearTimeout(U.current),Q.current&&clearTimeout(Q.current)}},[]);var re={position:"absolute",top:0,left:0,opacity:T?1:0,transform:T?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===d?"auto":"none",zIndex:9999},ie=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){V(ie())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ie]);var ae=r(r({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==F?{width:"number"==typeof F?"".concat(F,"px"):F,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:O,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),le=e.jsxs("div",{style:r(r(r({},re),q),{pointerEvents:"hover"===d?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===d?ne:void 0,onMouseLeave:"hover"===d?te:void 0,children:[e.jsx("div",{ref:J,className:"aha-tooltip ".concat(m),style:ae,role:"tooltip",children:i}),C&&de(I,K)]}),ue=t.useCallback(function(){"hover"===d&&(Q.current=setTimeout(function(){te()},100))},[d,te]),pe="click"===d?{onClick:oe}:{onMouseEnter:ee,onMouseLeave:ue,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:G,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===d?"pointer":"default"}},pe,{children:a})),z&&"undefined"!=typeof document&&n.createPortal(le,document.body)]})},exports.clearAllToasts=function(){b.clearAll()},exports.closeToast=function(e){b.removeToast(e)},exports.debugToast=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",b.getToasts()),console.log("容器根节点:",j),console.log("是否正在初始化:",D),console.log("====================")},exports.toast=F,exports.toastError=function(e,t){return S(),F(r(r({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return S(),F(r(r({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return S(),F(r(r({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return S(),F(r(r({},t),{message:e,type:"success"}))},exports.useTheme=u;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function s(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var c={primaryColor:"#FB6011"},d=t.createContext(c),u=function(){var e=t.useContext(d);return e||c},p={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"}},f=function(t){var n=t.size,o=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},h=function(n){var o,a=n.children,l=n.type,s=void 0===l?"default":l,c=n.size,d=void 0===c?"medium":c,h=n.disabled,x=void 0!==h&&h,g=n.loading,v=void 0!==g&&g,m=n.onClick,y=n.htmlType,b=void 0===y?"button":y,w=n.className,C=void 0===w?"":w,F=n.style,k=n.icon,j=n.iconPosition,D=void 0===j?"left":j,S=i(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),E=u().primaryColor,M=void 0===E?"#FB6011":E,A=t.useState(!1),L=A[0],z=A[1],B=t.useState(!1),T=B[0],R=B[1],W=p[d],N=x||v,I=function(){if(v){var t="primary"===s?"#FFFFFF":"#101828",n=parseInt(W.iconSize.replace("px",""));return e.jsx(f,{size:n,color:t})}return k?e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:W.iconSize,height:W.iconSize,flexShrink:0},children:k}):null},H=(o=r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:W.gap,height:W.height,paddingLeft:W.paddingLeft,paddingRight:W.paddingRight,fontSize:W.fontSize,lineHeight:W.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:N?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},F),"primary"===s?(o.color="#FFFFFF",o.backgroundColor=M,x?(o.opacity=.4,o.cursor="not-allowed"):v?o.backgroundColor=M:T?o.backgroundColor="#EC470A":L&&(o.backgroundColor="#FD843A")):x?(o.backgroundColor="#FAFAF9",o.color="#D6D3D1",o.border="1px solid #E7E5E4"):v?(o.backgroundColor="#FFFFFF",o.color="#101828",o.border="1px solid #E7E5E4",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):T?(o.backgroundColor="#F5F5F4",o.color="#101828",o.border="1px solid #D7D3D0",o.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):L?(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 e.jsxs("button",r({type:b,className:"aha-button aha-button--".concat(s," aha-button--").concat(d," ").concat(N?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(C),disabled:N,onClick:function(e){N?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!N&&z(!0)},onMouseLeave:function(){z(!1),R(!1)},onMouseDown:function(){return!N&&R(!0)},onMouseUp:function(){return R(!1)},style:H},S,{children:[v&&I(),!v&&"left"===D&&I(),a&&e.jsx("span",{style:{display:"inline-block"},children:a}),!v&&"right"===D&&I()]}))};h.displayName="Button";var x={success:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},g=e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),v={success:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},m=function(t){var n=t.className;return e.jsx("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},y=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return s([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),b=new y,w=function(){var n=t.useState([]),o=n[0],i=n[1];t.useEffect(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}),l=o.filter(function(e){return"top-right"===e.props.position}),s=o.filter(function(e){return"bottom-left"===e.props.position}),c=o.filter(function(e){return"bottom-right"===e.props.position});return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e.jsx(C,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:l.map(function(t){return e.jsx(C,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e.jsx(C,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e.jsx(C,r({},t),t.id)})})]})},C=function(n){var o=n.id,r=n.props,i=t.useState(!1),a=i[0],l=i[1],s=t.useState(!1),c=s[0],d=s[1],u=r.message,p=r.type,f=void 0===p?"info":p,h=r.duration,x=void 0===h?3e3:h,g=r.icon,y=r.action,w=r.showClose,C=void 0===w||w,F=r.onClose,k=r.onClick;r.className;var j=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:v.success};case"error":return{bgColor:"#E7000B",defaultIcon:v.error};case"question":return{bgColor:"#1C1917",defaultIcon:v.question};default:return{bgColor:"#1447E6",defaultIcon:v.info}}}(f);t.useEffect(function(){var e=setTimeout(function(){l(!0)},10);return function(){return clearTimeout(e)}},[]),t.useEffect(function(){if(x>0){var e=setTimeout(function(){D()},x);return function(){return clearTimeout(e)}}},[x,o]);var D=t.useCallback(function(){d(!0),setTimeout(function(){b.removeToast(o),null==F||F()},300)},[o,F]),S=t.useCallback(function(){null==k||k()},[k]);return e.jsx("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!c?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!c?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:S,children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:j.bgColor,color:"white"},children:[e.jsx("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:g||j.defaultIcon}),e.jsxs("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e.jsx("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:u}),y&&e.jsx("div",{style:{marginTop:"12px"},children:y})]}),C&&e.jsx("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.jsx(m,{})})]})})},F=function(e){return console.log("Toast: 调用 toast 函数",e),S(),setTimeout(function(){var t=b.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},k=null,j=null,D=!1,S=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(D)console.log("Toast: 容器正在初始化中,跳过");else if(k)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),D=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),k=t,void(D=!1);console.log("Toast: 创建容器元素"),(k=document.createElement("div")).id="aha-toast-container",document.body.appendChild(k),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),j=n(k),console.log("Toast: 渲染 ToastContainer 组件"),j.render(e.jsx(w,{})),console.log("Toast: 容器渲染完成"),D=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),j=n(k),console.log("Toast: 渲染 ToastContainer 组件"),j.render(e.jsx(w,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}D=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),D=!1})}}catch(e){console.error("Toast: 创建容器失败",e),D=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},E={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},M={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"}},A=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"medium":a,s=n.disabled,c=void 0!==s&&s,d=n.error,p=void 0!==d&&d,f=n.readOnly,h=void 0!==f&&f,x=n.prefix,g=n.suffix,v=n.allowClear,m=void 0!==v&&v,y=n.onClear,b=n.className,w=void 0===b?"":b,C=n.style,F=n.type,k=void 0===F?"text":F,j=n.placeholder,D=n.value,S=n.defaultValue,E=n.onChange,M=n.onFocus,A=n.onBlur,L=n.onPressEnter,z=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),B=u().primaryColor,T=void 0===B?"#FB6011":B,R=t.useRef(null),W=t.useState(S||D||""),N=W[0],I=W[1],H=t.useState(!1),Y=H[0],O=H[1];t.useEffect(function(){"function"==typeof o?o(R.current):o&&(o.current=R.current)},[o]);var V=void 0!==D,P=V?D:N,q=function(e){var t;e.stopPropagation(),V||I("");null==E||E({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=R.current)||void 0===t||t.focus()},X=m&&P&&!c,Z={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"}},K=g||X?"40px":"12px",_=r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":Y?T:"#D7D3D0"),backgroundColor:c||h?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:K,paddingTop:Z[l].paddingTop,paddingBottom:Z[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},C);return e.jsxs(e.Fragment,{children:[e.jsx("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 '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[x&&e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:x}),e.jsx("input",r({ref:R,type:k,value:P,placeholder:j,disabled:c,readOnly:h,onChange:function(e){V||I(e.target.value),null==E||E(e)},onFocus:function(e){O(!0),null==M||M(e)},onBlur:function(e){O(!1),null==A||A(e)},onKeyDown:function(e){var t;"Enter"===e.key&&L&&L(e),null===(t=z.onKeyDown)||void 0===t||t.call(z,e)},style:_,autoComplete:z.autoComplete||"off",autoCorrect:z.autoCorrect||"off",autoCapitalize:z.autoCapitalize||"off",spellCheck:z.spellCheck||!1},z)),(g||X)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[X&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:q,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),g&&e.jsx("span",{style:{pointerEvents:"none"},children:g})]})]})]})});A.displayName="Input";var L=function(o){var i,a=o.value,l=o.defaultValue,c=o.options,d=void 0===c?[]:c,p=o.mode,f=o.disabled,h=void 0!==f&&f,x=o.error,g=void 0!==x&&x,v=o.placeholder,m=void 0===v?"Please select":v,y=o.size,b=void 0===y?"medium":y,w=o.showSearch,C=void 0!==w&&w,F=o.filterOption,k=void 0===F||F,j=o.allowClear,D=void 0!==j&&j,S=o.onChange,E=o.onSelect,M=o.onDeselect,A=o.onSearch,L=o.onFocus,z=o.onBlur,B=o.onDropdownVisibleChange,T=o.className,R=void 0===T?"":T,W=o.style,N=o.dropdownClassName,I=void 0===N?"":N,H=o.dropdownStyle,Y=o.defaultOpen,O=void 0!==Y&&Y,V=o.open,P=o.maxTagCount,q=o.tagRender,X=o.optionRender,Z=u().primaryColor,K=void 0===Z?"#FB6011":Z,_=t.useState(void 0!==l?l:p?[]:void 0),G=_[0],J=_[1],U=t.useState(O),Q=U[0],$=U[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),re=oe[0],ie=oe[1],ae=t.useRef(null),le=t.useRef(null),se=t.useRef(null),ce=t.useState(null),de=ce[0],ue=ce[1],pe=void 0!==a,fe=void 0!==V,he=pe?a:G,xe=fe?V:Q,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!he)return[];var e=Array.isArray(he)?he:[he];return d.filter(function(t){return e.includes(t.value)})},[he,d]),me=t.useCallback(function(){return C&&te?!1===k?d:"function"==typeof k?d.filter(function(e){return k(te,e)}):d.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):d},[d,te,C,k]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&ae.current){var e=function(){var e,t;if(ae.current){var n=ae.current.getBoundingClientRect(),o=null!==(t=null===(e=se.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-4:n.bottom+window.scrollY+4;ue({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}ue(null)},[xe,ye.length]),t.useEffect(function(){var e=function(e){var t=e.target;ae.current&&!ae.current.contains(t)&&se.current&&!se.current.contains(t)&&(fe||$(!1),null==B||B(!1),ne(""))};if(xe)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[xe,fe,B]),t.useEffect(function(){if(xe){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),ie(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ie(function(e){return e>0?e-1:0});else if("Enter"===e.key&&re>=0){e.preventDefault();var n=ye[re];n&&!n.disabled&&be(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==B||B(!1),null===(t=ae.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,ye,re,fe,B]),t.useEffect(function(){if(re>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=t.useCallback(function(e){var t;if(!e.disabled)if(ge){var n,o=Array.isArray(he)?he:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==M||M(e.value,e)):(n=s(s([],o,!0),[e.value],!1),null==E||E(e.value,e)),pe||J(n);var r=d.filter(function(e){return n.includes(e.value)});null==S||S(n,r)}else pe||J(e.value),null==S||S(e.value,e),null==E||E(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,he,pe,fe,d,S,E,M,B]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(he)){var n=he.filter(function(e){return e!==t}),o=d.find(function(e){return e.value===t});pe||J(n),null==S||S(n,ve()),null==M||M(t,o)}},[ge,he,pe,d,S,M,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||J(t),null==S||S(t,[]),ne("")},Fe={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"}},ke=t.useMemo(function(){return ve()},[ve]),je=t.useMemo(function(){return D&&he&&!h},[D,he,h]),De=t.useMemo(function(){return ge?Array.isArray(he)&&he.length>0:null!=he&&""!==he},[ge,he]),Se=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===P?ke.slice(0,2):P?ke.slice(0,P):ke,o=P&&ke.length>n.length?ke.length-n.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var o={label:n.label,value:n.value,closable:!h,onClose:function(){return we({},n.value)}};return q?e.jsx(t.Fragment,{children:q(o)},n.value):e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!h&&e.jsx("span",{onClick:function(e){return we(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ge,he,ke,P,h,q]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:ae,className:"aha-select ".concat(R),style:r({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":xe?K:"#D7D3D0"),backgroundColor:h?"#FAFAF9":"#FFFFFF",cursor:h?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Fe[b].paddingTop,paddingBottom:Fe[b].paddingBottom,fontSize:Fe[b].fontSize,lineHeight:Fe[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},W),onClick:function(){if(!h){var e=!xe;fe||$(e),null==B||B(e),e&&C?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==L||L(e)},onBlur:function(e){null==z||z(e)},onTouchStart:function(e){h||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:h?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?Se||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):C&&xe?e.jsx("input",{ref:le,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==A||A(t),ie(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:h?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:De?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:De?h?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:De?(null===(i=ke[0])||void 0===i?void 0:i.label)||he:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[je&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ce,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(t){var n=t.isOpen;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:xe})]})]}),xe&&de&&n.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(I),style:r({position:"absolute",top:"".concat(de.top,"px"),left:"".concat(de.left,"px"),width:"".concat(de.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===de.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===de.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},H),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(t,n){var o=ge?Array.isArray(he)&&he.includes(t.value):he===t.value,r=n===re;return X?e.jsx("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&be(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:X(t,{selected:o,focused:r,disabled:t.disabled||!1})},t.value):e.jsxs("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return be(t)},style:{padding:"8px 16px",cursor:t.disabled?"not-allowed":"pointer",color:t.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e.jsx("span",{children:t.label}),o&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:K,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};L.displayName="Select";var z=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},B=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},T=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},R=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},W=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},N=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},I=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},H=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("g",{clipPath:"url(#clip0_54_1653)",children:e.jsx("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_54_1653",children:e.jsx("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},Y=function(n){var o=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,c=n.pageSize,d=n.defaultPageSize,p=void 0===d?10:d,f=n.showSizeChanger,x=void 0!==f&&f,g=n.pageSizeOptions,v=void 0===g?["10","20","50","100"]:g,m=n.showQuickJumper,y=void 0!==m&&m,b=n.showTotal,w=n.onChange,C=n.onShowSizeChange,F=n.simple,k=void 0!==F&&F,j=n.disabled,D=void 0!==j&&j,S=n.hideOnSinglePage,E=void 0!==S&&S,M=n.className,z=void 0===M?"":M,B=n.style,T=n.size,R=void 0===T?"default":T,W=n.responsive,H=void 0!==W&&W;n.showLessItems;var Y=n.itemRender,O=u().primaryColor,V=void 0===O?"#FB6011":O,P=t.useState(a),q=P[0],X=P[1],Z=t.useState(p),K=Z[0],_=Z[1],G=t.useState(""),J=G[0],U=G[1],Q=null!=o?o:q,$=null!=c?c:K,ee=t.useMemo(function(){return Math.ceil(s/$)},[s,$]);t.useEffect(function(){void 0!==o&&X(o)},[o]),t.useEffect(function(){void 0!==c&&_(c)},[c]);var te=function(e){e<1||e>ee||e===Q||D||(void 0===o&&X(e),null==w||w(e,$))},ne=function(){var e=parseInt(J,10);e>=1&&e<=ee&&(te(e),U(""))};if(E&&ee<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(z),style:B,children:[e.jsx(h,{onClick:function(){return te(Q-1)},disabled:D||1===Q,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ee]}),e.jsx(h,{onClick:function(){return te(Q+1)},disabled:D||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(I,{})})]});var oe=(Q-1)*$+1,re=Math.min(Q*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(z),style:r({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:H?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},B),children:[b&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:b(s,[oe,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:Y?Y(Q-1,"prev",e.jsx(h,{onClick:function(){return te(Q-1)},disabled:D||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})})):e.jsx(h,{onClick:function(){return te(Q-1)},disabled:D||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ee)}else if(Q>=ee-3){e.push(1),e.push("jump-prev");for(t=ee-4;t<=ee;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ee)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e.jsx(h,{onClick:function(){return te(t)},disabled:D,type:n?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return Y?Y(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(h,{onClick:function(){return te(Math.max(1,Q-5))},disabled:D,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(h,{onClick:function(){return te(Math.min(ee,Q+5))},disabled:D,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y(Q+5,"jump-next",o):o;return null}(t)})}),s>0&&e.jsx(e.Fragment,{children:Y?Y(Q+1,"next",e.jsx(h,{onClick:function(){return te(Q+1)},disabled:D||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(I,{})})):e.jsx(h,{onClick:function(){return te(Q+1)},disabled:D||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(I,{})})}),x&&e.jsx(L,{value:$,options:v.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(s/t),r=Q>n?n:Q,void 0===c&&_(t),void 0===o&&X(r),null==C||C(r,t),void(null==w||w(r,t));var t,n,r},disabled:D,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),y&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(A,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:ne,disabled:D,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof y&&y.goButton?e.jsx(h,{onClick:ne,disabled:D,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:y.goButton}):e.jsx(h,{onClick:ne,disabled:D,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},O=function(t){var n=t.checked,o=void 0!==n&&n,i=t.indeterminate,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l,c=t.onChange,d=t.className,p=void 0===d?"":d,f=t.style,h=t.children,x=u().primaryColor,g=o||a,v=s?"#FAFAF9":g?x:"white",m=s?"#FAFAF9":g?x:"#D7D3D0";return e.jsxs("div",{className:"aha-checkbox ".concat(p),style:r({display:"inline-flex",alignItems:"center",gap:"8px",cursor:s?"not-allowed":"pointer"},f),onClick:function(e){s||(null==c||c({target:{checked:!o},currentTarget:{checked:!o}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:g?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:a?e.jsx(B,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(z,{style:{width:"14px",height:"14px",display:"block"}})})}),h&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:s?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:h}),e.jsx("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=a)},onChange:c,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};O.displayName="Checkbox";var V=function(t){var n=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},P=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e.jsx(V,{color:o}):n;return e.jsx("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},q=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)},X=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=q(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},Z=function(t){var n=t.order,o=u().primaryColor;return"ascend"===n?e.jsx(W,{style:{color:o}}):"descend"===n?e.jsx(R,{style:{color:o}}):e.jsx(T,{})},K=function(t){var n=t.checked,o=void 0!==n&&n,i=t.disabled,a=void 0!==i&&i,l=t.onChange,s=t.className,c=void 0===s?"":s,d=t.style,p=t.children,f=t.value,h=t.name,x=u().primaryColor,g=void 0===x?"#FB6011":x,v=a?"#FAFAF9":o?g:"white",m=a?"#FAFAF9":o?g:"#D7D3D0";return e.jsxs("div",{className:"aha-radio ".concat(c),style:r({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},d),onClick:function(e){a||(null==l||l({target:{checked:!o,value:f},currentTarget:{checked:!o,value:f}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("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"}})}),p&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:p}),e.jsx("input",{type:"radio",checked:o,onChange:l,disabled:a,value:f,name:h,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};K.displayName="Radio";var _=t.forwardRef(function(n,o){var a=n.disabled,l=void 0!==a&&a,s=n.error,c=void 0!==s&&s,d=n.readOnly,p=void 0!==d&&d,f=n.showCount,h=void 0!==f&&f,x=n.maxLength,g=n.className,v=void 0===g?"":g,m=n.style,y=n.placeholder,b=n.value,w=n.defaultValue,C=n.rows,F=void 0===C?3:C,k=n.autoSize,j=void 0!==k&&k,D=n.onChange,S=n.onFocus,E=n.onBlur,M=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),A=u().primaryColor,L=void 0===A?"#FB6011":A,z=t.useRef(null),B=t.useState(w||b||""),T=B[0],R=B[1],W=t.useState(!1),N=W[0],I=W[1],H=t.useState(void 0),Y=H[0],O=H[1];t.useEffect(function(){"function"==typeof o?o(z.current):o&&(o.current=z.current)},[o]);var V=void 0!==b,P=V?b:T,q=String(P||"").length;t.useEffect(function(){if(j&&z.current){var e=z.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),O(l)}},[P,j]);var X=r(r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":N?L:"#D7D3D0"),backgroundColor:l||p?"#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:j?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==Y&&j?{height:"".concat(Y,"px")}:{}),m);return e.jsxs(e.Fragment,{children:[e.jsx("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 "}),e.jsxs("div",{className:"aha-textarea-wrapper ".concat(v),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e.jsx("textarea",r({ref:z,value:P,placeholder:y,disabled:l,readOnly:p,rows:j?void 0:F,maxLength:x,onChange:function(e){V||R(e.target.value),null==D||D(e)},onFocus:function(e){I(!0),null==S||S(e)},onBlur:function(e){I(!1),null==E||E(e)},style:X,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(h||x)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:x?e.jsxs("span",{children:[q," / ",x]}):e.jsx("span",{children:q})})]})]})});_.displayName="Textarea";var G=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,c=n.onChange,d=n.onClick,p=n.checkedChildren,f=n.unCheckedChildren,h=n.size,x=void 0===h?"default":h,g=n.loading,v=void 0!==g&&g,m=n.className,y=void 0===m?"":m,b=n.style,w=u().primaryColor,C=void 0===w?"#FB6011":w,F=t.useState(a),k=F[0],j=F[1],D=void 0!==o,S=D?o:k,E={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],M=S||v,A=s?"#E7E5E4":M?C:"#F5F5F4",L=M?"calc(100% - ".concat(E.thumbSize," - ").concat(E.thumbOffset,")"):E.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":S,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!S;D||j(t),null==c||c(t,e),null==d||d(t,e)}},className:"aha-switch ".concat(y),style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:E.width,height:E.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===x?"10px":"12px",backgroundColor:A,cursor:s||v?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(p||f)&&e.jsx("span",{style:{position:"absolute",left:M?"6px":"auto",right:M?"auto":"6px",fontSize:E.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:s?.5:1,zIndex:1,pointerEvents:"none"},children:M?p:f}),e.jsx("span",{style:{position:"absolute",left:L,top:"50%",transform:"translateY(-50%)",width:E.thumbSize,height:E.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:v&&e.jsxs("svg",{width:"small"===x?"8":"10",height:"small"===x?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};G.displayName="Switch";var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],U=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=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"),U[o]).replace(new RegExp("","g"),J[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},$=function(e,t){return new Date(e,t+1,0).getDate()},ee=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},te=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},ne=function(o){var i=o.mode,a=void 0===i?"date":i,l=o.disabled,s=void 0!==l&&l,c=o.error,d=void 0!==c&&c,p=o.placeholder,f=void 0===p?"Select date":p,h=o.startPlaceholder,x=void 0===h?"Start date":h,g=o.endPlaceholder,v=void 0===g?"End date":g,m=o.size,y=void 0===m?"medium":m,b=o.allowClear,w=void 0!==b&&b,C=o.format,F=void 0===C?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":C,k=o.onFocus,j=o.onBlur,D=o.onOpenChange,S=o.className,E=void 0===S?"":S,M=o.style,A=o.dropdownClassName,L=void 0===A?"":A,z=o.dropdownStyle,B=o.defaultOpen,T=void 0!==B&&B,R=o.open,W=o.minDate,N=o.maxDate,I=o.separator,H=void 0===I?" - ":I,Y=o.presetRanges,O=void 0!==Y&&Y,V=o.calendarCount,P=void 0===V?1:V,q=o.showApplyCancel,X=void 0!==q&&q,Z=o.applyText,K=void 0===Z?"Apply":Z,_=o.cancelText,G=void 0===_?"Cancel":_,J=o.onApply,ne=o.onCancel,oe=o.showSelectedRange,re=void 0!==oe&&oe,ie=o.startSelectedRangeText,ae=void 0===ie?"Select dates":ie,le=o.endSelectedRangeText,se=void 0===le?"Select dates":le,ce=o.rangeDisplayMode,de=void 0===ce?"range":ce,ue=u().primaryColor,pe=void 0===ue?"#FB6011":ue,fe="range"===a,he=t.useState(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),xe=he[0],ge=he[1],ve=t.useState(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),me=ve[0],ye=ve[1],be=t.useState(T),we=be[0],Ce=be[1],Fe=t.useState(!0),ke=Fe[0],je=Fe[1],De=t.useState(null),Se=De[0],Ee=De[1],Me=t.useState(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ae=Me[0],Le=Me[1],ze=t.useState(function(){if(2===P&&fe){var e=new Date(Ae.year,Ae.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Be=ze[0],Te=ze[1];t.useEffect(function(){if(2===P&&fe){var e=new Date(Ae.year,Ae.month+1,1);Te({year:e.getFullYear(),month:e.getMonth()})}else Te(null)},[Ae,P,fe]);var Re=t.useRef(null),We=t.useRef(null),Ne=t.useRef(null),Ie=t.useRef(null),He=t.useRef(null),Ye=t.useState(null),Oe=Ye[0],Ve=Ye[1],Pe=t.useRef(!1),qe=t.useRef(!1),Xe=t.useRef(null),Ze="value"in o&&void 0!==o.value,Ke=void 0!==R,_e=fe?null:Ze&&"date"===a&&"value"in o?o.value:xe,Ge=fe?Ze&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:me:{startDate:null,endDate:null},Je=Ke?R:we;t.useEffect(function(){if(Je&&!Pe.current){if(fe){var e=Ge.startDate||Ge.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Le({year:t,month:n})}else{var o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}}else if(_e){t=_e.getFullYear(),n=_e.getMonth();Le({year:t,month:n})}else{o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}Pe.current=!0}else Je||(Pe.current=!1)},[Je,_e,Ge,fe]),t.useEffect(function(){if(Je&&Re.current){qe.current=!1,Xe.current=null;var e=function(){if(Re.current){var e=Re.current.getBoundingClientRect();if(qe.current&&null!==Xe.current){var t,n=Xe.current;if(He.current){var o=He.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Ve({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";Ve({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(He.current){var t=He.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),qe.current=!0,Xe.current=i}Ve({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Ve(null),qe.current=!1,Xe.current=null},[Je]),t.useEffect(function(){var e=function(e){var t=e.target;Re.current&&!Re.current.contains(t)&&He.current&&!He.current.contains(t)&&(Ke||Ce(!1),null==D||D(!1))};if(Je)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Je,Ke,D]);var Ue,Qe,$e,et,tt=t.useCallback(function(e){var t;te(e,W,N)&&(Ze||ge(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ke||Ce(!1),null==D||D(!1))},[Ze,Ke,a,o,D,W,N]),nt=t.useCallback(function(e){var t;if(te(e,W,N)){var n,r=X&&Se?Se:Ge;r.startDate&&r.endDate?(n={startDate:e,endDate:null},je(!1)):ke?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},je(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(je(!0),X||(Ke||Ce(!1),null==D||D(!1))):je(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},je(!1)):(n={startDate:r.startDate,endDate:e},je(!0),X||(Ke||Ce(!1),null==D||D(!1))),X?Ee(n):(Ze||ye(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[ke,Ge,Se,X,Ze,Ke,a,o,D,W,N]),ot=function(e){var t,n;if(e.stopPropagation(),fe){var r={startDate:null,endDate:null};Ze||ye(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),je(!0)}else Ze||ge(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!Je){var i=new Date;Le({year:i.getFullYear(),month:i.getMonth()})}},rt=function(){if(!s){var e=!Je;if(Ke||Ce(e),null==D||D(e),e){if(fe){if(je(!Ge.startDate),X&&Ee(Ge),!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else if(!_e){t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else!e&&X&&Ee(null)}},it=t.useMemo(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),at=t.useMemo(function(){return Array.isArray(O)?O:!0===O?it:[]},[O,it]),lt=at.length>0,st=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Le({year:n,month:r})}X?Ee(e):(Ze||ye(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ke||Ce(!1),null==D||D(!1))},ct=function(){Le(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},dt=function(){Le(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},ut=t.useCallback(function(e,t){for(var n=$(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),pt=t.useMemo(function(){return ut(Ae.year,Ae.month)},[Ae,ut]),ft=t.useMemo(function(){return 2===P&&fe&&Be?ut(Be.year,Be.month):null},[P,fe,Be,ut]),ht=function(){Be&&Te(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},xt=function(){Be&&Te(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},gt={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},vt=w&&!s&&(fe?Ge.startDate||Ge.endDate:_e),mt=_e?Q(_e,F):"",yt=Ge.startDate?Q(Ge.startDate,F):"",bt=Ge.endDate?Q(Ge.endDate,F):"",wt=t.useMemo(function(){if(!fe||"text"!==de)return"";if(Ge.startDate&&Ge.endDate){var e=Q(Ge.startDate,"MMM D, YYYY"),t=Q(Ge.endDate,"MMM D, YYYY");return"".concat(e," ").concat(H," ").concat(t)}return Ge.startDate?Q(Ge.startDate,"MMM D, YYYY"):Ge.endDate?Q(Ge.endDate,"MMM D, YYYY"):""},[fe,de,Ge,H]),Ct=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:Re,className:"aha-date-picker ".concat(E),style:r({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(d?"#F04438":Je?pe:"#D7D3D0"),backgroundColor:s?"#FAFAF9":"#FFFFFF",cursor:s?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:vt?"30px":"12px",paddingTop:gt[y].paddingTop,paddingBottom:gt[y].paddingBottom,fontSize:gt[y].fontSize,lineHeight:gt[y].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},M),onClick:rt,onFocus:function(e){null==k||k(e)},onBlur:function(e){null==j||j(e)},tabIndex:s?-1:0,children:[e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:s?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),fe?"text"===de?e.jsx("input",{ref:We,type:"text",value:wt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate||Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):e.jsxs("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e.jsx("input",{ref:Ne,type:"text",value:yt,readOnly:!0,placeholder:x,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!0),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e.jsx("span",{style:{color:s?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:H}),e.jsx("input",{ref:Ie,type:"text",value:bt,readOnly:!0,placeholder:v,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!1),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e.jsx("input",{ref:We,type:"text",value:mt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":_e?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),vt&&e.jsx("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:ot,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),Je&&Oe&&n.createPortal(e.jsx("div",{ref:He,className:"aha-date-picker-dropdown ".concat(L),style:r({position:"absolute",top:"".concat(Oe.top,"px"),left:"".concat(Oe.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Oe.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Oe.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},z),children:e.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:fe&&lt&&1===P?"column":"row"},children:[fe&&lt&&2===P&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:X?"0":"8px"},children:at.map(function(t,n){var o=Se?ee(t.range.startDate,Se.startDate)&&ee(t.range.endDate,Se.endDate):ee(t.range.startDate,Ge.startDate)&&ee(t.range.endDate,Ge.endDate);return e.jsx("div",{onClick:function(){return st(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),e.jsxs("div",{children:[e.jsx("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===P?"row":"column",gap:2===P?"24px":"0"},children:(et=function(t,n,o,r,i){return void 0===i&&(i=0),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:2===P&&fe?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===P&&fe&&1===i)&&e.jsx("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===P&&fe?"absolute":"relative",left:2===P&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[U[t.month]," ",t.year]}),!(2===P&&fe&&0===i)&&e.jsx("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===P&&fe?"absolute":"relative",right:2===P&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),fe&&re&&1===P&&0===i&&(a=X&&Se?Se:Ge,l=a.startDate?Q(a.startDate,"MMM D, YYYY"):ae,s=a.endDate?Q(a.endDate,"MMM D, YYYY"):se,e.jsxs("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.startDate?"text-[#44403C]":"text-[#79716B]"),children:l}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),fe&&lt&&1===P&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:at.map(function(t,n){var o=Se?ee(t.range.startDate,Se.startDate)&&ee(t.range.endDate,Se.endDate):ee(t.range.startDate,Ge.startDate)&&ee(t.range.endDate,Ge.endDate);return e.jsx("button",{type:"button",onClick:function(){return st(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Ct.map(function(t){return e.jsx("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var o,r,i=(o=t.year,r=t.month,new Date(o,r,1).getDay()),a=(0===i?7:i)-1,l=[],s=0;s<a;s++)l.push(e.jsx("div",{},"empty-".concat(s)));return n.forEach(function(n,o){if(n){var r=a+o,i=n.getMonth()===t.month,s=ee(n,new Date),c=!te(n,W,N);if(fe){var d=X&&Se?Se:Ge,u=ee(n,d.startDate),p=ee(n,d.endDate),f=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(n,d.startDate,d.endDate),h=r%7==0,x=r%7==6,g=u,v=p,m={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor: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(g||v)m.background=pe,m.borderRadius="50%",m.color="#FFFFFF",m.fontWeight=500;else if(f){m.background="#F5F5F4",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;var y=1===n.getDate(),b=$(t.year,t.month),w=n.getDate()===b,C=h||y,F=x||w;C&&F?m.borderRadius="18px":C?(m.borderTopLeftRadius="18px",m.borderBottomLeftRadius="18px",m.borderTopRightRadius="0",m.borderBottomRightRadius="0"):F?(m.borderTopRightRadius="18px",m.borderBottomRightRadius="18px",m.borderTopLeftRadius="0",m.borderBottomLeftRadius="0"):m.borderRadius="0"}else m.background="transparent",m.borderRadius="50%",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return nt(n)},style:m,onMouseEnter:function(e){c||g||v||(e.currentTarget.style.backgroundColor=f?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){g||v||(e.currentTarget.style.backgroundColor=f?"#F5F5F4":"transparent")},children:[n.getDate(),s&&e.jsx("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:g||v?"#FFFFFF":pe}})]},"date-".concat(o)))}else{var k=ee(n,_e);l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return tt(n)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:k?pe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:k?500:400,color:k?"#FFFFFF":i?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||k||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){k||(e.currentTarget.style.backgroundColor="transparent")},children:[n.getDate(),s&&!k&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:pe}})]},"date-".concat(o)))}}}),l}()})]},i);var a,l,s},e.jsxs(e.Fragment,{children:[et(Ae,pt,ct,dt,0),2===P&&fe&&Be&&ft&&et(Be,ft,ht,xt,1)]}))}),fe&&re&&2===P&&!X&&(Ue=Ge,Qe=Ue.startDate?Q(Ue.startDate,"MMM D, YYYY"):ae,$e=Ue.endDate?Q(Ue.endDate,"MMM D, YYYY"):se,e.jsx("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.startDate?"text-[#44403C]":"text-[#79716B]"),children:Qe}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.endDate?"text-[#44403C]":"text-[#79716B]"),children:$e})]})})),fe&&X&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[re&&2===P&&function(){var t=Se||Ge,n=t.startDate?Q(t.startDate,"MMM D, YYYY"):ae,o=t.endDate?Q(t.endDate,"MMM D, YYYY"):se;return e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.startDate?"text-[#44403C]":"text-[#79716B]"),children:n}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),e.jsxs("div",{className:"".concat(2===P?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e.jsx("button",{type:"button",onClick:function(){Ee(null),null==ne||ne(),Ke||Ce(!1),null==D||D(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:G}),e.jsx("button",{type:"button",onClick:function(){var e;Se&&(Ze||ye(Se),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,Se)),null==J||J(Se),Ke||Ce(!1),null==D||D(!1),Ee(null))},disabled:!Se||!Se.startDate||!Se.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Se&&Se.startDate&&Se.endDate?pe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Se&&Se.startDate&&Se.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Se&&Se.startDate&&Se.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Se&&Se.startDate&&Se.endDate&&(e.currentTarget.style.backgroundColor=pe)},children:K})]})]})]})]})}),document.body)]})};ne.displayName="DatePicker";var oe=t.createContext(null),re=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),ie=t.forwardRef(function(n,o){var i=n.initialValues,s=void 0===i?{}:i,c=n.onValuesChange,d=n.onFinish,u=n.onFinishFailed,p=n.labelWidth,f=void 0===p?"120px":p,h=n.labelAlign,x=void 0===h?"right":h,g=n.layout,v=void 0===g?"horizontal":g;n.size;var m=n.className,y=void 0===m?"":m,b=n.style,w=n.children,C=t.useState(function(){var e={};return Object.keys(s).forEach(function(t){e[t]={value:s[t],error:void 0,touched:!1,validating:!1}}),e}),F=C[0],k=C[1],j=t.useRef(F);t.useEffect(function(){j.current=F},[F]);var D=t.useRef({}),S=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),E=t.useCallback(function(e,t){k(function(n){var o=r({},n);if(o[e]?o[e]=r(r({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},j.current[e]?j.current[e]=r(r({},j.current[e]),{value:t}):j.current[e]={value:t,error:void 0,touched:!1,validating:!1},c){var i={};i[e]=t;var a={};Object.keys(o).forEach(function(e){a[e]=o[e].value}),c(i,a)}return o})},[c]),M=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),A=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{error:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),z=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{touched:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),B=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.validating)||!1},[]),T=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{validating:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),R=t.useRef();R.current=function(e,t){k(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 c=o[l],d=i[l];if((null==c?void 0:c.required)!==(null==d?void 0:d.required)||(null==c?void 0:c.message)!==(null==d?void 0:d.message)||(null==c?void 0:c.type)!==(null==d?void 0:d.type)||(null==c?void 0:c.pattern)!==(null==d?void 0:d.pattern)||(null==c?void 0:c.min)!==(null==d?void 0:d.min)||(null==c?void 0:c.max)!==(null==d?void 0:d.max)||(null==c?void 0:c.len)!==(null==d?void 0:d.len)||(null==c?void 0:c.whitespace)!==(null==d?void 0:d.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var u=r({},n);return u[e]?u[e]=r(r({},u[e]),{rules:t.rules,required:t.required}):u[e]={value:s[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},u})};var W=t.useCallback(function(e,t){var n;null===(n=R.current)||void 0===n||n.call(R,e,t)},[]),N=t.useCallback(function(e){delete D.current[e],k(function(t){var n=r({},t);return delete n[e],n}),delete j.current[e]},[]),I=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,i,a,s,c,d,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];T(e,!0),n=t.rules||[],i=0,a=n,l.label=1;case 1:if(!(i<a.length))return[3,6];if(s=a[i],c=t.value,s.required&&(null==c||""===c))return o=s.message||"".concat(e," is required"),[3,6];if(s.type&&null!=c&&""!==c&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[s.type])&&!d(c))return o=s.message||"".concat(e," must be a valid ").concat(s.type),[3,6];if(s.pattern&&null!=c&&""!==c&&!s.pattern.test(String(c)))return o=s.message||"".concat(e," format is invalid"),[3,6];if(void 0!==s.min&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))<s.min)return o=s.message||"".concat(e," must be at least ").concat(s.min),[3,6];if(void 0!==s.max&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))>s.max)return o=s.message||"".concat(e," must be at most ").concat(s.max),[3,6];if(void 0!==s.len&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))!==s.len)return o=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof c&&c.trim()!==c)return o=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,c)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),o=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return i++,[3,1];case 6:return j.current[e]?j.current[e]=r(r({},j.current[e]),{error:o,validating:!1,touched:!0}):j.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},k(function(n){var i=r({},n);return i[e]?i[e]=r(r({},i[e]),{error:o,validating:!1,touched:!0}):i[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},i}),[2,o]}})})},[]),H=t.useCallback(function(e){var t=j.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),Y=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,r,i;return l(this,function(s){switch(s.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return a(void 0,void 0,void 0,function(){var n,o;return l(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,I(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return s.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(s.sent(),o.length>0)throw r=H(),i={values:r,errorFields:o},null==u||u(i),new re("Form validation failed",r,o);return[2,H()]}})})},[I,H,u]),O=t.useCallback(function(e){k(function(t){var n=r({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=r(r({},n[e]),{value:s[e],error:void 0,touched:!1,validating:!1}),j.current[e]=r({},n[e]))}),n})},[s]),V=t.useCallback(function(e){k(function(t){var n=r({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=r(r({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},j.current[t]=r({},n[t])}),c){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),c(e,o)}return n})},[c]),P=t.useCallback(function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Y()];case 1:return e=t.sent(),null==d||d(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[Y,d]),q=t.useCallback(function(e){if(k(function(t){var n=r({},t);return e.forEach(function(e){var t=e.name,o=e.value,i=e.errors,a=i&&i.length>0?i[0]:void 0;n[t]?n[t]=r(r(r({},n[t]),void 0!==o&&{value:o}),{error:a,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:a,touched:!0,validating:!1},j.current[t]=r({},n[t])}),n}),c&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return c(t,H())},0)}},[c,H]),X=t.useCallback(function(e,t){t?D.current[e]=t:delete D.current[e]},[]),Z=t.useCallback(function(e,t){var n=D.current[e];null==n||n.scrollIntoView(r({behavior:"smooth",block:"center"},t))},[]);t.useImperativeHandle(o,function(){return{getFieldValue:S,getFieldsValue:H,setFieldValue:E,setFieldsValue:V,setFields:q,getFieldError:M,validateField:I,validateFields:Y,resetFields:O,submit:P,scrollToField:Z}});var K=t.useMemo(function(){return{fields:F,getFieldValue:S,setFieldValue:E,getFieldError:M,setFieldError:A,isFieldTouched:L,setFieldTouched:z,isFieldValidating:B,setFieldValidating:T,registerField:W,unregisterField:N,validateField:I,validateFields:Y,resetFields:O,getFieldsValue:H,setFieldsValue:V,setFields:q,submit:P,scrollToField:Z,registerFieldRef:X,labelWidth:f,labelAlign:x}},[F,S,E,M,A,L,z,B,T,W,N,I,Y,O,H,V,q,P,Z,X,f,x]),_=r({},b);return"vertical"===v?(_.display="flex",_.flexDirection="column"):"inline"===v&&(_.display="inline-flex",_.flexWrap="wrap",_.gap="16px"),e.jsx(oe.Provider,{value:K,children:e.jsx("form",{className:"aha-form ".concat(y),style:_,onSubmit:function(e){return a(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Y()];case 2:return t=n.sent(),null==d||d(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:w})})});ie.displayName="Form";var ae=ie;ae.Item=function(n){var o=n.name,i=n.label,a=n.htmlFor;n.labelCol,n.wrapperCol;var l=n.required,s=void 0!==l&&l,c=n.rules,d=void 0===c?[]:c;n.hasFeedback;var u=n.validateStatus,p=n.help,f=n.extra,h=n.className,x=void 0===h?"":h,g=n.style,v=n.children;n.labelAlign,n.labelWidth;var m=n.hidden,y=void 0!==m&&m,b=n.tooltip,w=t.useContext(oe),C=t.useRef(null),F=t.useCallback(function(e){C.current=e,o&&(null==w?void 0:w.registerFieldRef)&&w.registerFieldRef(o,e)},[o,w]),k=(null==w?void 0:w.fields)||{};o&&w&&w.getFieldValue(o);var j=o&&w?w.getFieldError(o):void 0,D=!(!o||!w)&&w.isFieldTouched(o),S=!(!o||!w)&&w.isFieldValidating(o);o&&k[o];var E=u||(j?"error":S?"validating":D&&!j?"success":void 0),M=void 0!==p?p:j||void 0,A=t.useRef(d),L=t.useRef(s),z=t.useRef(!1),B=s||d.some(function(e){return e.required}),T=t.useMemo(function(){if(!z.current)return z.current=!0,!0;if(A.current.length!==d.length)return!0;if(A.current===d)return!1;for(var e=0;e<d.length;e++){var t=A.current[e],n=d[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},[d]);t.useEffect(function(){if(o&&w)return(!A.current||T||L.current!==s)&&(A.current=d,L.current=s,w.registerField(o,{rules:d,required:B})),function(){o&&w&&w.unregisterField(o)}},[o]);if(y)return null;return e.jsxs("div",{ref:F,className:"aha-form-item ".concat(x),style:r({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[i&&e.jsxs("label",{htmlFor:a,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[i,B&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),b&&e.jsx(function(n){var o=n.content,r=t.useState(!1),i=r[0],a=r[1],l=t.useRef(null);return t.useEffect(function(){var e=function(e){l.current&&!l.current.contains(e.target)&&a(!1)};if(i)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),a(!i)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(H,{})}),i&&e.jsxs("div",{ref:l,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[o,e.jsx("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:b})]}),e.jsxs("div",{style:{width:"100%"},children:[e.jsx("div",{children:t.Children.map(v,function(e){return t.isValidElement(e)?function(e){var n,i,a,l,s,c,d,u,p;if(!t.isValidElement(e))return e;var f=r({},e.props);if(o&&w){var h=w.getFieldValue(o),x=w.setFieldValue;if(!x)return e;var g=e.type;if(g&&("object"==typeof g||"function"==typeof g)&&"displayName"in g){var v=g.displayName;if("Input"===v||"Textarea"===v){f.value=h||"";var m=null===(n=e.props)||void 0===n?void 0:n.onChange,y=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){x(o,e.target.value),null==m||m(e),o&&w&&setTimeout(function(){w.validateField(o)},0)},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==y||y(e)},f.error="error"===E}else if("Select"===v){f.value=h;var b=null===(a=e.props)||void 0===a?void 0:a.onChange,C=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){x(o,e),null==b||b(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==C||C(e)},f.error="error"===E}else if("Switch"===v){f.checked=h||!1;var F=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(o,e),null==F||F(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Checkbox"===v){f.checked=h||!1;var k=null===(c=e.props)||void 0===c?void 0:c.onChange;f.onChange=function(e){x(o,e.target.checked),null==k||k(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Radio"===v){var j=null===(d=e.props)||void 0===d?void 0:d.value;if(void 0!==j){f.checked=h===j;var D=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){x(o,j),null==D||D(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}}}else{void 0!==h&&(f.value=h);var S=null===(p=e.props)||void 0===p?void 0:p.onChange;f.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;x(o,r),null==S||S(e)}}}return"error"===E&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),M&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===E?"#D92D20":"warning"===E?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:M}),f&&!M&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})},ae.useForm=function(){return[t.useRef(null)]};var le=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,l=n.selectedKeys,c=n.defaultSelectedKeys,d=void 0===c?[]:c,p=n.onSelect,f=n.onDeselect,h=n.onClick,x=n.className,g=void 0===x?"":x,v=n.style,m=n.width,y=void 0===m?320:m;u().primaryColor;var b=t.useRef(null),w=t.useRef({}),C=void 0!==l,F=t.useState(d),k=F[0],j=F[1],D=C?l:k,S=function(e){return"children"in e&&Array.isArray(e.children)},E=t.useCallback(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(S(i)){var a=E(e,i.children,n);if(a)return a}else{var l=i,c=s(s([],n,!0),[l.key],!1);if(l.key===e)return c}}return null},[]),M=t.useCallback(function(e){var t;if(!e.disabled){var n,o=E(e.key,i)||[e.key];D.includes(e.key)?(n=D.filter(function(t){return t!==e.key}),null==f||f({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==p||p({key:e.key,keyPath:o,selectedKeys:n})),C||j(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==h||h({key:e.key,keyPath:o})}},[D,C,p,f,h,i,E]),A=function(t){var n=D.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var o=r({display:"flex",alignItems:"center",padding:"10px 16px",cursor:t.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:t.disabled?.5:1},t.style);return e.jsxs("div",{ref:function(e){w.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:o,onClick:function(){return M(t)},onMouseEnter:function(e){t.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[t.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.icon}),e.jsx("span",{style:{flex:1},children:t.label}),t.suffixIcon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.suffixIcon})]},t.key)},L=r({width:"number"==typeof y?"".concat(y,"px"):y,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},v),z=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!S(o)||!(!S(n)||S(o))};return e.jsxs("div",{ref:b,className:"aha-menu-list ".concat(g),style:L,children:[a&&(a?a.render?a.render(a):e.jsx("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e.jsx("div",{children:i.map(function(n,o){return e.jsxs(t.Fragment,{children:[z(o,i)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),S(n)?(r=n,e.jsx("div",{className:"aha-menu-group ".concat(r.className||""),children:r.children.map(function(e){return A(e)})},"group-".concat(r.title))):A(n)]},o);var r})})]})};le.displayName="MenuList";var se=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,c=0,d=0;switch(n){case"top":c=e.top-t.height-s+i,d=a-t.width/2+r;break;case"bottom":default:c=e.bottom+s+i,d=a-t.width/2+r;break;case"left":c=l-t.height/2+i,d=e.left-t.width-s+r;break;case"right":c=l-t.height/2+i,d=e.right+s+r;break;case"top-left":c=e.top-t.height-s+i,d=e.left+r;break;case"top-right":c=e.top-t.height-s+i,d=e.right-t.width+r;break;case"bottom-left":c=e.bottom+s+i,d=e.left+r;break;case"bottom-right":c=e.bottom+s+i,d=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return d<r+8?d=r+8:d+t.width>r+u-8&&(d=r+u-t.width-8),c<i+8?c=i+8:c+t.height>i+p-8&&(c=i+p-t.height-8),{top:c,left:d}},ce=function(e,t,n,o){void 0===o&&(o=6);var r=se(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,s=i-(window.scrollY||window.pageYOffset),c=a-l,d=s+t.height,u=c+t.width,p=s,f=c,h=Math.max(p,e.top),x=Math.min(d,e.bottom),g=Math.max(f,e.left),v=Math.min(u,e.right);return x>h+1&&v>g+1},de=function(t,n){var o=r({position:"absolute",width:0,height:0,borderStyle:"solid"},n),i={top:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:r(r({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:i[t]})},ue=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},pe=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},fe=function(o){var i=o.children,a=o.content,l=o.trigger,s=void 0===l?"click":l,c=o.open,d=o.defaultOpen,u=void 0!==d&&d,p=o.onOpenChange,f=o.placement,h=void 0===f?"right":f,x=o.width,g=o.offset,v=void 0===g?8:g,m=o.className,y=void 0===m?"":m,b=o.popoverClassName,w=void 0===b?"":b,C=o.disabled,F=void 0!==C&&C,k=void 0!==c,j=t.useState(u),D=j[0],S=j[1],E=k?!!c:D,M=t.useState({top:0,left:0,opacity:0}),A=M[0],L=M[1],z=t.useRef(null),B=t.useRef(null),T=t.useCallback(function(e){k||S(e),null==p||p(e)},[k,p]),R=t.useCallback(function(){if(E&&z.current&&B.current){var e=z.current.getBoundingClientRect(),t=B.current.getBoundingClientRect(),n=function(){if(ue(e,t,h,v))return h;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(h);return ue(e,t,n,v)||pe(e,n)>pe(e,h)?n:h}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,v),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,s=t;return s<o+8&&(s=o+8),s+n.width>o+i-8&&(s=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:s}}(o.top,o.left,t);L({top:r.top,left:r.left,opacity:1})}},[E,h,v]),W=t.useCallback(function(){F||T(!0)},[F,T]),N=t.useCallback(function(){T(!1)},[T]),I=t.useCallback(function(){F||T(!E)},[F,E,T]);t.useEffect(function(){if(E)return requestAnimationFrame(function(){R()}),window.addEventListener("resize",R),window.addEventListener("scroll",R,!0),function(){window.removeEventListener("resize",R),window.removeEventListener("scroll",R,!0)}},[E,R]),t.useEffect(function(){if(E&&"click"===s){var e=function(e){var t=e.target;z.current&&B.current&&!z.current.contains(t)&&!B.current.contains(t)&&N()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[E,s,N]);var H="hover"===s?{onMouseEnter:W,onMouseLeave:N,onFocus:W,onBlur:N}:{onClick:function(e){e.stopPropagation(),I()}},Y=E?e.jsx("div",{ref:B,className:"aha-popover ".concat(w),style:{position:"absolute",zIndex:9999,top:A.top,left:A.left,opacity:A.opacity,transition:"opacity 120ms ease-out",width:"number"==typeof x?"".concat(x,"px"):x,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===s?W:void 0,onMouseLeave:"hover"===s?N:void 0,children:a}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:z,className:"aha-popover-trigger ".concat(y),style:{display:"inline-block",cursor:F?"not-allowed":"pointer"}},H,{children:i})),Y&&"undefined"!=typeof document&&n.createPortal(Y,document.body)]})};fe.displayName="Popover";var he=240,xe=function(o){var i=o.open,a=o.defaultOpen,l=void 0!==a&&a,s=o.onClose,c=o.afterOpenChange,d=o.title,u=o.extra,p=o.footer,f=o.children,h=o.placement,x=void 0===h?"right":h,g=o.width,v=void 0===g?378:g,m=o.height,y=void 0===m?378:m,b=o.mask,w=void 0===b||b,C=o.maskClosable,F=void 0===C||C,k=o.closable,j=void 0===k||k,D=o.closeIcon,S=o.keyboard,E=void 0===S||S,M=o.destroyOnClose,A=void 0!==M&&M,L=o.zIndex,z=void 0===L?1e3:L,B=o.mobileBreakpoint,T=void 0===B?768:B,R=o.className,W=void 0===R?"":R,N=o.style,I=o.drawerStyle,H=o.headerStyle,Y=o.bodyStyle,O=o.footerStyle,V=o.maskStyle,P=void 0!==i,q=t.useState(l),X=q[0],Z=q[1],K=P?!!i:X,_=t.useState(K),G=_[0],J=_[1],U=t.useState(K),Q=U[0],$=U[1],ee=t.useState(!1),te=ee[0],ne=ee[1],oe=t.useState(!1),re=oe[0],ie=oe[1];t.useEffect(function(){ne(!0)},[]),t.useEffect(function(){var e=function(){ie(window.innerWidth<T)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[T]),t.useEffect(function(){if(K){J(!0),$(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){$(!0)})}),t=window.setTimeout(function(){null==c||c(!0)},he);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}$(!1);var n=window.setTimeout(function(){A&&J(!1),null==c||c(!1)},he);return function(){return window.clearTimeout(n)}},[K,A,c]),t.useEffect(function(){if(K&&E){var e=function(e){"Escape"===e.key&&(null==s||s(e),P||Z(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[K,E,s,P]),t.useEffect(function(){if(te&&K){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[K,te]);var ae=t.useCallback(function(e){null==s||s(e),P||Z(!1)},[s,P]),le=t.useMemo(function(){return re?"100vw":"left"===x||"right"===x?"number"==typeof v?"".concat(v,"px"):v:"100vw"},[x,re,v]),se=t.useMemo(function(){return"top"===x||"bottom"===x?"number"==typeof y?"".concat(y,"px"):y:"100vh"},[x,y]),ce=t.useMemo(function(){return re&&("left"===x||"right"===x)?"bottom":x},[re,x]),de=t.useMemo(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(he,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:z+1};switch(ce){case"left":return r(r({},e),{top:0,left:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(-100%)"});case"right":return r(r({},e),{top:0,right:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(100%)"});case"top":return r(r({},e),{top:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(-100%)"});default:return r(r({},e),{bottom:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(100%)"})}},[ce,le,se,Q,z]);if(!te||!G&&!K)return null;var ue=e.jsxs("div",{className:"aha-drawer-root ".concat(W),style:r({position:"fixed",inset:0,zIndex:z,pointerEvents:K||Q?"auto":"none"},N),children:[w&&e.jsx("div",{"aria-hidden":!0,onClick:F?function(e){return ae(e)}:void 0,style:r({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:Q?1:0,transition:"opacity ".concat(he,"ms cubic-bezier(0.2, 0, 0, 1)")},V)}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:r(r({},de),I),children:[(void 0!==d||j||u)&&e.jsxs("div",{style:r({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},H),children:[e.jsx("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:d}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u,j&&e.jsx("button",{type:"button",onClick:function(e){return ae(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:D||e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsx("div",{style:r({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},Y),children:f}),void 0!==p&&e.jsx("div",{style:r({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},O),children:p})]},"".concat(ce,"-").concat(K?"open":"closed"))]});return n.createPortal(ue,document.body)};xe.displayName="Drawer",exports.Alert=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,l=n.title,s=n.description,c=n.icon,d=void 0===c?x[a]:c,u=n.showIcon,p=void 0===u||u,f=n.closeable,h=void 0!==f&&f,v=n.action,m=n.children,y=n.onClose,b=t.useState(!0),w=b[0],C=b[1],F=function(){C(!1),null==y||y()},k=v||h;return w?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[p&&d,e.jsxs("div",{className:"flex flex-col gap-1 ".concat(k?"flex-1 min-w-0":""),children:[l&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:l}),s&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),m&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:m})]}),k&&e.jsxs("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[v,h&&e.jsx("div",{className:"cursor-pointer relative top-[-12px]",onClick:F,onKeyDown:function(e){return"Enter"===e.key&&F()},role:"button",tabIndex:0,"aria-label":"关闭",children:g})]})]}):null},exports.Button=h,exports.CheckIcon=z,exports.Checkbox=O,exports.DatePicker=ne,exports.Drawer=xe,exports.Form=ae,exports.Input=A,exports.MenuList=le,exports.MinusIcon=B,exports.Pagination=Y,exports.Popover=fe,exports.Progress=function(n){var o=n.percent,a=void 0===o?0:o,l=n.type,s=void 0===l?"circle":l,c=n.width,d=void 0===c?120:c,p=n.title,f=n.titlePosition,h=n.showPercent,x=void 0===h||h,g=n.animated,v=void 0!==g&&g,m=n.status,y=void 0===m?"normal":m,b=n.className,w=void 0===b?"":b,C=n.style,F=n.strokeColor,k=n.trailColor,j=void 0===k?"#F5F5F4":k,D=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),S=u().primaryColor,E=Math.min(100,Math.max(0,a)),M=t.useRef(!0),A=t.useState(!1),L=A[0],z=A[1],B=t.useState(0),T=B[0],R=B[1];t.useEffect(function(){if(v&&M.current&&E>0){M.current=!1,R(0),z(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){R(E)})});var e=setTimeout(function(){z(!1),R(E)},300);return function(){return clearTimeout(e)}}M.current?(M.current=!1,z(!1),R(E)):R(E)},[v,E]);var W=F||S||"#FB6011";"success"===y?W="#00BC7D":"exception"===y&&(W="#FB2C36");var N=f||"inside",I=Math.max(4,Math.round(.06*d)),H=(d-I)/2,Y="semicircle"===s?d/2:d,O="14px",V="12px",P=function(){var t=p&&"outside"===N?d+4+18+4:d,n=2*Math.PI*H,o=n-(L?T:E)/100*n;return e.jsxs("div",{style:{position:"relative",width:d,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:d,height:d,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(d/2," ").concat(d/2,")"),style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=r({display:"inline-flex",flexDirection:"column",alignItems:"center",width:d},C);return e.jsx("div",r({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},D,{children:function(){switch(s){case"circle":return P();case"semicircle":return n=I/2,o=d-I/2,r=(t=Y+I)-I/2,i=Y/2+I/2+I/2,a=p&&"outside"===N?t+4+18+4:t,l=Math.PI*H,c=l-(L?T:E)/100*l,e.jsxs("div",{style:{position:"relative",width:d,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:d,height:t,viewBox:"0 0 ".concat(d," ").concat(t),style:{position:"absolute",top:0,left:0},children:[e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:c,style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(E),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),P()}var t,n,o,r,i,a,l,c}()}))},exports.Radio=K,exports.Select=L,exports.Switch=G,exports.Tab=function(n){var o=n.items,a=void 0===o?[]:o,l=n.variant,s=void 0===l?"underline":l,c=n.layout,d=void 0===c?"equal":c,p=n.defaultValue,f=n.value,h=n.onChange,x=n.className,g=void 0===x?"":x,v=n.mode,m=void 0===v?"children":v,y=n.scrollable,b=void 0!==y&&y,w=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=u().primaryColor;if(!a||0===a.length)return null;var F=t.useMemo(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),k=void 0!==f,j=F.length>0?F[0].key:"",D=function(e){if(void 0===e)return j;var t=F.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:j},S=t.useState(function(){var e,t=null!==(e=null!=f?f:p)&&void 0!==e?e:j;return D(t)}),E=S[0],M=S[1],A=k?void 0!==f?D(f):j:E;t.useEffect(function(){console.log("[Tab Debug] currentValue:",A,"type:",typeof A),console.log("[Tab Debug] normalizedItems:",F.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",f,"isControlled:",k)},[A,F,f,k]);var L=t.useCallback(function(e,t){if(!t){k||M(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==h||h(n),b&&"underline"===s){var o=T.current[R(e)],r=I.current;if(o&&r){O.current=!0;var i,l=function(){if(r&&W.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},c=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),O.current=!1,r.removeEventListener("scroll",c)},150)};r.addEventListener("scroll",c,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[k,h,a,b,s]),z=F.find(function(e){if(e.key===A)return!0;if(String(e.key)===String(A))return!0;var t=Number(e.key),n=Number(A);return!isNaN(t)&&!isNaN(n)&&t===n}),B=C||"#FB6011",T=t.useRef({}),R=function(e){return String(e)},W=t.useRef(null),N=t.useRef(null),I=t.useRef(null),H=t.useRef(null),Y=t.useRef("");t.useRef(new Set);var O=t.useRef(!1),V=t.useState({width:0,left:0,opacity:0}),P=V[0],q=V[1],X=t.useState({width:0,left:0,opacity:0}),Z=X[0],K=X[1],_=t.useCallback(function(){"underline"===s&&I.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&I.current){var e=T.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=T.current[R(t)]}if(e){var n=I.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=I.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),s="".concat(a,"px");q(function(e){return e.left===l&&e.width===s&&1===e.opacity?e:{width:s,left:l,opacity:1}})}}}})})},[s,A,F]),G=t.useCallback(function(){"background"===s&&H.current&&N.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(N.current&&H.current){var e=T.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=T.current[R(t)]}if(e){var n=H.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");K(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[s,A,F]);t.useEffect(function(){A?Y.current!==A&&(Y.current=A,"underline"===s&&I.current&&!O.current&&_(),"background"===s&&H.current&&N.current&&G()):Y.current=""},[A,s,F.length,k,_,G]),t.useEffect(function(){if(A){var e=setTimeout(function(){if("underline"===s)(e=T.current[R(A)])&&I.current&&W.current&&(_(),b&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=T.current[R(A)])&&H.current&&N.current){var t=H.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");K({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),t.useEffect(function(){if(b&&"underline"===s&&A&&!O.current){var e=setTimeout(function(){var e=T.current[R(A)],t=I.current;if(e&&t){O.current=!0;var n,o=function(){if(t&&W.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),O.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[A,b,s]);var J;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(J={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},b&&(J.overflowX="auto",J.overflowY="hidden",J.scrollBehavior="smooth",J.scrollbarWidth="none",J.WebkitOverflowScrolling="touch"),e.jsxs("div",r({ref:I,className:"aha-tab aha-tab--underline ".concat(b?"aha-tab--scrollable":""," ").concat(g),style:J},w,{children:[e.jsx("div",{ref:W,style:r({position:"absolute",bottom:"0px",height:"2px",backgroundColor:B,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},P)}),F.map(function(n){var o=function(){if(n.key===A)return!0;if(String(n.key)===String(A))return!0;var e=Number(n.key),t=Number(A);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===F[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:A,currentValueType:typeof A,isActive:o,variant:s}),e.jsxs("div",{ref:function(e){T.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:b?0:void 0,whiteSpace:b?"nowrap":void 0},children:[n.icon&&function(){var i,a=typeof n.icon,l=t.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:a,isReactElement:l,iconValue:n.icon}),t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:20,height:20,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?B:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:20,height:20,style:{color:o?B:"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?B:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===d?"100%":"fit-content",e.jsxs("div",r({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(d," ").concat(g),style:n},w,{children:[e.jsx("div",{ref:N,style:r({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},Z)}),F.map(function(n){var o=function(){if(n.key===A)return!0;if(String(n.key)===String(A))return!0;var e=Number(n.key),t=Number(A);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===F[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:A,currentValueType:typeof A,isActive:o,variant:s});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===d?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return e.jsxs("div",{ref:function(e){T.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:i,children:[n.icon&&function(){var i;return t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:16,height:16,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),b&&"underline"===s&&e.jsx("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===m&&(null==z?void 0:z.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:z.children})]})},exports.Table=function(n){var o,a,l,c,d=n.columns,p=void 0===d?[]:d,f=n.dataSource,h=void 0===f?[]:f,x=n.rowKey,g=void 0===x?"key":x,v=n.rowSelection,m=n.pagination,y=void 0!==m&&m,b=n.size,w=void 0===b?"middle":b,C=n.bordered,F=void 0!==C&&C,k=n.loading,j=void 0!==k&&k,D=n.locale,S=n.showHeader,E=void 0===S||S,M=n.title,A=n.footer,L=n.summary,z=n.scroll,B=n.tableLayout,T=void 0===B?"auto":B,R=n.onChange,W=n.onSorterChange,N=n.onPaginationChange,I=n.onRow,H=n.className,V=void 0===H?"":H,K=n.innerClassName,_=void 0===K?"":K,G=n.style,J=n.expandable,U=n.rowClassName,Q=n.onHeaderRow;n.sticky;var $=i(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=u().primaryColor||"#FB6011",te=t.useState((null==v?void 0:v.selectedRowKeys)||(null==v?void 0:v.defaultSelectedRowKeys)||[]),ne=te[0],oe=te[1];t.useEffect(function(){void 0!==(null==v?void 0:v.selectedRowKeys)&&oe(v.selectedRowKeys)},[null==v?void 0:v.selectedRowKeys]);var re=t.useState(new Map),ie=re[0],ae=re[1],le=t.useState((null==J?void 0:J.defaultExpandedRowKeys)||[]),se=le[0],ce=le[1],de=t.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ue=de[0],pe=de[1],fe=t.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),he=fe[0],xe=fe[1];t.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&xe(y.pageSize))},[y]);var ge=t.useState(null),ve=ge[0],me=ge[1],ye=t.useState(null),be=ye[0],we=ye[1],Ce=t.useState(!1),Fe=Ce[0],ke=Ce[1],je=t.useRef(null),De=t.useRef(null);t.useEffect(function(){var e=function(){ke(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Se=t.useCallback(function(e,t){var n,o,r,i=null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e);if(!(null==i?void 0:i.disabled)){var a,l=X(e,g);a="radio"===(null==v?void 0:v.type)?t?[l]:[]:t?s(s([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),oe(a);var c=h.filter(function(e){return a.includes(X(e,g))});null===(o=null==v?void 0:v.onChange)||void 0===o||o.call(v,a,c),null===(r=null==v?void 0:v.onSelect)||void 0===r||r.call(v,e,t,c,new Event("select"))}},[ne,g,v,h]),Ee=t.useCallback(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}).map(function(e){return X(e,g)}),i=e?r:[];oe(i);var a=h.filter(function(e){return i.includes(X(e,g))}),l=e?t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}):[];null===(n=null==v?void 0:v.onChange)||void 0===n||n.call(v,i,a),null===(o=null==v?void 0:v.onSelectAll)||void 0===o||o.call(v,e,a,l)},[g,v,h]),Me=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),W&&W(1===r.length?r[0]:r),R&&R({current:ue,pageSize:he},{},1===r.length?r[0]:r,{currentDataSource:h,action:"sort"})}},[ie,R,W,ue,he,h,p]);t.useCallback(function(e,t){var n,o,r,i=X(e,g);r=t?s(s([],se,!0),[i],!1):se.filter(function(e){return e!==i}),ce(r),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(o=null==J?void 0:J.onExpandedRowsChange)||void 0===o||o.call(J,r)},[se,g,J]);var Ae,Le=t.useCallback(function(){var e=s([],h,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,t);else if(!0===r.sorter){var a=q(e,r.dataIndex||n),l=q(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[h,ie,p]),ze=Le(),Be=Boolean(y&&"object"==typeof y&&void 0!==y.total),Te=t.useMemo(function(){if(!1===y||!y)return ze;if(Be)return ze;var e=(ue-1)*he,t=e+he;return ze.slice(e,t)},[ze,ue,he,y,Be]),Re=t.useCallback(function(e,t){var n,o,r=null!=t?t:he;if(pe(e),t&&xe(t),N&&N(e,r),y&&"object"==typeof y&&(null===(n=y.onChange)||void 0===n||n.call(y,e,t),t&&(null===(o=y.onShowSizeChange)||void 0===o||o.call(y,e,t))),R){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});R({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:ze,action:"paginate"})}},[y,N,R,he,ie,p,ze]),We=t.useCallback(function(e,t,n){var o=q(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Ne=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(v&&("left"===v.fixed||!0===v.fixed))r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=p[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===o){for(i=e+1;i<p.length;i++){var a;if("right"===(a=p[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(v&&"right"===v.fixed)r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;return r}}},[p,v]),Ie=t.useCallback(function(){if(!E)return null;var t,n,o,i,a=p.map(function(t,n){var o,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=ie.get(i)||null,l=Ne(n,t.fixed,!0),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("th",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:a,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){Me(t,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e.jsx(Z,{order:a||void 0})})]})}),i)});if(v){var l="number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!v.hideSelectAll&&"radio"!==v.type&&(t=Te.filter(function(e){var t;return!(null===(t=v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}),n=t.map(function(e){return X(e,g)}),o=t.length>0&&n.every(function(e){return ne.includes(e)}),i=n.some(function(e){return ne.includes(e)}),e.jsx(O,{checked:o,indeterminate:i&&!o,onChange:function(e){return Ee(e.target.checked,Te)}})),v.columnTitle&&e.jsx("span",{style:{marginLeft:v.hideSelectAll?0:"8px"},children:v.columnTitle})]})},"selection");a.unshift(s)}var c=null==Q?void 0:Q(p,0);return e.jsx("thead",{ref:De,children:e.jsx("tr",r({},c||{},{children:a}))})},[p,E,ie,v,ne,Te,g,Me,Ee,D,Q,Ne]),He=t.useCallback(function(e){me(e)},[]),Ye=t.useCallback(function(e,t){e.preventDefault(),we(t)},[]),Oe=t.useCallback(function(e,t){if(e.preventDefault(),null===ve||ve===t)return me(null),void we(null);var n=s([],Te,!0),o=n[ve];n.splice(ve,1),n.splice(t,0,o),me(null),we(null)},[ve,Te]),Ve=t.useCallback(function(){me(null),we(null)},[]),Pe=t.useCallback(function(){var t=null==D?void 0:D.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=p.length+(v?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==D?void 0:D.emptyText,p.length,v]),qe=t.useCallback(function(){return 0===Te.length?Pe():Te.map(function(n,o){var i,a=X(n,g),l=ne.includes(a),s=se.includes(a),c=(null==I?void 0:I(n,o))||{},d=o===Te.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",r({className:"".concat("function"==typeof U?U(n,o):U||""," ").concat(ve===o?"dragging":""," ").concat(be===o?"drag-over":""),draggable:!0,onDragStart:function(){return He(o)},onDragOver:function(e){return Ye(e,o)},onDrop:function(e){return Oe(e,o)},onDragEnd:Ve,style:r({cursor:"move",opacity:ve===o?.5:1,backgroundColor:be===o?"#F9FAFB":"white",transition:"background-color 0.2s"},c.style),onMouseEnter:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="white")}},c,{children:[v&&e.jsx("td",{style:{width:"number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(O,{checked:l,onChange:function(e){return Se(n,e.target.checked)},disabled:null===(i=v.getCheckboxProps)||void 0===i?void 0:i.call(v,n).disabled})})}),p.map(function(t,i){var a,l=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,s=(null===(a=t.onCell)||void 0===a?void 0:a.call(t,n,o))||{},c=Ne(i,t.fixed,!1),u=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("td",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:r({width:u,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:u||void 0,maxWidth:u,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,right:"right"===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},s.style),colSpan:t.colSpan,rowSpan:t.rowSpan},s,{children:We(t,n,o)}),l)})]})),(null==J?void 0:J.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:J.expandedRowRender(n,o,0,!0)})})]},a)})},[Te,g,ne,se,v,p,I,U,Se,We,J,ve,be,He,Ye,Oe,Ve,Ne,Pe]),Xe=function(){var t;if(!1===y||!y)return null;var n=null!==(t=y.total)&&void 0!==t?t:ze.length,o=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e.jsx(Y,{current:ue,total:n,pageSize:he,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:Re,onShowSizeChange:Re,simple:y.simple,responsive:y.responsive,size:"small"===w?"small":"default"})})},Ze=t.useMemo(function(){return p.some(function(e){return e.fixed})||v&&v.fixed},[p,v]),Ke=t.useMemo(function(){return p.every(function(e){return e.width})&&(!v||v.columnWidth)},[p,v]),_e=t.useMemo(function(){if(null==z?void 0:z.x){if("number"==typeof z.x)return z.x;if(!0===z.x)return p.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(v?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth||"60").replace("px",""))||60:0)}if(Ze)return p.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(v&&v.fixed&&v.columnWidth?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth).replace("px",""))||60:0)},[p,null==z?void 0:z.x,v,Ze]),Ge=t.useMemo(function(){return"fixed"===T||Ze||Ke||p.some(function(e){return e.width})?"fixed":T},[T,Ze,Ke,p]),Je=r(r({width:"100%",minWidth:_e?"".concat(_e,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ge,backgroundColor:"white"},F&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=r({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"},G);if(Fe)return e.jsxs("div",r({ref:je,className:"aha-table aha-table-mobile-wrapper ".concat(V),style:Ue,"aria-busy":!!j||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(ze)}),y&&"object"==typeof y&&(null===(o=y.position)||void 0===o?void 0:o.startsWith("top"))&&Xe(),(Ae="function"==typeof(null==D?void 0:D.emptyText)?D.emptyText():void 0!==(null==D?void 0:D.emptyText)?D.emptyText:"No data",0===Te.length?e.jsx("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Ae}):e.jsx("div",{className:"aha-table-mobile",children:Te.map(function(t,n){var o,r=X(t,g),i=ne.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[v&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(O,{checked:i,onChange:function(e){return Se(t,e.target.checked)},disabled:null===(o=v.getCheckboxProps)||void 0===o?void 0:o.call(v,t).disabled})}),p.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=q(t,o.dataIndex||""),a=o.render?o.render(i,t,n):i;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),A&&e.jsx("div",{style:{marginTop:"16px"},children:A(ze)}),y&&("object"!=typeof y||!(null===(a=y.position)||void 0===a?void 0:a.startsWith("top")))&&Xe(),e.jsx(P,{loading:j,spinColor:ee})]}));var Qe={position:"relative",overflowX:(null==z?void 0:z.x)||Ze?"auto":"visible",overflowY:(null==z?void 0:z.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==z?void 0:z.x)?"100%":"number"==typeof(null==z?void 0:z.x)?"".concat(z.x,"px"):void 0,maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",r({ref:je,className:"aha-table ".concat(V),style:Ue,"aria-busy":!!j||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(ze)}),y&&"object"==typeof y&&(null===(l=y.position)||void 0===l?void 0:l.startsWith("top"))&&Xe(),e.jsx("div",{style:Qe,children:e.jsx("div",{style:{width:"100%",minWidth:_e?"".concat(_e,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Je,className:_,children:[Ie(),e.jsx("tbody",{children:qe()}),L&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:L(ze)})})})]})})}),A&&e.jsx("div",{style:{marginTop:"16px"},children:A(ze)}),y&&("object"!=typeof y||!(null===(c=y.position)||void 0===c?void 0:c.startsWith("top")))&&Xe(),e.jsx(P,{loading:j,spinColor:ee})]}))},exports.Tag=function(n){var o=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,c=n.size,d=void 0===c?"large":c,p=n.stroke,f=void 0!==p&&p,h=n.icon,x=n.iconPosition,g=void 0===x?"none":x,v=n.className,m=void 0===v?"":v,y=n.onClick,b=i(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=u().primaryColor,C=function(e,t){if("string"==typeof e&&e in E){var n=E[e];return"Orange"===e&&t?r(r({},n),{fill:r(r({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var o=e.replace("#",""),i=parseInt(o.substr(0,2),16),a=parseInt(o.substr(2,2),16),l=parseInt(o.substr(4,2),16);return{light:{bg:"rgba(".concat(i,", ").concat(a,", ").concat(l,", 0.1)"),text:e,border:"rgba(".concat(i,", ").concat(a,", ").concat(l,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return E.Green}(a,w),F=M[d],k={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"===s&&(k.backgroundColor=C.light.bg,k.color=C.light.text,f&&(k.outline="1px solid",k.outlineOffset="-1px",k.outlineColor=function(e){if("string"==typeof e&&e in E)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"}(a))),y&&(k.cursor="pointer",k.opacity="1");var j=["rounded-md","inline-flex","justify-start","items-center",F.padding,F.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"===s&&(k.backgroundColor=C.fill.bg,k.color=C.fill.text),y&&j.push("cursor-pointer","hover:opacity-80"),m&&j.push(m);var D=j.join(" "),S=function(){if(!h)return null;var n=function(e,t){if("string"==typeof e&&e in E)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"}(a,w),o="small"===d?"14px":"16px";return e.jsx("div",{className:"flex items-center justify-center",style:{width:o,height:o},children:"svg"===h.type?t.cloneElement(h,{width:o,height:o,style:{fill:n}}):h})};return e.jsxs("div",r({className:D,style:k,onClick:y},b,{children:["leading"===g&&S(),e.jsx("div",{className:"px-1 flex justify-center items-center",children:e.jsx("div",{className:"justify-center ".concat(F.textSize," font-medium font-dm-sans ").concat("large"===d?"leading-snug":"leading-none"),children:o})}),"after"===g&&S()]}))},exports.Textarea=_,exports.ThemeProvider=function(n){var o=n.theme,i=n.children,a=t.useMemo(function(){return r(r({},c),o)},[o]);return e.jsx(d.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(C,{id:"direct",props:t})},exports.ToastProvider=function(o){var r=o.children,i=t.useState(!1),a=i[0],l=i[1];return t.useEffect(function(){l(!0)},[]),e.jsxs(e.Fragment,{children:[r,a&&n.createPortal(e.jsx(w,{}),document.body)]})},exports.Tooltip=function(o){var i=o.content,a=o.children,l=o.position,s=void 0===l?"top":l,c=o.trigger,d=void 0===c?"hover":c,u=o.delay,p=void 0===u?200:u,f=o.disabled,h=void 0!==f&&f,x=o.className,g=void 0===x?"":x,v=o.tooltipClassName,m=void 0===v?"":v,y=o.gap,b=void 0===y?6:y,w=o.showArrow,C=void 0===w||w,F=o.width,k=o.defaultVisible,j=void 0!==k&&k,D=o.visible,S=o.onVisibleChange,E=void 0!==D,M=t.useState(j),A=M[0],L=M[1],z=E?D:A,B=t.useState(E?null!=D&&D:j),T=B[0],R=B[1],W=t.useCallback(function(e){E||L(e),null==S||S(e)},[E,S]);t.useEffect(function(){E&&(D?requestAnimationFrame(function(){R(!0)}):R(!1))},[E,D]);var N=t.useState(s),I=N[0],H=N[1],Y=t.useState("320px"),O=Y[0],V=Y[1],P=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===d?"auto":"none"}),q=P[0],X=P[1],Z=t.useState({}),K=Z[0],_=Z[1],G=t.useRef(null),J=t.useRef(null),U=t.useRef(null),Q=t.useRef(null),$=t.useCallback(function(){if(G.current&&J.current&&z&&T){var e=G.current.getBoundingClientRect(),t=J.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!ce(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(!ce(e,t,a,o))return a}return n}(e,t,s,b);H(n);var o=se(e,t,n,b),i=o.top,a=o.left;if(X(function(e){return r(r({},e),{position:"absolute",top:"".concat(i,"px"),left:"".concat(a,"px"),pointerEvents:"hover"===d?"auto":"none",zIndex:9999})}),C){var l=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,c=o-i,d=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,a,i);_(l)}}},[z,s,b,C,T,d]),ee=t.useCallback(function(){h||(Q.current&&(clearTimeout(Q.current),Q.current=null),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){W(!0),E||requestAnimationFrame(function(){R(!0)})},p))},[h,p,W,E]),te=t.useCallback(function(){U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),E?W(!1):(R(!1),Q.current=setTimeout(function(){W(!1),Q.current=null},150))},[W,E]),ne=t.useCallback(function(){"hover"===d&&(Q.current&&(clearTimeout(Q.current),Q.current=null),z||(W(!0),requestAnimationFrame(function(){R(!0)})))},[d,z]),oe=t.useCallback(function(e){h||"click"!==d||(e.stopPropagation(),z?te():(U.current&&(clearTimeout(U.current),U.current=null),W(!0),requestAnimationFrame(function(){R(!0)})))},[h,d,z,te]);t.useEffect(function(){if(j&&z&&T){var e=function(){G.current&&J.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,z,T,$]),t.useEffect(function(){if(z)return requestAnimationFrame(function(){$()}),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),function(){window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[z,$]),t.useEffect(function(){if(z&&"click"===d){var e=function(e){G.current&&J.current&&!G.current.contains(e.target)&&!J.current.contains(e.target)&&te()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[z,d,te]),t.useEffect(function(){return function(){U.current&&clearTimeout(U.current),Q.current&&clearTimeout(Q.current)}},[]);var re={position:"absolute",top:0,left:0,opacity:T?1:0,transform:T?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===d?"auto":"none",zIndex:9999},ie=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){V(ie())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ie]);var ae=r(r({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==F?{width:"number"==typeof F?"".concat(F,"px"):F,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:O,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),le=e.jsxs("div",{style:r(r(r({},re),q),{pointerEvents:"hover"===d?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===d?ne:void 0,onMouseLeave:"hover"===d?te:void 0,children:[e.jsx("div",{ref:J,className:"aha-tooltip ".concat(m),style:ae,role:"tooltip",children:i}),C&&de(I,K)]}),ue=t.useCallback(function(){"hover"===d&&(Q.current=setTimeout(function(){te()},100))},[d,te]),pe="click"===d?{onClick:oe}:{onMouseEnter:ee,onMouseLeave:ue,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:G,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===d?"pointer":"default"}},pe,{children:a})),z&&"undefined"!=typeof document&&n.createPortal(le,document.body)]})},exports.clearAllToasts=function(){b.clearAll()},exports.closeToast=function(e){b.removeToast(e)},exports.debugToast=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",b.getToasts()),console.log("容器根节点:",j),console.log("是否正在初始化:",D),console.log("====================")},exports.toast=F,exports.toastError=function(e,t){return S(),F(r(r({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return S(),F(r(r({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return S(),F(r(r({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return S(),F(r(r({},t),{message:e,type:"success"}))},exports.useTheme=u;
2
2
  //# sourceMappingURL=index.js.map