34 lines
88 KiB
JavaScript
34 lines
88 KiB
JavaScript
import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{$n as t,$t as n,An as r,Bt as i,Dn as a,Dt as o,En as s,Fn as c,Ft as l,Hn as u,In as d,It as f,Kn as p,Nt as m,On as h,Ot as g,Pn as _,Qn as v,Qt as y,Rt as b,Sn as x,St as S,U as C,V as w,Vn as T,Wn as E,Wt as D,Xn as O,Xt as k,Yn as A,Z as j,Zn as M,Zt as N,_t as P,bn as F,cn as I,er as ee,fn as L,ft as te,gt as R,in as ne,kn as z,kt as B,lt as re,nn as ie,on as V,pn as H,qn as U,tn as ae,tr as W,un as oe,wn as G,wt as K,xn as se,xt as ce}from"./index-D422TGjj.js";import{C as le,S as ue,T as de,b as fe,v as pe,x as me,y as he}from"./TextArea-C-bIgxlu.js";import{_ as ge,d as _e,f as q,g as J,h as ve,m as ye,p as be}from"./input-CKrxaItg.js";var Y=e(W()),xe=e(ee()),X=e(t()),Se=e=>typeof e==`object`&&!!e&&e.nodeType===1,Ce=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,Z=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Ce(n.overflowY,t)||Ce(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Q=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,we=e=>e.parentElement??(e.getRootNode().host||null),Te=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!Se(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;Se(u)&&s(u);){if(u=we(u),u===c){l.push(u);break}u!=null&&u===document.body&&Z(u)&&!Z(document.documentElement)||u!=null&&Z(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,{scrollX:p,scrollY:m}=window,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),{top:x,right:S,bottom:C,left:w}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),T=r===`start`||r===`nearest`?_-x:r===`end`?y+C:_+h/2-x+C,E=i===`center`?b+g/2-w+S:i===`end`?v+S:b-w,D=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:x,left:S}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&(t===c&&!Z(t)||_>=s&&y<=x&&b>=S&&v<=u))return D;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),O=parseInt(C.borderTopWidth,10),k=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-k:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,I=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)j=r===`start`?T:r===`end`?T-f:r===`nearest`?Q(m,m+f,f,O,A,m+T,m+T+h,h):T-f/2,M=i===`start`?E:i===`center`?E-d/2:i===`end`?E-d:Q(p,p+d,d,w,k,p+E,p+E+g,g),j=Math.max(0,j+m),M=Math.max(0,M+p);else{j=r===`start`?T-s-O:r===`end`?T-x+A+P:r===`nearest`?Q(s,x,a,O,A+P,T,T+h,h):T-(s+a/2)+P/2,M=i===`start`?E-S-w:i===`center`?E-(S+o/2)+N/2:i===`end`?E-u+k+N:Q(S,u,o,w,k+N,E,E+g,g);let{scrollLeft:e,scrollTop:n}=t;j=I===0?0:Math.max(0,Math.min(n+j/I,t.scrollHeight-a/I+P)),M=F===0?0:Math.max(0,Math.min(e+M/F,t.scrollWidth-o/F+N)),T+=n-j,E+=e-M}D.push({el:t,top:j,left:M})}return D},Ee=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function De(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(Te(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of Te(e,Ee(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var Oe=()=>Y.useReducer(e=>e+1,0),ke=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:`hidden`,"&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
||
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:`hidden`,transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
||
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),Ae=new se(`antMoveDownIn`,{"0%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),je=new se(`antMoveDownOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0}}),Me=new se(`antMoveLeftIn`,{"0%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Ne=new se(`antMoveLeftOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),Pe=new se(`antMoveRightIn`,{"0%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Fe=new se(`antMoveRightOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),Ie={"move-up":{inKeyframes:new se(`antMoveUpIn`,{"0%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),outKeyframes:new se(`antMoveUpOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0}})},"move-down":{inKeyframes:Ae,outKeyframes:je},"move-left":{inKeyframes:Me,outKeyframes:Ne},"move-right":{inKeyframes:Pe,outKeyframes:Fe}},Le=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Ie[t];return[te(r,i,a,e.motionDurationMid),{[`
|
||
${r}-enter,
|
||
${r}-appear
|
||
`]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]};function Re(e){return t=>Y.createElement(i,{theme:{token:{motion:!1,zIndexPopupBase:0}}},Y.createElement(e,Object.assign({},t)))}var ze=(e,t,n,r,i)=>Re(a=>{let{prefixCls:o,style:s}=a,c=Y.useRef(null),[l,u]=Y.useState(0),[d,f]=Y.useState(0),[p,m]=ie(!1,{value:a.open}),{getPrefixCls:h}=Y.useContext(I),g=h(r||`select`,o);Y.useEffect(()=>{if(m(!0),typeof ResizeObserver<`u`){let e=new ResizeObserver(e=>{let t=e[0].target;u(t.offsetHeight+8),f(t.offsetWidth)}),t=setInterval(()=>{let n=i?`.${i(g)}`:`.${g}-dropdown`,r=c.current?.querySelector(n);r&&(clearInterval(t),e.observe(r))},10);return()=>{clearInterval(t),e.disconnect()}}},[g]);let _=Object.assign(Object.assign({},a),{style:Object.assign(Object.assign({},s),{margin:0}),open:p,visible:p,getPopupContainer:()=>c.current});n&&(_=n(_)),t&&Object.assign(_,{[t]:{overflow:{adjustX:!1,adjustY:!1}}});let v={paddingBottom:l,position:`relative`,minWidth:d};return Y.createElement(`div`,{ref:c,style:v},Y.createElement(e,Object.assign({},_)))}),Be=function(e){var t=e.className,n=e.customizeIcon,r=e.customizeIconProps,i=e.children,a=e.onMouseDown,o=e.onClick,s=typeof n==`function`?n(r):n;return Y.createElement(`span`,{className:t,onMouseDown:function(e){e.preventDefault(),a?.(e)},style:{userSelect:`none`,WebkitUserSelect:`none`},unselectable:`on`,onClick:o,"aria-hidden":!0},s===void 0?Y.createElement(`span`,{className:(0,X.default)(t.split(/\s+/).map(function(e){return`${e}-icon`}))},i):s)},Ve=function(e,t,n,r,i){var a=arguments.length>5&&arguments[5]!==void 0&&arguments[5],o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0,c=Y.useMemo(function(){if(M(r)===`object`)return r.clearIcon;if(i)return i},[r,i]);return{allowClear:Y.useMemo(function(){return!(a||!r||!n.length&&!o||s===`combobox`&&o===``)},[r,a,n.length,o,s]),clearIcon:Y.createElement(Be,{className:`${e}-clear`,onMouseDown:t,customizeIcon:c},`×`)}},He=Y.createContext(null);function Ue(){return Y.useContext(He)}function We(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=Y.useState(!1),n=h(t,2),r=n[0],i=n[1],a=Y.useRef(null),o=function(){window.clearTimeout(a.current)};return Y.useEffect(function(){return o},[]),[r,function(t,n){o(),a.current=window.setTimeout(function(){i(t),n&&n()},e)},o]}function Ge(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=Y.useRef(null),n=Y.useRef(null);Y.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(r){(r||t.current===null)&&(t.current=r),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}return[function(){return t.current},r]}function Ke(e,t,n,r){var i=Y.useRef(null);i.current={open:t,triggerOpen:n,customizedTrigger:r},Y.useEffect(function(){function t(t){var n;if(!((n=i.current)!=null&&n.customizedTrigger)){var r=t.target;r.shadowRoot&&t.composed&&(r=t.composedPath()[0]||r),i.current.open&&e().filter(function(e){return e}).every(function(e){return!e.contains(r)&&e!==r})&&i.current.triggerOpen(!1)}}return window.addEventListener(`mousedown`,t),function(){return window.removeEventListener(`mousedown`,t)}},[])}function qe(e){return e&&![g.ESC,g.SHIFT,g.BACKSPACE,g.TAB,g.WIN_KEY,g.ALT,g.META,g.WIN_KEY_RIGHT,g.CTRL,g.SEMICOLON,g.EQUALS,g.CAPS_LOCK,g.CONTEXT_MENU,g.F1,g.F2,g.F3,g.F4,g.F5,g.F6,g.F7,g.F8,g.F9,g.F10,g.F11,g.F12].includes(e)}function Je(e,t,n){var r=p(p({},e),n?t:{});return Object.keys(t).forEach(function(n){var i=t[n];typeof i==`function`&&(r[n]=function(){var t,r=[...arguments];return i.apply(void 0,r),(t=e[n])?.call.apply(t,[e].concat(r))})}),r}var Ye=[`prefixCls`,`id`,`inputElement`,`autoFocus`,`autoComplete`,`editable`,`activeDescendantId`,`value`,`open`,`attrs`],$=Y.forwardRef(function(e,t){var n=e.prefixCls,r=e.id,i=e.inputElement,a=e.autoFocus,o=e.autoComplete,c=e.editable,l=e.activeDescendantId,u=e.value,f=e.open,m=e.attrs,h=s(e,Ye),g=i||Y.createElement(`input`,null),_=g,v=_.ref,y=_.props;return`maxLength`in g.props,g=Y.cloneElement(g,p(p(p({type:`search`},Je(h,y,!0)),{},{id:r,ref:d(t,v),autoComplete:o||`off`,autoFocus:a,className:(0,X.default)(`${n}-selection-search-input`,y?.className),role:`combobox`,"aria-expanded":f||!1,"aria-haspopup":`listbox`,"aria-owns":`${r}_list`,"aria-autocomplete":`list`,"aria-controls":`${r}_list`,"aria-activedescendant":f?l:void 0},m),{},{value:c?u:``,readOnly:!c,unselectable:c?null:`on`,style:p(p({},y.style),{},{opacity:c?null:0})})),g});function Xe(e){return Array.isArray(e)?e:e===void 0?[]:[e]}var Ze=typeof window<`u`&&window.document&&window.document.documentElement;function Qe(e){return e!=null}function $e(e){return!e&&e!==0}function et(e){return[`string`,`number`].includes(M(e))}function tt(e){var t=void 0;return e&&(et(e.title)?t=e.title.toString():et(e.label)&&(t=e.label.toString())),t}function nt(e,t){Ze?Y.useLayoutEffect(e,t):Y.useEffect(e,t)}function rt(e){return e.key??e.value}var it=function(e){e.preventDefault(),e.stopPropagation()},at=function(e){var t=e.id,n=e.prefixCls,r=e.values,i=e.open,a=e.searchValue,o=e.autoClearSearchValue,s=e.inputRef,c=e.placeholder,l=e.disabled,u=e.mode,d=e.showSearch,f=e.autoFocus,p=e.autoComplete,g=e.activeDescendantId,_=e.tabIndex,v=e.removeIcon,y=e.maxTagCount,b=e.maxTagTextLength,x=e.maxTagPlaceholder,S=x===void 0?function(e){return`+ ${e.length} ...`}:x,C=e.tagRender,w=e.onToggleOpen,T=e.onRemove,E=e.onInputChange,D=e.onInputPaste,O=e.onInputKeyDown,k=e.onInputMouseDown,A=e.onInputCompositionStart,j=e.onInputCompositionEnd,M=e.onInputBlur,N=Y.useRef(null),P=(0,Y.useState)(0),F=h(P,2),I=F[0],ee=F[1],L=(0,Y.useState)(!1),te=h(L,2),R=te[0],ne=te[1],z=`${n}-selection`,B=i||u===`multiple`&&o===!1||u===`tags`?a:``,re=u===`tags`||u===`multiple`&&o===!1||d&&(i||R);nt(function(){ee(N.current.scrollWidth)},[B]);var ie=function(e,t,n,r,i){return Y.createElement(`span`,{title:tt(e),className:(0,X.default)(`${z}-item`,U({},`${z}-item-disabled`,n))},Y.createElement(`span`,{className:`${z}-item-content`},t),r&&Y.createElement(Be,{className:`${z}-item-remove`,onMouseDown:it,onClick:i,customizeIcon:v},`×`))},V=function(e,t,n,r,a,o){return Y.createElement(`span`,{onMouseDown:function(e){it(e),w(!i)}},C({label:t,value:e,disabled:n,closable:r,onClose:a,isMaxTag:!!o}))},H=function(e){var t=e.disabled,n=e.label,r=e.value,i=!l&&!t,a=n;if(typeof b==`number`&&(typeof n==`string`||typeof n==`number`)){var o=String(a);o.length>b&&(a=`${o.slice(0,b)}...`)}var s=function(t){t&&t.stopPropagation(),T(e)};return typeof C==`function`?V(r,a,t,i,s):ie(e,a,t,i,s)},ae=function(e){if(!r.length)return null;var t=typeof S==`function`?S(e):S;return typeof C==`function`?V(void 0,t,!1,!1,void 0,!0):ie({title:t},t,!1)},W=Y.createElement(`div`,{className:`${z}-search`,style:{width:I},onFocus:function(){ne(!0)},onBlur:function(){ne(!1)}},Y.createElement($,{ref:s,open:i,prefixCls:n,id:t,inputElement:null,disabled:l,autoFocus:f,autoComplete:p,editable:re,activeDescendantId:g,value:B,onKeyDown:O,onMouseDown:k,onChange:E,onPaste:D,onCompositionStart:A,onCompositionEnd:j,onBlur:M,tabIndex:_,attrs:m(e,!0)}),Y.createElement(`span`,{ref:N,className:`${z}-search-mirror`,"aria-hidden":!0},B,`\xA0`)),oe=Y.createElement(q,{prefixCls:`${z}-overflow`,data:r,renderItem:H,renderRest:ae,suffix:W,itemKey:rt,maxCount:y});return Y.createElement(`span`,{className:`${z}-wrap`},oe,!r.length&&!B&&Y.createElement(`span`,{className:`${z}-placeholder`},c))},ot=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,i=e.inputRef,a=e.disabled,o=e.autoFocus,s=e.autoComplete,c=e.activeDescendantId,l=e.mode,u=e.open,d=e.values,f=e.placeholder,p=e.tabIndex,g=e.showSearch,_=e.searchValue,v=e.activeValue,y=e.maxLength,b=e.onInputKeyDown,x=e.onInputMouseDown,S=e.onInputChange,C=e.onInputPaste,w=e.onInputCompositionStart,T=e.onInputCompositionEnd,E=e.onInputBlur,D=e.title,O=Y.useState(!1),k=h(O,2),A=k[0],j=k[1],M=l===`combobox`,N=M||g,P=d[0],F=_||``;M&&v&&!A&&(F=v),Y.useEffect(function(){M&&j(!1)},[M,v]);var I=l!==`combobox`&&!u&&!g?!1:!!F,ee=D===void 0?tt(P):D,L=Y.useMemo(function(){return P?null:Y.createElement(`span`,{className:`${n}-selection-placeholder`,style:I?{visibility:`hidden`}:void 0},f)},[P,I,f,n]);return Y.createElement(`span`,{className:`${n}-selection-wrap`},Y.createElement(`span`,{className:`${n}-selection-search`},Y.createElement($,{ref:i,prefixCls:n,id:r,open:u,inputElement:t,disabled:a,autoFocus:o,autoComplete:s,editable:N,activeDescendantId:c,value:F,onKeyDown:b,onMouseDown:x,onChange:function(e){j(!0),S(e)},onPaste:C,onCompositionStart:w,onCompositionEnd:T,onBlur:E,tabIndex:p,attrs:m(e,!0),maxLength:M?y:void 0})),!M&&P?Y.createElement(`span`,{className:`${n}-selection-item`,title:ee,style:I?{visibility:`hidden`}:void 0},P.label):null,L)},st=Y.forwardRef(function(e,t){var n=(0,Y.useRef)(null),r=(0,Y.useRef)(!1),i=e.prefixCls,a=e.open,o=e.mode,s=e.showSearch,c=e.tokenWithEnter,l=e.disabled,u=e.prefix,d=e.autoClearSearchValue,f=e.onSearch,p=e.onSearchSubmit,m=e.onToggleOpen,_=e.onInputKeyDown,y=e.onInputBlur,b=e.domRef;Y.useImperativeHandle(t,function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}});var x=Ge(0),S=h(x,2),C=S[0],w=S[1],T=function(e){var t=e.which,i=n.current instanceof HTMLTextAreaElement;!i&&a&&(t===g.UP||t===g.DOWN)&&e.preventDefault(),_&&_(e),t===g.ENTER&&o===`tags`&&!r.current&&!a&&p?.(e.target.value),i&&!a&&~[g.UP,g.DOWN,g.LEFT,g.RIGHT].indexOf(t)||qe(t)&&m(!0)},E=function(){w(!0)},D=(0,Y.useRef)(null),O=function(e){f(e,!0,r.current)!==!1&&m(!0)},k=function(){r.current=!0},A=function(e){r.current=!1,o!==`combobox`&&O(e.target.value)},j=function(e){var t=e.target.value;if(c&&D.current&&/[\r\n]/.test(D.current)){var n=D.current.replace(/[\r\n]+$/,``).replace(/\r\n/g,` `).replace(/[\r\n]/g,` `);t=t.replace(n,D.current)}D.current=null,O(t)},M=function(e){D.current=e.clipboardData?.getData(`text`)||``},N=function(e){e.target!==n.current&&(document.body.style.msTouchAction===void 0?n.current.focus():setTimeout(function(){n.current.focus()}))},P=function(e){var t=C();e.target!==n.current&&!t&&!(o===`combobox`&&l)&&e.preventDefault(),(o===`combobox`||s&&t)&&a||(a&&d!==!1&&f(``,!0,!1),m())},F={inputRef:n,onInputKeyDown:T,onInputMouseDown:E,onInputChange:j,onInputPaste:M,onInputCompositionStart:k,onInputCompositionEnd:A,onInputBlur:y},I=o===`multiple`||o===`tags`?Y.createElement(at,v({},e,F)):Y.createElement(ot,v({},e,F));return Y.createElement(`div`,{ref:b,className:`${i}-selector`,onClick:N,onMouseDown:P},u&&Y.createElement(`div`,{className:`${i}-prefix`},u),I)}),ct=[`prefixCls`,`disabled`,`visible`,`children`,`popupElement`,`animation`,`transitionName`,`dropdownStyle`,`dropdownClassName`,`direction`,`placement`,`builtinPlacements`,`dropdownMatchSelectWidth`,`dropdownRender`,`dropdownAlign`,`getPopupContainer`,`empty`,`getTriggerDOMNode`,`onPopupVisibleChange`,`onPopupMouseEnter`],lt=function(e){var t=e===!0?0:1;return{bottomLeft:{points:[`tl`,`bl`],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:`scroll`},bottomRight:{points:[`tr`,`br`],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:`scroll`},topLeft:{points:[`bl`,`tl`],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:`scroll`},topRight:{points:[`br`,`tr`],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:`scroll`}}},ut=Y.forwardRef(function(e,t){var n=e.prefixCls;e.disabled;var r=e.visible,i=e.children,a=e.popupElement,o=e.animation,c=e.transitionName,l=e.dropdownStyle,u=e.dropdownClassName,d=e.direction,f=d===void 0?`ltr`:d,m=e.placement,h=e.builtinPlacements,g=e.dropdownMatchSelectWidth,_=e.dropdownRender,y=e.dropdownAlign,b=e.getPopupContainer,x=e.empty,S=e.getTriggerDOMNode,C=e.onPopupVisibleChange,w=e.onPopupMouseEnter,T=s(e,ct),E=`${n}-dropdown`,D=a;_&&(D=_(a));var O=Y.useMemo(function(){return h||lt(g)},[h,g]),k=o?`${E}-${o}`:c,A=typeof g==`number`,j=Y.useMemo(function(){return A?null:g===!1?`minWidth`:`width`},[g,A]),M=l;A&&(M=p(p({},M),{},{width:g}));var N=Y.useRef(null);return Y.useImperativeHandle(t,function(){return{getPopupElement:function(){return N.current?.popupElement}}}),Y.createElement(ue,v({},T,{showAction:C?[`click`]:[],hideAction:C?[`click`]:[],popupPlacement:m||(f===`rtl`?`bottomRight`:`bottomLeft`),builtinPlacements:O,prefixCls:E,popupTransitionName:k,popup:Y.createElement(`div`,{onMouseEnter:w},D),ref:N,stretch:j,popupAlign:y,popupVisible:r,getPopupContainer:b,popupClassName:(0,X.default)(u,U({},`${E}-empty`,x)),popupStyle:M,getTriggerDOMNode:S,onPopupVisibleChange:C}),i)});function dt(e,t){var n=e.key,r;return`value`in e&&(r=e.value),n??(r===void 0?`rc-index-key-${t}`:r)}function ft(e){return e!==void 0&&!Number.isNaN(e)}function pt(e,t){var n=e||{},r=n.label,i=n.value,a=n.options,o=n.groupLabel,s=r||(t?`children`:`label`);return{label:s,value:i||`value`,options:a||`options`,groupLabel:o||s}}function mt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],a=pt(n,!1),o=a.label,s=a.value,c=a.options,l=a.groupLabel;function u(e,t){Array.isArray(e)&&e.forEach(function(e){if(t||!(c in e)){var n=e[s];i.push({key:dt(e,i.length),groupOption:t,data:e,label:e[o],value:n})}else{var a=e[l];a===void 0&&r&&(a=e.label),i.push({key:dt(e,i.length),group:!0,data:e,label:a}),u(e[c],!0)}})}return u(e,!1),i}function ht(e){var t=p({},e);return`props`in t||Object.defineProperty(t,"props",{get:function(){return A(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var gt=function(e,t,n){if(!t||!t.length)return null;var i=!1,a=function e(t,n){var a=F(n),o=a[0],s=a.slice(1);if(!o)return[t];var c=t.split(o);return i||=c.length>1,c.reduce(function(t,n){return[].concat(r(t),r(e(n,s)))},[]).filter(Boolean)}(e,t);return i?n===void 0?a:a.slice(0,n):null},_t=Y.createContext(null);function vt(e){var t=e.visible,n=e.values;if(!t)return null;var r=50;return Y.createElement(`span`,{"aria-live":`polite`,style:{width:0,height:0,position:`absolute`,overflow:`hidden`,opacity:0}},`${n.slice(0,r).map(function(e){var t=e.label,n=e.value;return[`number`,`string`].includes(M(t))?t:n}).join(`, `)}`,n.length>r?`, ...`:null)}var yt=`id.prefixCls.className.showSearch.tagRender.direction.omitDomProps.displayValues.onDisplayValuesChange.emptyOptions.notFoundContent.onClear.mode.disabled.loading.getInputElement.getRawInputElement.open.defaultOpen.onDropdownVisibleChange.activeValue.onActiveValueChange.activeDescendantId.searchValue.autoClearSearchValue.onSearch.onSearchSplit.tokenSeparators.allowClear.prefix.suffixIcon.clearIcon.OptionList.animation.transitionName.dropdownStyle.dropdownClassName.dropdownMatchSelectWidth.dropdownRender.dropdownAlign.placement.builtinPlacements.getPopupContainer.showAction.onFocus.onBlur.onKeyUp.onKeyDown.onMouseDown`.split(`.`),bt=[`value`,`onChange`,`removeIcon`,`placeholder`,`autoFocus`,`maxTagCount`,`maxTagTextLength`,`maxTagPlaceholder`,`choiceTransitionName`,`onInputKeyDown`,`onPopupScroll`,`tabIndex`],xt=function(e){return e===`tags`||e===`multiple`},St=Y.forwardRef(function(e,t){var n,i=e.id,a=e.prefixCls,o=e.className,c=e.showSearch,l=e.tagRender,u=e.direction,d=e.omitDomProps,f=e.displayValues,m=e.onDisplayValuesChange,g=e.emptyOptions,_=e.notFoundContent,y=_===void 0?`Not Found`:_,b=e.onClear,S=e.mode,C=e.disabled,w=e.loading,E=e.getInputElement,D=e.getRawInputElement,O=e.open,k=e.defaultOpen,A=e.onDropdownVisibleChange,j=e.activeValue,M=e.onActiveValueChange,N=e.activeDescendantId,P=e.searchValue,F=e.autoClearSearchValue,I=e.onSearch,ee=e.onSearchSplit,L=e.tokenSeparators,te=e.allowClear,R=e.prefix,ne=e.suffixIcon,z=e.clearIcon,B=e.OptionList,re=e.animation,V=e.transitionName,H=e.dropdownStyle,ae=e.dropdownClassName,W=e.dropdownMatchSelectWidth,oe=e.dropdownRender,G=e.dropdownAlign,K=e.placement,se=e.builtinPlacements,ce=e.getPopupContainer,ue=e.showAction,de=ue===void 0?[]:ue,fe=e.onFocus,pe=e.onBlur,me=e.onKeyUp,he=e.onKeyDown,ge=e.onMouseDown,_e=s(e,yt),q=xt(S),J=(c===void 0?q:c)||S===`combobox`,ve=p({},_e);bt.forEach(function(e){delete ve[e]}),d?.forEach(function(e){delete ve[e]});var ye=Y.useState(!1),be=h(ye,2),xe=be[0],Se=be[1];Y.useEffect(function(){Se(le())},[]);var Ce=Y.useRef(null),Z=Y.useRef(null),Q=Y.useRef(null),we=Y.useRef(null),Te=Y.useRef(null),Ee=Y.useRef(!1),De=We(),Oe=h(De,3),ke=Oe[0],Ae=Oe[1],je=Oe[2];Y.useImperativeHandle(t,function(){return{focus:we.current?.focus,blur:we.current?.blur,scrollTo:function(e){return Te.current?.scrollTo(e)},nativeElement:Ce.current||Z.current}});var Me=Y.useMemo(function(){if(S!==`combobox`)return P;var e=f[0]?.value;return typeof e==`string`||typeof e==`number`?String(e):``},[P,S,f]),Ne=S===`combobox`&&typeof E==`function`&&E()||null,Pe=typeof D==`function`&&D(),Fe=T(Z,Pe==null||(n=Pe.props)==null?void 0:n.ref),Ie=Y.useState(!1),Le=h(Ie,2),Re=Le[0],ze=Le[1];x(function(){ze(!0)},[]);var Ue=ie(!1,{defaultValue:k,value:O}),qe=h(Ue,2),Je=qe[0],Ye=qe[1],$=Re?Je:!1,Xe=!y&&g;(C||Xe&&$&&S===`combobox`)&&($=!1);var Ze=!Xe&&$,Qe=Y.useCallback(function(e){var t=e===void 0?!$:e;C||(Ye(t),$!==t&&A?.(t))},[C,$,Ye,A]),$e=Y.useMemo(function(){return(L||[]).some(function(e){return[`
|
||
`,`\r
|
||
`].includes(e)})},[L]),et=Y.useContext(_t)||{},tt=et.maxCount,nt=et.rawValues,rt=function(e,t,n){if(!(q&&ft(tt)&&nt?.size>=tt)){var r=!0,i=e;M?.(null);var a=gt(e,L,ft(tt)?tt-nt.size:void 0),o=n?null:a;return S!==`combobox`&&o&&(i=``,ee?.(o),Qe(!1),r=!1),I&&Me!==i&&I(i,{source:t?`typing`:`effect`}),r}},it=function(e){e&&e.trim()&&I(e,{source:`submit`})};Y.useEffect(function(){!$&&!q&&S!==`combobox`&&rt(``,!1,!1)},[$]),Y.useEffect(function(){Je&&C&&Ye(!1),C&&!Ee.current&&Ae(!1)},[C]);var at=Ge(),ot=h(at,2),ct=ot[0],lt=ot[1],dt=Y.useRef(!1),pt=function(e){var t=ct(),n=e.key,i=n===`Enter`;if(i&&(S!==`combobox`&&e.preventDefault(),$||Qe(!0)),lt(!!Me),n===`Backspace`&&!t&&q&&!Me&&f.length){for(var a=r(f),o=null,s=a.length-1;s>=0;--s){var c=a[s];if(!c.disabled){a.splice(s,1),o=c;break}}o&&m(a,{type:`remove`,values:[o]})}var l=[...arguments].slice(1);if($&&(!i||!dt.current)){var u;i&&(dt.current=!0),(u=Te.current)==null||u.onKeyDown.apply(u,[e].concat(l))}he?.apply(void 0,[e].concat(l))},mt=function(e){var t=[...arguments].slice(1);if($){var n;(n=Te.current)==null||n.onKeyUp.apply(n,[e].concat(t))}e.key===`Enter`&&(dt.current=!1),me?.apply(void 0,[e].concat(t))},ht=function(e){m(f.filter(function(t){return t!==e}),{type:`remove`,values:[e]})},St=function(){dt.current=!1},Ct=Y.useRef(!1),wt=function(){Ae(!0),C||(fe&&!Ct.current&&fe.apply(void 0,arguments),de.includes(`focus`)&&Qe(!0)),Ct.current=!0},Tt=function(){Ee.current=!0,Ae(!1,function(){Ct.current=!1,Ee.current=!1,Qe(!1)}),C||(Me&&(S===`tags`?I(Me,{source:`submit`}):S===`multiple`&&I(``,{source:`blur`})),pe&&pe.apply(void 0,arguments))},Et=[];Y.useEffect(function(){return function(){Et.forEach(function(e){return clearTimeout(e)}),Et.splice(0,Et.length)}},[]);var Dt=function(e){var t=e.target,n=Q.current?.getPopupElement();if(n&&n.contains(t)){var r=setTimeout(function(){var e=Et.indexOf(r);if(e!==-1&&Et.splice(e,1),je(),!xe&&!n.contains(document.activeElement)){var t;(t=we.current)==null||t.focus()}});Et.push(r)}var i=[...arguments].slice(1);ge?.apply(void 0,[e].concat(i))},Ot=Y.useState({}),kt=h(Ot,2)[1];function At(){kt({})}var jt;Pe&&(jt=function(e){Qe(e)}),Ke(function(){return[Ce.current,Q.current?.getPopupElement()]},Ze,Qe,!!Pe);var Mt=Y.useMemo(function(){return p(p({},e),{},{notFoundContent:y,open:$,triggerOpen:Ze,id:i,showSearch:J,multiple:q,toggleOpen:Qe})},[e,y,Ze,$,i,J,q,Qe]),Nt=!!ne||w,Pt;Nt&&(Pt=Y.createElement(Be,{className:(0,X.default)(`${a}-arrow`,U({},`${a}-arrow-loading`,w)),customizeIcon:ne,customizeIconProps:{loading:w,searchValue:Me,open:$,focused:ke,showSearch:J}}));var Ft=Ve(a,function(){var e;b?.(),(e=we.current)==null||e.focus(),m([],{type:`clear`,values:f}),rt(``,!1,!1)},f,te,z,C,Me,S),It=Ft.allowClear,Lt=Ft.clearIcon,Rt=Y.createElement(B,{ref:Te}),zt=(0,X.default)(a,o,U(U(U(U(U(U(U(U(U(U({},`${a}-focused`,ke),`${a}-multiple`,q),`${a}-single`,!q),`${a}-allow-clear`,te),`${a}-show-arrow`,Nt),`${a}-disabled`,C),`${a}-loading`,w),`${a}-open`,$),`${a}-customize-input`,Ne),`${a}-show-search`,J)),Bt=Y.createElement(ut,{ref:Q,disabled:C,prefixCls:a,visible:Ze,popupElement:Rt,animation:re,transitionName:V,dropdownStyle:H,dropdownClassName:ae,direction:u,dropdownMatchSelectWidth:W,dropdownRender:oe,dropdownAlign:G,placement:K,builtinPlacements:se,getPopupContainer:ce,empty:g,getTriggerDOMNode:function(e){return Z.current||e},onPopupVisibleChange:jt,onPopupMouseEnter:At},Pe?Y.cloneElement(Pe,{ref:Fe}):Y.createElement(st,v({},e,{domRef:Z,prefixCls:a,inputElement:Ne,ref:we,id:i,prefix:R,showSearch:J,autoClearSearchValue:F,mode:S,activeDescendantId:N,tagRender:l,values:f,open:$,onToggleOpen:Qe,activeValue:j,searchValue:Me,onSearch:rt,onSearchSubmit:it,onRemove:ht,tokenWithEnter:$e,onInputBlur:St}))),Vt=Pe?Bt:Y.createElement(`div`,v({className:zt},ve,{ref:Ce,onMouseDown:Dt,onKeyDown:pt,onKeyUp:mt,onFocus:wt,onBlur:Tt}),Y.createElement(vt,{visible:ke&&!$,values:f}),Bt,Pt,It&&Lt);return Y.createElement(He.Provider,{value:Mt},Vt)}),Ct=function(){return null};Ct.isSelectOptGroup=!0;var wt=function(){return null};wt.isSelectOption=!0;var Tt=Y.forwardRef(function(e,t){var n=e.height,r=e.offsetY,i=e.offsetX,a=e.children,o=e.prefixCls,s=e.onInnerResize,c=e.innerProps,l=e.rtl,u=e.extra,d={},f={display:`flex`,flexDirection:`column`};return r!==void 0&&(d={height:n,position:`relative`,overflow:`hidden`},f=p(p({},f),{},U(U(U(U(U({transform:`translateY(${r}px)`},l?`marginRight`:`marginLeft`,-i),`position`,`absolute`),`left`,0),`right`,0),`top`,0))),Y.createElement(`div`,{style:d},Y.createElement(de,{onResize:function(e){e.offsetHeight&&s&&s()}},Y.createElement(`div`,v({style:f,className:(0,X.default)(U({},`${o}-holder-inner`,o)),ref:t},c),a,u)))});Tt.displayName=`Filler`;function Et(e){var t=e.children,n=e.setRef,r=Y.useCallback(function(e){n(e)},[]);return Y.cloneElement(t,{ref:r})}function Dt(e,t,n,r,i,a,o,s){var c=s.getKey;return e.slice(t,n+1).map(function(e,n){var s=o(e,t+n,{style:{width:r},offsetX:i}),l=c(e);return Y.createElement(Et,{key:l,setRef:function(t){return a(e,t)}},s)})}function Ot(e,t,n){var r=e.length,i=t.length,a,o;if(r===0&&i===0)return null;r<i?(a=e,o=t):(a=t,o=e);var s={__EMPTY_ITEM__:!0};function c(e){return e===void 0?s:n(e)}for(var l=null,u=Math.abs(r-i)!==1,d=0;d<o.length;d+=1){var f=c(a[d]);if(f!==c(o[d])){l=d,u||=f!==c(o[d+1]);break}}return l===null?null:{index:l,multiple:u}}function kt(e,t,n){var r=Y.useState(e),i=h(r,2),a=i[0],o=i[1],s=Y.useState(null),c=h(s,2),l=c[0],u=c[1];return Y.useEffect(function(){var r=Ot(a||[],e||[],t);r?.index!==void 0&&(n?.(r.index),u(e[r.index])),o(e)},[e]),[l]}var At=(typeof navigator>`u`?`undefined`:M(navigator))===`object`&&/Firefox/i.test(navigator.userAgent),jt=(function(e,t,n,r){var i=(0,Y.useRef)(!1),a=(0,Y.useRef)(null);function o(){clearTimeout(a.current),i.current=!0,a.current=setTimeout(function(){i.current=!1},50)}var s=(0,Y.useRef)({top:e,bottom:t,left:n,right:r});return s.current.top=e,s.current.bottom=t,s.current.left=n,s.current.right=r,function(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=e?t<0&&s.current.left||t>0&&s.current.right:t<0&&s.current.top||t>0&&s.current.bottom;return n&&r?(clearTimeout(a.current),i.current=!1):(!r||i.current)&&o(),!i.current&&r}});function Mt(e,t,n,r,i,a,o){var s=(0,Y.useRef)(0),c=(0,Y.useRef)(null),l=(0,Y.useRef)(null),u=(0,Y.useRef)(!1),d=jt(t,n,r,i);function f(e,t){if(z.cancel(c.current),!d(!1,t)){var n=e;if(!n._virtualHandled)n._virtualHandled=!0;else return;s.current+=t,l.current=t,At||n.preventDefault(),c.current=z(function(){var e=u.current?10:1;o(s.current*e,!1),s.current=0})}}function p(e,t){o(t,!0),At||e.preventDefault()}var m=(0,Y.useRef)(null),h=(0,Y.useRef)(null);function g(t){if(e){z.cancel(h.current),h.current=z(function(){m.current=null},2);var n=t.deltaX,r=t.deltaY,i=t.shiftKey,o=n,s=r;(m.current===`sx`||!m.current&&i&&r&&!n)&&(o=r,s=0,m.current=`sx`);var c=Math.abs(o),l=Math.abs(s);m.current===null&&(m.current=a&&c>l?`x`:`y`),m.current===`y`?f(t,s):p(t,o)}}function _(t){e&&(u.current=t.detail===l.current)}return[g,_]}function Nt(e,t,n,r){var i=Y.useMemo(function(){return[new Map,[]]},[e,n.id,r]),a=h(i,2),o=a[0],s=a[1];return function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i,c=o.get(i),l=o.get(a);if(c===void 0||l===void 0)for(var u=e.length,d=s.length;d<u;d+=1){var f=t(e[d]);o.set(f,d);var p=n.get(f)??r;if(s[d]=(s[d-1]||0)+p,f===i&&(c=d),f===a&&(l=d),c!==void 0&&l!==void 0)break}return{top:s[c-1]||0,bottom:s[l]}}}var Pt=function(){function e(){c(this,e),U(this,`maps`,void 0),U(this,`id`,0),U(this,`diffRecords`,new Map),this.maps=Object.create(null)}return _(e,[{key:`set`,value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:`get`,value:function(e){return this.maps[e]}},{key:`resetRecord`,value:function(){this.diffRecords.clear()}},{key:`getRecord`,value:function(){return this.diffRecords}}]),e}();function Ft(e){var t=parseFloat(e);return isNaN(t)?0:t}function It(e,t,n){var r=Y.useState(0),i=h(r,2),a=i[0],o=i[1],s=(0,Y.useRef)(new Map),c=(0,Y.useRef)(new Pt),l=(0,Y.useRef)(0);function u(){l.current+=1}function d(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0];u();var t=function(){var e=!1;s.current.forEach(function(t,n){if(t&&t.offsetParent){var r=t.offsetHeight,i=getComputedStyle(t),a=i.marginTop,o=i.marginBottom,s=Ft(a),l=Ft(o),u=r+s+l;c.current.get(n)!==u&&(c.current.set(n,u),e=!0)}}),e&&o(function(e){return e+1})};if(e)t();else{l.current+=1;var n=l.current;Promise.resolve().then(function(){n===l.current&&t()})}}function f(r,i){var a=e(r),o=s.current.get(a);i?(s.current.set(a,i),d()):s.current.delete(a),!o!=!i&&(i?t?.(r):n?.(r))}return(0,Y.useEffect)(function(){return u},[]),[f,d,c.current,a]}var Lt=14/15;function Rt(e,t,n){var r=(0,Y.useRef)(!1),i=(0,Y.useRef)(0),a=(0,Y.useRef)(0),o=(0,Y.useRef)(null),s=(0,Y.useRef)(null),c,l=function(e){if(r.current){var t=Math.ceil(e.touches[0].pageX),o=Math.ceil(e.touches[0].pageY),c=i.current-t,l=a.current-o,u=Math.abs(c)>Math.abs(l);u?i.current=t:a.current=o;var d=n(u,u?c:l,!1,e);d&&e.preventDefault(),clearInterval(s.current),d&&(s.current=setInterval(function(){u?c*=Lt:l*=Lt;var e=Math.floor(u?c:l);(!n(u,e,!0)||Math.abs(e)<=.1)&&clearInterval(s.current)},16))}},u=function(){r.current=!1,c()},d=function(e){c(),e.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(e.touches[0].pageX),a.current=Math.ceil(e.touches[0].pageY),o.current=e.target,o.current.addEventListener(`touchmove`,l,{passive:!1}),o.current.addEventListener(`touchend`,u,{passive:!0}))};c=function(){o.current&&(o.current.removeEventListener(`touchmove`,l),o.current.removeEventListener(`touchend`,u))},x(function(){return e&&t.current.addEventListener(`touchstart`,d,{passive:!0}),function(){var e;(e=t.current)==null||e.removeEventListener(`touchstart`,d),c(),clearInterval(s.current)}},[e])}function zt(e){return Math.floor(e**.5)}function Bt(e,t){return(`touches`in e?e.touches[0]:e)[t?`pageX`:`pageY`]-window[t?`scrollX`:`scrollY`]}function Vt(e,t,n){Y.useEffect(function(){var r=t.current;if(e&&r){var i=!1,a,o,s=function(){z.cancel(a)},c=function e(){s(),a=z(function(){n(o),e()})},l=function(){i=!1,s()},u=function(e){if(!(e.target.draggable||e.button!==0)){var t=e;t._virtualHandled||(t._virtualHandled=!0,i=!0)}},d=function(e){if(i){var t=Bt(e,!1),n=r.getBoundingClientRect(),a=n.top,l=n.bottom;t<=a?(o=-zt(a-t),c()):t>=l?(o=zt(t-l),c()):s()}};return r.addEventListener(`mousedown`,u),r.ownerDocument.addEventListener(`mouseup`,l),r.ownerDocument.addEventListener(`mousemove`,d),r.ownerDocument.addEventListener(`dragend`,l),function(){r.removeEventListener(`mousedown`,u),r.ownerDocument.removeEventListener(`mouseup`,l),r.ownerDocument.removeEventListener(`mousemove`,d),r.ownerDocument.removeEventListener(`dragend`,l),s()}}},[e])}var Ht=10;function Ut(e,t,n,r,i,a,o,s){var c=Y.useRef(),l=Y.useState(null),u=h(l,2),d=u[0],f=u[1];return x(function(){if(d&&d.times<Ht){if(!e.current){f(function(e){return p({},e)});return}a();var s=d.targetAlign,c=d.originAlign,l=d.index,u=d.offset,m=e.current.clientHeight,h=!1,g=s,_=null;if(m){for(var v=s||c,y=0,b=0,x=0,S=Math.min(t.length-1,l),C=0;C<=S;C+=1){var w=i(t[C]);b=y;var T=n.get(w);x=b+(T===void 0?r:T),y=x}for(var E=v===`top`?u:m-u,D=S;D>=0;--D){var O=i(t[D]),k=n.get(O);if(k===void 0){h=!0;break}if(E-=k,E<=0)break}switch(v){case`top`:_=b-u;break;case`bottom`:_=x-m+u;break;default:var A=e.current.scrollTop,j=A+m;b<A?g=`top`:x>j&&(g=`bottom`)}_!==null&&o(_),_!==d.lastTop&&(h=!0)}h&&f(p(p({},d),{},{times:d.times+1,targetAlign:g,lastTop:_}))}},[d,e.current]),function(e){if(e==null)s();else if(z.cancel(c.current),typeof e==`number`)o(e);else if(e&&M(e)===`object`){var n,r=e.align;n=`index`in e?e.index:t.findIndex(function(t){return i(t)===e.key});var a=e.offset;f({times:0,index:n,offset:a===void 0?0:a,originAlign:r})}}}var Wt=Y.forwardRef(function(e,t){var n=e.prefixCls,r=e.rtl,i=e.scrollOffset,a=e.scrollRange,o=e.onStartMove,s=e.onStopMove,c=e.onScroll,l=e.horizontal,u=e.spinSize,d=e.containerSize,f=e.style,m=e.thumbStyle,g=e.showScrollBar,_=Y.useState(!1),v=h(_,2),y=v[0],b=v[1],x=Y.useState(null),S=h(x,2),C=S[0],w=S[1],T=Y.useState(null),E=h(T,2),D=E[0],O=E[1],k=!r,A=Y.useRef(),j=Y.useRef(),M=Y.useState(g),N=h(M,2),P=N[0],F=N[1],I=Y.useRef(),ee=function(){g!==!0&&g!==!1&&(clearTimeout(I.current),F(!0),I.current=setTimeout(function(){F(!1)},3e3))},L=a-d||0,te=d-u||0,R=Y.useMemo(function(){return i===0||L===0?0:i/L*te},[i,L,te]),ne=function(e){e.stopPropagation(),e.preventDefault()},B=Y.useRef({top:R,dragging:y,pageY:C,startTop:D});B.current={top:R,dragging:y,pageY:C,startTop:D};var re=function(e){b(!0),w(Bt(e,l)),O(B.current.top),o(),e.stopPropagation(),e.preventDefault()};Y.useEffect(function(){var e=function(e){e.preventDefault()},t=A.current,n=j.current;return t.addEventListener(`touchstart`,e,{passive:!1}),n.addEventListener(`touchstart`,re,{passive:!1}),function(){t.removeEventListener(`touchstart`,e),n.removeEventListener(`touchstart`,re)}},[]);var ie=Y.useRef();ie.current=L;var V=Y.useRef();V.current=te,Y.useEffect(function(){if(y){var e,t=function(t){var n=B.current,r=n.dragging,i=n.pageY,a=n.startTop;z.cancel(e);var o=A.current.getBoundingClientRect(),s=d/(l?o.width:o.height);if(r){var u=(Bt(t,l)-i)*s,f=a;!k&&l?f-=u:f+=u;var p=ie.current,m=V.current,h=m?f/m:0,g=Math.ceil(h*p);g=Math.max(g,0),g=Math.min(g,p),e=z(function(){c(g,l)})}},n=function(){b(!1),s()};return window.addEventListener(`mousemove`,t,{passive:!0}),window.addEventListener(`touchmove`,t,{passive:!0}),window.addEventListener(`mouseup`,n,{passive:!0}),window.addEventListener(`touchend`,n,{passive:!0}),function(){window.removeEventListener(`mousemove`,t),window.removeEventListener(`touchmove`,t),window.removeEventListener(`mouseup`,n),window.removeEventListener(`touchend`,n),z.cancel(e)}}},[y]),Y.useEffect(function(){return ee(),function(){clearTimeout(I.current)}},[i]),Y.useImperativeHandle(t,function(){return{delayHidden:ee}});var H=`${n}-scrollbar`,ae={position:`absolute`,visibility:P?null:`hidden`},W={position:`absolute`,borderRadius:99,background:`var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))`,cursor:`pointer`,userSelect:`none`};return l?(Object.assign(ae,{height:8,left:0,right:0,bottom:0}),Object.assign(W,U({height:`100%`,width:u},k?`left`:`right`,R))):(Object.assign(ae,U({width:8,top:0,bottom:0},k?`right`:`left`,0)),Object.assign(W,{width:`100%`,height:u,top:R})),Y.createElement(`div`,{ref:A,className:(0,X.default)(H,U(U(U({},`${H}-horizontal`,l),`${H}-vertical`,!l),`${H}-visible`,P)),style:p(p({},ae),f),onMouseDown:ne,onMouseMove:ee},Y.createElement(`div`,{ref:j,className:(0,X.default)(`${H}-thumb`,U({},`${H}-thumb-moving`,y)),style:p(p({},W),m),onMouseDown:re}))}),Gt=20;function Kt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e/(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*e;return isNaN(t)&&(t=0),t=Math.max(t,Gt),Math.floor(t)}var qt=[`prefixCls`,`className`,`height`,`itemHeight`,`fullHeight`,`style`,`data`,`children`,`itemKey`,`virtual`,`direction`,`scrollWidth`,`component`,`onScroll`,`onVirtualScroll`,`onVisibleChange`,`innerProps`,`extraRender`,`styles`,`showScrollBar`],Jt=[],Yt={overflowY:`auto`,overflowAnchor:`none`};function Xt(e,t){var n=e.prefixCls,r=n===void 0?`rc-virtual-list`:n,i=e.className,a=e.height,o=e.itemHeight,c=e.fullHeight,l=c===void 0||c,u=e.style,d=e.data,f=e.children,m=e.itemKey,g=e.virtual,_=e.direction,y=e.scrollWidth,b=e.component,S=b===void 0?`div`:b,C=e.onScroll,w=e.onVirtualScroll,T=e.onVisibleChange,E=e.innerProps,D=e.extraRender,O=e.styles,k=e.showScrollBar,A=k===void 0?`optional`:k,j=s(e,qt),N=Y.useCallback(function(e){return typeof m==`function`?m(e):e?.[m]},[m]),P=It(N,null,null),F=h(P,4),I=F[0],ee=F[1],L=F[2],te=F[3],R=!!(g!==!1&&a&&o),z=Y.useMemo(function(){return Object.values(L.maps).reduce(function(e,t){return e+t},0)},[L.id,L.maps]),B=R&&d&&(Math.max(o*d.length,z)>a||!!y),re=_===`rtl`,ie=(0,X.default)(r,U({},`${r}-rtl`,re),i),V=d||Jt,H=(0,Y.useRef)(),ae=(0,Y.useRef)(),W=(0,Y.useRef)(),oe=(0,Y.useState)(0),G=h(oe,2),K=G[0],se=G[1],ce=(0,Y.useState)(0),le=h(ce,2),ue=le[0],fe=le[1],pe=(0,Y.useState)(!1),me=h(pe,2),he=me[0],ge=me[1],_e=function(){ge(!0)},q=function(){ge(!1)},J={getKey:N};function ve(e){se(function(t){var n=Le(typeof e==`function`?e(t):e);return H.current.scrollTop=n,n})}var ye=(0,Y.useRef)({start:0,end:V.length}),be=(0,Y.useRef)(),Se=kt(V,N);be.current=h(Se,1)[0];var Ce=Y.useMemo(function(){if(!R)return{scrollHeight:void 0,start:0,end:V.length-1,offset:void 0};if(!B)return{scrollHeight:ae.current?.offsetHeight||0,start:0,end:V.length-1,offset:void 0};for(var e=0,t,n,r,i=V.length,s=0;s<i;s+=1){var c=N(V[s]),l=L.get(c),u=e+(l===void 0?o:l);u>=K&&t===void 0&&(t=s,n=e),u>K+a&&r===void 0&&(r=s),e=u}return t===void 0&&(t=0,n=0,r=Math.ceil(a/o)),r===void 0&&(r=V.length-1),r=Math.min(r+1,V.length-1),{scrollHeight:e,start:t,end:r,offset:n}},[B,R,K,V,te,a]),Z=Ce.scrollHeight,Q=Ce.start,we=Ce.end,Te=Ce.offset;ye.current.start=Q,ye.current.end=we,Y.useLayoutEffect(function(){var e=L.getRecord();if(e.size===1){var t=Array.from(e.keys())[0],n=e.get(t),r=V[Q];if(r&&n===void 0&&N(r)===t){var i=L.get(t)-o;ve(function(e){return e+i})}}L.resetRecord()},[Z]);var Ee=Y.useState({width:0,height:a}),De=h(Ee,2),Oe=De[0],ke=De[1],Ae=function(e){ke({width:e.offsetWidth,height:e.offsetHeight})},je=(0,Y.useRef)(),Me=(0,Y.useRef)(),Ne=Y.useMemo(function(){return Kt(Oe.width,y)},[Oe.width,y]),Pe=Y.useMemo(function(){return Kt(Oe.height,Z)},[Oe.height,Z]),Fe=Z-a,Ie=(0,Y.useRef)(Fe);Ie.current=Fe;function Le(e){var t=e;return Number.isNaN(Ie.current)||(t=Math.min(t,Ie.current)),t=Math.max(t,0),t}var Re=K<=0,ze=K>=Fe,Be=ue<=0,Ve=ue>=y,He=jt(Re,ze,Be,Ve),Ue=function(){return{x:re?-ue:ue,y:K}},We=(0,Y.useRef)(Ue()),Ge=ne(function(e){if(w){var t=p(p({},Ue()),e);(We.current.x!==t.x||We.current.y!==t.y)&&(w(t),We.current=t)}});function Ke(e,t){var n=e;t?((0,xe.flushSync)(function(){fe(n)}),Ge()):ve(n)}function qe(e){var t=e.currentTarget.scrollTop;t!==K&&ve(t),C?.(e),Ge()}var Je=function(e){var t=e,n=y?y-Oe.width:0;return t=Math.max(t,0),t=Math.min(t,n),t},Ye=ne(function(e,t){t?((0,xe.flushSync)(function(){fe(function(t){return Je(t+(re?-e:e))})}),Ge()):ve(function(t){return t+e})}),$=Mt(R,Re,ze,Be,Ve,!!y,Ye),Xe=h($,2),Ze=Xe[0],Qe=Xe[1];Rt(R,H,function(e,t,n,r){var i=r;return He(e,t,n)?!1:!i||!i._virtualHandled?(i&&(i._virtualHandled=!0),Ze({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0):!1}),Vt(B,H,function(e){ve(function(t){return t+e})}),x(function(){function e(e){var t=Re&&e.detail<0,n=ze&&e.detail>0;R&&!t&&!n&&e.preventDefault()}var t=H.current;return t.addEventListener(`wheel`,Ze,{passive:!1}),t.addEventListener(`DOMMouseScroll`,Qe,{passive:!0}),t.addEventListener(`MozMousePixelScroll`,e,{passive:!1}),function(){t.removeEventListener(`wheel`,Ze),t.removeEventListener(`DOMMouseScroll`,Qe),t.removeEventListener(`MozMousePixelScroll`,e)}},[R,Re,ze]),x(function(){if(y){var e=Je(ue);fe(e),Ge({x:e})}},[Oe.width,y]);var $e=function(){var e,t;(e=je.current)==null||e.delayHidden(),(t=Me.current)==null||t.delayHidden()},et=Ut(H,V,L,o,N,function(){return ee(!0)},ve,$e);Y.useImperativeHandle(t,function(){return{nativeElement:W.current,getScrollInfo:Ue,scrollTo:function(e){function t(e){return e&&M(e)===`object`&&(`left`in e||`top`in e)}t(e)?(e.left!==void 0&&fe(Je(e.left)),et(e.top)):et(e)}}}),x(function(){T&&T(V.slice(Q,we+1),V)},[Q,we,V]);var tt=Nt(V,N,L,o),nt=D?.({start:Q,end:we,virtual:B,offsetX:ue,offsetY:Te,rtl:re,getSize:tt}),rt=Dt(V,Q,we,y,ue,I,f,J),it=null;a&&(it=p(U({},l?`height`:`maxHeight`,a),Yt),R&&(it.overflowY=`hidden`,y&&(it.overflowX=`hidden`),he&&(it.pointerEvents=`none`)));var at={};return re&&(at.dir=`rtl`),Y.createElement(`div`,v({ref:W,style:p(p({},u),{},{position:`relative`}),className:ie},at,j),Y.createElement(de,{onResize:Ae},Y.createElement(S,{className:`${r}-holder`,style:it,ref:H,onScroll:qe,onMouseEnter:$e},Y.createElement(Tt,{prefixCls:r,height:Z,offsetX:ue,offsetY:Te,scrollWidth:y,onInnerResize:ee,ref:ae,innerProps:E,rtl:re,extra:nt},rt))),B&&Z>a&&Y.createElement(Wt,{ref:je,prefixCls:r,scrollOffset:K,scrollRange:Z,rtl:re,onScroll:Ke,onStartMove:_e,onStopMove:q,spinSize:Pe,containerSize:Oe.height,style:O?.verticalScrollBar,thumbStyle:O?.verticalScrollBarThumb,showScrollBar:A}),B&&y>Oe.width&&Y.createElement(Wt,{ref:Me,prefixCls:r,scrollOffset:ue,scrollRange:y,rtl:re,onScroll:Ke,onStartMove:_e,onStopMove:q,spinSize:Ne,containerSize:Oe.width,horizontal:!0,style:O?.horizontalScrollBar,thumbStyle:O?.horizontalScrollBarThumb,showScrollBar:A}))}var Zt=Y.forwardRef(Xt);Zt.displayName=`List`;var Qt=Zt;function $t(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var en=[`disabled`,`title`,`children`,`style`,`className`];function tn(e){return typeof e==`string`||typeof e==`number`}var nn=Y.forwardRef(function(e,t){var n=Ue(),i=n.prefixCls,a=n.id,o=n.open,c=n.multiple,l=n.mode,d=n.searchValue,f=n.toggleOpen,p=n.notFoundContent,_=n.onPopupScroll,y=Y.useContext(_t),b=y.maxCount,x=y.flattenOptions,S=y.onActiveValue,C=y.defaultActiveFirstOption,w=y.onSelect,T=y.menuItemSelectedIcon,E=y.rawValues,D=y.fieldNames,O=y.virtual,k=y.direction,A=y.listHeight,j=y.listItemHeight,M=y.optionRender,N=`${i}-item`,P=u(function(){return x},[o,x],function(e,t){return t[0]&&e[1]!==t[1]}),F=Y.useRef(null),I=Y.useMemo(function(){return c&&ft(b)&&E?.size>=b},[c,b,E?.size]),ee=function(e){e.preventDefault()},L=function(e){var t;(t=F.current)==null||t.scrollTo(typeof e==`number`?{index:e}:e)},te=Y.useCallback(function(e){return l!==`combobox`&&E.has(e)},[l,r(E).toString(),E.size]),R=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=P.length,r=0;r<n;r+=1){var i=(e+r*t+n)%n,a=P[i]||{},o=a.group,s=a.data;if(!o&&!(s!=null&&s.disabled)&&(te(s.value)||!I))return i}return-1},ne=Y.useState(function(){return R(0)}),z=h(ne,2),B=z[0],re=z[1],ie=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];re(e);var n={source:t?`keyboard`:`mouse`},r=P[e];r?S(r.value,e,n):S(null,-1,n)};(0,Y.useEffect)(function(){ie(C===!1?-1:R(0))},[P.length,d]);var V=Y.useCallback(function(e){return l===`combobox`?String(e).toLowerCase()===d.toLowerCase():E.has(e)},[l,d,r(E).toString(),E.size]);(0,Y.useEffect)(function(){var e=setTimeout(function(){if(!c&&o&&E.size===1){var e=Array.from(E)[0],t=P.findIndex(function(t){var n=t.data;return d?String(n.value).startsWith(d):n.value===e});t!==-1&&(ie(t),L(t))}});if(o){var t;(t=F.current)==null||t.scrollTo(void 0)}return function(){return clearTimeout(e)}},[o,d]);var H=function(e){e!==void 0&&w(e,{selected:!E.has(e)}),c||f(!1)};if(Y.useImperativeHandle(t,function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case g.N:case g.P:case g.UP:case g.DOWN:var r=0;if(t===g.UP?r=-1:t===g.DOWN?r=1:$t()&&n&&(t===g.N?r=1:t===g.P&&(r=-1)),r!==0){var i=R(B+r,r);L(i),ie(i,!0)}break;case g.TAB:case g.ENTER:var a,s=P[B];s&&!(s!=null&&(a=s.data)!=null&&a.disabled)&&!I?H(s.value):H(void 0),o&&e.preventDefault();break;case g.ESC:f(!1),o&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){L(e)}}}),P.length===0)return Y.createElement(`div`,{role:`listbox`,id:`${a}_list`,className:`${N}-empty`,onMouseDown:ee},p);var ae=Object.keys(D).map(function(e){return D[e]}),W=function(e){return e.label};function oe(e,t){return{role:e.group?`presentation`:`option`,id:`${a}_list_${t}`}}var G=function(e){var t=P[e];if(!t)return null;var n=t.data||{},r=n.value,i=t.group,a=m(n,!0),o=W(t);return t?Y.createElement(`div`,v({"aria-label":typeof o==`string`&&!i?o:null},a,{key:e},oe(t,e),{"aria-selected":V(r)}),r):null},K={role:`listbox`,id:`${a}_list`};return Y.createElement(Y.Fragment,null,O&&Y.createElement(`div`,v({},K,{style:{height:0,width:0,overflow:`hidden`}}),G(B-1),G(B),G(B+1)),Y.createElement(Qt,{itemKey:`key`,ref:F,data:P,height:A,itemHeight:j,fullHeight:!1,onMouseDown:ee,onScroll:_,virtual:O,direction:k,innerProps:O?null:K},function(e,t){var n=e.group,r=e.groupOption,i=e.data,a=e.label,o=e.value,c=i.key;if(n){var l=i.title??(tn(a)?a.toString():void 0);return Y.createElement(`div`,{className:(0,X.default)(N,`${N}-group`,i.className),title:l},a===void 0?c:a)}var u=i.disabled,d=i.title;i.children;var f=i.style,p=i.className,h=s(i,en),g=ce(h,ae),_=te(o),y=u||!_&&I,b=`${N}-option`,x=(0,X.default)(N,b,p,U(U(U(U({},`${b}-grouped`,r),`${b}-active`,B===t&&!y),`${b}-disabled`,y),`${b}-selected`,_)),S=W(e),C=!T||typeof T==`function`||_,w=typeof S==`number`?S:S||o,E=tn(w)?w.toString():void 0;return d!==void 0&&(E=d),Y.createElement(`div`,v({},m(g),O?{}:oe(e,t),{"aria-selected":V(o),className:x,title:E,onMouseMove:function(){B===t||y||ie(t)},onClick:function(){y||H(o)},style:f}),Y.createElement(`div`,{className:`${b}-content`},typeof M==`function`?M(e,{index:t}):w),Y.isValidElement(T)||_,C&&Y.createElement(Be,{className:`${N}-option-state`,customizeIcon:T,customizeIconProps:{value:o,disabled:y,isSelected:_}},_?`✓`:null))}))}),rn=(function(e,t){var n=Y.useRef({values:new Map,options:new Map});return[Y.useMemo(function(){var r=n.current,i=r.values,a=r.options,o=e.map(function(e){return e.label===void 0?p(p({},e),{},{label:i.get(e.value)?.label}):e}),s=new Map,c=new Map;return o.forEach(function(e){s.set(e.value,e),c.set(e.value,t.get(e.value)||a.get(e.value))}),n.current.values=s,n.current.options=c,o},[e,t]),Y.useCallback(function(e){return t.get(e)||n.current.options.get(e)},[t])]});function an(e,t){return Xe(e).join(``).toUpperCase().includes(t)}var on=(function(e,t,n,r,i){return Y.useMemo(function(){if(!n||r===!1)return e;var a=t.options,o=t.label,s=t.value,c=[],l=typeof r==`function`,u=n.toUpperCase(),d=l?r:function(e,t){return i?an(t[i],u):t[a]?an(t[o===`children`?`label`:o],u):an(t[s],u)},f=l?function(e){return ht(e)}:function(e){return e};return e.forEach(function(e){if(e[a]){if(d(n,f(e)))c.push(e);else{var t=e[a].filter(function(e){return d(n,f(e))});t.length&&c.push(p(p({},e),{},U({},a,t)))}}else d(n,f(e))&&c.push(e)}),c},[e,r,i,n,t])}),sn=0,cn=a();function ln(){var e;return cn?(e=sn,sn+=1):e=`TEST_OR_SSR`,e}function un(e){var t=Y.useState(),n=h(t,2),r=n[0],i=n[1];return Y.useEffect(function(){i(`rc_select_${ln()}`)},[]),e||r}var dn=[`children`,`value`],fn=[`children`];function pn(e){var t=e,n=t.key,r=t.props,i=r.children,a=r.value,o=s(r,dn);return p({key:n,value:a===void 0?n:a,children:i},o)}function mn(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return O(e).map(function(e,n){if(!Y.isValidElement(e)||!e.type)return null;var r=e,i=r.type.isSelectOptGroup,a=r.key,o=r.props,c=o.children,l=s(o,fn);return t||!i?pn(e):p(p({key:`__RC_SELECT_GRP__${a===null?n:a}__`,label:a},l),{},{options:mn(c)})}).filter(function(e){return e})}var hn=function(e,t,n,r,i){return Y.useMemo(function(){var a=e;e||(a=mn(t));var o=new Map,s=new Map,c=function(e,t,n){n&&typeof n==`string`&&e.set(t[n],t)};return(function e(t){for(var a=arguments.length>1&&arguments[1]!==void 0&&arguments[1],l=0;l<t.length;l+=1){var u=t[l];!u[n.options]||a?(o.set(u[n.value],u),c(s,u,n.label),c(s,u,r),c(s,u,i)):e(u[n.options],!0)}})(a),{options:a,valueOptions:o,labelOptions:s}},[e,t,n,r,i])};function gn(e){var t=Y.useRef();return t.current=e,Y.useCallback(function(){return t.current.apply(t,arguments)},[])}var _n=`id.mode.prefixCls.backfill.fieldNames.inputValue.searchValue.onSearch.autoClearSearchValue.onSelect.onDeselect.dropdownMatchSelectWidth.filterOption.filterSort.optionFilterProp.optionLabelProp.options.optionRender.children.defaultActiveFirstOption.menuItemSelectedIcon.virtual.direction.listHeight.listItemHeight.labelRender.value.defaultValue.labelInValue.onChange.maxCount`.split(`.`),vn=[`inputValue`];function yn(e){return!e||M(e)!==`object`}var bn=Y.forwardRef(function(e,t){var n=e.id,i=e.mode,a=e.prefixCls,o=a===void 0?`rc-select`:a,c=e.backfill,l=e.fieldNames,u=e.inputValue,d=e.searchValue,f=e.onSearch,m=e.autoClearSearchValue,g=m===void 0||m,_=e.onSelect,y=e.onDeselect,b=e.dropdownMatchSelectWidth,x=b===void 0||b,S=e.filterOption,C=e.filterSort,w=e.optionFilterProp,T=e.optionLabelProp,E=e.options,D=e.optionRender,O=e.children,k=e.defaultActiveFirstOption,A=e.menuItemSelectedIcon,j=e.virtual,M=e.direction,N=e.listHeight,P=N===void 0?200:N,F=e.listItemHeight,I=F===void 0?20:F,ee=e.labelRender,L=e.value,te=e.defaultValue,R=e.labelInValue,ne=e.onChange,z=e.maxCount,B=s(e,_n),re=un(n),V=xt(i),H=!(E||!O),ae=Y.useMemo(function(){return S===void 0&&i===`combobox`?!1:S},[S,i]),W=Y.useMemo(function(){return pt(l,H)},[JSON.stringify(l),H]),oe=ie(``,{value:d===void 0?u:d,postState:function(e){return e||``}}),G=h(oe,2),K=G[0],se=G[1],ce=hn(E,O,W,w,T),le=ce.valueOptions,ue=ce.labelOptions,de=ce.options,fe=Y.useCallback(function(e){return Xe(e).map(function(e){var t,n,r,i,a;yn(e)?t=e:(r=e.key,n=e.label,t=e.value??r);var o=le.get(t);return o&&(n===void 0&&(n=o?.[T||W.label]),r===void 0&&(r=o?.key??t),i=o?.disabled,a=o?.title),{label:n,value:t,key:r,disabled:i,title:a}})},[W,T,le]),pe=ie(te,{value:L}),me=h(pe,2),he=me[0],ge=me[1],_e=rn(Y.useMemo(function(){var e=fe(V&&he===null?[]:he);return i===`combobox`&&$e(e[0]?.value)?[]:e},[he,fe,i,V]),le),q=h(_e,2),J=q[0],ve=q[1],ye=Y.useMemo(function(){if(!i&&J.length===1){var e=J[0];if(e.value===null&&(e.label===null||e.label===void 0))return[]}return J.map(function(e){return p(p({},e),{},{label:(typeof ee==`function`?ee(e):e.label)??e.value})})},[i,J,ee]),be=Y.useMemo(function(){return new Set(J.map(function(e){return e.value}))},[J]);Y.useEffect(function(){if(i===`combobox`){var e=J[0]?.value;se(Qe(e)?String(e):``)}},[J]);var xe=gn(function(e,t){var n=t??e;return U(U({},W.value,e),W.label,n)}),X=on(Y.useMemo(function(){if(i!==`tags`)return de;var e=r(de),t=function(e){return le.has(e)};return r(J).sort(function(e,t){return e.value<t.value?-1:1}).forEach(function(n){var r=n.value;t(r)||e.push(xe(r,n.label))}),e},[xe,de,le,J,i]),W,K,ae,w),Se=Y.useMemo(function(){return i!==`tags`||!K||X.some(function(e){return e[w||`value`]===K})||X.some(function(e){return e[W.value]===K})?X:[xe(K)].concat(r(X))},[xe,w,i,X,K,W]),Ce=function e(t){return r(t).sort(function(e,t){return C(e,t,{searchValue:K})}).map(function(t){return Array.isArray(t.options)?p(p({},t),{},{options:t.options.length>0?e(t.options):t.options}):t})},Z=Y.useMemo(function(){return C?Ce(Se):Se},[Se,C,K]),Q=Y.useMemo(function(){return mt(Z,{fieldNames:W,childrenAsData:H})},[Z,W,H]),we=function(e){var t=fe(e);if(ge(t),ne&&(t.length!==J.length||t.some(function(e,t){return J[t]?.value!==e?.value}))){var n=R?t:t.map(function(e){return e.value}),r=t.map(function(e){return ht(ve(e.value))});ne(V?n:n[0],V?r:r[0])}},Te=Y.useState(null),Ee=h(Te,2),De=Ee[0],Oe=Ee[1],ke=Y.useState(0),Ae=h(ke,2),je=Ae[0],Me=Ae[1],Ne=k===void 0?i!==`combobox`:k,Pe=Y.useCallback(function(e,t){var n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}).source,r=n===void 0?`keyboard`:n;Me(t),c&&i===`combobox`&&e!==null&&r===`keyboard`&&Oe(String(e))},[c,i]),Fe=function(e,t,n){var r=function(){var t=ve(e);return[R?{label:t?.[W.label],value:e,key:t?.key??e}:e,ht(t)]};if(t&&_){var i=r(),a=h(i,2);_(a[0],a[1])}else if(!t&&y&&n!==`clear`){var o=r(),s=h(o,2);y(s[0],s[1])}},Ie=gn(function(e,t){var n,a=!V||t.selected;n=a?V?[].concat(r(J),[e]):[e]:J.filter(function(t){return t.value!==e}),we(n),Fe(e,a),i===`combobox`?Oe(``):(!xt||g)&&(se(``),Oe(``))}),Le=function(e,t){we(e);var n=t.type,r=t.values;(n===`remove`||n===`clear`)&&r.forEach(function(e){Fe(e.value,!1,n)})},Re=function(e,t){if(se(e),Oe(null),t.source===`submit`){var n=(e||``).trim();n&&(we(Array.from(new Set([].concat(r(be),[n])))),Fe(n,!0),se(``))}else t.source!==`blur`&&(i===`combobox`&&we(e),f?.(e))},ze=function(e){var t=e;i!==`tags`&&(t=e.map(function(e){return ue.get(e)?.value}).filter(function(e){return e!==void 0}));var n=Array.from(new Set([].concat(r(be),r(t))));we(n),n.forEach(function(e){Fe(e,!0)})},Be=Y.useMemo(function(){var e=j!==!1&&x!==!1;return p(p({},ce),{},{flattenOptions:Q,onActiveValue:Pe,defaultActiveFirstOption:Ne,onSelect:Ie,menuItemSelectedIcon:A,rawValues:be,fieldNames:W,virtual:e,direction:M,listHeight:P,listItemHeight:I,childrenAsData:H,maxCount:z,optionRender:D})},[z,ce,Q,Pe,Ne,Ie,A,be,W,j,x,M,P,I,H,D]);return Y.createElement(_t.Provider,{value:Be},Y.createElement(St,v({},B,{id:re,prefixCls:o,ref:t,omitDomProps:vn,mode:i,displayValues:ye,onDisplayValuesChange:Le,direction:M,searchValue:K,onSearch:Re,autoClearSearchValue:g,onSearchSplit:ze,dropdownMatchSelectWidth:x,OptionList:nn,emptyOptions:!Q.length,activeValue:De,activeDescendantId:`${re}_list_${je}`})))});bn.Option=wt,bn.OptGroup=Ct;var xn=bn,Sn=()=>{let[,e]=n(),[t]=H(`Empty`),r=new L(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Y.createElement(`svg`,{style:r,width:`184`,height:`152`,viewBox:`0 0 184 152`,xmlns:`http://www.w3.org/2000/svg`},Y.createElement(`title`,null,t?.description||`Empty`),Y.createElement(`g`,{fill:`none`,fillRule:`evenodd`},Y.createElement(`g`,{transform:`translate(24 31.67)`},Y.createElement(`ellipse`,{fillOpacity:`.8`,fill:`#F5F5F7`,cx:`67.797`,cy:`106.89`,rx:`67.797`,ry:`12.668`}),Y.createElement(`path`,{d:`M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z`,fill:`#AEB8C2`}),Y.createElement(`path`,{d:`M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z`,fill:`url(#linearGradient-1)`,transform:`translate(13.56)`}),Y.createElement(`path`,{d:`M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z`,fill:`#F5F5F7`}),Y.createElement(`path`,{d:`M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z`,fill:`#DCE0E6`})),Y.createElement(`path`,{d:`M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z`,fill:`#DCE0E6`}),Y.createElement(`g`,{transform:`translate(149.65 15.383)`,fill:`#FFF`},Y.createElement(`ellipse`,{cx:`20.654`,cy:`3.167`,rx:`2.849`,ry:`2.815`}),Y.createElement(`path`,{d:`M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z`}))))},Cn=()=>{let[,e]=n(),[t]=H(`Empty`),{colorFill:r,colorFillTertiary:i,colorFillQuaternary:a,colorBgContainer:o}=e,{borderColor:s,shadowColor:c,contentColor:l}=(0,Y.useMemo)(()=>({borderColor:new L(r).onBackground(o).toHexString(),shadowColor:new L(i).onBackground(o).toHexString(),contentColor:new L(a).onBackground(o).toHexString()}),[r,i,a,o]);return Y.createElement(`svg`,{width:`64`,height:`41`,viewBox:`0 0 64 41`,xmlns:`http://www.w3.org/2000/svg`},Y.createElement(`title`,null,t?.description||`Empty`),Y.createElement(`g`,{transform:`translate(0 1)`,fill:`none`,fillRule:`evenodd`},Y.createElement(`ellipse`,{fill:c,cx:`32`,cy:`33`,rx:`32`,ry:`7`}),Y.createElement(`g`,{fillRule:`nonzero`,stroke:s},Y.createElement(`path`,{d:`M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z`}),Y.createElement(`path`,{d:`M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z`,fill:l}))))},wn=e=>{let{componentCls:t,margin:n,marginXS:r,marginXL:i,fontSize:a,lineHeight:o}=e;return{[t]:{marginInline:r,fontSize:a,lineHeight:o,textAlign:`center`,[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:`100%`},svg:{maxWidth:`100%`,height:`100%`,margin:`auto`}},[`${t}-description`]:{color:e.colorTextDescription},[`${t}-footer`]:{marginTop:n},"&-normal":{marginBlock:i,color:e.colorTextDescription,[`${t}-description`]:{color:e.colorTextDescription},[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDescription,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}},Tn=D(`Empty`,e=>{let{componentCls:t,controlHeightLG:n,calc:r}=e;return wn(ae(e,{emptyImgCls:`${t}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()}))}),En=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Dn=Y.createElement(Sn,null),On=Y.createElement(Cn,null),kn=e=>{let{className:t,rootClassName:n,prefixCls:r,image:i,description:a,children:o,imageStyle:s,style:c,classNames:l,styles:u}=e,d=En(e,[`className`,`rootClassName`,`prefixCls`,`image`,`description`,`children`,`imageStyle`,`style`,`classNames`,`styles`]),{getPrefixCls:f,direction:p,className:m,style:h,classNames:g,styles:_,image:v}=oe(`empty`),y=f(`empty`,r),[b,x,S]=Tn(y),[C]=H(`Empty`),w=a===void 0?C?.description:a,T=typeof w==`string`?w:`empty`,E=i??v??Dn,D=null;return D=typeof E==`string`?Y.createElement(`img`,{draggable:!1,alt:T,src:E}):E,b(Y.createElement(`div`,Object.assign({className:(0,X.default)(x,S,y,m,{[`${y}-normal`]:E===On,[`${y}-rtl`]:p===`rtl`},t,n,g.root,l?.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},_.root),h),u?.root),c)},d),Y.createElement(`div`,{className:(0,X.default)(`${y}-image`,g.image,l?.image),style:Object.assign(Object.assign(Object.assign({},s),_.image),u?.image)},D),w&&Y.createElement(`div`,{className:(0,X.default)(`${y}-description`,g.description,l?.description),style:Object.assign(Object.assign({},_.description),u?.description)},w),o&&Y.createElement(`div`,{className:(0,X.default)(`${y}-footer`,g.footer,l?.footer),style:Object.assign(Object.assign({},_.footer),u?.footer)},o)))};kn.PRESENTED_IMAGE_DEFAULT=Dn,kn.PRESENTED_IMAGE_SIMPLE=On;var An=e=>{let{componentName:t}=e,{getPrefixCls:n}=(0,Y.useContext)(I),r=n(`empty`);switch(t){case`Table`:case`List`:return Y.createElement(kn,{image:kn.PRESENTED_IMAGE_SIMPLE});case`Select`:case`TreeSelect`:case`Cascader`:case`Transfer`:case`Mentions`:return Y.createElement(kn,{image:kn.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case`Table.filter`:return null;default:return Y.createElement(kn,null)}},jn=e=>{let t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:e===`scroll`?`scroll`:`visible`,dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:[`tl`,`bl`],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:[`tr`,`br`],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:[`bl`,`tl`],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:[`br`,`tr`],offset:[0,-4]})}};function Mn(e,t){return e||jn(t)}var Nn=e=>{let{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:i}=e;return{position:`relative`,display:`block`,minHeight:t,padding:i,color:e.colorText,fontWeight:`normal`,fontSize:n,lineHeight:r,boxSizing:`border-box`}},Pn=e=>{let{antCls:t,componentCls:n}=e,r=`${n}-item`,i=`&${t}-slide-up-enter${t}-slide-up-enter-active`,a=`&${t}-slide-up-appear${t}-slide-up-appear-active`,o=`&${t}-slide-up-leave${t}-slide-up-leave-active`,s=`${n}-dropdown-placement-`,c=`${r}-option-selected`;return[{[`${n}-dropdown`]:Object.assign(Object.assign({},k(e)),{position:`absolute`,top:-9999,zIndex:e.zIndexPopup,boxSizing:`border-box`,padding:e.paddingXXS,overflow:`hidden`,fontSize:e.fontSize,fontVariant:`initial`,backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary,[`
|
||
${i}${s}bottomLeft,
|
||
${a}${s}bottomLeft
|
||
`]:{animationName:J},[`
|
||
${i}${s}topLeft,
|
||
${a}${s}topLeft,
|
||
${i}${s}topRight,
|
||
${a}${s}topRight
|
||
`]:{animationName:ye},[`${o}${s}bottomLeft`]:{animationName:ge},[`
|
||
${o}${s}topLeft,
|
||
${o}${s}topRight
|
||
`]:{animationName:ve},"&-hidden":{display:`none`},[r]:Object.assign(Object.assign({},Nn(e)),{cursor:`pointer`,transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:`default`},"&-option":{display:`flex`,"&-content":Object.assign({flex:`auto`},y),"&-state":{flex:`none`,display:`flex`,alignItems:`center`},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:`not-allowed`},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},Nn(e)),{color:e.colorTextDisabled})}),[`${c}:has(+ ${c})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${c}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:`rtl`}})},be(e,`slide-up`),be(e,`slide-down`),Le(e,`move-up`),Le(e,`move-down`)]},Fn=e=>{let{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=e,a=e.max(e.calc(n).sub(r).equal(),0);return{basePadding:a,containerPadding:e.max(e.calc(a).sub(i).equal(),0),itemHeight:G(t),itemLineHeight:G(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}},In=e=>{let{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()},Ln=e=>{let{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:a,multipleItemColorDisabled:o,multipleItemBorderColorDisabled:s,colorIcon:c,colorIconHover:l,INTERNAL_FIXED_ITEM_MARGIN:u}=e;return{[`${t}-selection-overflow`]:{position:`relative`,display:`flex`,flex:`auto`,flexWrap:`wrap`,maxWidth:`100%`,"&-item":{flex:`none`,alignSelf:`center`,maxWidth:`calc(100% - 4px)`,display:`inline-flex`},[`${t}-selection-item`]:{display:`flex`,alignSelf:`center`,flex:`none`,boxSizing:`border-box`,maxWidth:`100%`,marginBlock:u,borderRadius:r,cursor:`default`,transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:e.calc(a).div(2).equal(),[`${t}-disabled&`]:{color:o,borderColor:s,cursor:`not-allowed`},"&-content":{display:`inline-block`,marginInlineEnd:e.calc(a).div(2).equal(),overflow:`hidden`,whiteSpace:`pre`,textOverflow:`ellipsis`},"&-remove":Object.assign(Object.assign({},N()),{display:`inline-flex`,alignItems:`center`,color:c,fontWeight:`bold`,fontSize:10,lineHeight:`inherit`,cursor:`pointer`,[`> ${n}`]:{verticalAlign:`-0.2em`},"&:hover":{color:l}})}}}},Rn=(e,t)=>{let{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,i=`${n}-selection-overflow`,a=e.multipleSelectItemHeight,o=In(e),s=t?`${n}-${t}`:``,c=Fn(e);return{[`${n}-multiple${s}`]:Object.assign(Object.assign({},Ln(e)),{[`${n}-selector`]:{display:`flex`,alignItems:`center`,width:`100%`,height:`100%`,paddingInline:c.basePadding,paddingBlock:c.containerPadding,borderRadius:e.borderRadius,[`${n}-disabled&`]:{background:e.multipleSelectorBgDisabled,cursor:`not-allowed`},"&:after":{display:`inline-block`,width:0,margin:`${G(r)} 0`,lineHeight:G(a),visibility:`hidden`,content:`"\\a0"`}},[`${n}-selection-item`]:{height:c.itemHeight,lineHeight:G(c.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:`flex-start`,"&:after":{lineHeight:G(a),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(c.basePadding).equal()},[`${i}-item + ${i}-item,
|
||
${n}-prefix + ${n}-selection-wrap
|
||
`]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:c.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:`inline-flex`,position:`relative`,maxWidth:`100%`,marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(o).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:G(a),transition:`all ${e.motionDurationSlow}`},"&-input":{width:`100%`,minWidth:4.1},"&-mirror":{position:`absolute`,top:0,insetInlineStart:0,insetInlineEnd:`auto`,zIndex:999,whiteSpace:`pre`,visibility:`hidden`}},[`${n}-selection-placeholder`]:{position:`absolute`,top:`50%`,insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(c.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:`translateY(-50%)`,transition:`all ${e.motionDurationSlow}`}})}};function zn(e,t){let{componentCls:n}=e,r={[`${n}-multiple${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:`text`}},[`
|
||
&${n}-show-arrow ${n}-selector,
|
||
&${n}-allow-clear ${n}-selector
|
||
`]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[Rn(e,t),r]}var Bn=e=>{let{componentCls:t}=e,n=ae(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=ae(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[zn(e),zn(n,`sm`),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},[`${t}-selection-search`]:{marginInlineStart:2}}},zn(r,`lg`)]};function Vn(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal();return{[`${n}-single${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,height:e.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},k(e,!0)),{display:`flex`,borderRadius:i,flex:`1 1 auto`,[`${n}-selection-wrap:after`]:{lineHeight:G(a)},[`${n}-selection-search`]:{position:`absolute`,inset:0,width:`100%`,"&-input":{width:`100%`,WebkitAppearance:`textfield`}},[`
|
||
${n}-selection-item,
|
||
${n}-selection-placeholder
|
||
`]:{display:`block`,padding:0,lineHeight:G(a),transition:`all ${e.motionDurationSlow}, visibility 0s`,alignSelf:`center`},[`${n}-selection-placeholder`]:{transition:`none`,pointerEvents:`none`},[[`&:after`,`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(`,`)]:{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`}}),[`
|
||
&${n}-show-arrow ${n}-selection-item,
|
||
&${n}-show-arrow ${n}-selection-search,
|
||
&${n}-show-arrow ${n}-selection-placeholder
|
||
`]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:`100%`,height:`100%`,alignItems:`center`,padding:`0 ${G(r)}`,[`${n}-selection-search-input`]:{height:a,fontSize:e.fontSize},"&:after":{lineHeight:G(a)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:`none`},[`${n}-selection-search`]:{position:`static`,width:`100%`},[`${n}-selection-placeholder`]:{position:`absolute`,insetInlineStart:0,insetInlineEnd:0,padding:`0 ${G(r)}`,"&:after":{display:`none`}}}}}}}function Hn(e){let{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[Vn(e),Vn(ae(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),`sm`),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{padding:`0 ${G(n)}`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},[`
|
||
&${t}-show-arrow ${t}-selection-item,
|
||
&${t}-show-arrow ${t}-selection-placeholder
|
||
`]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},Vn(ae(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),`lg`)]}var Un=e=>{let{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:a,controlHeightLG:o,paddingXXS:s,controlPaddingHorizontal:c,zIndexPopupBase:l,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:m,colorFillSecondary:h,colorBgContainerDisabled:g,colorTextDisabled:_,colorPrimaryHover:v,colorPrimary:y,controlOutline:b}=e,x=s*2,S=r*2,C=Math.min(i-x,i-S),w=Math.min(a-x,a-S),T=Math.min(o-x,o-S);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(s/2),zIndexPopup:l+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:`${(i-t*n)/2}px ${c}px`,optionFontSize:t,optionLineHeight:n,optionHeight:i,selectorBg:m,clearBg:m,singleItemHeightLG:o,multipleItemBg:h,multipleItemBorderColor:`transparent`,multipleItemHeight:C,multipleItemHeightSM:w,multipleItemHeightLG:T,multipleSelectorBgDisabled:g,multipleItemColorDisabled:_,multipleItemBorderColorDisabled:`transparent`,showArrowPaddingInlineEnd:Math.ceil(e.fontSize*1.25),hoverBorderColor:v,activeBorderColor:y,activeOutlineColor:b,selectAffixPadding:s}},Wn=(e,t)=>{let{componentCls:n,antCls:r,controlOutlineWidth:i}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${G(e.lineWidth)} ${e.lineType} ${t.borderColor}`,background:e.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,boxShadow:`0 0 0 ${G(i)} ${t.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:t.color}}}},Gn=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},Wn(e,t))}),Kn=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Wn(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),Gn(e,{status:`error`,borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),Gn(e,{status:`warning`,borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${G(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),qn=(e,t)=>{let{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:t.bg,border:`${G(e.lineWidth)} ${e.lineType} transparent`,color:t.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:t.hoverBg},[`${n}-focused& ${n}-selector`]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},Jn=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},qn(e,t))}),Yn=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},qn(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),Jn(e,{status:`error`,bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),Jn(e,{status:`warning`,bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.colorBgContainer,border:`${G(e.lineWidth)} ${e.lineType} ${e.colorSplit}`}})}),Xn=e=>({"&-borderless":{[`${e.componentCls}-selector`]:{background:`transparent`,border:`${G(e.lineWidth)} ${e.lineType} transparent`},[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${G(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`},[`&${e.componentCls}-status-error`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorError}},[`&${e.componentCls}-status-warning`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorWarning}}}}),Zn=(e,t)=>{let{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`${G(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,background:e.selectorBg,borderRadius:0},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:`transparent transparent ${t.hoverBorderHover} transparent`},[`${n}-focused& ${n}-selector`]:{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0},[`${n}-prefix`]:{color:t.color}}}},Qn=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},Zn(e,t))}),$n=e=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},Zn(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),Qn(e,{status:`error`,borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),Qn(e,{status:`warning`,borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${G(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),er=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},Kn(e)),Yn(e)),Xn(e)),$n(e))}),tr=e=>{let{componentCls:t}=e;return{position:`relative`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,input:{cursor:`pointer`},[`${t}-show-search&`]:{cursor:`text`,input:{cursor:`auto`,color:`inherit`,height:`100%`}},[`${t}-disabled&`]:{cursor:`not-allowed`,input:{cursor:`not-allowed`}}}},nr=e=>{let{componentCls:t}=e;return{[`${t}-selection-search-input`]:{margin:0,padding:0,background:`transparent`,border:`none`,outline:`none`,appearance:`none`,fontFamily:`inherit`,"&::-webkit-search-cancel-button":{display:`none`,appearance:`none`}}}},rr=e=>{let{antCls:t,componentCls:n,inputPaddingHorizontalBase:r,iconCls:i}=e,a={[`${n}-clear`]:{opacity:1,background:e.colorBgBase,borderRadius:`50%`}};return{[n]:Object.assign(Object.assign({},k(e)),{position:`relative`,display:`inline-flex`,cursor:`pointer`,[`&:not(${n}-customize-input) ${n}-selector`]:Object.assign(Object.assign({},tr(e)),nr(e)),[`${n}-selection-item`]:Object.assign(Object.assign({flex:1,fontWeight:`normal`,position:`relative`,userSelect:`none`},y),{[`> ${t}-typography`]:{display:`inline`}}),[`${n}-selection-placeholder`]:Object.assign(Object.assign({},y),{flex:1,color:e.colorTextPlaceholder,pointerEvents:`none`}),[`${n}-arrow`]:Object.assign(Object.assign({},N()),{position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:r,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:`center`,pointerEvents:`none`,display:`flex`,alignItems:`center`,transition:`opacity ${e.motionDurationSlow} ease`,[i]:{verticalAlign:`top`,transition:`transform ${e.motionDurationSlow}`,"> svg":{verticalAlign:`top`},[`&:not(${n}-suffix)`]:{pointerEvents:`auto`}},[`${n}-disabled &`]:{cursor:`not-allowed`},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${n}-selection-wrap`]:{display:`flex`,width:`100%`,position:`relative`,minWidth:0,"&:after":{content:`"\\a0"`,width:0,overflow:`hidden`}},[`${n}-prefix`]:{flex:`none`,marginInlineEnd:e.selectAffixPadding},[`${n}-clear`]:{position:`absolute`,top:`50%`,insetInlineStart:`auto`,insetInlineEnd:r,zIndex:1,display:`inline-block`,width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:`normal`,lineHeight:1,textAlign:`center`,textTransform:`none`,cursor:`pointer`,opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:`auto`,transform:`translateZ(0)`,"&:before":{display:`block`},"&:hover":{color:e.colorIcon}},"@media(hover:none)":a,"&:hover":a}),[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}}}},ir=e=>{let{componentCls:t}=e;return[{[t]:{[`&${t}-in-form-item`]:{width:`100%`}}},rr(e),Hn(e),Bn(e),Pn(e),{[`${t}-rtl`]:{direction:`rtl`}},re(e,{borderElCls:`${t}-selector`,focusElCls:`${t}-focused`})]},ar=D(`Select`,(e,{rootPrefixCls:t})=>{let n=ae(e,{rootPrefixCls:t,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[ir(n),er(n)]},Un,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),or={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z`}}]},name:`down`,theme:`outlined`},sr=Y.forwardRef(function(e,t){return Y.createElement(b,v({},e,{ref:t,icon:or}))});function cr({suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:r,loading:i,multiple:a,hasFeedback:s,prefixCls:c,showSuffixIcon:u,feedbackIcon:d,showArrow:p,componentName:m}){let h=t??Y.createElement(f,null),g=t=>e===null&&!s&&!p?null:Y.createElement(Y.Fragment,null,u!==!1&&t,s&&d),_=null;if(e!==void 0)_=g(e);else if(i)_=g(Y.createElement(o,{spin:!0}));else{let e=`${c}-suffix`;_=({open:t,showSearch:n})=>g(t&&n?Y.createElement(_e,{className:e}):Y.createElement(sr,{className:e}))}let v=null;v=n===void 0?a?Y.createElement(pe,null):null:n;let y=null;return y=r===void 0?Y.createElement(l,null):r,{clearIcon:h,suffixIcon:_,itemIcon:v,removeIcon:y}}function lr(e){return Y.useMemo(()=>{if(e)return(...t)=>Y.createElement(w,{space:!0},e.apply(void 0,t))},[e])}function ur(e,t){return t===void 0?e!==null:t}var dr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},fr=`SECRET_COMBOBOX_MODE_DO_NOT_USE`,pr=Y.forwardRef((e,t)=>{let{prefixCls:r,bordered:i,className:a,rootClassName:o,getPopupContainer:s,popupClassName:c,dropdownClassName:l,listHeight:u=256,placement:d,listItemHeight:f,size:p,disabled:m,notFoundContent:h,status:g,builtinPlacements:_,dropdownMatchSelectWidth:v,popupMatchSelectWidth:y,direction:b,style:x,allowClear:w,variant:T,dropdownStyle:E,transitionName:D,tagRender:O,maxCount:k,prefix:A,dropdownRender:j,popupRender:M,onDropdownVisibleChange:N,onOpenChange:F,styles:ee,classNames:L}=e,te=dr(e,`prefixCls.bordered.className.rootClassName.getPopupContainer.popupClassName.dropdownClassName.listHeight.placement.listItemHeight.size.disabled.notFoundContent.status.builtinPlacements.dropdownMatchSelectWidth.popupMatchSelectWidth.direction.style.allowClear.variant.dropdownStyle.transitionName.tagRender.maxCount.prefix.dropdownRender.popupRender.onDropdownVisibleChange.onOpenChange.styles.classNames`.split(`.`)),{getPopupContainer:ne,getPrefixCls:z,renderEmpty:re,direction:ie,virtual:H,popupMatchSelectWidth:U,popupOverflow:ae}=Y.useContext(I),{showSearch:W,style:G,styles:se,className:le,classNames:ue}=oe(`select`),[,de]=n(),pe=f??de?.controlHeight,ge=z(`select`,r),_e=z(),q=b??ie,{compactSize:J,compactItemClassnames:ve}=R(ge,q),[ye,be]=he(`select`,T,i),xe=B(ge),[Se,Ce,Z]=ar(ge,xe),Q=Y.useMemo(()=>{let{mode:t}=e;if(t!==`combobox`)return t===fr?`combobox`:t},[e.mode]),we=Q===`multiple`||Q===`tags`,Te=ur(e.suffixIcon,e.showArrow),Ee=y??v??U,De=ee?.popup?.root||se.popup?.root||E,Oe=lr(M||j),ke=F||N,{status:Ae,hasFeedback:je,isFormItemInput:Me,feedbackIcon:Ne}=Y.useContext(C),Pe=fe(Ae,g),Fe;Fe=h===void 0?Q===`combobox`?null:re?.(`Select`)||Y.createElement(An,{componentName:`Select`}):h;let{suffixIcon:Ie,itemIcon:Le,removeIcon:Re,clearIcon:ze}=cr(Object.assign(Object.assign({},te),{multiple:we,hasFeedback:je,feedbackIcon:Ne,showSuffixIcon:Te,prefixCls:ge,componentName:`Select`})),Be=w===!0?{clearIcon:ze}:w,Ve=ce(te,[`suffixIcon`,`itemIcon`]),He=(0,X.default)(L?.popup?.root||ue?.popup?.root||c||l,{[`${ge}-dropdown-${q}`]:q===`rtl`},o,ue.root,L?.root,Z,xe,Ce),Ue=P(e=>p??J??e),We=Y.useContext(V),Ge=m??We,Ke=(0,X.default)({[`${ge}-lg`]:Ue===`large`,[`${ge}-sm`]:Ue===`small`,[`${ge}-rtl`]:q===`rtl`,[`${ge}-${ye}`]:be,[`${ge}-in-form-item`]:Me},me(ge,Pe,je),ve,le,a,ue.root,L?.root,o,Z,xe,Ce),qe=Y.useMemo(()=>d===void 0?q===`rtl`?`bottomRight`:`bottomLeft`:d,[d,q]),[Je]=K(`SelectLike`,De?.zIndex);return Se(Y.createElement(xn,Object.assign({ref:t,virtual:H,showSearch:W},Ve,{style:Object.assign(Object.assign(Object.assign(Object.assign({},se.root),ee?.root),G),x),dropdownMatchSelectWidth:Ee,transitionName:S(_e,`slide-up`,D),builtinPlacements:Mn(_,ae),listHeight:u,listItemHeight:pe,mode:Q,prefixCls:ge,placement:qe,direction:q,prefix:A,suffixIcon:Ie,menuItemSelectedIcon:Le,removeIcon:Re,allowClear:Be,notFoundContent:Fe,className:Ke,getPopupContainer:s||ne,dropdownClassName:He,disabled:Ge,dropdownStyle:Object.assign(Object.assign({},De),{zIndex:Je}),maxCount:we?k:void 0,tagRender:we?O:void 0,dropdownRender:Oe,onDropdownVisibleChange:ke})))}),mr=ze(pr,`dropdownAlign`);pr.SECRET_COMBOBOX_MODE_DO_NOT_USE=fr,pr.Option=wt,pr.OptGroup=Ct,pr._InternalPanelDoNotUseOrYouWillBeFired=mr;var hr=(e,t)=>{e?.addEventListener===void 0?e?.addListener!==void 0&&e.addListener(t):e.addEventListener(`change`,t)},gr=(e,t)=>{e?.removeEventListener===void 0?e?.removeListener!==void 0&&e.removeListener(t):e.removeEventListener(`change`,t)},_r=[`xxl`,`xl`,`lg`,`md`,`sm`,`xs`],vr=e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`}),yr=e=>{let t=e,n=[].concat(_r).reverse();return n.forEach((e,r)=>{let i=e.toUpperCase(),a=`screen${i}Min`,o=`screen${i}`;if(!(t[a]<=t[o]))throw Error(`${a}<=${o} fails : !(${t[a]}<=${t[o]})`);if(r<n.length-1){let e=`screen${i}Max`;if(!(t[o]<=t[e]))throw Error(`${o}<=${e} fails : !(${t[o]}<=${t[e]})`);let a=`screen${n[r+1].toUpperCase()}Min`;if(!(t[e]<=t[a]))throw Error(`${e}<=${a} fails : !(${t[e]}<=${t[a]})`)}}),e},br=()=>{let[,e]=n(),t=vr(yr(e));return Y.useMemo(()=>{let e=new Map,n=-1,r={};return{responsiveMap:t,matchHandlers:{},dispatch(t){return r=t,e.forEach(e=>e(r)),e.size>=1},subscribe(t){return e.size||this.register(),n+=1,e.set(n,t),t(r),n},unsubscribe(t){e.delete(t),e.size||this.unregister()},register(){Object.entries(t).forEach(([e,t])=>{let n=({matches:t})=>{this.dispatch(Object.assign(Object.assign({},r),{[e]:t}))},i=window.matchMedia(t);hr(i,n),this.matchHandlers[t]={mql:i,listener:n},n(i)})},unregister(){Object.values(t).forEach(e=>{let t=this.matchHandlers[e];gr(t?.mql,t?.listener)}),e.clear()}}},[t])};function xr(e=!0,t={}){let n=(0,Y.useRef)(t),[,r]=Oe(),i=br();return x(()=>{let t=i.subscribe(t=>{n.current=t,e&&r()});return()=>i.unsubscribe(t)},[]),n.current}var Sr=[`parentNode`],Cr=`form_item`;function wr(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function Tr(e,t){if(!e.length)return;let n=e.join(`_`);return t?`${t}_${n}`:Sr.includes(n)?`${Cr}_${n}`:n}function Er(e,t,n,r,i,a){let o=r;return a===void 0?n.validating?o=`validating`:e.length?o=`error`:t.length?o=`warning`:(n.touched||i&&n.validated)&&(o=`success`):o=a,o}var Dr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Or(e){return wr(e).join(`_`)}function kr(e,t){let n=t.getFieldInstance(e),r=E(n);if(r)return r;let i=Tr(wr(e),t.__INTERNAL__.name);if(i)return document.getElementById(i)}function Ar(e){let[t]=j(),n=Y.useRef({}),r=Y.useMemo(()=>e??Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:e=>t=>{let r=Or(e);t?n.current[r]=t:delete n.current[r]}},scrollToField:(e,t={})=>{let{focus:n}=t,i=Dr(t,[`focus`]),a=kr(e,r);a&&(De(a,Object.assign({scrollMode:`if-needed`,block:`nearest`},i)),n&&r.focusField(e))},focusField:e=>{var t,n;let i=r.getFieldInstance(e);typeof i?.focus==`function`?i.focus():(n=(t=kr(e,r))?.focus)==null||n.call(t)},getFieldInstance:e=>{let t=Or(e);return n.current[t]}}),[e,t]);return[r]}export{Oe as _,wr as a,pr as c,kn as d,Qt as f,ke as g,Le as h,Er as i,sr as l,Re as m,Ar as n,xr as o,ze as p,Tr as r,_r as s,Or as t,An as u}; |