You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
52 KiB
1 line
52 KiB
2 years ago
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[614],{5949:function(e,t,o){"use strict";o.d(t,{D:function(){return p},Z:function(){return f}});var n=o(7462),r=o(7294),i=o(7579),a=o(8925),l=o(3633),s=o(7960);function c(e){return"undefined"!==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function p(e={}){const{ignoreAccents:t=!0,ignoreCase:o=!0,limit:n,matchFrom:r="any",stringify:i,trim:a=!1}=e;return(e,{inputValue:l,getOptionLabel:s})=>{let p=a?l.trim():l;o&&(p=p.toLowerCase()),t&&(p=c(p));const u=e.filter((e=>{let n=(i||s)(e);return o&&(n=n.toLowerCase()),t&&(n=c(n)),"start"===r?0===n.indexOf(p):n.indexOf(p)>-1}));return"number"===typeof n?u.slice(0,n):u}}function u(e,t){for(let o=0;o<e.length;o+=1)if(t(e[o]))return o;return-1}const d=p();function f(e){const{autoComplete:t=!1,autoHighlight:o=!1,autoSelect:c=!1,blurOnSelect:p=!1,disabled:f,clearOnBlur:m=!e.freeSolo,clearOnEscape:h=!1,componentName:g="useAutocomplete",defaultValue:b=(e.multiple?[]:null),disableClearable:v=!1,disableCloseOnSelect:y=!1,disabledItemsFocusable:x=!1,disableListWrap:Z=!1,filterOptions:w=d,filterSelectedOptions:O=!1,freeSolo:C=!1,getOptionDisabled:S,getOptionLabel:k=(e=>{var t;return null!=(t=e.label)?t:e}),isOptionEqualToValue:$=((e,t)=>e===t),groupBy:I,handleHomeEndKeys:P=!e.freeSolo,id:R,includeInputInList:L=!1,inputValue:A,multiple:E=!1,onChange:D,onClose:M,onHighlightChange:T,onInputChange:j,onOpen:z,open:N,openOnFocus:W=!1,options:F,readOnly:H=!1,selectOnFocus:V=!e.freeSolo,value:q}=e,B=(0,i.Z)(R);let U=k;U=e=>{const t=k(e);return"string"!==typeof t?String(t):t};const K=r.useRef(!1),G=r.useRef(!0),_=r.useRef(null),X=r.useRef(null),[Y,Q]=r.useState(null),[J,ee]=r.useState(-1),te=o?0:-1,oe=r.useRef(te),[ne,re]=(0,a.Z)({controlled:q,default:b,name:g}),[ie,ae]=(0,a.Z)({controlled:A,default:"",name:g,state:"inputValue"}),[le,se]=r.useState(!1),ce=r.useCallback(((e,t)=>{if(!(E?ne.length<t.length:null!==t)&&!m)return;let o;if(E)o="";else if(null==t)o="";else{const e=U(t);o="string"===typeof e?e:""}ie!==o&&(ae(o),j&&j(e,o,"reset"))}),[U,ie,E,j,ae,m,ne]),pe=r.useRef();r.useEffect((()=>{const e=ne!==pe.current;pe.current=ne,le&&!e||C&&!e||ce(null,ne)}),[ne,ce,le,pe,C]);const[ue,de]=(0,a.Z)({controlled:N,default:!1,name:g,state:"open"}),[fe,me]=r.useState(!0),he=!E&&null!=ne&&ie===U(ne),ge=ue&&!H,be=ge?w(F.filter((e=>!O||!(E?ne:[ne]).some((t=>null!==t&&$(e,t))))),{inputValue:he&&fe?"":ie,getOptionLabel:U}):[],ve=ue&&be.length>0&&!H;const ye=(0,l.Z)((e=>{-1===e?_.current.focus():Y.querySelector(`[data-tag-index="${e}"]`).focus()}));r.useEffect((()=>{E&&J>ne.length-1&&(ee(-1),ye(-1))}),[ne,E,J,ye]);const xe=(0,l.Z)((({event:e,index:t,reason:o="auto"})=>{if(oe.current=t,-1===t?_.current.removeAttribute("aria-activedescendant"):_.current.setAttribute("aria-activedescendant",`${B}-option-${t}`),T&&T(e,-1===t?null:be[t],o),!X.current)return;const n=X.current.querySelector('[role="option"].Mui-focused');n&&(n.classList.remove("Mui-focused"),n.classList.remove("Mui-focusVisible"));const r=X.current.parentElement.querySelector('[role="listbox"]');if(!r)return;if(-1===t)return void(r.scrollTop=0);const i=X.current.querySelector(`[data-option-index="${t}"]`);if(i&&(i.classList.add("Mui-focused"),"keyboard"===o&&i.classList.add("Mui-focusVisible"),r.scrollHeight>r.clientHeight&&"mouse"!==o)){const e=i,t=r.clientHeight+r.scrollTop,o=e.offsetTop+e.offsetHeight;o>t?r.scrollTop=o-r.clientHeight:e.offsetTop-e.offsetHeight*(I?1.3:0)<r.scrollTop&&(r.scrollTop=e.offsetTop-e.offsetHeight*(I?1.3:0))}})),Ze=(0,l.Z)((({event:e,diff:o,direction:n="next",reason:r="auto"})=>{if(!ge)return;const i=function(e,t){if(!X.current||-1===e)return-1;let o=e;for(;;){if("next"===t&&o===be.length||"previous"===t&&-1===o)return-1;const e=X.current.querySelector(`[data-option-index="${o}"]`),n=!x&&(!e||e.disabled||"true"===e.getAttribute("aria-disabled"));if(!(e&&!e.hasAttribute("tabindex")||n))return o;o+="next"===t?1:-1}}((()=>{const e=be.length-1;if("reset"===o)return te;if("start"===o)return 0;if("end"===o)return e;const t=oe.current+o;return t<0?-1===t
|