import{V as be,Q as fe,W as A,a1 as Le,a2 as Ie,Y as b,r as c,X as pe,_ as le,Z as W,j as h,$ as he,a3 as Ne,a4 as ue,a5 as $e,u as ke,a6 as ce,a7 as Ve}from"./index-e4283c06.js";let P;function Fe(){if(P)return P;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),P="reverse",e.scrollLeft>0?P="default":(e.scrollLeft=1,e.scrollLeft===0&&(P="negative")),document.body.removeChild(e),P}function Be(e,t){const r=e.scrollLeft;if(t!=="rtl")return r;switch(Fe()){case"negative":return e.scrollWidth-e.clientWidth+r;case"reverse":return e.scrollWidth-e.clientWidth-r;default:return r}}function _e(e){return fe("MuiTab",e)}const Oe=be("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),F=Oe,qe=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],Ge=e=>{const{classes:t,textColor:r,fullWidth:a,wrapped:n,icon:d,label:f,selected:m,disabled:u}=e,v={root:["root",d&&f&&"labelIcon",`textColor${Ie(r)}`,a&&"fullWidth",n&&"wrapped",m&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return he(v,_e,t)},Qe=A(Le,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.label&&r.icon&&t.labelIcon,t[`textColor${Ie(r.textColor)}`],r.fullWidth&&t.fullWidth,r.wrapped&&t.wrapped]}})(({theme:e,ownerState:t})=>b({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${F.iconWrapper}`]:b({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${F.selected}`]:{opacity:1},[`&.${F.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${F.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${F.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${F.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${F.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),Ze=c.forwardRef(function(t,r){const a=pe({props:t,name:"MuiTab"}),{className:n,disabled:d=!1,disableFocusRipple:f=!1,fullWidth:m,icon:u,iconPosition:v="top",indicator:T,label:y,onChange:g,onClick:B,onFocus:G,selected:E,selectionFollowsFocus:C,textColor:Q="inherit",value:z,wrapped:re=!1}=a,X=le(a,qe),L=b({},a,{disabled:d,disableFocusRipple:f,selected:E,icon:!!u,iconPosition:v,label:!!y,fullWidth:m,textColor:Q,wrapped:re}),D=Ge(L),I=u&&y&&c.isValidElement(u)?c.cloneElement(u,{className:W(D.iconWrapper,u.props.className)}):u,Y=N=>{!E&&g&&g(N,z),B&&B(N)},K=N=>{C&&!E&&g&&g(N,z),G&&G(N)};return h.jsxs(Qe,b({focusRipple:!f,className:W(D.root,n),ref:r,role:"tab","aria-selected":E,disabled:d,onClick:Y,onFocus:K,ownerState:L,tabIndex:E?0:-1},X,{children:[v==="top"||v==="start"?h.jsxs(c.Fragment,{children:[I,y]}):h.jsxs(c.Fragment,{children:[y,I]}),T]}))}),Bt=Ze,Je=Ne(h.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),et=Ne(h.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function tt(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function ot(e,t,r,a={},n=()=>{}){const{ease:d=tt,duration:f=300}=a;let m=null;const u=t[e];let v=!1;const T=()=>{v=!0},y=g=>{if(v){n(new Error("Animation cancelled"));return}m===null&&(m=g);const B=Math.min(1,(g-m)/f);if(t[e]=d(B)*(r-u)+u,B>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(y)};return u===r?(n(new Error("Element already at target position")),T):(requestAnimationFrame(y),T)}const lt=["onChange"],rt={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function nt(e){const{onChange:t}=e,r=le(e,lt),a=c.useRef(),n=c.useRef(null),d=()=>{a.current=n.current.offsetHeight-n.current.clientHeight};return c.useEffect(()=>{const f=ue(()=>{const u=a.current;d(),u!==a.current&&t(a.current)}),m=$e(n.current);return m.addEventListener("resize",f),()=>{f.clear(),m.removeEventListener("resize",f)}},[t]),c.useEffect(()=>{d(),t(a.current)},[t]),h.jsx("div",b({style:rt,ref:n},r))}function st(e){return fe("MuiTabScrollButton",e)}const it=be("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),at=it;var Me,Re;const ct=["className","direction","orientation","disabled"],dt=e=>{const{classes:t,orientation:r,disabled:a}=e;return he({root:["root",r,a&&"disabled"]},st,t)},ut=A(Le,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.orientation&&t[r.orientation]]}})(({ownerState:e})=>b({width:40,flexShrink:0,opacity:.8,[`&.${at.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),bt=c.forwardRef(function(t,r){const a=pe({props:t,name:"MuiTabScrollButton"}),{className:n,direction:d}=a,f=le(a,ct),u=ke().direction==="rtl",v=b({isRtl:u},a),T=dt(v);return h.jsx(ut,b({component:"div",className:W(T.root,n),ref:r,role:null,ownerState:v,tabIndex:null},f,{children:d==="left"?Me||(Me=h.jsx(Je,{fontSize:"small"})):Re||(Re=h.jsx(et,{fontSize:"small"}))}))}),ft=bt;function pt(e){return fe("MuiTabs",e)}const ht=be("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),de=ht,mt=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],We=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Ee=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,oe=(e,t,r)=>{let a=!1,n=r(e,t);for(;n;){if(n===e.firstChild){if(a)return;a=!0}const d=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||d)n=r(e,n);else{n.focus();return}}},vt=e=>{const{vertical:t,fixed:r,hideScrollbar:a,scrollableX:n,scrollableY:d,centered:f,scrollButtonsHideMobile:m,classes:u}=e;return he({root:["root",t&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",n&&"scrollableX",d&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",f&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",m&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},pt,u)},xt=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${de.scrollButtons}`]:t.scrollButtons},{[`& .${de.scrollButtons}`]:r.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,r.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${de.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),St=A("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.scroller,r.fixed&&t.fixed,r.hideScrollbar&&t.hideScrollbar,r.scrollableX&&t.scrollableX,r.scrollableY&&t.scrollableY]}})(({ownerState:e})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),gt=A("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.flexContainer,r.vertical&&t.flexContainerVertical,r.centered&&t.centered]}})(({ownerState:e})=>b({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),Ct=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),wt=A(nt,{name:"MuiTabs",slot:"ScrollbarSize"})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),ze={},yt=c.forwardRef(function(t,r){const a=pe({props:t,name:"MuiTabs"}),n=ke(),d=n.direction==="rtl",{"aria-label":f,"aria-labelledby":m,action:u,centered:v=!1,children:T,className:y,component:g="div",allowScrollButtonsMobile:B=!1,indicatorColor:G="primary",onChange:E,orientation:C="horizontal",ScrollButtonComponent:Q=ft,scrollButtons:z="auto",selectionFollowsFocus:re,TabIndicatorProps:X={},TabScrollButtonProps:L={},textColor:D="primary",value:I,variant:Y="standard",visibleScrollbar:K=!1}=a,N=le(a,mt),M=Y==="scrollable",x=C==="vertical",U=x?"scrollTop":"scrollLeft",Z=x?"top":"left",J=x?"bottom":"right",ne=x?"clientHeight":"clientWidth",V=x?"height":"width",_=b({},a,{component:g,allowScrollButtonsMobile:B,indicatorColor:G,orientation:C,vertical:x,scrollButtons:z,textColor:D,variant:Y,visibleScrollbar:K,fixed:!M,hideScrollbar:M&&!K,scrollableX:M&&!x,scrollableY:M&&x,centered:v&&!M,scrollButtonsHideMobile:!B}),R=vt(_),[me,Ae]=c.useState(!1),[$,ve]=c.useState(ze),[j,je]=c.useState({start:!1,end:!1}),[xe,He]=c.useState({overflow:"hidden",scrollbarWidth:0}),Se=new Map,w=c.useRef(null),O=c.useRef(null),ge=()=>{const o=w.current;let l;if(o){const i=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:Be(o,n.direction),scrollWidth:o.scrollWidth,top:i.top,bottom:i.bottom,left:i.left,right:i.right}}let s;if(o&&I!==!1){const i=O.current.children;if(i.length>0){const p=i[Se.get(I)];s=p?p.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:s}},q=ce(()=>{const{tabsMeta:o,tabMeta:l}=ge();let s=0,i;if(x)i="top",l&&o&&(s=l.top-o.top+o.scrollTop);else if(i=d?"right":"left",l&&o){const S=d?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;s=(d?-1:1)*(l[i]-o[i]+S)}const p={[i]:s,[V]:l?l[V]:0};if(isNaN($[i])||isNaN($[V]))ve(p);else{const S=Math.abs($[i]-p[i]),H=Math.abs($[V]-p[V]);(S>=1||H>=1)&&ve(p)}}),se=(o,{animation:l=!0}={})=>{l?ot(U,w.current,o,{duration:n.transitions.duration.standard}):w.current[U]=o},Ce=o=>{let l=w.current[U];x?l+=o:(l+=o*(d?-1:1),l*=d&&Fe()==="reverse"?-1:1),se(l)},we=()=>{const o=w.current[ne];let l=0;const s=Array.from(O.current.children);for(let i=0;i<s.length;i+=1){const p=s[i];if(l+p[ne]>o){i===0&&(l=o);break}l+=p[ne]}return l},Pe=()=>{Ce(-1*we())},Xe=()=>{Ce(we())},De=c.useCallback(o=>{He({overflow:null,scrollbarWidth:o})},[]),Ye=()=>{const o={};o.scrollbarSizeListener=M?h.jsx(wt,{onChange:De,className:W(R.scrollableX,R.hideScrollbar)}):null;const l=j.start||j.end,s=M&&(z==="auto"&&l||z===!0);return o.scrollButtonStart=s?h.jsx(Q,b({orientation:C,direction:d?"right":"left",onClick:Pe,disabled:!j.start},L,{className:W(R.scrollButtons,L.className)})):null,o.scrollButtonEnd=s?h.jsx(Q,b({orientation:C,direction:d?"left":"right",onClick:Xe,disabled:!j.end},L,{className:W(R.scrollButtons,L.className)})):null,o},ye=ce(o=>{const{tabsMeta:l,tabMeta:s}=ge();if(!(!s||!l)){if(s[Z]<l[Z]){const i=l[U]+(s[Z]-l[Z]);se(i,{animation:o})}else if(s[J]>l[J]){const i=l[U]+(s[J]-l[J]);se(i,{animation:o})}}}),k=ce(()=>{if(M&&z!==!1){const{scrollTop:o,scrollHeight:l,clientHeight:s,scrollWidth:i,clientWidth:p}=w.current;let S,H;if(x)S=o>1,H=o<l-s-1;else{const te=Be(w.current,n.direction);S=d?te<i-p-1:te>1,H=d?te>1:te<i-p-1}(S!==j.start||H!==j.end)&&je({start:S,end:H})}});c.useEffect(()=>{const o=ue(()=>{w.current&&(q(),k())}),l=$e(w.current);l.addEventListener("resize",o);let s;return typeof ResizeObserver!="undefined"&&(s=new ResizeObserver(o),Array.from(O.current.children).forEach(i=>{s.observe(i)})),()=>{o.clear(),l.removeEventListener("resize",o),s&&s.disconnect()}},[q,k]);const ie=c.useMemo(()=>ue(()=>{k()}),[k]);c.useEffect(()=>()=>{ie.clear()},[ie]),c.useEffect(()=>{Ae(!0)},[]),c.useEffect(()=>{q(),k()}),c.useEffect(()=>{ye(ze!==$)},[ye,$]),c.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:k}),[q,k]);const Te=h.jsx(Ct,b({},X,{className:W(R.indicator,X.className),ownerState:_,style:b({},$,X.style)}));let ee=0;const Ke=c.Children.map(T,o=>{if(!c.isValidElement(o))return null;const l=o.props.value===void 0?ee:o.props.value;Se.set(l,ee);const s=l===I;return ee+=1,c.cloneElement(o,b({fullWidth:Y==="fullWidth",indicator:s&&!me&&Te,selected:s,selectionFollowsFocus:re,onChange:E,textColor:D,value:l},ee===1&&I===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Ue=o=>{const l=O.current,s=Ve(l).activeElement;if(s.getAttribute("role")!=="tab")return;let p=C==="horizontal"?"ArrowLeft":"ArrowUp",S=C==="horizontal"?"ArrowRight":"ArrowDown";switch(C==="horizontal"&&d&&(p="ArrowRight",S="ArrowLeft"),o.key){case p:o.preventDefault(),oe(l,s,Ee);break;case S:o.preventDefault(),oe(l,s,We);break;case"Home":o.preventDefault(),oe(l,null,We);break;case"End":o.preventDefault(),oe(l,null,Ee);break}},ae=Ye();return h.jsxs(xt,b({className:W(R.root,y),ownerState:_,ref:r,as:g},N,{children:[ae.scrollButtonStart,ae.scrollbarSizeListener,h.jsxs(St,{className:R.scroller,ownerState:_,style:{overflow:xe.overflow,[x?`margin${d?"Left":"Right"}`:"marginBottom"]:K?void 0:-xe.scrollbarWidth},ref:w,onScroll:ie,children:[h.jsx(gt,{"aria-label":f,"aria-labelledby":m,"aria-orientation":C==="vertical"?"vertical":null,className:R.flexContainer,ownerState:_,onKeyDown:Ue,ref:O,role:"tablist",children:Ke}),me&&Te]}),ae.scrollButtonEnd]}))}),Mt=yt;export{Mt as T,Bt as a};