Self hosted FLOSS fitness/workout, nutrition and weight tracker
Update react code
Roland Geider9001bdacc725
diff --git a/wger/core/static/react/main.js b/wger/core/static/react/main.jsindex ad3300cb8..719688afc 100644--- a/wger/core/static/react/main.js+++ b/wger/core/static/react/main.js@@ -89,10 +89,10 @@ export default theme;`}function z$(e={},...t){const{breakpoints:n,mixins:r={},sp`+q+p}var J=!1;function ie(p,m){if(!p||J)return"";J=!0;var P=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(m)if(m=function(){throw Error()},Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(De){var D=De}Reflect.construct(p,[],m)}else{try{m.call()}catch(De){D=De}p.call(m.prototype)}else{try{throw Error()}catch(De){D=De}p()}}catch(De){if(De&&D&&typeof De.stack=="string"){for(var j=De.stack.split(``),W=D.stack.split(``),Z=j.length-1,pe=W.length-1;1<=Z&&0<=pe&&j[Z]!==W[pe];)pe--;for(;1<=Z&&0<=pe;Z--,pe--)if(j[Z]!==W[pe]){if(Z!==1||pe!==1)do if(Z--,pe--,0>pe||j[Z]!==W[pe]){var be=`-`+j[Z].replace(" at new "," at ");return p.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",p.displayName)),be}while(1<=Z&&0<=pe);break}}}finally{J=!1,Error.prepareStackTrace=P}return(p=p?p.displayName||p.name:"")?Y(p):""}function ee(p){switch(p.tag){case 5:return Y(p.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return p=ie(p.type,!1),p;case 11:return p=ie(p.type.render,!1),p;case 1:return p=ie(p.type,!0),p;default:return""}}function te(p){if(p==null)return null;if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case O:return"Fragment";case T:return"Portal";case k:return"Profiler";case A:return"StrictMode";case L:return"Suspense";case z:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case R:return(p.displayName||"Context")+".Consumer";case M:return(p._context.displayName||"Context")+".Provider";case $:var m=p.render;return p=p.displayName,p||(p=m.displayName||m.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case N:return m=p.displayName||null,m!==null?m:te(p.type)||"Memo";case B:m=p._payload,p=p._init;try{return te(p(m))}catch{}}return null}function ce(p){var m=p.type;switch(p.tag){case 24:return"Cache";case 9:return(m.displayName||"Context")+".Consumer";case 10:return(m._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return p=m.render,p=p.displayName||p.name||"",m.displayName||(p!==""?"ForwardRef("+p+")":"ForwardRef");case 7:return"Fragment";case 5:return m;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(m);case 8:return m===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m}return null}function ae(p){switch(typeof p){case"boolean":case"number":case"string":case"undefined":return p;case"object":return p;default:return""}}function ne(p){var m=p.type;return(p=p.nodeName)&&p.toLowerCase()==="input"&&(m==="checkbox"||m==="radio")}function ue(p){var m=ne(p)?"checked":"value",P=Object.getOwnPropertyDescriptor(p.constructor.prototype,m),D=""+p[m];if(!p.hasOwnProperty(m)&&typeof P<"u"&&typeof P.get=="function"&&typeof P.set=="function"){var j=P.get,W=P.set;return Object.defineProperty(p,m,{configurable:!0,get:function(){return j.call(this)},set:function(Z){D=""+Z,W.call(this,Z)}}),Object.defineProperty(p,m,{enumerable:P.enumerable}),{getValue:function(){return D},setValue:function(Z){D=""+Z},stopTracking:function(){p._valueTracker=null,delete p[m]}}}}function he(p){p._valueTracker||(p._valueTracker=ue(p))}function re(p){if(!p)return!1;var m=p._valueTracker;if(!m)return!0;var P=m.getValue(),D="";return p&&(D=ne(p)?p.checked?"true":"false":p.value),p=D,p!==P?(m.setValue(p),!0):!1}function le(p){if(p=p||(typeof document<"u"?document:void 0),typeof p>"u")return null;try{return p.activeElement||p.body}catch{return p.body}}function me(p,m){var P=m.checked;return K({},m,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:P??p._wrapperState.initialChecked})}function Se(p,m){var P=m.defaultValue==null?"":m.defaultValue,D=m.checked!=null?m.checked:m.defaultChecked;P=ae(m.value!=null?m.value:P),p._wrapperState={initialChecked:D,initialValue:P,controlled:m.type==="checkbox"||m.type==="radio"?m.checked!=null:m.value!=null}}function Ee(p,m){m=m.checked,m!=null&&C(p,"checked",m,!1)}function ge(p,m){Ee(p,m);var P=ae(m.value),D=m.type;if(P!=null)D==="number"?(P===0&&p.value===""||p.value!=P)&&(p.value=""+P):p.value!==""+P&&(p.value=""+P);else if(D==="submit"||D==="reset"){p.removeAttribute("value");return}m.hasOwnProperty("value")?Pe(p,m.type,P):m.hasOwnProperty("defaultValue")&&Pe(p,m.type,ae(m.defaultValue)),m.checked==null&&m.defaultChecked!=null&&(p.defaultChecked=!!m.defaultChecked)}function xe(p,m,P){if(m.hasOwnProperty("value")||m.hasOwnProperty("defaultValue")){var D=m.type;if(!(D!=="submit"&&D!=="reset"||m.value!==void 0&&m.value!==null))return;m=""+p._wrapperState.initialValue,P||m===p.value||(p.value=m),p.defaultValue=m}P=p.name,P!==""&&(p.name=""),p.defaultChecked=!!p._wrapperState.initialChecked,P!==""&&(p.name=P)}function Pe(p,m,P){(m!=="number"||le(p.ownerDocument)!==p)&&(P==null?p.defaultValue=""+p._wrapperState.initialValue:p.defaultValue!==""+P&&(p.defaultValue=""+P))}var _e=Array.isArray;function Le(p,m,P,D){if(p=p.options,m){m={};for(var j=0;j<P.length;j++)m["$"+P[j]]=!0;for(P=0;P<p.length;P++)j=m.hasOwnProperty("$"+p[P].value),p[P].selected!==j&&(p[P].selected=j),j&&D&&(p[P].defaultSelected=!0)}else{for(P=""+ae(P),m=null,j=0;j<p.length;j++){if(p[j].value===P){p[j].selected=!0,D&&(p[j].defaultSelected=!0);return}m!==null||p[j].disabled||(m=p[j])}m!==null&&(m.selected=!0)}}function de(p,m){if(m.dangerouslySetInnerHTML!=null)throw Error(n(91));return K({},m,{value:void 0,defaultValue:void 0,children:""+p._wrapperState.initialValue})}function $e(p,m){var P=m.value;if(P==null){if(P=m.children,m=m.defaultValue,P!=null){if(m!=null)throw Error(n(92));if(_e(P)){if(1<P.length)throw Error(n(93));P=P[0]}m=P}m==null&&(m=""),P=m}p._wrapperState={initialValue:ae(P)}}function Ae(p,m){var P=ae(m.value),D=ae(m.defaultValue);P!=null&&(P=""+P,P!==p.value&&(p.value=P),m.defaultValue==null&&p.defaultValue!==P&&(p.defaultValue=P)),D!=null&&(p.defaultValue=""+D)}function Ne(p){var m=p.textContent;m===p._wrapperState.initialValue&&m!==""&&m!==null&&(p.value=m)}function Ue(p){switch(p){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ze(p,m){return p==null||p==="http://www.w3.org/1999/xhtml"?Ue(m):p==="http://www.w3.org/2000/svg"&&m==="foreignObject"?"http://www.w3.org/1999/xhtml":p}var ut,Ye=function(p){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(m,P,D,j){MSApp.execUnsafeLocalFunction(function(){return p(m,P,D,j)})}:p}(function(p,m){if(p.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in p)p.innerHTML=m;else{for(ut=ut||document.createElement("div"),ut.innerHTML="<svg>"+m.valueOf().toString()+"</svg>",m=ut.firstChild;p.firstChild;)p.removeChild(p.firstChild);for(;m.firstChild;)p.appendChild(m.firstChild)}});function et(p,m){if(m){var P=p.firstChild;if(P&&P===p.lastChild&&P.nodeType===3){P.nodeValue=m;return}}p.textContent=m}var Xe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},mt=["Webkit","ms","Moz","O"];Object.keys(Xe).forEach(function(p){mt.forEach(function(m){m=m+p.charAt(0).toUpperCase()+p.substring(1),Xe[m]=Xe[p]})});function At(p,m,P){return m==null||typeof m=="boolean"||m===""?"":P||typeof m!="number"||m===0||Xe.hasOwnProperty(p)&&Xe[p]?(""+m).trim():m+"px"}function Bt(p,m){p=p.style;for(var P in m)if(m.hasOwnProperty(P)){var D=P.indexOf("--")===0,j=At(P,m[P],D);P==="float"&&(P="cssFloat"),D?p.setProperty(P,j):p[P]=j}}var gt=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vt(p,m){if(m){if(gt[p]&&(m.children!=null||m.dangerouslySetInnerHTML!=null))throw Error(n(137,p));if(m.dangerouslySetInnerHTML!=null){if(m.children!=null)throw Error(n(60));if(typeof m.dangerouslySetInnerHTML!="object"||!("__html"in m.dangerouslySetInnerHTML))throw Error(n(61))}if(m.style!=null&&typeof m.style!="object")throw Error(n(62))}}function Mn(p,m){if(p.indexOf("-")===-1)return typeof m.is=="string";switch(p){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nr=null;function un(p){return p=p.target||p.srcElement||window,p.correspondingUseElement&&(p=p.correspondingUseElement),p.nodeType===3?p.parentNode:p}var jn=null,dr=null,Bn=null;function Fo(p){if(p=Rv(p)){if(typeof jn!="function")throw Error(n(280));var m=p.stateNode;m&&(m=RS(m),jn(p.stateNode,p.type,m))}}function Yr(p){dr?Bn?Bn.push(p):Bn=[p]:dr=p}function Yi(){if(dr){var p=dr,m=Bn;if(Bn=dr=null,Fo(p),m)for(p=0;p<m.length;p++)Fo(m[p])}}function Qi(p,m){return p(m)}function qt(){}var Dr=!1;function Tt(p,m,P){if(Dr)return p(m,P);Dr=!0;try{return Qi(p,m,P)}finally{Dr=!1,(dr!==null||Bn!==null)&&(qt(),Yi())}}function Ot(p,m){var P=p.stateNode;if(P===null)return null;var D=RS(P);if(D===null)return null;P=D[m];e:switch(m){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(D=!D.disabled)||(p=p.type,D=!(p==="button"||p==="input"||p==="select"||p==="textarea")),p=!D;break e;default:p=!1}if(p)return null;if(P&&typeof P!="function")throw Error(n(231,m,typeof P));return P}var gn=!1;if(s)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){gn=!0}}),window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{gn=!1}function fr(p,m,P,D,j,W,Z,pe,be){var De=Array.prototype.slice.call(arguments,3);try{m.apply(P,De)}catch(it){this.onError(it)}}var ho=!1,ui=null,Xi=!1,ns=null,Qr={onError:function(p){ho=!0,ui=p}};function mo(p,m,P,D,j,W,Z,pe,be){ho=!1,ui=null,fr.apply(Qr,arguments)}function rs(p,m,P,D,j,W,Z,pe,be){if(mo.apply(this,arguments),ho){if(ho){var De=ui;ho=!1,ui=null}else throw Error(n(198));Xi||(Xi=!0,ns=De)}}function os(p){var m=p,P=p;if(p.alternate)for(;m.return;)m=m.return;else{p=m;do m=p,m.flags&4098&&(P=m.return),p=m.return;while(p)}return m.tag===3?P:null}function qe(p){if(p.tag===13){var m=p.memoizedState;if(m===null&&(p=p.alternate,p!==null&&(m=p.memoizedState)),m!==null)return m.dehydrated}return null}function Ve(p){if(os(p)!==p)throw Error(n(188))}function Dt(p){var m=p.alternate;if(!m){if(m=os(p),m===null)throw Error(n(188));return m!==p?null:p}for(var P=p,D=m;;){var j=P.return;if(j===null)break;var W=j.alternate;if(W===null){if(D=j.return,D!==null){P=D;continue}break}if(j.child===W.child){for(W=j.child;W;){if(W===P)return Ve(j),p;if(W===D)return Ve(j),m;W=W.sibling}throw Error(n(188))}if(P.return!==D.return)P=j,D=W;else{for(var Z=!1,pe=j.child;pe;){if(pe===P){Z=!0,P=j,D=W;break}if(pe===D){Z=!0,D=j,P=W;break}pe=pe.sibling}if(!Z){for(pe=W.child;pe;){if(pe===P){Z=!0,P=W,D=j;break}if(pe===D){Z=!0,D=W,P=j;break}pe=pe.sibling}if(!Z)throw Error(n(189))}}if(P.alternate!==D)throw Error(n(190))}if(P.tag!==3)throw Error(n(188));return P.stateNode.current===P?p:m}function fn(p){return p=Dt(p),p!==null?Tn(p):null}function Tn(p){if(p.tag===5||p.tag===6)return p;for(p=p.child;p!==null;){var m=Tn(p);if(m!==null)return m;p=p.sibling}return null}var rr=t.unstable_scheduleCallback,Fr=t.unstable_cancelCallback,Ji=t.unstable_shouldYield,pv=t.unstable_requestPaint,jr=t.unstable_now,pS=t.unstable_getCurrentPriorityLevel,Wu=t.unstable_ImmediatePriority,Of=t.unstable_UserBlockingPriority,$n=t.unstable_NormalPriority,is=t.unstable_LowPriority,Js=t.unstable_IdlePriority,ql=null,as=null;function Efe(p){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(ql,p,void 0,(p.current.flags&128)===128)}catch{}}var Zs=Math.clz32?Math.clz32:Tfe,Pfe=Math.log,Ife=Math.LN2;function Tfe(p){return p>>>=0,p===0?32:31-(Pfe(p)/Ife|0)|0}var hS=64,mS=4194304;function hv(p){switch(p&-p){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function gS(p,m){var P=p.pendingLanes;if(P===0)return 0;var D=0,j=p.suspendedLanes,W=p.pingedLanes,Z=P&268435455;if(Z!==0){var pe=Z&~j;pe!==0?D=hv(pe):(W&=Z,W!==0&&(D=hv(W)))}else Z=P&~j,Z!==0?D=hv(Z):W!==0&&(D=hv(W));if(D===0)return 0;if(m!==0&&m!==D&&!(m&j)&&(j=D&-D,W=m&-m,j>=W||j===16&&(W&4194240)!==0))return m;if(D&4&&(D|=P&16),m=p.entangledLanes,m!==0)for(p=p.entanglements,m&=D;0<m;)P=31-Zs(m),j=1<<P,D|=p[P],m&=~j;return D}function Ofe(p,m){switch(p){case 1:case 2:case 4:return m+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return m+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kfe(p,m){for(var P=p.suspendedLanes,D=p.pingedLanes,j=p.expirationTimes,W=p.pendingLanes;0<W;){var Z=31-Zs(W),pe=1<<Z,be=j[Z];be===-1?(!(pe&P)||pe&D)&&(j[Z]=Ofe(pe,m)):be<=m&&(p.expiredLanes|=pe),W&=~pe}}function mO(p){return p=p.pendingLanes&-1073741825,p!==0?p:p&1073741824?1073741824:0}function AV(){var p=hS;return hS<<=1,!(hS&4194240)&&(hS=64),p}function gO(p){for(var m=[],P=0;31>P;P++)m.push(p);return m}function mv(p,m,P){p.pendingLanes|=m,m!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,m=31-Zs(m),p[m]=P}function Mfe(p,m){var P=p.pendingLanes&~m;p.pendingLanes=m,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=m,p.mutableReadLanes&=m,p.entangledLanes&=m,m=p.entanglements;var D=p.eventTimes;for(p=p.expirationTimes;0<P;){var j=31-Zs(P),W=1<<j;m[j]=0,D[j]=-1,p[j]=-1,P&=~W}}function yO(p,m){var P=p.entangledLanes|=m;for(p=p.entanglements;P;){var D=31-Zs(P),j=1<<D;j&m|p[D]&m&&(p[D]|=m),P&=~j}}var ur=0;function RV(p){return p&=-p,1<p?4<p?p&268435455?16:536870912:4:1}var DV,vO,_V,$V,NV,bO=!1,yS=[],Gu=null,qu=null,Ku=null,gv=new Map,yv=new Map,Yu=[],Afe="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function LV(p,m){switch(p){case"focusin":case"focusout":Gu=null;break;case"dragenter":case"dragleave":qu=null;break;case"mouseover":case"mouseout":Ku=null;break;case"pointerover":case"pointerout":gv.delete(m.pointerId);break;case"gotpointercapture":case"lostpointercapture":yv.delete(m.pointerId)}}function vv(p,m,P,D,j,W){return p===null||p.nativeEvent!==W?(p={blockedOn:m,domEventName:P,eventSystemFlags:D,nativeEvent:W,targetContainers:[j]},m!==null&&(m=Rv(m),m!==null&&vO(m)),p):(p.eventSystemFlags|=D,m=p.targetContainers,j!==null&&m.indexOf(j)===-1&&m.push(j),p)}function Rfe(p,m,P,D,j){switch(m){case"focusin":return Gu=vv(Gu,p,m,P,D,j),!0;case"dragenter":return qu=vv(qu,p,m,P,D,j),!0;case"mouseover":return Ku=vv(Ku,p,m,P,D,j),!0;case"pointerover":var W=j.pointerId;return gv.set(W,vv(gv.get(W)||null,p,m,P,D,j)),!0;case"gotpointercapture":return W=j.pointerId,yv.set(W,vv(yv.get(W)||null,p,m,P,D,j)),!0}return!1}function FV(p){var m=kf(p.target);if(m!==null){var P=os(m);if(P!==null){if(m=P.tag,m===13){if(m=qe(P),m!==null){p.blockedOn=m,NV(p.priority,function(){_V(P)});return}}else if(m===3&&P.stateNode.current.memoizedState.isDehydrated){p.blockedOn=P.tag===3?P.stateNode.containerInfo:null;return}}}p.blockedOn=null}function vS(p){if(p.blockedOn!==null)return!1;for(var m=p.targetContainers;0<m.length;){var P=xO(p.domEventName,p.eventSystemFlags,m[0],p.nativeEvent);if(P===null){P=p.nativeEvent;var D=new P.constructor(P.type,P);nr=D,P.target.dispatchEvent(D),nr=null}else return m=Rv(P),m!==null&&vO(m),p.blockedOn=P,!1;m.shift()}return!0}function jV(p,m,P){vS(p)&&P.delete(m)}function Dfe(){bO=!1,Gu!==null&&vS(Gu)&&(Gu=null),qu!==null&&vS(qu)&&(qu=null),Ku!==null&&vS(Ku)&&(Ku=null),gv.forEach(jV),yv.forEach(jV)}function bv(p,m){p.blockedOn===m&&(p.blockedOn=null,bO||(bO=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Dfe)))}function wv(p){function m(j){return bv(j,p)}if(0<yS.length){bv(yS[0],p);for(var P=1;P<yS.length;P++){var D=yS[P];D.blockedOn===p&&(D.blockedOn=null)}}for(Gu!==null&&bv(Gu,p),qu!==null&&bv(qu,p),Ku!==null&&bv(Ku,p),gv.forEach(m),yv.forEach(m),P=0;P<Yu.length;P++)D=Yu[P],D.blockedOn===p&&(D.blockedOn=null);for(;0<Yu.length&&(P=Yu[0],P.blockedOn===null);)FV(P),P.blockedOn===null&&Yu.shift()}var Sh=I.ReactCurrentBatchConfig,bS=!0;function _fe(p,m,P,D){var j=ur,W=Sh.transition;Sh.transition=null;try{ur=1,wO(p,m,P,D)}finally{ur=j,Sh.transition=W}}function $fe(p,m,P,D){var j=ur,W=Sh.transition;Sh.transition=null;try{ur=4,wO(p,m,P,D)}finally{ur=j,Sh.transition=W}}function wO(p,m,P,D){if(bS){var j=xO(p,m,P,D);if(j===null)FO(p,m,D,wS,P),LV(p,D);else if(Rfe(j,p,m,P,D))D.stopPropagation();else if(LV(p,D),m&4&&-1<Afe.indexOf(p)){for(;j!==null;){var W=Rv(j);if(W!==null&&DV(W),W=xO(p,m,P,D),W===null&&FO(p,m,D,wS,P),W===j)break;j=W}j!==null&&D.stopPropagation()}else FO(p,m,D,null,P)}}var wS=null;function xO(p,m,P,D){if(wS=null,p=un(D),p=kf(p),p!==null)if(m=os(p),m===null)p=null;else if(P=m.tag,P===13){if(p=qe(m),p!==null)return p;p=null}else if(P===3){if(m.stateNode.current.memoizedState.isDehydrated)return m.tag===3?m.stateNode.containerInfo:null;p=null}else m!==p&&(p=null);return wS=p,null}function BV(p){switch(p){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pS()){case Wu:return 1;case Of:return 4;case $n:case is:return 16;case Js:return 536870912;default:return 16}default:return 16}}var Qu=null,SO=null,xS=null;function zV(){if(xS)return xS;var p,m=SO,P=m.length,D,j="value"in Qu?Qu.value:Qu.textContent,W=j.length;for(p=0;p<P&&m[p]===j[p];p++);var Z=P-p;for(D=1;D<=Z&&m[P-D]===j[W-D];D++);return xS=j.slice(p,1<D?1-D:void 0)}function SS(p){var m=p.keyCode;return"charCode"in p?(p=p.charCode,p===0&&m===13&&(p=13)):p=m,p===10&&(p=13),32<=p||p===13?p:0}function CS(){return!0}function VV(){return!1}function Ia(p){function m(P,D,j,W,Z){this._reactName=P,this._targetInst=j,this.type=D,this.nativeEvent=W,this.target=Z,this.currentTarget=null;for(var pe in p)p.hasOwnProperty(pe)&&(P=p[pe],this[pe]=P?P(W):W[pe]);return this.isDefaultPrevented=(W.defaultPrevented!=null?W.defaultPrevented:W.returnValue===!1)?CS:VV,this.isPropagationStopped=VV,this}return K(m.prototype,{preventDefault:function(){this.defaultPrevented=!0;var P=this.nativeEvent;P&&(P.preventDefault?P.preventDefault():typeof P.returnValue!="unknown"&&(P.returnValue=!1),this.isDefaultPrevented=CS)},stopPropagation:function(){var P=this.nativeEvent;P&&(P.stopPropagation?P.stopPropagation():typeof P.cancelBubble!="unknown"&&(P.cancelBubble=!0),this.isPropagationStopped=CS)},persist:function(){},isPersistent:CS}),m}var Ch={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(p){return p.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},CO=Ia(Ch),xv=K({},Ch,{view:0,detail:0}),Nfe=Ia(xv),EO,PO,Sv,ES=K({},xv,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:TO,button:0,buttons:0,relatedTarget:function(p){return p.relatedTarget===void 0?p.fromElement===p.srcElement?p.toElement:p.fromElement:p.relatedTarget},movementX:function(p){return"movementX"in p?p.movementX:(p!==Sv&&(Sv&&p.type==="mousemove"?(EO=p.screenX-Sv.screenX,PO=p.screenY-Sv.screenY):PO=EO=0,Sv=p),EO)},movementY:function(p){return"movementY"in p?p.movementY:PO}}),HV=Ia(ES),Lfe=K({},ES,{dataTransfer:0}),Ffe=Ia(Lfe),jfe=K({},xv,{relatedTarget:0}),IO=Ia(jfe),Bfe=K({},Ch,{animationName:0,elapsedTime:0,pseudoElement:0}),zfe=Ia(Bfe),Vfe=K({},Ch,{clipboardData:function(p){return"clipboardData"in p?p.clipboardData:window.clipboardData}}),Hfe=Ia(Vfe),Ufe=K({},Ch,{data:0}),UV=Ia(Ufe),Wfe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gfe={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},qfe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kfe(p){var m=this.nativeEvent;return m.getModifierState?m.getModifierState(p):(p=qfe[p])?!!m[p]:!1}function TO(){return Kfe}var Yfe=K({},xv,{key:function(p){if(p.key){var m=Wfe[p.key]||p.key;if(m!=="Unidentified")return m}return p.type==="keypress"?(p=SS(p),p===13?"Enter":String.fromCharCode(p)):p.type==="keydown"||p.type==="keyup"?Gfe[p.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:TO,charCode:function(p){return p.type==="keypress"?SS(p):0},keyCode:function(p){return p.type==="keydown"||p.type==="keyup"?p.keyCode:0},which:function(p){return p.type==="keypress"?SS(p):p.type==="keydown"||p.type==="keyup"?p.keyCode:0}}),Qfe=Ia(Yfe),Xfe=K({},ES,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),WV=Ia(Xfe),Jfe=K({},xv,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:TO}),Zfe=Ia(Jfe),epe=K({},Ch,{propertyName:0,elapsedTime:0,pseudoElement:0}),tpe=Ia(epe),npe=K({},ES,{deltaX:function(p){return"deltaX"in p?p.deltaX:"wheelDeltaX"in p?-p.wheelDeltaX:0},deltaY:function(p){return"deltaY"in p?p.deltaY:"wheelDeltaY"in p?-p.wheelDeltaY:"wheelDelta"in p?-p.wheelDelta:0},deltaZ:0,deltaMode:0}),rpe=Ia(npe),ope=[9,13,27,32],OO=s&&"CompositionEvent"in window,Cv=null;s&&"documentMode"in document&&(Cv=document.documentMode);var ipe=s&&"TextEvent"in window&&!Cv,GV=s&&(!OO||Cv&&8<Cv&&11>=Cv),qV=" ",KV=!1;function YV(p,m){switch(p){case"keyup":return ope.indexOf(m.keyCode)!==-1;case"keydown":return m.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QV(p){return p=p.detail,typeof p=="object"&&"data"in p?p.data:null}var Eh=!1;function ape(p,m){switch(p){case"compositionend":return QV(m);case"keypress":return m.which!==32?null:(KV=!0,qV);case"textInput":return p=m.data,p===qV&&KV?null:p;default:return null}}function spe(p,m){if(Eh)return p==="compositionend"||!OO&&YV(p,m)?(p=zV(),xS=SO=Qu=null,Eh=!1,p):null;switch(p){case"paste":return null;case"keypress":if(!(m.ctrlKey||m.altKey||m.metaKey)||m.ctrlKey&&m.altKey){if(m.char&&1<m.char.length)return m.char;if(m.which)return String.fromCharCode(m.which)}return null;case"compositionend":return GV&&m.locale!=="ko"?null:m.data;default:return null}}var lpe={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function XV(p){var m=p&&p.nodeName&&p.nodeName.toLowerCase();return m==="input"?!!lpe[p.type]:m==="textarea"}function JV(p,m,P,D){Yr(D),m=kS(m,"onChange"),0<m.length&&(P=new CO("onChange","change",null,P,D),p.push({event:P,listeners:m}))}var Ev=null,Pv=null;function cpe(p){gH(p,0)}function PS(p){var m=kh(p);if(re(m))return p}function upe(p,m){if(p==="change")return m}var ZV=!1;if(s){var kO;if(s){var MO="oninput"in document;if(!MO){var eH=document.createElement("div");eH.setAttribute("oninput","return;"),MO=typeof eH.oninput=="function"}kO=MO}else kO=!1;ZV=kO&&(!document.documentMode||9<document.documentMode)}function tH(){Ev&&(Ev.detachEvent("onpropertychange",nH),Pv=Ev=null)}function nH(p){if(p.propertyName==="value"&&PS(Pv)){var m=[];JV(m,Pv,p,un(p)),Tt(cpe,m)}}function dpe(p,m,P){p==="focusin"?(tH(),Ev=m,Pv=P,Ev.attachEvent("onpropertychange",nH)):p==="focusout"&&tH()}function fpe(p){if(p==="selectionchange"||p==="keyup"||p==="keydown")return PS(Pv)}function ppe(p,m){if(p==="click")return PS(m)}function hpe(p,m){if(p==="input"||p==="change")return PS(m)}function mpe(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var el=typeof Object.is=="function"?Object.is:mpe;function Iv(p,m){if(el(p,m))return!0;if(typeof p!="object"||p===null||typeof m!="object"||m===null)return!1;var P=Object.keys(p),D=Object.keys(m);if(P.length!==D.length)return!1;for(D=0;D<P.length;D++){var j=P[D];if(!l.call(m,j)||!el(p[j],m[j]))return!1}return!0}function rH(p){for(;p&&p.firstChild;)p=p.firstChild;return p}function oH(p,m){var P=rH(p);p=0;for(var D;P;){if(P.nodeType===3){if(D=p+P.textContent.length,p<=m&&D>=m)return{node:P,offset:m-p};p=D}e:{for(;P;){if(P.nextSibling){P=P.nextSibling;break e}P=P.parentNode}P=void 0}P=rH(P)}}function iH(p,m){return p&&m?p===m?!0:p&&p.nodeType===3?!1:m&&m.nodeType===3?iH(p,m.parentNode):"contains"in p?p.contains(m):p.compareDocumentPosition?!!(p.compareDocumentPosition(m)&16):!1:!1}function aH(){for(var p=window,m=le();m instanceof p.HTMLIFrameElement;){try{var P=typeof m.contentWindow.location.href=="string"}catch{P=!1}if(P)p=m.contentWindow;else break;m=le(p.document)}return m}function AO(p){var m=p&&p.nodeName&&p.nodeName.toLowerCase();return m&&(m==="input"&&(p.type==="text"||p.type==="search"||p.type==="tel"||p.type==="url"||p.type==="password")||m==="textarea"||p.contentEditable==="true")}function gpe(p){var m=aH(),P=p.focusedElem,D=p.selectionRange;if(m!==P&&P&&P.ownerDocument&&iH(P.ownerDocument.documentElement,P)){if(D!==null&&AO(P)){if(m=D.start,p=D.end,p===void 0&&(p=m),"selectionStart"in P)P.selectionStart=m,P.selectionEnd=Math.min(p,P.value.length);else if(p=(m=P.ownerDocument||document)&&m.defaultView||window,p.getSelection){p=p.getSelection();var j=P.textContent.length,W=Math.min(D.start,j);D=D.end===void 0?W:Math.min(D.end,j),!p.extend&&W>D&&(j=D,D=W,W=j),j=oH(P,W);var Z=oH(P,D);j&&Z&&(p.rangeCount!==1||p.anchorNode!==j.node||p.anchorOffset!==j.offset||p.focusNode!==Z.node||p.focusOffset!==Z.offset)&&(m=m.createRange(),m.setStart(j.node,j.offset),p.removeAllRanges(),W>D?(p.addRange(m),p.extend(Z.node,Z.offset)):(m.setEnd(Z.node,Z.offset),p.addRange(m)))}}for(m=[],p=P;p=p.parentNode;)p.nodeType===1&&m.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<m.length;P++)p=m[P],p.element.scrollLeft=p.left,p.element.scrollTop=p.top}}var ype=s&&"documentMode"in document&&11>=document.documentMode,Ph=null,RO=null,Tv=null,DO=!1;function sH(p,m,P){var D=P.window===P?P.document:P.nodeType===9?P:P.ownerDocument;DO||Ph==null||Ph!==le(D)||(D=Ph,"selectionStart"in D&&AO(D)?D={start:D.selectionStart,end:D.selectionEnd}:(D=(D.ownerDocument&&D.ownerDocument.defaultView||window).getSelection(),D={anchorNode:D.anchorNode,anchorOffset:D.anchorOffset,focusNode:D.focusNode,focusOffset:D.focusOffset}),Tv&&Iv(Tv,D)||(Tv=D,D=kS(RO,"onSelect"),0<D.length&&(m=new CO("onSelect","select",null,m,P),p.push({event:m,listeners:D}),m.target=Ph)))}function IS(p,m){var P={};return P[p.toLowerCase()]=m.toLowerCase(),P["Webkit"+p]="webkit"+m,P["Moz"+p]="moz"+m,P}var Ih={animationend:IS("Animation","AnimationEnd"),animationiteration:IS("Animation","AnimationIteration"),animationstart:IS("Animation","AnimationStart"),transitionend:IS("Transition","TransitionEnd")},_O={},lH={};s&&(lH=document.createElement("div").style,"AnimationEvent"in window||(delete Ih.animationend.animation,delete Ih.animationiteration.animation,delete Ih.animationstart.animation),"TransitionEvent"in window||delete Ih.transitionend.transition);function TS(p){if(_O[p])return _O[p];if(!Ih[p])return p;var m=Ih[p],P;for(P in m)if(m.hasOwnProperty(P)&&P in lH)return _O[p]=m[P];return p}var cH=TS("animationend"),uH=TS("animationiteration"),dH=TS("animationstart"),fH=TS("transitionend"),pH=new Map,hH="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Xu(p,m){pH.set(p,m),i(m,[p])}for(var $O=0;$O<hH.length;$O++){var NO=hH[$O],vpe=NO.toLowerCase(),bpe=NO[0].toUpperCase()+NO.slice(1);Xu(vpe,"on"+bpe)}Xu(cH,"onAnimationEnd"),Xu(uH,"onAnimationIteration"),Xu(dH,"onAnimationStart"),Xu("dblclick","onDoubleClick"),Xu("focusin","onFocus"),Xu("focusout","onBlur"),Xu(fH,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ov="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wpe=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ov));function mH(p,m,P){var D=p.type||"unknown-event";p.currentTarget=P,rs(D,m,void 0,p),p.currentTarget=null}function gH(p,m){m=(m&4)!==0;for(var P=0;P<p.length;P++){var D=p[P],j=D.event;D=D.listeners;e:{var W=void 0;if(m)for(var Z=D.length-1;0<=Z;Z--){var pe=D[Z],be=pe.instance,De=pe.currentTarget;if(pe=pe.listener,be!==W&&j.isPropagationStopped())break e;mH(j,pe,De),W=be}else for(Z=0;Z<D.length;Z++){if(pe=D[Z],be=pe.instance,De=pe.currentTarget,pe=pe.listener,be!==W&&j.isPropagationStopped())break e;mH(j,pe,De),W=be}}}if(Xi)throw p=ns,Xi=!1,ns=null,p}function Ir(p,m){var P=m[UO];P===void 0&&(P=m[UO]=new Set);var D=p+"__bubble";P.has(D)||(yH(m,p,2,!1),P.add(D))}function LO(p,m,P){var D=0;m&&(D|=4),yH(P,p,D,m)}var OS="_reactListening"+Math.random().toString(36).slice(2);function kv(p){if(!p[OS]){p[OS]=!0,r.forEach(function(P){P!=="selectionchange"&&(wpe.has(P)||LO(P,!1,p),LO(P,!0,p))});var m=p.nodeType===9?p:p.ownerDocument;m===null||m[OS]||(m[OS]=!0,LO("selectionchange",!1,m))}}function yH(p,m,P,D){switch(BV(m)){case 1:var j=_fe;break;case 4:j=$fe;break;default:j=wO}P=j.bind(null,m,P,p),j=void 0,!gn||m!=="touchstart"&&m!=="touchmove"&&m!=="wheel"||(j=!0),D?j!==void 0?p.addEventListener(m,P,{capture:!0,passive:j}):p.addEventListener(m,P,!0):j!==void 0?p.addEventListener(m,P,{passive:j}):p.addEventListener(m,P,!1)}function FO(p,m,P,D,j){var W=D;if(!(m&1)&&!(m&2)&&D!==null)e:for(;;){if(D===null)return;var Z=D.tag;if(Z===3||Z===4){var pe=D.stateNode.containerInfo;if(pe===j||pe.nodeType===8&&pe.parentNode===j)break;if(Z===4)for(Z=D.return;Z!==null;){var be=Z.tag;if((be===3||be===4)&&(be=Z.stateNode.containerInfo,be===j||be.nodeType===8&&be.parentNode===j))return;Z=Z.return}for(;pe!==null;){if(Z=kf(pe),Z===null)return;if(be=Z.tag,be===5||be===6){D=W=Z;continue e}pe=pe.parentNode}}D=D.return}Tt(function(){var De=W,it=un(P),ct=[];e:{var ot=pH.get(p);if(ot!==void 0){var Mt=CO,Lt=p;switch(p){case"keypress":if(SS(P)===0)break e;case"keydown":case"keyup":Mt=Qfe;break;case"focusin":Lt="focus",Mt=IO;break;case"focusout":Lt="blur",Mt=IO;break;case"beforeblur":case"afterblur":Mt=IO;break;case"click":if(P.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Mt=HV;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Mt=Ffe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Mt=Zfe;break;case cH:case uH:case dH:Mt=zfe;break;case fH:Mt=tpe;break;case"scroll":Mt=Nfe;break;case"wheel":Mt=rpe;break;case"copy":case"cut":case"paste":Mt=Hfe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Mt=WV}var jt=(m&4)!==0,so=!jt&&p==="scroll",ke=jt?ot!==null?ot+"Capture":null:ot;jt=[];for(var Ce=De,Me;Ce!==null;){Me=Ce;var ht=Me.stateNode;if(Me.tag===5&&ht!==null&&(Me=ht,ke!==null&&(ht=Ot(Ce,ke),ht!=null&&jt.push(Mv(Ce,ht,Me)))),so)break;Ce=Ce.return}0<jt.length&&(ot=new Mt(ot,Lt,null,P,it),ct.push({event:ot,listeners:jt}))}}if(!(m&7)){e:{if(ot=p==="mouseover"||p==="pointerover",Mt=p==="mouseout"||p==="pointerout",ot&&P!==nr&&(Lt=P.relatedTarget||P.fromElement)&&(kf(Lt)||Lt[jc]))break e;if((Mt||ot)&&(ot=it.window===it?it:(ot=it.ownerDocument)?ot.defaultView||ot.parentWindow:window,Mt?(Lt=P.relatedTarget||P.toElement,Mt=De,Lt=Lt?kf(Lt):null,Lt!==null&&(so=os(Lt),Lt!==so||Lt.tag!==5&&Lt.tag!==6)&&(Lt=null)):(Mt=null,Lt=De),Mt!==Lt)){if(jt=HV,ht="onMouseLeave",ke="onMouseEnter",Ce="mouse",(p==="pointerout"||p==="pointerover")&&(jt=WV,ht="onPointerLeave",ke="onPointerEnter",Ce="pointer"),so=Mt==null?ot:kh(Mt),Me=Lt==null?ot:kh(Lt),ot=new jt(ht,Ce+"leave",Mt,P,it),ot.target=so,ot.relatedTarget=Me,ht=null,kf(it)===De&&(jt=new jt(ke,Ce+"enter",Lt,P,it),jt.target=Me,jt.relatedTarget=so,ht=jt),so=ht,Mt&&Lt)t:{for(jt=Mt,ke=Lt,Ce=0,Me=jt;Me;Me=Th(Me))Ce++;for(Me=0,ht=ke;ht;ht=Th(ht))Me++;for(;0<Ce-Me;)jt=Th(jt),Ce--;for(;0<Me-Ce;)ke=Th(ke),Me--;for(;Ce--;){if(jt===ke||ke!==null&&jt===ke.alternate)break t;jt=Th(jt),ke=Th(ke)}jt=null}else jt=null;Mt!==null&&vH(ct,ot,Mt,jt,!1),Lt!==null&&so!==null&&vH(ct,so,Lt,jt,!0)}}e:{if(ot=De?kh(De):window,Mt=ot.nodeName&&ot.nodeName.toLowerCase(),Mt==="select"||Mt==="input"&&ot.type==="file")var Ht=upe;else if(XV(ot))if(ZV)Ht=hpe;else{Ht=fpe;var Xt=dpe}else(Mt=ot.nodeName)&&Mt.toLowerCase()==="input"&&(ot.type==="checkbox"||ot.type==="radio")&&(Ht=ppe);if(Ht&&(Ht=Ht(p,De))){JV(ct,Ht,P,it);break e}Xt&&Xt(p,ot,De),p==="focusout"&&(Xt=ot._wrapperState)&&Xt.controlled&&ot.type==="number"&&Pe(ot,"number",ot.value)}switch(Xt=De?kh(De):window,p){case"focusin":(XV(Xt)||Xt.contentEditable==="true")&&(Ph=Xt,RO=De,Tv=null);break;case"focusout":Tv=RO=Ph=null;break;case"mousedown":DO=!0;break;case"contextmenu":case"mouseup":case"dragend":DO=!1,sH(ct,P,it);break;case"selectionchange":if(ype)break;case"keydown":case"keyup":sH(ct,P,it)}var Jt;if(OO)e:{switch(p){case"compositionstart":var sn="onCompositionStart";break e;case"compositionend":sn="onCompositionEnd";break e;case"compositionupdate":sn="onCompositionUpdate";break e}sn=void 0}else Eh?YV(p,P)&&(sn="onCompositionEnd"):p==="keydown"&&P.keyCode===229&&(sn="onCompositionStart");sn&&(GV&&P.locale!=="ko"&&(Eh||sn!=="onCompositionStart"?sn==="onCompositionEnd"&&Eh&&(Jt=zV()):(Qu=it,SO="value"in Qu?Qu.value:Qu.textContent,Eh=!0)),Xt=kS(De,sn),0<Xt.length&&(sn=new UV(sn,p,null,P,it),ct.push({event:sn,listeners:Xt}),Jt?sn.data=Jt:(Jt=QV(P),Jt!==null&&(sn.data=Jt)))),(Jt=ipe?ape(p,P):spe(p,P))&&(De=kS(De,"onBeforeInput"),0<De.length&&(it=new UV("onBeforeInput","beforeinput",null,P,it),ct.push({event:it,listeners:De}),it.data=Jt))}gH(ct,m)})}function Mv(p,m,P){return{instance:p,listener:m,currentTarget:P}}function kS(p,m){for(var P=m+"Capture",D=[];p!==null;){var j=p,W=j.stateNode;j.tag===5&&W!==null&&(j=W,W=Ot(p,P),W!=null&&D.unshift(Mv(p,W,j)),W=Ot(p,m),W!=null&&D.push(Mv(p,W,j))),p=p.return}return D}function Th(p){if(p===null)return null;do p=p.return;while(p&&p.tag!==5);return p||null}function vH(p,m,P,D,j){for(var W=m._reactName,Z=[];P!==null&&P!==D;){var pe=P,be=pe.alternate,De=pe.stateNode;if(be!==null&&be===D)break;pe.tag===5&&De!==null&&(pe=De,j?(be=Ot(P,W),be!=null&&Z.unshift(Mv(P,be,pe))):j||(be=Ot(P,W),be!=null&&Z.push(Mv(P,be,pe)))),P=P.return}Z.length!==0&&p.push({event:m,listeners:Z})}var xpe=/\r\n?/g,Spe=/\u0000|\uFFFD/g;function bH(p){return(typeof p=="string"?p:""+p).replace(xpe,`-`).replace(Spe,"")}function MS(p,m,P){if(m=bH(m),bH(p)!==m&&P)throw Error(n(425))}function AS(){}var jO=null,BO=null;function zO(p,m){return p==="textarea"||p==="noscript"||typeof m.children=="string"||typeof m.children=="number"||typeof m.dangerouslySetInnerHTML=="object"&&m.dangerouslySetInnerHTML!==null&&m.dangerouslySetInnerHTML.__html!=null}var VO=typeof setTimeout=="function"?setTimeout:void 0,Cpe=typeof clearTimeout=="function"?clearTimeout:void 0,wH=typeof Promise=="function"?Promise:void 0,Epe=typeof queueMicrotask=="function"?queueMicrotask:typeof wH<"u"?function(p){return wH.resolve(null).then(p).catch(Ppe)}:VO;function Ppe(p){setTimeout(function(){throw p})}function HO(p,m){var P=m,D=0;do{var j=P.nextSibling;if(p.removeChild(P),j&&j.nodeType===8)if(P=j.data,P==="/$"){if(D===0){p.removeChild(j),wv(m);return}D--}else P!=="$"&&P!=="$?"&&P!=="$!"||D++;P=j}while(P);wv(m)}function Ju(p){for(;p!=null;p=p.nextSibling){var m=p.nodeType;if(m===1||m===3)break;if(m===8){if(m=p.data,m==="$"||m==="$!"||m==="$?")break;if(m==="/$")return null}}return p}function xH(p){p=p.previousSibling;for(var m=0;p;){if(p.nodeType===8){var P=p.data;if(P==="$"||P==="$!"||P==="$?"){if(m===0)return p;m--}else P==="/$"&&m++}p=p.previousSibling}return null}var Oh=Math.random().toString(36).slice(2),Kl="__reactFiber$"+Oh,Av="__reactProps$"+Oh,jc="__reactContainer$"+Oh,UO="__reactEvents$"+Oh,Ipe="__reactListeners$"+Oh,Tpe="__reactHandles$"+Oh;function kf(p){var m=p[Kl];if(m)return m;for(var P=p.parentNode;P;){if(m=P[jc]||P[Kl]){if(P=m.alternate,m.child!==null||P!==null&&P.child!==null)for(p=xH(p);p!==null;){if(P=p[Kl])return P;p=xH(p)}return m}p=P,P=p.parentNode}return null}function Rv(p){return p=p[Kl]||p[jc],!p||p.tag!==5&&p.tag!==6&&p.tag!==13&&p.tag!==3?null:p}function kh(p){if(p.tag===5||p.tag===6)return p.stateNode;throw Error(n(33))}function RS(p){return p[Av]||null}var WO=[],Mh=-1;function Zu(p){return{current:p}}function Tr(p){0>Mh||(p.current=WO[Mh],WO[Mh]=null,Mh--)}function xr(p,m){Mh++,WO[Mh]=p.current,p.current=m}var ed={},di=Zu(ed),Zi=Zu(!1),Mf=ed;function Ah(p,m){var P=p.type.contextTypes;if(!P)return ed;var D=p.stateNode;if(D&&D.__reactInternalMemoizedUnmaskedChildContext===m)return D.__reactInternalMemoizedMaskedChildContext;var j={},W;for(W in P)j[W]=m[W];return D&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=m,p.__reactInternalMemoizedMaskedChildContext=j),j}function ea(p){return p=p.childContextTypes,p!=null}function DS(){Tr(Zi),Tr(di)}function SH(p,m,P){if(di.current!==ed)throw Error(n(168));xr(di,m),xr(Zi,P)}function CH(p,m,P){var D=p.stateNode;if(m=m.childContextTypes,typeof D.getChildContext!="function")return P;D=D.getChildContext();for(var j in D)if(!(j in m))throw Error(n(108,ce(p)||"Unknown",j));return K({},P,D)}function _S(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||ed,Mf=di.current,xr(di,p),xr(Zi,Zi.current),!0}function EH(p,m,P){var D=p.stateNode;if(!D)throw Error(n(169));P?(p=CH(p,m,Mf),D.__reactInternalMemoizedMergedChildContext=p,Tr(Zi),Tr(di),xr(di,p)):Tr(Zi),xr(Zi,P)}var Bc=null,$S=!1,GO=!1;function PH(p){Bc===null?Bc=[p]:Bc.push(p)}function Ope(p){$S=!0,PH(p)}function td(){if(!GO&&Bc!==null){GO=!0;var p=0,m=ur;try{var P=Bc;for(ur=1;p<P.length;p++){var D=P[p];do D=D(!0);while(D!==null)}Bc=null,$S=!1}catch(j){throw Bc!==null&&(Bc=Bc.slice(p+1)),rr(Wu,td),j}finally{ur=m,GO=!1}}return null}var Rh=[],Dh=0,NS=null,LS=0,ss=[],ls=0,Af=null,zc=1,Vc="";function Rf(p,m){Rh[Dh++]=LS,Rh[Dh++]=NS,NS=p,LS=m}function IH(p,m,P){ss[ls++]=zc,ss[ls++]=Vc,ss[ls++]=Af,Af=p;var D=zc;p=Vc;var j=32-Zs(D)-1;D&=~(1<<j),P+=1;var W=32-Zs(m)+j;if(30<W){var Z=j-j%5;W=(D&(1<<Z)-1).toString(32),D>>=Z,j-=Z,zc=1<<32-Zs(m)+j|P<<j|D,Vc=W+p}else zc=1<<W|P<<j|D,Vc=p}function qO(p){p.return!==null&&(Rf(p,1),IH(p,1,0))}function KO(p){for(;p===NS;)NS=Rh[--Dh],Rh[Dh]=null,LS=Rh[--Dh],Rh[Dh]=null;for(;p===Af;)Af=ss[--ls],ss[ls]=null,Vc=ss[--ls],ss[ls]=null,zc=ss[--ls],ss[ls]=null}var Ta=null,Oa=null,_r=!1,tl=null;function TH(p,m){var P=fs(5,null,null,0);P.elementType="DELETED",P.stateNode=m,P.return=p,m=p.deletions,m===null?(p.deletions=[P],p.flags|=16):m.push(P)}function OH(p,m){switch(p.tag){case 5:var P=p.type;return m=m.nodeType!==1||P.toLowerCase()!==m.nodeName.toLowerCase()?null:m,m!==null?(p.stateNode=m,Ta=p,Oa=Ju(m.firstChild),!0):!1;case 6:return m=p.pendingProps===""||m.nodeType!==3?null:m,m!==null?(p.stateNode=m,Ta=p,Oa=null,!0):!1;case 13:return m=m.nodeType!==8?null:m,m!==null?(P=Af!==null?{id:zc,overflow:Vc}:null,p.memoizedState={dehydrated:m,treeContext:P,retryLane:1073741824},P=fs(18,null,null,0),P.stateNode=m,P.return=p,p.child=P,Ta=p,Oa=null,!0):!1;default:return!1}}function YO(p){return(p.mode&1)!==0&&(p.flags&128)===0}function QO(p){if(_r){var m=Oa;if(m){var P=m;if(!OH(p,m)){if(YO(p))throw Error(n(418));m=Ju(P.nextSibling);var D=Ta;m&&OH(p,m)?TH(D,P):(p.flags=p.flags&-4097|2,_r=!1,Ta=p)}}else{if(YO(p))throw Error(n(418));p.flags=p.flags&-4097|2,_r=!1,Ta=p}}}function kH(p){for(p=p.return;p!==null&&p.tag!==5&&p.tag!==3&&p.tag!==13;)p=p.return;Ta=p}function FS(p){if(p!==Ta)return!1;if(!_r)return kH(p),_r=!0,!1;var m;if((m=p.tag!==3)&&!(m=p.tag!==5)&&(m=p.type,m=m!=="head"&&m!=="body"&&!zO(p.type,p.memoizedProps)),m&&(m=Oa)){if(YO(p))throw MH(),Error(n(418));for(;m;)TH(p,m),m=Ju(m.nextSibling)}if(kH(p),p.tag===13){if(p=p.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(317));e:{for(p=p.nextSibling,m=0;p;){if(p.nodeType===8){var P=p.data;if(P==="/$"){if(m===0){Oa=Ju(p.nextSibling);break e}m--}else P!=="$"&&P!=="$!"&&P!=="$?"||m++}p=p.nextSibling}Oa=null}}else Oa=Ta?Ju(p.stateNode.nextSibling):null;return!0}function MH(){for(var p=Oa;p;)p=Ju(p.nextSibling)}function _h(){Oa=Ta=null,_r=!1}function XO(p){tl===null?tl=[p]:tl.push(p)}var kpe=I.ReactCurrentBatchConfig;function Dv(p,m,P){if(p=P.ref,p!==null&&typeof p!="function"&&typeof p!="object"){if(P._owner){if(P=P._owner,P){if(P.tag!==1)throw Error(n(309));var D=P.stateNode}if(!D)throw Error(n(147,p));var j=D,W=""+p;return m!==null&&m.ref!==null&&typeof m.ref=="function"&&m.ref._stringRef===W?m.ref:(m=function(Z){var pe=j.refs;Z===null?delete pe[W]:pe[W]=Z},m._stringRef=W,m)}if(typeof p!="string")throw Error(n(284));if(!P._owner)throw Error(n(290,p))}return p}function jS(p,m){throw p=Object.prototype.toString.call(m),Error(n(31,p==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":p))}function AH(p){var m=p._init;return m(p._payload)}function RH(p){function m(ke,Ce){if(p){var Me=ke.deletions;Me===null?(ke.deletions=[Ce],ke.flags|=16):Me.push(Ce)}}function P(ke,Ce){if(!p)return null;for(;Ce!==null;)m(ke,Ce),Ce=Ce.sibling;return null}function D(ke,Ce){for(ke=new Map;Ce!==null;)Ce.key!==null?ke.set(Ce.key,Ce):ke.set(Ce.index,Ce),Ce=Ce.sibling;return ke}function j(ke,Ce){return ke=cd(ke,Ce),ke.index=0,ke.sibling=null,ke}function W(ke,Ce,Me){return ke.index=Me,p?(Me=ke.alternate,Me!==null?(Me=Me.index,Me<Ce?(ke.flags|=2,Ce):Me):(ke.flags|=2,Ce)):(ke.flags|=1048576,Ce)}function Z(ke){return p&&ke.alternate===null&&(ke.flags|=2),ke}function pe(ke,Ce,Me,ht){return Ce===null||Ce.tag!==6?(Ce=Vk(Me,ke.mode,ht),Ce.return=ke,Ce):(Ce=j(Ce,Me),Ce.return=ke,Ce)}function be(ke,Ce,Me,ht){var Ht=Me.type;return Ht===O?it(ke,Ce,Me.props.children,ht,Me.key):Ce!==null&&(Ce.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===B&&AH(Ht)===Ce.type)?(ht=j(Ce,Me.props),ht.ref=Dv(ke,Ce,Me),ht.return=ke,ht):(ht=cC(Me.type,Me.key,Me.props,null,ke.mode,ht),ht.ref=Dv(ke,Ce,Me),ht.return=ke,ht)}function De(ke,Ce,Me,ht){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==Me.containerInfo||Ce.stateNode.implementation!==Me.implementation?(Ce=Hk(Me,ke.mode,ht),Ce.return=ke,Ce):(Ce=j(Ce,Me.children||[]),Ce.return=ke,Ce)}function it(ke,Ce,Me,ht,Ht){return Ce===null||Ce.tag!==7?(Ce=Bf(Me,ke.mode,ht,Ht),Ce.return=ke,Ce):(Ce=j(Ce,Me),Ce.return=ke,Ce)}function ct(ke,Ce,Me){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return Ce=Vk(""+Ce,ke.mode,Me),Ce.return=ke,Ce;if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case E:return Me=cC(Ce.type,Ce.key,Ce.props,null,ke.mode,Me),Me.ref=Dv(ke,null,Ce),Me.return=ke,Me;case T:return Ce=Hk(Ce,ke.mode,Me),Ce.return=ke,Ce;case B:var ht=Ce._init;return ct(ke,ht(Ce._payload),Me)}if(_e(Ce)||H(Ce))return Ce=Bf(Ce,ke.mode,Me,null),Ce.return=ke,Ce;jS(ke,Ce)}return null}function ot(ke,Ce,Me,ht){var Ht=Ce!==null?Ce.key:null;if(typeof Me=="string"&&Me!==""||typeof Me=="number")return Ht!==null?null:pe(ke,Ce,""+Me,ht);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case E:return Me.key===Ht?be(ke,Ce,Me,ht):null;case T:return Me.key===Ht?De(ke,Ce,Me,ht):null;case B:return Ht=Me._init,ot(ke,Ce,Ht(Me._payload),ht)}if(_e(Me)||H(Me))return Ht!==null?null:it(ke,Ce,Me,ht,null);jS(ke,Me)}return null}function Mt(ke,Ce,Me,ht,Ht){if(typeof ht=="string"&&ht!==""||typeof ht=="number")return ke=ke.get(Me)||null,pe(Ce,ke,""+ht,Ht);if(typeof ht=="object"&&ht!==null){switch(ht.$$typeof){case E:return ke=ke.get(ht.key===null?Me:ht.key)||null,be(Ce,ke,ht,Ht);case T:return ke=ke.get(ht.key===null?Me:ht.key)||null,De(Ce,ke,ht,Ht);case B:var Xt=ht._init;return Mt(ke,Ce,Me,Xt(ht._payload),Ht)}if(_e(ht)||H(ht))return ke=ke.get(Me)||null,it(Ce,ke,ht,Ht,null);jS(Ce,ht)}return null}function Lt(ke,Ce,Me,ht){for(var Ht=null,Xt=null,Jt=Ce,sn=Ce=0,zo=null;Jt!==null&&sn<Me.length;sn++){Jt.index>sn?(zo=Jt,Jt=null):zo=Jt.sibling;var Gn=ot(ke,Jt,Me[sn],ht);if(Gn===null){Jt===null&&(Jt=zo);break}p&&Jt&&Gn.alternate===null&&m(ke,Jt),Ce=W(Gn,Ce,sn),Xt===null?Ht=Gn:Xt.sibling=Gn,Xt=Gn,Jt=zo}if(sn===Me.length)return P(ke,Jt),_r&&Rf(ke,sn),Ht;if(Jt===null){for(;sn<Me.length;sn++)Jt=ct(ke,Me[sn],ht),Jt!==null&&(Ce=W(Jt,Ce,sn),Xt===null?Ht=Jt:Xt.sibling=Jt,Xt=Jt);return _r&&Rf(ke,sn),Ht}for(Jt=D(ke,Jt);sn<Me.length;sn++)zo=Mt(Jt,ke,sn,Me[sn],ht),zo!==null&&(p&&zo.alternate!==null&&Jt.delete(zo.key===null?sn:zo.key),Ce=W(zo,Ce,sn),Xt===null?Ht=zo:Xt.sibling=zo,Xt=zo);return p&&Jt.forEach(function(ud){return m(ke,ud)}),_r&&Rf(ke,sn),Ht}function jt(ke,Ce,Me,ht){var Ht=H(Me);if(typeof Ht!="function")throw Error(n(150));if(Me=Ht.call(Me),Me==null)throw Error(n(151));for(var Xt=Ht=null,Jt=Ce,sn=Ce=0,zo=null,Gn=Me.next();Jt!==null&&!Gn.done;sn++,Gn=Me.next()){Jt.index>sn?(zo=Jt,Jt=null):zo=Jt.sibling;var ud=ot(ke,Jt,Gn.value,ht);if(ud===null){Jt===null&&(Jt=zo);break}p&&Jt&&ud.alternate===null&&m(ke,Jt),Ce=W(ud,Ce,sn),Xt===null?Ht=ud:Xt.sibling=ud,Xt=ud,Jt=zo}if(Gn.done)return P(ke,Jt),_r&&Rf(ke,sn),Ht;if(Jt===null){for(;!Gn.done;sn++,Gn=Me.next())Gn=ct(ke,Gn.value,ht),Gn!==null&&(Ce=W(Gn,Ce,sn),Xt===null?Ht=Gn:Xt.sibling=Gn,Xt=Gn);return _r&&Rf(ke,sn),Ht}for(Jt=D(ke,Jt);!Gn.done;sn++,Gn=Me.next())Gn=Mt(Jt,ke,sn,Gn.value,ht),Gn!==null&&(p&&Gn.alternate!==null&&Jt.delete(Gn.key===null?sn:Gn.key),Ce=W(Gn,Ce,sn),Xt===null?Ht=Gn:Xt.sibling=Gn,Xt=Gn);return p&&Jt.forEach(function(lhe){return m(ke,lhe)}),_r&&Rf(ke,sn),Ht}function so(ke,Ce,Me,ht){if(typeof Me=="object"&&Me!==null&&Me.type===O&&Me.key===null&&(Me=Me.props.children),typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case E:e:{for(var Ht=Me.key,Xt=Ce;Xt!==null;){if(Xt.key===Ht){if(Ht=Me.type,Ht===O){if(Xt.tag===7){P(ke,Xt.sibling),Ce=j(Xt,Me.props.children),Ce.return=ke,ke=Ce;break e}}else if(Xt.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===B&&AH(Ht)===Xt.type){P(ke,Xt.sibling),Ce=j(Xt,Me.props),Ce.ref=Dv(ke,Xt,Me),Ce.return=ke,ke=Ce;break e}P(ke,Xt);break}else m(ke,Xt);Xt=Xt.sibling}Me.type===O?(Ce=Bf(Me.props.children,ke.mode,ht,Me.key),Ce.return=ke,ke=Ce):(ht=cC(Me.type,Me.key,Me.props,null,ke.mode,ht),ht.ref=Dv(ke,Ce,Me),ht.return=ke,ke=ht)}return Z(ke);case T:e:{for(Xt=Me.key;Ce!==null;){if(Ce.key===Xt)if(Ce.tag===4&&Ce.stateNode.containerInfo===Me.containerInfo&&Ce.stateNode.implementation===Me.implementation){P(ke,Ce.sibling),Ce=j(Ce,Me.children||[]),Ce.return=ke,ke=Ce;break e}else{P(ke,Ce);break}else m(ke,Ce);Ce=Ce.sibling}Ce=Hk(Me,ke.mode,ht),Ce.return=ke,ke=Ce}return Z(ke);case B:return Xt=Me._init,so(ke,Ce,Xt(Me._payload),ht)}if(_e(Me))return Lt(ke,Ce,Me,ht);if(H(Me))return jt(ke,Ce,Me,ht);jS(ke,Me)}return typeof Me=="string"&&Me!==""||typeof Me=="number"?(Me=""+Me,Ce!==null&&Ce.tag===6?(P(ke,Ce.sibling),Ce=j(Ce,Me),Ce.return=ke,ke=Ce):(P(ke,Ce),Ce=Vk(Me,ke.mode,ht),Ce.return=ke,ke=Ce),Z(ke)):P(ke,Ce)}return so}var $h=RH(!0),DH=RH(!1),BS=Zu(null),zS=null,Nh=null,JO=null;function ZO(){JO=Nh=zS=null}function ek(p){var m=BS.current;Tr(BS),p._currentValue=m}function tk(p,m,P){for(;p!==null;){var D=p.alternate;if((p.childLanes&m)!==m?(p.childLanes|=m,D!==null&&(D.childLanes|=m)):D!==null&&(D.childLanes&m)!==m&&(D.childLanes|=m),p===P)break;p=p.return}}function Lh(p,m){zS=p,JO=Nh=null,p=p.dependencies,p!==null&&p.firstContext!==null&&(p.lanes&m&&(ta=!0),p.firstContext=null)}function cs(p){var m=p._currentValue;if(JO!==p)if(p={context:p,memoizedValue:m,next:null},Nh===null){if(zS===null)throw Error(n(308));Nh=p,zS.dependencies={lanes:0,firstContext:p}}else Nh=Nh.next=p;return m}var Df=null;function nk(p){Df===null?Df=[p]:Df.push(p)}function _H(p,m,P,D){var j=m.interleaved;return j===null?(P.next=P,nk(m)):(P.next=j.next,j.next=P),m.interleaved=P,Hc(p,D)}function Hc(p,m){p.lanes|=m;var P=p.alternate;for(P!==null&&(P.lanes|=m),P=p,p=p.return;p!==null;)p.childLanes|=m,P=p.alternate,P!==null&&(P.childLanes|=m),P=p,p=p.return;return P.tag===3?P.stateNode:null}var nd=!1;function rk(p){p.updateQueue={baseState:p.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $H(p,m){p=p.updateQueue,m.updateQueue===p&&(m.updateQueue={baseState:p.baseState,firstBaseUpdate:p.firstBaseUpdate,lastBaseUpdate:p.lastBaseUpdate,shared:p.shared,effects:p.effects})}function Uc(p,m){return{eventTime:p,lane:m,tag:0,payload:null,callback:null,next:null}}function rd(p,m,P){var D=p.updateQueue;if(D===null)return null;if(D=D.shared,Hn&2){var j=D.pending;return j===null?m.next=m:(m.next=j.next,j.next=m),D.pending=m,Hc(p,P)}return j=D.interleaved,j===null?(m.next=m,nk(D)):(m.next=j.next,j.next=m),D.interleaved=m,Hc(p,P)}function VS(p,m,P){if(m=m.updateQueue,m!==null&&(m=m.shared,(P&4194240)!==0)){var D=m.lanes;D&=p.pendingLanes,P|=D,m.lanes=P,yO(p,P)}}function NH(p,m){var P=p.updateQueue,D=p.alternate;if(D!==null&&(D=D.updateQueue,P===D)){var j=null,W=null;if(P=P.firstBaseUpdate,P!==null){do{var Z={eventTime:P.eventTime,lane:P.lane,tag:P.tag,payload:P.payload,callback:P.callback,next:null};W===null?j=W=Z:W=W.next=Z,P=P.next}while(P!==null);W===null?j=W=m:W=W.next=m}else j=W=m;P={baseState:D.baseState,firstBaseUpdate:j,lastBaseUpdate:W,shared:D.shared,effects:D.effects},p.updateQueue=P;return}p=P.lastBaseUpdate,p===null?P.firstBaseUpdate=m:p.next=m,P.lastBaseUpdate=m}function HS(p,m,P,D){var j=p.updateQueue;nd=!1;var W=j.firstBaseUpdate,Z=j.lastBaseUpdate,pe=j.shared.pending;if(pe!==null){j.shared.pending=null;var be=pe,De=be.next;be.next=null,Z===null?W=De:Z.next=De,Z=be;var it=p.alternate;it!==null&&(it=it.updateQueue,pe=it.lastBaseUpdate,pe!==Z&&(pe===null?it.firstBaseUpdate=De:pe.next=De,it.lastBaseUpdate=be))}if(W!==null){var ct=j.baseState;Z=0,it=De=be=null,pe=W;do{var ot=pe.lane,Mt=pe.eventTime;if((D&ot)===ot){it!==null&&(it=it.next={eventTime:Mt,lane:0,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null});e:{var Lt=p,jt=pe;switch(ot=m,Mt=P,jt.tag){case 1:if(Lt=jt.payload,typeof Lt=="function"){ct=Lt.call(Mt,ct,ot);break e}ct=Lt;break e;case 3:Lt.flags=Lt.flags&-65537|128;case 0:if(Lt=jt.payload,ot=typeof Lt=="function"?Lt.call(Mt,ct,ot):Lt,ot==null)break e;ct=K({},ct,ot);break e;case 2:nd=!0}}pe.callback!==null&&pe.lane!==0&&(p.flags|=64,ot=j.effects,ot===null?j.effects=[pe]:ot.push(pe))}else Mt={eventTime:Mt,lane:ot,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null},it===null?(De=it=Mt,be=ct):it=it.next=Mt,Z|=ot;if(pe=pe.next,pe===null){if(pe=j.shared.pending,pe===null)break;ot=pe,pe=ot.next,ot.next=null,j.lastBaseUpdate=ot,j.shared.pending=null}}while(!0);if(it===null&&(be=ct),j.baseState=be,j.firstBaseUpdate=De,j.lastBaseUpdate=it,m=j.shared.interleaved,m!==null){j=m;do Z|=j.lane,j=j.next;while(j!==m)}else W===null&&(j.shared.lanes=0);Nf|=Z,p.lanes=Z,p.memoizedState=ct}}function LH(p,m,P){if(p=m.effects,m.effects=null,p!==null)for(m=0;m<p.length;m++){var D=p[m],j=D.callback;if(j!==null){if(D.callback=null,D=P,typeof j!="function")throw Error(n(191,j));j.call(D)}}}var _v={},Yl=Zu(_v),$v=Zu(_v),Nv=Zu(_v);function _f(p){if(p===_v)throw Error(n(174));return p}function ok(p,m){switch(xr(Nv,m),xr($v,p),xr(Yl,_v),p=m.nodeType,p){case 9:case 11:m=(m=m.documentElement)?m.namespaceURI:Ze(null,"");break;default:p=p===8?m.parentNode:m,m=p.namespaceURI||null,p=p.tagName,m=Ze(m,p)}Tr(Yl),xr(Yl,m)}function Fh(){Tr(Yl),Tr($v),Tr(Nv)}function FH(p){_f(Nv.current);var m=_f(Yl.current),P=Ze(m,p.type);m!==P&&(xr($v,p),xr(Yl,P))}function ik(p){$v.current===p&&(Tr(Yl),Tr($v))}var Br=Zu(0);function US(p){for(var m=p;m!==null;){if(m.tag===13){var P=m.memoizedState;if(P!==null&&(P=P.dehydrated,P===null||P.data==="$?"||P.data==="$!"))return m}else if(m.tag===19&&m.memoizedProps.revealOrder!==void 0){if(m.flags&128)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===p)break;for(;m.sibling===null;){if(m.return===null||m.return===p)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var ak=[];function sk(){for(var p=0;p<ak.length;p++)ak[p]._workInProgressVersionPrimary=null;ak.length=0}var WS=I.ReactCurrentDispatcher,lk=I.ReactCurrentBatchConfig,$f=0,zr=null,Eo=null,jo=null,GS=!1,Lv=!1,Fv=0,Mpe=0;function fi(){throw Error(n(321))}function ck(p,m){if(m===null)return!1;for(var P=0;P<m.length&&P<p.length;P++)if(!el(p[P],m[P]))return!1;return!0}function uk(p,m,P,D,j,W){if($f=W,zr=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,WS.current=p===null||p.memoizedState===null?_pe:$pe,p=P(D,j),Lv){W=0;do{if(Lv=!1,Fv=0,25<=W)throw Error(n(301));W+=1,jo=Eo=null,m.updateQueue=null,WS.current=Npe,p=P(D,j)}while(Lv)}if(WS.current=YS,m=Eo!==null&&Eo.next!==null,$f=0,jo=Eo=zr=null,GS=!1,m)throw Error(n(300));return p}function dk(){var p=Fv!==0;return Fv=0,p}function Ql(){var p={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jo===null?zr.memoizedState=jo=p:jo=jo.next=p,jo}function us(){if(Eo===null){var p=zr.alternate;p=p!==null?p.memoizedState:null}else p=Eo.next;var m=jo===null?zr.memoizedState:jo.next;if(m!==null)jo=m,Eo=p;else{if(p===null)throw Error(n(310));Eo=p,p={memoizedState:Eo.memoizedState,baseState:Eo.baseState,baseQueue:Eo.baseQueue,queue:Eo.queue,next:null},jo===null?zr.memoizedState=jo=p:jo=jo.next=p}return jo}function jv(p,m){return typeof m=="function"?m(p):m}function fk(p){var m=us(),P=m.queue;if(P===null)throw Error(n(311));P.lastRenderedReducer=p;var D=Eo,j=D.baseQueue,W=P.pending;if(W!==null){if(j!==null){var Z=j.next;j.next=W.next,W.next=Z}D.baseQueue=j=W,P.pending=null}if(j!==null){W=j.next,D=D.baseState;var pe=Z=null,be=null,De=W;do{var it=De.lane;if(($f&it)===it)be!==null&&(be=be.next={lane:0,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null}),D=De.hasEagerState?De.eagerState:p(D,De.action);else{var ct={lane:it,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null};be===null?(pe=be=ct,Z=D):be=be.next=ct,zr.lanes|=it,Nf|=it}De=De.next}while(De!==null&&De!==W);be===null?Z=D:be.next=pe,el(D,m.memoizedState)||(ta=!0),m.memoizedState=D,m.baseState=Z,m.baseQueue=be,P.lastRenderedState=D}if(p=P.interleaved,p!==null){j=p;do W=j.lane,zr.lanes|=W,Nf|=W,j=j.next;while(j!==p)}else j===null&&(P.lanes=0);return[m.memoizedState,P.dispatch]}function pk(p){var m=us(),P=m.queue;if(P===null)throw Error(n(311));P.lastRenderedReducer=p;var D=P.dispatch,j=P.pending,W=m.memoizedState;if(j!==null){P.pending=null;var Z=j=j.next;do W=p(W,Z.action),Z=Z.next;while(Z!==j);el(W,m.memoizedState)||(ta=!0),m.memoizedState=W,m.baseQueue===null&&(m.baseState=W),P.lastRenderedState=W}return[W,D]}function jH(){}function BH(p,m){var P=zr,D=us(),j=m(),W=!el(D.memoizedState,j);if(W&&(D.memoizedState=j,ta=!0),D=D.queue,hk(HH.bind(null,P,D,p),[p]),D.getSnapshot!==m||W||jo!==null&&jo.memoizedState.tag&1){if(P.flags|=2048,Bv(9,VH.bind(null,P,D,j,m),void 0,null),Bo===null)throw Error(n(349));$f&30||zH(P,m,j)}return j}function zH(p,m,P){p.flags|=16384,p={getSnapshot:m,value:P},m=zr.updateQueue,m===null?(m={lastEffect:null,stores:null},zr.updateQueue=m,m.stores=[p]):(P=m.stores,P===null?m.stores=[p]:P.push(p))}function VH(p,m,P,D){m.value=P,m.getSnapshot=D,UH(m)&&WH(p)}function HH(p,m,P){return P(function(){UH(m)&&WH(p)})}function UH(p){var m=p.getSnapshot;p=p.value;try{var P=m();return!el(p,P)}catch{return!0}}function WH(p){var m=Hc(p,1);m!==null&&il(m,p,1,-1)}function GH(p){var m=Ql();return typeof p=="function"&&(p=p()),m.memoizedState=m.baseState=p,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:jv,lastRenderedState:p},m.queue=p,p=p.dispatch=Dpe.bind(null,zr,p),[m.memoizedState,p]}function Bv(p,m,P,D){return p={tag:p,create:m,destroy:P,deps:D,next:null},m=zr.updateQueue,m===null?(m={lastEffect:null,stores:null},zr.updateQueue=m,m.lastEffect=p.next=p):(P=m.lastEffect,P===null?m.lastEffect=p.next=p:(D=P.next,P.next=p,p.next=D,m.lastEffect=p)),p}function qH(){return us().memoizedState}function qS(p,m,P,D){var j=Ql();zr.flags|=p,j.memoizedState=Bv(1|m,P,void 0,D===void 0?null:D)}function KS(p,m,P,D){var j=us();D=D===void 0?null:D;var W=void 0;if(Eo!==null){var Z=Eo.memoizedState;if(W=Z.destroy,D!==null&&ck(D,Z.deps)){j.memoizedState=Bv(m,P,W,D);return}}zr.flags|=p,j.memoizedState=Bv(1|m,P,W,D)}function KH(p,m){return qS(8390656,8,p,m)}function hk(p,m){return KS(2048,8,p,m)}function YH(p,m){return KS(4,2,p,m)}function QH(p,m){return KS(4,4,p,m)}function XH(p,m){if(typeof m=="function")return p=p(),m(p),function(){m(null)};if(m!=null)return p=p(),m.current=p,function(){m.current=null}}function JH(p,m,P){return P=P!=null?P.concat([p]):null,KS(4,4,XH.bind(null,m,p),P)}function mk(){}function ZH(p,m){var P=us();m=m===void 0?null:m;var D=P.memoizedState;return D!==null&&m!==null&&ck(m,D[1])?D[0]:(P.memoizedState=[p,m],p)}function e5(p,m){var P=us();m=m===void 0?null:m;var D=P.memoizedState;return D!==null&&m!==null&&ck(m,D[1])?D[0]:(p=p(),P.memoizedState=[p,m],p)}function t5(p,m,P){return $f&21?(el(P,m)||(P=AV(),zr.lanes|=P,Nf|=P,p.baseState=!0),m):(p.baseState&&(p.baseState=!1,ta=!0),p.memoizedState=P)}function Ape(p,m){var P=ur;ur=P!==0&&4>P?P:4,p(!0);var D=lk.transition;lk.transition={};try{p(!1),m()}finally{ur=P,lk.transition=D}}function n5(){return us().memoizedState}function Rpe(p,m,P){var D=sd(p);if(P={lane:D,action:P,hasEagerState:!1,eagerState:null,next:null},r5(p))o5(m,P);else if(P=_H(p,m,P,D),P!==null){var j=Ai();il(P,p,D,j),i5(P,m,D)}}function Dpe(p,m,P){var D=sd(p),j={lane:D,action:P,hasEagerState:!1,eagerState:null,next:null};if(r5(p))o5(m,j);else{var W=p.alternate;if(p.lanes===0&&(W===null||W.lanes===0)&&(W=m.lastRenderedReducer,W!==null))try{var Z=m.lastRenderedState,pe=W(Z,P);if(j.hasEagerState=!0,j.eagerState=pe,el(pe,Z)){var be=m.interleaved;be===null?(j.next=j,nk(m)):(j.next=be.next,be.next=j),m.interleaved=j;return}}catch{}finally{}P=_H(p,m,j,D),P!==null&&(j=Ai(),il(P,p,D,j),i5(P,m,D))}}function r5(p){var m=p.alternate;return p===zr||m!==null&&m===zr}function o5(p,m){Lv=GS=!0;var P=p.pending;P===null?m.next=m:(m.next=P.next,P.next=m),p.pending=m}function i5(p,m,P){if(P&4194240){var D=m.lanes;D&=p.pendingLanes,P|=D,m.lanes=P,yO(p,P)}}var YS={readContext:cs,useCallback:fi,useContext:fi,useEffect:fi,useImperativeHandle:fi,useInsertionEffect:fi,useLayoutEffect:fi,useMemo:fi,useReducer:fi,useRef:fi,useState:fi,useDebugValue:fi,useDeferredValue:fi,useTransition:fi,useMutableSource:fi,useSyncExternalStore:fi,useId:fi,unstable_isNewReconciler:!1},_pe={readContext:cs,useCallback:function(p,m){return Ql().memoizedState=[p,m===void 0?null:m],p},useContext:cs,useEffect:KH,useImperativeHandle:function(p,m,P){return P=P!=null?P.concat([p]):null,qS(4194308,4,XH.bind(null,m,p),P)},useLayoutEffect:function(p,m){return qS(4194308,4,p,m)},useInsertionEffect:function(p,m){return qS(4,2,p,m)},useMemo:function(p,m){var P=Ql();return m=m===void 0?null:m,p=p(),P.memoizedState=[p,m],p},useReducer:function(p,m,P){var D=Ql();return m=P!==void 0?P(m):m,D.memoizedState=D.baseState=m,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:m},D.queue=p,p=p.dispatch=Rpe.bind(null,zr,p),[D.memoizedState,p]},useRef:function(p){var m=Ql();return p={current:p},m.memoizedState=p},useState:GH,useDebugValue:mk,useDeferredValue:function(p){return Ql().memoizedState=p},useTransition:function(){var p=GH(!1),m=p[0];return p=Ape.bind(null,p[1]),Ql().memoizedState=p,[m,p]},useMutableSource:function(){},useSyncExternalStore:function(p,m,P){var D=zr,j=Ql();if(_r){if(P===void 0)throw Error(n(407));P=P()}else{if(P=m(),Bo===null)throw Error(n(349));$f&30||zH(D,m,P)}j.memoizedState=P;var W={value:P,getSnapshot:m};return j.queue=W,KH(HH.bind(null,D,W,p),[p]),D.flags|=2048,Bv(9,VH.bind(null,D,W,P,m),void 0,null),P},useId:function(){var p=Ql(),m=Bo.identifierPrefix;if(_r){var P=Vc,D=zc;P=(D&~(1<<32-Zs(D)-1)).toString(32)+P,m=":"+m+"R"+P,P=Fv++,0<P&&(m+="H"+P.toString(32)),m+=":"}else P=Mpe++,m=":"+m+"r"+P.toString(32)+":";return p.memoizedState=m},unstable_isNewReconciler:!1},$pe={readContext:cs,useCallback:ZH,useContext:cs,useEffect:hk,useImperativeHandle:JH,useInsertionEffect:YH,useLayoutEffect:QH,useMemo:e5,useReducer:fk,useRef:qH,useState:function(){return fk(jv)},useDebugValue:mk,useDeferredValue:function(p){var m=us();return t5(m,Eo.memoizedState,p)},useTransition:function(){var p=fk(jv)[0],m=us().memoizedState;return[p,m]},useMutableSource:jH,useSyncExternalStore:BH,useId:n5,unstable_isNewReconciler:!1},Npe={readContext:cs,useCallback:ZH,useContext:cs,useEffect:hk,useImperativeHandle:JH,useInsertionEffect:YH,useLayoutEffect:QH,useMemo:e5,useReducer:pk,useRef:qH,useState:function(){return pk(jv)},useDebugValue:mk,useDeferredValue:function(p){var m=us();return Eo===null?m.memoizedState=p:t5(m,Eo.memoizedState,p)},useTransition:function(){var p=pk(jv)[0],m=us().memoizedState;return[p,m]},useMutableSource:jH,useSyncExternalStore:BH,useId:n5,unstable_isNewReconciler:!1};function nl(p,m){if(p&&p.defaultProps){m=K({},m),p=p.defaultProps;for(var P in p)m[P]===void 0&&(m[P]=p[P]);return m}return m}function gk(p,m,P,D){m=p.memoizedState,P=P(D,m),P=P==null?m:K({},m,P),p.memoizedState=P,p.lanes===0&&(p.updateQueue.baseState=P)}var QS={isMounted:function(p){return(p=p._reactInternals)?os(p)===p:!1},enqueueSetState:function(p,m,P){p=p._reactInternals;var D=Ai(),j=sd(p),W=Uc(D,j);W.payload=m,P!=null&&(W.callback=P),m=rd(p,W,j),m!==null&&(il(m,p,j,D),VS(m,p,j))},enqueueReplaceState:function(p,m,P){p=p._reactInternals;var D=Ai(),j=sd(p),W=Uc(D,j);W.tag=1,W.payload=m,P!=null&&(W.callback=P),m=rd(p,W,j),m!==null&&(il(m,p,j,D),VS(m,p,j))},enqueueForceUpdate:function(p,m){p=p._reactInternals;var P=Ai(),D=sd(p),j=Uc(P,D);j.tag=2,m!=null&&(j.callback=m),m=rd(p,j,D),m!==null&&(il(m,p,D,P),VS(m,p,D))}};function a5(p,m,P,D,j,W,Z){return p=p.stateNode,typeof p.shouldComponentUpdate=="function"?p.shouldComponentUpdate(D,W,Z):m.prototype&&m.prototype.isPureReactComponent?!Iv(P,D)||!Iv(j,W):!0}function s5(p,m,P){var D=!1,j=ed,W=m.contextType;return typeof W=="object"&&W!==null?W=cs(W):(j=ea(m)?Mf:di.current,D=m.contextTypes,W=(D=D!=null)?Ah(p,j):ed),m=new m(P,W),p.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=QS,p.stateNode=m,m._reactInternals=p,D&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=j,p.__reactInternalMemoizedMaskedChildContext=W),m}function l5(p,m,P,D){p=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(P,D),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(P,D),m.state!==p&&QS.enqueueReplaceState(m,m.state,null)}function yk(p,m,P,D){var j=p.stateNode;j.props=P,j.state=p.memoizedState,j.refs={},rk(p);var W=m.contextType;typeof W=="object"&&W!==null?j.context=cs(W):(W=ea(m)?Mf:di.current,j.context=Ah(p,W)),j.state=p.memoizedState,W=m.getDerivedStateFromProps,typeof W=="function"&&(gk(p,m,W,P),j.state=p.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(m=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),m!==j.state&&QS.enqueueReplaceState(j,j.state,null),HS(p,P,j,D),j.state=p.memoizedState),typeof j.componentDidMount=="function"&&(p.flags|=4194308)}function jh(p,m){try{var P="",D=m;do P+=ee(D),D=D.return;while(D);var j=P}catch(W){j=`+`+j[Z].replace(" at new "," at ");return p.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",p.displayName)),be}while(1<=Z&&0<=pe);break}}}finally{J=!1,Error.prepareStackTrace=P}return(p=p?p.displayName||p.name:"")?Y(p):""}function ee(p){switch(p.tag){case 5:return Y(p.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return p=ie(p.type,!1),p;case 11:return p=ie(p.type.render,!1),p;case 1:return p=ie(p.type,!0),p;default:return""}}function te(p){if(p==null)return null;if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case O:return"Fragment";case T:return"Portal";case k:return"Profiler";case A:return"StrictMode";case L:return"Suspense";case z:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case R:return(p.displayName||"Context")+".Consumer";case M:return(p._context.displayName||"Context")+".Provider";case $:var m=p.render;return p=p.displayName,p||(p=m.displayName||m.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case N:return m=p.displayName||null,m!==null?m:te(p.type)||"Memo";case B:m=p._payload,p=p._init;try{return te(p(m))}catch{}}return null}function ce(p){var m=p.type;switch(p.tag){case 24:return"Cache";case 9:return(m.displayName||"Context")+".Consumer";case 10:return(m._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return p=m.render,p=p.displayName||p.name||"",m.displayName||(p!==""?"ForwardRef("+p+")":"ForwardRef");case 7:return"Fragment";case 5:return m;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return te(m);case 8:return m===A?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m}return null}function ae(p){switch(typeof p){case"boolean":case"number":case"string":case"undefined":return p;case"object":return p;default:return""}}function ne(p){var m=p.type;return(p=p.nodeName)&&p.toLowerCase()==="input"&&(m==="checkbox"||m==="radio")}function ue(p){var m=ne(p)?"checked":"value",P=Object.getOwnPropertyDescriptor(p.constructor.prototype,m),D=""+p[m];if(!p.hasOwnProperty(m)&&typeof P<"u"&&typeof P.get=="function"&&typeof P.set=="function"){var j=P.get,W=P.set;return Object.defineProperty(p,m,{configurable:!0,get:function(){return j.call(this)},set:function(Z){D=""+Z,W.call(this,Z)}}),Object.defineProperty(p,m,{enumerable:P.enumerable}),{getValue:function(){return D},setValue:function(Z){D=""+Z},stopTracking:function(){p._valueTracker=null,delete p[m]}}}}function he(p){p._valueTracker||(p._valueTracker=ue(p))}function re(p){if(!p)return!1;var m=p._valueTracker;if(!m)return!0;var P=m.getValue(),D="";return p&&(D=ne(p)?p.checked?"true":"false":p.value),p=D,p!==P?(m.setValue(p),!0):!1}function le(p){if(p=p||(typeof document<"u"?document:void 0),typeof p>"u")return null;try{return p.activeElement||p.body}catch{return p.body}}function me(p,m){var P=m.checked;return K({},m,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:P??p._wrapperState.initialChecked})}function Se(p,m){var P=m.defaultValue==null?"":m.defaultValue,D=m.checked!=null?m.checked:m.defaultChecked;P=ae(m.value!=null?m.value:P),p._wrapperState={initialChecked:D,initialValue:P,controlled:m.type==="checkbox"||m.type==="radio"?m.checked!=null:m.value!=null}}function Ee(p,m){m=m.checked,m!=null&&C(p,"checked",m,!1)}function ge(p,m){Ee(p,m);var P=ae(m.value),D=m.type;if(P!=null)D==="number"?(P===0&&p.value===""||p.value!=P)&&(p.value=""+P):p.value!==""+P&&(p.value=""+P);else if(D==="submit"||D==="reset"){p.removeAttribute("value");return}m.hasOwnProperty("value")?Pe(p,m.type,P):m.hasOwnProperty("defaultValue")&&Pe(p,m.type,ae(m.defaultValue)),m.checked==null&&m.defaultChecked!=null&&(p.defaultChecked=!!m.defaultChecked)}function xe(p,m,P){if(m.hasOwnProperty("value")||m.hasOwnProperty("defaultValue")){var D=m.type;if(!(D!=="submit"&&D!=="reset"||m.value!==void 0&&m.value!==null))return;m=""+p._wrapperState.initialValue,P||m===p.value||(p.value=m),p.defaultValue=m}P=p.name,P!==""&&(p.name=""),p.defaultChecked=!!p._wrapperState.initialChecked,P!==""&&(p.name=P)}function Pe(p,m,P){(m!=="number"||le(p.ownerDocument)!==p)&&(P==null?p.defaultValue=""+p._wrapperState.initialValue:p.defaultValue!==""+P&&(p.defaultValue=""+P))}var _e=Array.isArray;function Le(p,m,P,D){if(p=p.options,m){m={};for(var j=0;j<P.length;j++)m["$"+P[j]]=!0;for(P=0;P<p.length;P++)j=m.hasOwnProperty("$"+p[P].value),p[P].selected!==j&&(p[P].selected=j),j&&D&&(p[P].defaultSelected=!0)}else{for(P=""+ae(P),m=null,j=0;j<p.length;j++){if(p[j].value===P){p[j].selected=!0,D&&(p[j].defaultSelected=!0);return}m!==null||p[j].disabled||(m=p[j])}m!==null&&(m.selected=!0)}}function de(p,m){if(m.dangerouslySetInnerHTML!=null)throw Error(n(91));return K({},m,{value:void 0,defaultValue:void 0,children:""+p._wrapperState.initialValue})}function $e(p,m){var P=m.value;if(P==null){if(P=m.children,m=m.defaultValue,P!=null){if(m!=null)throw Error(n(92));if(_e(P)){if(1<P.length)throw Error(n(93));P=P[0]}m=P}m==null&&(m=""),P=m}p._wrapperState={initialValue:ae(P)}}function Ae(p,m){var P=ae(m.value),D=ae(m.defaultValue);P!=null&&(P=""+P,P!==p.value&&(p.value=P),m.defaultValue==null&&p.defaultValue!==P&&(p.defaultValue=P)),D!=null&&(p.defaultValue=""+D)}function Ne(p){var m=p.textContent;m===p._wrapperState.initialValue&&m!==""&&m!==null&&(p.value=m)}function Ue(p){switch(p){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ze(p,m){return p==null||p==="http://www.w3.org/1999/xhtml"?Ue(m):p==="http://www.w3.org/2000/svg"&&m==="foreignObject"?"http://www.w3.org/1999/xhtml":p}var ut,Ye=function(p){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(m,P,D,j){MSApp.execUnsafeLocalFunction(function(){return p(m,P,D,j)})}:p}(function(p,m){if(p.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in p)p.innerHTML=m;else{for(ut=ut||document.createElement("div"),ut.innerHTML="<svg>"+m.valueOf().toString()+"</svg>",m=ut.firstChild;p.firstChild;)p.removeChild(p.firstChild);for(;m.firstChild;)p.appendChild(m.firstChild)}});function et(p,m){if(m){var P=p.firstChild;if(P&&P===p.lastChild&&P.nodeType===3){P.nodeValue=m;return}}p.textContent=m}var Xe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},mt=["Webkit","ms","Moz","O"];Object.keys(Xe).forEach(function(p){mt.forEach(function(m){m=m+p.charAt(0).toUpperCase()+p.substring(1),Xe[m]=Xe[p]})});function At(p,m,P){return m==null||typeof m=="boolean"||m===""?"":P||typeof m!="number"||m===0||Xe.hasOwnProperty(p)&&Xe[p]?(""+m).trim():m+"px"}function Bt(p,m){p=p.style;for(var P in m)if(m.hasOwnProperty(P)){var D=P.indexOf("--")===0,j=At(P,m[P],D);P==="float"&&(P="cssFloat"),D?p.setProperty(P,j):p[P]=j}}var gt=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vt(p,m){if(m){if(gt[p]&&(m.children!=null||m.dangerouslySetInnerHTML!=null))throw Error(n(137,p));if(m.dangerouslySetInnerHTML!=null){if(m.children!=null)throw Error(n(60));if(typeof m.dangerouslySetInnerHTML!="object"||!("__html"in m.dangerouslySetInnerHTML))throw Error(n(61))}if(m.style!=null&&typeof m.style!="object")throw Error(n(62))}}function Mn(p,m){if(p.indexOf("-")===-1)return typeof m.is=="string";switch(p){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nr=null;function un(p){return p=p.target||p.srcElement||window,p.correspondingUseElement&&(p=p.correspondingUseElement),p.nodeType===3?p.parentNode:p}var jn=null,dr=null,Bn=null;function Fo(p){if(p=Rv(p)){if(typeof jn!="function")throw Error(n(280));var m=p.stateNode;m&&(m=RS(m),jn(p.stateNode,p.type,m))}}function Yr(p){dr?Bn?Bn.push(p):Bn=[p]:dr=p}function Yi(){if(dr){var p=dr,m=Bn;if(Bn=dr=null,Fo(p),m)for(p=0;p<m.length;p++)Fo(m[p])}}function Qi(p,m){return p(m)}function qt(){}var Dr=!1;function Tt(p,m,P){if(Dr)return p(m,P);Dr=!0;try{return Qi(p,m,P)}finally{Dr=!1,(dr!==null||Bn!==null)&&(qt(),Yi())}}function Ot(p,m){var P=p.stateNode;if(P===null)return null;var D=RS(P);if(D===null)return null;P=D[m];e:switch(m){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(D=!D.disabled)||(p=p.type,D=!(p==="button"||p==="input"||p==="select"||p==="textarea")),p=!D;break e;default:p=!1}if(p)return null;if(P&&typeof P!="function")throw Error(n(231,m,typeof P));return P}var gn=!1;if(s)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){gn=!0}}),window.addEventListener("test",mn,mn),window.removeEventListener("test",mn,mn)}catch{gn=!1}function fr(p,m,P,D,j,W,Z,pe,be){var De=Array.prototype.slice.call(arguments,3);try{m.apply(P,De)}catch(it){this.onError(it)}}var ho=!1,ui=null,Xi=!1,ns=null,Qr={onError:function(p){ho=!0,ui=p}};function mo(p,m,P,D,j,W,Z,pe,be){ho=!1,ui=null,fr.apply(Qr,arguments)}function rs(p,m,P,D,j,W,Z,pe,be){if(mo.apply(this,arguments),ho){if(ho){var De=ui;ho=!1,ui=null}else throw Error(n(198));Xi||(Xi=!0,ns=De)}}function os(p){var m=p,P=p;if(p.alternate)for(;m.return;)m=m.return;else{p=m;do m=p,m.flags&4098&&(P=m.return),p=m.return;while(p)}return m.tag===3?P:null}function qe(p){if(p.tag===13){var m=p.memoizedState;if(m===null&&(p=p.alternate,p!==null&&(m=p.memoizedState)),m!==null)return m.dehydrated}return null}function Ve(p){if(os(p)!==p)throw Error(n(188))}function Dt(p){var m=p.alternate;if(!m){if(m=os(p),m===null)throw Error(n(188));return m!==p?null:p}for(var P=p,D=m;;){var j=P.return;if(j===null)break;var W=j.alternate;if(W===null){if(D=j.return,D!==null){P=D;continue}break}if(j.child===W.child){for(W=j.child;W;){if(W===P)return Ve(j),p;if(W===D)return Ve(j),m;W=W.sibling}throw Error(n(188))}if(P.return!==D.return)P=j,D=W;else{for(var Z=!1,pe=j.child;pe;){if(pe===P){Z=!0,P=j,D=W;break}if(pe===D){Z=!0,D=j,P=W;break}pe=pe.sibling}if(!Z){for(pe=W.child;pe;){if(pe===P){Z=!0,P=W,D=j;break}if(pe===D){Z=!0,D=W,P=j;break}pe=pe.sibling}if(!Z)throw Error(n(189))}}if(P.alternate!==D)throw Error(n(190))}if(P.tag!==3)throw Error(n(188));return P.stateNode.current===P?p:m}function fn(p){return p=Dt(p),p!==null?Tn(p):null}function Tn(p){if(p.tag===5||p.tag===6)return p;for(p=p.child;p!==null;){var m=Tn(p);if(m!==null)return m;p=p.sibling}return null}var rr=t.unstable_scheduleCallback,Fr=t.unstable_cancelCallback,Ji=t.unstable_shouldYield,pv=t.unstable_requestPaint,jr=t.unstable_now,pS=t.unstable_getCurrentPriorityLevel,Wu=t.unstable_ImmediatePriority,Of=t.unstable_UserBlockingPriority,$n=t.unstable_NormalPriority,is=t.unstable_LowPriority,Js=t.unstable_IdlePriority,ql=null,as=null;function Efe(p){if(as&&typeof as.onCommitFiberRoot=="function")try{as.onCommitFiberRoot(ql,p,void 0,(p.current.flags&128)===128)}catch{}}var Zs=Math.clz32?Math.clz32:Tfe,Pfe=Math.log,Ife=Math.LN2;function Tfe(p){return p>>>=0,p===0?32:31-(Pfe(p)/Ife|0)|0}var hS=64,mS=4194304;function hv(p){switch(p&-p){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function gS(p,m){var P=p.pendingLanes;if(P===0)return 0;var D=0,j=p.suspendedLanes,W=p.pingedLanes,Z=P&268435455;if(Z!==0){var pe=Z&~j;pe!==0?D=hv(pe):(W&=Z,W!==0&&(D=hv(W)))}else Z=P&~j,Z!==0?D=hv(Z):W!==0&&(D=hv(W));if(D===0)return 0;if(m!==0&&m!==D&&!(m&j)&&(j=D&-D,W=m&-m,j>=W||j===16&&(W&4194240)!==0))return m;if(D&4&&(D|=P&16),m=p.entangledLanes,m!==0)for(p=p.entanglements,m&=D;0<m;)P=31-Zs(m),j=1<<P,D|=p[P],m&=~j;return D}function Ofe(p,m){switch(p){case 1:case 2:case 4:return m+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return m+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kfe(p,m){for(var P=p.suspendedLanes,D=p.pingedLanes,j=p.expirationTimes,W=p.pendingLanes;0<W;){var Z=31-Zs(W),pe=1<<Z,be=j[Z];be===-1?(!(pe&P)||pe&D)&&(j[Z]=Ofe(pe,m)):be<=m&&(p.expiredLanes|=pe),W&=~pe}}function mO(p){return p=p.pendingLanes&-1073741825,p!==0?p:p&1073741824?1073741824:0}function AV(){var p=hS;return hS<<=1,!(hS&4194240)&&(hS=64),p}function gO(p){for(var m=[],P=0;31>P;P++)m.push(p);return m}function mv(p,m,P){p.pendingLanes|=m,m!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,m=31-Zs(m),p[m]=P}function Mfe(p,m){var P=p.pendingLanes&~m;p.pendingLanes=m,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=m,p.mutableReadLanes&=m,p.entangledLanes&=m,m=p.entanglements;var D=p.eventTimes;for(p=p.expirationTimes;0<P;){var j=31-Zs(P),W=1<<j;m[j]=0,D[j]=-1,p[j]=-1,P&=~W}}function yO(p,m){var P=p.entangledLanes|=m;for(p=p.entanglements;P;){var D=31-Zs(P),j=1<<D;j&m|p[D]&m&&(p[D]|=m),P&=~j}}var ur=0;function RV(p){return p&=-p,1<p?4<p?p&268435455?16:536870912:4:1}var DV,vO,_V,$V,NV,bO=!1,yS=[],Gu=null,qu=null,Ku=null,gv=new Map,yv=new Map,Yu=[],Afe="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function LV(p,m){switch(p){case"focusin":case"focusout":Gu=null;break;case"dragenter":case"dragleave":qu=null;break;case"mouseover":case"mouseout":Ku=null;break;case"pointerover":case"pointerout":gv.delete(m.pointerId);break;case"gotpointercapture":case"lostpointercapture":yv.delete(m.pointerId)}}function vv(p,m,P,D,j,W){return p===null||p.nativeEvent!==W?(p={blockedOn:m,domEventName:P,eventSystemFlags:D,nativeEvent:W,targetContainers:[j]},m!==null&&(m=Rv(m),m!==null&&vO(m)),p):(p.eventSystemFlags|=D,m=p.targetContainers,j!==null&&m.indexOf(j)===-1&&m.push(j),p)}function Rfe(p,m,P,D,j){switch(m){case"focusin":return Gu=vv(Gu,p,m,P,D,j),!0;case"dragenter":return qu=vv(qu,p,m,P,D,j),!0;case"mouseover":return Ku=vv(Ku,p,m,P,D,j),!0;case"pointerover":var W=j.pointerId;return gv.set(W,vv(gv.get(W)||null,p,m,P,D,j)),!0;case"gotpointercapture":return W=j.pointerId,yv.set(W,vv(yv.get(W)||null,p,m,P,D,j)),!0}return!1}function FV(p){var m=kf(p.target);if(m!==null){var P=os(m);if(P!==null){if(m=P.tag,m===13){if(m=qe(P),m!==null){p.blockedOn=m,NV(p.priority,function(){_V(P)});return}}else if(m===3&&P.stateNode.current.memoizedState.isDehydrated){p.blockedOn=P.tag===3?P.stateNode.containerInfo:null;return}}}p.blockedOn=null}function vS(p){if(p.blockedOn!==null)return!1;for(var m=p.targetContainers;0<m.length;){var P=xO(p.domEventName,p.eventSystemFlags,m[0],p.nativeEvent);if(P===null){P=p.nativeEvent;var D=new P.constructor(P.type,P);nr=D,P.target.dispatchEvent(D),nr=null}else return m=Rv(P),m!==null&&vO(m),p.blockedOn=P,!1;m.shift()}return!0}function jV(p,m,P){vS(p)&&P.delete(m)}function Dfe(){bO=!1,Gu!==null&&vS(Gu)&&(Gu=null),qu!==null&&vS(qu)&&(qu=null),Ku!==null&&vS(Ku)&&(Ku=null),gv.forEach(jV),yv.forEach(jV)}function bv(p,m){p.blockedOn===m&&(p.blockedOn=null,bO||(bO=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Dfe)))}function wv(p){function m(j){return bv(j,p)}if(0<yS.length){bv(yS[0],p);for(var P=1;P<yS.length;P++){var D=yS[P];D.blockedOn===p&&(D.blockedOn=null)}}for(Gu!==null&&bv(Gu,p),qu!==null&&bv(qu,p),Ku!==null&&bv(Ku,p),gv.forEach(m),yv.forEach(m),P=0;P<Yu.length;P++)D=Yu[P],D.blockedOn===p&&(D.blockedOn=null);for(;0<Yu.length&&(P=Yu[0],P.blockedOn===null);)FV(P),P.blockedOn===null&&Yu.shift()}var Sh=I.ReactCurrentBatchConfig,bS=!0;function _fe(p,m,P,D){var j=ur,W=Sh.transition;Sh.transition=null;try{ur=1,wO(p,m,P,D)}finally{ur=j,Sh.transition=W}}function $fe(p,m,P,D){var j=ur,W=Sh.transition;Sh.transition=null;try{ur=4,wO(p,m,P,D)}finally{ur=j,Sh.transition=W}}function wO(p,m,P,D){if(bS){var j=xO(p,m,P,D);if(j===null)FO(p,m,D,wS,P),LV(p,D);else if(Rfe(j,p,m,P,D))D.stopPropagation();else if(LV(p,D),m&4&&-1<Afe.indexOf(p)){for(;j!==null;){var W=Rv(j);if(W!==null&&DV(W),W=xO(p,m,P,D),W===null&&FO(p,m,D,wS,P),W===j)break;j=W}j!==null&&D.stopPropagation()}else FO(p,m,D,null,P)}}var wS=null;function xO(p,m,P,D){if(wS=null,p=un(D),p=kf(p),p!==null)if(m=os(p),m===null)p=null;else if(P=m.tag,P===13){if(p=qe(m),p!==null)return p;p=null}else if(P===3){if(m.stateNode.current.memoizedState.isDehydrated)return m.tag===3?m.stateNode.containerInfo:null;p=null}else m!==p&&(p=null);return wS=p,null}function BV(p){switch(p){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pS()){case Wu:return 1;case Of:return 4;case $n:case is:return 16;case Js:return 536870912;default:return 16}default:return 16}}var Qu=null,SO=null,xS=null;function zV(){if(xS)return xS;var p,m=SO,P=m.length,D,j="value"in Qu?Qu.value:Qu.textContent,W=j.length;for(p=0;p<P&&m[p]===j[p];p++);var Z=P-p;for(D=1;D<=Z&&m[P-D]===j[W-D];D++);return xS=j.slice(p,1<D?1-D:void 0)}function SS(p){var m=p.keyCode;return"charCode"in p?(p=p.charCode,p===0&&m===13&&(p=13)):p=m,p===10&&(p=13),32<=p||p===13?p:0}function CS(){return!0}function VV(){return!1}function Ia(p){function m(P,D,j,W,Z){this._reactName=P,this._targetInst=j,this.type=D,this.nativeEvent=W,this.target=Z,this.currentTarget=null;for(var pe in p)p.hasOwnProperty(pe)&&(P=p[pe],this[pe]=P?P(W):W[pe]);return this.isDefaultPrevented=(W.defaultPrevented!=null?W.defaultPrevented:W.returnValue===!1)?CS:VV,this.isPropagationStopped=VV,this}return K(m.prototype,{preventDefault:function(){this.defaultPrevented=!0;var P=this.nativeEvent;P&&(P.preventDefault?P.preventDefault():typeof P.returnValue!="unknown"&&(P.returnValue=!1),this.isDefaultPrevented=CS)},stopPropagation:function(){var P=this.nativeEvent;P&&(P.stopPropagation?P.stopPropagation():typeof P.cancelBubble!="unknown"&&(P.cancelBubble=!0),this.isPropagationStopped=CS)},persist:function(){},isPersistent:CS}),m}var Ch={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(p){return p.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},CO=Ia(Ch),xv=K({},Ch,{view:0,detail:0}),Nfe=Ia(xv),EO,PO,Sv,ES=K({},xv,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:TO,button:0,buttons:0,relatedTarget:function(p){return p.relatedTarget===void 0?p.fromElement===p.srcElement?p.toElement:p.fromElement:p.relatedTarget},movementX:function(p){return"movementX"in p?p.movementX:(p!==Sv&&(Sv&&p.type==="mousemove"?(EO=p.screenX-Sv.screenX,PO=p.screenY-Sv.screenY):PO=EO=0,Sv=p),EO)},movementY:function(p){return"movementY"in p?p.movementY:PO}}),HV=Ia(ES),Lfe=K({},ES,{dataTransfer:0}),Ffe=Ia(Lfe),jfe=K({},xv,{relatedTarget:0}),IO=Ia(jfe),Bfe=K({},Ch,{animationName:0,elapsedTime:0,pseudoElement:0}),zfe=Ia(Bfe),Vfe=K({},Ch,{clipboardData:function(p){return"clipboardData"in p?p.clipboardData:window.clipboardData}}),Hfe=Ia(Vfe),Ufe=K({},Ch,{data:0}),UV=Ia(Ufe),Wfe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gfe={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},qfe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kfe(p){var m=this.nativeEvent;return m.getModifierState?m.getModifierState(p):(p=qfe[p])?!!m[p]:!1}function TO(){return Kfe}var Yfe=K({},xv,{key:function(p){if(p.key){var m=Wfe[p.key]||p.key;if(m!=="Unidentified")return m}return p.type==="keypress"?(p=SS(p),p===13?"Enter":String.fromCharCode(p)):p.type==="keydown"||p.type==="keyup"?Gfe[p.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:TO,charCode:function(p){return p.type==="keypress"?SS(p):0},keyCode:function(p){return p.type==="keydown"||p.type==="keyup"?p.keyCode:0},which:function(p){return p.type==="keypress"?SS(p):p.type==="keydown"||p.type==="keyup"?p.keyCode:0}}),Qfe=Ia(Yfe),Xfe=K({},ES,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),WV=Ia(Xfe),Jfe=K({},xv,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:TO}),Zfe=Ia(Jfe),epe=K({},Ch,{propertyName:0,elapsedTime:0,pseudoElement:0}),tpe=Ia(epe),npe=K({},ES,{deltaX:function(p){return"deltaX"in p?p.deltaX:"wheelDeltaX"in p?-p.wheelDeltaX:0},deltaY:function(p){return"deltaY"in p?p.deltaY:"wheelDeltaY"in p?-p.wheelDeltaY:"wheelDelta"in p?-p.wheelDelta:0},deltaZ:0,deltaMode:0}),rpe=Ia(npe),ope=[9,13,27,32],OO=s&&"CompositionEvent"in window,Cv=null;s&&"documentMode"in document&&(Cv=document.documentMode);var ipe=s&&"TextEvent"in window&&!Cv,GV=s&&(!OO||Cv&&8<Cv&&11>=Cv),qV=" ",KV=!1;function YV(p,m){switch(p){case"keyup":return ope.indexOf(m.keyCode)!==-1;case"keydown":return m.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QV(p){return p=p.detail,typeof p=="object"&&"data"in p?p.data:null}var Eh=!1;function ape(p,m){switch(p){case"compositionend":return QV(m);case"keypress":return m.which!==32?null:(KV=!0,qV);case"textInput":return p=m.data,p===qV&&KV?null:p;default:return null}}function spe(p,m){if(Eh)return p==="compositionend"||!OO&&YV(p,m)?(p=zV(),xS=SO=Qu=null,Eh=!1,p):null;switch(p){case"paste":return null;case"keypress":if(!(m.ctrlKey||m.altKey||m.metaKey)||m.ctrlKey&&m.altKey){if(m.char&&1<m.char.length)return m.char;if(m.which)return String.fromCharCode(m.which)}return null;case"compositionend":return GV&&m.locale!=="ko"?null:m.data;default:return null}}var lpe={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function XV(p){var m=p&&p.nodeName&&p.nodeName.toLowerCase();return m==="input"?!!lpe[p.type]:m==="textarea"}function JV(p,m,P,D){Yr(D),m=kS(m,"onChange"),0<m.length&&(P=new CO("onChange","change",null,P,D),p.push({event:P,listeners:m}))}var Ev=null,Pv=null;function cpe(p){gH(p,0)}function PS(p){var m=kh(p);if(re(m))return p}function upe(p,m){if(p==="change")return m}var ZV=!1;if(s){var kO;if(s){var MO="oninput"in document;if(!MO){var eH=document.createElement("div");eH.setAttribute("oninput","return;"),MO=typeof eH.oninput=="function"}kO=MO}else kO=!1;ZV=kO&&(!document.documentMode||9<document.documentMode)}function tH(){Ev&&(Ev.detachEvent("onpropertychange",nH),Pv=Ev=null)}function nH(p){if(p.propertyName==="value"&&PS(Pv)){var m=[];JV(m,Pv,p,un(p)),Tt(cpe,m)}}function dpe(p,m,P){p==="focusin"?(tH(),Ev=m,Pv=P,Ev.attachEvent("onpropertychange",nH)):p==="focusout"&&tH()}function fpe(p){if(p==="selectionchange"||p==="keyup"||p==="keydown")return PS(Pv)}function ppe(p,m){if(p==="click")return PS(m)}function hpe(p,m){if(p==="input"||p==="change")return PS(m)}function mpe(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var el=typeof Object.is=="function"?Object.is:mpe;function Iv(p,m){if(el(p,m))return!0;if(typeof p!="object"||p===null||typeof m!="object"||m===null)return!1;var P=Object.keys(p),D=Object.keys(m);if(P.length!==D.length)return!1;for(D=0;D<P.length;D++){var j=P[D];if(!l.call(m,j)||!el(p[j],m[j]))return!1}return!0}function rH(p){for(;p&&p.firstChild;)p=p.firstChild;return p}function oH(p,m){var P=rH(p);p=0;for(var D;P;){if(P.nodeType===3){if(D=p+P.textContent.length,p<=m&&D>=m)return{node:P,offset:m-p};p=D}e:{for(;P;){if(P.nextSibling){P=P.nextSibling;break e}P=P.parentNode}P=void 0}P=rH(P)}}function iH(p,m){return p&&m?p===m?!0:p&&p.nodeType===3?!1:m&&m.nodeType===3?iH(p,m.parentNode):"contains"in p?p.contains(m):p.compareDocumentPosition?!!(p.compareDocumentPosition(m)&16):!1:!1}function aH(){for(var p=window,m=le();m instanceof p.HTMLIFrameElement;){try{var P=typeof m.contentWindow.location.href=="string"}catch{P=!1}if(P)p=m.contentWindow;else break;m=le(p.document)}return m}function AO(p){var m=p&&p.nodeName&&p.nodeName.toLowerCase();return m&&(m==="input"&&(p.type==="text"||p.type==="search"||p.type==="tel"||p.type==="url"||p.type==="password")||m==="textarea"||p.contentEditable==="true")}function gpe(p){var m=aH(),P=p.focusedElem,D=p.selectionRange;if(m!==P&&P&&P.ownerDocument&&iH(P.ownerDocument.documentElement,P)){if(D!==null&&AO(P)){if(m=D.start,p=D.end,p===void 0&&(p=m),"selectionStart"in P)P.selectionStart=m,P.selectionEnd=Math.min(p,P.value.length);else if(p=(m=P.ownerDocument||document)&&m.defaultView||window,p.getSelection){p=p.getSelection();var j=P.textContent.length,W=Math.min(D.start,j);D=D.end===void 0?W:Math.min(D.end,j),!p.extend&&W>D&&(j=D,D=W,W=j),j=oH(P,W);var Z=oH(P,D);j&&Z&&(p.rangeCount!==1||p.anchorNode!==j.node||p.anchorOffset!==j.offset||p.focusNode!==Z.node||p.focusOffset!==Z.offset)&&(m=m.createRange(),m.setStart(j.node,j.offset),p.removeAllRanges(),W>D?(p.addRange(m),p.extend(Z.node,Z.offset)):(m.setEnd(Z.node,Z.offset),p.addRange(m)))}}for(m=[],p=P;p=p.parentNode;)p.nodeType===1&&m.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<m.length;P++)p=m[P],p.element.scrollLeft=p.left,p.element.scrollTop=p.top}}var ype=s&&"documentMode"in document&&11>=document.documentMode,Ph=null,RO=null,Tv=null,DO=!1;function sH(p,m,P){var D=P.window===P?P.document:P.nodeType===9?P:P.ownerDocument;DO||Ph==null||Ph!==le(D)||(D=Ph,"selectionStart"in D&&AO(D)?D={start:D.selectionStart,end:D.selectionEnd}:(D=(D.ownerDocument&&D.ownerDocument.defaultView||window).getSelection(),D={anchorNode:D.anchorNode,anchorOffset:D.anchorOffset,focusNode:D.focusNode,focusOffset:D.focusOffset}),Tv&&Iv(Tv,D)||(Tv=D,D=kS(RO,"onSelect"),0<D.length&&(m=new CO("onSelect","select",null,m,P),p.push({event:m,listeners:D}),m.target=Ph)))}function IS(p,m){var P={};return P[p.toLowerCase()]=m.toLowerCase(),P["Webkit"+p]="webkit"+m,P["Moz"+p]="moz"+m,P}var Ih={animationend:IS("Animation","AnimationEnd"),animationiteration:IS("Animation","AnimationIteration"),animationstart:IS("Animation","AnimationStart"),transitionend:IS("Transition","TransitionEnd")},_O={},lH={};s&&(lH=document.createElement("div").style,"AnimationEvent"in window||(delete Ih.animationend.animation,delete Ih.animationiteration.animation,delete Ih.animationstart.animation),"TransitionEvent"in window||delete Ih.transitionend.transition);function TS(p){if(_O[p])return _O[p];if(!Ih[p])return p;var m=Ih[p],P;for(P in m)if(m.hasOwnProperty(P)&&P in lH)return _O[p]=m[P];return p}var cH=TS("animationend"),uH=TS("animationiteration"),dH=TS("animationstart"),fH=TS("transitionend"),pH=new Map,hH="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Xu(p,m){pH.set(p,m),i(m,[p])}for(var $O=0;$O<hH.length;$O++){var NO=hH[$O],vpe=NO.toLowerCase(),bpe=NO[0].toUpperCase()+NO.slice(1);Xu(vpe,"on"+bpe)}Xu(cH,"onAnimationEnd"),Xu(uH,"onAnimationIteration"),Xu(dH,"onAnimationStart"),Xu("dblclick","onDoubleClick"),Xu("focusin","onFocus"),Xu("focusout","onBlur"),Xu(fH,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ov="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wpe=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ov));function mH(p,m,P){var D=p.type||"unknown-event";p.currentTarget=P,rs(D,m,void 0,p),p.currentTarget=null}function gH(p,m){m=(m&4)!==0;for(var P=0;P<p.length;P++){var D=p[P],j=D.event;D=D.listeners;e:{var W=void 0;if(m)for(var Z=D.length-1;0<=Z;Z--){var pe=D[Z],be=pe.instance,De=pe.currentTarget;if(pe=pe.listener,be!==W&&j.isPropagationStopped())break e;mH(j,pe,De),W=be}else for(Z=0;Z<D.length;Z++){if(pe=D[Z],be=pe.instance,De=pe.currentTarget,pe=pe.listener,be!==W&&j.isPropagationStopped())break e;mH(j,pe,De),W=be}}}if(Xi)throw p=ns,Xi=!1,ns=null,p}function Ir(p,m){var P=m[UO];P===void 0&&(P=m[UO]=new Set);var D=p+"__bubble";P.has(D)||(yH(m,p,2,!1),P.add(D))}function LO(p,m,P){var D=0;m&&(D|=4),yH(P,p,D,m)}var OS="_reactListening"+Math.random().toString(36).slice(2);function kv(p){if(!p[OS]){p[OS]=!0,r.forEach(function(P){P!=="selectionchange"&&(wpe.has(P)||LO(P,!1,p),LO(P,!0,p))});var m=p.nodeType===9?p:p.ownerDocument;m===null||m[OS]||(m[OS]=!0,LO("selectionchange",!1,m))}}function yH(p,m,P,D){switch(BV(m)){case 1:var j=_fe;break;case 4:j=$fe;break;default:j=wO}P=j.bind(null,m,P,p),j=void 0,!gn||m!=="touchstart"&&m!=="touchmove"&&m!=="wheel"||(j=!0),D?j!==void 0?p.addEventListener(m,P,{capture:!0,passive:j}):p.addEventListener(m,P,!0):j!==void 0?p.addEventListener(m,P,{passive:j}):p.addEventListener(m,P,!1)}function FO(p,m,P,D,j){var W=D;if(!(m&1)&&!(m&2)&&D!==null)e:for(;;){if(D===null)return;var Z=D.tag;if(Z===3||Z===4){var pe=D.stateNode.containerInfo;if(pe===j||pe.nodeType===8&&pe.parentNode===j)break;if(Z===4)for(Z=D.return;Z!==null;){var be=Z.tag;if((be===3||be===4)&&(be=Z.stateNode.containerInfo,be===j||be.nodeType===8&&be.parentNode===j))return;Z=Z.return}for(;pe!==null;){if(Z=kf(pe),Z===null)return;if(be=Z.tag,be===5||be===6){D=W=Z;continue e}pe=pe.parentNode}}D=D.return}Tt(function(){var De=W,it=un(P),ct=[];e:{var ot=pH.get(p);if(ot!==void 0){var Mt=CO,Lt=p;switch(p){case"keypress":if(SS(P)===0)break e;case"keydown":case"keyup":Mt=Qfe;break;case"focusin":Lt="focus",Mt=IO;break;case"focusout":Lt="blur",Mt=IO;break;case"beforeblur":case"afterblur":Mt=IO;break;case"click":if(P.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Mt=HV;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Mt=Ffe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Mt=Zfe;break;case cH:case uH:case dH:Mt=zfe;break;case fH:Mt=tpe;break;case"scroll":Mt=Nfe;break;case"wheel":Mt=rpe;break;case"copy":case"cut":case"paste":Mt=Hfe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Mt=WV}var jt=(m&4)!==0,ao=!jt&&p==="scroll",ke=jt?ot!==null?ot+"Capture":null:ot;jt=[];for(var Ce=De,Me;Ce!==null;){Me=Ce;var ht=Me.stateNode;if(Me.tag===5&&ht!==null&&(Me=ht,ke!==null&&(ht=Ot(Ce,ke),ht!=null&&jt.push(Mv(Ce,ht,Me)))),ao)break;Ce=Ce.return}0<jt.length&&(ot=new Mt(ot,Lt,null,P,it),ct.push({event:ot,listeners:jt}))}}if(!(m&7)){e:{if(ot=p==="mouseover"||p==="pointerover",Mt=p==="mouseout"||p==="pointerout",ot&&P!==nr&&(Lt=P.relatedTarget||P.fromElement)&&(kf(Lt)||Lt[jc]))break e;if((Mt||ot)&&(ot=it.window===it?it:(ot=it.ownerDocument)?ot.defaultView||ot.parentWindow:window,Mt?(Lt=P.relatedTarget||P.toElement,Mt=De,Lt=Lt?kf(Lt):null,Lt!==null&&(ao=os(Lt),Lt!==ao||Lt.tag!==5&&Lt.tag!==6)&&(Lt=null)):(Mt=null,Lt=De),Mt!==Lt)){if(jt=HV,ht="onMouseLeave",ke="onMouseEnter",Ce="mouse",(p==="pointerout"||p==="pointerover")&&(jt=WV,ht="onPointerLeave",ke="onPointerEnter",Ce="pointer"),ao=Mt==null?ot:kh(Mt),Me=Lt==null?ot:kh(Lt),ot=new jt(ht,Ce+"leave",Mt,P,it),ot.target=ao,ot.relatedTarget=Me,ht=null,kf(it)===De&&(jt=new jt(ke,Ce+"enter",Lt,P,it),jt.target=Me,jt.relatedTarget=ao,ht=jt),ao=ht,Mt&&Lt)t:{for(jt=Mt,ke=Lt,Ce=0,Me=jt;Me;Me=Th(Me))Ce++;for(Me=0,ht=ke;ht;ht=Th(ht))Me++;for(;0<Ce-Me;)jt=Th(jt),Ce--;for(;0<Me-Ce;)ke=Th(ke),Me--;for(;Ce--;){if(jt===ke||ke!==null&&jt===ke.alternate)break t;jt=Th(jt),ke=Th(ke)}jt=null}else jt=null;Mt!==null&&vH(ct,ot,Mt,jt,!1),Lt!==null&&ao!==null&&vH(ct,ao,Lt,jt,!0)}}e:{if(ot=De?kh(De):window,Mt=ot.nodeName&&ot.nodeName.toLowerCase(),Mt==="select"||Mt==="input"&&ot.type==="file")var Ht=upe;else if(XV(ot))if(ZV)Ht=hpe;else{Ht=fpe;var Xt=dpe}else(Mt=ot.nodeName)&&Mt.toLowerCase()==="input"&&(ot.type==="checkbox"||ot.type==="radio")&&(Ht=ppe);if(Ht&&(Ht=Ht(p,De))){JV(ct,Ht,P,it);break e}Xt&&Xt(p,ot,De),p==="focusout"&&(Xt=ot._wrapperState)&&Xt.controlled&&ot.type==="number"&&Pe(ot,"number",ot.value)}switch(Xt=De?kh(De):window,p){case"focusin":(XV(Xt)||Xt.contentEditable==="true")&&(Ph=Xt,RO=De,Tv=null);break;case"focusout":Tv=RO=Ph=null;break;case"mousedown":DO=!0;break;case"contextmenu":case"mouseup":case"dragend":DO=!1,sH(ct,P,it);break;case"selectionchange":if(ype)break;case"keydown":case"keyup":sH(ct,P,it)}var Jt;if(OO)e:{switch(p){case"compositionstart":var sn="onCompositionStart";break e;case"compositionend":sn="onCompositionEnd";break e;case"compositionupdate":sn="onCompositionUpdate";break e}sn=void 0}else Eh?YV(p,P)&&(sn="onCompositionEnd"):p==="keydown"&&P.keyCode===229&&(sn="onCompositionStart");sn&&(GV&&P.locale!=="ko"&&(Eh||sn!=="onCompositionStart"?sn==="onCompositionEnd"&&Eh&&(Jt=zV()):(Qu=it,SO="value"in Qu?Qu.value:Qu.textContent,Eh=!0)),Xt=kS(De,sn),0<Xt.length&&(sn=new UV(sn,p,null,P,it),ct.push({event:sn,listeners:Xt}),Jt?sn.data=Jt:(Jt=QV(P),Jt!==null&&(sn.data=Jt)))),(Jt=ipe?ape(p,P):spe(p,P))&&(De=kS(De,"onBeforeInput"),0<De.length&&(it=new UV("onBeforeInput","beforeinput",null,P,it),ct.push({event:it,listeners:De}),it.data=Jt))}gH(ct,m)})}function Mv(p,m,P){return{instance:p,listener:m,currentTarget:P}}function kS(p,m){for(var P=m+"Capture",D=[];p!==null;){var j=p,W=j.stateNode;j.tag===5&&W!==null&&(j=W,W=Ot(p,P),W!=null&&D.unshift(Mv(p,W,j)),W=Ot(p,m),W!=null&&D.push(Mv(p,W,j))),p=p.return}return D}function Th(p){if(p===null)return null;do p=p.return;while(p&&p.tag!==5);return p||null}function vH(p,m,P,D,j){for(var W=m._reactName,Z=[];P!==null&&P!==D;){var pe=P,be=pe.alternate,De=pe.stateNode;if(be!==null&&be===D)break;pe.tag===5&&De!==null&&(pe=De,j?(be=Ot(P,W),be!=null&&Z.unshift(Mv(P,be,pe))):j||(be=Ot(P,W),be!=null&&Z.push(Mv(P,be,pe)))),P=P.return}Z.length!==0&&p.push({event:m,listeners:Z})}var xpe=/\r\n?/g,Spe=/\u0000|\uFFFD/g;function bH(p){return(typeof p=="string"?p:""+p).replace(xpe,`+`).replace(Spe,"")}function MS(p,m,P){if(m=bH(m),bH(p)!==m&&P)throw Error(n(425))}function AS(){}var jO=null,BO=null;function zO(p,m){return p==="textarea"||p==="noscript"||typeof m.children=="string"||typeof m.children=="number"||typeof m.dangerouslySetInnerHTML=="object"&&m.dangerouslySetInnerHTML!==null&&m.dangerouslySetInnerHTML.__html!=null}var VO=typeof setTimeout=="function"?setTimeout:void 0,Cpe=typeof clearTimeout=="function"?clearTimeout:void 0,wH=typeof Promise=="function"?Promise:void 0,Epe=typeof queueMicrotask=="function"?queueMicrotask:typeof wH<"u"?function(p){return wH.resolve(null).then(p).catch(Ppe)}:VO;function Ppe(p){setTimeout(function(){throw p})}function HO(p,m){var P=m,D=0;do{var j=P.nextSibling;if(p.removeChild(P),j&&j.nodeType===8)if(P=j.data,P==="/$"){if(D===0){p.removeChild(j),wv(m);return}D--}else P!=="$"&&P!=="$?"&&P!=="$!"||D++;P=j}while(P);wv(m)}function Ju(p){for(;p!=null;p=p.nextSibling){var m=p.nodeType;if(m===1||m===3)break;if(m===8){if(m=p.data,m==="$"||m==="$!"||m==="$?")break;if(m==="/$")return null}}return p}function xH(p){p=p.previousSibling;for(var m=0;p;){if(p.nodeType===8){var P=p.data;if(P==="$"||P==="$!"||P==="$?"){if(m===0)return p;m--}else P==="/$"&&m++}p=p.previousSibling}return null}var Oh=Math.random().toString(36).slice(2),Kl="__reactFiber$"+Oh,Av="__reactProps$"+Oh,jc="__reactContainer$"+Oh,UO="__reactEvents$"+Oh,Ipe="__reactListeners$"+Oh,Tpe="__reactHandles$"+Oh;function kf(p){var m=p[Kl];if(m)return m;for(var P=p.parentNode;P;){if(m=P[jc]||P[Kl]){if(P=m.alternate,m.child!==null||P!==null&&P.child!==null)for(p=xH(p);p!==null;){if(P=p[Kl])return P;p=xH(p)}return m}p=P,P=p.parentNode}return null}function Rv(p){return p=p[Kl]||p[jc],!p||p.tag!==5&&p.tag!==6&&p.tag!==13&&p.tag!==3?null:p}function kh(p){if(p.tag===5||p.tag===6)return p.stateNode;throw Error(n(33))}function RS(p){return p[Av]||null}var WO=[],Mh=-1;function Zu(p){return{current:p}}function Tr(p){0>Mh||(p.current=WO[Mh],WO[Mh]=null,Mh--)}function xr(p,m){Mh++,WO[Mh]=p.current,p.current=m}var ed={},di=Zu(ed),Zi=Zu(!1),Mf=ed;function Ah(p,m){var P=p.type.contextTypes;if(!P)return ed;var D=p.stateNode;if(D&&D.__reactInternalMemoizedUnmaskedChildContext===m)return D.__reactInternalMemoizedMaskedChildContext;var j={},W;for(W in P)j[W]=m[W];return D&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=m,p.__reactInternalMemoizedMaskedChildContext=j),j}function ea(p){return p=p.childContextTypes,p!=null}function DS(){Tr(Zi),Tr(di)}function SH(p,m,P){if(di.current!==ed)throw Error(n(168));xr(di,m),xr(Zi,P)}function CH(p,m,P){var D=p.stateNode;if(m=m.childContextTypes,typeof D.getChildContext!="function")return P;D=D.getChildContext();for(var j in D)if(!(j in m))throw Error(n(108,ce(p)||"Unknown",j));return K({},P,D)}function _S(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||ed,Mf=di.current,xr(di,p),xr(Zi,Zi.current),!0}function EH(p,m,P){var D=p.stateNode;if(!D)throw Error(n(169));P?(p=CH(p,m,Mf),D.__reactInternalMemoizedMergedChildContext=p,Tr(Zi),Tr(di),xr(di,p)):Tr(Zi),xr(Zi,P)}var Bc=null,$S=!1,GO=!1;function PH(p){Bc===null?Bc=[p]:Bc.push(p)}function Ope(p){$S=!0,PH(p)}function td(){if(!GO&&Bc!==null){GO=!0;var p=0,m=ur;try{var P=Bc;for(ur=1;p<P.length;p++){var D=P[p];do D=D(!0);while(D!==null)}Bc=null,$S=!1}catch(j){throw Bc!==null&&(Bc=Bc.slice(p+1)),rr(Wu,td),j}finally{ur=m,GO=!1}}return null}var Rh=[],Dh=0,NS=null,LS=0,ss=[],ls=0,Af=null,zc=1,Vc="";function Rf(p,m){Rh[Dh++]=LS,Rh[Dh++]=NS,NS=p,LS=m}function IH(p,m,P){ss[ls++]=zc,ss[ls++]=Vc,ss[ls++]=Af,Af=p;var D=zc;p=Vc;var j=32-Zs(D)-1;D&=~(1<<j),P+=1;var W=32-Zs(m)+j;if(30<W){var Z=j-j%5;W=(D&(1<<Z)-1).toString(32),D>>=Z,j-=Z,zc=1<<32-Zs(m)+j|P<<j|D,Vc=W+p}else zc=1<<W|P<<j|D,Vc=p}function qO(p){p.return!==null&&(Rf(p,1),IH(p,1,0))}function KO(p){for(;p===NS;)NS=Rh[--Dh],Rh[Dh]=null,LS=Rh[--Dh],Rh[Dh]=null;for(;p===Af;)Af=ss[--ls],ss[ls]=null,Vc=ss[--ls],ss[ls]=null,zc=ss[--ls],ss[ls]=null}var Ta=null,Oa=null,_r=!1,tl=null;function TH(p,m){var P=fs(5,null,null,0);P.elementType="DELETED",P.stateNode=m,P.return=p,m=p.deletions,m===null?(p.deletions=[P],p.flags|=16):m.push(P)}function OH(p,m){switch(p.tag){case 5:var P=p.type;return m=m.nodeType!==1||P.toLowerCase()!==m.nodeName.toLowerCase()?null:m,m!==null?(p.stateNode=m,Ta=p,Oa=Ju(m.firstChild),!0):!1;case 6:return m=p.pendingProps===""||m.nodeType!==3?null:m,m!==null?(p.stateNode=m,Ta=p,Oa=null,!0):!1;case 13:return m=m.nodeType!==8?null:m,m!==null?(P=Af!==null?{id:zc,overflow:Vc}:null,p.memoizedState={dehydrated:m,treeContext:P,retryLane:1073741824},P=fs(18,null,null,0),P.stateNode=m,P.return=p,p.child=P,Ta=p,Oa=null,!0):!1;default:return!1}}function YO(p){return(p.mode&1)!==0&&(p.flags&128)===0}function QO(p){if(_r){var m=Oa;if(m){var P=m;if(!OH(p,m)){if(YO(p))throw Error(n(418));m=Ju(P.nextSibling);var D=Ta;m&&OH(p,m)?TH(D,P):(p.flags=p.flags&-4097|2,_r=!1,Ta=p)}}else{if(YO(p))throw Error(n(418));p.flags=p.flags&-4097|2,_r=!1,Ta=p}}}function kH(p){for(p=p.return;p!==null&&p.tag!==5&&p.tag!==3&&p.tag!==13;)p=p.return;Ta=p}function FS(p){if(p!==Ta)return!1;if(!_r)return kH(p),_r=!0,!1;var m;if((m=p.tag!==3)&&!(m=p.tag!==5)&&(m=p.type,m=m!=="head"&&m!=="body"&&!zO(p.type,p.memoizedProps)),m&&(m=Oa)){if(YO(p))throw MH(),Error(n(418));for(;m;)TH(p,m),m=Ju(m.nextSibling)}if(kH(p),p.tag===13){if(p=p.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(n(317));e:{for(p=p.nextSibling,m=0;p;){if(p.nodeType===8){var P=p.data;if(P==="/$"){if(m===0){Oa=Ju(p.nextSibling);break e}m--}else P!=="$"&&P!=="$!"&&P!=="$?"||m++}p=p.nextSibling}Oa=null}}else Oa=Ta?Ju(p.stateNode.nextSibling):null;return!0}function MH(){for(var p=Oa;p;)p=Ju(p.nextSibling)}function _h(){Oa=Ta=null,_r=!1}function XO(p){tl===null?tl=[p]:tl.push(p)}var kpe=I.ReactCurrentBatchConfig;function Dv(p,m,P){if(p=P.ref,p!==null&&typeof p!="function"&&typeof p!="object"){if(P._owner){if(P=P._owner,P){if(P.tag!==1)throw Error(n(309));var D=P.stateNode}if(!D)throw Error(n(147,p));var j=D,W=""+p;return m!==null&&m.ref!==null&&typeof m.ref=="function"&&m.ref._stringRef===W?m.ref:(m=function(Z){var pe=j.refs;Z===null?delete pe[W]:pe[W]=Z},m._stringRef=W,m)}if(typeof p!="string")throw Error(n(284));if(!P._owner)throw Error(n(290,p))}return p}function jS(p,m){throw p=Object.prototype.toString.call(m),Error(n(31,p==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":p))}function AH(p){var m=p._init;return m(p._payload)}function RH(p){function m(ke,Ce){if(p){var Me=ke.deletions;Me===null?(ke.deletions=[Ce],ke.flags|=16):Me.push(Ce)}}function P(ke,Ce){if(!p)return null;for(;Ce!==null;)m(ke,Ce),Ce=Ce.sibling;return null}function D(ke,Ce){for(ke=new Map;Ce!==null;)Ce.key!==null?ke.set(Ce.key,Ce):ke.set(Ce.index,Ce),Ce=Ce.sibling;return ke}function j(ke,Ce){return ke=cd(ke,Ce),ke.index=0,ke.sibling=null,ke}function W(ke,Ce,Me){return ke.index=Me,p?(Me=ke.alternate,Me!==null?(Me=Me.index,Me<Ce?(ke.flags|=2,Ce):Me):(ke.flags|=2,Ce)):(ke.flags|=1048576,Ce)}function Z(ke){return p&&ke.alternate===null&&(ke.flags|=2),ke}function pe(ke,Ce,Me,ht){return Ce===null||Ce.tag!==6?(Ce=Vk(Me,ke.mode,ht),Ce.return=ke,Ce):(Ce=j(Ce,Me),Ce.return=ke,Ce)}function be(ke,Ce,Me,ht){var Ht=Me.type;return Ht===O?it(ke,Ce,Me.props.children,ht,Me.key):Ce!==null&&(Ce.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===B&&AH(Ht)===Ce.type)?(ht=j(Ce,Me.props),ht.ref=Dv(ke,Ce,Me),ht.return=ke,ht):(ht=cC(Me.type,Me.key,Me.props,null,ke.mode,ht),ht.ref=Dv(ke,Ce,Me),ht.return=ke,ht)}function De(ke,Ce,Me,ht){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==Me.containerInfo||Ce.stateNode.implementation!==Me.implementation?(Ce=Hk(Me,ke.mode,ht),Ce.return=ke,Ce):(Ce=j(Ce,Me.children||[]),Ce.return=ke,Ce)}function it(ke,Ce,Me,ht,Ht){return Ce===null||Ce.tag!==7?(Ce=Bf(Me,ke.mode,ht,Ht),Ce.return=ke,Ce):(Ce=j(Ce,Me),Ce.return=ke,Ce)}function ct(ke,Ce,Me){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return Ce=Vk(""+Ce,ke.mode,Me),Ce.return=ke,Ce;if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case E:return Me=cC(Ce.type,Ce.key,Ce.props,null,ke.mode,Me),Me.ref=Dv(ke,null,Ce),Me.return=ke,Me;case T:return Ce=Hk(Ce,ke.mode,Me),Ce.return=ke,Ce;case B:var ht=Ce._init;return ct(ke,ht(Ce._payload),Me)}if(_e(Ce)||H(Ce))return Ce=Bf(Ce,ke.mode,Me,null),Ce.return=ke,Ce;jS(ke,Ce)}return null}function ot(ke,Ce,Me,ht){var Ht=Ce!==null?Ce.key:null;if(typeof Me=="string"&&Me!==""||typeof Me=="number")return Ht!==null?null:pe(ke,Ce,""+Me,ht);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case E:return Me.key===Ht?be(ke,Ce,Me,ht):null;case T:return Me.key===Ht?De(ke,Ce,Me,ht):null;case B:return Ht=Me._init,ot(ke,Ce,Ht(Me._payload),ht)}if(_e(Me)||H(Me))return Ht!==null?null:it(ke,Ce,Me,ht,null);jS(ke,Me)}return null}function Mt(ke,Ce,Me,ht,Ht){if(typeof ht=="string"&&ht!==""||typeof ht=="number")return ke=ke.get(Me)||null,pe(Ce,ke,""+ht,Ht);if(typeof ht=="object"&&ht!==null){switch(ht.$$typeof){case E:return ke=ke.get(ht.key===null?Me:ht.key)||null,be(Ce,ke,ht,Ht);case T:return ke=ke.get(ht.key===null?Me:ht.key)||null,De(Ce,ke,ht,Ht);case B:var Xt=ht._init;return Mt(ke,Ce,Me,Xt(ht._payload),Ht)}if(_e(ht)||H(ht))return ke=ke.get(Me)||null,it(Ce,ke,ht,Ht,null);jS(Ce,ht)}return null}function Lt(ke,Ce,Me,ht){for(var Ht=null,Xt=null,Jt=Ce,sn=Ce=0,zo=null;Jt!==null&&sn<Me.length;sn++){Jt.index>sn?(zo=Jt,Jt=null):zo=Jt.sibling;var Gn=ot(ke,Jt,Me[sn],ht);if(Gn===null){Jt===null&&(Jt=zo);break}p&&Jt&&Gn.alternate===null&&m(ke,Jt),Ce=W(Gn,Ce,sn),Xt===null?Ht=Gn:Xt.sibling=Gn,Xt=Gn,Jt=zo}if(sn===Me.length)return P(ke,Jt),_r&&Rf(ke,sn),Ht;if(Jt===null){for(;sn<Me.length;sn++)Jt=ct(ke,Me[sn],ht),Jt!==null&&(Ce=W(Jt,Ce,sn),Xt===null?Ht=Jt:Xt.sibling=Jt,Xt=Jt);return _r&&Rf(ke,sn),Ht}for(Jt=D(ke,Jt);sn<Me.length;sn++)zo=Mt(Jt,ke,sn,Me[sn],ht),zo!==null&&(p&&zo.alternate!==null&&Jt.delete(zo.key===null?sn:zo.key),Ce=W(zo,Ce,sn),Xt===null?Ht=zo:Xt.sibling=zo,Xt=zo);return p&&Jt.forEach(function(ud){return m(ke,ud)}),_r&&Rf(ke,sn),Ht}function jt(ke,Ce,Me,ht){var Ht=H(Me);if(typeof Ht!="function")throw Error(n(150));if(Me=Ht.call(Me),Me==null)throw Error(n(151));for(var Xt=Ht=null,Jt=Ce,sn=Ce=0,zo=null,Gn=Me.next();Jt!==null&&!Gn.done;sn++,Gn=Me.next()){Jt.index>sn?(zo=Jt,Jt=null):zo=Jt.sibling;var ud=ot(ke,Jt,Gn.value,ht);if(ud===null){Jt===null&&(Jt=zo);break}p&&Jt&&ud.alternate===null&&m(ke,Jt),Ce=W(ud,Ce,sn),Xt===null?Ht=ud:Xt.sibling=ud,Xt=ud,Jt=zo}if(Gn.done)return P(ke,Jt),_r&&Rf(ke,sn),Ht;if(Jt===null){for(;!Gn.done;sn++,Gn=Me.next())Gn=ct(ke,Gn.value,ht),Gn!==null&&(Ce=W(Gn,Ce,sn),Xt===null?Ht=Gn:Xt.sibling=Gn,Xt=Gn);return _r&&Rf(ke,sn),Ht}for(Jt=D(ke,Jt);!Gn.done;sn++,Gn=Me.next())Gn=Mt(Jt,ke,sn,Gn.value,ht),Gn!==null&&(p&&Gn.alternate!==null&&Jt.delete(Gn.key===null?sn:Gn.key),Ce=W(Gn,Ce,sn),Xt===null?Ht=Gn:Xt.sibling=Gn,Xt=Gn);return p&&Jt.forEach(function(lhe){return m(ke,lhe)}),_r&&Rf(ke,sn),Ht}function ao(ke,Ce,Me,ht){if(typeof Me=="object"&&Me!==null&&Me.type===O&&Me.key===null&&(Me=Me.props.children),typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case E:e:{for(var Ht=Me.key,Xt=Ce;Xt!==null;){if(Xt.key===Ht){if(Ht=Me.type,Ht===O){if(Xt.tag===7){P(ke,Xt.sibling),Ce=j(Xt,Me.props.children),Ce.return=ke,ke=Ce;break e}}else if(Xt.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===B&&AH(Ht)===Xt.type){P(ke,Xt.sibling),Ce=j(Xt,Me.props),Ce.ref=Dv(ke,Xt,Me),Ce.return=ke,ke=Ce;break e}P(ke,Xt);break}else m(ke,Xt);Xt=Xt.sibling}Me.type===O?(Ce=Bf(Me.props.children,ke.mode,ht,Me.key),Ce.return=ke,ke=Ce):(ht=cC(Me.type,Me.key,Me.props,null,ke.mode,ht),ht.ref=Dv(ke,Ce,Me),ht.return=ke,ke=ht)}return Z(ke);case T:e:{for(Xt=Me.key;Ce!==null;){if(Ce.key===Xt)if(Ce.tag===4&&Ce.stateNode.containerInfo===Me.containerInfo&&Ce.stateNode.implementation===Me.implementation){P(ke,Ce.sibling),Ce=j(Ce,Me.children||[]),Ce.return=ke,ke=Ce;break e}else{P(ke,Ce);break}else m(ke,Ce);Ce=Ce.sibling}Ce=Hk(Me,ke.mode,ht),Ce.return=ke,ke=Ce}return Z(ke);case B:return Xt=Me._init,ao(ke,Ce,Xt(Me._payload),ht)}if(_e(Me))return Lt(ke,Ce,Me,ht);if(H(Me))return jt(ke,Ce,Me,ht);jS(ke,Me)}return typeof Me=="string"&&Me!==""||typeof Me=="number"?(Me=""+Me,Ce!==null&&Ce.tag===6?(P(ke,Ce.sibling),Ce=j(Ce,Me),Ce.return=ke,ke=Ce):(P(ke,Ce),Ce=Vk(Me,ke.mode,ht),Ce.return=ke,ke=Ce),Z(ke)):P(ke,Ce)}return ao}var $h=RH(!0),DH=RH(!1),BS=Zu(null),zS=null,Nh=null,JO=null;function ZO(){JO=Nh=zS=null}function ek(p){var m=BS.current;Tr(BS),p._currentValue=m}function tk(p,m,P){for(;p!==null;){var D=p.alternate;if((p.childLanes&m)!==m?(p.childLanes|=m,D!==null&&(D.childLanes|=m)):D!==null&&(D.childLanes&m)!==m&&(D.childLanes|=m),p===P)break;p=p.return}}function Lh(p,m){zS=p,JO=Nh=null,p=p.dependencies,p!==null&&p.firstContext!==null&&(p.lanes&m&&(ta=!0),p.firstContext=null)}function cs(p){var m=p._currentValue;if(JO!==p)if(p={context:p,memoizedValue:m,next:null},Nh===null){if(zS===null)throw Error(n(308));Nh=p,zS.dependencies={lanes:0,firstContext:p}}else Nh=Nh.next=p;return m}var Df=null;function nk(p){Df===null?Df=[p]:Df.push(p)}function _H(p,m,P,D){var j=m.interleaved;return j===null?(P.next=P,nk(m)):(P.next=j.next,j.next=P),m.interleaved=P,Hc(p,D)}function Hc(p,m){p.lanes|=m;var P=p.alternate;for(P!==null&&(P.lanes|=m),P=p,p=p.return;p!==null;)p.childLanes|=m,P=p.alternate,P!==null&&(P.childLanes|=m),P=p,p=p.return;return P.tag===3?P.stateNode:null}var nd=!1;function rk(p){p.updateQueue={baseState:p.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $H(p,m){p=p.updateQueue,m.updateQueue===p&&(m.updateQueue={baseState:p.baseState,firstBaseUpdate:p.firstBaseUpdate,lastBaseUpdate:p.lastBaseUpdate,shared:p.shared,effects:p.effects})}function Uc(p,m){return{eventTime:p,lane:m,tag:0,payload:null,callback:null,next:null}}function rd(p,m,P){var D=p.updateQueue;if(D===null)return null;if(D=D.shared,Hn&2){var j=D.pending;return j===null?m.next=m:(m.next=j.next,j.next=m),D.pending=m,Hc(p,P)}return j=D.interleaved,j===null?(m.next=m,nk(D)):(m.next=j.next,j.next=m),D.interleaved=m,Hc(p,P)}function VS(p,m,P){if(m=m.updateQueue,m!==null&&(m=m.shared,(P&4194240)!==0)){var D=m.lanes;D&=p.pendingLanes,P|=D,m.lanes=P,yO(p,P)}}function NH(p,m){var P=p.updateQueue,D=p.alternate;if(D!==null&&(D=D.updateQueue,P===D)){var j=null,W=null;if(P=P.firstBaseUpdate,P!==null){do{var Z={eventTime:P.eventTime,lane:P.lane,tag:P.tag,payload:P.payload,callback:P.callback,next:null};W===null?j=W=Z:W=W.next=Z,P=P.next}while(P!==null);W===null?j=W=m:W=W.next=m}else j=W=m;P={baseState:D.baseState,firstBaseUpdate:j,lastBaseUpdate:W,shared:D.shared,effects:D.effects},p.updateQueue=P;return}p=P.lastBaseUpdate,p===null?P.firstBaseUpdate=m:p.next=m,P.lastBaseUpdate=m}function HS(p,m,P,D){var j=p.updateQueue;nd=!1;var W=j.firstBaseUpdate,Z=j.lastBaseUpdate,pe=j.shared.pending;if(pe!==null){j.shared.pending=null;var be=pe,De=be.next;be.next=null,Z===null?W=De:Z.next=De,Z=be;var it=p.alternate;it!==null&&(it=it.updateQueue,pe=it.lastBaseUpdate,pe!==Z&&(pe===null?it.firstBaseUpdate=De:pe.next=De,it.lastBaseUpdate=be))}if(W!==null){var ct=j.baseState;Z=0,it=De=be=null,pe=W;do{var ot=pe.lane,Mt=pe.eventTime;if((D&ot)===ot){it!==null&&(it=it.next={eventTime:Mt,lane:0,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null});e:{var Lt=p,jt=pe;switch(ot=m,Mt=P,jt.tag){case 1:if(Lt=jt.payload,typeof Lt=="function"){ct=Lt.call(Mt,ct,ot);break e}ct=Lt;break e;case 3:Lt.flags=Lt.flags&-65537|128;case 0:if(Lt=jt.payload,ot=typeof Lt=="function"?Lt.call(Mt,ct,ot):Lt,ot==null)break e;ct=K({},ct,ot);break e;case 2:nd=!0}}pe.callback!==null&&pe.lane!==0&&(p.flags|=64,ot=j.effects,ot===null?j.effects=[pe]:ot.push(pe))}else Mt={eventTime:Mt,lane:ot,tag:pe.tag,payload:pe.payload,callback:pe.callback,next:null},it===null?(De=it=Mt,be=ct):it=it.next=Mt,Z|=ot;if(pe=pe.next,pe===null){if(pe=j.shared.pending,pe===null)break;ot=pe,pe=ot.next,ot.next=null,j.lastBaseUpdate=ot,j.shared.pending=null}}while(!0);if(it===null&&(be=ct),j.baseState=be,j.firstBaseUpdate=De,j.lastBaseUpdate=it,m=j.shared.interleaved,m!==null){j=m;do Z|=j.lane,j=j.next;while(j!==m)}else W===null&&(j.shared.lanes=0);Nf|=Z,p.lanes=Z,p.memoizedState=ct}}function LH(p,m,P){if(p=m.effects,m.effects=null,p!==null)for(m=0;m<p.length;m++){var D=p[m],j=D.callback;if(j!==null){if(D.callback=null,D=P,typeof j!="function")throw Error(n(191,j));j.call(D)}}}var _v={},Yl=Zu(_v),$v=Zu(_v),Nv=Zu(_v);function _f(p){if(p===_v)throw Error(n(174));return p}function ok(p,m){switch(xr(Nv,m),xr($v,p),xr(Yl,_v),p=m.nodeType,p){case 9:case 11:m=(m=m.documentElement)?m.namespaceURI:Ze(null,"");break;default:p=p===8?m.parentNode:m,m=p.namespaceURI||null,p=p.tagName,m=Ze(m,p)}Tr(Yl),xr(Yl,m)}function Fh(){Tr(Yl),Tr($v),Tr(Nv)}function FH(p){_f(Nv.current);var m=_f(Yl.current),P=Ze(m,p.type);m!==P&&(xr($v,p),xr(Yl,P))}function ik(p){$v.current===p&&(Tr(Yl),Tr($v))}var Br=Zu(0);function US(p){for(var m=p;m!==null;){if(m.tag===13){var P=m.memoizedState;if(P!==null&&(P=P.dehydrated,P===null||P.data==="$?"||P.data==="$!"))return m}else if(m.tag===19&&m.memoizedProps.revealOrder!==void 0){if(m.flags&128)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===p)break;for(;m.sibling===null;){if(m.return===null||m.return===p)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var ak=[];function sk(){for(var p=0;p<ak.length;p++)ak[p]._workInProgressVersionPrimary=null;ak.length=0}var WS=I.ReactCurrentDispatcher,lk=I.ReactCurrentBatchConfig,$f=0,zr=null,Eo=null,jo=null,GS=!1,Lv=!1,Fv=0,Mpe=0;function fi(){throw Error(n(321))}function ck(p,m){if(m===null)return!1;for(var P=0;P<m.length&&P<p.length;P++)if(!el(p[P],m[P]))return!1;return!0}function uk(p,m,P,D,j,W){if($f=W,zr=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,WS.current=p===null||p.memoizedState===null?_pe:$pe,p=P(D,j),Lv){W=0;do{if(Lv=!1,Fv=0,25<=W)throw Error(n(301));W+=1,jo=Eo=null,m.updateQueue=null,WS.current=Npe,p=P(D,j)}while(Lv)}if(WS.current=YS,m=Eo!==null&&Eo.next!==null,$f=0,jo=Eo=zr=null,GS=!1,m)throw Error(n(300));return p}function dk(){var p=Fv!==0;return Fv=0,p}function Ql(){var p={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jo===null?zr.memoizedState=jo=p:jo=jo.next=p,jo}function us(){if(Eo===null){var p=zr.alternate;p=p!==null?p.memoizedState:null}else p=Eo.next;var m=jo===null?zr.memoizedState:jo.next;if(m!==null)jo=m,Eo=p;else{if(p===null)throw Error(n(310));Eo=p,p={memoizedState:Eo.memoizedState,baseState:Eo.baseState,baseQueue:Eo.baseQueue,queue:Eo.queue,next:null},jo===null?zr.memoizedState=jo=p:jo=jo.next=p}return jo}function jv(p,m){return typeof m=="function"?m(p):m}function fk(p){var m=us(),P=m.queue;if(P===null)throw Error(n(311));P.lastRenderedReducer=p;var D=Eo,j=D.baseQueue,W=P.pending;if(W!==null){if(j!==null){var Z=j.next;j.next=W.next,W.next=Z}D.baseQueue=j=W,P.pending=null}if(j!==null){W=j.next,D=D.baseState;var pe=Z=null,be=null,De=W;do{var it=De.lane;if(($f&it)===it)be!==null&&(be=be.next={lane:0,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null}),D=De.hasEagerState?De.eagerState:p(D,De.action);else{var ct={lane:it,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null};be===null?(pe=be=ct,Z=D):be=be.next=ct,zr.lanes|=it,Nf|=it}De=De.next}while(De!==null&&De!==W);be===null?Z=D:be.next=pe,el(D,m.memoizedState)||(ta=!0),m.memoizedState=D,m.baseState=Z,m.baseQueue=be,P.lastRenderedState=D}if(p=P.interleaved,p!==null){j=p;do W=j.lane,zr.lanes|=W,Nf|=W,j=j.next;while(j!==p)}else j===null&&(P.lanes=0);return[m.memoizedState,P.dispatch]}function pk(p){var m=us(),P=m.queue;if(P===null)throw Error(n(311));P.lastRenderedReducer=p;var D=P.dispatch,j=P.pending,W=m.memoizedState;if(j!==null){P.pending=null;var Z=j=j.next;do W=p(W,Z.action),Z=Z.next;while(Z!==j);el(W,m.memoizedState)||(ta=!0),m.memoizedState=W,m.baseQueue===null&&(m.baseState=W),P.lastRenderedState=W}return[W,D]}function jH(){}function BH(p,m){var P=zr,D=us(),j=m(),W=!el(D.memoizedState,j);if(W&&(D.memoizedState=j,ta=!0),D=D.queue,hk(HH.bind(null,P,D,p),[p]),D.getSnapshot!==m||W||jo!==null&&jo.memoizedState.tag&1){if(P.flags|=2048,Bv(9,VH.bind(null,P,D,j,m),void 0,null),Bo===null)throw Error(n(349));$f&30||zH(P,m,j)}return j}function zH(p,m,P){p.flags|=16384,p={getSnapshot:m,value:P},m=zr.updateQueue,m===null?(m={lastEffect:null,stores:null},zr.updateQueue=m,m.stores=[p]):(P=m.stores,P===null?m.stores=[p]:P.push(p))}function VH(p,m,P,D){m.value=P,m.getSnapshot=D,UH(m)&&WH(p)}function HH(p,m,P){return P(function(){UH(m)&&WH(p)})}function UH(p){var m=p.getSnapshot;p=p.value;try{var P=m();return!el(p,P)}catch{return!0}}function WH(p){var m=Hc(p,1);m!==null&&il(m,p,1,-1)}function GH(p){var m=Ql();return typeof p=="function"&&(p=p()),m.memoizedState=m.baseState=p,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:jv,lastRenderedState:p},m.queue=p,p=p.dispatch=Dpe.bind(null,zr,p),[m.memoizedState,p]}function Bv(p,m,P,D){return p={tag:p,create:m,destroy:P,deps:D,next:null},m=zr.updateQueue,m===null?(m={lastEffect:null,stores:null},zr.updateQueue=m,m.lastEffect=p.next=p):(P=m.lastEffect,P===null?m.lastEffect=p.next=p:(D=P.next,P.next=p,p.next=D,m.lastEffect=p)),p}function qH(){return us().memoizedState}function qS(p,m,P,D){var j=Ql();zr.flags|=p,j.memoizedState=Bv(1|m,P,void 0,D===void 0?null:D)}function KS(p,m,P,D){var j=us();D=D===void 0?null:D;var W=void 0;if(Eo!==null){var Z=Eo.memoizedState;if(W=Z.destroy,D!==null&&ck(D,Z.deps)){j.memoizedState=Bv(m,P,W,D);return}}zr.flags|=p,j.memoizedState=Bv(1|m,P,W,D)}function KH(p,m){return qS(8390656,8,p,m)}function hk(p,m){return KS(2048,8,p,m)}function YH(p,m){return KS(4,2,p,m)}function QH(p,m){return KS(4,4,p,m)}function XH(p,m){if(typeof m=="function")return p=p(),m(p),function(){m(null)};if(m!=null)return p=p(),m.current=p,function(){m.current=null}}function JH(p,m,P){return P=P!=null?P.concat([p]):null,KS(4,4,XH.bind(null,m,p),P)}function mk(){}function ZH(p,m){var P=us();m=m===void 0?null:m;var D=P.memoizedState;return D!==null&&m!==null&&ck(m,D[1])?D[0]:(P.memoizedState=[p,m],p)}function e5(p,m){var P=us();m=m===void 0?null:m;var D=P.memoizedState;return D!==null&&m!==null&&ck(m,D[1])?D[0]:(p=p(),P.memoizedState=[p,m],p)}function t5(p,m,P){return $f&21?(el(P,m)||(P=AV(),zr.lanes|=P,Nf|=P,p.baseState=!0),m):(p.baseState&&(p.baseState=!1,ta=!0),p.memoizedState=P)}function Ape(p,m){var P=ur;ur=P!==0&&4>P?P:4,p(!0);var D=lk.transition;lk.transition={};try{p(!1),m()}finally{ur=P,lk.transition=D}}function n5(){return us().memoizedState}function Rpe(p,m,P){var D=sd(p);if(P={lane:D,action:P,hasEagerState:!1,eagerState:null,next:null},r5(p))o5(m,P);else if(P=_H(p,m,P,D),P!==null){var j=Ai();il(P,p,D,j),i5(P,m,D)}}function Dpe(p,m,P){var D=sd(p),j={lane:D,action:P,hasEagerState:!1,eagerState:null,next:null};if(r5(p))o5(m,j);else{var W=p.alternate;if(p.lanes===0&&(W===null||W.lanes===0)&&(W=m.lastRenderedReducer,W!==null))try{var Z=m.lastRenderedState,pe=W(Z,P);if(j.hasEagerState=!0,j.eagerState=pe,el(pe,Z)){var be=m.interleaved;be===null?(j.next=j,nk(m)):(j.next=be.next,be.next=j),m.interleaved=j;return}}catch{}finally{}P=_H(p,m,j,D),P!==null&&(j=Ai(),il(P,p,D,j),i5(P,m,D))}}function r5(p){var m=p.alternate;return p===zr||m!==null&&m===zr}function o5(p,m){Lv=GS=!0;var P=p.pending;P===null?m.next=m:(m.next=P.next,P.next=m),p.pending=m}function i5(p,m,P){if(P&4194240){var D=m.lanes;D&=p.pendingLanes,P|=D,m.lanes=P,yO(p,P)}}var YS={readContext:cs,useCallback:fi,useContext:fi,useEffect:fi,useImperativeHandle:fi,useInsertionEffect:fi,useLayoutEffect:fi,useMemo:fi,useReducer:fi,useRef:fi,useState:fi,useDebugValue:fi,useDeferredValue:fi,useTransition:fi,useMutableSource:fi,useSyncExternalStore:fi,useId:fi,unstable_isNewReconciler:!1},_pe={readContext:cs,useCallback:function(p,m){return Ql().memoizedState=[p,m===void 0?null:m],p},useContext:cs,useEffect:KH,useImperativeHandle:function(p,m,P){return P=P!=null?P.concat([p]):null,qS(4194308,4,XH.bind(null,m,p),P)},useLayoutEffect:function(p,m){return qS(4194308,4,p,m)},useInsertionEffect:function(p,m){return qS(4,2,p,m)},useMemo:function(p,m){var P=Ql();return m=m===void 0?null:m,p=p(),P.memoizedState=[p,m],p},useReducer:function(p,m,P){var D=Ql();return m=P!==void 0?P(m):m,D.memoizedState=D.baseState=m,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:m},D.queue=p,p=p.dispatch=Rpe.bind(null,zr,p),[D.memoizedState,p]},useRef:function(p){var m=Ql();return p={current:p},m.memoizedState=p},useState:GH,useDebugValue:mk,useDeferredValue:function(p){return Ql().memoizedState=p},useTransition:function(){var p=GH(!1),m=p[0];return p=Ape.bind(null,p[1]),Ql().memoizedState=p,[m,p]},useMutableSource:function(){},useSyncExternalStore:function(p,m,P){var D=zr,j=Ql();if(_r){if(P===void 0)throw Error(n(407));P=P()}else{if(P=m(),Bo===null)throw Error(n(349));$f&30||zH(D,m,P)}j.memoizedState=P;var W={value:P,getSnapshot:m};return j.queue=W,KH(HH.bind(null,D,W,p),[p]),D.flags|=2048,Bv(9,VH.bind(null,D,W,P,m),void 0,null),P},useId:function(){var p=Ql(),m=Bo.identifierPrefix;if(_r){var P=Vc,D=zc;P=(D&~(1<<32-Zs(D)-1)).toString(32)+P,m=":"+m+"R"+P,P=Fv++,0<P&&(m+="H"+P.toString(32)),m+=":"}else P=Mpe++,m=":"+m+"r"+P.toString(32)+":";return p.memoizedState=m},unstable_isNewReconciler:!1},$pe={readContext:cs,useCallback:ZH,useContext:cs,useEffect:hk,useImperativeHandle:JH,useInsertionEffect:YH,useLayoutEffect:QH,useMemo:e5,useReducer:fk,useRef:qH,useState:function(){return fk(jv)},useDebugValue:mk,useDeferredValue:function(p){var m=us();return t5(m,Eo.memoizedState,p)},useTransition:function(){var p=fk(jv)[0],m=us().memoizedState;return[p,m]},useMutableSource:jH,useSyncExternalStore:BH,useId:n5,unstable_isNewReconciler:!1},Npe={readContext:cs,useCallback:ZH,useContext:cs,useEffect:hk,useImperativeHandle:JH,useInsertionEffect:YH,useLayoutEffect:QH,useMemo:e5,useReducer:pk,useRef:qH,useState:function(){return pk(jv)},useDebugValue:mk,useDeferredValue:function(p){var m=us();return Eo===null?m.memoizedState=p:t5(m,Eo.memoizedState,p)},useTransition:function(){var p=pk(jv)[0],m=us().memoizedState;return[p,m]},useMutableSource:jH,useSyncExternalStore:BH,useId:n5,unstable_isNewReconciler:!1};function nl(p,m){if(p&&p.defaultProps){m=K({},m),p=p.defaultProps;for(var P in p)m[P]===void 0&&(m[P]=p[P]);return m}return m}function gk(p,m,P,D){m=p.memoizedState,P=P(D,m),P=P==null?m:K({},m,P),p.memoizedState=P,p.lanes===0&&(p.updateQueue.baseState=P)}var QS={isMounted:function(p){return(p=p._reactInternals)?os(p)===p:!1},enqueueSetState:function(p,m,P){p=p._reactInternals;var D=Ai(),j=sd(p),W=Uc(D,j);W.payload=m,P!=null&&(W.callback=P),m=rd(p,W,j),m!==null&&(il(m,p,j,D),VS(m,p,j))},enqueueReplaceState:function(p,m,P){p=p._reactInternals;var D=Ai(),j=sd(p),W=Uc(D,j);W.tag=1,W.payload=m,P!=null&&(W.callback=P),m=rd(p,W,j),m!==null&&(il(m,p,j,D),VS(m,p,j))},enqueueForceUpdate:function(p,m){p=p._reactInternals;var P=Ai(),D=sd(p),j=Uc(P,D);j.tag=2,m!=null&&(j.callback=m),m=rd(p,j,D),m!==null&&(il(m,p,D,P),VS(m,p,D))}};function a5(p,m,P,D,j,W,Z){return p=p.stateNode,typeof p.shouldComponentUpdate=="function"?p.shouldComponentUpdate(D,W,Z):m.prototype&&m.prototype.isPureReactComponent?!Iv(P,D)||!Iv(j,W):!0}function s5(p,m,P){var D=!1,j=ed,W=m.contextType;return typeof W=="object"&&W!==null?W=cs(W):(j=ea(m)?Mf:di.current,D=m.contextTypes,W=(D=D!=null)?Ah(p,j):ed),m=new m(P,W),p.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=QS,p.stateNode=m,m._reactInternals=p,D&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=j,p.__reactInternalMemoizedMaskedChildContext=W),m}function l5(p,m,P,D){p=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(P,D),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(P,D),m.state!==p&&QS.enqueueReplaceState(m,m.state,null)}function yk(p,m,P,D){var j=p.stateNode;j.props=P,j.state=p.memoizedState,j.refs={},rk(p);var W=m.contextType;typeof W=="object"&&W!==null?j.context=cs(W):(W=ea(m)?Mf:di.current,j.context=Ah(p,W)),j.state=p.memoizedState,W=m.getDerivedStateFromProps,typeof W=="function"&&(gk(p,m,W,P),j.state=p.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(m=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),m!==j.state&&QS.enqueueReplaceState(j,j.state,null),HS(p,P,j,D),j.state=p.memoizedState),typeof j.componentDidMount=="function"&&(p.flags|=4194308)}function jh(p,m){try{var P="",D=m;do P+=ee(D),D=D.return;while(D);var j=P}catch(W){j=`Error generating stack: `+W.message+`-`+W.stack}return{value:p,source:m,stack:j,digest:null}}function vk(p,m,P){return{value:p,source:null,stack:P??null,digest:m??null}}function bk(p,m){try{console.error(m.value)}catch(P){setTimeout(function(){throw P})}}var Lpe=typeof WeakMap=="function"?WeakMap:Map;function c5(p,m,P){P=Uc(-1,P),P.tag=3,P.payload={element:null};var D=m.value;return P.callback=function(){rC||(rC=!0,_k=D),bk(p,m)},P}function u5(p,m,P){P=Uc(-1,P),P.tag=3;var D=p.type.getDerivedStateFromError;if(typeof D=="function"){var j=m.value;P.payload=function(){return D(j)},P.callback=function(){bk(p,m)}}var W=p.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&(P.callback=function(){bk(p,m),typeof D!="function"&&(id===null?id=new Set([this]):id.add(this));var Z=m.stack;this.componentDidCatch(m.value,{componentStack:Z!==null?Z:""})}),P}function d5(p,m,P){var D=p.pingCache;if(D===null){D=p.pingCache=new Lpe;var j=new Set;D.set(m,j)}else j=D.get(m),j===void 0&&(j=new Set,D.set(m,j));j.has(P)||(j.add(P),p=Xpe.bind(null,p,m,P),m.then(p,p))}function f5(p){do{var m;if((m=p.tag===13)&&(m=p.memoizedState,m=m!==null?m.dehydrated!==null:!0),m)return p;p=p.return}while(p!==null);return null}function p5(p,m,P,D,j){return p.mode&1?(p.flags|=65536,p.lanes=j,p):(p===m?p.flags|=65536:(p.flags|=128,P.flags|=131072,P.flags&=-52805,P.tag===1&&(P.alternate===null?P.tag=17:(m=Uc(-1,1),m.tag=2,rd(P,m,1))),P.lanes|=1),p)}var Fpe=I.ReactCurrentOwner,ta=!1;function Mi(p,m,P,D){m.child=p===null?DH(m,null,P,D):$h(m,p.child,P,D)}function h5(p,m,P,D,j){P=P.render;var W=m.ref;return Lh(m,j),D=uk(p,m,P,D,W,j),P=dk(),p!==null&&!ta?(m.updateQueue=p.updateQueue,m.flags&=-2053,p.lanes&=~j,Wc(p,m,j)):(_r&&P&&qO(m),m.flags|=1,Mi(p,m,D,j),m.child)}function m5(p,m,P,D,j){if(p===null){var W=P.type;return typeof W=="function"&&!zk(W)&&W.defaultProps===void 0&&P.compare===null&&P.defaultProps===void 0?(m.tag=15,m.type=W,g5(p,m,W,D,j)):(p=cC(P.type,null,D,m,m.mode,j),p.ref=m.ref,p.return=m,m.child=p)}if(W=p.child,!(p.lanes&j)){var Z=W.memoizedProps;if(P=P.compare,P=P!==null?P:Iv,P(Z,D)&&p.ref===m.ref)return Wc(p,m,j)}return m.flags|=1,p=cd(W,D),p.ref=m.ref,p.return=m,m.child=p}function g5(p,m,P,D,j){if(p!==null){var W=p.memoizedProps;if(Iv(W,D)&&p.ref===m.ref)if(ta=!1,m.pendingProps=D=W,(p.lanes&j)!==0)p.flags&131072&&(ta=!0);else return m.lanes=p.lanes,Wc(p,m,j)}return wk(p,m,P,D,j)}function y5(p,m,P){var D=m.pendingProps,j=D.children,W=p!==null?p.memoizedState:null;if(D.mode==="hidden")if(!(m.mode&1))m.memoizedState={baseLanes:0,cachePool:null,transitions:null},xr(zh,ka),ka|=P;else{if(!(P&1073741824))return p=W!==null?W.baseLanes|P:P,m.lanes=m.childLanes=1073741824,m.memoizedState={baseLanes:p,cachePool:null,transitions:null},m.updateQueue=null,xr(zh,ka),ka|=p,null;m.memoizedState={baseLanes:0,cachePool:null,transitions:null},D=W!==null?W.baseLanes:P,xr(zh,ka),ka|=D}else W!==null?(D=W.baseLanes|P,m.memoizedState=null):D=P,xr(zh,ka),ka|=D;return Mi(p,m,j,P),m.child}function v5(p,m){var P=m.ref;(p===null&&P!==null||p!==null&&p.ref!==P)&&(m.flags|=512,m.flags|=2097152)}function wk(p,m,P,D,j){var W=ea(P)?Mf:di.current;return W=Ah(m,W),Lh(m,j),P=uk(p,m,P,D,W,j),D=dk(),p!==null&&!ta?(m.updateQueue=p.updateQueue,m.flags&=-2053,p.lanes&=~j,Wc(p,m,j)):(_r&&D&&qO(m),m.flags|=1,Mi(p,m,P,j),m.child)}function b5(p,m,P,D,j){if(ea(P)){var W=!0;_S(m)}else W=!1;if(Lh(m,j),m.stateNode===null)JS(p,m),s5(m,P,D),yk(m,P,D,j),D=!0;else if(p===null){var Z=m.stateNode,pe=m.memoizedProps;Z.props=pe;var be=Z.context,De=P.contextType;typeof De=="object"&&De!==null?De=cs(De):(De=ea(P)?Mf:di.current,De=Ah(m,De));var it=P.getDerivedStateFromProps,ct=typeof it=="function"||typeof Z.getSnapshotBeforeUpdate=="function";ct||typeof Z.UNSAFE_componentWillReceiveProps!="function"&&typeof Z.componentWillReceiveProps!="function"||(pe!==D||be!==De)&&l5(m,Z,D,De),nd=!1;var ot=m.memoizedState;Z.state=ot,HS(m,D,Z,j),be=m.memoizedState,pe!==D||ot!==be||Zi.current||nd?(typeof it=="function"&&(gk(m,P,it,D),be=m.memoizedState),(pe=nd||a5(m,P,pe,D,ot,be,De))?(ct||typeof Z.UNSAFE_componentWillMount!="function"&&typeof Z.componentWillMount!="function"||(typeof Z.componentWillMount=="function"&&Z.componentWillMount(),typeof Z.UNSAFE_componentWillMount=="function"&&Z.UNSAFE_componentWillMount()),typeof Z.componentDidMount=="function"&&(m.flags|=4194308)):(typeof Z.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=D,m.memoizedState=be),Z.props=D,Z.state=be,Z.context=De,D=pe):(typeof Z.componentDidMount=="function"&&(m.flags|=4194308),D=!1)}else{Z=m.stateNode,$H(p,m),pe=m.memoizedProps,De=m.type===m.elementType?pe:nl(m.type,pe),Z.props=De,ct=m.pendingProps,ot=Z.context,be=P.contextType,typeof be=="object"&&be!==null?be=cs(be):(be=ea(P)?Mf:di.current,be=Ah(m,be));var Mt=P.getDerivedStateFromProps;(it=typeof Mt=="function"||typeof Z.getSnapshotBeforeUpdate=="function")||typeof Z.UNSAFE_componentWillReceiveProps!="function"&&typeof Z.componentWillReceiveProps!="function"||(pe!==ct||ot!==be)&&l5(m,Z,D,be),nd=!1,ot=m.memoizedState,Z.state=ot,HS(m,D,Z,j);var Lt=m.memoizedState;pe!==ct||ot!==Lt||Zi.current||nd?(typeof Mt=="function"&&(gk(m,P,Mt,D),Lt=m.memoizedState),(De=nd||a5(m,P,De,D,ot,Lt,be)||!1)?(it||typeof Z.UNSAFE_componentWillUpdate!="function"&&typeof Z.componentWillUpdate!="function"||(typeof Z.componentWillUpdate=="function"&&Z.componentWillUpdate(D,Lt,be),typeof Z.UNSAFE_componentWillUpdate=="function"&&Z.UNSAFE_componentWillUpdate(D,Lt,be)),typeof Z.componentDidUpdate=="function"&&(m.flags|=4),typeof Z.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof Z.componentDidUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=4),typeof Z.getSnapshotBeforeUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=1024),m.memoizedProps=D,m.memoizedState=Lt),Z.props=D,Z.state=Lt,Z.context=be,D=De):(typeof Z.componentDidUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=4),typeof Z.getSnapshotBeforeUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=1024),D=!1)}return xk(p,m,P,D,W,j)}function xk(p,m,P,D,j,W){v5(p,m);var Z=(m.flags&128)!==0;if(!D&&!Z)return j&&EH(m,P,!1),Wc(p,m,W);D=m.stateNode,Fpe.current=m;var pe=Z&&typeof P.getDerivedStateFromError!="function"?null:D.render();return m.flags|=1,p!==null&&Z?(m.child=$h(m,p.child,null,W),m.child=$h(m,null,pe,W)):Mi(p,m,pe,W),m.memoizedState=D.state,j&&EH(m,P,!0),m.child}function w5(p){var m=p.stateNode;m.pendingContext?SH(p,m.pendingContext,m.pendingContext!==m.context):m.context&&SH(p,m.context,!1),ok(p,m.containerInfo)}function x5(p,m,P,D,j){return _h(),XO(j),m.flags|=256,Mi(p,m,P,D),m.child}var Sk={dehydrated:null,treeContext:null,retryLane:0};function Ck(p){return{baseLanes:p,cachePool:null,transitions:null}}function S5(p,m,P){var D=m.pendingProps,j=Br.current,W=!1,Z=(m.flags&128)!==0,pe;if((pe=Z)||(pe=p!==null&&p.memoizedState===null?!1:(j&2)!==0),pe?(W=!0,m.flags&=-129):(p===null||p.memoizedState!==null)&&(j|=1),xr(Br,j&1),p===null)return QO(m),p=m.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?(m.mode&1?p.data==="$!"?m.lanes=8:m.lanes=1073741824:m.lanes=1,null):(Z=D.children,p=D.fallback,W?(D=m.mode,W=m.child,Z={mode:"hidden",children:Z},!(D&1)&&W!==null?(W.childLanes=0,W.pendingProps=Z):W=uC(Z,D,0,null),p=Bf(p,D,P,null),W.return=m,p.return=m,W.sibling=p,m.child=W,m.child.memoizedState=Ck(P),m.memoizedState=Sk,p):Ek(m,Z));if(j=p.memoizedState,j!==null&&(pe=j.dehydrated,pe!==null))return jpe(p,m,Z,D,pe,j,P);if(W){W=D.fallback,Z=m.mode,j=p.child,pe=j.sibling;var be={mode:"hidden",children:D.children};return!(Z&1)&&m.child!==j?(D=m.child,D.childLanes=0,D.pendingProps=be,m.deletions=null):(D=cd(j,be),D.subtreeFlags=j.subtreeFlags&14680064),pe!==null?W=cd(pe,W):(W=Bf(W,Z,P,null),W.flags|=2),W.return=m,D.return=m,D.sibling=W,m.child=D,D=W,W=m.child,Z=p.child.memoizedState,Z=Z===null?Ck(P):{baseLanes:Z.baseLanes|P,cachePool:null,transitions:Z.transitions},W.memoizedState=Z,W.childLanes=p.childLanes&~P,m.memoizedState=Sk,D}return W=p.child,p=W.sibling,D=cd(W,{mode:"visible",children:D.children}),!(m.mode&1)&&(D.lanes=P),D.return=m,D.sibling=null,p!==null&&(P=m.deletions,P===null?(m.deletions=[p],m.flags|=16):P.push(p)),m.child=D,m.memoizedState=null,D}function Ek(p,m){return m=uC({mode:"visible",children:m},p.mode,0,null),m.return=p,p.child=m}function XS(p,m,P,D){return D!==null&&XO(D),$h(m,p.child,null,P),p=Ek(m,m.pendingProps.children),p.flags|=2,m.memoizedState=null,p}function jpe(p,m,P,D,j,W,Z){if(P)return m.flags&256?(m.flags&=-257,D=vk(Error(n(422))),XS(p,m,Z,D)):m.memoizedState!==null?(m.child=p.child,m.flags|=128,null):(W=D.fallback,j=m.mode,D=uC({mode:"visible",children:D.children},j,0,null),W=Bf(W,j,Z,null),W.flags|=2,D.return=m,W.return=m,D.sibling=W,m.child=D,m.mode&1&&$h(m,p.child,null,Z),m.child.memoizedState=Ck(Z),m.memoizedState=Sk,W);if(!(m.mode&1))return XS(p,m,Z,null);if(j.data==="$!"){if(D=j.nextSibling&&j.nextSibling.dataset,D)var pe=D.dgst;return D=pe,W=Error(n(419)),D=vk(W,D,void 0),XS(p,m,Z,D)}if(pe=(Z&p.childLanes)!==0,ta||pe){if(D=Bo,D!==null){switch(Z&-Z){case 4:j=2;break;case 16:j=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(D.suspendedLanes|Z)?0:j,j!==0&&j!==W.retryLane&&(W.retryLane=j,Hc(p,j),il(D,p,j,-1))}return Bk(),D=vk(Error(n(421))),XS(p,m,Z,D)}return j.data==="$?"?(m.flags|=128,m.child=p.child,m=Jpe.bind(null,p),j._reactRetry=m,null):(p=W.treeContext,Oa=Ju(j.nextSibling),Ta=m,_r=!0,tl=null,p!==null&&(ss[ls++]=zc,ss[ls++]=Vc,ss[ls++]=Af,zc=p.id,Vc=p.overflow,Af=m),m=Ek(m,D.children),m.flags|=4096,m)}function C5(p,m,P){p.lanes|=m;var D=p.alternate;D!==null&&(D.lanes|=m),tk(p.return,m,P)}function Pk(p,m,P,D,j){var W=p.memoizedState;W===null?p.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:D,tail:P,tailMode:j}:(W.isBackwards=m,W.rendering=null,W.renderingStartTime=0,W.last=D,W.tail=P,W.tailMode=j)}function E5(p,m,P){var D=m.pendingProps,j=D.revealOrder,W=D.tail;if(Mi(p,m,D.children,P),D=Br.current,D&2)D=D&1|2,m.flags|=128;else{if(p!==null&&p.flags&128)e:for(p=m.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&C5(p,P,m);else if(p.tag===19)C5(p,P,m);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===m)break e;for(;p.sibling===null;){if(p.return===null||p.return===m)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}D&=1}if(xr(Br,D),!(m.mode&1))m.memoizedState=null;else switch(j){case"forwards":for(P=m.child,j=null;P!==null;)p=P.alternate,p!==null&&US(p)===null&&(j=P),P=P.sibling;P=j,P===null?(j=m.child,m.child=null):(j=P.sibling,P.sibling=null),Pk(m,!1,j,P,W);break;case"backwards":for(P=null,j=m.child,m.child=null;j!==null;){if(p=j.alternate,p!==null&&US(p)===null){m.child=j;break}p=j.sibling,j.sibling=P,P=j,j=p}Pk(m,!0,P,null,W);break;case"together":Pk(m,!1,null,null,void 0);break;default:m.memoizedState=null}return m.child}function JS(p,m){!(m.mode&1)&&p!==null&&(p.alternate=null,m.alternate=null,m.flags|=2)}function Wc(p,m,P){if(p!==null&&(m.dependencies=p.dependencies),Nf|=m.lanes,!(P&m.childLanes))return null;if(p!==null&&m.child!==p.child)throw Error(n(153));if(m.child!==null){for(p=m.child,P=cd(p,p.pendingProps),m.child=P,P.return=m;p.sibling!==null;)p=p.sibling,P=P.sibling=cd(p,p.pendingProps),P.return=m;P.sibling=null}return m.child}function Bpe(p,m,P){switch(m.tag){case 3:w5(m),_h();break;case 5:FH(m);break;case 1:ea(m.type)&&_S(m);break;case 4:ok(m,m.stateNode.containerInfo);break;case 10:var D=m.type._context,j=m.memoizedProps.value;xr(BS,D._currentValue),D._currentValue=j;break;case 13:if(D=m.memoizedState,D!==null)return D.dehydrated!==null?(xr(Br,Br.current&1),m.flags|=128,null):P&m.child.childLanes?S5(p,m,P):(xr(Br,Br.current&1),p=Wc(p,m,P),p!==null?p.sibling:null);xr(Br,Br.current&1);break;case 19:if(D=(P&m.childLanes)!==0,p.flags&128){if(D)return E5(p,m,P);m.flags|=128}if(j=m.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),xr(Br,Br.current),D)break;return null;case 22:case 23:return m.lanes=0,y5(p,m,P)}return Wc(p,m,P)}var P5,Ik,I5,T5;P5=function(p,m){for(var P=m.child;P!==null;){if(P.tag===5||P.tag===6)p.appendChild(P.stateNode);else if(P.tag!==4&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===m)break;for(;P.sibling===null;){if(P.return===null||P.return===m)return;P=P.return}P.sibling.return=P.return,P=P.sibling}},Ik=function(){},I5=function(p,m,P,D){var j=p.memoizedProps;if(j!==D){p=m.stateNode,_f(Yl.current);var W=null;switch(P){case"input":j=me(p,j),D=me(p,D),W=[];break;case"select":j=K({},j,{value:void 0}),D=K({},D,{value:void 0}),W=[];break;case"textarea":j=de(p,j),D=de(p,D),W=[];break;default:typeof j.onClick!="function"&&typeof D.onClick=="function"&&(p.onclick=AS)}Vt(P,D);var Z;P=null;for(De in j)if(!D.hasOwnProperty(De)&&j.hasOwnProperty(De)&&j[De]!=null)if(De==="style"){var pe=j[De];for(Z in pe)pe.hasOwnProperty(Z)&&(P||(P={}),P[Z]="")}else De!=="dangerouslySetInnerHTML"&&De!=="children"&&De!=="suppressContentEditableWarning"&&De!=="suppressHydrationWarning"&&De!=="autoFocus"&&(o.hasOwnProperty(De)?W||(W=[]):(W=W||[]).push(De,null));for(De in D){var be=D[De];if(pe=j!=null?j[De]:void 0,D.hasOwnProperty(De)&&be!==pe&&(be!=null||pe!=null))if(De==="style")if(pe){for(Z in pe)!pe.hasOwnProperty(Z)||be&&be.hasOwnProperty(Z)||(P||(P={}),P[Z]="");for(Z in be)be.hasOwnProperty(Z)&&pe[Z]!==be[Z]&&(P||(P={}),P[Z]=be[Z])}else P||(W||(W=[]),W.push(De,P)),P=be;else De==="dangerouslySetInnerHTML"?(be=be?be.__html:void 0,pe=pe?pe.__html:void 0,be!=null&&pe!==be&&(W=W||[]).push(De,be)):De==="children"?typeof be!="string"&&typeof be!="number"||(W=W||[]).push(De,""+be):De!=="suppressContentEditableWarning"&&De!=="suppressHydrationWarning"&&(o.hasOwnProperty(De)?(be!=null&&De==="onScroll"&&Ir("scroll",p),W||pe===be||(W=[])):(W=W||[]).push(De,be))}P&&(W=W||[]).push("style",P);var De=W;(m.updateQueue=De)&&(m.flags|=4)}},T5=function(p,m,P,D){P!==D&&(m.flags|=4)};function zv(p,m){if(!_r)switch(p.tailMode){case"hidden":m=p.tail;for(var P=null;m!==null;)m.alternate!==null&&(P=m),m=m.sibling;P===null?p.tail=null:P.sibling=null;break;case"collapsed":P=p.tail;for(var D=null;P!==null;)P.alternate!==null&&(D=P),P=P.sibling;D===null?m||p.tail===null?p.tail=null:p.tail.sibling=null:D.sibling=null}}function pi(p){var m=p.alternate!==null&&p.alternate.child===p.child,P=0,D=0;if(m)for(var j=p.child;j!==null;)P|=j.lanes|j.childLanes,D|=j.subtreeFlags&14680064,D|=j.flags&14680064,j.return=p,j=j.sibling;else for(j=p.child;j!==null;)P|=j.lanes|j.childLanes,D|=j.subtreeFlags,D|=j.flags,j.return=p,j=j.sibling;return p.subtreeFlags|=D,p.childLanes=P,m}function zpe(p,m,P){var D=m.pendingProps;switch(KO(m),m.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pi(m),null;case 1:return ea(m.type)&&DS(),pi(m),null;case 3:return D=m.stateNode,Fh(),Tr(Zi),Tr(di),sk(),D.pendingContext&&(D.context=D.pendingContext,D.pendingContext=null),(p===null||p.child===null)&&(FS(m)?m.flags|=4:p===null||p.memoizedState.isDehydrated&&!(m.flags&256)||(m.flags|=1024,tl!==null&&(Lk(tl),tl=null))),Ik(p,m),pi(m),null;case 5:ik(m);var j=_f(Nv.current);if(P=m.type,p!==null&&m.stateNode!=null)I5(p,m,P,D,j),p.ref!==m.ref&&(m.flags|=512,m.flags|=2097152);else{if(!D){if(m.stateNode===null)throw Error(n(166));return pi(m),null}if(p=_f(Yl.current),FS(m)){D=m.stateNode,P=m.type;var W=m.memoizedProps;switch(D[Kl]=m,D[Av]=W,p=(m.mode&1)!==0,P){case"dialog":Ir("cancel",D),Ir("close",D);break;case"iframe":case"object":case"embed":Ir("load",D);break;case"video":case"audio":for(j=0;j<Ov.length;j++)Ir(Ov[j],D);break;case"source":Ir("error",D);break;case"img":case"image":case"link":Ir("error",D),Ir("load",D);break;case"details":Ir("toggle",D);break;case"input":Se(D,W),Ir("invalid",D);break;case"select":D._wrapperState={wasMultiple:!!W.multiple},Ir("invalid",D);break;case"textarea":$e(D,W),Ir("invalid",D)}Vt(P,W),j=null;for(var Z in W)if(W.hasOwnProperty(Z)){var pe=W[Z];Z==="children"?typeof pe=="string"?D.textContent!==pe&&(W.suppressHydrationWarning!==!0&&MS(D.textContent,pe,p),j=["children",pe]):typeof pe=="number"&&D.textContent!==""+pe&&(W.suppressHydrationWarning!==!0&&MS(D.textContent,pe,p),j=["children",""+pe]):o.hasOwnProperty(Z)&&pe!=null&&Z==="onScroll"&&Ir("scroll",D)}switch(P){case"input":he(D),xe(D,W,!0);break;case"textarea":he(D),Ne(D);break;case"select":case"option":break;default:typeof W.onClick=="function"&&(D.onclick=AS)}D=j,m.updateQueue=D,D!==null&&(m.flags|=4)}else{Z=j.nodeType===9?j:j.ownerDocument,p==="http://www.w3.org/1999/xhtml"&&(p=Ue(P)),p==="http://www.w3.org/1999/xhtml"?P==="script"?(p=Z.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild)):typeof D.is=="string"?p=Z.createElement(P,{is:D.is}):(p=Z.createElement(P),P==="select"&&(Z=p,D.multiple?Z.multiple=!0:D.size&&(Z.size=D.size))):p=Z.createElementNS(p,P),p[Kl]=m,p[Av]=D,P5(p,m,!1,!1),m.stateNode=p;e:{switch(Z=Mn(P,D),P){case"dialog":Ir("cancel",p),Ir("close",p),j=D;break;case"iframe":case"object":case"embed":Ir("load",p),j=D;break;case"video":case"audio":for(j=0;j<Ov.length;j++)Ir(Ov[j],p);j=D;break;case"source":Ir("error",p),j=D;break;case"img":case"image":case"link":Ir("error",p),Ir("load",p),j=D;break;case"details":Ir("toggle",p),j=D;break;case"input":Se(p,D),j=me(p,D),Ir("invalid",p);break;case"option":j=D;break;case"select":p._wrapperState={wasMultiple:!!D.multiple},j=K({},D,{value:void 0}),Ir("invalid",p);break;case"textarea":$e(p,D),j=de(p,D),Ir("invalid",p);break;default:j=D}Vt(P,j),pe=j;for(W in pe)if(pe.hasOwnProperty(W)){var be=pe[W];W==="style"?Bt(p,be):W==="dangerouslySetInnerHTML"?(be=be?be.__html:void 0,be!=null&&Ye(p,be)):W==="children"?typeof be=="string"?(P!=="textarea"||be!=="")&&et(p,be):typeof be=="number"&&et(p,""+be):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(o.hasOwnProperty(W)?be!=null&&W==="onScroll"&&Ir("scroll",p):be!=null&&C(p,W,be,Z))}switch(P){case"input":he(p),xe(p,D,!1);break;case"textarea":he(p),Ne(p);break;case"option":D.value!=null&&p.setAttribute("value",""+ae(D.value));break;case"select":p.multiple=!!D.multiple,W=D.value,W!=null?Le(p,!!D.multiple,W,!1):D.defaultValue!=null&&Le(p,!!D.multiple,D.defaultValue,!0);break;default:typeof j.onClick=="function"&&(p.onclick=AS)}switch(P){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}}D&&(m.flags|=4)}m.ref!==null&&(m.flags|=512,m.flags|=2097152)}return pi(m),null;case 6:if(p&&m.stateNode!=null)T5(p,m,p.memoizedProps,D);else{if(typeof D!="string"&&m.stateNode===null)throw Error(n(166));if(P=_f(Nv.current),_f(Yl.current),FS(m)){if(D=m.stateNode,P=m.memoizedProps,D[Kl]=m,(W=D.nodeValue!==P)&&(p=Ta,p!==null))switch(p.tag){case 3:MS(D.nodeValue,P,(p.mode&1)!==0);break;case 5:p.memoizedProps.suppressHydrationWarning!==!0&&MS(D.nodeValue,P,(p.mode&1)!==0)}W&&(m.flags|=4)}else D=(P.nodeType===9?P:P.ownerDocument).createTextNode(D),D[Kl]=m,m.stateNode=D}return pi(m),null;case 13:if(Tr(Br),D=m.memoizedState,p===null||p.memoizedState!==null&&p.memoizedState.dehydrated!==null){if(_r&&Oa!==null&&m.mode&1&&!(m.flags&128))MH(),_h(),m.flags|=98560,W=!1;else if(W=FS(m),D!==null&&D.dehydrated!==null){if(p===null){if(!W)throw Error(n(318));if(W=m.memoizedState,W=W!==null?W.dehydrated:null,!W)throw Error(n(317));W[Kl]=m}else _h(),!(m.flags&128)&&(m.memoizedState=null),m.flags|=4;pi(m),W=!1}else tl!==null&&(Lk(tl),tl=null),W=!0;if(!W)return m.flags&65536?m:null}return m.flags&128?(m.lanes=P,m):(D=D!==null,D!==(p!==null&&p.memoizedState!==null)&&D&&(m.child.flags|=8192,m.mode&1&&(p===null||Br.current&1?Po===0&&(Po=3):Bk())),m.updateQueue!==null&&(m.flags|=4),pi(m),null);case 4:return Fh(),Ik(p,m),p===null&&kv(m.stateNode.containerInfo),pi(m),null;case 10:return ek(m.type._context),pi(m),null;case 17:return ea(m.type)&&DS(),pi(m),null;case 19:if(Tr(Br),W=m.memoizedState,W===null)return pi(m),null;if(D=(m.flags&128)!==0,Z=W.rendering,Z===null)if(D)zv(W,!1);else{if(Po!==0||p!==null&&p.flags&128)for(p=m.child;p!==null;){if(Z=US(p),Z!==null){for(m.flags|=128,zv(W,!1),D=Z.updateQueue,D!==null&&(m.updateQueue=D,m.flags|=4),m.subtreeFlags=0,D=P,P=m.child;P!==null;)W=P,p=D,W.flags&=14680066,Z=W.alternate,Z===null?(W.childLanes=0,W.lanes=p,W.child=null,W.subtreeFlags=0,W.memoizedProps=null,W.memoizedState=null,W.updateQueue=null,W.dependencies=null,W.stateNode=null):(W.childLanes=Z.childLanes,W.lanes=Z.lanes,W.child=Z.child,W.subtreeFlags=0,W.deletions=null,W.memoizedProps=Z.memoizedProps,W.memoizedState=Z.memoizedState,W.updateQueue=Z.updateQueue,W.type=Z.type,p=Z.dependencies,W.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),P=P.sibling;return xr(Br,Br.current&1|2),m.child}p=p.sibling}W.tail!==null&&jr()>Vh&&(m.flags|=128,D=!0,zv(W,!1),m.lanes=4194304)}else{if(!D)if(p=US(Z),p!==null){if(m.flags|=128,D=!0,P=p.updateQueue,P!==null&&(m.updateQueue=P,m.flags|=4),zv(W,!0),W.tail===null&&W.tailMode==="hidden"&&!Z.alternate&&!_r)return pi(m),null}else 2*jr()-W.renderingStartTime>Vh&&P!==1073741824&&(m.flags|=128,D=!0,zv(W,!1),m.lanes=4194304);W.isBackwards?(Z.sibling=m.child,m.child=Z):(P=W.last,P!==null?P.sibling=Z:m.child=Z,W.last=Z)}return W.tail!==null?(m=W.tail,W.rendering=m,W.tail=m.sibling,W.renderingStartTime=jr(),m.sibling=null,P=Br.current,xr(Br,D?P&1|2:P&1),m):(pi(m),null);case 22:case 23:return jk(),D=m.memoizedState!==null,p!==null&&p.memoizedState!==null!==D&&(m.flags|=8192),D&&m.mode&1?ka&1073741824&&(pi(m),m.subtreeFlags&6&&(m.flags|=8192)):pi(m),null;case 24:return null;case 25:return null}throw Error(n(156,m.tag))}function Vpe(p,m){switch(KO(m),m.tag){case 1:return ea(m.type)&&DS(),p=m.flags,p&65536?(m.flags=p&-65537|128,m):null;case 3:return Fh(),Tr(Zi),Tr(di),sk(),p=m.flags,p&65536&&!(p&128)?(m.flags=p&-65537|128,m):null;case 5:return ik(m),null;case 13:if(Tr(Br),p=m.memoizedState,p!==null&&p.dehydrated!==null){if(m.alternate===null)throw Error(n(340));_h()}return p=m.flags,p&65536?(m.flags=p&-65537|128,m):null;case 19:return Tr(Br),null;case 4:return Fh(),null;case 10:return ek(m.type._context),null;case 22:case 23:return jk(),null;case 24:return null;default:return null}}var ZS=!1,hi=!1,Hpe=typeof WeakSet=="function"?WeakSet:Set,$t=null;function Bh(p,m){var P=p.ref;if(P!==null)if(typeof P=="function")try{P(null)}catch(D){Xr(p,m,D)}else P.current=null}function Tk(p,m,P){try{P()}catch(D){Xr(p,m,D)}}var O5=!1;function Upe(p,m){if(jO=bS,p=aH(),AO(p)){if("selectionStart"in p)var P={start:p.selectionStart,end:p.selectionEnd};else e:{P=(P=p.ownerDocument)&&P.defaultView||window;var D=P.getSelection&&P.getSelection();if(D&&D.rangeCount!==0){P=D.anchorNode;var j=D.anchorOffset,W=D.focusNode;D=D.focusOffset;try{P.nodeType,W.nodeType}catch{P=null;break e}var Z=0,pe=-1,be=-1,De=0,it=0,ct=p,ot=null;t:for(;;){for(var Mt;ct!==P||j!==0&&ct.nodeType!==3||(pe=Z+j),ct!==W||D!==0&&ct.nodeType!==3||(be=Z+D),ct.nodeType===3&&(Z+=ct.nodeValue.length),(Mt=ct.firstChild)!==null;)ot=ct,ct=Mt;for(;;){if(ct===p)break t;if(ot===P&&++De===j&&(pe=Z),ot===W&&++it===D&&(be=Z),(Mt=ct.nextSibling)!==null)break;ct=ot,ot=ct.parentNode}ct=Mt}P=pe===-1||be===-1?null:{start:pe,end:be}}else P=null}P=P||{start:0,end:0}}else P=null;for(BO={focusedElem:p,selectionRange:P},bS=!1,$t=m;$t!==null;)if(m=$t,p=m.child,(m.subtreeFlags&1028)!==0&&p!==null)p.return=m,$t=p;else for(;$t!==null;){m=$t;try{var Lt=m.alternate;if(m.flags&1024)switch(m.tag){case 0:case 11:case 15:break;case 1:if(Lt!==null){var jt=Lt.memoizedProps,so=Lt.memoizedState,ke=m.stateNode,Ce=ke.getSnapshotBeforeUpdate(m.elementType===m.type?jt:nl(m.type,jt),so);ke.__reactInternalSnapshotBeforeUpdate=Ce}break;case 3:var Me=m.stateNode.containerInfo;Me.nodeType===1?Me.textContent="":Me.nodeType===9&&Me.documentElement&&Me.removeChild(Me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ht){Xr(m,m.return,ht)}if(p=m.sibling,p!==null){p.return=m.return,$t=p;break}$t=m.return}return Lt=O5,O5=!1,Lt}function Vv(p,m,P){var D=m.updateQueue;if(D=D!==null?D.lastEffect:null,D!==null){var j=D=D.next;do{if((j.tag&p)===p){var W=j.destroy;j.destroy=void 0,W!==void 0&&Tk(m,P,W)}j=j.next}while(j!==D)}}function eC(p,m){if(m=m.updateQueue,m=m!==null?m.lastEffect:null,m!==null){var P=m=m.next;do{if((P.tag&p)===p){var D=P.create;P.destroy=D()}P=P.next}while(P!==m)}}function Ok(p){var m=p.ref;if(m!==null){var P=p.stateNode;switch(p.tag){case 5:p=P;break;default:p=P}typeof m=="function"?m(p):m.current=p}}function k5(p){var m=p.alternate;m!==null&&(p.alternate=null,k5(m)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(m=p.stateNode,m!==null&&(delete m[Kl],delete m[Av],delete m[UO],delete m[Ipe],delete m[Tpe])),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function M5(p){return p.tag===5||p.tag===3||p.tag===4}function A5(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||M5(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function kk(p,m,P){var D=p.tag;if(D===5||D===6)p=p.stateNode,m?P.nodeType===8?P.parentNode.insertBefore(p,m):P.insertBefore(p,m):(P.nodeType===8?(m=P.parentNode,m.insertBefore(p,P)):(m=P,m.appendChild(p)),P=P._reactRootContainer,P!=null||m.onclick!==null||(m.onclick=AS));else if(D!==4&&(p=p.child,p!==null))for(kk(p,m,P),p=p.sibling;p!==null;)kk(p,m,P),p=p.sibling}function Mk(p,m,P){var D=p.tag;if(D===5||D===6)p=p.stateNode,m?P.insertBefore(p,m):P.appendChild(p);else if(D!==4&&(p=p.child,p!==null))for(Mk(p,m,P),p=p.sibling;p!==null;)Mk(p,m,P),p=p.sibling}var ei=null,rl=!1;function od(p,m,P){for(P=P.child;P!==null;)R5(p,m,P),P=P.sibling}function R5(p,m,P){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(ql,P)}catch{}switch(P.tag){case 5:hi||Bh(P,m);case 6:var D=ei,j=rl;ei=null,od(p,m,P),ei=D,rl=j,ei!==null&&(rl?(p=ei,P=P.stateNode,p.nodeType===8?p.parentNode.removeChild(P):p.removeChild(P)):ei.removeChild(P.stateNode));break;case 18:ei!==null&&(rl?(p=ei,P=P.stateNode,p.nodeType===8?HO(p.parentNode,P):p.nodeType===1&&HO(p,P),wv(p)):HO(ei,P.stateNode));break;case 4:D=ei,j=rl,ei=P.stateNode.containerInfo,rl=!0,od(p,m,P),ei=D,rl=j;break;case 0:case 11:case 14:case 15:if(!hi&&(D=P.updateQueue,D!==null&&(D=D.lastEffect,D!==null))){j=D=D.next;do{var W=j,Z=W.destroy;W=W.tag,Z!==void 0&&(W&2||W&4)&&Tk(P,m,Z),j=j.next}while(j!==D)}od(p,m,P);break;case 1:if(!hi&&(Bh(P,m),D=P.stateNode,typeof D.componentWillUnmount=="function"))try{D.props=P.memoizedProps,D.state=P.memoizedState,D.componentWillUnmount()}catch(pe){Xr(P,m,pe)}od(p,m,P);break;case 21:od(p,m,P);break;case 22:P.mode&1?(hi=(D=hi)||P.memoizedState!==null,od(p,m,P),hi=D):od(p,m,P);break;default:od(p,m,P)}}function D5(p){var m=p.updateQueue;if(m!==null){p.updateQueue=null;var P=p.stateNode;P===null&&(P=p.stateNode=new Hpe),m.forEach(function(D){var j=Zpe.bind(null,p,D);P.has(D)||(P.add(D),D.then(j,j))})}}function ol(p,m){var P=m.deletions;if(P!==null)for(var D=0;D<P.length;D++){var j=P[D];try{var W=p,Z=m,pe=Z;e:for(;pe!==null;){switch(pe.tag){case 5:ei=pe.stateNode,rl=!1;break e;case 3:ei=pe.stateNode.containerInfo,rl=!0;break e;case 4:ei=pe.stateNode.containerInfo,rl=!0;break e}pe=pe.return}if(ei===null)throw Error(n(160));R5(W,Z,j),ei=null,rl=!1;var be=j.alternate;be!==null&&(be.return=null),j.return=null}catch(De){Xr(j,m,De)}}if(m.subtreeFlags&12854)for(m=m.child;m!==null;)_5(m,p),m=m.sibling}function _5(p,m){var P=p.alternate,D=p.flags;switch(p.tag){case 0:case 11:case 14:case 15:if(ol(m,p),Xl(p),D&4){try{Vv(3,p,p.return),eC(3,p)}catch(jt){Xr(p,p.return,jt)}try{Vv(5,p,p.return)}catch(jt){Xr(p,p.return,jt)}}break;case 1:ol(m,p),Xl(p),D&512&&P!==null&&Bh(P,P.return);break;case 5:if(ol(m,p),Xl(p),D&512&&P!==null&&Bh(P,P.return),p.flags&32){var j=p.stateNode;try{et(j,"")}catch(jt){Xr(p,p.return,jt)}}if(D&4&&(j=p.stateNode,j!=null)){var W=p.memoizedProps,Z=P!==null?P.memoizedProps:W,pe=p.type,be=p.updateQueue;if(p.updateQueue=null,be!==null)try{pe==="input"&&W.type==="radio"&&W.name!=null&&Ee(j,W),Mn(pe,Z);var De=Mn(pe,W);for(Z=0;Z<be.length;Z+=2){var it=be[Z],ct=be[Z+1];it==="style"?Bt(j,ct):it==="dangerouslySetInnerHTML"?Ye(j,ct):it==="children"?et(j,ct):C(j,it,ct,De)}switch(pe){case"input":ge(j,W);break;case"textarea":Ae(j,W);break;case"select":var ot=j._wrapperState.wasMultiple;j._wrapperState.wasMultiple=!!W.multiple;var Mt=W.value;Mt!=null?Le(j,!!W.multiple,Mt,!1):ot!==!!W.multiple&&(W.defaultValue!=null?Le(j,!!W.multiple,W.defaultValue,!0):Le(j,!!W.multiple,W.multiple?[]:"",!1))}j[Av]=W}catch(jt){Xr(p,p.return,jt)}}break;case 6:if(ol(m,p),Xl(p),D&4){if(p.stateNode===null)throw Error(n(162));j=p.stateNode,W=p.memoizedProps;try{j.nodeValue=W}catch(jt){Xr(p,p.return,jt)}}break;case 3:if(ol(m,p),Xl(p),D&4&&P!==null&&P.memoizedState.isDehydrated)try{wv(m.containerInfo)}catch(jt){Xr(p,p.return,jt)}break;case 4:ol(m,p),Xl(p);break;case 13:ol(m,p),Xl(p),j=p.child,j.flags&8192&&(W=j.memoizedState!==null,j.stateNode.isHidden=W,!W||j.alternate!==null&&j.alternate.memoizedState!==null||(Dk=jr())),D&4&&D5(p);break;case 22:if(it=P!==null&&P.memoizedState!==null,p.mode&1?(hi=(De=hi)||it,ol(m,p),hi=De):ol(m,p),Xl(p),D&8192){if(De=p.memoizedState!==null,(p.stateNode.isHidden=De)&&!it&&p.mode&1)for($t=p,it=p.child;it!==null;){for(ct=$t=it;$t!==null;){switch(ot=$t,Mt=ot.child,ot.tag){case 0:case 11:case 14:case 15:Vv(4,ot,ot.return);break;case 1:Bh(ot,ot.return);var Lt=ot.stateNode;if(typeof Lt.componentWillUnmount=="function"){D=ot,P=ot.return;try{m=D,Lt.props=m.memoizedProps,Lt.state=m.memoizedState,Lt.componentWillUnmount()}catch(jt){Xr(D,P,jt)}}break;case 5:Bh(ot,ot.return);break;case 22:if(ot.memoizedState!==null){L5(ct);continue}}Mt!==null?(Mt.return=ot,$t=Mt):L5(ct)}it=it.sibling}e:for(it=null,ct=p;;){if(ct.tag===5){if(it===null){it=ct;try{j=ct.stateNode,De?(W=j.style,typeof W.setProperty=="function"?W.setProperty("display","none","important"):W.display="none"):(pe=ct.stateNode,be=ct.memoizedProps.style,Z=be!=null&&be.hasOwnProperty("display")?be.display:null,pe.style.display=At("display",Z))}catch(jt){Xr(p,p.return,jt)}}}else if(ct.tag===6){if(it===null)try{ct.stateNode.nodeValue=De?"":ct.memoizedProps}catch(jt){Xr(p,p.return,jt)}}else if((ct.tag!==22&&ct.tag!==23||ct.memoizedState===null||ct===p)&&ct.child!==null){ct.child.return=ct,ct=ct.child;continue}if(ct===p)break e;for(;ct.sibling===null;){if(ct.return===null||ct.return===p)break e;it===ct&&(it=null),ct=ct.return}it===ct&&(it=null),ct.sibling.return=ct.return,ct=ct.sibling}}break;case 19:ol(m,p),Xl(p),D&4&&D5(p);break;case 21:break;default:ol(m,p),Xl(p)}}function Xl(p){var m=p.flags;if(m&2){try{e:{for(var P=p.return;P!==null;){if(M5(P)){var D=P;break e}P=P.return}throw Error(n(160))}switch(D.tag){case 5:var j=D.stateNode;D.flags&32&&(et(j,""),D.flags&=-33);var W=A5(p);Mk(p,W,j);break;case 3:case 4:var Z=D.stateNode.containerInfo,pe=A5(p);kk(p,pe,Z);break;default:throw Error(n(161))}}catch(be){Xr(p,p.return,be)}p.flags&=-3}m&4096&&(p.flags&=-4097)}function Wpe(p,m,P){$t=p,$5(p)}function $5(p,m,P){for(var D=(p.mode&1)!==0;$t!==null;){var j=$t,W=j.child;if(j.tag===22&&D){var Z=j.memoizedState!==null||ZS;if(!Z){var pe=j.alternate,be=pe!==null&&pe.memoizedState!==null||hi;pe=ZS;var De=hi;if(ZS=Z,(hi=be)&&!De)for($t=j;$t!==null;)Z=$t,be=Z.child,Z.tag===22&&Z.memoizedState!==null?F5(j):be!==null?(be.return=Z,$t=be):F5(j);for(;W!==null;)$t=W,$5(W),W=W.sibling;$t=j,ZS=pe,hi=De}N5(p)}else j.subtreeFlags&8772&&W!==null?(W.return=j,$t=W):N5(p)}}function N5(p){for(;$t!==null;){var m=$t;if(m.flags&8772){var P=m.alternate;try{if(m.flags&8772)switch(m.tag){case 0:case 11:case 15:hi||eC(5,m);break;case 1:var D=m.stateNode;if(m.flags&4&&!hi)if(P===null)D.componentDidMount();else{var j=m.elementType===m.type?P.memoizedProps:nl(m.type,P.memoizedProps);D.componentDidUpdate(j,P.memoizedState,D.__reactInternalSnapshotBeforeUpdate)}var W=m.updateQueue;W!==null&&LH(m,W,D);break;case 3:var Z=m.updateQueue;if(Z!==null){if(P=null,m.child!==null)switch(m.child.tag){case 5:P=m.child.stateNode;break;case 1:P=m.child.stateNode}LH(m,Z,P)}break;case 5:var pe=m.stateNode;if(P===null&&m.flags&4){P=pe;var be=m.memoizedProps;switch(m.type){case"button":case"input":case"select":case"textarea":be.autoFocus&&P.focus();break;case"img":be.src&&(P.src=be.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(m.memoizedState===null){var De=m.alternate;if(De!==null){var it=De.memoizedState;if(it!==null){var ct=it.dehydrated;ct!==null&&wv(ct)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}hi||m.flags&512&&Ok(m)}catch(ot){Xr(m,m.return,ot)}}if(m===p){$t=null;break}if(P=m.sibling,P!==null){P.return=m.return,$t=P;break}$t=m.return}}function L5(p){for(;$t!==null;){var m=$t;if(m===p){$t=null;break}var P=m.sibling;if(P!==null){P.return=m.return,$t=P;break}$t=m.return}}function F5(p){for(;$t!==null;){var m=$t;try{switch(m.tag){case 0:case 11:case 15:var P=m.return;try{eC(4,m)}catch(be){Xr(m,P,be)}break;case 1:var D=m.stateNode;if(typeof D.componentDidMount=="function"){var j=m.return;try{D.componentDidMount()}catch(be){Xr(m,j,be)}}var W=m.return;try{Ok(m)}catch(be){Xr(m,W,be)}break;case 5:var Z=m.return;try{Ok(m)}catch(be){Xr(m,Z,be)}}}catch(be){Xr(m,m.return,be)}if(m===p){$t=null;break}var pe=m.sibling;if(pe!==null){pe.return=m.return,$t=pe;break}$t=m.return}}var Gpe=Math.ceil,tC=I.ReactCurrentDispatcher,Ak=I.ReactCurrentOwner,ds=I.ReactCurrentBatchConfig,Hn=0,Bo=null,go=null,ti=0,ka=0,zh=Zu(0),Po=0,Hv=null,Nf=0,nC=0,Rk=0,Uv=null,na=null,Dk=0,Vh=1/0,Gc=null,rC=!1,_k=null,id=null,oC=!1,ad=null,iC=0,Wv=0,$k=null,aC=-1,sC=0;function Ai(){return Hn&6?jr():aC!==-1?aC:aC=jr()}function sd(p){return p.mode&1?Hn&2&&ti!==0?ti&-ti:kpe.transition!==null?(sC===0&&(sC=AV()),sC):(p=ur,p!==0||(p=window.event,p=p===void 0?16:BV(p.type)),p):1}function il(p,m,P,D){if(50<Wv)throw Wv=0,$k=null,Error(n(185));mv(p,P,D),(!(Hn&2)||p!==Bo)&&(p===Bo&&(!(Hn&2)&&(nC|=P),Po===4&&ld(p,ti)),ra(p,D),P===1&&Hn===0&&!(m.mode&1)&&(Vh=jr()+500,$S&&td()))}function ra(p,m){var P=p.callbackNode;kfe(p,m);var D=gS(p,p===Bo?ti:0);if(D===0)P!==null&&Fr(P),p.callbackNode=null,p.callbackPriority=0;else if(m=D&-D,p.callbackPriority!==m){if(P!=null&&Fr(P),m===1)p.tag===0?Ope(B5.bind(null,p)):PH(B5.bind(null,p)),Epe(function(){!(Hn&6)&&td()}),P=null;else{switch(RV(D)){case 1:P=Wu;break;case 4:P=Of;break;case 16:P=$n;break;case 536870912:P=Js;break;default:P=$n}P=K5(P,j5.bind(null,p))}p.callbackPriority=m,p.callbackNode=P}}function j5(p,m){if(aC=-1,sC=0,Hn&6)throw Error(n(327));var P=p.callbackNode;if(Hh()&&p.callbackNode!==P)return null;var D=gS(p,p===Bo?ti:0);if(D===0)return null;if(D&30||D&p.expiredLanes||m)m=lC(p,D);else{m=D;var j=Hn;Hn|=2;var W=V5();(Bo!==p||ti!==m)&&(Gc=null,Vh=jr()+500,Ff(p,m));do try{Ype();break}catch(pe){z5(p,pe)}while(!0);ZO(),tC.current=W,Hn=j,go!==null?m=0:(Bo=null,ti=0,m=Po)}if(m!==0){if(m===2&&(j=mO(p),j!==0&&(D=j,m=Nk(p,j))),m===1)throw P=Hv,Ff(p,0),ld(p,D),ra(p,jr()),P;if(m===6)ld(p,D);else{if(j=p.current.alternate,!(D&30)&&!qpe(j)&&(m=lC(p,D),m===2&&(W=mO(p),W!==0&&(D=W,m=Nk(p,W))),m===1))throw P=Hv,Ff(p,0),ld(p,D),ra(p,jr()),P;switch(p.finishedWork=j,p.finishedLanes=D,m){case 0:case 1:throw Error(n(345));case 2:jf(p,na,Gc);break;case 3:if(ld(p,D),(D&130023424)===D&&(m=Dk+500-jr(),10<m)){if(gS(p,0)!==0)break;if(j=p.suspendedLanes,(j&D)!==D){Ai(),p.pingedLanes|=p.suspendedLanes&j;break}p.timeoutHandle=VO(jf.bind(null,p,na,Gc),m);break}jf(p,na,Gc);break;case 4:if(ld(p,D),(D&4194240)===D)break;for(m=p.eventTimes,j=-1;0<D;){var Z=31-Zs(D);W=1<<Z,Z=m[Z],Z>j&&(j=Z),D&=~W}if(D=j,D=jr()-D,D=(120>D?120:480>D?480:1080>D?1080:1920>D?1920:3e3>D?3e3:4320>D?4320:1960*Gpe(D/1960))-D,10<D){p.timeoutHandle=VO(jf.bind(null,p,na,Gc),D);break}jf(p,na,Gc);break;case 5:jf(p,na,Gc);break;default:throw Error(n(329))}}}return ra(p,jr()),p.callbackNode===P?j5.bind(null,p):null}function Nk(p,m){var P=Uv;return p.current.memoizedState.isDehydrated&&(Ff(p,m).flags|=256),p=lC(p,m),p!==2&&(m=na,na=P,m!==null&&Lk(m)),p}function Lk(p){na===null?na=p:na.push.apply(na,p)}function qpe(p){for(var m=p;;){if(m.flags&16384){var P=m.updateQueue;if(P!==null&&(P=P.stores,P!==null))for(var D=0;D<P.length;D++){var j=P[D],W=j.getSnapshot;j=j.value;try{if(!el(W(),j))return!1}catch{return!1}}}if(P=m.child,m.subtreeFlags&16384&&P!==null)P.return=m,m=P;else{if(m===p)break;for(;m.sibling===null;){if(m.return===null||m.return===p)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function ld(p,m){for(m&=~Rk,m&=~nC,p.suspendedLanes|=m,p.pingedLanes&=~m,p=p.expirationTimes;0<m;){var P=31-Zs(m),D=1<<P;p[P]=-1,m&=~D}}function B5(p){if(Hn&6)throw Error(n(327));Hh();var m=gS(p,0);if(!(m&1))return ra(p,jr()),null;var P=lC(p,m);if(p.tag!==0&&P===2){var D=mO(p);D!==0&&(m=D,P=Nk(p,D))}if(P===1)throw P=Hv,Ff(p,0),ld(p,m),ra(p,jr()),P;if(P===6)throw Error(n(345));return p.finishedWork=p.current.alternate,p.finishedLanes=m,jf(p,na,Gc),ra(p,jr()),null}function Fk(p,m){var P=Hn;Hn|=1;try{return p(m)}finally{Hn=P,Hn===0&&(Vh=jr()+500,$S&&td())}}function Lf(p){ad!==null&&ad.tag===0&&!(Hn&6)&&Hh();var m=Hn;Hn|=1;var P=ds.transition,D=ur;try{if(ds.transition=null,ur=1,p)return p()}finally{ur=D,ds.transition=P,Hn=m,!(Hn&6)&&td()}}function jk(){ka=zh.current,Tr(zh)}function Ff(p,m){p.finishedWork=null,p.finishedLanes=0;var P=p.timeoutHandle;if(P!==-1&&(p.timeoutHandle=-1,Cpe(P)),go!==null)for(P=go.return;P!==null;){var D=P;switch(KO(D),D.tag){case 1:D=D.type.childContextTypes,D!=null&&DS();break;case 3:Fh(),Tr(Zi),Tr(di),sk();break;case 5:ik(D);break;case 4:Fh();break;case 13:Tr(Br);break;case 19:Tr(Br);break;case 10:ek(D.type._context);break;case 22:case 23:jk()}P=P.return}if(Bo=p,go=p=cd(p.current,null),ti=ka=m,Po=0,Hv=null,Rk=nC=Nf=0,na=Uv=null,Df!==null){for(m=0;m<Df.length;m++)if(P=Df[m],D=P.interleaved,D!==null){P.interleaved=null;var j=D.next,W=P.pending;if(W!==null){var Z=W.next;W.next=j,D.next=Z}P.pending=D}Df=null}return p}function z5(p,m){do{var P=go;try{if(ZO(),WS.current=YS,GS){for(var D=zr.memoizedState;D!==null;){var j=D.queue;j!==null&&(j.pending=null),D=D.next}GS=!1}if($f=0,jo=Eo=zr=null,Lv=!1,Fv=0,Ak.current=null,P===null||P.return===null){Po=1,Hv=m,go=null;break}e:{var W=p,Z=P.return,pe=P,be=m;if(m=ti,pe.flags|=32768,be!==null&&typeof be=="object"&&typeof be.then=="function"){var De=be,it=pe,ct=it.tag;if(!(it.mode&1)&&(ct===0||ct===11||ct===15)){var ot=it.alternate;ot?(it.updateQueue=ot.updateQueue,it.memoizedState=ot.memoizedState,it.lanes=ot.lanes):(it.updateQueue=null,it.memoizedState=null)}var Mt=f5(Z);if(Mt!==null){Mt.flags&=-257,p5(Mt,Z,pe,W,m),Mt.mode&1&&d5(W,De,m),m=Mt,be=De;var Lt=m.updateQueue;if(Lt===null){var jt=new Set;jt.add(be),m.updateQueue=jt}else Lt.add(be);break e}else{if(!(m&1)){d5(W,De,m),Bk();break e}be=Error(n(426))}}else if(_r&&pe.mode&1){var so=f5(Z);if(so!==null){!(so.flags&65536)&&(so.flags|=256),p5(so,Z,pe,W,m),XO(jh(be,pe));break e}}W=be=jh(be,pe),Po!==4&&(Po=2),Uv===null?Uv=[W]:Uv.push(W),W=Z;do{switch(W.tag){case 3:W.flags|=65536,m&=-m,W.lanes|=m;var ke=c5(W,be,m);NH(W,ke);break e;case 1:pe=be;var Ce=W.type,Me=W.stateNode;if(!(W.flags&128)&&(typeof Ce.getDerivedStateFromError=="function"||Me!==null&&typeof Me.componentDidCatch=="function"&&(id===null||!id.has(Me)))){W.flags|=65536,m&=-m,W.lanes|=m;var ht=u5(W,pe,m);NH(W,ht);break e}}W=W.return}while(W!==null)}U5(P)}catch(Ht){m=Ht,go===P&&P!==null&&(go=P=P.return);continue}break}while(!0)}function V5(){var p=tC.current;return tC.current=YS,p===null?YS:p}function Bk(){(Po===0||Po===3||Po===2)&&(Po=4),Bo===null||!(Nf&268435455)&&!(nC&268435455)||ld(Bo,ti)}function lC(p,m){var P=Hn;Hn|=2;var D=V5();(Bo!==p||ti!==m)&&(Gc=null,Ff(p,m));do try{Kpe();break}catch(j){z5(p,j)}while(!0);if(ZO(),Hn=P,tC.current=D,go!==null)throw Error(n(261));return Bo=null,ti=0,Po}function Kpe(){for(;go!==null;)H5(go)}function Ype(){for(;go!==null&&!Ji();)H5(go)}function H5(p){var m=q5(p.alternate,p,ka);p.memoizedProps=p.pendingProps,m===null?U5(p):go=m,Ak.current=null}function U5(p){var m=p;do{var P=m.alternate;if(p=m.return,m.flags&32768){if(P=Vpe(P,m),P!==null){P.flags&=32767,go=P;return}if(p!==null)p.flags|=32768,p.subtreeFlags=0,p.deletions=null;else{Po=6,go=null;return}}else if(P=zpe(P,m,ka),P!==null){go=P;return}if(m=m.sibling,m!==null){go=m;return}go=m=p}while(m!==null);Po===0&&(Po=5)}function jf(p,m,P){var D=ur,j=ds.transition;try{ds.transition=null,ur=1,Qpe(p,m,P,D)}finally{ds.transition=j,ur=D}return null}function Qpe(p,m,P,D){do Hh();while(ad!==null);if(Hn&6)throw Error(n(327));P=p.finishedWork;var j=p.finishedLanes;if(P===null)return null;if(p.finishedWork=null,p.finishedLanes=0,P===p.current)throw Error(n(177));p.callbackNode=null,p.callbackPriority=0;var W=P.lanes|P.childLanes;if(Mfe(p,W),p===Bo&&(go=Bo=null,ti=0),!(P.subtreeFlags&2064)&&!(P.flags&2064)||oC||(oC=!0,K5($n,function(){return Hh(),null})),W=(P.flags&15990)!==0,P.subtreeFlags&15990||W){W=ds.transition,ds.transition=null;var Z=ur;ur=1;var pe=Hn;Hn|=4,Ak.current=null,Upe(p,P),_5(P,p),gpe(BO),bS=!!jO,BO=jO=null,p.current=P,Wpe(P),pv(),Hn=pe,ur=Z,ds.transition=W}else p.current=P;if(oC&&(oC=!1,ad=p,iC=j),W=p.pendingLanes,W===0&&(id=null),Efe(P.stateNode),ra(p,jr()),m!==null)for(D=p.onRecoverableError,P=0;P<m.length;P++)j=m[P],D(j.value,{componentStack:j.stack,digest:j.digest});if(rC)throw rC=!1,p=_k,_k=null,p;return iC&1&&p.tag!==0&&Hh(),W=p.pendingLanes,W&1?p===$k?Wv++:(Wv=0,$k=p):Wv=0,td(),null}function Hh(){if(ad!==null){var p=RV(iC),m=ds.transition,P=ur;try{if(ds.transition=null,ur=16>p?16:p,ad===null)var D=!1;else{if(p=ad,ad=null,iC=0,Hn&6)throw Error(n(331));var j=Hn;for(Hn|=4,$t=p.current;$t!==null;){var W=$t,Z=W.child;if($t.flags&16){var pe=W.deletions;if(pe!==null){for(var be=0;be<pe.length;be++){var De=pe[be];for($t=De;$t!==null;){var it=$t;switch(it.tag){case 0:case 11:case 15:Vv(8,it,W)}var ct=it.child;if(ct!==null)ct.return=it,$t=ct;else for(;$t!==null;){it=$t;var ot=it.sibling,Mt=it.return;if(k5(it),it===De){$t=null;break}if(ot!==null){ot.return=Mt,$t=ot;break}$t=Mt}}}var Lt=W.alternate;if(Lt!==null){var jt=Lt.child;if(jt!==null){Lt.child=null;do{var so=jt.sibling;jt.sibling=null,jt=so}while(jt!==null)}}$t=W}}if(W.subtreeFlags&2064&&Z!==null)Z.return=W,$t=Z;else e:for(;$t!==null;){if(W=$t,W.flags&2048)switch(W.tag){case 0:case 11:case 15:Vv(9,W,W.return)}var ke=W.sibling;if(ke!==null){ke.return=W.return,$t=ke;break e}$t=W.return}}var Ce=p.current;for($t=Ce;$t!==null;){Z=$t;var Me=Z.child;if(Z.subtreeFlags&2064&&Me!==null)Me.return=Z,$t=Me;else e:for(Z=Ce;$t!==null;){if(pe=$t,pe.flags&2048)try{switch(pe.tag){case 0:case 11:case 15:eC(9,pe)}}catch(Ht){Xr(pe,pe.return,Ht)}if(pe===Z){$t=null;break e}var ht=pe.sibling;if(ht!==null){ht.return=pe.return,$t=ht;break e}$t=pe.return}}if(Hn=j,td(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(ql,p)}catch{}D=!0}return D}finally{ur=P,ds.transition=m}}return!1}function W5(p,m,P){m=jh(P,m),m=c5(p,m,1),p=rd(p,m,1),m=Ai(),p!==null&&(mv(p,1,m),ra(p,m))}function Xr(p,m,P){if(p.tag===3)W5(p,p,P);else for(;m!==null;){if(m.tag===3){W5(m,p,P);break}else if(m.tag===1){var D=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(id===null||!id.has(D))){p=jh(P,p),p=u5(m,p,1),m=rd(m,p,1),p=Ai(),m!==null&&(mv(m,1,p),ra(m,p));break}}m=m.return}}function Xpe(p,m,P){var D=p.pingCache;D!==null&&D.delete(m),m=Ai(),p.pingedLanes|=p.suspendedLanes&P,Bo===p&&(ti&P)===P&&(Po===4||Po===3&&(ti&130023424)===ti&&500>jr()-Dk?Ff(p,0):Rk|=P),ra(p,m)}function G5(p,m){m===0&&(p.mode&1?(m=mS,mS<<=1,!(mS&130023424)&&(mS=4194304)):m=1);var P=Ai();p=Hc(p,m),p!==null&&(mv(p,m,P),ra(p,P))}function Jpe(p){var m=p.memoizedState,P=0;m!==null&&(P=m.retryLane),G5(p,P)}function Zpe(p,m){var P=0;switch(p.tag){case 13:var D=p.stateNode,j=p.memoizedState;j!==null&&(P=j.retryLane);break;case 19:D=p.stateNode;break;default:throw Error(n(314))}D!==null&&D.delete(m),G5(p,P)}var q5;q5=function(p,m,P){if(p!==null)if(p.memoizedProps!==m.pendingProps||Zi.current)ta=!0;else{if(!(p.lanes&P)&&!(m.flags&128))return ta=!1,Bpe(p,m,P);ta=!!(p.flags&131072)}else ta=!1,_r&&m.flags&1048576&&IH(m,LS,m.index);switch(m.lanes=0,m.tag){case 2:var D=m.type;JS(p,m),p=m.pendingProps;var j=Ah(m,di.current);Lh(m,P),j=uk(null,m,D,p,j,P);var W=dk();return m.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(m.tag=1,m.memoizedState=null,m.updateQueue=null,ea(D)?(W=!0,_S(m)):W=!1,m.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,rk(m),j.updater=QS,m.stateNode=j,j._reactInternals=m,yk(m,D,p,P),m=xk(null,m,D,!0,W,P)):(m.tag=0,_r&&W&&qO(m),Mi(null,m,j,P),m=m.child),m;case 16:D=m.elementType;e:{switch(JS(p,m),p=m.pendingProps,j=D._init,D=j(D._payload),m.type=D,j=m.tag=the(D),p=nl(D,p),j){case 0:m=wk(null,m,D,p,P);break e;case 1:m=b5(null,m,D,p,P);break e;case 11:m=h5(null,m,D,p,P);break e;case 14:m=m5(null,m,D,nl(D.type,p),P);break e}throw Error(n(306,D,""))}return m;case 0:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),wk(p,m,D,j,P);case 1:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),b5(p,m,D,j,P);case 3:e:{if(w5(m),p===null)throw Error(n(387));D=m.pendingProps,W=m.memoizedState,j=W.element,$H(p,m),HS(m,D,null,P);var Z=m.memoizedState;if(D=Z.element,W.isDehydrated)if(W={element:D,isDehydrated:!1,cache:Z.cache,pendingSuspenseBoundaries:Z.pendingSuspenseBoundaries,transitions:Z.transitions},m.updateQueue.baseState=W,m.memoizedState=W,m.flags&256){j=jh(Error(n(423)),m),m=x5(p,m,D,P,j);break e}else if(D!==j){j=jh(Error(n(424)),m),m=x5(p,m,D,P,j);break e}else for(Oa=Ju(m.stateNode.containerInfo.firstChild),Ta=m,_r=!0,tl=null,P=DH(m,null,D,P),m.child=P;P;)P.flags=P.flags&-3|4096,P=P.sibling;else{if(_h(),D===j){m=Wc(p,m,P);break e}Mi(p,m,D,P)}m=m.child}return m;case 5:return FH(m),p===null&&QO(m),D=m.type,j=m.pendingProps,W=p!==null?p.memoizedProps:null,Z=j.children,zO(D,j)?Z=null:W!==null&&zO(D,W)&&(m.flags|=32),v5(p,m),Mi(p,m,Z,P),m.child;case 6:return p===null&&QO(m),null;case 13:return S5(p,m,P);case 4:return ok(m,m.stateNode.containerInfo),D=m.pendingProps,p===null?m.child=$h(m,null,D,P):Mi(p,m,D,P),m.child;case 11:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),h5(p,m,D,j,P);case 7:return Mi(p,m,m.pendingProps,P),m.child;case 8:return Mi(p,m,m.pendingProps.children,P),m.child;case 12:return Mi(p,m,m.pendingProps.children,P),m.child;case 10:e:{if(D=m.type._context,j=m.pendingProps,W=m.memoizedProps,Z=j.value,xr(BS,D._currentValue),D._currentValue=Z,W!==null)if(el(W.value,Z)){if(W.children===j.children&&!Zi.current){m=Wc(p,m,P);break e}}else for(W=m.child,W!==null&&(W.return=m);W!==null;){var pe=W.dependencies;if(pe!==null){Z=W.child;for(var be=pe.firstContext;be!==null;){if(be.context===D){if(W.tag===1){be=Uc(-1,P&-P),be.tag=2;var De=W.updateQueue;if(De!==null){De=De.shared;var it=De.pending;it===null?be.next=be:(be.next=it.next,it.next=be),De.pending=be}}W.lanes|=P,be=W.alternate,be!==null&&(be.lanes|=P),tk(W.return,P,m),pe.lanes|=P;break}be=be.next}}else if(W.tag===10)Z=W.type===m.type?null:W.child;else if(W.tag===18){if(Z=W.return,Z===null)throw Error(n(341));Z.lanes|=P,pe=Z.alternate,pe!==null&&(pe.lanes|=P),tk(Z,P,m),Z=W.sibling}else Z=W.child;if(Z!==null)Z.return=W;else for(Z=W;Z!==null;){if(Z===m){Z=null;break}if(W=Z.sibling,W!==null){W.return=Z.return,Z=W;break}Z=Z.return}W=Z}Mi(p,m,j.children,P),m=m.child}return m;case 9:return j=m.type,D=m.pendingProps.children,Lh(m,P),j=cs(j),D=D(j),m.flags|=1,Mi(p,m,D,P),m.child;case 14:return D=m.type,j=nl(D,m.pendingProps),j=nl(D.type,j),m5(p,m,D,j,P);case 15:return g5(p,m,m.type,m.pendingProps,P);case 17:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),JS(p,m),m.tag=1,ea(D)?(p=!0,_S(m)):p=!1,Lh(m,P),s5(m,D,j),yk(m,D,j,P),xk(null,m,D,!0,p,P);case 19:return E5(p,m,P);case 22:return y5(p,m,P)}throw Error(n(156,m.tag))};function K5(p,m){return rr(p,m)}function ehe(p,m,P,D){this.tag=p,this.key=P,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=D,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fs(p,m,P,D){return new ehe(p,m,P,D)}function zk(p){return p=p.prototype,!(!p||!p.isReactComponent)}function the(p){if(typeof p=="function")return zk(p)?1:0;if(p!=null){if(p=p.$$typeof,p===$)return 11;if(p===N)return 14}return 2}function cd(p,m){var P=p.alternate;return P===null?(P=fs(p.tag,m,p.key,p.mode),P.elementType=p.elementType,P.type=p.type,P.stateNode=p.stateNode,P.alternate=p,p.alternate=P):(P.pendingProps=m,P.type=p.type,P.flags=0,P.subtreeFlags=0,P.deletions=null),P.flags=p.flags&14680064,P.childLanes=p.childLanes,P.lanes=p.lanes,P.child=p.child,P.memoizedProps=p.memoizedProps,P.memoizedState=p.memoizedState,P.updateQueue=p.updateQueue,m=p.dependencies,P.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},P.sibling=p.sibling,P.index=p.index,P.ref=p.ref,P}function cC(p,m,P,D,j,W){var Z=2;if(D=p,typeof p=="function")zk(p)&&(Z=1);else if(typeof p=="string")Z=5;else e:switch(p){case O:return Bf(P.children,j,W,m);case A:Z=8,j|=8;break;case k:return p=fs(12,P,m,j|2),p.elementType=k,p.lanes=W,p;case L:return p=fs(13,P,m,j),p.elementType=L,p.lanes=W,p;case z:return p=fs(19,P,m,j),p.elementType=z,p.lanes=W,p;case U:return uC(P,j,W,m);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case M:Z=10;break e;case R:Z=9;break e;case $:Z=11;break e;case N:Z=14;break e;case B:Z=16,D=null;break e}throw Error(n(130,p==null?p:typeof p,""))}return m=fs(Z,P,m,j),m.elementType=p,m.type=D,m.lanes=W,m}function Bf(p,m,P,D){return p=fs(7,p,D,m),p.lanes=P,p}function uC(p,m,P,D){return p=fs(22,p,D,m),p.elementType=U,p.lanes=P,p.stateNode={isHidden:!1},p}function Vk(p,m,P){return p=fs(6,p,null,m),p.lanes=P,p}function Hk(p,m,P){return m=fs(4,p.children!==null?p.children:[],p.key,m),m.lanes=P,m.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},m}function nhe(p,m,P,D,j){this.tag=m,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gO(0),this.expirationTimes=gO(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gO(0),this.identifierPrefix=D,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function Uk(p,m,P,D,j,W,Z,pe,be){return p=new nhe(p,m,P,pe,be),m===1?(m=1,W===!0&&(m|=8)):m=0,W=fs(3,null,null,m),p.current=W,W.stateNode=p,W.memoizedState={element:D,isDehydrated:P,cache:null,transitions:null,pendingSuspenseBoundaries:null},rk(W),p}function rhe(p,m,P){var D=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:D==null?null:""+D,children:p,containerInfo:m,implementation:P}}function Y5(p){if(!p)return ed;p=p._reactInternals;e:{if(os(p)!==p||p.tag!==1)throw Error(n(170));var m=p;do{switch(m.tag){case 3:m=m.stateNode.context;break e;case 1:if(ea(m.type)){m=m.stateNode.__reactInternalMemoizedMergedChildContext;break e}}m=m.return}while(m!==null);throw Error(n(171))}if(p.tag===1){var P=p.type;if(ea(P))return CH(p,P,m)}return m}function Q5(p,m,P,D,j,W,Z,pe,be){return p=Uk(P,D,!0,p,j,W,Z,pe,be),p.context=Y5(null),P=p.current,D=Ai(),j=sd(P),W=Uc(D,j),W.callback=m??null,rd(P,W,j),p.current.lanes=j,mv(p,j,D),ra(p,D),p}function dC(p,m,P,D){var j=m.current,W=Ai(),Z=sd(j);return P=Y5(P),m.context===null?m.context=P:m.pendingContext=P,m=Uc(W,Z),m.payload={element:p},D=D===void 0?null:D,D!==null&&(m.callback=D),p=rd(j,m,Z),p!==null&&(il(p,j,Z,W),VS(p,j,Z)),Z}function fC(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return p.child.stateNode;default:return p.child.stateNode}}function X5(p,m){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var P=p.retryLane;p.retryLane=P!==0&&P<m?P:m}}function Wk(p,m){X5(p,m),(p=p.alternate)&&X5(p,m)}function ohe(){return null}var J5=typeof reportError=="function"?reportError:function(p){console.error(p)};function Gk(p){this._internalRoot=p}pC.prototype.render=Gk.prototype.render=function(p){var m=this._internalRoot;if(m===null)throw Error(n(409));dC(p,m,null,null)},pC.prototype.unmount=Gk.prototype.unmount=function(){var p=this._internalRoot;if(p!==null){this._internalRoot=null;var m=p.containerInfo;Lf(function(){dC(null,p,null,null)}),m[jc]=null}};function pC(p){this._internalRoot=p}pC.prototype.unstable_scheduleHydration=function(p){if(p){var m=$V();p={blockedOn:null,target:p,priority:m};for(var P=0;P<Yu.length&&m!==0&&m<Yu[P].priority;P++);Yu.splice(P,0,p),P===0&&FV(p)}};function qk(p){return!(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)}function hC(p){return!(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11&&(p.nodeType!==8||p.nodeValue!==" react-mount-point-unstable "))}function Z5(){}function ihe(p,m,P,D,j){if(j){if(typeof D=="function"){var W=D;D=function(){var De=fC(Z);W.call(De)}}var Z=Q5(m,D,p,0,null,!1,!1,"",Z5);return p._reactRootContainer=Z,p[jc]=Z.current,kv(p.nodeType===8?p.parentNode:p),Lf(),Z}for(;j=p.lastChild;)p.removeChild(j);if(typeof D=="function"){var pe=D;D=function(){var De=fC(be);pe.call(De)}}var be=Uk(p,0,!1,null,null,!1,!1,"",Z5);return p._reactRootContainer=be,p[jc]=be.current,kv(p.nodeType===8?p.parentNode:p),Lf(function(){dC(m,be,P,D)}),be}function mC(p,m,P,D,j){var W=P._reactRootContainer;if(W){var Z=W;if(typeof j=="function"){var pe=j;j=function(){var be=fC(Z);pe.call(be)}}dC(m,Z,p,j)}else Z=ihe(P,m,p,j,D);return fC(Z)}DV=function(p){switch(p.tag){case 3:var m=p.stateNode;if(m.current.memoizedState.isDehydrated){var P=hv(m.pendingLanes);P!==0&&(yO(m,P|1),ra(m,jr()),!(Hn&6)&&(Vh=jr()+500,td()))}break;case 13:Lf(function(){var D=Hc(p,1);if(D!==null){var j=Ai();il(D,p,1,j)}}),Wk(p,1)}},vO=function(p){if(p.tag===13){var m=Hc(p,134217728);if(m!==null){var P=Ai();il(m,p,134217728,P)}Wk(p,134217728)}},_V=function(p){if(p.tag===13){var m=sd(p),P=Hc(p,m);if(P!==null){var D=Ai();il(P,p,m,D)}Wk(p,m)}},$V=function(){return ur},NV=function(p,m){var P=ur;try{return ur=p,m()}finally{ur=P}},jn=function(p,m,P){switch(m){case"input":if(ge(p,P),m=P.name,P.type==="radio"&&m!=null){for(P=p;P.parentNode;)P=P.parentNode;for(P=P.querySelectorAll("input[name="+JSON.stringify(""+m)+'][type="radio"]'),m=0;m<P.length;m++){var D=P[m];if(D!==p&&D.form===p.form){var j=RS(D);if(!j)throw Error(n(90));re(D),ge(D,j)}}}break;case"textarea":Ae(p,P);break;case"select":m=P.value,m!=null&&Le(p,!!P.multiple,m,!1)}},Qi=Fk,qt=Lf;var ahe={usingClientEntryPoint:!1,Events:[Rv,kh,RS,Yr,Yi,Fk]},Gv={findFiberByHostInstance:kf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},she={bundleType:Gv.bundleType,version:Gv.version,rendererPackageName:Gv.rendererPackageName,rendererConfig:Gv.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(p){return p=fn(p),p===null?null:p.stateNode},findFiberByHostInstance:Gv.findFiberByHostInstance||ohe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gC=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gC.isDisabled&&gC.supportsFiber)try{ql=gC.inject(she),as=gC}catch{}}return oa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ahe,oa.createPortal=function(p,m){var P=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qk(m))throw Error(n(200));return rhe(p,m,null,P)},oa.createRoot=function(p,m){if(!qk(p))throw Error(n(299));var P=!1,D="",j=J5;return m!=null&&(m.unstable_strictMode===!0&&(P=!0),m.identifierPrefix!==void 0&&(D=m.identifierPrefix),m.onRecoverableError!==void 0&&(j=m.onRecoverableError)),m=Uk(p,1,!1,null,null,P,!1,D,j),p[jc]=m.current,kv(p.nodeType===8?p.parentNode:p),new Gk(m)},oa.findDOMNode=function(p){if(p==null)return null;if(p.nodeType===1)return p;var m=p._reactInternals;if(m===void 0)throw typeof p.render=="function"?Error(n(188)):(p=Object.keys(p).join(","),Error(n(268,p)));return p=fn(m),p=p===null?null:p.stateNode,p},oa.flushSync=function(p){return Lf(p)},oa.hydrate=function(p,m,P){if(!hC(m))throw Error(n(200));return mC(null,p,m,!0,P)},oa.hydrateRoot=function(p,m,P){if(!qk(p))throw Error(n(405));var D=P!=null&&P.hydratedSources||null,j=!1,W="",Z=J5;if(P!=null&&(P.unstable_strictMode===!0&&(j=!0),P.identifierPrefix!==void 0&&(W=P.identifierPrefix),P.onRecoverableError!==void 0&&(Z=P.onRecoverableError)),m=Q5(m,null,p,1,P??null,j,!1,W,Z),p[jc]=m.current,kv(p),D)for(p=0;p<D.length;p++)P=D[p],j=P._getVersion,j=j(P._source),m.mutableSourceEagerHydrationData==null?m.mutableSourceEagerHydrationData=[P,j]:m.mutableSourceEagerHydrationData.push(P,j);return new pC(m)},oa.render=function(p,m,P){if(!hC(m))throw Error(n(200));return mC(null,p,m,!1,P)},oa.unmountComponentAtNode=function(p){if(!hC(p))throw Error(n(40));return p._reactRootContainer?(Lf(function(){mC(null,null,p,!1,function(){p._reactRootContainer=null,p[jc]=null})}),!0):!1},oa.unstable_batchedUpdates=Fk,oa.unstable_renderSubtreeIntoContainer=function(p,m,P,D){if(!hC(P))throw Error(n(200));if(p==null||p._reactInternals===void 0)throw Error(n(38));return mC(p,m,P,!1,D)},oa.version="18.3.1-next-f1338f8080-20240426",oa}var i4;function LZ(){if(i4)return cM.exports;i4=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cM.exports=sbe(),cM.exports}var u0=LZ();const Lb=Fn(u0),a4={disabled:!1},rE=X.createContext(null);var FZ=function(t){return t.scrollTop},Fb="unmounted",Jf="exited",Zf="entering",gm="entered",o2="exiting",Qa=function(e){c0(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,s=a&&!a.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?s?(l=Jf,i.appearStatus=Zf):l=gm:r.unmountOnExit||r.mountOnEnter?l=Fb:l=Jf,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Fb?{status:Jf}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Zf&&a!==gm&&(i=Zf):(a===Zf||a===gm)&&(i=o2)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,s;return i=a=s=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,s=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:s}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Zf){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Lb.findDOMNode(this);a&&FZ(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jf&&this.setState({status:Fb})},n.performEnter=function(o){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:o,l=this.props.nodeRef?[s]:[Lb.findDOMNode(this),s],c=l[0],u=l[1],d=this.getTimeouts(),f=s?d.appear:d.enter;if(!o&&!a||a4.disabled){this.safeSetState({status:gm},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Zf},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:gm},function(){i.props.onEntered(c,u)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Lb.findDOMNode(this);if(!i||a4.disabled){this.safeSetState({status:Jf},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:o2},function(){o.props.onExiting(s),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:Jf},function(){o.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,o(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Lb.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Fb)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=We(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return X.createElement(rE.Provider,{value:null},typeof a=="function"?a(o,s):X.cloneElement(X.Children.only(a),s))},t}(X.Component);Qa.contextType=rE;Qa.propTypes={};function Yh(){}Qa.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yh,onEntering:Yh,onEntered:Yh,onExit:Yh,onExiting:Yh,onExited:Yh};Qa.UNMOUNTED=Fb;Qa.EXITED=Jf;Qa.ENTERING=Zf;Qa.ENTERED=gm;Qa.EXITING=o2;var lbe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return rbe(t,r)})},fM=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return obe(t,r)})},RF=function(e){c0(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(s,l){var c=r.resolveArguments(s,l),u=c[0],d=c[1];r.removeClasses(u,"exit"),r.addClass(u,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(s,l)},r.onEntering=function(s,l){var c=r.resolveArguments(s,l),u=c[0],d=c[1],f=d?"appear":"enter";r.addClass(u,f,"active"),r.props.onEntering&&r.props.onEntering(s,l)},r.onEntered=function(s,l){var c=r.resolveArguments(s,l),u=c[0],d=c[1],f=d?"appear":"enter";r.removeClasses(u,f),r.addClass(u,f,"done"),r.props.onEntered&&r.props.onEntered(s,l)},r.onExit=function(s){var l=r.resolveArguments(s),c=l[0];r.removeClasses(c,"appear"),r.removeClasses(c,"enter"),r.addClass(c,"exit","base"),r.props.onExit&&r.props.onExit(s)},r.onExiting=function(s){var l=r.resolveArguments(s),c=l[0];r.addClass(c,"exit","active"),r.props.onExiting&&r.props.onExiting(s)},r.onExited=function(s){var l=r.resolveArguments(s),c=l[0];r.removeClasses(c,"exit"),r.addClass(c,"exit","done"),r.props.onExited&&r.props.onExited(s)},r.resolveArguments=function(s,l){return r.props.nodeRef?[r.props.nodeRef.current,s]:[s,l]},r.getClassNames=function(s){var l=r.props.classNames,c=typeof l=="string",u=c&&l?l+"-":"",d=c?""+u+s:l[s],f=c?d+"-active":l[s+"Active"],h=c?d+"-done":l[s+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:h}},r}var n=t.prototype;return n.addClass=function(o,i,a){var s=this.getClassNames(i)[a+"ClassName"],l=this.getClassNames("enter"),c=l.doneClassName;i==="appear"&&a==="done"&&c&&(s+=" "+c),a==="active"&&o&&FZ(o),s&&(this.appliedClasses[i][a]=s,lbe(o,s))},n.removeClasses=function(o,i){var a=this.appliedClasses[i],s=a.base,l=a.active,c=a.done;this.appliedClasses[i]={},s&&fM(o,s),l&&fM(o,l),c&&fM(o,c)},n.render=function(){var o=this.props;o.classNames;var i=We(o,["classNames"]);return X.createElement(Qa,F({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(X.Component);RF.defaultProps={classNames:""};RF.propTypes={};function i2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DF(e,t){var n=function(i){return t&&w.isValidElement(i)?t(i):i},r=Object.create(null);return e&&w.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function cbe(e,t){e=e||{},t=t||{};function n(u){return u in t?t[u]:e[u]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var l in t){if(r[l])for(a=0;a<r[l].length;a++){var c=r[l][a];s[r[l][a]]=n(c)}s[l]=n(l)}for(a=0;a<o.length;a++)s[o[a]]=n(o[a]);return s}function cp(e,t,n){return n[t]!=null?n[t]:e.props[t]}function ube(e,t){return DF(e.children,function(n){return w.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:cp(n,"appear",e),enter:cp(n,"enter",e),exit:cp(n,"exit",e)})})}function dbe(e,t,n){var r=DF(e.children),o=cbe(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if(w.isValidElement(a)){var s=i in t,l=i in r,c=t[i],u=w.isValidElement(c)&&!c.props.in;l&&(!s||u)?o[i]=w.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:cp(a,"exit",e),enter:cp(a,"enter",e)}):!l&&s&&!u?o[i]=w.cloneElement(a,{in:!1}):l&&s&&w.isValidElement(c)&&(o[i]=w.cloneElement(a,{onExited:n.bind(null,a),in:c.props.in,exit:cp(a,"exit",e),enter:cp(a,"enter",e)}))}}),o}var fbe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},pbe={component:"div",childFactory:function(t){return t}},d0=function(e){c0(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=i.handleExited.bind(i2(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var a=i.children,s=i.handleExited,l=i.firstRender;return{children:l?ube(o,s):dbe(o,a,s),firstRender:!1}},n.handleExited=function(o,i){var a=DF(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(s){var l=F({},s.children);return delete l[o.key],{children:l}}))},n.render=function(){var o=this.props,i=o.component,a=o.childFactory,s=We(o,["component","childFactory"]),l=this.state.contextValue,c=fbe(this.state.children).map(a);return delete s.appear,delete s.enter,delete s.exit,i===null?X.createElement(rE.Provider,{value:l},c):X.createElement(rE.Provider,{value:l},X.createElement(i,s,c))},t}(X.Component);d0.propTypes={};d0.defaultProps=pbe;const _F=e=>e.scrollTop;function Jd(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}function hbe(e){return je("MuiCollapse",e)}Be("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const mbe=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Oe(r,hbe,n)},gbe=se("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(rt(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),ybe=se("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),vbe=se("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Ls=w.forwardRef(function(t,n){const r=lt({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:a,collapsedSize:s="0px",component:l,easing:c,in:u,onEnter:d,onEntered:f,onEntering:h,onExit:g,onExited:y,onExiting:v,orientation:x="vertical",style:S,timeout:C=bZ.standard,TransitionComponent:I=Qa,...E}=r,T={...r,orientation:x,collapsedSize:s},O=mbe(T),A=Lr(),k=fa(),M=w.useRef(null),R=w.useRef(),$=typeof s=="number"?`${s}px`:s,L=x==="horizontal",z=L?"width":"height",N=w.useRef(null),B=cn(n,N),U=te=>ce=>{if(te){const ae=N.current;ce===void 0?te(ae):te(ae,ce)}},G=()=>M.current?M.current[L?"clientWidth":"clientHeight"]:0,H=U((te,ce)=>{M.current&&L&&(M.current.style.position="absolute"),te.style[z]=$,d&&d(te,ce)}),K=U((te,ce)=>{const ae=G();M.current&&L&&(M.current.style.position="");const{duration:ne,easing:ue}=Jd({style:S,timeout:C,easing:c},{mode:"enter"});if(C==="auto"){const he=A.transitions.getAutoHeightDuration(ae);te.style.transitionDuration=`${he}ms`,R.current=he}else te.style.transitionDuration=typeof ne=="string"?ne:`${ne}ms`;te.style[z]=`${ae}px`,te.style.transitionTimingFunction=ue,h&&h(te,ce)}),q=U((te,ce)=>{te.style[z]="auto",f&&f(te,ce)}),Y=U(te=>{te.style[z]=`${G()}px`,g&&g(te)}),J=U(y),ie=U(te=>{const ce=G(),{duration:ae,easing:ne}=Jd({style:S,timeout:C,easing:c},{mode:"exit"});if(C==="auto"){const ue=A.transitions.getAutoHeightDuration(ce);te.style.transitionDuration=`${ue}ms`,R.current=ue}else te.style.transitionDuration=typeof ae=="string"?ae:`${ae}ms`;te.style[z]=$,te.style.transitionTimingFunction=ne,v&&v(te)}),ee=te=>{C==="auto"&&k.start(R.current||0,te),o&&o(N.current,te)};return _.jsx(I,{in:u,onEnter:H,onEntered:q,onEntering:K,onExit:Y,onExited:J,onExiting:ie,addEndListener:ee,nodeRef:N,timeout:C==="auto"?null:C,...E,children:(te,{ownerState:ce,...ae})=>_.jsx(gbe,{as:l,className:fe(O.root,a,{entered:O.entered,exited:!u&&$==="0px"&&O.hidden}[te]),style:{[L?"minWidth":"minHeight"]:$,...S},ref:B,ownerState:{...T,state:te},...ae,children:_.jsx(ybe,{ownerState:{...T,state:te},className:O.wrapper,ref:M,children:_.jsx(vbe,{ownerState:{...T,state:te},className:O.wrapperInner,children:i})})})})});Ls&&(Ls.muiSupportAuto=!0);function bbe(e){return je("MuiPaper",e)}Be("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const wbe=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Oe(i,bbe,o)},xbe=se("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(rt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Kr=w.forwardRef(function(t,n){var h;const r=lt({props:t,name:"MuiPaper"}),o=Lr(),{className:i,component:a="div",elevation:s=1,square:l=!1,variant:c="elevation",...u}=r,d={...r,component:a,elevation:s,square:l,variant:c},f=wbe(d);return _.jsx(xbe,{as:a,ownerState:d,className:fe(f.root,i),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[s],...o.vars&&{"--Paper-overlay":(h=o.vars.overlays)==null?void 0:h[s]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Pt("#fff",V$(s))}, ${Pt("#fff",V$(s))})`}},...u.style}})}),jZ=w.createContext({});function St(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:a,shouldForwardComponentProp:s=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=i,h=u[e]||r,g=Cu(d[e],o),{props:{component:y,...v},internalRef:x}=cZ({className:n,...l,externalForwardedProps:e==="root"?f:void 0,externalSlotProps:g}),S=cn(x,g==null?void 0:g.ref,t.ref),C=e==="root"?y||c:y,I=lZ(h,{...e==="root"&&!c&&!u[e]&&a,...e!=="root"&&!u[e]&&a,...v,...C&&!s&&{as:C},...C&&s&&{component:C},ref:S},o);return[h,I]}function Sbe(e){return je("MuiAccordion",e)}const EC=Be("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Cbe=e=>{const{classes:t,square:n,expanded:r,disabled:o,disableGutters:i}=e;return Oe({root:["root",!n&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],heading:["heading"],region:["region"]},Sbe,t)},Ebe=se(Kr,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${EC.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(rt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${EC.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${EC.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),rt(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${EC.expanded}`]:{margin:"16px 0"}}}]}))),Pbe=se("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(e,t)=>t.heading})({all:"unset"}),$F=w.forwardRef(function(t,n){const r=lt({props:t,name:"MuiAccordion"}),{children:o,className:i,defaultExpanded:a=!1,disabled:s=!1,disableGutters:l=!1,expanded:c,onChange:u,square:d=!1,slots:f={},slotProps:h={},TransitionComponent:g,TransitionProps:y,...v}=r,[x,S]=Ei({controlled:c,default:a,name:"Accordion",state:"expanded"}),C=w.useCallback(B=>{S(!x),u&&u(B,!x)},[x,u,S]),[I,...E]=w.Children.toArray(o),T=w.useMemo(()=>({expanded:x,disabled:s,disableGutters:l,toggle:C}),[x,s,l,C]),O={...r,square:d,disabled:s,disableGutters:l,expanded:x},A=Cbe(O),k={transition:g,...f},M={transition:y,...h},R={slots:k,slotProps:M},[$,L]=St("heading",{elementType:Pbe,externalForwardedProps:R,className:A.heading,ownerState:O}),[z,N]=St("transition",{elementType:Ls,externalForwardedProps:R,ownerState:O});return _.jsxs(Ebe,{className:fe(A.root,i),ref:n,ownerState:O,square:d,...v,children:[_.jsx($,{...L,children:_.jsx(jZ.Provider,{value:T,children:I})}),_.jsx(z,{in:x,timeout:"auto",...N,children:_.jsx("div",{"aria-labelledby":I.props.id,id:I.props["aria-controls"],role:"region",className:A.region,children:E})})]})});function Ibe(e){return je("MuiAccordionDetails",e)}Be("MuiAccordionDetails",["root"]);const Tbe=e=>{const{classes:t}=e;return Oe({root:["root"]},Ibe,t)},Obe=se("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(rt(({theme:e})=>({padding:e.spacing(1,2,2)}))),NF=w.forwardRef(function(t,n){const r=lt({props:t,name:"MuiAccordionDetails"}),{className:o,...i}=r,a=r,s=Tbe(a);return _.jsx(Obe,{className:fe(s.root,o),ref:n,ownerState:a,...i})});class oE{constructor(){Ie(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new oE}static use(){const t=Ks(oE.create).current,[n,r]=w.useState(!1);return t.shouldMount=n,t.setShouldMount=r,w.useEffect(t.mountEffect,[n]),t}mount(){return this.mounted||(this.mounted=Mbe(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...t)})}stop(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...t)})}pulsate(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...t)})}}function kbe(){return oE.use()}function Mbe(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function Abe(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:a,in:s,onExited:l,timeout:c}=e,[u,d]=w.useState(!1),f=fe(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},g=fe(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),w.useEffect(()=>{if(!s&&l!=null){const y=setTimeout(l,c);return()=>{clearTimeout(y)}}},[l,s,c]),_.jsx("span",{className:f,style:h,children:_.jsx("span",{className:g})})}const Is=Be("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),a2=550,Rbe=80,Dbe=Oc`+`+W.stack}return{value:p,source:m,stack:j,digest:null}}function vk(p,m,P){return{value:p,source:null,stack:P??null,digest:m??null}}function bk(p,m){try{console.error(m.value)}catch(P){setTimeout(function(){throw P})}}var Lpe=typeof WeakMap=="function"?WeakMap:Map;function c5(p,m,P){P=Uc(-1,P),P.tag=3,P.payload={element:null};var D=m.value;return P.callback=function(){rC||(rC=!0,_k=D),bk(p,m)},P}function u5(p,m,P){P=Uc(-1,P),P.tag=3;var D=p.type.getDerivedStateFromError;if(typeof D=="function"){var j=m.value;P.payload=function(){return D(j)},P.callback=function(){bk(p,m)}}var W=p.stateNode;return W!==null&&typeof W.componentDidCatch=="function"&&(P.callback=function(){bk(p,m),typeof D!="function"&&(id===null?id=new Set([this]):id.add(this));var Z=m.stack;this.componentDidCatch(m.value,{componentStack:Z!==null?Z:""})}),P}function d5(p,m,P){var D=p.pingCache;if(D===null){D=p.pingCache=new Lpe;var j=new Set;D.set(m,j)}else j=D.get(m),j===void 0&&(j=new Set,D.set(m,j));j.has(P)||(j.add(P),p=Xpe.bind(null,p,m,P),m.then(p,p))}function f5(p){do{var m;if((m=p.tag===13)&&(m=p.memoizedState,m=m!==null?m.dehydrated!==null:!0),m)return p;p=p.return}while(p!==null);return null}function p5(p,m,P,D,j){return p.mode&1?(p.flags|=65536,p.lanes=j,p):(p===m?p.flags|=65536:(p.flags|=128,P.flags|=131072,P.flags&=-52805,P.tag===1&&(P.alternate===null?P.tag=17:(m=Uc(-1,1),m.tag=2,rd(P,m,1))),P.lanes|=1),p)}var Fpe=I.ReactCurrentOwner,ta=!1;function Mi(p,m,P,D){m.child=p===null?DH(m,null,P,D):$h(m,p.child,P,D)}function h5(p,m,P,D,j){P=P.render;var W=m.ref;return Lh(m,j),D=uk(p,m,P,D,W,j),P=dk(),p!==null&&!ta?(m.updateQueue=p.updateQueue,m.flags&=-2053,p.lanes&=~j,Wc(p,m,j)):(_r&&P&&qO(m),m.flags|=1,Mi(p,m,D,j),m.child)}function m5(p,m,P,D,j){if(p===null){var W=P.type;return typeof W=="function"&&!zk(W)&&W.defaultProps===void 0&&P.compare===null&&P.defaultProps===void 0?(m.tag=15,m.type=W,g5(p,m,W,D,j)):(p=cC(P.type,null,D,m,m.mode,j),p.ref=m.ref,p.return=m,m.child=p)}if(W=p.child,!(p.lanes&j)){var Z=W.memoizedProps;if(P=P.compare,P=P!==null?P:Iv,P(Z,D)&&p.ref===m.ref)return Wc(p,m,j)}return m.flags|=1,p=cd(W,D),p.ref=m.ref,p.return=m,m.child=p}function g5(p,m,P,D,j){if(p!==null){var W=p.memoizedProps;if(Iv(W,D)&&p.ref===m.ref)if(ta=!1,m.pendingProps=D=W,(p.lanes&j)!==0)p.flags&131072&&(ta=!0);else return m.lanes=p.lanes,Wc(p,m,j)}return wk(p,m,P,D,j)}function y5(p,m,P){var D=m.pendingProps,j=D.children,W=p!==null?p.memoizedState:null;if(D.mode==="hidden")if(!(m.mode&1))m.memoizedState={baseLanes:0,cachePool:null,transitions:null},xr(zh,ka),ka|=P;else{if(!(P&1073741824))return p=W!==null?W.baseLanes|P:P,m.lanes=m.childLanes=1073741824,m.memoizedState={baseLanes:p,cachePool:null,transitions:null},m.updateQueue=null,xr(zh,ka),ka|=p,null;m.memoizedState={baseLanes:0,cachePool:null,transitions:null},D=W!==null?W.baseLanes:P,xr(zh,ka),ka|=D}else W!==null?(D=W.baseLanes|P,m.memoizedState=null):D=P,xr(zh,ka),ka|=D;return Mi(p,m,j,P),m.child}function v5(p,m){var P=m.ref;(p===null&&P!==null||p!==null&&p.ref!==P)&&(m.flags|=512,m.flags|=2097152)}function wk(p,m,P,D,j){var W=ea(P)?Mf:di.current;return W=Ah(m,W),Lh(m,j),P=uk(p,m,P,D,W,j),D=dk(),p!==null&&!ta?(m.updateQueue=p.updateQueue,m.flags&=-2053,p.lanes&=~j,Wc(p,m,j)):(_r&&D&&qO(m),m.flags|=1,Mi(p,m,P,j),m.child)}function b5(p,m,P,D,j){if(ea(P)){var W=!0;_S(m)}else W=!1;if(Lh(m,j),m.stateNode===null)JS(p,m),s5(m,P,D),yk(m,P,D,j),D=!0;else if(p===null){var Z=m.stateNode,pe=m.memoizedProps;Z.props=pe;var be=Z.context,De=P.contextType;typeof De=="object"&&De!==null?De=cs(De):(De=ea(P)?Mf:di.current,De=Ah(m,De));var it=P.getDerivedStateFromProps,ct=typeof it=="function"||typeof Z.getSnapshotBeforeUpdate=="function";ct||typeof Z.UNSAFE_componentWillReceiveProps!="function"&&typeof Z.componentWillReceiveProps!="function"||(pe!==D||be!==De)&&l5(m,Z,D,De),nd=!1;var ot=m.memoizedState;Z.state=ot,HS(m,D,Z,j),be=m.memoizedState,pe!==D||ot!==be||Zi.current||nd?(typeof it=="function"&&(gk(m,P,it,D),be=m.memoizedState),(pe=nd||a5(m,P,pe,D,ot,be,De))?(ct||typeof Z.UNSAFE_componentWillMount!="function"&&typeof Z.componentWillMount!="function"||(typeof Z.componentWillMount=="function"&&Z.componentWillMount(),typeof Z.UNSAFE_componentWillMount=="function"&&Z.UNSAFE_componentWillMount()),typeof Z.componentDidMount=="function"&&(m.flags|=4194308)):(typeof Z.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=D,m.memoizedState=be),Z.props=D,Z.state=be,Z.context=De,D=pe):(typeof Z.componentDidMount=="function"&&(m.flags|=4194308),D=!1)}else{Z=m.stateNode,$H(p,m),pe=m.memoizedProps,De=m.type===m.elementType?pe:nl(m.type,pe),Z.props=De,ct=m.pendingProps,ot=Z.context,be=P.contextType,typeof be=="object"&&be!==null?be=cs(be):(be=ea(P)?Mf:di.current,be=Ah(m,be));var Mt=P.getDerivedStateFromProps;(it=typeof Mt=="function"||typeof Z.getSnapshotBeforeUpdate=="function")||typeof Z.UNSAFE_componentWillReceiveProps!="function"&&typeof Z.componentWillReceiveProps!="function"||(pe!==ct||ot!==be)&&l5(m,Z,D,be),nd=!1,ot=m.memoizedState,Z.state=ot,HS(m,D,Z,j);var Lt=m.memoizedState;pe!==ct||ot!==Lt||Zi.current||nd?(typeof Mt=="function"&&(gk(m,P,Mt,D),Lt=m.memoizedState),(De=nd||a5(m,P,De,D,ot,Lt,be)||!1)?(it||typeof Z.UNSAFE_componentWillUpdate!="function"&&typeof Z.componentWillUpdate!="function"||(typeof Z.componentWillUpdate=="function"&&Z.componentWillUpdate(D,Lt,be),typeof Z.UNSAFE_componentWillUpdate=="function"&&Z.UNSAFE_componentWillUpdate(D,Lt,be)),typeof Z.componentDidUpdate=="function"&&(m.flags|=4),typeof Z.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof Z.componentDidUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=4),typeof Z.getSnapshotBeforeUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=1024),m.memoizedProps=D,m.memoizedState=Lt),Z.props=D,Z.state=Lt,Z.context=be,D=De):(typeof Z.componentDidUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=4),typeof Z.getSnapshotBeforeUpdate!="function"||pe===p.memoizedProps&&ot===p.memoizedState||(m.flags|=1024),D=!1)}return xk(p,m,P,D,W,j)}function xk(p,m,P,D,j,W){v5(p,m);var Z=(m.flags&128)!==0;if(!D&&!Z)return j&&EH(m,P,!1),Wc(p,m,W);D=m.stateNode,Fpe.current=m;var pe=Z&&typeof P.getDerivedStateFromError!="function"?null:D.render();return m.flags|=1,p!==null&&Z?(m.child=$h(m,p.child,null,W),m.child=$h(m,null,pe,W)):Mi(p,m,pe,W),m.memoizedState=D.state,j&&EH(m,P,!0),m.child}function w5(p){var m=p.stateNode;m.pendingContext?SH(p,m.pendingContext,m.pendingContext!==m.context):m.context&&SH(p,m.context,!1),ok(p,m.containerInfo)}function x5(p,m,P,D,j){return _h(),XO(j),m.flags|=256,Mi(p,m,P,D),m.child}var Sk={dehydrated:null,treeContext:null,retryLane:0};function Ck(p){return{baseLanes:p,cachePool:null,transitions:null}}function S5(p,m,P){var D=m.pendingProps,j=Br.current,W=!1,Z=(m.flags&128)!==0,pe;if((pe=Z)||(pe=p!==null&&p.memoizedState===null?!1:(j&2)!==0),pe?(W=!0,m.flags&=-129):(p===null||p.memoizedState!==null)&&(j|=1),xr(Br,j&1),p===null)return QO(m),p=m.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?(m.mode&1?p.data==="$!"?m.lanes=8:m.lanes=1073741824:m.lanes=1,null):(Z=D.children,p=D.fallback,W?(D=m.mode,W=m.child,Z={mode:"hidden",children:Z},!(D&1)&&W!==null?(W.childLanes=0,W.pendingProps=Z):W=uC(Z,D,0,null),p=Bf(p,D,P,null),W.return=m,p.return=m,W.sibling=p,m.child=W,m.child.memoizedState=Ck(P),m.memoizedState=Sk,p):Ek(m,Z));if(j=p.memoizedState,j!==null&&(pe=j.dehydrated,pe!==null))return jpe(p,m,Z,D,pe,j,P);if(W){W=D.fallback,Z=m.mode,j=p.child,pe=j.sibling;var be={mode:"hidden",children:D.children};return!(Z&1)&&m.child!==j?(D=m.child,D.childLanes=0,D.pendingProps=be,m.deletions=null):(D=cd(j,be),D.subtreeFlags=j.subtreeFlags&14680064),pe!==null?W=cd(pe,W):(W=Bf(W,Z,P,null),W.flags|=2),W.return=m,D.return=m,D.sibling=W,m.child=D,D=W,W=m.child,Z=p.child.memoizedState,Z=Z===null?Ck(P):{baseLanes:Z.baseLanes|P,cachePool:null,transitions:Z.transitions},W.memoizedState=Z,W.childLanes=p.childLanes&~P,m.memoizedState=Sk,D}return W=p.child,p=W.sibling,D=cd(W,{mode:"visible",children:D.children}),!(m.mode&1)&&(D.lanes=P),D.return=m,D.sibling=null,p!==null&&(P=m.deletions,P===null?(m.deletions=[p],m.flags|=16):P.push(p)),m.child=D,m.memoizedState=null,D}function Ek(p,m){return m=uC({mode:"visible",children:m},p.mode,0,null),m.return=p,p.child=m}function XS(p,m,P,D){return D!==null&&XO(D),$h(m,p.child,null,P),p=Ek(m,m.pendingProps.children),p.flags|=2,m.memoizedState=null,p}function jpe(p,m,P,D,j,W,Z){if(P)return m.flags&256?(m.flags&=-257,D=vk(Error(n(422))),XS(p,m,Z,D)):m.memoizedState!==null?(m.child=p.child,m.flags|=128,null):(W=D.fallback,j=m.mode,D=uC({mode:"visible",children:D.children},j,0,null),W=Bf(W,j,Z,null),W.flags|=2,D.return=m,W.return=m,D.sibling=W,m.child=D,m.mode&1&&$h(m,p.child,null,Z),m.child.memoizedState=Ck(Z),m.memoizedState=Sk,W);if(!(m.mode&1))return XS(p,m,Z,null);if(j.data==="$!"){if(D=j.nextSibling&&j.nextSibling.dataset,D)var pe=D.dgst;return D=pe,W=Error(n(419)),D=vk(W,D,void 0),XS(p,m,Z,D)}if(pe=(Z&p.childLanes)!==0,ta||pe){if(D=Bo,D!==null){switch(Z&-Z){case 4:j=2;break;case 16:j=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:j=32;break;case 536870912:j=268435456;break;default:j=0}j=j&(D.suspendedLanes|Z)?0:j,j!==0&&j!==W.retryLane&&(W.retryLane=j,Hc(p,j),il(D,p,j,-1))}return Bk(),D=vk(Error(n(421))),XS(p,m,Z,D)}return j.data==="$?"?(m.flags|=128,m.child=p.child,m=Jpe.bind(null,p),j._reactRetry=m,null):(p=W.treeContext,Oa=Ju(j.nextSibling),Ta=m,_r=!0,tl=null,p!==null&&(ss[ls++]=zc,ss[ls++]=Vc,ss[ls++]=Af,zc=p.id,Vc=p.overflow,Af=m),m=Ek(m,D.children),m.flags|=4096,m)}function C5(p,m,P){p.lanes|=m;var D=p.alternate;D!==null&&(D.lanes|=m),tk(p.return,m,P)}function Pk(p,m,P,D,j){var W=p.memoizedState;W===null?p.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:D,tail:P,tailMode:j}:(W.isBackwards=m,W.rendering=null,W.renderingStartTime=0,W.last=D,W.tail=P,W.tailMode=j)}function E5(p,m,P){var D=m.pendingProps,j=D.revealOrder,W=D.tail;if(Mi(p,m,D.children,P),D=Br.current,D&2)D=D&1|2,m.flags|=128;else{if(p!==null&&p.flags&128)e:for(p=m.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&C5(p,P,m);else if(p.tag===19)C5(p,P,m);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===m)break e;for(;p.sibling===null;){if(p.return===null||p.return===m)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}D&=1}if(xr(Br,D),!(m.mode&1))m.memoizedState=null;else switch(j){case"forwards":for(P=m.child,j=null;P!==null;)p=P.alternate,p!==null&&US(p)===null&&(j=P),P=P.sibling;P=j,P===null?(j=m.child,m.child=null):(j=P.sibling,P.sibling=null),Pk(m,!1,j,P,W);break;case"backwards":for(P=null,j=m.child,m.child=null;j!==null;){if(p=j.alternate,p!==null&&US(p)===null){m.child=j;break}p=j.sibling,j.sibling=P,P=j,j=p}Pk(m,!0,P,null,W);break;case"together":Pk(m,!1,null,null,void 0);break;default:m.memoizedState=null}return m.child}function JS(p,m){!(m.mode&1)&&p!==null&&(p.alternate=null,m.alternate=null,m.flags|=2)}function Wc(p,m,P){if(p!==null&&(m.dependencies=p.dependencies),Nf|=m.lanes,!(P&m.childLanes))return null;if(p!==null&&m.child!==p.child)throw Error(n(153));if(m.child!==null){for(p=m.child,P=cd(p,p.pendingProps),m.child=P,P.return=m;p.sibling!==null;)p=p.sibling,P=P.sibling=cd(p,p.pendingProps),P.return=m;P.sibling=null}return m.child}function Bpe(p,m,P){switch(m.tag){case 3:w5(m),_h();break;case 5:FH(m);break;case 1:ea(m.type)&&_S(m);break;case 4:ok(m,m.stateNode.containerInfo);break;case 10:var D=m.type._context,j=m.memoizedProps.value;xr(BS,D._currentValue),D._currentValue=j;break;case 13:if(D=m.memoizedState,D!==null)return D.dehydrated!==null?(xr(Br,Br.current&1),m.flags|=128,null):P&m.child.childLanes?S5(p,m,P):(xr(Br,Br.current&1),p=Wc(p,m,P),p!==null?p.sibling:null);xr(Br,Br.current&1);break;case 19:if(D=(P&m.childLanes)!==0,p.flags&128){if(D)return E5(p,m,P);m.flags|=128}if(j=m.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),xr(Br,Br.current),D)break;return null;case 22:case 23:return m.lanes=0,y5(p,m,P)}return Wc(p,m,P)}var P5,Ik,I5,T5;P5=function(p,m){for(var P=m.child;P!==null;){if(P.tag===5||P.tag===6)p.appendChild(P.stateNode);else if(P.tag!==4&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===m)break;for(;P.sibling===null;){if(P.return===null||P.return===m)return;P=P.return}P.sibling.return=P.return,P=P.sibling}},Ik=function(){},I5=function(p,m,P,D){var j=p.memoizedProps;if(j!==D){p=m.stateNode,_f(Yl.current);var W=null;switch(P){case"input":j=me(p,j),D=me(p,D),W=[];break;case"select":j=K({},j,{value:void 0}),D=K({},D,{value:void 0}),W=[];break;case"textarea":j=de(p,j),D=de(p,D),W=[];break;default:typeof j.onClick!="function"&&typeof D.onClick=="function"&&(p.onclick=AS)}Vt(P,D);var Z;P=null;for(De in j)if(!D.hasOwnProperty(De)&&j.hasOwnProperty(De)&&j[De]!=null)if(De==="style"){var pe=j[De];for(Z in pe)pe.hasOwnProperty(Z)&&(P||(P={}),P[Z]="")}else De!=="dangerouslySetInnerHTML"&&De!=="children"&&De!=="suppressContentEditableWarning"&&De!=="suppressHydrationWarning"&&De!=="autoFocus"&&(o.hasOwnProperty(De)?W||(W=[]):(W=W||[]).push(De,null));for(De in D){var be=D[De];if(pe=j!=null?j[De]:void 0,D.hasOwnProperty(De)&&be!==pe&&(be!=null||pe!=null))if(De==="style")if(pe){for(Z in pe)!pe.hasOwnProperty(Z)||be&&be.hasOwnProperty(Z)||(P||(P={}),P[Z]="");for(Z in be)be.hasOwnProperty(Z)&&pe[Z]!==be[Z]&&(P||(P={}),P[Z]=be[Z])}else P||(W||(W=[]),W.push(De,P)),P=be;else De==="dangerouslySetInnerHTML"?(be=be?be.__html:void 0,pe=pe?pe.__html:void 0,be!=null&&pe!==be&&(W=W||[]).push(De,be)):De==="children"?typeof be!="string"&&typeof be!="number"||(W=W||[]).push(De,""+be):De!=="suppressContentEditableWarning"&&De!=="suppressHydrationWarning"&&(o.hasOwnProperty(De)?(be!=null&&De==="onScroll"&&Ir("scroll",p),W||pe===be||(W=[])):(W=W||[]).push(De,be))}P&&(W=W||[]).push("style",P);var De=W;(m.updateQueue=De)&&(m.flags|=4)}},T5=function(p,m,P,D){P!==D&&(m.flags|=4)};function zv(p,m){if(!_r)switch(p.tailMode){case"hidden":m=p.tail;for(var P=null;m!==null;)m.alternate!==null&&(P=m),m=m.sibling;P===null?p.tail=null:P.sibling=null;break;case"collapsed":P=p.tail;for(var D=null;P!==null;)P.alternate!==null&&(D=P),P=P.sibling;D===null?m||p.tail===null?p.tail=null:p.tail.sibling=null:D.sibling=null}}function pi(p){var m=p.alternate!==null&&p.alternate.child===p.child,P=0,D=0;if(m)for(var j=p.child;j!==null;)P|=j.lanes|j.childLanes,D|=j.subtreeFlags&14680064,D|=j.flags&14680064,j.return=p,j=j.sibling;else for(j=p.child;j!==null;)P|=j.lanes|j.childLanes,D|=j.subtreeFlags,D|=j.flags,j.return=p,j=j.sibling;return p.subtreeFlags|=D,p.childLanes=P,m}function zpe(p,m,P){var D=m.pendingProps;switch(KO(m),m.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pi(m),null;case 1:return ea(m.type)&&DS(),pi(m),null;case 3:return D=m.stateNode,Fh(),Tr(Zi),Tr(di),sk(),D.pendingContext&&(D.context=D.pendingContext,D.pendingContext=null),(p===null||p.child===null)&&(FS(m)?m.flags|=4:p===null||p.memoizedState.isDehydrated&&!(m.flags&256)||(m.flags|=1024,tl!==null&&(Lk(tl),tl=null))),Ik(p,m),pi(m),null;case 5:ik(m);var j=_f(Nv.current);if(P=m.type,p!==null&&m.stateNode!=null)I5(p,m,P,D,j),p.ref!==m.ref&&(m.flags|=512,m.flags|=2097152);else{if(!D){if(m.stateNode===null)throw Error(n(166));return pi(m),null}if(p=_f(Yl.current),FS(m)){D=m.stateNode,P=m.type;var W=m.memoizedProps;switch(D[Kl]=m,D[Av]=W,p=(m.mode&1)!==0,P){case"dialog":Ir("cancel",D),Ir("close",D);break;case"iframe":case"object":case"embed":Ir("load",D);break;case"video":case"audio":for(j=0;j<Ov.length;j++)Ir(Ov[j],D);break;case"source":Ir("error",D);break;case"img":case"image":case"link":Ir("error",D),Ir("load",D);break;case"details":Ir("toggle",D);break;case"input":Se(D,W),Ir("invalid",D);break;case"select":D._wrapperState={wasMultiple:!!W.multiple},Ir("invalid",D);break;case"textarea":$e(D,W),Ir("invalid",D)}Vt(P,W),j=null;for(var Z in W)if(W.hasOwnProperty(Z)){var pe=W[Z];Z==="children"?typeof pe=="string"?D.textContent!==pe&&(W.suppressHydrationWarning!==!0&&MS(D.textContent,pe,p),j=["children",pe]):typeof pe=="number"&&D.textContent!==""+pe&&(W.suppressHydrationWarning!==!0&&MS(D.textContent,pe,p),j=["children",""+pe]):o.hasOwnProperty(Z)&&pe!=null&&Z==="onScroll"&&Ir("scroll",D)}switch(P){case"input":he(D),xe(D,W,!0);break;case"textarea":he(D),Ne(D);break;case"select":case"option":break;default:typeof W.onClick=="function"&&(D.onclick=AS)}D=j,m.updateQueue=D,D!==null&&(m.flags|=4)}else{Z=j.nodeType===9?j:j.ownerDocument,p==="http://www.w3.org/1999/xhtml"&&(p=Ue(P)),p==="http://www.w3.org/1999/xhtml"?P==="script"?(p=Z.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild)):typeof D.is=="string"?p=Z.createElement(P,{is:D.is}):(p=Z.createElement(P),P==="select"&&(Z=p,D.multiple?Z.multiple=!0:D.size&&(Z.size=D.size))):p=Z.createElementNS(p,P),p[Kl]=m,p[Av]=D,P5(p,m,!1,!1),m.stateNode=p;e:{switch(Z=Mn(P,D),P){case"dialog":Ir("cancel",p),Ir("close",p),j=D;break;case"iframe":case"object":case"embed":Ir("load",p),j=D;break;case"video":case"audio":for(j=0;j<Ov.length;j++)Ir(Ov[j],p);j=D;break;case"source":Ir("error",p),j=D;break;case"img":case"image":case"link":Ir("error",p),Ir("load",p),j=D;break;case"details":Ir("toggle",p),j=D;break;case"input":Se(p,D),j=me(p,D),Ir("invalid",p);break;case"option":j=D;break;case"select":p._wrapperState={wasMultiple:!!D.multiple},j=K({},D,{value:void 0}),Ir("invalid",p);break;case"textarea":$e(p,D),j=de(p,D),Ir("invalid",p);break;default:j=D}Vt(P,j),pe=j;for(W in pe)if(pe.hasOwnProperty(W)){var be=pe[W];W==="style"?Bt(p,be):W==="dangerouslySetInnerHTML"?(be=be?be.__html:void 0,be!=null&&Ye(p,be)):W==="children"?typeof be=="string"?(P!=="textarea"||be!=="")&&et(p,be):typeof be=="number"&&et(p,""+be):W!=="suppressContentEditableWarning"&&W!=="suppressHydrationWarning"&&W!=="autoFocus"&&(o.hasOwnProperty(W)?be!=null&&W==="onScroll"&&Ir("scroll",p):be!=null&&C(p,W,be,Z))}switch(P){case"input":he(p),xe(p,D,!1);break;case"textarea":he(p),Ne(p);break;case"option":D.value!=null&&p.setAttribute("value",""+ae(D.value));break;case"select":p.multiple=!!D.multiple,W=D.value,W!=null?Le(p,!!D.multiple,W,!1):D.defaultValue!=null&&Le(p,!!D.multiple,D.defaultValue,!0);break;default:typeof j.onClick=="function"&&(p.onclick=AS)}switch(P){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}}D&&(m.flags|=4)}m.ref!==null&&(m.flags|=512,m.flags|=2097152)}return pi(m),null;case 6:if(p&&m.stateNode!=null)T5(p,m,p.memoizedProps,D);else{if(typeof D!="string"&&m.stateNode===null)throw Error(n(166));if(P=_f(Nv.current),_f(Yl.current),FS(m)){if(D=m.stateNode,P=m.memoizedProps,D[Kl]=m,(W=D.nodeValue!==P)&&(p=Ta,p!==null))switch(p.tag){case 3:MS(D.nodeValue,P,(p.mode&1)!==0);break;case 5:p.memoizedProps.suppressHydrationWarning!==!0&&MS(D.nodeValue,P,(p.mode&1)!==0)}W&&(m.flags|=4)}else D=(P.nodeType===9?P:P.ownerDocument).createTextNode(D),D[Kl]=m,m.stateNode=D}return pi(m),null;case 13:if(Tr(Br),D=m.memoizedState,p===null||p.memoizedState!==null&&p.memoizedState.dehydrated!==null){if(_r&&Oa!==null&&m.mode&1&&!(m.flags&128))MH(),_h(),m.flags|=98560,W=!1;else if(W=FS(m),D!==null&&D.dehydrated!==null){if(p===null){if(!W)throw Error(n(318));if(W=m.memoizedState,W=W!==null?W.dehydrated:null,!W)throw Error(n(317));W[Kl]=m}else _h(),!(m.flags&128)&&(m.memoizedState=null),m.flags|=4;pi(m),W=!1}else tl!==null&&(Lk(tl),tl=null),W=!0;if(!W)return m.flags&65536?m:null}return m.flags&128?(m.lanes=P,m):(D=D!==null,D!==(p!==null&&p.memoizedState!==null)&&D&&(m.child.flags|=8192,m.mode&1&&(p===null||Br.current&1?Po===0&&(Po=3):Bk())),m.updateQueue!==null&&(m.flags|=4),pi(m),null);case 4:return Fh(),Ik(p,m),p===null&&kv(m.stateNode.containerInfo),pi(m),null;case 10:return ek(m.type._context),pi(m),null;case 17:return ea(m.type)&&DS(),pi(m),null;case 19:if(Tr(Br),W=m.memoizedState,W===null)return pi(m),null;if(D=(m.flags&128)!==0,Z=W.rendering,Z===null)if(D)zv(W,!1);else{if(Po!==0||p!==null&&p.flags&128)for(p=m.child;p!==null;){if(Z=US(p),Z!==null){for(m.flags|=128,zv(W,!1),D=Z.updateQueue,D!==null&&(m.updateQueue=D,m.flags|=4),m.subtreeFlags=0,D=P,P=m.child;P!==null;)W=P,p=D,W.flags&=14680066,Z=W.alternate,Z===null?(W.childLanes=0,W.lanes=p,W.child=null,W.subtreeFlags=0,W.memoizedProps=null,W.memoizedState=null,W.updateQueue=null,W.dependencies=null,W.stateNode=null):(W.childLanes=Z.childLanes,W.lanes=Z.lanes,W.child=Z.child,W.subtreeFlags=0,W.deletions=null,W.memoizedProps=Z.memoizedProps,W.memoizedState=Z.memoizedState,W.updateQueue=Z.updateQueue,W.type=Z.type,p=Z.dependencies,W.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),P=P.sibling;return xr(Br,Br.current&1|2),m.child}p=p.sibling}W.tail!==null&&jr()>Vh&&(m.flags|=128,D=!0,zv(W,!1),m.lanes=4194304)}else{if(!D)if(p=US(Z),p!==null){if(m.flags|=128,D=!0,P=p.updateQueue,P!==null&&(m.updateQueue=P,m.flags|=4),zv(W,!0),W.tail===null&&W.tailMode==="hidden"&&!Z.alternate&&!_r)return pi(m),null}else 2*jr()-W.renderingStartTime>Vh&&P!==1073741824&&(m.flags|=128,D=!0,zv(W,!1),m.lanes=4194304);W.isBackwards?(Z.sibling=m.child,m.child=Z):(P=W.last,P!==null?P.sibling=Z:m.child=Z,W.last=Z)}return W.tail!==null?(m=W.tail,W.rendering=m,W.tail=m.sibling,W.renderingStartTime=jr(),m.sibling=null,P=Br.current,xr(Br,D?P&1|2:P&1),m):(pi(m),null);case 22:case 23:return jk(),D=m.memoizedState!==null,p!==null&&p.memoizedState!==null!==D&&(m.flags|=8192),D&&m.mode&1?ka&1073741824&&(pi(m),m.subtreeFlags&6&&(m.flags|=8192)):pi(m),null;case 24:return null;case 25:return null}throw Error(n(156,m.tag))}function Vpe(p,m){switch(KO(m),m.tag){case 1:return ea(m.type)&&DS(),p=m.flags,p&65536?(m.flags=p&-65537|128,m):null;case 3:return Fh(),Tr(Zi),Tr(di),sk(),p=m.flags,p&65536&&!(p&128)?(m.flags=p&-65537|128,m):null;case 5:return ik(m),null;case 13:if(Tr(Br),p=m.memoizedState,p!==null&&p.dehydrated!==null){if(m.alternate===null)throw Error(n(340));_h()}return p=m.flags,p&65536?(m.flags=p&-65537|128,m):null;case 19:return Tr(Br),null;case 4:return Fh(),null;case 10:return ek(m.type._context),null;case 22:case 23:return jk(),null;case 24:return null;default:return null}}var ZS=!1,hi=!1,Hpe=typeof WeakSet=="function"?WeakSet:Set,$t=null;function Bh(p,m){var P=p.ref;if(P!==null)if(typeof P=="function")try{P(null)}catch(D){Xr(p,m,D)}else P.current=null}function Tk(p,m,P){try{P()}catch(D){Xr(p,m,D)}}var O5=!1;function Upe(p,m){if(jO=bS,p=aH(),AO(p)){if("selectionStart"in p)var P={start:p.selectionStart,end:p.selectionEnd};else e:{P=(P=p.ownerDocument)&&P.defaultView||window;var D=P.getSelection&&P.getSelection();if(D&&D.rangeCount!==0){P=D.anchorNode;var j=D.anchorOffset,W=D.focusNode;D=D.focusOffset;try{P.nodeType,W.nodeType}catch{P=null;break e}var Z=0,pe=-1,be=-1,De=0,it=0,ct=p,ot=null;t:for(;;){for(var Mt;ct!==P||j!==0&&ct.nodeType!==3||(pe=Z+j),ct!==W||D!==0&&ct.nodeType!==3||(be=Z+D),ct.nodeType===3&&(Z+=ct.nodeValue.length),(Mt=ct.firstChild)!==null;)ot=ct,ct=Mt;for(;;){if(ct===p)break t;if(ot===P&&++De===j&&(pe=Z),ot===W&&++it===D&&(be=Z),(Mt=ct.nextSibling)!==null)break;ct=ot,ot=ct.parentNode}ct=Mt}P=pe===-1||be===-1?null:{start:pe,end:be}}else P=null}P=P||{start:0,end:0}}else P=null;for(BO={focusedElem:p,selectionRange:P},bS=!1,$t=m;$t!==null;)if(m=$t,p=m.child,(m.subtreeFlags&1028)!==0&&p!==null)p.return=m,$t=p;else for(;$t!==null;){m=$t;try{var Lt=m.alternate;if(m.flags&1024)switch(m.tag){case 0:case 11:case 15:break;case 1:if(Lt!==null){var jt=Lt.memoizedProps,ao=Lt.memoizedState,ke=m.stateNode,Ce=ke.getSnapshotBeforeUpdate(m.elementType===m.type?jt:nl(m.type,jt),ao);ke.__reactInternalSnapshotBeforeUpdate=Ce}break;case 3:var Me=m.stateNode.containerInfo;Me.nodeType===1?Me.textContent="":Me.nodeType===9&&Me.documentElement&&Me.removeChild(Me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ht){Xr(m,m.return,ht)}if(p=m.sibling,p!==null){p.return=m.return,$t=p;break}$t=m.return}return Lt=O5,O5=!1,Lt}function Vv(p,m,P){var D=m.updateQueue;if(D=D!==null?D.lastEffect:null,D!==null){var j=D=D.next;do{if((j.tag&p)===p){var W=j.destroy;j.destroy=void 0,W!==void 0&&Tk(m,P,W)}j=j.next}while(j!==D)}}function eC(p,m){if(m=m.updateQueue,m=m!==null?m.lastEffect:null,m!==null){var P=m=m.next;do{if((P.tag&p)===p){var D=P.create;P.destroy=D()}P=P.next}while(P!==m)}}function Ok(p){var m=p.ref;if(m!==null){var P=p.stateNode;switch(p.tag){case 5:p=P;break;default:p=P}typeof m=="function"?m(p):m.current=p}}function k5(p){var m=p.alternate;m!==null&&(p.alternate=null,k5(m)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(m=p.stateNode,m!==null&&(delete m[Kl],delete m[Av],delete m[UO],delete m[Ipe],delete m[Tpe])),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function M5(p){return p.tag===5||p.tag===3||p.tag===4}function A5(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||M5(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function kk(p,m,P){var D=p.tag;if(D===5||D===6)p=p.stateNode,m?P.nodeType===8?P.parentNode.insertBefore(p,m):P.insertBefore(p,m):(P.nodeType===8?(m=P.parentNode,m.insertBefore(p,P)):(m=P,m.appendChild(p)),P=P._reactRootContainer,P!=null||m.onclick!==null||(m.onclick=AS));else if(D!==4&&(p=p.child,p!==null))for(kk(p,m,P),p=p.sibling;p!==null;)kk(p,m,P),p=p.sibling}function Mk(p,m,P){var D=p.tag;if(D===5||D===6)p=p.stateNode,m?P.insertBefore(p,m):P.appendChild(p);else if(D!==4&&(p=p.child,p!==null))for(Mk(p,m,P),p=p.sibling;p!==null;)Mk(p,m,P),p=p.sibling}var ei=null,rl=!1;function od(p,m,P){for(P=P.child;P!==null;)R5(p,m,P),P=P.sibling}function R5(p,m,P){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(ql,P)}catch{}switch(P.tag){case 5:hi||Bh(P,m);case 6:var D=ei,j=rl;ei=null,od(p,m,P),ei=D,rl=j,ei!==null&&(rl?(p=ei,P=P.stateNode,p.nodeType===8?p.parentNode.removeChild(P):p.removeChild(P)):ei.removeChild(P.stateNode));break;case 18:ei!==null&&(rl?(p=ei,P=P.stateNode,p.nodeType===8?HO(p.parentNode,P):p.nodeType===1&&HO(p,P),wv(p)):HO(ei,P.stateNode));break;case 4:D=ei,j=rl,ei=P.stateNode.containerInfo,rl=!0,od(p,m,P),ei=D,rl=j;break;case 0:case 11:case 14:case 15:if(!hi&&(D=P.updateQueue,D!==null&&(D=D.lastEffect,D!==null))){j=D=D.next;do{var W=j,Z=W.destroy;W=W.tag,Z!==void 0&&(W&2||W&4)&&Tk(P,m,Z),j=j.next}while(j!==D)}od(p,m,P);break;case 1:if(!hi&&(Bh(P,m),D=P.stateNode,typeof D.componentWillUnmount=="function"))try{D.props=P.memoizedProps,D.state=P.memoizedState,D.componentWillUnmount()}catch(pe){Xr(P,m,pe)}od(p,m,P);break;case 21:od(p,m,P);break;case 22:P.mode&1?(hi=(D=hi)||P.memoizedState!==null,od(p,m,P),hi=D):od(p,m,P);break;default:od(p,m,P)}}function D5(p){var m=p.updateQueue;if(m!==null){p.updateQueue=null;var P=p.stateNode;P===null&&(P=p.stateNode=new Hpe),m.forEach(function(D){var j=Zpe.bind(null,p,D);P.has(D)||(P.add(D),D.then(j,j))})}}function ol(p,m){var P=m.deletions;if(P!==null)for(var D=0;D<P.length;D++){var j=P[D];try{var W=p,Z=m,pe=Z;e:for(;pe!==null;){switch(pe.tag){case 5:ei=pe.stateNode,rl=!1;break e;case 3:ei=pe.stateNode.containerInfo,rl=!0;break e;case 4:ei=pe.stateNode.containerInfo,rl=!0;break e}pe=pe.return}if(ei===null)throw Error(n(160));R5(W,Z,j),ei=null,rl=!1;var be=j.alternate;be!==null&&(be.return=null),j.return=null}catch(De){Xr(j,m,De)}}if(m.subtreeFlags&12854)for(m=m.child;m!==null;)_5(m,p),m=m.sibling}function _5(p,m){var P=p.alternate,D=p.flags;switch(p.tag){case 0:case 11:case 14:case 15:if(ol(m,p),Xl(p),D&4){try{Vv(3,p,p.return),eC(3,p)}catch(jt){Xr(p,p.return,jt)}try{Vv(5,p,p.return)}catch(jt){Xr(p,p.return,jt)}}break;case 1:ol(m,p),Xl(p),D&512&&P!==null&&Bh(P,P.return);break;case 5:if(ol(m,p),Xl(p),D&512&&P!==null&&Bh(P,P.return),p.flags&32){var j=p.stateNode;try{et(j,"")}catch(jt){Xr(p,p.return,jt)}}if(D&4&&(j=p.stateNode,j!=null)){var W=p.memoizedProps,Z=P!==null?P.memoizedProps:W,pe=p.type,be=p.updateQueue;if(p.updateQueue=null,be!==null)try{pe==="input"&&W.type==="radio"&&W.name!=null&&Ee(j,W),Mn(pe,Z);var De=Mn(pe,W);for(Z=0;Z<be.length;Z+=2){var it=be[Z],ct=be[Z+1];it==="style"?Bt(j,ct):it==="dangerouslySetInnerHTML"?Ye(j,ct):it==="children"?et(j,ct):C(j,it,ct,De)}switch(pe){case"input":ge(j,W);break;case"textarea":Ae(j,W);break;case"select":var ot=j._wrapperState.wasMultiple;j._wrapperState.wasMultiple=!!W.multiple;var Mt=W.value;Mt!=null?Le(j,!!W.multiple,Mt,!1):ot!==!!W.multiple&&(W.defaultValue!=null?Le(j,!!W.multiple,W.defaultValue,!0):Le(j,!!W.multiple,W.multiple?[]:"",!1))}j[Av]=W}catch(jt){Xr(p,p.return,jt)}}break;case 6:if(ol(m,p),Xl(p),D&4){if(p.stateNode===null)throw Error(n(162));j=p.stateNode,W=p.memoizedProps;try{j.nodeValue=W}catch(jt){Xr(p,p.return,jt)}}break;case 3:if(ol(m,p),Xl(p),D&4&&P!==null&&P.memoizedState.isDehydrated)try{wv(m.containerInfo)}catch(jt){Xr(p,p.return,jt)}break;case 4:ol(m,p),Xl(p);break;case 13:ol(m,p),Xl(p),j=p.child,j.flags&8192&&(W=j.memoizedState!==null,j.stateNode.isHidden=W,!W||j.alternate!==null&&j.alternate.memoizedState!==null||(Dk=jr())),D&4&&D5(p);break;case 22:if(it=P!==null&&P.memoizedState!==null,p.mode&1?(hi=(De=hi)||it,ol(m,p),hi=De):ol(m,p),Xl(p),D&8192){if(De=p.memoizedState!==null,(p.stateNode.isHidden=De)&&!it&&p.mode&1)for($t=p,it=p.child;it!==null;){for(ct=$t=it;$t!==null;){switch(ot=$t,Mt=ot.child,ot.tag){case 0:case 11:case 14:case 15:Vv(4,ot,ot.return);break;case 1:Bh(ot,ot.return);var Lt=ot.stateNode;if(typeof Lt.componentWillUnmount=="function"){D=ot,P=ot.return;try{m=D,Lt.props=m.memoizedProps,Lt.state=m.memoizedState,Lt.componentWillUnmount()}catch(jt){Xr(D,P,jt)}}break;case 5:Bh(ot,ot.return);break;case 22:if(ot.memoizedState!==null){L5(ct);continue}}Mt!==null?(Mt.return=ot,$t=Mt):L5(ct)}it=it.sibling}e:for(it=null,ct=p;;){if(ct.tag===5){if(it===null){it=ct;try{j=ct.stateNode,De?(W=j.style,typeof W.setProperty=="function"?W.setProperty("display","none","important"):W.display="none"):(pe=ct.stateNode,be=ct.memoizedProps.style,Z=be!=null&&be.hasOwnProperty("display")?be.display:null,pe.style.display=At("display",Z))}catch(jt){Xr(p,p.return,jt)}}}else if(ct.tag===6){if(it===null)try{ct.stateNode.nodeValue=De?"":ct.memoizedProps}catch(jt){Xr(p,p.return,jt)}}else if((ct.tag!==22&&ct.tag!==23||ct.memoizedState===null||ct===p)&&ct.child!==null){ct.child.return=ct,ct=ct.child;continue}if(ct===p)break e;for(;ct.sibling===null;){if(ct.return===null||ct.return===p)break e;it===ct&&(it=null),ct=ct.return}it===ct&&(it=null),ct.sibling.return=ct.return,ct=ct.sibling}}break;case 19:ol(m,p),Xl(p),D&4&&D5(p);break;case 21:break;default:ol(m,p),Xl(p)}}function Xl(p){var m=p.flags;if(m&2){try{e:{for(var P=p.return;P!==null;){if(M5(P)){var D=P;break e}P=P.return}throw Error(n(160))}switch(D.tag){case 5:var j=D.stateNode;D.flags&32&&(et(j,""),D.flags&=-33);var W=A5(p);Mk(p,W,j);break;case 3:case 4:var Z=D.stateNode.containerInfo,pe=A5(p);kk(p,pe,Z);break;default:throw Error(n(161))}}catch(be){Xr(p,p.return,be)}p.flags&=-3}m&4096&&(p.flags&=-4097)}function Wpe(p,m,P){$t=p,$5(p)}function $5(p,m,P){for(var D=(p.mode&1)!==0;$t!==null;){var j=$t,W=j.child;if(j.tag===22&&D){var Z=j.memoizedState!==null||ZS;if(!Z){var pe=j.alternate,be=pe!==null&&pe.memoizedState!==null||hi;pe=ZS;var De=hi;if(ZS=Z,(hi=be)&&!De)for($t=j;$t!==null;)Z=$t,be=Z.child,Z.tag===22&&Z.memoizedState!==null?F5(j):be!==null?(be.return=Z,$t=be):F5(j);for(;W!==null;)$t=W,$5(W),W=W.sibling;$t=j,ZS=pe,hi=De}N5(p)}else j.subtreeFlags&8772&&W!==null?(W.return=j,$t=W):N5(p)}}function N5(p){for(;$t!==null;){var m=$t;if(m.flags&8772){var P=m.alternate;try{if(m.flags&8772)switch(m.tag){case 0:case 11:case 15:hi||eC(5,m);break;case 1:var D=m.stateNode;if(m.flags&4&&!hi)if(P===null)D.componentDidMount();else{var j=m.elementType===m.type?P.memoizedProps:nl(m.type,P.memoizedProps);D.componentDidUpdate(j,P.memoizedState,D.__reactInternalSnapshotBeforeUpdate)}var W=m.updateQueue;W!==null&&LH(m,W,D);break;case 3:var Z=m.updateQueue;if(Z!==null){if(P=null,m.child!==null)switch(m.child.tag){case 5:P=m.child.stateNode;break;case 1:P=m.child.stateNode}LH(m,Z,P)}break;case 5:var pe=m.stateNode;if(P===null&&m.flags&4){P=pe;var be=m.memoizedProps;switch(m.type){case"button":case"input":case"select":case"textarea":be.autoFocus&&P.focus();break;case"img":be.src&&(P.src=be.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(m.memoizedState===null){var De=m.alternate;if(De!==null){var it=De.memoizedState;if(it!==null){var ct=it.dehydrated;ct!==null&&wv(ct)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}hi||m.flags&512&&Ok(m)}catch(ot){Xr(m,m.return,ot)}}if(m===p){$t=null;break}if(P=m.sibling,P!==null){P.return=m.return,$t=P;break}$t=m.return}}function L5(p){for(;$t!==null;){var m=$t;if(m===p){$t=null;break}var P=m.sibling;if(P!==null){P.return=m.return,$t=P;break}$t=m.return}}function F5(p){for(;$t!==null;){var m=$t;try{switch(m.tag){case 0:case 11:case 15:var P=m.return;try{eC(4,m)}catch(be){Xr(m,P,be)}break;case 1:var D=m.stateNode;if(typeof D.componentDidMount=="function"){var j=m.return;try{D.componentDidMount()}catch(be){Xr(m,j,be)}}var W=m.return;try{Ok(m)}catch(be){Xr(m,W,be)}break;case 5:var Z=m.return;try{Ok(m)}catch(be){Xr(m,Z,be)}}}catch(be){Xr(m,m.return,be)}if(m===p){$t=null;break}var pe=m.sibling;if(pe!==null){pe.return=m.return,$t=pe;break}$t=m.return}}var Gpe=Math.ceil,tC=I.ReactCurrentDispatcher,Ak=I.ReactCurrentOwner,ds=I.ReactCurrentBatchConfig,Hn=0,Bo=null,go=null,ti=0,ka=0,zh=Zu(0),Po=0,Hv=null,Nf=0,nC=0,Rk=0,Uv=null,na=null,Dk=0,Vh=1/0,Gc=null,rC=!1,_k=null,id=null,oC=!1,ad=null,iC=0,Wv=0,$k=null,aC=-1,sC=0;function Ai(){return Hn&6?jr():aC!==-1?aC:aC=jr()}function sd(p){return p.mode&1?Hn&2&&ti!==0?ti&-ti:kpe.transition!==null?(sC===0&&(sC=AV()),sC):(p=ur,p!==0||(p=window.event,p=p===void 0?16:BV(p.type)),p):1}function il(p,m,P,D){if(50<Wv)throw Wv=0,$k=null,Error(n(185));mv(p,P,D),(!(Hn&2)||p!==Bo)&&(p===Bo&&(!(Hn&2)&&(nC|=P),Po===4&&ld(p,ti)),ra(p,D),P===1&&Hn===0&&!(m.mode&1)&&(Vh=jr()+500,$S&&td()))}function ra(p,m){var P=p.callbackNode;kfe(p,m);var D=gS(p,p===Bo?ti:0);if(D===0)P!==null&&Fr(P),p.callbackNode=null,p.callbackPriority=0;else if(m=D&-D,p.callbackPriority!==m){if(P!=null&&Fr(P),m===1)p.tag===0?Ope(B5.bind(null,p)):PH(B5.bind(null,p)),Epe(function(){!(Hn&6)&&td()}),P=null;else{switch(RV(D)){case 1:P=Wu;break;case 4:P=Of;break;case 16:P=$n;break;case 536870912:P=Js;break;default:P=$n}P=K5(P,j5.bind(null,p))}p.callbackPriority=m,p.callbackNode=P}}function j5(p,m){if(aC=-1,sC=0,Hn&6)throw Error(n(327));var P=p.callbackNode;if(Hh()&&p.callbackNode!==P)return null;var D=gS(p,p===Bo?ti:0);if(D===0)return null;if(D&30||D&p.expiredLanes||m)m=lC(p,D);else{m=D;var j=Hn;Hn|=2;var W=V5();(Bo!==p||ti!==m)&&(Gc=null,Vh=jr()+500,Ff(p,m));do try{Ype();break}catch(pe){z5(p,pe)}while(!0);ZO(),tC.current=W,Hn=j,go!==null?m=0:(Bo=null,ti=0,m=Po)}if(m!==0){if(m===2&&(j=mO(p),j!==0&&(D=j,m=Nk(p,j))),m===1)throw P=Hv,Ff(p,0),ld(p,D),ra(p,jr()),P;if(m===6)ld(p,D);else{if(j=p.current.alternate,!(D&30)&&!qpe(j)&&(m=lC(p,D),m===2&&(W=mO(p),W!==0&&(D=W,m=Nk(p,W))),m===1))throw P=Hv,Ff(p,0),ld(p,D),ra(p,jr()),P;switch(p.finishedWork=j,p.finishedLanes=D,m){case 0:case 1:throw Error(n(345));case 2:jf(p,na,Gc);break;case 3:if(ld(p,D),(D&130023424)===D&&(m=Dk+500-jr(),10<m)){if(gS(p,0)!==0)break;if(j=p.suspendedLanes,(j&D)!==D){Ai(),p.pingedLanes|=p.suspendedLanes&j;break}p.timeoutHandle=VO(jf.bind(null,p,na,Gc),m);break}jf(p,na,Gc);break;case 4:if(ld(p,D),(D&4194240)===D)break;for(m=p.eventTimes,j=-1;0<D;){var Z=31-Zs(D);W=1<<Z,Z=m[Z],Z>j&&(j=Z),D&=~W}if(D=j,D=jr()-D,D=(120>D?120:480>D?480:1080>D?1080:1920>D?1920:3e3>D?3e3:4320>D?4320:1960*Gpe(D/1960))-D,10<D){p.timeoutHandle=VO(jf.bind(null,p,na,Gc),D);break}jf(p,na,Gc);break;case 5:jf(p,na,Gc);break;default:throw Error(n(329))}}}return ra(p,jr()),p.callbackNode===P?j5.bind(null,p):null}function Nk(p,m){var P=Uv;return p.current.memoizedState.isDehydrated&&(Ff(p,m).flags|=256),p=lC(p,m),p!==2&&(m=na,na=P,m!==null&&Lk(m)),p}function Lk(p){na===null?na=p:na.push.apply(na,p)}function qpe(p){for(var m=p;;){if(m.flags&16384){var P=m.updateQueue;if(P!==null&&(P=P.stores,P!==null))for(var D=0;D<P.length;D++){var j=P[D],W=j.getSnapshot;j=j.value;try{if(!el(W(),j))return!1}catch{return!1}}}if(P=m.child,m.subtreeFlags&16384&&P!==null)P.return=m,m=P;else{if(m===p)break;for(;m.sibling===null;){if(m.return===null||m.return===p)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function ld(p,m){for(m&=~Rk,m&=~nC,p.suspendedLanes|=m,p.pingedLanes&=~m,p=p.expirationTimes;0<m;){var P=31-Zs(m),D=1<<P;p[P]=-1,m&=~D}}function B5(p){if(Hn&6)throw Error(n(327));Hh();var m=gS(p,0);if(!(m&1))return ra(p,jr()),null;var P=lC(p,m);if(p.tag!==0&&P===2){var D=mO(p);D!==0&&(m=D,P=Nk(p,D))}if(P===1)throw P=Hv,Ff(p,0),ld(p,m),ra(p,jr()),P;if(P===6)throw Error(n(345));return p.finishedWork=p.current.alternate,p.finishedLanes=m,jf(p,na,Gc),ra(p,jr()),null}function Fk(p,m){var P=Hn;Hn|=1;try{return p(m)}finally{Hn=P,Hn===0&&(Vh=jr()+500,$S&&td())}}function Lf(p){ad!==null&&ad.tag===0&&!(Hn&6)&&Hh();var m=Hn;Hn|=1;var P=ds.transition,D=ur;try{if(ds.transition=null,ur=1,p)return p()}finally{ur=D,ds.transition=P,Hn=m,!(Hn&6)&&td()}}function jk(){ka=zh.current,Tr(zh)}function Ff(p,m){p.finishedWork=null,p.finishedLanes=0;var P=p.timeoutHandle;if(P!==-1&&(p.timeoutHandle=-1,Cpe(P)),go!==null)for(P=go.return;P!==null;){var D=P;switch(KO(D),D.tag){case 1:D=D.type.childContextTypes,D!=null&&DS();break;case 3:Fh(),Tr(Zi),Tr(di),sk();break;case 5:ik(D);break;case 4:Fh();break;case 13:Tr(Br);break;case 19:Tr(Br);break;case 10:ek(D.type._context);break;case 22:case 23:jk()}P=P.return}if(Bo=p,go=p=cd(p.current,null),ti=ka=m,Po=0,Hv=null,Rk=nC=Nf=0,na=Uv=null,Df!==null){for(m=0;m<Df.length;m++)if(P=Df[m],D=P.interleaved,D!==null){P.interleaved=null;var j=D.next,W=P.pending;if(W!==null){var Z=W.next;W.next=j,D.next=Z}P.pending=D}Df=null}return p}function z5(p,m){do{var P=go;try{if(ZO(),WS.current=YS,GS){for(var D=zr.memoizedState;D!==null;){var j=D.queue;j!==null&&(j.pending=null),D=D.next}GS=!1}if($f=0,jo=Eo=zr=null,Lv=!1,Fv=0,Ak.current=null,P===null||P.return===null){Po=1,Hv=m,go=null;break}e:{var W=p,Z=P.return,pe=P,be=m;if(m=ti,pe.flags|=32768,be!==null&&typeof be=="object"&&typeof be.then=="function"){var De=be,it=pe,ct=it.tag;if(!(it.mode&1)&&(ct===0||ct===11||ct===15)){var ot=it.alternate;ot?(it.updateQueue=ot.updateQueue,it.memoizedState=ot.memoizedState,it.lanes=ot.lanes):(it.updateQueue=null,it.memoizedState=null)}var Mt=f5(Z);if(Mt!==null){Mt.flags&=-257,p5(Mt,Z,pe,W,m),Mt.mode&1&&d5(W,De,m),m=Mt,be=De;var Lt=m.updateQueue;if(Lt===null){var jt=new Set;jt.add(be),m.updateQueue=jt}else Lt.add(be);break e}else{if(!(m&1)){d5(W,De,m),Bk();break e}be=Error(n(426))}}else if(_r&&pe.mode&1){var ao=f5(Z);if(ao!==null){!(ao.flags&65536)&&(ao.flags|=256),p5(ao,Z,pe,W,m),XO(jh(be,pe));break e}}W=be=jh(be,pe),Po!==4&&(Po=2),Uv===null?Uv=[W]:Uv.push(W),W=Z;do{switch(W.tag){case 3:W.flags|=65536,m&=-m,W.lanes|=m;var ke=c5(W,be,m);NH(W,ke);break e;case 1:pe=be;var Ce=W.type,Me=W.stateNode;if(!(W.flags&128)&&(typeof Ce.getDerivedStateFromError=="function"||Me!==null&&typeof Me.componentDidCatch=="function"&&(id===null||!id.has(Me)))){W.flags|=65536,m&=-m,W.lanes|=m;var ht=u5(W,pe,m);NH(W,ht);break e}}W=W.return}while(W!==null)}U5(P)}catch(Ht){m=Ht,go===P&&P!==null&&(go=P=P.return);continue}break}while(!0)}function V5(){var p=tC.current;return tC.current=YS,p===null?YS:p}function Bk(){(Po===0||Po===3||Po===2)&&(Po=4),Bo===null||!(Nf&268435455)&&!(nC&268435455)||ld(Bo,ti)}function lC(p,m){var P=Hn;Hn|=2;var D=V5();(Bo!==p||ti!==m)&&(Gc=null,Ff(p,m));do try{Kpe();break}catch(j){z5(p,j)}while(!0);if(ZO(),Hn=P,tC.current=D,go!==null)throw Error(n(261));return Bo=null,ti=0,Po}function Kpe(){for(;go!==null;)H5(go)}function Ype(){for(;go!==null&&!Ji();)H5(go)}function H5(p){var m=q5(p.alternate,p,ka);p.memoizedProps=p.pendingProps,m===null?U5(p):go=m,Ak.current=null}function U5(p){var m=p;do{var P=m.alternate;if(p=m.return,m.flags&32768){if(P=Vpe(P,m),P!==null){P.flags&=32767,go=P;return}if(p!==null)p.flags|=32768,p.subtreeFlags=0,p.deletions=null;else{Po=6,go=null;return}}else if(P=zpe(P,m,ka),P!==null){go=P;return}if(m=m.sibling,m!==null){go=m;return}go=m=p}while(m!==null);Po===0&&(Po=5)}function jf(p,m,P){var D=ur,j=ds.transition;try{ds.transition=null,ur=1,Qpe(p,m,P,D)}finally{ds.transition=j,ur=D}return null}function Qpe(p,m,P,D){do Hh();while(ad!==null);if(Hn&6)throw Error(n(327));P=p.finishedWork;var j=p.finishedLanes;if(P===null)return null;if(p.finishedWork=null,p.finishedLanes=0,P===p.current)throw Error(n(177));p.callbackNode=null,p.callbackPriority=0;var W=P.lanes|P.childLanes;if(Mfe(p,W),p===Bo&&(go=Bo=null,ti=0),!(P.subtreeFlags&2064)&&!(P.flags&2064)||oC||(oC=!0,K5($n,function(){return Hh(),null})),W=(P.flags&15990)!==0,P.subtreeFlags&15990||W){W=ds.transition,ds.transition=null;var Z=ur;ur=1;var pe=Hn;Hn|=4,Ak.current=null,Upe(p,P),_5(P,p),gpe(BO),bS=!!jO,BO=jO=null,p.current=P,Wpe(P),pv(),Hn=pe,ur=Z,ds.transition=W}else p.current=P;if(oC&&(oC=!1,ad=p,iC=j),W=p.pendingLanes,W===0&&(id=null),Efe(P.stateNode),ra(p,jr()),m!==null)for(D=p.onRecoverableError,P=0;P<m.length;P++)j=m[P],D(j.value,{componentStack:j.stack,digest:j.digest});if(rC)throw rC=!1,p=_k,_k=null,p;return iC&1&&p.tag!==0&&Hh(),W=p.pendingLanes,W&1?p===$k?Wv++:(Wv=0,$k=p):Wv=0,td(),null}function Hh(){if(ad!==null){var p=RV(iC),m=ds.transition,P=ur;try{if(ds.transition=null,ur=16>p?16:p,ad===null)var D=!1;else{if(p=ad,ad=null,iC=0,Hn&6)throw Error(n(331));var j=Hn;for(Hn|=4,$t=p.current;$t!==null;){var W=$t,Z=W.child;if($t.flags&16){var pe=W.deletions;if(pe!==null){for(var be=0;be<pe.length;be++){var De=pe[be];for($t=De;$t!==null;){var it=$t;switch(it.tag){case 0:case 11:case 15:Vv(8,it,W)}var ct=it.child;if(ct!==null)ct.return=it,$t=ct;else for(;$t!==null;){it=$t;var ot=it.sibling,Mt=it.return;if(k5(it),it===De){$t=null;break}if(ot!==null){ot.return=Mt,$t=ot;break}$t=Mt}}}var Lt=W.alternate;if(Lt!==null){var jt=Lt.child;if(jt!==null){Lt.child=null;do{var ao=jt.sibling;jt.sibling=null,jt=ao}while(jt!==null)}}$t=W}}if(W.subtreeFlags&2064&&Z!==null)Z.return=W,$t=Z;else e:for(;$t!==null;){if(W=$t,W.flags&2048)switch(W.tag){case 0:case 11:case 15:Vv(9,W,W.return)}var ke=W.sibling;if(ke!==null){ke.return=W.return,$t=ke;break e}$t=W.return}}var Ce=p.current;for($t=Ce;$t!==null;){Z=$t;var Me=Z.child;if(Z.subtreeFlags&2064&&Me!==null)Me.return=Z,$t=Me;else e:for(Z=Ce;$t!==null;){if(pe=$t,pe.flags&2048)try{switch(pe.tag){case 0:case 11:case 15:eC(9,pe)}}catch(Ht){Xr(pe,pe.return,Ht)}if(pe===Z){$t=null;break e}var ht=pe.sibling;if(ht!==null){ht.return=pe.return,$t=ht;break e}$t=pe.return}}if(Hn=j,td(),as&&typeof as.onPostCommitFiberRoot=="function")try{as.onPostCommitFiberRoot(ql,p)}catch{}D=!0}return D}finally{ur=P,ds.transition=m}}return!1}function W5(p,m,P){m=jh(P,m),m=c5(p,m,1),p=rd(p,m,1),m=Ai(),p!==null&&(mv(p,1,m),ra(p,m))}function Xr(p,m,P){if(p.tag===3)W5(p,p,P);else for(;m!==null;){if(m.tag===3){W5(m,p,P);break}else if(m.tag===1){var D=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(id===null||!id.has(D))){p=jh(P,p),p=u5(m,p,1),m=rd(m,p,1),p=Ai(),m!==null&&(mv(m,1,p),ra(m,p));break}}m=m.return}}function Xpe(p,m,P){var D=p.pingCache;D!==null&&D.delete(m),m=Ai(),p.pingedLanes|=p.suspendedLanes&P,Bo===p&&(ti&P)===P&&(Po===4||Po===3&&(ti&130023424)===ti&&500>jr()-Dk?Ff(p,0):Rk|=P),ra(p,m)}function G5(p,m){m===0&&(p.mode&1?(m=mS,mS<<=1,!(mS&130023424)&&(mS=4194304)):m=1);var P=Ai();p=Hc(p,m),p!==null&&(mv(p,m,P),ra(p,P))}function Jpe(p){var m=p.memoizedState,P=0;m!==null&&(P=m.retryLane),G5(p,P)}function Zpe(p,m){var P=0;switch(p.tag){case 13:var D=p.stateNode,j=p.memoizedState;j!==null&&(P=j.retryLane);break;case 19:D=p.stateNode;break;default:throw Error(n(314))}D!==null&&D.delete(m),G5(p,P)}var q5;q5=function(p,m,P){if(p!==null)if(p.memoizedProps!==m.pendingProps||Zi.current)ta=!0;else{if(!(p.lanes&P)&&!(m.flags&128))return ta=!1,Bpe(p,m,P);ta=!!(p.flags&131072)}else ta=!1,_r&&m.flags&1048576&&IH(m,LS,m.index);switch(m.lanes=0,m.tag){case 2:var D=m.type;JS(p,m),p=m.pendingProps;var j=Ah(m,di.current);Lh(m,P),j=uk(null,m,D,p,j,P);var W=dk();return m.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(m.tag=1,m.memoizedState=null,m.updateQueue=null,ea(D)?(W=!0,_S(m)):W=!1,m.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,rk(m),j.updater=QS,m.stateNode=j,j._reactInternals=m,yk(m,D,p,P),m=xk(null,m,D,!0,W,P)):(m.tag=0,_r&&W&&qO(m),Mi(null,m,j,P),m=m.child),m;case 16:D=m.elementType;e:{switch(JS(p,m),p=m.pendingProps,j=D._init,D=j(D._payload),m.type=D,j=m.tag=the(D),p=nl(D,p),j){case 0:m=wk(null,m,D,p,P);break e;case 1:m=b5(null,m,D,p,P);break e;case 11:m=h5(null,m,D,p,P);break e;case 14:m=m5(null,m,D,nl(D.type,p),P);break e}throw Error(n(306,D,""))}return m;case 0:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),wk(p,m,D,j,P);case 1:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),b5(p,m,D,j,P);case 3:e:{if(w5(m),p===null)throw Error(n(387));D=m.pendingProps,W=m.memoizedState,j=W.element,$H(p,m),HS(m,D,null,P);var Z=m.memoizedState;if(D=Z.element,W.isDehydrated)if(W={element:D,isDehydrated:!1,cache:Z.cache,pendingSuspenseBoundaries:Z.pendingSuspenseBoundaries,transitions:Z.transitions},m.updateQueue.baseState=W,m.memoizedState=W,m.flags&256){j=jh(Error(n(423)),m),m=x5(p,m,D,P,j);break e}else if(D!==j){j=jh(Error(n(424)),m),m=x5(p,m,D,P,j);break e}else for(Oa=Ju(m.stateNode.containerInfo.firstChild),Ta=m,_r=!0,tl=null,P=DH(m,null,D,P),m.child=P;P;)P.flags=P.flags&-3|4096,P=P.sibling;else{if(_h(),D===j){m=Wc(p,m,P);break e}Mi(p,m,D,P)}m=m.child}return m;case 5:return FH(m),p===null&&QO(m),D=m.type,j=m.pendingProps,W=p!==null?p.memoizedProps:null,Z=j.children,zO(D,j)?Z=null:W!==null&&zO(D,W)&&(m.flags|=32),v5(p,m),Mi(p,m,Z,P),m.child;case 6:return p===null&&QO(m),null;case 13:return S5(p,m,P);case 4:return ok(m,m.stateNode.containerInfo),D=m.pendingProps,p===null?m.child=$h(m,null,D,P):Mi(p,m,D,P),m.child;case 11:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),h5(p,m,D,j,P);case 7:return Mi(p,m,m.pendingProps,P),m.child;case 8:return Mi(p,m,m.pendingProps.children,P),m.child;case 12:return Mi(p,m,m.pendingProps.children,P),m.child;case 10:e:{if(D=m.type._context,j=m.pendingProps,W=m.memoizedProps,Z=j.value,xr(BS,D._currentValue),D._currentValue=Z,W!==null)if(el(W.value,Z)){if(W.children===j.children&&!Zi.current){m=Wc(p,m,P);break e}}else for(W=m.child,W!==null&&(W.return=m);W!==null;){var pe=W.dependencies;if(pe!==null){Z=W.child;for(var be=pe.firstContext;be!==null;){if(be.context===D){if(W.tag===1){be=Uc(-1,P&-P),be.tag=2;var De=W.updateQueue;if(De!==null){De=De.shared;var it=De.pending;it===null?be.next=be:(be.next=it.next,it.next=be),De.pending=be}}W.lanes|=P,be=W.alternate,be!==null&&(be.lanes|=P),tk(W.return,P,m),pe.lanes|=P;break}be=be.next}}else if(W.tag===10)Z=W.type===m.type?null:W.child;else if(W.tag===18){if(Z=W.return,Z===null)throw Error(n(341));Z.lanes|=P,pe=Z.alternate,pe!==null&&(pe.lanes|=P),tk(Z,P,m),Z=W.sibling}else Z=W.child;if(Z!==null)Z.return=W;else for(Z=W;Z!==null;){if(Z===m){Z=null;break}if(W=Z.sibling,W!==null){W.return=Z.return,Z=W;break}Z=Z.return}W=Z}Mi(p,m,j.children,P),m=m.child}return m;case 9:return j=m.type,D=m.pendingProps.children,Lh(m,P),j=cs(j),D=D(j),m.flags|=1,Mi(p,m,D,P),m.child;case 14:return D=m.type,j=nl(D,m.pendingProps),j=nl(D.type,j),m5(p,m,D,j,P);case 15:return g5(p,m,m.type,m.pendingProps,P);case 17:return D=m.type,j=m.pendingProps,j=m.elementType===D?j:nl(D,j),JS(p,m),m.tag=1,ea(D)?(p=!0,_S(m)):p=!1,Lh(m,P),s5(m,D,j),yk(m,D,j,P),xk(null,m,D,!0,p,P);case 19:return E5(p,m,P);case 22:return y5(p,m,P)}throw Error(n(156,m.tag))};function K5(p,m){return rr(p,m)}function ehe(p,m,P,D){this.tag=p,this.key=P,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=D,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fs(p,m,P,D){return new ehe(p,m,P,D)}function zk(p){return p=p.prototype,!(!p||!p.isReactComponent)}function the(p){if(typeof p=="function")return zk(p)?1:0;if(p!=null){if(p=p.$$typeof,p===$)return 11;if(p===N)return 14}return 2}function cd(p,m){var P=p.alternate;return P===null?(P=fs(p.tag,m,p.key,p.mode),P.elementType=p.elementType,P.type=p.type,P.stateNode=p.stateNode,P.alternate=p,p.alternate=P):(P.pendingProps=m,P.type=p.type,P.flags=0,P.subtreeFlags=0,P.deletions=null),P.flags=p.flags&14680064,P.childLanes=p.childLanes,P.lanes=p.lanes,P.child=p.child,P.memoizedProps=p.memoizedProps,P.memoizedState=p.memoizedState,P.updateQueue=p.updateQueue,m=p.dependencies,P.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},P.sibling=p.sibling,P.index=p.index,P.ref=p.ref,P}function cC(p,m,P,D,j,W){var Z=2;if(D=p,typeof p=="function")zk(p)&&(Z=1);else if(typeof p=="string")Z=5;else e:switch(p){case O:return Bf(P.children,j,W,m);case A:Z=8,j|=8;break;case k:return p=fs(12,P,m,j|2),p.elementType=k,p.lanes=W,p;case L:return p=fs(13,P,m,j),p.elementType=L,p.lanes=W,p;case z:return p=fs(19,P,m,j),p.elementType=z,p.lanes=W,p;case U:return uC(P,j,W,m);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case M:Z=10;break e;case R:Z=9;break e;case $:Z=11;break e;case N:Z=14;break e;case B:Z=16,D=null;break e}throw Error(n(130,p==null?p:typeof p,""))}return m=fs(Z,P,m,j),m.elementType=p,m.type=D,m.lanes=W,m}function Bf(p,m,P,D){return p=fs(7,p,D,m),p.lanes=P,p}function uC(p,m,P,D){return p=fs(22,p,D,m),p.elementType=U,p.lanes=P,p.stateNode={isHidden:!1},p}function Vk(p,m,P){return p=fs(6,p,null,m),p.lanes=P,p}function Hk(p,m,P){return m=fs(4,p.children!==null?p.children:[],p.key,m),m.lanes=P,m.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},m}function nhe(p,m,P,D,j){this.tag=m,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gO(0),this.expirationTimes=gO(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gO(0),this.identifierPrefix=D,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function Uk(p,m,P,D,j,W,Z,pe,be){return p=new nhe(p,m,P,pe,be),m===1?(m=1,W===!0&&(m|=8)):m=0,W=fs(3,null,null,m),p.current=W,W.stateNode=p,W.memoizedState={element:D,isDehydrated:P,cache:null,transitions:null,pendingSuspenseBoundaries:null},rk(W),p}function rhe(p,m,P){var D=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:D==null?null:""+D,children:p,containerInfo:m,implementation:P}}function Y5(p){if(!p)return ed;p=p._reactInternals;e:{if(os(p)!==p||p.tag!==1)throw Error(n(170));var m=p;do{switch(m.tag){case 3:m=m.stateNode.context;break e;case 1:if(ea(m.type)){m=m.stateNode.__reactInternalMemoizedMergedChildContext;break e}}m=m.return}while(m!==null);throw Error(n(171))}if(p.tag===1){var P=p.type;if(ea(P))return CH(p,P,m)}return m}function Q5(p,m,P,D,j,W,Z,pe,be){return p=Uk(P,D,!0,p,j,W,Z,pe,be),p.context=Y5(null),P=p.current,D=Ai(),j=sd(P),W=Uc(D,j),W.callback=m??null,rd(P,W,j),p.current.lanes=j,mv(p,j,D),ra(p,D),p}function dC(p,m,P,D){var j=m.current,W=Ai(),Z=sd(j);return P=Y5(P),m.context===null?m.context=P:m.pendingContext=P,m=Uc(W,Z),m.payload={element:p},D=D===void 0?null:D,D!==null&&(m.callback=D),p=rd(j,m,Z),p!==null&&(il(p,j,Z,W),VS(p,j,Z)),Z}function fC(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return p.child.stateNode;default:return p.child.stateNode}}function X5(p,m){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var P=p.retryLane;p.retryLane=P!==0&&P<m?P:m}}function Wk(p,m){X5(p,m),(p=p.alternate)&&X5(p,m)}function ohe(){return null}var J5=typeof reportError=="function"?reportError:function(p){console.error(p)};function Gk(p){this._internalRoot=p}pC.prototype.render=Gk.prototype.render=function(p){var m=this._internalRoot;if(m===null)throw Error(n(409));dC(p,m,null,null)},pC.prototype.unmount=Gk.prototype.unmount=function(){var p=this._internalRoot;if(p!==null){this._internalRoot=null;var m=p.containerInfo;Lf(function(){dC(null,p,null,null)}),m[jc]=null}};function pC(p){this._internalRoot=p}pC.prototype.unstable_scheduleHydration=function(p){if(p){var m=$V();p={blockedOn:null,target:p,priority:m};for(var P=0;P<Yu.length&&m!==0&&m<Yu[P].priority;P++);Yu.splice(P,0,p),P===0&&FV(p)}};function qk(p){return!(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)}function hC(p){return!(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11&&(p.nodeType!==8||p.nodeValue!==" react-mount-point-unstable "))}function Z5(){}function ihe(p,m,P,D,j){if(j){if(typeof D=="function"){var W=D;D=function(){var De=fC(Z);W.call(De)}}var Z=Q5(m,D,p,0,null,!1,!1,"",Z5);return p._reactRootContainer=Z,p[jc]=Z.current,kv(p.nodeType===8?p.parentNode:p),Lf(),Z}for(;j=p.lastChild;)p.removeChild(j);if(typeof D=="function"){var pe=D;D=function(){var De=fC(be);pe.call(De)}}var be=Uk(p,0,!1,null,null,!1,!1,"",Z5);return p._reactRootContainer=be,p[jc]=be.current,kv(p.nodeType===8?p.parentNode:p),Lf(function(){dC(m,be,P,D)}),be}function mC(p,m,P,D,j){var W=P._reactRootContainer;if(W){var Z=W;if(typeof j=="function"){var pe=j;j=function(){var be=fC(Z);pe.call(be)}}dC(m,Z,p,j)}else Z=ihe(P,m,p,j,D);return fC(Z)}DV=function(p){switch(p.tag){case 3:var m=p.stateNode;if(m.current.memoizedState.isDehydrated){var P=hv(m.pendingLanes);P!==0&&(yO(m,P|1),ra(m,jr()),!(Hn&6)&&(Vh=jr()+500,td()))}break;case 13:Lf(function(){var D=Hc(p,1);if(D!==null){var j=Ai();il(D,p,1,j)}}),Wk(p,1)}},vO=function(p){if(p.tag===13){var m=Hc(p,134217728);if(m!==null){var P=Ai();il(m,p,134217728,P)}Wk(p,134217728)}},_V=function(p){if(p.tag===13){var m=sd(p),P=Hc(p,m);if(P!==null){var D=Ai();il(P,p,m,D)}Wk(p,m)}},$V=function(){return ur},NV=function(p,m){var P=ur;try{return ur=p,m()}finally{ur=P}},jn=function(p,m,P){switch(m){case"input":if(ge(p,P),m=P.name,P.type==="radio"&&m!=null){for(P=p;P.parentNode;)P=P.parentNode;for(P=P.querySelectorAll("input[name="+JSON.stringify(""+m)+'][type="radio"]'),m=0;m<P.length;m++){var D=P[m];if(D!==p&&D.form===p.form){var j=RS(D);if(!j)throw Error(n(90));re(D),ge(D,j)}}}break;case"textarea":Ae(p,P);break;case"select":m=P.value,m!=null&&Le(p,!!P.multiple,m,!1)}},Qi=Fk,qt=Lf;var ahe={usingClientEntryPoint:!1,Events:[Rv,kh,RS,Yr,Yi,Fk]},Gv={findFiberByHostInstance:kf,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},she={bundleType:Gv.bundleType,version:Gv.version,rendererPackageName:Gv.rendererPackageName,rendererConfig:Gv.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(p){return p=fn(p),p===null?null:p.stateNode},findFiberByHostInstance:Gv.findFiberByHostInstance||ohe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gC=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gC.isDisabled&&gC.supportsFiber)try{ql=gC.inject(she),as=gC}catch{}}return oa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ahe,oa.createPortal=function(p,m){var P=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qk(m))throw Error(n(200));return rhe(p,m,null,P)},oa.createRoot=function(p,m){if(!qk(p))throw Error(n(299));var P=!1,D="",j=J5;return m!=null&&(m.unstable_strictMode===!0&&(P=!0),m.identifierPrefix!==void 0&&(D=m.identifierPrefix),m.onRecoverableError!==void 0&&(j=m.onRecoverableError)),m=Uk(p,1,!1,null,null,P,!1,D,j),p[jc]=m.current,kv(p.nodeType===8?p.parentNode:p),new Gk(m)},oa.findDOMNode=function(p){if(p==null)return null;if(p.nodeType===1)return p;var m=p._reactInternals;if(m===void 0)throw typeof p.render=="function"?Error(n(188)):(p=Object.keys(p).join(","),Error(n(268,p)));return p=fn(m),p=p===null?null:p.stateNode,p},oa.flushSync=function(p){return Lf(p)},oa.hydrate=function(p,m,P){if(!hC(m))throw Error(n(200));return mC(null,p,m,!0,P)},oa.hydrateRoot=function(p,m,P){if(!qk(p))throw Error(n(405));var D=P!=null&&P.hydratedSources||null,j=!1,W="",Z=J5;if(P!=null&&(P.unstable_strictMode===!0&&(j=!0),P.identifierPrefix!==void 0&&(W=P.identifierPrefix),P.onRecoverableError!==void 0&&(Z=P.onRecoverableError)),m=Q5(m,null,p,1,P??null,j,!1,W,Z),p[jc]=m.current,kv(p),D)for(p=0;p<D.length;p++)P=D[p],j=P._getVersion,j=j(P._source),m.mutableSourceEagerHydrationData==null?m.mutableSourceEagerHydrationData=[P,j]:m.mutableSourceEagerHydrationData.push(P,j);return new pC(m)},oa.render=function(p,m,P){if(!hC(m))throw Error(n(200));return mC(null,p,m,!1,P)},oa.unmountComponentAtNode=function(p){if(!hC(p))throw Error(n(40));return p._reactRootContainer?(Lf(function(){mC(null,null,p,!1,function(){p._reactRootContainer=null,p[jc]=null})}),!0):!1},oa.unstable_batchedUpdates=Fk,oa.unstable_renderSubtreeIntoContainer=function(p,m,P,D){if(!hC(P))throw Error(n(200));if(p==null||p._reactInternals===void 0)throw Error(n(38));return mC(p,m,P,!1,D)},oa.version="18.3.1-next-f1338f8080-20240426",oa}var i4;function LZ(){if(i4)return cM.exports;i4=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cM.exports=sbe(),cM.exports}var u0=LZ();const Lb=Fn(u0),a4={disabled:!1},rE=X.createContext(null);var FZ=function(t){return t.scrollTop},Fb="unmounted",Jf="exited",Zf="entering",gm="entered",o2="exiting",Qa=function(e){c0(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,s=a&&!a.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?s?(l=Jf,i.appearStatus=Zf):l=gm:r.unmountOnExit||r.mountOnEnter?l=Fb:l=Jf,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Fb?{status:Jf}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==Zf&&a!==gm&&(i=Zf):(a===Zf||a===gm)&&(i=o2)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,s;return i=a=s=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,s=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:s}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Zf){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Lb.findDOMNode(this);a&&FZ(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Jf&&this.setState({status:Fb})},n.performEnter=function(o){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:o,l=this.props.nodeRef?[s]:[Lb.findDOMNode(this),s],c=l[0],u=l[1],d=this.getTimeouts(),f=s?d.appear:d.enter;if(!o&&!a||a4.disabled){this.safeSetState({status:gm},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Zf},function(){i.props.onEntering(c,u),i.onTransitionEnd(f,function(){i.safeSetState({status:gm},function(){i.props.onEntered(c,u)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Lb.findDOMNode(this);if(!i||a4.disabled){this.safeSetState({status:Jf},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:o2},function(){o.props.onExiting(s),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:Jf},function(){o.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,o(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Lb.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Fb)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=We(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return X.createElement(rE.Provider,{value:null},typeof a=="function"?a(o,s):X.cloneElement(X.Children.only(a),s))},t}(X.Component);Qa.contextType=rE;Qa.propTypes={};function Yh(){}Qa.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yh,onEntering:Yh,onEntered:Yh,onExit:Yh,onExiting:Yh,onExited:Yh};Qa.UNMOUNTED=Fb;Qa.EXITED=Jf;Qa.ENTERING=Zf;Qa.ENTERED=gm;Qa.EXITING=o2;var lbe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return rbe(t,r)})},fM=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return obe(t,r)})},RF=function(e){c0(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=e.call.apply(e,[this].concat(i))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(s,l){var c=r.resolveArguments(s,l),u=c[0],d=c[1];r.removeClasses(u,"exit"),r.addClass(u,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(s,l)},r.onEntering=function(s,l){var c=r.resolveArguments(s,l),u=c[0],d=c[1],f=d?"appear":"enter";r.addClass(u,f,"active"),r.props.onEntering&&r.props.onEntering(s,l)},r.onEntered=function(s,l){var c=r.resolveArguments(s,l),u=c[0],d=c[1],f=d?"appear":"enter";r.removeClasses(u,f),r.addClass(u,f,"done"),r.props.onEntered&&r.props.onEntered(s,l)},r.onExit=function(s){var l=r.resolveArguments(s),c=l[0];r.removeClasses(c,"appear"),r.removeClasses(c,"enter"),r.addClass(c,"exit","base"),r.props.onExit&&r.props.onExit(s)},r.onExiting=function(s){var l=r.resolveArguments(s),c=l[0];r.addClass(c,"exit","active"),r.props.onExiting&&r.props.onExiting(s)},r.onExited=function(s){var l=r.resolveArguments(s),c=l[0];r.removeClasses(c,"exit"),r.addClass(c,"exit","done"),r.props.onExited&&r.props.onExited(s)},r.resolveArguments=function(s,l){return r.props.nodeRef?[r.props.nodeRef.current,s]:[s,l]},r.getClassNames=function(s){var l=r.props.classNames,c=typeof l=="string",u=c&&l?l+"-":"",d=c?""+u+s:l[s],f=c?d+"-active":l[s+"Active"],h=c?d+"-done":l[s+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:h}},r}var n=t.prototype;return n.addClass=function(o,i,a){var s=this.getClassNames(i)[a+"ClassName"],l=this.getClassNames("enter"),c=l.doneClassName;i==="appear"&&a==="done"&&c&&(s+=" "+c),a==="active"&&o&&FZ(o),s&&(this.appliedClasses[i][a]=s,lbe(o,s))},n.removeClasses=function(o,i){var a=this.appliedClasses[i],s=a.base,l=a.active,c=a.done;this.appliedClasses[i]={},s&&fM(o,s),l&&fM(o,l),c&&fM(o,c)},n.render=function(){var o=this.props;o.classNames;var i=We(o,["classNames"]);return X.createElement(Qa,F({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(X.Component);RF.defaultProps={classNames:""};RF.propTypes={};function i2(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DF(e,t){var n=function(i){return t&&w.isValidElement(i)?t(i):i},r=Object.create(null);return e&&w.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function cbe(e,t){e=e||{},t=t||{};function n(u){return u in t?t[u]:e[u]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var l in t){if(r[l])for(a=0;a<r[l].length;a++){var c=r[l][a];s[r[l][a]]=n(c)}s[l]=n(l)}for(a=0;a<o.length;a++)s[o[a]]=n(o[a]);return s}function cp(e,t,n){return n[t]!=null?n[t]:e.props[t]}function ube(e,t){return DF(e.children,function(n){return w.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:cp(n,"appear",e),enter:cp(n,"enter",e),exit:cp(n,"exit",e)})})}function dbe(e,t,n){var r=DF(e.children),o=cbe(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if(w.isValidElement(a)){var s=i in t,l=i in r,c=t[i],u=w.isValidElement(c)&&!c.props.in;l&&(!s||u)?o[i]=w.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:cp(a,"exit",e),enter:cp(a,"enter",e)}):!l&&s&&!u?o[i]=w.cloneElement(a,{in:!1}):l&&s&&w.isValidElement(c)&&(o[i]=w.cloneElement(a,{onExited:n.bind(null,a),in:c.props.in,exit:cp(a,"exit",e),enter:cp(a,"enter",e)}))}}),o}var fbe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},pbe={component:"div",childFactory:function(t){return t}},d0=function(e){c0(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=i.handleExited.bind(i2(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var a=i.children,s=i.handleExited,l=i.firstRender;return{children:l?ube(o,s):dbe(o,a,s),firstRender:!1}},n.handleExited=function(o,i){var a=DF(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(s){var l=F({},s.children);return delete l[o.key],{children:l}}))},n.render=function(){var o=this.props,i=o.component,a=o.childFactory,s=We(o,["component","childFactory"]),l=this.state.contextValue,c=fbe(this.state.children).map(a);return delete s.appear,delete s.enter,delete s.exit,i===null?X.createElement(rE.Provider,{value:l},c):X.createElement(rE.Provider,{value:l},X.createElement(i,s,c))},t}(X.Component);d0.propTypes={};d0.defaultProps=pbe;const _F=e=>e.scrollTop;function Jd(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}function hbe(e){return je("MuiCollapse",e)}Be("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const mbe=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Oe(r,hbe,n)},gbe=se("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(rt(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),ybe=se("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),vbe=se("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Ls=w.forwardRef(function(t,n){const r=lt({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:a,collapsedSize:s="0px",component:l,easing:c,in:u,onEnter:d,onEntered:f,onEntering:h,onExit:g,onExited:y,onExiting:v,orientation:x="vertical",style:S,timeout:C=bZ.standard,TransitionComponent:I=Qa,...E}=r,T={...r,orientation:x,collapsedSize:s},O=mbe(T),A=Lr(),k=fa(),M=w.useRef(null),R=w.useRef(),$=typeof s=="number"?`${s}px`:s,L=x==="horizontal",z=L?"width":"height",N=w.useRef(null),B=cn(n,N),U=te=>ce=>{if(te){const ae=N.current;ce===void 0?te(ae):te(ae,ce)}},G=()=>M.current?M.current[L?"clientWidth":"clientHeight"]:0,H=U((te,ce)=>{M.current&&L&&(M.current.style.position="absolute"),te.style[z]=$,d&&d(te,ce)}),K=U((te,ce)=>{const ae=G();M.current&&L&&(M.current.style.position="");const{duration:ne,easing:ue}=Jd({style:S,timeout:C,easing:c},{mode:"enter"});if(C==="auto"){const he=A.transitions.getAutoHeightDuration(ae);te.style.transitionDuration=`${he}ms`,R.current=he}else te.style.transitionDuration=typeof ne=="string"?ne:`${ne}ms`;te.style[z]=`${ae}px`,te.style.transitionTimingFunction=ue,h&&h(te,ce)}),q=U((te,ce)=>{te.style[z]="auto",f&&f(te,ce)}),Y=U(te=>{te.style[z]=`${G()}px`,g&&g(te)}),J=U(y),ie=U(te=>{const ce=G(),{duration:ae,easing:ne}=Jd({style:S,timeout:C,easing:c},{mode:"exit"});if(C==="auto"){const ue=A.transitions.getAutoHeightDuration(ce);te.style.transitionDuration=`${ue}ms`,R.current=ue}else te.style.transitionDuration=typeof ae=="string"?ae:`${ae}ms`;te.style[z]=$,te.style.transitionTimingFunction=ne,v&&v(te)}),ee=te=>{C==="auto"&&k.start(R.current||0,te),o&&o(N.current,te)};return _.jsx(I,{in:u,onEnter:H,onEntered:q,onEntering:K,onExit:Y,onExited:J,onExiting:ie,addEndListener:ee,nodeRef:N,timeout:C==="auto"?null:C,...E,children:(te,{ownerState:ce,...ae})=>_.jsx(gbe,{as:l,className:fe(O.root,a,{entered:O.entered,exited:!u&&$==="0px"&&O.hidden}[te]),style:{[L?"minWidth":"minHeight"]:$,...S},ref:B,ownerState:{...T,state:te},...ae,children:_.jsx(ybe,{ownerState:{...T,state:te},className:O.wrapper,ref:M,children:_.jsx(vbe,{ownerState:{...T,state:te},className:O.wrapperInner,children:i})})})})});Ls&&(Ls.muiSupportAuto=!0);function bbe(e){return je("MuiPaper",e)}Be("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const wbe=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Oe(i,bbe,o)},xbe=se("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(rt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Kr=w.forwardRef(function(t,n){var h;const r=lt({props:t,name:"MuiPaper"}),o=Lr(),{className:i,component:a="div",elevation:s=1,square:l=!1,variant:c="elevation",...u}=r,d={...r,component:a,elevation:s,square:l,variant:c},f=wbe(d);return _.jsx(xbe,{as:a,ownerState:d,className:fe(f.root,i),ref:n,...u,style:{...c==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[s],...o.vars&&{"--Paper-overlay":(h=o.vars.overlays)==null?void 0:h[s]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Pt("#fff",V$(s))}, ${Pt("#fff",V$(s))})`}},...u.style}})}),jZ=w.createContext({});function St(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:a,shouldForwardComponentProp:s=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=i,h=u[e]||r,g=Cu(d[e],o),{props:{component:y,...v},internalRef:x}=cZ({className:n,...l,externalForwardedProps:e==="root"?f:void 0,externalSlotProps:g}),S=cn(x,g==null?void 0:g.ref,t.ref),C=e==="root"?y||c:y,I=lZ(h,{...e==="root"&&!c&&!u[e]&&a,...e!=="root"&&!u[e]&&a,...v,...C&&!s&&{as:C},...C&&s&&{component:C},ref:S},o);return[h,I]}function Sbe(e){return je("MuiAccordion",e)}const EC=Be("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Cbe=e=>{const{classes:t,square:n,expanded:r,disabled:o,disableGutters:i}=e;return Oe({root:["root",!n&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],heading:["heading"],region:["region"]},Sbe,t)},Ebe=se(Kr,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${EC.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(rt(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${EC.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${EC.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),rt(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${EC.expanded}`]:{margin:"16px 0"}}}]}))),Pbe=se("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(e,t)=>t.heading})({all:"unset"}),$F=w.forwardRef(function(t,n){const r=lt({props:t,name:"MuiAccordion"}),{children:o,className:i,defaultExpanded:a=!1,disabled:s=!1,disableGutters:l=!1,expanded:c,onChange:u,square:d=!1,slots:f={},slotProps:h={},TransitionComponent:g,TransitionProps:y,...v}=r,[x,S]=Ei({controlled:c,default:a,name:"Accordion",state:"expanded"}),C=w.useCallback(B=>{S(!x),u&&u(B,!x)},[x,u,S]),[I,...E]=w.Children.toArray(o),T=w.useMemo(()=>({expanded:x,disabled:s,disableGutters:l,toggle:C}),[x,s,l,C]),O={...r,square:d,disabled:s,disableGutters:l,expanded:x},A=Cbe(O),k={transition:g,...f},M={transition:y,...h},R={slots:k,slotProps:M},[$,L]=St("heading",{elementType:Pbe,externalForwardedProps:R,className:A.heading,ownerState:O}),[z,N]=St("transition",{elementType:Ls,externalForwardedProps:R,ownerState:O});return _.jsxs(Ebe,{className:fe(A.root,i),ref:n,ownerState:O,square:d,...v,children:[_.jsx($,{...L,children:_.jsx(jZ.Provider,{value:T,children:I})}),_.jsx(z,{in:x,timeout:"auto",...N,children:_.jsx("div",{"aria-labelledby":I.props.id,id:I.props["aria-controls"],role:"region",className:A.region,children:E})})]})});function Ibe(e){return je("MuiAccordionDetails",e)}Be("MuiAccordionDetails",["root"]);const Tbe=e=>{const{classes:t}=e;return Oe({root:["root"]},Ibe,t)},Obe=se("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(rt(({theme:e})=>({padding:e.spacing(1,2,2)}))),NF=w.forwardRef(function(t,n){const r=lt({props:t,name:"MuiAccordionDetails"}),{className:o,...i}=r,a=r,s=Tbe(a);return _.jsx(Obe,{className:fe(s.root,o),ref:n,ownerState:a,...i})});class oE{constructor(){Ie(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new oE}static use(){const t=Ks(oE.create).current,[n,r]=w.useState(!1);return t.shouldMount=n,t.setShouldMount=r,w.useEffect(t.mountEffect,[n]),t}mount(){return this.mounted||(this.mounted=Mbe(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...t)})}stop(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...t)})}pulsate(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...t)})}}function kbe(){return oE.use()}function Mbe(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function Abe(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:a,in:s,onExited:l,timeout:c}=e,[u,d]=w.useState(!1),f=fe(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},g=fe(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),w.useEffect(()=>{if(!s&&l!=null){const y=setTimeout(l,c);return()=>{clearTimeout(y)}}},[l,s,c]),_.jsx("span",{className:f,style:h,children:_.jsx("span",{className:g})})}const Is=Be("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),a2=550,Rbe=80,Dbe=Oc`0% {transform: scale(0);opacity: 0.1;@@ -362,8 +362,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho`));return x},[l,d,c,u,o]),y=w.useMemo(()=>g?{minDate:g.date("1900-01-01T00:00:00.000"),maxDate:g.date("2099-12-31T00:00:00.000")}:null,[g]),v=w.useMemo(()=>({utils:g,defaultDates:y,localeText:h}),[y,g,h]);return _.jsx(pL.Provider,{value:v,children:s})},I8e=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:F({},e)}}}}),Hy=e=>{const{utils:t,formatKey:n,contextTranslation:r,propsTranslation:o}=e;return i=>{const a=i!==null&&t.isValid(i)?t.format(i,n):null;return(o??r)(i,t,a)}},uae={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"Open previous view",openNextView:"Open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",startDate:"Start date",startTime:"Start time",endDate:"End date",endTime:"End time",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n,r)=>`Select ${e}. ${!r&&(t===null||!n.isValid(t))?"No time selected":`Selected time is ${r??n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose date, selected date is ${n??t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t,n)=>n||e!==null&&t.isValid(e)?`Choose time, selected time is ${n??t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa",year:"Year",month:"Month",day:"Day",weekDay:"Week day",hours:"Hours",minutes:"Minutes",seconds:"Seconds",meridiem:"Meridiem",empty:"Empty"},T8e=uae;I8e(uae);const dh=()=>{const e=w.useContext(pL);if(e===null)throw new Error(["MUI X: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(``));if(e.utils===null)throw new Error(["MUI X: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(``));const t=w.useMemo(()=>F({},T8e,e.localeText),[e.localeText]);return w.useMemo(()=>F({},e,{localeText:t}),[e,t])},In=()=>dh().utils,fh=()=>dh().defaultDates,ph=e=>{const t=In(),n=w.useRef(void 0);return n.current===void 0&&(n.current=t.date(void 0,e)),n.current},Co=()=>dh().localeText,O8e=Je(_.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),k8e=Je(_.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),M8e=Je(_.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),dae=Je(_.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar"),A8e=Je(_.jsxs(w.Fragment,{children:[_.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),_.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock"),R8e=Je(_.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange"),D8e=Je(_.jsxs(w.Fragment,{children:[_.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),_.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time"),_8e=Je(_.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function $8e(e){return je("MuiPickersArrowSwitcher",e)}Be("MuiPickersArrowSwitcher",["root","spacer","button","previousIconButton","nextIconButton","leftArrowIcon","rightArrowIcon"]);const N8e=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel","labelId"],L8e=["ownerState"],F8e=["ownerState"],j8e=se("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),B8e=se("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),yK=se(on,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})({variants:[{props:{hidden:!0},style:{visibility:"hidden"}}]}),z8e=e=>{const{classes:t}=e;return Oe({root:["root"],spacer:["spacer"],button:["button"],previousIconButton:["previousIconButton"],nextIconButton:["nextIconButton"],leftArrowIcon:["leftArrowIcon"],rightArrowIcon:["rightArrowIcon"]},$8e,t)},fae=w.forwardRef(function(t,n){const r=Yn(),o=hn({props:t,name:"MuiPickersArrowSwitcher"}),{children:i,className:a,slots:s,slotProps:l,isNextDisabled:c,isNextHidden:u,onGoToNext:d,nextLabel:f,isPreviousDisabled:h,isPreviousHidden:g,onGoToPrevious:y,previousLabel:v,labelId:x}=o,S=We(o,N8e),C=o,I=z8e(C),E={isDisabled:c,isHidden:u,goTo:d,label:f},T={isDisabled:h,isHidden:g,goTo:y,label:v},O=(s==null?void 0:s.previousIconButton)??yK,A=Pn({elementType:O,externalSlotProps:l==null?void 0:l.previousIconButton,additionalProps:{size:"medium",title:T.label,"aria-label":T.label,disabled:T.isDisabled,edge:"end",onClick:T.goTo},ownerState:F({},C,{hidden:T.isHidden}),className:fe(I.button,I.previousIconButton)}),k=(s==null?void 0:s.nextIconButton)??yK,M=Pn({elementType:k,externalSlotProps:l==null?void 0:l.nextIconButton,additionalProps:{size:"medium",title:E.label,"aria-label":E.label,disabled:E.isDisabled,edge:"start",onClick:E.goTo},ownerState:F({},C,{hidden:E.isHidden}),className:fe(I.button,I.nextIconButton)}),R=(s==null?void 0:s.leftArrowIcon)??k8e,$=Pn({elementType:R,externalSlotProps:l==null?void 0:l.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:C,className:I.leftArrowIcon}),L=We($,L8e),z=(s==null?void 0:s.rightArrowIcon)??M8e,N=Pn({elementType:z,externalSlotProps:l==null?void 0:l.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:C,className:I.rightArrowIcon}),B=We(N,F8e);return _.jsxs(j8e,F({ref:n,className:fe(I.root,a),ownerState:C},S,{children:[_.jsx(O,F({},A,{children:r?_.jsx(z,F({},B)):_.jsx(R,F({},L))})),i?_.jsx(tt,{variant:"subtitle1",component:"span",id:x,children:i}):_.jsx(B8e,{className:I.spacer,ownerState:C}),_.jsx(k,F({},M,{children:r?_.jsx(R,F({},L)):_.jsx(z,F({},B))}))]}))}),lc=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),RB=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(e!=null)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}},pae=["hours","minutes","seconds"],Qg=e=>pae.includes(e),Gb=e=>pae.includes(e)||e==="meridiem",V8e=(e,t)=>e?t.getHours(e)>=12?"pm":"am":null,Px=(e,t,n)=>n&&(e>=12?"pm":"am")!==t?t==="am"?e-12:e+12:e,H8e=(e,t,n,r)=>{const o=Px(r.getHours(e),t,n);return r.setHours(e,o)},vK=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),F0=(e,t)=>(n,r)=>e?t.isAfter(n,r):vK(n,t)>vK(r,t),SP=(e,{format:t,views:n,ampm:r})=>{if(t!=null)return t;const o=e.formats;return lc(n,["hours"])?r?`${o.hours12h} ${o.meridiem}`:o.hours24h:lc(n,["minutes"])?o.minutes:lc(n,["seconds"])?o.seconds:lc(n,["minutes","seconds"])?`${o.minutes}:${o.seconds}`:lc(n,["hours","minutes","seconds"])?r?`${o.hours12h}:${o.minutes}:${o.seconds} ${o.meridiem}`:`${o.hours24h}:${o.minutes}:${o.seconds}`:r?`${o.hours12h}:${o.minutes} ${o.meridiem}`:`${o.hours24h}:${o.minutes}`};function j0({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:i,focusedView:a,onFocusedViewChange:s}){const l=w.useRef(n),c=w.useRef(o),u=w.useRef(o.includes(n)?n:o[0]),[d,f]=Ei({name:"useViews",state:"view",controlled:r,default:u.current}),h=w.useRef(i?d:null),[g,y]=Ei({name:"useViews",state:"focusedView",controlled:a,default:h.current});w.useEffect(()=>{(l.current&&l.current!==n||c.current&&c.current.some(O=>!o.includes(O)))&&(f(o.includes(n)?n:o[0]),c.current=o,l.current=n)},[n,f,d,o]);const v=o.indexOf(d),x=o[v-1]??null,S=o[v+1]??null,C=Qe((O,A)=>{y(A?O:k=>O===k?null:k),s==null||s(O,A)}),I=Qe(O=>{C(O,!0),O!==d&&(f(O),t&&t(O))}),E=Qe(()=>{S&&I(S)}),T=Qe((O,A,k)=>{const M=A==="finish",R=k?o.indexOf(k)<o.length-1:!!S;if(e(O,M&&R?"partial":A,k),k&&k!==d){const L=o[o.indexOf(k)+1];L&&I(L)}else M&&E()});return{view:d,setView:I,focusedView:g,setFocusedView:C,nextView:S,previousView:x,defaultView:o.includes(n)?n:o[0],goToNextView:E,setValueAndGoToNextView:T}}function U8e(e,{disableFuture:t,maxDate:n,timezone:r}){const o=In();return w.useMemo(()=>{const i=o.date(void 0,r),a=o.startOfMonth(t&&o.isBefore(i,n)?i:n);return!o.isAfter(a,e)},[t,n,e,o,r])}function W8e(e,{disablePast:t,minDate:n,timezone:r}){const o=In();return w.useMemo(()=>{const i=o.date(void 0,r),a=o.startOfMonth(t&&o.isAfter(i,n)?i:n);return!o.isBefore(a,e)},[t,n,e,o,r])}function AT(e,t,n,r){const o=In(),i=V8e(e,o),a=w.useCallback(s=>{const l=e==null?null:H8e(e,s,!!t,o);n(l,r??"partial")},[t,e,n,r,o]);return{meridiemMode:i,handleMeridiemChange:a}}const Ix=36,RT=2,DT=320,G8e=280,_T=336,hae=232,qb=48,$T=se("div")({overflow:"hidden",width:DT,maxHeight:_T,display:"flex",flexDirection:"column",margin:"0 auto"});function q8e(e){return je("MuiTimeClock",e)}Be("MuiTimeClock",["root","arrowSwitcher"]);const Xg=220,fu=36,Tx={x:Xg/2,y:Xg/2},mae={x:Tx.x,y:0},K8e=mae.x-Tx.x,Y8e=mae.y-Tx.y,Q8e=e=>e*(180/Math.PI),gae=(e,t,n)=>{const r=t-Tx.x,o=n-Tx.y,i=Math.atan2(K8e,Y8e)-Math.atan2(r,o);let a=Q8e(i);a=Math.round(a/e)*e,a%=360;const s=Math.floor(a/e)||0,l=r**2+o**2,c=Math.sqrt(l);return{value:s,distance:c}},X8e=(e,t,n=1)=>{const r=n*6;let{value:o}=gae(r,e,t);return o=o*n%60,o},J8e=(e,t,n)=>{const{value:r,distance:o}=gae(30,e,t);let i=r||12;return n?i%=12:o<Xg/2-fu&&(i+=12,i%=24),i};function Z8e(e){return je("MuiClockPointer",e)}Be("MuiClockPointer",["root","thumb"]);const e9e=["className","hasSelected","isInner","type","viewValue"],t9e=e=>{const{classes:t}=e;return Oe({root:["root"],thumb:["thumb"]},Z8e,t)},n9e=se("div",{name:"MuiClockPointer",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({width:2,backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px",variants:[{props:{shouldAnimate:!0},style:{transition:e.transitions.create(["transform","height"])}}]})),r9e=se("div",{name:"MuiClockPointer",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(({theme:e})=>({width:4,height:4,backgroundColor:(e.vars||e).palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${fu/2}px)`,border:`${(fu-4)/2}px solid ${(e.vars||e).palette.primary.main}`,boxSizing:"content-box",variants:[{props:{hasSelected:!0},style:{backgroundColor:(e.vars||e).palette.primary.main}}]}));function o9e(e){const t=hn({props:e,name:"MuiClockPointer"}),{className:n,isInner:r,type:o,viewValue:i}=t,a=We(t,e9e),s=w.useRef(o);w.useEffect(()=>{s.current=o},[o]);const l=F({},t,{shouldAnimate:s.current!==o}),c=t9e(l),u=()=>{let f=360/(o==="hours"?12:60)*i;return o==="hours"&&i>12&&(f-=360),{height:Math.round((r?.26:.4)*Xg),transform:`rotateZ(${f}deg)`}};return _.jsx(n9e,F({style:u(),className:fe(c.root,n),ownerState:l},a,{children:_.jsx(r9e,{ownerState:l,className:c.thumb})}))}function i9e(e){return je("MuiClock",e)}Be("MuiClock",["root","clock","wrapper","squareMask","pin","amButton","pmButton","meridiemText","selected"]);const CP=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},vw=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:a,timezone:s})=>{const l=CP(a,a.date(void 0,s),e);n&&a.isBefore(o,l)&&(o=l),t&&a.isAfter(r,l)&&(r=l);let c=e,u=e;for(a.isBefore(e,o)&&(c=o,u=null),a.isAfter(e,r)&&(u&&(u=r),c=null);c||u;){if(c&&a.isAfter(c,r)&&(c=null),u&&a.isBefore(u,o)&&(u=null),c){if(!i(c))return c;c=a.addDays(c,1)}if(u){if(!i(u))return u;u=a.addDays(u,-1)}}return null},a9e=(e,t)=>t==null||!e.isValid(t)?null:t,Oi=(e,t,n)=>t==null||!e.isValid(t)?n:t,s9e=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),DB=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},_B=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),Il=(e,t)=>{const n=e.setHours(e.date(),t==="am"?2:14);return e.format(n,"meridiem")},l9e=["year","month","day"],Jg=e=>l9e.includes(e),Ox=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return lc(n,["year"])?o.year:lc(n,["month"])?o.month:lc(n,["day"])?o.dayOfMonth:lc(n,["month","year"])?`${o.month} ${o.year}`:lc(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},c9e=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},u9e=e=>{const{classes:t,meridiemMode:n}=e;return Oe({root:["root"],clock:["clock"],wrapper:["wrapper"],squareMask:["squareMask"],pin:["pin"],amButton:["amButton",n==="am"&&"selected"],pmButton:["pmButton",n==="pm"&&"selected"],meridiemText:["meridiemText"]},i9e,t)},d9e=se("div",{name:"MuiClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:e.spacing(2)})),f9e=se("div",{name:"MuiClock",slot:"Clock",overridesResolver:(e,t)=>t.clock})({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),p9e=se("div",{name:"MuiClock",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({"&:focus":{outline:"none"}}),h9e=se("div",{name:"MuiClock",slot:"SquareMask",overridesResolver:(e,t)=>t.squareMask})({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none",variants:[{props:{disabled:!1},style:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}}}]}),m9e=se("div",{name:"MuiClock",slot:"Pin",overridesResolver:(e,t)=>t.pin})(({theme:e})=>({width:6,height:6,borderRadius:"50%",backgroundColor:(e.vars||e).palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),yae=(e,t)=>({zIndex:1,bottom:8,paddingLeft:4,paddingRight:4,width:fu,variants:[{props:{meridiemMode:t},style:{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:hover":{backgroundColor:(e.vars||e).palette.primary.light}}}]}),g9e=se(on,{name:"MuiClock",slot:"AmButton",overridesResolver:(e,t)=>t.amButton})(({theme:e})=>F({},yae(e,"am"),{position:"absolute",left:8})),y9e=se(on,{name:"MuiClock",slot:"PmButton",overridesResolver:(e,t)=>t.pmButton})(({theme:e})=>F({},yae(e,"pm"),{position:"absolute",right:8})),bK=se(tt,{name:"MuiClock",slot:"meridiemText",overridesResolver:(e,t)=>t.meridiemText})({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});function v9e(e){const t=hn({props:e,name:"MuiClock"}),{ampm:n,ampmInClock:r,autoFocus:o,children:i,value:a,handleMeridiemChange:s,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:d,selectedId:f,type:h,viewValue:g,viewRange:[y,v],disabled:x=!1,readOnly:S,className:C}=t,I=t,E=In(),T=Co(),O=w.useRef(!1),A=u9e(I),k=l(g,h),M=!n&&h==="hours"&&(g<1||g>12),R=(J,ie)=>{x||S||l(J,h)||d(J,ie)},$=(J,ie)=>{let{offsetX:ee,offsetY:te}=J;if(ee===void 0){const ae=J.target.getBoundingClientRect();ee=J.changedTouches[0].clientX-ae.left,te=J.changedTouches[0].clientY-ae.top}const ce=h==="seconds"||h==="minutes"?X8e(ee,te,u):J8e(ee,te,!!n);R(ce,ie)},L=J=>{O.current=!0,$(J,"shallow")},z=J=>{O.current&&($(J,"finish"),O.current=!1),J.preventDefault()},N=J=>{J.buttons>0&&$(J.nativeEvent,"shallow")},B=J=>{O.current&&(O.current=!1),$(J.nativeEvent,"finish")},U=w.useMemo(()=>h==="hours"?!0:g%5===0,[h,g]),G=h==="minutes"?u:1,H=w.useRef(null);On(()=>{o&&H.current.focus()},[o]);const K=J=>Math.max(y,Math.min(v,J)),q=J=>(J+(v+1))%(v+1),Y=J=>{if(!O.current)switch(J.key){case"Home":R(y,"partial"),J.preventDefault();break;case"End":R(v,"partial"),J.preventDefault();break;case"ArrowUp":R(q(g+G),"partial"),J.preventDefault();break;case"ArrowDown":R(q(g-G),"partial"),J.preventDefault();break;case"PageUp":R(K(g+5),"partial"),J.preventDefault();break;case"PageDown":R(K(g-5),"partial"),J.preventDefault();break;case"Enter":case" ":R(g,"finish"),J.preventDefault();break}};return _.jsxs(d9e,{className:fe(A.root,C),children:[_.jsxs(f9e,{className:A.clock,children:[_.jsx(h9e,{onTouchMove:L,onTouchStart:L,onTouchEnd:z,onMouseUp:B,onMouseMove:N,ownerState:{disabled:x},className:A.squareMask}),!k&&_.jsxs(w.Fragment,{children:[_.jsx(m9e,{className:A.pin}),a!=null&&_.jsx(o9e,{type:h,viewValue:g,isInner:M,hasSelected:U})]}),_.jsx(p9e,{"aria-activedescendant":f,"aria-label":T.clockLabelText(h,a,E,a==null?null:E.format(a,"fullTime")),ref:H,role:"listbox",onKeyDown:Y,tabIndex:0,className:A.wrapper,children:i})]}),n&&r&&_.jsxs(w.Fragment,{children:[_.jsx(g9e,{onClick:S?void 0:()=>s("am"),disabled:x||c===null,ownerState:I,className:A.amButton,title:Il(E,"am"),children:_.jsx(bK,{variant:"caption",className:A.meridiemText,children:Il(E,"am")})}),_.jsx(y9e,{disabled:x||c===null,onClick:S?void 0:()=>s("pm"),ownerState:I,className:A.pmButton,title:Il(E,"pm"),children:_.jsx(bK,{variant:"caption",className:A.meridiemText,children:Il(E,"pm")})})]})]})}function b9e(e){return je("MuiClockNumber",e)}const JC=Be("MuiClockNumber",["root","selected","disabled"]),w9e=["className","disabled","index","inner","label","selected"],x9e=e=>{const{classes:t,selected:n,disabled:r}=e;return Oe({root:["root",n&&"selected",r&&"disabled"]},b9e,t)},S9e=se("span",{name:"MuiClockNumber",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${JC.disabled}`]:t.disabled},{[`&.${JC.selected}`]:t.selected}]})(({theme:e})=>({height:fu,width:fu,position:"absolute",left:`calc((100% - ${fu}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:(e.vars||e).palette.text.primary,fontFamily:e.typography.fontFamily,"&:focused":{backgroundColor:(e.vars||e).palette.background.paper},[`&.${JC.selected}`]:{color:(e.vars||e).palette.primary.contrastText},[`&.${JC.disabled}`]:{pointerEvents:"none",color:(e.vars||e).palette.text.disabled},variants:[{props:{inner:!0},style:F({},e.typography.body2,{color:(e.vars||e).palette.text.secondary})}]}));function vae(e){const t=hn({props:e,name:"MuiClockNumber"}),{className:n,disabled:r,index:o,inner:i,label:a,selected:s}=t,l=We(t,w9e),c=t,u=x9e(c),d=o%12/12*Math.PI*2-Math.PI/2,f=(Xg-fu-2)/2*(i?.65:1),h=Math.round(Math.cos(d)*f),g=Math.round(Math.sin(d)*f);return _.jsx(S9e,F({className:fe(u.root,n),"aria-disabled":r?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${h}px, ${g+(Xg-fu)/2}px`},ownerState:c},l,{children:a}))}const C9e=({ampm:e,value:t,getClockNumberText:n,isDisabled:r,selectedId:o,utils:i})=>{const a=t?i.getHours(t):null,s=[],l=e?1:0,c=e?12:23,u=d=>a===null?!1:e?d===12?a===12||a===0:a===d||a-12===d:a===d;for(let d=l;d<=c;d+=1){let f=d.toString();d===0&&(f="00");const h=!e&&(d===0||d>12);f=i.formatNumber(f);const g=u(d);s.push(_.jsx(vae,{id:g?o:void 0,index:d,inner:h,selected:g,disabled:r(d),label:f,"aria-label":n(f)},d))}return s},wK=({utils:e,value:t,isDisabled:n,getClockNumberText:r,selectedId:o})=>{const i=e.formatNumber;return[[5,i("05")],[10,i("10")],[15,i("15")],[20,i("20")],[25,i("25")],[30,i("30")],[35,i("35")],[40,i("40")],[45,i("45")],[50,i("50")],[55,i("55")],[0,i("00")]].map(([a,s],l)=>{const c=a===t;return _.jsx(vae,{label:s,id:c?o:void 0,index:l+1,inner:!1,disabled:n(a),selected:c,"aria-label":r(s)},a)})},$B=({timezone:e,value:t,defaultValue:n,referenceDate:r,onChange:o,valueManager:i})=>{const a=In(),s=w.useRef(n),l=t??s.current??i.emptyValue,c=w.useMemo(()=>i.getTimezone(a,l),[a,i,l]),u=Qe(g=>c==null?g:i.setTimezone(a,c,g));let d;e?d=e:c?d=c:r?d=a.getTimezone(r):d="default";const f=w.useMemo(()=>i.setTimezone(a,d,l),[i,a,d,l]),h=Qe((g,...y)=>{const v=u(g);o==null||o(v,...y)});return{value:f,handleValueChange:h,timezone:d}},Uy=({name:e,timezone:t,value:n,defaultValue:r,referenceDate:o,onChange:i,valueManager:a})=>{const[s,l]=Ei({name:e,state:"value",controlled:n,default:r??a.emptyValue}),c=Qe((u,...d)=>{l(u),i==null||i(u,...d)});return $B({timezone:t,value:s,defaultValue:void 0,referenceDate:o,onChange:c,valueManager:a})},xl={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},E9e=e=>Math.max(...e.map(t=>xl[t.type]??1)),mb=(e,t,n)=>{if(t===xl.year)return e.startOfYear(n);if(t===xl.month)return e.startOfMonth(n);if(t===xl.day)return e.startOfDay(n);let r=n;return t<xl.minutes&&(r=e.setMinutes(r,0)),t<xl.seconds&&(r=e.setSeconds(r,0)),t<xl.milliseconds&&(r=e.setMilliseconds(r,0)),r},P9e=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():mb(t,n,_B(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=mb(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=mb(t,n,e.maxDate));const a=F0(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&a(e.minTime,i)&&(i=mb(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:CP(t,i,e.minTime))),e.maxTime!=null&&a(i,e.maxTime)&&(i=mb(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:CP(t,i,e.maxTime))),i},bae=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`-`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},I9e=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},NT=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),i=e.endOfWeek(r);let a=o;for(;e.isBefore(a,i);)n.push(a),a=e.addDays(a,1);return n.map(s=>e.formatByString(s,t))},wae=(e,t,n,r)=>{switch(n){case"month":return DB(e,e.date(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return NT(e,r);case"meridiem":{const o=e.date(void 0,t);return[e.startOfDay(o),e.endOfDay(o)].map(i=>e.formatByString(i,r))}default:return[]}},xK="s",T9e=["0","1","2","3","4","5","6","7","8","9"],O9e=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),xK)==="0"?T9e:Array.from({length:10}).map((r,o)=>e.formatByString(e.setSeconds(t,o),xK))},qp=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const i=t.indexOf(r);i>-1&&(n.push(i.toString()),r="")}return n.join("")},NB=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),SK=(e,t)=>{const n=qp(e,t);return n!==" "&&!Number.isNaN(Number(n))},xae=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},Sae=(e,t,n,r,o)=>{if(o.type==="day"&&o.contentType==="digit-with-letter"){const a=e.setDate(n.longestMonth,t);return e.formatByString(a,o.format)}let i=t.toString();return o.hasLeadingZerosInInput&&(i=xae(i,o.maxLength)),NB(i,r)},k9e=(e,t,n,r,o,i,a,s)=>{const l=I9e(r),c=r==="Home",u=r==="End",d=n.value===""||c||u,f=()=>{const g=o[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),y=C=>Sae(e,C,g,i,n),v=n.type==="minutes"&&(s!=null&&s.minutesStep)?s.minutesStep:1;let S=parseInt(qp(n.value,i),10)+l*v;if(d){if(n.type==="year"&&!u&&!c)return e.formatByString(e.date(void 0,t),n.format);l>0||c?S=g.minimum:S=g.maximum}return S%v!==0&&((l<0||c)&&(S+=v-(v+S)%v),(l>0||u)&&(S-=S%v)),S>g.maximum?y(g.minimum+(S-g.maximum-1)%(g.maximum-g.minimum+1)):S<g.minimum?y(g.maximum-(g.minimum-S-1)%(g.maximum-g.minimum+1)):y(S)},h=()=>{const g=wae(e,t,n.type,n.format);if(g.length===0)return n.value;if(d)return l>0||c?g[0]:g[g.length-1];const x=((g.indexOf(n.value)+l)%g.length+g.length)%g.length;return g[x]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?f():h()},LB=(e,t,n)=>{let r=e.value||e.placeholder;const o=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(qp(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!o&&r.length===1&&(r=`${r}`),t==="input-rtl"&&(r=`${r}`),r},CK=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),Cae=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,Eae=(e,t,n,r)=>{if(t!=="digit")return!1;const o=e.date(void 0,"default");switch(n){case"year":return Cae(e,r)?e.formatByString(e.setYear(o,1),r)==="0001":e.formatByString(e.setYear(o,2001),r)==="01";case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},M9e=(e,t,n)=>{const r=t.some(l=>l.type==="day"),o=[],i=[];for(let l=0;l<t.length;l+=1){const c=t[l];r&&c.type==="weekDay"||(o.push(c.format),i.push(LB(c,"non-input",n)))}const a=o.join(" "),s=i.join(" ");return e.parse(s,a)},A9e=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),R9e=(e,t,n)=>{const o=e.map(i=>{const a=LB(i,n?"input-rtl":"input-ltr",t);return`${i.startSeparator}${a}${i.endSeparator}`}).join("");return n?`${o}`:o},D9e=(e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:a,longestMonth:s}=DB(e,r).reduce((l,c)=>{const u=e.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:Cae(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):a,longestMonth:s}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=NT(e,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=e.getHours(i);return qp(e.formatByString(e.endOfDay(r),l),t)!==c.toString()?{minimum:1,maximum:Number(qp(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:e.getMinutes(i)}),seconds:()=>({minimum:0,maximum:e.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},_9e=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const o=NT(e,t.format),i=e.formatByString(n,t.format),a=o.indexOf(i),l=o.indexOf(t.value)-a;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const o=e.getHours(n)<12,i=e.getHours(r);return o&&i>=12?e.addHours(r,-12):!o&&i<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},EK={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},PK=(e,t,n,r,o)=>[...n].sort((i,a)=>EK[i.type]-EK[a.type]).reduce((i,a)=>!o||a.modified?_9e(e,a,t,i):i,r),$9e=()=>navigator.userAgent.toLowerCase().includes("android"),N9e=(e,t)=>{const n={};if(!t)return e.forEach((l,c)=>{const u=c===0?null:c-1,d=c===e.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:d}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,a=0,s=e.length-1;for(;s>=0;){a=e.findIndex((l,c)=>{var u;return c>=i&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),a===-1&&(a=e.length-1);for(let l=a;l>=i;l-=1)o[l]=s,r[s]=l,s-=1;i=a+1}return e.forEach((l,c)=>{const u=o[c],d=u===0?null:r[u-1],f=u===e.length-1?null:r[u+1];n[c]={leftIndex:d,rightIndex:f}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},hL=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},L9e=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},F9e=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},j9e=["value","referenceDate"],ao={emptyValue:null,getTodayValue:_B,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=We(e,j9e);return t!=null&&r.utils.isValid(t)?t:n??P9e(r)},cleanValue:a9e,areValuesEqual:s9e,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},FB={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:A9e,getV6InputValueFromSections:R9e,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},jB=({value:e,referenceDate:t,utils:n,props:r,timezone:o})=>{const i=w.useMemo(()=>ao.getInitialReferenceValue({value:e,utils:n,props:r,referenceDate:t,granularity:xl.day,timezone:o,getTodayDate:()=>_B(n,o,"date")}),[]);return e??i},B9e=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],z9e=e=>{const{classes:t}=e;return Oe({root:["root"],arrowSwitcher:["arrowSwitcher"]},q8e,t)},V9e=se($T,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),H9e=se(fae,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),U9e=["hours","minutes"],W9e=w.forwardRef(function(t,n){const r=In(),o=hn({props:t,name:"MuiTimeClock"}),{ampm:i=r.is12HourCycleInCurrentLocale(),ampmInClock:a=!1,autoFocus:s,slots:l,slotProps:c,value:u,defaultValue:d,referenceDate:f,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:g,minTime:y,disableFuture:v,disablePast:x,minutesStep:S=1,shouldDisableTime:C,showViewSwitcher:I,onChange:E,view:T,views:O=U9e,openTo:A,onViewChange:k,focusedView:M,onFocusedViewChange:R,className:$,disabled:L,readOnly:z,timezone:N}=o,B=We(o,B9e),{value:U,handleValueChange:G,timezone:H}=Uy({name:"TimeClock",timezone:N,value:u,defaultValue:d,referenceDate:f,onChange:E,valueManager:ao}),K=jB({value:U,referenceDate:f,utils:r,props:o,timezone:H}),q=Co(),Y=ph(H),{view:J,setView:ie,previousView:ee,nextView:te,setValueAndGoToNextView:ce}=j0({view:T,views:O,openTo:A,onViewChange:k,onChange:G,focusedView:M,onFocusedViewChange:R}),{meridiemMode:ae,handleMeridiemChange:ne}=AT(K,i,ce),ue=w.useCallback((Se,Ee)=>{const ge=F0(h,r),xe=Ee==="hours"||Ee==="minutes"&&O.includes("seconds"),Pe=({start:Le,end:de})=>!(y&&ge(y,de)||g&&ge(Le,g)||v&&ge(Le,Y)||x&&ge(Y,xe?de:Le)),_e=(Le,de=1)=>{if(Le%de!==0)return!1;if(C)switch(Ee){case"hours":return!C(r.setHours(K,Le),"hours");case"minutes":return!C(r.setMinutes(K,Le),"minutes");case"seconds":return!C(r.setSeconds(K,Le),"seconds");default:return!1}return!0};switch(Ee){case"hours":{const Le=Px(Se,ae,i),de=r.setHours(K,Le);if(r.getHours(de)!==Le)return!0;const $e=r.setSeconds(r.setMinutes(de,0),0),Ae=r.setSeconds(r.setMinutes(de,59),59);return!Pe({start:$e,end:Ae})||!_e(Le)}case"minutes":{const Le=r.setMinutes(K,Se),de=r.setSeconds(Le,0),$e=r.setSeconds(Le,59);return!Pe({start:de,end:$e})||!_e(Se,S)}case"seconds":{const Le=r.setSeconds(K,Se);return!Pe({start:Le,end:Le})||!_e(Se)}default:throw new Error("not supported")}},[i,K,h,g,ae,y,S,C,r,v,x,Y,O]),he=Dn(),re=w.useMemo(()=>{switch(J){case"hours":{const Se=(xe,Pe)=>{const _e=Px(xe,ae,i);ce(r.setHours(K,_e),Pe,"hours")},Ee=r.getHours(K);let ge;return i?Ee>12?ge=[12,23]:ge=[0,11]:ge=[0,23],{onChange:Se,viewValue:Ee,children:C9e({value:U,utils:r,ampm:i,getClockNumberText:q.hoursClockNumberText,isDisabled:xe=>L||ue(xe,"hours"),selectedId:he}),viewRange:ge}}case"minutes":{const Se=r.getMinutes(K);return{viewValue:Se,onChange:(ge,xe)=>{ce(r.setMinutes(K,ge),xe,"minutes")},children:wK({utils:r,value:Se,getClockNumberText:q.minutesClockNumberText,isDisabled:ge=>L||ue(ge,"minutes"),selectedId:he}),viewRange:[0,59]}}case"seconds":{const Se=r.getSeconds(K);return{viewValue:Se,onChange:(ge,xe)=>{ce(r.setSeconds(K,ge),xe,"seconds")},children:wK({utils:r,value:Se,getClockNumberText:q.secondsClockNumberText,isDisabled:ge=>L||ue(ge,"seconds"),selectedId:he}),viewRange:[0,59]}}default:throw new Error("You must provide the type for ClockView")}},[J,r,U,i,q.hoursClockNumberText,q.minutesClockNumberText,q.secondsClockNumberText,ae,ce,K,ue,he,L]),le=o,me=z9e(le);return _.jsxs(V9e,F({ref:n,className:fe(me.root,$),ownerState:le},B,{children:[_.jsx(v9e,F({autoFocus:s??!!M,ampmInClock:a&&O.includes("hours"),value:U,type:J,ampm:i,minutesStep:S,isTimeDisabled:ue,meridiemMode:ae,handleMeridiemChange:ne,selectedId:he,disabled:L,readOnly:z},re)),I&&_.jsx(H9e,{className:me.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>ie(ee),isPreviousDisabled:!ee,previousLabel:q.openPreviousView,onGoToNext:()=>ie(te),isNextDisabled:!te,nextLabel:q.openNextView,ownerState:le})]}))});function G9e(e){return je("MuiDigitalClock",e)}const q9e=Be("MuiDigitalClock",["root","list","item"]);function bm(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const K9e=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},Bi=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Bi(t.shadowRoot):t:null},EP=e=>Array.from(e.children).indexOf(Bi(document)),BB="@media (pointer: fine)",Y9e=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],Q9e=e=>{const{classes:t}=e;return Oe({root:["root"],list:["list"],item:["item"]},G9e,t)},X9e=se($T,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:hae,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),J9e=se(wy,{name:"MuiDigitalClock",slot:"List",overridesResolver:(e,t)=>t.list})({padding:0}),Z9e=se(Ft,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.primary.main,e.palette.action.focusOpacity)}})),e7e=w.forwardRef(function(t,n){const r=In(),o=w.useRef(null),i=cn(n,o),a=w.useRef(null),s=hn({props:t,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:d,slotProps:f,value:h,defaultValue:g,referenceDate:y,disableIgnoringDatePartForTimeValidation:v=!1,maxTime:x,minTime:S,disableFuture:C,disablePast:I,minutesStep:E=1,shouldDisableTime:T,onChange:O,view:A,openTo:k,onViewChange:M,focusedView:R,onFocusedViewChange:$,className:L,disabled:z,readOnly:N,views:B=["hours"],skipDisabled:U=!1,timezone:G}=s,H=We(s,Y9e),{value:K,handleValueChange:q,timezone:Y}=Uy({name:"DigitalClock",timezone:G,value:h,defaultValue:g,referenceDate:y,onChange:O,valueManager:ao}),J=Co(),ie=ph(Y),ee=w.useMemo(()=>F({},s,{alreadyRendered:!!o.current}),[s]),te=Q9e(ee),ce=(d==null?void 0:d.digitalClockItem)??Z9e,ae=Pn({elementType:ce,externalSlotProps:f==null?void 0:f.digitalClockItem,ownerState:{},className:te.item}),ne=jB({value:K,referenceDate:y,utils:r,props:s,timezone:Y}),ue=Qe(ge=>q(ge,"finish","hours")),{setValueAndGoToNextView:he}=j0({view:A,views:B,openTo:k,onViewChange:M,onChange:ue,focusedView:R,onFocusedViewChange:$}),re=Qe(ge=>{he(ge,"finish")});w.useEffect(()=>{if(o.current===null)return;const ge=o.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!ge)return;const xe=ge.offsetTop;(u||R)&&ge.focus(),o.current.scrollTop=xe-4});const le=w.useCallback(ge=>{const xe=F0(v,r),Pe=()=>!(S&&xe(S,ge)||x&&xe(ge,x)||C&&xe(ge,ie)||I&&xe(ie,ge)),_e=()=>r.getMinutes(ge)%E!==0?!1:T?!T(ge,"hours"):!0;return!Pe()||!_e()},[v,r,S,x,C,ie,I,E,T]),me=w.useMemo(()=>{const ge=[];let Pe=r.startOfDay(ne);for(;r.isSameDay(ne,Pe);)ge.push(Pe),Pe=r.addMinutes(Pe,c);return ge},[ne,c,r]),Se=me.findIndex(ge=>r.isEqual(ge,ne)),Ee=ge=>{switch(ge.key){case"PageUp":{const xe=EP(a.current)-5,Pe=a.current.children,_e=Math.max(0,xe),Le=Pe[_e];Le&&Le.focus(),ge.preventDefault();break}case"PageDown":{const xe=EP(a.current)+5,Pe=a.current.children,_e=Math.min(Pe.length-1,xe),Le=Pe[_e];Le&&Le.focus(),ge.preventDefault();break}}};return _.jsx(X9e,F({ref:i,className:fe(te.root,L),ownerState:ee},H,{children:_.jsx(J9e,{ref:a,role:"listbox","aria-label":J.timePickerToolbarTitle,className:te.list,onKeyDown:Ee,children:me.map((ge,xe)=>{if(U&&le(ge))return null;const Pe=r.isEqual(ge,K),_e=r.format(ge,l?"fullTime12h":"fullTime24h"),Le=Se===xe||Se===-1&&xe===0?0:-1;return _.jsx(ce,F({onClick:()=>!N&&re(ge),selected:Pe,disabled:z||le(ge),disableRipple:N,role:"option","aria-disabled":N,"aria-selected":Pe,tabIndex:Le},ae,{children:_e}),`${ge.valueOf()}-${_e}`)})})}))});function t7e(e){return je("MuiMultiSectionDigitalClock",e)}const IK=Be("MuiMultiSectionDigitalClock",["root"]);function n7e(e){return je("MuiMultiSectionDigitalClockSection",e)}const r7e=Be("MuiMultiSectionDigitalClockSection",["root","item"]),o7e=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],i7e=e=>{const{classes:t}=e;return Oe({root:["root"],item:["item"]},n7e,t)},a7e=se(wy,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({maxHeight:hae,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),s7e=se(Ft,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:8,margin:"2px 4px",width:qb,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.primary.main,e.palette.action.focusOpacity)}})),l7e=w.forwardRef(function(t,n){const r=w.useRef(null),o=cn(n,r),i=w.useRef(null),a=hn({props:t,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:s,onChange:l,className:c,disabled:u,readOnly:d,items:f,active:h,slots:g,slotProps:y,skipDisabled:v}=a,x=We(a,o7e),S=w.useMemo(()=>F({},a,{alreadyRendered:!!r.current}),[a]),C=i7e(S),I=(g==null?void 0:g.digitalClockSectionItem)??s7e;w.useEffect(()=>{if(r.current===null)return;const O=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&s&&O&&O.focus(),!O||i.current===O)return;i.current=O;const A=O.offsetTop;r.current.scrollTop=A-4});const E=f.findIndex(O=>O.isFocused(O.value)),T=O=>{switch(O.key){case"PageUp":{const A=EP(r.current)-5,k=r.current.children,M=Math.max(0,A),R=k[M];R&&R.focus(),O.preventDefault();break}case"PageDown":{const A=EP(r.current)+5,k=r.current.children,M=Math.min(k.length-1,A),R=k[M];R&&R.focus(),O.preventDefault();break}}};return _.jsx(a7e,F({ref:o,className:fe(C.root,c),ownerState:S,autoFocusItem:s&&h,role:"listbox",onKeyDown:T},x,{children:f.map((O,A)=>{var L;const k=(L=O.isDisabled)==null?void 0:L.call(O,O.value),M=u||k;if(v&&M)return null;const R=O.isSelected(O.value),$=E===A||E===-1&&A===0?0:-1;return _.jsx(I,F({onClick:()=>!d&&l(O.value),selected:R,disabled:M,disableRipple:d,role:"option","aria-disabled":d||M||void 0,"aria-label":O.ariaLabel,"aria-selected":R,tabIndex:$,className:C.item},y==null?void 0:y.digitalClockSectionItem,{children:O.label}),O.label)})}))}),c7e=({now:e,value:t,utils:n,ampm:r,isDisabled:o,resolveAriaLabel:i,timeStep:a,valueOrReferenceDate:s})=>{const l=t?n.getHours(t):null,c=[],u=(h,g)=>{const y=g??l;return y===null?!1:r?h===12?y===12||y===0:y===h||y-12===h:y===h},d=h=>u(h,n.getHours(s)),f=r?11:23;for(let h=0;h<=f;h+=a){let g=n.format(n.setHours(e,h),r?"hours12h":"hours24h");const y=i(parseInt(g,10).toString());g=n.formatNumber(g),c.push({value:h,label:g,isSelected:u,isDisabled:o,isFocused:d,ariaLabel:y})}return c},TK=({value:e,utils:t,isDisabled:n,timeStep:r,resolveLabel:o,resolveAriaLabel:i,hasValue:a=!0})=>{const s=c=>e===null?!1:a&&e===c,l=c=>e===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const d=r*u;return{value:d,label:t.formatNumber(o(d)),isDisabled:n,isSelected:s,isFocused:l,ariaLabel:i(d.toString())}})]},u7e=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],d7e=e=>{const{classes:t}=e;return Oe({root:["root"]},t7e,t)},f7e=se($T,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(e.vars||e).palette.divider}`})),p7e=w.forwardRef(function(t,n){const r=In(),o=Yn(),i=hn({props:t,name:"MuiMultiSectionDigitalClock"}),{ampm:a=r.is12HourCycleInCurrentLocale(),timeSteps:s,autoFocus:l,slots:c,slotProps:u,value:d,defaultValue:f,referenceDate:h,disableIgnoringDatePartForTimeValidation:g=!1,maxTime:y,minTime:v,disableFuture:x,disablePast:S,minutesStep:C=1,shouldDisableTime:I,onChange:E,view:T,views:O=["hours","minutes"],openTo:A,onViewChange:k,focusedView:M,onFocusedViewChange:R,className:$,disabled:L,readOnly:z,skipDisabled:N=!1,timezone:B}=i,U=We(i,u7e),{value:G,handleValueChange:H,timezone:K}=Uy({name:"MultiSectionDigitalClock",timezone:B,value:d,defaultValue:f,referenceDate:h,onChange:E,valueManager:ao}),q=Co(),Y=ph(K),J=w.useMemo(()=>F({hours:1,minutes:5,seconds:5},s),[s]),ie=jB({value:G,referenceDate:h,utils:r,props:i,timezone:K}),ee=Qe((Pe,_e,Le)=>H(Pe,_e,Le)),te=w.useMemo(()=>!a||!O.includes("hours")||O.includes("meridiem")?O:[...O,"meridiem"],[a,O]),{view:ce,setValueAndGoToNextView:ae,focusedView:ne}=j0({view:T,views:te,openTo:A,onViewChange:k,onChange:ee,focusedView:M,onFocusedViewChange:R}),ue=Qe(Pe=>{ae(Pe,"finish","meridiem")}),{meridiemMode:he,handleMeridiemChange:re}=AT(ie,a,ue,"finish"),le=w.useCallback((Pe,_e)=>{const Le=F0(g,r),de=_e==="hours"||_e==="minutes"&&te.includes("seconds"),$e=({start:Ne,end:Ue})=>!(v&&Le(v,Ue)||y&&Le(Ne,y)||x&&Le(Ne,Y)||S&&Le(Y,de?Ue:Ne)),Ae=(Ne,Ue=1)=>{if(Ne%Ue!==0)return!1;if(I)switch(_e){case"hours":return!I(r.setHours(ie,Ne),"hours");case"minutes":return!I(r.setMinutes(ie,Ne),"minutes");case"seconds":return!I(r.setSeconds(ie,Ne),"seconds");default:return!1}return!0};switch(_e){case"hours":{const Ne=Px(Pe,he,a),Ue=r.setHours(ie,Ne);if(r.getHours(Ue)!==Ne)return!0;const Ze=r.setSeconds(r.setMinutes(Ue,0),0),ut=r.setSeconds(r.setMinutes(Ue,59),59);return!$e({start:Ze,end:ut})||!Ae(Ne)}case"minutes":{const Ne=r.setMinutes(ie,Pe),Ue=r.setSeconds(Ne,0),Ze=r.setSeconds(Ne,59);return!$e({start:Ue,end:Ze})||!Ae(Pe,C)}case"seconds":{const Ne=r.setSeconds(ie,Pe);return!$e({start:Ne,end:Ne})||!Ae(Pe)}default:throw new Error("not supported")}},[a,ie,g,y,he,v,C,I,r,x,S,Y,te]),me=w.useCallback(Pe=>{switch(Pe){case"hours":return{onChange:_e=>{const Le=Px(_e,he,a);ae(r.setHours(ie,Le),"finish","hours")},items:c7e({now:Y,value:G,ampm:a,utils:r,isDisabled:_e=>le(_e,"hours"),timeStep:J.hours,resolveAriaLabel:q.hoursClockNumberText,valueOrReferenceDate:ie})};case"minutes":return{onChange:_e=>{ae(r.setMinutes(ie,_e),"finish","minutes")},items:TK({value:r.getMinutes(ie),utils:r,isDisabled:_e=>le(_e,"minutes"),resolveLabel:_e=>r.format(r.setMinutes(Y,_e),"minutes"),timeStep:J.minutes,hasValue:!!G,resolveAriaLabel:q.minutesClockNumberText})};case"seconds":return{onChange:_e=>{ae(r.setSeconds(ie,_e),"finish","seconds")},items:TK({value:r.getSeconds(ie),utils:r,isDisabled:_e=>le(_e,"seconds"),resolveLabel:_e=>r.format(r.setSeconds(Y,_e),"seconds"),timeStep:J.seconds,hasValue:!!G,resolveAriaLabel:q.secondsClockNumberText})};case"meridiem":{const _e=Il(r,"am"),Le=Il(r,"pm");return{onChange:re,items:[{value:"am",label:_e,isSelected:()=>!!G&&he==="am",isFocused:()=>!!ie&&he==="am",ariaLabel:_e},{value:"pm",label:Le,isSelected:()=>!!G&&he==="pm",isFocused:()=>!!ie&&he==="pm",ariaLabel:Le}]}}default:throw new Error(`Unknown view: ${Pe} found.`)}},[Y,G,a,r,J.hours,J.minutes,J.seconds,q.hoursClockNumberText,q.minutesClockNumberText,q.secondsClockNumberText,he,ae,ie,le,re]),Se=w.useMemo(()=>{if(!o)return te;const Pe=te.filter(_e=>_e!=="meridiem");return Pe.reverse(),te.includes("meridiem")&&Pe.push("meridiem"),Pe},[o,te]),Ee=w.useMemo(()=>te.reduce((Pe,_e)=>F({},Pe,{[_e]:me(_e)}),{}),[te,me]),ge=i,xe=d7e(ge);return _.jsx(f7e,F({ref:n,className:fe(xe.root,$),ownerState:ge,role:"group"},U,{children:Se.map(Pe=>_.jsx(l7e,{items:Ee[Pe].items,onChange:Ee[Pe].onChange,active:ce===Pe,autoFocus:l??ne===Pe,disabled:L,readOnly:z,slots:c,slotProps:u,skipDisabled:N,"aria-label":q.selectViewText(Pe)},Pe))}))});function h7e(e){return je("MuiPickersDay",e)}const qf=Be("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),m7e=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],g7e=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:i,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e,c=a&&!s;return Oe({root:["root",t&&!c&&"selected",i&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",a&&s&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},h7e,l)},Pae=({theme:e})=>F({},e.typography.caption,{width:Ix,height:Ix,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${qf.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${qf.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${qf.disabled}:not(.${qf.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${qf.disabled}&.${qf.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${RT}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${qf.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),Iae=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},y7e=se(qi,{name:"MuiPickersDay",slot:"Root",overridesResolver:Iae})(Pae),v7e=se("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Iae})(({theme:e})=>F({},Pae({theme:e}),{opacity:0,pointerEvents:"none"})),gb=()=>{},b7e=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:a,disabled:s=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:d,onDaySelect:f,onFocus:h=gb,onBlur:g=gb,onKeyDown:y=gb,onMouseDown:v=gb,onMouseEnter:x=gb,outsideCurrentMonth:S,selected:C=!1,showDaysOutsideCurrentMonth:I=!1,children:E,today:T=!1}=r,O=We(r,m7e),A=F({},r,{autoFocus:o,disabled:s,disableHighlightToday:l,disableMargin:c,selected:C,showDaysOutsideCurrentMonth:I,today:T}),k=g7e(A),M=In(),R=w.useRef(null),$=cn(R,n);On(()=>{o&&!s&&!u&&!S&&R.current.focus()},[o,s,u,S]);const L=N=>{v(N),S&&N.preventDefault()},z=N=>{s||f(a),S&&N.currentTarget.focus(),d&&d(N)};return S&&!I?_.jsx(v7e,{className:fe(k.root,k.hiddenDaySpacingFiller,i),ownerState:A,role:O.role}):_.jsx(y7e,F({className:fe(k.root,i),ref:$,centerRipple:!0,disabled:s,tabIndex:C?0:-1,onKeyDown:N=>y(N,a),onFocus:N=>h(N,a),onBlur:N=>g(N,a),onMouseEnter:N=>x(N,a),onClick:z,onMouseDown:L},O,{ownerState:A,children:E||M.format(a,"dayOfMonth")}))}),w7e=w.memo(b7e),Wy=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:o,shouldDisableMonth:i,shouldDisableYear:a,disablePast:s,disableFuture:l}=e,c=r.utils.date(void 0,n),u=Oi(r.utils,e.minDate,r.defaultDates.minDate),d=Oi(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(i&&i(t)):return"shouldDisableMonth";case!!(a&&a(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,c)):return"disableFuture";case!!(s&&r.utils.isBeforeDay(t,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(t,u)):return"minDate";case!!(d&&r.utils.isAfterDay(t,d)):return"maxDate";default:return null}};Wy.valueManager=ao;const B0=({adapter:e,value:t,timezone:n,props:r})=>{if(t===null)return null;const{minTime:o,maxTime:i,minutesStep:a,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=r,d=e.utils.date(void 0,n),f=F0(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(o&&f(o,t)):return"minTime";case!!(i&&f(t,i)):return"maxTime";case!!(u&&e.utils.isAfter(t,d)):return"disableFuture";case!!(c&&e.utils.isBefore(t,d)):return"disablePast";case!!(s&&s(t,"hours")):return"shouldDisableTime-hours";case!!(s&&s(t,"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(t,"seconds")):return"shouldDisableTime-seconds";case!!(a&&e.utils.getMinutes(t)%a!==0):return"minutesStep";default:return null}};B0.valueManager=ao;const LT=({adapter:e,value:t,timezone:n,props:r})=>{const o=Wy({adapter:e,value:t,timezone:n,props:r});return o!==null?o:B0({adapter:e,value:t,timezone:n,props:r})};LT.valueManager=ao;const mL=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],gL=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],Tae=["minDateTime","maxDateTime"],x7e=[...mL,...gL,...Tae],Gy=e=>x7e.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function Oae(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,a=dh(),s=w.useRef(n.valueManager.defaultErrorState),l=n({adapter:a,value:r,timezone:o,props:t}),c=n.valueManager.hasError(l);w.useEffect(()=>{i&&!n.valueManager.isSameError(l,s.current)&&i(l,r),s.current=l},[n,i,l,r]);const u=Qe(d=>n({adapter:a,value:d,timezone:o,props:t}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const S7e=({utils:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return o},C7e=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let a=null;for(;a=i.exec(t);)n.push({start:a.index,end:i.lastIndex-1});return n},E7e=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},P7e=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:i,token:a,startSeparator:s})=>{if(a==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=bae(e,a),c=Eae(e,l.contentType,l.type,a),u=n?c:l.contentType==="digit",d=t!=null&&e.isValid(t);let f=d?e.formatByString(t,a):"",h=null;if(u)if(c)h=f===""?e.formatByString(i,a).length:f.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${a} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,d&&(f=NB(xae(qp(f,o),h),o))}return F({},l,{format:a,maxLength:h,value:f,placeholder:E7e(e,r,l,a),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:s,endSeparator:"",modified:!1})},I7e=e=>{var h;const{utils:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),i=[];let a="";const s=Object.keys(t.formatTokenMap).sort((g,y)=>y.length-g.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${s.join("|")})*$`),u=new RegExp(`^(${s.join("|")})`),d=g=>r.find(y=>y.start<=g&&y.end>=g);let f=0;for(;f<n.length;){const g=d(f),y=g!=null,v=(h=l.exec(n.slice(f)))==null?void 0:h[1];if(!y&&v!=null&&c.test(v)){let x=v;for(;x.length>0;){const S=u.exec(x)[1];x=x.slice(S.length),i.push(P7e(F({},e,{now:o,token:S,startSeparator:a}))),a=""}f+=v.length}else{const x=n[f];y&&(g==null?void 0:g.start)===f||(g==null?void 0:g.end)===f||(i.length===0?a+=x:i[i.length-1].endSeparator+=x),f+=1}}return i.length===0&&a.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),i},T7e=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const o=i=>{let a=i;return e&&a!==null&&a.includes(" ")&&(a=`${a}`),t==="spacious"&&["/",".","-"].includes(a)&&(a=` ${a} `),a};return r.startSeparator=o(r.startSeparator),r.endSeparator=o(r.endSeparator),r}),OK=e=>{let t=S7e(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=C7e(F({},e,{expandedFormat:t})),r=I7e(F({},e,{expandedFormat:t,escapedParts:n}));return T7e(F({},e,{sections:r}))},O7e=e=>{const t=In(),n=Co(),r=dh(),o=Yn(),{valueManager:i,fieldValueManager:a,valueType:s,validator:l,internalProps:c,internalProps:{value:u,defaultValue:d,referenceDate:f,onChange:h,format:g,formatDensity:y="dense",selectedSections:v,onSelectedSectionsChange:x,shouldRespectLeadingZeros:S=!1,timezone:C,enableAccessibleFieldDOMStructure:I=!1}}=e,{timezone:E,value:T,handleValueChange:O}=$B({timezone:C,value:u,defaultValue:d,referenceDate:f,onChange:h,valueManager:i}),A=w.useMemo(()=>O9e(t),[t]),k=w.useMemo(()=>D9e(t,A,E),[t,A,E]),M=w.useCallback((ee,te=null)=>a.getSectionsFromValue(t,ee,te,ce=>OK({utils:t,localeText:n,localizedDigits:A,format:g,date:ce,formatDensity:y,shouldRespectLeadingZeros:S,enableAccessibleFieldDOMStructure:I,isRtl:o})),[a,g,n,A,o,S,t,y,I]),[R,$]=w.useState(()=>{const ee=M(T),te={sections:ee,value:T,referenceValue:i.emptyValue,tempValueStrAndroid:null},ce=E9e(ee),ae=i.getInitialReferenceValue({referenceDate:f,value:T,utils:t,props:c,granularity:ce,timezone:E});return F({},te,{referenceValue:ae})}),[L,z]=Ei({controlled:v,default:null,name:"useField",state:"selectedSections"}),N=ee=>{z(ee),x==null||x(ee)},B=w.useMemo(()=>hL(L,R.sections),[L,R.sections]),U=B==="all"?0:B,G=({value:ee,referenceValue:te,sections:ce})=>{if($(ne=>F({},ne,{sections:ce,value:ee,referenceValue:te,tempValueStrAndroid:null})),i.areValuesEqual(t,R.value,ee))return;const ae={validationError:l({adapter:r,value:ee,timezone:E,props:c})};O(ee,ae)},H=(ee,te)=>{const ce=[...R.sections];return ce[ee]=F({},ce[ee],{value:te,modified:!0}),ce},K=()=>{G({value:i.emptyValue,referenceValue:R.referenceValue,sections:M(i.emptyValue)})},q=()=>{if(U==null)return;const ee=R.sections[U],te=a.getActiveDateManager(t,R,ee),ae=te.getSections(R.sections).filter(re=>re.value!=="").length===(ee.value===""?0:1),ne=H(U,""),ue=ae?null:t.getInvalidDate(),he=te.getNewValuesFromNewActiveDate(ue);G(F({},he,{sections:ne}))},Y=ee=>{const te=(ne,ue)=>{const he=t.parse(ne,g);if(he==null||!t.isValid(he))return null;const re=OK({utils:t,localeText:n,localizedDigits:A,format:g,date:he,formatDensity:y,shouldRespectLeadingZeros:S,enableAccessibleFieldDOMStructure:I,isRtl:o});return PK(t,he,re,ue,!1)},ce=a.parseValueStr(ee,R.referenceValue,te),ae=a.updateReferenceValue(t,ce,R.referenceValue);G({value:ce,referenceValue:ae,sections:M(ce,R.sections)})},J=({activeSection:ee,newSectionValue:te,shouldGoToNextSection:ce})=>{ce&&U<R.sections.length-1&&N(U+1);const ae=a.getActiveDateManager(t,R,ee),ne=H(U,te),ue=ae.getSections(ne),he=M9e(t,ue,A);let re,le;if(he!=null&&t.isValid(he)){const me=PK(t,he,ue,ae.referenceDate,!0);re=ae.getNewValuesFromNewActiveDate(me),le=!0}else re=ae.getNewValuesFromNewActiveDate(he),le=(he!=null&&!t.isValid(he))!=(ae.date!=null&&!t.isValid(ae.date));return le?G(F({},re,{sections:ne})):$(me=>F({},me,re,{sections:ne,tempValueStrAndroid:null}))},ie=ee=>$(te=>F({},te,{tempValueStrAndroid:ee}));return w.useEffect(()=>{const ee=M(R.value);$(te=>F({},te,{sections:ee}))},[g,t.locale,o]),w.useEffect(()=>{let ee;i.areValuesEqual(t,R.value,T)?ee=i.getTimezone(t,R.value)!==i.getTimezone(t,T):ee=!0,ee&&$(te=>F({},te,{value:T,referenceValue:a.updateReferenceValue(t,T,te.referenceValue),sections:M(T)}))},[T]),{state:R,activeSectionIndex:U,parsedSelectedSections:B,setSelectedSections:N,clearValue:K,clearActiveSection:q,updateSectionValue:J,updateValueFromValueStr:Y,setTempAndroidValueStr:ie,getSectionsFromValue:M,sectionsValueBoundaries:k,localizedDigits:A,timezone:E}},k7e=5e3,sm=e=>e.saveQuery!=null,M7e=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:o,timezone:i})=>{const a=In(),[s,l]=w.useState(null),c=Qe(()=>l(null));w.useEffect(()=>{var g;s!=null&&((g=e[s.sectionIndex])==null?void 0:g.type)!==s.sectionType&&c()},[e,s,c]),w.useEffect(()=>{if(s!=null){const g=setTimeout(()=>c(),k7e);return()=>{clearTimeout(g)}}return()=>{}},[s,c]);const u=({keyPressed:g,sectionIndex:y},v,x)=>{const S=g.toLowerCase(),C=e[y];if(s!=null&&(!x||x(s.value))&&s.sectionIndex===y){const E=`${s.value}${S}`,T=v(E,C);if(!sm(T))return l({sectionIndex:y,value:E,sectionType:C.type}),T}const I=v(S,C);return sm(I)&&!I.saveQuery?(c(),null):(l({sectionIndex:y,value:S,sectionType:C.type}),sm(I)?null:I)},d=g=>{const y=(S,C,I)=>{const E=C.filter(T=>T.toLowerCase().startsWith(I));return E.length===0?{saveQuery:!1}:{sectionValue:E[0],shouldGoToNextSection:E.length===1}},v=(S,C,I,E)=>{const T=O=>wae(a,i,C.type,O);if(C.contentType==="letter")return y(C.format,T(C.format),S);if(I&&E!=null&&bae(a,I).contentType==="letter"){const O=T(I),A=y(I,O,S);return sm(A)?{saveQuery:!1}:F({},A,{sectionValue:E(A.sectionValue,O)})}return{saveQuery:!1}};return u(g,(S,C)=>{switch(C.type){case"month":{const I=E=>CK(a,E,a.formats.month,C.format);return v(S,C,a.formats.month,I)}case"weekDay":{const I=(E,T)=>T.indexOf(E).toString();return v(S,C,a.formats.weekday,I)}case"meridiem":return v(S,C);default:return{saveQuery:!1}}})},f=g=>{const y=(x,S)=>{const C=qp(x,r),I=Number(C),E=n[S.type]({currentDate:null,format:S.format,contentType:S.contentType});if(I>E.maximum)return{saveQuery:!1};if(I<E.minimum)return{saveQuery:!0};const T=I*10>E.maximum||C.length===E.maximum.toString().length;return{sectionValue:Sae(a,I,E,r,S),shouldGoToNextSection:T}};return u(g,(x,S)=>{if(S.contentType==="digit"||S.contentType==="digit-with-letter")return y(x,S);if(S.type==="month"){Eae(a,"digit","month","MM");const C=y(x,{type:S.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(sm(C))return C;const I=CK(a,C.sectionValue,"MM",S.format);return F({},C,{sectionValue:I})}if(S.type==="weekDay"){const C=y(x,S);if(sm(C))return C;const I=NT(a,S.format)[Number(C.sectionValue)-1];return F({},C,{sectionValue:I})}return{saveQuery:!1}},x=>SK(x,r))};return{applyCharacterEditing:Qe(g=>{const y=e[g.sectionIndex],x=SK(g.keyPressed,r)?f(F({},g,{keyPressed:NB(g.keyPressed,r)})):d(g);if(x==null){o(null);return}t({activeSection:y,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:c}},A7e=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:o,onClick:i,onFocus:a,onInput:s,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:d,applyCharacterEditing:f,resetCharacterQuery:h,setSelectedSections:g,parsedSelectedSections:y,state:v,clearActiveSection:x,clearValue:S,updateSectionValue:C,updateValueFromValueStr:I,sectionOrder:E,areAllSectionsEmpty:T,sectionsValueBoundaries:O}=e,A=w.useRef(null),k=cn(r,A),M=Co(),R=In(),$=Dn(),[L,z]=w.useState(!1),N=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!A.current)return;const le=document.getSelection();if(!le)return;if(y==null){le.rangeCount>0&&A.current.getRoot().contains(le.getRangeAt(0).startContainer)&&le.removeAllRanges(),L&&A.current.getRoot().blur();return}if(!A.current.getRoot().contains(Bi(document)))return;const me=new window.Range;let Se;y==="all"?Se=A.current.getRoot():v.sections[y].type==="empty"?Se=A.current.getSectionContainer(y):Se=A.current.getSectionContent(y),me.selectNodeContents(Se),Se.focus(),le.removeAllRanges(),le.addRange(me)},getActiveSectionIndexFromDOM:()=>{const le=Bi(document);return!le||!A.current||!A.current.getRoot().contains(le)?null:A.current.getSectionIndexFromDOMElement(le)},focusField:(le=0)=>{if(!A.current||N.getActiveSectionIndexFromDOM()!=null)return;const me=hL(le,v.sections);z(!0),A.current.getSectionContent(me).focus()},setSelectedSections:le=>{if(!A.current)return;const me=hL(le,v.sections);z((me==="all"?0:me)!==null),g(le)},isFieldFocused:()=>{const le=Bi(document);return!!A.current&&A.current.getRoot().contains(le)}}),[y,g,v.sections,L]),B=Qe(le=>{if(!A.current)return;const me=v.sections[le];A.current.getSectionContent(le).innerHTML=me.value||me.placeholder,N.syncSelectionToDOM()}),U=Qe((le,...me)=>{le.isDefaultPrevented()||!A.current||(z(!0),i==null||i(le,...me),y==="all"?setTimeout(()=>{const Se=document.getSelection().getRangeAt(0).startOffset;if(Se===0){g(E.startIndex);return}let Ee=0,ge=0;for(;ge<Se&&Ee<v.sections.length;){const xe=v.sections[Ee];Ee+=1,ge+=`${xe.startSeparator}${xe.value||xe.placeholder}${xe.endSeparator}`.length}g(Ee-1)}):L?A.current.getRoot().contains(le.target)||g(E.startIndex):(z(!0),g(E.startIndex)))}),G=Qe(le=>{if(s==null||s(le),!A.current||y!=="all")return;const Se=le.target.textContent??"";A.current.getRoot().innerHTML=v.sections.map(Ee=>`${Ee.startSeparator}${Ee.value||Ee.placeholder}${Ee.endSeparator}`).join(""),N.syncSelectionToDOM(),Se.length===0||Se.charCodeAt(0)===10?(h(),S(),g("all")):Se.length>1?I(Se):(y==="all"&&g(0),f({keyPressed:Se,sectionIndex:0}))}),H=Qe(le=>{if(l==null||l(le),n||y!=="all"){le.preventDefault();return}const me=le.clipboardData.getData("text");le.preventDefault(),h(),I(me)}),K=Qe((...le)=>{if(a==null||a(...le),L||!A.current)return;z(!0),A.current.getSectionIndexFromDOMElement(Bi(document))!=null||g(E.startIndex)}),q=Qe((...le)=>{o==null||o(...le),setTimeout(()=>{if(!A.current)return;const me=Bi(document);!A.current.getRoot().contains(me)&&(z(!1),g(null))})}),Y=Qe(le=>me=>{me.isDefaultPrevented()||g(le)}),J=Qe(le=>{le.preventDefault()}),ie=Qe(le=>()=>{g(le)}),ee=Qe(le=>{if(le.preventDefault(),n||t||typeof y!="number")return;const me=v.sections[y],Se=le.clipboardData.getData("text"),Ee=/^[a-zA-Z]+$/.test(Se),ge=/^[0-9]+$/.test(Se),xe=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Se);me.contentType==="letter"&&Ee||me.contentType==="digit"&&ge||me.contentType==="digit-with-letter"&&xe?(h(),C({activeSection:me,newSectionValue:Se,shouldGoToNextSection:!0})):!Ee&&!ge&&(h(),I(Se))}),te=Qe(le=>{le.preventDefault(),le.dataTransfer.dropEffect="none"}),ce=Qe(le=>{if(!A.current)return;const me=le.target,Se=me.textContent??"",Ee=A.current.getSectionIndexFromDOMElement(me),ge=v.sections[Ee];if(n||!A.current){B(Ee);return}if(Se.length===0){if(ge.value===""){B(Ee);return}const xe=le.nativeEvent.inputType;if(xe==="insertParagraph"||xe==="insertLineBreak"){B(Ee);return}h(),x();return}f({keyPressed:Se,sectionIndex:Ee}),B(Ee)});On(()=>{if(!(!L||!A.current)){if(y==="all")A.current.getRoot().focus();else if(typeof y=="number"){const le=A.current.getSectionContent(y);le&&le.focus()}}},[y,L]);const ae=w.useMemo(()=>v.sections.reduce((le,me)=>(le[me.type]=O[me.type]({currentDate:null,contentType:me.contentType,format:me.format}),le),{}),[O,v.sections]),ne=y==="all",ue=w.useMemo(()=>v.sections.map((le,me)=>{const Se=!ne&&!t&&!n;return{container:{"data-sectionindex":me,onClick:Y(me)},content:{tabIndex:ne||me>0?-1:0,contentEditable:!ne&&!t&&!n,role:"spinbutton",id:`${$}-${le.type}`,"aria-labelledby":`${$}-${le.type}`,"aria-readonly":n,"aria-valuenow":F9e(le,R),"aria-valuemin":ae[le.type].minimum,"aria-valuemax":ae[le.type].maximum,"aria-valuetext":le.value?L9e(le,R):M.empty,"aria-label":M[le.type],"aria-disabled":t,spellCheck:Se?!1:void 0,autoCapitalize:Se?"off":void 0,autoCorrect:Se?"off":void 0,[parseInt(w.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Se?"next":void 0,children:le.value||le.placeholder,onInput:ce,onPaste:ee,onFocus:ie(me),onDragOver:te,onMouseUp:J,inputMode:le.contentType==="letter"?"text":"numeric"},before:{children:le.startSeparator},after:{children:le.endSeparator}}}),[v.sections,ie,ee,te,ce,Y,J,t,n,ne,M,R,ae,$]),he=Qe(le=>{I(le.target.value)}),re=w.useMemo(()=>T?"":d.getV7HiddenInputValueFromSections(v.sections),[T,v.sections,d]);return w.useEffect(()=>{if(A.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`-`));u&&A.current&&A.current.getSectionContent(E.startIndex).focus()},[]),{interactions:N,returnedValue:{autoFocus:u,readOnly:n,focused:c??L,sectionListRef:k,onBlur:q,onClick:U,onFocus:K,onInput:G,onPaste:H,enableAccessibleFieldDOMStructure:!0,elements:ue,tabIndex:y===0?-1:0,contentEditable:ne,value:re,onChange:he,areAllSectionsEmpty:T}}},Mm=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),R7e=(e,t,n)=>{let r=0,o=n?1:0;const i=[];for(let a=0;a<e.length;a+=1){const s=e[a],l=LB(s,n?"input-rtl":"input-ltr",t),c=`${s.startSeparator}${l}${s.endSeparator}`,u=Mm(c).length,d=c.length,f=Mm(l),h=o+(f===""?0:l.indexOf(f[0]))+s.startSeparator.length,g=h+f.length;i.push(F({},s,{start:r,end:r+u,startInInput:h,endInInput:g})),r+=u,o+=d}return i},D7e=e=>{const t=Yn(),n=w.useRef(void 0),r=w.useRef(void 0),{forwardedProps:{onFocus:o,onClick:i,onPaste:a,onBlur:s,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:d=!1},parsedSelectedSections:f,activeSectionIndex:h,state:g,fieldValueManager:y,valueManager:v,applyCharacterEditing:x,resetCharacterQuery:S,updateSectionValue:C,updateValueFromValueStr:I,clearActiveSection:E,clearValue:T,setTempAndroidValueStr:O,setSelectedSections:A,getSectionsFromValue:k,areAllSectionsEmpty:M,localizedDigits:R}=e,$=w.useRef(null),L=cn(l,$),z=w.useMemo(()=>R7e(g.sections,R,t),[g.sections,R,t]),N=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!$.current)return;if(f==null){$.current.scrollLeft&&($.current.scrollLeft=0);return}if($.current!==Bi(document))return;const ce=$.current.scrollTop;if(f==="all")$.current.select();else{const ae=z[f],ne=ae.type==="empty"?ae.startInInput-ae.startSeparator.length:ae.startInInput,ue=ae.type==="empty"?ae.endInInput+ae.endSeparator.length:ae.endInInput;(ne!==$.current.selectionStart||ue!==$.current.selectionEnd)&&$.current===Bi(document)&&$.current.setSelectionRange(ne,ue),clearTimeout(r.current),r.current=setTimeout(()=>{$.current&&$.current===Bi(document)&&$.current.selectionStart===$.current.selectionEnd&&($.current.selectionStart!==ne||$.current.selectionEnd!==ue)&&N.syncSelectionToDOM()})}$.current.scrollTop=ce},getActiveSectionIndexFromDOM:()=>{const ce=$.current.selectionStart??0,ae=$.current.selectionEnd??0;if(ce===0&&ae===0)return null;const ne=ce<=z[0].startInInput?1:z.findIndex(ue=>ue.startInInput-ue.startSeparator.length>ce);return ne===-1?z.length-1:ne-1},focusField:(ce=0)=>{var ae;Bi(document)!==$.current&&((ae=$.current)==null||ae.focus(),A(ce))},setSelectedSections:ce=>A(ce),isFieldFocused:()=>$.current===Bi(document)}),[$,f,z,A]),B=()=>{const ce=$.current.selectionStart??0;let ae;ce<=z[0].startInInput||ce>=z[z.length-1].endInInput?ae=1:ae=z.findIndex(ue=>ue.startInInput-ue.startSeparator.length>ce);const ne=ae===-1?z.length-1:ae-1;A(ne)},U=Qe((...ce)=>{o==null||o(...ce);const ae=$.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ae||ae!==$.current||h==null&&(ae.value.length&&Number(ae.selectionEnd)-Number(ae.selectionStart)===ae.value.length?A("all"):B())})}),G=Qe((ce,...ae)=>{ce.isDefaultPrevented()||(i==null||i(ce,...ae),B())}),H=Qe(ce=>{if(a==null||a(ce),ce.preventDefault(),u||d)return;const ae=ce.clipboardData.getData("text");if(typeof f=="number"){const ne=g.sections[f],ue=/^[a-zA-Z]+$/.test(ae),he=/^[0-9]+$/.test(ae),re=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ae);if(ne.contentType==="letter"&&ue||ne.contentType==="digit"&&he||ne.contentType==="digit-with-letter"&&re){S(),C({activeSection:ne,newSectionValue:ae,shouldGoToNextSection:!0});return}if(ue||he)return}S(),I(ae)}),K=Qe((...ce)=>{s==null||s(...ce),A(null)}),q=Qe(ce=>{if(u)return;const ae=ce.target.value;if(ae===""){S(),T();return}const ne=ce.nativeEvent.data,ue=ne&&ne.length>1,he=ue?ne:ae,re=Mm(he);if(f==="all"&&A(h),h==null||ue){I(ue?ne:re);return}let le;if(f==="all"&&re.length===1)le=re;else{const me=Mm(y.getV6InputValueFromSections(z,R,t));let Se=-1,Ee=-1;for(let _e=0;_e<me.length;_e+=1)Se===-1&&me[_e]!==re[_e]&&(Se=_e),Ee===-1&&me[me.length-_e-1]!==re[re.length-_e-1]&&(Ee=_e);const ge=z[h];if(Se<ge.start||me.length-Ee-1>ge.end)return;const Pe=re.length-me.length+ge.end-Mm(ge.endSeparator||"").length;le=re.slice(ge.start+Mm(ge.startSeparator||"").length,Pe)}if(le.length===0){$9e()&&O(he),S(),E();return}x({keyPressed:le,sectionIndex:h})}),Y=w.useMemo(()=>c!==void 0?c:y.getV6InputValueFromSections(k(v.emptyValue),R,t),[c,y,k,v.emptyValue,R,t]),J=w.useMemo(()=>g.tempValueStrAndroid??y.getV6InputValueFromSections(g.sections,R,t),[g.sections,y,g.tempValueStrAndroid,R,t]);w.useEffect(()=>($.current&&$.current===Bi(document)&&A("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const ie=w.useMemo(()=>h==null||g.sections[h].contentType==="letter"?"text":"numeric",[h,g.sections]),te=!($.current&&$.current===Bi(document))&&M;return{interactions:N,returnedValue:{readOnly:u,onBlur:K,onClick:G,onFocus:U,onPaste:H,inputRef:L,enableAccessibleFieldDOMStructure:!1,placeholder:Y,inputMode:ie,autoComplete:"off",value:te?"":J,onChange:q}}},zB=e=>{const t=In(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:i=!1,disabled:a=!1,readOnly:s=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:d},fieldValueManager:f,valueManager:h,validator:g}=e,y=Yn(),v=O7e(e),{state:x,activeSectionIndex:S,parsedSelectedSections:C,setSelectedSections:I,clearValue:E,clearActiveSection:T,updateSectionValue:O,setTempAndroidValueStr:A,sectionsValueBoundaries:k,localizedDigits:M,timezone:R}=v,$=M7e({sections:x.sections,updateSectionValue:O,sectionsValueBoundaries:k,localizedDigits:M,setTempAndroidValueStr:A,timezone:R}),{resetCharacterQuery:L}=$,z=h.areValuesEqual(t,x.value,h.emptyValue),N=i?A7e:D7e,B=w.useMemo(()=>N9e(x.sections,y&&!i),[x.sections,y,i]),{returnedValue:U,interactions:G}=N(F({},e,v,$,{areAllSectionsEmpty:z,sectionOrder:B})),H=Qe(ee=>{if(l==null||l(ee),!a)switch(!0){case((ee.ctrlKey||ee.metaKey)&&String.fromCharCode(ee.keyCode)==="A"&&!ee.shiftKey&&!ee.altKey):{ee.preventDefault(),I("all");break}case ee.key==="ArrowRight":{if(ee.preventDefault(),C==null)I(B.startIndex);else if(C==="all")I(B.endIndex);else{const te=B.neighbors[C].rightIndex;te!==null&&I(te)}break}case ee.key==="ArrowLeft":{if(ee.preventDefault(),C==null)I(B.endIndex);else if(C==="all")I(B.startIndex);else{const te=B.neighbors[C].leftIndex;te!==null&&I(te)}break}case ee.key==="Delete":{if(ee.preventDefault(),s)break;C==null||C==="all"?E():T(),L();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(ee.key):{if(ee.preventDefault(),s||S==null)break;C==="all"&&I(S);const te=x.sections[S],ce=f.getActiveDateManager(t,x,te),ae=k9e(t,R,te,ee.key,k,M,ce.date,{minutesStep:o});O({activeSection:te,newSectionValue:ae,shouldGoToNextSection:!1});break}}});On(()=>{G.syncSelectionToDOM()});const{hasValidationError:K}=Oae({props:n,validator:g,timezone:R,value:x.value,onError:n.onError}),q=w.useMemo(()=>c!==void 0?c:K,[K,c]);w.useEffect(()=>{!q&&S==null&&L()},[x.referenceValue,S,q]),w.useEffect(()=>{x.tempValueStrAndroid!=null&&S!=null&&(L(),T())},[x.sections]),w.useImperativeHandle(r,()=>({getSections:()=>x.sections,getActiveSectionIndex:G.getActiveSectionIndexFromDOM,setSelectedSections:G.setSelectedSections,focusField:G.focusField,isFieldFocused:G.isFieldFocused}));const Y=Qe((ee,...te)=>{ee.preventDefault(),d==null||d(ee,...te),E(),G.isFieldFocused()?I(B.startIndex):G.focusField(0)}),J={onKeyDown:H,onClear:Y,error:q,clearable:!!(u&&!z&&!s&&!a)},ie={disabled:a,readOnly:s};return F({},e.forwardedProps,J,ie,U)},_7e=["clearable","onClear","InputProps","sx","slots","slotProps"],$7e=["ownerState"],VB=e=>{const t=Co(),{clearable:n,onClear:r,InputProps:o,sx:i,slots:a,slotProps:s}=e,l=We(e,_7e),c=(a==null?void 0:a.clearButton)??on,u=Pn({elementType:c,externalSlotProps:s==null?void 0:s.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),d=We(u,$7e),f=(a==null?void 0:a.clearIcon)??_8e,h=Pn({elementType:f,externalSlotProps:s==null?void 0:s.clearIcon,ownerState:{}});return F({},l,{InputProps:F({},o,{endAdornment:_.jsxs(w.Fragment,{children:[n&&_.jsx(ro,{position:"end",sx:{marginRight:o!=null&&o.endAdornment?-1:-1.5},children:_.jsx(c,F({},d,{onClick:r,children:_.jsx(f,F({fontSize:"small"},h))}))}),o==null?void 0:o.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(i)?i:[i]]})},N7e=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],HB=(e,t)=>w.useMemo(()=>{const n=F({},e),r={},o=i=>{n.hasOwnProperty(i)&&(r[i]=n[i],delete n[i])};return N7e.forEach(o),t==="date"?mL.forEach(o):t==="time"?gL.forEach(o):t==="date-time"&&(mL.forEach(o),gL.forEach(o),Tae.forEach(o)),{forwardedProps:n,internalProps:r}},[e,t]),L7e=w.createContext(null);function kae(e){const{contextValue:t,localeText:n,children:r}=e;return _.jsx(L7e.Provider,{value:t,children:_.jsx(vc,{localeText:n,children:r})})}const F7e=e=>{const t=In(),n=fh();return F({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:Oi(t,e.minDate,n.minDate),maxDate:Oi(t,e.maxDate,n.maxDate)})},j7e=e=>{const t=In(),r=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.fullTime12h:t.formats.fullTime24h;return F({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??r})},B7e=e=>{const t=In(),n=fh(),o=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h;return F({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??o,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:Oi(t,e.minDateTime??e.minDate,n.minDate),maxDate:Oi(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime})},z7e=e=>{const t=F7e(e),{forwardedProps:n,internalProps:r}=HB(t,"date");return zB({forwardedProps:n,internalProps:r,valueManager:ao,fieldValueManager:FB,validator:Wy,valueType:"date"})};function V7e(e){return je("MuiPickersTextField",e)}Be("MuiPickersTextField",["root","focused","disabled","error","required"]);function H7e(e){return je("MuiPickersInputBase",e)}const Qm=Be("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function U7e(e){return je("MuiPickersSectionList",e)}const yb=Be("MuiPickersSectionList",["root","section","sectionContent"]),W7e=["slots","slotProps","elements","sectionListRef"],Mae=se("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),Aae=se("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),Rae=se("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),Dae=se("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),G7e=e=>{const{classes:t}=e;return Oe({root:["root"],section:["section"],sectionContent:["sectionContent"]},U7e,t)};function q7e(e){const{slots:t,slotProps:n,element:r,classes:o}=e,i=(t==null?void 0:t.section)??Aae,a=Pn({elementType:i,externalSlotProps:n==null?void 0:n.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),s=(t==null?void 0:t.sectionContent)??Dae,l=Pn({elementType:s,externalSlotProps:n==null?void 0:n.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),c=(t==null?void 0:t.sectionSeparator)??Rae,u=Pn({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),d=Pn({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return _.jsxs(i,F({},a,{children:[_.jsx(c,F({},u)),_.jsx(s,F({},l)),_.jsx(c,F({},d))]}))}const K7e=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:i,elements:a,sectionListRef:s}=r,l=We(r,W7e),c=G7e(r),u=w.useRef(null),d=cn(n,u),f=y=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${y} before the mount of the component.`);return u.current};w.useImperativeHandle(s,()=>({getRoot(){return f("getRoot")},getSectionContainer(y){return f("getSectionContainer").querySelector(`.${yb.section}[data-sectionindex="${y}"]`)},getSectionContent(y){return f("getSectionContent").querySelector(`.${yb.section}[data-sectionindex="${y}"] .${yb.sectionContent}`)},getSectionIndexFromDOMElement(y){const v=f("getSectionIndexFromDOMElement");if(y==null||!v.contains(y))return null;let x=null;return y.classList.contains(yb.section)?x=y:y.classList.contains(yb.sectionContent)&&(x=y.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const h=(o==null?void 0:o.root)??Mae,g=Pn({elementType:h,externalSlotProps:i==null?void 0:i.root,externalForwardedProps:l,additionalProps:{ref:d,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return _.jsx(h,F({},g,{children:g.contentEditable?a.map(({content:y,before:v,after:x})=>`${v.children}${y.children}${x.children}`).join(""):_.jsx(w.Fragment,{children:a.map((y,v)=>_.jsx(q7e,{slots:o,slotProps:i,element:y,classes:c},v))})}))}),Y7e=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],Q7e=e=>Math.round(e*1e5)/1e5,FT=se("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>F({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Q7e(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),UB=se(Mae,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:o})=>!t&&!n&&!r&&o==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),X7e=se(Aae,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),J7e=se(Dae,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Z7e=se(Rae,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),eKe=se("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(F({},Bge)),tKe=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:i,readOnly:a,color:s,size:l,endAdornment:c,startAdornment:u}=e,d={root:["root",t&&!n&&"focused",n&&"disabled",a&&"readOnly",r&&"error",i&&"fullWidth",`color${we(s)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Oe(d,H7e,o)},WB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:i,value:a,onChange:s,id:l,endAdornment:c,startAdornment:u,renderSuffix:d,slots:f,slotProps:h,contentEditable:g,tabIndex:y,onInput:v,onPaste:x,onKeyDown:S,name:C,readOnly:I,inputProps:E,inputRef:T,sectionListRef:O}=r,A=We(r,Y7e),k=w.useRef(null),M=cn(n,k),R=cn(E==null?void 0:E.ref,T),$=Yn(),L=wa();if(!L)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const z=K=>{var q;if(L.disabled){K.stopPropagation();return}(q=L.onFocus)==null||q.call(L,K)};w.useEffect(()=>{L&&L.setAdornedStart(!!u)},[L,u]),w.useEffect(()=>{L&&(i?L.onEmpty():L.onFilled())},[L,i]);const N=F({},r,L,{isRtl:$}),B=tKe(N),U=(f==null?void 0:f.root)||FT,G=Pn({elementType:U,externalSlotProps:h==null?void 0:h.root,externalForwardedProps:A,additionalProps:{"aria-invalid":L.error,ref:M},className:B.root,ownerState:N}),H=(f==null?void 0:f.input)||UB;return _.jsxs(U,F({},G,{children:[u,_.jsx(K7e,{sectionListRef:O,elements:o,contentEditable:g,tabIndex:y,className:B.sectionsContainer,onFocus:z,onBlur:L.onBlur,onInput:v,onPaste:x,onKeyDown:S,slots:{root:H,section:X7e,sectionContent:J7e,sectionSeparator:Z7e},slotProps:{root:{ownerState:N},sectionContent:{className:Qm.sectionContent},sectionSeparator:({position:K})=>({className:K==="before"?Qm.sectionBefore:Qm.sectionAfter})}}),c,d?d(F({},L)):null,_.jsx(eKe,F({name:C,className:B.input,value:a,onChange:s,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:I,required:L.required,disabled:L.disabled},E,{ref:R}))]}))});function nKe(e){return je("MuiPickersOutlinedInput",e)}const ul=F({},Qm,Be("MuiPickersOutlinedInput",["root","notchedOutline","input"])),rKe=["children","className","label","notched","shrink"],oKe=se("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),kK=se("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),iKe=se("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function aKe(e){const{className:t,label:n}=e,r=We(e,rKe),o=n!=null&&n!=="",i=F({},e,{withLabel:o});return _.jsx(oKe,F({"aria-hidden":!0,className:t},r,{ownerState:i,children:_.jsx(iKe,{ownerState:i,children:o?_.jsx(kK,{children:n}):_.jsx(kK,{className:"notranslate",children:""})})}))}const sKe=["label","autoFocus","ownerState","notched"],lKe=se(FT,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ul.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ul.focused} .${ul.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${ul.disabled}`]:{[`& .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${ul.error} .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>{var r;return((r=(e.vars??e).palette[n])==null?void 0:r.main)??!1}).map(n=>({props:{color:n},style:{[`&.${ul.focused}:not(.${ul.error}) .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),cKe=se(UB,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),uKe=e=>{const{classes:t}=e,r=Oe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},nKe,t);return F({},t,r)},_ae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:i,notched:a}=r,s=We(r,sKe),l=wa(),c=F({},r,i,l,{color:(l==null?void 0:l.color)||"primary"}),u=uKe(c);return _.jsx(WB,F({slots:{root:lKe,input:cKe},renderSuffix:d=>_.jsx(aKe,{shrink:!!(a||d.adornedStart||d.focused||d.filled),notched:!!(a||d.adornedStart||d.focused||d.filled),className:u.notchedOutline,label:o!=null&&o!==""&&(l!=null&&l.required)?_.jsxs(w.Fragment,{children:[o," ","*"]}):o,ownerState:c})},s,{label:o,classes:u,ref:n}))});_ae.muiName="Input";function dKe(e){return je("MuiPickersFilledInput",e)}const Kf=F({},Qm,Be("MuiPickersFilledInput",["root","underline","input"])),fKe=["label","autoFocus","disableUnderline","ownerState"],pKe=se(FT,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>b1(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Kf.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Kf.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(a=>(e.vars??e).palette[a].main).map(a=>{var s;return{props:{color:a,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(s=(e.vars||e).palette[a])==null?void 0:s.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Kf.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Kf.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Kf.disabled}, .${Kf.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Kf.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:a})=>!!a,style:{paddingLeft:12}},{props:({endAdornment:a})=>!!a,style:{paddingRight:12}}]}}),hKe=se(UB,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),mKe=e=>{const{classes:t,disableUnderline:n}=e,o=Oe({root:["root",!n&&"underline"],input:["input"]},dKe,t);return F({},t,o)},$ae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:i=!1,ownerState:a}=r,s=We(r,fKe),l=wa(),c=F({},r,a,l,{color:(l==null?void 0:l.color)||"primary"}),u=mKe(c);return _.jsx(WB,F({slots:{root:pKe,input:hKe},slotProps:{root:{disableUnderline:i}}},s,{label:o,classes:u,ref:n}))});$ae.muiName="Input";function gKe(e){return je("MuiPickersFilledInput",e)}const vb=F({},Qm,Be("MuiPickersInput",["root","input"])),yKe=["label","autoFocus","disableUnderline","ownerState"],vKe=se(FT,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${vb.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${vb.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${vb.disabled}, .${vb.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${vb.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),bKe=e=>{const{classes:t,disableUnderline:n}=e,o=Oe({root:["root",!n&&"underline"],input:["input"]},gKe,t);return F({},t,o)},Nae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:i=!1,ownerState:a}=r,s=We(r,yKe),l=wa(),c=F({},r,a,l,{disableUnderline:i,color:(l==null?void 0:l.color)||"primary"}),u=bKe(c);return _.jsx(WB,F({slots:{root:vKe}},s,{label:o,classes:u,ref:n}))});Nae.muiName="Input";const wKe=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],xKe={standard:Nae,filled:$ae,outlined:_ae},SKe=se(rh,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),CKe=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return Oe({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},V7e,r)},GB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:i,className:a,color:s="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:d=!1,InputProps:f,inputProps:h,inputRef:g,sectionListRef:y,elements:v,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:I,onPaste:E,onInput:T,endAdornment:O,startAdornment:A,tabIndex:k,contentEditable:M,focused:R,value:$,onChange:L,fullWidth:z,id:N,name:B,helperText:U,FormHelperTextProps:G,label:H,InputLabelProps:K}=r,q=We(r,wKe),Y=w.useRef(null),J=cn(n,Y),ie=Dn(N),ee=U&&ie?`${ie}-helper-text`:void 0,te=H&&ie?`${ie}-label`:void 0,ce=F({},r,{color:s,disabled:l,error:c,focused:R,required:d,variant:u}),ae=CKe(ce),ne=xKe[u];return _.jsxs(SKe,F({className:fe(ae.root,a),ref:J,focused:R,onFocus:o,onBlur:i,disabled:l,variant:u,error:c,color:s,fullWidth:z,required:d,ownerState:ce},q,{children:[_.jsx(oh,F({htmlFor:ie,id:te},K,{children:H})),_.jsx(ne,F({elements:v,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:I,onInput:T,onPaste:E,endAdornment:O,startAdornment:A,tabIndex:k,contentEditable:M,value:$,onChange:L,id:ie,fullWidth:z,inputProps:h,inputRef:g,sectionListRef:y,label:H,name:B,role:"group","aria-labelledby":te,"aria-describedby":ee,"aria-live":ee?"polite":void 0},f)),U&&_.jsx(h0,F({id:ee},G,{children:U}))]}))}),EKe=["enableAccessibleFieldDOMStructure"],PKe=["InputProps","readOnly"],IKe=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],qB=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=We(e,EKe);if(t){const{InputProps:d,readOnly:f}=n,h=We(n,PKe);return F({},h,{InputProps:F({},d??{},{readOnly:f})})}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:a,InputProps:s,inputProps:l,inputRef:c}=n,u=We(n,IKe);return F({},u,{InputProps:F({},s??{},{readOnly:a}),inputProps:F({},l??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:c})})},TKe=["slots","slotProps","InputProps","inputProps"],Lae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDateField"}),{slots:o,slotProps:i,InputProps:a,inputProps:s}=r,l=We(r,TKe),c=r,u=(o==null?void 0:o.textField)??(t.enableAccessibleFieldDOMStructure?GB:tn),d=Pn({elementType:u,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:l,additionalProps:{ref:n},ownerState:c});d.inputProps=F({},s,d.inputProps),d.InputProps=F({},a,d.InputProps);const f=z7e(d),h=qB(f),g=VB(F({},h,{slots:o,slotProps:i}));return _.jsx(u,F({},g))}),OKe=e=>{const t=j7e(e),{forwardedProps:n,internalProps:r}=HB(t,"time");return zB({forwardedProps:n,internalProps:r,valueManager:ao,fieldValueManager:FB,validator:B0,valueType:"time"})},kKe=["slots","slotProps","InputProps","inputProps"],Fae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiTimeField"}),{slots:o,slotProps:i,InputProps:a,inputProps:s}=r,l=We(r,kKe),c=r,u=(o==null?void 0:o.textField)??(t.enableAccessibleFieldDOMStructure?GB:tn),d=Pn({elementType:u,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});d.inputProps=F({},s,d.inputProps),d.InputProps=F({},a,d.InputProps);const f=OKe(d),h=qB(f),g=VB(F({},h,{slots:o,slotProps:i}));return _.jsx(u,F({},g))}),MKe=e=>{const t=B7e(e),{forwardedProps:n,internalProps:r}=HB(t,"date-time");return zB({forwardedProps:n,internalProps:r,valueManager:ao,fieldValueManager:FB,validator:LT,valueType:"date-time"})},AKe=["slots","slotProps","InputProps","inputProps"],jae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDateTimeField"}),{slots:o,slotProps:i,InputProps:a,inputProps:s}=r,l=We(r,AKe),c=r,u=(o==null?void 0:o.textField)??(t.enableAccessibleFieldDOMStructure?GB:tn),d=Pn({elementType:u,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});d.inputProps=F({},s,d.inputProps),d.InputProps=F({},a,d.InputProps);const f=MKe(d),h=qB(f),g=VB(F({},h,{slots:o,slotProps:i}));return _.jsx(u,F({},g))}),Bae=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a,timezone:s})=>{const l=dh();return w.useCallback(c=>Wy({adapter:l,value:c,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a}})!==null,[l,e,t,n,r,o,i,a,s])},RKe=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return F({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const i=o.newTimezone;if(n.getTimezone(r.currentMonth)===i)return r;let a=n.setTimezone(r.currentMonth,i);return n.getMonth(a)!==n.getMonth(r.currentMonth)&&(a=n.setMonth(a,n.getMonth(r.currentMonth))),F({},r,{currentMonth:a})}case"finishMonthSwitchingAnimation":return F({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return F({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},DKe=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:i=!1,maxDate:a,minDate:s,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:d}=e,f=In(),h=w.useRef(RKe(!!c,i,f)).current,g=w.useMemo(()=>ao.getInitialReferenceValue({value:t,utils:f,timezone:d,props:e,referenceDate:n,granularity:xl.day}),[n,d]),[y,v]=w.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:f.startOfMonth(g),slideDirection:"left"});w.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:f.getTimezone(g)})},[g,f]);const x=w.useCallback(T=>{v(F({type:"changeMonth"},T)),l&&l(T.newMonth)},[l]),S=w.useCallback(T=>{const O=T;f.isSameMonth(O,y.currentMonth)||x({newMonth:f.startOfMonth(O),direction:f.isAfterDay(O,y.currentMonth)?"left":"right"})},[y.currentMonth,x,f]),C=Bae({shouldDisableDate:u,minDate:s,maxDate:a,disableFuture:r,disablePast:o,timezone:d}),I=w.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]),E=Qe((T,O)=>{C(T)||v({type:"changeFocusedDay",focusedDay:T,withoutMonthSwitchingAnimation:O})});return{referenceDate:g,calendarState:y,changeMonth:S,changeFocusedDay:E,isDateDisabled:C,onMonthSwitchingAnimationEnd:I,handleChangeMonth:x}},_Ke=e=>je("MuiPickersFadeTransitionGroup",e);Be("MuiPickersFadeTransitionGroup",["root"]);const $Ke=e=>{const{classes:t}=e;return Oe({root:["root"]},_Ke,t)},NKe=se(d0,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function zae(e){const t=hn({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,a=$Ke(t),s=Lr();return o?n:_.jsx(NKe,{className:fe(a.root,r),children:_.jsx(jp,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},i)})}const LKe=e=>je("MuiPickersSlideTransition",e),ys=Be("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),FKe=["children","className","reduceAnimations","slideDirection","transKey","classes"],jKe=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Oe(r,LKe,t)},BKe=se(d0,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${ys["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${ys["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${ys.slideEnterActive}`]:t.slideEnterActive},{[`.${ys.slideExit}`]:t.slideExit},{[`.${ys["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${ys["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${ys["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${ys["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${ys.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${ys.slideExit}`]:{transform:"translate(0%)"},[`& .${ys["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${ys["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function zKe(e){const t=hn({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,a=We(t,FKe),s=jKe(t),l=Lr();if(o)return _.jsx("div",{className:fe(s.root,r),children:n});const c={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return _.jsx(BKe,{className:fe(s.root,r),childFactory:u=>w.cloneElement(u,{classNames:c}),role:"presentation",children:_.jsx(RF,F({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},a,{children:n}),i)})}const VKe=e=>je("MuiDayCalendar",e);Be("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const HKe=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],UKe=["ownerState"],WKe=e=>{const{classes:t}=e;return Oe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},VKe,t)},Vae=(Ix+RT*2)*6,GKe=se("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),qKe=se("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),KKe=se(tt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),YKe=se(tt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),QKe=se(tt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>F({},e.typography.caption,{width:Ix,height:Ix,padding:0,margin:`0 ${RT}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),XKe=se("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Vae}),JKe=se(zKe,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:Vae}),ZKe=se("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),eYe=se("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${RT}px 0`,display:"flex",justifyContent:"center"});function tYe(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:a,isViewFocused:s}=e,l=We(e,HKe);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:d,showDaysOutsideCurrentMonth:f,slots:h,slotProps:g,timezone:y}=t,v=In(),x=ph(y),S=r!==null&&v.isSameDay(n,r),C=o.some($=>v.isSameDay($,n)),I=v.isSameDay(n,x),E=(h==null?void 0:h.day)??w7e,T=Pn({elementType:E,externalSlotProps:g==null?void 0:g.day,additionalProps:F({disableHighlightToday:u,showDaysOutsideCurrentMonth:f,role:"gridcell",isAnimating:d,"data-timestamp":v.toJsDate(n).valueOf()},l),ownerState:F({},t,{day:n,selected:C})}),O=We(T,UKe),A=w.useMemo(()=>c||i(n),[c,i,n]),k=w.useMemo(()=>v.getMonth(n)!==a,[v,n,a]),M=w.useMemo(()=>{const $=v.startOfMonth(v.setMonth(n,a));return f?v.isSameDay(n,v.startOfWeek($)):v.isSameDay(n,$)},[a,n,f,v]),R=w.useMemo(()=>{const $=v.endOfMonth(v.setMonth(n,a));return f?v.isSameDay(n,v.endOfWeek($)):v.isSameDay(n,$)},[a,n,f,v]);return _.jsx(E,F({},O,{day:n,disabled:A,autoFocus:s&&S,today:I,outsideCurrentMonth:k,isFirstVisibleCell:M,isLastVisibleCell:R,selected:C,tabIndex:S?0:-1,"aria-selected":C,"aria-current":I?"date":void 0}))}function nYe(e){const t=hn({props:e,name:"MuiDayCalendar"}),n=In(),{onFocusedDayChange:r,className:o,currentMonth:i,selectedDays:a,focusedDay:s,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:d,reduceAnimations:f,renderLoading:h=()=>_.jsx("span",{children:"..."}),slideDirection:g,TransitionProps:y,disablePast:v,disableFuture:x,minDate:S,maxDate:C,shouldDisableDate:I,shouldDisableMonth:E,shouldDisableYear:T,dayOfWeekFormatter:O=Ee=>n.format(Ee,"weekdayShort").charAt(0).toUpperCase(),hasFocus:A,onFocusedViewChange:k,gridLabelId:M,displayWeekNumber:R,fixedWeekNumber:$,autoFocus:L,timezone:z}=t,N=ph(z),B=WKe(t),U=Yn(),G=Bae({shouldDisableDate:I,shouldDisableMonth:E,shouldDisableYear:T,minDate:S,maxDate:C,disablePast:v,disableFuture:x,timezone:z}),H=Co(),[K,q]=Ei({name:"DayCalendar",state:"hasFocus",controlled:A,default:L??!1}),[Y,J]=w.useState(()=>s||N),ie=Qe(Ee=>{d||c(Ee)}),ee=Ee=>{G(Ee)||(r(Ee),J(Ee),k==null||k(!0),q(!0))},te=Qe((Ee,ge)=>{switch(Ee.key){case"ArrowUp":ee(n.addDays(ge,-7)),Ee.preventDefault();break;case"ArrowDown":ee(n.addDays(ge,7)),Ee.preventDefault();break;case"ArrowLeft":{const xe=n.addDays(ge,U?1:-1),Pe=n.addMonths(ge,U?1:-1),_e=vw({utils:n,date:xe,minDate:U?xe:n.startOfMonth(Pe),maxDate:U?n.endOfMonth(Pe):xe,isDateDisabled:G,timezone:z});ee(_e||xe),Ee.preventDefault();break}case"ArrowRight":{const xe=n.addDays(ge,U?-1:1),Pe=n.addMonths(ge,U?-1:1),_e=vw({utils:n,date:xe,minDate:U?n.startOfMonth(Pe):xe,maxDate:U?xe:n.endOfMonth(Pe),isDateDisabled:G,timezone:z});ee(_e||xe),Ee.preventDefault();break}case"Home":ee(n.startOfWeek(ge)),Ee.preventDefault();break;case"End":ee(n.endOfWeek(ge)),Ee.preventDefault();break;case"PageUp":ee(n.addMonths(ge,1)),Ee.preventDefault();break;case"PageDown":ee(n.addMonths(ge,-1)),Ee.preventDefault();break}}),ce=Qe((Ee,ge)=>ee(ge)),ae=Qe((Ee,ge)=>{K&&n.isSameDay(Y,ge)&&(k==null||k(!1))}),ne=n.getMonth(i),ue=n.getYear(i),he=w.useMemo(()=>a.filter(Ee=>!!Ee).map(Ee=>n.startOfDay(Ee)),[n,a]),re=`${ue}-${ne}`,le=w.useMemo(()=>w.createRef(),[re]),me=w.useMemo(()=>{const Ee=n.startOfMonth(i),ge=n.endOfMonth(i);return G(Y)||n.isAfterDay(Y,ge)||n.isBeforeDay(Y,Ee)?vw({utils:n,date:Y,minDate:Ee,maxDate:ge,disablePast:v,disableFuture:x,isDateDisabled:G,timezone:z}):Y},[i,x,v,Y,G,n,z]),Se=w.useMemo(()=>{const Ee=n.getWeekArray(i);let ge=n.addMonths(i,1);for(;$&&Ee.length<$;){const xe=n.getWeekArray(ge),Pe=n.isSameDay(Ee[Ee.length-1][0],xe[0][0]);xe.slice(Pe?1:0).forEach(_e=>{Ee.length<$&&Ee.push(_e)}),ge=n.addMonths(ge,1)}return Ee},[i,$,n]);return _.jsxs(GKe,{role:"grid","aria-labelledby":M,className:B.root,children:[_.jsxs(qKe,{role:"row",className:B.header,children:[R&&_.jsx(YKe,{variant:"caption",role:"columnheader","aria-label":H.calendarWeekNumberHeaderLabel,className:B.weekNumberLabel,children:H.calendarWeekNumberHeaderText}),c9e(n,N).map((Ee,ge)=>_.jsx(KKe,{variant:"caption",role:"columnheader","aria-label":n.format(Ee,"weekday"),className:B.weekDayLabel,children:O(Ee)},ge.toString()))]}),l?_.jsx(XKe,{className:B.loadingContainer,children:h()}):_.jsx(JKe,F({transKey:re,onExited:u,reduceAnimations:f,slideDirection:g,className:fe(o,B.slideTransition)},y,{nodeRef:le,children:_.jsx(ZKe,{ref:le,role:"rowgroup",className:B.monthContainer,children:Se.map((Ee,ge)=>_.jsxs(eYe,{role:"row",className:B.weekContainer,"aria-rowindex":ge+1,children:[R&&_.jsx(QKe,{className:B.weekNumber,role:"rowheader","aria-label":H.calendarWeekNumberAriaLabelText(n.getWeekNumber(Ee[0])),children:H.calendarWeekNumberText(n.getWeekNumber(Ee[0]))}),Ee.map((xe,Pe)=>_.jsx(tYe,{parentProps:t,day:xe,selectedDays:he,focusableDay:me,onKeyDown:te,onFocus:ce,onBlur:ae,onDaySelect:ie,isDateDisabled:G,currentMonthNumber:ne,isViewFocused:K,"aria-colindex":Pe+1},xe.toString()))]},`week-${Ee[0]}`))})}))]})}function rYe(e){return je("MuiPickersMonth",e)}const ZC=Be("MuiPickersMonth",["root","monthButton","disabled","selected"]),oYe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],iYe=e=>{const{disabled:t,selected:n,classes:r}=e;return Oe({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},rYe,r)},aYe=se("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),sYe=se("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${ZC.disabled}`]:t.disabled},{[`&.${ZC.selected}`]:t.selected}]})(({theme:e})=>F({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${ZC.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${ZC.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),lYe=w.memo(function(t){const n=hn({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:o,children:i,disabled:a,selected:s,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:f,onBlur:h,"aria-current":g,"aria-label":y,slots:v,slotProps:x}=n,S=We(n,oYe),C=w.useRef(null),I=iYe(n);On(()=>{var O;r&&((O=C.current)==null||O.focus())},[r]);const E=(v==null?void 0:v.monthButton)??sYe,T=Pn({elementType:E,externalSlotProps:x==null?void 0:x.monthButton,additionalProps:{children:i,disabled:a,tabIndex:c,ref:C,type:"button",role:"radio","aria-current":g,"aria-checked":s,"aria-label":y,onClick:O=>u(O,l),onKeyDown:O=>d(O,l),onFocus:O=>f(O,l),onBlur:O=>h(O,l)},ownerState:n,className:I.monthButton});return _.jsx(aYe,F({className:fe(I.root,o),ownerState:n},S,{children:_.jsx(E,F({},T))}))});function cYe(e){return je("MuiMonthCalendar",e)}Be("MuiMonthCalendar",["root"]);const uYe=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],dYe=e=>{const{classes:t}=e;return Oe({root:["root"]},cYe,t)};function fYe(e,t){const n=In(),r=fh(),o=hn({props:e,name:t});return F({disableFuture:!1,disablePast:!1},o,{minDate:Oi(n,o.minDate,r.minDate),maxDate:Oi(n,o.maxDate,r.maxDate)})}const pYe=se("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:DT,boxSizing:"border-box"}),hYe=w.forwardRef(function(t,n){const r=fYe(t,"MuiMonthCalendar"),{className:o,value:i,defaultValue:a,referenceDate:s,disabled:l,disableFuture:c,disablePast:u,maxDate:d,minDate:f,onChange:h,shouldDisableMonth:g,readOnly:y,autoFocus:v=!1,onMonthFocus:x,hasFocus:S,onFocusedViewChange:C,monthsPerRow:I=3,timezone:E,gridLabelId:T,slots:O,slotProps:A}=r,k=We(r,uYe),{value:M,handleValueChange:R,timezone:$}=Uy({name:"MonthCalendar",timezone:E,value:i,defaultValue:a,referenceDate:s,onChange:h,valueManager:ao}),L=ph($),z=Yn(),N=In(),B=w.useMemo(()=>ao.getInitialReferenceValue({value:M,utils:N,props:r,timezone:$,referenceDate:s,granularity:xl.month}),[]),U=r,G=dYe(U),H=w.useMemo(()=>N.getMonth(L),[N,L]),K=w.useMemo(()=>M!=null?N.getMonth(M):null,[M,N]),[q,Y]=w.useState(()=>K||N.getMonth(B)),[J,ie]=Ei({name:"MonthCalendar",state:"hasFocus",controlled:S,default:v??!1}),ee=Qe(re=>{ie(re),C&&C(re)}),te=w.useCallback(re=>{const le=N.startOfMonth(u&&N.isAfter(L,f)?L:f),me=N.startOfMonth(c&&N.isBefore(L,d)?L:d),Se=N.startOfMonth(re);return N.isBefore(Se,le)||N.isAfter(Se,me)?!0:g?g(Se):!1},[c,u,d,f,L,g,N]),ce=Qe((re,le)=>{if(y)return;const me=N.setMonth(M??B,le);R(me)}),ae=Qe(re=>{te(N.setMonth(M??B,re))||(Y(re),ee(!0),x&&x(re))});w.useEffect(()=>{Y(re=>K!==null&&re!==K?K:re)},[K]);const ne=Qe((re,le)=>{switch(re.key){case"ArrowUp":ae((12+le-3)%12),re.preventDefault();break;case"ArrowDown":ae((12+le+3)%12),re.preventDefault();break;case"ArrowLeft":ae((12+le+(z?1:-1))%12),re.preventDefault();break;case"ArrowRight":ae((12+le+(z?-1:1))%12),re.preventDefault();break}}),ue=Qe((re,le)=>{ae(le)}),he=Qe((re,le)=>{q===le&&ee(!1)});return _.jsx(pYe,F({ref:n,className:fe(G.root,o),ownerState:U,role:"radiogroup","aria-labelledby":T},k,{children:DB(N,M??B).map(re=>{const le=N.getMonth(re),me=N.format(re,"monthShort"),Se=N.format(re,"month"),Ee=le===K,ge=l||te(re);return _.jsx(lYe,{selected:Ee,value:le,onClick:ce,onKeyDown:ne,autoFocus:J&&le===q,disabled:ge,tabIndex:le===q&&!ge?0:-1,onFocus:ue,onBlur:he,"aria-current":H===le?"date":void 0,"aria-label":Se,monthsPerRow:I,slots:O,slotProps:A,children:me},me)})}))});function mYe(e){return je("MuiPickersYear",e)}const e1=Be("MuiPickersYear",["root","yearButton","selected","disabled"]),gYe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],yYe=e=>{const{disabled:t,selected:n,classes:r}=e;return Oe({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},mYe,r)},vYe=se("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),bYe=se("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${e1.disabled}`]:t.disabled},{[`&.${e1.selected}`]:t.selected}]})(({theme:e})=>F({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${e1.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${e1.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),wYe=w.memo(function(t){const n=hn({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:i,disabled:a,selected:s,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:f,onBlur:h,"aria-current":g,slots:y,slotProps:v}=n,x=We(n,gYe),S=w.useRef(null),C=yYe(n);On(()=>{var T;r&&((T=S.current)==null||T.focus())},[r]);const I=(y==null?void 0:y.yearButton)??bYe,E=Pn({elementType:I,externalSlotProps:v==null?void 0:v.yearButton,additionalProps:{children:i,disabled:a,tabIndex:c,ref:S,type:"button",role:"radio","aria-current":g,"aria-checked":s,onClick:T=>u(T,l),onKeyDown:T=>d(T,l),onFocus:T=>f(T,l),onBlur:T=>h(T,l)},ownerState:n,className:C.yearButton});return _.jsx(vYe,F({className:fe(C.root,o),ownerState:n},x,{children:_.jsx(I,F({},E))}))});function xYe(e){return je("MuiYearCalendar",e)}Be("MuiYearCalendar",["root"]);const SYe=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],CYe=e=>{const{classes:t}=e;return Oe({root:["root"]},xYe,t)};function EYe(e,t){const n=In(),r=fh(),o=hn({props:e,name:t});return F({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:Oi(n,o.minDate,r.minDate),maxDate:Oi(n,o.maxDate,r.maxDate)})}const PYe=se("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:DT,maxHeight:G8e,boxSizing:"border-box",position:"relative"}),IYe=w.forwardRef(function(t,n){const r=EYe(t,"MuiYearCalendar"),{autoFocus:o,className:i,value:a,defaultValue:s,referenceDate:l,disabled:c,disableFuture:u,disablePast:d,maxDate:f,minDate:h,onChange:g,readOnly:y,shouldDisableYear:v,onYearFocus:x,hasFocus:S,onFocusedViewChange:C,yearsOrder:I="asc",yearsPerRow:E,timezone:T,gridLabelId:O,slots:A,slotProps:k}=r,M=We(r,SYe),{value:R,handleValueChange:$,timezone:L}=Uy({name:"YearCalendar",timezone:T,value:a,defaultValue:s,referenceDate:l,onChange:g,valueManager:ao}),z=ph(L),N=Yn(),B=In(),U=w.useMemo(()=>ao.getInitialReferenceValue({value:R,utils:B,props:r,timezone:L,referenceDate:l,granularity:xl.year}),[]),G=r,H=CYe(G),K=w.useMemo(()=>B.getYear(z),[B,z]),q=w.useMemo(()=>R!=null?B.getYear(R):null,[R,B]),[Y,J]=w.useState(()=>q||B.getYear(U)),[ie,ee]=Ei({name:"YearCalendar",state:"hasFocus",controlled:S,default:o??!1}),te=Qe(xe=>{ee(xe),C&&C(xe)}),ce=w.useCallback(xe=>{if(d&&B.isBeforeYear(xe,z)||u&&B.isAfterYear(xe,z)||h&&B.isBeforeYear(xe,h)||f&&B.isAfterYear(xe,f))return!0;if(!v)return!1;const Pe=B.startOfYear(xe);return v(Pe)},[u,d,f,h,z,v,B]),ae=Qe((xe,Pe)=>{if(y)return;const _e=B.setYear(R??U,Pe);$(_e)}),ne=Qe(xe=>{ce(B.setYear(R??U,xe))||(J(xe),te(!0),x==null||x(xe))});w.useEffect(()=>{J(xe=>q!==null&&xe!==q?q:xe)},[q]);const ue=I!=="desc"?E*1:E*-1,he=N&&I==="asc"||!N&&I==="desc"?-1:1,re=Qe((xe,Pe)=>{switch(xe.key){case"ArrowUp":ne(Pe-ue),xe.preventDefault();break;case"ArrowDown":ne(Pe+ue),xe.preventDefault();break;case"ArrowLeft":ne(Pe-he),xe.preventDefault();break;case"ArrowRight":ne(Pe+he),xe.preventDefault();break}}),le=Qe((xe,Pe)=>{ne(Pe)}),me=Qe((xe,Pe)=>{Y===Pe&&te(!1)}),Se=w.useRef(null),Ee=cn(n,Se);w.useEffect(()=>{if(o||Se.current===null)return;const xe=Se.current.querySelector('[tabindex="0"]');if(!xe)return;const Pe=xe.offsetHeight,_e=xe.offsetTop,Le=Se.current.clientHeight,de=Se.current.scrollTop,$e=_e+Pe;Pe>Le||_e<de||(Se.current.scrollTop=$e-Le/2-Pe/2)},[o]);const ge=B.getYearRange([h,f]);return I==="desc"&&ge.reverse(),_.jsx(PYe,F({ref:Ee,className:fe(H.root,i),ownerState:G,role:"radiogroup","aria-labelledby":O},M,{children:ge.map(xe=>{const Pe=B.getYear(xe),_e=Pe===q,Le=c||ce(xe);return _.jsx(wYe,{selected:_e,value:Pe,onClick:ae,onKeyDown:re,autoFocus:ie&&Pe===Y,disabled:Le,tabIndex:Pe===Y&&!Le?0:-1,onFocus:le,onBlur:me,"aria-current":K===Pe?"date":void 0,yearsPerRow:E,slots:A,slotProps:k,children:B.format(xe,"year")},B.format(xe,"year"))})}))}),TYe=e=>je("MuiPickersCalendarHeader",e),OYe=Be("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),kYe=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],MYe=["ownerState"],AYe=e=>{const{classes:t}=e;return Oe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},TYe,t)},RYe=se("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),DYe=se("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>F({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),_Ye=se("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),$Ye=se(on,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${OYe.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),NYe=se(O8e,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),LYe=w.forwardRef(function(t,n){const r=Co(),o=In(),i=hn({props:t,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:s,currentMonth:l,disabled:c,disableFuture:u,disablePast:d,maxDate:f,minDate:h,onMonthChange:g,onViewChange:y,view:v,reduceAnimations:x,views:S,labelId:C,className:I,timezone:E,format:T=`${o.formats.month} ${o.formats.year}`}=i,O=We(i,kYe),A=i,k=AYe(i),M=(a==null?void 0:a.switchViewButton)??$Ye,R=Pn({elementType:M,externalSlotProps:s==null?void 0:s.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(v)},ownerState:A,className:k.switchViewButton}),$=(a==null?void 0:a.switchViewIcon)??NYe,L=Pn({elementType:$,externalSlotProps:s==null?void 0:s.switchViewIcon,ownerState:A,className:k.switchViewIcon}),z=We(L,MYe),N=()=>g(o.addMonths(l,1),"left"),B=()=>g(o.addMonths(l,-1),"right"),U=U8e(l,{disableFuture:u,maxDate:f,timezone:E}),G=W8e(l,{disablePast:d,minDate:h,timezone:E}),H=()=>{if(!(S.length===1||!y||c))if(S.length===2)y(S.find(q=>q!==v)||S[0]);else{const q=S.indexOf(v)!==0?0:1;y(S[q])}};if(S.length===1&&S[0]==="year")return null;const K=o.formatByString(l,T);return _.jsxs(RYe,F({},O,{ownerState:A,className:fe(k.root,I),ref:n,children:[_.jsxs(DYe,{role:"presentation",onClick:H,ownerState:A,"aria-live":"polite",className:k.labelContainer,children:[_.jsx(zae,{reduceAnimations:x,transKey:K,children:_.jsx(_Ye,{id:C,ownerState:A,className:k.label,children:K})}),S.length>1&&!c&&_.jsx(M,F({},R,{children:_.jsx($,F({},z))}))]}),_.jsx(jp,{in:v==="day",appear:!x,enter:!x,children:_.jsx(fae,{slots:a,slotProps:s,onGoToPrevious:B,isPreviousDisabled:G,previousLabel:r.previousMonth,onGoToNext:N,isNextDisabled:U,nextLabel:r.nextMonth})})]}))}),FYe="@media (prefers-reduced-motion: reduce)",Xm=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),MK=Xm&&Xm[1]?parseInt(Xm[1],10):null,AK=Xm&&Xm[2]?parseInt(Xm[2],10):null,jYe=MK&&MK<10||AK&&AK<13||!1,Hae=()=>Zd(FYe,{defaultMatches:!1})||jYe,BYe=e=>je("MuiDateCalendar",e);Be("MuiDateCalendar",["root","viewTransitionContainer"]);const zYe=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],VYe=e=>{const{classes:t}=e;return Oe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},BYe,t)};function HYe(e,t){const n=In(),r=fh(),o=Hae(),i=hn({props:e,name:t});return F({},i,{loading:i.loading??!1,disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,openTo:i.openTo??"day",views:i.views??["year","day"],reduceAnimations:i.reduceAnimations??o,renderLoading:i.renderLoading??(()=>_.jsx("span",{children:"..."})),minDate:Oi(n,i.minDate,r.minDate),maxDate:Oi(n,i.maxDate,r.maxDate)})}const UYe=se($T,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:_T}),WYe=se(zae,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),GYe=w.forwardRef(function(t,n){const r=In(),o=Dn(),i=HYe(t,"MuiDateCalendar"),{autoFocus:a,onViewChange:s,value:l,defaultValue:c,referenceDate:u,disableFuture:d,disablePast:f,onChange:h,onYearChange:g,onMonthChange:y,reduceAnimations:v,shouldDisableDate:x,shouldDisableMonth:S,shouldDisableYear:C,view:I,views:E,openTo:T,className:O,disabled:A,readOnly:k,minDate:M,maxDate:R,disableHighlightToday:$,focusedView:L,onFocusedViewChange:z,showDaysOutsideCurrentMonth:N,fixedWeekNumber:B,dayOfWeekFormatter:U,slots:G,slotProps:H,loading:K,renderLoading:q,displayWeekNumber:Y,yearsOrder:J,yearsPerRow:ie,monthsPerRow:ee,timezone:te}=i,ce=We(i,zYe),{value:ae,handleValueChange:ne,timezone:ue}=Uy({name:"DateCalendar",timezone:te,value:l,defaultValue:c,referenceDate:u,onChange:h,valueManager:ao}),{view:he,setView:re,focusedView:le,setFocusedView:me,goToNextView:Se,setValueAndGoToNextView:Ee}=j0({view:I,views:E,openTo:T,onChange:ne,onViewChange:s,autoFocus:a,focusedView:L,onFocusedViewChange:z}),{referenceDate:ge,calendarState:xe,changeFocusedDay:Pe,changeMonth:_e,handleChangeMonth:Le,isDateDisabled:de,onMonthSwitchingAnimationEnd:$e}=DKe({value:ae,referenceDate:u,reduceAnimations:v,onMonthChange:y,minDate:M,maxDate:R,shouldDisableDate:x,disablePast:f,disableFuture:d,timezone:ue}),Ae=A&&ae||M,Ne=A&&ae||R,Ue=`${o}-grid-label`,Ze=le!==null,ut=(G==null?void 0:G.calendarHeader)??LYe,Ye=Pn({elementType:ut,externalSlotProps:H==null?void 0:H.calendarHeader,additionalProps:{views:E,view:he,currentMonth:xe.currentMonth,onViewChange:re,onMonthChange:(un,jn)=>Le({newMonth:un,direction:jn}),minDate:Ae,maxDate:Ne,disabled:A,disablePast:f,disableFuture:d,reduceAnimations:v,timezone:ue,labelId:Ue},ownerState:i}),et=Qe(un=>{const jn=r.startOfMonth(un),dr=r.endOfMonth(un),Bn=de(un)?vw({utils:r,date:un,minDate:r.isBefore(M,jn)?jn:M,maxDate:r.isAfter(R,dr)?dr:R,disablePast:f,disableFuture:d,isDateDisabled:de,timezone:ue}):un;Bn?(Ee(Bn,"finish"),y==null||y(jn)):(Se(),_e(jn)),Pe(Bn,!0)}),Xe=Qe(un=>{const jn=r.startOfYear(un),dr=r.endOfYear(un),Bn=de(un)?vw({utils:r,date:un,minDate:r.isBefore(M,jn)?jn:M,maxDate:r.isAfter(R,dr)?dr:R,disablePast:f,disableFuture:d,isDateDisabled:de,timezone:ue}):un;Bn?(Ee(Bn,"finish"),g==null||g(Bn)):(Se(),_e(jn)),Pe(Bn,!0)}),mt=Qe(un=>ne(un&&CP(r,un,ae??ge),"finish",he));w.useEffect(()=>{ae!=null&&r.isValid(ae)&&_e(ae)},[ae]);const At=i,Bt=VYe(At),gt={disablePast:f,disableFuture:d,maxDate:R,minDate:M},Vt={disableHighlightToday:$,readOnly:k,disabled:A,timezone:ue,gridLabelId:Ue,slots:G,slotProps:H},Mn=w.useRef(he);w.useEffect(()=>{Mn.current!==he&&(le===Mn.current&&me(he,!0),Mn.current=he)},[le,me,he]);const nr=w.useMemo(()=>[ae],[ae]);return _.jsxs(UYe,F({ref:n,className:fe(Bt.root,O),ownerState:At},ce,{children:[_.jsx(ut,F({},Ye,{slots:G,slotProps:H})),_.jsx(WYe,{reduceAnimations:v,className:Bt.viewTransitionContainer,transKey:he,ownerState:At,children:_.jsxs("div",{children:[he==="year"&&_.jsx(IYe,F({},gt,Vt,{value:ae,onChange:Xe,shouldDisableYear:C,hasFocus:Ze,onFocusedViewChange:un=>me("year",un),yearsOrder:J,yearsPerRow:ie,referenceDate:ge})),he==="month"&&_.jsx(hYe,F({},gt,Vt,{hasFocus:Ze,className:O,value:ae,onChange:et,shouldDisableMonth:S,onFocusedViewChange:un=>me("month",un),monthsPerRow:ee,referenceDate:ge})),he==="day"&&_.jsx(nYe,F({},xe,gt,Vt,{onMonthSwitchingAnimationEnd:$e,onFocusedDayChange:Pe,reduceAnimations:v,selectedDays:nr,onSelectedDaysChange:mt,shouldDisableDate:x,shouldDisableMonth:S,shouldDisableYear:C,hasFocus:Ze,onFocusedViewChange:un=>me("day",un),showDaysOutsideCurrentMonth:N,fixedWeekNumber:B,dayOfWeekFormatter:U,displayWeekNumber:Y,loading:K,renderLoading:q}))]})})]}))});function Uae(e){return je("MuiPickersToolbar",e)}const qYe=Be("MuiPickersToolbar",["root","content"]),KYe=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],YYe=e=>{const{classes:t}=e;return Oe({root:["root"],content:["content"]},Uae,t)},QYe=se("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),XYe=se("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),KB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,toolbarTitle:a,hidden:s,titleId:l}=r,c=We(r,KYe),u=r,d=YYe(u);return s?null:_.jsxs(QYe,F({ref:n,className:fe(d.root,i),ownerState:u},c,{children:[_.jsx(tt,{color:"text.secondary",variant:"overline",id:l,children:a}),_.jsx(XYe,{className:d.content,ownerState:u,children:o})]}))});function JYe(e){return je("MuiDatePickerToolbar",e)}Be("MuiDatePickerToolbar",["root","title"]);const ZYe=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],eQe=e=>{const{classes:t}=e;return Oe({root:["root"],title:["title"]},JYe,t)},tQe=se(KB,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),nQe=se(tt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),rQe=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:i,toolbarFormat:a,toolbarPlaceholder:s="––",views:l,className:c}=r,u=We(r,ZYe),d=In(),f=Co(),h=eQe(r),g=w.useMemo(()=>{if(!o)return s;const v=Ox(d,{format:a,views:l},!0);return d.formatByString(o,v)},[o,a,s,d,l]),y=r;return _.jsx(tQe,F({ref:n,toolbarTitle:f.datePickerToolbarTitle,isLandscape:i,className:fe(h.root,c)},u,{children:_.jsx(nQe,{variant:"h4",align:i?"left":"center",ownerState:y,className:h.title,children:g})}))});function Wae(e,t){const n=In(),r=fh(),o=hn({props:e,name:t}),i=w.useMemo(()=>{var a;return((a=o.localeText)==null?void 0:a.toolbarTitle)==null?o.localeText:F({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle})},[o.localeText]);return F({},o,{localeText:i},RB({views:o.views,openTo:o.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:Oi(n,o.minDate,r.minDate),maxDate:Oi(n,o.maxDate,r.maxDate),slots:F({toolbar:rQe},o.slots)})}function oQe(e){return je("MuiPickersPopper",e)}Be("MuiPickersPopper",["root","paper"]);const iQe=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],aQe=e=>{const{classes:t}=e;return Oe({root:["root"],paper:["paper"]},oQe,t)},sQe=se(pf,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),lQe=se(Kr,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function cQe(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function uQe(e,t){const n=w.useRef(!1),r=w.useRef(!1),o=w.useRef(null),i=w.useRef(!1);w.useEffect(()=>{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const a=Qe(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=vr(o.current);if(!o.current||"clientX"in l&&cQe(l,u))return;if(n.current){n.current=!1;return}let d;l.composedPath?d=l.composedPath().indexOf(o.current)>-1:d=!u.documentElement.contains(l.target)||o.current.contains(l.target),!d&&!c&&t(l)}),s=()=>{r.current=!0};return w.useEffect(()=>{if(e){const l=vr(o.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[e,a]),w.useEffect(()=>{if(e){const l=vr(o.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),r.current=!1}}},[e,a]),[o,s,s]}const dQe=w.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:i,paperSlotProps:a,paperClasses:s,onPaperClick:l,onPaperTouchStart:c}=e,u=We(e,iQe),d=F({},o,{placement:r}),f=Pn({elementType:n,externalSlotProps:a,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:s,ownerState:d});return _.jsx(n,F({},u,f,{onClick:h=>{var g;l(h),(g=f.onClick)==null||g.call(f,h)},onTouchStart:h=>{var g;c(h),(g=f.onTouchStart)==null||g.call(f,h)},ownerState:d,children:i}))});function fQe(e){const t=hn({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:o=null,shouldRestoreFocus:i,onBlur:a,onDismiss:s,open:l,role:c,placement:u,slots:d,slotProps:f,reduceAnimations:h}=t;w.useEffect(()=>{function N(B){l&&B.key==="Escape"&&s()}return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[s,l]);const g=w.useRef(null);w.useEffect(()=>{c==="tooltip"||i&&!i()||(l?g.current=Bi(document):g.current&&g.current instanceof HTMLElement&&setTimeout(()=>{g.current instanceof HTMLElement&&g.current.focus()}))},[l,c,i]);const[y,v,x]=uQe(l,a??s),S=w.useRef(null),C=cn(S,o),I=cn(C,y),E=t,T=aQe(E),O=Hae(),A=h??O,k=N=>{N.key==="Escape"&&(N.stopPropagation(),s())},M=(d==null?void 0:d.desktopTransition)??A?jp:Bp,R=(d==null?void 0:d.desktopTrapFocus)??KF,$=(d==null?void 0:d.desktopPaper)??lQe,L=(d==null?void 0:d.popper)??sQe,z=Pn({elementType:L,externalSlotProps:f==null?void 0:f.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:T.root,ownerState:t});return _.jsx(L,F({},z,{children:({TransitionProps:N,placement:B})=>_.jsx(R,F({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},f==null?void 0:f.desktopTrapFocus,{children:_.jsx(M,F({},N,f==null?void 0:f.desktopTransition,{children:_.jsx(dQe,{PaperComponent:$,ownerState:E,popperPlacement:B,ref:I,onPaperClick:v,onPaperTouchStart:x,paperClasses:T.paper,paperSlotProps:f==null?void 0:f.desktopPaper,children:r})}))}))}))}const pQe=({open:e,onOpen:t,onClose:n})=>{const r=w.useRef(typeof e=="boolean").current,[o,i]=w.useState(!1);w.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}},[r,e]);const a=w.useCallback(s=>{r||i(s),s&&t&&t(),!s&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:a}},hQe=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?i?!0:n(r.lastPublishedValue):!1},mQe=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:i}=e,a=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?a&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&i?a?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},gQe=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},yQe=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:i,onChange:a,value:s,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u,referenceDate:d}=e,{current:f}=w.useRef(l),{current:h}=w.useRef(s!==void 0),[g,y]=w.useState(u),v=In(),x=dh(),{isOpen:S,setIsOpen:C}=pQe(e),{timezone:I,value:E,handleValueChange:T}=$B({timezone:u,value:s,defaultValue:f,referenceDate:d,onChange:a,valueManager:t}),[O,A]=w.useState(()=>{let ne;return E!==void 0?ne=E:f!==void 0?ne=f:ne=t.emptyValue,{draft:ne,lastPublishedValue:ne,lastCommittedValue:ne,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),k=t.getTimezone(v,O.draft);g!==u&&(y(u),u&&k&&u!==k&&A(ne=>F({},ne,{draft:t.setTimezone(v,u,ne.draft)})));const{getValidationErrorForNewValue:M}=Oae({props:e,validator:o,timezone:I,value:O.draft,onError:e.onError}),R=Qe(ne=>{const ue={action:ne,dateState:O,hasChanged:Ee=>!t.areValuesEqual(v,ne.value,Ee),isControlled:h,closeOnSelect:c},he=hQe(ue),re=mQe(ue),le=gQe(ue);A(Ee=>F({},Ee,{draft:ne.value,lastPublishedValue:he?ne.value:Ee.lastPublishedValue,lastCommittedValue:re?ne.value:Ee.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let me=null;const Se=()=>(me||(me={validationError:ne.name==="setValueFromField"?ne.context.validationError:M(ne.value)},ne.name==="setValueFromShortcut"&&(me.shortcut=ne.shortcut)),me);he&&T(ne.value,Se()),re&&i&&i(ne.value,Se()),le&&C(!1)});if(O.lastControlledValue!==s){const ne=t.areValuesEqual(v,O.draft,E);A(ue=>F({},ue,{lastControlledValue:s},ne?{}:{lastCommittedValue:E,lastPublishedValue:E,draft:E,hasBeenModifiedSinceMount:!0}))}const $=Qe(()=>{R({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),L=Qe(()=>{R({value:O.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),z=Qe(()=>{R({value:O.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),N=Qe(()=>{R({value:O.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),B=Qe(()=>{R({value:t.getTodayValue(v,I,n),name:"setValueFromAction",pickerAction:"today"})}),U=Qe(ne=>{ne.preventDefault(),C(!0)}),G=Qe(ne=>{ne==null||ne.preventDefault(),C(!1)}),H=Qe((ne,ue="partial")=>R({name:"setValueFromView",value:ne,selectionState:ue})),K=Qe((ne,ue,he)=>R({name:"setValueFromShortcut",value:ne,changeImportance:ue,shortcut:he})),q=Qe((ne,ue)=>R({name:"setValueFromField",value:ne,context:ue})),Y={onClear:$,onAccept:L,onDismiss:z,onCancel:N,onSetToday:B,onOpen:U,onClose:G},J={value:O.draft,onChange:q},ie=w.useMemo(()=>t.cleanValue(v,O.draft),[v,t,O.draft]),ee={value:ie,onChange:H,onClose:G,open:S},ce=F({},Y,{value:ie,onChange:H,onSelectShortcut:K,isValid:ne=>{const ue=o({adapter:x,value:ne,timezone:I,props:e});return!t.hasError(ue)}}),ae=w.useMemo(()=>({onOpen:U,onClose:G,open:S}),[S,G,U]);return{open:S,fieldProps:J,viewProps:ee,layoutProps:ce,actions:Y,contextValue:ae}},vQe=["className","sx"],bQe=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:o,fieldRef:i})=>{const{onChange:a,open:s,onClose:l}=t,{view:c,views:u,openTo:d,onViewChange:f,viewRenderers:h,timezone:g}=e,y=We(e,vQe),{view:v,setView:x,defaultView:S,focusedView:C,setFocusedView:I,setValueAndGoToNextView:E}=j0({view:c,views:u,openTo:d,onChange:a,onViewChange:f,autoFocus:r}),{hasUIView:T,viewModeLookup:O}=w.useMemo(()=>u.reduce((z,N)=>{let B;return h[N]!=null?B="UI":B="field",z.viewModeLookup[N]=B,B==="UI"&&(z.hasUIView=!0),z},{hasUIView:!1,viewModeLookup:{}}),[h,u]),A=w.useMemo(()=>u.reduce((z,N)=>h[N]!=null&&Qg(N)?z+1:z,0),[h,u]),k=O[v],M=Qe(()=>k==="UI"),[R,$]=w.useState(k==="UI"?v:null);return R!==v&&O[v]==="UI"&&$(v),On(()=>{k==="field"&&s&&(l(),setTimeout(()=>{var z,N;(z=i==null?void 0:i.current)==null||z.setSelectedSections(v),(N=i==null?void 0:i.current)==null||N.focusField(v)}))},[v]),On(()=>{if(!s)return;let z=v;k==="field"&&R!=null&&(z=R),z!==S&&O[z]==="UI"&&O[S]==="UI"&&(z=S),z!==v&&x(z),I(z,!0)},[s]),{hasUIView:T,shouldRestoreFocus:M,layoutProps:{views:u,view:R,onViewChange:x},renderCurrentView:()=>{if(R==null)return null;const z=h[R];if(z==null)return null;const N=F({},y,n,t,{views:u,timezone:g,onChange:E,view:R,onViewChange:x,focusedView:C,onFocusedViewChange:I,showViewSwitcher:A>1,timeViewsCount:A});return o?o(h,R,N):z(N)}}};function RK(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const wQe=(e,t)=>{const[n,r]=w.useState(RK);return On(()=>{const i=()=>{r(RK())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),bm(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},xQe=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,i=wQe(n.views,o),a=Yn();return{layoutProps:F({},n,t,{isLandscape:i,isRtl:a,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function SQe(e){const{props:t,pickerValueResponse:n}=e;return w.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const Gae=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:i,autoFocusView:a,rendererInterceptor:s,fieldRef:l})=>{const c=yQe({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i}),u=bQe({props:e,additionalViewProps:o,autoFocusView:a,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:s}),d=xQe({props:e,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),f=SQe({props:e,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:d.layoutProps,contextValue:c.contextValue,ownerState:f}};function qae(e){return je("MuiPickersLayout",e)}const bl=Be("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),CQe=["onAccept","onClear","onCancel","onSetToday","actions"];function EQe(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:i}=e,a=We(e,CQe),s=Co();if(i==null||i.length===0)return null;const l=i==null?void 0:i.map(c=>{switch(c){case"clear":return _.jsx(at,{onClick:n,children:s.clearButtonLabel},c);case"cancel":return _.jsx(at,{onClick:r,children:s.cancelButtonLabel},c);case"accept":return _.jsx(at,{onClick:t,children:s.okButtonLabel},c);case"today":return _.jsx(at,{onClick:o,children:s.todayButtonLabel},c);default:return null}});return _.jsx(Nw,F({},a,{children:l}))}const PQe=["items","changeImportance","isLandscape","onChange","isValid"],IQe=["getValue"];function TQe(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,i=We(e,PQe);if(t==null||t.length===0)return null;const a=t.map(s=>{let{getValue:l}=s,c=We(s,IQe);const u=l({isValid:o});return F({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!o(u)})});return _.jsx(xa,F({dense:!0,sx:[{maxHeight:_T,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:a.map(s=>_.jsx(Ka,{children:_.jsx(Pu,F({},s))},s.id??s.label))}))}function OQe(e){return e.view!==null}const kQe=e=>{const{classes:t,isLandscape:n}=e;return Oe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},qae,t)},Kae=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:i,view:a,views:s,onViewChange:l,value:c,onChange:u,onSelectShortcut:d,isValid:f,isLandscape:h,disabled:g,readOnly:y,children:v,slots:x,slotProps:S}=e,C=kQe(e),I=(x==null?void 0:x.actionBar)??EQe,E=Pn({elementType:I,externalSlotProps:S==null?void 0:S.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:i,actions:t==="desktop"?[]:["cancel","accept"]},className:C.actionBar,ownerState:F({},e,{wrapperVariant:t})}),T=_.jsx(I,F({},E)),O=x==null?void 0:x.toolbar,A=Pn({elementType:O,externalSlotProps:S==null?void 0:S.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:a,onViewChange:l,views:s,disabled:g,readOnly:y},className:C.toolbar,ownerState:F({},e,{wrapperVariant:t})}),k=OQe(A)&&O?_.jsx(O,F({},A)):null,M=v,R=x==null?void 0:x.tabs,$=a&&R?_.jsx(R,F({view:a,onViewChange:l,className:C.tabs},S==null?void 0:S.tabs)):null,L=(x==null?void 0:x.shortcuts)??TQe,z=Pn({elementType:L,externalSlotProps:S==null?void 0:S.shortcuts,additionalProps:{isValid:f,isLandscape:h,onChange:d},className:C.shortcuts,ownerState:{isValid:f,isLandscape:h,onChange:d,wrapperVariant:t}}),N=a&&L?_.jsx(L,F({},z)):null;return{toolbar:k,content:M,tabs:$,actionBar:T,shortcuts:N}},MQe=e=>{const{isLandscape:t,classes:n}=e;return Oe({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},qae,n)},Yae=se("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${bl.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${bl.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${bl.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${bl.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${bl.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${bl.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${bl.shortcuts}`]:{gridColumn:3}}}]}),Qae=se("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Xae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:i,tabs:a,actionBar:s,shortcuts:l}=Kae(r),{sx:c,className:u,isLandscape:d,wrapperVariant:f}=r,h=MQe(r);return _.jsxs(Yae,{ref:n,sx:c,className:fe(h.root,u),ownerState:r,children:[d?l:o,d?o:l,_.jsx(Qae,{className:h.contentWrapper,children:f==="desktop"?_.jsxs(w.Fragment,{children:[i,a]}):_.jsxs(w.Fragment,{children:[a,i]})}),s]})}),AQe=["props","getOpenDialogAriaText"],RQe=["ownerState"],DQe=["ownerState"],YB=e=>{var Se;let{props:t,getOpenDialogAriaText:n}=e,r=We(e,AQe);const{slots:o,slotProps:i,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,name:g,label:y,inputRef:v,readOnly:x,disabled:S,autoFocus:C,localeText:I,reduceAnimations:E}=t,T=w.useRef(null),O=w.useRef(null),A=Dn(),k=((Se=i==null?void 0:i.toolbar)==null?void 0:Se.hidden)??!1,{open:M,actions:R,hasUIView:$,layoutProps:L,renderCurrentView:z,shouldRestoreFocus:N,fieldProps:B,contextValue:U,ownerState:G}=Gae(F({},r,{props:t,fieldRef:O,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),H=o.inputAdornment??ro,K=Pn({elementType:H,externalSlotProps:i==null?void 0:i.inputAdornment,additionalProps:{position:"end"},ownerState:t}),q=We(K,RQe),Y=o.openPickerButton??on,J=Pn({elementType:Y,externalSlotProps:i==null?void 0:i.openPickerButton,additionalProps:{disabled:S||x,onClick:M?R.onClose:R.onOpen,"aria-label":n(B.value),edge:q.position},ownerState:t}),ie=We(J,DQe),ee=o.openPickerIcon,te=Pn({elementType:ee,externalSlotProps:i==null?void 0:i.openPickerIcon,ownerState:G}),ce=o.field,ae=Pn({elementType:ce,externalSlotProps:i==null?void 0:i.field,additionalProps:F({},B,k&&{id:A},{readOnly:x,disabled:S,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,label:y,name:g,autoFocus:C&&!t.open,focused:M?!0:void 0},v?{inputRef:v}:{}),ownerState:t});$&&(ae.InputProps=F({},ae.InputProps,{ref:T},!t.disableOpenPicker&&{[`${q.position}Adornment`]:_.jsx(H,F({},q,{children:_.jsx(Y,F({},ie,{children:_.jsx(ee,F({},te))}))}))}));const ne=F({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},ae.slots),ue=o.layout??Xae;let he=A;k&&(y?he=`${A}-label`:he=void 0);const re=F({},i,{toolbar:F({},i==null?void 0:i.toolbar,{titleId:A}),popper:F({"aria-labelledby":he},i==null?void 0:i.popper)}),le=cn(O,ae.unstableFieldRef);return{renderPicker:()=>_.jsxs(kae,{contextValue:U,localeText:I,children:[_.jsx(ce,F({},ae,{slots:ne,slotProps:re,unstableFieldRef:le})),_.jsx(fQe,F({role:"dialog",placement:"bottom-start",anchorEl:T.current},R,{open:M,slots:o,slotProps:re,shouldRestoreFocus:N,reduceAnimations:E,children:_.jsx(ue,F({},L,re==null?void 0:re.layout,{slots:o,slotProps:re,children:z()}))}))]})}},Bs=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minDate:h,maxDate:g,shouldDisableDate:y,shouldDisableMonth:v,shouldDisableYear:x,reduceAnimations:S,onMonthChange:C,monthsPerRow:I,onYearChange:E,yearsOrder:T,yearsPerRow:O,slots:A,slotProps:k,loading:M,renderLoading:R,disableHighlightToday:$,readOnly:L,disabled:z,showDaysOutsideCurrentMonth:N,dayOfWeekFormatter:B,sx:U,autoFocus:G,fixedWeekNumber:H,displayWeekNumber:K,timezone:q})=>_.jsx(GYe,{view:e,onViewChange:t,views:n.filter(Jg),focusedView:r&&Jg(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minDate:h,maxDate:g,shouldDisableDate:y,shouldDisableMonth:v,shouldDisableYear:x,reduceAnimations:S,onMonthChange:C,monthsPerRow:I,onYearChange:E,yearsOrder:T,yearsPerRow:O,slots:A,slotProps:k,loading:M,renderLoading:R,disableHighlightToday:$,readOnly:L,disabled:z,showDaysOutsideCurrentMonth:N,dayOfWeekFormatter:B,sx:U,autoFocus:G,fixedWeekNumber:H,displayWeekNumber:K,timezone:q}),Jae=w.forwardRef(function(t,n){var c,u;const r=Co(),o=In(),i=Wae(t,"MuiDesktopDatePicker"),a=F({day:Bs,month:Bs,year:Bs},i.viewRenderers),s=F({},i,{viewRenderers:a,format:Ox(o,i,!1),yearsPerRow:i.yearsPerRow??4,slots:F({openPickerIcon:dae,field:Lae},i.slots),slotProps:F({},i.slotProps,{field:d=>{var f;return F({},Cu((f=i.slotProps)==null?void 0:f.field,d),Gy(i),{ref:n})},toolbar:F({hidden:!0},(c=i.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=YB({props:s,valueManager:ao,valueType:"date",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(u=s.localeText)==null?void 0:u.openDatePickerDialogue}),validator:Wy});return l()});Jae.propTypes={autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,minDate:V.object,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","month","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["day","month","year"]),viewRenderers:V.shape({day:V.func,month:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","month","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const _Qe=se($w)({[`& .${iw.container}`]:{outline:0},[`& .${iw.paper}`]:{outline:0,minWidth:DT}}),$Qe=se(Lw)({"&:first-of-type":{padding:0}});function NQe(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:i}=e,a=(o==null?void 0:o.dialog)??_Qe,s=(o==null?void 0:o.mobileTransition)??jp;return _.jsx(a,F({open:r,onClose:n},i==null?void 0:i.dialog,{TransitionComponent:s,TransitionProps:i==null?void 0:i.mobileTransition,PaperComponent:o==null?void 0:o.mobilePaper,PaperProps:i==null?void 0:i.mobilePaper,children:_.jsx($Qe,{children:t})}))}const LQe=["props","getOpenDialogAriaText"],QB=e=>{var q;let{props:t,getOpenDialogAriaText:n}=e,r=We(e,LQe);const{slots:o,slotProps:i,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,name:g,label:y,inputRef:v,readOnly:x,disabled:S,localeText:C}=t,I=w.useRef(null),E=Dn(),T=((q=i==null?void 0:i.toolbar)==null?void 0:q.hidden)??!1,{open:O,actions:A,layoutProps:k,renderCurrentView:M,fieldProps:R,contextValue:$}=Gae(F({},r,{props:t,fieldRef:I,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),L=o.field,z=Pn({elementType:L,externalSlotProps:i==null?void 0:i.field,additionalProps:F({},R,T&&{id:E},!(S||x)&&{onClick:A.onOpen,onKeyDown:K9e(A.onOpen)},{readOnly:x??!0,disabled:S,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,label:y,name:g},v?{inputRef:v}:{}),ownerState:t});z.inputProps=F({},z.inputProps,{"aria-label":n(R.value)});const N=F({textField:o.textField},z.slots),B=o.layout??Xae;let U=E;T&&(y?U=`${E}-label`:U=void 0);const G=F({},i,{toolbar:F({},i==null?void 0:i.toolbar,{titleId:E}),mobilePaper:F({"aria-labelledby":U},i==null?void 0:i.mobilePaper)}),H=cn(I,z.unstableFieldRef);return{renderPicker:()=>_.jsxs(kae,{contextValue:$,localeText:C,children:[_.jsx(L,F({},z,{slots:N,slotProps:G,unstableFieldRef:H})),_.jsx(NQe,F({},A,{open:O,slots:o,slotProps:G,children:_.jsx(B,F({},k,G==null?void 0:G.layout,{slots:o,slotProps:G,children:M()}))}))]})}},Zae=w.forwardRef(function(t,n){var c,u;const r=Co(),o=In(),i=Wae(t,"MuiMobileDatePicker"),a=F({day:Bs,month:Bs,year:Bs},i.viewRenderers),s=F({},i,{viewRenderers:a,format:Ox(o,i,!1),slots:F({field:Lae},i.slots),slotProps:F({},i.slotProps,{field:d=>{var f;return F({},Cu((f=i.slotProps)==null?void 0:f.field,d),Gy(i),{ref:n})},toolbar:F({hidden:!1},(c=i.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=QB({props:s,valueManager:ao,valueType:"date",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(u=s.localeText)==null?void 0:u.openDatePickerDialogue}),validator:Wy});return l()});Zae.propTypes={autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,minDate:V.object,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","month","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["day","month","year"]),viewRenderers:V.shape({day:V.func,month:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","month","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const FQe=["desktopModeMediaQuery"],kx=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=BB}=r,i=We(r,FQe);return Zd(o,{defaultMatches:!0})?_.jsx(Jae,F({ref:n},i)):_.jsx(Zae,F({ref:n},i))});function jQe(e){return je("MuiPickersToolbarText",e)}const yL=Be("MuiPickersToolbarText",["root","selected"]),BQe=["className","selected","value"],zQe=e=>{const{classes:t,selected:n}=e;return Oe({root:["root",n&&"selected"]},jQe,t)},VQe=se(tt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${yL.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${yL.selected}`]:{color:(e.vars||e).palette.text.primary}})),XB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersToolbarText"}),{className:o,value:i}=r,a=We(r,BQe),s=zQe(r);return _.jsx(VQe,F({ref:n,className:fe(s.root,o),component:"span"},a,{children:i}))}),HQe=["align","className","selected","typographyClassName","value","variant","width"],UQe=e=>{const{classes:t}=e;return Oe({root:["root"]},Uae,t)},WQe=se(at,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),Da=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersToolbarButton"}),{align:o,className:i,selected:a,typographyClassName:s,value:l,variant:c,width:u}=r,d=We(r,HQe),f=UQe(r);return _.jsx(WQe,F({variant:"text",ref:n,className:fe(f.root,i)},u?{sx:{width:u}}:{},d,{children:_.jsx(XB,{align:o,className:s,variant:c,value:l,selected:a})}))});function GQe(e){return je("MuiTimePickerToolbar",e)}const bw=Be("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),qQe=["ampm","ampmInClock","value","isLandscape","onChange","view","onViewChange","views","disabled","readOnly","className"],KQe=e=>{const{isLandscape:t,classes:n,isRtl:r}=e;return Oe({root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",t&&"hourMinuteLabelLandscape",r&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",t&&"ampmLandscape"],ampmLabel:["ampmLabel"]},GQe,n)},YQe=se(KB,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),QQe=se(XB,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),XQe=se("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(e,t)=>[{[`&.${bw.hourMinuteLabelLandscape}`]:t.hourMinuteLabelLandscape,[`&.${bw.hourMinuteLabelReverse}`]:t.hourMinuteLabelReverse},t.hourMinuteLabel]})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{isLandscape:!0},style:{marginTop:"auto"}}]}),JQe=se("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${bw.ampmLabel}`]:t.ampmLabel},{[`&.${bw.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${bw.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"}}]});function ZQe(e){const t=hn({props:e,name:"MuiTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:o,isLandscape:i,onChange:a,view:s,onViewChange:l,views:c,disabled:u,readOnly:d,className:f}=t,h=We(t,qQe),g=In(),y=Co(),v=Yn(),x=!!(n&&!r&&c.includes("hours")),{meridiemMode:S,handleMeridiemChange:C}=AT(o,n,a),I=A=>n?g.format(A,"hours12h"):g.format(A,"hours24h"),E=F({},t,{isRtl:v}),T=KQe(E),O=_.jsx(QQe,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:T.separator});return _.jsxs(YQe,F({landscapeDirection:"row",toolbarTitle:y.timePickerToolbarTitle,isLandscape:i,ownerState:E,className:fe(T.root,f)},h,{children:[_.jsxs(XQe,{className:T.hourMinuteLabel,ownerState:E,children:[bm(c,"hours")&&_.jsx(Da,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:s==="hours",value:o?I(o):"--"}),bm(c,["hours","minutes"])&&O,bm(c,"minutes")&&_.jsx(Da,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:s==="minutes",value:o?g.format(o,"minutes"):"--"}),bm(c,["minutes","seconds"])&&O,bm(c,"seconds")&&_.jsx(Da,{variant:"h3",onClick:()=>l("seconds"),selected:s==="seconds",value:o?g.format(o,"seconds"):"--"})]}),x&&_.jsxs(JQe,{className:T.ampmSelection,ownerState:E,children:[_.jsx(Da,{disableRipple:!0,variant:"subtitle2",selected:S==="am",typographyClassName:T.ampmLabel,value:Il(g,"am"),onClick:d?void 0:()=>C("am"),disabled:u}),_.jsx(Da,{disableRipple:!0,variant:"subtitle2",selected:S==="pm",typographyClassName:T.ampmLabel,value:Il(g,"pm"),onClick:d?void 0:()=>C("pm"),disabled:u})]})]}))}function ese(e,t){var a;const n=In(),r=hn({props:e,name:t}),o=r.ampm??n.is12HourCycleInCurrentLocale(),i=w.useMemo(()=>{var s;return((s=r.localeText)==null?void 0:s.toolbarTitle)==null?r.localeText:F({},r.localeText,{timePickerToolbarTitle:r.localeText.toolbarTitle})},[r.localeText]);return F({},r,{ampm:o,localeText:i},RB({views:r.views,openTo:r.openTo,defaultViews:["hours","minutes"],defaultOpenTo:"hours"}),{disableFuture:r.disableFuture??!1,disablePast:r.disablePast??!1,slots:F({toolbar:ZQe},r.slots),slotProps:F({},r.slotProps,{toolbar:F({ampm:o,ampmInClock:r.ampmInClock},(a=r.slotProps)==null?void 0:a.toolbar)})})}const Jm=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,ampmInClock:S,slots:C,slotProps:I,readOnly:E,disabled:T,sx:O,autoFocus:A,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:M,timezone:R})=>_.jsx(W9e,{view:e,onViewChange:t,focusedView:n&&Qg(n)?n:null,onFocusedViewChange:r,views:o.filter(Qg),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,ampmInClock:S,slots:C,slotProps:I,readOnly:E,disabled:T,sx:O,autoFocus:A,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:M,timezone:R}),tse=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeSteps:k,skipDisabled:M,timezone:R})=>_.jsx(e7e,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o.filter(Qg),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeStep:k==null?void 0:k.minutes,skipDisabled:M,timezone:R}),PP=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeSteps:k,skipDisabled:M,timezone:R})=>_.jsx(p7e,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o.filter(Qg),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeSteps:k,skipDisabled:M,timezone:R}),eXe=["views","format"],nse=(e,t,n)=>{let{views:r,format:o}=t,i=We(t,eXe);if(o)return o;const a=[],s=[];if(r.forEach(u=>{Qg(u)?s.push(u):Jg(u)&&a.push(u)}),s.length===0)return Ox(e,F({views:a},i),!1);if(a.length===0)return SP(e,F({views:s},i));const l=SP(e,F({views:s},i));return`${Ox(e,F({views:a},i),!1)} ${l}`},tXe=(e,t,n)=>n?t.filter(r=>!Gb(r)||r==="hours"):e?[...t,"meridiem"]:t,nXe=(e,t)=>24*60/((e.hours??1)*(e.minutes??5))<=t;function rse({thresholdToRenderTimeInASingleColumn:e,ampm:t,timeSteps:n,views:r}){const o=e??24,i=F({hours:1,minutes:5,seconds:5},n),a=nXe(i,o);return{thresholdToRenderTimeInASingleColumn:o,timeSteps:i,shouldRenderTimeInASingleColumn:a,views:tXe(t,r,a)}}const ose=w.forwardRef(function(t,n){var x,S,C,I;const r=Co(),o=In(),i=ese(t,"MuiDesktopTimePicker"),{shouldRenderTimeInASingleColumn:a,views:s,timeSteps:l}=rse(i),c=a?tse:PP,u=F({hours:c,minutes:c,seconds:c,meridiem:c},i.viewRenderers),d=i.ampmInClock??!0,f=a?[]:["accept"],g=((x=u.hours)==null?void 0:x.name)===PP.name?s:s.filter(E=>E!=="meridiem"),y=F({},i,{ampmInClock:d,timeSteps:l,viewRenderers:u,format:SP(o,i),views:a?["hours"]:g,slots:F({field:Fae,openPickerIcon:A8e},i.slots),slotProps:F({},i.slotProps,{field:E=>{var T;return F({},Cu((T=i.slotProps)==null?void 0:T.field,E),Gy(i),{ref:n})},toolbar:F({hidden:!0,ampmInClock:d},(S=i.slotProps)==null?void 0:S.toolbar),actionBar:F({actions:f},(C=i.slotProps)==null?void 0:C.actionBar)})}),{renderPicker:v}=YB({props:y,valueManager:ao,valueType:"time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullTime",contextTranslation:r.openTimePickerDialogue,propsTranslation:(I=y.localeText)==null?void 0:I.openTimePickerDialogue}),validator:B0});return v()});ose.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,enableAccessibleFieldDOMStructure:V.any,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,localeText:V.object,maxTime:V.object,minTime:V.object,minutesStep:V.number,name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,open:V.bool,openTo:V.oneOf(["hours","meridiem","minutes","seconds"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableTime:V.func,skipDisabled:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),thresholdToRenderTimeInASingleColumn:V.number,timeSteps:V.shape({hours:V.number,minutes:V.number,seconds:V.number}),timezone:V.string,value:V.object,view:V.oneOf(["hours","meridiem","minutes","seconds"]),viewRenderers:V.shape({hours:V.func,meridiem:V.func,minutes:V.func,seconds:V.func}),views:V.arrayOf(V.oneOf(["hours","minutes","seconds"]).isRequired)};const ise=w.forwardRef(function(t,n){var u,d;const r=Co(),o=In(),i=ese(t,"MuiMobileTimePicker"),a=F({hours:Jm,minutes:Jm,seconds:Jm},i.viewRenderers),s=i.ampmInClock??!1,l=F({},i,{ampmInClock:s,viewRenderers:a,format:SP(o,i),slots:F({field:Fae},i.slots),slotProps:F({},i.slotProps,{field:f=>{var h;return F({},Cu((h=i.slotProps)==null?void 0:h.field,f),Gy(i),{ref:n})},toolbar:F({hidden:!1,ampmInClock:s},(u=i.slotProps)==null?void 0:u.toolbar)})}),{renderPicker:c}=QB({props:l,valueManager:ao,valueType:"time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullTime",contextTranslation:r.openTimePickerDialogue,propsTranslation:(d=l.localeText)==null?void 0:d.openTimePickerDialogue}),validator:B0});return c()});ise.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,enableAccessibleFieldDOMStructure:V.any,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,localeText:V.object,maxTime:V.object,minTime:V.object,minutesStep:V.number,name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,open:V.bool,openTo:V.oneOf(["hours","minutes","seconds"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableTime:V.func,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["hours","minutes","seconds"]),viewRenderers:V.shape({hours:V.func,minutes:V.func,seconds:V.func}),views:V.arrayOf(V.oneOf(["hours","minutes","seconds"]).isRequired)};const rXe=["desktopModeMediaQuery"],vL=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiTimePicker"}),{desktopModeMediaQuery:o=BB}=r,i=We(r,rXe);return Zd(o,{defaultMatches:!0})?_.jsx(ose,F({ref:n},i)):_.jsx(ise,F({ref:n},i))});function oXe(e){return je("MuiDateTimePickerTabs",e)}Be("MuiDateTimePickerTabs",["root"]);const iXe=e=>Jg(e)?"date":"time",aXe=e=>e==="date"?"day":"hours",sXe=e=>{const{classes:t}=e;return Oe({root:["root"]},oXe,t)},lXe=se(Cee,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${E1.indicator}`]:{bottom:"auto",top:0}}})),cXe=function(t){const n=hn({props:t,name:"MuiDateTimePickerTabs"}),{dateIcon:r=_.jsx(R8e,{}),onViewChange:o,timeIcon:i=_.jsx(D8e,{}),view:a,hidden:s=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=Co(),d=sXe(n),f=(h,g)=>{o(aXe(g))};return s?null:_.jsxs(lXe,{ownerState:n,variant:"fullWidth",value:iXe(a),onChange:f,className:fe(l,d.root),sx:c,children:[_.jsx(w2,{value:"date","aria-label":u.dateTableLabel,icon:_.jsx(w.Fragment,{children:r})}),_.jsx(w2,{value:"time","aria-label":u.timeTableLabel,icon:_.jsx(w.Fragment,{children:i})})]})};function uXe(e){return je("MuiDateTimePickerToolbar",e)}const N_=Be("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),dXe=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],fXe=e=>{const{classes:t,isLandscape:n,isRtl:r}=e;return Oe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},uXe,t)},pXe=se(KB,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${qYe.content} .${yL.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),hXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),mXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&t!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&t!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),gXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),DK=se(XB,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),yXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${N_.ampmLabel}`]:t.ampmLabel},{[`&.${N_.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${N_.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function vXe(e){const t=hn({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:o,onChange:i,view:a,isLandscape:s,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:d,disabled:f,readOnly:h,toolbarVariant:g="mobile",toolbarTitle:y,className:v}=t,x=We(t,dXe),S=Yn(),C=F({},t,{isRtl:S}),I=In(),{meridiemMode:E,handleMeridiemChange:T}=AT(o,n,i),O=!!(n&&!r),A=g==="desktop",k=Co(),M=fXe(C),R=y??k.dateTimePickerToolbarTitle,$=z=>n?I.format(z,"hours12h"):I.format(z,"hours24h"),L=w.useMemo(()=>o?c?I.formatByString(o,c):I.format(o,"shortDate"):u,[o,c,u,I]);return _.jsxs(pXe,F({isLandscape:s,className:fe(M.root,v),toolbarTitle:R},x,{ownerState:C,children:[_.jsxs(hXe,{className:M.dateContainer,ownerState:C,children:[d.includes("year")&&_.jsx(Da,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:a==="year",value:o?I.format(o,"year"):"–"}),d.includes("day")&&_.jsx(Da,{tabIndex:-1,variant:A?"h5":"h4",onClick:()=>l("day"),selected:a==="day",value:L})]}),_.jsxs(mXe,{className:M.timeContainer,ownerState:C,children:[_.jsxs(gXe,{className:M.timeDigitsContainer,ownerState:C,children:[d.includes("hours")&&_.jsxs(w.Fragment,{children:[_.jsx(Da,{variant:A?"h5":"h3",width:A&&!s?qb:void 0,onClick:()=>l("hours"),selected:a==="hours",value:o?$(o):"--"}),_.jsx(DK,{variant:A?"h5":"h3",value:":",className:M.separator,ownerState:C}),_.jsx(Da,{variant:A?"h5":"h3",width:A&&!s?qb:void 0,onClick:()=>l("minutes"),selected:a==="minutes"||!d.includes("minutes")&&a==="hours",value:o?I.format(o,"minutes"):"--",disabled:!d.includes("minutes")})]}),d.includes("seconds")&&_.jsxs(w.Fragment,{children:[_.jsx(DK,{variant:A?"h5":"h3",value:":",className:M.separator,ownerState:C}),_.jsx(Da,{variant:A?"h5":"h3",width:A&&!s?qb:void 0,onClick:()=>l("seconds"),selected:a==="seconds",value:o?I.format(o,"seconds"):"--"})]})]}),O&&!A&&_.jsxs(yXe,{className:M.ampmSelection,ownerState:C,children:[_.jsx(Da,{variant:"subtitle2",selected:E==="am",typographyClassName:M.ampmLabel,value:Il(I,"am"),onClick:h?void 0:()=>T("am"),disabled:f}),_.jsx(Da,{variant:"subtitle2",selected:E==="pm",typographyClassName:M.ampmLabel,value:Il(I,"pm"),onClick:h?void 0:()=>T("pm"),disabled:f})]}),n&&A&&_.jsx(Da,{variant:"h5",onClick:()=>l("meridiem"),selected:a==="meridiem",value:o&&E?Il(I,E):"--",width:qb})]})]}))}function ase(e,t){var s;const n=In(),r=fh(),o=hn({props:e,name:t}),i=o.ampm??n.is12HourCycleInCurrentLocale(),a=w.useMemo(()=>{var l;return((l=o.localeText)==null?void 0:l.toolbarTitle)==null?o.localeText:F({},o.localeText,{dateTimePickerToolbarTitle:o.localeText.toolbarTitle})},[o.localeText]);return F({},o,RB({views:o.views,openTo:o.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:i,localeText:a,orientation:o.orientation??"portrait",disableIgnoringDatePartForTimeValidation:o.disableIgnoringDatePartForTimeValidation??!!(o.minDateTime||o.maxDateTime||o.disablePast||o.disableFuture),disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:Oi(n,o.minDateTime??o.minDate,r.minDate),maxDate:Oi(n,o.maxDateTime??o.maxDate,r.maxDate),minTime:o.minDateTime??o.minTime,maxTime:o.maxDateTime??o.maxTime,slots:F({toolbar:vXe,tabs:cXe},o.slots),slotProps:F({},o.slotProps,{toolbar:F({ampm:i},(s=o.slotProps)==null?void 0:s.toolbar)})})}const bXe=w.forwardRef(function(t,n){var y;const r=Yn(),{toolbar:o,tabs:i,content:a,actionBar:s,shortcuts:l}=Kae(t),{sx:c,className:u,isLandscape:d,classes:f}=t,h=s&&(((y=s.props.actions)==null?void 0:y.length)??0)>0,g=F({},t,{isRtl:r});return _.jsxs(Yae,{ref:n,className:fe(bl.root,f==null?void 0:f.root,u),sx:[{[`& .${bl.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${bl.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:g,children:[d?l:o,d?o:l,_.jsxs(Qae,{className:fe(bl.contentWrapper,f==null?void 0:f.contentWrapper),sx:{display:"grid"},children:[a,i,h&&_.jsx(Ti,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),s]})}),wXe=["openTo","focusedView","timeViewsCount"],xXe=function(t,n,r){var u,d;const{openTo:o,focusedView:i,timeViewsCount:a}=r,s=We(r,wXe),l=F({},s,{focusedView:null,sx:[{[`&.${IK.root}`]:{borderBottom:0},[`&.${IK.root}, .${r7e.root}, &.${q9e.root}`]:{maxHeight:_T}}]}),c=Gb(n);return _.jsxs(w.Fragment,{children:[(u=t[c?"day":n])==null?void 0:u.call(t,F({},r,{view:c?"day":n,focusedView:i&&Jg(i)?i:null,views:r.views.filter(Jg),sx:[{gridColumn:1},...l.sx]})),a>0&&_.jsxs(w.Fragment,{children:[_.jsx(Ti,{orientation:"vertical",sx:{gridColumn:2}}),(d=t[c?n:"hours"])==null?void 0:d.call(t,F({},l,{view:c?n:"hours",focusedView:i&&Gb(i)?i:null,openTo:Gb(o)?o:"hours",views:r.views.filter(Gb),sx:[{gridColumn:3},...l.sx]}))]})]})},sse=w.forwardRef(function(t,n){var S,C,I,E;const r=Co(),o=In(),i=ase(t,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:a,thresholdToRenderTimeInASingleColumn:s,views:l,timeSteps:c}=rse(i),u=a?tse:PP,d=F({day:Bs,month:Bs,year:Bs,hours:u,minutes:u,seconds:u,meridiem:u},i.viewRenderers),f=i.ampmInClock??!0,g=((S=d.hours)==null?void 0:S.name)===PP.name?l:l.filter(T=>T!=="meridiem"),y=a?[]:["accept"],v=F({},i,{viewRenderers:d,format:nse(o,i),views:g,yearsPerRow:i.yearsPerRow??4,ampmInClock:f,timeSteps:c,thresholdToRenderTimeInASingleColumn:s,shouldRenderTimeInASingleColumn:a,slots:F({field:jae,layout:bXe,openPickerIcon:dae},i.slots),slotProps:F({},i.slotProps,{field:T=>{var O;return F({},Cu((O=i.slotProps)==null?void 0:O.field,T),Gy(i),{ref:n})},toolbar:F({hidden:!0,ampmInClock:f,toolbarVariant:"desktop"},(C=i.slotProps)==null?void 0:C.toolbar),tabs:F({hidden:!0},(I=i.slotProps)==null?void 0:I.tabs),actionBar:T=>{var O;return F({actions:y},Cu((O=i.slotProps)==null?void 0:O.actionBar,T))}})}),{renderPicker:x}=YB({props:v,valueManager:ao,valueType:"date-time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(E=v.localeText)==null?void 0:E.openDatePickerDialogue}),validator:LT,rendererInterceptor:xXe});return x()});sse.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,maxDateTime:V.object,maxTime:V.object,minDate:V.object,minDateTime:V.object,minTime:V.object,minutesStep:V.number,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableTime:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,skipDisabled:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),thresholdToRenderTimeInASingleColumn:V.number,timeSteps:V.shape({hours:V.number,minutes:V.number,seconds:V.number}),timezone:V.string,value:V.object,view:V.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:V.shape({day:V.func,hours:V.func,meridiem:V.func,minutes:V.func,month:V.func,seconds:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const lse=w.forwardRef(function(t,n){var u,d,f;const r=Co(),o=In(),i=ase(t,"MuiMobileDateTimePicker"),a=F({day:Bs,month:Bs,year:Bs,hours:Jm,minutes:Jm,seconds:Jm},i.viewRenderers),s=i.ampmInClock??!1,l=F({},i,{viewRenderers:a,format:nse(o,i),ampmInClock:s,slots:F({field:jae},i.slots),slotProps:F({},i.slotProps,{field:h=>{var g;return F({},Cu((g=i.slotProps)==null?void 0:g.field,h),Gy(i),{ref:n})},toolbar:F({hidden:!1,ampmInClock:s},(u=i.slotProps)==null?void 0:u.toolbar),tabs:F({hidden:!1},(d=i.slotProps)==null?void 0:d.tabs)})}),{renderPicker:c}=QB({props:l,valueManager:ao,valueType:"date-time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(f=l.localeText)==null?void 0:f.openDatePickerDialogue}),validator:LT});return c()});lse.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,maxDateTime:V.object,maxTime:V.object,minDate:V.object,minDateTime:V.object,minTime:V.object,minutesStep:V.number,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableTime:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:V.shape({day:V.func,hours:V.func,minutes:V.func,month:V.func,seconds:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const SXe=["desktopModeMediaQuery"],CXe=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:o=BB}=r,i=We(r,SXe);return Zd(o,{defaultMatches:!0})?_.jsx(sse,F({ref:n},i)):_.jsx(lse,F({ref:n},i))}),EXe={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyyy:{sectionType:"year",contentType:"digit",maxLength:4},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",c:{sectionType:"weekDay",contentType:"digit",maxLength:1},ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},E:{sectionType:"weekDay",contentType:"digit",maxLength:2},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},PXe={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"d",weekday:"cccc",weekdayShort:"ccccc",hours24h:"HH",hours12h:"hh",meridiem:"a",minutes:"mm",seconds:"ss",fullDate:"DD",keyboardDate:"D",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"t",fullTime12h:"hh:mm a",fullTime24h:"HH:mm",keyboardDateTime:"D t",keyboardDateTime12h:"D hh:mm a",keyboardDateTime24h:"D T"};class pu{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="luxon",this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"'",end:"'"},this.formatTokenMap=EXe,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale?r:r.setLocale(o)},this.date=(r,o="default")=>r===null?null:typeof r>"u"?yt.fromJSDate(new Date,{locale:this.locale,zone:o}):yt.fromISO(r,{locale:this.locale,zone:o}),this.getInvalidDate=()=>yt.fromJSDate(new Date("Invalid Date")),this.getTimezone=r=>r.zone.type==="system"?"system":r.zoneName,this.setTimezone=(r,o)=>r.zone.equals(zb.normalizeZone(o))?r:r.setZone(o),this.toJsDate=r=>r.toJSDate(),this.parse=(r,o)=>r===""?null:yt.fromFormat(r,o,{locale:this.locale}),this.getCurrentLocaleCode=()=>this.locale,this.is12HourCycleInCurrentLocale=()=>{var r,o;return typeof Intl>"u"||typeof Intl.DateTimeFormat>"u"?!0:!!((o=(r=new Intl.DateTimeFormat(this.locale,{hour:"numeric"}))==null?void 0:r.resolvedOptions())!=null&&o.hour12)},this.expandFormat=r=>{const o=/''|'(''|[^'])+('|$)|[^']*/g,i=[...Object.keys(this.formatTokenMap),"yyyyy"],a=new RegExp(`^(${i.join("|")})+$`),s=/(?:^|[^a-z])([a-z]+)(?:[^a-z]|$)|([a-z]+)/gi;return r.match(o).map(l=>l[0]==="'"?l:yt.expandFormat(l,{locale:this.locale}).replace(s,(d,f,h)=>{const g=f||h;return a.test(g)?d:`'${d}'`})).join("").replace("yyyyy","yyyy")},this.isValid=r=>r===null?!1:r.isValid,this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>r.setLocale(this.locale).toFormat(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:+r==+o,this.isSameYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"year")},this.isSameMonth=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"month")},this.isSameDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"day")},this.isSameHour=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"hour")},this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.endOfYear(i),"years").toObject().years>0},this.isAfterDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.endOfDay(i),"days").toObject().days>0},this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.startOfYear(i),"years").toObject().years<0},this.isBeforeDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.startOfDay(i),"days").toObject().days<0},this.isWithinRange=(r,[o,i])=>this.isEqual(r,o)||this.isEqual(r,i)||this.isAfter(r,o)&&this.isBefore(r,i),this.startOfYear=r=>r.startOf("year"),this.startOfMonth=r=>r.startOf("month"),this.startOfWeek=r=>this.setLocaleToValue(r).startOf("week",{useLocaleWeeks:!0}),this.startOfDay=r=>r.startOf("day"),this.endOfYear=r=>r.endOf("year"),this.endOfMonth=r=>r.endOf("month"),this.endOfWeek=r=>this.setLocaleToValue(r).endOf("week",{useLocaleWeeks:!0}),this.endOfDay=r=>r.endOf("day"),this.addYears=(r,o)=>r.plus({years:o}),this.addMonths=(r,o)=>r.plus({months:o}),this.addWeeks=(r,o)=>r.plus({weeks:o}),this.addDays=(r,o)=>r.plus({days:o}),this.addHours=(r,o)=>r.plus({hours:o}),this.addMinutes=(r,o)=>r.plus({minutes:o}),this.addSeconds=(r,o)=>r.plus({seconds:o}),this.getYear=r=>r.get("year"),this.getMonth=r=>r.get("month")-1,this.getDate=r=>r.get("day"),this.getHours=r=>r.get("hour"),this.getMinutes=r=>r.get("minute"),this.getSeconds=r=>r.get("second"),this.getMilliseconds=r=>r.get("millisecond"),this.setYear=(r,o)=>r.set({year:o}),this.setMonth=(r,o)=>r.set({month:o+1}),this.setDate=(r,o)=>r.set({day:o}),this.setHours=(r,o)=>r.set({hour:o}),this.setMinutes=(r,o)=>r.set({minute:o}),this.setSeconds=(r,o)=>r.set({second:o}),this.setMilliseconds=(r,o)=>r.set({millisecond:o}),this.getDaysInMonth=r=>r.daysInMonth,this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),i=this.endOfWeek(this.endOfMonth(r)),{days:a}=i.diff(o,"days").toObject(),s=[];return new Array(Math.round(a)).fill(0).map((l,c)=>c).map(l=>o.plus({days:l})).forEach((l,c)=>{if(c===0||c%7===0&&c>6){s.push([l]);return}s[s.length-1].push(l)}),s},this.getWeekNumber=r=>r.localWeekNumber??r.weekNumber,this.getDayOfWeek=r=>r.weekday,this.getYearRange=([r,o])=>{const i=this.startOfYear(r),a=this.endOfYear(o),s=[];let l=i;for(;this.isBefore(l,a);)s.push(l),l=this.addYears(l,1);return s},this.locale=t||"en-US",this.formats=F({},PXe,n)}}const JB=Je(_.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");function ZB({callback:e,initialIngredient:t}){const n=t?{value:t,data:{id:-1,name:t,image:null,image_thumbnail:null}}:null,[r,o]=w.useState(!0),[i,a]=w.useState(n),[s,l]=w.useState(""),[c,u]=w.useState([]),[d,f]=Re(),h=w.useMemo(()=>sT(g=>Qke(g,f.language,r).then(y=>u(y)),200),[f.language,r]);return w.useEffect(()=>{if(s===""){u(i?[i]:[]);return}return h(s),()=>{}},[i,s,h]),Q(_t,{children:[b($l,{id:"ingredient-autocomplete",getOptionLabel:g=>g.value,"data-testid":"autocomplete",filterOptions:g=>g,options:c,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:i,noOptionsText:d("noResults"),isOptionEqualToValue:(g,y)=>g.value===y.value,onChange:(g,y)=>{u(y?[y,...c]:c),a(y),e(y)},onInputChange:(g,y)=>{l(y)},renderInput:g=>b(tn,{...g,label:d("nutrition.searchIngredientName"),fullWidth:!0,InputProps:{...g.InputProps,startAdornment:Q(xt,{children:[b(ro,{position:"start",children:b(JB,{})}),g.InputProps.startAdornment]})}}),renderOption:(g,y)=>gF("li",{...g,key:`ingredient-${y.data.id}`},Q(Ka,{disablePadding:!0,component:"div",children:[b(si,{children:b(Nl,{alt:"",src:`${cj}${y.data.image}`,variant:"rounded",children:b(_u,{})})}),b(uo,{primary:y.value,primaryTypographyProps:{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})]}))}),f.language!==bg&&b(Fw,{children:b(ba,{control:b(li,{checked:r,onChange:(g,y)=>o(y)}),label:d("alsoSearchEnglish")})})]})}var IXe=function(t){return TXe(t)&&!OXe(t)};function TXe(e){return!!e&&typeof e=="object"}function OXe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||AXe(e)}var kXe=typeof Symbol=="function"&&Symbol.for,MXe=kXe?Symbol.for("react.element"):60103;function AXe(e){return e.$$typeof===MXe}function RXe(e){return Array.isArray(e)?[]:{}}function IP(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Mx(RXe(e),e,t):e}function DXe(e,t,n){return e.concat(t).map(function(r){return IP(r,n)})}function _Xe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=IP(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=IP(t[o],n):r[o]=Mx(e[o],t[o],n)}),r}function Mx(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||DXe,n.isMergeableObject=n.isMergeableObject||IXe;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):_Xe(e,t,n):IP(t,n)}Mx.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Mx(r,o,n)},{})};var bL=Mx,cse=typeof global=="object"&&global&&global.Object===Object&&global,$Xe=typeof self=="object"&&self&&self.Object===Object&&self,Dc=cse||$Xe||Function("return this")(),rf=Dc.Symbol,use=Object.prototype,NXe=use.hasOwnProperty,LXe=use.toString,bb=rf?rf.toStringTag:void 0;function FXe(e){var t=NXe.call(e,bb),n=e[bb];try{e[bb]=void 0;var r=!0}catch{}var o=LXe.call(e);return r&&(t?e[bb]=n:delete e[bb]),o}var jXe=Object.prototype,BXe=jXe.toString;function zXe(e){return BXe.call(e)}var VXe="[object Null]",HXe="[object Undefined]",_K=rf?rf.toStringTag:void 0;function hh(e){return e==null?e===void 0?HXe:VXe:_K&&_K in Object(e)?FXe(e):zXe(e)}function dse(e,t){return function(n){return e(t(n))}}var ez=dse(Object.getPrototypeOf,Object);function mh(e){return e!=null&&typeof e=="object"}var UXe="[object Object]",WXe=Function.prototype,GXe=Object.prototype,fse=WXe.toString,qXe=GXe.hasOwnProperty,KXe=fse.call(Object);function $K(e){if(!mh(e)||hh(e)!=UXe)return!1;var t=ez(e);if(t===null)return!0;var n=qXe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&fse.call(n)==KXe}function YXe(){this.__data__=[],this.size=0}function pse(e,t){return e===t||e!==e&&t!==t}function jT(e,t){for(var n=e.length;n--;)if(pse(e[n][0],t))return n;return-1}var QXe=Array.prototype,XXe=QXe.splice;function JXe(e){var t=this.__data__,n=jT(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():XXe.call(t,n,1),--this.size,!0}function ZXe(e){var t=this.__data__,n=jT(t,e);return n<0?void 0:t[n][1]}function eJe(e){return jT(this.__data__,e)>-1}function tJe(e,t){var n=this.__data__,r=jT(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Bu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bu.prototype.clear=YXe;Bu.prototype.delete=JXe;Bu.prototype.get=ZXe;Bu.prototype.has=eJe;Bu.prototype.set=tJe;function nJe(){this.__data__=new Bu,this.size=0}function rJe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function oJe(e){return this.__data__.get(e)}function iJe(e){return this.__data__.has(e)}function z0(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var aJe="[object AsyncFunction]",sJe="[object Function]",lJe="[object GeneratorFunction]",cJe="[object Proxy]";function hse(e){if(!z0(e))return!1;var t=hh(e);return t==sJe||t==lJe||t==aJe||t==cJe}var L_=Dc["__core-js_shared__"],NK=function(){var e=/[^.]+$/.exec(L_&&L_.keys&&L_.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function uJe(e){return!!NK&&NK in e}var dJe=Function.prototype,fJe=dJe.toString;function gh(e){if(e!=null){try{return fJe.call(e)}catch{}try{return e+""}catch{}}return""}var pJe=/[\\^$.*+?()[\]{}|]/g,hJe=/^\[object .+?Constructor\]$/,mJe=Function.prototype,gJe=Object.prototype,yJe=mJe.toString,vJe=gJe.hasOwnProperty,bJe=RegExp("^"+yJe.call(vJe).replace(pJe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wJe(e){if(!z0(e)||uJe(e))return!1;var t=hse(e)?bJe:hJe;return t.test(gh(e))}function xJe(e,t){return e==null?void 0:e[t]}function yh(e,t){var n=xJe(e,t);return wJe(n)?n:void 0}var Ax=yh(Dc,"Map"),Rx=yh(Object,"create");function SJe(){this.__data__=Rx?Rx(null):{},this.size=0}function CJe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var EJe="__lodash_hash_undefined__",PJe=Object.prototype,IJe=PJe.hasOwnProperty;function TJe(e){var t=this.__data__;if(Rx){var n=t[e];return n===EJe?void 0:n}return IJe.call(t,e)?t[e]:void 0}var OJe=Object.prototype,kJe=OJe.hasOwnProperty;function MJe(e){var t=this.__data__;return Rx?t[e]!==void 0:kJe.call(t,e)}var AJe="__lodash_hash_undefined__";function RJe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Rx&&t===void 0?AJe:t,this}function Kp(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Kp.prototype.clear=SJe;Kp.prototype.delete=CJe;Kp.prototype.get=TJe;Kp.prototype.has=MJe;Kp.prototype.set=RJe;function DJe(){this.size=0,this.__data__={hash:new Kp,map:new(Ax||Bu),string:new Kp}}function _Je(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function BT(e,t){var n=e.__data__;return _Je(t)?n[typeof t=="string"?"string":"hash"]:n.map}function $Je(e){var t=BT(this,e).delete(e);return this.size-=t?1:0,t}function NJe(e){return BT(this,e).get(e)}function LJe(e){return BT(this,e).has(e)}function FJe(e,t){var n=BT(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ef(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ef.prototype.clear=DJe;Ef.prototype.delete=$Je;Ef.prototype.get=NJe;Ef.prototype.has=LJe;Ef.prototype.set=FJe;var jJe=200;function BJe(e,t){var n=this.__data__;if(n instanceof Bu){var r=n.__data__;if(!Ax||r.length<jJe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ef(r)}return n.set(e,t),this.size=n.size,this}function qy(e){var t=this.__data__=new Bu(e);this.size=t.size}qy.prototype.clear=nJe;qy.prototype.delete=rJe;qy.prototype.get=oJe;qy.prototype.has=iJe;qy.prototype.set=BJe;function zJe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var LK=function(){try{var e=yh(Object,"defineProperty");return e({},"",{}),e}catch{}}();function mse(e,t,n){t=="__proto__"&&LK?LK(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var VJe=Object.prototype,HJe=VJe.hasOwnProperty;function gse(e,t,n){var r=e[t];(!(HJe.call(e,t)&&pse(r,n))||n===void 0&&!(t in e))&&mse(e,t,n)}function zT(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],l=void 0;l===void 0&&(l=e[s]),o?mse(n,s,l):gse(n,s,l)}return n}function UJe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var WJe="[object Arguments]";function FK(e){return mh(e)&&hh(e)==WJe}var yse=Object.prototype,GJe=yse.hasOwnProperty,qJe=yse.propertyIsEnumerable,KJe=FK(function(){return arguments}())?FK:function(e){return mh(e)&&GJe.call(e,"callee")&&!qJe.call(e,"callee")},V0=Array.isArray;function YJe(){return!1}var vse=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jK=vse&&typeof module=="object"&&module&&!module.nodeType&&module,QJe=jK&&jK.exports===vse,BK=QJe?Dc.Buffer:void 0,XJe=BK?BK.isBuffer:void 0,bse=XJe||YJe,JJe=9007199254740991,ZJe=/^(?:0|[1-9]\d*)$/;function eZe(e,t){var n=typeof e;return t=t??JJe,!!t&&(n=="number"||n!="symbol"&&ZJe.test(e))&&e>-1&&e%1==0&&e<t}var tZe=9007199254740991;function wse(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tZe}var nZe="[object Arguments]",rZe="[object Array]",oZe="[object Boolean]",iZe="[object Date]",aZe="[object Error]",sZe="[object Function]",lZe="[object Map]",cZe="[object Number]",uZe="[object Object]",dZe="[object RegExp]",fZe="[object Set]",pZe="[object String]",hZe="[object WeakMap]",mZe="[object ArrayBuffer]",gZe="[object DataView]",yZe="[object Float32Array]",vZe="[object Float64Array]",bZe="[object Int8Array]",wZe="[object Int16Array]",xZe="[object Int32Array]",SZe="[object Uint8Array]",CZe="[object Uint8ClampedArray]",EZe="[object Uint16Array]",PZe="[object Uint32Array]",kr={};kr[yZe]=kr[vZe]=kr[bZe]=kr[wZe]=kr[xZe]=kr[SZe]=kr[CZe]=kr[EZe]=kr[PZe]=!0;kr[nZe]=kr[rZe]=kr[mZe]=kr[oZe]=kr[gZe]=kr[iZe]=kr[aZe]=kr[sZe]=kr[lZe]=kr[cZe]=kr[uZe]=kr[dZe]=kr[fZe]=kr[pZe]=kr[hZe]=!1;function IZe(e){return mh(e)&&wse(e.length)&&!!kr[hh(e)]}function tz(e){return function(t){return e(t)}}var xse=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ww=xse&&typeof module=="object"&&module&&!module.nodeType&&module,TZe=ww&&ww.exports===xse,F_=TZe&&cse.process,Zg=function(){try{var e=ww&&ww.require&&ww.require("util").types;return e||F_&&F_.binding&&F_.binding("util")}catch{}}(),zK=Zg&&Zg.isTypedArray,OZe=zK?tz(zK):IZe,kZe=Object.prototype,MZe=kZe.hasOwnProperty;function Sse(e,t){var n=V0(e),r=!n&&KJe(e),o=!n&&!r&&bse(e),i=!n&&!r&&!o&&OZe(e),a=n||r||o||i,s=a?UJe(e.length,String):[],l=s.length;for(var c in e)(t||MZe.call(e,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eZe(c,l)))&&s.push(c);return s}var AZe=Object.prototype;function nz(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||AZe;return e===n}var RZe=dse(Object.keys,Object),DZe=Object.prototype,_Ze=DZe.hasOwnProperty;function $Ze(e){if(!nz(e))return RZe(e);var t=[];for(var n in Object(e))_Ze.call(e,n)&&n!="constructor"&&t.push(n);return t}function Cse(e){return e!=null&&wse(e.length)&&!hse(e)}function rz(e){return Cse(e)?Sse(e):$Ze(e)}function NZe(e,t){return e&&zT(t,rz(t),e)}function LZe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var FZe=Object.prototype,jZe=FZe.hasOwnProperty;function BZe(e){if(!z0(e))return LZe(e);var t=nz(e),n=[];for(var r in e)r=="constructor"&&(t||!jZe.call(e,r))||n.push(r);return n}function oz(e){return Cse(e)?Sse(e,!0):BZe(e)}function zZe(e,t){return e&&zT(t,oz(t),e)}var Ese=typeof exports=="object"&&exports&&!exports.nodeType&&exports,VK=Ese&&typeof module=="object"&&module&&!module.nodeType&&module,VZe=VK&&VK.exports===Ese,HK=VZe?Dc.Buffer:void 0,UK=HK?HK.allocUnsafe:void 0;function HZe(e,t){if(t)return e.slice();var n=e.length,r=UK?UK(n):new e.constructor(n);return e.copy(r),r}function Pse(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function UZe(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Ise(){return[]}var WZe=Object.prototype,GZe=WZe.propertyIsEnumerable,WK=Object.getOwnPropertySymbols,iz=WK?function(e){return e==null?[]:(e=Object(e),UZe(WK(e),function(t){return GZe.call(e,t)}))}:Ise;function qZe(e,t){return zT(e,iz(e),t)}function Tse(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var KZe=Object.getOwnPropertySymbols,Ose=KZe?function(e){for(var t=[];e;)Tse(t,iz(e)),e=ez(e);return t}:Ise;function YZe(e,t){return zT(e,Ose(e),t)}function kse(e,t,n){var r=t(e);return V0(e)?r:Tse(r,n(e))}function QZe(e){return kse(e,rz,iz)}function XZe(e){return kse(e,oz,Ose)}var wL=yh(Dc,"DataView"),xL=yh(Dc,"Promise"),SL=yh(Dc,"Set"),CL=yh(Dc,"WeakMap"),GK="[object Map]",JZe="[object Object]",qK="[object Promise]",KK="[object Set]",YK="[object WeakMap]",QK="[object DataView]",ZZe=gh(wL),eet=gh(Ax),tet=gh(xL),net=gh(SL),ret=gh(CL),ru=hh;(wL&&ru(new wL(new ArrayBuffer(1)))!=QK||Ax&&ru(new Ax)!=GK||xL&&ru(xL.resolve())!=qK||SL&&ru(new SL)!=KK||CL&&ru(new CL)!=YK)&&(ru=function(e){var t=hh(e),n=t==JZe?e.constructor:void 0,r=n?gh(n):"";if(r)switch(r){case ZZe:return QK;case eet:return GK;case tet:return qK;case net:return KK;case ret:return YK}return t});var oet=Object.prototype,iet=oet.hasOwnProperty;function aet(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&iet.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var XK=Dc.Uint8Array;function az(e){var t=new e.constructor(e.byteLength);return new XK(t).set(new XK(e)),t}function set(e,t){var n=t?az(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var cet=/\w*$/;function uet(e){var t=new e.constructor(e.source,cet.exec(e));return t.lastIndex=e.lastIndex,t}var JK=rf?rf.prototype:void 0,ZK=JK?JK.valueOf:void 0;function det(e){return ZK?Object(ZK.call(e)):{}}function fet(e,t){var n=t?az(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var pet="[object Boolean]",het="[object Date]",met="[object Map]",get="[object Number]",yet="[object RegExp]",vet="[object Set]",bet="[object String]",wet="[object Symbol]",xet="[object ArrayBuffer]",Cet="[object DataView]",Eet="[object Float32Array]",Pet="[object Float64Array]",Iet="[object Int8Array]",Tet="[object Int16Array]",Oet="[object Int32Array]",ket="[object Uint8Array]",Met="[object Uint8ClampedArray]",Aet="[object Uint16Array]",Ret="[object Uint32Array]";function Det(e,t,n){var r=e.constructor;switch(t){case xet:return az(e);case pet:case het:return new r(+e);case Cet:return set(e,n);case Eet:case Pet:case Iet:case Tet:case Oet:case ket:case Met:case Aet:case Ret:return fet(e,n);case met:return new r;case get:case bet:return new r(e);case yet:return uet(e);case vet:return new r;case wet:return det(e)}}var eY=Object.create,_et=function(){function e(){}return function(t){if(!z0(t))return{};if(eY)return eY(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function $et(e){return typeof e.constructor=="function"&&!nz(e)?_et(ez(e)):{}}var Net="[object Map]";function Let(e){return mh(e)&&ru(e)==Net}var tY=Zg&&Zg.isMap,Fet=tY?tz(tY):Let,jet="[object Set]";function Bet(e){return mh(e)&&ru(e)==jet}var nY=Zg&&Zg.isSet,zet=nY?tz(nY):Bet,Vet=1,Het=2,Uet=4,Mse="[object Arguments]",Wet="[object Array]",Get="[object Boolean]",qet="[object Date]",Ket="[object Error]",Ase="[object Function]",Yet="[object GeneratorFunction]",Qet="[object Map]",Xet="[object Number]",Rse="[object Object]",Jet="[object RegExp]",Zet="[object Set]",ett="[object String]",ttt="[object Symbol]",ntt="[object WeakMap]",rtt="[object ArrayBuffer]",ott="[object DataView]",itt="[object Float32Array]",att="[object Float64Array]",stt="[object Int8Array]",ltt="[object Int16Array]",ctt="[object Int32Array]",utt="[object Uint8Array]",dtt="[object Uint8ClampedArray]",ftt="[object Uint16Array]",ptt="[object Uint32Array]",Sr={};Sr[Mse]=Sr[Wet]=Sr[rtt]=Sr[ott]=Sr[Get]=Sr[qet]=Sr[itt]=Sr[att]=Sr[stt]=Sr[ltt]=Sr[ctt]=Sr[Qet]=Sr[Xet]=Sr[Rse]=Sr[Jet]=Sr[Zet]=Sr[ett]=Sr[ttt]=Sr[utt]=Sr[dtt]=Sr[ftt]=Sr[ptt]=!0;Sr[Ket]=Sr[Ase]=Sr[ntt]=!1;function xw(e,t,n,r,o,i){var a,s=t&Vet,l=t&Het,c=t&Uet;if(a!==void 0)return a;if(!z0(e))return e;var u=V0(e);if(u){if(a=aet(e),!s)return Pse(e,a)}else{var d=ru(e),f=d==Ase||d==Yet;if(bse(e))return HZe(e,s);if(d==Rse||d==Mse||f&&!o){if(a=l||f?{}:$et(e),!s)return l?YZe(e,zZe(a,e)):qZe(e,NZe(a,e))}else{if(!Sr[d])return o?e:{};a=Det(e,d,s)}}i||(i=new qy);var h=i.get(e);if(h)return h;i.set(e,a),zet(e)?e.forEach(function(v){a.add(xw(v,t,n,v,e,i))}):Fet(e)&&e.forEach(function(v,x){a.set(x,xw(v,t,n,x,e,i))});var g=c?l?XZe:QZe:l?oz:rz,y=u?void 0:g(e);return zJe(y||e,function(v,x){y&&(x=v,v=e[x]),gse(a,x,xw(v,t,n,x,e,i))}),a}var htt=1,mtt=4;function Kb(e){return xw(e,htt|mtt)}var j_,rY;function gtt(){if(rY)return j_;rY=1;var e=Array.isArray,t=Object.keys,n=Object.prototype.hasOwnProperty,r=typeof Element<"u";function o(i,a){if(i===a)return!0;if(i&&a&&typeof i=="object"&&typeof a=="object"){var s=e(i),l=e(a),c,u,d;if(s&&l){if(u=i.length,u!=a.length)return!1;for(c=u;c--!==0;)if(!o(i[c],a[c]))return!1;return!0}if(s!=l)return!1;var f=i instanceof Date,h=a instanceof Date;if(f!=h)return!1;if(f&&h)return i.getTime()==a.getTime();var g=i instanceof RegExp,y=a instanceof RegExp;if(g!=y)return!1;if(g&&y)return i.toString()==a.toString();var v=t(i);if(u=v.length,u!==t(a).length)return!1;for(c=u;c--!==0;)if(!n.call(a,v[c]))return!1;if(r&&i instanceof Element&&a instanceof Element)return i===a;for(c=u;c--!==0;)if(d=v[c],!(d==="_owner"&&i.$$typeof)&&!o(i[d],a[d]))return!1;return!0}return i!==i&&a!==a}return j_=function(a,s){try{return o(a,s)}catch(l){if(l.message&&l.message.match(/stack|recursion/i)||l.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",l.name,l.message),!1;throw l}},j_}var ytt=gtt();const Sd=Fn(ytt);var vtt=4;function oY(e){return xw(e,vtt)}function Dse(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var btt="[object Symbol]";function sz(e){return typeof e=="symbol"||mh(e)&&hh(e)==btt}var wtt="Expected a function";function lz(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wtt);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(lz.Cache||Ef),n}lz.Cache=Ef;var xtt=500;function Stt(e){var t=lz(e,function(r){return n.size===xtt&&n.clear(),r}),n=t.cache;return t}var Ctt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ett=/\\(\\)?/g,Ptt=Stt(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ctt,function(n,r,o,i){t.push(o?i.replace(Ett,"$1"):r||n)}),t});function Itt(e){if(typeof e=="string"||sz(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var iY=rf?rf.prototype:void 0,aY=iY?iY.toString:void 0;function _se(e){if(typeof e=="string")return e;if(V0(e))return Dse(e,_se)+"";if(sz(e))return aY?aY.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ttt(e){return e==null?"":_se(e)}function $se(e){return V0(e)?Dse(e,Itt):sz(e)?[e]:Pse(Ptt(Ttt(e)))}function no(){return no=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},no.apply(this,arguments)}function Ott(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function cz(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function sY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var VT=w.createContext(void 0);VT.displayName="FormikContext";var ktt=VT.Provider,Mtt=VT.Consumer;function uz(){var e=w.useContext(VT);return e}var lY=function(t){return Array.isArray(t)&&t.length===0},la=function(t){return typeof t=="function"},Ky=function(t){return t!==null&&typeof t=="object"},Att=function(t){return String(Math.floor(Number(t)))===t},B_=function(t){return Object.prototype.toString.call(t)==="[object String]"},Nse=function(t){return w.Children.count(t)===0},z_=function(t){return Ky(t)&&la(t.then)};function Ho(e,t,n,r){r===void 0&&(r=0);for(var o=$se(t);e&&r<o.length;)e=e[o[r++]];return r!==o.length&&!e||e===void 0?n:e}function bc(e,t,n){for(var r=oY(e),o=r,i=0,a=$se(t);i<a.length-1;i++){var s=a[i],l=Ho(e,a.slice(0,i+1));if(l&&(Ky(l)||Array.isArray(l)))o=o[s]=oY(l);else{var c=a[i+1];o=o[s]=Att(c)&&Number(c)>=0?[]:{}}}return(i===0?e:o)[a[i]]===n?e:(n===void 0?delete o[a[i]]:o[a[i]]=n,i===0&&n===void 0&&delete r[a[i]],r)}function Lse(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],s=e[a];Ky(s)?n.get(s)||(n.set(s,!0),r[a]=Array.isArray(s)?[]:{},Lse(s,t,n,r[a])):r[a]=t}return r}function Rtt(e,t){switch(t.type){case"SET_VALUES":return no({},e,{values:t.payload});case"SET_TOUCHED":return no({},e,{touched:t.payload});case"SET_ERRORS":return Sd(e.errors,t.payload)?e:no({},e,{errors:t.payload});case"SET_STATUS":return no({},e,{status:t.payload});case"SET_ISSUBMITTING":return no({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return no({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return no({},e,{values:bc(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return no({},e,{touched:bc(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return no({},e,{errors:bc(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return no({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return no({},e,{touched:Lse(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return no({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return no({},e,{isSubmitting:!1});default:return e}}var Yf={},t1={};function Dtt(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,i=e.validateOnMount,a=i===void 0?!1:i,s=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,u=e.onSubmit,d=cz(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),f=no({validateOnChange:n,validateOnBlur:o,validateOnMount:a,onSubmit:u},d),h=w.useRef(f.initialValues),g=w.useRef(f.initialErrors||Yf),y=w.useRef(f.initialTouched||t1),v=w.useRef(f.initialStatus),x=w.useRef(!1),S=w.useRef({});w.useEffect(function(){return x.current=!0,function(){x.current=!1}},[]);var C=w.useState(0),I=C[1],E=w.useRef({values:Kb(f.initialValues),errors:Kb(f.initialErrors)||Yf,touched:Kb(f.initialTouched)||t1,status:Kb(f.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),T=E.current,O=w.useCallback(function(de){var $e=E.current;E.current=Rtt($e,de),$e!==E.current&&I(function(Ae){return Ae+1})},[]),A=w.useCallback(function(de,$e){return new Promise(function(Ae,Ne){var Ue=f.validate(de,$e);Ue==null?Ae(Yf):z_(Ue)?Ue.then(function(Ze){Ae(Ze||Yf)},function(Ze){Ne(Ze)}):Ae(Ue)})},[f.validate]),k=w.useCallback(function(de,$e){var Ae=f.validationSchema,Ne=la(Ae)?Ae($e):Ae,Ue=$e&&Ne.validateAt?Ne.validateAt($e,de):$tt(de,Ne);return new Promise(function(Ze,ut){Ue.then(function(){Ze(Yf)},function(Ye){Ye.name==="ValidationError"?Ze(_tt(Ye)):ut(Ye)})})},[f.validationSchema]),M=w.useCallback(function(de,$e){return new Promise(function(Ae){return Ae(S.current[de].validate($e))})},[]),R=w.useCallback(function(de){var $e=Object.keys(S.current).filter(function(Ne){return la(S.current[Ne].validate)}),Ae=$e.length>0?$e.map(function(Ne){return M(Ne,Ho(de,Ne))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ae).then(function(Ne){return Ne.reduce(function(Ue,Ze,ut){return Ze==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ze&&(Ue=bc(Ue,$e[ut],Ze)),Ue},{})})},[M]),$=w.useCallback(function(de){return Promise.all([R(de),f.validationSchema?k(de):{},f.validate?A(de):{}]).then(function($e){var Ae=$e[0],Ne=$e[1],Ue=$e[2],Ze=bL.all([Ae,Ne,Ue],{arrayMerge:Ntt});return Ze})},[f.validate,f.validationSchema,R,A,k]),L=vs(function(de){return de===void 0&&(de=T.values),O({type:"SET_ISVALIDATING",payload:!0}),$(de).then(function($e){return x.current&&(O({type:"SET_ISVALIDATING",payload:!1}),O({type:"SET_ERRORS",payload:$e})),$e})});w.useEffect(function(){a&&x.current===!0&&Sd(h.current,f.initialValues)&&L(h.current)},[a,L]);var z=w.useCallback(function(de){var $e=de&&de.values?de.values:h.current,Ae=de&&de.errors?de.errors:g.current?g.current:f.initialErrors||{},Ne=de&&de.touched?de.touched:y.current?y.current:f.initialTouched||{},Ue=de&&de.status?de.status:v.current?v.current:f.initialStatus;h.current=$e,g.current=Ae,y.current=Ne,v.current=Ue;var Ze=function(){O({type:"RESET_FORM",payload:{isSubmitting:!!de&&!!de.isSubmitting,errors:Ae,touched:Ne,status:Ue,values:$e,isValidating:!!de&&!!de.isValidating,submitCount:de&&de.submitCount&&typeof de.submitCount=="number"?de.submitCount:0}})};if(f.onReset){var ut=f.onReset(T.values,le);z_(ut)?ut.then(Ze):Ze()}else Ze()},[f.initialErrors,f.initialStatus,f.initialTouched,f.onReset]);w.useEffect(function(){x.current===!0&&!Sd(h.current,f.initialValues)&&c&&(h.current=f.initialValues,z(),a&&L(h.current))},[c,f.initialValues,z,a,L]),w.useEffect(function(){c&&x.current===!0&&!Sd(g.current,f.initialErrors)&&(g.current=f.initialErrors||Yf,O({type:"SET_ERRORS",payload:f.initialErrors||Yf}))},[c,f.initialErrors]),w.useEffect(function(){c&&x.current===!0&&!Sd(y.current,f.initialTouched)&&(y.current=f.initialTouched||t1,O({type:"SET_TOUCHED",payload:f.initialTouched||t1}))},[c,f.initialTouched]),w.useEffect(function(){c&&x.current===!0&&!Sd(v.current,f.initialStatus)&&(v.current=f.initialStatus,O({type:"SET_STATUS",payload:f.initialStatus}))},[c,f.initialStatus,f.initialTouched]);var N=vs(function(de){if(S.current[de]&&la(S.current[de].validate)){var $e=Ho(T.values,de),Ae=S.current[de].validate($e);return z_(Ae)?(O({type:"SET_ISVALIDATING",payload:!0}),Ae.then(function(Ne){return Ne}).then(function(Ne){O({type:"SET_FIELD_ERROR",payload:{field:de,value:Ne}}),O({type:"SET_ISVALIDATING",payload:!1})})):(O({type:"SET_FIELD_ERROR",payload:{field:de,value:Ae}}),Promise.resolve(Ae))}else if(f.validationSchema)return O({type:"SET_ISVALIDATING",payload:!0}),k(T.values,de).then(function(Ne){return Ne}).then(function(Ne){O({type:"SET_FIELD_ERROR",payload:{field:de,value:Ho(Ne,de)}}),O({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),B=w.useCallback(function(de,$e){var Ae=$e.validate;S.current[de]={validate:Ae}},[]),U=w.useCallback(function(de){delete S.current[de]},[]),G=vs(function(de,$e){O({type:"SET_TOUCHED",payload:de});var Ae=$e===void 0?o:$e;return Ae?L(T.values):Promise.resolve()}),H=w.useCallback(function(de){O({type:"SET_ERRORS",payload:de})},[]),K=vs(function(de,$e){var Ae=la(de)?de(T.values):de;O({type:"SET_VALUES",payload:Ae});var Ne=$e===void 0?n:$e;return Ne?L(Ae):Promise.resolve()}),q=w.useCallback(function(de,$e){O({type:"SET_FIELD_ERROR",payload:{field:de,value:$e}})},[]),Y=vs(function(de,$e,Ae){O({type:"SET_FIELD_VALUE",payload:{field:de,value:$e}});var Ne=Ae===void 0?n:Ae;return Ne?L(bc(T.values,de,$e)):Promise.resolve()}),J=w.useCallback(function(de,$e){var Ae=$e,Ne=de,Ue;if(!B_(de)){de.persist&&de.persist();var Ze=de.target?de.target:de.currentTarget,ut=Ze.type,Ye=Ze.name,et=Ze.id,Xe=Ze.value,mt=Ze.checked;Ze.outerHTML;var At=Ze.options,Bt=Ze.multiple;Ae=$e||Ye||et,Ne=/number|range/.test(ut)?(Ue=parseFloat(Xe),isNaN(Ue)?"":Ue):/checkbox/.test(ut)?Ftt(Ho(T.values,Ae),mt,Xe):At&&Bt?Ltt(At):Xe}Ae&&Y(Ae,Ne)},[Y,T.values]),ie=vs(function(de){if(B_(de))return function($e){return J($e,de)};J(de)}),ee=vs(function(de,$e,Ae){$e===void 0&&($e=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:de,value:$e}});var Ne=Ae===void 0?o:Ae;return Ne?L(T.values):Promise.resolve()}),te=w.useCallback(function(de,$e){de.persist&&de.persist();var Ae=de.target,Ne=Ae.name,Ue=Ae.id;Ae.outerHTML;var Ze=$e||Ne||Ue;ee(Ze,!0)},[ee]),ce=vs(function(de){if(B_(de))return function($e){return te($e,de)};te(de)}),ae=w.useCallback(function(de){la(de)?O({type:"SET_FORMIK_STATE",payload:de}):O({type:"SET_FORMIK_STATE",payload:function(){return de}})},[]),ne=w.useCallback(function(de){O({type:"SET_STATUS",payload:de})},[]),ue=w.useCallback(function(de){O({type:"SET_ISSUBMITTING",payload:de})},[]),he=vs(function(){return O({type:"SUBMIT_ATTEMPT"}),L().then(function(de){var $e=de instanceof Error,Ae=!$e&&Object.keys(de).length===0;if(Ae){var Ne;try{if(Ne=me(),Ne===void 0)return}catch(Ue){throw Ue}return Promise.resolve(Ne).then(function(Ue){return x.current&&O({type:"SUBMIT_SUCCESS"}),Ue}).catch(function(Ue){if(x.current)throw O({type:"SUBMIT_FAILURE"}),Ue})}else if(x.current&&(O({type:"SUBMIT_FAILURE"}),$e))throw de})}),re=vs(function(de){de&&de.preventDefault&&la(de.preventDefault)&&de.preventDefault(),de&&de.stopPropagation&&la(de.stopPropagation)&&de.stopPropagation(),he().catch(function($e){console.warn("Warning: An unhandled error was caught from submitForm()",$e)})}),le={resetForm:z,validateForm:L,validateField:N,setErrors:H,setFieldError:q,setFieldTouched:ee,setFieldValue:Y,setStatus:ne,setSubmitting:ue,setTouched:G,setValues:K,setFormikState:ae,submitForm:he},me=vs(function(){return u(T.values,le)}),Se=vs(function(de){de&&de.preventDefault&&la(de.preventDefault)&&de.preventDefault(),de&&de.stopPropagation&&la(de.stopPropagation)&&de.stopPropagation(),z()}),Ee=w.useCallback(function(de){return{value:Ho(T.values,de),error:Ho(T.errors,de),touched:!!Ho(T.touched,de),initialValue:Ho(h.current,de),initialTouched:!!Ho(y.current,de),initialError:Ho(g.current,de)}},[T.errors,T.touched,T.values]),ge=w.useCallback(function(de){return{setValue:function(Ae,Ne){return Y(de,Ae,Ne)},setTouched:function(Ae,Ne){return ee(de,Ae,Ne)},setError:function(Ae){return q(de,Ae)}}},[Y,ee,q]),xe=w.useCallback(function(de){var $e=Ky(de),Ae=$e?de.name:de,Ne=Ho(T.values,Ae),Ue={name:Ae,value:Ne,onChange:ie,onBlur:ce};if($e){var Ze=de.type,ut=de.value,Ye=de.as,et=de.multiple;Ze==="checkbox"?ut===void 0?Ue.checked=!!Ne:(Ue.checked=!!(Array.isArray(Ne)&&~Ne.indexOf(ut)),Ue.value=ut):Ze==="radio"?(Ue.checked=Ne===ut,Ue.value=ut):Ye==="select"&&et&&(Ue.value=Ue.value||[],Ue.multiple=!0)}return Ue},[ce,ie,T.values]),Pe=w.useMemo(function(){return!Sd(h.current,T.values)},[h.current,T.values]),_e=w.useMemo(function(){return typeof s<"u"?Pe?T.errors&&Object.keys(T.errors).length===0:s!==!1&&la(s)?s(f):s:T.errors&&Object.keys(T.errors).length===0},[s,Pe,T.errors,f]),Le=no({},T,{initialValues:h.current,initialErrors:g.current,initialTouched:y.current,initialStatus:v.current,handleBlur:ce,handleChange:ie,handleReset:Se,handleSubmit:re,resetForm:z,setErrors:H,setFormikState:ae,setFieldTouched:ee,setFieldValue:Y,setFieldError:q,setStatus:ne,setSubmitting:ue,setTouched:G,setValues:K,submitForm:he,validateForm:L,validateField:N,isValid:_e,dirty:Pe,unregisterField:U,registerField:B,getFieldProps:xe,getFieldMeta:Ee,getFieldHelpers:ge,validateOnBlur:o,validateOnChange:n,validateOnMount:a});return Le}function ci(e){var t=Dtt(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return w.useImperativeHandle(i,function(){return t}),w.createElement(ktt,{value:t},n?w.createElement(n,t):o?o(t):r?la(r)?r(t):Nse(r)?null:w.Children.only(r):null)}function _tt(e){var t={};if(e.inner){if(e.inner.length===0)return bc(t,e.path,e.message);for(var o=e.inner,n=Array.isArray(o),r=0,o=n?o:o[Symbol.iterator]();;){var i;if(n){if(r>=o.length)break;i=o[r++]}else{if(r=o.next(),r.done)break;i=r.value}var a=i;Ho(t,a.path)||(t=bc(t,a.path,a.message))}}return t}function $tt(e,t,n,r){n===void 0&&(n=!1);var o=EL(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:o})}function EL(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(o){return Array.isArray(o)===!0||$K(o)?EL(o):o!==""?o:void 0}):$K(e[r])?t[r]=EL(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function Ntt(e,t,n){var r=e.slice();return t.forEach(function(i,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(i);r[a]=l?bL(Array.isArray(i)?[]:{},i,n):i}else n.isMergeableObject(i)?r[a]=bL(e[a],i,n):e.indexOf(i)===-1&&r.push(i)}),r}function Ltt(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Ftt(e,t,n){if(typeof e=="boolean")return!!t;var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,i=e.indexOf(n),o=i>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!o?r.concat(n):o?r.slice(0,i).concat(r.slice(i+1)):r}var jtt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function vs(e){var t=w.useRef(e);return jtt(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current.apply(void 0,r)},[])}function Za(e){var t=uz(),n=t.getFieldProps,r=t.getFieldMeta,o=t.getFieldHelpers,i=t.registerField,a=t.unregisterField,s=Ky(e),l=s?e:{name:e},c=l.name,u=l.validate;w.useEffect(function(){return c&&i(c,{validate:u}),function(){c&&a(c)}},[i,a,c,u]);var d=w.useMemo(function(){return o(c)},[o,c]);return[n(l),r(c),d]}var Zo=w.forwardRef(function(e,t){var n=e.action,r=cz(e,["action"]),o=n??"#",i=uz(),a=i.handleReset,s=i.handleSubmit;return w.createElement("form",no({onSubmit:s,ref:t,onReset:a,action:o},r))});Zo.displayName="Form";function Btt(e){var t=function(o){return w.createElement(Mtt,null,function(i){return w.createElement(e,no({},o,{formik:i}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",qhe(t,e)}var ztt=function(t,n,r){var o=Yp(t),i=o[n];return o.splice(n,1),o.splice(r,0,i),o},Vtt=function(t,n,r){var o=Yp(t),i=o[n];return o[n]=o[r],o[r]=i,o},V_=function(t,n,r){var o=Yp(t);return o.splice(n,0,r),o},Htt=function(t,n,r){var o=Yp(t);return o[n]=r,o},Yp=function(t){if(t){if(Array.isArray(t))return[].concat(t);var n=Object.keys(t).map(function(r){return parseInt(r)}).reduce(function(r,o){return o>r?o:r},0);return Array.from(no({},t,{length:n+1}))}else return[]},cY=function(t,n){var r=typeof t=="function"?t:n;return function(o){if(Array.isArray(o)||Ky(o)){var i=Yp(o);return r(i)}return o}},Fse=function(e){Ott(t,e);function t(r){var o;return o=e.call(this,r)||this,o.updateArrayField=function(i,a,s){var l=o.props,c=l.name,u=l.formik.setFormikState;u(function(d){var f=cY(s,i),h=cY(a,i),g=bc(d.values,c,i(Ho(d.values,c))),y=s?f(Ho(d.errors,c)):void 0,v=a?h(Ho(d.touched,c)):void 0;return lY(y)&&(y=void 0),lY(v)&&(v=void 0),no({},d,{values:g,errors:s?bc(d.errors,c,y):d.errors,touched:a?bc(d.touched,c,v):d.touched})})},o.push=function(i){return o.updateArrayField(function(a){return[].concat(Yp(a),[Kb(i)])},!1,!1)},o.handlePush=function(i){return function(){return o.push(i)}},o.swap=function(i,a){return o.updateArrayField(function(s){return Vtt(s,i,a)},!0,!0)},o.handleSwap=function(i,a){return function(){return o.swap(i,a)}},o.move=function(i,a){return o.updateArrayField(function(s){return ztt(s,i,a)},!0,!0)},o.handleMove=function(i,a){return function(){return o.move(i,a)}},o.insert=function(i,a){return o.updateArrayField(function(s){return V_(s,i,a)},function(s){return V_(s,i,null)},function(s){return V_(s,i,null)})},o.handleInsert=function(i,a){return function(){return o.insert(i,a)}},o.replace=function(i,a){return o.updateArrayField(function(s){return Htt(s,i,a)},!1,!1)},o.handleReplace=function(i,a){return function(){return o.replace(i,a)}},o.unshift=function(i){var a=-1;return o.updateArrayField(function(s){var l=s?[i].concat(s):[i];return a=l.length,l},function(s){return s?[null].concat(s):[null]},function(s){return s?[null].concat(s):[null]}),a},o.handleUnshift=function(i){return function(){return o.unshift(i)}},o.handleRemove=function(i){return function(){return o.remove(i)}},o.handlePop=function(){return function(){return o.pop()}},o.remove=o.remove.bind(sY(o)),o.pop=o.pop.bind(sY(o)),o}var n=t.prototype;return n.componentDidUpdate=function(o){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Sd(Ho(o.formik.values,o.name),Ho(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(o){var i;return this.updateArrayField(function(a){var s=a?Yp(a):[];return i||(i=s[o]),la(s.splice)&&s.splice(o,1),la(s.every)&&s.every(function(l){return l===void 0})?[]:s},!0,!0),i},n.pop=function(){var o;return this.updateArrayField(function(i){var a=i.slice();return o||(o=a&&a.pop&&a.pop()),a},!0,!0),o},n.render=function(){var o={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},i=this.props,a=i.component,s=i.render,l=i.children,c=i.name,u=i.formik,d=cz(u,["validate","validationSchema"]),f=no({},o,{form:d,name:c});return a?w.createElement(a,f):s?s(f):l?typeof l=="function"?l(f):Nse(l)?null:w.Children.only(l):null},t}(w.Component);Fse.defaultProps={validateOnChange:!0};var jse=Btt(Fse),H_,uY;function Utt(){if(uY)return H_;uY=1;function e(x){this._maxSize=x,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(x){return this._values[x]},e.prototype.set=function(x,S){return this._size>=this._maxSize&&this.clear(),x in this._values||this._size++,this._values[x]=S};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,s=new e(a),l=new e(a),c=new e(a);H_={Cache:e,split:d,normalizePath:u,setter:function(x){var S=u(x);return l.get(x)||l.set(x,function(I,E){for(var T=0,O=S.length,A=I;T<O-1;){var k=S[T];if(k==="__proto__"||k==="constructor"||k==="prototype")return I;A=A[S[T++]]}A[S[T]]=E})},getter:function(x,S){var C=u(x);return c.get(x)||c.set(x,function(E){for(var T=0,O=C.length;T<O;)if(E!=null||!S)E=E[C[T++]];else return;return E})},join:function(x){return x.reduce(function(S,C){return S+(h(C)||n.test(C)?"["+C+"]":(S?".":"")+C)},"")},forEach:function(x,S,C){f(Array.isArray(x)?x:d(x),S,C)}};function u(x){return s.get(x)||s.set(x,d(x).map(function(S){return S.replace(i,"$2")}))}function d(x){return x.match(t)||[""]}function f(x,S,C){var I=x.length,E,T,O,A;for(T=0;T<I;T++)E=x[T],E&&(v(E)&&(E='"'+E+'"'),A=h(E),O=!A&&/^\d+$/.test(E),S.call(C,E,A,O,T,x))}function h(x){return typeof x=="string"&&x&&["'",'"'].indexOf(x.charAt(0))!==-1}function g(x){return x.match(r)&&!x.match(n)}function y(x){return o.test(x)}function v(x){return!h(x)&&(g(x)||y(x))}return H_}var Rp=Utt(),U_,dY;function Wtt(){if(dY)return U_;dY=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=u=>u.match(e)||[],n=u=>u[0].toUpperCase()+u.slice(1),r=(u,d)=>t(u).join(d).toLowerCase(),o=u=>t(u).reduce((d,f)=>`${d}${d?f[0].toUpperCase()+f.slice(1).toLowerCase():f.toLowerCase()}`,"");return U_={words:t,upperFirst:n,camelCase:o,pascalCase:u=>n(o(u)),snakeCase:u=>r(u,"_"),kebabCase:u=>r(u,"-"),sentenceCase:u=>n(r(u," ")),titleCase:u=>t(u).map(n).join(" ")},U_}var W_=Wtt(),n1={exports:{}},fY;function Gtt(){if(fY)return n1.exports;fY=1,n1.exports=function(o){return e(t(o),o)},n1.exports.array=e;function e(o,i){var a=o.length,s=new Array(a),l={},c=a,u=n(i),d=r(o);for(i.forEach(function(h){if(!d.has(h[0])||!d.has(h[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});c--;)l[c]||f(o[c],c,new Set);return s;function f(h,g,y){if(y.has(h)){var v;try{v=", node was:"+JSON.stringify(h)}catch{v=""}throw new Error("Cyclic dependency"+v)}if(!d.has(h))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(h));if(!l[g]){l[g]=!0;var x=u.get(h)||new Set;if(x=Array.from(x),g=x.length){y.add(h);do{var S=x[--g];f(S,d.get(S),y)}while(g);y.delete(h)}s[--a]=h}}}function t(o){for(var i=new Set,a=0,s=o.length;a<s;a++){var l=o[a];i.add(l[0]),i.add(l[1])}return Array.from(i)}function n(o){for(var i=new Map,a=0,s=o.length;a<s;a++){var l=o[a];i.has(l[0])||i.set(l[0],new Set),i.has(l[1])||i.set(l[1],new Set),i.get(l[0]).add(l[1])}return i}function r(o){for(var i=new Map,a=0,s=o.length;a<s;a++)i.set(o[a],a);return i}return n1.exports}var qtt=Gtt();const Ktt=Fn(qtt),Ytt=Object.prototype.toString,Qtt=Error.prototype.toString,Xtt=RegExp.prototype.toString,Jtt=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ztt=/^Symbol\((.*)\)(.*)$/;function ent(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function pY(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return ent(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Jtt.call(e).replace(Ztt,"Symbol($1)");const r=Ytt.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Qtt.call(e)+"]":r==="RegExp"?Xtt.call(e):null}function hu(e,t){let n=pY(e,t);return n!==null?n:JSON.stringify(e,function(r,o){let i=pY(this[r],t);return i!==null?i:o},2)}function Bse(e){return e==null?[]:[].concat(e)}let zse,Vse,Hse,tnt=/\$\{\s*(\w+)\s*\}/g;zse=Symbol.toStringTag;class hY{constructor(t,n,r,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[zse]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],Bse(t).forEach(i=>{if(da.isError(i)){this.errors.push(...i.errors);const a=i.inner.length?i.inner:[i];this.inner.push(...a)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Vse=Symbol.hasInstance;Hse=Symbol.toStringTag;class da extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(tnt,(o,i)=>hu(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,o,i){const a=new hY(t,n,r,o);if(i)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Hse]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,da)}static[Vse](t){return hY[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let ec={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=r!=null&&r!==n?` (cast from the value \`${hu(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${hu(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${hu(n,!0)}\``+o}},ia={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},yd={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},PL={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},IL={isValue:"${path} field must be ${value}"},N1={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},L1={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},nnt={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${hu(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${hu(n,!0)}\``}return da.formatError(ec.notType,e)}};Object.assign(Object.create(null),{mixed:ec,string:ia,number:yd,date:PL,object:N1,array:L1,boolean:IL,tuple:nnt});const HT=e=>e&&e.__isYupSchema__;class TP{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:o,otherwise:i}=n,a=typeof r=="function"?r:(...s)=>s.every(l=>l===r);return new TP(t,(s,l)=>{var c;let u=a(...s)?o:i;return(c=u==null?void 0:u(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),o=this.fn(r,t,n);if(o===void 0||o===t)return t;if(!HT(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const r1={context:"$",value:"."};function dz(e,t){return new Pf(e,t)}class Pf{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===r1.context,this.isValue=this.key[0]===r1.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?r1.context:this.isValue?r1.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Rp.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let o=this.isContext?r:this.isValue?t:n;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Pf.prototype.__isYupRef=!0;const Tl=e=>e==null;function lm(e){function t({value:n,path:r="",options:o,originalValue:i,schema:a},s,l){const{name:c,test:u,params:d,message:f,skipAbsent:h}=e;let{parent:g,context:y,abortEarly:v=a.spec.abortEarly,disableStackTrace:x=a.spec.disableStackTrace}=o;function S(R){return Pf.isRef(R)?R.getValue(n,g,y):R}function C(R={}){const $=Object.assign({value:n,originalValue:i,label:a.spec.label,path:R.path||r,spec:a.spec,disableStackTrace:R.disableStackTrace||x},d,R.params);for(const z of Object.keys($))$[z]=S($[z]);const L=new da(da.formatError(R.message||f,$),n,$.path,R.type||c,$.disableStackTrace);return L.params=$,L}const I=v?s:l;let E={path:r,parent:g,type:c,from:o.from,createError:C,resolve:S,options:o,originalValue:i,schema:a};const T=R=>{da.isError(R)?I(R):R?l(null):I(C())},O=R=>{da.isError(R)?I(R):s(R)};if(h&&Tl(n))return T(!0);let k;try{var M;if(k=u.call(E,n,E),typeof((M=k)==null?void 0:M.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${E.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(k).then(T,O)}}catch(R){O(R);return}T(k)}return t.OPTIONS=e,t}function rnt(e,t,n,r=n){let o,i,a;return t?(Rp.forEach(t,(s,l,c)=>{let u=l?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:o,value:n});let d=e.type==="tuple",f=c?parseInt(u,10):0;if(e.innerType||d){if(d&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[f],e=d?e.spec.types[f]:e.innerType}if(!c){if(!e.fields||!e.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);o=n,n=n&&n[u],e=e.fields[u]}i=u,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class OP extends Set{describe(){const t=[];for(const n of this.values())t.push(Pf.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new OP(this.values())}merge(t,n){const r=this.clone();return t.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function Am(e,t=new Map){if(HT(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Am(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,Am(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Am(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=Am(o,t)}else throw Error(`Unable to clone ${e}`);return n}class Ya{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new OP,this._blacklist=new OP,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ec.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Am(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const o=Object.assign({},n.spec,r.spec);return r.spec=o,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(a=>{i.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((o,i)=>i.resolve(o,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,o,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(o=t.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),o=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(o&&Tl(i))return i;let a=hu(t),s=hu(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".+`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},I9e=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},NT=(e,t)=>{const n=[],r=e.date(void 0,"default"),o=e.startOfWeek(r),i=e.endOfWeek(r);let a=o;for(;e.isBefore(a,i);)n.push(a),a=e.addDays(a,1);return n.map(s=>e.formatByString(s,t))},wae=(e,t,n,r)=>{switch(n){case"month":return DB(e,e.date(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return NT(e,r);case"meridiem":{const o=e.date(void 0,t);return[e.startOfDay(o),e.endOfDay(o)].map(i=>e.formatByString(i,r))}default:return[]}},xK="s",T9e=["0","1","2","3","4","5","6","7","8","9"],O9e=e=>{const t=e.date(void 0);return e.formatByString(e.setSeconds(t,0),xK)==="0"?T9e:Array.from({length:10}).map((r,o)=>e.formatByString(e.setSeconds(t,o),xK))},qp=(e,t)=>{if(t[0]==="0")return e;const n=[];let r="";for(let o=0;o<e.length;o+=1){r+=e[o];const i=t.indexOf(r);i>-1&&(n.push(i.toString()),r="")}return n.join("")},NB=(e,t)=>t[0]==="0"?e:e.split("").map(n=>t[Number(n)]).join(""),SK=(e,t)=>{const n=qp(e,t);return n!==" "&&!Number.isNaN(Number(n))},xae=(e,t)=>{let n=e;for(n=Number(n).toString();n.length<t;)n=`0${n}`;return n},Sae=(e,t,n,r,o)=>{if(o.type==="day"&&o.contentType==="digit-with-letter"){const a=e.setDate(n.longestMonth,t);return e.formatByString(a,o.format)}let i=t.toString();return o.hasLeadingZerosInInput&&(i=xae(i,o.maxLength)),NB(i,r)},k9e=(e,t,n,r,o,i,a,s)=>{const l=I9e(r),c=r==="Home",u=r==="End",d=n.value===""||c||u,f=()=>{const g=o[n.type]({currentDate:a,format:n.format,contentType:n.contentType}),y=C=>Sae(e,C,g,i,n),v=n.type==="minutes"&&(s!=null&&s.minutesStep)?s.minutesStep:1;let S=parseInt(qp(n.value,i),10)+l*v;if(d){if(n.type==="year"&&!u&&!c)return e.formatByString(e.date(void 0,t),n.format);l>0||c?S=g.minimum:S=g.maximum}return S%v!==0&&((l<0||c)&&(S+=v-(v+S)%v),(l>0||u)&&(S-=S%v)),S>g.maximum?y(g.minimum+(S-g.maximum-1)%(g.maximum-g.minimum+1)):S<g.minimum?y(g.maximum-(g.minimum-S-1)%(g.maximum-g.minimum+1)):y(S)},h=()=>{const g=wae(e,t,n.type,n.format);if(g.length===0)return n.value;if(d)return l>0||c?g[0]:g[g.length-1];const x=((g.indexOf(n.value)+l)%g.length+g.length)%g.length;return g[x]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?f():h()},LB=(e,t,n)=>{let r=e.value||e.placeholder;const o=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(r=Number(qp(r,n)).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!o&&r.length===1&&(r=`${r}`),t==="input-rtl"&&(r=`${r}`),r},CK=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),Cae=(e,t)=>e.formatByString(e.date(void 0,"system"),t).length===4,Eae=(e,t,n,r)=>{if(t!=="digit")return!1;const o=e.date(void 0,"default");switch(n){case"year":return Cae(e,r)?e.formatByString(e.setYear(o,1),r)==="0001":e.formatByString(e.setYear(o,2001),r)==="01";case"month":return e.formatByString(e.startOfYear(o),r).length>1;case"day":return e.formatByString(e.startOfMonth(o),r).length>1;case"weekDay":return e.formatByString(e.startOfWeek(o),r).length>1;case"hours":return e.formatByString(e.setHours(o,1),r).length>1;case"minutes":return e.formatByString(e.setMinutes(o,1),r).length>1;case"seconds":return e.formatByString(e.setSeconds(o,1),r).length>1;default:throw new Error("Invalid section type")}},M9e=(e,t,n)=>{const r=t.some(l=>l.type==="day"),o=[],i=[];for(let l=0;l<t.length;l+=1){const c=t[l];r&&c.type==="weekDay"||(o.push(c.format),i.push(LB(c,"non-input",n)))}const a=o.join(" "),s=i.join(" ");return e.parse(s,a)},A9e=e=>e.map(t=>`${t.startSeparator}${t.value||t.placeholder}${t.endSeparator}`).join(""),R9e=(e,t,n)=>{const o=e.map(i=>{const a=LB(i,n?"input-rtl":"input-ltr",t);return`${i.startSeparator}${a}${i.endSeparator}`}).join("");return n?`${o}`:o},D9e=(e,t,n)=>{const r=e.date(void 0,n),o=e.endOfYear(r),i=e.endOfDay(r),{maxDaysInMonth:a,longestMonth:s}=DB(e,r).reduce((l,c)=>{const u=e.getDaysInMonth(c);return u>l.maxDaysInMonth?{maxDaysInMonth:u,longestMonth:c}:l},{maxDaysInMonth:0,longestMonth:null});return{year:({format:l})=>({minimum:0,maximum:Cae(e,l)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(o)+1}),day:({currentDate:l})=>({minimum:1,maximum:l!=null&&e.isValid(l)?e.getDaysInMonth(l):a,longestMonth:s}),weekDay:({format:l,contentType:c})=>{if(c==="digit"){const u=NT(e,l).map(Number);return{minimum:Math.min(...u),maximum:Math.max(...u)}}return{minimum:1,maximum:7}},hours:({format:l})=>{const c=e.getHours(i);return qp(e.formatByString(e.endOfDay(r),l),t)!==c.toString()?{minimum:1,maximum:Number(qp(e.formatByString(e.startOfDay(r),l),t))}:{minimum:0,maximum:c}},minutes:()=>({minimum:0,maximum:e.getMinutes(i)}),seconds:()=>({minimum:0,maximum:e.getSeconds(i)}),meridiem:()=>({minimum:0,maximum:1}),empty:()=>({minimum:0,maximum:0})}},_9e=(e,t,n,r)=>{switch(t.type){case"year":return e.setYear(r,e.getYear(n));case"month":return e.setMonth(r,e.getMonth(n));case"weekDay":{const o=NT(e,t.format),i=e.formatByString(n,t.format),a=o.indexOf(i),l=o.indexOf(t.value)-a;return e.addDays(n,l)}case"day":return e.setDate(r,e.getDate(n));case"meridiem":{const o=e.getHours(n)<12,i=e.getHours(r);return o&&i>=12?e.addHours(r,-12):!o&&i<12?e.addHours(r,12):r}case"hours":return e.setHours(r,e.getHours(n));case"minutes":return e.setMinutes(r,e.getMinutes(n));case"seconds":return e.setSeconds(r,e.getSeconds(n));default:return r}},EK={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8,empty:9},PK=(e,t,n,r,o)=>[...n].sort((i,a)=>EK[i.type]-EK[a.type]).reduce((i,a)=>!o||a.modified?_9e(e,a,t,i):i,r),$9e=()=>navigator.userAgent.toLowerCase().includes("android"),N9e=(e,t)=>{const n={};if(!t)return e.forEach((l,c)=>{const u=c===0?null:c-1,d=c===e.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:d}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,a=0,s=e.length-1;for(;s>=0;){a=e.findIndex((l,c)=>{var u;return c>=i&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),a===-1&&(a=e.length-1);for(let l=a;l>=i;l-=1)o[l]=s,r[s]=l,s-=1;i=a+1}return e.forEach((l,c)=>{const u=o[c],d=u===0?null:r[u-1],f=u===e.length-1?null:r[u+1];n[c]={leftIndex:d,rightIndex:f}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},hL=(e,t)=>{if(e==null)return null;if(e==="all")return"all";if(typeof e=="string"){const n=t.findIndex(r=>r.type===e);return n===-1?null:n}return e},L9e=(e,t)=>{if(e.value)switch(e.type){case"month":{if(e.contentType==="digit")return t.format(t.setMonth(t.date(),Number(e.value)-1),"month");const n=t.parse(e.value,e.format);return n?t.format(n,"month"):void 0}case"day":return e.contentType==="digit"?t.format(t.setDate(t.startOfYear(t.date()),Number(e.value)),"dayOfMonthFull"):e.value;case"weekDay":return;default:return}},F9e=(e,t)=>{if(e.value)switch(e.type){case"weekDay":return e.contentType==="letter"?void 0:Number(e.value);case"meridiem":{const n=t.parse(`01:00 ${e.value}`,`${t.formats.hours12h}:${t.formats.minutes} ${e.format}`);return n?t.getHours(n)>=12?1:0:void 0}case"day":return e.contentType==="digit-with-letter"?parseInt(e.value,10):Number(e.value);case"month":{if(e.contentType==="digit")return Number(e.value);const n=t.parse(e.value,e.format);return n?t.getMonth(n)+1:void 0}default:return e.contentType!=="letter"?Number(e.value):void 0}},j9e=["value","referenceDate"],io={emptyValue:null,getTodayValue:_B,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=We(e,j9e);return t!=null&&r.utils.isValid(t)?t:n??P9e(r)},cleanValue:a9e,areValuesEqual:s9e,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},FB={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r)=>!e.isValid(t)&&!!n?n:r(t),getV7HiddenInputValueFromSections:A9e,getV6InputValueFromSections:R9e,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},jB=({value:e,referenceDate:t,utils:n,props:r,timezone:o})=>{const i=w.useMemo(()=>io.getInitialReferenceValue({value:e,utils:n,props:r,referenceDate:t,granularity:xl.day,timezone:o,getTodayDate:()=>_B(n,o,"date")}),[]);return e??i},B9e=["ampm","ampmInClock","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","showViewSwitcher","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","timezone"],z9e=e=>{const{classes:t}=e;return Oe({root:["root"],arrowSwitcher:["arrowSwitcher"]},q8e,t)},V9e=se($T,{name:"MuiTimeClock",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",position:"relative"}),H9e=se(fae,{name:"MuiTimeClock",slot:"ArrowSwitcher",overridesResolver:(e,t)=>t.arrowSwitcher})({position:"absolute",right:12,top:15}),U9e=["hours","minutes"],W9e=w.forwardRef(function(t,n){const r=In(),o=hn({props:t,name:"MuiTimeClock"}),{ampm:i=r.is12HourCycleInCurrentLocale(),ampmInClock:a=!1,autoFocus:s,slots:l,slotProps:c,value:u,defaultValue:d,referenceDate:f,disableIgnoringDatePartForTimeValidation:h=!1,maxTime:g,minTime:y,disableFuture:v,disablePast:x,minutesStep:S=1,shouldDisableTime:C,showViewSwitcher:I,onChange:E,view:T,views:O=U9e,openTo:A,onViewChange:k,focusedView:M,onFocusedViewChange:R,className:$,disabled:L,readOnly:z,timezone:N}=o,B=We(o,B9e),{value:U,handleValueChange:G,timezone:H}=Uy({name:"TimeClock",timezone:N,value:u,defaultValue:d,referenceDate:f,onChange:E,valueManager:io}),K=jB({value:U,referenceDate:f,utils:r,props:o,timezone:H}),q=Co(),Y=ph(H),{view:J,setView:ie,previousView:ee,nextView:te,setValueAndGoToNextView:ce}=j0({view:T,views:O,openTo:A,onViewChange:k,onChange:G,focusedView:M,onFocusedViewChange:R}),{meridiemMode:ae,handleMeridiemChange:ne}=AT(K,i,ce),ue=w.useCallback((Se,Ee)=>{const ge=F0(h,r),xe=Ee==="hours"||Ee==="minutes"&&O.includes("seconds"),Pe=({start:Le,end:de})=>!(y&&ge(y,de)||g&&ge(Le,g)||v&&ge(Le,Y)||x&&ge(Y,xe?de:Le)),_e=(Le,de=1)=>{if(Le%de!==0)return!1;if(C)switch(Ee){case"hours":return!C(r.setHours(K,Le),"hours");case"minutes":return!C(r.setMinutes(K,Le),"minutes");case"seconds":return!C(r.setSeconds(K,Le),"seconds");default:return!1}return!0};switch(Ee){case"hours":{const Le=Px(Se,ae,i),de=r.setHours(K,Le);if(r.getHours(de)!==Le)return!0;const $e=r.setSeconds(r.setMinutes(de,0),0),Ae=r.setSeconds(r.setMinutes(de,59),59);return!Pe({start:$e,end:Ae})||!_e(Le)}case"minutes":{const Le=r.setMinutes(K,Se),de=r.setSeconds(Le,0),$e=r.setSeconds(Le,59);return!Pe({start:de,end:$e})||!_e(Se,S)}case"seconds":{const Le=r.setSeconds(K,Se);return!Pe({start:Le,end:Le})||!_e(Se)}default:throw new Error("not supported")}},[i,K,h,g,ae,y,S,C,r,v,x,Y,O]),he=Dn(),re=w.useMemo(()=>{switch(J){case"hours":{const Se=(xe,Pe)=>{const _e=Px(xe,ae,i);ce(r.setHours(K,_e),Pe,"hours")},Ee=r.getHours(K);let ge;return i?Ee>12?ge=[12,23]:ge=[0,11]:ge=[0,23],{onChange:Se,viewValue:Ee,children:C9e({value:U,utils:r,ampm:i,getClockNumberText:q.hoursClockNumberText,isDisabled:xe=>L||ue(xe,"hours"),selectedId:he}),viewRange:ge}}case"minutes":{const Se=r.getMinutes(K);return{viewValue:Se,onChange:(ge,xe)=>{ce(r.setMinutes(K,ge),xe,"minutes")},children:wK({utils:r,value:Se,getClockNumberText:q.minutesClockNumberText,isDisabled:ge=>L||ue(ge,"minutes"),selectedId:he}),viewRange:[0,59]}}case"seconds":{const Se=r.getSeconds(K);return{viewValue:Se,onChange:(ge,xe)=>{ce(r.setSeconds(K,ge),xe,"seconds")},children:wK({utils:r,value:Se,getClockNumberText:q.secondsClockNumberText,isDisabled:ge=>L||ue(ge,"seconds"),selectedId:he}),viewRange:[0,59]}}default:throw new Error("You must provide the type for ClockView")}},[J,r,U,i,q.hoursClockNumberText,q.minutesClockNumberText,q.secondsClockNumberText,ae,ce,K,ue,he,L]),le=o,me=z9e(le);return _.jsxs(V9e,F({ref:n,className:fe(me.root,$),ownerState:le},B,{children:[_.jsx(v9e,F({autoFocus:s??!!M,ampmInClock:a&&O.includes("hours"),value:U,type:J,ampm:i,minutesStep:S,isTimeDisabled:ue,meridiemMode:ae,handleMeridiemChange:ne,selectedId:he,disabled:L,readOnly:z},re)),I&&_.jsx(H9e,{className:me.arrowSwitcher,slots:l,slotProps:c,onGoToPrevious:()=>ie(ee),isPreviousDisabled:!ee,previousLabel:q.openPreviousView,onGoToNext:()=>ie(te),isNextDisabled:!te,nextLabel:q.openNextView,ownerState:le})]}))});function G9e(e){return je("MuiDigitalClock",e)}const q9e=Be("MuiDigitalClock",["root","list","item"]);function bm(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const K9e=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation())},Bi=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?Bi(t.shadowRoot):t:null},EP=e=>Array.from(e.children).indexOf(Bi(document)),BB="@media (pointer: fine)",Y9e=["ampm","timeStep","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","views","skipDisabled","timezone"],Q9e=e=>{const{classes:t}=e;return Oe({root:["root"],list:["list"],item:["item"]},G9e,t)},X9e=se($T,{name:"MuiDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})({overflowY:"auto",width:"100%","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},maxHeight:hae,variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]}),J9e=se(wy,{name:"MuiDigitalClock",slot:"List",overridesResolver:(e,t)=>t.list})({padding:0}),Z9e=se(Ft,{name:"MuiDigitalClock",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:"8px 16px",margin:"2px 4px","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.primary.main,e.palette.action.focusOpacity)}})),e7e=w.forwardRef(function(t,n){const r=In(),o=w.useRef(null),i=cn(n,o),a=w.useRef(null),s=hn({props:t,name:"MuiDigitalClock"}),{ampm:l=r.is12HourCycleInCurrentLocale(),timeStep:c=30,autoFocus:u,slots:d,slotProps:f,value:h,defaultValue:g,referenceDate:y,disableIgnoringDatePartForTimeValidation:v=!1,maxTime:x,minTime:S,disableFuture:C,disablePast:I,minutesStep:E=1,shouldDisableTime:T,onChange:O,view:A,openTo:k,onViewChange:M,focusedView:R,onFocusedViewChange:$,className:L,disabled:z,readOnly:N,views:B=["hours"],skipDisabled:U=!1,timezone:G}=s,H=We(s,Y9e),{value:K,handleValueChange:q,timezone:Y}=Uy({name:"DigitalClock",timezone:G,value:h,defaultValue:g,referenceDate:y,onChange:O,valueManager:io}),J=Co(),ie=ph(Y),ee=w.useMemo(()=>F({},s,{alreadyRendered:!!o.current}),[s]),te=Q9e(ee),ce=(d==null?void 0:d.digitalClockItem)??Z9e,ae=Pn({elementType:ce,externalSlotProps:f==null?void 0:f.digitalClockItem,ownerState:{},className:te.item}),ne=jB({value:K,referenceDate:y,utils:r,props:s,timezone:Y}),ue=Qe(ge=>q(ge,"finish","hours")),{setValueAndGoToNextView:he}=j0({view:A,views:B,openTo:k,onViewChange:M,onChange:ue,focusedView:R,onFocusedViewChange:$}),re=Qe(ge=>{he(ge,"finish")});w.useEffect(()=>{if(o.current===null)return;const ge=o.current.querySelector('[role="listbox"] [role="option"][tabindex="0"], [role="listbox"] [role="option"][aria-selected="true"]');if(!ge)return;const xe=ge.offsetTop;(u||R)&&ge.focus(),o.current.scrollTop=xe-4});const le=w.useCallback(ge=>{const xe=F0(v,r),Pe=()=>!(S&&xe(S,ge)||x&&xe(ge,x)||C&&xe(ge,ie)||I&&xe(ie,ge)),_e=()=>r.getMinutes(ge)%E!==0?!1:T?!T(ge,"hours"):!0;return!Pe()||!_e()},[v,r,S,x,C,ie,I,E,T]),me=w.useMemo(()=>{const ge=[];let Pe=r.startOfDay(ne);for(;r.isSameDay(ne,Pe);)ge.push(Pe),Pe=r.addMinutes(Pe,c);return ge},[ne,c,r]),Se=me.findIndex(ge=>r.isEqual(ge,ne)),Ee=ge=>{switch(ge.key){case"PageUp":{const xe=EP(a.current)-5,Pe=a.current.children,_e=Math.max(0,xe),Le=Pe[_e];Le&&Le.focus(),ge.preventDefault();break}case"PageDown":{const xe=EP(a.current)+5,Pe=a.current.children,_e=Math.min(Pe.length-1,xe),Le=Pe[_e];Le&&Le.focus(),ge.preventDefault();break}}};return _.jsx(X9e,F({ref:i,className:fe(te.root,L),ownerState:ee},H,{children:_.jsx(J9e,{ref:a,role:"listbox","aria-label":J.timePickerToolbarTitle,className:te.list,onKeyDown:Ee,children:me.map((ge,xe)=>{if(U&&le(ge))return null;const Pe=r.isEqual(ge,K),_e=r.format(ge,l?"fullTime12h":"fullTime24h"),Le=Se===xe||Se===-1&&xe===0?0:-1;return _.jsx(ce,F({onClick:()=>!N&&re(ge),selected:Pe,disabled:z||le(ge),disableRipple:N,role:"option","aria-disabled":N,"aria-selected":Pe,tabIndex:Le},ae,{children:_e}),`${ge.valueOf()}-${_e}`)})})}))});function t7e(e){return je("MuiMultiSectionDigitalClock",e)}const IK=Be("MuiMultiSectionDigitalClock",["root"]);function n7e(e){return je("MuiMultiSectionDigitalClockSection",e)}const r7e=Be("MuiMultiSectionDigitalClockSection",["root","item"]),o7e=["autoFocus","onChange","className","disabled","readOnly","items","active","slots","slotProps","skipDisabled"],i7e=e=>{const{classes:t}=e;return Oe({root:["root"],item:["item"]},n7e,t)},a7e=se(wy,{name:"MuiMultiSectionDigitalClockSection",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({maxHeight:hae,width:56,padding:0,overflow:"hidden","@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"auto"},"@media (pointer: fine)":{"&:hover":{overflowY:"auto"}},"@media (pointer: none), (pointer: coarse)":{overflowY:"auto"},"&:not(:first-of-type)":{borderLeft:`1px solid ${(e.vars||e).palette.divider}`},"&::after":{display:"block",content:'""',height:"calc(100% - 40px - 6px)"},variants:[{props:{alreadyRendered:!0},style:{"@media (prefers-reduced-motion: no-preference)":{scrollBehavior:"smooth"}}}]})),s7e=se(Ft,{name:"MuiMultiSectionDigitalClockSection",slot:"Item",overridesResolver:(e,t)=>t.item})(({theme:e})=>({padding:8,margin:"2px 4px",width:qb,justifyContent:"center","&:first-of-type":{marginTop:4},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.primary.main,e.palette.action.hoverOpacity)},"&.Mui-selected":{backgroundColor:(e.vars||e).palette.primary.main,color:(e.vars||e).palette.primary.contrastText,"&:focus-visible, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}},"&.Mui-focusVisible":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.primary.main,e.palette.action.focusOpacity)}})),l7e=w.forwardRef(function(t,n){const r=w.useRef(null),o=cn(n,r),i=w.useRef(null),a=hn({props:t,name:"MuiMultiSectionDigitalClockSection"}),{autoFocus:s,onChange:l,className:c,disabled:u,readOnly:d,items:f,active:h,slots:g,slotProps:y,skipDisabled:v}=a,x=We(a,o7e),S=w.useMemo(()=>F({},a,{alreadyRendered:!!r.current}),[a]),C=i7e(S),I=(g==null?void 0:g.digitalClockSectionItem)??s7e;w.useEffect(()=>{if(r.current===null)return;const O=r.current.querySelector('[role="option"][tabindex="0"], [role="option"][aria-selected="true"]');if(h&&s&&O&&O.focus(),!O||i.current===O)return;i.current=O;const A=O.offsetTop;r.current.scrollTop=A-4});const E=f.findIndex(O=>O.isFocused(O.value)),T=O=>{switch(O.key){case"PageUp":{const A=EP(r.current)-5,k=r.current.children,M=Math.max(0,A),R=k[M];R&&R.focus(),O.preventDefault();break}case"PageDown":{const A=EP(r.current)+5,k=r.current.children,M=Math.min(k.length-1,A),R=k[M];R&&R.focus(),O.preventDefault();break}}};return _.jsx(a7e,F({ref:o,className:fe(C.root,c),ownerState:S,autoFocusItem:s&&h,role:"listbox",onKeyDown:T},x,{children:f.map((O,A)=>{var L;const k=(L=O.isDisabled)==null?void 0:L.call(O,O.value),M=u||k;if(v&&M)return null;const R=O.isSelected(O.value),$=E===A||E===-1&&A===0?0:-1;return _.jsx(I,F({onClick:()=>!d&&l(O.value),selected:R,disabled:M,disableRipple:d,role:"option","aria-disabled":d||M||void 0,"aria-label":O.ariaLabel,"aria-selected":R,tabIndex:$,className:C.item},y==null?void 0:y.digitalClockSectionItem,{children:O.label}),O.label)})}))}),c7e=({now:e,value:t,utils:n,ampm:r,isDisabled:o,resolveAriaLabel:i,timeStep:a,valueOrReferenceDate:s})=>{const l=t?n.getHours(t):null,c=[],u=(h,g)=>{const y=g??l;return y===null?!1:r?h===12?y===12||y===0:y===h||y-12===h:y===h},d=h=>u(h,n.getHours(s)),f=r?11:23;for(let h=0;h<=f;h+=a){let g=n.format(n.setHours(e,h),r?"hours12h":"hours24h");const y=i(parseInt(g,10).toString());g=n.formatNumber(g),c.push({value:h,label:g,isSelected:u,isDisabled:o,isFocused:d,ariaLabel:y})}return c},TK=({value:e,utils:t,isDisabled:n,timeStep:r,resolveLabel:o,resolveAriaLabel:i,hasValue:a=!0})=>{const s=c=>e===null?!1:a&&e===c,l=c=>e===c;return[...Array.from({length:Math.ceil(60/r)},(c,u)=>{const d=r*u;return{value:d,label:t.formatNumber(o(d)),isDisabled:n,isSelected:s,isFocused:l,ariaLabel:i(d.toString())}})]},u7e=["ampm","timeSteps","autoFocus","slots","slotProps","value","defaultValue","referenceDate","disableIgnoringDatePartForTimeValidation","maxTime","minTime","disableFuture","disablePast","minutesStep","shouldDisableTime","onChange","view","views","openTo","onViewChange","focusedView","onFocusedViewChange","className","disabled","readOnly","skipDisabled","timezone"],d7e=e=>{const{classes:t}=e;return Oe({root:["root"]},t7e,t)},f7e=se($T,{name:"MuiMultiSectionDigitalClock",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"row",width:"100%",borderBottom:`1px solid ${(e.vars||e).palette.divider}`})),p7e=w.forwardRef(function(t,n){const r=In(),o=Yn(),i=hn({props:t,name:"MuiMultiSectionDigitalClock"}),{ampm:a=r.is12HourCycleInCurrentLocale(),timeSteps:s,autoFocus:l,slots:c,slotProps:u,value:d,defaultValue:f,referenceDate:h,disableIgnoringDatePartForTimeValidation:g=!1,maxTime:y,minTime:v,disableFuture:x,disablePast:S,minutesStep:C=1,shouldDisableTime:I,onChange:E,view:T,views:O=["hours","minutes"],openTo:A,onViewChange:k,focusedView:M,onFocusedViewChange:R,className:$,disabled:L,readOnly:z,skipDisabled:N=!1,timezone:B}=i,U=We(i,u7e),{value:G,handleValueChange:H,timezone:K}=Uy({name:"MultiSectionDigitalClock",timezone:B,value:d,defaultValue:f,referenceDate:h,onChange:E,valueManager:io}),q=Co(),Y=ph(K),J=w.useMemo(()=>F({hours:1,minutes:5,seconds:5},s),[s]),ie=jB({value:G,referenceDate:h,utils:r,props:i,timezone:K}),ee=Qe((Pe,_e,Le)=>H(Pe,_e,Le)),te=w.useMemo(()=>!a||!O.includes("hours")||O.includes("meridiem")?O:[...O,"meridiem"],[a,O]),{view:ce,setValueAndGoToNextView:ae,focusedView:ne}=j0({view:T,views:te,openTo:A,onViewChange:k,onChange:ee,focusedView:M,onFocusedViewChange:R}),ue=Qe(Pe=>{ae(Pe,"finish","meridiem")}),{meridiemMode:he,handleMeridiemChange:re}=AT(ie,a,ue,"finish"),le=w.useCallback((Pe,_e)=>{const Le=F0(g,r),de=_e==="hours"||_e==="minutes"&&te.includes("seconds"),$e=({start:Ne,end:Ue})=>!(v&&Le(v,Ue)||y&&Le(Ne,y)||x&&Le(Ne,Y)||S&&Le(Y,de?Ue:Ne)),Ae=(Ne,Ue=1)=>{if(Ne%Ue!==0)return!1;if(I)switch(_e){case"hours":return!I(r.setHours(ie,Ne),"hours");case"minutes":return!I(r.setMinutes(ie,Ne),"minutes");case"seconds":return!I(r.setSeconds(ie,Ne),"seconds");default:return!1}return!0};switch(_e){case"hours":{const Ne=Px(Pe,he,a),Ue=r.setHours(ie,Ne);if(r.getHours(Ue)!==Ne)return!0;const Ze=r.setSeconds(r.setMinutes(Ue,0),0),ut=r.setSeconds(r.setMinutes(Ue,59),59);return!$e({start:Ze,end:ut})||!Ae(Ne)}case"minutes":{const Ne=r.setMinutes(ie,Pe),Ue=r.setSeconds(Ne,0),Ze=r.setSeconds(Ne,59);return!$e({start:Ue,end:Ze})||!Ae(Pe,C)}case"seconds":{const Ne=r.setSeconds(ie,Pe);return!$e({start:Ne,end:Ne})||!Ae(Pe)}default:throw new Error("not supported")}},[a,ie,g,y,he,v,C,I,r,x,S,Y,te]),me=w.useCallback(Pe=>{switch(Pe){case"hours":return{onChange:_e=>{const Le=Px(_e,he,a);ae(r.setHours(ie,Le),"finish","hours")},items:c7e({now:Y,value:G,ampm:a,utils:r,isDisabled:_e=>le(_e,"hours"),timeStep:J.hours,resolveAriaLabel:q.hoursClockNumberText,valueOrReferenceDate:ie})};case"minutes":return{onChange:_e=>{ae(r.setMinutes(ie,_e),"finish","minutes")},items:TK({value:r.getMinutes(ie),utils:r,isDisabled:_e=>le(_e,"minutes"),resolveLabel:_e=>r.format(r.setMinutes(Y,_e),"minutes"),timeStep:J.minutes,hasValue:!!G,resolveAriaLabel:q.minutesClockNumberText})};case"seconds":return{onChange:_e=>{ae(r.setSeconds(ie,_e),"finish","seconds")},items:TK({value:r.getSeconds(ie),utils:r,isDisabled:_e=>le(_e,"seconds"),resolveLabel:_e=>r.format(r.setSeconds(Y,_e),"seconds"),timeStep:J.seconds,hasValue:!!G,resolveAriaLabel:q.secondsClockNumberText})};case"meridiem":{const _e=Il(r,"am"),Le=Il(r,"pm");return{onChange:re,items:[{value:"am",label:_e,isSelected:()=>!!G&&he==="am",isFocused:()=>!!ie&&he==="am",ariaLabel:_e},{value:"pm",label:Le,isSelected:()=>!!G&&he==="pm",isFocused:()=>!!ie&&he==="pm",ariaLabel:Le}]}}default:throw new Error(`Unknown view: ${Pe} found.`)}},[Y,G,a,r,J.hours,J.minutes,J.seconds,q.hoursClockNumberText,q.minutesClockNumberText,q.secondsClockNumberText,he,ae,ie,le,re]),Se=w.useMemo(()=>{if(!o)return te;const Pe=te.filter(_e=>_e!=="meridiem");return Pe.reverse(),te.includes("meridiem")&&Pe.push("meridiem"),Pe},[o,te]),Ee=w.useMemo(()=>te.reduce((Pe,_e)=>F({},Pe,{[_e]:me(_e)}),{}),[te,me]),ge=i,xe=d7e(ge);return _.jsx(f7e,F({ref:n,className:fe(xe.root,$),ownerState:ge,role:"group"},U,{children:Se.map(Pe=>_.jsx(l7e,{items:Ee[Pe].items,onChange:Ee[Pe].onChange,active:ce===Pe,autoFocus:l??ne===Pe,disabled:L,readOnly:z,slots:c,slotProps:u,skipDisabled:N,"aria-label":q.selectViewText(Pe)},Pe))}))});function h7e(e){return je("MuiPickersDay",e)}const qf=Be("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),m7e=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],g7e=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:i,outsideCurrentMonth:a,showDaysOutsideCurrentMonth:s,classes:l}=e,c=a&&!s;return Oe({root:["root",t&&!c&&"selected",i&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",a&&s&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},h7e,l)},Pae=({theme:e})=>F({},e.typography.caption,{width:Ix,height:Ix,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${qf.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${qf.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${qf.disabled}:not(.${qf.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${qf.disabled}&.${qf.selected}`]:{opacity:.6},variants:[{props:{disableMargin:!1},style:{margin:`0 ${RT}px`}},{props:{outsideCurrentMonth:!0,showDaysOutsideCurrentMonth:!0},style:{color:(e.vars||e).palette.text.secondary}},{props:{disableHighlightToday:!1,today:!0},style:{[`&:not(.${qf.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}}]}),Iae=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},y7e=se(qi,{name:"MuiPickersDay",slot:"Root",overridesResolver:Iae})(Pae),v7e=se("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:Iae})(({theme:e})=>F({},Pae({theme:e}),{opacity:0,pointerEvents:"none"})),gb=()=>{},b7e=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:a,disabled:s=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:d,onDaySelect:f,onFocus:h=gb,onBlur:g=gb,onKeyDown:y=gb,onMouseDown:v=gb,onMouseEnter:x=gb,outsideCurrentMonth:S,selected:C=!1,showDaysOutsideCurrentMonth:I=!1,children:E,today:T=!1}=r,O=We(r,m7e),A=F({},r,{autoFocus:o,disabled:s,disableHighlightToday:l,disableMargin:c,selected:C,showDaysOutsideCurrentMonth:I,today:T}),k=g7e(A),M=In(),R=w.useRef(null),$=cn(R,n);On(()=>{o&&!s&&!u&&!S&&R.current.focus()},[o,s,u,S]);const L=N=>{v(N),S&&N.preventDefault()},z=N=>{s||f(a),S&&N.currentTarget.focus(),d&&d(N)};return S&&!I?_.jsx(v7e,{className:fe(k.root,k.hiddenDaySpacingFiller,i),ownerState:A,role:O.role}):_.jsx(y7e,F({className:fe(k.root,i),ref:$,centerRipple:!0,disabled:s,tabIndex:C?0:-1,onKeyDown:N=>y(N,a),onFocus:N=>h(N,a),onBlur:N=>g(N,a),onMouseEnter:N=>x(N,a),onClick:z,onMouseDown:L},O,{ownerState:A,children:E||M.format(a,"dayOfMonth")}))}),w7e=w.memo(b7e),Wy=({props:e,value:t,timezone:n,adapter:r})=>{if(t===null)return null;const{shouldDisableDate:o,shouldDisableMonth:i,shouldDisableYear:a,disablePast:s,disableFuture:l}=e,c=r.utils.date(void 0,n),u=Oi(r.utils,e.minDate,r.defaultDates.minDate),d=Oi(r.utils,e.maxDate,r.defaultDates.maxDate);switch(!0){case!r.utils.isValid(t):return"invalidDate";case!!(o&&o(t)):return"shouldDisableDate";case!!(i&&i(t)):return"shouldDisableMonth";case!!(a&&a(t)):return"shouldDisableYear";case!!(l&&r.utils.isAfterDay(t,c)):return"disableFuture";case!!(s&&r.utils.isBeforeDay(t,c)):return"disablePast";case!!(u&&r.utils.isBeforeDay(t,u)):return"minDate";case!!(d&&r.utils.isAfterDay(t,d)):return"maxDate";default:return null}};Wy.valueManager=io;const B0=({adapter:e,value:t,timezone:n,props:r})=>{if(t===null)return null;const{minTime:o,maxTime:i,minutesStep:a,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:l=!1,disablePast:c,disableFuture:u}=r,d=e.utils.date(void 0,n),f=F0(l,e.utils);switch(!0){case!e.utils.isValid(t):return"invalidDate";case!!(o&&f(o,t)):return"minTime";case!!(i&&f(t,i)):return"maxTime";case!!(u&&e.utils.isAfter(t,d)):return"disableFuture";case!!(c&&e.utils.isBefore(t,d)):return"disablePast";case!!(s&&s(t,"hours")):return"shouldDisableTime-hours";case!!(s&&s(t,"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(t,"seconds")):return"shouldDisableTime-seconds";case!!(a&&e.utils.getMinutes(t)%a!==0):return"minutesStep";default:return null}};B0.valueManager=io;const LT=({adapter:e,value:t,timezone:n,props:r})=>{const o=Wy({adapter:e,value:t,timezone:n,props:r});return o!==null?o:B0({adapter:e,value:t,timezone:n,props:r})};LT.valueManager=io;const mL=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],gL=["disablePast","disableFuture","minTime","maxTime","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],Tae=["minDateTime","maxDateTime"],x7e=[...mL,...gL,...Tae],Gy=e=>x7e.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{});function Oae(e){const{props:t,validator:n,value:r,timezone:o,onError:i}=e,a=dh(),s=w.useRef(n.valueManager.defaultErrorState),l=n({adapter:a,value:r,timezone:o,props:t}),c=n.valueManager.hasError(l);w.useEffect(()=>{i&&!n.valueManager.isSameError(l,s.current)&&i(l,r),s.current=l},[n,i,l,r]);const u=Qe(d=>n({adapter:a,value:d,timezone:o,props:t}));return{validationError:l,hasValidationError:c,getValidationErrorForNewValue:u}}const S7e=({utils:e,format:t})=>{let n=10,r=t,o=e.expandFormat(t);for(;o!==r;)if(r=o,o=e.expandFormat(r),n-=1,n<0)throw new Error("MUI X: The format expansion seems to be in an infinite loop. Please open an issue with the format passed to the picker component.");return o},C7e=({utils:e,expandedFormat:t})=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let a=null;for(;a=i.exec(t);)n.push({start:a.index,end:i.lastIndex-1});return n},E7e=(e,t,n,r)=>{switch(n.type){case"year":return t.fieldYearPlaceholder({digitAmount:e.formatByString(e.date(void 0,"default"),r).length,format:r});case"month":return t.fieldMonthPlaceholder({contentType:n.contentType,format:r});case"day":return t.fieldDayPlaceholder({format:r});case"weekDay":return t.fieldWeekDayPlaceholder({contentType:n.contentType,format:r});case"hours":return t.fieldHoursPlaceholder({format:r});case"minutes":return t.fieldMinutesPlaceholder({format:r});case"seconds":return t.fieldSecondsPlaceholder({format:r});case"meridiem":return t.fieldMeridiemPlaceholder({format:r});default:return r}},P7e=({utils:e,date:t,shouldRespectLeadingZeros:n,localeText:r,localizedDigits:o,now:i,token:a,startSeparator:s})=>{if(a==="")throw new Error("MUI X: Should not call `commitToken` with an empty token");const l=bae(e,a),c=Eae(e,l.contentType,l.type,a),u=n?c:l.contentType==="digit",d=t!=null&&e.isValid(t);let f=d?e.formatByString(t,a):"",h=null;if(u)if(c)h=f===""?e.formatByString(i,a).length:f.length;else{if(l.maxLength==null)throw new Error(`MUI X: The token ${a} should have a 'maxDigitNumber' property on it's adapter`);h=l.maxLength,d&&(f=NB(xae(qp(f,o),h),o))}return F({},l,{format:a,maxLength:h,value:f,placeholder:E7e(e,r,l,a),hasLeadingZerosInFormat:c,hasLeadingZerosInInput:u,startSeparator:s,endSeparator:"",modified:!1})},I7e=e=>{var h;const{utils:t,expandedFormat:n,escapedParts:r}=e,o=t.date(void 0),i=[];let a="";const s=Object.keys(t.formatTokenMap).sort((g,y)=>y.length-g.length),l=/^([a-zA-Z]+)/,c=new RegExp(`^(${s.join("|")})*$`),u=new RegExp(`^(${s.join("|")})`),d=g=>r.find(y=>y.start<=g&&y.end>=g);let f=0;for(;f<n.length;){const g=d(f),y=g!=null,v=(h=l.exec(n.slice(f)))==null?void 0:h[1];if(!y&&v!=null&&c.test(v)){let x=v;for(;x.length>0;){const S=u.exec(x)[1];x=x.slice(S.length),i.push(P7e(F({},e,{now:o,token:S,startSeparator:a}))),a=""}f+=v.length}else{const x=n[f];y&&(g==null?void 0:g.start)===f||(g==null?void 0:g.end)===f||(i.length===0?a+=x:i[i.length-1].endSeparator+=x),f+=1}}return i.length===0&&a.length>0&&i.push({type:"empty",contentType:"letter",maxLength:null,format:"",value:"",placeholder:"",hasLeadingZerosInFormat:!1,hasLeadingZerosInInput:!1,startSeparator:a,endSeparator:"",modified:!1}),i},T7e=({isRtl:e,formatDensity:t,sections:n})=>n.map(r=>{const o=i=>{let a=i;return e&&a!==null&&a.includes(" ")&&(a=`${a}`),t==="spacious"&&["/",".","-"].includes(a)&&(a=` ${a} `),a};return r.startSeparator=o(r.startSeparator),r.endSeparator=o(r.endSeparator),r}),OK=e=>{let t=S7e(e);e.isRtl&&e.enableAccessibleFieldDOMStructure&&(t=t.split(" ").reverse().join(" "));const n=C7e(F({},e,{expandedFormat:t})),r=I7e(F({},e,{expandedFormat:t,escapedParts:n}));return T7e(F({},e,{sections:r}))},O7e=e=>{const t=In(),n=Co(),r=dh(),o=Yn(),{valueManager:i,fieldValueManager:a,valueType:s,validator:l,internalProps:c,internalProps:{value:u,defaultValue:d,referenceDate:f,onChange:h,format:g,formatDensity:y="dense",selectedSections:v,onSelectedSectionsChange:x,shouldRespectLeadingZeros:S=!1,timezone:C,enableAccessibleFieldDOMStructure:I=!1}}=e,{timezone:E,value:T,handleValueChange:O}=$B({timezone:C,value:u,defaultValue:d,referenceDate:f,onChange:h,valueManager:i}),A=w.useMemo(()=>O9e(t),[t]),k=w.useMemo(()=>D9e(t,A,E),[t,A,E]),M=w.useCallback((ee,te=null)=>a.getSectionsFromValue(t,ee,te,ce=>OK({utils:t,localeText:n,localizedDigits:A,format:g,date:ce,formatDensity:y,shouldRespectLeadingZeros:S,enableAccessibleFieldDOMStructure:I,isRtl:o})),[a,g,n,A,o,S,t,y,I]),[R,$]=w.useState(()=>{const ee=M(T),te={sections:ee,value:T,referenceValue:i.emptyValue,tempValueStrAndroid:null},ce=E9e(ee),ae=i.getInitialReferenceValue({referenceDate:f,value:T,utils:t,props:c,granularity:ce,timezone:E});return F({},te,{referenceValue:ae})}),[L,z]=Ei({controlled:v,default:null,name:"useField",state:"selectedSections"}),N=ee=>{z(ee),x==null||x(ee)},B=w.useMemo(()=>hL(L,R.sections),[L,R.sections]),U=B==="all"?0:B,G=({value:ee,referenceValue:te,sections:ce})=>{if($(ne=>F({},ne,{sections:ce,value:ee,referenceValue:te,tempValueStrAndroid:null})),i.areValuesEqual(t,R.value,ee))return;const ae={validationError:l({adapter:r,value:ee,timezone:E,props:c})};O(ee,ae)},H=(ee,te)=>{const ce=[...R.sections];return ce[ee]=F({},ce[ee],{value:te,modified:!0}),ce},K=()=>{G({value:i.emptyValue,referenceValue:R.referenceValue,sections:M(i.emptyValue)})},q=()=>{if(U==null)return;const ee=R.sections[U],te=a.getActiveDateManager(t,R,ee),ae=te.getSections(R.sections).filter(re=>re.value!=="").length===(ee.value===""?0:1),ne=H(U,""),ue=ae?null:t.getInvalidDate(),he=te.getNewValuesFromNewActiveDate(ue);G(F({},he,{sections:ne}))},Y=ee=>{const te=(ne,ue)=>{const he=t.parse(ne,g);if(he==null||!t.isValid(he))return null;const re=OK({utils:t,localeText:n,localizedDigits:A,format:g,date:he,formatDensity:y,shouldRespectLeadingZeros:S,enableAccessibleFieldDOMStructure:I,isRtl:o});return PK(t,he,re,ue,!1)},ce=a.parseValueStr(ee,R.referenceValue,te),ae=a.updateReferenceValue(t,ce,R.referenceValue);G({value:ce,referenceValue:ae,sections:M(ce,R.sections)})},J=({activeSection:ee,newSectionValue:te,shouldGoToNextSection:ce})=>{ce&&U<R.sections.length-1&&N(U+1);const ae=a.getActiveDateManager(t,R,ee),ne=H(U,te),ue=ae.getSections(ne),he=M9e(t,ue,A);let re,le;if(he!=null&&t.isValid(he)){const me=PK(t,he,ue,ae.referenceDate,!0);re=ae.getNewValuesFromNewActiveDate(me),le=!0}else re=ae.getNewValuesFromNewActiveDate(he),le=(he!=null&&!t.isValid(he))!=(ae.date!=null&&!t.isValid(ae.date));return le?G(F({},re,{sections:ne})):$(me=>F({},me,re,{sections:ne,tempValueStrAndroid:null}))},ie=ee=>$(te=>F({},te,{tempValueStrAndroid:ee}));return w.useEffect(()=>{const ee=M(R.value);$(te=>F({},te,{sections:ee}))},[g,t.locale,o]),w.useEffect(()=>{let ee;i.areValuesEqual(t,R.value,T)?ee=i.getTimezone(t,R.value)!==i.getTimezone(t,T):ee=!0,ee&&$(te=>F({},te,{value:T,referenceValue:a.updateReferenceValue(t,T,te.referenceValue),sections:M(T)}))},[T]),{state:R,activeSectionIndex:U,parsedSelectedSections:B,setSelectedSections:N,clearValue:K,clearActiveSection:q,updateSectionValue:J,updateValueFromValueStr:Y,setTempAndroidValueStr:ie,getSectionsFromValue:M,sectionsValueBoundaries:k,localizedDigits:A,timezone:E}},k7e=5e3,sm=e=>e.saveQuery!=null,M7e=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,localizedDigits:r,setTempAndroidValueStr:o,timezone:i})=>{const a=In(),[s,l]=w.useState(null),c=Qe(()=>l(null));w.useEffect(()=>{var g;s!=null&&((g=e[s.sectionIndex])==null?void 0:g.type)!==s.sectionType&&c()},[e,s,c]),w.useEffect(()=>{if(s!=null){const g=setTimeout(()=>c(),k7e);return()=>{clearTimeout(g)}}return()=>{}},[s,c]);const u=({keyPressed:g,sectionIndex:y},v,x)=>{const S=g.toLowerCase(),C=e[y];if(s!=null&&(!x||x(s.value))&&s.sectionIndex===y){const E=`${s.value}${S}`,T=v(E,C);if(!sm(T))return l({sectionIndex:y,value:E,sectionType:C.type}),T}const I=v(S,C);return sm(I)&&!I.saveQuery?(c(),null):(l({sectionIndex:y,value:S,sectionType:C.type}),sm(I)?null:I)},d=g=>{const y=(S,C,I)=>{const E=C.filter(T=>T.toLowerCase().startsWith(I));return E.length===0?{saveQuery:!1}:{sectionValue:E[0],shouldGoToNextSection:E.length===1}},v=(S,C,I,E)=>{const T=O=>wae(a,i,C.type,O);if(C.contentType==="letter")return y(C.format,T(C.format),S);if(I&&E!=null&&bae(a,I).contentType==="letter"){const O=T(I),A=y(I,O,S);return sm(A)?{saveQuery:!1}:F({},A,{sectionValue:E(A.sectionValue,O)})}return{saveQuery:!1}};return u(g,(S,C)=>{switch(C.type){case"month":{const I=E=>CK(a,E,a.formats.month,C.format);return v(S,C,a.formats.month,I)}case"weekDay":{const I=(E,T)=>T.indexOf(E).toString();return v(S,C,a.formats.weekday,I)}case"meridiem":return v(S,C);default:return{saveQuery:!1}}})},f=g=>{const y=(x,S)=>{const C=qp(x,r),I=Number(C),E=n[S.type]({currentDate:null,format:S.format,contentType:S.contentType});if(I>E.maximum)return{saveQuery:!1};if(I<E.minimum)return{saveQuery:!0};const T=I*10>E.maximum||C.length===E.maximum.toString().length;return{sectionValue:Sae(a,I,E,r,S),shouldGoToNextSection:T}};return u(g,(x,S)=>{if(S.contentType==="digit"||S.contentType==="digit-with-letter")return y(x,S);if(S.type==="month"){Eae(a,"digit","month","MM");const C=y(x,{type:S.type,format:"MM",hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(sm(C))return C;const I=CK(a,C.sectionValue,"MM",S.format);return F({},C,{sectionValue:I})}if(S.type==="weekDay"){const C=y(x,S);if(sm(C))return C;const I=NT(a,S.format)[Number(C.sectionValue)-1];return F({},C,{sectionValue:I})}return{saveQuery:!1}},x=>SK(x,r))};return{applyCharacterEditing:Qe(g=>{const y=e[g.sectionIndex],x=SK(g.keyPressed,r)?f(F({},g,{keyPressed:NB(g.keyPressed,r)})):d(g);if(x==null){o(null);return}t({activeSection:y,newSectionValue:x.sectionValue,shouldGoToNextSection:x.shouldGoToNextSection})}),resetCharacterQuery:c}},A7e=e=>{const{internalProps:{disabled:t,readOnly:n=!1},forwardedProps:{sectionListRef:r,onBlur:o,onClick:i,onFocus:a,onInput:s,onPaste:l,focused:c,autoFocus:u=!1},fieldValueManager:d,applyCharacterEditing:f,resetCharacterQuery:h,setSelectedSections:g,parsedSelectedSections:y,state:v,clearActiveSection:x,clearValue:S,updateSectionValue:C,updateValueFromValueStr:I,sectionOrder:E,areAllSectionsEmpty:T,sectionsValueBoundaries:O}=e,A=w.useRef(null),k=cn(r,A),M=Co(),R=In(),$=Dn(),[L,z]=w.useState(!1),N=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!A.current)return;const le=document.getSelection();if(!le)return;if(y==null){le.rangeCount>0&&A.current.getRoot().contains(le.getRangeAt(0).startContainer)&&le.removeAllRanges(),L&&A.current.getRoot().blur();return}if(!A.current.getRoot().contains(Bi(document)))return;const me=new window.Range;let Se;y==="all"?Se=A.current.getRoot():v.sections[y].type==="empty"?Se=A.current.getSectionContainer(y):Se=A.current.getSectionContent(y),me.selectNodeContents(Se),Se.focus(),le.removeAllRanges(),le.addRange(me)},getActiveSectionIndexFromDOM:()=>{const le=Bi(document);return!le||!A.current||!A.current.getRoot().contains(le)?null:A.current.getSectionIndexFromDOMElement(le)},focusField:(le=0)=>{if(!A.current||N.getActiveSectionIndexFromDOM()!=null)return;const me=hL(le,v.sections);z(!0),A.current.getSectionContent(me).focus()},setSelectedSections:le=>{if(!A.current)return;const me=hL(le,v.sections);z((me==="all"?0:me)!==null),g(le)},isFieldFocused:()=>{const le=Bi(document);return!!A.current&&A.current.getRoot().contains(le)}}),[y,g,v.sections,L]),B=Qe(le=>{if(!A.current)return;const me=v.sections[le];A.current.getSectionContent(le).innerHTML=me.value||me.placeholder,N.syncSelectionToDOM()}),U=Qe((le,...me)=>{le.isDefaultPrevented()||!A.current||(z(!0),i==null||i(le,...me),y==="all"?setTimeout(()=>{const Se=document.getSelection().getRangeAt(0).startOffset;if(Se===0){g(E.startIndex);return}let Ee=0,ge=0;for(;ge<Se&&Ee<v.sections.length;){const xe=v.sections[Ee];Ee+=1,ge+=`${xe.startSeparator}${xe.value||xe.placeholder}${xe.endSeparator}`.length}g(Ee-1)}):L?A.current.getRoot().contains(le.target)||g(E.startIndex):(z(!0),g(E.startIndex)))}),G=Qe(le=>{if(s==null||s(le),!A.current||y!=="all")return;const Se=le.target.textContent??"";A.current.getRoot().innerHTML=v.sections.map(Ee=>`${Ee.startSeparator}${Ee.value||Ee.placeholder}${Ee.endSeparator}`).join(""),N.syncSelectionToDOM(),Se.length===0||Se.charCodeAt(0)===10?(h(),S(),g("all")):Se.length>1?I(Se):(y==="all"&&g(0),f({keyPressed:Se,sectionIndex:0}))}),H=Qe(le=>{if(l==null||l(le),n||y!=="all"){le.preventDefault();return}const me=le.clipboardData.getData("text");le.preventDefault(),h(),I(me)}),K=Qe((...le)=>{if(a==null||a(...le),L||!A.current)return;z(!0),A.current.getSectionIndexFromDOMElement(Bi(document))!=null||g(E.startIndex)}),q=Qe((...le)=>{o==null||o(...le),setTimeout(()=>{if(!A.current)return;const me=Bi(document);!A.current.getRoot().contains(me)&&(z(!1),g(null))})}),Y=Qe(le=>me=>{me.isDefaultPrevented()||g(le)}),J=Qe(le=>{le.preventDefault()}),ie=Qe(le=>()=>{g(le)}),ee=Qe(le=>{if(le.preventDefault(),n||t||typeof y!="number")return;const me=v.sections[y],Se=le.clipboardData.getData("text"),Ee=/^[a-zA-Z]+$/.test(Se),ge=/^[0-9]+$/.test(Se),xe=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(Se);me.contentType==="letter"&&Ee||me.contentType==="digit"&&ge||me.contentType==="digit-with-letter"&&xe?(h(),C({activeSection:me,newSectionValue:Se,shouldGoToNextSection:!0})):!Ee&&!ge&&(h(),I(Se))}),te=Qe(le=>{le.preventDefault(),le.dataTransfer.dropEffect="none"}),ce=Qe(le=>{if(!A.current)return;const me=le.target,Se=me.textContent??"",Ee=A.current.getSectionIndexFromDOMElement(me),ge=v.sections[Ee];if(n||!A.current){B(Ee);return}if(Se.length===0){if(ge.value===""){B(Ee);return}const xe=le.nativeEvent.inputType;if(xe==="insertParagraph"||xe==="insertLineBreak"){B(Ee);return}h(),x();return}f({keyPressed:Se,sectionIndex:Ee}),B(Ee)});On(()=>{if(!(!L||!A.current)){if(y==="all")A.current.getRoot().focus();else if(typeof y=="number"){const le=A.current.getSectionContent(y);le&&le.focus()}}},[y,L]);const ae=w.useMemo(()=>v.sections.reduce((le,me)=>(le[me.type]=O[me.type]({currentDate:null,contentType:me.contentType,format:me.format}),le),{}),[O,v.sections]),ne=y==="all",ue=w.useMemo(()=>v.sections.map((le,me)=>{const Se=!ne&&!t&&!n;return{container:{"data-sectionindex":me,onClick:Y(me)},content:{tabIndex:ne||me>0?-1:0,contentEditable:!ne&&!t&&!n,role:"spinbutton",id:`${$}-${le.type}`,"aria-labelledby":`${$}-${le.type}`,"aria-readonly":n,"aria-valuenow":F9e(le,R),"aria-valuemin":ae[le.type].minimum,"aria-valuemax":ae[le.type].maximum,"aria-valuetext":le.value?L9e(le,R):M.empty,"aria-label":M[le.type],"aria-disabled":t,spellCheck:Se?!1:void 0,autoCapitalize:Se?"off":void 0,autoCorrect:Se?"off":void 0,[parseInt(w.version,10)>=17?"enterKeyHint":"enterkeyhint"]:Se?"next":void 0,children:le.value||le.placeholder,onInput:ce,onPaste:ee,onFocus:ie(me),onDragOver:te,onMouseUp:J,inputMode:le.contentType==="letter"?"text":"numeric"},before:{children:le.startSeparator},after:{children:le.endSeparator}}}),[v.sections,ie,ee,te,ce,Y,J,t,n,ne,M,R,ae,$]),he=Qe(le=>{I(le.target.value)}),re=w.useMemo(()=>T?"":d.getV7HiddenInputValueFromSections(v.sections),[T,v.sections,d]);return w.useEffect(()=>{if(A.current==null)throw new Error(["MUI X: The `sectionListRef` prop has not been initialized by `PickersSectionList`","You probably tried to pass a component to the `textField` slot that contains an `<input />` element instead of a `PickersSectionList`.","","If you want to keep using an `<input />` HTML element for the editing, please remove the `enableAccessibleFieldDOMStructure` prop from your picker or field component:","","<DatePicker slots={{ textField: MyCustomTextField }} />","","Learn more about the field accessible DOM structure on the MUI documentation: https://mui.com/x/react-date-pickers/fields/#fields-to-edit-a-single-element"].join(`+`));u&&A.current&&A.current.getSectionContent(E.startIndex).focus()},[]),{interactions:N,returnedValue:{autoFocus:u,readOnly:n,focused:c??L,sectionListRef:k,onBlur:q,onClick:U,onFocus:K,onInput:G,onPaste:H,enableAccessibleFieldDOMStructure:!0,elements:ue,tabIndex:y===0?-1:0,contentEditable:ne,value:re,onChange:he,areAllSectionsEmpty:T}}},Mm=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),R7e=(e,t,n)=>{let r=0,o=n?1:0;const i=[];for(let a=0;a<e.length;a+=1){const s=e[a],l=LB(s,n?"input-rtl":"input-ltr",t),c=`${s.startSeparator}${l}${s.endSeparator}`,u=Mm(c).length,d=c.length,f=Mm(l),h=o+(f===""?0:l.indexOf(f[0]))+s.startSeparator.length,g=h+f.length;i.push(F({},s,{start:r,end:r+u,startInInput:h,endInInput:g})),r+=u,o+=d}return i},D7e=e=>{const t=Yn(),n=w.useRef(void 0),r=w.useRef(void 0),{forwardedProps:{onFocus:o,onClick:i,onPaste:a,onBlur:s,inputRef:l,placeholder:c},internalProps:{readOnly:u=!1,disabled:d=!1},parsedSelectedSections:f,activeSectionIndex:h,state:g,fieldValueManager:y,valueManager:v,applyCharacterEditing:x,resetCharacterQuery:S,updateSectionValue:C,updateValueFromValueStr:I,clearActiveSection:E,clearValue:T,setTempAndroidValueStr:O,setSelectedSections:A,getSectionsFromValue:k,areAllSectionsEmpty:M,localizedDigits:R}=e,$=w.useRef(null),L=cn(l,$),z=w.useMemo(()=>R7e(g.sections,R,t),[g.sections,R,t]),N=w.useMemo(()=>({syncSelectionToDOM:()=>{if(!$.current)return;if(f==null){$.current.scrollLeft&&($.current.scrollLeft=0);return}if($.current!==Bi(document))return;const ce=$.current.scrollTop;if(f==="all")$.current.select();else{const ae=z[f],ne=ae.type==="empty"?ae.startInInput-ae.startSeparator.length:ae.startInInput,ue=ae.type==="empty"?ae.endInInput+ae.endSeparator.length:ae.endInInput;(ne!==$.current.selectionStart||ue!==$.current.selectionEnd)&&$.current===Bi(document)&&$.current.setSelectionRange(ne,ue),clearTimeout(r.current),r.current=setTimeout(()=>{$.current&&$.current===Bi(document)&&$.current.selectionStart===$.current.selectionEnd&&($.current.selectionStart!==ne||$.current.selectionEnd!==ue)&&N.syncSelectionToDOM()})}$.current.scrollTop=ce},getActiveSectionIndexFromDOM:()=>{const ce=$.current.selectionStart??0,ae=$.current.selectionEnd??0;if(ce===0&&ae===0)return null;const ne=ce<=z[0].startInInput?1:z.findIndex(ue=>ue.startInInput-ue.startSeparator.length>ce);return ne===-1?z.length-1:ne-1},focusField:(ce=0)=>{var ae;Bi(document)!==$.current&&((ae=$.current)==null||ae.focus(),A(ce))},setSelectedSections:ce=>A(ce),isFieldFocused:()=>$.current===Bi(document)}),[$,f,z,A]),B=()=>{const ce=$.current.selectionStart??0;let ae;ce<=z[0].startInInput||ce>=z[z.length-1].endInInput?ae=1:ae=z.findIndex(ue=>ue.startInInput-ue.startSeparator.length>ce);const ne=ae===-1?z.length-1:ae-1;A(ne)},U=Qe((...ce)=>{o==null||o(...ce);const ae=$.current;clearTimeout(n.current),n.current=setTimeout(()=>{!ae||ae!==$.current||h==null&&(ae.value.length&&Number(ae.selectionEnd)-Number(ae.selectionStart)===ae.value.length?A("all"):B())})}),G=Qe((ce,...ae)=>{ce.isDefaultPrevented()||(i==null||i(ce,...ae),B())}),H=Qe(ce=>{if(a==null||a(ce),ce.preventDefault(),u||d)return;const ae=ce.clipboardData.getData("text");if(typeof f=="number"){const ne=g.sections[f],ue=/^[a-zA-Z]+$/.test(ae),he=/^[0-9]+$/.test(ae),re=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(ae);if(ne.contentType==="letter"&&ue||ne.contentType==="digit"&&he||ne.contentType==="digit-with-letter"&&re){S(),C({activeSection:ne,newSectionValue:ae,shouldGoToNextSection:!0});return}if(ue||he)return}S(),I(ae)}),K=Qe((...ce)=>{s==null||s(...ce),A(null)}),q=Qe(ce=>{if(u)return;const ae=ce.target.value;if(ae===""){S(),T();return}const ne=ce.nativeEvent.data,ue=ne&&ne.length>1,he=ue?ne:ae,re=Mm(he);if(f==="all"&&A(h),h==null||ue){I(ue?ne:re);return}let le;if(f==="all"&&re.length===1)le=re;else{const me=Mm(y.getV6InputValueFromSections(z,R,t));let Se=-1,Ee=-1;for(let _e=0;_e<me.length;_e+=1)Se===-1&&me[_e]!==re[_e]&&(Se=_e),Ee===-1&&me[me.length-_e-1]!==re[re.length-_e-1]&&(Ee=_e);const ge=z[h];if(Se<ge.start||me.length-Ee-1>ge.end)return;const Pe=re.length-me.length+ge.end-Mm(ge.endSeparator||"").length;le=re.slice(ge.start+Mm(ge.startSeparator||"").length,Pe)}if(le.length===0){$9e()&&O(he),S(),E();return}x({keyPressed:le,sectionIndex:h})}),Y=w.useMemo(()=>c!==void 0?c:y.getV6InputValueFromSections(k(v.emptyValue),R,t),[c,y,k,v.emptyValue,R,t]),J=w.useMemo(()=>g.tempValueStrAndroid??y.getV6InputValueFromSections(g.sections,R,t),[g.sections,y,g.tempValueStrAndroid,R,t]);w.useEffect(()=>($.current&&$.current===Bi(document)&&A("all"),()=>{clearTimeout(n.current),clearTimeout(r.current)}),[]);const ie=w.useMemo(()=>h==null||g.sections[h].contentType==="letter"?"text":"numeric",[h,g.sections]),te=!($.current&&$.current===Bi(document))&&M;return{interactions:N,returnedValue:{readOnly:u,onBlur:K,onClick:G,onFocus:U,onPaste:H,inputRef:L,enableAccessibleFieldDOMStructure:!1,placeholder:Y,inputMode:ie,autoComplete:"off",value:te?"":J,onChange:q}}},zB=e=>{const t=In(),{internalProps:n,internalProps:{unstableFieldRef:r,minutesStep:o,enableAccessibleFieldDOMStructure:i=!1,disabled:a=!1,readOnly:s=!1},forwardedProps:{onKeyDown:l,error:c,clearable:u,onClear:d},fieldValueManager:f,valueManager:h,validator:g}=e,y=Yn(),v=O7e(e),{state:x,activeSectionIndex:S,parsedSelectedSections:C,setSelectedSections:I,clearValue:E,clearActiveSection:T,updateSectionValue:O,setTempAndroidValueStr:A,sectionsValueBoundaries:k,localizedDigits:M,timezone:R}=v,$=M7e({sections:x.sections,updateSectionValue:O,sectionsValueBoundaries:k,localizedDigits:M,setTempAndroidValueStr:A,timezone:R}),{resetCharacterQuery:L}=$,z=h.areValuesEqual(t,x.value,h.emptyValue),N=i?A7e:D7e,B=w.useMemo(()=>N9e(x.sections,y&&!i),[x.sections,y,i]),{returnedValue:U,interactions:G}=N(F({},e,v,$,{areAllSectionsEmpty:z,sectionOrder:B})),H=Qe(ee=>{if(l==null||l(ee),!a)switch(!0){case((ee.ctrlKey||ee.metaKey)&&String.fromCharCode(ee.keyCode)==="A"&&!ee.shiftKey&&!ee.altKey):{ee.preventDefault(),I("all");break}case ee.key==="ArrowRight":{if(ee.preventDefault(),C==null)I(B.startIndex);else if(C==="all")I(B.endIndex);else{const te=B.neighbors[C].rightIndex;te!==null&&I(te)}break}case ee.key==="ArrowLeft":{if(ee.preventDefault(),C==null)I(B.endIndex);else if(C==="all")I(B.startIndex);else{const te=B.neighbors[C].leftIndex;te!==null&&I(te)}break}case ee.key==="Delete":{if(ee.preventDefault(),s)break;C==null||C==="all"?E():T(),L();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(ee.key):{if(ee.preventDefault(),s||S==null)break;C==="all"&&I(S);const te=x.sections[S],ce=f.getActiveDateManager(t,x,te),ae=k9e(t,R,te,ee.key,k,M,ce.date,{minutesStep:o});O({activeSection:te,newSectionValue:ae,shouldGoToNextSection:!1});break}}});On(()=>{G.syncSelectionToDOM()});const{hasValidationError:K}=Oae({props:n,validator:g,timezone:R,value:x.value,onError:n.onError}),q=w.useMemo(()=>c!==void 0?c:K,[K,c]);w.useEffect(()=>{!q&&S==null&&L()},[x.referenceValue,S,q]),w.useEffect(()=>{x.tempValueStrAndroid!=null&&S!=null&&(L(),T())},[x.sections]),w.useImperativeHandle(r,()=>({getSections:()=>x.sections,getActiveSectionIndex:G.getActiveSectionIndexFromDOM,setSelectedSections:G.setSelectedSections,focusField:G.focusField,isFieldFocused:G.isFieldFocused}));const Y=Qe((ee,...te)=>{ee.preventDefault(),d==null||d(ee,...te),E(),G.isFieldFocused()?I(B.startIndex):G.focusField(0)}),J={onKeyDown:H,onClear:Y,error:q,clearable:!!(u&&!z&&!s&&!a)},ie={disabled:a,readOnly:s};return F({},e.forwardedProps,J,ie,U)},_7e=["clearable","onClear","InputProps","sx","slots","slotProps"],$7e=["ownerState"],VB=e=>{const t=Co(),{clearable:n,onClear:r,InputProps:o,sx:i,slots:a,slotProps:s}=e,l=We(e,_7e),c=(a==null?void 0:a.clearButton)??on,u=Pn({elementType:c,externalSlotProps:s==null?void 0:s.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:t.fieldClearLabel}}),d=We(u,$7e),f=(a==null?void 0:a.clearIcon)??_8e,h=Pn({elementType:f,externalSlotProps:s==null?void 0:s.clearIcon,ownerState:{}});return F({},l,{InputProps:F({},o,{endAdornment:_.jsxs(w.Fragment,{children:[n&&_.jsx(ro,{position:"end",sx:{marginRight:o!=null&&o.endAdornment?-1:-1.5},children:_.jsx(c,F({},d,{onClick:r,children:_.jsx(f,F({fontSize:"small"},h))}))}),o==null?void 0:o.endAdornment]})}),sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(i)?i:[i]]})},N7e=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef","enableAccessibleFieldDOMStructure","disabled","readOnly","dateSeparator"],HB=(e,t)=>w.useMemo(()=>{const n=F({},e),r={},o=i=>{n.hasOwnProperty(i)&&(r[i]=n[i],delete n[i])};return N7e.forEach(o),t==="date"?mL.forEach(o):t==="time"?gL.forEach(o):t==="date-time"&&(mL.forEach(o),gL.forEach(o),Tae.forEach(o)),{forwardedProps:n,internalProps:r}},[e,t]),L7e=w.createContext(null);function kae(e){const{contextValue:t,localeText:n,children:r}=e;return _.jsx(L7e.Provider,{value:t,children:_.jsx(vc,{localeText:n,children:r})})}const F7e=e=>{const t=In(),n=fh();return F({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??t.formats.keyboardDate,minDate:Oi(t,e.minDate,n.minDate),maxDate:Oi(t,e.maxDate,n.maxDate)})},j7e=e=>{const t=In(),r=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.fullTime12h:t.formats.fullTime24h;return F({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??r})},B7e=e=>{const t=In(),n=fh(),o=e.ampm??t.is12HourCycleInCurrentLocale()?t.formats.keyboardDateTime12h:t.formats.keyboardDateTime24h;return F({},e,{disablePast:e.disablePast??!1,disableFuture:e.disableFuture??!1,format:e.format??o,disableIgnoringDatePartForTimeValidation:!!(e.minDateTime||e.maxDateTime),minDate:Oi(t,e.minDateTime??e.minDate,n.minDate),maxDate:Oi(t,e.maxDateTime??e.maxDate,n.maxDate),minTime:e.minDateTime??e.minTime,maxTime:e.maxDateTime??e.maxTime})},z7e=e=>{const t=F7e(e),{forwardedProps:n,internalProps:r}=HB(t,"date");return zB({forwardedProps:n,internalProps:r,valueManager:io,fieldValueManager:FB,validator:Wy,valueType:"date"})};function V7e(e){return je("MuiPickersTextField",e)}Be("MuiPickersTextField",["root","focused","disabled","error","required"]);function H7e(e){return je("MuiPickersInputBase",e)}const Qm=Be("MuiPickersInputBase",["root","focused","disabled","error","notchedOutline","sectionContent","sectionBefore","sectionAfter","adornedStart","adornedEnd","input"]);function U7e(e){return je("MuiPickersSectionList",e)}const yb=Be("MuiPickersSectionList",["root","section","sectionContent"]),W7e=["slots","slotProps","elements","sectionListRef"],Mae=se("div",{name:"MuiPickersSectionList",slot:"Root",overridesResolver:(e,t)=>t.root})({direction:"ltr /*! @noflip */",outline:"none"}),Aae=se("span",{name:"MuiPickersSectionList",slot:"Section",overridesResolver:(e,t)=>t.section})({}),Rae=se("span",{name:"MuiPickersSectionList",slot:"SectionSeparator",overridesResolver:(e,t)=>t.sectionSeparator})({whiteSpace:"pre"}),Dae=se("span",{name:"MuiPickersSectionList",slot:"SectionContent",overridesResolver:(e,t)=>t.sectionContent})({outline:"none"}),G7e=e=>{const{classes:t}=e;return Oe({root:["root"],section:["section"],sectionContent:["sectionContent"]},U7e,t)};function q7e(e){const{slots:t,slotProps:n,element:r,classes:o}=e,i=(t==null?void 0:t.section)??Aae,a=Pn({elementType:i,externalSlotProps:n==null?void 0:n.section,externalForwardedProps:r.container,className:o.section,ownerState:{}}),s=(t==null?void 0:t.sectionContent)??Dae,l=Pn({elementType:s,externalSlotProps:n==null?void 0:n.sectionContent,externalForwardedProps:r.content,additionalProps:{suppressContentEditableWarning:!0},className:o.sectionContent,ownerState:{}}),c=(t==null?void 0:t.sectionSeparator)??Rae,u=Pn({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.before,ownerState:{position:"before"}}),d=Pn({elementType:c,externalSlotProps:n==null?void 0:n.sectionSeparator,externalForwardedProps:r.after,ownerState:{position:"after"}});return _.jsxs(i,F({},a,{children:[_.jsx(c,F({},u)),_.jsx(s,F({},l)),_.jsx(c,F({},d))]}))}const K7e=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersSectionList"}),{slots:o,slotProps:i,elements:a,sectionListRef:s}=r,l=We(r,W7e),c=G7e(r),u=w.useRef(null),d=cn(n,u),f=y=>{if(!u.current)throw new Error(`MUI X: Cannot call sectionListRef.${y} before the mount of the component.`);return u.current};w.useImperativeHandle(s,()=>({getRoot(){return f("getRoot")},getSectionContainer(y){return f("getSectionContainer").querySelector(`.${yb.section}[data-sectionindex="${y}"]`)},getSectionContent(y){return f("getSectionContent").querySelector(`.${yb.section}[data-sectionindex="${y}"] .${yb.sectionContent}`)},getSectionIndexFromDOMElement(y){const v=f("getSectionIndexFromDOMElement");if(y==null||!v.contains(y))return null;let x=null;return y.classList.contains(yb.section)?x=y:y.classList.contains(yb.sectionContent)&&(x=y.parentElement),x==null?null:Number(x.dataset.sectionindex)}}));const h=(o==null?void 0:o.root)??Mae,g=Pn({elementType:h,externalSlotProps:i==null?void 0:i.root,externalForwardedProps:l,additionalProps:{ref:d,suppressContentEditableWarning:!0},className:c.root,ownerState:{}});return _.jsx(h,F({},g,{children:g.contentEditable?a.map(({content:y,before:v,after:x})=>`${v.children}${y.children}${x.children}`).join(""):_.jsx(w.Fragment,{children:a.map((y,v)=>_.jsx(q7e,{slots:o,slotProps:i,element:y,classes:c},v))})}))}),Y7e=["elements","areAllSectionsEmpty","defaultValue","label","value","onChange","id","autoFocus","endAdornment","startAdornment","renderSuffix","slots","slotProps","contentEditable","tabIndex","onInput","onPaste","onKeyDown","fullWidth","name","readOnly","inputProps","inputRef","sectionListRef"],Q7e=e=>Math.round(e*1e5)/1e5,FT=se("div",{name:"MuiPickersInputBase",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>F({},e.typography.body1,{color:(e.vars||e).palette.text.primary,cursor:"text",padding:0,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",boxSizing:"border-box",letterSpacing:`${Q7e(.15/16)}em`,variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),UB=se(Mae,{name:"MuiPickersInputBase",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})(({theme:e})=>({padding:"4px 0 5px",fontFamily:e.typography.fontFamily,fontSize:"inherit",lineHeight:"1.4375em",flexGrow:1,outline:"none",display:"flex",flexWrap:"nowrap",overflow:"hidden",letterSpacing:"inherit",width:"182px",variants:[{props:{isRtl:!0},style:{textAlign:"right /*! @noflip */"}},{props:{size:"small"},style:{paddingTop:1}},{props:{adornedStart:!1,focused:!1,filled:!1},style:{color:"currentColor",opacity:0}},{props:({adornedStart:t,focused:n,filled:r,label:o})=>!t&&!n&&!r&&o==null,style:e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:e.palette.mode==="light"?.42:.5}}]})),X7e=se(Aae,{name:"MuiPickersInputBase",slot:"Section",overridesResolver:(e,t)=>t.section})(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit",letterSpacing:"inherit",lineHeight:"1.4375em",display:"inline-block",whiteSpace:"nowrap"})),J7e=se(Dae,{name:"MuiPickersInputBase",slot:"SectionContent",overridesResolver:(e,t)=>t.content})(({theme:e})=>({fontFamily:e.typography.fontFamily,lineHeight:"1.4375em",letterSpacing:"inherit",width:"fit-content",outline:"none"})),Z7e=se(Rae,{name:"MuiPickersInputBase",slot:"Separator",overridesResolver:(e,t)=>t.separator})(()=>({whiteSpace:"pre",letterSpacing:"inherit"})),eKe=se("input",{name:"MuiPickersInputBase",slot:"Input",overridesResolver:(e,t)=>t.hiddenInput})(F({},Bge)),tKe=e=>{const{focused:t,disabled:n,error:r,classes:o,fullWidth:i,readOnly:a,color:s,size:l,endAdornment:c,startAdornment:u}=e,d={root:["root",t&&!n&&"focused",n&&"disabled",a&&"readOnly",r&&"error",i&&"fullWidth",`color${we(s)}`,l==="small"&&"inputSizeSmall",!!u&&"adornedStart",!!c&&"adornedEnd"],notchedOutline:["notchedOutline"],input:["input"],sectionsContainer:["sectionsContainer"],sectionContent:["sectionContent"],sectionBefore:["sectionBefore"],sectionAfter:["sectionAfter"]};return Oe(d,H7e,o)},WB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersInputBase"}),{elements:o,areAllSectionsEmpty:i,value:a,onChange:s,id:l,endAdornment:c,startAdornment:u,renderSuffix:d,slots:f,slotProps:h,contentEditable:g,tabIndex:y,onInput:v,onPaste:x,onKeyDown:S,name:C,readOnly:I,inputProps:E,inputRef:T,sectionListRef:O}=r,A=We(r,Y7e),k=w.useRef(null),M=cn(n,k),R=cn(E==null?void 0:E.ref,T),$=Yn(),L=wa();if(!L)throw new Error("MUI X: PickersInputBase should always be used inside a PickersTextField component");const z=K=>{var q;if(L.disabled){K.stopPropagation();return}(q=L.onFocus)==null||q.call(L,K)};w.useEffect(()=>{L&&L.setAdornedStart(!!u)},[L,u]),w.useEffect(()=>{L&&(i?L.onEmpty():L.onFilled())},[L,i]);const N=F({},r,L,{isRtl:$}),B=tKe(N),U=(f==null?void 0:f.root)||FT,G=Pn({elementType:U,externalSlotProps:h==null?void 0:h.root,externalForwardedProps:A,additionalProps:{"aria-invalid":L.error,ref:M},className:B.root,ownerState:N}),H=(f==null?void 0:f.input)||UB;return _.jsxs(U,F({},G,{children:[u,_.jsx(K7e,{sectionListRef:O,elements:o,contentEditable:g,tabIndex:y,className:B.sectionsContainer,onFocus:z,onBlur:L.onBlur,onInput:v,onPaste:x,onKeyDown:S,slots:{root:H,section:X7e,sectionContent:J7e,sectionSeparator:Z7e},slotProps:{root:{ownerState:N},sectionContent:{className:Qm.sectionContent},sectionSeparator:({position:K})=>({className:K==="before"?Qm.sectionBefore:Qm.sectionAfter})}}),c,d?d(F({},L)):null,_.jsx(eKe,F({name:C,className:B.input,value:a,onChange:s,id:l,"aria-hidden":"true",tabIndex:-1,readOnly:I,required:L.required,disabled:L.disabled},E,{ref:R}))]}))});function nKe(e){return je("MuiPickersOutlinedInput",e)}const ul=F({},Qm,Be("MuiPickersOutlinedInput",["root","notchedOutline","input"])),rKe=["children","className","label","notched","shrink"],oKe=se("fieldset",{name:"MuiPickersOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%",borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),kK=se("span")(({theme:e})=>({fontFamily:e.typography.fontFamily,fontSize:"inherit"})),iKe=se("legend")(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:{withLabel:!1},style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:{withLabel:!0},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:{withLabel:!0,notched:!0},style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]}));function aKe(e){const{className:t,label:n}=e,r=We(e,rKe),o=n!=null&&n!=="",i=F({},e,{withLabel:o});return _.jsx(oKe,F({"aria-hidden":!0,className:t},r,{ownerState:i,children:_.jsx(iKe,{ownerState:i,children:o?_.jsx(kK,{children:n}):_.jsx(kK,{className:"notranslate",children:""})})}))}const sKe=["label","autoFocus","ownerState","notched"],lKe=se(FT,{name:"MuiPickersOutlinedInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{padding:"0 14px",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${ul.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${ul.focused} .${ul.notchedOutline}`]:{borderStyle:"solid",borderWidth:2},[`&.${ul.disabled}`]:{[`& .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled},"*":{color:(e.vars||e).palette.action.disabled}},[`&.${ul.error} .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},variants:Object.keys((e.vars??e).palette).filter(n=>{var r;return((r=(e.vars??e).palette[n])==null?void 0:r.main)??!1}).map(n=>({props:{color:n},style:{[`&.${ul.focused}:not(.${ul.error}) .${ul.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}}))}}),cKe=se(UB,{name:"MuiPickersOutlinedInput",slot:"SectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({padding:"16.5px 0",variants:[{props:{size:"small"},style:{padding:"8.5px 0"}}]}),uKe=e=>{const{classes:t}=e,r=Oe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},nKe,t);return F({},t,r)},_ae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersOutlinedInput"}),{label:o,ownerState:i,notched:a}=r,s=We(r,sKe),l=wa(),c=F({},r,i,l,{color:(l==null?void 0:l.color)||"primary"}),u=uKe(c);return _.jsx(WB,F({slots:{root:lKe,input:cKe},renderSuffix:d=>_.jsx(aKe,{shrink:!!(a||d.adornedStart||d.focused||d.filled),notched:!!(a||d.adornedStart||d.focused||d.filled),className:u.notchedOutline,label:o!=null&&o!==""&&(l!=null&&l.required)?_.jsxs(w.Fragment,{children:[o," ","*"]}):o,ownerState:c})},s,{label:o,classes:u,ref:n}))});_ae.muiName="Input";function dKe(e){return je("MuiPickersFilledInput",e)}const Kf=F({},Qm,Be("MuiPickersFilledInput",["root","underline","input"])),fKe=["label","autoFocus","disableUnderline","ownerState"],pKe=se(FT,{name:"MuiPickersFilledInput",slot:"Root",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>b1(e)&&e!=="disableUnderline"})(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${Kf.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${Kf.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[...Object.keys((e.vars??e).palette).filter(a=>(e.vars??e).palette[a].main).map(a=>{var s;return{props:{color:a,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(s=(e.vars||e).palette[a])==null?void 0:s.main}`}}}}),{props:{disableUnderline:!1},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Kf.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Kf.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Kf.disabled}, .${Kf.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Kf.disabled}:before`]:{borderBottomStyle:"dotted"}}},{props:({startAdornment:a})=>!!a,style:{paddingLeft:12}},{props:({endAdornment:a})=>!!a,style:{paddingRight:12}}]}}),hKe=se(UB,{name:"MuiPickersFilledInput",slot:"sectionsContainer",overridesResolver:(e,t)=>t.sectionsContainer})({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({startAdornment:e})=>!!e,style:{paddingLeft:0}},{props:({endAdornment:e})=>!!e,style:{paddingRight:0}},{props:{hiddenLabel:!0},style:{paddingTop:16,paddingBottom:17}},{props:{hiddenLabel:!0,size:"small"},style:{paddingTop:8,paddingBottom:9}}]}),mKe=e=>{const{classes:t,disableUnderline:n}=e,o=Oe({root:["root",!n&&"underline"],input:["input"]},dKe,t);return F({},t,o)},$ae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersFilledInput"}),{label:o,disableUnderline:i=!1,ownerState:a}=r,s=We(r,fKe),l=wa(),c=F({},r,a,l,{color:(l==null?void 0:l.color)||"primary"}),u=mKe(c);return _.jsx(WB,F({slots:{root:pKe,input:hKe},slotProps:{root:{disableUnderline:i}}},s,{label:o,classes:u,ref:n}))});$ae.muiName="Input";function gKe(e){return je("MuiPickersFilledInput",e)}const vb=F({},Qm,Be("MuiPickersInput",["root","input"])),yKe=["label","autoFocus","disableUnderline","ownerState"],vKe=se(FT,{name:"MuiPickersInput",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{"label + &":{marginTop:16},variants:[...Object.keys((e.vars??e).palette).filter(r=>(e.vars??e).palette[r].main).map(r=>({props:{color:r},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}})),{props:{disableUnderline:!1},style:{"&::after":{background:"red",left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${vb.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${vb.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${vb.disabled}, .${vb.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${vb.disabled}:before`]:{borderBottomStyle:"dotted"}}}]}}),bKe=e=>{const{classes:t,disableUnderline:n}=e,o=Oe({root:["root",!n&&"underline"],input:["input"]},gKe,t);return F({},t,o)},Nae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersInput"}),{label:o,disableUnderline:i=!1,ownerState:a}=r,s=We(r,yKe),l=wa(),c=F({},r,a,l,{disableUnderline:i,color:(l==null?void 0:l.color)||"primary"}),u=bKe(c);return _.jsx(WB,F({slots:{root:vKe}},s,{label:o,classes:u,ref:n}))});Nae.muiName="Input";const wKe=["onFocus","onBlur","className","color","disabled","error","variant","required","InputProps","inputProps","inputRef","sectionListRef","elements","areAllSectionsEmpty","onClick","onKeyDown","onKeyUp","onPaste","onInput","endAdornment","startAdornment","tabIndex","contentEditable","focused","value","onChange","fullWidth","id","name","helperText","FormHelperTextProps","label","InputLabelProps"],xKe={standard:Nae,filled:$ae,outlined:_ae},SKe=se(rh,{name:"MuiPickersTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),CKe=e=>{const{focused:t,disabled:n,classes:r,required:o}=e;return Oe({root:["root",t&&!n&&"focused",n&&"disabled",o&&"required"]},V7e,r)},GB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersTextField"}),{onFocus:o,onBlur:i,className:a,color:s="primary",disabled:l=!1,error:c=!1,variant:u="outlined",required:d=!1,InputProps:f,inputProps:h,inputRef:g,sectionListRef:y,elements:v,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:I,onPaste:E,onInput:T,endAdornment:O,startAdornment:A,tabIndex:k,contentEditable:M,focused:R,value:$,onChange:L,fullWidth:z,id:N,name:B,helperText:U,FormHelperTextProps:G,label:H,InputLabelProps:K}=r,q=We(r,wKe),Y=w.useRef(null),J=cn(n,Y),ie=Dn(N),ee=U&&ie?`${ie}-helper-text`:void 0,te=H&&ie?`${ie}-label`:void 0,ce=F({},r,{color:s,disabled:l,error:c,focused:R,required:d,variant:u}),ae=CKe(ce),ne=xKe[u];return _.jsxs(SKe,F({className:fe(ae.root,a),ref:J,focused:R,onFocus:o,onBlur:i,disabled:l,variant:u,error:c,color:s,fullWidth:z,required:d,ownerState:ce},q,{children:[_.jsx(oh,F({htmlFor:ie,id:te},K,{children:H})),_.jsx(ne,F({elements:v,areAllSectionsEmpty:x,onClick:S,onKeyDown:C,onKeyUp:I,onInput:T,onPaste:E,endAdornment:O,startAdornment:A,tabIndex:k,contentEditable:M,value:$,onChange:L,id:ie,fullWidth:z,inputProps:h,inputRef:g,sectionListRef:y,label:H,name:B,role:"group","aria-labelledby":te,"aria-describedby":ee,"aria-live":ee?"polite":void 0},f)),U&&_.jsx(h0,F({id:ee},G,{children:U}))]}))}),EKe=["enableAccessibleFieldDOMStructure"],PKe=["InputProps","readOnly"],IKe=["onPaste","onKeyDown","inputMode","readOnly","InputProps","inputProps","inputRef"],qB=e=>{let{enableAccessibleFieldDOMStructure:t}=e,n=We(e,EKe);if(t){const{InputProps:d,readOnly:f}=n,h=We(n,PKe);return F({},h,{InputProps:F({},d??{},{readOnly:f})})}const{onPaste:r,onKeyDown:o,inputMode:i,readOnly:a,InputProps:s,inputProps:l,inputRef:c}=n,u=We(n,IKe);return F({},u,{InputProps:F({},s??{},{readOnly:a}),inputProps:F({},l??{},{inputMode:i,onPaste:r,onKeyDown:o,ref:c})})},TKe=["slots","slotProps","InputProps","inputProps"],Lae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDateField"}),{slots:o,slotProps:i,InputProps:a,inputProps:s}=r,l=We(r,TKe),c=r,u=(o==null?void 0:o.textField)??(t.enableAccessibleFieldDOMStructure?GB:tn),d=Pn({elementType:u,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:l,additionalProps:{ref:n},ownerState:c});d.inputProps=F({},s,d.inputProps),d.InputProps=F({},a,d.InputProps);const f=z7e(d),h=qB(f),g=VB(F({},h,{slots:o,slotProps:i}));return _.jsx(u,F({},g))}),OKe=e=>{const t=j7e(e),{forwardedProps:n,internalProps:r}=HB(t,"time");return zB({forwardedProps:n,internalProps:r,valueManager:io,fieldValueManager:FB,validator:B0,valueType:"time"})},kKe=["slots","slotProps","InputProps","inputProps"],Fae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiTimeField"}),{slots:o,slotProps:i,InputProps:a,inputProps:s}=r,l=We(r,kKe),c=r,u=(o==null?void 0:o.textField)??(t.enableAccessibleFieldDOMStructure?GB:tn),d=Pn({elementType:u,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});d.inputProps=F({},s,d.inputProps),d.InputProps=F({},a,d.InputProps);const f=OKe(d),h=qB(f),g=VB(F({},h,{slots:o,slotProps:i}));return _.jsx(u,F({},g))}),MKe=e=>{const t=B7e(e),{forwardedProps:n,internalProps:r}=HB(t,"date-time");return zB({forwardedProps:n,internalProps:r,valueManager:io,fieldValueManager:FB,validator:LT,valueType:"date-time"})},AKe=["slots","slotProps","InputProps","inputProps"],jae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDateTimeField"}),{slots:o,slotProps:i,InputProps:a,inputProps:s}=r,l=We(r,AKe),c=r,u=(o==null?void 0:o.textField)??(t.enableAccessibleFieldDOMStructure?GB:tn),d=Pn({elementType:u,externalSlotProps:i==null?void 0:i.textField,externalForwardedProps:l,ownerState:c,additionalProps:{ref:n}});d.inputProps=F({},s,d.inputProps),d.InputProps=F({},a,d.InputProps);const f=MKe(d),h=qB(f),g=VB(F({},h,{slots:o,slotProps:i}));return _.jsx(u,F({},g))}),Bae=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a,timezone:s})=>{const l=dh();return w.useCallback(c=>Wy({adapter:l,value:c,timezone:s,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:a}})!==null,[l,e,t,n,r,o,i,a,s])},RKe=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return F({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"changeMonthTimezone":{const i=o.newTimezone;if(n.getTimezone(r.currentMonth)===i)return r;let a=n.setTimezone(r.currentMonth,i);return n.getMonth(a)!==n.getMonth(r.currentMonth)&&(a=n.setMonth(a,n.getMonth(r.currentMonth))),F({},r,{currentMonth:a})}case"finishMonthSwitchingAnimation":return F({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return F({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},DKe=e=>{const{value:t,referenceDate:n,disableFuture:r,disablePast:o,disableSwitchToMonthOnDayFocus:i=!1,maxDate:a,minDate:s,onMonthChange:l,reduceAnimations:c,shouldDisableDate:u,timezone:d}=e,f=In(),h=w.useRef(RKe(!!c,i,f)).current,g=w.useMemo(()=>io.getInitialReferenceValue({value:t,utils:f,timezone:d,props:e,referenceDate:n,granularity:xl.day}),[n,d]),[y,v]=w.useReducer(h,{isMonthSwitchingAnimating:!1,focusedDay:g,currentMonth:f.startOfMonth(g),slideDirection:"left"});w.useEffect(()=>{v({type:"changeMonthTimezone",newTimezone:f.getTimezone(g)})},[g,f]);const x=w.useCallback(T=>{v(F({type:"changeMonth"},T)),l&&l(T.newMonth)},[l]),S=w.useCallback(T=>{const O=T;f.isSameMonth(O,y.currentMonth)||x({newMonth:f.startOfMonth(O),direction:f.isAfterDay(O,y.currentMonth)?"left":"right"})},[y.currentMonth,x,f]),C=Bae({shouldDisableDate:u,minDate:s,maxDate:a,disableFuture:r,disablePast:o,timezone:d}),I=w.useCallback(()=>{v({type:"finishMonthSwitchingAnimation"})},[]),E=Qe((T,O)=>{C(T)||v({type:"changeFocusedDay",focusedDay:T,withoutMonthSwitchingAnimation:O})});return{referenceDate:g,calendarState:y,changeMonth:S,changeFocusedDay:E,isDateDisabled:C,onMonthSwitchingAnimationEnd:I,handleChangeMonth:x}},_Ke=e=>je("MuiPickersFadeTransitionGroup",e);Be("MuiPickersFadeTransitionGroup",["root"]);const $Ke=e=>{const{classes:t}=e;return Oe({root:["root"]},_Ke,t)},NKe=se(d0,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function zae(e){const t=hn({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,a=$Ke(t),s=Lr();return o?n:_.jsx(NKe,{className:fe(a.root,r),children:_.jsx(jp,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:s.transitions.duration.enteringScreen,enter:s.transitions.duration.enteringScreen,exit:0},children:n},i)})}const LKe=e=>je("MuiPickersSlideTransition",e),ys=Be("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),FKe=["children","className","reduceAnimations","slideDirection","transKey","classes"],jKe=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return Oe(r,LKe,t)},BKe=se(d0,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${ys["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${ys["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${ys.slideEnterActive}`]:t.slideEnterActive},{[`.${ys.slideExit}`]:t.slideExit},{[`.${ys["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${ys["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${ys["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${ys["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${ys.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${ys.slideExit}`]:{transform:"translate(0%)"},[`& .${ys["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${ys["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function zKe(e){const t=hn({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,a=We(t,FKe),s=jKe(t),l=Lr();if(o)return _.jsx("div",{className:fe(s.root,r),children:n});const c={exit:s.exit,enterActive:s.enterActive,enter:s.enter,exitActive:s.exitActive};return _.jsx(BKe,{className:fe(s.root,r),childFactory:u=>w.cloneElement(u,{classNames:c}),role:"presentation",children:_.jsx(RF,F({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},a,{children:n}),i)})}const VKe=e=>je("MuiDayCalendar",e);Be("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const HKe=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],UKe=["ownerState"],WKe=e=>{const{classes:t}=e;return Oe({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},VKe,t)},Vae=(Ix+RT*2)*6,GKe=se("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),qKe=se("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),KKe=se(tt,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),YKe=se(tt,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),QKe=se(tt,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>F({},e.typography.caption,{width:Ix,height:Ix,padding:0,margin:`0 ${RT}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),XKe=se("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Vae}),JKe=se(zKe,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:Vae}),ZKe=se("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),eYe=se("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${RT}px 0`,display:"flex",justifyContent:"center"});function tYe(e){let{parentProps:t,day:n,focusableDay:r,selectedDays:o,isDateDisabled:i,currentMonthNumber:a,isViewFocused:s}=e,l=We(e,HKe);const{disabled:c,disableHighlightToday:u,isMonthSwitchingAnimating:d,showDaysOutsideCurrentMonth:f,slots:h,slotProps:g,timezone:y}=t,v=In(),x=ph(y),S=r!==null&&v.isSameDay(n,r),C=o.some($=>v.isSameDay($,n)),I=v.isSameDay(n,x),E=(h==null?void 0:h.day)??w7e,T=Pn({elementType:E,externalSlotProps:g==null?void 0:g.day,additionalProps:F({disableHighlightToday:u,showDaysOutsideCurrentMonth:f,role:"gridcell",isAnimating:d,"data-timestamp":v.toJsDate(n).valueOf()},l),ownerState:F({},t,{day:n,selected:C})}),O=We(T,UKe),A=w.useMemo(()=>c||i(n),[c,i,n]),k=w.useMemo(()=>v.getMonth(n)!==a,[v,n,a]),M=w.useMemo(()=>{const $=v.startOfMonth(v.setMonth(n,a));return f?v.isSameDay(n,v.startOfWeek($)):v.isSameDay(n,$)},[a,n,f,v]),R=w.useMemo(()=>{const $=v.endOfMonth(v.setMonth(n,a));return f?v.isSameDay(n,v.endOfWeek($)):v.isSameDay(n,$)},[a,n,f,v]);return _.jsx(E,F({},O,{day:n,disabled:A,autoFocus:s&&S,today:I,outsideCurrentMonth:k,isFirstVisibleCell:M,isLastVisibleCell:R,selected:C,tabIndex:S?0:-1,"aria-selected":C,"aria-current":I?"date":void 0}))}function nYe(e){const t=hn({props:e,name:"MuiDayCalendar"}),n=In(),{onFocusedDayChange:r,className:o,currentMonth:i,selectedDays:a,focusedDay:s,loading:l,onSelectedDaysChange:c,onMonthSwitchingAnimationEnd:u,readOnly:d,reduceAnimations:f,renderLoading:h=()=>_.jsx("span",{children:"..."}),slideDirection:g,TransitionProps:y,disablePast:v,disableFuture:x,minDate:S,maxDate:C,shouldDisableDate:I,shouldDisableMonth:E,shouldDisableYear:T,dayOfWeekFormatter:O=Ee=>n.format(Ee,"weekdayShort").charAt(0).toUpperCase(),hasFocus:A,onFocusedViewChange:k,gridLabelId:M,displayWeekNumber:R,fixedWeekNumber:$,autoFocus:L,timezone:z}=t,N=ph(z),B=WKe(t),U=Yn(),G=Bae({shouldDisableDate:I,shouldDisableMonth:E,shouldDisableYear:T,minDate:S,maxDate:C,disablePast:v,disableFuture:x,timezone:z}),H=Co(),[K,q]=Ei({name:"DayCalendar",state:"hasFocus",controlled:A,default:L??!1}),[Y,J]=w.useState(()=>s||N),ie=Qe(Ee=>{d||c(Ee)}),ee=Ee=>{G(Ee)||(r(Ee),J(Ee),k==null||k(!0),q(!0))},te=Qe((Ee,ge)=>{switch(Ee.key){case"ArrowUp":ee(n.addDays(ge,-7)),Ee.preventDefault();break;case"ArrowDown":ee(n.addDays(ge,7)),Ee.preventDefault();break;case"ArrowLeft":{const xe=n.addDays(ge,U?1:-1),Pe=n.addMonths(ge,U?1:-1),_e=vw({utils:n,date:xe,minDate:U?xe:n.startOfMonth(Pe),maxDate:U?n.endOfMonth(Pe):xe,isDateDisabled:G,timezone:z});ee(_e||xe),Ee.preventDefault();break}case"ArrowRight":{const xe=n.addDays(ge,U?-1:1),Pe=n.addMonths(ge,U?-1:1),_e=vw({utils:n,date:xe,minDate:U?n.startOfMonth(Pe):xe,maxDate:U?xe:n.endOfMonth(Pe),isDateDisabled:G,timezone:z});ee(_e||xe),Ee.preventDefault();break}case"Home":ee(n.startOfWeek(ge)),Ee.preventDefault();break;case"End":ee(n.endOfWeek(ge)),Ee.preventDefault();break;case"PageUp":ee(n.addMonths(ge,1)),Ee.preventDefault();break;case"PageDown":ee(n.addMonths(ge,-1)),Ee.preventDefault();break}}),ce=Qe((Ee,ge)=>ee(ge)),ae=Qe((Ee,ge)=>{K&&n.isSameDay(Y,ge)&&(k==null||k(!1))}),ne=n.getMonth(i),ue=n.getYear(i),he=w.useMemo(()=>a.filter(Ee=>!!Ee).map(Ee=>n.startOfDay(Ee)),[n,a]),re=`${ue}-${ne}`,le=w.useMemo(()=>w.createRef(),[re]),me=w.useMemo(()=>{const Ee=n.startOfMonth(i),ge=n.endOfMonth(i);return G(Y)||n.isAfterDay(Y,ge)||n.isBeforeDay(Y,Ee)?vw({utils:n,date:Y,minDate:Ee,maxDate:ge,disablePast:v,disableFuture:x,isDateDisabled:G,timezone:z}):Y},[i,x,v,Y,G,n,z]),Se=w.useMemo(()=>{const Ee=n.getWeekArray(i);let ge=n.addMonths(i,1);for(;$&&Ee.length<$;){const xe=n.getWeekArray(ge),Pe=n.isSameDay(Ee[Ee.length-1][0],xe[0][0]);xe.slice(Pe?1:0).forEach(_e=>{Ee.length<$&&Ee.push(_e)}),ge=n.addMonths(ge,1)}return Ee},[i,$,n]);return _.jsxs(GKe,{role:"grid","aria-labelledby":M,className:B.root,children:[_.jsxs(qKe,{role:"row",className:B.header,children:[R&&_.jsx(YKe,{variant:"caption",role:"columnheader","aria-label":H.calendarWeekNumberHeaderLabel,className:B.weekNumberLabel,children:H.calendarWeekNumberHeaderText}),c9e(n,N).map((Ee,ge)=>_.jsx(KKe,{variant:"caption",role:"columnheader","aria-label":n.format(Ee,"weekday"),className:B.weekDayLabel,children:O(Ee)},ge.toString()))]}),l?_.jsx(XKe,{className:B.loadingContainer,children:h()}):_.jsx(JKe,F({transKey:re,onExited:u,reduceAnimations:f,slideDirection:g,className:fe(o,B.slideTransition)},y,{nodeRef:le,children:_.jsx(ZKe,{ref:le,role:"rowgroup",className:B.monthContainer,children:Se.map((Ee,ge)=>_.jsxs(eYe,{role:"row",className:B.weekContainer,"aria-rowindex":ge+1,children:[R&&_.jsx(QKe,{className:B.weekNumber,role:"rowheader","aria-label":H.calendarWeekNumberAriaLabelText(n.getWeekNumber(Ee[0])),children:H.calendarWeekNumberText(n.getWeekNumber(Ee[0]))}),Ee.map((xe,Pe)=>_.jsx(tYe,{parentProps:t,day:xe,selectedDays:he,focusableDay:me,onKeyDown:te,onFocus:ce,onBlur:ae,onDaySelect:ie,isDateDisabled:G,currentMonthNumber:ne,isViewFocused:K,"aria-colindex":Pe+1},xe.toString()))]},`week-${Ee[0]}`))})}))]})}function rYe(e){return je("MuiPickersMonth",e)}const ZC=Be("MuiPickersMonth",["root","monthButton","disabled","selected"]),oYe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow","slots","slotProps"],iYe=e=>{const{disabled:t,selected:n,classes:r}=e;return Oe({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},rYe,r)},aYe=se("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{monthsPerRow:4},style:{flexBasis:"25%"}}]}),sYe=se("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${ZC.disabled}`]:t.disabled},{[`&.${ZC.selected}`]:t.selected}]})(({theme:e})=>F({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${ZC.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${ZC.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),lYe=w.memo(function(t){const n=hn({props:t,name:"MuiPickersMonth"}),{autoFocus:r,className:o,children:i,disabled:a,selected:s,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:f,onBlur:h,"aria-current":g,"aria-label":y,slots:v,slotProps:x}=n,S=We(n,oYe),C=w.useRef(null),I=iYe(n);On(()=>{var O;r&&((O=C.current)==null||O.focus())},[r]);const E=(v==null?void 0:v.monthButton)??sYe,T=Pn({elementType:E,externalSlotProps:x==null?void 0:x.monthButton,additionalProps:{children:i,disabled:a,tabIndex:c,ref:C,type:"button",role:"radio","aria-current":g,"aria-checked":s,"aria-label":y,onClick:O=>u(O,l),onKeyDown:O=>d(O,l),onFocus:O=>f(O,l),onBlur:O=>h(O,l)},ownerState:n,className:I.monthButton});return _.jsx(aYe,F({className:fe(I.root,o),ownerState:n},S,{children:_.jsx(E,F({},T))}))});function cYe(e){return je("MuiMonthCalendar",e)}Be("MuiMonthCalendar",["root"]);const uYe=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId","slots","slotProps"],dYe=e=>{const{classes:t}=e;return Oe({root:["root"]},cYe,t)};function fYe(e,t){const n=In(),r=fh(),o=hn({props:e,name:t});return F({disableFuture:!1,disablePast:!1},o,{minDate:Oi(n,o.minDate,r.minDate),maxDate:Oi(n,o.maxDate,r.maxDate)})}const pYe=se("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:DT,boxSizing:"border-box"}),hYe=w.forwardRef(function(t,n){const r=fYe(t,"MuiMonthCalendar"),{className:o,value:i,defaultValue:a,referenceDate:s,disabled:l,disableFuture:c,disablePast:u,maxDate:d,minDate:f,onChange:h,shouldDisableMonth:g,readOnly:y,autoFocus:v=!1,onMonthFocus:x,hasFocus:S,onFocusedViewChange:C,monthsPerRow:I=3,timezone:E,gridLabelId:T,slots:O,slotProps:A}=r,k=We(r,uYe),{value:M,handleValueChange:R,timezone:$}=Uy({name:"MonthCalendar",timezone:E,value:i,defaultValue:a,referenceDate:s,onChange:h,valueManager:io}),L=ph($),z=Yn(),N=In(),B=w.useMemo(()=>io.getInitialReferenceValue({value:M,utils:N,props:r,timezone:$,referenceDate:s,granularity:xl.month}),[]),U=r,G=dYe(U),H=w.useMemo(()=>N.getMonth(L),[N,L]),K=w.useMemo(()=>M!=null?N.getMonth(M):null,[M,N]),[q,Y]=w.useState(()=>K||N.getMonth(B)),[J,ie]=Ei({name:"MonthCalendar",state:"hasFocus",controlled:S,default:v??!1}),ee=Qe(re=>{ie(re),C&&C(re)}),te=w.useCallback(re=>{const le=N.startOfMonth(u&&N.isAfter(L,f)?L:f),me=N.startOfMonth(c&&N.isBefore(L,d)?L:d),Se=N.startOfMonth(re);return N.isBefore(Se,le)||N.isAfter(Se,me)?!0:g?g(Se):!1},[c,u,d,f,L,g,N]),ce=Qe((re,le)=>{if(y)return;const me=N.setMonth(M??B,le);R(me)}),ae=Qe(re=>{te(N.setMonth(M??B,re))||(Y(re),ee(!0),x&&x(re))});w.useEffect(()=>{Y(re=>K!==null&&re!==K?K:re)},[K]);const ne=Qe((re,le)=>{switch(re.key){case"ArrowUp":ae((12+le-3)%12),re.preventDefault();break;case"ArrowDown":ae((12+le+3)%12),re.preventDefault();break;case"ArrowLeft":ae((12+le+(z?1:-1))%12),re.preventDefault();break;case"ArrowRight":ae((12+le+(z?-1:1))%12),re.preventDefault();break}}),ue=Qe((re,le)=>{ae(le)}),he=Qe((re,le)=>{q===le&&ee(!1)});return _.jsx(pYe,F({ref:n,className:fe(G.root,o),ownerState:U,role:"radiogroup","aria-labelledby":T},k,{children:DB(N,M??B).map(re=>{const le=N.getMonth(re),me=N.format(re,"monthShort"),Se=N.format(re,"month"),Ee=le===K,ge=l||te(re);return _.jsx(lYe,{selected:Ee,value:le,onClick:ce,onKeyDown:ne,autoFocus:J&&le===q,disabled:ge,tabIndex:le===q&&!ge?0:-1,onFocus:ue,onBlur:he,"aria-current":H===le?"date":void 0,"aria-label":Se,monthsPerRow:I,slots:O,slotProps:A,children:me},me)})}))});function mYe(e){return je("MuiPickersYear",e)}const e1=Be("MuiPickersYear",["root","yearButton","selected","disabled"]),gYe=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow","slots","slotProps"],yYe=e=>{const{disabled:t,selected:n,classes:r}=e;return Oe({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},mYe,r)},vYe=se("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})({display:"flex",alignItems:"center",justifyContent:"center",flexBasis:"33.3%",variants:[{props:{yearsPerRow:4},style:{flexBasis:"25%"}}]}),bYe=se("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${e1.disabled}`]:t.disabled},{[`&.${e1.selected}`]:t.selected}]})(({theme:e})=>F({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Pt(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Pt(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${e1.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${e1.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),wYe=w.memo(function(t){const n=hn({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:i,disabled:a,selected:s,value:l,tabIndex:c,onClick:u,onKeyDown:d,onFocus:f,onBlur:h,"aria-current":g,slots:y,slotProps:v}=n,x=We(n,gYe),S=w.useRef(null),C=yYe(n);On(()=>{var T;r&&((T=S.current)==null||T.focus())},[r]);const I=(y==null?void 0:y.yearButton)??bYe,E=Pn({elementType:I,externalSlotProps:v==null?void 0:v.yearButton,additionalProps:{children:i,disabled:a,tabIndex:c,ref:S,type:"button",role:"radio","aria-current":g,"aria-checked":s,onClick:T=>u(T,l),onKeyDown:T=>d(T,l),onFocus:T=>f(T,l),onBlur:T=>h(T,l)},ownerState:n,className:C.yearButton});return _.jsx(vYe,F({className:fe(C.root,o),ownerState:n},x,{children:_.jsx(I,F({},E))}))});function xYe(e){return je("MuiYearCalendar",e)}Be("MuiYearCalendar",["root"]);const SYe=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsOrder","yearsPerRow","timezone","gridLabelId","slots","slotProps"],CYe=e=>{const{classes:t}=e;return Oe({root:["root"]},xYe,t)};function EYe(e,t){const n=In(),r=fh(),o=hn({props:e,name:t});return F({disablePast:!1,disableFuture:!1},o,{yearsPerRow:o.yearsPerRow??3,minDate:Oi(n,o.minDate,r.minDate),maxDate:Oi(n,o.maxDate,r.maxDate)})}const PYe=se("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:DT,maxHeight:G8e,boxSizing:"border-box",position:"relative"}),IYe=w.forwardRef(function(t,n){const r=EYe(t,"MuiYearCalendar"),{autoFocus:o,className:i,value:a,defaultValue:s,referenceDate:l,disabled:c,disableFuture:u,disablePast:d,maxDate:f,minDate:h,onChange:g,readOnly:y,shouldDisableYear:v,onYearFocus:x,hasFocus:S,onFocusedViewChange:C,yearsOrder:I="asc",yearsPerRow:E,timezone:T,gridLabelId:O,slots:A,slotProps:k}=r,M=We(r,SYe),{value:R,handleValueChange:$,timezone:L}=Uy({name:"YearCalendar",timezone:T,value:a,defaultValue:s,referenceDate:l,onChange:g,valueManager:io}),z=ph(L),N=Yn(),B=In(),U=w.useMemo(()=>io.getInitialReferenceValue({value:R,utils:B,props:r,timezone:L,referenceDate:l,granularity:xl.year}),[]),G=r,H=CYe(G),K=w.useMemo(()=>B.getYear(z),[B,z]),q=w.useMemo(()=>R!=null?B.getYear(R):null,[R,B]),[Y,J]=w.useState(()=>q||B.getYear(U)),[ie,ee]=Ei({name:"YearCalendar",state:"hasFocus",controlled:S,default:o??!1}),te=Qe(xe=>{ee(xe),C&&C(xe)}),ce=w.useCallback(xe=>{if(d&&B.isBeforeYear(xe,z)||u&&B.isAfterYear(xe,z)||h&&B.isBeforeYear(xe,h)||f&&B.isAfterYear(xe,f))return!0;if(!v)return!1;const Pe=B.startOfYear(xe);return v(Pe)},[u,d,f,h,z,v,B]),ae=Qe((xe,Pe)=>{if(y)return;const _e=B.setYear(R??U,Pe);$(_e)}),ne=Qe(xe=>{ce(B.setYear(R??U,xe))||(J(xe),te(!0),x==null||x(xe))});w.useEffect(()=>{J(xe=>q!==null&&xe!==q?q:xe)},[q]);const ue=I!=="desc"?E*1:E*-1,he=N&&I==="asc"||!N&&I==="desc"?-1:1,re=Qe((xe,Pe)=>{switch(xe.key){case"ArrowUp":ne(Pe-ue),xe.preventDefault();break;case"ArrowDown":ne(Pe+ue),xe.preventDefault();break;case"ArrowLeft":ne(Pe-he),xe.preventDefault();break;case"ArrowRight":ne(Pe+he),xe.preventDefault();break}}),le=Qe((xe,Pe)=>{ne(Pe)}),me=Qe((xe,Pe)=>{Y===Pe&&te(!1)}),Se=w.useRef(null),Ee=cn(n,Se);w.useEffect(()=>{if(o||Se.current===null)return;const xe=Se.current.querySelector('[tabindex="0"]');if(!xe)return;const Pe=xe.offsetHeight,_e=xe.offsetTop,Le=Se.current.clientHeight,de=Se.current.scrollTop,$e=_e+Pe;Pe>Le||_e<de||(Se.current.scrollTop=$e-Le/2-Pe/2)},[o]);const ge=B.getYearRange([h,f]);return I==="desc"&&ge.reverse(),_.jsx(PYe,F({ref:Ee,className:fe(H.root,i),ownerState:G,role:"radiogroup","aria-labelledby":O},M,{children:ge.map(xe=>{const Pe=B.getYear(xe),_e=Pe===q,Le=c||ce(xe);return _.jsx(wYe,{selected:_e,value:Pe,onClick:ae,onKeyDown:re,autoFocus:ie&&Pe===Y,disabled:Le,tabIndex:Pe===Y&&!Le?0:-1,onFocus:le,onBlur:me,"aria-current":K===Pe?"date":void 0,yearsPerRow:E,slots:A,slotProps:k,children:B.format(xe,"year")},B.format(xe,"year"))})}))}),TYe=e=>je("MuiPickersCalendarHeader",e),OYe=Be("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),kYe=["slots","slotProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone","format"],MYe=["ownerState"],AYe=e=>{const{classes:t}=e;return Oe({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},TYe,t)},RYe=se("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:12,marginBottom:4,paddingLeft:24,paddingRight:12,maxHeight:40,minHeight:40}),DYe=se("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>F({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),_Ye=se("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),$Ye=se(on,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})({marginRight:"auto",variants:[{props:{view:"year"},style:{[`.${OYe.switchViewIcon}`]:{transform:"rotate(180deg)"}}}]}),NYe=se(O8e,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),LYe=w.forwardRef(function(t,n){const r=Co(),o=In(),i=hn({props:t,name:"MuiPickersCalendarHeader"}),{slots:a,slotProps:s,currentMonth:l,disabled:c,disableFuture:u,disablePast:d,maxDate:f,minDate:h,onMonthChange:g,onViewChange:y,view:v,reduceAnimations:x,views:S,labelId:C,className:I,timezone:E,format:T=`${o.formats.month} ${o.formats.year}`}=i,O=We(i,kYe),A=i,k=AYe(i),M=(a==null?void 0:a.switchViewButton)??$Ye,R=Pn({elementType:M,externalSlotProps:s==null?void 0:s.switchViewButton,additionalProps:{size:"small","aria-label":r.calendarViewSwitchingButtonAriaLabel(v)},ownerState:A,className:k.switchViewButton}),$=(a==null?void 0:a.switchViewIcon)??NYe,L=Pn({elementType:$,externalSlotProps:s==null?void 0:s.switchViewIcon,ownerState:A,className:k.switchViewIcon}),z=We(L,MYe),N=()=>g(o.addMonths(l,1),"left"),B=()=>g(o.addMonths(l,-1),"right"),U=U8e(l,{disableFuture:u,maxDate:f,timezone:E}),G=W8e(l,{disablePast:d,minDate:h,timezone:E}),H=()=>{if(!(S.length===1||!y||c))if(S.length===2)y(S.find(q=>q!==v)||S[0]);else{const q=S.indexOf(v)!==0?0:1;y(S[q])}};if(S.length===1&&S[0]==="year")return null;const K=o.formatByString(l,T);return _.jsxs(RYe,F({},O,{ownerState:A,className:fe(k.root,I),ref:n,children:[_.jsxs(DYe,{role:"presentation",onClick:H,ownerState:A,"aria-live":"polite",className:k.labelContainer,children:[_.jsx(zae,{reduceAnimations:x,transKey:K,children:_.jsx(_Ye,{id:C,ownerState:A,className:k.label,children:K})}),S.length>1&&!c&&_.jsx(M,F({},R,{children:_.jsx($,F({},z))}))]}),_.jsx(jp,{in:v==="day",appear:!x,enter:!x,children:_.jsx(fae,{slots:a,slotProps:s,onGoToPrevious:B,isPreviousDisabled:G,previousLabel:r.previousMonth,onGoToNext:N,isNextDisabled:U,nextLabel:r.nextMonth})})]}))}),FYe="@media (prefers-reduced-motion: reduce)",Xm=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),MK=Xm&&Xm[1]?parseInt(Xm[1],10):null,AK=Xm&&Xm[2]?parseInt(Xm[2],10):null,jYe=MK&&MK<10||AK&&AK<13||!1,Hae=()=>Zd(FYe,{defaultMatches:!1})||jYe,BYe=e=>je("MuiDateCalendar",e);Be("MuiDateCalendar",["root","viewTransitionContainer"]);const zYe=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsOrder","yearsPerRow","monthsPerRow","timezone"],VYe=e=>{const{classes:t}=e;return Oe({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},BYe,t)};function HYe(e,t){const n=In(),r=fh(),o=Hae(),i=hn({props:e,name:t});return F({},i,{loading:i.loading??!1,disablePast:i.disablePast??!1,disableFuture:i.disableFuture??!1,openTo:i.openTo??"day",views:i.views??["year","day"],reduceAnimations:i.reduceAnimations??o,renderLoading:i.renderLoading??(()=>_.jsx("span",{children:"..."})),minDate:Oi(n,i.minDate,r.minDate),maxDate:Oi(n,i.maxDate,r.maxDate)})}const UYe=se($T,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:_T}),WYe=se(zae,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),GYe=w.forwardRef(function(t,n){const r=In(),o=Dn(),i=HYe(t,"MuiDateCalendar"),{autoFocus:a,onViewChange:s,value:l,defaultValue:c,referenceDate:u,disableFuture:d,disablePast:f,onChange:h,onYearChange:g,onMonthChange:y,reduceAnimations:v,shouldDisableDate:x,shouldDisableMonth:S,shouldDisableYear:C,view:I,views:E,openTo:T,className:O,disabled:A,readOnly:k,minDate:M,maxDate:R,disableHighlightToday:$,focusedView:L,onFocusedViewChange:z,showDaysOutsideCurrentMonth:N,fixedWeekNumber:B,dayOfWeekFormatter:U,slots:G,slotProps:H,loading:K,renderLoading:q,displayWeekNumber:Y,yearsOrder:J,yearsPerRow:ie,monthsPerRow:ee,timezone:te}=i,ce=We(i,zYe),{value:ae,handleValueChange:ne,timezone:ue}=Uy({name:"DateCalendar",timezone:te,value:l,defaultValue:c,referenceDate:u,onChange:h,valueManager:io}),{view:he,setView:re,focusedView:le,setFocusedView:me,goToNextView:Se,setValueAndGoToNextView:Ee}=j0({view:I,views:E,openTo:T,onChange:ne,onViewChange:s,autoFocus:a,focusedView:L,onFocusedViewChange:z}),{referenceDate:ge,calendarState:xe,changeFocusedDay:Pe,changeMonth:_e,handleChangeMonth:Le,isDateDisabled:de,onMonthSwitchingAnimationEnd:$e}=DKe({value:ae,referenceDate:u,reduceAnimations:v,onMonthChange:y,minDate:M,maxDate:R,shouldDisableDate:x,disablePast:f,disableFuture:d,timezone:ue}),Ae=A&&ae||M,Ne=A&&ae||R,Ue=`${o}-grid-label`,Ze=le!==null,ut=(G==null?void 0:G.calendarHeader)??LYe,Ye=Pn({elementType:ut,externalSlotProps:H==null?void 0:H.calendarHeader,additionalProps:{views:E,view:he,currentMonth:xe.currentMonth,onViewChange:re,onMonthChange:(un,jn)=>Le({newMonth:un,direction:jn}),minDate:Ae,maxDate:Ne,disabled:A,disablePast:f,disableFuture:d,reduceAnimations:v,timezone:ue,labelId:Ue},ownerState:i}),et=Qe(un=>{const jn=r.startOfMonth(un),dr=r.endOfMonth(un),Bn=de(un)?vw({utils:r,date:un,minDate:r.isBefore(M,jn)?jn:M,maxDate:r.isAfter(R,dr)?dr:R,disablePast:f,disableFuture:d,isDateDisabled:de,timezone:ue}):un;Bn?(Ee(Bn,"finish"),y==null||y(jn)):(Se(),_e(jn)),Pe(Bn,!0)}),Xe=Qe(un=>{const jn=r.startOfYear(un),dr=r.endOfYear(un),Bn=de(un)?vw({utils:r,date:un,minDate:r.isBefore(M,jn)?jn:M,maxDate:r.isAfter(R,dr)?dr:R,disablePast:f,disableFuture:d,isDateDisabled:de,timezone:ue}):un;Bn?(Ee(Bn,"finish"),g==null||g(Bn)):(Se(),_e(jn)),Pe(Bn,!0)}),mt=Qe(un=>ne(un&&CP(r,un,ae??ge),"finish",he));w.useEffect(()=>{ae!=null&&r.isValid(ae)&&_e(ae)},[ae]);const At=i,Bt=VYe(At),gt={disablePast:f,disableFuture:d,maxDate:R,minDate:M},Vt={disableHighlightToday:$,readOnly:k,disabled:A,timezone:ue,gridLabelId:Ue,slots:G,slotProps:H},Mn=w.useRef(he);w.useEffect(()=>{Mn.current!==he&&(le===Mn.current&&me(he,!0),Mn.current=he)},[le,me,he]);const nr=w.useMemo(()=>[ae],[ae]);return _.jsxs(UYe,F({ref:n,className:fe(Bt.root,O),ownerState:At},ce,{children:[_.jsx(ut,F({},Ye,{slots:G,slotProps:H})),_.jsx(WYe,{reduceAnimations:v,className:Bt.viewTransitionContainer,transKey:he,ownerState:At,children:_.jsxs("div",{children:[he==="year"&&_.jsx(IYe,F({},gt,Vt,{value:ae,onChange:Xe,shouldDisableYear:C,hasFocus:Ze,onFocusedViewChange:un=>me("year",un),yearsOrder:J,yearsPerRow:ie,referenceDate:ge})),he==="month"&&_.jsx(hYe,F({},gt,Vt,{hasFocus:Ze,className:O,value:ae,onChange:et,shouldDisableMonth:S,onFocusedViewChange:un=>me("month",un),monthsPerRow:ee,referenceDate:ge})),he==="day"&&_.jsx(nYe,F({},xe,gt,Vt,{onMonthSwitchingAnimationEnd:$e,onFocusedDayChange:Pe,reduceAnimations:v,selectedDays:nr,onSelectedDaysChange:mt,shouldDisableDate:x,shouldDisableMonth:S,shouldDisableYear:C,hasFocus:Ze,onFocusedViewChange:un=>me("day",un),showDaysOutsideCurrentMonth:N,fixedWeekNumber:B,dayOfWeekFormatter:U,displayWeekNumber:Y,loading:K,renderLoading:q}))]})})]}))});function Uae(e){return je("MuiPickersToolbar",e)}const qYe=Be("MuiPickersToolbar",["root","content"]),KYe=["children","className","toolbarTitle","hidden","titleId","isLandscape","classes","landscapeDirection"],YYe=e=>{const{classes:t}=e;return Oe({root:["root"],content:["content"]},Uae,t)},QYe=se("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3),variants:[{props:{isLandscape:!0},style:{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"}}]})),XYe=se("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})({display:"flex",flexWrap:"wrap",width:"100%",flex:1,justifyContent:"space-between",alignItems:"center",flexDirection:"row",variants:[{props:{isLandscape:!0},style:{justifyContent:"flex-start",alignItems:"flex-start",flexDirection:"column"}},{props:{isLandscape:!0,landscapeDirection:"row"},style:{flexDirection:"row"}}]}),KB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,toolbarTitle:a,hidden:s,titleId:l}=r,c=We(r,KYe),u=r,d=YYe(u);return s?null:_.jsxs(QYe,F({ref:n,className:fe(d.root,i),ownerState:u},c,{children:[_.jsx(tt,{color:"text.secondary",variant:"overline",id:l,children:a}),_.jsx(XYe,{className:d.content,ownerState:u,children:o})]}))});function JYe(e){return je("MuiDatePickerToolbar",e)}Be("MuiDatePickerToolbar",["root","title"]);const ZYe=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views","className","onViewChange","view"],eQe=e=>{const{classes:t}=e;return Oe({root:["root"],title:["title"]},JYe,t)},tQe=se(KB,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),nQe=se(tt,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})({variants:[{props:{isLandscape:!0},style:{margin:"auto 16px auto auto"}}]}),rQe=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:i,toolbarFormat:a,toolbarPlaceholder:s="––",views:l,className:c}=r,u=We(r,ZYe),d=In(),f=Co(),h=eQe(r),g=w.useMemo(()=>{if(!o)return s;const v=Ox(d,{format:a,views:l},!0);return d.formatByString(o,v)},[o,a,s,d,l]),y=r;return _.jsx(tQe,F({ref:n,toolbarTitle:f.datePickerToolbarTitle,isLandscape:i,className:fe(h.root,c)},u,{children:_.jsx(nQe,{variant:"h4",align:i?"left":"center",ownerState:y,className:h.title,children:g})}))});function Wae(e,t){const n=In(),r=fh(),o=hn({props:e,name:t}),i=w.useMemo(()=>{var a;return((a=o.localeText)==null?void 0:a.toolbarTitle)==null?o.localeText:F({},o.localeText,{datePickerToolbarTitle:o.localeText.toolbarTitle})},[o.localeText]);return F({},o,{localeText:i},RB({views:o.views,openTo:o.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:Oi(n,o.minDate,r.minDate),maxDate:Oi(n,o.maxDate,r.maxDate),slots:F({toolbar:rQe},o.slots)})}function oQe(e){return je("MuiPickersPopper",e)}Be("MuiPickersPopper",["root","paper"]);const iQe=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],aQe=e=>{const{classes:t}=e;return Oe({root:["root"],paper:["paper"]},oQe,t)},sQe=se(pf,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),lQe=se(Kr,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})({outline:0,transformOrigin:"top center",variants:[{props:({placement:e})=>["top","top-start","top-end"].includes(e),style:{transformOrigin:"bottom center"}}]});function cQe(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function uQe(e,t){const n=w.useRef(!1),r=w.useRef(!1),o=w.useRef(null),i=w.useRef(!1);w.useEffect(()=>{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const a=Qe(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=vr(o.current);if(!o.current||"clientX"in l&&cQe(l,u))return;if(n.current){n.current=!1;return}let d;l.composedPath?d=l.composedPath().indexOf(o.current)>-1:d=!u.documentElement.contains(l.target)||o.current.contains(l.target),!d&&!c&&t(l)}),s=()=>{r.current=!0};return w.useEffect(()=>{if(e){const l=vr(o.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",a),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",a),l.removeEventListener("touchmove",c)}}},[e,a]),w.useEffect(()=>{if(e){const l=vr(o.current);return l.addEventListener("click",a),()=>{l.removeEventListener("click",a),r.current=!1}}},[e,a]),[o,s,s]}const dQe=w.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:i,paperSlotProps:a,paperClasses:s,onPaperClick:l,onPaperTouchStart:c}=e,u=We(e,iQe),d=F({},o,{placement:r}),f=Pn({elementType:n,externalSlotProps:a,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:s,ownerState:d});return _.jsx(n,F({},u,f,{onClick:h=>{var g;l(h),(g=f.onClick)==null||g.call(f,h)},onTouchStart:h=>{var g;c(h),(g=f.onTouchStart)==null||g.call(f,h)},ownerState:d,children:i}))});function fQe(e){const t=hn({props:e,name:"MuiPickersPopper"}),{anchorEl:n,children:r,containerRef:o=null,shouldRestoreFocus:i,onBlur:a,onDismiss:s,open:l,role:c,placement:u,slots:d,slotProps:f,reduceAnimations:h}=t;w.useEffect(()=>{function N(B){l&&B.key==="Escape"&&s()}return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[s,l]);const g=w.useRef(null);w.useEffect(()=>{c==="tooltip"||i&&!i()||(l?g.current=Bi(document):g.current&&g.current instanceof HTMLElement&&setTimeout(()=>{g.current instanceof HTMLElement&&g.current.focus()}))},[l,c,i]);const[y,v,x]=uQe(l,a??s),S=w.useRef(null),C=cn(S,o),I=cn(C,y),E=t,T=aQe(E),O=Hae(),A=h??O,k=N=>{N.key==="Escape"&&(N.stopPropagation(),s())},M=(d==null?void 0:d.desktopTransition)??A?jp:Bp,R=(d==null?void 0:d.desktopTrapFocus)??KF,$=(d==null?void 0:d.desktopPaper)??lQe,L=(d==null?void 0:d.popper)??sQe,z=Pn({elementType:L,externalSlotProps:f==null?void 0:f.popper,additionalProps:{transition:!0,role:c,open:l,anchorEl:n,placement:u,onKeyDown:k},className:T.root,ownerState:t});return _.jsx(L,F({},z,{children:({TransitionProps:N,placement:B})=>_.jsx(R,F({open:l,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:c==="tooltip",isEnabled:()=>!0},f==null?void 0:f.desktopTrapFocus,{children:_.jsx(M,F({},N,f==null?void 0:f.desktopTransition,{children:_.jsx(dQe,{PaperComponent:$,ownerState:E,popperPlacement:B,ref:I,onPaperClick:v,onPaperTouchStart:x,paperClasses:T.paper,paperSlotProps:f==null?void 0:f.desktopPaper,children:r})}))}))}))}const pQe=({open:e,onOpen:t,onClose:n})=>{const r=w.useRef(typeof e=="boolean").current,[o,i]=w.useState(!1);w.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}},[r,e]);const a=w.useCallback(s=>{r||i(s),s&&t&&t(),!s&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:a}},hQe=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?i?!0:n(r.lastPublishedValue):!1},mQe=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:i}=e,a=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?a&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&i?a?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},gQe=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},yQe=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:i,onChange:a,value:s,defaultValue:l,closeOnSelect:c=r==="desktop",timezone:u,referenceDate:d}=e,{current:f}=w.useRef(l),{current:h}=w.useRef(s!==void 0),[g,y]=w.useState(u),v=In(),x=dh(),{isOpen:S,setIsOpen:C}=pQe(e),{timezone:I,value:E,handleValueChange:T}=$B({timezone:u,value:s,defaultValue:f,referenceDate:d,onChange:a,valueManager:t}),[O,A]=w.useState(()=>{let ne;return E!==void 0?ne=E:f!==void 0?ne=f:ne=t.emptyValue,{draft:ne,lastPublishedValue:ne,lastCommittedValue:ne,lastControlledValue:s,hasBeenModifiedSinceMount:!1}}),k=t.getTimezone(v,O.draft);g!==u&&(y(u),u&&k&&u!==k&&A(ne=>F({},ne,{draft:t.setTimezone(v,u,ne.draft)})));const{getValidationErrorForNewValue:M}=Oae({props:e,validator:o,timezone:I,value:O.draft,onError:e.onError}),R=Qe(ne=>{const ue={action:ne,dateState:O,hasChanged:Ee=>!t.areValuesEqual(v,ne.value,Ee),isControlled:h,closeOnSelect:c},he=hQe(ue),re=mQe(ue),le=gQe(ue);A(Ee=>F({},Ee,{draft:ne.value,lastPublishedValue:he?ne.value:Ee.lastPublishedValue,lastCommittedValue:re?ne.value:Ee.lastCommittedValue,hasBeenModifiedSinceMount:!0}));let me=null;const Se=()=>(me||(me={validationError:ne.name==="setValueFromField"?ne.context.validationError:M(ne.value)},ne.name==="setValueFromShortcut"&&(me.shortcut=ne.shortcut)),me);he&&T(ne.value,Se()),re&&i&&i(ne.value,Se()),le&&C(!1)});if(O.lastControlledValue!==s){const ne=t.areValuesEqual(v,O.draft,E);A(ue=>F({},ue,{lastControlledValue:s},ne?{}:{lastCommittedValue:E,lastPublishedValue:E,draft:E,hasBeenModifiedSinceMount:!0}))}const $=Qe(()=>{R({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),L=Qe(()=>{R({value:O.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),z=Qe(()=>{R({value:O.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),N=Qe(()=>{R({value:O.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),B=Qe(()=>{R({value:t.getTodayValue(v,I,n),name:"setValueFromAction",pickerAction:"today"})}),U=Qe(ne=>{ne.preventDefault(),C(!0)}),G=Qe(ne=>{ne==null||ne.preventDefault(),C(!1)}),H=Qe((ne,ue="partial")=>R({name:"setValueFromView",value:ne,selectionState:ue})),K=Qe((ne,ue,he)=>R({name:"setValueFromShortcut",value:ne,changeImportance:ue,shortcut:he})),q=Qe((ne,ue)=>R({name:"setValueFromField",value:ne,context:ue})),Y={onClear:$,onAccept:L,onDismiss:z,onCancel:N,onSetToday:B,onOpen:U,onClose:G},J={value:O.draft,onChange:q},ie=w.useMemo(()=>t.cleanValue(v,O.draft),[v,t,O.draft]),ee={value:ie,onChange:H,onClose:G,open:S},ce=F({},Y,{value:ie,onChange:H,onSelectShortcut:K,isValid:ne=>{const ue=o({adapter:x,value:ne,timezone:I,props:e});return!t.hasError(ue)}}),ae=w.useMemo(()=>({onOpen:U,onClose:G,open:S}),[S,G,U]);return{open:S,fieldProps:J,viewProps:ee,layoutProps:ce,actions:Y,contextValue:ae}},vQe=["className","sx"],bQe=({props:e,propsFromPickerValue:t,additionalViewProps:n,autoFocusView:r,rendererInterceptor:o,fieldRef:i})=>{const{onChange:a,open:s,onClose:l}=t,{view:c,views:u,openTo:d,onViewChange:f,viewRenderers:h,timezone:g}=e,y=We(e,vQe),{view:v,setView:x,defaultView:S,focusedView:C,setFocusedView:I,setValueAndGoToNextView:E}=j0({view:c,views:u,openTo:d,onChange:a,onViewChange:f,autoFocus:r}),{hasUIView:T,viewModeLookup:O}=w.useMemo(()=>u.reduce((z,N)=>{let B;return h[N]!=null?B="UI":B="field",z.viewModeLookup[N]=B,B==="UI"&&(z.hasUIView=!0),z},{hasUIView:!1,viewModeLookup:{}}),[h,u]),A=w.useMemo(()=>u.reduce((z,N)=>h[N]!=null&&Qg(N)?z+1:z,0),[h,u]),k=O[v],M=Qe(()=>k==="UI"),[R,$]=w.useState(k==="UI"?v:null);return R!==v&&O[v]==="UI"&&$(v),On(()=>{k==="field"&&s&&(l(),setTimeout(()=>{var z,N;(z=i==null?void 0:i.current)==null||z.setSelectedSections(v),(N=i==null?void 0:i.current)==null||N.focusField(v)}))},[v]),On(()=>{if(!s)return;let z=v;k==="field"&&R!=null&&(z=R),z!==S&&O[z]==="UI"&&O[S]==="UI"&&(z=S),z!==v&&x(z),I(z,!0)},[s]),{hasUIView:T,shouldRestoreFocus:M,layoutProps:{views:u,view:R,onViewChange:x},renderCurrentView:()=>{if(R==null)return null;const z=h[R];if(z==null)return null;const N=F({},y,n,t,{views:u,timezone:g,onChange:E,view:R,onViewChange:x,focusedView:C,onFocusedViewChange:I,showViewSwitcher:A>1,timeViewsCount:A});return o?o(h,R,N):z(N)}}};function RK(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const wQe=(e,t)=>{const[n,r]=w.useState(RK);return On(()=>{const i=()=>{r(RK())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),bm(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},xQe=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,i=wQe(n.views,o),a=Yn();return{layoutProps:F({},n,t,{isLandscape:i,isRtl:a,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}};function SQe(e){const{props:t,pickerValueResponse:n}=e;return w.useMemo(()=>({value:n.viewProps.value,open:n.open,disabled:t.disabled??!1,readOnly:t.readOnly??!1}),[n.viewProps.value,n.open,t.disabled,t.readOnly])}const Gae=({props:e,valueManager:t,valueType:n,wrapperVariant:r,additionalViewProps:o,validator:i,autoFocusView:a,rendererInterceptor:s,fieldRef:l})=>{const c=yQe({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:i}),u=bQe({props:e,additionalViewProps:o,autoFocusView:a,fieldRef:l,propsFromPickerValue:c.viewProps,rendererInterceptor:s}),d=xQe({props:e,wrapperVariant:r,propsFromPickerValue:c.layoutProps,propsFromPickerViews:u.layoutProps}),f=SQe({props:e,pickerValueResponse:c});return{open:c.open,actions:c.actions,fieldProps:c.fieldProps,renderCurrentView:u.renderCurrentView,hasUIView:u.hasUIView,shouldRestoreFocus:u.shouldRestoreFocus,layoutProps:d.layoutProps,contextValue:c.contextValue,ownerState:f}};function qae(e){return je("MuiPickersLayout",e)}const bl=Be("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","tabs","shortcuts"]),CQe=["onAccept","onClear","onCancel","onSetToday","actions"];function EQe(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:i}=e,a=We(e,CQe),s=Co();if(i==null||i.length===0)return null;const l=i==null?void 0:i.map(c=>{switch(c){case"clear":return _.jsx(at,{onClick:n,children:s.clearButtonLabel},c);case"cancel":return _.jsx(at,{onClick:r,children:s.cancelButtonLabel},c);case"accept":return _.jsx(at,{onClick:t,children:s.okButtonLabel},c);case"today":return _.jsx(at,{onClick:o,children:s.todayButtonLabel},c);default:return null}});return _.jsx(Nw,F({},a,{children:l}))}const PQe=["items","changeImportance","isLandscape","onChange","isValid"],IQe=["getValue"];function TQe(e){const{items:t,changeImportance:n="accept",onChange:r,isValid:o}=e,i=We(e,PQe);if(t==null||t.length===0)return null;const a=t.map(s=>{let{getValue:l}=s,c=We(s,IQe);const u=l({isValid:o});return F({},c,{label:c.label,onClick:()=>{r(u,n,c)},disabled:!o(u)})});return _.jsx(xa,F({dense:!0,sx:[{maxHeight:_T,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:a.map(s=>_.jsx(Ka,{children:_.jsx(Pu,F({},s))},s.id??s.label))}))}function OQe(e){return e.view!==null}const kQe=e=>{const{classes:t,isLandscape:n}=e;return Oe({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},qae,t)},Kae=e=>{const{wrapperVariant:t,onAccept:n,onClear:r,onCancel:o,onSetToday:i,view:a,views:s,onViewChange:l,value:c,onChange:u,onSelectShortcut:d,isValid:f,isLandscape:h,disabled:g,readOnly:y,children:v,slots:x,slotProps:S}=e,C=kQe(e),I=(x==null?void 0:x.actionBar)??EQe,E=Pn({elementType:I,externalSlotProps:S==null?void 0:S.actionBar,additionalProps:{onAccept:n,onClear:r,onCancel:o,onSetToday:i,actions:t==="desktop"?[]:["cancel","accept"]},className:C.actionBar,ownerState:F({},e,{wrapperVariant:t})}),T=_.jsx(I,F({},E)),O=x==null?void 0:x.toolbar,A=Pn({elementType:O,externalSlotProps:S==null?void 0:S.toolbar,additionalProps:{isLandscape:h,onChange:u,value:c,view:a,onViewChange:l,views:s,disabled:g,readOnly:y},className:C.toolbar,ownerState:F({},e,{wrapperVariant:t})}),k=OQe(A)&&O?_.jsx(O,F({},A)):null,M=v,R=x==null?void 0:x.tabs,$=a&&R?_.jsx(R,F({view:a,onViewChange:l,className:C.tabs},S==null?void 0:S.tabs)):null,L=(x==null?void 0:x.shortcuts)??TQe,z=Pn({elementType:L,externalSlotProps:S==null?void 0:S.shortcuts,additionalProps:{isValid:f,isLandscape:h,onChange:d},className:C.shortcuts,ownerState:{isValid:f,isLandscape:h,onChange:d,wrapperVariant:t}}),N=a&&L?_.jsx(L,F({},z)):null;return{toolbar:k,content:M,tabs:$,actionBar:T,shortcuts:N}},MQe=e=>{const{isLandscape:t,classes:n}=e;return Oe({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},qae,n)},Yae=se("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${bl.actionBar}`]:{gridColumn:"1 / 4",gridRow:3},variants:[{props:{isLandscape:!0},style:{[`& .${bl.toolbar}`]:{gridColumn:1,gridRow:"2 / 3"},[`.${bl.shortcuts}`]:{gridColumn:"2 / 4",gridRow:1}}},{props:{isLandscape:!0,isRtl:!0},style:{[`& .${bl.toolbar}`]:{gridColumn:3}}},{props:{isLandscape:!1},style:{[`& .${bl.toolbar}`]:{gridColumn:"2 / 4",gridRow:1},[`& .${bl.shortcuts}`]:{gridColumn:1,gridRow:"2 / 3"}}},{props:{isLandscape:!1,isRtl:!0},style:{[`& .${bl.shortcuts}`]:{gridColumn:3}}}]}),Qae=se("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),Xae=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersLayout"}),{toolbar:o,content:i,tabs:a,actionBar:s,shortcuts:l}=Kae(r),{sx:c,className:u,isLandscape:d,wrapperVariant:f}=r,h=MQe(r);return _.jsxs(Yae,{ref:n,sx:c,className:fe(h.root,u),ownerState:r,children:[d?l:o,d?o:l,_.jsx(Qae,{className:h.contentWrapper,children:f==="desktop"?_.jsxs(w.Fragment,{children:[i,a]}):_.jsxs(w.Fragment,{children:[a,i]})}),s]})}),AQe=["props","getOpenDialogAriaText"],RQe=["ownerState"],DQe=["ownerState"],YB=e=>{var Se;let{props:t,getOpenDialogAriaText:n}=e,r=We(e,AQe);const{slots:o,slotProps:i,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,name:g,label:y,inputRef:v,readOnly:x,disabled:S,autoFocus:C,localeText:I,reduceAnimations:E}=t,T=w.useRef(null),O=w.useRef(null),A=Dn(),k=((Se=i==null?void 0:i.toolbar)==null?void 0:Se.hidden)??!1,{open:M,actions:R,hasUIView:$,layoutProps:L,renderCurrentView:z,shouldRestoreFocus:N,fieldProps:B,contextValue:U,ownerState:G}=Gae(F({},r,{props:t,fieldRef:O,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),H=o.inputAdornment??ro,K=Pn({elementType:H,externalSlotProps:i==null?void 0:i.inputAdornment,additionalProps:{position:"end"},ownerState:t}),q=We(K,RQe),Y=o.openPickerButton??on,J=Pn({elementType:Y,externalSlotProps:i==null?void 0:i.openPickerButton,additionalProps:{disabled:S||x,onClick:M?R.onClose:R.onOpen,"aria-label":n(B.value),edge:q.position},ownerState:t}),ie=We(J,DQe),ee=o.openPickerIcon,te=Pn({elementType:ee,externalSlotProps:i==null?void 0:i.openPickerIcon,ownerState:G}),ce=o.field,ae=Pn({elementType:ce,externalSlotProps:i==null?void 0:i.field,additionalProps:F({},B,k&&{id:A},{readOnly:x,disabled:S,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,label:y,name:g,autoFocus:C&&!t.open,focused:M?!0:void 0},v?{inputRef:v}:{}),ownerState:t});$&&(ae.InputProps=F({},ae.InputProps,{ref:T},!t.disableOpenPicker&&{[`${q.position}Adornment`]:_.jsx(H,F({},q,{children:_.jsx(Y,F({},ie,{children:_.jsx(ee,F({},te))}))}))}));const ne=F({textField:o.textField,clearIcon:o.clearIcon,clearButton:o.clearButton},ae.slots),ue=o.layout??Xae;let he=A;k&&(y?he=`${A}-label`:he=void 0);const re=F({},i,{toolbar:F({},i==null?void 0:i.toolbar,{titleId:A}),popper:F({"aria-labelledby":he},i==null?void 0:i.popper)}),le=cn(O,ae.unstableFieldRef);return{renderPicker:()=>_.jsxs(kae,{contextValue:U,localeText:I,children:[_.jsx(ce,F({},ae,{slots:ne,slotProps:re,unstableFieldRef:le})),_.jsx(fQe,F({role:"dialog",placement:"bottom-start",anchorEl:T.current},R,{open:M,slots:o,slotProps:re,shouldRestoreFocus:N,reduceAnimations:E,children:_.jsx(ue,F({},L,re==null?void 0:re.layout,{slots:o,slotProps:re,children:z()}))}))]})}},Bs=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minDate:h,maxDate:g,shouldDisableDate:y,shouldDisableMonth:v,shouldDisableYear:x,reduceAnimations:S,onMonthChange:C,monthsPerRow:I,onYearChange:E,yearsOrder:T,yearsPerRow:O,slots:A,slotProps:k,loading:M,renderLoading:R,disableHighlightToday:$,readOnly:L,disabled:z,showDaysOutsideCurrentMonth:N,dayOfWeekFormatter:B,sx:U,autoFocus:G,fixedWeekNumber:H,displayWeekNumber:K,timezone:q})=>_.jsx(GYe,{view:e,onViewChange:t,views:n.filter(Jg),focusedView:r&&Jg(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minDate:h,maxDate:g,shouldDisableDate:y,shouldDisableMonth:v,shouldDisableYear:x,reduceAnimations:S,onMonthChange:C,monthsPerRow:I,onYearChange:E,yearsOrder:T,yearsPerRow:O,slots:A,slotProps:k,loading:M,renderLoading:R,disableHighlightToday:$,readOnly:L,disabled:z,showDaysOutsideCurrentMonth:N,dayOfWeekFormatter:B,sx:U,autoFocus:G,fixedWeekNumber:H,displayWeekNumber:K,timezone:q}),Jae=w.forwardRef(function(t,n){var c,u;const r=Co(),o=In(),i=Wae(t,"MuiDesktopDatePicker"),a=F({day:Bs,month:Bs,year:Bs},i.viewRenderers),s=F({},i,{viewRenderers:a,format:Ox(o,i,!1),yearsPerRow:i.yearsPerRow??4,slots:F({openPickerIcon:dae,field:Lae},i.slots),slotProps:F({},i.slotProps,{field:d=>{var f;return F({},Cu((f=i.slotProps)==null?void 0:f.field,d),Gy(i),{ref:n})},toolbar:F({hidden:!0},(c=i.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=YB({props:s,valueManager:io,valueType:"date",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(u=s.localeText)==null?void 0:u.openDatePickerDialogue}),validator:Wy});return l()});Jae.propTypes={autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,minDate:V.object,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","month","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["day","month","year"]),viewRenderers:V.shape({day:V.func,month:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","month","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const _Qe=se($w)({[`& .${iw.container}`]:{outline:0},[`& .${iw.paper}`]:{outline:0,minWidth:DT}}),$Qe=se(Lw)({"&:first-of-type":{padding:0}});function NQe(e){const{children:t,onDismiss:n,open:r,slots:o,slotProps:i}=e,a=(o==null?void 0:o.dialog)??_Qe,s=(o==null?void 0:o.mobileTransition)??jp;return _.jsx(a,F({open:r,onClose:n},i==null?void 0:i.dialog,{TransitionComponent:s,TransitionProps:i==null?void 0:i.mobileTransition,PaperComponent:o==null?void 0:o.mobilePaper,PaperProps:i==null?void 0:i.mobilePaper,children:_.jsx($Qe,{children:t})}))}const LQe=["props","getOpenDialogAriaText"],QB=e=>{var q;let{props:t,getOpenDialogAriaText:n}=e,r=We(e,LQe);const{slots:o,slotProps:i,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,name:g,label:y,inputRef:v,readOnly:x,disabled:S,localeText:C}=t,I=w.useRef(null),E=Dn(),T=((q=i==null?void 0:i.toolbar)==null?void 0:q.hidden)??!1,{open:O,actions:A,layoutProps:k,renderCurrentView:M,fieldProps:R,contextValue:$}=Gae(F({},r,{props:t,fieldRef:I,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),L=o.field,z=Pn({elementType:L,externalSlotProps:i==null?void 0:i.field,additionalProps:F({},R,T&&{id:E},!(S||x)&&{onClick:A.onOpen,onKeyDown:K9e(A.onOpen)},{readOnly:x??!0,disabled:S,className:a,sx:s,format:l,formatDensity:c,enableAccessibleFieldDOMStructure:u,selectedSections:d,onSelectedSectionsChange:f,timezone:h,label:y,name:g},v?{inputRef:v}:{}),ownerState:t});z.inputProps=F({},z.inputProps,{"aria-label":n(R.value)});const N=F({textField:o.textField},z.slots),B=o.layout??Xae;let U=E;T&&(y?U=`${E}-label`:U=void 0);const G=F({},i,{toolbar:F({},i==null?void 0:i.toolbar,{titleId:E}),mobilePaper:F({"aria-labelledby":U},i==null?void 0:i.mobilePaper)}),H=cn(I,z.unstableFieldRef);return{renderPicker:()=>_.jsxs(kae,{contextValue:$,localeText:C,children:[_.jsx(L,F({},z,{slots:N,slotProps:G,unstableFieldRef:H})),_.jsx(NQe,F({},A,{open:O,slots:o,slotProps:G,children:_.jsx(B,F({},k,G==null?void 0:G.layout,{slots:o,slotProps:G,children:M()}))}))]})}},Zae=w.forwardRef(function(t,n){var c,u;const r=Co(),o=In(),i=Wae(t,"MuiMobileDatePicker"),a=F({day:Bs,month:Bs,year:Bs},i.viewRenderers),s=F({},i,{viewRenderers:a,format:Ox(o,i,!1),slots:F({field:Lae},i.slots),slotProps:F({},i.slotProps,{field:d=>{var f;return F({},Cu((f=i.slotProps)==null?void 0:f.field,d),Gy(i),{ref:n})},toolbar:F({hidden:!1},(c=i.slotProps)==null?void 0:c.toolbar)})}),{renderPicker:l}=QB({props:s,valueManager:io,valueType:"date",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(u=s.localeText)==null?void 0:u.openDatePickerDialogue}),validator:Wy});return l()});Zae.propTypes={autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,minDate:V.object,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","month","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["day","month","year"]),viewRenderers:V.shape({day:V.func,month:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","month","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const FQe=["desktopModeMediaQuery"],kx=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=BB}=r,i=We(r,FQe);return Zd(o,{defaultMatches:!0})?_.jsx(Jae,F({ref:n},i)):_.jsx(Zae,F({ref:n},i))});function jQe(e){return je("MuiPickersToolbarText",e)}const yL=Be("MuiPickersToolbarText",["root","selected"]),BQe=["className","selected","value"],zQe=e=>{const{classes:t,selected:n}=e;return Oe({root:["root",n&&"selected"]},jQe,t)},VQe=se(tt,{name:"MuiPickersToolbarText",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${yL.selected}`]:t.selected}]})(({theme:e})=>({transition:e.transitions.create("color"),color:(e.vars||e).palette.text.secondary,[`&.${yL.selected}`]:{color:(e.vars||e).palette.text.primary}})),XB=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersToolbarText"}),{className:o,value:i}=r,a=We(r,BQe),s=zQe(r);return _.jsx(VQe,F({ref:n,className:fe(s.root,o),component:"span"},a,{children:i}))}),HQe=["align","className","selected","typographyClassName","value","variant","width"],UQe=e=>{const{classes:t}=e;return Oe({root:["root"]},Uae,t)},WQe=se(at,{name:"MuiPickersToolbarButton",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,minWidth:16,textTransform:"none"}),Da=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiPickersToolbarButton"}),{align:o,className:i,selected:a,typographyClassName:s,value:l,variant:c,width:u}=r,d=We(r,HQe),f=UQe(r);return _.jsx(WQe,F({variant:"text",ref:n,className:fe(f.root,i)},u?{sx:{width:u}}:{},d,{children:_.jsx(XB,{align:o,className:s,variant:c,value:l,selected:a})}))});function GQe(e){return je("MuiTimePickerToolbar",e)}const bw=Be("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),qQe=["ampm","ampmInClock","value","isLandscape","onChange","view","onViewChange","views","disabled","readOnly","className"],KQe=e=>{const{isLandscape:t,classes:n,isRtl:r}=e;return Oe({root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",t&&"hourMinuteLabelLandscape",r&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",t&&"ampmLandscape"],ampmLabel:["ampmLabel"]},GQe,n)},YQe=se(KB,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),QQe=se(XB,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),XQe=se("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(e,t)=>[{[`&.${bw.hourMinuteLabelLandscape}`]:t.hourMinuteLabelLandscape,[`&.${bw.hourMinuteLabelReverse}`]:t.hourMinuteLabelReverse},t.hourMinuteLabel]})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{isLandscape:!0},style:{marginTop:"auto"}}]}),JQe=se("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${bw.ampmLabel}`]:t.ampmLabel},{[`&.${bw.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${bw.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"}}]});function ZQe(e){const t=hn({props:e,name:"MuiTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:o,isLandscape:i,onChange:a,view:s,onViewChange:l,views:c,disabled:u,readOnly:d,className:f}=t,h=We(t,qQe),g=In(),y=Co(),v=Yn(),x=!!(n&&!r&&c.includes("hours")),{meridiemMode:S,handleMeridiemChange:C}=AT(o,n,a),I=A=>n?g.format(A,"hours12h"):g.format(A,"hours24h"),E=F({},t,{isRtl:v}),T=KQe(E),O=_.jsx(QQe,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:T.separator});return _.jsxs(YQe,F({landscapeDirection:"row",toolbarTitle:y.timePickerToolbarTitle,isLandscape:i,ownerState:E,className:fe(T.root,f)},h,{children:[_.jsxs(XQe,{className:T.hourMinuteLabel,ownerState:E,children:[bm(c,"hours")&&_.jsx(Da,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:s==="hours",value:o?I(o):"--"}),bm(c,["hours","minutes"])&&O,bm(c,"minutes")&&_.jsx(Da,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:s==="minutes",value:o?g.format(o,"minutes"):"--"}),bm(c,["minutes","seconds"])&&O,bm(c,"seconds")&&_.jsx(Da,{variant:"h3",onClick:()=>l("seconds"),selected:s==="seconds",value:o?g.format(o,"seconds"):"--"})]}),x&&_.jsxs(JQe,{className:T.ampmSelection,ownerState:E,children:[_.jsx(Da,{disableRipple:!0,variant:"subtitle2",selected:S==="am",typographyClassName:T.ampmLabel,value:Il(g,"am"),onClick:d?void 0:()=>C("am"),disabled:u}),_.jsx(Da,{disableRipple:!0,variant:"subtitle2",selected:S==="pm",typographyClassName:T.ampmLabel,value:Il(g,"pm"),onClick:d?void 0:()=>C("pm"),disabled:u})]})]}))}function ese(e,t){var a;const n=In(),r=hn({props:e,name:t}),o=r.ampm??n.is12HourCycleInCurrentLocale(),i=w.useMemo(()=>{var s;return((s=r.localeText)==null?void 0:s.toolbarTitle)==null?r.localeText:F({},r.localeText,{timePickerToolbarTitle:r.localeText.toolbarTitle})},[r.localeText]);return F({},r,{ampm:o,localeText:i},RB({views:r.views,openTo:r.openTo,defaultViews:["hours","minutes"],defaultOpenTo:"hours"}),{disableFuture:r.disableFuture??!1,disablePast:r.disablePast??!1,slots:F({toolbar:ZQe},r.slots),slotProps:F({},r.slotProps,{toolbar:F({ampm:o,ampmInClock:r.ampmInClock},(a=r.slotProps)==null?void 0:a.toolbar)})})}const Jm=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,ampmInClock:S,slots:C,slotProps:I,readOnly:E,disabled:T,sx:O,autoFocus:A,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:M,timezone:R})=>_.jsx(W9e,{view:e,onViewChange:t,focusedView:n&&Qg(n)?n:null,onFocusedViewChange:r,views:o.filter(Qg),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,ampmInClock:S,slots:C,slotProps:I,readOnly:E,disabled:T,sx:O,autoFocus:A,showViewSwitcher:k,disableIgnoringDatePartForTimeValidation:M,timezone:R}),tse=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeSteps:k,skipDisabled:M,timezone:R})=>_.jsx(e7e,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o.filter(Qg),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeStep:k==null?void 0:k.minutes,skipDisabled:M,timezone:R}),PP=({view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o,value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeSteps:k,skipDisabled:M,timezone:R})=>_.jsx(p7e,{view:e,onViewChange:t,focusedView:n,onFocusedViewChange:r,views:o.filter(Qg),value:i,defaultValue:a,referenceDate:s,onChange:l,className:c,classes:u,disableFuture:d,disablePast:f,minTime:h,maxTime:g,shouldDisableTime:y,minutesStep:v,ampm:x,slots:S,slotProps:C,readOnly:I,disabled:E,sx:T,autoFocus:O,disableIgnoringDatePartForTimeValidation:A,timeSteps:k,skipDisabled:M,timezone:R}),eXe=["views","format"],nse=(e,t,n)=>{let{views:r,format:o}=t,i=We(t,eXe);if(o)return o;const a=[],s=[];if(r.forEach(u=>{Qg(u)?s.push(u):Jg(u)&&a.push(u)}),s.length===0)return Ox(e,F({views:a},i),!1);if(a.length===0)return SP(e,F({views:s},i));const l=SP(e,F({views:s},i));return`${Ox(e,F({views:a},i),!1)} ${l}`},tXe=(e,t,n)=>n?t.filter(r=>!Gb(r)||r==="hours"):e?[...t,"meridiem"]:t,nXe=(e,t)=>24*60/((e.hours??1)*(e.minutes??5))<=t;function rse({thresholdToRenderTimeInASingleColumn:e,ampm:t,timeSteps:n,views:r}){const o=e??24,i=F({hours:1,minutes:5,seconds:5},n),a=nXe(i,o);return{thresholdToRenderTimeInASingleColumn:o,timeSteps:i,shouldRenderTimeInASingleColumn:a,views:tXe(t,r,a)}}const ose=w.forwardRef(function(t,n){var x,S,C,I;const r=Co(),o=In(),i=ese(t,"MuiDesktopTimePicker"),{shouldRenderTimeInASingleColumn:a,views:s,timeSteps:l}=rse(i),c=a?tse:PP,u=F({hours:c,minutes:c,seconds:c,meridiem:c},i.viewRenderers),d=i.ampmInClock??!0,f=a?[]:["accept"],g=((x=u.hours)==null?void 0:x.name)===PP.name?s:s.filter(E=>E!=="meridiem"),y=F({},i,{ampmInClock:d,timeSteps:l,viewRenderers:u,format:SP(o,i),views:a?["hours"]:g,slots:F({field:Fae,openPickerIcon:A8e},i.slots),slotProps:F({},i.slotProps,{field:E=>{var T;return F({},Cu((T=i.slotProps)==null?void 0:T.field,E),Gy(i),{ref:n})},toolbar:F({hidden:!0,ampmInClock:d},(S=i.slotProps)==null?void 0:S.toolbar),actionBar:F({actions:f},(C=i.slotProps)==null?void 0:C.actionBar)})}),{renderPicker:v}=YB({props:y,valueManager:io,valueType:"time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullTime",contextTranslation:r.openTimePickerDialogue,propsTranslation:(I=y.localeText)==null?void 0:I.openTimePickerDialogue}),validator:B0});return v()});ose.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,enableAccessibleFieldDOMStructure:V.any,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,localeText:V.object,maxTime:V.object,minTime:V.object,minutesStep:V.number,name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,open:V.bool,openTo:V.oneOf(["hours","meridiem","minutes","seconds"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableTime:V.func,skipDisabled:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),thresholdToRenderTimeInASingleColumn:V.number,timeSteps:V.shape({hours:V.number,minutes:V.number,seconds:V.number}),timezone:V.string,value:V.object,view:V.oneOf(["hours","meridiem","minutes","seconds"]),viewRenderers:V.shape({hours:V.func,meridiem:V.func,minutes:V.func,seconds:V.func}),views:V.arrayOf(V.oneOf(["hours","minutes","seconds"]).isRequired)};const ise=w.forwardRef(function(t,n){var u,d;const r=Co(),o=In(),i=ese(t,"MuiMobileTimePicker"),a=F({hours:Jm,minutes:Jm,seconds:Jm},i.viewRenderers),s=i.ampmInClock??!1,l=F({},i,{ampmInClock:s,viewRenderers:a,format:SP(o,i),slots:F({field:Fae},i.slots),slotProps:F({},i.slotProps,{field:f=>{var h;return F({},Cu((h=i.slotProps)==null?void 0:h.field,f),Gy(i),{ref:n})},toolbar:F({hidden:!1,ampmInClock:s},(u=i.slotProps)==null?void 0:u.toolbar)})}),{renderPicker:c}=QB({props:l,valueManager:io,valueType:"time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullTime",contextTranslation:r.openTimePickerDialogue,propsTranslation:(d=l.localeText)==null?void 0:d.openTimePickerDialogue}),validator:B0});return c()});ise.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,enableAccessibleFieldDOMStructure:V.any,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,localeText:V.object,maxTime:V.object,minTime:V.object,minutesStep:V.number,name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,open:V.bool,openTo:V.oneOf(["hours","minutes","seconds"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableTime:V.func,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["hours","minutes","seconds"]),viewRenderers:V.shape({hours:V.func,minutes:V.func,seconds:V.func}),views:V.arrayOf(V.oneOf(["hours","minutes","seconds"]).isRequired)};const rXe=["desktopModeMediaQuery"],vL=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiTimePicker"}),{desktopModeMediaQuery:o=BB}=r,i=We(r,rXe);return Zd(o,{defaultMatches:!0})?_.jsx(ose,F({ref:n},i)):_.jsx(ise,F({ref:n},i))});function oXe(e){return je("MuiDateTimePickerTabs",e)}Be("MuiDateTimePickerTabs",["root"]);const iXe=e=>Jg(e)?"date":"time",aXe=e=>e==="date"?"day":"hours",sXe=e=>{const{classes:t}=e;return Oe({root:["root"]},oXe,t)},lXe=se(Cee,{name:"MuiDateTimePickerTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({boxShadow:`0 -1px 0 0 inset ${(e.vars||e).palette.divider}`,"&:last-child":{boxShadow:`0 1px 0 0 inset ${(e.vars||e).palette.divider}`,[`& .${E1.indicator}`]:{bottom:"auto",top:0}}})),cXe=function(t){const n=hn({props:t,name:"MuiDateTimePickerTabs"}),{dateIcon:r=_.jsx(R8e,{}),onViewChange:o,timeIcon:i=_.jsx(D8e,{}),view:a,hidden:s=typeof window>"u"||window.innerHeight<667,className:l,sx:c}=n,u=Co(),d=sXe(n),f=(h,g)=>{o(aXe(g))};return s?null:_.jsxs(lXe,{ownerState:n,variant:"fullWidth",value:iXe(a),onChange:f,className:fe(l,d.root),sx:c,children:[_.jsx(w2,{value:"date","aria-label":u.dateTableLabel,icon:_.jsx(w.Fragment,{children:r})}),_.jsx(w2,{value:"time","aria-label":u.timeTableLabel,icon:_.jsx(w.Fragment,{children:i})})]})};function uXe(e){return je("MuiDateTimePickerToolbar",e)}const N_=Be("MuiDateTimePickerToolbar",["root","dateContainer","timeContainer","timeDigitsContainer","separator","timeLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),dXe=["ampm","ampmInClock","value","onChange","view","isLandscape","onViewChange","toolbarFormat","toolbarPlaceholder","views","disabled","readOnly","toolbarVariant","toolbarTitle","className"],fXe=e=>{const{classes:t,isLandscape:n,isRtl:r}=e;return Oe({root:["root"],dateContainer:["dateContainer"],timeContainer:["timeContainer",r&&"timeLabelReverse"],timeDigitsContainer:["timeDigitsContainer",r&&"timeLabelReverse"],separator:["separator"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]},uXe,t)},pXe=se(KB,{name:"MuiDateTimePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({paddingLeft:16,paddingRight:16,justifyContent:"space-around",position:"relative",variants:[{props:{toolbarVariant:"desktop"},style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,[`& .${qYe.content} .${yL.selected}`]:{color:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightBold}}},{props:{toolbarVariant:"desktop",isLandscape:!0},style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{paddingLeft:24,paddingRight:0}}]})),hXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"DateContainer",overridesResolver:(e,t)=>t.dateContainer})({display:"flex",flexDirection:"column",alignItems:"flex-start"}),mXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"TimeContainer",overridesResolver:(e,t)=>t.timeContainer})({display:"flex",flexDirection:"row",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop",isLandscape:!1},style:{gap:9,marginRight:4,alignSelf:"flex-end"}},{props:({isLandscape:e,toolbarVariant:t})=>e&&t!=="desktop",style:{flexDirection:"column"}},{props:({isLandscape:e,toolbarVariant:t,isRtl:n})=>e&&t!=="desktop"&&n,style:{flexDirection:"column-reverse"}}]}),gXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"TimeDigitsContainer",overridesResolver:(e,t)=>t.timeDigitsContainer})({display:"flex",variants:[{props:{isRtl:!0},style:{flexDirection:"row-reverse"}},{props:{toolbarVariant:"desktop"},style:{gap:1.5}}]}),DK=se(XB,{name:"MuiDateTimePickerToolbar",slot:"Separator",overridesResolver:(e,t)=>t.separator})({margin:"0 4px 0 2px",cursor:"default",variants:[{props:{toolbarVariant:"desktop"},style:{margin:0}}]}),yXe=se("div",{name:"MuiDateTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(e,t)=>[{[`.${N_.ampmLabel}`]:t.ampmLabel},{[`&.${N_.ampmLandscape}`]:t.ampmLandscape},t.ampmSelection]})({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12,[`& .${N_.ampmLabel}`]:{fontSize:17},variants:[{props:{isLandscape:!0},style:{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",width:"100%"}}]});function vXe(e){const t=hn({props:e,name:"MuiDateTimePickerToolbar"}),{ampm:n,ampmInClock:r,value:o,onChange:i,view:a,isLandscape:s,onViewChange:l,toolbarFormat:c,toolbarPlaceholder:u="––",views:d,disabled:f,readOnly:h,toolbarVariant:g="mobile",toolbarTitle:y,className:v}=t,x=We(t,dXe),S=Yn(),C=F({},t,{isRtl:S}),I=In(),{meridiemMode:E,handleMeridiemChange:T}=AT(o,n,i),O=!!(n&&!r),A=g==="desktop",k=Co(),M=fXe(C),R=y??k.dateTimePickerToolbarTitle,$=z=>n?I.format(z,"hours12h"):I.format(z,"hours24h"),L=w.useMemo(()=>o?c?I.formatByString(o,c):I.format(o,"shortDate"):u,[o,c,u,I]);return _.jsxs(pXe,F({isLandscape:s,className:fe(M.root,v),toolbarTitle:R},x,{ownerState:C,children:[_.jsxs(hXe,{className:M.dateContainer,ownerState:C,children:[d.includes("year")&&_.jsx(Da,{tabIndex:-1,variant:"subtitle1",onClick:()=>l("year"),selected:a==="year",value:o?I.format(o,"year"):"–"}),d.includes("day")&&_.jsx(Da,{tabIndex:-1,variant:A?"h5":"h4",onClick:()=>l("day"),selected:a==="day",value:L})]}),_.jsxs(mXe,{className:M.timeContainer,ownerState:C,children:[_.jsxs(gXe,{className:M.timeDigitsContainer,ownerState:C,children:[d.includes("hours")&&_.jsxs(w.Fragment,{children:[_.jsx(Da,{variant:A?"h5":"h3",width:A&&!s?qb:void 0,onClick:()=>l("hours"),selected:a==="hours",value:o?$(o):"--"}),_.jsx(DK,{variant:A?"h5":"h3",value:":",className:M.separator,ownerState:C}),_.jsx(Da,{variant:A?"h5":"h3",width:A&&!s?qb:void 0,onClick:()=>l("minutes"),selected:a==="minutes"||!d.includes("minutes")&&a==="hours",value:o?I.format(o,"minutes"):"--",disabled:!d.includes("minutes")})]}),d.includes("seconds")&&_.jsxs(w.Fragment,{children:[_.jsx(DK,{variant:A?"h5":"h3",value:":",className:M.separator,ownerState:C}),_.jsx(Da,{variant:A?"h5":"h3",width:A&&!s?qb:void 0,onClick:()=>l("seconds"),selected:a==="seconds",value:o?I.format(o,"seconds"):"--"})]})]}),O&&!A&&_.jsxs(yXe,{className:M.ampmSelection,ownerState:C,children:[_.jsx(Da,{variant:"subtitle2",selected:E==="am",typographyClassName:M.ampmLabel,value:Il(I,"am"),onClick:h?void 0:()=>T("am"),disabled:f}),_.jsx(Da,{variant:"subtitle2",selected:E==="pm",typographyClassName:M.ampmLabel,value:Il(I,"pm"),onClick:h?void 0:()=>T("pm"),disabled:f})]}),n&&A&&_.jsx(Da,{variant:"h5",onClick:()=>l("meridiem"),selected:a==="meridiem",value:o&&E?Il(I,E):"--",width:qb})]})]}))}function ase(e,t){var s;const n=In(),r=fh(),o=hn({props:e,name:t}),i=o.ampm??n.is12HourCycleInCurrentLocale(),a=w.useMemo(()=>{var l;return((l=o.localeText)==null?void 0:l.toolbarTitle)==null?o.localeText:F({},o.localeText,{dateTimePickerToolbarTitle:o.localeText.toolbarTitle})},[o.localeText]);return F({},o,RB({views:o.views,openTo:o.openTo,defaultViews:["year","day","hours","minutes"],defaultOpenTo:"day"}),{ampm:i,localeText:a,orientation:o.orientation??"portrait",disableIgnoringDatePartForTimeValidation:o.disableIgnoringDatePartForTimeValidation??!!(o.minDateTime||o.maxDateTime||o.disablePast||o.disableFuture),disableFuture:o.disableFuture??!1,disablePast:o.disablePast??!1,minDate:Oi(n,o.minDateTime??o.minDate,r.minDate),maxDate:Oi(n,o.maxDateTime??o.maxDate,r.maxDate),minTime:o.minDateTime??o.minTime,maxTime:o.maxDateTime??o.maxTime,slots:F({toolbar:vXe,tabs:cXe},o.slots),slotProps:F({},o.slotProps,{toolbar:F({ampm:i},(s=o.slotProps)==null?void 0:s.toolbar)})})}const bXe=w.forwardRef(function(t,n){var y;const r=Yn(),{toolbar:o,tabs:i,content:a,actionBar:s,shortcuts:l}=Kae(t),{sx:c,className:u,isLandscape:d,classes:f}=t,h=s&&(((y=s.props.actions)==null?void 0:y.length)??0)>0,g=F({},t,{isRtl:r});return _.jsxs(Yae,{ref:n,className:fe(bl.root,f==null?void 0:f.root,u),sx:[{[`& .${bl.tabs}`]:{gridRow:4,gridColumn:"1 / 4"},[`& .${bl.actionBar}`]:{gridRow:5}},...Array.isArray(c)?c:[c]],ownerState:g,children:[d?l:o,d?o:l,_.jsxs(Qae,{className:fe(bl.contentWrapper,f==null?void 0:f.contentWrapper),sx:{display:"grid"},children:[a,i,h&&_.jsx(Ti,{sx:{gridRow:3,gridColumn:"1 / 4"}})]}),s]})}),wXe=["openTo","focusedView","timeViewsCount"],xXe=function(t,n,r){var u,d;const{openTo:o,focusedView:i,timeViewsCount:a}=r,s=We(r,wXe),l=F({},s,{focusedView:null,sx:[{[`&.${IK.root}`]:{borderBottom:0},[`&.${IK.root}, .${r7e.root}, &.${q9e.root}`]:{maxHeight:_T}}]}),c=Gb(n);return _.jsxs(w.Fragment,{children:[(u=t[c?"day":n])==null?void 0:u.call(t,F({},r,{view:c?"day":n,focusedView:i&&Jg(i)?i:null,views:r.views.filter(Jg),sx:[{gridColumn:1},...l.sx]})),a>0&&_.jsxs(w.Fragment,{children:[_.jsx(Ti,{orientation:"vertical",sx:{gridColumn:2}}),(d=t[c?n:"hours"])==null?void 0:d.call(t,F({},l,{view:c?n:"hours",focusedView:i&&Gb(i)?i:null,openTo:Gb(o)?o:"hours",views:r.views.filter(Gb),sx:[{gridColumn:3},...l.sx]}))]})]})},sse=w.forwardRef(function(t,n){var S,C,I,E;const r=Co(),o=In(),i=ase(t,"MuiDesktopDateTimePicker"),{shouldRenderTimeInASingleColumn:a,thresholdToRenderTimeInASingleColumn:s,views:l,timeSteps:c}=rse(i),u=a?tse:PP,d=F({day:Bs,month:Bs,year:Bs,hours:u,minutes:u,seconds:u,meridiem:u},i.viewRenderers),f=i.ampmInClock??!0,g=((S=d.hours)==null?void 0:S.name)===PP.name?l:l.filter(T=>T!=="meridiem"),y=a?[]:["accept"],v=F({},i,{viewRenderers:d,format:nse(o,i),views:g,yearsPerRow:i.yearsPerRow??4,ampmInClock:f,timeSteps:c,thresholdToRenderTimeInASingleColumn:s,shouldRenderTimeInASingleColumn:a,slots:F({field:jae,layout:bXe,openPickerIcon:dae},i.slots),slotProps:F({},i.slotProps,{field:T=>{var O;return F({},Cu((O=i.slotProps)==null?void 0:O.field,T),Gy(i),{ref:n})},toolbar:F({hidden:!0,ampmInClock:f,toolbarVariant:"desktop"},(C=i.slotProps)==null?void 0:C.toolbar),tabs:F({hidden:!0},(I=i.slotProps)==null?void 0:I.tabs),actionBar:T=>{var O;return F({actions:y},Cu((O=i.slotProps)==null?void 0:O.actionBar,T))}})}),{renderPicker:x}=YB({props:v,valueManager:io,valueType:"date-time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(E=v.localeText)==null?void 0:E.openDatePickerDialogue}),validator:LT,rendererInterceptor:xXe});return x()});sse.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,maxDateTime:V.object,maxTime:V.object,minDate:V.object,minDateTime:V.object,minTime:V.object,minutesStep:V.number,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableTime:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,skipDisabled:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),thresholdToRenderTimeInASingleColumn:V.number,timeSteps:V.shape({hours:V.number,minutes:V.number,seconds:V.number}),timezone:V.string,value:V.object,view:V.oneOf(["day","hours","meridiem","minutes","month","seconds","year"]),viewRenderers:V.shape({day:V.func,hours:V.func,meridiem:V.func,minutes:V.func,month:V.func,seconds:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const lse=w.forwardRef(function(t,n){var u,d,f;const r=Co(),o=In(),i=ase(t,"MuiMobileDateTimePicker"),a=F({day:Bs,month:Bs,year:Bs,hours:Jm,minutes:Jm,seconds:Jm},i.viewRenderers),s=i.ampmInClock??!1,l=F({},i,{viewRenderers:a,format:nse(o,i),ampmInClock:s,slots:F({field:jae},i.slots),slotProps:F({},i.slotProps,{field:h=>{var g;return F({},Cu((g=i.slotProps)==null?void 0:g.field,h),Gy(i),{ref:n})},toolbar:F({hidden:!1,ampmInClock:s},(u=i.slotProps)==null?void 0:u.toolbar),tabs:F({hidden:!1},(d=i.slotProps)==null?void 0:d.tabs)})}),{renderPicker:c}=QB({props:l,valueManager:io,valueType:"date-time",getOpenDialogAriaText:Hy({utils:o,formatKey:"fullDate",contextTranslation:r.openDatePickerDialogue,propsTranslation:(f=l.localeText)==null?void 0:f.openDatePickerDialogue}),validator:LT});return c()});lse.propTypes={ampm:V.bool,ampmInClock:V.bool,autoFocus:V.bool,className:V.string,closeOnSelect:V.bool,dayOfWeekFormatter:V.func,defaultValue:V.object,disabled:V.bool,disableFuture:V.bool,disableHighlightToday:V.bool,disableIgnoringDatePartForTimeValidation:V.bool,disableOpenPicker:V.bool,disablePast:V.bool,displayWeekNumber:V.bool,enableAccessibleFieldDOMStructure:V.any,fixedWeekNumber:V.number,format:V.string,formatDensity:V.oneOf(["dense","spacious"]),inputRef:py,label:V.node,loading:V.bool,localeText:V.object,maxDate:V.object,maxDateTime:V.object,maxTime:V.object,minDate:V.object,minDateTime:V.object,minTime:V.object,minutesStep:V.number,monthsPerRow:V.oneOf([3,4]),name:V.string,onAccept:V.func,onChange:V.func,onClose:V.func,onError:V.func,onMonthChange:V.func,onOpen:V.func,onSelectedSectionsChange:V.func,onViewChange:V.func,onYearChange:V.func,open:V.bool,openTo:V.oneOf(["day","hours","minutes","month","seconds","year"]),orientation:V.oneOf(["landscape","portrait"]),readOnly:V.bool,reduceAnimations:V.bool,referenceDate:V.object,renderLoading:V.func,selectedSections:V.oneOfType([V.oneOf(["all","day","empty","hours","meridiem","minutes","month","seconds","weekDay","year"]),V.number]),shouldDisableDate:V.func,shouldDisableMonth:V.func,shouldDisableTime:V.func,shouldDisableYear:V.func,showDaysOutsideCurrentMonth:V.bool,slotProps:V.object,slots:V.object,sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),timezone:V.string,value:V.object,view:V.oneOf(["day","hours","minutes","month","seconds","year"]),viewRenderers:V.shape({day:V.func,hours:V.func,minutes:V.func,month:V.func,seconds:V.func,year:V.func}),views:V.arrayOf(V.oneOf(["day","hours","minutes","month","seconds","year"]).isRequired),yearsOrder:V.oneOf(["asc","desc"]),yearsPerRow:V.oneOf([3,4])};const SXe=["desktopModeMediaQuery"],CXe=w.forwardRef(function(t,n){const r=hn({props:t,name:"MuiDateTimePicker"}),{desktopModeMediaQuery:o=BB}=r,i=We(r,SXe);return Zd(o,{defaultMatches:!0})?_.jsx(sse,F({ref:n},i)):_.jsx(lse,F({ref:n},i))}),EXe={y:{sectionType:"year",contentType:"digit",maxLength:4},yy:"year",yyyy:{sectionType:"year",contentType:"digit",maxLength:4},L:{sectionType:"month",contentType:"digit",maxLength:2},LL:"month",LLL:{sectionType:"month",contentType:"letter"},LLLL:{sectionType:"month",contentType:"letter"},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},d:{sectionType:"day",contentType:"digit",maxLength:2},dd:"day",c:{sectionType:"weekDay",contentType:"digit",maxLength:1},ccc:{sectionType:"weekDay",contentType:"letter"},cccc:{sectionType:"weekDay",contentType:"letter"},E:{sectionType:"weekDay",contentType:"digit",maxLength:2},EEE:{sectionType:"weekDay",contentType:"letter"},EEEE:{sectionType:"weekDay",contentType:"letter"},a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},PXe={year:"yyyy",month:"LLLL",monthShort:"MMM",dayOfMonth:"d",dayOfMonthFull:"d",weekday:"cccc",weekdayShort:"ccccc",hours24h:"HH",hours12h:"hh",meridiem:"a",minutes:"mm",seconds:"ss",fullDate:"DD",keyboardDate:"D",shortDate:"MMM d",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",fullTime:"t",fullTime12h:"hh:mm a",fullTime24h:"HH:mm",keyboardDateTime:"D t",keyboardDateTime12h:"D hh:mm a",keyboardDateTime24h:"D T"};class pu{constructor({locale:t,formats:n}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="luxon",this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"'",end:"'"},this.formatTokenMap=EXe,this.setLocaleToValue=r=>{const o=this.getCurrentLocaleCode();return o===r.locale?r:r.setLocale(o)},this.date=(r,o="default")=>r===null?null:typeof r>"u"?yt.fromJSDate(new Date,{locale:this.locale,zone:o}):yt.fromISO(r,{locale:this.locale,zone:o}),this.getInvalidDate=()=>yt.fromJSDate(new Date("Invalid Date")),this.getTimezone=r=>r.zone.type==="system"?"system":r.zoneName,this.setTimezone=(r,o)=>r.zone.equals(zb.normalizeZone(o))?r:r.setZone(o),this.toJsDate=r=>r.toJSDate(),this.parse=(r,o)=>r===""?null:yt.fromFormat(r,o,{locale:this.locale}),this.getCurrentLocaleCode=()=>this.locale,this.is12HourCycleInCurrentLocale=()=>{var r,o;return typeof Intl>"u"||typeof Intl.DateTimeFormat>"u"?!0:!!((o=(r=new Intl.DateTimeFormat(this.locale,{hour:"numeric"}))==null?void 0:r.resolvedOptions())!=null&&o.hour12)},this.expandFormat=r=>{const o=/''|'(''|[^'])+('|$)|[^']*/g,i=[...Object.keys(this.formatTokenMap),"yyyyy"],a=new RegExp(`^(${i.join("|")})+$`),s=/(?:^|[^a-z])([a-z]+)(?:[^a-z]|$)|([a-z]+)/gi;return r.match(o).map(l=>l[0]==="'"?l:yt.expandFormat(l,{locale:this.locale}).replace(s,(d,f,h)=>{const g=f||h;return a.test(g)?d:`'${d}'`})).join("").replace("yyyyy","yyyy")},this.isValid=r=>r===null?!1:r.isValid,this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>r.setLocale(this.locale).toFormat(o),this.formatNumber=r=>r,this.isEqual=(r,o)=>r===null&&o===null?!0:r===null||o===null?!1:+r==+o,this.isSameYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"year")},this.isSameMonth=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"month")},this.isSameDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"day")},this.isSameHour=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.hasSame(i,"hour")},this.isAfter=(r,o)=>r>o,this.isAfterYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.endOfYear(i),"years").toObject().years>0},this.isAfterDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.endOfDay(i),"days").toObject().days>0},this.isBefore=(r,o)=>r<o,this.isBeforeYear=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.startOfYear(i),"years").toObject().years<0},this.isBeforeDay=(r,o)=>{const i=this.setTimezone(o,this.getTimezone(r));return r.diff(this.startOfDay(i),"days").toObject().days<0},this.isWithinRange=(r,[o,i])=>this.isEqual(r,o)||this.isEqual(r,i)||this.isAfter(r,o)&&this.isBefore(r,i),this.startOfYear=r=>r.startOf("year"),this.startOfMonth=r=>r.startOf("month"),this.startOfWeek=r=>this.setLocaleToValue(r).startOf("week",{useLocaleWeeks:!0}),this.startOfDay=r=>r.startOf("day"),this.endOfYear=r=>r.endOf("year"),this.endOfMonth=r=>r.endOf("month"),this.endOfWeek=r=>this.setLocaleToValue(r).endOf("week",{useLocaleWeeks:!0}),this.endOfDay=r=>r.endOf("day"),this.addYears=(r,o)=>r.plus({years:o}),this.addMonths=(r,o)=>r.plus({months:o}),this.addWeeks=(r,o)=>r.plus({weeks:o}),this.addDays=(r,o)=>r.plus({days:o}),this.addHours=(r,o)=>r.plus({hours:o}),this.addMinutes=(r,o)=>r.plus({minutes:o}),this.addSeconds=(r,o)=>r.plus({seconds:o}),this.getYear=r=>r.get("year"),this.getMonth=r=>r.get("month")-1,this.getDate=r=>r.get("day"),this.getHours=r=>r.get("hour"),this.getMinutes=r=>r.get("minute"),this.getSeconds=r=>r.get("second"),this.getMilliseconds=r=>r.get("millisecond"),this.setYear=(r,o)=>r.set({year:o}),this.setMonth=(r,o)=>r.set({month:o+1}),this.setDate=(r,o)=>r.set({day:o}),this.setHours=(r,o)=>r.set({hour:o}),this.setMinutes=(r,o)=>r.set({minute:o}),this.setSeconds=(r,o)=>r.set({second:o}),this.setMilliseconds=(r,o)=>r.set({millisecond:o}),this.getDaysInMonth=r=>r.daysInMonth,this.getWeekArray=r=>{const o=this.startOfWeek(this.startOfMonth(r)),i=this.endOfWeek(this.endOfMonth(r)),{days:a}=i.diff(o,"days").toObject(),s=[];return new Array(Math.round(a)).fill(0).map((l,c)=>c).map(l=>o.plus({days:l})).forEach((l,c)=>{if(c===0||c%7===0&&c>6){s.push([l]);return}s[s.length-1].push(l)}),s},this.getWeekNumber=r=>r.localWeekNumber??r.weekNumber,this.getDayOfWeek=r=>r.weekday,this.getYearRange=([r,o])=>{const i=this.startOfYear(r),a=this.endOfYear(o),s=[];let l=i;for(;this.isBefore(l,a);)s.push(l),l=this.addYears(l,1);return s},this.locale=t||"en-US",this.formats=F({},PXe,n)}}const JB=Je(_.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");function ZB({callback:e,initialIngredient:t}){const n=t?{value:t,data:{id:-1,name:t,image:null,image_thumbnail:null}}:null,[r,o]=w.useState(!0),[i,a]=w.useState(n),[s,l]=w.useState(""),[c,u]=w.useState([]),[d,f]=Re(),h=w.useMemo(()=>sT(g=>Qke(g,f.language,r).then(y=>u(y)),200),[f.language,r]);return w.useEffect(()=>{if(s===""){u(i?[i]:[]);return}return h(s),()=>{}},[i,s,h]),Q(_t,{children:[b($l,{id:"ingredient-autocomplete",getOptionLabel:g=>g.value,"data-testid":"autocomplete",filterOptions:g=>g,options:c,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:i,noOptionsText:d("noResults"),isOptionEqualToValue:(g,y)=>g.value===y.value,onChange:(g,y)=>{u(y?[y,...c]:c),a(y),e(y)},onInputChange:(g,y)=>{l(y)},renderInput:g=>b(tn,{...g,label:d("nutrition.searchIngredientName"),fullWidth:!0,InputProps:{...g.InputProps,startAdornment:Q(xt,{children:[b(ro,{position:"start",children:b(JB,{})}),g.InputProps.startAdornment]})}}),renderOption:(g,y)=>gF("li",{...g,key:`ingredient-${y.data.id}`},Q(Ka,{disablePadding:!0,component:"div",children:[b(si,{children:b(Nl,{alt:"",src:`${cj}${y.data.image}`,variant:"rounded",children:b(_u,{})})}),b(uo,{primary:y.value,primaryTypographyProps:{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})]}))}),f.language!==bg&&b(Fw,{children:b(ba,{control:b(li,{checked:r,onChange:(g,y)=>o(y)}),label:d("alsoSearchEnglish")})})]})}var IXe=function(t){return TXe(t)&&!OXe(t)};function TXe(e){return!!e&&typeof e=="object"}function OXe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||AXe(e)}var kXe=typeof Symbol=="function"&&Symbol.for,MXe=kXe?Symbol.for("react.element"):60103;function AXe(e){return e.$$typeof===MXe}function RXe(e){return Array.isArray(e)?[]:{}}function IP(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Mx(RXe(e),e,t):e}function DXe(e,t,n){return e.concat(t).map(function(r){return IP(r,n)})}function _Xe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=IP(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=IP(t[o],n):r[o]=Mx(e[o],t[o],n)}),r}function Mx(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||DXe,n.isMergeableObject=n.isMergeableObject||IXe;var r=Array.isArray(t),o=Array.isArray(e),i=r===o;return i?r?n.arrayMerge(e,t,n):_Xe(e,t,n):IP(t,n)}Mx.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Mx(r,o,n)},{})};var bL=Mx,cse=typeof global=="object"&&global&&global.Object===Object&&global,$Xe=typeof self=="object"&&self&&self.Object===Object&&self,Dc=cse||$Xe||Function("return this")(),rf=Dc.Symbol,use=Object.prototype,NXe=use.hasOwnProperty,LXe=use.toString,bb=rf?rf.toStringTag:void 0;function FXe(e){var t=NXe.call(e,bb),n=e[bb];try{e[bb]=void 0;var r=!0}catch{}var o=LXe.call(e);return r&&(t?e[bb]=n:delete e[bb]),o}var jXe=Object.prototype,BXe=jXe.toString;function zXe(e){return BXe.call(e)}var VXe="[object Null]",HXe="[object Undefined]",_K=rf?rf.toStringTag:void 0;function hh(e){return e==null?e===void 0?HXe:VXe:_K&&_K in Object(e)?FXe(e):zXe(e)}function dse(e,t){return function(n){return e(t(n))}}var ez=dse(Object.getPrototypeOf,Object);function mh(e){return e!=null&&typeof e=="object"}var UXe="[object Object]",WXe=Function.prototype,GXe=Object.prototype,fse=WXe.toString,qXe=GXe.hasOwnProperty,KXe=fse.call(Object);function $K(e){if(!mh(e)||hh(e)!=UXe)return!1;var t=ez(e);if(t===null)return!0;var n=qXe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&fse.call(n)==KXe}function YXe(){this.__data__=[],this.size=0}function pse(e,t){return e===t||e!==e&&t!==t}function jT(e,t){for(var n=e.length;n--;)if(pse(e[n][0],t))return n;return-1}var QXe=Array.prototype,XXe=QXe.splice;function JXe(e){var t=this.__data__,n=jT(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():XXe.call(t,n,1),--this.size,!0}function ZXe(e){var t=this.__data__,n=jT(t,e);return n<0?void 0:t[n][1]}function eJe(e){return jT(this.__data__,e)>-1}function tJe(e,t){var n=this.__data__,r=jT(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Bu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bu.prototype.clear=YXe;Bu.prototype.delete=JXe;Bu.prototype.get=ZXe;Bu.prototype.has=eJe;Bu.prototype.set=tJe;function nJe(){this.__data__=new Bu,this.size=0}function rJe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function oJe(e){return this.__data__.get(e)}function iJe(e){return this.__data__.has(e)}function z0(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var aJe="[object AsyncFunction]",sJe="[object Function]",lJe="[object GeneratorFunction]",cJe="[object Proxy]";function hse(e){if(!z0(e))return!1;var t=hh(e);return t==sJe||t==lJe||t==aJe||t==cJe}var L_=Dc["__core-js_shared__"],NK=function(){var e=/[^.]+$/.exec(L_&&L_.keys&&L_.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function uJe(e){return!!NK&&NK in e}var dJe=Function.prototype,fJe=dJe.toString;function gh(e){if(e!=null){try{return fJe.call(e)}catch{}try{return e+""}catch{}}return""}var pJe=/[\\^$.*+?()[\]{}|]/g,hJe=/^\[object .+?Constructor\]$/,mJe=Function.prototype,gJe=Object.prototype,yJe=mJe.toString,vJe=gJe.hasOwnProperty,bJe=RegExp("^"+yJe.call(vJe).replace(pJe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wJe(e){if(!z0(e)||uJe(e))return!1;var t=hse(e)?bJe:hJe;return t.test(gh(e))}function xJe(e,t){return e==null?void 0:e[t]}function yh(e,t){var n=xJe(e,t);return wJe(n)?n:void 0}var Ax=yh(Dc,"Map"),Rx=yh(Object,"create");function SJe(){this.__data__=Rx?Rx(null):{},this.size=0}function CJe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var EJe="__lodash_hash_undefined__",PJe=Object.prototype,IJe=PJe.hasOwnProperty;function TJe(e){var t=this.__data__;if(Rx){var n=t[e];return n===EJe?void 0:n}return IJe.call(t,e)?t[e]:void 0}var OJe=Object.prototype,kJe=OJe.hasOwnProperty;function MJe(e){var t=this.__data__;return Rx?t[e]!==void 0:kJe.call(t,e)}var AJe="__lodash_hash_undefined__";function RJe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Rx&&t===void 0?AJe:t,this}function Kp(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Kp.prototype.clear=SJe;Kp.prototype.delete=CJe;Kp.prototype.get=TJe;Kp.prototype.has=MJe;Kp.prototype.set=RJe;function DJe(){this.size=0,this.__data__={hash:new Kp,map:new(Ax||Bu),string:new Kp}}function _Je(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function BT(e,t){var n=e.__data__;return _Je(t)?n[typeof t=="string"?"string":"hash"]:n.map}function $Je(e){var t=BT(this,e).delete(e);return this.size-=t?1:0,t}function NJe(e){return BT(this,e).get(e)}function LJe(e){return BT(this,e).has(e)}function FJe(e,t){var n=BT(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Ef(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ef.prototype.clear=DJe;Ef.prototype.delete=$Je;Ef.prototype.get=NJe;Ef.prototype.has=LJe;Ef.prototype.set=FJe;var jJe=200;function BJe(e,t){var n=this.__data__;if(n instanceof Bu){var r=n.__data__;if(!Ax||r.length<jJe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ef(r)}return n.set(e,t),this.size=n.size,this}function qy(e){var t=this.__data__=new Bu(e);this.size=t.size}qy.prototype.clear=nJe;qy.prototype.delete=rJe;qy.prototype.get=oJe;qy.prototype.has=iJe;qy.prototype.set=BJe;function zJe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var LK=function(){try{var e=yh(Object,"defineProperty");return e({},"",{}),e}catch{}}();function mse(e,t,n){t=="__proto__"&&LK?LK(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var VJe=Object.prototype,HJe=VJe.hasOwnProperty;function gse(e,t,n){var r=e[t];(!(HJe.call(e,t)&&pse(r,n))||n===void 0&&!(t in e))&&mse(e,t,n)}function zT(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],l=void 0;l===void 0&&(l=e[s]),o?mse(n,s,l):gse(n,s,l)}return n}function UJe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var WJe="[object Arguments]";function FK(e){return mh(e)&&hh(e)==WJe}var yse=Object.prototype,GJe=yse.hasOwnProperty,qJe=yse.propertyIsEnumerable,KJe=FK(function(){return arguments}())?FK:function(e){return mh(e)&&GJe.call(e,"callee")&&!qJe.call(e,"callee")},V0=Array.isArray;function YJe(){return!1}var vse=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jK=vse&&typeof module=="object"&&module&&!module.nodeType&&module,QJe=jK&&jK.exports===vse,BK=QJe?Dc.Buffer:void 0,XJe=BK?BK.isBuffer:void 0,bse=XJe||YJe,JJe=9007199254740991,ZJe=/^(?:0|[1-9]\d*)$/;function eZe(e,t){var n=typeof e;return t=t??JJe,!!t&&(n=="number"||n!="symbol"&&ZJe.test(e))&&e>-1&&e%1==0&&e<t}var tZe=9007199254740991;function wse(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tZe}var nZe="[object Arguments]",rZe="[object Array]",oZe="[object Boolean]",iZe="[object Date]",aZe="[object Error]",sZe="[object Function]",lZe="[object Map]",cZe="[object Number]",uZe="[object Object]",dZe="[object RegExp]",fZe="[object Set]",pZe="[object String]",hZe="[object WeakMap]",mZe="[object ArrayBuffer]",gZe="[object DataView]",yZe="[object Float32Array]",vZe="[object Float64Array]",bZe="[object Int8Array]",wZe="[object Int16Array]",xZe="[object Int32Array]",SZe="[object Uint8Array]",CZe="[object Uint8ClampedArray]",EZe="[object Uint16Array]",PZe="[object Uint32Array]",kr={};kr[yZe]=kr[vZe]=kr[bZe]=kr[wZe]=kr[xZe]=kr[SZe]=kr[CZe]=kr[EZe]=kr[PZe]=!0;kr[nZe]=kr[rZe]=kr[mZe]=kr[oZe]=kr[gZe]=kr[iZe]=kr[aZe]=kr[sZe]=kr[lZe]=kr[cZe]=kr[uZe]=kr[dZe]=kr[fZe]=kr[pZe]=kr[hZe]=!1;function IZe(e){return mh(e)&&wse(e.length)&&!!kr[hh(e)]}function tz(e){return function(t){return e(t)}}var xse=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ww=xse&&typeof module=="object"&&module&&!module.nodeType&&module,TZe=ww&&ww.exports===xse,F_=TZe&&cse.process,Zg=function(){try{var e=ww&&ww.require&&ww.require("util").types;return e||F_&&F_.binding&&F_.binding("util")}catch{}}(),zK=Zg&&Zg.isTypedArray,OZe=zK?tz(zK):IZe,kZe=Object.prototype,MZe=kZe.hasOwnProperty;function Sse(e,t){var n=V0(e),r=!n&&KJe(e),o=!n&&!r&&bse(e),i=!n&&!r&&!o&&OZe(e),a=n||r||o||i,s=a?UJe(e.length,String):[],l=s.length;for(var c in e)(t||MZe.call(e,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eZe(c,l)))&&s.push(c);return s}var AZe=Object.prototype;function nz(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||AZe;return e===n}var RZe=dse(Object.keys,Object),DZe=Object.prototype,_Ze=DZe.hasOwnProperty;function $Ze(e){if(!nz(e))return RZe(e);var t=[];for(var n in Object(e))_Ze.call(e,n)&&n!="constructor"&&t.push(n);return t}function Cse(e){return e!=null&&wse(e.length)&&!hse(e)}function rz(e){return Cse(e)?Sse(e):$Ze(e)}function NZe(e,t){return e&&zT(t,rz(t),e)}function LZe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var FZe=Object.prototype,jZe=FZe.hasOwnProperty;function BZe(e){if(!z0(e))return LZe(e);var t=nz(e),n=[];for(var r in e)r=="constructor"&&(t||!jZe.call(e,r))||n.push(r);return n}function oz(e){return Cse(e)?Sse(e,!0):BZe(e)}function zZe(e,t){return e&&zT(t,oz(t),e)}var Ese=typeof exports=="object"&&exports&&!exports.nodeType&&exports,VK=Ese&&typeof module=="object"&&module&&!module.nodeType&&module,VZe=VK&&VK.exports===Ese,HK=VZe?Dc.Buffer:void 0,UK=HK?HK.allocUnsafe:void 0;function HZe(e,t){if(t)return e.slice();var n=e.length,r=UK?UK(n):new e.constructor(n);return e.copy(r),r}function Pse(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function UZe(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Ise(){return[]}var WZe=Object.prototype,GZe=WZe.propertyIsEnumerable,WK=Object.getOwnPropertySymbols,iz=WK?function(e){return e==null?[]:(e=Object(e),UZe(WK(e),function(t){return GZe.call(e,t)}))}:Ise;function qZe(e,t){return zT(e,iz(e),t)}function Tse(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var KZe=Object.getOwnPropertySymbols,Ose=KZe?function(e){for(var t=[];e;)Tse(t,iz(e)),e=ez(e);return t}:Ise;function YZe(e,t){return zT(e,Ose(e),t)}function kse(e,t,n){var r=t(e);return V0(e)?r:Tse(r,n(e))}function QZe(e){return kse(e,rz,iz)}function XZe(e){return kse(e,oz,Ose)}var wL=yh(Dc,"DataView"),xL=yh(Dc,"Promise"),SL=yh(Dc,"Set"),CL=yh(Dc,"WeakMap"),GK="[object Map]",JZe="[object Object]",qK="[object Promise]",KK="[object Set]",YK="[object WeakMap]",QK="[object DataView]",ZZe=gh(wL),eet=gh(Ax),tet=gh(xL),net=gh(SL),ret=gh(CL),ru=hh;(wL&&ru(new wL(new ArrayBuffer(1)))!=QK||Ax&&ru(new Ax)!=GK||xL&&ru(xL.resolve())!=qK||SL&&ru(new SL)!=KK||CL&&ru(new CL)!=YK)&&(ru=function(e){var t=hh(e),n=t==JZe?e.constructor:void 0,r=n?gh(n):"";if(r)switch(r){case ZZe:return QK;case eet:return GK;case tet:return qK;case net:return KK;case ret:return YK}return t});var oet=Object.prototype,iet=oet.hasOwnProperty;function aet(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&iet.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var XK=Dc.Uint8Array;function az(e){var t=new e.constructor(e.byteLength);return new XK(t).set(new XK(e)),t}function set(e,t){var n=t?az(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var cet=/\w*$/;function uet(e){var t=new e.constructor(e.source,cet.exec(e));return t.lastIndex=e.lastIndex,t}var JK=rf?rf.prototype:void 0,ZK=JK?JK.valueOf:void 0;function det(e){return ZK?Object(ZK.call(e)):{}}function fet(e,t){var n=t?az(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var pet="[object Boolean]",het="[object Date]",met="[object Map]",get="[object Number]",yet="[object RegExp]",vet="[object Set]",bet="[object String]",wet="[object Symbol]",xet="[object ArrayBuffer]",Cet="[object DataView]",Eet="[object Float32Array]",Pet="[object Float64Array]",Iet="[object Int8Array]",Tet="[object Int16Array]",Oet="[object Int32Array]",ket="[object Uint8Array]",Met="[object Uint8ClampedArray]",Aet="[object Uint16Array]",Ret="[object Uint32Array]";function Det(e,t,n){var r=e.constructor;switch(t){case xet:return az(e);case pet:case het:return new r(+e);case Cet:return set(e,n);case Eet:case Pet:case Iet:case Tet:case Oet:case ket:case Met:case Aet:case Ret:return fet(e,n);case met:return new r;case get:case bet:return new r(e);case yet:return uet(e);case vet:return new r;case wet:return det(e)}}var eY=Object.create,_et=function(){function e(){}return function(t){if(!z0(t))return{};if(eY)return eY(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function $et(e){return typeof e.constructor=="function"&&!nz(e)?_et(ez(e)):{}}var Net="[object Map]";function Let(e){return mh(e)&&ru(e)==Net}var tY=Zg&&Zg.isMap,Fet=tY?tz(tY):Let,jet="[object Set]";function Bet(e){return mh(e)&&ru(e)==jet}var nY=Zg&&Zg.isSet,zet=nY?tz(nY):Bet,Vet=1,Het=2,Uet=4,Mse="[object Arguments]",Wet="[object Array]",Get="[object Boolean]",qet="[object Date]",Ket="[object Error]",Ase="[object Function]",Yet="[object GeneratorFunction]",Qet="[object Map]",Xet="[object Number]",Rse="[object Object]",Jet="[object RegExp]",Zet="[object Set]",ett="[object String]",ttt="[object Symbol]",ntt="[object WeakMap]",rtt="[object ArrayBuffer]",ott="[object DataView]",itt="[object Float32Array]",att="[object Float64Array]",stt="[object Int8Array]",ltt="[object Int16Array]",ctt="[object Int32Array]",utt="[object Uint8Array]",dtt="[object Uint8ClampedArray]",ftt="[object Uint16Array]",ptt="[object Uint32Array]",Sr={};Sr[Mse]=Sr[Wet]=Sr[rtt]=Sr[ott]=Sr[Get]=Sr[qet]=Sr[itt]=Sr[att]=Sr[stt]=Sr[ltt]=Sr[ctt]=Sr[Qet]=Sr[Xet]=Sr[Rse]=Sr[Jet]=Sr[Zet]=Sr[ett]=Sr[ttt]=Sr[utt]=Sr[dtt]=Sr[ftt]=Sr[ptt]=!0;Sr[Ket]=Sr[Ase]=Sr[ntt]=!1;function xw(e,t,n,r,o,i){var a,s=t&Vet,l=t&Het,c=t&Uet;if(a!==void 0)return a;if(!z0(e))return e;var u=V0(e);if(u){if(a=aet(e),!s)return Pse(e,a)}else{var d=ru(e),f=d==Ase||d==Yet;if(bse(e))return HZe(e,s);if(d==Rse||d==Mse||f&&!o){if(a=l||f?{}:$et(e),!s)return l?YZe(e,zZe(a,e)):qZe(e,NZe(a,e))}else{if(!Sr[d])return o?e:{};a=Det(e,d,s)}}i||(i=new qy);var h=i.get(e);if(h)return h;i.set(e,a),zet(e)?e.forEach(function(v){a.add(xw(v,t,n,v,e,i))}):Fet(e)&&e.forEach(function(v,x){a.set(x,xw(v,t,n,x,e,i))});var g=c?l?XZe:QZe:l?oz:rz,y=u?void 0:g(e);return zJe(y||e,function(v,x){y&&(x=v,v=e[x]),gse(a,x,xw(v,t,n,x,e,i))}),a}var htt=1,mtt=4;function Kb(e){return xw(e,htt|mtt)}var j_,rY;function gtt(){if(rY)return j_;rY=1;var e=Array.isArray,t=Object.keys,n=Object.prototype.hasOwnProperty,r=typeof Element<"u";function o(i,a){if(i===a)return!0;if(i&&a&&typeof i=="object"&&typeof a=="object"){var s=e(i),l=e(a),c,u,d;if(s&&l){if(u=i.length,u!=a.length)return!1;for(c=u;c--!==0;)if(!o(i[c],a[c]))return!1;return!0}if(s!=l)return!1;var f=i instanceof Date,h=a instanceof Date;if(f!=h)return!1;if(f&&h)return i.getTime()==a.getTime();var g=i instanceof RegExp,y=a instanceof RegExp;if(g!=y)return!1;if(g&&y)return i.toString()==a.toString();var v=t(i);if(u=v.length,u!==t(a).length)return!1;for(c=u;c--!==0;)if(!n.call(a,v[c]))return!1;if(r&&i instanceof Element&&a instanceof Element)return i===a;for(c=u;c--!==0;)if(d=v[c],!(d==="_owner"&&i.$$typeof)&&!o(i[d],a[d]))return!1;return!0}return i!==i&&a!==a}return j_=function(a,s){try{return o(a,s)}catch(l){if(l.message&&l.message.match(/stack|recursion/i)||l.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",l.name,l.message),!1;throw l}},j_}var ytt=gtt();const Sd=Fn(ytt);var vtt=4;function oY(e){return xw(e,vtt)}function Dse(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var btt="[object Symbol]";function sz(e){return typeof e=="symbol"||mh(e)&&hh(e)==btt}var wtt="Expected a function";function lz(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wtt);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(lz.Cache||Ef),n}lz.Cache=Ef;var xtt=500;function Stt(e){var t=lz(e,function(r){return n.size===xtt&&n.clear(),r}),n=t.cache;return t}var Ctt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ett=/\\(\\)?/g,Ptt=Stt(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ctt,function(n,r,o,i){t.push(o?i.replace(Ett,"$1"):r||n)}),t});function Itt(e){if(typeof e=="string"||sz(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var iY=rf?rf.prototype:void 0,aY=iY?iY.toString:void 0;function _se(e){if(typeof e=="string")return e;if(V0(e))return Dse(e,_se)+"";if(sz(e))return aY?aY.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ttt(e){return e==null?"":_se(e)}function $se(e){return V0(e)?Dse(e,Itt):sz(e)?[e]:Pse(Ptt(Ttt(e)))}function no(){return no=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},no.apply(this,arguments)}function Ott(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function cz(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function sY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var VT=w.createContext(void 0);VT.displayName="FormikContext";var ktt=VT.Provider,Mtt=VT.Consumer;function uz(){var e=w.useContext(VT);return e}var lY=function(t){return Array.isArray(t)&&t.length===0},la=function(t){return typeof t=="function"},Ky=function(t){return t!==null&&typeof t=="object"},Att=function(t){return String(Math.floor(Number(t)))===t},B_=function(t){return Object.prototype.toString.call(t)==="[object String]"},Nse=function(t){return w.Children.count(t)===0},z_=function(t){return Ky(t)&&la(t.then)};function Ho(e,t,n,r){r===void 0&&(r=0);for(var o=$se(t);e&&r<o.length;)e=e[o[r++]];return r!==o.length&&!e||e===void 0?n:e}function bc(e,t,n){for(var r=oY(e),o=r,i=0,a=$se(t);i<a.length-1;i++){var s=a[i],l=Ho(e,a.slice(0,i+1));if(l&&(Ky(l)||Array.isArray(l)))o=o[s]=oY(l);else{var c=a[i+1];o=o[s]=Att(c)&&Number(c)>=0?[]:{}}}return(i===0?e:o)[a[i]]===n?e:(n===void 0?delete o[a[i]]:o[a[i]]=n,i===0&&n===void 0&&delete r[a[i]],r)}function Lse(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var o=0,i=Object.keys(e);o<i.length;o++){var a=i[o],s=e[a];Ky(s)?n.get(s)||(n.set(s,!0),r[a]=Array.isArray(s)?[]:{},Lse(s,t,n,r[a])):r[a]=t}return r}function Rtt(e,t){switch(t.type){case"SET_VALUES":return no({},e,{values:t.payload});case"SET_TOUCHED":return no({},e,{touched:t.payload});case"SET_ERRORS":return Sd(e.errors,t.payload)?e:no({},e,{errors:t.payload});case"SET_STATUS":return no({},e,{status:t.payload});case"SET_ISSUBMITTING":return no({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return no({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return no({},e,{values:bc(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return no({},e,{touched:bc(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return no({},e,{errors:bc(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return no({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return no({},e,{touched:Lse(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return no({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return no({},e,{isSubmitting:!1});default:return e}}var Yf={},t1={};function Dtt(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,i=e.validateOnMount,a=i===void 0?!1:i,s=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,u=e.onSubmit,d=cz(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),f=no({validateOnChange:n,validateOnBlur:o,validateOnMount:a,onSubmit:u},d),h=w.useRef(f.initialValues),g=w.useRef(f.initialErrors||Yf),y=w.useRef(f.initialTouched||t1),v=w.useRef(f.initialStatus),x=w.useRef(!1),S=w.useRef({});w.useEffect(function(){return x.current=!0,function(){x.current=!1}},[]);var C=w.useState(0),I=C[1],E=w.useRef({values:Kb(f.initialValues),errors:Kb(f.initialErrors)||Yf,touched:Kb(f.initialTouched)||t1,status:Kb(f.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),T=E.current,O=w.useCallback(function(de){var $e=E.current;E.current=Rtt($e,de),$e!==E.current&&I(function(Ae){return Ae+1})},[]),A=w.useCallback(function(de,$e){return new Promise(function(Ae,Ne){var Ue=f.validate(de,$e);Ue==null?Ae(Yf):z_(Ue)?Ue.then(function(Ze){Ae(Ze||Yf)},function(Ze){Ne(Ze)}):Ae(Ue)})},[f.validate]),k=w.useCallback(function(de,$e){var Ae=f.validationSchema,Ne=la(Ae)?Ae($e):Ae,Ue=$e&&Ne.validateAt?Ne.validateAt($e,de):$tt(de,Ne);return new Promise(function(Ze,ut){Ue.then(function(){Ze(Yf)},function(Ye){Ye.name==="ValidationError"?Ze(_tt(Ye)):ut(Ye)})})},[f.validationSchema]),M=w.useCallback(function(de,$e){return new Promise(function(Ae){return Ae(S.current[de].validate($e))})},[]),R=w.useCallback(function(de){var $e=Object.keys(S.current).filter(function(Ne){return la(S.current[Ne].validate)}),Ae=$e.length>0?$e.map(function(Ne){return M(Ne,Ho(de,Ne))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ae).then(function(Ne){return Ne.reduce(function(Ue,Ze,ut){return Ze==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ze&&(Ue=bc(Ue,$e[ut],Ze)),Ue},{})})},[M]),$=w.useCallback(function(de){return Promise.all([R(de),f.validationSchema?k(de):{},f.validate?A(de):{}]).then(function($e){var Ae=$e[0],Ne=$e[1],Ue=$e[2],Ze=bL.all([Ae,Ne,Ue],{arrayMerge:Ntt});return Ze})},[f.validate,f.validationSchema,R,A,k]),L=vs(function(de){return de===void 0&&(de=T.values),O({type:"SET_ISVALIDATING",payload:!0}),$(de).then(function($e){return x.current&&(O({type:"SET_ISVALIDATING",payload:!1}),O({type:"SET_ERRORS",payload:$e})),$e})});w.useEffect(function(){a&&x.current===!0&&Sd(h.current,f.initialValues)&&L(h.current)},[a,L]);var z=w.useCallback(function(de){var $e=de&&de.values?de.values:h.current,Ae=de&&de.errors?de.errors:g.current?g.current:f.initialErrors||{},Ne=de&&de.touched?de.touched:y.current?y.current:f.initialTouched||{},Ue=de&&de.status?de.status:v.current?v.current:f.initialStatus;h.current=$e,g.current=Ae,y.current=Ne,v.current=Ue;var Ze=function(){O({type:"RESET_FORM",payload:{isSubmitting:!!de&&!!de.isSubmitting,errors:Ae,touched:Ne,status:Ue,values:$e,isValidating:!!de&&!!de.isValidating,submitCount:de&&de.submitCount&&typeof de.submitCount=="number"?de.submitCount:0}})};if(f.onReset){var ut=f.onReset(T.values,le);z_(ut)?ut.then(Ze):Ze()}else Ze()},[f.initialErrors,f.initialStatus,f.initialTouched,f.onReset]);w.useEffect(function(){x.current===!0&&!Sd(h.current,f.initialValues)&&c&&(h.current=f.initialValues,z(),a&&L(h.current))},[c,f.initialValues,z,a,L]),w.useEffect(function(){c&&x.current===!0&&!Sd(g.current,f.initialErrors)&&(g.current=f.initialErrors||Yf,O({type:"SET_ERRORS",payload:f.initialErrors||Yf}))},[c,f.initialErrors]),w.useEffect(function(){c&&x.current===!0&&!Sd(y.current,f.initialTouched)&&(y.current=f.initialTouched||t1,O({type:"SET_TOUCHED",payload:f.initialTouched||t1}))},[c,f.initialTouched]),w.useEffect(function(){c&&x.current===!0&&!Sd(v.current,f.initialStatus)&&(v.current=f.initialStatus,O({type:"SET_STATUS",payload:f.initialStatus}))},[c,f.initialStatus,f.initialTouched]);var N=vs(function(de){if(S.current[de]&&la(S.current[de].validate)){var $e=Ho(T.values,de),Ae=S.current[de].validate($e);return z_(Ae)?(O({type:"SET_ISVALIDATING",payload:!0}),Ae.then(function(Ne){return Ne}).then(function(Ne){O({type:"SET_FIELD_ERROR",payload:{field:de,value:Ne}}),O({type:"SET_ISVALIDATING",payload:!1})})):(O({type:"SET_FIELD_ERROR",payload:{field:de,value:Ae}}),Promise.resolve(Ae))}else if(f.validationSchema)return O({type:"SET_ISVALIDATING",payload:!0}),k(T.values,de).then(function(Ne){return Ne}).then(function(Ne){O({type:"SET_FIELD_ERROR",payload:{field:de,value:Ho(Ne,de)}}),O({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),B=w.useCallback(function(de,$e){var Ae=$e.validate;S.current[de]={validate:Ae}},[]),U=w.useCallback(function(de){delete S.current[de]},[]),G=vs(function(de,$e){O({type:"SET_TOUCHED",payload:de});var Ae=$e===void 0?o:$e;return Ae?L(T.values):Promise.resolve()}),H=w.useCallback(function(de){O({type:"SET_ERRORS",payload:de})},[]),K=vs(function(de,$e){var Ae=la(de)?de(T.values):de;O({type:"SET_VALUES",payload:Ae});var Ne=$e===void 0?n:$e;return Ne?L(Ae):Promise.resolve()}),q=w.useCallback(function(de,$e){O({type:"SET_FIELD_ERROR",payload:{field:de,value:$e}})},[]),Y=vs(function(de,$e,Ae){O({type:"SET_FIELD_VALUE",payload:{field:de,value:$e}});var Ne=Ae===void 0?n:Ae;return Ne?L(bc(T.values,de,$e)):Promise.resolve()}),J=w.useCallback(function(de,$e){var Ae=$e,Ne=de,Ue;if(!B_(de)){de.persist&&de.persist();var Ze=de.target?de.target:de.currentTarget,ut=Ze.type,Ye=Ze.name,et=Ze.id,Xe=Ze.value,mt=Ze.checked;Ze.outerHTML;var At=Ze.options,Bt=Ze.multiple;Ae=$e||Ye||et,Ne=/number|range/.test(ut)?(Ue=parseFloat(Xe),isNaN(Ue)?"":Ue):/checkbox/.test(ut)?Ftt(Ho(T.values,Ae),mt,Xe):At&&Bt?Ltt(At):Xe}Ae&&Y(Ae,Ne)},[Y,T.values]),ie=vs(function(de){if(B_(de))return function($e){return J($e,de)};J(de)}),ee=vs(function(de,$e,Ae){$e===void 0&&($e=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:de,value:$e}});var Ne=Ae===void 0?o:Ae;return Ne?L(T.values):Promise.resolve()}),te=w.useCallback(function(de,$e){de.persist&&de.persist();var Ae=de.target,Ne=Ae.name,Ue=Ae.id;Ae.outerHTML;var Ze=$e||Ne||Ue;ee(Ze,!0)},[ee]),ce=vs(function(de){if(B_(de))return function($e){return te($e,de)};te(de)}),ae=w.useCallback(function(de){la(de)?O({type:"SET_FORMIK_STATE",payload:de}):O({type:"SET_FORMIK_STATE",payload:function(){return de}})},[]),ne=w.useCallback(function(de){O({type:"SET_STATUS",payload:de})},[]),ue=w.useCallback(function(de){O({type:"SET_ISSUBMITTING",payload:de})},[]),he=vs(function(){return O({type:"SUBMIT_ATTEMPT"}),L().then(function(de){var $e=de instanceof Error,Ae=!$e&&Object.keys(de).length===0;if(Ae){var Ne;try{if(Ne=me(),Ne===void 0)return}catch(Ue){throw Ue}return Promise.resolve(Ne).then(function(Ue){return x.current&&O({type:"SUBMIT_SUCCESS"}),Ue}).catch(function(Ue){if(x.current)throw O({type:"SUBMIT_FAILURE"}),Ue})}else if(x.current&&(O({type:"SUBMIT_FAILURE"}),$e))throw de})}),re=vs(function(de){de&&de.preventDefault&&la(de.preventDefault)&&de.preventDefault(),de&&de.stopPropagation&&la(de.stopPropagation)&&de.stopPropagation(),he().catch(function($e){console.warn("Warning: An unhandled error was caught from submitForm()",$e)})}),le={resetForm:z,validateForm:L,validateField:N,setErrors:H,setFieldError:q,setFieldTouched:ee,setFieldValue:Y,setStatus:ne,setSubmitting:ue,setTouched:G,setValues:K,setFormikState:ae,submitForm:he},me=vs(function(){return u(T.values,le)}),Se=vs(function(de){de&&de.preventDefault&&la(de.preventDefault)&&de.preventDefault(),de&&de.stopPropagation&&la(de.stopPropagation)&&de.stopPropagation(),z()}),Ee=w.useCallback(function(de){return{value:Ho(T.values,de),error:Ho(T.errors,de),touched:!!Ho(T.touched,de),initialValue:Ho(h.current,de),initialTouched:!!Ho(y.current,de),initialError:Ho(g.current,de)}},[T.errors,T.touched,T.values]),ge=w.useCallback(function(de){return{setValue:function(Ae,Ne){return Y(de,Ae,Ne)},setTouched:function(Ae,Ne){return ee(de,Ae,Ne)},setError:function(Ae){return q(de,Ae)}}},[Y,ee,q]),xe=w.useCallback(function(de){var $e=Ky(de),Ae=$e?de.name:de,Ne=Ho(T.values,Ae),Ue={name:Ae,value:Ne,onChange:ie,onBlur:ce};if($e){var Ze=de.type,ut=de.value,Ye=de.as,et=de.multiple;Ze==="checkbox"?ut===void 0?Ue.checked=!!Ne:(Ue.checked=!!(Array.isArray(Ne)&&~Ne.indexOf(ut)),Ue.value=ut):Ze==="radio"?(Ue.checked=Ne===ut,Ue.value=ut):Ye==="select"&&et&&(Ue.value=Ue.value||[],Ue.multiple=!0)}return Ue},[ce,ie,T.values]),Pe=w.useMemo(function(){return!Sd(h.current,T.values)},[h.current,T.values]),_e=w.useMemo(function(){return typeof s<"u"?Pe?T.errors&&Object.keys(T.errors).length===0:s!==!1&&la(s)?s(f):s:T.errors&&Object.keys(T.errors).length===0},[s,Pe,T.errors,f]),Le=no({},T,{initialValues:h.current,initialErrors:g.current,initialTouched:y.current,initialStatus:v.current,handleBlur:ce,handleChange:ie,handleReset:Se,handleSubmit:re,resetForm:z,setErrors:H,setFormikState:ae,setFieldTouched:ee,setFieldValue:Y,setFieldError:q,setStatus:ne,setSubmitting:ue,setTouched:G,setValues:K,submitForm:he,validateForm:L,validateField:N,isValid:_e,dirty:Pe,unregisterField:U,registerField:B,getFieldProps:xe,getFieldMeta:Ee,getFieldHelpers:ge,validateOnBlur:o,validateOnChange:n,validateOnMount:a});return Le}function ci(e){var t=Dtt(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return w.useImperativeHandle(i,function(){return t}),w.createElement(ktt,{value:t},n?w.createElement(n,t):o?o(t):r?la(r)?r(t):Nse(r)?null:w.Children.only(r):null)}function _tt(e){var t={};if(e.inner){if(e.inner.length===0)return bc(t,e.path,e.message);for(var o=e.inner,n=Array.isArray(o),r=0,o=n?o:o[Symbol.iterator]();;){var i;if(n){if(r>=o.length)break;i=o[r++]}else{if(r=o.next(),r.done)break;i=r.value}var a=i;Ho(t,a.path)||(t=bc(t,a.path,a.message))}}return t}function $tt(e,t,n,r){n===void 0&&(n=!1);var o=EL(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:o})}function EL(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(o){return Array.isArray(o)===!0||$K(o)?EL(o):o!==""?o:void 0}):$K(e[r])?t[r]=EL(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function Ntt(e,t,n){var r=e.slice();return t.forEach(function(i,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(i);r[a]=l?bL(Array.isArray(i)?[]:{},i,n):i}else n.isMergeableObject(i)?r[a]=bL(e[a],i,n):e.indexOf(i)===-1&&r.push(i)}),r}function Ltt(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Ftt(e,t,n){if(typeof e=="boolean")return!!t;var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,i=e.indexOf(n),o=i>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!o?r.concat(n):o?r.slice(0,i).concat(r.slice(i+1)):r}var jtt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function vs(e){var t=w.useRef(e);return jtt(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current.apply(void 0,r)},[])}function Za(e){var t=uz(),n=t.getFieldProps,r=t.getFieldMeta,o=t.getFieldHelpers,i=t.registerField,a=t.unregisterField,s=Ky(e),l=s?e:{name:e},c=l.name,u=l.validate;w.useEffect(function(){return c&&i(c,{validate:u}),function(){c&&a(c)}},[i,a,c,u]);var d=w.useMemo(function(){return o(c)},[o,c]);return[n(l),r(c),d]}var Zo=w.forwardRef(function(e,t){var n=e.action,r=cz(e,["action"]),o=n??"#",i=uz(),a=i.handleReset,s=i.handleSubmit;return w.createElement("form",no({onSubmit:s,ref:t,onReset:a,action:o},r))});Zo.displayName="Form";function Btt(e){var t=function(o){return w.createElement(Mtt,null,function(i){return w.createElement(e,no({},o,{formik:i}))})},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",qhe(t,e)}var ztt=function(t,n,r){var o=Yp(t),i=o[n];return o.splice(n,1),o.splice(r,0,i),o},Vtt=function(t,n,r){var o=Yp(t),i=o[n];return o[n]=o[r],o[r]=i,o},V_=function(t,n,r){var o=Yp(t);return o.splice(n,0,r),o},Htt=function(t,n,r){var o=Yp(t);return o[n]=r,o},Yp=function(t){if(t){if(Array.isArray(t))return[].concat(t);var n=Object.keys(t).map(function(r){return parseInt(r)}).reduce(function(r,o){return o>r?o:r},0);return Array.from(no({},t,{length:n+1}))}else return[]},cY=function(t,n){var r=typeof t=="function"?t:n;return function(o){if(Array.isArray(o)||Ky(o)){var i=Yp(o);return r(i)}return o}},Fse=function(e){Ott(t,e);function t(r){var o;return o=e.call(this,r)||this,o.updateArrayField=function(i,a,s){var l=o.props,c=l.name,u=l.formik.setFormikState;u(function(d){var f=cY(s,i),h=cY(a,i),g=bc(d.values,c,i(Ho(d.values,c))),y=s?f(Ho(d.errors,c)):void 0,v=a?h(Ho(d.touched,c)):void 0;return lY(y)&&(y=void 0),lY(v)&&(v=void 0),no({},d,{values:g,errors:s?bc(d.errors,c,y):d.errors,touched:a?bc(d.touched,c,v):d.touched})})},o.push=function(i){return o.updateArrayField(function(a){return[].concat(Yp(a),[Kb(i)])},!1,!1)},o.handlePush=function(i){return function(){return o.push(i)}},o.swap=function(i,a){return o.updateArrayField(function(s){return Vtt(s,i,a)},!0,!0)},o.handleSwap=function(i,a){return function(){return o.swap(i,a)}},o.move=function(i,a){return o.updateArrayField(function(s){return ztt(s,i,a)},!0,!0)},o.handleMove=function(i,a){return function(){return o.move(i,a)}},o.insert=function(i,a){return o.updateArrayField(function(s){return V_(s,i,a)},function(s){return V_(s,i,null)},function(s){return V_(s,i,null)})},o.handleInsert=function(i,a){return function(){return o.insert(i,a)}},o.replace=function(i,a){return o.updateArrayField(function(s){return Htt(s,i,a)},!1,!1)},o.handleReplace=function(i,a){return function(){return o.replace(i,a)}},o.unshift=function(i){var a=-1;return o.updateArrayField(function(s){var l=s?[i].concat(s):[i];return a=l.length,l},function(s){return s?[null].concat(s):[null]},function(s){return s?[null].concat(s):[null]}),a},o.handleUnshift=function(i){return function(){return o.unshift(i)}},o.handleRemove=function(i){return function(){return o.remove(i)}},o.handlePop=function(){return function(){return o.pop()}},o.remove=o.remove.bind(sY(o)),o.pop=o.pop.bind(sY(o)),o}var n=t.prototype;return n.componentDidUpdate=function(o){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Sd(Ho(o.formik.values,o.name),Ho(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(o){var i;return this.updateArrayField(function(a){var s=a?Yp(a):[];return i||(i=s[o]),la(s.splice)&&s.splice(o,1),la(s.every)&&s.every(function(l){return l===void 0})?[]:s},!0,!0),i},n.pop=function(){var o;return this.updateArrayField(function(i){var a=i.slice();return o||(o=a&&a.pop&&a.pop()),a},!0,!0),o},n.render=function(){var o={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},i=this.props,a=i.component,s=i.render,l=i.children,c=i.name,u=i.formik,d=cz(u,["validate","validationSchema"]),f=no({},o,{form:d,name:c});return a?w.createElement(a,f):s?s(f):l?typeof l=="function"?l(f):Nse(l)?null:w.Children.only(l):null},t}(w.Component);Fse.defaultProps={validateOnChange:!0};var jse=Btt(Fse),H_,uY;function Utt(){if(uY)return H_;uY=1;function e(x){this._maxSize=x,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(x){return this._values[x]},e.prototype.set=function(x,S){return this._size>=this._maxSize&&this.clear(),x in this._values||this._size++,this._values[x]=S};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,a=512,s=new e(a),l=new e(a),c=new e(a);H_={Cache:e,split:d,normalizePath:u,setter:function(x){var S=u(x);return l.get(x)||l.set(x,function(I,E){for(var T=0,O=S.length,A=I;T<O-1;){var k=S[T];if(k==="__proto__"||k==="constructor"||k==="prototype")return I;A=A[S[T++]]}A[S[T]]=E})},getter:function(x,S){var C=u(x);return c.get(x)||c.set(x,function(E){for(var T=0,O=C.length;T<O;)if(E!=null||!S)E=E[C[T++]];else return;return E})},join:function(x){return x.reduce(function(S,C){return S+(h(C)||n.test(C)?"["+C+"]":(S?".":"")+C)},"")},forEach:function(x,S,C){f(Array.isArray(x)?x:d(x),S,C)}};function u(x){return s.get(x)||s.set(x,d(x).map(function(S){return S.replace(i,"$2")}))}function d(x){return x.match(t)||[""]}function f(x,S,C){var I=x.length,E,T,O,A;for(T=0;T<I;T++)E=x[T],E&&(v(E)&&(E='"'+E+'"'),A=h(E),O=!A&&/^\d+$/.test(E),S.call(C,E,A,O,T,x))}function h(x){return typeof x=="string"&&x&&["'",'"'].indexOf(x.charAt(0))!==-1}function g(x){return x.match(r)&&!x.match(n)}function y(x){return o.test(x)}function v(x){return!h(x)&&(g(x)||y(x))}return H_}var Rp=Utt(),U_,dY;function Wtt(){if(dY)return U_;dY=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=u=>u.match(e)||[],n=u=>u[0].toUpperCase()+u.slice(1),r=(u,d)=>t(u).join(d).toLowerCase(),o=u=>t(u).reduce((d,f)=>`${d}${d?f[0].toUpperCase()+f.slice(1).toLowerCase():f.toLowerCase()}`,"");return U_={words:t,upperFirst:n,camelCase:o,pascalCase:u=>n(o(u)),snakeCase:u=>r(u,"_"),kebabCase:u=>r(u,"-"),sentenceCase:u=>n(r(u," ")),titleCase:u=>t(u).map(n).join(" ")},U_}var W_=Wtt(),n1={exports:{}},fY;function Gtt(){if(fY)return n1.exports;fY=1,n1.exports=function(o){return e(t(o),o)},n1.exports.array=e;function e(o,i){var a=o.length,s=new Array(a),l={},c=a,u=n(i),d=r(o);for(i.forEach(function(h){if(!d.has(h[0])||!d.has(h[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});c--;)l[c]||f(o[c],c,new Set);return s;function f(h,g,y){if(y.has(h)){var v;try{v=", node was:"+JSON.stringify(h)}catch{v=""}throw new Error("Cyclic dependency"+v)}if(!d.has(h))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(h));if(!l[g]){l[g]=!0;var x=u.get(h)||new Set;if(x=Array.from(x),g=x.length){y.add(h);do{var S=x[--g];f(S,d.get(S),y)}while(g);y.delete(h)}s[--a]=h}}}function t(o){for(var i=new Set,a=0,s=o.length;a<s;a++){var l=o[a];i.add(l[0]),i.add(l[1])}return Array.from(i)}function n(o){for(var i=new Map,a=0,s=o.length;a<s;a++){var l=o[a];i.has(l[0])||i.set(l[0],new Set),i.has(l[1])||i.set(l[1],new Set),i.get(l[0]).add(l[1])}return i}function r(o){for(var i=new Map,a=0,s=o.length;a<s;a++)i.set(o[a],a);return i}return n1.exports}var qtt=Gtt();const Ktt=Fn(qtt),Ytt=Object.prototype.toString,Qtt=Error.prototype.toString,Xtt=RegExp.prototype.toString,Jtt=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Ztt=/^Symbol\((.*)\)(.*)$/;function ent(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function pY(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return ent(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Jtt.call(e).replace(Ztt,"Symbol($1)");const r=Ytt.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Qtt.call(e)+"]":r==="RegExp"?Xtt.call(e):null}function hu(e,t){let n=pY(e,t);return n!==null?n:JSON.stringify(e,function(r,o){let i=pY(this[r],t);return i!==null?i:o},2)}function Bse(e){return e==null?[]:[].concat(e)}let zse,Vse,Hse,tnt=/\$\{\s*(\w+)\s*\}/g;zse=Symbol.toStringTag;class hY{constructor(t,n,r,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[zse]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],Bse(t).forEach(i=>{if(da.isError(i)){this.errors.push(...i.errors);const a=i.inner.length?i.inner:[i];this.inner.push(...a)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Vse=Symbol.hasInstance;Hse=Symbol.toStringTag;class da extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(tnt,(o,i)=>hu(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,o,i){const a=new hY(t,n,r,o);if(i)return a;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Hse]="Error",this.name=a.name,this.message=a.message,this.type=a.type,this.value=a.value,this.path=a.path,this.errors=a.errors,this.inner=a.inner,Error.captureStackTrace&&Error.captureStackTrace(this,da)}static[Vse](t){return hY[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let ec={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const o=r!=null&&r!==n?` (cast from the value \`${hu(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${hu(n,!0)}\``+o:`${e} must match the configured type. The validated value was: \`${hu(n,!0)}\``+o}},ia={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},yd={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},PL={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},IL={isValue:"${path} field must be ${value}"},N1={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},L1={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},nnt={notType:e=>{const{path:t,value:n,spec:r}=e,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${t} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${hu(n,!0)}\``;if(n.length>o)return`${t} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${hu(n,!0)}\``}return da.formatError(ec.notType,e)}};Object.assign(Object.create(null),{mixed:ec,string:ia,number:yd,date:PL,object:N1,array:L1,boolean:IL,tuple:nnt});const HT=e=>e&&e.__isYupSchema__;class TP{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:o,otherwise:i}=n,a=typeof r=="function"?r:(...s)=>s.every(l=>l===r);return new TP(t,(s,l)=>{var c;let u=a(...s)?o:i;return(c=u==null?void 0:u(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),o=this.fn(r,t,n);if(o===void 0||o===t)return t;if(!HT(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const r1={context:"$",value:"."};function dz(e,t){return new Pf(e,t)}class Pf{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===r1.context,this.isValue=this.key[0]===r1.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?r1.context:this.isValue?r1.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Rp.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let o=this.isContext?r:this.isValue?t:n;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Pf.prototype.__isYupRef=!0;const Tl=e=>e==null;function lm(e){function t({value:n,path:r="",options:o,originalValue:i,schema:a},s,l){const{name:c,test:u,params:d,message:f,skipAbsent:h}=e;let{parent:g,context:y,abortEarly:v=a.spec.abortEarly,disableStackTrace:x=a.spec.disableStackTrace}=o;function S(R){return Pf.isRef(R)?R.getValue(n,g,y):R}function C(R={}){const $=Object.assign({value:n,originalValue:i,label:a.spec.label,path:R.path||r,spec:a.spec,disableStackTrace:R.disableStackTrace||x},d,R.params);for(const z of Object.keys($))$[z]=S($[z]);const L=new da(da.formatError(R.message||f,$),n,$.path,R.type||c,$.disableStackTrace);return L.params=$,L}const I=v?s:l;let E={path:r,parent:g,type:c,from:o.from,createError:C,resolve:S,options:o,originalValue:i,schema:a};const T=R=>{da.isError(R)?I(R):R?l(null):I(C())},O=R=>{da.isError(R)?I(R):s(R)};if(h&&Tl(n))return T(!0);let k;try{var M;if(k=u.call(E,n,E),typeof((M=k)==null?void 0:M.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${E.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(k).then(T,O)}}catch(R){O(R);return}T(k)}return t.OPTIONS=e,t}function rnt(e,t,n,r=n){let o,i,a;return t?(Rp.forEach(t,(s,l,c)=>{let u=l?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:o,value:n});let d=e.type==="tuple",f=c?parseInt(u,10):0;if(e.innerType||d){if(d&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);o=n,n=n&&n[f],e=d?e.spec.types[f]:e.innerType}if(!c){if(!e.fields||!e.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);o=n,n=n&&n[u],e=e.fields[u]}i=u,a=l?"["+s+"]":"."+s}),{schema:e,parent:o,parentPath:i}):{parent:o,parentPath:t,schema:e}}class OP extends Set{describe(){const t=[];for(const n of this.values())t.push(Pf.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new OP(this.values())}merge(t,n){const r=this.clone();return t.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function Am(e,t=new Map){if(HT(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Am(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,o]of e.entries())n.set(r,Am(o,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Am(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,o]of Object.entries(e))n[r]=Am(o,t)}else throw Error(`Unable to clone ${e}`);return n}class Ya{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new OP,this._blacklist=new OP,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ec.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Am(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const o=Object.assign({},n.spec,r.spec);return r.spec=o,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(a=>{i.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((o,i)=>i.resolve(o,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,o,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(o=t.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),o=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(o&&Tl(i))return i;let a=hu(t),s=hu(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".attempted value: ${a}`+(s!==a?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((o,i)=>i.call(this,o,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,o){let{path:i,originalValue:a=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:l,originalValue:a,options:n,tests:c},r,u=>{if(u.length)return o(u,l);this.runTests({path:i,value:l,originalValue:a,options:n,tests:this.tests},r,o)})}runTests(t,n,r){let o=!1,{tests:i,value:a,originalValue:s,path:l,options:c}=t,u=y=>{o||(o=!0,n(y,a))},d=y=>{o||(o=!0,r(y,a))},f=i.length,h=[];if(!f)return d([]);let g={value:a,originalValue:s,path:l,options:c,schema:this};for(let y=0;y<i.length;y++){const v=i[y];v(g,u,function(S){S&&(Array.isArray(S)?h.push(...S):h.push(S)),--f<=0&&d(h)})}}asNestedTest({key:t,index:n,parent:r,parentPath:o,originalParent:i,options:a}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let c=r[s];const u=Object.assign({},a,{strict:!0,parent:r,value:c,originalValue:i[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${o||""}[${l?s:`"${s}"`}]`:(o?`${o}.`:"")+t});return(d,f,h)=>this.resolve(u)._validate(c,u,f,h)}validate(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((a,s)=>o._validate(t,n,(l,c)=>{da.isError(l)&&(l.value=c),s(l)},(l,c)=>{l.length?s(new da(l,c,void 0,void 0,i)):a(c)}))}validateSync(t,n){var r;let o=this.resolve(Object.assign({},n,{value:t})),i,a=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(t,Object.assign({},n,{sync:!0}),(s,l)=>{throw da.isError(s)&&(s.value=l),s},(s,l)=>{if(s.length)throw new da(s,t,void 0,void 0,a);i=l}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(da.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(da.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Am(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=lm({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=lm({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=ec.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=ec.notNull){return this.nullability(!1,t)}required(t=ec.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=ec.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=lm(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(i||a.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),o=Bse(t).map(i=>new Pf(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new TP(o,n):TP.fromOptions(o,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=lm({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=ec.oneOf){let r=this.clone();return t.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=lm({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,a=i.resolveAll(this.resolve);return a.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:a}})}}),r}notOneOf(t,n=ec.notOneOf){let r=this.clone();return t.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=lm({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,a=i.resolveAll(this.resolve);return a.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:o,optional:i,nullable:a}=n.spec;return{meta:o,label:r,optional:i,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,u)=>u.findIndex(d=>d.name===l.name)===c)}}}Ya.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Ya.prototype[`${e}At`]=function(t,n,r={}){const{parent:o,parentPath:i,schema:a}=rnt(this,t,n,r.context);return a[e](o&&o[i],Object.assign({},r,{parent:o,path:t}))};for(const e of["equals","is"])Ya.prototype[e]=Ya.prototype.oneOf;for(const e of["not","nope"])Ya.prototype[e]=Ya.prototype.notOneOf;function mu(){return new Use}class Use extends Ya{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=IL.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return Tl(n)||n===!0}})}isFalse(t=IL.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return Tl(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}mu.prototype=Use.prototype;const ont=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function int(e){const t=TL(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function TL(e){var t,n;const r=ont.exec(e);return r?{year:Qc(r[1]),month:Qc(r[2],1)-1,day:Qc(r[3],1),hour:Qc(r[4]),minute:Qc(r[5]),second:Qc(r[6]),millisecond:r[7]?Qc(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:Qc(r[10]),minuteOffset:Qc(r[11])}:null}function Qc(e,t=0){return Number(e)||t}let ant=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,snt=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,lnt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,cnt="^\\d{4}-\\d{2}-\\d{2}",unt="\\d{2}:\\d{2}:\\d{2}",dnt="(([+-]\\d{2}(:?\\d{2})?)|Z)",fnt=new RegExp(`${cnt}T${unt}(\\.\\d+)?${dnt}$`),pnt=e=>Tl(e)||e===e.trim(),hnt={}.toString();function Ro(){return new Wse}class Wse extends Ya{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const o=t!=null&&t.toString?t.toString():t;return o===hnt?t:o})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||ec.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=ia.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=ia.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=ia.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||ia.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=ia.email){return this.matches(ant,{name:"email",message:t,excludeEmptyString:!0})}url(t=ia.url){return this.matches(snt,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=ia.uuid){return this.matches(lnt,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,o;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=t:n=t),this.matches(fnt,{name:"datetime",message:n||ia.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||ia.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const a=TL(i);return a?!!a.z:!1}}).test({name:"datetime_precision",message:n||ia.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const a=TL(i);return a?a.precision===o:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=ia.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:pnt})}lowercase(t=ia.lowercase){return this.transform(n=>Tl(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Tl(n)||n===n.toLowerCase()})}uppercase(t=ia.uppercase){return this.transform(n=>Tl(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Tl(n)||n===n.toUpperCase()})}}Ro.prototype=Wse.prototype;let mnt=e=>e!=+e;function wo(){return new Gse}class Gse extends Ya{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!mnt(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let o=t;if(typeof o=="string"){if(o=o.replace(/\s/g,""),o==="")return NaN;o=+o}return r.isType(o)||o===null?o:parseFloat(o)})})}min(t,n=yd.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=yd.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=yd.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=yd.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=yd.positive){return this.moreThan(0,t)}negative(t=yd.negative){return this.lessThan(0,t)}integer(t=yd.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>Tl(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(o=>Tl(o)?o:Math[t](o))}}wo.prototype=Gse.prototype;let qse=new Date(""),gnt=e=>Object.prototype.toString.call(e)==="[object Date]";function wc(){return new H0}class H0 extends Ya{constructor(){super({type:"date",check(t){return gnt(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=int(t),isNaN(t)?H0.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Pf.isRef(t))r=t;else{let o=this.cast(t);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(t,n=PL.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(t,n=PL.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}H0.INVALID_DATE=qse;wc.prototype=H0.prototype;wc.INVALID_DATE=qse;function ynt(e,t=[]){let n=[],r=new Set,o=new Set(t.map(([a,s])=>`${a}-${s}`));function i(a,s){let l=Rp.split(a)[0];r.add(l),o.has(`${s}-${l}`)||n.push([s,l])}for(const a of Object.keys(e)){let s=e[a];r.add(a),Pf.isRef(s)&&s.isSibling?i(s.path,a):HT(s)&&"deps"in s&&s.deps.forEach(l=>i(l,a))}return Ktt.array(Array.from(r),n).reverse()}function mY(e,t){let n=1/0;return e.some((r,o)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=o,!0}),n}function Kse(e){return(t,n)=>mY(e,t)-mY(e,n)}const Yse=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function F1(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=F1(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=F1(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(F1)}):"optional"in e?e.optional():e}const vnt=(e,t)=>{const n=[...Rp.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),o=Rp.getter(Rp.join(n),!0)(e);return!!(o&&r in o)};let gY=e=>Object.prototype.toString.call(e)==="[object Object]";function yY(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const bnt=Kse([]);function _o(e){return new Qse(e)}class Qse extends Ya{constructor(t){super({type:"object",check(n){return gY(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=bnt,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let o=super._cast(t,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(o).filter(d=>!this._nodes.includes(d))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),u=!1;for(const d of s){let f=i[d],h=d in o;if(f){let g,y=o[d];c.path=(n.path?`${n.path}.`:"")+d,f=f.resolve({value:y,context:n.context,parent:l});let v=f instanceof Ya?f.spec:void 0,x=v==null?void 0:v.strict;if(v!=null&&v.strip){u=u||d in o;continue}g=!n.__validating||!x?f.cast(o[d],c):o[d],g!==void 0&&(l[d]=g)}else h&&!a&&(l[d]=o[d]);(h!==d in l||l[d]!==o[d])&&(u=!0)}return u?l:o}_validate(t,n={},r,o){let{from:i=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...i],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,c)=>{if(!s||!gY(c)){o(l,c);return}a=a||c;let u=[];for(let d of this._nodes){let f=this.fields[d];!f||Pf.isRef(f)||u.push(f.asNestedTest({options:n,key:d,parent:c,parentPath:n.path,originalParent:a}))}this.runTests({tests:u,value:c,originalValue:a,options:n},r,d=>{o(d.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const a=r[o];r[o]=a===void 0?i:a}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let a=t;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(a):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=ynt(t,n),r._sortErrors=Kse(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),o)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return F1(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>t.includes(r)&&t.includes(o)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let o=Rp.getter(t,!0);return this.transform(i=>{if(!i)return i;let a=i;return vnt(i,t)&&(a=Object.assign({},i),r||delete a[t],a[n]=o(i)),a})}json(){return this.transform(Yse)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||N1.exact,test(n){if(n==null)return!0;const r=yY(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=N1.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=yY(this.schema,o);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=N1.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[t(o)]=n[o];return r})}camelCase(){return this.transformKeys(W_.camelCase)}snakeCase(){return this.transformKeys(W_.snakeCase)}constantCase(){return this.transformKeys(t=>W_.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,a]of Object.entries(n.fields)){var o;let s=t;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[i]})),r.fields[i]=a.describe(s)}return r}}_o.prototype=Qse.prototype;function Dp(e){return new Xse(e)}class Xse extends Ya{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let o=!1;const i=r.map((a,s)=>{const l=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return l!==a&&(o=!0),l});return o?i:r}_validate(t,n={},r,o){var i;let a=this.innerType,s=(i=n.recursive)!=null?i:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,c)=>{var u;if(!s||!a||!this._typeCheck(c)){o(l,c);return}let d=new Array(c.length);for(let h=0;h<c.length;h++){var f;d[h]=a.asNestedTest({options:n,index:h,parent:c,parentPath:n.path,originalParent:(f=n.originalValue)!=null?f:t})}this.runTests({value:c,tests:d,originalValue:(u=n.originalValue)!=null?u:t,options:n},r,h=>o(h.concat(l),c))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(Yse)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!HT(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+hu(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=L1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||L1.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||L1.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,o,i)=>!t(r,o,i):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);if(n.innerType){var o;let i=t;(o=i)!=null&&o.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),r.innerType=n.innerType.describe(i)}return r}}Dp.prototype=Xse.prototype;const fz=({planId:e,entry:t,mealId:n,meals:r,closeFn:o})=>{const i=n===void 0?null:n,a=r===void 0?[]:r,[s,l]=Re(),c=bMe(e),u=wMe(e),[d,f]=w.useState(t?yt.fromJSDate(t.datetime):yt.now()),[h,g]=w.useState(i),y=_o({amount:wo().required(s("forms.fieldRequired")).max(1e3,s("forms.maxValue",{value:"1000"})).min(1,s("forms.minValue",{value:"1"})),ingredient:wo().required(s("forms.fieldRequired")),datetime:wc().required(s("forms.fieldRequired"))});return b(ci,{initialValues:{datetime:new Date,amount:0,ingredient:0},validationSchema:y,onSubmit:async v=>{const x={...v,plan:e,meal:h,weight_unit:null,datetime:v.datetime.toISOString()};t?u.mutate({...x,id:t.id}):c.mutate(x),o&&o()},children:v=>b(Zo,{children:Q(_t,{spacing:2,children:[b(ZB,{callback:x=>v.setFieldValue("ingredient",x==null?void 0:x.data.id)}),b(tn,{fullWidth:!0,id:"amount",label:"amount",InputProps:{endAdornment:b(ro,{position:"end",children:s("nutrition.gramShort")})},error:v.touched.amount&&!!v.errors.amount,helperText:v.touched.amount&&v.errors.amount,...v.getFieldProps("amount")}),a.length>0&&b($l,{value:h,options:a.map(x=>x.id),getOptionLabel:x=>a.find(S=>S.id===x).displayName,onChange:(x,S)=>g(S),renderInput:x=>b(tn,{label:s("nutrition.meal"),value:h,...x})}),b(vc,{dateAdapter:pu,adapterLocale:l.language,children:b(CXe,{format:"yyyy-MM-dd HH:mm",label:s("date"),value:d,disableFuture:!0,onChange:x=>{v.setFieldValue("datetime",x==null?void 0:x.toJSDate()),f(x)},shouldDisableDate:x=>(t&&co(t.datetime)===co(x.toJSDate()),!1)})}),Q(_t,{direction:"row",justifyContent:"end",spacing:2,children:[o!==void 0&&b(at,{color:"primary",variant:"outlined",onClick:()=>o(),children:s("close")}),b(at,{color:"primary",variant:"contained",type:"submit",children:s("submit")})]})]})})})},pz=({plan:e,closeFn:t})=>{const[n]=Re(),r=gMe(),o=vMe(e==null?void 0:e.id),[i,a]=w.useState(e==null?void 0:e.hasAnyGoals),s=_o({description:Ro().required().max(25,n("forms.maxLength",{chars:"25"})).min(3,n("forms.minLength",{chars:"3"})),only_logging:mu(),goal_energy:wo().notRequired().positive().max(6e3,n("forms.maxValue",{value:"6000kcal"})),goal_protein:wo().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),goal_carbohydrates:wo().notRequired().positive().max(750,n("forms.maxValue",{value:"750"})),goal_fiber:wo().notRequired().positive().max(500,n("forms.maxValue",{value:"500"})),goal_fat:wo().notRequired().positive().max(500,n("forms.maxValue",{value:"500"}))});return b(ci,{initialValues:{description:e?e.description:n("nutrition.plan"),only_logging:e?e.onlyLogging:!0,goal_energy:e?e.goalEnergy:null,goal_protein:e?e.goalProtein:null,goal_carbohydrates:e?e.goalCarbohydrates:null,goal_fiber:e?e.goalFiber:null,goal_fat:e?e.goalFat:null},validationSchema:s,onSubmit:async l=>{l.goal_energy=l.goal_energy?l.goal_energy:null,l.goal_protein=l.goal_protein?l.goal_protein:null,l.goal_carbohydrates=l.goal_carbohydrates?l.goal_carbohydrates:null,l.goal_fiber=l.goal_fiber?l.goal_fiber:null,l.goal_fat=l.goal_fat?l.goal_fat:null,i||(l.goal_energy=null,l.goal_protein=null,l.goal_carbohydrates=null,l.goal_fiber=null,l.goal_fat=null),e?o.mutate({...l,id:e.id}):r.mutate(l),t&&t()},children:l=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"description",label:n("description"),error:l.touched.description&&!!l.errors.description,helperText:l.touched.description&&l.errors.description,...l.getFieldProps("description")}),b(Fw,{children:b(ba,{label:n("nutrition.onlyLoggingHelpText"),control:b(li,{id:"onlyLogging",checked:l.values.only_logging,...l.getFieldProps("only_logging")})})}),b(Fw,{children:b(ba,{label:n("nutrition.useGoalsHelpText"),control:b(li,{id:"goalEnergy",checked:i,onChange:()=>a(!i)})})}),b(h0,{children:n("nutrition.useGoalsHelpTextLong")}),i&&Q(xt,{children:[b(tn,{fullWidth:!0,id:"energy",label:n("nutrition.goalEnergy"),error:l.touched.goal_energy&&!!l.errors.goal_energy,helperText:l.touched.goal_energy&&l.errors.goal_energy,...l.getFieldProps("goal_energy"),InputProps:{endAdornment:b(ro,{position:"end",children:n("nutrition.kcal")})}}),Q(ye,{container:!0,spacing:1,children:[b(ye,{size:4,children:b(tn,{id:"protein",label:n("nutrition.goalProtein"),error:l.touched.goal_protein&&!!l.errors.goal_protein,helperText:l.touched.goal_protein&&l.errors.goal_protein,...l.getFieldProps("goal_protein"),InputProps:{startAdornment:b(ro,{position:"start",children:l.values.goal_protein!==null&&l.values.goal_protein!==void 0?n("nutrition.valueEnergyKcal",{value:l.values.goal_protein*Hm.protein}):""}),endAdornment:b(ro,{position:"end",children:n("nutrition.gramShort")})}})}),b(ye,{size:4,children:b(tn,{id:"carbohydrates",label:n("nutrition.goalCarbohydrates"),error:l.touched.goal_carbohydrates&&!!l.errors.goal_carbohydrates,helperText:l.touched.goal_carbohydrates&&l.errors.goal_carbohydrates,...l.getFieldProps("goal_carbohydrates"),InputProps:{startAdornment:b(ro,{position:"start",children:l.values.goal_carbohydrates!==null&&l.values.goal_carbohydrates!==void 0?n("nutrition.valueEnergyKcal",{value:l.values.goal_carbohydrates*Hm.carbohydrates}):""}),endAdornment:b(ro,{position:"end",children:n("nutrition.gramShort")})}})}),b(ye,{size:4,children:b(tn,{id:"fat",label:n("nutrition.goalFat"),error:l.touched.goal_fat&&!!l.errors.goal_fat,helperText:l.touched.goal_fat&&l.errors.goal_fat,...l.getFieldProps("goal_fat"),InputProps:{startAdornment:b(ro,{position:"start",children:l.values.goal_fat!==null&&l.values.goal_fat!==void 0?n("nutrition.valueEnergyKcal",{value:l.values.goal_fat*Hm.fat}):""}),endAdornment:b(ro,{position:"end",children:n("nutrition.gramShort")})}})})]}),b(ye,{container:!0,spacing:1,children:b(ye,{size:4,children:b(tn,{id:"fiber",label:n("nutrition.goalFiber"),error:l.touched.goal_fiber&&!!l.errors.goal_fiber,helperText:l.touched.goal_fiber&&l.errors.goal_fiber,...l.getFieldProps("goal_fiber"),InputProps:{startAdornment:b(ro,{position:"start",children:n("nutrition.valueEnergyKcal",{value:0})}),endAdornment:b(ro,{position:"end",children:n("nutrition.gramShort")})}})})})]}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("submit")})})]})})})},Jse=()=>{const[e]=Re(),t=pMe();return t.isLoading?b(wr,{}):t.data!==null?b(wnt,{plan:t.data}):b(rj,{title:e("nutritionalPlan"),modalContent:b(pz,{}),modalTitle:e("add")})};function wnt(e){const[t,n]=Re(),[r,o]=X.useState(!1),i=()=>o(!0),a=()=>o(!1);return Q(xt,{children:[Q(fo,{children:[b(Vl,{title:t("nutritionalPlan"),subheader:e.plan.description}),Q(Pi,{sx:{height:"500px",overflow:"auto"},children:[b(E8e,{percentage:e.plan.percentageValuesLoggedToday,planned:e.plan.plannedNutritionalValues,logged:e.plan.loggedNutritionalValuesToday}),b(xa,{children:e.plan.meals.map(s=>b(xnt,{meal:s,planId:e.plan.id},s.id))})]}),Q(Ys,{sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[b(at,{size:"small",href:Qt(Kt.NUTRITION_DETAIL,n.language,{id:e.plan.id}),children:t("seeDetails")}),b(Do,{title:t("nutrition.logThisMealItem"),children:b(on,{onClick:i,children:b(g0,{})})})]})]}),b(ki,{title:t("nutrition.addNutritionalDiary"),isOpen:r,closeFn:a,children:b(fz,{closeFn:a,planId:e.plan.id,meals:e.plan.meals})})]})}const xnt=e=>{const[t,n]=Re(),r=ste(e.planId),[o,i]=w.useState(!1),[a,s]=X.useState(!1),l=()=>i(!o),c=(h,g)=>{g!=="clickaway"&&s(!1)},u=h=>{const g=[{plan:e.planId,meal:e.meal.id,mealItem:h.id,ingredient:h.ingredientId,weight_unit:h.weightUnitId,datetime:new Date().toISOString(),amount:h.amount}];r.mutate(g),s(!0)},d=e.meal.name?e.meal.name:fE(e.meal.time,n.language),f=e.meal.name?fE(e.meal.time,n.language):null;return Q(xt,{children:[Q(mf,{onClick:l,selected:o,children:[b(si,{children:o?b(kee,{}):b(xy,{})}),b(uo,{primary:d,secondary:f})]}),b(Ls,{in:o,timeout:"auto",unmountOnExit:!0,children:b(xa,{children:e.meal.items.map(h=>{var g,y,v,x;return Q(Ka,{secondaryAction:b(Do,{title:t("nutrition.logThisMealItem"),children:b(on,{edge:"end",onClick:()=>u(h),children:b(g0,{})})}),children:[b(JF,{children:b(Nl,{alt:(g=h.ingredient)==null?void 0:g.name,src:(v=(y=h.ingredient)==null?void 0:y.image)==null?void 0:v.url,sx:{width:45,height:45},children:b(_u,{})})}),b(uo,{primary:(x=h.ingredient)==null?void 0:x.name,secondary:Rn(h.amount,n.language)})]},h.id)})})}),b(II,{open:a,autoHideDuration:NI,onClose:c,children:b(Ii,{onClose:c,severity:"success",sx:{width:"100%"},children:t("nutrition.diaryEntrySaved")})})]})},Zse=Je(_.jsx("path",{d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V8h14zM7 10h5v5H7z"}),"Today");function _c(e){return br({queryKey:[st.ROUTINE_DETAIL,e],queryFn:()=>m_e(e)})}function Snt(e){return br({queryKey:[st.ROUTINE_STATS,e],queryFn:()=>P_e(e)})}function ele(e){return br({queryKey:[st.ROUTINE_LOG_DATA,e],queryFn:()=>E_e(e)})}function Cnt(){return br({queryKey:[st.ROUTINES_SHALLOW],queryFn:g_e})}function Ent(){return br({queryKey:[st.PRIVATE_TEMPLATES],queryFn:y_e})}function Pnt(){return br({queryKey:[st.PUBLIC_TEMPLATES],queryFn:v_e})}function Int(){return br({queryKey:[st.ROUTINES_ACTIVE],queryFn:h_e})}const Tnt=()=>{const e=Et();return It({mutationFn:t=>b_e(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]})})},tle=e=>{const t=Et();return It({mutationFn:n=>w_e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},Ont=e=>{const t=Et();return It({mutationFn:()=>x_e(e),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},knt=e=>{const t=Et();return It({mutationFn:n=>K_e(n.toAdd,n.toEdit,n.toDelete,n.apiPath),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Mnt=e=>{const t=Et();return It({mutationFn:n=>Y_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Ant=e=>{const t=Et();return It({mutationFn:n=>Q_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Rnt=e=>{const t=Et();return It({mutationFn:n=>X_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Dnt=e=>{const t=Et();return It({mutationFn:n=>J_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},_nt=e=>{const t=Et();return It({mutationFn:n=>Z_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},$nt=e=>{const t=Et();return It({mutationFn:n=>e$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Nnt=e=>{const t=Et();return It({mutationFn:n=>t$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Lnt=e=>{const t=Et();return It({mutationFn:n=>n$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Fnt=e=>{const t=Et();return It({mutationFn:n=>r$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},jnt=e=>{const t=Et();return It({mutationFn:n=>o$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},vY=e=>{const t=Et();return It({mutationFn:n=>i$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Bnt=e=>{const t=Et();return It({mutationFn:n=>a$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},znt=e=>{const t=Et();return It({mutationFn:n=>s$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Vnt=e=>{const t=Et();return It({mutationFn:n=>l$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Hnt=e=>{const t=Et();return It({mutationFn:n=>c$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Unt=e=>{const t=Et();return It({mutationFn:n=>u$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Wnt=e=>{const t=Et();return It({mutationFn:n=>d$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},nle=e=>{const t=Et();return It({mutationFn:n=>f$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},rle=e=>{const t=Et();return It({mutationFn:n=>p$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ole=e=>{const t=Et();return It({mutationFn:n=>h$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Gnt=e=>{const t=Et();return It({mutationFn:n=>m$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},qnt=e=>{const t=Et();return It({mutationFn:n=>g$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Knt=e=>{const t=Et();return It({mutationFn:n=>y$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Ynt=e=>{const t=Et();return It({mutationFn:n=>v$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Qnt=e=>{const t=Et();return It({mutationFn:n=>b$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Xnt=e=>{const t=Et();return It({mutationFn:n=>w$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Jnt=e=>{const t=Et();return It({mutationFn:n=>x$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},Znt=e=>{const t=Et();return It({mutationFn:n=>S$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ert=e=>{const t=Et();return It({mutationFn:n=>C$e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},trt=e=>{const t=Et();return It({mutationFn:n=>B_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},nrt=e=>{const t=Et();return It({mutationFn:n=>z_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},rrt=e=>{const t=Et();return It({mutationFn:n=>V_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},ort=e=>{const t=Et();return It({mutationFn:n=>H_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})};function irt(e){const t=Et();return It({mutationFn:n=>N_e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_LOGS,e]}),t.invalidateQueries({queryKey:[st.ROUTINE_STATS,e]})}})}const U0=e=>{const t=Et();return It({mutationFn:n=>L_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},art=e=>{const t=Et();return It({mutationFn:n=>j_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},srt=e=>{const t=Et();return It({mutationFn:n=>F_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},lrt=()=>br({queryKey:[st.ROUTINE_WEIGHT_UNITS],queryFn:Mne}),crt=()=>br({queryKey:[st.ROUTINE_REP_UNITS],queryFn:kne}),urt=e=>{const t=Et();return It({mutationFn:n=>U_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},drt=e=>{const t=Et();return It({mutationFn:n=>W_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},frt=e=>{const t=Et();return It({mutationFn:n=>G_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},prt=e=>{const t=Et();return It({mutationFn:n=>q_e(n),onSuccess:()=>t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})})},hrt=(e,t)=>br({queryFn:()=>E$e(t),queryKey:[st.SESSION_SEARCH,e,JSON.stringify(t)]}),mrt=()=>{const e=Et();return It({mutationFn:t=>P$e(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]})})},grt=e=>{const t=Et();return It({mutationFn:n=>I$e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.ROUTINE_OVERVIEW]}),t.invalidateQueries({queryKey:[st.ROUTINE_DETAIL,e]})}})},$o=Je(_.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),ile=Je(_.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddCircle"),yrt=Je(_.jsx("path",{d:"M22 5v2h-3v3h-2V7h-3V5h3V2h2v3zm-3 14H5V5h6V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6h-2zm-4-6v4h2v-4zm-4 4h2V9h-2zm-2 0v-6H7v6z"}),"Addchart"),vrt=Je(_.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown"),brt=Je(_.jsx("path",{d:"m7 14 5-5 5 5z"}),"ArrowDropUp"),wrt=Je(_.jsx("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}),"ArrowForwardIos"),ale=Je(_.jsx("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart"),xrt=Je(_.jsx("path",{d:"m19 8-4 4h3c0 3.31-2.69 6-6 6-1.01 0-1.97-.25-2.8-.7l-1.46 1.46C8.97 19.54 10.43 20 12 20c4.42 0 8-3.58 8-8h3zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46C15.03 4.46 13.57 4 12 4c-4.42 0-8 3.58-8 8H1l4 4 4-4z"}),"Cached"),Srt=Je(_.jsx("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"}),"CalendarMonth"),Crt=Je([_.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),_.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"CameraAlt"),Ert=Je(_.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckBox"),Prt=Je(_.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"CheckBoxOutlineBlank"),Irt=Je(_.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),sle=Je(_.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),Trt=Je(_.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear"),Ort=Je(_.jsx("path",{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2m-11-4 2.03 2.71L16 11l4 5H8zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6z"}),"Collections"),krt=Je(_.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),W0=Je(_.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),Mrt=Je(_.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline"),kP=Je(_.jsx("path",{d:"M16 9v10H8V9zm-1.5-6h-5l-1 1H5v2h14V4h-3.5zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2z"}),"DeleteOutlined"),lle=Je(_.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),hz=Je(_.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),Art=Je(_.jsx("path",{d:"m12.126 8.125 1.937-1.937 3.747 3.747-1.937 1.938zM20.71 5.63l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75L20.71 7a1 1 0 0 0 0-1.37M2 5l6.63 6.63L3 17.25V21h3.75l5.63-5.62L18 21l2-2L4 3z"}),"EditOff"),Rrt=Je(_.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61"}),"FilterAlt"),Drt=Je(_.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m6 13h-5l-1-2H9.5v5H8V7h6l1 2h3z"}),"FlagCircle"),Dx=Je(_.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),cle=Je(_.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),ule=Je(_.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined"),_rt=Je(_.jsx("path",{d:"m14 6-3.75 5 2.85 3.8-1.6 1.2C9.81 13.75 7 10 7 10l-6 8h22z"}),"Landscape"),$rt=Je(_.jsx("path",{d:"m14 6-4.22 5.63 1.25 1.67L14 9.33 19 16h-8.46l-4.01-5.37L1 18h22zM5 16l1.52-2.03L8.04 16z"}),"LandscapeOutlined"),Nrt=Je([_.jsx("path",{d:"M5 16h3.04l-1.52-2.03z",opacity:".3"},"0"),_.jsx("path",{d:"m9.78 11.63 1.25 1.67L14 9.33 19 16h-8.46l-4.01-5.37L1 18h22L14 6zM5 16l1.52-2.03L8.04 16z"},"1")],"LandscapeTwoTone"),mz=Je(_.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),Lrt=Je(_.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),gz=Je(_.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),Frt=Je(_.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),jrt=Je(_.jsx("path",{d:"M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"}),"NorthEast"),Brt=Je([_.jsx("circle",{cx:"12",cy:"12",r:"3.2"},"0"),_.jsx("path",{d:"M9 2 7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5"},"1")],"PhotoCamera"),zrt=Je(_.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"}),"Redo"),Vrt=Je(_.jsx("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3m3-10H5V5h10z"}),"Save"),Hrt=Je([_.jsx("path",{d:"M9 15.5h6v1H9z"},"0"),_.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"1"),_.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"2"),_.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"3")],"SentimentNeutral"),Urt=Je([_.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),_.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),_.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"2"),_.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"3"),_.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-2.5c2.33 0 4.32-1.45 5.12-3.5h-1.67c-.69 1.19-1.97 2-3.45 2s-2.75-.81-3.45-2H6.88c.8 2.05 2.79 3.5 5.12 3.5"},"4")],"SentimentSatisfiedAlt"),Wrt=Je([_.jsx("circle",{cx:"15.5",cy:"9.5",r:"1.5"},"0"),_.jsx("circle",{cx:"8.5",cy:"9.5",r:"1.5"},"1"),_.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m0-6c-2.33 0-4.32 1.45-5.12 3.5h1.67c.69-1.19 1.97-2 3.45-2s2.75.81 3.45 2h1.67c-.8-2.05-2.79-3.5-5.12-3.5"},"2")],"SentimentVeryDissatisfied"),Grt=Je(_.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),qrt=Je(_.jsx("path",{d:"M19 9h-2v6.59L5.41 4 4 5.41 15.59 17H9v2h10z"}),"SouthEast"),Krt=Je(_.jsx("path",{d:"M21 5.47 12 12 7.62 7.62 3 11V8.52L7.83 5l4.38 4.38L21 3zM21 15h-4.7l-4.17 3.34L6 12.41l-3 2.13V17l2.8-2 6.2 6 5-4h4z"}),"SsidChart"),Yrt=Je(_.jsx("path",{d:"M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z"}),"SwapHoriz"),UT=e=>{if(e.query.isLoading)return b(wr,{});if(e.query.isError)return b(en,{sx:{height:200,alignItems:"center",mt:2},component:_t,direction:"column",justifyContent:"center",children:Q(Ii,{severity:"error",children:["Error while fetching data: ",e.query.error.message]})});if(e.query.isSuccess)return e.child},Qrt=e=>{var r;const t=e.avatarSize||40,n=e.iconSize||40;return b(Nl,{sx:{height:t,width:t},src:(r=e.image)==null?void 0:r.url,children:b(_u,{sx:{height:n,width:n}})})};function dle(){return br({queryKey:[st.EXERCISES],queryFn:QMe})}function Xrt(e){return br({queryKey:[st.EXERCISE_DETAIL,e],queryFn:()=>w0(e)})}function Jrt(e){const t=Et();return It({mutationFn:n=>D2(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function Zrt(e){const t=Et();return It({mutationFn:n=>tAe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function eot(e){const t=Et();return It({mutationFn:n=>iAe(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function tot(e){const t=Et();return It({mutationFn:n=>bte(n),onSuccess:()=>{t.invalidateQueries({queryKey:[st.EXERCISES]}),t.invalidateQueries({queryKey:[st.EXERCISE_DETAIL,e]})}})}function WT(){return br({queryKey:[st.CATEGORIES],queryFn:WMe})}function Yy(){return br({queryKey:[st.MUSCLES],queryFn:jMe})}function GT(){return br({queryKey:[st.EQUIPMENT],queryFn:VMe})}function $c(){return br({queryKey:[st.LANGUAGES],queryFn:oAe})}var wb={},bY;function not(){if(bY)return wb;bY=1,Object.defineProperty(wb,"__esModule",{value:!0}),wb.parse=a,wb.serialize=c;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,o=Object.prototype.toString,i=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function a(f,h){const g=new i,y=f.length;if(y<2)return g;const v=(h==null?void 0:h.decode)||u;let x=0;do{const S=f.indexOf("=",x);if(S===-1)break;const C=f.indexOf(";",x),I=C===-1?y:C;if(S>I){x=f.lastIndexOf(";",S-1)+1;continue}const E=s(f,x,S),T=l(f,S,E),O=f.slice(E,T);if(g[O]===void 0){let A=s(f,S+1,I),k=l(f,I,A);const M=v(f.slice(A,k));g[O]=M}x=I+1}while(x<y);return g}function s(f,h,g){do{const y=f.charCodeAt(h);if(y!==32&&y!==9)return h}while(++h<g);return g}function l(f,h,g){for(;h>g;){const y=f.charCodeAt(--h);if(y!==32&&y!==9)return h+1}return g}function c(f,h,g){const y=(g==null?void 0:g.encode)||encodeURIComponent;if(!e.test(f))throw new TypeError(`argument name is invalid: ${f}`);const v=y(h);if(!t.test(v))throw new TypeError(`argument val is invalid: ${h}`);let x=f+"="+v;if(!g)return x;if(g.maxAge!==void 0){if(!Number.isInteger(g.maxAge))throw new TypeError(`option maxAge is invalid: ${g.maxAge}`);x+="; Max-Age="+g.maxAge}if(g.domain){if(!n.test(g.domain))throw new TypeError(`option domain is invalid: ${g.domain}`);x+="; Domain="+g.domain}if(g.path){if(!r.test(g.path))throw new TypeError(`option path is invalid: ${g.path}`);x+="; Path="+g.path}if(g.expires){if(!d(g.expires)||!Number.isFinite(g.expires.valueOf()))throw new TypeError(`option expires is invalid: ${g.expires}`);x+="; Expires="+g.expires.toUTCString()}if(g.httpOnly&&(x+="; HttpOnly"),g.secure&&(x+="; Secure"),g.partitioned&&(x+="; Partitioned"),g.priority)switch(typeof g.priority=="string"?g.priority.toLowerCase():void 0){case"low":x+="; Priority=Low";break;case"medium":x+="; Priority=Medium";break;case"high":x+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${g.priority}`)}if(g.sameSite)switch(typeof g.sameSite=="string"?g.sameSite.toLowerCase():g.sameSite){case!0:case"strict":x+="; SameSite=Strict";break;case"lax":x+="; SameSite=Lax";break;case"none":x+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${g.sameSite}`)}return x}function u(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function d(f){return o.call(f)==="[object Date]"}return wb}not();/**@@ -377,7 +377,7 @@ attempted value: ${a}* @license MIT*/var wY="popstate";function rot(e={}){function t(r,o){let{pathname:i,search:a,hash:s}=r.location;return OL("",{pathname:i,search:a,hash:s},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:_x(o)}return iot(t,n,null,e)}function Gr(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ic(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function oot(){return Math.random().toString(36).substring(2,10)}function xY(e,t){return{usr:e.state,key:e.key,idx:t}}function OL(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Qy(t):t,state:n,key:t&&t.key||r||oot()}}function _x({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Qy(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function iot(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s="POP",l=null,c=u();c==null&&(c=0,a.replaceState({...a.state,idx:c},""));function u(){return(a.state||{idx:null}).idx}function d(){s="POP";let v=u(),x=v==null?null:v-c;c=v,l&&l({action:s,location:y.location,delta:x})}function f(v,x){s="PUSH";let S=OL(y.location,v,x);c=u()+1;let C=xY(S,c),I=y.createHref(S);try{a.pushState(C,"",I)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;o.location.assign(I)}i&&l&&l({action:s,location:y.location,delta:1})}function h(v,x){s="REPLACE";let S=OL(y.location,v,x);c=u();let C=xY(S,c),I=y.createHref(S);a.replaceState(C,"",I),i&&l&&l({action:s,location:y.location,delta:0})}function g(v){let x=o.location.origin!=="null"?o.location.origin:o.location.href,S=typeof v=="string"?v:_x(v);return S=S.replace(/ $/,"%20"),Gr(x,`No window.location.(origin|href) available to create URL for href: ${S}`),new URL(S,x)}let y={get action(){return s},get location(){return e(o,a)},listen(v){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(wY,d),l=v,()=>{o.removeEventListener(wY,d),l=null}},createHref(v){return t(o,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:h,go(v){return a.go(v)}};return y}function fle(e,t,n="/"){return aot(e,t,n,!1)}function aot(e,t,n,r){let o=typeof t=="string"?Qy(t):t,i=of(o.pathname||"/",n);if(i==null)return null;let a=ple(e);sot(a);let s=null;for(let l=0;s==null&&l<a.length;++l){let c=vot(i);s=got(a[l],c,r)}return s}function ple(e,t=[],n=[],r=""){let o=(i,a,s)=>{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(Gr(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length));let c=gu([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(Gr(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),ple(i.children,t,u,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:hot(c,i.index),routesMeta:u})};return e.forEach((i,a)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))o(i,a);else for(let l of hle(i.path))o(i,a,l)}),t}function hle(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=hle(r.join("/")),s=[];return s.push(...a.map(l=>l===""?i:[i,l].join("/"))),o&&s.push(...a),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function sot(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mot(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var lot=/^:[\w-]+$/,cot=3,uot=2,dot=1,fot=10,pot=-2,SY=e=>e==="*";function hot(e,t){let n=e.split("/"),r=n.length;return n.some(SY)&&(r+=pot),t&&(r+=uot),n.filter(o=>!SY(o)).reduce((o,i)=>o+(lot.test(i)?cot:i===""?dot:fot),r)}function mot(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function got(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",a=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",d=MP({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=MP({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;Object.assign(o,d.params),a.push({params:o,pathname:gu([i,d.pathname]),pathnameBase:Sot(gu([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=gu([i,d.pathnameBase]))}return a}function MP(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=yot(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:d},f)=>{if(u==="*"){let g=s[f]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const h=s[f];return d&&!h?c[u]=void 0:c[u]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:a,pattern:e}}function yot(e,t=!1,n=!0){Ic(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function vot(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ic(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function of(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function bot(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Qy(e):e;return{pathname:n?n.startsWith("/")?n:wot(n,t):t,search:Cot(r),hash:Eot(o)}}function wot(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function G_(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xot(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function mle(e){let t=xot(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function gle(e,t,n,r=!1){let o;typeof e=="string"?o=Qy(e):(o={...e},Gr(!o.pathname||!o.pathname.includes("?"),G_("?","pathname","search",o)),Gr(!o.pathname||!o.pathname.includes("#"),G_("#","pathname","hash",o)),Gr(!o.search||!o.search.includes("#"),G_("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,s;if(a==null)s=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}s=d>=0?t[d]:"/"}let l=bot(o,s),c=a&&a!=="/"&&a.endsWith("/"),u=(i||a===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var gu=e=>e.join("/").replace(/\/\/+/g,"/"),Sot=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Cot=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Eot=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pot(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var yle=["POST","PUT","PATCH","DELETE"];new Set(yle);var Iot=["GET",...yle];new Set(Iot);var Xy=w.createContext(null);Xy.displayName="DataRouter";var qT=w.createContext(null);qT.displayName="DataRouterState";var vle=w.createContext({isTransitioning:!1});vle.displayName="ViewTransition";var Tot=w.createContext(new Map);Tot.displayName="Fetchers";var Oot=w.createContext(null);Oot.displayName="Await";var Nc=w.createContext(null);Nc.displayName="Navigation";var G0=w.createContext(null);G0.displayName="Location";var Lc=w.createContext({outlet:null,matches:[],isDataRoute:!1});Lc.displayName="Route";var yz=w.createContext(null);yz.displayName="RouteError";function kot(e,{relative:t}={}){Gr(q0(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=w.useContext(Nc),{hash:o,pathname:i,search:a}=K0(e,{relative:t}),s=i;return n!=="/"&&(s=i==="/"?n:gu([n,i])),r.createHref({pathname:s,search:a,hash:o})}function q0(){return w.useContext(G0)!=null}function vh(){return Gr(q0(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(G0).location}var ble="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wle(e){w.useContext(Nc).static||w.useLayoutEffect(e)}function zu(){let{isDataRoute:e}=w.useContext(Lc);return e?Vot():Mot()}function Mot(){Gr(q0(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(Xy),{basename:t,navigator:n}=w.useContext(Nc),{matches:r}=w.useContext(Lc),{pathname:o}=vh(),i=JSON.stringify(mle(r)),a=w.useRef(!1);return wle(()=>{a.current=!0}),w.useCallback((l,c={})=>{if(Ic(a.current,ble),!a.current)return;if(typeof l=="number"){n.go(l);return}let u=gle(l,JSON.parse(i),o,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:gu([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,i,o,e])}w.createContext(null);function Ea(){let{matches:e}=w.useContext(Lc),t=e[e.length-1];return t?t.params:{}}function K0(e,{relative:t}={}){let{matches:n}=w.useContext(Lc),{pathname:r}=vh(),o=JSON.stringify(mle(n));return w.useMemo(()=>gle(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function Aot(e,t){return xle(e,t)}function xle(e,t,n,r){var S;Gr(q0(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o,static:i}=w.useContext(Nc),{matches:a}=w.useContext(Lc),s=a[a.length-1],l=s?s.params:{},c=s?s.pathname:"/",u=s?s.pathnameBase:"/",d=s&&s.route;{let C=d&&d.path||"";Sle(c,!d||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.-Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let f=vh(),h;if(t){let C=typeof t=="string"?Qy(t):t;Gr(u==="/"||((S=C.pathname)==null?void 0:S.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${C.pathname}" was given in the \`location\` prop.`),h=C}else h=f;let g=h.pathname||"/",y=g;if(u!=="/"){let C=u.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(C.length).join("/")}let v=!i&&n&&n.matches&&n.matches.length>0?n.matches:fle(e,{pathname:y});Ic(d||v!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Ic(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=Not(v&&v.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:gu([u,o.encodeLocation?o.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?u:gu([u,o.encodeLocation?o.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return t&&x?w.createElement(G0.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},x):x}function Rot(){let e=zot(),t=Pot(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:i},"ErrorBoundary")," or"," ",w.createElement("code",{style:i},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:o},n):null,a)}var Dot=w.createElement(Rot,null),_ot=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?w.createElement(Lc.Provider,{value:this.props.routeContext},w.createElement(yz.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $ot({routeContext:e,match:t,children:n}){let r=w.useContext(Xy);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Lc.Provider,{value:e},n)}function Not(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let l=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);Gr(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,l+1))}let a=!1,s=-1;if(n)for(let l=0;l<o.length;l++){let c=o[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=l),c.route.id){let{loaderData:u,errors:d}=n,f=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){a=!0,s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((l,c,u)=>{let d,f=!1,h=null,g=null;n&&(d=i&&c.route.id?i[c.route.id]:void 0,h=c.route.errorElement||Dot,a&&(s<0&&u===0?(Sle("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):s===u&&(f=!0,g=c.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,u+1)),v=()=>{let x;return d?x=h:f?x=g:c.route.Component?x=w.createElement(c.route.Component,null):c.route.element?x=c.route.element:x=l,w.createElement($ot,{match:c,routeContext:{outlet:l,matches:y,isDataRoute:n!=null},children:x})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?w.createElement(_ot,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}function vz(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lot(e){let t=w.useContext(Xy);return Gr(t,vz(e)),t}function Fot(e){let t=w.useContext(qT);return Gr(t,vz(e)),t}function jot(e){let t=w.useContext(Lc);return Gr(t,vz(e)),t}function bz(e){let t=jot(e),n=t.matches[t.matches.length-1];return Gr(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Bot(){return bz("useRouteId")}function zot(){var r;let e=w.useContext(yz),t=Fot("useRouteError"),n=bz("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Vot(){let{router:e}=Lot("useNavigate"),t=bz("useNavigate"),n=w.useRef(!1);return wle(()=>{n.current=!0}),w.useCallback(async(o,i={})=>{Ic(n.current,ble),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var CY={};function Sle(e,t,n){!t&&!CY[e]&&(CY[e]=!0,Ic(!1,n))}w.memo(Hot);function Hot({routes:e,future:t,state:n}){return xle(e,void 0,n,t)}function Ut(e){Gr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Uot({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1}){Gr(!q0(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),s=w.useMemo(()=>({basename:a,navigator:o,static:i,future:{}}),[a,o,i]);typeof n=="string"&&(n=Qy(n));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:f="default"}=n,h=w.useMemo(()=>{let g=of(l,a);return g==null?null:{location:{pathname:g,search:c,hash:u,state:d,key:f},navigationType:r}},[a,l,c,u,d,f,r]);return Ic(h!=null,`<Router basename="${a}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:w.createElement(Nc.Provider,{value:s},w.createElement(G0.Provider,{children:t,value:h}))}function Wot({children:e,location:t}){return Aot(kL(e),t)}function kL(e,t=[]){let n=[];return w.Children.forEach(e,(r,o)=>{if(!w.isValidElement(r))return;let i=[...t,o];if(r.type===w.Fragment){n.push.apply(n,kL(r.props.children,i));return}Gr(r.type===Ut,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Gr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=kL(r.props.children,i)),n.push(a)}),n}var j1="get",B1="application/x-www-form-urlencoded";function KT(e){return e!=null&&typeof e.tagName=="string"}function Got(e){return KT(e)&&e.tagName.toLowerCase()==="button"}function qot(e){return KT(e)&&e.tagName.toLowerCase()==="form"}function Kot(e){return KT(e)&&e.tagName.toLowerCase()==="input"}function Yot(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qot(e,t){return e.button===0&&(!t||t==="_self")&&!Yot(e)}var o1=null;function Xot(){if(o1===null)try{new FormData(document.createElement("form"),0),o1=!1}catch{o1=!0}return o1}var Jot=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function q_(e){return e!=null&&!Jot.has(e)?(Ic(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${B1}"`),null):e}function Zot(e,t){let n,r,o,i,a;if(qot(e)){let s=e.getAttribute("action");r=s?of(s,t):null,n=e.getAttribute("method")||j1,o=q_(e.getAttribute("enctype"))||B1,i=new FormData(e)}else if(Got(e)||Kot(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(r=l?of(l,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||j1,o=q_(e.getAttribute("formenctype"))||q_(s.getAttribute("enctype"))||B1,i=new FormData(s,e),!Xot()){let{name:c,type:u,value:d}=e;if(u==="image"){let f=c?`${c}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}else c&&i.append(c,d)}}else{if(KT(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=j1,r=null,o=B1,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}function wz(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function eit(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tit(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function nit(e,t,n){let r=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await eit(i,n);return a.links?a.links():[]}return[]}));return ait(r.flat(1).filter(tit).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function EY(e,t,n,r,o,i){let a=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,s=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return i==="assets"?t.filter((l,c)=>a(l,c)||s(l,c)):i==="data"?t.filter((l,c)=>{var d;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(a(l,c)||s(l,c))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function rit(e,t){return oit(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let o=[r.module];return r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function oit(e){return[...new Set(e)]}function iit(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ait(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let i=JSON.stringify(iit(o));return n.has(i)||(n.add(i),r.push({key:i,link:o})),r},[])}function sit(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function lit(){let e=w.useContext(Xy);return wz(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function cit(){let e=w.useContext(qT);return wz(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var xz=w.createContext(void 0);xz.displayName="FrameworkContext";function Cle(){let e=w.useContext(xz);return wz(e,"You must render this element inside a <HydratedRouter> element"),e}function uit(e,t){let n=w.useContext(xz),[r,o]=w.useState(!1),[i,a]=w.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,f=w.useRef(null);w.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let y=x=>{x.forEach(S=>{a(S.isIntersecting)})},v=new IntersectionObserver(y,{threshold:.5});return f.current&&v.observe(f.current),()=>{v.disconnect()}}},[e]),w.useEffect(()=>{if(r){let y=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(y)}}},[r]);let h=()=>{o(!0)},g=()=>{o(!1),a(!1)};return n?e!=="intent"?[i,f,{}]:[i,f,{onFocus:xb(s,h),onBlur:xb(l,g),onMouseEnter:xb(c,h),onMouseLeave:xb(u,g),onTouchStart:xb(d,h)}]:[!1,f,{}]}function xb(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dit({page:e,...t}){let{router:n}=lit(),r=w.useMemo(()=>fle(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(pit,{page:e,matches:r,...t}):null}function fit(e){let{manifest:t,routeModules:n}=Cle(),[r,o]=w.useState([]);return w.useEffect(()=>{let i=!1;return nit(e,t,n).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,n]),r}function pit({page:e,matches:t,...n}){let r=vh(),{manifest:o,routeModules:i}=Cle(),{loaderData:a,matches:s}=cit(),l=w.useMemo(()=>EY(e,t,s,o,r,"data"),[e,t,s,o,r]),c=w.useMemo(()=>EY(e,t,s,o,r,"assets"),[e,t,s,o,r]),u=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let h=new Set,g=!1;if(t.forEach(v=>{var S;let x=o.routes[v.route.id];!x||!x.hasLoader||(!l.some(C=>C.route.id===v.route.id)&&v.route.id in a&&((S=i[v.route.id])!=null&&S.shouldRevalidate)||x.hasClientLoader?g=!0:h.add(v.route.id))}),h.size===0)return[];let y=sit(e);return g&&h.size>0&&y.searchParams.set("_routes",t.filter(v=>h.has(v.route.id)).map(v=>v.route.id).join(",")),[y.pathname+y.search]},[a,r,o,l,t,e,i]),d=w.useMemo(()=>rit(c,o),[c,o]),f=fit(c);return w.createElement(w.Fragment,null,u.map(h=>w.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...n})),d.map(h=>w.createElement("link",{key:h,rel:"modulepreload",href:h,...n})),f.map(({key:h,link:g})=>w.createElement("link",{key:h,...g})))}function hit(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Ele=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ele&&(window.__reactRouterVersion="7.1.5")}catch{}function Sz({basename:e,children:t,window:n}){let r=w.useRef();r.current==null&&(r.current=rot({window:n,v5Compat:!0}));let o=r.current,[i,a]=w.useState({action:o.action,location:o.location}),s=w.useCallback(l=>{w.startTransition(()=>a(l))},[a]);return w.useLayoutEffect(()=>o.listen(s),[o,s]),w.createElement(Uot,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o})}var Ple=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,io=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:i,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d,...f},h){let{basename:g}=w.useContext(Nc),y=typeof c=="string"&&Ple.test(c),v,x=!1;if(typeof c=="string"&&y&&(v=c,Ele))try{let k=new URL(window.location.href),M=c.startsWith("//")?new URL(k.protocol+c):new URL(c),R=of(M.pathname,g);M.origin===k.origin&&R!=null?c=R+M.search+M.hash:x=!0}catch{Ic(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let S=kot(c,{relative:o}),[C,I,E]=uit(r,f),T=vit(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:o,viewTransition:d});function O(k){t&&t(k),k.defaultPrevented||T(k)}let A=w.createElement("a",{...f,...E,href:v||S,onClick:x||i?t:O,ref:hit(h,I),target:l,"data-discover":!y&&n==="render"?"true":void 0});return C&&!y?w.createElement(w.Fragment,null,A,w.createElement(dit,{page:S})):A});io.displayName="Link";var mit=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...c},u){let d=K0(a,{relative:c.relative}),f=vh(),h=w.useContext(qT),{navigator:g,basename:y}=w.useContext(Nc),v=h!=null&&Cit(d)&&s===!0,x=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,S=f.pathname,C=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(S=S.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&y&&(C=of(C,y)||C);const I=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let E=S===x||!o&&S.startsWith(x)&&S.charAt(I)==="/",T=C!=null&&(C===x||!o&&C.startsWith(x)&&C.charAt(x.length)==="/"),O={isActive:E,isPending:T,isTransitioning:v},A=E?t:void 0,k;typeof r=="function"?k=r(O):k=[r,E?"active":null,T?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(O):i;return w.createElement(io,{...c,"aria-current":A,className:k,ref:u,style:M,to:a,viewTransition:s},typeof l=="function"?l(O):l)});mit.displayName="NavLink";var git=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:a=j1,action:s,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let g=xit(),y=Sit(s,{relative:c}),v=a.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&Ple.test(s),S=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let I=C.nativeEvent.submitter,E=(I==null?void 0:I.getAttribute("formmethod"))||a;g(I||C.currentTarget,{fetcherKey:t,method:E,navigate:n,replace:o,state:i,relative:c,preventScrollReset:u,viewTransition:d})};return w.createElement("form",{ref:h,method:v,action:y,onSubmit:r?l:S,...f,"data-discover":!x&&e==="render"?"true":void 0})});git.displayName="Form";function yit(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ile(e){let t=w.useContext(Xy);return Gr(t,yit(e)),t}function vit(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:a}={}){let s=zu(),l=vh(),c=K0(e,{relative:i});return w.useCallback(u=>{if(Qot(u,t)){u.preventDefault();let d=n!==void 0?n:_x(l)===_x(c);s(e,{replace:d,state:r,preventScrollReset:o,relative:i,viewTransition:a})}},[l,s,c,n,r,t,e,o,i,a])}var bit=0,wit=()=>`__${String(++bit)}__`;function xit(){let{router:e}=Ile("useSubmit"),{basename:t}=w.useContext(Nc),n=Bot();return w.useCallback(async(r,o={})=>{let{action:i,method:a,encType:s,formData:l,body:c}=Zot(r,t);if(o.navigate===!1){let u=o.fetcherKey||wit();await e.fetch(u,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function Sit(e,{relative:t}={}){let{basename:n}=w.useContext(Nc),r=w.useContext(Lc);Gr(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...K0(e||".",{relative:t})},a=vh();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(u=>u==="")){s.delete("index"),l.filter(d=>d).forEach(d=>s.append("index",d));let u=s.toString();i.search=u?`?${u}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:gu([n,i.pathname])),_x(i)}function Cit(e,t={}){let n=w.useContext(vle);Gr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ile("useViewTransitionState"),o=K0(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=of(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=of(n.nextLocation.pathname,r)||n.nextLocation.pathname;return MP(o.pathname,a)!=null||MP(o.pathname,i)!=null}new TextEncoder;const Eit=()=>{var r,o;const e=Ea(),t=parseInt(e.routineId??"");if(Number.isNaN(t))return b("p",{children:"Please pass an integer as the routine id."});const n=_c(t);return b(Iu,{maxWidth:"lg",children:b(UT,{query:n,child:n.isSuccess&&Q(xt,{children:[((r=n.data)==null?void 0:r.description)!==""&&b(tt,{variant:"body2",sx:{whiteSpace:"pre-line"},children:(o=n.data)==null?void 0:o.description}),b(_t,{spacing:2,sx:{mt:2},children:n.data.dayDataCurrentIteration.filter(i=>i.day!==null).map((i,a)=>b(Cz,{routineId:t,dayData:i},`dayDetails-${a}`))})]})})})};function Tle(e){var o;const{i18n:t}=Re(),n=$c();let r;return n.isSuccess&&(r=Tu(t.language,n.data)),b(ye,{container:!0,alignItems:"center",justifyContent:"center",sx:{height:e.rowHeight,marginBottom:e.marginBottom},children:b(ye,{size:12,children:Q(_t,{spacing:0,children:[b(tt,{variant:"h6",children:e.showExercise?(o=e.setConfigData.exercise)==null?void 0:o.getTranslation(r).name:""}),Q("div",{children:[e.setConfigData.textRepr,e.setConfigData.isSpecialType&&b(Pu,{label:e.setConfigData.type,color:"info",size:"small",sx:{marginLeft:"0.5em"}})]}),b(tt,{variant:"caption",children:e.setConfigData.comment})]})})})}function Pit(e){return Q(ye,{container:!0,justifyContent:"space-between",alignItems:"flex-start",children:[b(ye,{size:1,children:b(_t,{divider:b(en,{height:"10px"}),children:e.slotData.exercises.map((t,n)=>b(Qrt,{image:t.mainImage,iconSize:40,avatarSize:50},n))})}),b(ye,{size:11,children:e.slotData.setConfigs.map((t,n)=>{var o;const r=n===0||t.exerciseId!==((o=e.slotData.setConfigs[n-1])==null?void 0:o.exerciseId);return b(Tle,{setConfigData:t,marginBottom:"1em",showExercise:r},n)})})]})}const Cz=e=>{var i;const t=(e.readOnly??!1)||e.dayData.day===null||e.dayData.day.isRest,n=Lr(),[r,o]=Re();return Q(fo,{sx:{minWidth:275},children:[b(Vl,{sx:{bgcolor:n.palette.grey.A200},action:e.dayData.day===null||e.dayData.day.isRest||t?null:b(Do,{title:r("routines.addWeightLog"),children:b(on,{href:Qt(Kt.ROUTINE_ADD_LOG,o.language,{id:e.routineId,id2:e.dayData.day.id}),children:b(yrt,{})})}),title:Ite(e.dayData.day),avatar:kl(e.dayData.date,new Date)?b(Zse,{}):void 0,subheader:b(tt,{sx:{whiteSpace:"pre-line"},children:(i=e.dayData.day)==null?void 0:i.description})}),e.dayData.slots.length>0&&b(Pi,{sx:{padding:0,marginBottom:0},children:b(_t,{children:e.dayData.slots.map((a,s)=>Q("div",{children:[b(en,{padding:1,children:b(Pit,{slotData:a,index:s})}),b(Ti,{})]},s))})})]})},Ole=()=>{const[e,t]=Re(),n=Int();return n.isLoading?b(wr,{}):n.data!==null?b(Iit,{routine:n.data}):b(rj,{title:e("routines.routine"),link:Qt(Kt.ROUTINE_ADD,t.language)})},Iit=e=>{const[t,n]=Re();return Q(fo,{children:[b(Vl,{title:t("routines.routine"),subheader:e.routine.name??"."}),b(Pi,{sx:{height:"510px",overflow:"auto"},children:b(xa,{children:e.routine.dayDataCurrentIteration.filter(r=>r.day!==null).map((r,o)=>b(Tit,{dayData:r},o))})}),b(Ys,{children:b(at,{size:"small",href:Qt(Kt.ROUTINE_DETAIL,n.language,{id:e.routine.id}),children:t("seeDetails")})})]})},Tit=e=>{var i,a;const[t,n]=w.useState(!1),{t:r}=Re();return Q(xt,{children:[Q(mf,{onClick:()=>n(!t),selected:t,disabled:e.dayData.day===null||((i=e.dayData.day)==null?void 0:i.isRest),children:[b(si,{children:t?b(kee,{}):b(xy,{})}),b(uo,{primary:Ite(e.dayData.day),slotProps:{secondary:{noWrap:!0,style:{overflow:"hidden",textOverflow:"ellipsis"}}},secondary:(a=e.dayData.day)==null?void 0:a.description}),b(si,{children:kl(e.dayData.date,new Date)?b(Zse,{}):void 0})]}),b(Ls,{in:t,timeout:"auto",unmountOnExit:!0,children:e.dayData.slots.map((s,l)=>b("div",{children:s.setConfigs.map((c,u)=>b(Tle,{setConfigData:c,rowHeight:"70px",showExercise:!0},u))},l))})]})};function Y0(e="lastWeek"){return br({queryKey:[st.BODY_WEIGHT,e],queryFn:()=>MMe(e)})}const Oit=()=>{const e=Et();return It({mutationFn:t=>AMe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},kit=()=>{const e=Et();return It({mutationFn:t=>DMe(t),onError:t=>{console.log(t)},onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},Mit=()=>{const e=Et();return It({mutationFn:t=>RMe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})}})},Jy=({weightEntry:e,closeFn:t})=>{const n=Y0(),r=kit(),o=Mit(),[i,a]=w.useState(e?yt.fromJSDate(e.date):yt.now),[s,l]=Re(),c=_o({weight:wo().min(30,"Min weight is 30 kg").max(300,"Max weight is 300 kg").required("Weight field is required")});return n.isLoading?b(wr,{}):b(ci,{initialValues:{weight:e?e.weight:0,date:co(e?e.date:new Date)},validationSchema:c,onSubmit:async u=>{if(e){e.weight=u.weight,e.date=new Date(u.date);try{o.mutate(e)}catch{}}else{e=new lte(new Date(u.date),u.weight);try{r.mutate(e)}catch{}}t&&t()},children:u=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"weight",label:s("weight"),error:u.touched.weight&&!!u.touched.weight,helperText:u.touched.weight&&u.errors.weight,...u.getFieldProps("weight")}),b(vc,{dateAdapter:pu,adapterLocale:l.language,children:b(kx,{format:"yyyy-MM-dd",label:s("date"),value:i,slotProps:{textField:{variant:"outlined"}},disableFuture:!0,onChange:d=>{d&&u.setFieldValue("date",d.toJSDate()),a(d)},shouldDisableDate:d=>e&&co(e.date)===d.toISODate()?!1:d?n.data.some(f=>co(f.date)===d.toISODate()):!1})}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:s("submit")})})]})})})},Ait=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function Rit(e={}){const{disableGlobal:t=!1,productionPrefix:n="jss",seed:r=""}=e,o=r===""?"":`${r}-`;let i=0;const a=()=>(i+=1,i);return(s,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!t){if(Ait.includes(s.key))return`Mui-${s.key}`;const u=`${o}${c}-${s.key}`;return!l.options.theme[dZ]||r!==""?u:`${u}-${a()}`}return`${o}${n}${a()}`}}var PY=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q0=(typeof window>"u"?"undefined":PY(window))==="object"&&(typeof document>"u"?"undefined":PY(document))==="object"&&document.nodeType===9;function $x(e){"@babel/helpers - typeof";return $x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$x(e)}function Dit(e,t){if($x(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($x(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ey(e){var t=Dit(e,"string");return $x(t)=="symbol"?t:t+""}function _it(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ey(r.key),r)}}function kle(e,t,n){return t&&_it(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var $it={}.constructor;function ML(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ML);if(e.constructor!==$it)return e;var t={};for(var n in e)t[n]=ML(e[n]);return t}function Ez(e,t,n){e===void 0&&(e="unnamed");var r=n.jss,o=ML(t),i=r.plugins.onCreateRule(e,o,n);return i||(e[0],null)}var IY=function(t,n){for(var r="",o=0;o<t.length&&t[o]!=="!important";o++)r&&(r+=n),r+=t[o];return r},_p=function(t){if(!Array.isArray(t))return t;var n="";if(Array.isArray(t[0]))for(var r=0;r<t.length&&t[r]!=="!important";r++)n&&(n+=", "),n+=IY(t[r]," ");else n=IY(t,", ");return t[t.length-1]==="!important"&&(n+=" !important"),n};function Zy(e){return e&&e.format===!1?{linebreak:"",space:""}:{linebreak:`+Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let f=vh(),h;if(t){let C=typeof t=="string"?Qy(t):t;Gr(u==="/"||((S=C.pathname)==null?void 0:S.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${C.pathname}" was given in the \`location\` prop.`),h=C}else h=f;let g=h.pathname||"/",y=g;if(u!=="/"){let C=u.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(C.length).join("/")}let v=!i&&n&&n.matches&&n.matches.length>0?n.matches:fle(e,{pathname:y});Ic(d||v!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Ic(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=Not(v&&v.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:gu([u,o.encodeLocation?o.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?u:gu([u,o.encodeLocation?o.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,r);return t&&x?w.createElement(G0.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},x):x}function Rot(){let e=zot(),t=Pot(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:i},"ErrorBoundary")," or"," ",w.createElement("code",{style:i},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:o},n):null,a)}var Dot=w.createElement(Rot,null),_ot=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?w.createElement(Lc.Provider,{value:this.props.routeContext},w.createElement(yz.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $ot({routeContext:e,match:t,children:n}){let r=w.useContext(Xy);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Lc.Provider,{value:e},n)}function Not(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let l=o.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);Gr(l>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,l+1))}let a=!1,s=-1;if(n)for(let l=0;l<o.length;l++){let c=o[l];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(s=l),c.route.id){let{loaderData:u,errors:d}=n,f=c.route.loader&&!u.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){a=!0,s>=0?o=o.slice(0,s+1):o=[o[0]];break}}}return o.reduceRight((l,c,u)=>{let d,f=!1,h=null,g=null;n&&(d=i&&c.route.id?i[c.route.id]:void 0,h=c.route.errorElement||Dot,a&&(s<0&&u===0?(Sle("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,g=null):s===u&&(f=!0,g=c.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,u+1)),v=()=>{let x;return d?x=h:f?x=g:c.route.Component?x=w.createElement(c.route.Component,null):c.route.element?x=c.route.element:x=l,w.createElement($ot,{match:c,routeContext:{outlet:l,matches:y,isDataRoute:n!=null},children:x})};return n&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?w.createElement(_ot,{location:n.location,revalidation:n.revalidation,component:h,error:d,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}function vz(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lot(e){let t=w.useContext(Xy);return Gr(t,vz(e)),t}function Fot(e){let t=w.useContext(qT);return Gr(t,vz(e)),t}function jot(e){let t=w.useContext(Lc);return Gr(t,vz(e)),t}function bz(e){let t=jot(e),n=t.matches[t.matches.length-1];return Gr(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Bot(){return bz("useRouteId")}function zot(){var r;let e=w.useContext(yz),t=Fot("useRouteError"),n=bz("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Vot(){let{router:e}=Lot("useNavigate"),t=bz("useNavigate"),n=w.useRef(!1);return wle(()=>{n.current=!0}),w.useCallback(async(o,i={})=>{Ic(n.current,ble),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var CY={};function Sle(e,t,n){!t&&!CY[e]&&(CY[e]=!0,Ic(!1,n))}w.memo(Hot);function Hot({routes:e,future:t,state:n}){return xle(e,void 0,n,t)}function Ut(e){Gr(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Uot({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1}){Gr(!q0(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),s=w.useMemo(()=>({basename:a,navigator:o,static:i,future:{}}),[a,o,i]);typeof n=="string"&&(n=Qy(n));let{pathname:l="/",search:c="",hash:u="",state:d=null,key:f="default"}=n,h=w.useMemo(()=>{let g=of(l,a);return g==null?null:{location:{pathname:g,search:c,hash:u,state:d,key:f},navigationType:r}},[a,l,c,u,d,f,r]);return Ic(h!=null,`<Router basename="${a}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:w.createElement(Nc.Provider,{value:s},w.createElement(G0.Provider,{children:t,value:h}))}function Wot({children:e,location:t}){return Aot(kL(e),t)}function kL(e,t=[]){let n=[];return w.Children.forEach(e,(r,o)=>{if(!w.isValidElement(r))return;let i=[...t,o];if(r.type===w.Fragment){n.push.apply(n,kL(r.props.children,i));return}Gr(r.type===Ut,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Gr(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=kL(r.props.children,i)),n.push(a)}),n}var j1="get",B1="application/x-www-form-urlencoded";function KT(e){return e!=null&&typeof e.tagName=="string"}function Got(e){return KT(e)&&e.tagName.toLowerCase()==="button"}function qot(e){return KT(e)&&e.tagName.toLowerCase()==="form"}function Kot(e){return KT(e)&&e.tagName.toLowerCase()==="input"}function Yot(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Qot(e,t){return e.button===0&&(!t||t==="_self")&&!Yot(e)}var o1=null;function Xot(){if(o1===null)try{new FormData(document.createElement("form"),0),o1=!1}catch{o1=!0}return o1}var Jot=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function q_(e){return e!=null&&!Jot.has(e)?(Ic(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${B1}"`),null):e}function Zot(e,t){let n,r,o,i,a;if(qot(e)){let s=e.getAttribute("action");r=s?of(s,t):null,n=e.getAttribute("method")||j1,o=q_(e.getAttribute("enctype"))||B1,i=new FormData(e)}else if(Got(e)||Kot(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(r=l?of(l,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||j1,o=q_(e.getAttribute("formenctype"))||q_(s.getAttribute("enctype"))||B1,i=new FormData(s,e),!Xot()){let{name:c,type:u,value:d}=e;if(u==="image"){let f=c?`${c}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}else c&&i.append(c,d)}}else{if(KT(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=j1,r=null,o=B1,a=e}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}function wz(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function eit(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tit(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function nit(e,t,n){let r=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let a=await eit(i,n);return a.links?a.links():[]}return[]}));return ait(r.flat(1).filter(tit).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function EY(e,t,n,r,o,i){let a=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,s=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return i==="assets"?t.filter((l,c)=>a(l,c)||s(l,c)):i==="data"?t.filter((l,c)=>{var d;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(a(l,c)||s(l,c))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function rit(e,t){return oit(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let o=[r.module];return r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function oit(e){return[...new Set(e)]}function iit(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ait(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let i=JSON.stringify(iit(o));return n.has(i)||(n.add(i),r.push({key:i,link:o})),r},[])}function sit(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function lit(){let e=w.useContext(Xy);return wz(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function cit(){let e=w.useContext(qT);return wz(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var xz=w.createContext(void 0);xz.displayName="FrameworkContext";function Cle(){let e=w.useContext(xz);return wz(e,"You must render this element inside a <HydratedRouter> element"),e}function uit(e,t){let n=w.useContext(xz),[r,o]=w.useState(!1),[i,a]=w.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,f=w.useRef(null);w.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let y=x=>{x.forEach(S=>{a(S.isIntersecting)})},v=new IntersectionObserver(y,{threshold:.5});return f.current&&v.observe(f.current),()=>{v.disconnect()}}},[e]),w.useEffect(()=>{if(r){let y=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(y)}}},[r]);let h=()=>{o(!0)},g=()=>{o(!1),a(!1)};return n?e!=="intent"?[i,f,{}]:[i,f,{onFocus:xb(s,h),onBlur:xb(l,g),onMouseEnter:xb(c,h),onMouseLeave:xb(u,g),onTouchStart:xb(d,h)}]:[!1,f,{}]}function xb(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dit({page:e,...t}){let{router:n}=lit(),r=w.useMemo(()=>fle(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(pit,{page:e,matches:r,...t}):null}function fit(e){let{manifest:t,routeModules:n}=Cle(),[r,o]=w.useState([]);return w.useEffect(()=>{let i=!1;return nit(e,t,n).then(a=>{i||o(a)}),()=>{i=!0}},[e,t,n]),r}function pit({page:e,matches:t,...n}){let r=vh(),{manifest:o,routeModules:i}=Cle(),{loaderData:a,matches:s}=cit(),l=w.useMemo(()=>EY(e,t,s,o,r,"data"),[e,t,s,o,r]),c=w.useMemo(()=>EY(e,t,s,o,r,"assets"),[e,t,s,o,r]),u=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let h=new Set,g=!1;if(t.forEach(v=>{var S;let x=o.routes[v.route.id];!x||!x.hasLoader||(!l.some(C=>C.route.id===v.route.id)&&v.route.id in a&&((S=i[v.route.id])!=null&&S.shouldRevalidate)||x.hasClientLoader?g=!0:h.add(v.route.id))}),h.size===0)return[];let y=sit(e);return g&&h.size>0&&y.searchParams.set("_routes",t.filter(v=>h.has(v.route.id)).map(v=>v.route.id).join(",")),[y.pathname+y.search]},[a,r,o,l,t,e,i]),d=w.useMemo(()=>rit(c,o),[c,o]),f=fit(c);return w.createElement(w.Fragment,null,u.map(h=>w.createElement("link",{key:h,rel:"prefetch",as:"fetch",href:h,...n})),d.map(h=>w.createElement("link",{key:h,rel:"modulepreload",href:h,...n})),f.map(({key:h,link:g})=>w.createElement("link",{key:h,...g})))}function hit(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Ele=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ele&&(window.__reactRouterVersion="7.1.5")}catch{}function Sz({basename:e,children:t,window:n}){let r=w.useRef();r.current==null&&(r.current=rot({window:n,v5Compat:!0}));let o=r.current,[i,a]=w.useState({action:o.action,location:o.location}),s=w.useCallback(l=>{w.startTransition(()=>a(l))},[a]);return w.useLayoutEffect(()=>o.listen(s),[o,s]),w.createElement(Uot,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o})}var Ple=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lo=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:i,replace:a,state:s,target:l,to:c,preventScrollReset:u,viewTransition:d,...f},h){let{basename:g}=w.useContext(Nc),y=typeof c=="string"&&Ple.test(c),v,x=!1;if(typeof c=="string"&&y&&(v=c,Ele))try{let k=new URL(window.location.href),M=c.startsWith("//")?new URL(k.protocol+c):new URL(c),R=of(M.pathname,g);M.origin===k.origin&&R!=null?c=R+M.search+M.hash:x=!0}catch{Ic(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let S=kot(c,{relative:o}),[C,I,E]=uit(r,f),T=vit(c,{replace:a,state:s,target:l,preventScrollReset:u,relative:o,viewTransition:d});function O(k){t&&t(k),k.defaultPrevented||T(k)}let A=w.createElement("a",{...f,...E,href:v||S,onClick:x||i?t:O,ref:hit(h,I),target:l,"data-discover":!y&&n==="render"?"true":void 0});return C&&!y?w.createElement(w.Fragment,null,A,w.createElement(dit,{page:S})):A});lo.displayName="Link";var mit=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:i,to:a,viewTransition:s,children:l,...c},u){let d=K0(a,{relative:c.relative}),f=vh(),h=w.useContext(qT),{navigator:g,basename:y}=w.useContext(Nc),v=h!=null&&Cit(d)&&s===!0,x=g.encodeLocation?g.encodeLocation(d).pathname:d.pathname,S=f.pathname,C=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(S=S.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&y&&(C=of(C,y)||C);const I=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let E=S===x||!o&&S.startsWith(x)&&S.charAt(I)==="/",T=C!=null&&(C===x||!o&&C.startsWith(x)&&C.charAt(x.length)==="/"),O={isActive:E,isPending:T,isTransitioning:v},A=E?t:void 0,k;typeof r=="function"?k=r(O):k=[r,E?"active":null,T?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let M=typeof i=="function"?i(O):i;return w.createElement(lo,{...c,"aria-current":A,className:k,ref:u,style:M,to:a,viewTransition:s},typeof l=="function"?l(O):l)});mit.displayName="NavLink";var git=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:a=j1,action:s,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let g=xit(),y=Sit(s,{relative:c}),v=a.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&Ple.test(s),S=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let I=C.nativeEvent.submitter,E=(I==null?void 0:I.getAttribute("formmethod"))||a;g(I||C.currentTarget,{fetcherKey:t,method:E,navigate:n,replace:o,state:i,relative:c,preventScrollReset:u,viewTransition:d})};return w.createElement("form",{ref:h,method:v,action:y,onSubmit:r?l:S,...f,"data-discover":!x&&e==="render"?"true":void 0})});git.displayName="Form";function yit(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ile(e){let t=w.useContext(Xy);return Gr(t,yit(e)),t}function vit(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:a}={}){let s=zu(),l=vh(),c=K0(e,{relative:i});return w.useCallback(u=>{if(Qot(u,t)){u.preventDefault();let d=n!==void 0?n:_x(l)===_x(c);s(e,{replace:d,state:r,preventScrollReset:o,relative:i,viewTransition:a})}},[l,s,c,n,r,t,e,o,i,a])}var bit=0,wit=()=>`__${String(++bit)}__`;function xit(){let{router:e}=Ile("useSubmit"),{basename:t}=w.useContext(Nc),n=Bot();return w.useCallback(async(r,o={})=>{let{action:i,method:a,encType:s,formData:l,body:c}=Zot(r,t);if(o.navigate===!1){let u=o.fetcherKey||wit();await e.fetch(u,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function Sit(e,{relative:t}={}){let{basename:n}=w.useContext(Nc),r=w.useContext(Lc);Gr(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...K0(e||".",{relative:t})},a=vh();if(e==null){i.search=a.search;let s=new URLSearchParams(i.search),l=s.getAll("index");if(l.some(u=>u==="")){s.delete("index"),l.filter(d=>d).forEach(d=>s.append("index",d));let u=s.toString();i.search=u?`?${u}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:gu([n,i.pathname])),_x(i)}function Cit(e,t={}){let n=w.useContext(vle);Gr(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ile("useViewTransitionState"),o=K0(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=of(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=of(n.nextLocation.pathname,r)||n.nextLocation.pathname;return MP(o.pathname,a)!=null||MP(o.pathname,i)!=null}new TextEncoder;const Eit=()=>{var r,o;const e=Ea(),t=parseInt(e.routineId??"");if(Number.isNaN(t))return b("p",{children:"Please pass an integer as the routine id."});const n=_c(t);return b(Iu,{maxWidth:"lg",children:b(UT,{query:n,child:n.isSuccess&&Q(xt,{children:[((r=n.data)==null?void 0:r.description)!==""&&b(tt,{variant:"body2",sx:{whiteSpace:"pre-line"},children:(o=n.data)==null?void 0:o.description}),b(_t,{spacing:2,sx:{mt:2},children:n.data.dayDataCurrentIteration.filter(i=>i.day!==null).map((i,a)=>b(Cz,{routineId:t,dayData:i},`dayDetails-${a}`))})]})})})};function Tle(e){var o;const{i18n:t}=Re(),n=$c();let r;return n.isSuccess&&(r=Tu(t.language,n.data)),b(ye,{container:!0,alignItems:"center",justifyContent:"center",sx:{height:e.rowHeight,marginBottom:e.marginBottom},children:b(ye,{size:12,children:Q(_t,{spacing:0,children:[b(tt,{variant:"h6",children:e.showExercise?(o=e.setConfigData.exercise)==null?void 0:o.getTranslation(r).name:""}),Q("div",{children:[e.setConfigData.textRepr,e.setConfigData.isSpecialType&&b(Pu,{label:e.setConfigData.type,color:"info",size:"small",sx:{marginLeft:"0.5em"}})]}),b(tt,{variant:"caption",children:e.setConfigData.comment})]})})})}function Pit(e){return Q(ye,{container:!0,justifyContent:"space-between",alignItems:"flex-start",children:[b(ye,{size:1,children:b(_t,{divider:b(en,{height:"10px"}),children:e.slotData.exercises.map((t,n)=>b(Qrt,{image:t.mainImage,iconSize:40,avatarSize:50},n))})}),b(ye,{size:11,children:e.slotData.setConfigs.map((t,n)=>{var o;const r=n===0||t.exerciseId!==((o=e.slotData.setConfigs[n-1])==null?void 0:o.exerciseId);return b(Tle,{setConfigData:t,marginBottom:"1em",showExercise:r},n)})})]})}const Cz=e=>{var i;const t=(e.readOnly??!1)||e.dayData.day===null||e.dayData.day.isRest,n=Lr(),[r,o]=Re();return Q(fo,{sx:{minWidth:275},children:[b(Vl,{sx:{bgcolor:n.palette.grey.A200},action:e.dayData.day===null||e.dayData.day.isRest||t?null:b(Do,{title:r("routines.addWeightLog"),children:b(on,{href:Qt(Kt.ROUTINE_ADD_LOG,o.language,{id:e.routineId,id2:e.dayData.day.id}),children:b(yrt,{})})}),title:Ite(e.dayData.day),avatar:kl(e.dayData.date,new Date)?b(Zse,{}):void 0,subheader:b(tt,{sx:{whiteSpace:"pre-line"},children:(i=e.dayData.day)==null?void 0:i.description})}),e.dayData.slots.length>0&&b(Pi,{sx:{padding:0,marginBottom:0},children:b(_t,{children:e.dayData.slots.map((a,s)=>Q("div",{children:[b(en,{padding:1,children:b(Pit,{slotData:a,index:s})}),b(Ti,{})]},s))})})]})},Ole=()=>{const[e,t]=Re(),n=Int();return n.isLoading?b(wr,{}):n.data!==null?b(Iit,{routine:n.data}):b(rj,{title:e("routines.routine"),link:Qt(Kt.ROUTINE_ADD,t.language)})},Iit=e=>{const[t,n]=Re();return Q(fo,{children:[b(Vl,{title:t("routines.routine"),subheader:e.routine.name??"."}),b(Pi,{sx:{height:"510px",overflow:"auto"},children:b(xa,{children:e.routine.dayDataCurrentIteration.filter(r=>r.day!==null).map((r,o)=>b(Tit,{dayData:r},o))})}),b(Ys,{children:b(at,{size:"small",href:Qt(Kt.ROUTINE_DETAIL,n.language,{id:e.routine.id}),children:t("seeDetails")})})]})},Tit=e=>{var i,a;const[t,n]=w.useState(!1),{t:r}=Re();return Q(xt,{children:[Q(mf,{onClick:()=>n(!t),selected:t,disabled:e.dayData.day===null||((i=e.dayData.day)==null?void 0:i.isRest),children:[b(si,{children:t?b(kee,{}):b(xy,{})}),b(uo,{primary:Ite(e.dayData.day),slotProps:{secondary:{noWrap:!0,style:{overflow:"hidden",textOverflow:"ellipsis"}}},secondary:(a=e.dayData.day)==null?void 0:a.description}),b(si,{children:kl(e.dayData.date,new Date)?b(Zse,{}):void 0})]}),b(Ls,{in:t,timeout:"auto",unmountOnExit:!0,children:e.dayData.slots.map((s,l)=>b("div",{children:s.setConfigs.map((c,u)=>b(Tle,{setConfigData:c,rowHeight:"70px",showExercise:!0},u))},l))})]})};function Y0(e="lastWeek"){return br({queryKey:[st.BODY_WEIGHT,e],queryFn:()=>MMe(e)})}const Oit=()=>{const e=Et();return It({mutationFn:t=>AMe(t),onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},kit=()=>{const e=Et();return It({mutationFn:t=>DMe(t),onError:t=>{console.log(t)},onSuccess:()=>e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})})},Mit=()=>{const e=Et();return It({mutationFn:t=>RMe(t),onSuccess:()=>{e.invalidateQueries({queryKey:[st.BODY_WEIGHT]})}})},Jy=({weightEntry:e,closeFn:t})=>{const n=Y0(),r=kit(),o=Mit(),[i,a]=w.useState(e?yt.fromJSDate(e.date):yt.now),[s,l]=Re(),c=_o({weight:wo().min(30,"Min weight is 30 kg").max(300,"Max weight is 300 kg").required("Weight field is required")});return n.isLoading?b(wr,{}):b(ci,{initialValues:{weight:e?e.weight:0,date:co(e?e.date:new Date)},validationSchema:c,onSubmit:async u=>{if(e){e.weight=u.weight,e.date=new Date(u.date);try{o.mutate(e)}catch{}}else{e=new lte(new Date(u.date),u.weight);try{r.mutate(e)}catch{}}t&&t()},children:u=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"weight",label:s("weight"),error:u.touched.weight&&!!u.touched.weight,helperText:u.touched.weight&&u.errors.weight,...u.getFieldProps("weight")}),b(vc,{dateAdapter:pu,adapterLocale:l.language,children:b(kx,{format:"yyyy-MM-dd",label:s("date"),value:i,slotProps:{textField:{variant:"outlined"}},disableFuture:!0,onChange:d=>{d&&u.setFieldValue("date",d.toJSDate()),a(d)},shouldDisableDate:d=>e&&co(e.date)===d.toISODate()?!1:d?n.data.some(f=>co(f.date)===d.toISODate()):!1})}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:s("submit")})})]})})})},Ait=["checked","disabled","error","focused","focusVisible","required","expanded","selected"];function Rit(e={}){const{disableGlobal:t=!1,productionPrefix:n="jss",seed:r=""}=e,o=r===""?"":`${r}-`;let i=0;const a=()=>(i+=1,i);return(s,l)=>{const c=l.options.name;if(c&&c.startsWith("Mui")&&!l.options.link&&!t){if(Ait.includes(s.key))return`Mui-${s.key}`;const u=`${o}${c}-${s.key}`;return!l.options.theme[dZ]||r!==""?u:`${u}-${a()}`}return`${o}${n}${a()}`}}var PY=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q0=(typeof window>"u"?"undefined":PY(window))==="object"&&(typeof document>"u"?"undefined":PY(document))==="object"&&document.nodeType===9;function $x(e){"@babel/helpers - typeof";return $x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$x(e)}function Dit(e,t){if($x(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($x(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ey(e){var t=Dit(e,"string");return $x(t)=="symbol"?t:t+""}function _it(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ey(r.key),r)}}function kle(e,t,n){return t&&_it(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var $it={}.constructor;function ML(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(ML);if(e.constructor!==$it)return e;var t={};for(var n in e)t[n]=ML(e[n]);return t}function Ez(e,t,n){e===void 0&&(e="unnamed");var r=n.jss,o=ML(t),i=r.plugins.onCreateRule(e,o,n);return i||(e[0],null)}var IY=function(t,n){for(var r="",o=0;o<t.length&&t[o]!=="!important";o++)r&&(r+=n),r+=t[o];return r},_p=function(t){if(!Array.isArray(t))return t;var n="";if(Array.isArray(t[0]))for(var r=0;r<t.length&&t[r]!=="!important";r++)n&&(n+=", "),n+=IY(t[r]," ");else n=IY(t,", ");return t[t.length-1]==="!important"&&(n+=" !important"),n};function Zy(e){return e&&e.format===!1?{linebreak:"",space:""}:{linebreak:``,space:" "}}function Sb(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function Nx(e,t,n){n===void 0&&(n={});var r="";if(!t)return r;var o=n,i=o.indent,a=i===void 0?0:i,s=t.fallbacks;n.format===!1&&(a=-1/0);var l=Zy(n),c=l.linebreak,u=l.space;if(e&&a++,s)if(Array.isArray(s))for(var d=0;d<s.length;d++){var f=s[d];for(var h in f){var g=f[h];g!=null&&(r&&(r+=c),r+=Sb(h+":"+u+_p(g)+";",a))}}else for(var y in s){var v=s[y];v!=null&&(r&&(r+=c),r+=Sb(y+":"+u+_p(v)+";",a))}for(var x in t){var S=t[x];S!=null&&x!=="fallbacks"&&(r&&(r+=c),r+=Sb(x+":"+u+_p(S)+";",a))}return!r&&!n.allowEmpty||!e?r:(a--,r&&(r=""+c+r+c),Sb(""+e+u+"{"+r,a)+Sb("}",a))}var Nit=/([[\].#*$><+~=|^:(),"'`\s])/g,TY=typeof CSS<"u"&&CSS.escape,Pz=function(e){return TY?TY(e):e.replace(Nit,"\\$1")},Mle=function(){function e(n,r,o){this.type="style",this.isProcessed=!1;var i=o.sheet,a=o.Renderer;this.key=n,this.options=o,this.style=r,i?this.renderer=i.renderer:a&&(this.renderer=new a)}var t=e.prototype;return t.prop=function(r,o,i){if(o===void 0)return this.style[r];var a=i?i.force:!1;if(!a&&this.style[r]===o)return this;var s=o;(!i||i.process!==!1)&&(s=this.options.jss.plugins.onChangeValue(o,r,this));var l=s==null||s===!1,c=r in this.style;if(l&&!c&&!a)return this;var u=l&&c;if(u?delete this.style[r]:this.style[r]=s,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,r):this.renderer.setProperty(this.renderable,r,s),this;var d=this.options.sheet;return d&&d.attached,this},e}(),AL=function(e){c0(t,e);function t(r,o,i){var a;a=e.call(this,r,o,i)||this;var s=i.selector,l=i.scoped,c=i.sheet,u=i.generateId;return s?a.selectorText=s:l!==!1&&(a.id=u(i2(i2(a)),c),a.selectorText="."+Pz(a.id)),a}var n=t.prototype;return n.applyTo=function(o){var i=this.renderer;if(i){var a=this.toJSON();for(var s in a)i.setProperty(o,s,a[s])}return this},n.toJSON=function(){var o={};for(var i in this.style){var a=this.style[i];typeof a!="object"?o[i]=a:Array.isArray(a)&&(o[i]=_p(a))}return o},n.toString=function(o){var i=this.options.sheet,a=i?i.options.link:!1,s=a?F({},o,{allowEmpty:!0}):o;return Nx(this.selectorText,this.style,s)},kle(t,[{key:"selector",set:function(o){if(o!==this.selectorText){this.selectorText=o;var i=this.renderer,a=this.renderable;if(!(!a||!i)){var s=i.setSelector(a,o);s||i.replaceRule(a,this)}}},get:function(){return this.selectorText}}]),t}(Mle),Lit={onCreateRule:function(t,n,r){return t[0]==="@"||r.parent&&r.parent.type==="keyframes"?null:new AL(t,n,r)}},K_={indent:1,children:!0},Fit=/@([\w-]+)/,jit=function(){function e(n,r,o){this.type="conditional",this.isProcessed=!1,this.key=n;var i=n.match(Fit);this.at=i?i[1]:"unknown",this.query=o.name||"@"+this.at,this.options=o,this.rules=new YT(F({},o,{parent:this}));for(var a in r)this.rules.add(a,r[a]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.indexOf=function(r){return this.rules.indexOf(r)},t.addRule=function(r,o,i){var a=this.rules.add(r,o,i);return a?(this.options.jss.plugins.onProcessRule(a),a):null},t.replaceRule=function(r,o,i){var a=this.rules.replace(r,o,i);return a&&this.options.jss.plugins.onProcessRule(a),a},t.toString=function(r){r===void 0&&(r=K_);var o=Zy(r),i=o.linebreak;if(r.indent==null&&(r.indent=K_.indent),r.children==null&&(r.children=K_.children),r.children===!1)return this.query+" {}";var a=this.rules.toString(r);return a?this.query+" {"+i+a+i+"}":""},e}(),Bit=/@container|@media|@supports\s+/,zit={onCreateRule:function(t,n,r){return Bit.test(t)?new jit(t,n,r):null}},Y_={indent:1,children:!0},Vit=/@keyframes\s+([\w-]+)/,RL=function(){function e(n,r,o){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var i=n.match(Vit);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=o;var a=o.scoped,s=o.sheet,l=o.generateId;this.id=a===!1?this.name:Pz(l(this,s)),this.rules=new YT(F({},o,{parent:this}));for(var c in r)this.rules.add(c,r[c],F({},o,{parent:this}));this.rules.process()}var t=e.prototype;return t.toString=function(r){r===void 0&&(r=Y_);var o=Zy(r),i=o.linebreak;if(r.indent==null&&(r.indent=Y_.indent),r.children==null&&(r.children=Y_.children),r.children===!1)return this.at+" "+this.id+" {}";var a=this.rules.toString(r);return a&&(a=""+i+a+i),this.at+" "+this.id+" {"+a+"}"},e}(),Hit=/@keyframes\s+/,Uit=/\$([\w-]+)/g,DL=function(t,n){return typeof t=="string"?t.replace(Uit,function(r,o){return o in n?n[o]:r}):t},OY=function(t,n,r){var o=t[n],i=DL(o,r);i!==o&&(t[n]=i)},Wit={onCreateRule:function(t,n,r){return typeof t=="string"&&Hit.test(t)?new RL(t,n,r):null},onProcessStyle:function(t,n,r){return n.type!=="style"||!r||("animation-name"in t&&OY(t,"animation-name",r.keyframes),"animation"in t&&OY(t,"animation",r.keyframes)),t},onChangeValue:function(t,n,r){var o=r.options.sheet;if(!o)return t;switch(n){case"animation":return DL(t,o.keyframes);case"animation-name":return DL(t,o.keyframes);default:return t}}},Git=function(e){c0(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.toString=function(o){var i=this.options.sheet,a=i?i.options.link:!1,s=a?F({},o,{allowEmpty:!0}):o;return Nx(this.key,this.style,s)},t}(Mle),qit={onCreateRule:function(t,n,r){return r.parent&&r.parent.type==="keyframes"?new Git(t,n,r):null}},Kit=function(){function e(n,r,o){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=n,this.style=r,this.options=o}var t=e.prototype;return t.toString=function(r){var o=Zy(r),i=o.linebreak;if(Array.isArray(this.style)){for(var a="",s=0;s<this.style.length;s++)a+=Nx(this.at,this.style[s]),this.style[s+1]&&(a+=i);return a}return Nx(this.at,this.style,r)},e}(),Yit=/@font-face/,Qit={onCreateRule:function(t,n,r){return Yit.test(t)?new Kit(t,n,r):null}},Xit=function(){function e(n,r,o){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=n,this.style=r,this.options=o}var t=e.prototype;return t.toString=function(r){return Nx(this.key,this.style,r)},e}(),Jit={onCreateRule:function(t,n,r){return t==="@viewport"||t==="@-ms-viewport"?new Xit(t,n,r):null}},Zit=function(){function e(n,r,o){this.type="simple",this.isProcessed=!1,this.key=n,this.value=r,this.options=o}var t=e.prototype;return t.toString=function(r){if(Array.isArray(this.value)){for(var o="",i=0;i<this.value.length;i++)o+=this.key+" "+this.value[i]+";",this.value[i+1]&&(o+=``);return o}return this.key+" "+this.value+";"},e}(),eat={"@charset":!0,"@import":!0,"@namespace":!0},tat={onCreateRule:function(t,n,r){return t in eat?new Zit(t,n,r):null}},kY=[Lit,zit,Wit,qit,Qit,Jit,tat],nat={process:!0},MY={force:!0,process:!0},YT=function(){function e(n){this.map={},this.raw={},this.index=[],this.counter=0,this.options=n,this.classes=n.classes,this.keyframes=n.keyframes}var t=e.prototype;return t.add=function(r,o,i){var a=this.options,s=a.parent,l=a.sheet,c=a.jss,u=a.Renderer,d=a.generateId,f=a.scoped,h=F({classes:this.classes,parent:s,sheet:l,jss:c,Renderer:u,generateId:d,scoped:f,name:r,keyframes:this.keyframes,selector:void 0},i),g=r;r in this.raw&&(g=r+"-d"+this.counter++),this.raw[g]=o,g in this.classes&&(h.selector="."+Pz(this.classes[g]));var y=Ez(g,o,h);if(!y)return null;this.register(y);var v=h.index===void 0?this.index.length:h.index;return this.index.splice(v,0,y),y},t.replace=function(r,o,i){var a=this.get(r),s=this.index.indexOf(a);a&&this.remove(a);var l=i;return s!==-1&&(l=F({},i,{index:s})),this.add(r,o,l)},t.get=function(r){return this.map[r]},t.remove=function(r){this.unregister(r),delete this.raw[r.key],this.index.splice(this.index.indexOf(r),1)},t.indexOf=function(r){return this.index.indexOf(r)},t.process=function(){var r=this.options.jss.plugins;this.index.slice(0).forEach(r.onProcessRule,r)},t.register=function(r){this.map[r.key]=r,r instanceof AL?(this.map[r.selector]=r,r.id&&(this.classes[r.key]=r.id)):r instanceof RL&&this.keyframes&&(this.keyframes[r.name]=r.id)},t.unregister=function(r){delete this.map[r.key],r instanceof AL?(delete this.map[r.selector],delete this.classes[r.key]):r instanceof RL&&delete this.keyframes[r.name]},t.update=function(){var r,o,i;if(typeof(arguments.length<=0?void 0:arguments[0])=="string"?(r=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1],i=arguments.length<=2?void 0:arguments[2]):(o=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1],r=null),r)this.updateOne(this.get(r),o,i);else for(var a=0;a<this.index.length;a++)this.updateOne(this.index[a],o,i)},t.updateOne=function(r,o,i){i===void 0&&(i=nat);var a=this.options,s=a.jss.plugins,l=a.sheet;if(r.rules instanceof e){r.rules.update(o,i);return}var c=r.style;if(s.onUpdate(o,r,l,i),i.process&&c&&c!==r.style){s.onProcessStyle(r.style,r,l);for(var u in r.style){var d=r.style[u],f=c[u];d!==f&&r.prop(u,d,MY)}for(var h in c){var g=r.style[h],y=c[h];g==null&&g!==y&&r.prop(h,null,MY)}}},t.toString=function(r){for(var o="",i=this.options.sheet,a=i?i.options.link:!1,s=Zy(r),l=s.linebreak,c=0;c<this.index.length;c++){var u=this.index[c],d=u.toString(r);!d&&!a||(o&&(o+=l),o+=d)}return o},e}(),Ale=function(){function e(n,r){this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=F({},r,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),r.Renderer&&(this.renderer=new r.Renderer(this)),this.rules=new YT(this.options);for(var o in n)this.rules.add(o,n[o]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached?this:(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy(),this)},t.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},t.addRule=function(r,o,i){var a=this.queue;this.attached&&!a&&(this.queue=[]);var s=this.rules.add(r,o,i);return s?(this.options.jss.plugins.onProcessRule(s),this.attached?(this.deployed&&(a?a.push(s):(this.insertRule(s),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0))),s):(this.deployed=!1,s)):null},t.replaceRule=function(r,o,i){var a=this.rules.get(r);if(!a)return this.addRule(r,o,i);var s=this.rules.replace(r,o,i);return s&&this.options.jss.plugins.onProcessRule(s),this.attached?(this.deployed&&this.renderer&&(s?a.renderable&&this.renderer.replaceRule(a.renderable,s):this.renderer.deleteRule(a)),s):(this.deployed=!1,s)},t.insertRule=function(r){this.renderer&&this.renderer.insertRule(r)},t.addRules=function(r,o){var i=[];for(var a in r){var s=this.addRule(a,r[a],o);s&&i.push(s)}return i},t.getRule=function(r){return this.rules.get(r)},t.deleteRule=function(r){var o=typeof r=="object"?r:this.rules.get(r);return!o||this.attached&&!o.renderable?!1:(this.rules.remove(o),this.attached&&o.renderable&&this.renderer?this.renderer.deleteRule(o.renderable):!0)},t.indexOf=function(r){return this.rules.indexOf(r)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var r;return(r=this.rules).update.apply(r,arguments),this},t.updateOne=function(r,o,i){return this.rules.updateOne(r,o,i),this},t.toString=function(r){return this.rules.toString(r)},e}(),rat=function(){function e(){this.plugins={internal:[],external:[]},this.registry={}}var t=e.prototype;return t.onCreateRule=function(r,o,i){for(var a=0;a<this.registry.onCreateRule.length;a++){var s=this.registry.onCreateRule[a](r,o,i);if(s)return s}return null},t.onProcessRule=function(r){if(!r.isProcessed){for(var o=r.options.sheet,i=0;i<this.registry.onProcessRule.length;i++)this.registry.onProcessRule[i](r,o);r.style&&this.onProcessStyle(r.style,r,o),r.isProcessed=!0}},t.onProcessStyle=function(r,o,i){for(var a=0;a<this.registry.onProcessStyle.length;a++)o.style=this.registry.onProcessStyle[a](o.style,o,i)},t.onProcessSheet=function(r){for(var o=0;o<this.registry.onProcessSheet.length;o++)this.registry.onProcessSheet[o](r)},t.onUpdate=function(r,o,i,a){for(var s=0;s<this.registry.onUpdate.length;s++)this.registry.onUpdate[s](r,o,i,a)},t.onChangeValue=function(r,o,i){for(var a=r,s=0;s<this.registry.onChangeValue.length;s++)a=this.registry.onChangeValue[s](a,o,i);return a},t.use=function(r,o){o===void 0&&(o={queue:"external"});var i=this.plugins[o.queue];i.indexOf(r)===-1&&(i.push(r),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(a,s){for(var l in s)l in a&&a[l].push(s[l]);return a},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),oat=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(r){var o=this.registry,i=r.options.index;if(o.indexOf(r)===-1){if(o.length===0||i>=this.index){o.push(r);return}for(var a=0;a<o.length;a++)if(o[a].options.index>i){o.splice(a,0,r);return}}},t.reset=function(){this.registry=[]},t.remove=function(r){var o=this.registry.indexOf(r);this.registry.splice(o,1)},t.toString=function(r){for(var o=r===void 0?{}:r,i=o.attached,a=We(o,["attached"]),s=Zy(a),l=s.linebreak,c="",u=0;u<this.registry.length;u++){var d=this.registry[u];i!=null&&d.attached!==i||(c&&(c+=l),c+=d.toString(a))}return c},kle(e,[{key:"index",get:function(){return this.registry.length===0?0:this.registry[this.registry.length-1].options.index}}]),e}(),Sw=new oat,_L=typeof globalThis<"u"?globalThis:typeof window<"u"&&window.Math===Math?window:typeof self<"u"&&self.Math===Math?self:Function("return this")(),$L="2f1acc6c3a606b082e5eef5e54414ffb";_L[$L]==null&&(_L[$L]=0);var AY=_L[$L]++,RY=function(t){t===void 0&&(t={});var n=0,r=function(i,a){n+=1;var s="",l="";return a&&(a.options.classNamePrefix&&(l=a.options.classNamePrefix),a.options.jss.id!=null&&(s=String(a.options.jss.id))),t.minify?""+(l||"c")+AY+s+n:l+i.key+"-"+AY+(s?"-"+s:"")+"-"+n};return r},Rle=function(t){var n;return function(){return n||(n=t()),n}},iat=function(t,n){try{return t.attributeStyleMap?t.attributeStyleMap.get(n):t.style.getPropertyValue(n)}catch{return""}},aat=function(t,n,r){try{var o=r;if(Array.isArray(r)&&(o=_p(r)),t.attributeStyleMap)t.attributeStyleMap.set(n,o);else{var i=o?o.indexOf("!important"):-1,a=i>-1?o.substr(0,i-1):o;t.style.setProperty(n,a,i>-1?"important":"")}}catch{return!1}return!0},sat=function(t,n){try{t.attributeStyleMap?t.attributeStyleMap.delete(n):t.style.removeProperty(n)}catch{}},lat=function(t,n){return t.selectorText=n,t.selectorText===n},Dle=Rle(function(){return document.querySelector("head")});function cat(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}function uat(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}function dat(e){for(var t=Dle(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(r.nodeType===8&&r.nodeValue.trim()===e)return r}return null}function fat(e){var t=Sw.registry;if(t.length>0){var n=cat(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=uat(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&typeof r=="string"){var o=dat(r);if(o)return{parent:o.parentNode,node:o.nextSibling}}return!1}function pat(e,t){var n=t.insertionPoint,r=fat(t);if(r!==!1&&r.parent){r.parent.insertBefore(e,r.node);return}if(n&&typeof n.nodeType=="number"){var o=n,i=o.parentNode;i&&i.insertBefore(e,o.nextSibling);return}Dle().appendChild(e)}var hat=Rle(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),DY=function(t,n,r){try{"insertRule"in t?t.insertRule(n,r):"appendRule"in t&&t.appendRule(n)}catch{return!1}return t.cssRules[r]},_Y=function(t,n){var r=t.cssRules.length;return n===void 0||n>r?r:n},mat=function(){var t=document.createElement("style");return t.textContent=``,t},gat=function(){function e(n){this.getPropertyValue=iat,this.setProperty=aat,this.removeProperty=sat,this.setSelector=lat,this.hasInsertedRules=!1,this.cssRules=[],n&&Sw.add(n),this.sheet=n;var r=this.sheet?this.sheet.options:{},o=r.media,i=r.meta,a=r.element;this.element=a||mat(),this.element.setAttribute("data-jss",""),o&&this.element.setAttribute("media",o),i&&this.element.setAttribute("data-meta",i);var s=hat();s&&this.element.setAttribute("nonce",s)}var t=e.prototype;return t.attach=function(){if(!(this.element.parentNode||!this.sheet)){pat(this.element,this.sheet.options);var r=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&r&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var r=this.element.parentNode;r&&r.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent=`@@ -390,7 +390,7 @@ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}* @website https://github.com/cssinjs/jss* @license MIT*/_le();var Nle=Date.now(),Q_="fnValues"+Nle,X_="fnStyle"+ ++Nle,bat=function(){return{onCreateRule:function(n,r,o){if(typeof r!="function")return null;var i=Ez(n,{},o);return i[X_]=r,i},onProcessStyle:function(n,r){if(Q_ in r||X_ in r)return n;var o={};for(var i in n){var a=n[i];typeof a=="function"&&(delete n[i],o[i]=a)}return r[Q_]=o,n},onUpdate:function(n,r,o,i){var a=r,s=a[X_];s&&(a.style=s(n)||{});var l=a[Q_];if(l)for(var c in l)a.prop(c,l[c](n),i)}}},Wd="@global",NL="@global ",wat=function(){function e(n,r,o){this.type="global",this.at=Wd,this.isProcessed=!1,this.key=n,this.options=o,this.rules=new YT(F({},o,{parent:this}));for(var i in r)this.rules.add(i,r[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(r){return this.rules.get(r)},t.addRule=function(r,o,i){var a=this.rules.add(r,o,i);return a&&this.options.jss.plugins.onProcessRule(a),a},t.replaceRule=function(r,o,i){var a=this.rules.replace(r,o,i);return a&&this.options.jss.plugins.onProcessRule(a),a},t.indexOf=function(r){return this.rules.indexOf(r)},t.toString=function(r){return this.rules.toString(r)},e}(),xat=function(){function e(n,r,o){this.type="global",this.at=Wd,this.isProcessed=!1,this.key=n,this.options=o;var i=n.substr(NL.length);this.rule=o.jss.createRule(i,r,F({},o,{parent:this}))}var t=e.prototype;return t.toString=function(r){return this.rule?this.rule.toString(r):""},e}(),Sat=/\s*,\s*/g;function Lle(e,t){for(var n=e.split(Sat),r="",o=0;o<n.length;o++)r+=t+" "+n[o].trim(),n[o+1]&&(r+=", ");return r}function Cat(e,t){var n=e.options,r=e.style,o=r?r[Wd]:null;if(o){for(var i in o)t.addRule(i,o[i],F({},n,{selector:Lle(i,e.selector)}));delete r[Wd]}}function Eat(e,t){var n=e.options,r=e.style;for(var o in r)if(!(o[0]!=="@"||o.substr(0,Wd.length)!==Wd)){var i=Lle(o.substr(Wd.length),e.selector);t.addRule(i,r[o],F({},n,{selector:i})),delete r[o]}}function Pat(){function e(n,r,o){if(!n)return null;if(n===Wd)return new wat(n,r,o);if(n[0]==="@"&&n.substr(0,NL.length)===NL)return new xat(n,r,o);var i=o.parent;return i&&(i.type==="global"||i.options.parent&&i.options.parent.type==="global")&&(o.scoped=!1),!o.selector&&o.scoped===!1&&(o.selector=n),null}function t(n,r){n.type!=="style"||!r||(Cat(n,r),Eat(n,r))}return{onCreateRule:e,onProcessRule:t}}var $Y=/\s*,\s*/g,Iat=/&/g,Tat=/\$([\w-]+)/g;function Oat(){function e(o,i){return function(a,s){var l=o.getRule(s)||i&&i.getRule(s);return l?l.selector:s}}function t(o,i){for(var a=i.split($Y),s=o.split($Y),l="",c=0;c<a.length;c++)for(var u=a[c],d=0;d<s.length;d++){var f=s[d];l&&(l+=", "),l+=f.indexOf("&")!==-1?f.replace(Iat,u):u+" "+f}return l}function n(o,i,a){if(a)return F({},a,{index:a.index+1});var s=o.options.nestingLevel;s=s===void 0?1:s+1;var l=F({},o.options,{nestingLevel:s,index:i.indexOf(o)+1});return delete l.name,l}function r(o,i,a){if(i.type!=="style")return o;var s=i,l=s.options.parent,c,u;for(var d in o){var f=d.indexOf("&")!==-1,h=d[0]==="@";if(!(!f&&!h)){if(c=n(s,l,c),f){var g=t(d,s.selector);u||(u=e(l,a)),g=g.replace(Tat,u);var y=s.key+"-"+d;"replaceRule"in l?l.replaceRule(y,o[d],F({},c,{selector:g})):l.addRule(y,o[d],F({},c,{selector:g}))}else h&&l.addRule(d,{},c).addRule(s.key,o[d],{selector:s.selector});delete o[d]}}return o}return{onProcessStyle:r}}var kat=/[A-Z]/g,Mat=/^ms-/,J_={};function Aat(e){return"-"+e.toLowerCase()}function Fle(e){if(J_.hasOwnProperty(e))return J_[e];var t=e.replace(kat,Aat);return J_[e]=Mat.test(t)?"-"+t:t}function AP(e){var t={};for(var n in e){var r=n.indexOf("--")===0?n:Fle(n);t[r]=e[n]}return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(AP):t.fallbacks=AP(e.fallbacks)),t}function Rat(){function e(n){if(Array.isArray(n)){for(var r=0;r<n.length;r++)n[r]=AP(n[r]);return n}return AP(n)}function t(n,r,o){if(r.indexOf("--")===0)return n;var i=Fle(r);return r===i?n:(o.prop(i,n),null)}return{onProcessStyle:e,onChangeValue:t}}var Ge=Iz&&CSS?CSS.px:"px",i1=Iz&&CSS?CSS.ms:"ms",cm=Iz&&CSS?CSS.percent:"%",Dat={"animation-delay":i1,"animation-duration":i1,"background-position":Ge,"background-position-x":Ge,"background-position-y":Ge,"background-size":Ge,border:Ge,"border-bottom":Ge,"border-bottom-left-radius":Ge,"border-bottom-right-radius":Ge,"border-bottom-width":Ge,"border-left":Ge,"border-left-width":Ge,"border-radius":Ge,"border-right":Ge,"border-right-width":Ge,"border-top":Ge,"border-top-left-radius":Ge,"border-top-right-radius":Ge,"border-top-width":Ge,"border-width":Ge,"border-block":Ge,"border-block-end":Ge,"border-block-end-width":Ge,"border-block-start":Ge,"border-block-start-width":Ge,"border-block-width":Ge,"border-inline":Ge,"border-inline-end":Ge,"border-inline-end-width":Ge,"border-inline-start":Ge,"border-inline-start-width":Ge,"border-inline-width":Ge,"border-start-start-radius":Ge,"border-start-end-radius":Ge,"border-end-start-radius":Ge,"border-end-end-radius":Ge,margin:Ge,"margin-bottom":Ge,"margin-left":Ge,"margin-right":Ge,"margin-top":Ge,"margin-block":Ge,"margin-block-end":Ge,"margin-block-start":Ge,"margin-inline":Ge,"margin-inline-end":Ge,"margin-inline-start":Ge,padding:Ge,"padding-bottom":Ge,"padding-left":Ge,"padding-right":Ge,"padding-top":Ge,"padding-block":Ge,"padding-block-end":Ge,"padding-block-start":Ge,"padding-inline":Ge,"padding-inline-end":Ge,"padding-inline-start":Ge,"mask-position-x":Ge,"mask-position-y":Ge,"mask-size":Ge,height:Ge,width:Ge,"min-height":Ge,"max-height":Ge,"min-width":Ge,"max-width":Ge,bottom:Ge,left:Ge,top:Ge,right:Ge,inset:Ge,"inset-block":Ge,"inset-block-end":Ge,"inset-block-start":Ge,"inset-inline":Ge,"inset-inline-end":Ge,"inset-inline-start":Ge,"box-shadow":Ge,"text-shadow":Ge,"column-gap":Ge,"column-rule":Ge,"column-rule-width":Ge,"column-width":Ge,"font-size":Ge,"font-size-delta":Ge,"letter-spacing":Ge,"text-decoration-thickness":Ge,"text-indent":Ge,"text-stroke":Ge,"text-stroke-width":Ge,"word-spacing":Ge,motion:Ge,"motion-offset":Ge,outline:Ge,"outline-offset":Ge,"outline-width":Ge,perspective:Ge,"perspective-origin-x":cm,"perspective-origin-y":cm,"transform-origin":cm,"transform-origin-x":cm,"transform-origin-y":cm,"transform-origin-z":cm,"transition-delay":i1,"transition-duration":i1,"vertical-align":Ge,"flex-basis":Ge,"shape-margin":Ge,size:Ge,gap:Ge,grid:Ge,"grid-gap":Ge,"row-gap":Ge,"grid-row-gap":Ge,"grid-column-gap":Ge,"grid-template-rows":Ge,"grid-template-columns":Ge,"grid-auto-rows":Ge,"grid-auto-columns":Ge,"box-shadow-x":Ge,"box-shadow-y":Ge,"box-shadow-blur":Ge,"box-shadow-spread":Ge,"font-line-height":Ge,"text-shadow-x":Ge,"text-shadow-y":Ge,"text-shadow-blur":Ge};function jle(e){var t=/(-[a-z])/g,n=function(a){return a[1].toUpperCase()},r={};for(var o in e)r[o]=e[o],r[o.replace(t,n)]=e[o];return r}var _at=jle(Dat);function Cw(e,t,n){if(t==null)return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=Cw(e,t[r],n);else if(typeof t=="object")if(e==="fallbacks")for(var o in t)t[o]=Cw(o,t[o],n);else for(var i in t)t[i]=Cw(e+"-"+i,t[i],n);else if(typeof t=="number"&&isNaN(t)===!1){var a=n[e]||_at[e];return a&&!(t===0&&a===Ge)?typeof a=="function"?a(t).toString():""+t+a:t.toString()}return t}function $at(e){e===void 0&&(e={});var t=jle(e);function n(o,i){if(i.type!=="style")return o;for(var a in o)o[a]=Cw(a,o[a],t);return o}function r(o,i){return Cw(i,o,t)}return{onProcessStyle:n,onChangeValue:r}}function LL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Nat(e){if(Array.isArray(e))return LL(e)}function Lat(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fat(e,t){if(e){if(typeof e=="string")return LL(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LL(e,t):void 0}}function jat(){throw new TypeError(`Invalid attempt to spread non-iterable instance.-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bat(e){return Nat(e)||Lat(e)||Fat(e)||jat()}var Yb="",FL="",Ble="",zle="",zat=Q0&&"ontouchstart"in document.documentElement;if(Q0){var Z_={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},Vat=document.createElement("p"),e$=Vat.style,Hat="Transform";for(var t$ in Z_)if(t$+Hat in e$){Yb=t$,FL=Z_[t$];break}Yb==="Webkit"&&"msHyphens"in e$&&(Yb="ms",FL=Z_.ms,zle="edge"),Yb==="Webkit"&&"-apple-trailing-word"in e$&&(Ble="apple")}var bn={js:Yb,css:FL,vendor:Ble,browser:zle,isTouch:zat};function Uat(e){return e[1]==="-"||bn.js==="ms"?e:"@"+bn.css+"keyframes"+e.substr(10)}var Wat={noPrefill:["appearance"],supportedProperty:function(t){return t!=="appearance"?!1:bn.js==="ms"?"-webkit-"+t:bn.css+t}},Gat={noPrefill:["color-adjust"],supportedProperty:function(t){return t!=="color-adjust"?!1:bn.js==="Webkit"?bn.css+"print-"+t:t}},qat=/[-\s]+(.)?/g;function Kat(e,t){return t?t.toUpperCase():""}function Tz(e){return e.replace(qat,Kat)}function af(e){return Tz("-"+e)}var Yat={noPrefill:["mask"],supportedProperty:function(t,n){if(!/^mask/.test(t))return!1;if(bn.js==="Webkit"){var r="mask-image";if(Tz(r)in n)return t;if(bn.js+af(r)in n)return bn.css+t}return t}},Qat={noPrefill:["text-orientation"],supportedProperty:function(t){return t!=="text-orientation"?!1:bn.vendor==="apple"&&!bn.isTouch?bn.css+t:t}},Xat={noPrefill:["transform"],supportedProperty:function(t,n,r){return t!=="transform"?!1:r.transform?t:bn.css+t}},Jat={noPrefill:["transition"],supportedProperty:function(t,n,r){return t!=="transition"?!1:r.transition?t:bn.css+t}},Zat={noPrefill:["writing-mode"],supportedProperty:function(t){return t!=="writing-mode"?!1:bn.js==="Webkit"||bn.js==="ms"&&bn.browser!=="edge"?bn.css+t:t}},est={noPrefill:["user-select"],supportedProperty:function(t){return t!=="user-select"?!1:bn.js==="Moz"||bn.js==="ms"||bn.vendor==="apple"?bn.css+t:t}},tst={supportedProperty:function(t,n){if(!/^break-/.test(t))return!1;if(bn.js==="Webkit"){var r="WebkitColumn"+af(t);return r in n?bn.css+"column-"+t:!1}if(bn.js==="Moz"){var o="page"+af(t);return o in n?"page-"+t:!1}return!1}},nst={supportedProperty:function(t,n){if(!/^(border|margin|padding)-inline/.test(t))return!1;if(bn.js==="Moz")return t;var r=t.replace("-inline","");return bn.js+af(r)in n?bn.css+r:!1}},rst={supportedProperty:function(t,n){return Tz(t)in n?t:!1}},ost={supportedProperty:function(t,n){var r=af(t);return t[0]==="-"||t[0]==="-"&&t[1]==="-"?t:bn.js+r in n?bn.css+t:bn.js!=="Webkit"&&"Webkit"+r in n?"-webkit-"+t:!1}},ist={supportedProperty:function(t){return t.substring(0,11)!=="scroll-snap"?!1:bn.js==="ms"?""+bn.css+t:t}},ast={supportedProperty:function(t){return t!=="overscroll-behavior"?!1:bn.js==="ms"?bn.css+"scroll-chaining":t}},sst={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},lst={supportedProperty:function(t,n){var r=sst[t];return r&&bn.js+af(r)in n?bn.css+r:!1}},Vle={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},cst=Object.keys(Vle),ust=function(t){return bn.css+t},dst={supportedProperty:function(t,n,r){var o=r.multiple;if(cst.indexOf(t)>-1){var i=Vle[t];if(!Array.isArray(i))return bn.js+af(i)in n?bn.css+i:!1;if(!o)return!1;for(var a=0;a<i.length;a++)if(!(bn.js+af(i[0])in n))return!1;return i.map(ust)}return!1}},Hle=[Wat,Gat,Yat,Qat,Xat,Jat,Zat,est,tst,nst,rst,ost,ist,ast,lst,dst],NY=Hle.filter(function(e){return e.supportedProperty}).map(function(e){return e.supportedProperty}),fst=Hle.filter(function(e){return e.noPrefill}).reduce(function(e,t){return e.push.apply(e,Bat(t.noPrefill)),e},[]),Qb,sp={};if(Q0){Qb=document.createElement("p");var n$=window.getComputedStyle(document.documentElement,"");for(var r$ in n$)isNaN(r$)||(sp[n$[r$]]=n$[r$]);fst.forEach(function(e){return delete sp[e]})}function jL(e,t){if(t===void 0&&(t={}),!Qb)return e;if(sp[e]!=null)return sp[e];(e==="transition"||e==="transform")&&(t[e]=e in Qb.style);for(var n=0;n<NY.length&&(sp[e]=NY[n](e,Qb.style,t),!sp[e]);n++);try{Qb.style[e]=""}catch{return!1}return sp[e]}var um={},pst={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},hst=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g,vd;function mst(e,t,n){if(t==="var")return"var";if(t==="all")return"all";if(n==="all")return", all";var r=t?jL(t):", "+jL(n);return r||t||n}Q0&&(vd=document.createElement("p"));function LY(e,t){var n=t;if(!vd||e==="content")return t;if(typeof n!="string"||!isNaN(parseInt(n,10)))return n;var r=e+n;if(um[r]!=null)return um[r];try{vd.style[e]=n}catch{return um[r]=!1,!1}if(pst[e])n=n.replace(hst,mst);else if(vd.style[e]===""&&(n=bn.css+n,n==="-ms-flex"&&(vd.style[e]="-ms-flexbox"),vd.style[e]=n,vd.style[e]===""))return um[r]=!1,!1;return vd.style[e]="",um[r]=n,um[r]}function gst(){function e(o){if(o.type==="keyframes"){var i=o;i.at=Uat(i.at)}}function t(o){for(var i in o){var a=o[i];if(i==="fallbacks"&&Array.isArray(a)){o[i]=a.map(t);continue}var s=!1,l=jL(i);l&&l!==i&&(s=!0);var c=!1,u=LY(l,_p(a));u&&u!==a&&(c=!0),(s||c)&&(s&&delete o[i],o[l||i]=u||a)}return o}function n(o,i){return i.type!=="style"?o:t(o)}function r(o,i){return LY(i,_p(o))||o}return{onProcessRule:e,onProcessStyle:n,onChangeValue:r}}function yst(){var e=function(n,r){return n.length===r.length?n>r?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var o={},i=Object.keys(n).sort(e),a=0;a<i.length;a++)o[i[a]]=n[i[a]];return o}}}function vst(){return{plugins:[bat(),Pat(),Oat(),Rat(),$at(),typeof window>"u"?null:gst(),yst()]}}function Ule(e={}){const{baseClasses:t,newClasses:n,Component:r}=e;if(!n)return t;const o={...t};return Object.keys(n).forEach(i=>{n[i]&&(o[i]=`${t[i]} ${n[i]}`)}),o}const Rm={set:(e,t,n,r)=>{let o=e.get(t);o||(o=new Map,e.set(t,o)),o.set(n,r)},get:(e,t,n)=>{const r=e.get(t);return r?r.get(n):void 0},delete:(e,t,n)=>{e.get(t).delete(n)}};function bst(){const e=yI();return(e==null?void 0:e.$$material)??e}const wst=_le(vst()),xst=Rit(),Sst=new Map,Cst={disableGeneration:!1,generateClassName:xst,jss:wst,sheetsCache:null,sheetsManager:Sst,sheetsRegistry:null},Est=w.createContext(Cst);let FY=-1e9;function Pst(){return FY+=1,FY}function jY(e){return e.length===0}function Ist(e){const{variant:t,...n}=e;let r=t||"";return Object.keys(n).sort().forEach(o=>{o==="color"?r+=jY(r)?e[o]:we(e[o]):r+=`${jY(r)?o:we(o)}${we(e[o].toString())}`}),r}const Tst={};function Ost(e){const t=typeof e=="function";return{create:(n,r)=>{let o;try{o=t?e(n):e}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return o;const i=n.components[r].styleOverrides||{},a=n.components[r].variants||[],s={...o};return Object.keys(i).forEach(l=>{s[l]=xo(s[l]||{},i[l])}),a.forEach(l=>{const c=Ist(l.props);s[c]=xo(s[c]||{},l.style)}),s},options:{}}}function kst({state:e,stylesOptions:t},n,r){if(t.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let o=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,o=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,o=!0),o&&(e.cacheClasses.value=Ule({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:r})),e.cacheClasses.value}function Mst({state:e,theme:t,stylesOptions:n,stylesCreator:r,name:o},i){if(n.disableGeneration)return;let a=Rm.get(n.sheetsManager,r,t);a||(a={refs:0,staticSheet:null,dynamicStyles:null},Rm.set(n.sheetsManager,r,t,a));const s={...r.options,...n,theme:t,flip:typeof n.flip=="boolean"?n.flip:t.direction==="rtl"};s.generateId=s.serverGenerateClassName||s.generateClassName;const l=n.sheetsRegistry;if(a.refs===0){let c;n.sheetsCache&&(c=Rm.get(n.sheetsCache,r,t));const u=r.create(t,o);c||(c=n.jss.createStyleSheet(u,{link:!1,...s}),c.attach(),n.sheetsCache&&Rm.set(n.sheetsCache,r,t,c)),l&&l.add(c),a.staticSheet=c,a.dynamicStyles=$le(u)}if(a.dynamicStyles){const c=n.jss.createStyleSheet(a.dynamicStyles,{link:!0,...s});c.update(i),c.attach(),e.dynamicSheet=c,e.classes=Ule({baseClasses:a.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else e.classes=a.staticSheet.classes;a.refs+=1}function Ast({state:e},t){e.dynamicSheet&&e.dynamicSheet.update(t)}function Rst({state:e,theme:t,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const o=Rm.get(n.sheetsManager,r,t);o.refs-=1;const i=n.sheetsRegistry;o.refs===0&&(Rm.delete(n.sheetsManager,r,t),n.jss.removeStyleSheet(o.staticSheet),i&&i.remove(o.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),i&&i.remove(e.dynamicSheet))}function Dst(e,t){const n=w.useRef([]);let r;const o=w.useMemo(()=>({}),t);n.current!==o&&(n.current=o,r=e()),w.useEffect(()=>()=>{r&&r()},[o])}function Oz(e,t={}){const{name:n,classNamePrefix:r,Component:o,defaultTheme:i=Tst,...a}=t,s=Ost(e),l=n||r||"makeStyles";return s.options={index:Pst(),name:n,meta:l,classNamePrefix:l},(u={})=>{const d=bst()||i,f={...w.useContext(Est),...a},h=w.useRef(),g=w.useRef();return Dst(()=>{const v={name:n,state:{},stylesCreator:s,stylesOptions:f,theme:d};return Mst(v,u),g.current=!1,h.current=v,()=>{Rst(v)}},[d,s]),w.useEffect(()=>{g.current&&Ast(h.current,u),g.current=!0}),kst(h.current,u.classes,o)}}const _st=Oz(e=>({table:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),$st=({weights:e})=>{const[t]=Re(),n=_st(),o=e.slice(0,5);return b("div",{className:n.table,children:b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{align:"center",children:t("date")}),b(Te,{align:"center",children:t("weight")})]})}),b(Fl,{children:o.map(i=>Q(Zt,{children:[b(Te,{align:"center",children:i.date.toLocaleDateString()}),b(Te,{align:"center",children:i.weight})]},i.date.toLocaleDateString()))})]})})})},Nst=({active:e,payload:t,label:n})=>{const[r,o]=Re();return e&&t&&t.length?Q(Kr,{style:{padding:8},children:[b("p",{children:b("strong",{children:new Date(n).toLocaleDateString(o.language)})}),Q("p",{children:[r("weight"),": ",t[0].value]})]}):null},Wle=({weights:e,height:t})=>{t=t||300;const r=Lr(),[o,i]=Re(),[a,s]=X.useState(!1),[l,c]=X.useState(),u=()=>s(!1),d=[...e].sort((h,g)=>h.date.getTime()-g.date.getTime()).map(h=>({date:h.date.getTime(),weight:h.weight,entry:h}));function f(h,g){c(g.payload.entry),s(!0)}return Q("div",{children:[l&&b(ki,{title:o("edit"),isOpen:a,closeFn:u,children:b(Jy,{weightEntry:l})}),b(Fu,{height:t,children:Q(AB,{data:d,children:[b(uh,{type:"monotone",dataKey:"weight",stroke:r.palette.secondary.main,strokeWidth:2,dot:d.length>30?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6,onClick:f}}),b(Sf,{stroke:"#ccc",strokeDasharray:"5 5"}),b(Xa,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:h=>new Date(h).toLocaleDateString(i.language)}),b(Ja,{domain:["auto","auto"]}),b(ua,{content:b(Nst,{})})]})})]})},Gle=()=>{var n,r;const[e]=Re(),t=Y0("lastYear");return t.isLoading?b(wr,{}):((n=t.data)==null?void 0:n.length)!==void 0&&((r=t.data)==null?void 0:r.length)>0?b(Lst,{entries:t.data}):b(rj,{title:e("weight"),modalContent:b(Jy,{})})},Lst=e=>{const[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1),[i,a]=Re();return Q(xt,{children:[Q(fo,{children:[b(Vl,{title:i("weight"),subheader:"."}),Q(Pi,{sx:{height:"500px",overflow:"auto"},children:[b(Wle,{weights:e.entries,height:200}),b(en,{sx:{mt:2},children:b($st,{weights:e.entries})})]}),Q(Ys,{sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[b(at,{size:"small",href:Qt(Kt.WEIGHT_OVERVIEW,a.language),children:i("seeDetails")}),b(Do,{title:i("addEntry"),children:b(on,{onClick:r,children:b($o,{})})})]})]}),b(ki,{title:i("add"),isOpen:t,closeFn:o,children:b(Jy,{closeFn:o})})]})},Fst=()=>{const[e,t]=Re();return b(ZB,{callback:r=>{r!==null&&(window.location.href=Qt(Kt.INGREDIENT_DETAIL,t.language,{id:r.data.id}))}})};var a1={},BY;function jst(){if(BY)return a1;BY=1;var e=LZ();return a1.createRoot=e.createRoot,a1.hydrateRoot=e.hydrateRoot,a1}var bh=jst();const Bst=()=>Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:4},children:b(Ole,{})}),b(ye,{size:{xs:12,sm:4},children:b(Jse,{})}),b(ye,{size:{xs:12,sm:4},children:b(Gle,{})})]}),X0=w.createContext({}),qle=()=>{const{data:e,isLoading:t}=WT(),{selectedCategories:n,setSelectedCategories:r}=w.useContext(X0),[o]=Re(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?b(wr,{}):b(xa,{children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return b(Ka,{disablePadding:!0,children:Q(mf,{role:void 0,onClick:i(a),dense:!0,children:[b(si,{children:b(li,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`category-${a.id}`)}),b(uo,{id:s,primary:o(Ki(a.name))})]})},a.id)})})},zst=()=>{const[e]=Re();return Q($F,{children:[b(LF,{expandIcon:b(xy,{}),children:e("category")}),b(NF,{children:b(qle,{})})]})},Vst=()=>{const[e]=Re();return b("div",{"data-testid":"categories",children:Q(Kr,{children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:e("category")}),b(qle,{})]})})},Kle=()=>{const{data:e,isLoading:t}=GT(),{selectedEquipment:n,setSelectedEquipment:r}=w.useContext(X0),[o]=Re(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?b(wr,{}):b(xa,{sx:{maxHeight:"500px",overflowY:"auto"},children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return b(Ka,{disablePadding:!0,children:Q(mf,{role:void 0,onClick:i(a),dense:!0,children:[b(si,{children:b(li,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`muscle-${a.id}`)}),b(uo,{id:s,primary:o(Ki(a.name))})]})},a.id)})})},Hst=()=>{const[e]=Re();return Q($F,{children:[b(LF,{expandIcon:b(xy,{}),children:e("exercises.equipment")}),b(NF,{children:b(Kle,{})})]})},Ust=()=>{const[e]=Re();return b("div",{"data-testid":"equipment",children:Q(Kr,{sx:{mt:2},children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:e("exercises.equipment")}),b(Kle,{})]})})},Wst=se(({className:e,...t})=>b(Do,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${Vr.tooltip}`]:{backgroundColor:"rgb(245, 245, 245)",color:"rgba(0, 0, 0, 0.87)",boxShadow:e.shadows[1],fontSize:11}})),zl=({primaryMuscles:e,secondaryMuscles:t,isFront:n})=>{const r=[];r.push(...e.filter(i=>i.isFront===n).map(i=>`/muscles/main/muscle-${i.id}.svg`)),r.push(...t.filter(i=>i.isFront===n).map(i=>`/muscles/secondary/muscle-${i.id}.svg`)),r.push(n?"/muscles/muscular_system_front.svg":"/muscles/muscular_system_back.svg");const o=r.map(i=>`url(${Mke}${i})`).join(", ");return b("div",{style:{height:"400px",width:"200px",backgroundImage:o,backgroundRepeat:"no-repeat"}})},Yle=()=>{const{data:e,isLoading:t}=Yy(),{selectedMuscles:n,setSelectedMuscles:r}=w.useContext(X0),[o]=Re(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?b(wr,{}):b(xa,{sx:{maxHeight:"500px",overflowY:"auto"},children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return b(Ka,{disablePadding:!0,secondaryAction:b(Wst,{title:b(zl,{primaryMuscles:[a],secondaryMuscles:[],isFront:a.isFront}),placement:"right",arrow:!0,children:b(on,{edge:"end","aria-label":"comments",children:b(ule,{})})}),children:Q(mf,{role:void 0,onClick:i(a),dense:!0,children:[b(si,{children:b(li,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`muscle-${a.id}`)}),b(uo,{id:s,primary:a.name,secondary:a.nameEn!==""?o(Ki(a.nameEn)):""})]})},a.id)})})},Gst=()=>{const[e]=Re();return Q($F,{children:[b(LF,{expandIcon:b(xy,{}),children:e("exercises.muscles")}),b(NF,{children:b(Yle,{})})]})},qst=()=>{const[e]=Re();return b("div",{"data-testid":"muscles",children:Q(Kr,{sx:{mt:2},children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:e("exercises.muscles")}),b(Yle,{})]})})};function ty({callback:e,loadExercise:t}){const[n,r]=w.useState(null),[o,i]=w.useState(""),[a,s]=w.useState(!0),[l,c]=w.useState([]),[u,d]=Re();t=t===void 0?!1:t;const f=w.useMemo(()=>sT(h=>eAe(h,d.language,a).then(g=>c(g)),200),[d.language,a]);return w.useEffect(()=>{if(o===""){c(n?[n]:[]);return}return f(o),()=>{}},[n,o,f]),Q(xt,{children:[b($l,{id:"exercise-name-autocomplete",getOptionLabel:h=>h.value,"data-testid":"autocomplete",filterOptions:h=>h,options:l,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:n,noOptionsText:u("noResults"),isOptionEqualToValue:(h,g)=>h.value===g.value,onChange:async(h,g)=>{c(g?[g,...l]:l),r(g),t&&g!==null&&(g.exercise=await w0(g.data.base_id)),e(g)},onInputChange:(h,g)=>{i(g)},renderInput:h=>b(tn,{...h,label:u("exercises.searchExerciseName"),fullWidth:!0,slotProps:{input:{...h.InputProps,startAdornment:Q(xt,{children:[b(ro,{position:"start",children:b(JB,{})}),h.InputProps.startAdornment]})}}}),renderOption:(h,g,y)=>gF("li",{...h,key:`exercise-${y.index}-${g.data.id}`,"data-testid":`autocompleter-result-${g.data.base_id}`},Q(Ka,{disablePadding:!0,component:"div",children:[b(si,{children:g.data.image?b(Nl,{alt:"",src:`${cj}${g.data.image}`,variant:"rounded"}):b(_u,{fontSize:"large"})}),b(uo,{primary:g.value,primaryTypographyProps:{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},secondary:g.data.category})]}))}),d.language!==bg&&b(Fw,{children:b(ba,{control:b(li,{checked:a,onChange:(h,g)=>s(g)}),label:u("alsoSearchEnglish")})})]})}const Kst=e=>{const t=e.backgroundColor||"lightgray",n=e.iconColor||"gray",r=e.height||200;return b(en,{sx:{backgroundColor:t,height:r},display:"flex",alignItems:"center",justifyContent:"center",children:b(_u,{sx:{fontSize:80,color:n}})})},Qle=({exercise:e,language:t})=>{const n=t?e.getTranslation(t):e.getTranslation(new lj(Hp,"en","English")),[r,o]=Re();return b(fo,{sx:{width:"100%"},children:Q(hSe,{href:Qt(Kt.EXERCISE_DETAIL,o.language,{id:e.id,slug:n.nameSlug}),sx:{minHeight:330},children:[e.mainImage?b(Ec,{component:"img",image:e.mainImage.url,sx:{height:200},alt:""}):b(Ec,{children:b(Kst,{})}),Q(Pi,{children:[b(Do,{title:n.name,placement:"top",arrow:!0,children:b(tt,{gutterBottom:!0,variant:"h6",component:"div",noWrap:!0,children:n.name})}),b(Pu,{label:r(Ki(e.category.name)),sx:{position:"absolute",top:8,left:8},color:"primary",size:"small"},e.category.id),e.equipment.map(i=>b(tt,{display:"inline",mr:1,children:r(Ki(i.name))},i.id)),e.equipment.length===0&&b(tt,{color:"text.secondary",display:"inline",mr:1,children:r("exercises.noEquipment")})]})]})},e.id)},Yst=({exercises:e})=>{const t=$c(),[n,r]=Re();let o;return t.isSuccess&&(o=Tu(r.language,t.data)),b(ye,{container:!0,spacing:1,children:e.map(i=>b(ye,{sx:{display:"flex"},size:{xs:6,md:4},children:b(Qle,{exercise:i,language:o})},i.id))})},Qst=()=>b(ye,{container:!0,spacing:1,children:Array.apply(null,Array(21)).map((e,t)=>b(ye,{sx:{display:"flex"},size:4,children:Q(fo,{children:[b(Ec,{children:b(C1,{variant:"rectangular",width:250,height:150})}),b(Pi,{children:Q(en,{sx:{pt:.5},children:[b(C1,{width:"60%"}),b(C1,{})]})})]})},t))}),Xst=({children:e})=>{const[t]=Re(),[n,r]=w.useState(!1),o=i=>()=>{r(i)};return Q(xt,{children:[b(at,{onClick:o(!0),children:b(Rrt,{})}),Q(UCe,{open:n,onClose:o(!1),anchor:"right",children:[Q(_t,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:t("filters")}),b(at,{onClick:o(!1),children:b(y0,{})})]}),b(Ti,{}),e]})]})},Jst=()=>{const[e,t]=Re();return Q(en,{marginTop:4,padding:4,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[b(tt,{gutterBottom:!0,variant:"h4",component:"div",children:e("exercises.missingExercise")}),b(tt,{gutterBottom:!0,variant:"body1",component:"div",children:e("exercises.missingExerciseDescription")}),b(io,{to:Qt(Kt.EXERCISE_CONTRIBUTE,t.language),children:e("exercises.contributeExercise")})]})},Zst=()=>{const e=dle(),[t,n]=Re(),r=zu(),{selectedCategories:o,selectedEquipment:i,selectedMuscles:a}=w.useContext(X0),s=Zd("(max-width:600px)"),[l,c]=X.useState(1),u=(v,x)=>{c(x),window.scrollTo({top:0,behavior:"smooth"})};let d=w.useMemo(()=>{let v=e.data||[];return o.length>0&&(v=v.filter(x=>o.some(S=>x.category.id===S.id))),i.length>0&&(v=v.filter(x=>x.equipment.some(S=>i.some(C=>C.id===S.id)))),a.length>0&&(v=v.filter(x=>x.muscles.some(S=>a.some(C=>C.id===S.id)))),v},[e.data,o,i,a]);const f=21,h=Math.ceil(d.length/f),g=d.slice((l-1)*f,l*f),y=v=>{v&&r(Qt(Kt.EXERCISE_DETAIL,n.language,{id:v.data.base_id}))};return b(Iu,{maxWidth:"lg",children:Q(ye,{container:!0,spacing:2,mt:2,children:[b(ye,{size:{xs:10,sm:6},children:b(tt,{gutterBottom:!0,variant:"h3",component:"div",children:t("exercises.exercises")})}),s?Q(xt,{children:[b(ye,{size:{xs:2,sm:6},children:b(at,{variant:"contained",onClick:()=>r(Qt(Kt.EXERCISE_CONTRIBUTE,n.language)),children:b($o,{})})}),b(ye,{flexGrow:1,size:{sm:6},children:b(ty,{callback:y})}),b(ye,{display:"flex",justifyContent:"center",alignItems:"center",size:{xs:2,sm:6},children:Q(Xst,{children:[b(zst,{}),b(Hst,{}),b(Gst,{})]})})]}):Q(xt,{children:[b(ye,{size:{xs:12,sm:3},children:b(ty,{callback:y})}),b(ye,{size:{xs:12,sm:3},children:b(at,{variant:"contained",startIcon:b($o,{}),onClick:()=>r(Qt(Kt.EXERCISE_CONTRIBUTE,n.language)),children:t("exercises.contributeExercise")})})]}),!s&&b(ye,{size:{xs:12,sm:3},children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:{xs:6,sm:12},children:b(Vst,{})}),b(ye,{size:{xs:6,sm:12},children:b(Ust,{})}),b(ye,{size:12,children:b(qst,{})})]})}),Q(ye,{size:{xs:12,sm:9},children:[e.isLoading?b(Qst,{}):Q(xt,{children:[b(Yst,{exercises:g}),b(_t,{spacing:2,alignItems:"center",sx:{mt:2},children:b(aPe,{count:h,color:"primary",page:l,onChange:u})})]}),b(Jst,{})]})]})})},zY=()=>{const[e,t]=w.useState([]),[n,r]=w.useState([]),[o,i]=X.useState([]);return b(X0.Provider,{value:{selectedEquipment:e,setSelectedEquipment:t,selectedMuscles:n,setSelectedMuscles:r,selectedCategories:o,setSelectedCategories:i},children:b(Zst,{})})};function Xle(e){const{t}=Re();return Q(at,{size:"small",component:"a",href:e.href,children:[b(Irt,{fontSize:"inherit"}),e.backToTitle??t("goBack")]})}const es=e=>{const t=b(Xle,{href:e.backToUrl,backToTitle:e.backToTitle});return Q(Iu,{maxWidth:"lg",children:[Q(ye,{container:!0,spacing:2,children:[b(ye,{sx:{mb:2},size:8,children:Q(_t,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[Q(_t,{alignItems:"start",children:[b(tt,{variant:"h3",children:e.title}),e.subTitle&&b(tt,{variant:"h6",children:e.subTitle}),e.backToUrl&&t]}),e.optionsMenu]})}),b(ye,{size:{xs:12,sm:8},children:e.mainContent}),b(ye,{size:{xs:12,sm:4},children:e.sideBar})]}),e.fab]})},J0=e=>{const t=b(Xle,{href:e.backToUrl,backToTitle:e.backToTitle});return b(Iu,{maxWidth:e.maxWidth,children:Q(ye,{container:!0,spacing:2,children:[b(ye,{sx:{mb:2},size:12,children:Q(_t,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[Q(_t,{alignItems:"start",children:[b(tt,{variant:"h3",children:e.title}),e.backToUrl&&t]}),e.optionsMenu]})}),b(ye,{size:12,children:e.children})]})})};function Jle(){return br({queryKey:[Py],queryFn:O_e})}const elt=()=>{const e=Et();return It({mutationFn:t=>M_e(t),onSuccess:()=>e.invalidateQueries({queryKey:[Py]})})},tlt=e=>{const t=Et();return It({mutationFn:n=>A_e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[Ey,e]}),t.invalidateQueries({queryKey:[Py]})}})},nlt=e=>{const t=Et();return It({mutationFn:n=>R_e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[Ey,e]}),t.invalidateQueries({queryKey:[Py]})}})};function Zle(e){return br({queryKey:[Ey,e],queryFn:()=>k_e(e)})}const rlt=()=>{const e=Et();return It({mutationFn:t=>$_e(t),onError:t=>{console.log(t)},onSuccess:()=>{e.invalidateQueries({queryKey:[Ey]}),e.invalidateQueries({queryKey:[Py]})}})},ece=()=>{const e=Et();return It({mutationFn:t=>__e(t),onSuccess:()=>{e.invalidateQueries({queryKey:[Ey]}),e.invalidateQueries({queryKey:[Py]})}})},olt=()=>{const e=Et();return It({mutationFn:t=>D_e(t),onSuccess:()=>e.invalidateQueries({queryKey:[Ey]})})},tce=w.createContext(void 0);function wn(){const e=w.useContext(tce);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(`+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bat(e){return Nat(e)||Lat(e)||Fat(e)||jat()}var Yb="",FL="",Ble="",zle="",zat=Q0&&"ontouchstart"in document.documentElement;if(Q0){var Z_={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},Vat=document.createElement("p"),e$=Vat.style,Hat="Transform";for(var t$ in Z_)if(t$+Hat in e$){Yb=t$,FL=Z_[t$];break}Yb==="Webkit"&&"msHyphens"in e$&&(Yb="ms",FL=Z_.ms,zle="edge"),Yb==="Webkit"&&"-apple-trailing-word"in e$&&(Ble="apple")}var bn={js:Yb,css:FL,vendor:Ble,browser:zle,isTouch:zat};function Uat(e){return e[1]==="-"||bn.js==="ms"?e:"@"+bn.css+"keyframes"+e.substr(10)}var Wat={noPrefill:["appearance"],supportedProperty:function(t){return t!=="appearance"?!1:bn.js==="ms"?"-webkit-"+t:bn.css+t}},Gat={noPrefill:["color-adjust"],supportedProperty:function(t){return t!=="color-adjust"?!1:bn.js==="Webkit"?bn.css+"print-"+t:t}},qat=/[-\s]+(.)?/g;function Kat(e,t){return t?t.toUpperCase():""}function Tz(e){return e.replace(qat,Kat)}function af(e){return Tz("-"+e)}var Yat={noPrefill:["mask"],supportedProperty:function(t,n){if(!/^mask/.test(t))return!1;if(bn.js==="Webkit"){var r="mask-image";if(Tz(r)in n)return t;if(bn.js+af(r)in n)return bn.css+t}return t}},Qat={noPrefill:["text-orientation"],supportedProperty:function(t){return t!=="text-orientation"?!1:bn.vendor==="apple"&&!bn.isTouch?bn.css+t:t}},Xat={noPrefill:["transform"],supportedProperty:function(t,n,r){return t!=="transform"?!1:r.transform?t:bn.css+t}},Jat={noPrefill:["transition"],supportedProperty:function(t,n,r){return t!=="transition"?!1:r.transition?t:bn.css+t}},Zat={noPrefill:["writing-mode"],supportedProperty:function(t){return t!=="writing-mode"?!1:bn.js==="Webkit"||bn.js==="ms"&&bn.browser!=="edge"?bn.css+t:t}},est={noPrefill:["user-select"],supportedProperty:function(t){return t!=="user-select"?!1:bn.js==="Moz"||bn.js==="ms"||bn.vendor==="apple"?bn.css+t:t}},tst={supportedProperty:function(t,n){if(!/^break-/.test(t))return!1;if(bn.js==="Webkit"){var r="WebkitColumn"+af(t);return r in n?bn.css+"column-"+t:!1}if(bn.js==="Moz"){var o="page"+af(t);return o in n?"page-"+t:!1}return!1}},nst={supportedProperty:function(t,n){if(!/^(border|margin|padding)-inline/.test(t))return!1;if(bn.js==="Moz")return t;var r=t.replace("-inline","");return bn.js+af(r)in n?bn.css+r:!1}},rst={supportedProperty:function(t,n){return Tz(t)in n?t:!1}},ost={supportedProperty:function(t,n){var r=af(t);return t[0]==="-"||t[0]==="-"&&t[1]==="-"?t:bn.js+r in n?bn.css+t:bn.js!=="Webkit"&&"Webkit"+r in n?"-webkit-"+t:!1}},ist={supportedProperty:function(t){return t.substring(0,11)!=="scroll-snap"?!1:bn.js==="ms"?""+bn.css+t:t}},ast={supportedProperty:function(t){return t!=="overscroll-behavior"?!1:bn.js==="ms"?bn.css+"scroll-chaining":t}},sst={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},lst={supportedProperty:function(t,n){var r=sst[t];return r&&bn.js+af(r)in n?bn.css+r:!1}},Vle={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},cst=Object.keys(Vle),ust=function(t){return bn.css+t},dst={supportedProperty:function(t,n,r){var o=r.multiple;if(cst.indexOf(t)>-1){var i=Vle[t];if(!Array.isArray(i))return bn.js+af(i)in n?bn.css+i:!1;if(!o)return!1;for(var a=0;a<i.length;a++)if(!(bn.js+af(i[0])in n))return!1;return i.map(ust)}return!1}},Hle=[Wat,Gat,Yat,Qat,Xat,Jat,Zat,est,tst,nst,rst,ost,ist,ast,lst,dst],NY=Hle.filter(function(e){return e.supportedProperty}).map(function(e){return e.supportedProperty}),fst=Hle.filter(function(e){return e.noPrefill}).reduce(function(e,t){return e.push.apply(e,Bat(t.noPrefill)),e},[]),Qb,sp={};if(Q0){Qb=document.createElement("p");var n$=window.getComputedStyle(document.documentElement,"");for(var r$ in n$)isNaN(r$)||(sp[n$[r$]]=n$[r$]);fst.forEach(function(e){return delete sp[e]})}function jL(e,t){if(t===void 0&&(t={}),!Qb)return e;if(sp[e]!=null)return sp[e];(e==="transition"||e==="transform")&&(t[e]=e in Qb.style);for(var n=0;n<NY.length&&(sp[e]=NY[n](e,Qb.style,t),!sp[e]);n++);try{Qb.style[e]=""}catch{return!1}return sp[e]}var um={},pst={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},hst=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g,vd;function mst(e,t,n){if(t==="var")return"var";if(t==="all")return"all";if(n==="all")return", all";var r=t?jL(t):", "+jL(n);return r||t||n}Q0&&(vd=document.createElement("p"));function LY(e,t){var n=t;if(!vd||e==="content")return t;if(typeof n!="string"||!isNaN(parseInt(n,10)))return n;var r=e+n;if(um[r]!=null)return um[r];try{vd.style[e]=n}catch{return um[r]=!1,!1}if(pst[e])n=n.replace(hst,mst);else if(vd.style[e]===""&&(n=bn.css+n,n==="-ms-flex"&&(vd.style[e]="-ms-flexbox"),vd.style[e]=n,vd.style[e]===""))return um[r]=!1,!1;return vd.style[e]="",um[r]=n,um[r]}function gst(){function e(o){if(o.type==="keyframes"){var i=o;i.at=Uat(i.at)}}function t(o){for(var i in o){var a=o[i];if(i==="fallbacks"&&Array.isArray(a)){o[i]=a.map(t);continue}var s=!1,l=jL(i);l&&l!==i&&(s=!0);var c=!1,u=LY(l,_p(a));u&&u!==a&&(c=!0),(s||c)&&(s&&delete o[i],o[l||i]=u||a)}return o}function n(o,i){return i.type!=="style"?o:t(o)}function r(o,i){return LY(i,_p(o))||o}return{onProcessRule:e,onProcessStyle:n,onChangeValue:r}}function yst(){var e=function(n,r){return n.length===r.length?n>r?1:-1:n.length-r.length};return{onProcessStyle:function(n,r){if(r.type!=="style")return n;for(var o={},i=Object.keys(n).sort(e),a=0;a<i.length;a++)o[i[a]]=n[i[a]];return o}}}function vst(){return{plugins:[bat(),Pat(),Oat(),Rat(),$at(),typeof window>"u"?null:gst(),yst()]}}function Ule(e={}){const{baseClasses:t,newClasses:n,Component:r}=e;if(!n)return t;const o={...t};return Object.keys(n).forEach(i=>{n[i]&&(o[i]=`${t[i]} ${n[i]}`)}),o}const Rm={set:(e,t,n,r)=>{let o=e.get(t);o||(o=new Map,e.set(t,o)),o.set(n,r)},get:(e,t,n)=>{const r=e.get(t);return r?r.get(n):void 0},delete:(e,t,n)=>{e.get(t).delete(n)}};function bst(){const e=yI();return(e==null?void 0:e.$$material)??e}const wst=_le(vst()),xst=Rit(),Sst=new Map,Cst={disableGeneration:!1,generateClassName:xst,jss:wst,sheetsCache:null,sheetsManager:Sst,sheetsRegistry:null},Est=w.createContext(Cst);let FY=-1e9;function Pst(){return FY+=1,FY}function jY(e){return e.length===0}function Ist(e){const{variant:t,...n}=e;let r=t||"";return Object.keys(n).sort().forEach(o=>{o==="color"?r+=jY(r)?e[o]:we(e[o]):r+=`${jY(r)?o:we(o)}${we(e[o].toString())}`}),r}const Tst={};function Ost(e){const t=typeof e=="function";return{create:(n,r)=>{let o;try{o=t?e(n):e}catch(l){throw l}if(!r||!n.components||!n.components[r]||!n.components[r].styleOverrides&&!n.components[r].variants)return o;const i=n.components[r].styleOverrides||{},a=n.components[r].variants||[],s={...o};return Object.keys(i).forEach(l=>{s[l]=xo(s[l]||{},i[l])}),a.forEach(l=>{const c=Ist(l.props);s[c]=xo(s[c]||{},l.style)}),s},options:{}}}function kst({state:e,stylesOptions:t},n,r){if(t.disableGeneration)return n||{};e.cacheClasses||(e.cacheClasses={value:null,lastProp:null,lastJSS:{}});let o=!1;return e.classes!==e.cacheClasses.lastJSS&&(e.cacheClasses.lastJSS=e.classes,o=!0),n!==e.cacheClasses.lastProp&&(e.cacheClasses.lastProp=n,o=!0),o&&(e.cacheClasses.value=Ule({baseClasses:e.cacheClasses.lastJSS,newClasses:n,Component:r})),e.cacheClasses.value}function Mst({state:e,theme:t,stylesOptions:n,stylesCreator:r,name:o},i){if(n.disableGeneration)return;let a=Rm.get(n.sheetsManager,r,t);a||(a={refs:0,staticSheet:null,dynamicStyles:null},Rm.set(n.sheetsManager,r,t,a));const s={...r.options,...n,theme:t,flip:typeof n.flip=="boolean"?n.flip:t.direction==="rtl"};s.generateId=s.serverGenerateClassName||s.generateClassName;const l=n.sheetsRegistry;if(a.refs===0){let c;n.sheetsCache&&(c=Rm.get(n.sheetsCache,r,t));const u=r.create(t,o);c||(c=n.jss.createStyleSheet(u,{link:!1,...s}),c.attach(),n.sheetsCache&&Rm.set(n.sheetsCache,r,t,c)),l&&l.add(c),a.staticSheet=c,a.dynamicStyles=$le(u)}if(a.dynamicStyles){const c=n.jss.createStyleSheet(a.dynamicStyles,{link:!0,...s});c.update(i),c.attach(),e.dynamicSheet=c,e.classes=Ule({baseClasses:a.staticSheet.classes,newClasses:c.classes}),l&&l.add(c)}else e.classes=a.staticSheet.classes;a.refs+=1}function Ast({state:e},t){e.dynamicSheet&&e.dynamicSheet.update(t)}function Rst({state:e,theme:t,stylesOptions:n,stylesCreator:r}){if(n.disableGeneration)return;const o=Rm.get(n.sheetsManager,r,t);o.refs-=1;const i=n.sheetsRegistry;o.refs===0&&(Rm.delete(n.sheetsManager,r,t),n.jss.removeStyleSheet(o.staticSheet),i&&i.remove(o.staticSheet)),e.dynamicSheet&&(n.jss.removeStyleSheet(e.dynamicSheet),i&&i.remove(e.dynamicSheet))}function Dst(e,t){const n=w.useRef([]);let r;const o=w.useMemo(()=>({}),t);n.current!==o&&(n.current=o,r=e()),w.useEffect(()=>()=>{r&&r()},[o])}function Oz(e,t={}){const{name:n,classNamePrefix:r,Component:o,defaultTheme:i=Tst,...a}=t,s=Ost(e),l=n||r||"makeStyles";return s.options={index:Pst(),name:n,meta:l,classNamePrefix:l},(u={})=>{const d=bst()||i,f={...w.useContext(Est),...a},h=w.useRef(),g=w.useRef();return Dst(()=>{const v={name:n,state:{},stylesCreator:s,stylesOptions:f,theme:d};return Mst(v,u),g.current=!1,h.current=v,()=>{Rst(v)}},[d,s]),w.useEffect(()=>{g.current&&Ast(h.current,u),g.current=!0}),kst(h.current,u.classes,o)}}const _st=Oz(e=>({table:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),$st=({weights:e})=>{const[t]=Re(),n=_st(),o=e.slice(0,5);return b("div",{className:n.table,children:b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{align:"center",children:t("date")}),b(Te,{align:"center",children:t("weight")})]})}),b(Fl,{children:o.map(i=>Q(Zt,{children:[b(Te,{align:"center",children:i.date.toLocaleDateString()}),b(Te,{align:"center",children:i.weight})]},i.date.toLocaleDateString()))})]})})})},Nst=({active:e,payload:t,label:n})=>{const[r,o]=Re();return e&&t&&t.length?Q(Kr,{style:{padding:8},children:[b("p",{children:b("strong",{children:new Date(n).toLocaleDateString(o.language)})}),Q("p",{children:[r("weight"),": ",t[0].value]})]}):null},Wle=({weights:e,height:t})=>{t=t||300;const r=Lr(),[o,i]=Re(),[a,s]=X.useState(!1),[l,c]=X.useState(),u=()=>s(!1),d=[...e].sort((h,g)=>h.date.getTime()-g.date.getTime()).map(h=>({date:h.date.getTime(),weight:h.weight,entry:h}));function f(h,g){c(g.payload.entry),s(!0)}return Q("div",{children:[l&&b(ki,{title:o("edit"),isOpen:a,closeFn:u,children:b(Jy,{weightEntry:l})}),b(Fu,{height:t,children:Q(AB,{data:d,children:[b(uh,{type:"monotone",dataKey:"weight",stroke:r.palette.secondary.main,strokeWidth:2,dot:d.length>30?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6,onClick:f}}),b(Sf,{stroke:"#ccc",strokeDasharray:"5 5"}),b(Xa,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:h=>new Date(h).toLocaleDateString(i.language)}),b(Ja,{domain:["auto","auto"]}),b(ua,{content:b(Nst,{})})]})})]})},Gle=()=>{var n,r;const[e]=Re(),t=Y0("lastYear");return t.isLoading?b(wr,{}):((n=t.data)==null?void 0:n.length)!==void 0&&((r=t.data)==null?void 0:r.length)>0?b(Lst,{entries:t.data}):b(rj,{title:e("weight"),modalContent:b(Jy,{})})},Lst=e=>{const[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1),[i,a]=Re();return Q(xt,{children:[Q(fo,{children:[b(Vl,{title:i("weight"),subheader:"."}),Q(Pi,{sx:{height:"500px",overflow:"auto"},children:[b(Wle,{weights:e.entries,height:200}),b(en,{sx:{mt:2},children:b($st,{weights:e.entries})})]}),Q(Ys,{sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[b(at,{size:"small",href:Qt(Kt.WEIGHT_OVERVIEW,a.language),children:i("seeDetails")}),b(Do,{title:i("addEntry"),children:b(on,{onClick:r,children:b($o,{})})})]})]}),b(ki,{title:i("add"),isOpen:t,closeFn:o,children:b(Jy,{closeFn:o})})]})},Fst=()=>{const[e,t]=Re();return b(ZB,{callback:r=>{r!==null&&(window.location.href=Qt(Kt.INGREDIENT_DETAIL,t.language,{id:r.data.id}))}})};var a1={},BY;function jst(){if(BY)return a1;BY=1;var e=LZ();return a1.createRoot=e.createRoot,a1.hydrateRoot=e.hydrateRoot,a1}var bh=jst();const Bst=()=>Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:4},children:b(Ole,{})}),b(ye,{size:{xs:12,sm:4},children:b(Jse,{})}),b(ye,{size:{xs:12,sm:4},children:b(Gle,{})})]}),X0=w.createContext({}),qle=()=>{const{data:e,isLoading:t}=WT(),{selectedCategories:n,setSelectedCategories:r}=w.useContext(X0),[o]=Re(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?b(wr,{}):b(xa,{children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return b(Ka,{disablePadding:!0,children:Q(mf,{role:void 0,onClick:i(a),dense:!0,children:[b(si,{children:b(li,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`category-${a.id}`)}),b(uo,{id:s,primary:o(Ki(a.name))})]})},a.id)})})},zst=()=>{const[e]=Re();return Q($F,{children:[b(LF,{expandIcon:b(xy,{}),children:e("category")}),b(NF,{children:b(qle,{})})]})},Vst=()=>{const[e]=Re();return b("div",{"data-testid":"categories",children:Q(Kr,{children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:e("category")}),b(qle,{})]})})},Kle=()=>{const{data:e,isLoading:t}=GT(),{selectedEquipment:n,setSelectedEquipment:r}=w.useContext(X0),[o]=Re(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?b(wr,{}):b(xa,{sx:{maxHeight:"500px",overflowY:"auto"},children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return b(Ka,{disablePadding:!0,children:Q(mf,{role:void 0,onClick:i(a),dense:!0,children:[b(si,{children:b(li,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`muscle-${a.id}`)}),b(uo,{id:s,primary:o(Ki(a.name))})]})},a.id)})})},Hst=()=>{const[e]=Re();return Q($F,{children:[b(LF,{expandIcon:b(xy,{}),children:e("exercises.equipment")}),b(NF,{children:b(Kle,{})})]})},Ust=()=>{const[e]=Re();return b("div",{"data-testid":"equipment",children:Q(Kr,{sx:{mt:2},children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:e("exercises.equipment")}),b(Kle,{})]})})},Wst=se(({className:e,...t})=>b(Do,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${Vr.tooltip}`]:{backgroundColor:"rgb(245, 245, 245)",color:"rgba(0, 0, 0, 0.87)",boxShadow:e.shadows[1],fontSize:11}})),zl=({primaryMuscles:e,secondaryMuscles:t,isFront:n})=>{const r=[];r.push(...e.filter(i=>i.isFront===n).map(i=>`/muscles/main/muscle-${i.id}.svg`)),r.push(...t.filter(i=>i.isFront===n).map(i=>`/muscles/secondary/muscle-${i.id}.svg`)),r.push(n?"/muscles/muscular_system_front.svg":"/muscles/muscular_system_back.svg");const o=r.map(i=>`url(${Mke}${i})`).join(", ");return b("div",{style:{height:"400px",width:"200px",backgroundImage:o,backgroundRepeat:"no-repeat"}})},Yle=()=>{const{data:e,isLoading:t}=Yy(),{selectedMuscles:n,setSelectedMuscles:r}=w.useContext(X0),[o]=Re(),i=a=>()=>{const s=n.indexOf(a),l=[...n];s===-1?l.push(a):l.splice(s,1),r(l)};return t?b(wr,{}):b(xa,{sx:{maxHeight:"500px",overflowY:"auto"},children:e.map(a=>{const s=`checkbox-list-label-${a.id}`;return b(Ka,{disablePadding:!0,secondaryAction:b(Wst,{title:b(zl,{primaryMuscles:[a],secondaryMuscles:[],isFront:a.isFront}),placement:"right",arrow:!0,children:b(on,{edge:"end","aria-label":"comments",children:b(ule,{})})}),children:Q(mf,{role:void 0,onClick:i(a),dense:!0,children:[b(si,{children:b(li,{edge:"start",checked:n.indexOf(a)!==-1,tabIndex:-1,disableRipple:!0,inputProps:{"aria-labelledby":s}},`muscle-${a.id}`)}),b(uo,{id:s,primary:a.name,secondary:a.nameEn!==""?o(Ki(a.nameEn)):""})]})},a.id)})})},Gst=()=>{const[e]=Re();return Q($F,{children:[b(LF,{expandIcon:b(xy,{}),children:e("exercises.muscles")}),b(NF,{children:b(Yle,{})})]})},qst=()=>{const[e]=Re();return b("div",{"data-testid":"muscles",children:Q(Kr,{sx:{mt:2},children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:e("exercises.muscles")}),b(Yle,{})]})})};function ty({callback:e,loadExercise:t}){const[n,r]=w.useState(null),[o,i]=w.useState(""),[a,s]=w.useState(!0),[l,c]=w.useState([]),[u,d]=Re();t=t===void 0?!1:t;const f=w.useMemo(()=>sT(h=>eAe(h,d.language,a).then(g=>c(g)),200),[d.language,a]);return w.useEffect(()=>{if(o===""){c(n?[n]:[]);return}return f(o),()=>{}},[n,o,f]),Q(xt,{children:[b($l,{id:"exercise-name-autocomplete",getOptionLabel:h=>h.value,"data-testid":"autocomplete",filterOptions:h=>h,options:l,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:n,noOptionsText:u("noResults"),isOptionEqualToValue:(h,g)=>h.value===g.value,onChange:async(h,g)=>{c(g?[g,...l]:l),r(g),t&&g!==null&&(g.exercise=await w0(g.data.base_id)),e(g)},onInputChange:(h,g)=>{i(g)},renderInput:h=>b(tn,{...h,label:u("exercises.searchExerciseName"),fullWidth:!0,slotProps:{input:{...h.InputProps,startAdornment:Q(xt,{children:[b(ro,{position:"start",children:b(JB,{})}),h.InputProps.startAdornment]})}}}),renderOption:(h,g,y)=>gF("li",{...h,key:`exercise-${y.index}-${g.data.id}`,"data-testid":`autocompleter-result-${g.data.base_id}`},Q(Ka,{disablePadding:!0,component:"div",children:[b(si,{children:g.data.image?b(Nl,{alt:"",src:`${cj}${g.data.image}`,variant:"rounded"}):b(_u,{fontSize:"large"})}),b(uo,{primary:g.value,primaryTypographyProps:{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},secondary:g.data.category})]}))}),d.language!==bg&&b(Fw,{children:b(ba,{control:b(li,{checked:a,onChange:(h,g)=>s(g)}),label:u("alsoSearchEnglish")})})]})}const Kst=e=>{const t=e.backgroundColor||"lightgray",n=e.iconColor||"gray",r=e.height||200;return b(en,{sx:{backgroundColor:t,height:r},display:"flex",alignItems:"center",justifyContent:"center",children:b(_u,{sx:{fontSize:80,color:n}})})},Qle=({exercise:e,language:t})=>{const n=t?e.getTranslation(t):e.getTranslation(new lj(Hp,"en","English")),[r,o]=Re();return b(fo,{sx:{width:"100%"},children:Q(hSe,{href:Qt(Kt.EXERCISE_DETAIL,o.language,{id:e.id,slug:n.nameSlug}),sx:{minHeight:330},children:[e.mainImage?b(Ec,{component:"img",image:e.mainImage.url,sx:{height:200},alt:""}):b(Ec,{children:b(Kst,{})}),Q(Pi,{children:[b(Do,{title:n.name,placement:"top",arrow:!0,children:b(tt,{gutterBottom:!0,variant:"h6",component:"div",noWrap:!0,children:n.name})}),b(Pu,{label:r(Ki(e.category.name)),sx:{position:"absolute",top:8,left:8},color:"primary",size:"small"},e.category.id),e.equipment.map(i=>b(tt,{display:"inline",mr:1,children:r(Ki(i.name))},i.id)),e.equipment.length===0&&b(tt,{color:"text.secondary",display:"inline",mr:1,children:r("exercises.noEquipment")})]})]})},e.id)},Yst=({exercises:e})=>{const t=$c(),[n,r]=Re();let o;return t.isSuccess&&(o=Tu(r.language,t.data)),b(ye,{container:!0,spacing:1,children:e.map(i=>b(ye,{sx:{display:"flex"},size:{xs:6,md:4},children:b(Qle,{exercise:i,language:o})},i.id))})},Qst=()=>b(ye,{container:!0,spacing:1,children:Array.apply(null,Array(21)).map((e,t)=>b(ye,{sx:{display:"flex"},size:4,children:Q(fo,{children:[b(Ec,{children:b(C1,{variant:"rectangular",width:250,height:150})}),b(Pi,{children:Q(en,{sx:{pt:.5},children:[b(C1,{width:"60%"}),b(C1,{})]})})]})},t))}),Xst=({children:e})=>{const[t]=Re(),[n,r]=w.useState(!1),o=i=>()=>{r(i)};return Q(xt,{children:[b(at,{onClick:o(!0),children:b(Rrt,{})}),Q(UCe,{open:n,onClose:o(!1),anchor:"right",children:[Q(_t,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[b(tt,{gutterBottom:!0,variant:"h6",m:2,children:t("filters")}),b(at,{onClick:o(!1),children:b(y0,{})})]}),b(Ti,{}),e]})]})},Jst=()=>{const[e,t]=Re();return Q(en,{marginTop:4,padding:4,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[b(tt,{gutterBottom:!0,variant:"h4",component:"div",children:e("exercises.missingExercise")}),b(tt,{gutterBottom:!0,variant:"body1",component:"div",children:e("exercises.missingExerciseDescription")}),b(lo,{to:Qt(Kt.EXERCISE_CONTRIBUTE,t.language),children:e("exercises.contributeExercise")})]})},Zst=()=>{const e=dle(),[t,n]=Re(),r=zu(),{selectedCategories:o,selectedEquipment:i,selectedMuscles:a}=w.useContext(X0),s=Zd("(max-width:600px)"),[l,c]=X.useState(1),u=(v,x)=>{c(x),window.scrollTo({top:0,behavior:"smooth"})};let d=w.useMemo(()=>{let v=e.data||[];return o.length>0&&(v=v.filter(x=>o.some(S=>x.category.id===S.id))),i.length>0&&(v=v.filter(x=>x.equipment.some(S=>i.some(C=>C.id===S.id)))),a.length>0&&(v=v.filter(x=>x.muscles.some(S=>a.some(C=>C.id===S.id)))),v},[e.data,o,i,a]);const f=21,h=Math.ceil(d.length/f),g=d.slice((l-1)*f,l*f),y=v=>{v&&r(Qt(Kt.EXERCISE_DETAIL,n.language,{id:v.data.base_id}))};return b(Iu,{maxWidth:"lg",children:Q(ye,{container:!0,spacing:2,mt:2,children:[b(ye,{size:{xs:10,sm:6},children:b(tt,{gutterBottom:!0,variant:"h3",component:"div",children:t("exercises.exercises")})}),s?Q(xt,{children:[b(ye,{size:{xs:2,sm:6},children:b(at,{variant:"contained",onClick:()=>r(Qt(Kt.EXERCISE_CONTRIBUTE,n.language)),children:b($o,{})})}),b(ye,{flexGrow:1,size:{sm:6},children:b(ty,{callback:y})}),b(ye,{display:"flex",justifyContent:"center",alignItems:"center",size:{xs:2,sm:6},children:Q(Xst,{children:[b(zst,{}),b(Hst,{}),b(Gst,{})]})})]}):Q(xt,{children:[b(ye,{size:{xs:12,sm:3},children:b(ty,{callback:y})}),b(ye,{size:{xs:12,sm:3},children:b(at,{variant:"contained",startIcon:b($o,{}),onClick:()=>r(Qt(Kt.EXERCISE_CONTRIBUTE,n.language)),children:t("exercises.contributeExercise")})})]}),!s&&b(ye,{size:{xs:12,sm:3},children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:{xs:6,sm:12},children:b(Vst,{})}),b(ye,{size:{xs:6,sm:12},children:b(Ust,{})}),b(ye,{size:12,children:b(qst,{})})]})}),Q(ye,{size:{xs:12,sm:9},children:[e.isLoading?b(Qst,{}):Q(xt,{children:[b(Yst,{exercises:g}),b(_t,{spacing:2,alignItems:"center",sx:{mt:2},children:b(aPe,{count:h,color:"primary",page:l,onChange:u})})]}),b(Jst,{})]})]})})},zY=()=>{const[e,t]=w.useState([]),[n,r]=w.useState([]),[o,i]=X.useState([]);return b(X0.Provider,{value:{selectedEquipment:e,setSelectedEquipment:t,selectedMuscles:n,setSelectedMuscles:r,selectedCategories:o,setSelectedCategories:i},children:b(Zst,{})})};function Xle(e){const{t}=Re();return Q(at,{size:"small",component:"a",href:e.href,children:[b(Irt,{fontSize:"inherit"}),e.backToTitle??t("goBack")]})}const es=e=>{const t=b(Xle,{href:e.backToUrl,backToTitle:e.backToTitle});return Q(Iu,{maxWidth:"lg",children:[Q(ye,{container:!0,spacing:2,children:[b(ye,{sx:{mb:2},size:8,children:Q(_t,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[Q(_t,{alignItems:"start",children:[b(tt,{variant:"h3",children:e.title}),e.subTitle&&b(tt,{variant:"h6",children:e.subTitle}),e.backToUrl&&t]}),e.optionsMenu]})}),b(ye,{size:{xs:12,sm:8},children:e.mainContent}),b(ye,{size:{xs:12,sm:4},children:e.sideBar})]}),e.fab]})},J0=e=>{const t=b(Xle,{href:e.backToUrl,backToTitle:e.backToTitle});return b(Iu,{maxWidth:e.maxWidth,children:Q(ye,{container:!0,spacing:2,children:[b(ye,{sx:{mb:2},size:12,children:Q(_t,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[Q(_t,{alignItems:"start",children:[b(tt,{variant:"h3",children:e.title}),e.backToUrl&&t]}),e.optionsMenu]})}),b(ye,{size:12,children:e.children})]})})};function Jle(){return br({queryKey:[Py],queryFn:O_e})}const elt=()=>{const e=Et();return It({mutationFn:t=>M_e(t),onSuccess:()=>e.invalidateQueries({queryKey:[Py]})})},tlt=e=>{const t=Et();return It({mutationFn:n=>A_e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[Ey,e]}),t.invalidateQueries({queryKey:[Py]})}})},nlt=e=>{const t=Et();return It({mutationFn:n=>R_e(n),onSuccess:()=>{t.invalidateQueries({queryKey:[Ey,e]}),t.invalidateQueries({queryKey:[Py]})}})};function Zle(e){return br({queryKey:[Ey,e],queryFn:()=>k_e(e)})}const rlt=()=>{const e=Et();return It({mutationFn:t=>$_e(t),onError:t=>{console.log(t)},onSuccess:()=>{e.invalidateQueries({queryKey:[Ey]}),e.invalidateQueries({queryKey:[Py]})}})},ece=()=>{const e=Et();return It({mutationFn:t=>__e(t),onSuccess:()=>{e.invalidateQueries({queryKey:[Ey]}),e.invalidateQueries({queryKey:[Py]})}})},olt=()=>{const e=Et();return It({mutationFn:t=>D_e(t),onSuccess:()=>e.invalidateQueries({queryKey:[Ey]})})},tce=w.createContext(void 0);function wn(){const e=w.useContext(tce);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(``));return e}const nce=w.createContext(void 0),Rt=()=>{const e=w.useContext(nce);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},ilt=parseInt(w.version,10),Nn=e=>{if(ilt>=19){const t=n=>e(n,n.ref??null);return t.displayName=e.displayName??e.name,t}return w.forwardRef(e)};var RP=Symbol("NOT_FOUND");function alt(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function slt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function llt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var VY=e=>Array.isArray(e)?e:[e];function clt(e){const t=Array.isArray(e[0])?e[0]:e;return llt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ult(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function dlt(e){let t;return{get(n){return t&&e(t.key,n)?t.value:RP},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function flt(e,t){let n=[];function r(s){const l=n.findIndex(c=>t(s,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return RP}function o(s,l){r(s)===RP&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:o,getEntries:i,clear:a}}var plt=(e,t)=>e===t;function hlt(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let i=0;i<o;i++)if(!e(n[i],r[i]))return!1;return!0}}function rce(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=plt,maxSize:o=1,resultEqualityCheck:i}=n,a=hlt(r);let s=0;const l=o<=1?dlt(a):flt(o,a);function c(){let u=l.get(arguments);if(u===RP){if(u=e.apply(null,arguments),s++,i){const f=l.getEntries().find(h=>i(h.value,u));f&&(u=f.value,s!==0&&s--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}var mlt=class{constructor(e){this.value=e}deref(){return this.value}},glt=typeof WeakRef<"u"?WeakRef:mlt,ylt=0,HY=1;function s1(){return{s:ylt,v:void 0,o:null,p:null}}function oce(e,t={}){let n=s1();const{resultEqualityCheck:r}=t;let o,i=0;function a(){var d;let s=n;const{length:l}=arguments;for(let f=0,h=l;f<h;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);const v=y.get(g);v===void 0?(s=s1(),y.set(g,s)):s=v}else{let y=s.p;y===null&&(s.p=y=new Map);const v=y.get(g);v===void 0?(s=s1(),y.set(g,s)):s=v}}const c=s;let u;if(s.s===HY)u=s.v;else if(u=e.apply(null,arguments),i++,r){const f=((d=o==null?void 0:o.deref)==null?void 0:d.call(o))??o;f!=null&&r(f,u)&&(u=f,i!==0&&i--),o=typeof u=="object"&&u!==null||typeof u=="function"?new glt(u):u}return c.s=HY,c.v=u,u}return a.clearCache=()=>{n=s1(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function ice(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let i=0,a=0,s,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),alt(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:h=oce,argsMemoizeOptions:g=[]}=u,y=VY(f),v=VY(g),x=clt(o),S=d(function(){return i++,c.apply(null,arguments)},...y),C=h(function(){a++;const E=ult(x,arguments);return s=S.apply(null,E),s},...v);return Object.assign(C,{resultFunc:c,memoizedResultFunc:S,dependencies:x,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:d,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var ace=ice(oce),vlt=Object.assign((e,t=ace)=>{slt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((a,s,l)=>(a[n[l]]=s,a),{}))},{withTypes:()=>vlt});const blt=Object.is;function sce(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const o in e)if(n+=1,!blt(e[o],t[o])||!(o in t))return!1;for(const o in t)r+=1;return n===r}var o$={exports:{}},i$={};/*** @license React* use-sync-external-store-shim.production.js@@ -412,7 +412,7 @@ return result$$;`.replaceAll("$$",String(tQ)));return tQ+=1,(s,l)=>i(o,s,l)},Pce`))}const JT=(e,t,n)=>{const r=t?t(e):e.id;return _ct(r,e,n),r},z1=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={},a={};for(let s=0;s<e.length;s+=1){const l=e[s],c=JT(l,t);i[c]=l,a[c]=c,o.rows.push(c)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:o,dataRowIdToIdLookup:a,dataRowIdToModelLookup:i}},Ice=({tree:e,rowCountProp:t=0})=>{const n=e[ii];return Math.max(t,n.children.length+(n.footerId==null?0:1))},Tce=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o,previousGroupsToFetch:i})=>{const a=e.current.caches.rows,{tree:s,treeDepths:l,dataRowIds:c,groupingName:u,groupsToFetch:d=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:a.updates,dataRowIdToIdLookup:a.dataRowIdToIdLookup,dataRowIdToModelLookup:a.dataRowIdToModelLookup,previousGroupsToFetch:i}),f=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:s,treeDepths:l,dataRowIdToIdLookup:a.dataRowIdToIdLookup,dataRowIds:c,dataRowIdToModelLookup:a.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},F({},f,{totalRowCount:Math.max(t,f.dataRowIds.length),totalTopLevelRowCount:Ice({tree:f.tree,rowCountProp:t}),groupingName:u,loading:n,groupsToFetch:d})},ry=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,Nz=(e,t,n)=>{const r=e[t];if(r.type!=="group")return[];const o=[];for(let i=0;i<r.children.length;i+=1){const a=r.children[i];(!n||!ry(e[a]))&&o.push(a);const s=Nz(e,a,n);for(let l=0;l<s.length;l+=1)o.push(s[l])}return!n&&r.footerId!=null&&o.push(r.footerId),o},aQ=({previousCache:e,getRowId:t,updates:n,groupKeys:r})=>{if(e.updates.type==="full")throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const o=new Map;n.forEach(u=>{const d=JT(u,t,"A row was provided without id when calling updateRows():");o.has(d)?o.set(d,F({},o.get(d),u)):o.set(d,u)});const i={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:F({},e.updates.idToActionLookup),groupKeys:r},a=F({},e.dataRowIdToModelLookup),s=F({},e.dataRowIdToIdLookup),l={insert:{},modify:{},remove:{}};o.forEach((u,d)=>{const f=i.idToActionLookup[d];if(u._action==="delete"){if(f==="remove"||!a[d])return;f!=null&&(l[f][d]=!0),i.actions.remove.push(d),delete a[d],delete s[d];return}const h=a[d];if(h){f==="remove"?(l.remove[d]=!0,i.actions.modify.push(d)):f==null&&i.actions.modify.push(d),a[d]=F({},h,u);return}f==="remove"?(l.remove[d]=!0,i.actions.insert.push(d)):f==null&&i.actions.insert.push(d),a[d]=u,s[d]=d});const c=Object.keys(l);for(let u=0;u<c.length;u+=1){const d=c[u],f=l[d];Object.keys(f).length>0&&(i.actions[d]=i.actions[d].filter(h=>!f[h]))}return{dataRowIdToModelLookup:a,dataRowIdToIdLookup:s,updates:i,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},Oce="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function sQ(e,t,n){const r=[];return t.forEach(o=>{const i=JT(o,n,"A row was provided without id when calling updateRows():"),a=e.current.getRowNode(i);if((a==null?void 0:a.type)==="pinnedRow"){const s=e.current.caches.pinnedRows,l=s.idLookup[i];l&&(s.idLookup[i]=F({},l,o))}else r.push(o)}),r}const kce=(e,t,n)=>typeof e=="number"&&e>0?e:t,$ct="__tree_data_group__",Mce="__row_group_by_columns_group__",ZT="__detail_panel_toggle__";let Sn=function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e}({});const Nct=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"],Lct=e=>{const{classes:t}=e;return Oe({root:["booleanCell"]},kn,t)};function Fct(e){const{value:t,rowNode:n}=e,r=We(e,Nct),o=wn(),i=Rt(),a={classes:i.classes},s=Lct(a),c=Ke(o,wh)>0&&n.type==="group"&&i.treeData===!1,u=w.useMemo(()=>t?i.slots.booleanCellTrueIcon:i.slots.booleanCellFalseIcon,[i.slots.booleanCellFalseIcon,i.slots.booleanCellTrueIcon,t]);return c&&t===void 0?null:_.jsx(u,F({fontSize:"small",className:s.root,titleAccess:o.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},r))}const jct=w.memo(Fct),Bct=e=>e.field!==Mce&&ry(e.rowNode)?"":_.jsx(jct,F({},e)),zct=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],Vct=e=>{const{classes:t}=e;return Oe({root:["editBooleanCell"]},kn,t)};function Hct(e){var x;const{id:t,value:n,field:r,className:o,hasFocus:i,onValueChange:a}=e,s=We(e,zct),l=wn(),c=w.useRef(null),u=Dn(),[d,f]=w.useState(n),h=Rt(),g={classes:h.classes},y=Vct(g),v=w.useCallback(async S=>{const C=S.target.checked;a&&await a(S,C),f(C),await l.current.setEditCellValue({id:t,field:r,value:C},S)},[l,r,t,a]);return w.useEffect(()=>{f(n)},[n]),On(()=>{i&&c.current.focus()},[i]),_.jsx("label",F({htmlFor:u,className:fe(y.root,o)},s,{children:_.jsx(h.slots.baseCheckbox,F({id:u,inputRef:c,checked:!!d,onChange:v,size:"small"},(x=h.slotProps)==null?void 0:x.baseCheckbox))}))}const Uct=e=>_.jsx(Hct,F({},e)),Wct=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],V1=e=>{if(String(e).toLowerCase()==="true")return!0;if(String(e).toLowerCase()==="false")return!1},Gct=se("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function qct(e){var I,E,T;const{item:t,applyValue:n,apiRef:r,focusElementRef:o,clearButton:i,tabIndex:a,label:s,variant:l="standard"}=e,c=We(e,Wct),[u,d]=w.useState(V1(t.value)),f=Rt(),h=Dn(),g=Dn(),y=((I=f.slotProps)==null?void 0:I.baseSelect)||{},v=y.native??!1,x=((E=f.slotProps)==null?void 0:E.baseSelectOption)||{},S=w.useCallback(O=>{const A=V1(O.target.value);d(A),n(F({},t,{value:A}))},[n,t]);w.useEffect(()=>{d(V1(t.value))},[t.value]);const C=s??r.current.getLocaleText("filterPanelInputLabel");return _.jsxs(Gct,{children:[_.jsxs(f.slots.baseFormControl,{fullWidth:!0,children:[_.jsx(f.slots.baseInputLabel,F({},(T=f.slotProps)==null?void 0:T.baseInputLabel,{id:h,shrink:!0,variant:l,children:C})),_.jsxs(f.slots.baseSelect,F({labelId:h,id:g,label:C,value:u===void 0?"":String(u),onChange:S,variant:l,notched:l==="outlined"?!0:void 0,native:v,displayEmpty:!0,inputProps:{ref:o,tabIndex:a}},c,y,{children:[_.jsx(f.slots.baseSelectOption,F({},x,{native:v,value:"",children:r.current.getLocaleText("filterValueAny")})),_.jsx(f.slots.baseSelectOption,F({},x,{native:v,value:"true",children:r.current.getLocaleText("filterValueTrue")})),_.jsx(f.slots.baseSelectOption,F({},x,{native:v,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]}))]}),i]})}const Kct=()=>[{value:"is",getApplyFilterFn:e=>{const t=V1(e.value);return t===void 0?null:n=>!!n===t},InputComponent:qct}],Yct=(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),Qct=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},Ace=F({},Dl,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:Bct,renderEditCell:Uct,sortComparator:gce,valueFormatter:Yct,filterOperators:Kct(),getApplyQuickFilterFn:void 0,aggregable:!1,pastedValueParser:e=>Qct(e)}),Rce=e=>e.sorting,ov=Gt(Rce,e=>e.sortedRows),Lz=Wn(ov,Ds,Mo,(e,t,n)=>e.reduce((r,o)=>{const i=t[o];if(i)r.push({id:o,model:i});else{const a=n[o];a&&ry(a)&&r.push({id:o,model:{[ny]:o}})}return r},[])),hl=Gt(Rce,e=>e.sortModel),Xct=Wn(hl,e=>e.reduce((n,r,o)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?o+1:void 0},n),{}));Wn(ov,e=>e.reduce((t,n,r)=>(t[n]=r,t),Object.create(null)));const eO=e=>e.filter,Vo=Gt(eO,e=>e.filterModel),Jct=Gt(Vo,e=>e.quickFilterValues),Zct=e=>e.visibleRowsLookup,iv=Gt(eO,e=>e.filteredRowsLookup);Gt(eO,e=>e.filteredChildrenCountLookup);Gt(eO,e=>e.filteredDescendantCountLookup);const Tf=Wn(Zct,Lz,wh,Vo,Jct,(e,t,n,r,o)=>n<2&&!r.items.length&&!(o!=null&&o.length)?t:t.filter(i=>e[i.id]!==!1)),Zm=Wn(Tf,e=>e.map(t=>t.id)),Dce=Wn(iv,Lz,(e,t)=>t.filter(n=>e[n.id]!==!1)),_ce=Wn(Dce,e=>e.map(t=>t.id));Wn(Zm,Mo,(e,t)=>{const n={};let r=0;return e.reduce((o,i)=>{const a=t[i];return n[a.depth]||(n[a.depth]=0),a.depth>r&&(n[a.depth]=0),r=a.depth,n[a.depth]+=1,o[i]=n[a.depth],o},{})});const $ce=Wn(Tf,Mo,wh,(e,t,n)=>n<2?e:e.filter(r=>{var o;return((o=t[r.id])==null?void 0:o.depth)===0})),Fz=Gt(Tf,e=>e.length),jz=Gt($ce,e=>e.length),eut=Gt(Dce,e=>e.length);Gt(eut,jz,(e,t)=>e-t);const Nce=Wn(Vo,Hu,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(r=>{var a,s;if(!r.field)return!1;const o=t[r.field];if(!(o!=null&&o.filterOperators)||((a=o==null?void 0:o.filterOperators)==null?void 0:a.length)===0)return!1;const i=o.filterOperators.find(l=>l.value===r.operator);return i?!i.InputComponent||r.value!=null&&((s=r.value)==null?void 0:s.toString())!=="":!1})}),tut=Wn(Nce,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{})),Ps=e=>e.rowSelection,nut=Gt(Ps,e=>e.length),rut=Wn(Ps,Ds,(e,t)=>new Map(e.map(n=>[n,t[n]]))),vu=Wn(Ps,e=>e.reduce((t,n)=>(t[n]=n,t),{}));function Lce(e,t){var l;const n=Mo(e),r=ov(e),o=iv(e),i=n[t];if(!i||i.type!=="group")return[];const a=[],s=r.findIndex(c=>c===t)+1;for(let c=s;c<r.length&&((l=n[r[c]])==null?void 0:l.depth)>i.depth;c+=1){const u=r[c];o[u]!==!1&&e.current.isRowSelectable(u)&&a.push(u)}return a}function out(e,t){return Gt(Mo,ov,iv,vu,(n,r,o,i)=>{var u;const a=n[e];if(!a||a.type!=="group")return{isIndeterminate:!1,isChecked:i[e]===e};if(i[e]===e)return{isIndeterminate:!1,isChecked:!0};let s=0,l=0;const c=r.findIndex(d=>d===e)+1;for(let d=c;d<r.length&&((u=n[r[d]])==null?void 0:u.depth)>a.depth;d+=1){const f=r[d];o[f]!==!1&&(s+=1,i[f]!==void 0&&(l+=1))}return{isIndeterminate:l>0&&(l<s||i[e]===void 0),isChecked:t?l>0:i[e]===e}})}function Bz(e){return e.signature===zs.DataGrid?e.checkboxSelection&&e.disableMultipleRowSelection!==!0:!e.disableMultipleRowSelection}const iut=(e,t)=>{const n=[];let r=t;for(;r!=null&&r!==ii;){const o=e[r];if(!o)return n;n.push(r),r=o.parent}return n},aut=(e,t,n)=>{const r=e[n];if(!r)return[];const o=r.parent;return o==null?[]:e[o].children.filter(a=>a!==n&&t[a]!==!1)},l1=(e,t,n,r,o,i)=>{const a=iv(e),s=vu(e),l=new Set([]);if(!(!r&&!o)){if(r){const c=t[n];(c==null?void 0:c.type)==="group"&&Lce(e,n).forEach(d=>{i(d),l.add(d)})}if(o){const c=d=>{if(s[d]!==d&&!l.has(d))return!1;const f=t[d];return(f==null?void 0:f.type)!=="group"?!0:f.children.every(c)},u=d=>{const f=aut(t,a,d);if(f.length===0||f.every(c)){const g=t[d].parent;g!=null&&g!==ii&&e.current.isRowSelectable(g)&&(i(g),l.add(g),u(g))}};u(n)}}},lQ=(e,t,n,r,o,i)=>{const a=vu(e);if(!(!o&&!r)&&(o&&iut(t,n).forEach(l=>{a[l]===l&&i(l)}),r)){const s=t[n];(s==null?void 0:s.type)==="group"&&Lce(e,n).forEach(c=>{i(c)})}},sut=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],lut=e=>{const{classes:t}=e;return Oe({root:["checkboxInput"]},kn,t)},cut=Nn(function(t,n){var A,k;const{field:r,id:o,rowNode:i,hasFocus:a,tabIndex:s}=t,l=We(t,sut),c=wn(),u=Rt(),d={classes:u.classes},f=lut(d),h=w.useRef(null),g=w.useRef(null),y=cn(h,n),v=M=>{const R={value:M.target.checked,id:o};c.current.publishEvent("rowSelectionCheckboxChange",R,M)};w.useLayoutEffect(()=>{if(s===0){const M=c.current.getCellElement(o,r);M&&(M.tabIndex=-1)}},[c,s,o,r]),w.useEffect(()=>{var M;if(a){const R=(M=h.current)==null?void 0:M.querySelector("input");R==null||R.focus({preventScroll:!0})}else g.current&&g.current.stop({})},[a]);const x=w.useCallback(M=>{M.key===" "&&M.stopPropagation()},[]),S=c.current.isRowSelectable(o),C=out(o,((A=u.rowSelectionPropagation)==null?void 0:A.parents)??!1),{isIndeterminate:I,isChecked:E}=Ke(c,C,Mz);if(i.type==="footer"||i.type==="pinnedRow")return null;const T=u.indeterminateCheckboxAction==="select"?E&&!I:E,O=c.current.getLocaleText(T?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return _.jsx(u.slots.baseCheckbox,F({tabIndex:s,checked:T,onChange:v,className:f.root,inputProps:{"aria-label":O,name:"select_row"},onKeyDown:x,indeterminate:I,disabled:!S,touchRippleRef:g},(k=u.slotProps)==null?void 0:k.baseCheckbox,l,{ref:y}))}),uut=cut,tO=e=>e.focus,ca=Gt(tO,e=>e.cell),dut=Gt(tO,e=>e.columnHeader);Gt(tO,e=>e.columnHeaderFilter);const NP=Gt(tO,e=>e.columnGroupHeader),nO=e=>e.tabIndex,zz=Gt(nO,e=>e.cell),Fce=Gt(nO,e=>e.columnHeader);Gt(nO,e=>e.columnHeaderFilter);const fut=Gt(nO,e=>e.columnGroupHeader);function dn(e,t,n){const r=w.useRef(!0);On(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function Lo(e,t){const n=w.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const jce=(e,t,n,r,o)=>{const i=Lo(e,"useNativeEventListener");er(e,"rootMount",()=>{const a=typeof t=="function"?t():t.current;if(!(!a||!n||!r))return i.debug(`Binding native ${n} event`),a.addEventListener(n,r,o),()=>{i.debug(`Clearing native ${n} event`),a.removeEventListener(n,r,o)}})},tS=e=>{const t=w.useRef(!0);t.current&&(t.current=!1,e())},put=()=>{},hut=(e,t)=>{const n=w.useRef(!1);On(()=>n.current||!e?put:(n.current=!0,t()),[n.current||e])},mut=100,gut=e=>e?0:100,Bce=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):e===-1?n+2:0,zce=e=>({page:0,pageSize:e?0:100}),yut=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),Vce=(e,t)=>{if(t===zs.DataGrid&&e>mut)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(``))},vut=-1,nS=e=>e.pagination,Hce=Gt(nS,e=>e.enabled&&e.paginationMode==="client"),vi=Gt(nS,e=>e.paginationModel),_m=Gt(nS,e=>e.rowCount),Jb=Gt(nS,e=>e.meta),but=Gt(vi,e=>e.page),Uce=Gt(vi,e=>e.pageSize),Wce=Gt(vi,_m,(e,t)=>Bce(t,e.pageSize,e.page)),Vz=Wn(Hce,vi,Mo,wh,Tf,$ce,(e,t,n,r,o,i)=>{var g;if(!e)return null;const a=i.length,s=Math.min(t.pageSize*t.page,a-1),l=t.pageSize===vut?a-1:Math.min(s+t.pageSize-1,a-1);if(s===-1||l===-1)return null;if(r<2)return{firstRowIndex:s,lastRowIndex:l};const c=i[s],u=l-s+1,d=o.findIndex(y=>y.id===c.id);let f=d,h=0;for(;f<o.length&&h<=u;){const y=o[f],v=(g=n[y.id])==null?void 0:g.depth;v===void 0?f+=1:((h<u||v>0)&&(f+=1),v===0&&(h+=1))}return{firstRowIndex:d,lastRowIndex:f-1}}),wut=Wn(Tf,Vz,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),Gce=Wn(Zm,Vz,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),rS=Wn(Hce,Vz,wut,Tf,(e,t,n,r)=>e?{rows:n,range:t,rowToIndexMap:n.reduce((o,i,a)=>(o.set(i.model,a),o),new Map)}:{rows:r,range:r.length===0?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowToIndexMap:r.reduce((o,i,a)=>(o.set(i.model,a),o),new Map)}),xut=["field","colDef"],Sut=e=>{const{classes:t}=e;return Oe({root:["checkboxInput"]},kn,t)},Cut=Nn(function(t,n){var A;const r=We(t,xut),[,o]=w.useState(!1),i=wn(),a=Rt(),s={classes:a.classes},l=Sut(s),c=Ke(i,Fce),u=Ke(i,Ps),d=Ke(i,Zm),f=Ke(i,Gce),h=w.useMemo(()=>typeof a.isRowSelectable!="function"?u:u.filter(k=>a.keepNonExistentRowsSelected?!0:i.current.getRow(k)?a.isRowSelectable(i.current.getRowParams(k)):!1),[i,a.isRowSelectable,u,a.keepNonExistentRowsSelected]),g=w.useMemo(()=>(!a.pagination||!a.checkboxSelectionVisibleOnly?d:f).reduce((M,R)=>(M[R]=!0,M),{}),[a.pagination,a.checkboxSelectionVisibleOnly,f,d]),y=w.useMemo(()=>h.filter(k=>g[k]).length,[h,g]),v=y>0&&y<Object.keys(g).length,x=y>0,S=k=>{const M={value:k.target.checked};i.current.publishEvent("headerSelectionCheckboxChange",M)},C=c!==null&&c.field===t.field?0:-1;w.useLayoutEffect(()=>{const k=i.current.getColumnHeaderElement(t.field);C===0&&k&&(k.tabIndex=-1)},[C,i,t.field]);const I=w.useCallback(k=>{k.key===" "&&i.current.publishEvent("headerSelectionCheckboxChange",{value:!x})},[i,x]),E=w.useCallback(()=>{o(k=>!k)},[]);w.useEffect(()=>i.current.subscribeEvent("rowSelectionChange",E),[i,E]);const T=a.indeterminateCheckboxAction==="select"?x&&!v:x,O=i.current.getLocaleText(T?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return _.jsx(a.slots.baseCheckbox,F({indeterminate:v,checked:T,onChange:S,className:l.root,inputProps:{"aria-label":O,name:"select_all_rows"},tabIndex:C,onKeyDown:I,disabled:!Bz(a)},(A=a.slotProps)==null?void 0:A.baseCheckbox,r,{ref:n}))}),oS=(e,t)=>ny in t?t[ny]:e.props.getRowId?e.props.getRowId(t):t.id,tu="__check__",av=F({},Ace,{type:"custom",field:tu,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,display:"flex",valueGetter:(e,t,n,r)=>{const o=vu(r),i=oS(r.current.state,t);return o[i]!==void 0},renderHeader:e=>_.jsx(Cut,F({},e)),renderCell:e=>_.jsx(uut,F({},e))}),Eut=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function cQ(e,t){if(e==null)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":t==="date"?n.toISOString().substring(0,10):t==="datetime-local"?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function dm(e){var C;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,InputProps:a,clearButton:s,tabIndex:l,disabled:c}=e,u=We(e,Eut),d=fa(),[f,h]=w.useState(()=>cQ(t.value,r)),[g,y]=w.useState(!1),v=Dn(),x=Rt(),S=w.useCallback(I=>{d.clear();const E=I.target.value;h(E),y(!0),d.start(x.filterDebounceMs,()=>{const T=new Date(E);n(F({},t,{value:Number.isNaN(T.getTime())?void 0:T})),y(!1)})},[n,t,x.filterDebounceMs,d]);return w.useEffect(()=>{const I=cQ(t.value,r);h(I)},[t.value,r]),_.jsx(x.slots.baseTextField,F({fullWidth:!0,id:v,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:f,onChange:S,variant:"standard",type:r||"text",InputLabelProps:{shrink:!0},inputRef:i,InputProps:F({},g||s?{endAdornment:g?_.jsx(x.slots.loadIcon,{fontSize:"small",color:"action"}):s}:{},{disabled:c},a,{inputProps:F({max:r==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:l},a==null?void 0:a.inputProps)})},u,(C=x.slotProps)==null?void 0:C.baseTextField))}function fm(e,t,n,r){if(!e.value)return null;const o=new Date(e.value);n?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const i=o.getTime();return a=>{if(!a)return!1;if(r)return t(a.getTime(),i);const s=new Date(a);return n?s.setSeconds(0,0):s.setHours(0,0,0,0),t(s.getTime(),i)}}const qce=e=>[{value:"is",getApplyFilterFn:t=>fm(t,(n,r)=>n===r,e),InputComponent:dm,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>fm(t,(n,r)=>n!==r,e),InputComponent:dm,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>fm(t,(n,r)=>n>r,e),InputComponent:dm,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>fm(t,(n,r)=>n>=r,e),InputComponent:dm,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>fm(t,(n,r)=>n<r,e,!e),InputComponent:dm,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFn:t=>fm(t,(n,r)=>n<=r,e),InputComponent:dm,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>t=>t!=null,requiresFilterValue:!1}],Put=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],Iut=se(vy)({fontSize:"inherit"}),Tut=e=>{const{classes:t}=e;return Oe({root:["editInputCell"]},kn,t)};function Out(e){const{id:t,value:n,field:r,colDef:o,hasFocus:i,inputProps:a,onValueChange:s}=e,l=We(e,Put),c=o.type==="dateTime",u=wn(),d=w.useRef(null),f=w.useMemo(()=>{let I;n==null?I=null:n instanceof Date?I=n:I=new Date((n??"").toString());let E;return I==null||Number.isNaN(I.getTime())?E="":E=new Date(I.getTime()-I.getTimezoneOffset()*60*1e3).toISOString().substr(0,c?16:10),{parsed:I,formatted:E}},[n,c]),[h,g]=w.useState(f),v={classes:Rt().classes},x=Tut(v),S=w.useCallback(I=>{if(I==="")return null;const[E,T]=I.split("T"),[O,A,k]=E.split("-"),M=new Date;if(M.setFullYear(Number(O),Number(A)-1,Number(k)),M.setHours(0,0,0,0),T){const[R,$]=T.split(":");M.setHours(Number(R),Number($),0,0)}return M},[]),C=w.useCallback(async I=>{const E=I.target.value,T=S(E);s&&await s(I,T),g({parsed:T,formatted:E}),u.current.setEditCellValue({id:t,field:r,value:T},I)},[u,r,t,s,S]);return w.useEffect(()=>{g(I=>{var E,T;return f.parsed!==I.parsed&&((E=f.parsed)==null?void 0:E.getTime())!==((T=I.parsed)==null?void 0:T.getTime())?f:I})},[f]),On(()=>{i&&d.current.focus()},[i]),_.jsx(Iut,F({inputRef:d,fullWidth:!0,className:x.root,type:c?"datetime-local":"date",inputProps:F({max:c?"9999-12-31T23:59":"9999-12-31"},a),value:h.formatted,onChange:C},l))}const Kce=e=>_.jsx(Out,F({},e));function Yce({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(``))}const kut=(e,t,n,r)=>{if(!e)return"";const o=oS(r.current.state,t);return Yce({value:e,columnType:"date",rowId:o,field:n.field}),e.toLocaleDateString()},Mut=(e,t,n,r)=>{if(!e)return"";const o=oS(r.current.state,t);return Yce({value:e,columnType:"dateTime",rowId:o,field:n.field}),e.toLocaleString()},Aut=F({},Dl,{type:"date",sortComparator:yce,valueFormatter:kut,filterOperators:qce(),renderEditCell:Kce,pastedValueParser:e=>new Date(e)}),Rut=F({},Dl,{type:"dateTime",sortComparator:yce,valueFormatter:Mut,filterOperators:qce(!0),renderEditCell:Kce,pastedValueParser:e=>new Date(e)}),Ed=e=>e==null?null:Number(e),Dut=e=>e==null||Number.isNaN(e)||e===""?null:t=>Ed(t)===Ed(e),_ut=()=>[{value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Ed(t)===e.value,InputComponent:Os,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>Ed(t)!==e.value,InputComponent:Os,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Ed(t)>e.value,InputComponent:Os,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Ed(t)>=e.value,InputComponent:Os,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Ed(t)<e.value,InputComponent:Os,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:Ed(t)<=e.value,InputComponent:Os,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:bce,InputComponentProps:{type:"number"}}],$ut=F({},Dl,{type:"number",align:"right",headerAlign:"right",sortComparator:gce,valueParser:e=>e===""?null:Number(e),valueFormatter:e=>oct(e)?e.toLocaleString():e||"",filterOperators:_ut(),getApplyQuickFilterFn:Dut});function oy(e){return(e==null?void 0:e.type)==="singleSelect"}function Qp(e,t){if(e)return typeof e.valueOptions=="function"?e.valueOptions(F({field:e.field},t)):e.valueOptions}function LP(e,t,n){if(t===void 0)return;const r=t.find(o=>{const i=n(o);return String(i)===String(e)});return n(r)}const Nut=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],Lut=["MenuProps"];function Fut(e){return!!e.key}function jut(e){var $,L;const t=Rt(),{id:n,value:r,field:o,row:i,colDef:a,hasFocus:s,error:l,onValueChange:c,initialOpen:u=t.editMode===Tc.Cell}=e,d=We(e,Nut),f=wn(),h=w.useRef(null),g=w.useRef(null),[y,v]=w.useState(u),S=((($=t.slotProps)==null?void 0:$.baseSelect)||{}).native??!1,C=((L=t.slotProps)==null?void 0:L.baseSelect)||{},{MenuProps:I}=C,E=We(C,Lut);if(On(()=>{var z;s&&((z=g.current)==null||z.focus())},[s]),!oy(a))return null;const T=Qp(a,{id:n,row:i});if(!T)return null;const O=a.getOptionValue,A=a.getOptionLabel,k=async z=>{if(!oy(a)||!T)return;v(!1);const N=z.target,B=LP(N.value,T,O);c&&await c(z,B),await f.current.setEditCellValue({id:n,field:o,value:B},z)},M=(z,N)=>{if(t.editMode===Tc.Row){v(!1);return}if(N==="backdropClick"||z.key==="Escape"){const B=f.current.getCellParams(n,o);f.current.publishEvent("cellEditStop",F({},B,{reason:z.key==="Escape"?pl.escapeKeyDown:pl.cellFocusOut}))}},R=z=>{Fut(z)&&z.key==="Enter"||v(!0)};return!T||!a?null:_.jsx(t.slots.baseSelect,F({ref:h,inputRef:g,value:r,onChange:k,open:y,onOpen:R,MenuProps:F({onClose:M},I),error:l,native:S,fullWidth:!0},d,E,{children:T.map(z=>{var B;const N=O(z);return w.createElement(t.slots.baseSelectOption,F({},((B=t.slotProps)==null?void 0:B.baseSelectOption)||{},{native:S,key:N,value:N}),A(z))})}))}const But=e=>_.jsx(jut,F({},e)),zut=["item","applyValue","type","apiRef","focusElementRef","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],Vut=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:o,baseSelectOptionProps:i})=>["",...Qp(e)||[]].map(s=>{const l=r(s);let c=n(s);return c===""&&(c=" "),w.createElement(t,F({},i,{native:o,key:l,value:l}),c)}),Hut=se("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function uQ(e){var O,A,k,M,R;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,placeholder:a,tabIndex:s,label:l,variant:c="standard",clearButton:u}=e,d=We(e,zut),f=t.value??"",h=Dn(),g=Dn(),y=Rt(),v=((A=(O=y.slotProps)==null?void 0:O.baseSelect)==null?void 0:A.native)??!1;let x=null;if(t.field){const $=o.current.getColumn(t.field);oy($)&&(x=$)}const S=x==null?void 0:x.getOptionValue,C=x==null?void 0:x.getOptionLabel,I=w.useMemo(()=>Qp(x),[x]),E=w.useCallback($=>{let L=$.target.value;L=LP(L,I,S),n(F({},t,{value:L}))},[I,S,n,t]);if(!oy(x))return null;const T=l??o.current.getLocaleText("filterPanelInputLabel");return _.jsxs(Hut,{children:[_.jsxs(y.slots.baseFormControl,{fullWidth:!0,children:[_.jsx(y.slots.baseInputLabel,F({},(k=y.slotProps)==null?void 0:k.baseInputLabel,{id:g,htmlFor:h,shrink:!0,variant:c,children:T})),_.jsx(y.slots.baseSelect,F({id:h,label:T,labelId:g,value:f,onChange:E,variant:c,type:r||"text",inputProps:{tabIndex:s,ref:i,placeholder:a??o.current.getLocaleText("filterPanelInputPlaceholder")},native:v,notched:c==="outlined"?!0:void 0},d,(M=y.slotProps)==null?void 0:M.baseSelect,{children:Vut({column:x,OptionComponent:y.slots.baseSelectOption,getOptionLabel:C,getOptionValue:S,isSelectNative:v,baseSelectOptionProps:(R=y.slotProps)==null?void 0:R.baseSelectOption})}))]}),u]})}const Uut=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],Wut=["key"],Gut=zZ();function qut(e){const{item:t,applyValue:n,apiRef:r,focusElementRef:o,color:i,error:a,helperText:s,size:l,variant:c="standard"}=e,u=We(e,Uut),d={color:i,error:a,helperText:s,size:l,variant:c},f=Dn(),h=Rt();let g=null;if(t.field){const E=r.current.getColumn(t.field);oy(E)&&(g=E)}const y=g==null?void 0:g.getOptionValue,v=g==null?void 0:g.getOptionLabel,x=w.useCallback((E,T)=>y(E)===y(T),[y]),S=w.useMemo(()=>Qp(g)||[],[g]),C=w.useMemo(()=>Array.isArray(t.value)?t.value.reduce((E,T)=>{const O=S.find(A=>y(A)===T);return O!=null&&E.push(O),E},[]):[],[y,t.value,S]),I=w.useCallback((E,T)=>{n(F({},t,{value:T.map(y)}))},[n,t,y]);return _.jsx($l,F({multiple:!0,options:S,isOptionEqualToValue:x,filterOptions:Gut,id:f,value:C,onChange:I,getOptionLabel:v,renderTags:(E,T)=>E.map((O,A)=>{const k=T({index:A}),{key:M}=k,R=We(k,Wut);return _.jsx(h.slots.baseChip,F({variant:"outlined",size:"small",label:v(O)},R),M)}),renderInput:E=>{var T;return _.jsx(h.slots.baseTextField,F({},E,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:F({},E.InputLabelProps,{shrink:!0}),inputRef:o,type:"singleSelect"},d,(T=h.slotProps)==null?void 0:T.baseTextField))}},u))}const pm=e=>e==null||!Dz(e)?e:e.value,Kut=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>pm(t)===pm(e.value),InputComponent:uQ},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>pm(t)!==pm(e.value),InputComponent:uQ},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(pm);return n=>t.includes(pm(n))},InputComponent:qut}],Yut=e=>typeof e[0]=="object",Qut=e=>Dz(e)?e.value:e,Xut=e=>Dz(e)?e.label:String(e),Jut=F({},Dl,{type:"singleSelect",getOptionLabel:Xut,getOptionValue:Qut,valueFormatter(e,t,n,r){const o=oS(r.current.state,t);if(!oy(n))return"";const i=Qp(n,{id:o,row:t});if(e==null)return"";if(!i)return e;if(!Yut(i))return n.getOptionLabel(e);const a=i.find(s=>n.getOptionValue(s)===e);return a?n.getOptionLabel(a):""},renderEditCell:But,filterOperators:Kut(),pastedValueParser:(e,t,n)=>{const r=n,o=Qp(r)||[],i=r.getOptionValue;if(o.find(s=>i(s)===e))return e}}),Zut="string",edt=()=>({string:Dl,number:$ut,date:Aut,dateTime:Rut,boolean:Ace,singleSelect:Jut,[XT]:Rct,custom:Dl}),Hz=e=>e.headerFiltering,tdt=Gt(Hz,e=>(e==null?void 0:e.enabled)??!1),ndt=Gt(Hz,e=>e.editing),rdt=Gt(Hz,e=>e.menuOpen),rO=e=>e.columnGrouping,Qce=Wn(rO,e=>(e==null?void 0:e.unwrappedGroupingModel)??{}),Xce=Wn(rO,e=>(e==null?void 0:e.lookup)??{}),odt=Wn(rO,e=>(e==null?void 0:e.headerStructure)??[]),iS=Gt(rO,e=>(e==null?void 0:e.maxDepth)??0),Jce=["maxWidth","minWidth","width","flex"],l$=edt();function idt({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(a=>a.field)),o={all:{},frozenFields:[],freeze:a=>{const s=o.all[a];s&&s.frozen!==!0&&(o.all[a].frozen=!0,o.frozenFields.push(a))}};function i(){if(o.frozenFields.length===r.size)return;const a={min:{},max:{}};let s=e,l=t,c=0;o.frozenFields.forEach(u=>{s-=o.all[u].computedWidth,l-=o.all[u].flex});for(let u=0;u<n.length;u+=1){const d=n[u];if(o.all[d.field]&&o.all[d.field].frozen===!0)continue;let h=s/l*d.flex;h<d.minWidth?(c+=d.minWidth-h,h=d.minWidth,a.min[d.field]=!0):h>d.maxWidth&&(c+=d.maxWidth-h,h=d.maxWidth,a.max[d.field]=!0),o.all[d.field]={frozen:!1,computedWidth:h,flex:d.flex}}c<0?Object.keys(a.max).forEach(u=>{o.freeze(u)}):c>0?Object.keys(a.min).forEach(u=>{o.freeze(u)}):n.forEach(({field:u})=>{o.freeze(u)}),i()}return i(),o.all}const zL=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(l=>{let c=e.lookup[l],u=0,d=!1;e.columnVisibilityModel[l]!==!1&&(c.flex&&c.flex>0?(r+=c.flex,d=!0):u=Ua(c.width||Dl.width,c.minWidth||Dl.minWidth,c.maxWidth||Dl.maxWidth),o+=u),c.computedWidth!==u&&(c=F({},c,{computedWidth:u})),d&&i.push(c),n[l]=c});const a=t===void 0?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),s=Math.max(a-o,0);if(r>0&&a>0){const l=idt({initialFreeSpace:s,totalFlexUnits:r,flexColumns:i});Object.keys(l).forEach(c=>{n[c].computedWidth=l[c].computedWidth})}return F({},e,{lookup:n})},adt=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(o.length===0&&n.length===0)return e;const i={},a=[];for(let u=0;u<n.length;u+=1){const d=n[u];e.lookup[d]&&(i[d]=!0,a.push(d))}const s=a.length===0?e.orderedFields:[...a,...e.orderedFields.filter(u=>!i[u])],l=F({},e.lookup);for(let u=0;u<o.length;u+=1){const d=o[u],f=F({},l[d],{hasBeenResized:!0});Object.entries(r[d]).forEach(([h,g])=>{f[h]=g===-1?1/0:g}),l[d]=f}return F({},e,{orderedFields:s,lookup:l})};function dQ(e){let t=l$[Zut];return e&&l$[e]&&(t=l$[e]),t}const wm=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=_s(e),keepOnlyColumnsToUpsert:o=!1})=>{var u,d;const i=!e.current.state.columns;let a;if(i)a={orderedFields:[],lookup:{},columnVisibilityModel:r};else{const f=xc(e.current.state);a={orderedFields:o?[]:[...f.orderedFields],lookup:F({},f.lookup),columnVisibilityModel:r}}let s={};o&&!i&&(s=Object.keys(a.lookup).reduce((f,h)=>F({},f,{[h]:!1}),{})),t.forEach(f=>{const{field:h}=f;s[h]=!0;let g=a.lookup[h];g==null?(g=F({},dQ(f.type),{field:h,hasBeenResized:!1}),a.orderedFields.push(h)):o&&a.orderedFields.push(h),g&&g.type!==f.type&&(g=F({},dQ(f.type),{field:h}));let y=g.hasBeenResized;Jce.forEach(v=>{f[v]!==void 0&&(y=!0,f[v]===-1&&(f[v]=1/0))}),a.lookup[h]=Xd(g,F({},f,{hasBeenResized:y}))}),o&&!i&&Object.keys(a.lookup).forEach(f=>{s[f]||delete a.lookup[f]});const l=e.current.unstable_applyPipeProcessors("hydrateColumns",a),c=adt(l,n);return zL(c,((d=(u=e.current).getRootDimensions)==null?void 0:d.call(u))??void 0)};function sdt({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=e;for(let a=n;a<r;a+=1)if(o[a]){const l=o[a].id,c=t.current.unstable_getCellColSpanInfo(l,e);c&&c.spannedByColSpan&&(i=c.leftVisibleCellIndex)}return i}function Uz(e,t){if(t.unstable_listView)return 0;const n=ev(e),r=iS(e),o=tdt(e),i=Math.floor(t.columnHeaderHeight*n),a=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*n),s=o?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*n):0;return i+a*r+s}const fQ=1,ldt=1.5,cdt=e=>{const{scrollDirection:t,classes:n}=e,r={root:["scrollArea",`scrollArea--${t}`]};return Oe(r,kn,n)},udt=tr("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${oe["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${oe["scrollArea--right"]}`]:t["scrollArea--right"]},t.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${oe["scrollArea--left"]}`]:{left:0},[`&.${oe["scrollArea--right"]}`]:{right:0}})),ddt=Z0(qo,(e,t)=>t==="left"?e.leftPinnedWidth:t==="right"?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function fdt(e){const t=wn(),[n,r]=w.useState(!1);return wt(t,"columnHeaderDragStart",()=>r(!0)),wt(t,"columnHeaderDragEnd",()=>r(!1)),n?_.jsx(pdt,F({},e)):null}function pdt(e){const{scrollDirection:t,scrollPosition:n}=e,r=w.useRef(null),o=wn(),i=fa(),a=Ke(o,ev),s=Ke(o,QT),l=Lx(o,ddt,t),c=()=>{const I=qo(o.current.state);if(t==="left")return n.current.left>0;if(t==="right"){const E=s-I.viewportInnerSize.width;return n.current.left<E}return!1},[u,d]=w.useState(c),f=Rt(),h=F({},f,{scrollDirection:t}),g=cdt(h),y=Uz(o,f),v=Math.floor(f.columnHeaderHeight*a),x={height:v,top:y-v};t==="left"?x.left=l:t==="right"&&(x.right=l);const S=()=>{d(c)},C=Qe(I=>{let E;if(I.preventDefault(),t==="left")E=I.clientX-r.current.getBoundingClientRect().right;else if(t==="right")E=Math.max(1,I.clientX-r.current.getBoundingClientRect().left);else throw new Error("MUI X: Wrong drag direction");E=(E-fQ)*ldt+fQ,i.start(0,()=>{o.current.scroll({left:n.current.left+E,top:n.current.top})})});return wt(o,"scrollPositionChange",S),u?_.jsx(udt,{ref:r,className:fe(g.root),ownerState:h,onDragOver:C,style:x}):null}const pQ=Vu(fdt);var Eb={},c$={exports:{}},u$={exports:{}},hQ;function hdt(){return hQ||(hQ=1,function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(u$)),u$.exports}var mQ;function mdt(){return mQ||(mQ=1,function(e){var t=hdt().default;function n(o){if(typeof WeakMap!="function")return null;var i=new WeakMap,a=new WeakMap;return(n=function(l){return l?a:i})(o)}function r(o,i){if(!i&&o&&o.__esModule)return o;if(o===null||t(o)!="object"&&typeof o!="function")return{default:o};var a=n(i);if(a&&a.has(o))return a.get(o);var s={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in o)if(c!=="default"&&{}.hasOwnProperty.call(o,c)){var u=l?Object.getOwnPropertyDescriptor(o,c):null;u&&(u.get||u.set)?Object.defineProperty(s,c,u):s[c]=o[c]}return s.default=o,a&&a.set(o,s),s}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(c$)),c$.exports}var gQ;function gdt(){if(gQ)return Eb;gQ=1;var e=mdt().default;Object.defineProperty(Eb,"__esModule",{value:!0}),Eb.default=void 0;var t=e(uy());return Eb.default=parseInt(t.version,10),Eb}var ydt=gdt();const vdt=Fn(ydt),Zce=w.createContext(void 0);function ts(){const e=w.useContext(Zce);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(`-`));return e}const qd=(e,t)=>rS(e),Wz=(e,t)=>Ke(e,rS),bdt=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",wdt=bdt.includes("firefox"),aS=e=>e.rowsMeta,oO=e=>e.virtualization;Gt(oO,e=>e.enabled);const eue=Gt(oO,e=>e.enabledForColumns),xdt=Gt(oO,e=>e.enabledForRows),sS=Gt(oO,e=>e.renderContext),Sdt=Wn(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),VL={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},Cdt=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return F({},e,{virtualization:{enabled:!n,enabledForColumns:!n,enabledForRows:!n&&!r,renderContext:VL}})};function Edt(e,t){const n=i=>{e.current.setState(a=>F({},a,{virtualization:F({},a.virtualization,{enabled:i,enabledForColumns:i,enabledForRows:i&&!t.autoHeight})}))};dn(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:i=>{e.current.setState(a=>F({},a,{virtualization:F({},a.virtualization,{enabledForColumns:i})}))}},"public"),w.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}const Gz=e=>e.rowSpanning,tue=Gt(Gz,e=>e.hiddenCells),Pdt=Gt(Gz,e=>e.spannedCells),Idt=Gt(Gz,e=>e.hiddenCellOriginMap),iy=e=>e.listViewColumn,Tdt=ace(ca,sS,rS,Wr,Ds,(e,t,n,r,o)=>{if(!e)return!1;const i=o[e.id];if(!i)return!1;const a=n.rowToIndexMap.get(i),s=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(c=>c.field===e.field);return!(a!==void 0&&s!==-1&&a>=t.firstRowIndex&&a<=t.lastRowIndex)}),nue=Wn(Tdt,Wr,rS,Ds,ca,(e,t,n,r,o)=>{if(!e)return null;const i=r[o.id];if(!i)return null;const a=n.rowToIndexMap.get(i);if(a===void 0)return null;const s=t.findIndex(l=>l.field===o.field);return s===-1?null:F({},o,{rowIndex:a,columnIndex:s})});function $m(e,t){return Math.round(e*10**t)/10**t}const FP=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),d$=50;var lo=function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e}(lo||{});const yQ={top:0,left:0},Odt=Object.freeze(new Map),kdt=(e,t,n,r,o)=>({direction:lo.NONE,buffer:oue(e,lo.NONE,t,n,r,o)}),Mdt=()=>{var re;const e=ts(),t=Rt(),{unstable_listView:n}=t,r=Ke(e,()=>n?[iy(e.current.state)]:Wr(e)),o=Ke(e,xdt)&&!FP,i=Ke(e,eue)&&!FP,a=Ke(e,tv),s=rv(e),l=n?$P:s,c=a.bottom.length>0,[u,d]=w.useState(Odt),f=Yn(),h=Ke(e,vu),g=Wz(e),y=e.current.mainElementRef,v=e.current.virtualScrollerRef,x=e.current.virtualScrollbarVerticalRef,S=e.current.virtualScrollbarHorizontalRef,C=Ke(e,mct),I=w.useRef(!1),E=Ke(e,Az),T=Ke(e,Plt),O=Ke(e,QT),A=Ke(e,Adt),k=Ke(e,pce),M=Ke(e,fce),R=w.useRef(null),$=w.useCallback(le=>{if(y.current=le,!le)return;const me=le.getBoundingClientRect();let Se={width:$m(me.width,1),height:$m(me.height,1)};if((!R.current||Se.width!==R.current.width&&Se.height!==R.current.height)&&(R.current=Se,e.current.publishEvent("resize",Se)),typeof ResizeObserver>"u")return;const Ee=new ResizeObserver(ge=>{const xe=ge[0];if(!xe)return;const Pe={width:$m(xe.contentRect.width,1),height:$m(xe.contentRect.height,1)};Pe.width===Se.width&&Pe.height===Se.height||(e.current.publishEvent("resize",Pe),Se=Pe)});if(Ee.observe(le),vdt>=19)return()=>{y.current=null,Ee.disconnect()}},[e,y]),L=w.useRef(((re=t.initialState)==null?void 0:re.scroll)??yQ),z=w.useRef(!1),N=w.useRef(yQ),B=w.useRef(VL),U=Ke(e,sS),G=Ke(e,nue),H=fa(),K=w.useRef(void 0),q=Ks(()=>kdt(f,t.rowBufferPx,t.columnBufferPx,E*15,d$*6)).current,Y=w.useCallback(le=>{if(_dt(le,e.current.state.virtualization.renderContext))return;const me=le.firstRowIndex!==B.current.firstRowIndex||le.lastRowIndex!==B.current.lastRowIndex;e.current.setState(Ee=>F({},Ee,{virtualization:F({},Ee.virtualization,{renderContext:le})})),qo(e.current.state).isReady&&me&&(B.current=le,e.current.publishEvent("renderedRowsIntervalChange",le)),N.current=L.current},[e]),J=Qe(()=>{const le=v.current;if(!le)return;const me=qo(e.current.state),Se=Math.ceil(me.minimumSize.height-me.viewportOuterSize.height),Ee=Math.ceil(me.minimumSize.width-me.viewportInnerSize.width),ge={top:Ua(le.scrollTop,0,Se),left:f?Ua(le.scrollLeft,-Ee,0):Ua(le.scrollLeft,0,Ee)},xe=ge.left-L.current.left,Pe=ge.top-L.current.top,_e=xe!==0||Pe!==0;L.current=ge;const Le=_e?$dt(xe,Pe):lo.NONE,de=Math.abs(L.current.top-N.current.top),$e=Math.abs(L.current.left-N.current.left),Ae=de>=E||$e>=d$,Ne=q.direction!==Le;if(!(Ae||Ne))return U;if(Ne)switch(Le){case lo.NONE:case lo.LEFT:case lo.RIGHT:K.current=void 0;break;default:K.current=U;break}q.direction=Le,q.buffer=oue(f,Le,t.rowBufferPx,t.columnBufferPx,E*15,d$*6);const Ze=vQ(e,t,o,i),ut=bQ(Ze,L.current,q);return u0.flushSync(()=>{Y(ut)}),H.start(1e3,J),ut}),ie=()=>{if(!qo(e.current.state).isReady&&(o||i))return;const le=vQ(e,t,o,i),me=bQ(le,L.current,q);K.current=void 0,Y(me)},ee=Qe(()=>{if(z.current){z.current=!1;return}const le=J();e.current.publishEvent("scrollPositionChange",{top:L.current.top,left:L.current.left,renderContext:le})}),te=Qe(le=>{e.current.publishEvent("virtualScrollerWheel",{},le)}),ce=Qe(le=>{e.current.publishEvent("virtualScrollerTouchMove",{},le)}),ae=(le={})=>{var Ue;if(!le.rows&&!g.range)return[];let me=U;le.renderContext&&(me=le.renderContext,me.firstColumnIndex=U.firstColumnIndex,me.lastColumnIndex=U.lastColumnIndex);const Se=!c&&le.position===void 0||c&&le.position==="bottom",Ee=le.position!==void 0;let ge;switch(le.position){case"top":ge=0;break;case"bottom":ge=a.top.length+g.rows.length;break;case void 0:ge=a.top.length;break}const xe=le.rows??g.rows,Pe=me.firstRowIndex,_e=Math.min(me.lastRowIndex,xe.length),Le=le.rows?ZY(0,le.rows.length):ZY(Pe,_e);let de=-1;!Ee&&G&&(G.rowIndex<Pe&&(Le.unshift(G.rowIndex),de=G.rowIndex),G.rowIndex>_e&&(Le.push(G.rowIndex),de=G.rowIndex));const $e=[],Ae=(Ue=t.slotProps)==null?void 0:Ue.row,Ne=If(e);return Le.forEach(Ze=>{var Yr,Yi,Qi;const{id:ut,model:Ye}=xe[Ze],et=(((Yr=g==null?void 0:g.range)==null?void 0:Yr.firstRowIndex)||0)+ge+Ze;if(C){const qt=l.left.length,Dr=r.length-l.right.length;e.current.calculateColSpan({rowId:ut,minFirstColumn:qt,maxLastColumn:Dr,columns:r}),l.left.length>0&&e.current.calculateColSpan({rowId:ut,minFirstColumn:0,maxLastColumn:l.left.length,columns:r}),l.right.length>0&&e.current.calculateColSpan({rowId:ut,minFirstColumn:r.length-l.right.length,maxLastColumn:r.length,columns:r})}const Xe=e.current.rowHasAutoHeight(ut)?"auto":e.current.unstable_getRowHeight(ut);let mt;h[ut]==null?mt=!1:mt=e.current.isRowSelectable(ut);let At=!1;le.position===void 0&&(At=Ze===0);let Bt=!1;const gt=Ze===xe.length-1;if(Se)if(Ee)Bt=gt;else{const qt=g.rows.length-1;Ze===qt&&(Bt=!0)}let Vt=me;K.current&&Ze>=K.current.firstRowIndex&&Ze<K.current.lastRowIndex&&(Vt=K.current);const Mn=Ze===de,nr=(G==null?void 0:G.rowIndex)===et,un=rue(Ne,Vt,l.left.length),jn=gt&&le.position==="top",dr=Vt.firstColumnIndex,Bn=Vt.lastColumnIndex;if($e.push(_.jsx(t.slots.row,F({row:Ye,rowId:ut,index:et,selected:mt,offsetLeft:un,columnsTotalWidth:O,rowHeight:Xe,pinnedColumns:l,visibleColumns:r,firstColumnIndex:dr,lastColumnIndex:Bn,focusedColumnIndex:nr?G.columnIndex:void 0,isFirstVisible:At,isLastVisible:Bt,isNotVisible:Mn,showBottomBorder:jn,scrollbarWidth:k,gridHasFiller:M},Ae),ut)),Mn)return;const Fo=u.get(ut);Fo&&$e.push(Fo),le.position===void 0&>&&$e.push((Qi=(Yi=e.current).getInfiniteLoadingTriggerElement)==null?void 0:Qi.call(Yi,{lastRowId:ut}))}),$e},ne=w.useMemo(()=>({overflowX:!A||n?"hidden":void 0,overflowY:t.autoHeight?"hidden":void 0}),[A,t.autoHeight,n]),ue=w.useMemo(()=>{const le={width:A?O:"auto",flexBasis:T,flexShrink:0};return le.flexBasis===0&&(le.flexBasis=Oce),le},[O,T,A]),he=w.useCallback(le=>{le&&e.current.publishEvent("virtualScrollerContentSizeChange",{columnsTotalWidth:O,contentHeight:T})},[e,O,T]);return On(()=>{var le,me;I.current&&((me=(le=e.current).updateRenderContext)==null||me.call(le))},[e,i,o]),On(()=>{n&&(v.current.scrollLeft=0)},[n,v]),hut(U!==VL,()=>{var le;if(e.current.publishEvent("scrollPositionChange",{top:L.current.top,left:L.current.left,renderContext:U}),I.current=!0,(le=t.initialState)!=null&&le.scroll&&v.current){const me=v.current,{top:Se,left:Ee}=t.initialState.scroll,ge={top:!(Se>0),left:!(Ee>0)};if(!ge.left&&O&&(me.scrollLeft=Ee,z.current=!0,ge.left=!0),!ge.top&&T&&(me.scrollTop=Se,z.current=!0,ge.top=!0),!ge.top||!ge.left){const xe=e.current.subscribeEvent("virtualScrollerContentSizeChange",Pe=>{!ge.left&&Pe.columnsTotalWidth&&(me.scrollLeft=Ee,z.current=!0,ge.left=!0),!ge.top&&Pe.contentHeight&&(me.scrollTop=Se,z.current=!0,ge.top=!0),ge.left&&ge.top&&xe()});return xe}}}),e.current.register("private",{updateRenderContext:ie}),er(e,"sortedRowsSet",ie),er(e,"paginationModelChange",ie),er(e,"columnsChange",ie),{renderContext:U,setPanels:d,getRows:ae,getContainerProps:()=>({ref:$}),getScrollerProps:()=>({ref:v,onScroll:ee,onWheel:te,onTouchMove:ce,style:ne,role:"presentation",tabIndex:wdt?-1:void 0}),getContentProps:()=>({style:ue,role:"presentation",ref:he}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:x,scrollPosition:L}),getScrollbarHorizontalProps:()=>({ref:S,scrollPosition:L}),getScrollAreaProps:()=>({scrollPosition:L})}};function Adt(e){return e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width}function vQ(e,t,n,r){const o=qo(e.current.state),i=qd(e),a=t.unstable_listView?[iy(e.current.state)]:Wr(e),s=Idt(e),l=e.current.state.rows.dataRowIds.at(-1),c=a.at(-1);return{enabledForRows:n,enabledForColumns:r,apiRef:e,autoHeight:t.autoHeight,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx,leftPinnedWidth:o.leftPinnedWidth,columnsTotalWidth:o.columnsTotalWidth,viewportInnerWidth:o.viewportInnerSize.width,viewportInnerHeight:o.viewportInnerSize.height,lastRowHeight:l!==void 0?e.current.unstable_getRowHeight(l):0,lastColumnWidth:(c==null?void 0:c.computedWidth)??0,rowsMeta:aS(e.current.state),columnPositions:If(e),rows:i.rows,range:i.range,pinnedColumns:rv(e),visibleColumns:a,hiddenCellsOriginMap:s,listView:t.unstable_listView??!1,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function bQ(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length};if(e.listView)return F({},r,{lastColumnIndex:1});const{top:o,left:i}=t,a=Math.abs(i)+e.leftPinnedWidth;if(e.enabledForRows){let l=Math.min(wQ(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const c=e.hiddenCellsOriginMap[l];if(c){const d=Math.min(...Object.values(c));l=Math.min(l,d)}const u=e.autoHeight?l+e.rows.length:wQ(e,o+e.viewportInnerHeight);r.firstRowIndex=l,r.lastRowIndex=u}if(e.enabledForColumns){let l=0,c=e.columnPositions.length,u=!1;const[d,f]=HL({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let h=d;h<f&&!u;h+=1){const g=e.rows[h];u=e.apiRef.current.rowHasAutoHeight(g.id)}(!u||e.virtualizeColumnsWithAutoRowHeight)&&(l=sf(a,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),c=sf(a+e.viewportInnerWidth,e.columnPositions)),r.firstColumnIndex=l,r.lastColumnIndex=c}return Rdt(e,r,n)}function wQ(e,t,n){var a,s;const r=e.apiRef.current.getLastMeasuredRowIndex();let o=r===1/0;(a=e.range)!=null&&a.lastRowIndex&&!o&&(o=r>=e.range.lastRowIndex);const i=Ua(r-(((s=e.range)==null?void 0:s.firstRowIndex)||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[i]>=t?sf(t,e.rowsMeta.positions,n):Ddt(t,e.rowsMeta.positions,i,n)}function Rdt(e,t,n){const[r,o]=HL({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[i,a]=HL({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),s=sdt({firstColumnToRender:i,apiRef:e.apiRef,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:s,lastColumnIndex:a}}function sf(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const i=r+Math.floor((o-r)/2),a=t[i];let s;if(n!=null&&n.atStart){const l=(i===t.length-1?n.lastPosition:t[i+1])-a;s=e-l<a}else s=e<=a;return s?sf(e,t,n,r,i):sf(e,t,n,i+1,o)}function Ddt(e,t,n,r=void 0){let o=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=o,o*=2;return sf(e,t,r,Math.floor(n/2),Math.min(n,t.length))}function HL({firstIndex:e,lastIndex:t,bufferBefore:n,bufferAfter:r,minFirstIndex:o,maxLastIndex:i,positions:a,lastSize:s}){const l=a[e]-n,c=a[t]+r,u=sf(l,a,{atStart:!0,lastPosition:a[a.length-1]+s}),d=sf(c,a);return[Ua(u,o,i),Ua(d,o,i)]}function _dt(e,t){return e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function rue(e,t,n){const r=(e[t.firstColumnIndex]??0)-(e[n]??0);return Math.abs(r)}function $dt(e,t){return e===0&&t===0?lo.NONE:Math.abs(t)>=Math.abs(e)?t>0?lo.DOWN:lo.UP:e>0?lo.RIGHT:lo.LEFT}function oue(e,t,n,r,o,i){if(e)switch(t){case lo.LEFT:t=lo.RIGHT;break;case lo.RIGHT:t=lo.LEFT;break}switch(t){case lo.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case lo.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:i};case lo.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:i,columnBefore:0};case lo.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case lo.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const Ndt=()=>{var d,f;const e=wn(),t=Rt(),n=Ke(e,eS),r=Ke(e,Fz),o=Ke(e,hce),i=n===0&&o===0,a=Ke(e,Glt),s=!a&&i,l=!a&&n>0&&r===0;let c=null,u=null;return s&&(c="noRowsOverlay"),l&&(c="noResultsOverlay"),a&&(c="loadingOverlay",u=((f=(d=t.slotProps)==null?void 0:d.loadingOverlay)==null?void 0:f[i?"noRowsVariant":"variant"])||null),{overlayType:c,loadingOverlayVariant:u}},Ldt=tr("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),Fdt=tr("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),jdt=e=>{const{classes:t}=e;return Oe({root:["overlayWrapper"],inner:["overlayWrapperInner"]},kn,t)};function Bdt(e){const t=wn(),n=Rt(),r=Ke(t,qo);let o=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);o===0&&(o=Oce);const i=jdt(F({},e,{classes:n.classes}));return _.jsx(Ldt,F({className:fe(i.root)},e,{children:_.jsx(Fdt,F({className:fe(i.inner),style:{height:o,width:r.viewportOuterSize.width}},e))}))}function zdt(e){var i,a;const{overlayType:t}=e,n=Rt();if(!t)return null;const r=(i=n.slots)==null?void 0:i[t],o=(a=n.slotProps)==null?void 0:a[t];return _.jsx(Bdt,F({},e,{children:_.jsx(r,F({},o))}))}const H1=e=>e.columnMenu;function Vdt(){var v;const e=ts(),t=Rt(),n=Ke(e,Wr),r=Ke(e,tut),o=Ke(e,Xct),i=Ke(e,Fce),a=Ke(e,()=>zz(e)===null),s=Ke(e,fut),l=Ke(e,dut),c=Ke(e,NP),u=Ke(e,iS),d=Ke(e,H1),f=Ke(e,_s),h=Ke(e,odt),g=!(s===null&&i===null&&a),y=e.current.columnHeadersContainerRef;return _.jsx(t.slots.columnHeaders,F({ref:y,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:f,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:g},(v=t.slotProps)==null?void 0:v.columnHeaders))}const Hdt=Vu(Vdt),iue=w.createContext(void 0),aue=()=>{const e=w.useContext(iue);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(`+`));return e}const qd=(e,t)=>rS(e),Wz=(e,t)=>Ke(e,rS),bdt=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",wdt=bdt.includes("firefox"),aS=e=>e.rowsMeta,oO=e=>e.virtualization;Gt(oO,e=>e.enabled);const eue=Gt(oO,e=>e.enabledForColumns),xdt=Gt(oO,e=>e.enabledForRows),sS=Gt(oO,e=>e.renderContext),Sdt=Wn(e=>e.virtualization.renderContext.firstColumnIndex,e=>e.virtualization.renderContext.lastColumnIndex,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t})),VL={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},Cdt=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return F({},e,{virtualization:{enabled:!n,enabledForColumns:!n,enabledForRows:!n&&!r,renderContext:VL}})};function Edt(e,t){const n=i=>{e.current.setState(a=>F({},a,{virtualization:F({},a.virtualization,{enabled:i,enabledForColumns:i,enabledForRows:i&&!t.autoHeight})}))};dn(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:i=>{e.current.setState(a=>F({},a,{virtualization:F({},a.virtualization,{enabledForColumns:i})}))}},"public"),w.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization,t.autoHeight])}const Gz=e=>e.rowSpanning,tue=Gt(Gz,e=>e.hiddenCells),Pdt=Gt(Gz,e=>e.spannedCells),Idt=Gt(Gz,e=>e.hiddenCellOriginMap),iy=e=>e.listViewColumn,Tdt=ace(ca,sS,rS,Wr,Ds,(e,t,n,r,o)=>{if(!e)return!1;const i=o[e.id];if(!i)return!1;const a=n.rowToIndexMap.get(i),s=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(c=>c.field===e.field);return!(a!==void 0&&s!==-1&&a>=t.firstRowIndex&&a<=t.lastRowIndex)}),nue=Wn(Tdt,Wr,rS,Ds,ca,(e,t,n,r,o)=>{if(!e)return null;const i=r[o.id];if(!i)return null;const a=n.rowToIndexMap.get(i);if(a===void 0)return null;const s=t.findIndex(l=>l.field===o.field);return s===-1?null:F({},o,{rowIndex:a,columnIndex:s})});function $m(e,t){return Math.round(e*10**t)/10**t}const FP=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),d$=50;var so=function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e}(so||{});const yQ={top:0,left:0},Odt=Object.freeze(new Map),kdt=(e,t,n,r,o)=>({direction:so.NONE,buffer:oue(e,so.NONE,t,n,r,o)}),Mdt=()=>{var re;const e=ts(),t=Rt(),{unstable_listView:n}=t,r=Ke(e,()=>n?[iy(e.current.state)]:Wr(e)),o=Ke(e,xdt)&&!FP,i=Ke(e,eue)&&!FP,a=Ke(e,tv),s=rv(e),l=n?$P:s,c=a.bottom.length>0,[u,d]=w.useState(Odt),f=Yn(),h=Ke(e,vu),g=Wz(e),y=e.current.mainElementRef,v=e.current.virtualScrollerRef,x=e.current.virtualScrollbarVerticalRef,S=e.current.virtualScrollbarHorizontalRef,C=Ke(e,mct),I=w.useRef(!1),E=Ke(e,Az),T=Ke(e,Plt),O=Ke(e,QT),A=Ke(e,Adt),k=Ke(e,pce),M=Ke(e,fce),R=w.useRef(null),$=w.useCallback(le=>{if(y.current=le,!le)return;const me=le.getBoundingClientRect();let Se={width:$m(me.width,1),height:$m(me.height,1)};if((!R.current||Se.width!==R.current.width&&Se.height!==R.current.height)&&(R.current=Se,e.current.publishEvent("resize",Se)),typeof ResizeObserver>"u")return;const Ee=new ResizeObserver(ge=>{const xe=ge[0];if(!xe)return;const Pe={width:$m(xe.contentRect.width,1),height:$m(xe.contentRect.height,1)};Pe.width===Se.width&&Pe.height===Se.height||(e.current.publishEvent("resize",Pe),Se=Pe)});if(Ee.observe(le),vdt>=19)return()=>{y.current=null,Ee.disconnect()}},[e,y]),L=w.useRef(((re=t.initialState)==null?void 0:re.scroll)??yQ),z=w.useRef(!1),N=w.useRef(yQ),B=w.useRef(VL),U=Ke(e,sS),G=Ke(e,nue),H=fa(),K=w.useRef(void 0),q=Ks(()=>kdt(f,t.rowBufferPx,t.columnBufferPx,E*15,d$*6)).current,Y=w.useCallback(le=>{if(_dt(le,e.current.state.virtualization.renderContext))return;const me=le.firstRowIndex!==B.current.firstRowIndex||le.lastRowIndex!==B.current.lastRowIndex;e.current.setState(Ee=>F({},Ee,{virtualization:F({},Ee.virtualization,{renderContext:le})})),qo(e.current.state).isReady&&me&&(B.current=le,e.current.publishEvent("renderedRowsIntervalChange",le)),N.current=L.current},[e]),J=Qe(()=>{const le=v.current;if(!le)return;const me=qo(e.current.state),Se=Math.ceil(me.minimumSize.height-me.viewportOuterSize.height),Ee=Math.ceil(me.minimumSize.width-me.viewportInnerSize.width),ge={top:Ua(le.scrollTop,0,Se),left:f?Ua(le.scrollLeft,-Ee,0):Ua(le.scrollLeft,0,Ee)},xe=ge.left-L.current.left,Pe=ge.top-L.current.top,_e=xe!==0||Pe!==0;L.current=ge;const Le=_e?$dt(xe,Pe):so.NONE,de=Math.abs(L.current.top-N.current.top),$e=Math.abs(L.current.left-N.current.left),Ae=de>=E||$e>=d$,Ne=q.direction!==Le;if(!(Ae||Ne))return U;if(Ne)switch(Le){case so.NONE:case so.LEFT:case so.RIGHT:K.current=void 0;break;default:K.current=U;break}q.direction=Le,q.buffer=oue(f,Le,t.rowBufferPx,t.columnBufferPx,E*15,d$*6);const Ze=vQ(e,t,o,i),ut=bQ(Ze,L.current,q);return u0.flushSync(()=>{Y(ut)}),H.start(1e3,J),ut}),ie=()=>{if(!qo(e.current.state).isReady&&(o||i))return;const le=vQ(e,t,o,i),me=bQ(le,L.current,q);K.current=void 0,Y(me)},ee=Qe(()=>{if(z.current){z.current=!1;return}const le=J();e.current.publishEvent("scrollPositionChange",{top:L.current.top,left:L.current.left,renderContext:le})}),te=Qe(le=>{e.current.publishEvent("virtualScrollerWheel",{},le)}),ce=Qe(le=>{e.current.publishEvent("virtualScrollerTouchMove",{},le)}),ae=(le={})=>{var Ue;if(!le.rows&&!g.range)return[];let me=U;le.renderContext&&(me=le.renderContext,me.firstColumnIndex=U.firstColumnIndex,me.lastColumnIndex=U.lastColumnIndex);const Se=!c&&le.position===void 0||c&&le.position==="bottom",Ee=le.position!==void 0;let ge;switch(le.position){case"top":ge=0;break;case"bottom":ge=a.top.length+g.rows.length;break;case void 0:ge=a.top.length;break}const xe=le.rows??g.rows,Pe=me.firstRowIndex,_e=Math.min(me.lastRowIndex,xe.length),Le=le.rows?ZY(0,le.rows.length):ZY(Pe,_e);let de=-1;!Ee&&G&&(G.rowIndex<Pe&&(Le.unshift(G.rowIndex),de=G.rowIndex),G.rowIndex>_e&&(Le.push(G.rowIndex),de=G.rowIndex));const $e=[],Ae=(Ue=t.slotProps)==null?void 0:Ue.row,Ne=If(e);return Le.forEach(Ze=>{var Yr,Yi,Qi;const{id:ut,model:Ye}=xe[Ze],et=(((Yr=g==null?void 0:g.range)==null?void 0:Yr.firstRowIndex)||0)+ge+Ze;if(C){const qt=l.left.length,Dr=r.length-l.right.length;e.current.calculateColSpan({rowId:ut,minFirstColumn:qt,maxLastColumn:Dr,columns:r}),l.left.length>0&&e.current.calculateColSpan({rowId:ut,minFirstColumn:0,maxLastColumn:l.left.length,columns:r}),l.right.length>0&&e.current.calculateColSpan({rowId:ut,minFirstColumn:r.length-l.right.length,maxLastColumn:r.length,columns:r})}const Xe=e.current.rowHasAutoHeight(ut)?"auto":e.current.unstable_getRowHeight(ut);let mt;h[ut]==null?mt=!1:mt=e.current.isRowSelectable(ut);let At=!1;le.position===void 0&&(At=Ze===0);let Bt=!1;const gt=Ze===xe.length-1;if(Se)if(Ee)Bt=gt;else{const qt=g.rows.length-1;Ze===qt&&(Bt=!0)}let Vt=me;K.current&&Ze>=K.current.firstRowIndex&&Ze<K.current.lastRowIndex&&(Vt=K.current);const Mn=Ze===de,nr=(G==null?void 0:G.rowIndex)===et,un=rue(Ne,Vt,l.left.length),jn=gt&&le.position==="top",dr=Vt.firstColumnIndex,Bn=Vt.lastColumnIndex;if($e.push(_.jsx(t.slots.row,F({row:Ye,rowId:ut,index:et,selected:mt,offsetLeft:un,columnsTotalWidth:O,rowHeight:Xe,pinnedColumns:l,visibleColumns:r,firstColumnIndex:dr,lastColumnIndex:Bn,focusedColumnIndex:nr?G.columnIndex:void 0,isFirstVisible:At,isLastVisible:Bt,isNotVisible:Mn,showBottomBorder:jn,scrollbarWidth:k,gridHasFiller:M},Ae),ut)),Mn)return;const Fo=u.get(ut);Fo&&$e.push(Fo),le.position===void 0&>&&$e.push((Qi=(Yi=e.current).getInfiniteLoadingTriggerElement)==null?void 0:Qi.call(Yi,{lastRowId:ut}))}),$e},ne=w.useMemo(()=>({overflowX:!A||n?"hidden":void 0,overflowY:t.autoHeight?"hidden":void 0}),[A,t.autoHeight,n]),ue=w.useMemo(()=>{const le={width:A?O:"auto",flexBasis:T,flexShrink:0};return le.flexBasis===0&&(le.flexBasis=Oce),le},[O,T,A]),he=w.useCallback(le=>{le&&e.current.publishEvent("virtualScrollerContentSizeChange",{columnsTotalWidth:O,contentHeight:T})},[e,O,T]);return On(()=>{var le,me;I.current&&((me=(le=e.current).updateRenderContext)==null||me.call(le))},[e,i,o]),On(()=>{n&&(v.current.scrollLeft=0)},[n,v]),hut(U!==VL,()=>{var le;if(e.current.publishEvent("scrollPositionChange",{top:L.current.top,left:L.current.left,renderContext:U}),I.current=!0,(le=t.initialState)!=null&&le.scroll&&v.current){const me=v.current,{top:Se,left:Ee}=t.initialState.scroll,ge={top:!(Se>0),left:!(Ee>0)};if(!ge.left&&O&&(me.scrollLeft=Ee,z.current=!0,ge.left=!0),!ge.top&&T&&(me.scrollTop=Se,z.current=!0,ge.top=!0),!ge.top||!ge.left){const xe=e.current.subscribeEvent("virtualScrollerContentSizeChange",Pe=>{!ge.left&&Pe.columnsTotalWidth&&(me.scrollLeft=Ee,z.current=!0,ge.left=!0),!ge.top&&Pe.contentHeight&&(me.scrollTop=Se,z.current=!0,ge.top=!0),ge.left&&ge.top&&xe()});return xe}}}),e.current.register("private",{updateRenderContext:ie}),er(e,"sortedRowsSet",ie),er(e,"paginationModelChange",ie),er(e,"columnsChange",ie),{renderContext:U,setPanels:d,getRows:ae,getContainerProps:()=>({ref:$}),getScrollerProps:()=>({ref:v,onScroll:ee,onWheel:te,onTouchMove:ce,style:ne,role:"presentation",tabIndex:wdt?-1:void 0}),getContentProps:()=>({style:ue,role:"presentation",ref:he}),getRenderZoneProps:()=>({role:"rowgroup"}),getScrollbarVerticalProps:()=>({ref:x,scrollPosition:L}),getScrollbarHorizontalProps:()=>({ref:S,scrollPosition:L}),getScrollAreaProps:()=>({scrollPosition:L})}};function Adt(e){return e.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width}function vQ(e,t,n,r){const o=qo(e.current.state),i=qd(e),a=t.unstable_listView?[iy(e.current.state)]:Wr(e),s=Idt(e),l=e.current.state.rows.dataRowIds.at(-1),c=a.at(-1);return{enabledForRows:n,enabledForColumns:r,apiRef:e,autoHeight:t.autoHeight,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx,leftPinnedWidth:o.leftPinnedWidth,columnsTotalWidth:o.columnsTotalWidth,viewportInnerWidth:o.viewportInnerSize.width,viewportInnerHeight:o.viewportInnerSize.height,lastRowHeight:l!==void 0?e.current.unstable_getRowHeight(l):0,lastColumnWidth:(c==null?void 0:c.computedWidth)??0,rowsMeta:aS(e.current.state),columnPositions:If(e),rows:i.rows,range:i.range,pinnedColumns:rv(e),visibleColumns:a,hiddenCellsOriginMap:s,listView:t.unstable_listView??!1,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function bQ(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.visibleColumns.length};if(e.listView)return F({},r,{lastColumnIndex:1});const{top:o,left:i}=t,a=Math.abs(i)+e.leftPinnedWidth;if(e.enabledForRows){let l=Math.min(wQ(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const c=e.hiddenCellsOriginMap[l];if(c){const d=Math.min(...Object.values(c));l=Math.min(l,d)}const u=e.autoHeight?l+e.rows.length:wQ(e,o+e.viewportInnerHeight);r.firstRowIndex=l,r.lastRowIndex=u}if(e.enabledForColumns){let l=0,c=e.columnPositions.length,u=!1;const[d,f]=HL({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let h=d;h<f&&!u;h+=1){const g=e.rows[h];u=e.apiRef.current.rowHasAutoHeight(g.id)}(!u||e.virtualizeColumnsWithAutoRowHeight)&&(l=sf(a,e.columnPositions,{atStart:!0,lastPosition:e.columnsTotalWidth}),c=sf(a+e.viewportInnerWidth,e.columnPositions)),r.firstColumnIndex=l,r.lastColumnIndex=c}return Rdt(e,r,n)}function wQ(e,t,n){var a,s;const r=e.apiRef.current.getLastMeasuredRowIndex();let o=r===1/0;(a=e.range)!=null&&a.lastRowIndex&&!o&&(o=r>=e.range.lastRowIndex);const i=Ua(r-(((s=e.range)==null?void 0:s.firstRowIndex)||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[i]>=t?sf(t,e.rowsMeta.positions,n):Ddt(t,e.rowsMeta.positions,i,n)}function Rdt(e,t,n){const[r,o]=HL({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[i,a]=HL({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:e.pinnedColumns.left.length,maxLastIndex:e.visibleColumns.length-e.pinnedColumns.right.length,bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),s=sdt({firstColumnToRender:i,apiRef:e.apiRef,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:s,lastColumnIndex:a}}function sf(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const i=r+Math.floor((o-r)/2),a=t[i];let s;if(n!=null&&n.atStart){const l=(i===t.length-1?n.lastPosition:t[i+1])-a;s=e-l<a}else s=e<=a;return s?sf(e,t,n,r,i):sf(e,t,n,i+1,o)}function Ddt(e,t,n,r=void 0){let o=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=o,o*=2;return sf(e,t,r,Math.floor(n/2),Math.min(n,t.length))}function HL({firstIndex:e,lastIndex:t,bufferBefore:n,bufferAfter:r,minFirstIndex:o,maxLastIndex:i,positions:a,lastSize:s}){const l=a[e]-n,c=a[t]+r,u=sf(l,a,{atStart:!0,lastPosition:a[a.length-1]+s}),d=sf(c,a);return[Ua(u,o,i),Ua(d,o,i)]}function _dt(e,t){return e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex}function rue(e,t,n){const r=(e[t.firstColumnIndex]??0)-(e[n]??0);return Math.abs(r)}function $dt(e,t){return e===0&&t===0?so.NONE:Math.abs(t)>=Math.abs(e)?t>0?so.DOWN:so.UP:e>0?so.RIGHT:so.LEFT}function oue(e,t,n,r,o,i){if(e)switch(t){case so.LEFT:t=so.RIGHT;break;case so.RIGHT:t=so.LEFT;break}switch(t){case so.NONE:return{rowAfter:n,rowBefore:n,columnAfter:r,columnBefore:r};case so.LEFT:return{rowAfter:0,rowBefore:0,columnAfter:0,columnBefore:i};case so.RIGHT:return{rowAfter:0,rowBefore:0,columnAfter:i,columnBefore:0};case so.UP:return{rowAfter:0,rowBefore:o,columnAfter:0,columnBefore:0};case so.DOWN:return{rowAfter:o,rowBefore:0,columnAfter:0,columnBefore:0};default:throw new Error("unreachable")}}const Ndt=()=>{var d,f;const e=wn(),t=Rt(),n=Ke(e,eS),r=Ke(e,Fz),o=Ke(e,hce),i=n===0&&o===0,a=Ke(e,Glt),s=!a&&i,l=!a&&n>0&&r===0;let c=null,u=null;return s&&(c="noRowsOverlay"),l&&(c="noResultsOverlay"),a&&(c="loadingOverlay",u=((f=(d=t.slotProps)==null?void 0:d.loadingOverlay)==null?void 0:f[i?"noRowsVariant":"variant"])||null),{overlayType:c,loadingOverlayVariant:u}},Ldt=tr("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e,loadingOverlayVariant:t})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),Fdt=tr("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),jdt=e=>{const{classes:t}=e;return Oe({root:["overlayWrapper"],inner:["overlayWrapperInner"]},kn,t)};function Bdt(e){const t=wn(),n=Rt(),r=Ke(t,qo);let o=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);o===0&&(o=Oce);const i=jdt(F({},e,{classes:n.classes}));return _.jsx(Ldt,F({className:fe(i.root)},e,{children:_.jsx(Fdt,F({className:fe(i.inner),style:{height:o,width:r.viewportOuterSize.width}},e))}))}function zdt(e){var i,a;const{overlayType:t}=e,n=Rt();if(!t)return null;const r=(i=n.slots)==null?void 0:i[t],o=(a=n.slotProps)==null?void 0:a[t];return _.jsx(Bdt,F({},e,{children:_.jsx(r,F({},o))}))}const H1=e=>e.columnMenu;function Vdt(){var v;const e=ts(),t=Rt(),n=Ke(e,Wr),r=Ke(e,tut),o=Ke(e,Xct),i=Ke(e,Fce),a=Ke(e,()=>zz(e)===null),s=Ke(e,fut),l=Ke(e,dut),c=Ke(e,NP),u=Ke(e,iS),d=Ke(e,H1),f=Ke(e,_s),h=Ke(e,odt),g=!(s===null&&i===null&&a),y=e.current.columnHeadersContainerRef;return _.jsx(t.slots.columnHeaders,F({ref:y,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:f,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:g},(v=t.slotProps)==null?void 0:v.columnHeaders))}const Hdt=Vu(Vdt),iue=w.createContext(void 0),aue=()=>{const e=w.useContext(iue);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(``));return e},Udt=tr("div")({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),Wdt=tr("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],n.loadingOverlayVariant==="skeleton"&&t["main--hasSkeletonLoadingOverlay"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),Gdt=Nn((e,t)=>{var a;const{ownerState:n}=e,r=Rt(),i=aue().hooks.useGridAriaAttributes();return _.jsxs(Wdt,F({ownerState:n,className:e.className,tabIndex:-1},i,(a=r.slotProps)==null?void 0:a.main,{ref:t,children:[_.jsx(Udt,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),qdt=()=>Oe({root:["topContainer"]},kn,{}),Kdt=tr("div")({position:"sticky",zIndex:4,top:0});function Ydt(e){const t=qdt();return _.jsx(Kdt,F({},e,{className:fe(t.root,oe["container--top"]),role:"presentation"}))}const Qdt=()=>Oe({root:["bottomContainer"]},kn,{}),Xdt=tr("div")({position:"sticky",zIndex:4,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function Jdt(e){const t=Qdt();return _.jsx(Xdt,F({},e,{className:fe(t.root,oe["container--bottom"]),role:"presentation"}))}const Zdt=(e,t)=>{const{classes:n}=e;return Oe({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},kn,n)},eft=tr("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),tft=Nn(function(t,n){var s;const r=Rt(),o=!r.autoHeight&&((s=t.style)==null?void 0:s.minHeight)==="auto",i=Zdt(r,o),a={classes:r.classes,overflowedContent:o};return _.jsx(eft,F({},t,{ownerState:a,className:fe(i.root,t.className),ref:n}))}),nft=tr("div")({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),sue=tr("div")({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:"var(--DataGrid-pinnedBackground)"}),rft=tr(sue)({left:0,borderRight:"1px solid var(--rowBorderColor)"}),oft=tr(sue)({right:0,borderLeft:"1px solid var(--rowBorderColor)"}),ift=tr("div")({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});function aft({rowsLength:e}){const t=wn(),{viewportOuterSize:n,minimumSize:r,hasScrollX:o,hasScrollY:i,scrollbarSize:a,leftPinnedWidth:s,rightPinnedWidth:l}=Ke(t,qo),c=o?a:0,u=n.height-r.height>0;return c===0&&!u?null:_.jsxs(nft,{className:oe.filler,role:"presentation",style:{height:c,"--rowBorderColor":e===0?"transparent":"var(--DataGrid-rowBorderColor)"},children:[s>0&&_.jsx(rft,{className:oe["filler--pinnedLeft"],style:{width:s}}),_.jsx(ift,{}),l>0&&_.jsx(oft,{className:oe["filler--pinnedRight"],style:{width:l+(i?a:0)}})]})}const sft=Vu(aft),lft=["className"],cft=e=>{const{classes:t}=e;return Oe({root:["virtualScrollerRenderZone"]},kn,t)},uft=tr("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),dft=Nn(function(t,n){const{className:r}=t,o=We(t,lft),i=wn(),a=Rt(),s=cft(a),l=Ke(i,()=>{const c=sS(i);return aS(i.current.state).positions[c.firstRowIndex]??0});return _.jsx(uft,F({className:fe(s.root,r),ownerState:a,style:{transform:`translate3d(0, ${l}px, 0)`}},o,{ref:n}))}),fft={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},Oo=e=>e.editRows,lue=Z0(Oo,(e,{rowId:t,editMode:n})=>n===Tc.Row&&!!e[t]),pft=Z0(Oo,(e,{rowId:t,field:n})=>{var r;return((r=e[t])==null?void 0:r[n])??null}),Bx=e=>e.preferencePanel,hft=Z0(Bx,(e,t)=>!!(e.open&&e.labelId===t));var Xp=function(e){return e.filters="filters",e.columns="columns",e}(Xp||{});const mft=(e,t)=>{const{classes:n}=e,r={root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]};return Oe(r,kn,n)},cue=tr("div")({position:"absolute",display:"inline-block",zIndex:6,"&:hover":{zIndex:7},"--size":"calc(max(var(--DataGrid-scrollbarSize), 14px))"}),gft=tr(cue)({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-topContainerHeight) - var(--DataGrid-bottomContainerHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-topContainerHeight)",right:"0px"}),yft=tr(cue)({width:"100%",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:"0px"}),xQ=Nn(function(t,n){const r=ts(),o=Rt(),i=w.useRef(!1),a=w.useRef(0),s=w.useRef(null),l=w.useRef(null),c=mft(o,t.position),u=Ke(r,qo),d=t.position==="vertical"?"height":"width",f=t.position==="vertical"?"scrollTop":"scrollLeft",h=t.position==="vertical"?"top":"left",g=t.position==="vertical"?u.hasScrollX:u.hasScrollY,y=u.minimumSize[d]+(g?u.scrollbarSize:0),x=(t.position==="vertical"?u.viewportInnerSize.height:u.viewportOuterSize.width)*(y/u.viewportOuterSize[d]),S=Qe(()=>{const E=s.current,T=t.scrollPosition.current;if(!E||T[h]===a.current)return;if(a.current=T[h],i.current){i.current=!1;return}i.current=!0;const O=T[h]/y;E[f]=O*x}),C=Qe(()=>{const E=r.current.virtualScrollerRef.current,T=s.current;if(!T)return;if(i.current){i.current=!1;return}i.current=!0;const O=T[f]/x;E[f]=O*y});SF(()=>{const E=r.current.virtualScrollerRef.current,T=s.current,O={passive:!0};return E.addEventListener("scroll",S,O),T.addEventListener("scroll",C,O),()=>{E.removeEventListener("scroll",S,O),T.removeEventListener("scroll",C,O)}}),w.useEffect(()=>{l.current.style.setProperty(d,`${x}px`)},[x,d]);const I=t.position==="vertical"?gft:yft;return _.jsx(I,{ref:cn(n,s),className:c.root,style:t.position==="vertical"&&o.unstable_listView?{height:"100%",top:0}:void 0,tabIndex:-1,"aria-hidden":"true",onFocus:E=>{E.target.blur()},children:_.jsx("div",{ref:l,className:c.content})})}),vft=e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:o}=e;return Oe({root:["main",r&&"main--hasPinnedRight",o==="skeleton"&&"main--hasSkeletonLoadingOverlay"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},kn,t)},bft=tr("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),wft=e=>e.dimensions.rightPinnedWidth>0;function xft(e){const t=wn(),n=Rt(),r=Ke(t,Tlt),o=Ke(t,Ilt),i=Ke(t,wft),a=Ke(t,Mlt),s=Ndt(),l={classes:n.classes,hasScrollX:o,hasPinnedRight:i,loadingOverlayVariant:s.loadingOverlayVariant},c=vft(l),u=Mdt(),{getContainerProps:d,getScrollerProps:f,getContentProps:h,getRenderZoneProps:g,getScrollbarVerticalProps:y,getScrollbarHorizontalProps:v,getRows:x,getScrollAreaProps:S}=u,C=x();return _.jsxs(Gdt,F({className:c.root},d(),{ownerState:l,children:[_.jsx(pQ,F({scrollDirection:"left"},S())),_.jsx(pQ,F({scrollDirection:"right"},S())),_.jsxs(bft,F({className:c.scroller},f(),{ownerState:l,children:[_.jsxs(Ydt,{children:[!n.unstable_listView&&_.jsx(Hdt,{}),_.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:u})]}),_.jsx(zdt,F({},s)),_.jsx(tft,F({},h(),{children:_.jsxs(dft,F({},g(),{children:[C,_.jsx(n.slots.detailPanels,{virtualScroller:u})]}))})),a&&_.jsx(sft,{rowsLength:C.length}),_.jsx(Jdt,{children:_.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:u})})]})),o&&!n.unstable_listView&&_.jsx(xQ,F({position:"horizontal"},v())),r&&_.jsx(xQ,F({position:"vertical"},y())),e.children]}))}function Sft(){var t;const e=Rt();return e.hideFooter?null:_.jsx(e.slots.footer,F({},(t=e.slotProps)==null?void 0:t.footer))}let f$;function Cft(){return f$===void 0&&document.createElement("div").focus({get preventScroll(){return f$=!0,!1}}),f$}function Eft({defaultSlots:e,slots:t}){const n=t;if(!n||Object.keys(n).length===0)return e;const r=F({},e);return Object.keys(n).forEach(o=>{const i=o;n[i]!==void 0&&(r[i]=n[i])}),r}function Pft(e){var o;if((o=e.slotProps)!=null&&o.root)return e;const t=Object.keys(e);if(!t.some(i=>i.startsWith("aria-")||i.startsWith("data-")))return e;const n={},r=e.forwardedProps??{};for(let i=0;i<t.length;i+=1){const a=t[i];a.startsWith("aria-")||a.startsWith("data-")?r[a]=e[a]:n[a]=e[a]}return n.forwardedProps=r,n}function Ift(e){return w.useMemo(()=>Pft(e),[e])}const Tft=e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null},Oft=e=>e===Mce||Tft(e)!==null,uue=(e,t)=>{if(e)if(t){if(e===Sn.LEFT)return"right";if(e===Sn.RIGHT)return"left"}else{if(e===Sn.LEFT)return"left";if(e===Sn.RIGHT)return"right"}};function iO(e,t,n,r){const o=uue(n,t);return!o||r===void 0||(e[o]=r),e}const kft=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],Mft=["changeReason","unstable_updateValueOnRender"];Sn.LEFT+"",Cd.LEFT,Sn.RIGHT+"",Cd.RIGHT,Sn.NONE+"",Sn.VIRTUAL+"";const Aft=e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:o,isEditable:i,isSelected:a,isSelectionMode:s,classes:l}=e,c={root:["cell",`cell--text${we(t)}`,a&&"selected",i&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",o===Sn.LEFT&&"cell--pinnedLeft",o===Sn.RIGHT&&"cell--pinnedRight",s&&!i&&"cell--selectionMode"]};return Oe(c,kn,l)},Rft=Nn(function(t,n){var Ye,et,Xe;const{column:r,row:o,rowId:i,rowNode:a,align:s,colIndex:l,width:c,className:u,style:d,colSpan:f,disableDragEvents:h,isNotVisible:g,pinnedOffset:y,pinnedPosition:v,showRightBorder:x,showLeftBorder:S,onClick:C,onDoubleClick:I,onMouseDown:E,onMouseUp:T,onMouseOver:O,onKeyDown:A,onKeyUp:k,onDragEnter:M,onDragOver:R}=t,$=We(t,kft),L=ts(),z=Rt(),N=Yn(),B=r.field,U=Lx(L,pft,{rowId:i,field:B}),G=U?Jn.Edit:Jn.View,H=L.current.getCellParamsForRow(i,B,o,{colDef:r,cellMode:G,rowNode:a,tabIndex:Ke(L,()=>{const mt=zz(L);return mt&&mt.field===B&&mt.id===i?0:-1}),hasFocus:Ke(L,()=>{const mt=ca(L);return(mt==null?void 0:mt.id)===i&&mt.field===B})});H.api=L.current;const K=Ke(L,()=>L.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:i,field:B})),q=Ke(L,tue),Y=Ke(L,Pdt),{hasFocus:J,isEditable:ie=!1,value:ee}=H,te=r.type==="actions"&&((Ye=r.getActions)==null?void 0:Ye.call(r,L.current.getRowParams(i)).some(mt=>!mt.props.disabled)),ce=(G==="view"||!ie)&&!te?H.tabIndex:-1,{classes:ae,getCellClassName:ne}=z,he=[Ke(L,()=>L.current.unstable_applyPipeProcessors("cellClassName",[],{id:i,field:B}).filter(Boolean).join(" "))];r.cellClassName&&he.push(typeof r.cellClassName=="function"?r.cellClassName(H):r.cellClassName),r.display==="flex"&&he.push(oe["cell--flex"]),ne&&he.push(ne(H));const re=H.formattedValue??ee,le=w.useRef(null),me=cn(n,le),Se=w.useRef(null),Ee=z.cellSelection??!1,ge={align:s,showLeftBorder:S,showRightBorder:x,isEditable:ie,classes:z.classes,pinnedPosition:v,isSelected:K,isSelectionMode:Ee},xe=Aft(ge),Pe=w.useCallback(mt=>At=>{const Bt=L.current.getCellParams(i,B||"");L.current.publishEvent(mt,Bt,At),T&&T(At)},[L,B,T,i]),_e=w.useCallback(mt=>At=>{const Bt=L.current.getCellParams(i,B||"");L.current.publishEvent(mt,Bt,At),E&&E(At)},[L,B,E,i]),Le=w.useCallback((mt,At)=>Bt=>{if(!L.current.getRow(i))return;const gt=L.current.getCellParams(i,B||"");L.current.publishEvent(mt,gt,Bt),At&&At(Bt)},[L,B,i]),de=((et=q[i])==null?void 0:et[B])??!1,$e=((Xe=Y[i])==null?void 0:Xe[B])??1,Ae=w.useMemo(()=>{if(g)return{padding:0,opacity:0,width:0,height:0,border:0};const mt=iO(F({"--width":`${c}px`},d),N,v,y),At=v===Sn.LEFT,Bt=v===Sn.RIGHT;return $e>1&&(mt.height=`calc(var(--height) * ${$e})`,mt.zIndex=5,(At||Bt)&&(mt.zIndex=6)),mt},[c,g,d,y,v,N,$e]);if(w.useEffect(()=>{if(!J||G===Jn.Edit)return;const mt=vr(L.current.rootElementRef.current);if(le.current&&!le.current.contains(mt.activeElement)){const At=le.current.querySelector('[tabindex="0"]'),Bt=Se.current||At||le.current;if(Cft())Bt.focus({preventScroll:!0});else{const gt=L.current.getScrollPosition();Bt.focus(),L.current.scroll(gt)}}},[J,G,L]),de)return _.jsx("div",{"data-colindex":l,role:"presentation",style:F({width:"var(--width)"},Ae)});let Ne=$.onFocus,Ue,Ze;if(U===null&&r.renderCell&&(Ue=r.renderCell(H)),U!==null&&r.renderEditCell){const mt=L.current.getRowWithUpdatedValues(i,r.field),At=We(U,Mft),Bt=r.valueFormatter?r.valueFormatter(U.value,mt,r,L):H.formattedValue,gt=F({},H,{row:mt,formattedValue:Bt},At);Ue=r.renderEditCell(gt),he.push(oe["cell--editing"]),he.push(ae==null?void 0:ae["cell--editing"])}if(Ue===void 0){const mt=re==null?void 0:re.toString();Ue=mt,Ze=mt}w.isValidElement(Ue)&&te&&(Ue=w.cloneElement(Ue,{focusElementRef:Se}));const ut=h?null:{onDragEnter:Le("cellDragEnter",M),onDragOver:Le("cellDragOver",R)};return _.jsx("div",F({className:fe(xe.root,he,u),role:"gridcell","data-field":B,"data-colindex":l,"aria-colindex":l+1,"aria-colspan":f,"aria-rowspan":$e,style:Ae,title:Ze,tabIndex:ce,onClick:Le("cellClick",C),onDoubleClick:Le("cellDoubleClick",I),onMouseOver:Le("cellMouseOver",O),onMouseDown:_e("cellMouseDown"),onMouseUp:Pe("cellMouseUp"),onKeyDown:Le("cellKeyDown",A),onKeyUp:Le("cellKeyUp",k)},ut,$,{onFocus:Ne,ref:me,children:Ue}))}),Dft=Vu(Rft),_ft=["label","icon","showInMenu","onClick"],$ft=["label","icon","showInMenu","onClick","closeMenuOnClick","closeMenu"],c1=Nn((e,t)=>{var u;const n=Rt();if(!e.showInMenu){const{label:d,icon:f,onClick:h}=e,g=We(e,_ft),y=v=>{h==null||h(v)};return _.jsx(n.slots.baseIconButton,F({size:"small",role:"menuitem","aria-label":d},g,{onClick:y},(u=n.slotProps)==null?void 0:u.baseIconButton,{ref:t,children:w.cloneElement(f,{fontSize:"small"})}))}const{label:r,icon:o,onClick:i,closeMenuOnClick:a=!0,closeMenu:s}=e,l=We(e,$ft),c=d=>{i==null||i(d),a&&(s==null||s())};return _.jsxs(Ft,F({ref:t},l,{onClick:c,children:[o&&_.jsx(si,{children:o}),r]}))}),Nft=["field","type","align","width","height","empty","style","className"],SQ="1.3em",Lft="1.2em",CQ=[40,80],Fft={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},jft=e=>{const{align:t,classes:n,empty:r}=e,o={root:["cell","cellSkeleton",`cell--text${t?we(t):"Left"}`,r&&"cellEmpty"]};return Oe(o,kn,n)},Bft=lct(12345);function zft(e){const{field:t,type:n,align:r,width:o,height:i,empty:a=!1,style:s,className:l}=e,c=We(e,Nft),d={classes:Rt().classes,align:r,empty:a},f=jft(d),h=w.useMemo(()=>{if(n==="boolean"||n==="actions")return{variant:"circular",width:SQ,height:SQ};const[y,v]=n?Fft[n]??CQ:CQ;return{variant:"text",width:`${Math.round(Bft(y,v))}%`,height:Lft}},[n]);return _.jsx("div",F({"data-field":t,className:fe(f.root,l),style:F({height:i,maxWidth:o,minWidth:o},s)},c,{children:!a&&_.jsx(C1,F({},h))}))}const Vft=Vu(zft);function Hft(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?Su(Pt(e.palette.divider,1),.88):xu(Pt(e.palette.divider,1),.68)}const EQ={[`& .${oe.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${oe.menuIcon}`]:{width:"auto",visibility:"visible"}},Uft=10,u1=-5,hm=1,PQ={width:3,rx:1.5,x:10.5},Wft="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",Gft=e=>e.dimensions.hasScrollX&&(!e.dimensions.hasScrollY||e.dimensions.scrollbarSize===0),qft=se("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${oe.autoHeight}`]:t.autoHeight},{[`&.${oe.autosizing}`]:t.autosizing},{[`&.${oe["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${oe["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${oe["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${oe["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${oe["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${oe.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${oe.actionsCell}`]:t.actionsCell},{[`& .${oe.booleanCell}`]:t.booleanCell},{[`& .${oe.cell}`]:t.cell},{[`& .${oe["cell--editable"]}`]:t["cell--editable"]},{[`& .${oe["cell--editing"]}`]:t["cell--editing"]},{[`& .${oe["cell--flex"]}`]:t["cell--flex"]},{[`& .${oe["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${oe["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${oe["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${oe["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${oe["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${oe["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${oe["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${oe["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${oe["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${oe["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${oe["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${oe["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${oe.cellCheckbox}`]:t.cellCheckbox},{[`& .${oe.cellEmpty}`]:t.cellEmpty},{[`& .${oe.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${oe.cellSkeleton}`]:t.cellSkeleton},{[`& .${oe.checkboxInput}`]:t.checkboxInput},{[`& .${oe.columnHeader}`]:t.columnHeader},{[`& .${oe["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${oe["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${oe["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${oe["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${oe["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${oe["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${oe["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${oe["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${oe["columnHeader--lastUnpinned"]}`]:t["columnHeader--lastUnpinned"]},{[`& .${oe["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${oe["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${oe["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${oe["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${oe["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${oe["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${oe["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${oe["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${oe["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${oe.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${oe.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${oe.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${oe.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${oe.columnSeparator}`]:t.columnSeparator},{[`& .${oe["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${oe["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${oe["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${oe["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${oe["container--bottom"]}`]:t["container--bottom"]},{[`& .${oe["container--top"]}`]:t["container--top"]},{[`& .${oe.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${oe["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${oe.editBooleanCell}`]:t.editBooleanCell},{[`& .${oe.filterIcon}`]:t.filterIcon},{[`& .${oe["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${oe["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${oe["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${oe.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${oe.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${oe.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${oe.headerFilterRow}`]:t.headerFilterRow},{[`& .${oe.iconSeparator}`]:t.iconSeparator},{[`& .${oe.menuIcon}`]:t.menuIcon},{[`& .${oe.menuIconButton}`]:t.menuIconButton},{[`& .${oe.menuList}`]:t.menuList},{[`& .${oe.menuOpen}`]:t.menuOpen},{[`& .${oe.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${oe.pinnedRows}`]:t.pinnedRows},{[`& .${oe["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${oe["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${oe.row}`]:t.row},{[`& .${oe["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${oe["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${oe["row--dragging"]}`]:t["row--dragging"]},{[`& .${oe["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${oe["row--editable"]}`]:t["row--editable"]},{[`& .${oe["row--editing"]}`]:t["row--editing"]},{[`& .${oe["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${oe["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${oe.rowReorderCell}`]:t.rowReorderCell},{[`& .${oe["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${oe.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${oe.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${oe.rowSkeleton}`]:t.rowSkeleton},{[`& .${oe.scrollbar}`]:t.scrollbar},{[`& .${oe["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${oe["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${oe.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${oe["scrollbarFiller--borderBottom"]}`]:t["scrollbarFiller--borderBottom"]},{[`& .${oe["scrollbarFiller--borderTop"]}`]:t["scrollbarFiller--borderTop"]},{[`& .${oe["scrollbarFiller--header"]}`]:t["scrollbarFiller--header"]},{[`& .${oe["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${oe.sortIcon}`]:t.sortIcon},{[`& .${oe.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${oe.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${oe.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${oe.withBorderColor}`]:t.withBorderColor}]})(({theme:e})=>{var A,k;const t=ts(),n=Ke(t,Gft),r=Hft(e),o=e.shape.borderRadius,i=e.vars?e.vars.palette.background.default:((A=e.mixins.MuiDataGrid)==null?void 0:A.containerBackground)??e.palette.background.default,a=((k=e.mixins.MuiDataGrid)==null?void 0:k.pinnedBackground)??i,s=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Pt(e.palette.background.default,e.palette.action.disabledOpacity),l=(e.vars||e).palette.action.hoverOpacity,c=(e.vars||e).palette.action.hover,u=(e.vars||e).palette.action.selectedOpacity,d=e.vars?`calc(${l} + ${u})`:l+u,f=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${u})`:Pt(e.palette.primary.main,u),h=e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${d})`:Pt(e.palette.primary.main,d),g=e.vars?Qft:Kft,y=M=>({[`& .${oe["cell--pinnedLeft"]}, & .${oe["cell--pinnedRight"]}`]:{backgroundColor:M,"&.Mui-selected":{backgroundColor:g(M,f,u),"&:hover":{backgroundColor:g(M,f,d)}}}}),v=g(a,c,l),x=y(v),S=g(a,f,u),C=y(S),I=g(a,h,d),E=y(I),T={backgroundColor:f,"&:hover":{backgroundColor:h,"@media (hover: none)":{backgroundColor:f}}};return F({"--unstable_DataGrid-radius":typeof o=="number"?`${o}px`:o,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":s,"--DataGrid-containerBackground":i,"--DataGrid-pinnedBackground":a,"--DataGrid-rowBorderColor":r,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:r,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",[`.${oe.main} > *:first-child${Wft}`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${oe.autoHeight}`]:{height:"auto"},[`&.${oe.autosizing}`]:{[`& .${oe.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${oe.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${oe.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${oe.groupingCriteriaCell}`]:{width:"unset"},[`& .${oe.treeDataGroupingCell}`]:{width:"unset"}},[`& .${oe.columnHeader}, & .${oe.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${oe.columnHeader}:focus-within, & .${oe.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:Pt(e.palette.primary.main,.5)} ${hm}px`,outlineOffset:hm*-1},[`& .${oe.columnHeader}:focus, & .${oe.cell}:focus`]:{outline:`solid ${e.palette.primary.main} ${hm}px`,outlineOffset:hm*-1},[`& .${oe.columnHeader}:focus,& .${oe["columnHeader--withLeftBorder"]},& .${oe["columnHeader--withRightBorder"]},@@ -436,7 +436,7 @@ return result$$;`.replaceAll("$$",String(tQ)));return tQ+=1,(s,l)=>i(o,s,l)},Pce`));Ps(e.current.state)!==Y&&(n.debug("Setting selection model"),e.current.setState(ie=>F({},ie,{rowSelection:t.rowSelection?Y:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,u]),y=w.useCallback(Y=>Ps(e.current.state).includes(Y),[e]),v=w.useCallback(Y=>{if(t.rowSelection===!1||c&&!c(e.current.getRowParams(Y)))return!1;const J=Mo(e)[Y];return!((J==null?void 0:J.type)==="footer"||(J==null?void 0:J.type)==="pinnedRow")},[e,t.rowSelection,c]),x=w.useCallback(()=>rut(e),[e]),S=w.useCallback((Y,J=!0,ie=!1)=>{var ee,te,ce,ae,ne,ue;if(e.current.isRowSelectable(Y))if(a.current=Y,ie){n.debug(`Setting selection for row ${Y}`);const he=[],re=le=>{he.push(le)};J&&(re(Y),o&&l1(e,d,Y,((ee=t.rowSelectionPropagation)==null?void 0:ee.descendants)??!1,((te=t.rowSelectionPropagation)==null?void 0:te.parents)??!1,re)),e.current.setRowSelectionModel(he)}else{n.debug(`Toggling selection for row ${Y}`);const he=Ps(e.current.state),re=new Set(he);re.delete(Y);const le=Ee=>{re.add(Ee)},me=Ee=>{re.delete(Ee)};J?(le(Y),o&&l1(e,d,Y,((ce=t.rowSelectionPropagation)==null?void 0:ce.descendants)??!1,((ae=t.rowSelectionPropagation)==null?void 0:ae.parents)??!1,le)):o&&lQ(e,d,Y,((ne=t.rowSelectionPropagation)==null?void 0:ne.descendants)??!1,((ue=t.rowSelectionPropagation)==null?void 0:ue.parents)??!1,me),(re.size<2||u)&&e.current.setRowSelectionModel(Array.from(re))}},[e,n,o,d,(U=t.rowSelectionPropagation)==null?void 0:U.descendants,(G=t.rowSelectionPropagation)==null?void 0:G.parents,u]),C=w.useCallback((Y,J=!0,ie=!1)=>{n.debug("Setting selection for several rows");const ee=Y.filter(ae=>e.current.isRowSelectable(ae));let te;if(ie){if(J){if(te=new Set(ee),o){const ne=ue=>{te.add(ue)};ee.forEach(ue=>{var he,re;l1(e,d,ue,((he=t.rowSelectionPropagation)==null?void 0:he.descendants)??!1,((re=t.rowSelectionPropagation)==null?void 0:re.parents)??!1,ne)})}}else te=new Set;const ae=vu(e);if(te.size===Object.keys(ae).length&&Array.from(te).every(ne=>ae[ne]===ne))return}else{te=new Set(Object.values(vu(e)));const ae=ue=>{te.add(ue)},ne=ue=>{te.delete(ue)};ee.forEach(ue=>{var he,re,le,me;J?(te.add(ue),o&&l1(e,d,ue,((he=t.rowSelectionPropagation)==null?void 0:he.descendants)??!1,((re=t.rowSelectionPropagation)==null?void 0:re.parents)??!1,ae)):(ne(ue),o&&lQ(e,d,ue,((le=t.rowSelectionPropagation)==null?void 0:le.descendants)??!1,((me=t.rowSelectionPropagation)==null?void 0:me.parents)??!1,ne))})}(te.size<2||u)&&e.current.setRowSelectionModel(Array.from(te))},[n,o,u,e,d,(H=t.rowSelectionPropagation)==null?void 0:H.descendants,(K=t.rowSelectionPropagation)==null?void 0:K.parents]),I=w.useCallback(({startId:Y,endId:J},ie=!0,ee=!1)=>{if(!e.current.getRow(Y)||!e.current.getRow(J))return;n.debug(`Expanding selection from row ${Y} to row ${J}`);const te=Zm(e),ce=te.indexOf(Y),ae=te.indexOf(J),[ne,ue]=ce>ae?[ae,ce]:[ce,ae],he=te.slice(ne,ue+1);e.current.selectRows(he,ie,ee)},[e,n]),E={selectRow:S,setRowSelectionModel:g,getSelectedRows:x,isRowSelected:y,isRowSelectable:v},T={selectRows:C,selectRowRange:I};dn(e,E,"public"),dn(e,T,t.signature===zs.DataGrid?"private":"public");const O=w.useCallback((Y=!1)=>{var ue;const J=Ps(e.current.state),ie=Ds(e),ee=iv(e),te=F({},vu(e)),ce=he=>t.filterMode==="server"?!ie[he]:!ie[he]||ee[he]===!1;let ae=!1;J.forEach(he=>{var le;if(ce(he)){if(t.keepNonExistentRowsSelected)return;delete te[he],ae=!0;return}if(!((le=t.rowSelectionPropagation)!=null&&le.parents))return;const re=d[he];if(re.type==="group"){if(re.isAutoGenerated){delete te[he],ae=!0;return}re.children.every(Se=>ee[Se]===!1)||(delete te[he],ae=!0)}});const ne=f&&((ue=t.rowSelectionPropagation)==null?void 0:ue.parents)&&Object.keys(te).length>0;if(ae||ne&&!Y){const he=Object.values(te);ne?e.current.selectRows(he,!0,!0):e.current.setRowSelectionModel(he)}},[e,f,(q=t.rowSelectionPropagation)==null?void 0:q.parents,t.keepNonExistentRowsSelected,t.filterMode,d]),A=w.useCallback((Y,J)=>{const ie=J.metaKey||J.ctrlKey,ee=!s&&!ie&&!bht(J),te=!u||ee,ce=e.current.isRowSelected(Y);te?e.current.selectRow(Y,ee?!0:!ce,!0):e.current.selectRow(Y,!ce,!1)},[e,u,s]),k=w.useCallback((Y,J)=>{var te;if(l)return;const ie=(te=J.target.closest(`.${oe.cell}`))==null?void 0:te.getAttribute("data-field");if(ie===av.field||ie===ZT)return;if(ie){const ce=e.current.getColumn(ie);if((ce==null?void 0:ce.type)===XT)return}Mo(e)[Y.id].type!=="pinnedRow"&&(J.shiftKey&&u?h(Y.id):A(Y.id,J))},[l,u,e,h,A]),M=w.useCallback((Y,J)=>{var ie;u&&J.shiftKey&&((ie=window.getSelection())==null||ie.removeAllRanges())},[u]),R=w.useCallback((Y,J)=>{u&&J.nativeEvent.shiftKey?h(Y.id):e.current.selectRow(Y.id,Y.value,!u)},[e,h,u]),$=w.useCallback(Y=>{const J=t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?Gce(e):Zm(e);e.current.selectRows(J,Y.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),L=w.useCallback((Y,J)=>{if(e.current.getCellMode(Y.id,Y.field)!==Jn.Edit&&!lS(J)){if(BP(J.key)&&J.shiftKey){const ie=ca(e);if(ie&&ie.id!==Y.id){J.preventDefault();const ee=e.current.isRowSelected(ie.id);if(!u){e.current.selectRow(ie.id,!ee,!0);return}const te=e.current.getRowIndexRelativeToVisibleRows(ie.id),ce=e.current.getRowIndexRelativeToVisibleRows(Y.id);let ae,ne;te>ce?ee?(ae=ce,ne=te-1):(ae=ce,ne=te):ee?(ae=te+1,ne=ce):(ae=te,ne=ce);const he=qd(e).rows.slice(ae,ne+1).map(re=>re.id);e.current.selectRows(he,!ee);return}}if(J.key===" "&&J.shiftKey){J.preventDefault(),A(Y.id,J);return}String.fromCharCode(J.keyCode)==="A"&&(J.ctrlKey||J.metaKey)&&(J.preventDefault(),C(e.current.getAllRowIds(),!0))}},[e,A,C,u]);wt(e,"sortedRowsSet",r(()=>O(!0))),wt(e,"filteredRowsSet",r(O)),wt(e,"rowClick",r(k)),wt(e,"rowSelectionCheckboxChange",r(R)),wt(e,"headerSelectionCheckboxChange",$),wt(e,"cellMouseDown",r(M)),wt(e,"cellKeyDown",r(L)),w.useEffect(()=>{i!==void 0&&e.current.setRowSelectionModel(i)},[e,i,t.rowSelection]),w.useEffect(()=>{t.rowSelection||e.current.setRowSelectionModel([])},[e,t.rowSelection]);const z=i!=null;w.useEffect(()=>{if(z||!t.rowSelection)return;const Y=Ps(e.current.state);if(v){const J=Y.filter(ie=>v(ie));J.length<Y.length&&e.current.setRowSelectionModel(J)}},[e,v,z,t.rowSelection]),w.useEffect(()=>{if(!t.rowSelection||z)return;const Y=Ps(e.current.state);!u&&Y.length>1&&e.current.setRowSelectionModel([])},[e,u,s,z,t.rowSelection]),w.useEffect(()=>{r(O)},[O,r])},hyt=e=>{const{classes:t}=e;return w.useMemo(()=>Oe({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},kn,t),[t])},myt=(e,t)=>{const n={classes:t.classes},r=hyt(n),o=w.useCallback(i=>{const a=F({},av,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),s=t.checkboxSelection,l=i.lookup[tu]!=null;return s&&!l?(i.lookup[tu]=a,i.orderedFields=[tu,...i.orderedFields]):!s&&l?(delete i.lookup[tu],i.orderedFields=i.orderedFields.filter(c=>c!==tu)):s&&l&&(i.lookup[tu]=F({},a,i.lookup[tu])),i},[e,r,t.checkboxSelection]);Rr(e,"hydrateColumns",o)},gyt=(e,t)=>{var r,o;const n=t.sortModel??((o=(r=t.initialState)==null?void 0:r.sorting)==null?void 0:o.sortModel)??[];return F({},e,{sorting:{sortModel:mce(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},yyt=(e,t)=>{var E,T;const n=Lo(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:hl,changeEvent:"sortModelChange"});const r=w.useCallback((O,A)=>{const k=hl(e),M=k.findIndex($=>$.field===O);let R=[...k];return M>-1?(A==null?void 0:A.sort)==null?R.splice(M,1):R.splice(M,1,A):R=[...k,A],R},[e]),o=w.useCallback((O,A)=>{const M=hl(e).find(R=>R.field===O.field);if(M){const R=A===void 0?JY(O.sortingOrder??t.sortingOrder,M.sort):A;return R===void 0?void 0:F({},M,{sort:R})}return{field:O.field,sort:A===void 0?JY(O.sortingOrder??t.sortingOrder):A}},[e,t.sortingOrder]),i=w.useCallback((O,A)=>A==null||A.sortable===!1||t.disableColumnSorting?O:(A.sortingOrder||t.sortingOrder).some(M=>!!M)?[...O,"columnMenuSortItem"]:O,[t.sortingOrder,t.disableColumnSorting]),a=w.useCallback(()=>{e.current.setState(O=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),F({},O,{sorting:F({},O.sorting,{sortedRows:Nz(Mo(e),ii,!1)})});const A=hl(O,e.current.instanceId),k=ect(A,e),M=e.current.applyStrategyProcessor("sorting",{sortRowList:k});return F({},O,{sorting:F({},O.sorting,{sortedRows:M})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),s=w.useCallback(O=>{hl(e)!==O&&(n.debug("Setting sort model"),e.current.setState(XY(O,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),l=w.useCallback((O,A,k)=>{const M=e.current.getColumn(O),R=o(M,A);let $;!k||t.disableMultipleColumnsSorting?$=(R==null?void 0:R.sort)==null?[]:[R]:$=r(M.field,R),e.current.setSortModel($)},[e,r,o,t.disableMultipleColumnsSorting]),c=w.useCallback(()=>hl(e),[e]),u=w.useCallback(()=>Lz(e).map(A=>A.model),[e]),d=w.useCallback(()=>ov(e),[e]),f=w.useCallback(O=>e.current.getSortedRowIds()[O],[e]);dn(e,{getSortModel:c,getSortedRows:u,getSortedRowIds:d,getRowIdFromRowIndex:f,setSortModel:s,sortColumn:l,applySorting:a},"public");const g=w.useCallback((O,A)=>{var R,$;const k=hl(e);return!A.exportOnlyDirtyModels||t.sortModel!=null||(($=(R=t.initialState)==null?void 0:R.sorting)==null?void 0:$.sortModel)!=null||k.length>0?F({},O,{sorting:{sortModel:k}}):O},[e,t.sortModel,(T=(E=t.initialState)==null?void 0:E.sorting)==null?void 0:T.sortModel]),y=w.useCallback((O,A)=>{var M;const k=(M=A.stateToRestore.sorting)==null?void 0:M.sortModel;return k==null?O:(e.current.setState(XY(k,t.disableMultipleColumnsSorting)),F({},O,{callbacks:[...O.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),v=w.useCallback(O=>{const A=Mo(e),k=A[ii],M=O.sortRowList?O.sortRowList(k.children.map(R=>A[R])):[...k.children];return k.footerId!=null&&M.push(k.footerId),M},[e]);Rr(e,"exportState",g),Rr(e,"restoreState",y),HP(e,Jp,"sorting",v);const x=w.useCallback(({field:O,colDef:A},k)=>{if(!A.sortable||t.disableColumnSorting)return;const M=k.shiftKey||k.metaKey||k.ctrlKey;l(O,void 0,M)},[l,t.disableColumnSorting]),S=w.useCallback(({field:O,colDef:A},k)=>{!A.sortable||t.disableColumnSorting||k.key==="Enter"&&!k.ctrlKey&&!k.metaKey&&l(O,void 0,k.shiftKey)},[l,t.disableColumnSorting]),C=w.useCallback(()=>{const O=hl(e),A=Hu(e);if(O.length>0){const k=O.filter(M=>A[M.field]);k.length<O.length&&e.current.setSortModel(k)}},[e]),I=w.useCallback(O=>{O==="sorting"&&e.current.applySorting()},[e]);Rr(e,"columnMenu",i),wt(e,"columnHeaderClick",x),wt(e,"columnHeaderKeyDown",S),wt(e,"rowsSet",e.current.applySorting),wt(e,"columnsChange",C),wt(e,"activeStrategyProcessorChange",I),tS(()=>{e.current.applySorting()}),On(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function GQ(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,i=o+r;if(r>t)return o;if(i-t>n)return i-t;if(o<n)return o}const vyt=(e,t)=>{const n=Yn(),r=Lo(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,i=e.current.virtualScrollerRef,a=Ke(e,Tf),s=w.useCallback(d=>{var x;const f=qo(e.current.state),h=eS(e),g=t.unstable_listView?[iy(e.current.state)]:Wr(e);if(!(d.rowIndex==null)&&h===0||g.length===0)return!1;r.debug(`Scrolling to cell at row ${d.rowIndex}, col: ${d.colIndex} `);let v={};if(d.colIndex!==void 0){const S=If(e);let C;if(typeof d.rowIndex<"u"){const I=(x=a[d.rowIndex])==null?void 0:x.id,E=e.current.unstable_getCellColSpanInfo(I,d.colIndex);E&&!E.spannedByColSpan&&(C=E.cellProps.width)}typeof C>"u"&&(C=g[d.colIndex].computedWidth),v.left=GQ({containerSize:f.viewportOuterSize.width,scrollPosition:Math.abs(i.current.scrollLeft),elementSize:C,elementOffset:S[d.colIndex]})}if(d.rowIndex!==void 0){const S=aS(e.current.state),C=but(e),I=Uce(e),E=t.pagination?d.rowIndex-C*I:d.rowIndex,T=S.positions[E+1]?S.positions[E+1]-S.positions[E]:S.currentPageTotalHeight-S.positions[E];v.top=GQ({containerSize:f.viewportInnerSize.height,scrollPosition:i.current.scrollTop,elementSize:T,elementOffset:S.positions[E]})}return v=e.current.unstable_applyPipeProcessors("scrollToIndexes",v,d),typeof v.left!==void 0||typeof v.top!==void 0?(e.current.scroll(v),!0):!1},[r,e,i,t.pagination,a,t.unstable_listView]),l=w.useCallback(d=>{if(i.current&&d.left!==void 0&&o.current){const f=n?-1:1;o.current.scrollLeft=d.left,i.current.scrollLeft=f*d.left,r.debug(`Scrolling left: ${d.left}`)}i.current&&d.top!==void 0&&(i.current.scrollTop=d.top,r.debug(`Scrolling top: ${d.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n,o,r]),c=w.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);dn(e,{scroll:l,scrollToIndexes:s,getScrollPosition:c},"public")};function byt(e,t){er(e,"columnHeaderClick",t.onColumnHeaderClick),er(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),er(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),er(e,"columnHeaderOver",t.onColumnHeaderOver),er(e,"columnHeaderOut",t.onColumnHeaderOut),er(e,"columnHeaderEnter",t.onColumnHeaderEnter),er(e,"columnHeaderLeave",t.onColumnHeaderLeave),er(e,"cellClick",t.onCellClick),er(e,"cellDoubleClick",t.onCellDoubleClick),er(e,"cellKeyDown",t.onCellKeyDown),er(e,"preferencePanelClose",t.onPreferencePanelClose),er(e,"preferencePanelOpen",t.onPreferencePanelOpen),er(e,"menuOpen",t.onMenuOpen),er(e,"menuClose",t.onMenuClose),er(e,"rowDoubleClick",t.onRowDoubleClick),er(e,"rowClick",t.onRowClick),er(e,"stateChange",t.onStateChange)}function wyt(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function i(...a){r=a,n===void 0&&(n=setTimeout(o,t))}return i.clear=()=>{clearTimeout(n),n=void 0},i}const qL={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",columnBufferPx:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:Tc.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,indeterminateCheckboxAction:"deselect",keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resetPageOnSortFilter:!1,resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rowPositionsDebounceMs:166,rows:[],rowSelection:!0,rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,unstable_rowSpanning:!1,virtualizeColumnsWithAutoRowHeight:!1},xm={width:0,height:0},xyt={isReady:!1,root:xm,viewportOuterSize:xm,viewportInnerSize:xm,contentSize:xm,minimumSize:xm,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},Syt=(e,t,n)=>{const r=xyt,o=ev(n);return F({},e,{dimensions:F({},r,Tue(t,n,o,rv(n)))})},Iue=Gt(Wr,If,(e,t)=>{const n=e.length;return n===0?0:$m(t[n-1]+e[n-1].computedWidth,1)});function Cyt(e,t){const n=Lo(e,"useResizeContainer"),r=w.useRef(!1),o=w.useRef(xm),i=Ke(e,rv),a=Ke(e,ev),s=Ke(e,Iue),l=w.useRef(!0),{rowHeight:c,headerHeight:u,groupHeaderHeight:d,headerFilterHeight:f,headersTotalHeight:h,leftPinnedWidth:g,rightPinnedWidth:y}=Tue(t,e,a,i),v=w.useRef(void 0),x=w.useCallback(()=>qo(e.current.state),[e]),S=w.useCallback($=>{e.current.setState(L=>F({},L,{dimensions:$})),e.current.rootElementRef.current&&qQ(e.current.rootElementRef.current,qo(e.current.state))},[e]),C=w.useCallback(()=>{const $=e.current.mainElementRef.current;if(!$)return;const L=va($).getComputedStyle($),z={width:parseFloat(L.width)||0,height:parseFloat(L.height)||0};(!v.current||!YQ(v.current,z))&&(e.current.publishEvent("resize",z),v.current=z)},[e]),I=w.useCallback(()=>{const $=qo(e.current.state);if(!$.isReady)return 0;const L=qd(e);if(t.getRowHeight){const N=sS(e),B=N.lastRowIndex-N.firstRowIndex;return Math.min(B-1,L.rows.length)}const z=Math.floor($.viewportInnerSize.height/c);return Math.min(z,L.rows.length)},[e,t.getRowHeight,c]),E=w.useCallback(()=>{var te,ce;if(l.current)return;const $=Eyt(e.current.mainElementRef.current,t.scrollbarSize),L=aS(e.current.state),z=h+L.pinnedTopRowsTotalHeight,N=L.pinnedBottomRowsTotalHeight,U={width:s-g-y,height:$m(L.currentPageTotalHeight,1)};let G,H,K=!1,q=!1;if(t.autoHeight)q=!1,K=Math.round(s)>Math.round(o.current.width),G={width:o.current.width,height:z+N+U.height},H={width:Math.max(0,G.width-(q?$:0)),height:Math.max(0,G.height-(K?$:0))};else{G={width:o.current.width,height:o.current.height},H={width:Math.max(0,G.width-g-y),height:Math.max(0,G.height-z-N)};const ae=U,ne=H,ue=ae.width>ne.width,he=ae.height>ne.height;(ue||he)&&(q=he,K=ae.width+(q?$:0)>ne.width,K&&(q=ae.height+$>ne.height)),q&&(H.width-=$),K&&(H.height-=$)}const Y=Math.max(G.width,s+(q?$:0)),J={width:s,height:z+U.height+N},ie={isReady:!0,root:o.current,viewportOuterSize:G,viewportInnerSize:H,contentSize:U,minimumSize:J,hasScrollX:K,hasScrollY:q,scrollbarSize:$,headerHeight:u,groupHeaderHeight:d,headerFilterHeight:f,rowWidth:Y,rowHeight:c,columnsTotalWidth:s,leftPinnedWidth:g,rightPinnedWidth:y,headersTotalHeight:h,topContainerHeight:z,bottomContainerHeight:N},ee=e.current.state.dimensions;Gd(ee,ie)||(S(ie),YQ(ie.viewportInnerSize,ee.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",ie.viewportInnerSize),(ce=(te=e.current).updateRenderContext)==null||ce.call(te))},[e,S,t.scrollbarSize,t.autoHeight,c,u,d,f,s,h,g,y]),T=Qe(E),O=w.useMemo(()=>t.resizeThrottleMs>0?wyt(()=>{T(),e.current.publishEvent("debouncedResize",o.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,T]);w.useEffect(()=>O==null?void 0:O.clear,[O]);const A={resize:C,getRootDimensions:x},k={updateDimensions:E,getViewportPageSize:I};On(E,[E]),dn(e,A,"public"),dn(e,k,"private");const M=w.useCallback($=>{qQ($,qo(e.current.state))},[e]),R=w.useCallback($=>{if(o.current=$,$.height===0&&!r.current&&!t.autoHeight&&!FP&&(n.error(["The parent DOM element of the Data Grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(``)),r.current=!0),$.width===0&&!r.current&&!FP&&(n.error(["The parent DOM element of the Data Grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(``)),r.current=!0),l.current||!O){l.current=!1,E();return}O()},[E,t.autoHeight,O,n]);er(e,"rootMount",M),er(e,"resize",R),er(e,"debouncedResize",t.onResize)}function qQ(e,t){const n=(r,o)=>e.style.setProperty(r,o);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function Tue(e,t,n,r){const o=kce(e.rowHeight,qL.rowHeight);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:Iue(t),headersTotalHeight:Uz(t,e),leftPinnedWidth:r.left.reduce((i,a)=>i+a.computedWidth,0),rightPinnedWidth:r.right.reduce((i,a)=>i+a.computedWidth,0)}}const KQ=new WeakMap;function Eyt(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=KQ.get(e);if(n!==void 0)return n;const o=vr(e).createElement("div");o.style.width="99px",o.style.height="99px",o.style.position="absolute",o.style.overflow="scroll",o.className="scrollDiv",e.appendChild(o);const i=o.offsetWidth-o.clientWidth;return e.removeChild(o),KQ.set(e,i),i}function YQ(e,t){return e.width===t.width&&e.height===t.height}const Pyt=typeof globalThis.ResizeObserver<"u"?globalThis.ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},Iyt=(e,t,n)=>{n.current.caches.rowsMeta={heights:new Map};const r=Az(n.current.state),o=eS(n),i=nS(n.current.state),a=Math.min(i.enabled?i.paginationModel.pageSize:o,o);return F({},e,{rowsMeta:{currentPageTotalHeight:a*r,positions:Array.from({length:a},(s,l)=>l*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},Tyt=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:o}=t,i=e.current.caches.rowsMeta.heights,a=w.useRef(-1),s=w.useRef(!1),l=w.useRef(!1),c=Ke(e,ev),u=Wz(e),d=Ke(e,tv),f=Ke(e,Az),h=M=>{let R=i.get(M);return R===void 0&&(R={content:f,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},i.set(M,R)),R},g=w.useCallback(M=>{const R=qo(e.current.state).rowHeight,$=e.current.getRowHeightEntry(M.id);if(!n)$.content=R,$.needsFirstMeasurement=!1;else{const L=n(F({},M,{densityFactor:c}));if(L==="auto"){if($.needsFirstMeasurement){const z=o?o(F({},M,{densityFactor:c})):R;$.content=z??R}s.current=!0,$.autoHeight=!0}else $.content=kce(L,R),$.needsFirstMeasurement=!1,$.autoHeight=!1}if(r){const L=e.current.getRowIndexRelativeToVisibleRows(M.id),z=r(F({},M,{isFirstVisible:L===0,isLastVisible:L===u.rows.length-1,indexRelativeToCurrentPage:L}));$.spacingTop=z.top??0,$.spacingBottom=z.bottom??0}else $.spacingTop=0,$.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",$,M),$},[e,u.rows,n,o,f,r,c]),y=w.useCallback(()=>{s.current=!1;const M=d.top.reduce((B,U)=>{const G=g(U);return B+G.content+G.spacingTop+G.spacingBottom+G.detail},0),R=d.bottom.reduce((B,U)=>{const G=g(U);return B+G.content+G.spacingTop+G.spacingBottom+G.detail},0),$=[],L=u.rows.reduce((B,U)=>{$.push(B);const G=g(U),H=G.content+G.spacingTop+G.spacingBottom+G.detail;return B+H},0);s.current||(a.current=1/0);const z=M!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||R!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||L!==e.current.state.rowsMeta.currentPageTotalHeight,N={currentPageTotalHeight:L,positions:$,pinnedTopRowsTotalHeight:M,pinnedBottomRowsTotalHeight:R};e.current.setState(B=>F({},B,{rowsMeta:N})),z&&e.current.updateDimensions(),l.current=!0},[e,d,u.rows,g]),v=M=>{var R;return((R=i.get(M))==null?void 0:R.content)??f},x=(M,R)=>{const $=e.current.getRowHeightEntry(M),L=$.content!==R;$.needsFirstMeasurement=!1,$.content=R,l.current&&(l.current=!L)},S=M=>{var R;return((R=i.get(M))==null?void 0:R.autoHeight)??!1},C=()=>a.current,I=M=>{s.current&&M>a.current&&(a.current=M)},E=()=>{i.clear(),y()},T=Ks(()=>new Pyt(M=>{var R;for(let $=0;$<M.length;$+=1){const L=M[$],z=L.borderBoxSize&&L.borderBoxSize.length>0?L.borderBoxSize[0].blockSize:L.contentRect.height,N=L.target.__mui_id;if(((R=nue(e))==null?void 0:R.id)===N&&z===0)return;e.current.unstable_storeRowHeightMeasurement(N,z)}l.current||e.current.requestPipeProcessorsApplication("rowHeight")})).current,O=(M,R)=>(M.__mui_id=R,T.observe(M),()=>T.unobserve(M));Xz(e,"rowHeight",y),On(()=>{y()},[y]);const A={unstable_getRowHeight:v,unstable_setLastMeasuredRowIndex:I,unstable_storeRowHeightMeasurement:x,resetRowHeights:E},k={hydrateRowsMeta:y,observeRowHeight:O,rowHasAutoHeight:S,getRowHeightEntry:h,getLastMeasuredRowIndex:C};dn(e,A,"public"),dn(e,k,"private")},Oyt=e=>{const t=w.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=w.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(a=>{a()}),e.current.forceUpdate()},[e]);dn(e,{exportState:t,restoreState:n},"public")},kyt=e=>{const t=w.useRef({}),n=(s,l)=>{var c;return(c=t.current[s])==null?void 0:c[l]},r=()=>{t.current={}},o=w.useCallback(({rowId:s,minFirstColumn:l,maxLastColumn:c,columns:u})=>{for(let d=l;d<c;d+=1){const f=Myt({apiRef:e,lookup:t.current,columnIndex:d,rowId:s,minFirstColumnIndex:l,maxLastColumnIndex:c,columns:u});f.colSpan>1&&(d+=f.colSpan-1)}},[e]),i={unstable_getCellColSpanInfo:n},a={resetColSpan:r,calculateColSpan:o};dn(e,i,"public"),dn(e,a,"private"),wt(e,"columnOrderChange",r)};function Myt(e){const{apiRef:t,lookup:n,columnIndex:r,rowId:o,minFirstColumnIndex:i,maxLastColumnIndex:a,columns:s}=e,l=s.length,c=s[r],u=t.current.getRow(o),d=t.current.getRowValue(u,c),f=typeof c.colSpan=="function"?c.colSpan(d,u,c,t):c.colSpan;if(!f||f===1)return y$(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:c.computedWidth}}),{colSpan:1};let h=c.computedWidth;for(let g=1;g<f;g+=1){const y=r+g;if(y>=i&&y<a){const v=s[y];h+=v.computedWidth,y$(n,o,r+g,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(r+f,l-1),leftVisibleCellIndex:r})}y$(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:f,width:h}})}return{colSpan:f}}function y$(e,t,n,r){e[t]||(e[t]={}),e[t][n]=r}const Oue=(e,t,n)=>{if(wce(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(`-`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{Oue(i,[...t,r],n)})},KL=e=>{if(!e)return{};const t={};return e.forEach(n=>{Oue(n,[],t)}),t},YL=(e,t,n)=>{const r=l=>t[l]??[],o=[],i=Math.max(...e.map(l=>r(l).length)),a=(l,c,u)=>Gd(r(l).slice(0,u+1),r(c).slice(0,u+1)),s=(l,c)=>!!(n!=null&&n.left&&n.left.includes(l)&&!n.left.includes(c)||n!=null&&n.right&&!n.right.includes(l)&&n.right.includes(c));for(let l=0;l<i;l+=1){const c=e.reduce((u,d)=>{const f=r(d)[l]??null;if(u.length===0)return[{columnFields:[d],groupId:f}];const h=u[u.length-1],g=h.columnFields[h.columnFields.length-1];return h.groupId!==f||!a(g,d,l)||s(g,d)?[...u,{columnFields:[d],groupId:f}]:[...u.slice(0,u.length-1),{columnFields:[...h.columnFields,d],groupId:f}]},[]);o.push(c)}return o},Ayt=["groupId","children"],Jz=e=>{let t={};return e.forEach(n=>{if(wce(n))return;const{groupId:r,children:o}=n,i=We(n,Ayt);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const a=F({},i,{groupId:r}),s=Jz(o);if(s[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=F({},t,s,{[r]:a})}),F({},t)},Ryt=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=yu(n),o=nv(n),i=Jz(t.columnGroupingModel??[]),a=KL(t.columnGroupingModel??[]),s=YL(r,a,n.current.state.pinnedColumns??{}),l=o.length===0?0:Math.max(...o.map(c=>{var u;return((u=a[c])==null?void 0:u.length)??0}));return F({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:s,maxDepth:l}})},Dyt=(e,t)=>{const n=w.useCallback(s=>Qce(e)[s]??[],[e]),r=w.useCallback(()=>Xce(e),[e]);dn(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const i=w.useCallback(()=>{const s=KL(t.columnGroupingModel??[]);e.current.setState(l=>{var f;const c=((f=l.columns)==null?void 0:f.orderedFields)??[],u=l.pinnedColumns??{},d=YL(c,s,u);return F({},l,{columnGrouping:F({},l.columnGrouping,{headerStructure:d})})})},[e,t.columnGroupingModel]),a=w.useCallback(s=>{var y,v;const l=((v=(y=e.current).getPinnedColumns)==null?void 0:v.call(y))??{},c=yu(e),u=nv(e),d=Jz(s??[]),f=KL(s??[]),h=YL(c,f,l),g=u.length===0?0:Math.max(...u.map(x=>{var S;return((S=f[x])==null?void 0:S.length)??0}));e.current.setState(x=>F({},x,{columnGrouping:{lookup:d,unwrappedGroupingModel:f,headerStructure:h,maxDepth:g}}))},[e]);wt(e,"columnIndexChange",i),wt(e,"columnsChange",()=>{a(t.columnGroupingModel)}),wt(e,"columnVisibilityModelChange",()=>{a(t.columnGroupingModel)}),w.useEffect(()=>{a(t.columnGroupingModel)},[a,t.columnGroupingModel])};function _yt(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function QQ(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function XQ(e,t,n,r){let o=e;return r==="Right"?o+=t-n.left:o+=n.right-t,o}function $yt(e,t,n){return n==="Left"?e-t.left:t.right-e}function Nyt(e){return e==="Right"?"Left":"Right"}function Lyt(e,t){const n=e.classList.contains(oe["columnSeparator--sideRight"])?"Right":"Left";return t?Nyt(n):n}function JQ(e){e.preventDefault(),e.stopImmediatePropagation()}function Fyt(e){const t=w.useRef(void 0),n=()=>eue(e),r=Ke(e,n);return w.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=_yt()}return t.current}}function jyt(e,t){if(e.length<4)return e;const n=e.slice();n.sort((s,l)=>s-l);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],i=o-r,a=i<5?5:i*t;return n.filter(s=>s>r-a&&s<o+a)}function Byt(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(oe.autosizing),n.forEach(i=>{const s=Apt(e.current,i.field).map(g=>g.getBoundingClientRect().width??0),l=t.includeOutliers?s:jyt(s,t.outliersFactor);if(t.includeHeaders){const g=Mpt(e.current,i.field);if(g){const y=g.querySelector(`.${oe.columnHeaderTitle}`),v=g.querySelector(`.${oe.columnHeaderTitleContainerContent}`),x=g.querySelector(`.${oe.iconButtonContainer}`),S=g.querySelector(`.${oe.menuIcon}`),C=y??v,I=window.getComputedStyle(g,null),E=parseInt(I.paddingLeft,10)+parseInt(I.paddingRight,10),O=C.scrollWidth+1+E+((x==null?void 0:x.clientWidth)??0)+((S==null?void 0:S.clientWidth)??0);l.push(O)}}const c=i.minWidth!==-1/0&&i.minWidth!==void 0,u=i.maxWidth!==1/0&&i.maxWidth!==void 0,d=c?i.minWidth:0,f=u?i.maxWidth:1/0,h=l.length===0?0:Math.max(...l);r[i.field]=Ua(h,d,f)}),o.classList.remove(oe.autosizing),r}const zyt=e=>F({},e,{columnResize:{resizingColumnField:""}});function Vyt(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const Hyt=(e,t)=>{const n=Yn(),r=Lo(e,"useGridColumnResize"),o=Ks(Vyt).current,i=w.useRef(null),a=w.useRef(null),s=fa(),l=w.useRef(void 0),c=k=>{var N,B;r.debug(`Updating width to ${k} for col ${o.colDef.field}`);const M=o.columnHeaderElement.offsetWidth,R=k-M,$=k-o.initialColWidth;if($>0){const U=o.initialTotalWidth+$;(B=(N=e.current.rootElementRef)==null?void 0:N.current)==null||B.style.setProperty("--DataGrid-rowWidth",`${U}px`)}o.colDef.computedWidth=k,o.colDef.width=k,o.colDef.flex=0,o.columnHeaderElement.style.width=`${k}px`;const L=o.headerFilterElement;L&&(L.style.width=`${k}px`),o.groupHeaderElements.forEach(U=>{const G=U;let H;G.getAttribute("aria-colspan")==="1"?H=`${k}px`:H=`${G.offsetWidth+R}px`,G.style.width=H}),o.cellElements.forEach(U=>{const G=U;let H;G.getAttribute("aria-colspan")==="1"?H=`${k}px`:H=`${G.offsetWidth+R}px`,G.style.setProperty("--width",H)});const z=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);z===Cd.LEFT&&(mm(o.fillerLeft,"width",R),o.leftPinnedCellsAfter.forEach(U=>{mm(U,"left",R)}),o.leftPinnedHeadersAfter.forEach(U=>{mm(U,"left",R)})),z===Cd.RIGHT&&(mm(o.fillerRight,"width",R),o.rightPinnedCellsBefore.forEach(U=>{mm(U,"right",R)}),o.rightPinnedHeadersBefore.forEach(U=>{mm(U,"right",R)}))},u=k=>{if(x(),o.previousMouseClickEvent){const M=o.previousMouseClickEvent,R=M.timeStamp,$=M.clientX,L=M.clientY;if(k.timeStamp-R<300&&k.clientX===$&&k.clientY===L){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,k);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const M=xc(e.current.state);o.groupHeaderElements.forEach(R=>{const $=Cpt(R),L=R,N=`${$.reduce((B,U)=>M.columnVisibilityModel[U]!==!1?B+M.lookup[U].computedWidth:B,0)}px`;L.style.width=N})}s.start(0,()=>{e.current.publishEvent("columnResizeStop",null,k)})},d=(k,M,R)=>{var N;const $=e.current.rootElementRef.current;o.initialColWidth=k.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=k,o.columnHeaderElement=Spt(e.current.columnHeadersContainerRef.current,k.field);const L=$.querySelector(`.${oe.headerFilterRow} [data-field="${Uu(k.field)}"]`);L&&(o.headerFilterElement=L),o.groupHeaderElements=Ept((N=e.current.columnHeadersContainerRef)==null?void 0:N.current,k.field),o.cellElements=Ppt(o.columnHeaderElement,e.current),o.fillerLeft=IQ(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=IQ(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const z=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=z!==Cd.LEFT?[]:Ipt(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=z!==Cd.RIGHT?[]:Tpt(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=z!==Cd.LEFT?[]:Opt(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=z!==Cd.RIGHT?[]:kpt(e.current,o.columnHeaderElement,n),a.current=Lyt(M,n),i.current=$yt(R,o.columnHeaderElement.getBoundingClientRect(),a.current)},f=Qe(u),h=Qe(k=>{if(k.buttons===0){f(k);return}let M=XQ(i.current,k.clientX,o.columnHeaderElement.getBoundingClientRect(),a.current);M=Ua(M,o.colDef.minWidth,o.colDef.maxWidth),c(M);const R={element:o.columnHeaderElement,colDef:o.colDef,width:M};e.current.publishEvent("columnResize",R,k)}),g=Qe(k=>{QQ(k,l.current)&&u(k)}),y=Qe(k=>{const M=QQ(k,l.current);if(!M)return;if(k.type==="mousemove"&&k.buttons===0){g(k);return}let R=XQ(i.current,M.x,o.columnHeaderElement.getBoundingClientRect(),a.current);R=Ua(R,o.colDef.minWidth,o.colDef.maxWidth),c(R);const $={element:o.columnHeaderElement,colDef:o.colDef,width:R};e.current.publishEvent("columnResize",$,k)}),v=Qe(k=>{const M=jP(k.target,oe["columnSeparator--resizable"]);if(!M)return;const R=k.changedTouches[0];R!=null&&(l.current=R.identifier);const $=jP(k.target,oe.columnHeader),L=xpt($),z=e.current.getColumn(L);r.debug(`Start Resize on col ${z.field}`),e.current.publishEvent("columnResizeStart",{field:L},k),d(z,M,R.clientX);const N=vr(k.currentTarget);N.addEventListener("touchmove",y),N.addEventListener("touchend",g)}),x=w.useCallback(()=>{const k=vr(e.current.rootElementRef.current);k.body.style.removeProperty("cursor"),k.removeEventListener("mousemove",h),k.removeEventListener("mouseup",f),k.removeEventListener("touchmove",y),k.removeEventListener("touchend",g),setTimeout(()=>{k.removeEventListener("click",JQ,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,h,f,y,g]),S=w.useCallback(({field:k})=>{e.current.setState(M=>F({},M,{columnResize:F({},M.columnResize,{resizingColumnField:k})})),e.current.forceUpdate()},[e]),C=w.useCallback(()=>{e.current.setState(k=>F({},k,{columnResize:F({},k.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),I=Qe(({colDef:k},M)=>{if(M.button!==0||!M.currentTarget.classList.contains(oe["columnSeparator--resizable"]))return;M.preventDefault(),r.debug(`Start Resize on col ${k.field}`),e.current.publishEvent("columnResizeStart",{field:k.field},M),d(k,M.currentTarget,M.clientX);const R=vr(e.current.rootElementRef.current);R.body.style.cursor="col-resize",o.previousMouseClickEvent=M.nativeEvent,R.addEventListener("mousemove",h),R.addEventListener("mouseup",f),R.addEventListener("click",JQ,!0)}),E=Qe((k,M)=>{if(t.disableAutosize||M.button!==0)return;const R=e.current.state.columns.lookup[k.field];R.resizable!==!1&&e.current.autosizeColumns(F({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[R.field]}))}),T=Fyt(e),O=w.useRef(!1),A=w.useCallback(async k=>{var z;if(!((z=e.current.rootElementRef)==null?void 0:z.current)||O.current)return;O.current=!0;const R=xc(e.current.state),$=F({},fft,k,{columns:(k==null?void 0:k.columns)??R.orderedFields});$.columns=$.columns.filter(N=>R.columnVisibilityModel[N]!==!1);const L=$.columns.map(N=>e.current.state.columns.lookup[N]);try{!t.disableVirtualization&&$.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await T());const N=Byt(e,$,L),B=L.map(U=>F({},U,{width:N[U.field],computedWidth:N[U.field],flex:0}));if($.expand){const G=R.orderedFields.map(Y=>R.lookup[Y]).filter(Y=>R.columnVisibilityModel[Y.field]!==!1).reduce((Y,J)=>Y+(N[J.field]??J.computedWidth??J.width),0),q=e.current.getRootDimensions().viewportInnerSize.width-G;if(q>0){const Y=q/(B.length||1);B.forEach(J=>{J.width+=Y,J.computedWidth+=Y})}}e.current.updateColumns(B),B.forEach((U,G)=>{if(U.width!==L[G].width){const H=U.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(U.field),colDef:U,width:H})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),O.current=!1}},[e,T,t.disableVirtualization]);w.useEffect(()=>x,[x]),SF(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),jce(e,()=>{var k;return(k=e.current.columnHeadersContainerRef)==null?void 0:k.current},"touchstart",v,{passive:!0}),dn(e,{autosizeColumns:A},"public"),wt(e,"columnResizeStop",C),wt(e,"columnResizeStart",S),wt(e,"columnSeparatorMouseDown",I),wt(e,"columnSeparatorDoubleClick",E),er(e,"columnResize",t.onColumnResize),er(e,"columnWidthChange",t.onColumnWidthChange)};function mm(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function Uyt(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function ZQ(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const v$=(e,t,n)=>{if(!e)return null;let r=e[t.field];const o=t.rowSpanValueGetter??t.valueGetter;return o&&(r=o(r,e,t,n)),r},Nm={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},UP={firstRowIndex:0,lastRowIndex:0},Wyt=new Set([tu,"__reorder__",ZT]),eX=20,kue=(e,t,n,r,o,i,a)=>{const s=i?{}:F({},e.current.state.rowSpanning.spannedCells),l=i?{}:F({},e.current.state.rowSpanning.hiddenCells),c=i?{}:F({},e.current.state.rowSpanning.hiddenCellOriginMap);return i&&(a=UP),t.forEach(u=>{var d;if(!Wyt.has(u.field)){for(let f=o.firstRowIndex;f<o.lastRowIndex;f+=1){const h=n[f];if((d=l[h.id])!=null&&d[u.field])continue;const g=v$(h.model,u,e);if(g==null)continue;let y=h.id,v=f,x=0;const S=[];if(f===o.firstRowIndex){let I=f-1,E=n[I];for(;I>=r.firstRowIndex&&E&&v$(E.model,u,e)===g;){const T=n[I+1];l[T.id]?l[T.id][u.field]=!0:l[T.id]={[u.field]:!0},S.push(f),x+=1,y=E.id,v=I,I-=1,E=n[I]}}S.forEach(I=>{c[I]?c[I][u.field]=v:c[I]={[u.field]:v}});let C=f+1;for(;C<=r.lastRowIndex&&n[C]&&v$(n[C].model,u,e)===g;){const I=n[C];l[I.id]?l[I.id][u.field]=!0:l[I.id]={[u.field]:!0},c[C]?c[C][u.field]=v:c[C]={[u.field]:v},C+=1,x+=1}x>0&&(s[y]?s[y][u.field]=x+1:s[y]={[u.field]:x+1})}a={firstRowIndex:Math.min(a.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(a.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:s,hiddenCells:l,hiddenCellOriginMap:c,processedRange:a}},Mue=(e,t)=>{const n=Xb(t).length;if(e.pagination){const r=Uce(t);let o=eX;return r>0&&(o=r-1),{firstRowIndex:0,lastRowIndex:Math.min(o,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(eX,n)}},Gyt=(e,t,n)=>{var g;if(!t.unstable_rowSpanning)return F({},e,{rowSpanning:Nm});const r=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],i=e.rows.dataRowIdToModelLookup,a=e.columns.lookup,s=!!e.filter.filterModel.items.length||!!((g=e.filter.filterModel.quickFilterValues)!=null&&g.length);if(!r.length||!o.length||!i||!a||s)return F({},e,{rowSpanning:Nm});const l=Mue(t,n),c=r.map(y=>({id:y,model:i[y]})),u=o.map(y=>a[y]),{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h}=kue(n,u,c,l,l,!0,UP);return F({},e,{rowSpanning:{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h}})},qyt=(e,t)=>{const n=Ks(()=>e.current.state.rowSpanning!==Nm?Mue(t,e):UP),r=w.useCallback((i,a=!1)=>{const{range:s,rows:l}=qd(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(s===null||!ZQ(i))return;a&&(n.current=UP);const c=Uyt({firstRowIndex:i.firstRowIndex,lastRowIndex:Math.min(i.lastRowIndex,s.lastRowIndex+1)},n.current);if(c===null)return;const u=Wr(e),{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h,processedRange:g}=kue(e,u,l,s,c,a,n.current);n.current=g;const y=Object.keys(d).length,v=Object.keys(f).length,x=Object.keys(e.current.state.rowSpanning.spannedCells).length,S=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(a||y!==x||v!==S)||y===0&&x===0||e.current.setState(E=>F({},E,{rowSpanning:{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h}}))},[e,n,t.pagination,t.paginationMode]),o=w.useCallback(()=>{const i=sS(e);ZQ(i)&&r(i,!0)},[e,r]);wt(e,"renderedRowsIntervalChange",lp(t.unstable_rowSpanning,r)),wt(e,"sortedRowsSet",lp(t.unstable_rowSpanning,o)),wt(e,"paginationModelChange",lp(t.unstable_rowSpanning,o)),wt(e,"filteredRowsSet",lp(t.unstable_rowSpanning,o)),wt(e,"columnsChange",lp(t.unstable_rowSpanning,o)),w.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===Nm&&o():e.current.state.rowSpanning!==Nm&&e.current.setState(i=>F({},i,{rowSpanning:Nm}))},[e,o,t.unstable_rowSpanning])},Kyt=(e,t,n)=>F({},e,{listViewColumn:t.unstable_listColumn?F({},t.unstable_listColumn,{computedWidth:QL(n)}):void 0});function Yyt(e,t){const n=()=>{e.current.setState(i=>i.listViewColumn?F({},i,{listViewColumn:F({},i.listViewColumn,{computedWidth:QL(e)})}):i)},r=w.useRef(null);wt(e,"viewportInnerSizeChange",i=>{r.current!==i.width&&(r.current=i.width,n())}),wt(e,"columnVisibilityModelChange",n),On(()=>{const i=t.unstable_listColumn;i&&e.current.setState(a=>F({},a,{listViewColumn:F({},i,{computedWidth:QL(e)})}))},[e,t.unstable_listColumn]),w.useEffect(()=>{t.unstable_listView&&t.unstable_listColumn},[t.unstable_listView,t.unstable_listColumn])}function QL(e){return qo(e.current.state).viewportInnerSize.width}const Qyt=(e,t)=>{const n=vgt(e,t);return myt(n,t),uyt(n),Io(ggt,n,t),Io(fyt,n,t),Io(Igt,n,t),Io(iyt,n,t),Io(qgt,n,t),Io(ryt,n,t),Io(Bgt,n,t),Io(gyt,n,t),Io(Ygt,n,t),Io(Ngt,n,t),Io(Gyt,n,t),Io(Ogt,n,t),Io(zyt,n,t),Io(Egt,n,t),Io(Ryt,n,t),Io(Cdt,n,t),Io(Syt,n,t),Io(Iyt,n,t),Io(Kyt,n,t),Ugt(n,t),pyt(n,t),Tgt(n,t),ayt(n,t),qyt(n,t),dyt(n,t),kyt(n),Dyt(n,t),oyt(n,t),zgt(n,t),Qgt(n,t),jgt(n,t),yyt(n,t),kgt(n,t),Hyt(n,t),Kgt(n,t),Tyt(n,t),vyt(n,t),Pgt(n),Agt(n,t),$gt(n,t),Cgt(n,t),Cyt(n,t),byt(n,t),Oyt(n),Edt(n,t),Yyt(n,t),n},Xyt=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:a,groupId:s,pinnedPosition:l}=e,c={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",a&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",s===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",l===Sn.LEFT&&"columnHeader--pinnedLeft",l===Sn.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Oe(c,kn,t)};function Jyt(e){var G;const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:a,colIndex:s,hasFocus:l,tabIndex:c,isLastColumn:u,pinnedPosition:d,pinnedOffset:f}=e,h=Rt(),g=Yn(),y=w.useRef(null),v=wn(),x=Ke(v,Xce),S=t?x[t]:{},{headerName:C=t??"",description:I="",headerAlign:E=void 0}=S;let T;const O=t&&((G=x[t])==null?void 0:G.renderHeaderGroup),A=w.useMemo(()=>({groupId:t,headerName:C,description:I,depth:r,maxDepth:o,fields:i,colIndex:s,isLastColumn:u}),[t,C,I,r,o,i,s,u]);t&&O&&(T=O(A));const k=F({},e,{classes:h.classes,headerAlign:E,depth:r,isDragging:!1}),M=C??t,R=Dn(),$=t===null?`empty-group-cell-${R}`:t,L=Xyt(k);w.useLayoutEffect(()=>{if(l){const K=y.current.querySelector('[tabindex="0"]')||y.current;K==null||K.focus()}},[v,l]);const z=w.useCallback(H=>K=>{lS(K)||v.current.publishEvent(H,A,K)},[v,A]),N=w.useMemo(()=>({onKeyDown:z("columnGroupHeaderKeyDown"),onFocus:z("columnGroupHeaderFocus"),onBlur:z("columnGroupHeaderBlur")}),[z]),B=typeof S.headerClassName=="function"?S.headerClassName(A):S.headerClassName,U=w.useMemo(()=>iO(F({},e.style),g,d,f),[d,f,e.style,g]);return _.jsx(mue,F({ref:y,classes:L,columnMenuOpen:!1,colIndex:s,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:c,isDraggable:!1,headerComponent:T,headerClassName:B,description:I,elementId:$,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:M,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:U},N))}const tX=se("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),Zyt=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:a,columnGroupHeaderFocus:s,headerGroupingMaxDepth:l,columnMenuState:c,columnVisibility:u,columnGroupsHeaderStructure:d,hasOtherElementInTabSequence:f}=e,[h,g]=w.useState(""),[y,v]=w.useState(""),x=ts(),S=Rt(),C=Ke(x,Qce),I=Ke(x,If),E=Ke(x,Sdt),T=Ke(x,rv),O=Ke(x,Hu),A=rue(I,E,T.left.length),k=Ke(x,QT),M=Ke(x,fce),R=Ke(x,Olt),$=Ke(x,klt),L=Ke(x,pce),z=w.useCallback(te=>v(te.field),[]),N=w.useCallback(()=>v(""),[]),B=w.useCallback(te=>g(te.field),[]),U=w.useCallback(()=>g(""),[]),G=w.useMemo(()=>T.left.length?{firstColumnIndex:0,lastColumnIndex:T.left.length}:null,[T.left.length]),H=w.useMemo(()=>T.right.length?{firstColumnIndex:t.length-T.right.length,lastColumnIndex:t.length}:null,[T.right.length,t.length]);wt(x,"columnResizeStart",z),wt(x,"columnResizeStop",N),wt(x,"columnHeaderDragStart",B),wt(x,"columnHeaderDragEnd",U);const K=te=>{const{renderContext:ce=E}=te||{},ae=ce.firstColumnIndex,ne=ce.lastColumnIndex;return{renderedColumns:t.slice(ae,ne),firstColumnToRender:ae,lastColumnToRender:ne}},q=(te,ce,ae,ne=!1)=>{const ue=(te==null?void 0:te.position)===Sn.RIGHT,he=(te==null?void 0:te.position)===void 0,re=T.right.length>0&&ue||T.right.length===0&&he,le=A-ae;return _.jsxs(w.Fragment,{children:[he&&_.jsx("div",{role:"presentation",style:{width:le}}),ce,he&&_.jsx("div",{role:"presentation",className:fe(oe.filler,ne&&oe["filler--borderBottom"])}),re&&_.jsx(Yz,{header:!0,pinnedRight:ue,borderBottom:ne,borderTop:!1})]})},Y=(te,ce={})=>{const{renderedColumns:ae,firstColumnToRender:ne}=K(te),ue=[];for(let he=0;he<ae.length;he+=1){const re=ae[he],le=ne+he,me=le===0,Se=o!==null&&o.field===re.field||me&&!f?0:-1,Ee=a!==null&&a.field===re.field,ge=c.open&&c.field===re.field,xe=te==null?void 0:te.position,Pe=Ew(xe,re.computedWidth,le,I,k,L),_e=xe===Sn.RIGHT?ae[he-1]:ae[he+1],Le=_e?a!==null&&a.field===_e.field:!1,de=le+1===I.length-T.right.length,$e=he,Ae=ae.length,Ne=VP(xe,$e),Ue=zP(xe,$e,Ae,S.showColumnVerticalBorder,M);ue.push(_.jsx(Upt,F({},n[re.field],{columnMenuOpen:ge,filterItemsCounter:r[re.field]&&r[re.field].length,headerHeight:R,isDragging:re.field===h,colDef:re,colIndex:le,isResizing:y===re.field,isLast:le===I.length-1,hasFocus:Ee,tabIndex:Se,pinnedPosition:xe,pinnedOffset:Pe,isLastUnpinned:de,isSiblingFocused:Le,showLeftBorder:Ne,showRightBorder:Ue},ce),re.field))}return q(te,ue,0)},J=()=>_.jsxs(tX,{role:"row","aria-rowindex":l+1,ownerState:S,className:oe["row--borderBottom"],children:[G&&Y({position:Sn.LEFT,renderContext:G},{disableReorder:!0}),Y({renderContext:E}),H&&Y({position:Sn.RIGHT,renderContext:H},{disableReorder:!0,separatorSide:Kz.Left})]}),ie=({depth:te,params:ce})=>{var Ae,Ne;const ae=K(ce);if(ae.renderedColumns.length===0)return null;const{firstColumnToRender:ne,lastColumnToRender:ue}=ae,he=d[te],re=t[ne].field,le=((Ae=C[re])==null?void 0:Ae[te])??null,me=he.findIndex(({groupId:Ue,columnFields:Ze})=>Ue===le&&Ze.includes(re)),Se=t[ue-1].field,Ee=((Ne=C[Se])==null?void 0:Ne[te])??null,ge=he.findIndex(({groupId:Ue,columnFields:Ze})=>Ue===Ee&&Ze.includes(Se)),xe=he.slice(me,ge+1).map(Ue=>F({},Ue,{columnFields:Ue.columnFields.filter(Ze=>u[Ze]!==!1)})).filter(Ue=>Ue.columnFields.length>0),Pe=xe[0].columnFields.indexOf(re),Le=xe[0].columnFields.slice(0,Pe).reduce((Ue,Ze)=>{const ut=O[Ze];return Ue+(ut.computedWidth??0)},0);let de=ne;const $e=xe.map(({groupId:Ue,columnFields:Ze},ut)=>{const Ye=s!==null&&s.depth===te&&Ze.includes(s.field),et=i!==null&&i.depth===te&&Ze.includes(i.field)?0:-1,Xe={width:Ze.reduce((gt,Vt)=>gt+O[Vt].computedWidth,0),fields:Ze,colIndex:de},mt=ce.position,At=Ew(mt,Xe.width,de,I,k,L);de+=Ze.length;let Bt=ut;return mt===Sn.LEFT&&(Bt=de-1),_.jsx(Jyt,{groupId:Ue,width:Xe.width,fields:Xe.fields,colIndex:Xe.colIndex,depth:te,isLastColumn:ut===xe.length-1,maxDepth:l,height:$,hasFocus:Ye,tabIndex:et,pinnedPosition:mt,pinnedOffset:At,showLeftBorder:VP(mt,Bt),showRightBorder:zP(mt,Bt,xe.length,S.showColumnVerticalBorder,M)},ut)});return q(ce,$e,Le)};return{renderContext:E,leftRenderContext:G,rightRenderContext:H,pinnedColumns:T,visibleColumns:t,columnPositions:I,getFillers:q,getColumnHeadersRow:J,getColumnsToRender:K,getColumnGroupHeadersRows:()=>{if(l===0)return null;const te=[];for(let ce=0;ce<l;ce+=1)te.push(_.jsxs(tX,{role:"row","aria-rowindex":ce+1,ownerState:S,children:[G&&ie({depth:ce,params:{position:Sn.LEFT,renderContext:G,maxLastColumn:G.lastColumnIndex}}),ie({depth:ce,params:{renderContext:E}}),H&&ie({depth:ce,params:{position:Sn.RIGHT,renderContext:H,maxLastColumn:H.lastColumnIndex}})]},ce));return te},getPinnedCellOffset:Ew,isDragging:!!h,getInnerProps:()=>({role:"rowgroup"})}},evt=["className"],tvt=e=>{const{classes:t}=e;return Oe({root:["columnHeaders"]},kn,t)},nvt=tr("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),rvt=Nn(function(t,n){const{className:r}=t,o=We(t,evt),i=Rt(),a=tvt(i);return _.jsx(nvt,F({className:fe(a.root,r),ownerState:i},o,{role:"presentation",ref:n}))}),ovt=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],ivt=Nn(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:f,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:g}=t,y=We(t,ovt),{getInnerProps:v,getColumnHeadersRow:x,getColumnGroupHeadersRows:S}=Zyt({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:f,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:g});return _.jsxs(rvt,F({},y,v(),{ref:n,children:[S(),x()]}))}),avt=Vu(ivt);function svt(e){return null}function lvt(e){return null}const cvt=Nn(function(t,n){const o=wn().current.getLocaleText("noResultsOverlayLabel");return _.jsx(qz,F({},t,{ref:n,children:o}))}),uvt=["sortingOrder"],dvt=w.memo(function(t){const{sortingOrder:n}=t,r=We(t,uvt),o=Rt(),[i]=n,a=i==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return a?_.jsx(a,F({},r)):null}),fvt=["native"];function pvt(e){let{native:t}=e,n=We(e,fvt);return t?_.jsx("option",F({},n)):_.jsx(Ft,F({},n))}const hvt={booleanCellTrueIcon:pht,booleanCellFalseIcon:p$,columnMenuIcon:cht,openFilterButtonIcon:nht,filterPanelDeleteIcon:p$,columnFilteredIcon:AQ,columnSelectorIcon:oht,columnUnsortedIcon:dvt,columnSortedAscendingIcon:TQ,columnSortedDescendingIcon:OQ,columnResizeIcon:iht,densityCompactIcon:aht,densityStandardIcon:sht,densityComfortableIcon:lht,exportIcon:fht,moreActionsIcon:hht,treeDataCollapseIcon:MQ,treeDataExpandIcon:kQ,groupingCriteriaCollapseIcon:MQ,groupingCriteriaExpandIcon:kQ,detailPanelExpandIcon:RQ,detailPanelCollapseIcon:uht,rowReorderIcon:DQ,quickFilterIcon:rht,quickFilterClearIcon:p$,columnMenuHideIcon:mht,columnMenuSortAscendingIcon:TQ,columnMenuSortDescendingIcon:OQ,columnMenuFilterIcon:AQ,columnMenuManageColumnsIcon:ght,columnMenuClearIcon:yht,loadIcon:dht,filterPanelAddIcon:RQ,filterPanelRemoveAllIcon:vht,columnReorderIcon:DQ},mvt=F({},hvt,{baseBadge:K0e,baseCheckbox:WSe,baseDivider:Ti,baseTextField:tn,baseFormControl:rh,baseSelect:gf,baseButton:at,baseIconButton:on,baseInputAdornment:ro,baseTooltip:Do,basePopper:pf,baseInputLabel:oh,baseSelectOption:pvt,baseChip:Pu}),gvt=F({},mvt,{cell:Dft,skeletonCell:Vft,columnHeaderFilterIconButton:eht,columnHeaderSortIcon:Jpt,columnMenu:$ht,columnHeaders:avt,detailPanels:svt,footer:Amt,footerRowCount:Gmt,toolbar:null,pinnedRows:lvt,loadingOverlay:Lmt,noResultsOverlay:cvt,noRowsOverlay:Fmt,pagination:Vmt,filterPanel:dmt,columnsPanel:Bht,columnsManagement:mmt,panel:Wht,row:Jmt}),yvt={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},vvt=gvt,bvt=e=>{const t=Ift(hn({props:e,name:"MuiDataGrid"})),n=w.useMemo(()=>F({},Alt,t.localeText),[t.localeText]),r=w.useMemo(()=>Eft({defaultSlots:vvt,slots:t.slots}),[t.slots]),o=w.useMemo(()=>Object.keys(qL).reduce((i,a)=>(i[a]=t[a]??qL[a],i),{}),[t]);return w.useMemo(()=>F({},t,o,{localeText:n,slots:r},yvt),[t,n,r,o])},wvt={hooks:{useGridAriaAttributes:Zmt,useGridRowAriaAttributes:egt}},Aue=Nn(function(t,n){var i;const r=bvt(t),o=Qyt(r.apiRef,r);return _.jsx(tgt,{privateApiRef:o,configuration:wvt,props:r,children:_.jsx(apt,F({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,(i=r.slotProps)==null?void 0:i.root,{ref:n}))})}),xvt=w.memo(Aue);Aue.propTypes={apiRef:V.shape({current:V.object.isRequired}),"aria-label":V.string,"aria-labelledby":V.string,autoHeight:V.bool,autoPageSize:V.bool,autosizeOnMount:V.bool,autosizeOptions:V.shape({columns:V.arrayOf(V.string),disableColumnVirtualization:V.bool,expand:V.bool,includeHeaders:V.bool,includeOutliers:V.bool,outliersFactor:V.number}),cellModesModel:V.object,checkboxSelection:V.bool,classes:V.object,clipboardCopyCellDelimiter:V.string,columnBufferPx:V.number,columnGroupHeaderHeight:V.number,columnGroupingModel:V.arrayOf(V.object),columnHeaderHeight:V.number,columns:V.arrayOf(V.object).isRequired,columnVisibilityModel:V.object,density:V.oneOf(["comfortable","compact","standard"]),disableAutosize:V.bool,disableColumnFilter:V.bool,disableColumnMenu:V.bool,disableColumnResize:V.bool,disableColumnSelector:V.bool,disableColumnSorting:V.bool,disableDensitySelector:V.bool,disableEval:V.bool,disableMultipleRowSelection:V.bool,disableRowSelectionOnClick:V.bool,disableVirtualization:V.bool,editMode:V.oneOf(["cell","row"]),estimatedRowCount:V.number,experimentalFeatures:V.shape({warnIfFocusStateIsNotSynced:V.bool}),filterDebounceMs:V.number,filterMode:V.oneOf(["client","server"]),filterModel:V.shape({items:V.arrayOf(V.shape({field:V.string.isRequired,id:V.oneOfType([V.number,V.string]),operator:V.string.isRequired,value:V.any})).isRequired,logicOperator:V.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:V.bool,quickFilterLogicOperator:V.oneOf(["and","or"]),quickFilterValues:V.array}),forwardedProps:V.object,getCellClassName:V.func,getDetailPanelContent:V.func,getEstimatedRowHeight:V.func,getRowClassName:V.func,getRowHeight:V.func,getRowId:V.func,getRowSpacing:V.func,hideFooter:V.bool,hideFooterPagination:V.bool,hideFooterSelectedRowCount:V.bool,ignoreDiacritics:V.bool,ignoreValueFormatterDuringExport:V.oneOfType([V.shape({clipboardExport:V.bool,csvExport:V.bool}),V.bool]),indeterminateCheckboxAction:V.oneOf(["deselect","select"]),initialState:V.object,isCellEditable:V.func,isRowSelectable:V.func,keepNonExistentRowsSelected:V.bool,loading:V.bool,localeText:V.object,logger:V.shape({debug:V.func.isRequired,error:V.func.isRequired,info:V.func.isRequired,warn:V.func.isRequired}),logLevel:V.oneOf(["debug","error","info","warn",!1]),nonce:V.string,onCellClick:V.func,onCellDoubleClick:V.func,onCellEditStart:V.func,onCellEditStop:V.func,onCellKeyDown:V.func,onCellModesModelChange:V.func,onClipboardCopy:V.func,onColumnHeaderClick:V.func,onColumnHeaderContextMenu:V.func,onColumnHeaderDoubleClick:V.func,onColumnHeaderEnter:V.func,onColumnHeaderLeave:V.func,onColumnHeaderOut:V.func,onColumnHeaderOver:V.func,onColumnOrderChange:V.func,onColumnResize:V.func,onColumnVisibilityModelChange:V.func,onColumnWidthChange:V.func,onDensityChange:V.func,onFilterModelChange:V.func,onMenuClose:V.func,onMenuOpen:V.func,onPaginationMetaChange:V.func,onPaginationModelChange:V.func,onPreferencePanelClose:V.func,onPreferencePanelOpen:V.func,onProcessRowUpdateError:V.func,onResize:V.func,onRowClick:V.func,onRowCountChange:V.func,onRowDoubleClick:V.func,onRowEditStart:V.func,onRowEditStop:V.func,onRowModesModelChange:V.func,onRowSelectionModelChange:V.func,onSortModelChange:V.func,onStateChange:V.func,pageSizeOptions:V.arrayOf(V.oneOfType([V.number,V.shape({label:V.string.isRequired,value:V.number.isRequired})]).isRequired),pagination:V.oneOf([!0]),paginationMeta:V.shape({hasNextPage:V.bool}),paginationMode:V.oneOf(["client","server"]),paginationModel:V.shape({page:V.number.isRequired,pageSize:V.number.isRequired}),processRowUpdate:V.func,resetPageOnSortFilter:V.bool,resizeThrottleMs:V.number,rowBufferPx:V.number,rowCount:V.number,rowHeight:V.number,rowModesModel:V.object,rowPositionsDebounceMs:V.number,rows:V.arrayOf(V.object),rowSelection:V.bool,rowSelectionModel:V.oneOfType([V.arrayOf(V.oneOfType([V.number,V.string]).isRequired),V.number,V.string]),rowSpacingType:V.oneOf(["border","margin"]),scrollbarSize:V.number,showCellVerticalBorder:V.bool,showColumnVerticalBorder:V.bool,slotProps:V.object,slots:V.object,sortingMode:V.oneOf(["client","server"]),sortingOrder:V.arrayOf(V.oneOf(["asc","desc"])),sortModel:V.arrayOf(V.shape({field:V.string.isRequired,sort:V.oneOf(["asc","desc"])})),sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),unstable_rowSpanning:V.bool,virtualizeColumnsWithAutoRowHeight:V.bool};const Svt=e=>e.map(t=>({id:t.id,category:t.category,date:t.date,value:t.value,notes:t.notes})),Cvt=e=>{const[t]=Re(),n=Svt(e.category.entries),r=ece(),o=olt(),[i,a]=w.useState(n),[s,l]=w.useState({}),c=(S,C)=>{S.reason===fl.rowFocusOut&&(C.defaultMuiPrevented=!0)},u=S=>()=>{l({...s,[S]:{mode:ar.Edit}})},d=S=>()=>{l({...s,[S]:{mode:ar.View}})},f=S=>async()=>{console.log("deleting entry",S),o.mutate(parseInt(S.toString())),a(i.filter(C=>C.id!==S))},h=S=>()=>{l({...s,[S]:{mode:ar.View,ignoreModifications:!0}});const C=i.find(I=>I.id===S);(C==null?void 0:C.id)===null&&a(i.filter(I=>I.id!==S))},g=async S=>{r.mutate({id:S.id,categoryId:S.category,date:S.date,value:S.value,notes:S.notes});const C={...S,isNew:!1};return a(i.map(I=>I.id===S.id?C:I)),C},y=S=>{console.log(S)},v=S=>{l(S)},x=[{field:"value",headerName:t("value"),width:80,editable:!0,valueFormatter:S=>S==null?"":S+e.category.unit},{field:"date",headerName:t("date"),type:"date",width:120,editable:!0,valueFormatter:S=>S==null?"":yt.fromJSDate(S).toLocaleString(yt.DATE_MED)},{field:"notes",headerName:t("notes"),type:"string",flex:1,editable:!0},{field:"actions",type:"actions",headerName:t("actions"),width:100,cellClassName:"actions",getActions:({id:S})=>{var I;return((I=s[S])==null?void 0:I.mode)===ar.Edit?[b(c1,{icon:b(Vrt,{}),label:"Save",sx:{color:"primary.main"},onClick:d(S)}),b(c1,{icon:b(y0,{}),label:"Cancel",className:"textPrimary",onClick:h(S),color:"inherit"})]:[b(c1,{icon:b(hz,{}),label:"Edit",className:"textPrimary",onClick:u(S),color:"inherit"}),b(c1,{icon:b(kP,{}),label:"Delete",onClick:f(S),color:"inherit"})]}}];return b(en,{sx:{width:"100%"},children:b(xvt,{editMode:"row",rows:n,columns:x,initialState:{pagination:{paginationModel:{pageSize:CW.pageSize}}},pageSizeOptions:CW.pageSizeOptions,disableRowSelectionOnClick:!0,rowModesModel:s,onRowModesModelChange:v,onRowEditStop:c,processRowUpdate:g,onProcessRowUpdateError:y})})},aO=({title:e,subtitle:t,isOpen:n,message:r,deleteFn:o,closeFn:i})=>{const[a]=Re();return b(by,{open:n,onClose:i,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(fo,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",borderWidth:0,boxShadow:24,p:2},children:[b(Vl,{title:e,titleTypographyProps:{variant:"h6"},subheader:t,action:b(y0,{onClick:i})}),b(Pi,{children:b(tt,{variant:"body1",children:r})}),Q(Ys,{children:[b(at,{color:"error",variant:"contained",onClick:()=>{o(),i()},children:a("delete")}),b(at,{color:"primary",onClick:i,children:a("close")})]})]})})},Rue=({category:e,closeFn:t})=>{const[n]=Re(),r=elt(),o=tlt(e==null?void 0:e.id),i=_o({name:Ro().required(n("forms.fieldRequired")).max(20,n("forms.maxLength",{chars:"20"})).min(3,n("forms.minLength",{chars:"3"})),unit:Ro().required(n("forms.fieldRequired")).max(5,n("forms.maxLength",{chars:"5"}))});return b(ci,{initialValues:{name:e?e.name:"",unit:e?e.unit:""},validationSchema:i,onSubmit:async a=>{e?o.mutate({...a,id:e.id}):r.mutate(a),t&&t()},children:a=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"name",label:n("name"),error:a.touched.name&&!!a.touched.name,helperText:a.touched.name&&a.errors.name,...a.getFieldProps("name")}),b(tn,{fullWidth:!0,id:"unit",label:n("unit"),error:a.touched.unit&&!!a.errors.unit,helperText:a.touched.unit&&a.errors.unit?a.errors.unit:n("measurements.unitFormHelpText"),...a.getFieldProps("unit")}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("submit")})})]})})})},Evt=e=>{const t=nlt(e.category.id),n=zu(),[r]=Re(),[o,i]=X.useState(null),[a,s]=X.useState(!1),[l,c]=X.useState(!1),u=!!o,d=I=>{i(I.currentTarget)},f=()=>{h(),v()},h=()=>{i(null)},g=()=>{S(),i(null)},y=()=>{t.mutate(e.category.id),n(Qt(Kt.MEASUREMENT_OVERVIEW))},v=()=>s(!0),x=()=>s(!1),S=()=>c(!0),C=()=>c(!1);return Q("div",{children:[b(at,{onClick:d,children:b(mz,{})}),Q(Sa,{anchorEl:o,open:u,onClose:h,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:f,children:r("edit")}),b(Ft,{onClick:g,children:r("delete")})]}),b(ki,{title:r("edit"),isOpen:a,closeFn:x,children:b(Rue,{category:e.category,closeFn:x})}),b(aO,{title:r("deleteConfirmation",{name:e.category.name}),message:r("measurements.deleteInfo"),isOpen:l,closeFn:C,deleteFn:y})]})};Hr.defaultZone=Wke;const Due=({entry:e,closeFn:t,categoryId:n})=>{const[r,o]=Re(),i=rlt(),a=ece(),s=Zle(n),[l,c]=X.useState(e?yt.fromJSDate(e.date):yt.now()),u=_o({value:wo().required(r("forms.fieldRequired")).min(0,r("forms.minValue",{value:"0"})).max(1e3,r("forms.maxValue",{value:"1000"})),date:wc().required(r("forms.fieldRequired")),notes:Ro().max(500,r("forms.maxLength",{value:"500"}))});return b(ci,{initialValues:{value:e?e.value:0,date:e?e.date:new Date,notes:e?e.notes:""},validationSchema:u,onSubmit:async d=>{e?a.mutate({...d,id:e.id}):i.mutate({...d,categoryId:n}),t&&t()},children:d=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"value",type:"number",label:r("value"),error:d.touched.value&&!!d.errors.value,helperText:d.touched.value&&d.errors.value,...d.getFieldProps("value")}),s.isLoading?b(wr,{}):b(vc,{dateAdapter:pu,adapterLocale:o.language,children:b(kx,{format:"yyyy-MM-dd",label:r("date"),value:l,disableFuture:!0,onChange:f=>{f&&d.setFieldValue("date",f.toJSDate()),c(f)},shouldDisableDate:f=>e&&co(e.date)===co(f.toJSDate())?!1:f?s.data.entries.some(h=>co(h.date)===co(f.toJSDate())):!1})}),b(tn,{fullWidth:!0,id:"notes",label:r("notes"),multiline:!0,error:d.touched.notes&&!!d.errors.notes,helperText:d.touched.notes&&d.errors.notes,...d.getFieldProps("notes")}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})]})})})},Pvt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Rue,{closeFn:o})})]})},Ivt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1),i=Ea(),a=parseInt(i.categoryId);return Q(xt,{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:s=>s.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Due,{closeFn:o,categoryId:a})})]})},d1=['"Open Sans Bold"',"sans-serif"].join(","),Tvt=['"Open Sans Light"',"sans-serif"].join(","),_ue={spacing:8,typography:{h3:{fontFamily:d1},h4:{fontFamily:d1},h5:{fontFamily:d1},h6:{fontFamily:d1},fontFamily:Tvt},palette:{primary:{main:"#2A4C7D"},secondary:{main:"#e63946"},warning:{main:"#cba328"},info:{main:"#457b9d"},success:{main:"#307916"}}},xh=l0(_ue),Ovt=e=>l0({..._ue,components:{MuiPopover:{defaultProps:{container:e}},MuiPopper:{defaultProps:{container:e}},MuiModal:{defaultProps:{container:e}}}}),$ue=e=>{const{i18n:t}=Re(),n=30,r=[...e.category.entries].sort((o,i)=>o.date.getTime()-i.date.getTime()).map(o=>({date:o.date.getTime(),value:o.value,entry:o}));return b(en,{alignItems:"center",display:"flex",flexDirection:"column",children:b(Fu,{width:"90%",height:200,children:Q(AB,{data:r,children:[b(uh,{type:"monotone",dataKey:"value",stroke:xh.palette.secondary.main,strokeWidth:2,dot:r.length>n?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6}}),b(Sf,{stroke:"#ccc",strokeDasharray:"5 5"}),b(Xa,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:o=>new Date(o).toLocaleDateString(t.language),tickCount:10}),b(Ja,{domain:["auto","auto"],unit:e.category.unit})]})})})},kvt=()=>{const e=Ea(),t=parseInt(e.categoryId??"");if(Number.isNaN(t))return b("p",{children:"Please pass an integer as the category id."});const n=Zle(t);return n.isLoading?b(wr,{}):b(es,{title:n.data.name,optionsMenu:b(Evt,{category:n.data}),mainContent:Q(_t,{spacing:2,children:[b($ue,{category:n.data}),b(Cvt,{category:n.data})]}),fab:b(Ivt,{})})},Mvt=e=>{const[t,n]=Re(),[r,o]=X.useState(!1),i=()=>o(!0),a=()=>o(!1);return Q(xt,{children:[Q(fo,{children:[b(Vl,{title:e.category.name,subheader:e.category.unit}),b(Pi,{children:b($ue,{category:e.category})}),Q(Ys,{disableSpacing:!0,sx:{justifyContent:"space-between"},children:[b(at,{size:"small",children:b(io,{to:Qt(Kt.MEASUREMENT_DETAIL,n.language,{id:e.category.id}),children:t("seeDetails")})}),b(on,{onClick:i,children:b($o,{})})]})]}),b(ki,{title:t("add"),isOpen:r,closeFn:a,children:b(Due,{closeFn:a,categoryId:e.category.id})})]})},nX=()=>{const e=Jle(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("measurements.measurements"),mainContent:Q(_t,{spacing:2,children:[e.data.length===0&&b(ih,{}),e.data.map(n=>b(Mvt,{category:n},n.id))]}),fab:b(Pvt,{})})};function Pa(){return br({queryKey:[st.QUERY_PROFILE],queryFn:k$e})}const Avt=()=>{const e=Et();return It({mutationFn:t=>M$e(t),onSuccess:async()=>{await e.invalidateQueries({queryKey:[st.QUERY_PROFILE]})}})},W1=[{range:"obese",color:"#FF5733",min:30,max:100},{range:"overweight",color:"#FFC107",min:25,max:30},{range:"normal",color:"#90EE90",min:18.5,max:25},{range:"underweight",color:"#FFC300",min:0,max:18.5}],f1=e=>{const t=W1.find(n=>n.range===e);return t?t.color:"gray"},Rvt=()=>{const[e]=Re(),t=Y0(),n=Pa(),[r,o]=w.useState(),[i,a]=w.useState();w.useEffect(()=>{var u;if(t.data&&t.data.length>0){const d=t.data[0],f=(u=n.data)!=null&&u.useMetric?d.weight:d.weight*.453592;a(f)}},[t.data,n.data]),w.useEffect(()=>{var u;(u=n.data)!=null&&u.height&&o(n.data.height)},[n.data]);const l=(()=>{if(r&&i){const u=r/100;return i/(u*u)}return null})();if(t.isLoading||n.isLoading)return b(wr,{});const c=[];for(let u=140;u<=220;u+=10){const d=u/100,f={height:u};let h=0;W1.forEach((g,y)=>{const v=g.max>100?100:g.max;let x=v*d*d-h;x=Math.min(x,150-h),y===0?f[g.range]=x:f[g.range]=f[W1[y-1].range]+x,h=Math.min(v*d*d,150)}),c.push(f)}return b(es,{title:e("bmi.calculator"),mainContent:b(xt,{children:Q(_t,{spacing:2,children:[Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:6},children:b(tn,{label:e("height"),fullWidth:!0,slotProps:{input:{endAdornment:b(tt,{children:e("cm")})}},type:"number",value:r??"",onChange:u=>o(parseFloat(u.target.value))})}),b(ye,{size:{xs:12,sm:6},children:b(tn,{label:e("weight"),slotProps:{input:{endAdornment:b(tt,{children:e("server.kg")})}},fullWidth:!0,type:"number",value:i??"",onChange:u=>a(parseFloat(u.target.value))})})]}),l!==null&&b(tt,{variant:"h6",children:e("bmi.result",{value:l.toFixed(1)})}),b(Fu,{width:"100%",height:400,children:Q(C8e,{data:c,children:[b(Xa,{dataKey:"height",type:"number",domain:[140,220],unit:"cm"}),b(Ja,{domain:[40,150],tickFormatter:u=>Math.round(u).toString(),unit:"kg"}),b(Sf,{strokeDasharray:"3 3"}),b(ua,{formatter:(u,d)=>[Math.round(u),e("bmi."+d)]}),W1.map(u=>b(Cf,{type:"monotone",dataKey:u.range,stroke:"black",fill:u.color,fillOpacity:.8},u.range)),l!==null&&b($0,{x:r,y:i,r:8,fill:"black",stroke:"none"})]})}),Q(_t,{direction:"row",justifyContent:"center",children:[b(en,{height:20,width:20,sx:{backgroundColor:f1("obese")}}),e("bmi.obese"),b(en,{height:20,width:20,sx:{backgroundColor:f1("overweight"),marginLeft:2}}),e("bmi.overweight"),b(en,{height:20,width:20,sx:{backgroundColor:f1("normal"),marginLeft:2}}),e("bmi.normal"),b(en,{height:20,width:20,sx:{backgroundColor:f1("underweight"),marginLeft:2}}),e("bmi.underweight")]})]})})})},Dvt=e=>{var r,o,i,a;const[t,n]=Re();return Q(Zt,{children:[b(Te,{sx:{paddingX:1},children:b(Nl,{alt:(r=e.item.ingredient)==null?void 0:r.name,src:(i=(o=e.item.ingredient)==null?void 0:o.image)==null?void 0:i.url,sx:{width:45,height:45},children:b(_u,{})})}),Q(Te,{sx:{paddingX:1},children:[e.item.amountString," ",(a=e.item.ingredient)==null?void 0:a.name]}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.item.nutritionalValues.energy,n.language),kj:wi(e.item.nutritionalValues.energyKj,n.language)})}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.item.nutritionalValues.protein,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.item.nutritionalValues.carbohydrates,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.item.nutritionalValues.fat,n.language)})]},e.item.id)},XL=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{children:[b(Du,{children:Q(Zt,{children:[b(Te,{}),b(Te,{}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.energy")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.protein")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.carbohydrates")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.fat")})]})}),Q(Fl,{children:[e.items.map(r=>b(Dvt,{item:r},r.id)),e.showSum&&Q(Zt,{children:[b(Te,{sx:{paddingX:1},children:" "}),b(Te,{sx:{paddingX:1},children:t("total")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.values.energy,n.language),kj:wi(e.values.energyKj,n.language)})}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.values.protein,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.values.carbohydrates,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.values.fat,n.language)})]})]})]})})},_vt=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("nutrition.macronutrient")}),b(Te,{align:"right",children:t("nutrition.planned")}),b(Te,{align:"right",children:t("nutrition.logged")}),b(Te,{align:"right",children:t("nutrition.difference")})]})}),Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("nutrition.energy")}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.planned.energy,n.language),kj:wi(e.planned.energyKj,n.language)})}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.logged.energy,n.language),kj:wi(e.logged.energyKj,n.language)})}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.logged.energy-e.planned.energy,n.language),kj:wi(e.logged.energyKj-e.planned.energyKj,n.language)})})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.protein")}),b(Te,{align:"right",children:Rn(e.planned.protein,n.language)}),b(Te,{align:"right",children:Rn(e.logged.protein,n.language)}),b(Te,{align:"right",children:Rn(e.logged.protein-e.planned.protein,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.carbohydrates")}),b(Te,{align:"right",children:Rn(e.planned.carbohydrates,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydrates,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydrates-e.planned.carbohydrates,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),b(Te,{align:"right",children:Rn(e.planned.carbohydratesSugar,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydratesSugar,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydratesSugar-e.planned.carbohydratesSugar,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fat")}),b(Te,{align:"right",children:Rn(e.planned.fat,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fat,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fat-e.planned.fat,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{paddingLeft:5},children:t("nutrition.ofWhichSaturated")}),b(Te,{align:"right",children:Rn(e.planned.fatSaturated,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fatSaturated,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fatSaturated-e.planned.fatSaturated,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.others")}),b(Te,{}),b(Te,{}),b(Te,{})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fibres")}),b(Te,{align:"right",children:Rn(e.planned.fiber,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fiber,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fiber-e.planned.fiber,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.sodium")}),b(Te,{align:"right",children:Rn(e.planned.sodium,n.language)}),b(Te,{align:"right",children:Rn(e.logged.sodium,n.language)}),b(Te,{align:"right",children:Rn(e.logged.sodium-e.planned.sodium,n.language)})]})]})]})})},rX=()=>{const[e]=Re(),t=Ea(),n=parseInt(t.planId);if(Number.isNaN(n))return b("p",{children:"Please pass an integer as the nutritional plan id."});const r=new Date(t.date),o=mMe(n,t.date);return o.isLoading?b(wr,{}):b(es,{title:e("nutrition.nutritionalDiary"),mainContent:b(xt,{children:Q(_t,{spacing:2,children:[b(tt,{gutterBottom:!0,variant:"h4",children:r.toLocaleDateString()}),b(_vt,{logged:o.data.loggedNutritionalValuesDate(r),planned:o.data.plannedNutritionalValues}),b(XL,{values:o.data.loggedNutritionalValuesDate(r),items:o.data.loggedEntriesDate(r),showSum:!0})]})})})};function*cS(e){let t;e<=3?t=Uke:e<=5?t=Hke:t=Vke;for(const n of t)yield n}const $vt=e=>{const[t,n]=Re(),r=cS(3),o=[{name:t("nutrition.carbohydrates"),value:e.data.carbohydrates},{name:t("nutrition.protein"),value:e.data.protein},{name:t("nutrition.fat"),value:e.data.fat}],i=Math.PI/180;return b(Fu,{width:"100%",height:300,children:Q(cae,{children:[b(Rc,{data:o,labelLine:!1,label:({cx:s,cy:l,midAngle:c,innerRadius:u,outerRadius:d,payload:f})=>{const h=u+(d-u)*.4,g=s+h*Math.cos(-c*i),y=l+h*Math.sin(-c*i);return b("text",{x:g,y,fill:"white",textAnchor:"middle",dominantBaseline:"central",children:Rn(f.value,n.language)})},fill:"#8884d8",dataKey:"value",children:o.map((s,l)=>b(Ny,{fill:r.next().value},`cell-${l}`))}),b(hc,{})]})})},Nvt=({showPlanned:e,planned:t,today:n,avg7Days:r})=>{const[o,i]=Re(),a=cS(3),s=[{name:o("nutrition.protein"),planned:t.protein,today:n.protein,avg7Days:r.protein},{name:o("nutrition.carbohydrates"),planned:t.carbohydrates,today:n.carbohydrates,avg7Days:r.carbohydrates},{name:o("nutrition.sugar"),planned:t.carbohydratesSugar,today:n.carbohydratesSugar,avg7Days:r.carbohydratesSugar},{name:o("nutrition.fat"),planned:t.fat,today:n.fat,avg7Days:r.fat},{name:o("nutrition.saturatedFat"),planned:t.fatSaturated,today:n.fatSaturated,avg7Days:r.fatSaturated}];return b(Fu,{width:"100%",height:300,children:Q(lae,{data:s,margin:{top:20,right:30,left:20,bottom:5},children:[b(Sf,{strokeDasharray:"3 4"}),b(Xa,{dataKey:"name"}),b(Ja,{type:"number",orientation:"left",unit:o("nutrition.gramShort")}),b(ua,{formatter:l=>wi(l,i.language)}),b(hc,{}),e&&b(yc,{dataKey:"planned",unit:o("nutrition.gramShort"),name:o("nutrition.planned"),fill:a.next().value}),b(yc,{dataKey:"today",unit:o("nutrition.gramShort"),name:o("nutrition.today"),fill:a.next().value}),b(yc,{dataKey:"avg7Days",unit:o("nutrition.gramShort"),name:o("nutrition.7dayAvg"),fill:a.next().value})]})})},Lvt=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("date")}),b(Te,{align:"right",children:t("nutrition.logged")}),b(Te,{align:"right",children:t("nutrition.difference")})]})}),b(Fl,{children:Array.from(e.logged).map(([r])=>{var o,i;return Q(Zt,{children:[b(Te,{children:b(io,{to:Qt(Kt.NUTRITION_DIARY,n.language,{id:e.planId,date:r}),children:new Date(r).toLocaleDateString(n.language)})}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcal",{value:wi((o=e.logged.get(r))==null?void 0:o.nutritionalValues.energy,n.language)})}),b(Te,{align:"right",children:wi(((i=e.logged.get(r))==null?void 0:i.nutritionalValues.energy)-e.planned.energy,n.language)})]},r)})})]})})},Fvt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(pz,{closeFn:o})})]})},jvt=e=>{const[t]=Re(),[n,r]=X.useState(!1),o=()=>r(!0),i=()=>r(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:o,sx:{position:"fixed",bottom:"5rem",right:a=>a.spacing(2),zIndex:9},children:b(g0,{})}),b(ki,{title:t("nutrition.addNutritionalDiary"),isOpen:n,closeFn:i,children:b(fz,{closeFn:i,planId:e.plan.id,meals:e.plan.meals})})]})},Nue=({meal:e,planId:t,closeFn:n})=>{const[r,o]=Re(),i=xMe(t),a=CMe(t),s=_o({name:Ro().required().max(25,r("forms.maxLength",{chars:"25"})).min(3,r("forms.minLength",{chars:"3"})),time:wc().required()});return b(ci,{initialValues:{name:e?e.name:"",time:e?e.time:new Date},validationSchema:s,onSubmit:async l=>{l.time instanceof Date||(l.time=l.time.toJSDate());const c={...l,time:Bw(l.time)};e?a.mutate({...c,plan:t,id:e.id}):i.mutate({...c,plan:t}),n&&n()},children:l=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"name",label:r("description"),error:l.touched.name&&!!l.errors.name,helperText:l.touched.name&&l.errors.name,...l.getFieldProps("name")}),b(vc,{dateAdapter:pu,adapterLocale:o.language,children:b(vL,{label:r("timeOfDay"),value:l.values.time!==null?yt.fromJSDate(l.values.time):null,onChange:c=>l.setFieldValue("time",c)})}),Q(_t,{direction:"row",justifyContent:"end",spacing:2,children:[n!==void 0&&b(at,{color:"primary",variant:"outlined",onClick:()=>n(),children:r("close")}),b(at,{disabled:i.isPending||a.isPending,color:"primary",variant:"contained",type:"submit",children:r("submit")})]})]})})})},Bvt=e=>{const[t]=Re(),n=cS(3),r=[{name:t("nutrition.energy"),value:e.logged.energy/e.planned.energy*100},{name:t("nutrition.protein"),value:e.logged.protein/e.planned.protein*100},{name:t("nutrition.carbohydrates"),value:e.logged.carbohydrates/e.planned.carbohydrates*100},{name:t("nutrition.fat"),value:e.logged.fat/e.planned.fat*100}];return b(Fu,{width:"100%",height:150,children:Q(lae,{data:r,layout:"vertical",margin:{left:60},children:[b(Sf,{strokeDasharray:"3 4"}),b(Xa,{type:"number",unit:"%"}),b(Ja,{type:"category",dataKey:"name"}),b(yc,{dataKey:"value",unit:"%",fill:n.next().value})]})})},Lue=({planId:e,item:t,mealId:n,closeFn:r})=>{const[o]=Re(),i=TMe(e),a=OMe(e),s=kMe(e),l=()=>{t&&s.mutate(t.id),r&&r()},c=_o({amount:wo().required(o("forms.fieldRequired")).max(1e3,o("forms.maxValue",{value:"1000"})).min(1,o("forms.minValue",{value:"1"})),ingredient:wo().required(o("forms.fieldRequired"))});return b(ci,{initialValues:{amount:t?t.amount:0,ingredient:t?t.ingredientId:0},validationSchema:c,onSubmit:async u=>{const d={...u,meal:n,weight_unit:null};t?a.mutate({...d,id:t.id}):i.mutate(d),r&&r()},children:u=>{var d;return b(Zo,{children:Q(_t,{spacing:2,children:[b(ZB,{callback:f=>u.setFieldValue("ingredient",f?f.data.id:null),initialIngredient:t?(d=t.ingredient)==null?void 0:d.name:null}),b(tn,{fullWidth:!0,id:"amount",label:"amount",InputProps:{endAdornment:b(ro,{position:"end",children:o("nutrition.gramShort")})},error:u.touched.amount&&!!u.errors.amount,helperText:u.touched.amount&&u.errors.amount,...u.getFieldProps("amount")}),Q(_t,{direction:"row",justifyContent:"end",spacing:2,children:[r!==void 0&&t!==void 0&&b(at,{color:"error",variant:"outlined",onClick:l,children:o("delete")}),r!==void 0&&b(at,{color:"primary",variant:"outlined",onClick:()=>r(),children:o("close")}),b(at,{color:"primary",variant:"contained",type:"submit",children:o("submit")})]})]})})}})},zvt=e=>{const t=ste(e.planId),n=SMe(e.planId),[r]=Re(),[o,i]=X.useState(!1),[a,s]=w.useState(null),[l,c]=w.useState(!1),[u,d]=w.useState(!1),f=!!a,h=A=>{s(A.currentTarget)},g=()=>{y(),S()},y=()=>{s(null)},v=()=>{I(),s(null)},x=()=>{n.mutate(e.meal.id)},S=()=>c(!0),C=()=>c(!1),I=()=>d(!0),E=()=>d(!1),T=(A,k)=>{k!=="clickaway"&&i(!1)},O=()=>{const A=e.meal.items.map(k=>({plan:e.planId,meal:e.meal.id,mealItem:k.id,ingredient:k.ingredientId,weight_unit:k.weightUnitId,datetime:new Date().toISOString(),amount:k.amount}));t.mutate(A),i(!0)};return Q(xt,{children:[!e.onlyLogging&&b(Do,{title:r("nutrition.logThisMeal"),children:b(on,{"aria-label":"settings",onClick:O,children:b(g0,{})})}),b(on,{"aria-label":"settings",onClick:h,children:b(gz,{})}),b(on,{"aria-label":"settings",onClick:e.handleExpanded,children:e.isExpanded?b(cle,{}):b(ule,{})}),Q(Sa,{anchorEl:a,open:f,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:g,children:r("edit")}),b(Ft,{onClick:v,children:r("delete")})]}),b(ki,{title:r("edit"),isOpen:l,closeFn:C,children:b(Nue,{meal:e.meal,closeFn:C,planId:e.planId})}),b(aO,{title:r("deleteConfirmation",{name:e.meal.name}),message:r("nutrition.mealDeleteInfo"),isOpen:u,closeFn:E,deleteFn:x}),b(II,{open:o,autoHideDuration:NI,onClose:T,children:b(Ii,{onClose:T,severity:"success",sx:{width:"100%"},children:r("nutrition.diaryEntrySaved")})})]})},Vvt=e=>{var o,i,a,s;const[t,n]=w.useState(!1),r=()=>n(!t);return Q(xt,{children:[Q(Ka,{children:[b(JF,{onClick:r,sx:{"&:hover":{cursor:"pointer"}},children:b(Nl,{alt:(o=e.mealItem.ingredient)==null?void 0:o.name,src:(a=(i=e.mealItem.ingredient)==null?void 0:i.image)==null?void 0:a.url,sx:{width:45,height:45},children:b(_u,{})})}),b(uo,{primary:`${e.mealItem.amountString} ${(s=e.mealItem.ingredient)==null?void 0:s.name}`})]}),b(Ls,{in:t,timeout:"auto",unmountOnExit:!0,sx:{width:"100%"},children:b(Ka,{children:b(uo,{children:b(Lue,{planId:e.planId,mealId:e.mealId,item:e.mealItem,closeFn:r})})})})]})},oX=e=>{const t=Lr(),n=e.meal.id!==O1,[r]=Re(),[o,i]=w.useState(!1),a=()=>i(!o),[s,l]=w.useState(!1),c=()=>{l(!s),d(!1)},[u,d]=w.useState(!1),f=()=>{d(!u),l(!1)};return Q(fo,{children:[b(Vl,{sx:{bgcolor:t.palette.grey[300]},action:e.meal.id!==O1&&b(zvt,{meal:e.meal,planId:e.planId,onlyLogging:e.onlyLogging,isExpanded:o,handleExpanded:a}),title:e.meal.name,subheader:e.meal.timeHHMMLocale}),Q(Pi,{sx:{paddingY:0},children:[Q(Ls,{in:o,timeout:"auto",unmountOnExit:!0,children:[!e.onlyLogging&&b(XL,{showSum:n,items:e.meal.items,values:e.meal.plannedNutritionalValues}),b(tt,{gutterBottom:!0,variant:"h6",sx:{my:2},children:r("nutrition.loggedToday")}),!e.meal.plannedNutritionalValues.isEmpty&&b(Bvt,{logged:e.meal.loggedNutritionalValuesToday,planned:e.meal.plannedNutritionalValues}),b(XL,{showSum:n,items:e.meal.diaryEntriesToday,values:e.meal.loggedNutritionalValuesToday})]}),!o&&b(xa,{children:e.meal.items.map(h=>b(Vvt,{mealItem:h,planId:e.planId,mealId:e.meal.id},h.id))})]}),Q(Ys,{children:[!e.onlyLogging&&b(Do,{title:r("nutrition.addMealItem"),children:b(on,{onClick:c,children:b($o,{})})}),b(Do,{title:r("nutrition.addNutritionalDiary"),children:b(on,{onClick:f,children:b(g0,{})})})]}),b(Ls,{in:s,timeout:"auto",unmountOnExit:!0,children:Q(Pi,{sx:{paddingY:0},children:[b("p",{children:b("b",{children:r("nutrition.addMealItem")})}),b(Lue,{planId:e.planId,mealId:e.meal.id,closeFn:c})]})}),b(Ls,{in:u,timeout:"auto",unmountOnExit:!0,children:Q(Pi,{sx:{paddingY:0},children:[b("p",{children:b("b",{children:r("nutrition.addNutritionalDiary")})}),b(fz,{closeFn:f,planId:e.planId,mealId:e.meal.id!==O1?e.meal.id:null})]})})]})},iX=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("nutrition.macronutrient")}),b(Te,{align:"right",children:t("total")}),b(Te,{align:"right",children:t("nutrition.percentEnergy")})]})}),Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("nutrition.energy")}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.values.energy,n.language),kj:wi(e.values.energyKj,n.language)})}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.protein")}),b(Te,{align:"right",children:Rn(e.values.protein,n.language)}),b(Te,{align:"right",children:LM(e.values.percent.protein,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.carbohydrates")}),b(Te,{align:"right",children:Rn(e.values.carbohydrates,n.language)}),b(Te,{align:"right",children:LM(e.values.percent.carbohydrates,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),b(Te,{align:"right",children:Rn(e.values.carbohydratesSugar,n.language)}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fat")}),b(Te,{align:"right",children:Rn(e.values.fat,n.language)}),b(Te,{align:"right",children:LM(e.values.percent.fat,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{pl:5},children:t("nutrition.ofWhichSaturated")}),b(Te,{align:"right",children:Rn(e.values.fatSaturated,n.language)}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.others")}),b(Te,{children:" "}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fibres")}),b(Te,{align:"right",children:Rn(e.values.fiber,n.language)}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.sodium")}),b(Te,{align:"right",children:Rn(e.values.sodium,n.language)}),b(Te,{align:"right"})]})]})]})})},Hvt=e=>{const t=yMe(e.plan.id),n=zu(),[r,o]=Re(),[i,a]=X.useState(null),[s,l]=X.useState(!1),[c,u]=X.useState(!1),d=!!i,f=O=>{a(O.currentTarget)},h=()=>{g(),C()},g=()=>{a(null)},y=()=>{E(),a(null)},v=()=>{t.mutate(e.plan.id),n(Qt(Kt.NUTRITION_OVERVIEW))},x=()=>window.location.href=Qt(Kt.NUTRITION_PLAN_PDF,o.language,{id:e.plan.id}),S=()=>window.location.href=Qt(Kt.NUTRITION_PLAN_COPY,o.language,{id:e.plan.id}),C=()=>l(!0),I=()=>l(!1),E=()=>u(!0),T=()=>u(!1);return Q(xt,{children:[b(at,{onClick:f,children:b(mz,{})}),Q(Sa,{anchorEl:i,open:d,onClose:g,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:h,children:r("edit")}),b(Ft,{onClick:x,children:r("downloadAsPdf")}),b(Ft,{onClick:S,children:r("nutrition.copyPlan")}),b(Ft,{onClick:y,children:r("delete")})]}),b(ki,{title:r("edit"),isOpen:s,closeFn:I,children:b(pz,{plan:e.plan,closeFn:I})}),b(aO,{title:r("deleteConfirmation",{name:e.plan.description}),message:r("nutrition.planDeleteInfo"),isOpen:c,closeFn:T,deleteFn:v})]})},Uvt=e=>{const[t]=Re(),n=e.plan.plannedNutritionalValues,r=e.plan.loggedNutritionalValuesToday,o=e.plan.percentageValuesLoggedToday;return b(xt,{children:Q(_t,{direction:"column",spacing:1,children:[b(tt,{gutterBottom:!0,variant:"h6",children:t("nutrition.goalsTitle")}),b(Gm,{title:t("nutrition.protein"),percentage:o.protein,logged:r.protein,planned:n.protein}),b(Gm,{title:t("nutrition.carbohydrates"),percentage:o.carbohydrates,logged:r.carbohydrates,planned:n.carbohydrates}),b(Gm,{title:t("nutrition.fat"),percentage:o.fat,logged:r.fat,planned:n.fat})]})})},Wvt=()=>{const[e]=Re(),t=Ea(),n=parseInt(t.planId??"");if(Number.isNaN(n))return b("p",{children:"Please pass an integer as the nutritional plan id."});const r=hMe(n),[o,i]=w.useState(!1),a=()=>i(!o),s=r.data;return r.isLoading?b(wr,{}):b(es,{title:s.description,optionsMenu:b(Hvt,{plan:s}),mainContent:b(xt,{children:Q(_t,{spacing:2,children:[s.meals.map(l=>b(oX,{meal:l,planId:s.id,onlyLogging:s.onlyLogging},l.id)),b(oX,{meal:r.data.pseudoMealOthers(e("nutrition.pseudoMealTitle")),planId:s.id,onlyLogging:!0},-1),!s.onlyLogging&&Q(xt,{children:[b(Do,{title:e("nutrition.addMeal"),children:b(on,{onClick:a,children:b($o,{})})}),Q(Ls,{in:o,timeout:"auto",unmountOnExit:!0,children:[b("p",{children:b("b",{children:e("nutrition.addMeal")})}),b(Nue,{planId:s.id,closeFn:a})]})]}),b(iX,{values:s.plannedNutritionalValues}),s.hasAnyPlanned&&b($vt,{data:s.plannedNutritionalValues}),b(tt,{gutterBottom:!0,variant:"h4",children:e("nutrition.logged")}),b(Nvt,{showPlanned:s.hasAnyPlanned,planned:s.plannedNutritionalValues,today:s.loggedNutritionalValuesToday,avg7Days:s.loggedNutritionalValues7DayAvg}),b(iX,{values:s.loggedNutritionalValuesToday}),b(Lvt,{planId:s.id,logged:s.groupDiaryEntries,planned:s.plannedNutritionalValues})]})}),sideBar:b(Uvt,{plan:s}),fab:b(jvt,{plan:s})})},Gvt=()=>{var n;const e=fMe(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("nutrition.plans"),mainContent:Q(_t,{spacing:2,children:[((n=e.data)==null?void 0:n.length)===0&&b(ih,{}),b(Kvt,{plans:e.data})]}),fab:b(Fvt,{})})},qvt=e=>{const[t,n]=Re(),r=Qt(Kt.NUTRITION_DETAIL,n.language,{id:e.plan.id});return Q(xt,{children:[b(Ka,{sx:{p:0},children:Q(mf,{component:"a",href:r,children:[b(uo,{primary:e.plan.description!==""?e.plan.description:t("routines.routine"),secondary:e.plan.creationDate.toLocaleDateString()}),b(sle,{})]})}),b(Ti,{component:"li"})]})},Kvt=e=>b(Kr,{children:b(xa,{sx:{py:0},children:e.plans.map(t=>b(qvt,{plan:t},t.id))},"abc")});function Ru(e){const[t,n]=Za(e.fieldName),r=e.fullwidth??!0;return b(tn,{fullWidth:r,id:e.fieldName,label:e.title,variant:"standard",error:n.touched&&!!n.error,helperText:n.touched&&n.error,...t,...e.fieldProps})}const Yvt=e=>{const{t}=Re(),n=U0(e.routineId),r=[{value:"normal",label:t("routines.set.normalSet")},{value:"dropset",label:t("routines.set.dropSet")},{value:"myo",label:t("routines.set.myo")},{value:"partial",label:t("routines.set.partial")},{value:"forced",label:t("routines.set.forced")},{value:"tut",label:t("routines.set.tut")},{value:"iso",label:t("routines.set.iso")},{value:"jump",label:t("routines.set.jump")}],o=i=>{n.mutate({id:e.slotEntry.id,type:i})};return b(xt,{children:b(tn,{fullWidth:!0,select:!0,label:t("routines.set.type"),variant:"standard",value:e.slotEntry.type,disabled:n.isPending,onChange:i=>o(i.target.value),children:r.map(i=>b(Ft,{value:i.value,children:i.label},i.value))})})},Qvt=e=>{var a;const{t}=Re(),n=U0(e.routineId),r=crt();if(r.isLoading)return b(zp,{});const o=(a=r.data)==null?void 0:a.map(s=>({value:s.id,label:s.name})),i=s=>{n.mutate({id:e.slotEntry.id,repetition_unit:parseInt(s)})};return b(xt,{children:b(tn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.repetitionUnitId,disabled:n.isPending,onChange:s=>i(s.target.value),children:o.map(s=>b(Ft,{value:s.value,children:s.label},s.value))})})},Xvt=e=>{var s;const{t}=Re(),n=U0(e.routineId),r=lrt(),o=Pa();if(r.isLoading||o.isLoading)return b(zp,{});const i=(s=r.data)==null?void 0:s.map(l=>({value:l.id,label:l.name})),a=l=>{n.mutate({id:e.slotEntry.id,weight_unit:parseInt(l)})};return b(xt,{children:b(tn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.weightUnitId,disabled:n.isPending,onChange:l=>a(l.target.value),children:i.map(l=>b(Ft,{value:l.value,children:l.label},l.value))})})};function Jvt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}const WP=e=>{const{t}=Re(),n=U0(e.routineId),r=Avt(),[o,i]=w.useState(e.initialValue===null?"":e.initialValue),a=w.useCallback(Jvt(l=>{let c=parseFloat(l);Number.isNaN(c)&&(c=null);const u=e.rounding==="weight"?{weight_rounding:c}:{reps_rounding:c};e.editProfile?r.mutate(u):n.mutate({id:e.entryId,...u})},nte),[]),s=l=>{i(l),a(l)};return b(tn,{fullWidth:!0,label:e.rounding==="weight"?t("weight"):t("routines.reps"),variant:"standard",value:o,disabled:n.isPending||r.isPending,onChange:l=>s(l.target.value)})},Zz=({routine:e,closeFn:t})=>{const[n,r]=Re(),o=Tnt(),i=tle(e==null?void 0:e.id),a=zu(),[s,l]=w.useState(e?yt.fromJSDate(e.start):yt.now()),[c,u]=w.useState(e?yt.fromJSDate(e.end):yt.now().plus({weeks:WDe})),d=c.diff(s,["weeks","days"]),f=Math.floor(d.weeks),h=Math.floor(d.days),g=_o({name:Ro().required().max(p3,n("forms.maxLength",{chars:p3})).min(f3,n("forms.minLength",{chars:f3})),description:Ro().max(h3,n("forms.maxLength",{chars:h3})),start:wc().required(),end:wc().required().min(dz("start"),n("forms.endBeforeStart")).test("hasMinimumDuration",n("routines.minLengthRoutine",{number:m3}),function(y){const v=this.parent.start;if(v&&y){const x=yt.fromJSDate(v);return yt.fromJSDate(y).diff(x,"weeks").weeks>=m3}return!0}).test("hasMaximumDuration",n("routines.maxLengthRoutine",{number:g3}),function(y){const v=this.parent.start;if(v&&y){const x=yt.fromJSDate(v);return yt.fromJSDate(y).diff(x,"weeks").weeks<=g3}return!0}),fitInWeek:mu()});return b(ci,{initialValues:{name:e?e.name:"",description:e?e.description:"",start:s,end:c,fitInWeek:e?e.fitInWeek:!0},validationSchema:g,onSubmit:async y=>{var v,x,S,C;if(e)i.mutate({...y,fit_in_week:y.fitInWeek,start:(v=y.start)==null?void 0:v.toISODate(),end:(x=y.end)==null?void 0:x.toISODate(),id:e.id});else{const I=await o.mutateAsync({...y,fit_in_week:y.fitInWeek,start:(S=y.start)==null?void 0:S.toISODate(),end:(C=y.end)==null?void 0:C.toISODate()});a(Qt(Kt.ROUTINE_EDIT,r.language,{id:I.id})),t&&t()}},children:y=>b(Zo,{children:Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:5},children:b(Ru,{fieldName:"name",title:n("name")})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:r.language,children:b(kx,{defaultValue:yt.now(),label:n("start"),value:s,onChange:v=>{v&&(y.setFieldValue("start",v),l(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start?String(y.errors.start):""}}})})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:r.language,children:b(kx,{defaultValue:yt.now(),label:n("end"),value:c,onChange:v=>{v&&(y.setFieldValue("end",v),u(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end?String(y.errors.end):""}}})})}),b(ye,{size:{xs:12,sm:1},sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},children:h===0?n("durationWeeks",{number:f}):n("durationWeeksDays",{nrWeeks:f,nrDays:h})}),b(ye,{size:12,children:b(Ru,{fieldName:"description",title:n("description"),fieldProps:{multiline:!0,rows:4}})}),Q(ye,{size:12,children:[b(ba,{control:b(li,{checked:y.values.fitInWeek,...y.getFieldProps("fitInWeek")}),label:n("routines.fitDaysInWeek")}),b(Do,{title:n("routines.fitDaysInWeekHelpText"),children:b(on,{size:"small",children:b(Dx,{fontSize:"inherit"})})})]}),b(ye,{size:12,children:b(at,{disabled:y.isSubmitting,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("save")})})]})})})},Zvt=e=>{const t=Pa(),{t:n}=Re(),[r,o]=X.useState(null),i=!!r,a=l=>{o(l.currentTarget)},s=()=>{o(null)};return Q(_t,{direction:"row",children:[b(at,{variant:"text",id:"basic-button","aria-controls":i?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":i?"true":void 0,onClick:a,children:n("routines.defaultRounding")}),Q(Sa,{id:"basic-menu",anchorEl:r,open:i,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{children:b(WP,{routineId:e.routineId,rounding:"weight",editProfile:!0,initialValue:t.data.weightRounding})}),b(Ft,{children:b(WP,{routineId:e.routineId,rounding:"reps",editProfile:!0,initialValue:t.data.repetitionsRounding})})]}),b(Do,{title:n("routines.roundingHelp"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]})},ebt=()=>b(ye,{container:!0,children:b(ye,{size:6,offset:3,children:b(Zz,{})})}),tbt=e=>{const{t}=Re(),n=tle(e.routine.id),[r,o]=w.useState(e.routine.isTemplate),[i,a]=w.useState(e.routine.isPublic),s=u=>{const d=u&&i;o(u),a(d),c(u,d)},l=u=>{const d=u&&r;a(d),c(r,d)},c=(u,d)=>{n.mutate({id:e.routine.id,is_template:u,is_public:d})};return Q(ye,{container:!0,spacing:2,children:[b(ye,{size:12,children:Q(_t,{children:[b(ba,{disabled:n.isPending,control:b(li,{checked:r,onChange:async()=>s(!r)}),label:t("routines.template")}),b(tt,{variant:"caption",children:t("routines.templatesHelpText")})]})}),b(ye,{size:12,children:Q(_t,{children:[b(ba,{disabled:n.isPending||!r,control:b(li,{checked:i,onChange:async()=>l(!i)}),label:t("routines.publicTemplate")}),b(tt,{variant:"caption",children:t("routines.publicTemplateHelpText")})]})})]})},nbt=e=>{const t=zu(),n=Ont(e.routine.id),[r,o]=Re(),[i,a]=w.useState(null),[s,l]=w.useState(0),c=!!i,u=v=>{a(v.currentTarget)},d=()=>{l(1),y()},f=()=>{l(2),y()},h=async()=>{await n.mutateAsync(),t(Qt(Kt.ROUTINE_OVERVIEW,o.language))},g=()=>{l(0)},y=()=>{a(null)};return Q("div",{children:[b(at,{onClick:u,children:b(mz,{})}),Q(Sa,{anchorEl:i,open:c,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[!e.routine.isTemplate&&b(Ft,{component:io,to:Qt(Kt.ROUTINE_EDIT,o.language,{id:e.routine.id}),children:r("edit")}),b(Ft,{component:io,to:Qt(Kt.ROUTINE_DETAIL_TABLE,o.language,{id:e.routine.id}),children:"Table view"}),b(Ft,{component:io,to:Qt(Kt.ROUTINE_LOGS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.logsOverview")}),b(Ft,{component:io,to:Qt(Kt.ROUTINE_STATS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.statsOverview")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_COPY,o.language,{id:e.routine.id}),children:r("routines.duplicate")}),b(Ft,{onClick:f,children:r("routines.markAsTemplate")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_PDF_TABLE,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-table.pdf`,children:r("routines.downloadPdfTable")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_PDF_LOGS,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-logs.pdf`,children:r("routines.downloadPdfLogs")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_ICAL,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-calendar.ics`,children:r("routines.downloadIcal")}),b(Ti,{}),b(Ft,{onClick:d,children:r("delete")})]}),Q($w,{open:s===1,onClose:g,children:[b(cE,{id:"alert-dialog-title",children:r("delete")}),b(Lw,{children:b(N4,{id:"alert-dialog-description",children:r("deleteConfirmation",{name:e.routine.name})})}),Q(Nw,{children:[b(at,{onClick:g,children:r("cancel")}),b(at,{onClick:h,color:"error",autoFocus:!0,children:r("delete")})]})]}),Q($w,{open:s===2,onClose:g,children:[b(cE,{children:r("routines.markAsTemplate")}),b(Lw,{children:b(N4,{children:b(tbt,{routine:e.routine})})}),b(Nw,{children:b(at,{onClick:g,children:r("close")})})]})]})},rbt=()=>{const{t:e}=Re(),t=Ea(),n=parseInt(t.routineId??"");if(Number.isNaN(n))return b("p",{children:"Please pass an integer as the routine id."});const r=_c(n),o=r.data;return b(UT,{query:r,child:r.isSuccess&&b(es,{title:o.name,subTitle:`${o.start.toLocaleDateString()} - ${o.end.toLocaleDateString()} (${o.durationText})`,optionsMenu:Q(xt,{children:[o.isTemplate&&b(Pu,{label:e("routines.template"),size:"small"}),b(nbt,{routine:r.data})]}),mainContent:Q(_t,{spacing:2,children:[o.description!==""&&b(tt,{variant:"body2",sx:{whiteSpace:"pre-line"},children:o==null?void 0:o.description}),o.dayDataCurrentIteration.filter(i=>i.day!==null).map((i,a)=>b(Cz,{routineId:n,dayData:i},a))]}),sideBar:Q(_t,{children:[b(en,{height:40}),Q(ye,{container:!0,children:[b(ye,{size:6,children:b(zl,{primaryMuscles:o.mainMuscles.filter(i=>i.isFront),secondaryMuscles:o.secondaryMuscles.filter(i=>i.isFront),isFront:!0})}),b(ye,{size:6,children:b(zl,{primaryMuscles:o.mainMuscles.filter(i=>!i.isFront),secondaryMuscles:o.secondaryMuscles.filter(i=>!i.isFront),isFront:!1})})]})]})})})},obt=()=>{const{t:e,i18n:t}=Re(),n=Ea(),r=n.routineId?parseInt(n.routineId):0,o=_c(r),i=ele(r),[a,s]=X.useState(!1);return b(UT,{query:o,child:o.isSuccess&&b(J0,{title:o.data.name,backToUrl:Qt(Kt.ROUTINE_DETAIL,t.language,{id:r}),maxWidth:!1,children:Q(_t,{children:[b(ba,{control:b(li,{checked:a,onChange:(l,c)=>s(c)}),label:e("routines.alsoShowLogs")}),b(Fue,{routine:o.data,showLogs:a,logData:i.data})]})})})},ibt=Oz({stickyColumn:{position:"sticky",left:0,zIndex:1},stickyHeader:{position:"sticky",top:0,zIndex:2,background:"white"},whiteBg:{backgroundColor:"white"}});function abt(e,t,n){return e==null?null:t!=null&&n!==null&&n!==void 0?e<t?"lower":e>n?"higher":"match":t!=null?e<t?"lower":e>t?"higher":"match":null}const Fue=e=>{const{t,i18n:n}=Re(),r=Lr(),o=ibt(),i=$c(),a=e.showLogs??!1,s=e.logData??[];let l;i.isSuccess&&(l=Tu(n.language,i.data));const c={};for(const x of s)for(const S of x.logs)S.iteration!==null&&(c[S.iteration]||(c[S.iteration]=[]),c[S.iteration].push(S));const u=Object.keys(e.routine.groupedDayDataByIteration).map(x=>parseInt(x));function d(){return b(Zt,{children:u.map(x=>{const S=x===1?b(Te,{className:o.stickyColumn}):null;return Q(X.Fragment,{children:[S,b(Te,{align:"center",children:t("routines.sets")}),b(Te,{align:"center",sx:{minWidth:40},children:t("routines.reps")}),b(Te,{align:"center",sx:{minWidth:40},children:t("weight")}),b(Te,{align:"center",sx:{minWidth:60},children:t("routines.restTime")}),b(Te,{align:"center",sx:{minWidth:40},children:t("routines.rir")})]},`header-${x}`)})})}function f(){return b(Zt,{children:u.map(x=>{const S=x===1?b(Te,{className:o.stickyColumn}):null;return Q(X.Fragment,{children:[S,b(Te,{colSpan:5,children:b(tt,{variant:"h6",children:t("routines.weekNr",{number:x})})})]},`header-iteration-${x}`)})})}function h(x,S){var E;const C={borderBottomWidth:a?0:null,minWidth:40};function I(T,O,A){return Q(xt,{children:[T===null||O===null?"-/-":O,T!==null&&A!==null&&Q(xt,{children:[" - ",A]})]})}return Q(Zt,{children:[b(Te,{className:o.stickyColumn,sx:{minWidth:150,backgroundColor:"white",borderBottomWidth:a?0:null},children:(E=x.exercise)==null?void 0:E.getTranslation(l).name}),u.map(T=>{const O=e.routine.getSetConfigData(S.id,T,x.id);return Q(X.Fragment,{children:[b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.nrOfSets,O==null?void 0:O.maxNrOfSets)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.repetitions,O==null?void 0:O.maxRepetitions)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.weight,O==null?void 0:O.maxWeight)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.restTime,O==null?void 0:O.maxRestTime)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.rir,O==null?void 0:O.maxRir)})]},T)})]})}function g(x,S,C,I){const E=abt(x,S,C);x===105&&console.log(x,S,C,I,E);const T=17;return I=I??!0,E===null?null:E==="lower"?b(qrt,{sx:{fontSize:T},color:I?"error":"success"}):E==="higher"?b(jrt,{sx:{fontSize:T},color:I?"success":"error"}):b(Drt,{sx:{fontSize:T},color:"success"})}function y(x,S){return Q(Zt,{children:[b(Te,{sx:{verticalAlign:"top",backgroundColor:"white"},className:o.stickyColumn,children:b("small",{children:t("nutrition.logged")})}),u.map(C=>{const I=e.routine.getSetConfigData(S.id,C,x.id),T=(c[C]??[]).filter(O=>O.slotEntryId===x.id);return Q(X.Fragment,{children:[b(Te,{align:"center",sx:{verticalAlign:"top"}}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.repetitions??"-/-",g(O.repetitions,I==null?void 0:I.repetitions,I==null?void 0:I.maxRepetitions)]})},A))}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.weight??"-/-",g(O.weight,I==null?void 0:I.weight,I==null?void 0:I.maxWeight)]})},A))}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.restTime??"-/-",g(O.restTime,I==null?void 0:I.restTime,I==null?void 0:I.maxRestTime)]})},A))}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.rir??"-/-",g(O.rir,I==null?void 0:I.rir,I==null?void 0:I.maxRir,!1)]})},A))})]},C)})]})}function v(){return b(xt,{children:e.routine.days.map(x=>Q(X.Fragment,{children:[Q(Zt,{children:[b(Te,{sx:{backgroundColor:r.palette.action.hover},className:o.stickyColumn,children:b("b",{children:x.getDisplayName()})}),b(Te,{sx:{backgroundColor:r.palette.action.hover},colSpan:5*u.length})]}),x.slots.map((S,C)=>b(X.Fragment,{children:S.entries.map((I,E)=>Q(X.Fragment,{children:[h(I,x),a&&y(I,x)]},E))},C))]},x.id))})}return b(Iu,{maxWidth:!1,sx:{overflowX:"scroll",display:"flex",height:"80vh"},children:b(jl,{children:Q(Ll,{size:"small",children:[Q(Du,{className:o.stickyHeader,children:[f(),d()]}),b(Fl,{children:v()})]})})})};function $i(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var sbt=typeof Symbol=="function"&&Symbol.observable||"@@observable",aX=sbt,sX=()=>Math.random().toString(36).substring(7).split("").join("."),lbt={INIT:`@@redux/INIT${sX()}`,REPLACE:`@@redux/REPLACE${sX()}`},lX=lbt;function cbt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function jue(e,t,n){if(typeof e!="function")throw new Error($i(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error($i(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error($i(1));return n(jue)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach((v,x)=>{a.set(x,v)}))}function u(){if(l)throw new Error($i(3));return o}function d(v){if(typeof v!="function")throw new Error($i(4));if(l)throw new Error($i(5));let x=!0;c();const S=s++;return a.set(S,v),function(){if(x){if(l)throw new Error($i(6));x=!1,c(),a.delete(S),i=null}}}function f(v){if(!cbt(v))throw new Error($i(7));if(typeof v.type>"u")throw new Error($i(8));if(typeof v.type!="string")throw new Error($i(17));if(l)throw new Error($i(9));try{l=!0,o=r(o,v)}finally{l=!1}return(i=a).forEach(S=>{S()}),v}function h(v){if(typeof v!="function")throw new Error($i(10));r=v,f({type:lX.REPLACE})}function g(){const v=d;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error($i(11));function S(){const I=x;I.next&&I.next(u())}return S(),{unsubscribe:v(S)}},[aX](){return this}}}return f({type:lX.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:h,[aX]:g}}function cX(e,t){return function(...n){return t(e.apply(this,n))}}function uX(e,t){if(typeof e=="function")return cX(e,t);if(typeof e!="object"||e===null)throw new Error($i(16));const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=cX(o,t))}return n}function Bue(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function ubt(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error($i(15))};const a={getState:o.getState,dispatch:(l,...c)=>i(l,...c)},s=e.map(l=>l(a));return i=Bue(...s)(o.dispatch),{...o,dispatch:i}}}var b$={exports:{}},w$={};/**+`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{Oue(i,[...t,r],n)})},KL=e=>{if(!e)return{};const t={};return e.forEach(n=>{Oue(n,[],t)}),t},YL=(e,t,n)=>{const r=l=>t[l]??[],o=[],i=Math.max(...e.map(l=>r(l).length)),a=(l,c,u)=>Gd(r(l).slice(0,u+1),r(c).slice(0,u+1)),s=(l,c)=>!!(n!=null&&n.left&&n.left.includes(l)&&!n.left.includes(c)||n!=null&&n.right&&!n.right.includes(l)&&n.right.includes(c));for(let l=0;l<i;l+=1){const c=e.reduce((u,d)=>{const f=r(d)[l]??null;if(u.length===0)return[{columnFields:[d],groupId:f}];const h=u[u.length-1],g=h.columnFields[h.columnFields.length-1];return h.groupId!==f||!a(g,d,l)||s(g,d)?[...u,{columnFields:[d],groupId:f}]:[...u.slice(0,u.length-1),{columnFields:[...h.columnFields,d],groupId:f}]},[]);o.push(c)}return o},Ayt=["groupId","children"],Jz=e=>{let t={};return e.forEach(n=>{if(wce(n))return;const{groupId:r,children:o}=n,i=We(n,Ayt);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");const a=F({},i,{groupId:r}),s=Jz(o);if(s[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=F({},t,s,{[r]:a})}),F({},t)},Ryt=(e,t,n)=>{if(!t.columnGroupingModel)return e;const r=yu(n),o=nv(n),i=Jz(t.columnGroupingModel??[]),a=KL(t.columnGroupingModel??[]),s=YL(r,a,n.current.state.pinnedColumns??{}),l=o.length===0?0:Math.max(...o.map(c=>{var u;return((u=a[c])==null?void 0:u.length)??0}));return F({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:a,headerStructure:s,maxDepth:l}})},Dyt=(e,t)=>{const n=w.useCallback(s=>Qce(e)[s]??[],[e]),r=w.useCallback(()=>Xce(e),[e]);dn(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const i=w.useCallback(()=>{const s=KL(t.columnGroupingModel??[]);e.current.setState(l=>{var f;const c=((f=l.columns)==null?void 0:f.orderedFields)??[],u=l.pinnedColumns??{},d=YL(c,s,u);return F({},l,{columnGrouping:F({},l.columnGrouping,{headerStructure:d})})})},[e,t.columnGroupingModel]),a=w.useCallback(s=>{var y,v;const l=((v=(y=e.current).getPinnedColumns)==null?void 0:v.call(y))??{},c=yu(e),u=nv(e),d=Jz(s??[]),f=KL(s??[]),h=YL(c,f,l),g=u.length===0?0:Math.max(...u.map(x=>{var S;return((S=f[x])==null?void 0:S.length)??0}));e.current.setState(x=>F({},x,{columnGrouping:{lookup:d,unwrappedGroupingModel:f,headerStructure:h,maxDepth:g}}))},[e]);wt(e,"columnIndexChange",i),wt(e,"columnsChange",()=>{a(t.columnGroupingModel)}),wt(e,"columnVisibilityModelChange",()=>{a(t.columnGroupingModel)}),w.useEffect(()=>{a(t.columnGroupingModel)},[a,t.columnGroupingModel])};function _yt(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function QQ(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function XQ(e,t,n,r){let o=e;return r==="Right"?o+=t-n.left:o+=n.right-t,o}function $yt(e,t,n){return n==="Left"?e-t.left:t.right-e}function Nyt(e){return e==="Right"?"Left":"Right"}function Lyt(e,t){const n=e.classList.contains(oe["columnSeparator--sideRight"])?"Right":"Left";return t?Nyt(n):n}function JQ(e){e.preventDefault(),e.stopImmediatePropagation()}function Fyt(e){const t=w.useRef(void 0),n=()=>eue(e),r=Ke(e,n);return w.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=_yt()}return t.current}}function jyt(e,t){if(e.length<4)return e;const n=e.slice();n.sort((s,l)=>s-l);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],i=o-r,a=i<5?5:i*t;return n.filter(s=>s>r-a&&s<o+a)}function Byt(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(oe.autosizing),n.forEach(i=>{const s=Apt(e.current,i.field).map(g=>g.getBoundingClientRect().width??0),l=t.includeOutliers?s:jyt(s,t.outliersFactor);if(t.includeHeaders){const g=Mpt(e.current,i.field);if(g){const y=g.querySelector(`.${oe.columnHeaderTitle}`),v=g.querySelector(`.${oe.columnHeaderTitleContainerContent}`),x=g.querySelector(`.${oe.iconButtonContainer}`),S=g.querySelector(`.${oe.menuIcon}`),C=y??v,I=window.getComputedStyle(g,null),E=parseInt(I.paddingLeft,10)+parseInt(I.paddingRight,10),O=C.scrollWidth+1+E+((x==null?void 0:x.clientWidth)??0)+((S==null?void 0:S.clientWidth)??0);l.push(O)}}const c=i.minWidth!==-1/0&&i.minWidth!==void 0,u=i.maxWidth!==1/0&&i.maxWidth!==void 0,d=c?i.minWidth:0,f=u?i.maxWidth:1/0,h=l.length===0?0:Math.max(...l);r[i.field]=Ua(h,d,f)}),o.classList.remove(oe.autosizing),r}const zyt=e=>F({},e,{columnResize:{resizingColumnField:""}});function Vyt(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const Hyt=(e,t)=>{const n=Yn(),r=Lo(e,"useGridColumnResize"),o=Ks(Vyt).current,i=w.useRef(null),a=w.useRef(null),s=fa(),l=w.useRef(void 0),c=k=>{var N,B;r.debug(`Updating width to ${k} for col ${o.colDef.field}`);const M=o.columnHeaderElement.offsetWidth,R=k-M,$=k-o.initialColWidth;if($>0){const U=o.initialTotalWidth+$;(B=(N=e.current.rootElementRef)==null?void 0:N.current)==null||B.style.setProperty("--DataGrid-rowWidth",`${U}px`)}o.colDef.computedWidth=k,o.colDef.width=k,o.colDef.flex=0,o.columnHeaderElement.style.width=`${k}px`;const L=o.headerFilterElement;L&&(L.style.width=`${k}px`),o.groupHeaderElements.forEach(U=>{const G=U;let H;G.getAttribute("aria-colspan")==="1"?H=`${k}px`:H=`${G.offsetWidth+R}px`,G.style.width=H}),o.cellElements.forEach(U=>{const G=U;let H;G.getAttribute("aria-colspan")==="1"?H=`${k}px`:H=`${G.offsetWidth+R}px`,G.style.setProperty("--width",H)});const z=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);z===Cd.LEFT&&(mm(o.fillerLeft,"width",R),o.leftPinnedCellsAfter.forEach(U=>{mm(U,"left",R)}),o.leftPinnedHeadersAfter.forEach(U=>{mm(U,"left",R)})),z===Cd.RIGHT&&(mm(o.fillerRight,"width",R),o.rightPinnedCellsBefore.forEach(U=>{mm(U,"right",R)}),o.rightPinnedHeadersBefore.forEach(U=>{mm(U,"right",R)}))},u=k=>{if(x(),o.previousMouseClickEvent){const M=o.previousMouseClickEvent,R=M.timeStamp,$=M.clientX,L=M.clientY;if(k.timeStamp-R<300&&k.clientX===$&&k.clientY===L){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,k);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const M=xc(e.current.state);o.groupHeaderElements.forEach(R=>{const $=Cpt(R),L=R,N=`${$.reduce((B,U)=>M.columnVisibilityModel[U]!==!1?B+M.lookup[U].computedWidth:B,0)}px`;L.style.width=N})}s.start(0,()=>{e.current.publishEvent("columnResizeStop",null,k)})},d=(k,M,R)=>{var N;const $=e.current.rootElementRef.current;o.initialColWidth=k.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=k,o.columnHeaderElement=Spt(e.current.columnHeadersContainerRef.current,k.field);const L=$.querySelector(`.${oe.headerFilterRow} [data-field="${Uu(k.field)}"]`);L&&(o.headerFilterElement=L),o.groupHeaderElements=Ept((N=e.current.columnHeadersContainerRef)==null?void 0:N.current,k.field),o.cellElements=Ppt(o.columnHeaderElement,e.current),o.fillerLeft=IQ(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=IQ(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const z=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=z!==Cd.LEFT?[]:Ipt(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=z!==Cd.RIGHT?[]:Tpt(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=z!==Cd.LEFT?[]:Opt(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=z!==Cd.RIGHT?[]:kpt(e.current,o.columnHeaderElement,n),a.current=Lyt(M,n),i.current=$yt(R,o.columnHeaderElement.getBoundingClientRect(),a.current)},f=Qe(u),h=Qe(k=>{if(k.buttons===0){f(k);return}let M=XQ(i.current,k.clientX,o.columnHeaderElement.getBoundingClientRect(),a.current);M=Ua(M,o.colDef.minWidth,o.colDef.maxWidth),c(M);const R={element:o.columnHeaderElement,colDef:o.colDef,width:M};e.current.publishEvent("columnResize",R,k)}),g=Qe(k=>{QQ(k,l.current)&&u(k)}),y=Qe(k=>{const M=QQ(k,l.current);if(!M)return;if(k.type==="mousemove"&&k.buttons===0){g(k);return}let R=XQ(i.current,M.x,o.columnHeaderElement.getBoundingClientRect(),a.current);R=Ua(R,o.colDef.minWidth,o.colDef.maxWidth),c(R);const $={element:o.columnHeaderElement,colDef:o.colDef,width:R};e.current.publishEvent("columnResize",$,k)}),v=Qe(k=>{const M=jP(k.target,oe["columnSeparator--resizable"]);if(!M)return;const R=k.changedTouches[0];R!=null&&(l.current=R.identifier);const $=jP(k.target,oe.columnHeader),L=xpt($),z=e.current.getColumn(L);r.debug(`Start Resize on col ${z.field}`),e.current.publishEvent("columnResizeStart",{field:L},k),d(z,M,R.clientX);const N=vr(k.currentTarget);N.addEventListener("touchmove",y),N.addEventListener("touchend",g)}),x=w.useCallback(()=>{const k=vr(e.current.rootElementRef.current);k.body.style.removeProperty("cursor"),k.removeEventListener("mousemove",h),k.removeEventListener("mouseup",f),k.removeEventListener("touchmove",y),k.removeEventListener("touchend",g),setTimeout(()=>{k.removeEventListener("click",JQ,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,h,f,y,g]),S=w.useCallback(({field:k})=>{e.current.setState(M=>F({},M,{columnResize:F({},M.columnResize,{resizingColumnField:k})})),e.current.forceUpdate()},[e]),C=w.useCallback(()=>{e.current.setState(k=>F({},k,{columnResize:F({},k.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),I=Qe(({colDef:k},M)=>{if(M.button!==0||!M.currentTarget.classList.contains(oe["columnSeparator--resizable"]))return;M.preventDefault(),r.debug(`Start Resize on col ${k.field}`),e.current.publishEvent("columnResizeStart",{field:k.field},M),d(k,M.currentTarget,M.clientX);const R=vr(e.current.rootElementRef.current);R.body.style.cursor="col-resize",o.previousMouseClickEvent=M.nativeEvent,R.addEventListener("mousemove",h),R.addEventListener("mouseup",f),R.addEventListener("click",JQ,!0)}),E=Qe((k,M)=>{if(t.disableAutosize||M.button!==0)return;const R=e.current.state.columns.lookup[k.field];R.resizable!==!1&&e.current.autosizeColumns(F({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[R.field]}))}),T=Fyt(e),O=w.useRef(!1),A=w.useCallback(async k=>{var z;if(!((z=e.current.rootElementRef)==null?void 0:z.current)||O.current)return;O.current=!0;const R=xc(e.current.state),$=F({},fft,k,{columns:(k==null?void 0:k.columns)??R.orderedFields});$.columns=$.columns.filter(N=>R.columnVisibilityModel[N]!==!1);const L=$.columns.map(N=>e.current.state.columns.lookup[N]);try{!t.disableVirtualization&&$.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await T());const N=Byt(e,$,L),B=L.map(U=>F({},U,{width:N[U.field],computedWidth:N[U.field],flex:0}));if($.expand){const G=R.orderedFields.map(Y=>R.lookup[Y]).filter(Y=>R.columnVisibilityModel[Y.field]!==!1).reduce((Y,J)=>Y+(N[J.field]??J.computedWidth??J.width),0),q=e.current.getRootDimensions().viewportInnerSize.width-G;if(q>0){const Y=q/(B.length||1);B.forEach(J=>{J.width+=Y,J.computedWidth+=Y})}}e.current.updateColumns(B),B.forEach((U,G)=>{if(U.width!==L[G].width){const H=U.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(U.field),colDef:U,width:H})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),O.current=!1}},[e,T,t.disableVirtualization]);w.useEffect(()=>x,[x]),SF(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),jce(e,()=>{var k;return(k=e.current.columnHeadersContainerRef)==null?void 0:k.current},"touchstart",v,{passive:!0}),dn(e,{autosizeColumns:A},"public"),wt(e,"columnResizeStop",C),wt(e,"columnResizeStart",S),wt(e,"columnSeparatorMouseDown",I),wt(e,"columnSeparatorDoubleClick",E),er(e,"columnResize",t.onColumnResize),er(e,"columnWidthChange",t.onColumnWidthChange)};function mm(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function Uyt(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function ZQ(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const v$=(e,t,n)=>{if(!e)return null;let r=e[t.field];const o=t.rowSpanValueGetter??t.valueGetter;return o&&(r=o(r,e,t,n)),r},Nm={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},UP={firstRowIndex:0,lastRowIndex:0},Wyt=new Set([tu,"__reorder__",ZT]),eX=20,kue=(e,t,n,r,o,i,a)=>{const s=i?{}:F({},e.current.state.rowSpanning.spannedCells),l=i?{}:F({},e.current.state.rowSpanning.hiddenCells),c=i?{}:F({},e.current.state.rowSpanning.hiddenCellOriginMap);return i&&(a=UP),t.forEach(u=>{var d;if(!Wyt.has(u.field)){for(let f=o.firstRowIndex;f<o.lastRowIndex;f+=1){const h=n[f];if((d=l[h.id])!=null&&d[u.field])continue;const g=v$(h.model,u,e);if(g==null)continue;let y=h.id,v=f,x=0;const S=[];if(f===o.firstRowIndex){let I=f-1,E=n[I];for(;I>=r.firstRowIndex&&E&&v$(E.model,u,e)===g;){const T=n[I+1];l[T.id]?l[T.id][u.field]=!0:l[T.id]={[u.field]:!0},S.push(f),x+=1,y=E.id,v=I,I-=1,E=n[I]}}S.forEach(I=>{c[I]?c[I][u.field]=v:c[I]={[u.field]:v}});let C=f+1;for(;C<=r.lastRowIndex&&n[C]&&v$(n[C].model,u,e)===g;){const I=n[C];l[I.id]?l[I.id][u.field]=!0:l[I.id]={[u.field]:!0},c[C]?c[C][u.field]=v:c[C]={[u.field]:v},C+=1,x+=1}x>0&&(s[y]?s[y][u.field]=x+1:s[y]={[u.field]:x+1})}a={firstRowIndex:Math.min(a.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(a.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:s,hiddenCells:l,hiddenCellOriginMap:c,processedRange:a}},Mue=(e,t)=>{const n=Xb(t).length;if(e.pagination){const r=Uce(t);let o=eX;return r>0&&(o=r-1),{firstRowIndex:0,lastRowIndex:Math.min(o,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(eX,n)}},Gyt=(e,t,n)=>{var g;if(!t.unstable_rowSpanning)return F({},e,{rowSpanning:Nm});const r=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],i=e.rows.dataRowIdToModelLookup,a=e.columns.lookup,s=!!e.filter.filterModel.items.length||!!((g=e.filter.filterModel.quickFilterValues)!=null&&g.length);if(!r.length||!o.length||!i||!a||s)return F({},e,{rowSpanning:Nm});const l=Mue(t,n),c=r.map(y=>({id:y,model:i[y]})),u=o.map(y=>a[y]),{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h}=kue(n,u,c,l,l,!0,UP);return F({},e,{rowSpanning:{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h}})},qyt=(e,t)=>{const n=Ks(()=>e.current.state.rowSpanning!==Nm?Mue(t,e):UP),r=w.useCallback((i,a=!1)=>{const{range:s,rows:l}=qd(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(s===null||!ZQ(i))return;a&&(n.current=UP);const c=Uyt({firstRowIndex:i.firstRowIndex,lastRowIndex:Math.min(i.lastRowIndex,s.lastRowIndex+1)},n.current);if(c===null)return;const u=Wr(e),{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h,processedRange:g}=kue(e,u,l,s,c,a,n.current);n.current=g;const y=Object.keys(d).length,v=Object.keys(f).length,x=Object.keys(e.current.state.rowSpanning.spannedCells).length,S=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(a||y!==x||v!==S)||y===0&&x===0||e.current.setState(E=>F({},E,{rowSpanning:{spannedCells:d,hiddenCells:f,hiddenCellOriginMap:h}}))},[e,n,t.pagination,t.paginationMode]),o=w.useCallback(()=>{const i=sS(e);ZQ(i)&&r(i,!0)},[e,r]);wt(e,"renderedRowsIntervalChange",lp(t.unstable_rowSpanning,r)),wt(e,"sortedRowsSet",lp(t.unstable_rowSpanning,o)),wt(e,"paginationModelChange",lp(t.unstable_rowSpanning,o)),wt(e,"filteredRowsSet",lp(t.unstable_rowSpanning,o)),wt(e,"columnsChange",lp(t.unstable_rowSpanning,o)),w.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===Nm&&o():e.current.state.rowSpanning!==Nm&&e.current.setState(i=>F({},i,{rowSpanning:Nm}))},[e,o,t.unstable_rowSpanning])},Kyt=(e,t,n)=>F({},e,{listViewColumn:t.unstable_listColumn?F({},t.unstable_listColumn,{computedWidth:QL(n)}):void 0});function Yyt(e,t){const n=()=>{e.current.setState(i=>i.listViewColumn?F({},i,{listViewColumn:F({},i.listViewColumn,{computedWidth:QL(e)})}):i)},r=w.useRef(null);wt(e,"viewportInnerSizeChange",i=>{r.current!==i.width&&(r.current=i.width,n())}),wt(e,"columnVisibilityModelChange",n),On(()=>{const i=t.unstable_listColumn;i&&e.current.setState(a=>F({},a,{listViewColumn:F({},i,{computedWidth:QL(e)})}))},[e,t.unstable_listColumn]),w.useEffect(()=>{t.unstable_listView&&t.unstable_listColumn},[t.unstable_listView,t.unstable_listColumn])}function QL(e){return qo(e.current.state).viewportInnerSize.width}const Qyt=(e,t)=>{const n=vgt(e,t);return myt(n,t),uyt(n),Io(ggt,n,t),Io(fyt,n,t),Io(Igt,n,t),Io(iyt,n,t),Io(qgt,n,t),Io(ryt,n,t),Io(Bgt,n,t),Io(gyt,n,t),Io(Ygt,n,t),Io(Ngt,n,t),Io(Gyt,n,t),Io(Ogt,n,t),Io(zyt,n,t),Io(Egt,n,t),Io(Ryt,n,t),Io(Cdt,n,t),Io(Syt,n,t),Io(Iyt,n,t),Io(Kyt,n,t),Ugt(n,t),pyt(n,t),Tgt(n,t),ayt(n,t),qyt(n,t),dyt(n,t),kyt(n),Dyt(n,t),oyt(n,t),zgt(n,t),Qgt(n,t),jgt(n,t),yyt(n,t),kgt(n,t),Hyt(n,t),Kgt(n,t),Tyt(n,t),vyt(n,t),Pgt(n),Agt(n,t),$gt(n,t),Cgt(n,t),Cyt(n,t),byt(n,t),Oyt(n),Edt(n,t),Yyt(n,t),n},Xyt=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:a,groupId:s,pinnedPosition:l}=e,c={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",a&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",s===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",l===Sn.LEFT&&"columnHeader--pinnedLeft",l===Sn.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Oe(c,kn,t)};function Jyt(e){var G;const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:a,colIndex:s,hasFocus:l,tabIndex:c,isLastColumn:u,pinnedPosition:d,pinnedOffset:f}=e,h=Rt(),g=Yn(),y=w.useRef(null),v=wn(),x=Ke(v,Xce),S=t?x[t]:{},{headerName:C=t??"",description:I="",headerAlign:E=void 0}=S;let T;const O=t&&((G=x[t])==null?void 0:G.renderHeaderGroup),A=w.useMemo(()=>({groupId:t,headerName:C,description:I,depth:r,maxDepth:o,fields:i,colIndex:s,isLastColumn:u}),[t,C,I,r,o,i,s,u]);t&&O&&(T=O(A));const k=F({},e,{classes:h.classes,headerAlign:E,depth:r,isDragging:!1}),M=C??t,R=Dn(),$=t===null?`empty-group-cell-${R}`:t,L=Xyt(k);w.useLayoutEffect(()=>{if(l){const K=y.current.querySelector('[tabindex="0"]')||y.current;K==null||K.focus()}},[v,l]);const z=w.useCallback(H=>K=>{lS(K)||v.current.publishEvent(H,A,K)},[v,A]),N=w.useMemo(()=>({onKeyDown:z("columnGroupHeaderKeyDown"),onFocus:z("columnGroupHeaderFocus"),onBlur:z("columnGroupHeaderBlur")}),[z]),B=typeof S.headerClassName=="function"?S.headerClassName(A):S.headerClassName,U=w.useMemo(()=>iO(F({},e.style),g,d,f),[d,f,e.style,g]);return _.jsx(mue,F({ref:y,classes:L,columnMenuOpen:!1,colIndex:s,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:c,isDraggable:!1,headerComponent:T,headerClassName:B,description:I,elementId:$,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:M,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:U},N))}const tX=se("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),Zyt=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:a,columnGroupHeaderFocus:s,headerGroupingMaxDepth:l,columnMenuState:c,columnVisibility:u,columnGroupsHeaderStructure:d,hasOtherElementInTabSequence:f}=e,[h,g]=w.useState(""),[y,v]=w.useState(""),x=ts(),S=Rt(),C=Ke(x,Qce),I=Ke(x,If),E=Ke(x,Sdt),T=Ke(x,rv),O=Ke(x,Hu),A=rue(I,E,T.left.length),k=Ke(x,QT),M=Ke(x,fce),R=Ke(x,Olt),$=Ke(x,klt),L=Ke(x,pce),z=w.useCallback(te=>v(te.field),[]),N=w.useCallback(()=>v(""),[]),B=w.useCallback(te=>g(te.field),[]),U=w.useCallback(()=>g(""),[]),G=w.useMemo(()=>T.left.length?{firstColumnIndex:0,lastColumnIndex:T.left.length}:null,[T.left.length]),H=w.useMemo(()=>T.right.length?{firstColumnIndex:t.length-T.right.length,lastColumnIndex:t.length}:null,[T.right.length,t.length]);wt(x,"columnResizeStart",z),wt(x,"columnResizeStop",N),wt(x,"columnHeaderDragStart",B),wt(x,"columnHeaderDragEnd",U);const K=te=>{const{renderContext:ce=E}=te||{},ae=ce.firstColumnIndex,ne=ce.lastColumnIndex;return{renderedColumns:t.slice(ae,ne),firstColumnToRender:ae,lastColumnToRender:ne}},q=(te,ce,ae,ne=!1)=>{const ue=(te==null?void 0:te.position)===Sn.RIGHT,he=(te==null?void 0:te.position)===void 0,re=T.right.length>0&&ue||T.right.length===0&&he,le=A-ae;return _.jsxs(w.Fragment,{children:[he&&_.jsx("div",{role:"presentation",style:{width:le}}),ce,he&&_.jsx("div",{role:"presentation",className:fe(oe.filler,ne&&oe["filler--borderBottom"])}),re&&_.jsx(Yz,{header:!0,pinnedRight:ue,borderBottom:ne,borderTop:!1})]})},Y=(te,ce={})=>{const{renderedColumns:ae,firstColumnToRender:ne}=K(te),ue=[];for(let he=0;he<ae.length;he+=1){const re=ae[he],le=ne+he,me=le===0,Se=o!==null&&o.field===re.field||me&&!f?0:-1,Ee=a!==null&&a.field===re.field,ge=c.open&&c.field===re.field,xe=te==null?void 0:te.position,Pe=Ew(xe,re.computedWidth,le,I,k,L),_e=xe===Sn.RIGHT?ae[he-1]:ae[he+1],Le=_e?a!==null&&a.field===_e.field:!1,de=le+1===I.length-T.right.length,$e=he,Ae=ae.length,Ne=VP(xe,$e),Ue=zP(xe,$e,Ae,S.showColumnVerticalBorder,M);ue.push(_.jsx(Upt,F({},n[re.field],{columnMenuOpen:ge,filterItemsCounter:r[re.field]&&r[re.field].length,headerHeight:R,isDragging:re.field===h,colDef:re,colIndex:le,isResizing:y===re.field,isLast:le===I.length-1,hasFocus:Ee,tabIndex:Se,pinnedPosition:xe,pinnedOffset:Pe,isLastUnpinned:de,isSiblingFocused:Le,showLeftBorder:Ne,showRightBorder:Ue},ce),re.field))}return q(te,ue,0)},J=()=>_.jsxs(tX,{role:"row","aria-rowindex":l+1,ownerState:S,className:oe["row--borderBottom"],children:[G&&Y({position:Sn.LEFT,renderContext:G},{disableReorder:!0}),Y({renderContext:E}),H&&Y({position:Sn.RIGHT,renderContext:H},{disableReorder:!0,separatorSide:Kz.Left})]}),ie=({depth:te,params:ce})=>{var Ae,Ne;const ae=K(ce);if(ae.renderedColumns.length===0)return null;const{firstColumnToRender:ne,lastColumnToRender:ue}=ae,he=d[te],re=t[ne].field,le=((Ae=C[re])==null?void 0:Ae[te])??null,me=he.findIndex(({groupId:Ue,columnFields:Ze})=>Ue===le&&Ze.includes(re)),Se=t[ue-1].field,Ee=((Ne=C[Se])==null?void 0:Ne[te])??null,ge=he.findIndex(({groupId:Ue,columnFields:Ze})=>Ue===Ee&&Ze.includes(Se)),xe=he.slice(me,ge+1).map(Ue=>F({},Ue,{columnFields:Ue.columnFields.filter(Ze=>u[Ze]!==!1)})).filter(Ue=>Ue.columnFields.length>0),Pe=xe[0].columnFields.indexOf(re),Le=xe[0].columnFields.slice(0,Pe).reduce((Ue,Ze)=>{const ut=O[Ze];return Ue+(ut.computedWidth??0)},0);let de=ne;const $e=xe.map(({groupId:Ue,columnFields:Ze},ut)=>{const Ye=s!==null&&s.depth===te&&Ze.includes(s.field),et=i!==null&&i.depth===te&&Ze.includes(i.field)?0:-1,Xe={width:Ze.reduce((gt,Vt)=>gt+O[Vt].computedWidth,0),fields:Ze,colIndex:de},mt=ce.position,At=Ew(mt,Xe.width,de,I,k,L);de+=Ze.length;let Bt=ut;return mt===Sn.LEFT&&(Bt=de-1),_.jsx(Jyt,{groupId:Ue,width:Xe.width,fields:Xe.fields,colIndex:Xe.colIndex,depth:te,isLastColumn:ut===xe.length-1,maxDepth:l,height:$,hasFocus:Ye,tabIndex:et,pinnedPosition:mt,pinnedOffset:At,showLeftBorder:VP(mt,Bt),showRightBorder:zP(mt,Bt,xe.length,S.showColumnVerticalBorder,M)},ut)});return q(ce,$e,Le)};return{renderContext:E,leftRenderContext:G,rightRenderContext:H,pinnedColumns:T,visibleColumns:t,columnPositions:I,getFillers:q,getColumnHeadersRow:J,getColumnsToRender:K,getColumnGroupHeadersRows:()=>{if(l===0)return null;const te=[];for(let ce=0;ce<l;ce+=1)te.push(_.jsxs(tX,{role:"row","aria-rowindex":ce+1,ownerState:S,children:[G&&ie({depth:ce,params:{position:Sn.LEFT,renderContext:G,maxLastColumn:G.lastColumnIndex}}),ie({depth:ce,params:{renderContext:E}}),H&&ie({depth:ce,params:{position:Sn.RIGHT,renderContext:H,maxLastColumn:H.lastColumnIndex}})]},ce));return te},getPinnedCellOffset:Ew,isDragging:!!h,getInnerProps:()=>({role:"rowgroup"})}},evt=["className"],tvt=e=>{const{classes:t}=e;return Oe({root:["columnHeaders"]},kn,t)},nvt=tr("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),rvt=Nn(function(t,n){const{className:r}=t,o=We(t,evt),i=Rt(),a=tvt(i);return _.jsx(nvt,F({className:fe(a.root,r),ownerState:i},o,{role:"presentation",ref:n}))}),ovt=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],ivt=Nn(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:f,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:g}=t,y=We(t,ovt),{getInnerProps:v,getColumnHeadersRow:x,getColumnGroupHeadersRows:S}=Zyt({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:c,headerGroupingMaxDepth:u,columnMenuState:d,columnVisibility:f,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:g});return _.jsxs(rvt,F({},y,v(),{ref:n,children:[S(),x()]}))}),avt=Vu(ivt);function svt(e){return null}function lvt(e){return null}const cvt=Nn(function(t,n){const o=wn().current.getLocaleText("noResultsOverlayLabel");return _.jsx(qz,F({},t,{ref:n,children:o}))}),uvt=["sortingOrder"],dvt=w.memo(function(t){const{sortingOrder:n}=t,r=We(t,uvt),o=Rt(),[i]=n,a=i==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return a?_.jsx(a,F({},r)):null}),fvt=["native"];function pvt(e){let{native:t}=e,n=We(e,fvt);return t?_.jsx("option",F({},n)):_.jsx(Ft,F({},n))}const hvt={booleanCellTrueIcon:pht,booleanCellFalseIcon:p$,columnMenuIcon:cht,openFilterButtonIcon:nht,filterPanelDeleteIcon:p$,columnFilteredIcon:AQ,columnSelectorIcon:oht,columnUnsortedIcon:dvt,columnSortedAscendingIcon:TQ,columnSortedDescendingIcon:OQ,columnResizeIcon:iht,densityCompactIcon:aht,densityStandardIcon:sht,densityComfortableIcon:lht,exportIcon:fht,moreActionsIcon:hht,treeDataCollapseIcon:MQ,treeDataExpandIcon:kQ,groupingCriteriaCollapseIcon:MQ,groupingCriteriaExpandIcon:kQ,detailPanelExpandIcon:RQ,detailPanelCollapseIcon:uht,rowReorderIcon:DQ,quickFilterIcon:rht,quickFilterClearIcon:p$,columnMenuHideIcon:mht,columnMenuSortAscendingIcon:TQ,columnMenuSortDescendingIcon:OQ,columnMenuFilterIcon:AQ,columnMenuManageColumnsIcon:ght,columnMenuClearIcon:yht,loadIcon:dht,filterPanelAddIcon:RQ,filterPanelRemoveAllIcon:vht,columnReorderIcon:DQ},mvt=F({},hvt,{baseBadge:K0e,baseCheckbox:WSe,baseDivider:Ti,baseTextField:tn,baseFormControl:rh,baseSelect:gf,baseButton:at,baseIconButton:on,baseInputAdornment:ro,baseTooltip:Do,basePopper:pf,baseInputLabel:oh,baseSelectOption:pvt,baseChip:Pu}),gvt=F({},mvt,{cell:Dft,skeletonCell:Vft,columnHeaderFilterIconButton:eht,columnHeaderSortIcon:Jpt,columnMenu:$ht,columnHeaders:avt,detailPanels:svt,footer:Amt,footerRowCount:Gmt,toolbar:null,pinnedRows:lvt,loadingOverlay:Lmt,noResultsOverlay:cvt,noRowsOverlay:Fmt,pagination:Vmt,filterPanel:dmt,columnsPanel:Bht,columnsManagement:mmt,panel:Wht,row:Jmt}),yvt={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},vvt=gvt,bvt=e=>{const t=Ift(hn({props:e,name:"MuiDataGrid"})),n=w.useMemo(()=>F({},Alt,t.localeText),[t.localeText]),r=w.useMemo(()=>Eft({defaultSlots:vvt,slots:t.slots}),[t.slots]),o=w.useMemo(()=>Object.keys(qL).reduce((i,a)=>(i[a]=t[a]??qL[a],i),{}),[t]);return w.useMemo(()=>F({},t,o,{localeText:n,slots:r},yvt),[t,n,r,o])},wvt={hooks:{useGridAriaAttributes:Zmt,useGridRowAriaAttributes:egt}},Aue=Nn(function(t,n){var i;const r=bvt(t),o=Qyt(r.apiRef,r);return _.jsx(tgt,{privateApiRef:o,configuration:wvt,props:r,children:_.jsx(apt,F({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,(i=r.slotProps)==null?void 0:i.root,{ref:n}))})}),xvt=w.memo(Aue);Aue.propTypes={apiRef:V.shape({current:V.object.isRequired}),"aria-label":V.string,"aria-labelledby":V.string,autoHeight:V.bool,autoPageSize:V.bool,autosizeOnMount:V.bool,autosizeOptions:V.shape({columns:V.arrayOf(V.string),disableColumnVirtualization:V.bool,expand:V.bool,includeHeaders:V.bool,includeOutliers:V.bool,outliersFactor:V.number}),cellModesModel:V.object,checkboxSelection:V.bool,classes:V.object,clipboardCopyCellDelimiter:V.string,columnBufferPx:V.number,columnGroupHeaderHeight:V.number,columnGroupingModel:V.arrayOf(V.object),columnHeaderHeight:V.number,columns:V.arrayOf(V.object).isRequired,columnVisibilityModel:V.object,density:V.oneOf(["comfortable","compact","standard"]),disableAutosize:V.bool,disableColumnFilter:V.bool,disableColumnMenu:V.bool,disableColumnResize:V.bool,disableColumnSelector:V.bool,disableColumnSorting:V.bool,disableDensitySelector:V.bool,disableEval:V.bool,disableMultipleRowSelection:V.bool,disableRowSelectionOnClick:V.bool,disableVirtualization:V.bool,editMode:V.oneOf(["cell","row"]),estimatedRowCount:V.number,experimentalFeatures:V.shape({warnIfFocusStateIsNotSynced:V.bool}),filterDebounceMs:V.number,filterMode:V.oneOf(["client","server"]),filterModel:V.shape({items:V.arrayOf(V.shape({field:V.string.isRequired,id:V.oneOfType([V.number,V.string]),operator:V.string.isRequired,value:V.any})).isRequired,logicOperator:V.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:V.bool,quickFilterLogicOperator:V.oneOf(["and","or"]),quickFilterValues:V.array}),forwardedProps:V.object,getCellClassName:V.func,getDetailPanelContent:V.func,getEstimatedRowHeight:V.func,getRowClassName:V.func,getRowHeight:V.func,getRowId:V.func,getRowSpacing:V.func,hideFooter:V.bool,hideFooterPagination:V.bool,hideFooterSelectedRowCount:V.bool,ignoreDiacritics:V.bool,ignoreValueFormatterDuringExport:V.oneOfType([V.shape({clipboardExport:V.bool,csvExport:V.bool}),V.bool]),indeterminateCheckboxAction:V.oneOf(["deselect","select"]),initialState:V.object,isCellEditable:V.func,isRowSelectable:V.func,keepNonExistentRowsSelected:V.bool,loading:V.bool,localeText:V.object,logger:V.shape({debug:V.func.isRequired,error:V.func.isRequired,info:V.func.isRequired,warn:V.func.isRequired}),logLevel:V.oneOf(["debug","error","info","warn",!1]),nonce:V.string,onCellClick:V.func,onCellDoubleClick:V.func,onCellEditStart:V.func,onCellEditStop:V.func,onCellKeyDown:V.func,onCellModesModelChange:V.func,onClipboardCopy:V.func,onColumnHeaderClick:V.func,onColumnHeaderContextMenu:V.func,onColumnHeaderDoubleClick:V.func,onColumnHeaderEnter:V.func,onColumnHeaderLeave:V.func,onColumnHeaderOut:V.func,onColumnHeaderOver:V.func,onColumnOrderChange:V.func,onColumnResize:V.func,onColumnVisibilityModelChange:V.func,onColumnWidthChange:V.func,onDensityChange:V.func,onFilterModelChange:V.func,onMenuClose:V.func,onMenuOpen:V.func,onPaginationMetaChange:V.func,onPaginationModelChange:V.func,onPreferencePanelClose:V.func,onPreferencePanelOpen:V.func,onProcessRowUpdateError:V.func,onResize:V.func,onRowClick:V.func,onRowCountChange:V.func,onRowDoubleClick:V.func,onRowEditStart:V.func,onRowEditStop:V.func,onRowModesModelChange:V.func,onRowSelectionModelChange:V.func,onSortModelChange:V.func,onStateChange:V.func,pageSizeOptions:V.arrayOf(V.oneOfType([V.number,V.shape({label:V.string.isRequired,value:V.number.isRequired})]).isRequired),pagination:V.oneOf([!0]),paginationMeta:V.shape({hasNextPage:V.bool}),paginationMode:V.oneOf(["client","server"]),paginationModel:V.shape({page:V.number.isRequired,pageSize:V.number.isRequired}),processRowUpdate:V.func,resetPageOnSortFilter:V.bool,resizeThrottleMs:V.number,rowBufferPx:V.number,rowCount:V.number,rowHeight:V.number,rowModesModel:V.object,rowPositionsDebounceMs:V.number,rows:V.arrayOf(V.object),rowSelection:V.bool,rowSelectionModel:V.oneOfType([V.arrayOf(V.oneOfType([V.number,V.string]).isRequired),V.number,V.string]),rowSpacingType:V.oneOf(["border","margin"]),scrollbarSize:V.number,showCellVerticalBorder:V.bool,showColumnVerticalBorder:V.bool,slotProps:V.object,slots:V.object,sortingMode:V.oneOf(["client","server"]),sortingOrder:V.arrayOf(V.oneOf(["asc","desc"])),sortModel:V.arrayOf(V.shape({field:V.string.isRequired,sort:V.oneOf(["asc","desc"])})),sx:V.oneOfType([V.arrayOf(V.oneOfType([V.func,V.object,V.bool])),V.func,V.object]),unstable_rowSpanning:V.bool,virtualizeColumnsWithAutoRowHeight:V.bool};const Svt=e=>e.map(t=>({id:t.id,category:t.category,date:t.date,value:t.value,notes:t.notes})),Cvt=e=>{const[t]=Re(),n=Svt(e.category.entries),r=ece(),o=olt(),[i,a]=w.useState(n),[s,l]=w.useState({}),c=(S,C)=>{S.reason===fl.rowFocusOut&&(C.defaultMuiPrevented=!0)},u=S=>()=>{l({...s,[S]:{mode:ar.Edit}})},d=S=>()=>{l({...s,[S]:{mode:ar.View}})},f=S=>async()=>{console.log("deleting entry",S),o.mutate(parseInt(S.toString())),a(i.filter(C=>C.id!==S))},h=S=>()=>{l({...s,[S]:{mode:ar.View,ignoreModifications:!0}});const C=i.find(I=>I.id===S);(C==null?void 0:C.id)===null&&a(i.filter(I=>I.id!==S))},g=async S=>{r.mutate({id:S.id,categoryId:S.category,date:S.date,value:S.value,notes:S.notes});const C={...S,isNew:!1};return a(i.map(I=>I.id===S.id?C:I)),C},y=S=>{console.log(S)},v=S=>{l(S)},x=[{field:"value",headerName:t("value"),width:80,editable:!0,valueFormatter:S=>S==null?"":S+e.category.unit},{field:"date",headerName:t("date"),type:"date",width:120,editable:!0,valueFormatter:S=>S==null?"":yt.fromJSDate(S).toLocaleString(yt.DATE_MED)},{field:"notes",headerName:t("notes"),type:"string",flex:1,editable:!0},{field:"actions",type:"actions",headerName:t("actions"),width:100,cellClassName:"actions",getActions:({id:S})=>{var I;return((I=s[S])==null?void 0:I.mode)===ar.Edit?[b(c1,{icon:b(Vrt,{}),label:"Save",sx:{color:"primary.main"},onClick:d(S)}),b(c1,{icon:b(y0,{}),label:"Cancel",className:"textPrimary",onClick:h(S),color:"inherit"})]:[b(c1,{icon:b(hz,{}),label:"Edit",className:"textPrimary",onClick:u(S),color:"inherit"}),b(c1,{icon:b(kP,{}),label:"Delete",onClick:f(S),color:"inherit"})]}}];return b(en,{sx:{width:"100%"},children:b(xvt,{editMode:"row",rows:n,columns:x,initialState:{pagination:{paginationModel:{pageSize:CW.pageSize}}},pageSizeOptions:CW.pageSizeOptions,disableRowSelectionOnClick:!0,rowModesModel:s,onRowModesModelChange:v,onRowEditStop:c,processRowUpdate:g,onProcessRowUpdateError:y})})},aO=({title:e,subtitle:t,isOpen:n,message:r,deleteFn:o,closeFn:i})=>{const[a]=Re();return b(by,{open:n,onClose:i,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(fo,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"background.paper",borderWidth:0,boxShadow:24,p:2},children:[b(Vl,{title:e,titleTypographyProps:{variant:"h6"},subheader:t,action:b(y0,{onClick:i})}),b(Pi,{children:b(tt,{variant:"body1",children:r})}),Q(Ys,{children:[b(at,{color:"error",variant:"contained",onClick:()=>{o(),i()},children:a("delete")}),b(at,{color:"primary",onClick:i,children:a("close")})]})]})})},Rue=({category:e,closeFn:t})=>{const[n]=Re(),r=elt(),o=tlt(e==null?void 0:e.id),i=_o({name:Ro().required(n("forms.fieldRequired")).max(20,n("forms.maxLength",{chars:"20"})).min(3,n("forms.minLength",{chars:"3"})),unit:Ro().required(n("forms.fieldRequired")).max(5,n("forms.maxLength",{chars:"5"}))});return b(ci,{initialValues:{name:e?e.name:"",unit:e?e.unit:""},validationSchema:i,onSubmit:async a=>{e?o.mutate({...a,id:e.id}):r.mutate(a),t&&t()},children:a=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"name",label:n("name"),error:a.touched.name&&!!a.touched.name,helperText:a.touched.name&&a.errors.name,...a.getFieldProps("name")}),b(tn,{fullWidth:!0,id:"unit",label:n("unit"),error:a.touched.unit&&!!a.errors.unit,helperText:a.touched.unit&&a.errors.unit?a.errors.unit:n("measurements.unitFormHelpText"),...a.getFieldProps("unit")}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("submit")})})]})})})},Evt=e=>{const t=nlt(e.category.id),n=zu(),[r]=Re(),[o,i]=X.useState(null),[a,s]=X.useState(!1),[l,c]=X.useState(!1),u=!!o,d=I=>{i(I.currentTarget)},f=()=>{h(),v()},h=()=>{i(null)},g=()=>{S(),i(null)},y=()=>{t.mutate(e.category.id),n(Qt(Kt.MEASUREMENT_OVERVIEW))},v=()=>s(!0),x=()=>s(!1),S=()=>c(!0),C=()=>c(!1);return Q("div",{children:[b(at,{onClick:d,children:b(mz,{})}),Q(Sa,{anchorEl:o,open:u,onClose:h,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:f,children:r("edit")}),b(Ft,{onClick:g,children:r("delete")})]}),b(ki,{title:r("edit"),isOpen:a,closeFn:x,children:b(Rue,{category:e.category,closeFn:x})}),b(aO,{title:r("deleteConfirmation",{name:e.category.name}),message:r("measurements.deleteInfo"),isOpen:l,closeFn:C,deleteFn:y})]})};Hr.defaultZone=Wke;const Due=({entry:e,closeFn:t,categoryId:n})=>{const[r,o]=Re(),i=rlt(),a=ece(),s=Zle(n),[l,c]=X.useState(e?yt.fromJSDate(e.date):yt.now()),u=_o({value:wo().required(r("forms.fieldRequired")).min(0,r("forms.minValue",{value:"0"})).max(1e3,r("forms.maxValue",{value:"1000"})),date:wc().required(r("forms.fieldRequired")),notes:Ro().max(500,r("forms.maxLength",{value:"500"}))});return b(ci,{initialValues:{value:e?e.value:0,date:e?e.date:new Date,notes:e?e.notes:""},validationSchema:u,onSubmit:async d=>{e?a.mutate({...d,id:e.id}):i.mutate({...d,categoryId:n}),t&&t()},children:d=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"value",type:"number",label:r("value"),error:d.touched.value&&!!d.errors.value,helperText:d.touched.value&&d.errors.value,...d.getFieldProps("value")}),s.isLoading?b(wr,{}):b(vc,{dateAdapter:pu,adapterLocale:o.language,children:b(kx,{format:"yyyy-MM-dd",label:r("date"),value:l,disableFuture:!0,onChange:f=>{f&&d.setFieldValue("date",f.toJSDate()),c(f)},shouldDisableDate:f=>e&&co(e.date)===co(f.toJSDate())?!1:f?s.data.entries.some(h=>co(h.date)===co(f.toJSDate())):!1})}),b(tn,{fullWidth:!0,id:"notes",label:r("notes"),multiline:!0,error:d.touched.notes&&!!d.errors.notes,helperText:d.touched.notes&&d.errors.notes,...d.getFieldProps("notes")}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})]})})})},Pvt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Rue,{closeFn:o})})]})},Ivt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1),i=Ea(),a=parseInt(i.categoryId);return Q(xt,{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:s=>s.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Due,{closeFn:o,categoryId:a})})]})},d1=['"Open Sans Bold"',"sans-serif"].join(","),Tvt=['"Open Sans Light"',"sans-serif"].join(","),_ue={spacing:8,typography:{h3:{fontFamily:d1},h4:{fontFamily:d1},h5:{fontFamily:d1},h6:{fontFamily:d1},fontFamily:Tvt},palette:{primary:{main:"#2A4C7D"},secondary:{main:"#e63946"},warning:{main:"#cba328"},info:{main:"#457b9d"},success:{main:"#307916"}}},xh=l0(_ue),Ovt=e=>l0({..._ue,components:{MuiPopover:{defaultProps:{container:e}},MuiPopper:{defaultProps:{container:e}},MuiModal:{defaultProps:{container:e}}}}),$ue=e=>{const{i18n:t}=Re(),n=30,r=[...e.category.entries].sort((o,i)=>o.date.getTime()-i.date.getTime()).map(o=>({date:o.date.getTime(),value:o.value,entry:o}));return b(en,{alignItems:"center",display:"flex",flexDirection:"column",children:b(Fu,{width:"90%",height:200,children:Q(AB,{data:r,children:[b(uh,{type:"monotone",dataKey:"value",stroke:xh.palette.secondary.main,strokeWidth:2,dot:r.length>n?!1:{strokeWidth:1,r:4},activeDot:{stroke:"black",strokeWidth:1,r:6}}),b(Sf,{stroke:"#ccc",strokeDasharray:"5 5"}),b(Xa,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:o=>new Date(o).toLocaleDateString(t.language),tickCount:10}),b(Ja,{domain:["auto","auto"],unit:e.category.unit})]})})})},kvt=()=>{const e=Ea(),t=parseInt(e.categoryId??"");if(Number.isNaN(t))return b("p",{children:"Please pass an integer as the category id."});const n=Zle(t);return n.isLoading?b(wr,{}):b(es,{title:n.data.name,optionsMenu:b(Evt,{category:n.data}),mainContent:Q(_t,{spacing:2,children:[b($ue,{category:n.data}),b(Cvt,{category:n.data})]}),fab:b(Ivt,{})})},Mvt=e=>{const[t,n]=Re(),[r,o]=X.useState(!1),i=()=>o(!0),a=()=>o(!1);return Q(xt,{children:[Q(fo,{children:[b(Vl,{title:e.category.name,subheader:e.category.unit}),b(Pi,{children:b($ue,{category:e.category})}),Q(Ys,{disableSpacing:!0,sx:{justifyContent:"space-between"},children:[b(at,{size:"small",children:b(lo,{to:Qt(Kt.MEASUREMENT_DETAIL,n.language,{id:e.category.id}),children:t("seeDetails")})}),b(on,{onClick:i,children:b($o,{})})]})]}),b(ki,{title:t("add"),isOpen:r,closeFn:a,children:b(Due,{closeFn:a,categoryId:e.category.id})})]})},nX=()=>{const e=Jle(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("measurements.measurements"),mainContent:Q(_t,{spacing:2,children:[e.data.length===0&&b(ih,{}),e.data.map(n=>b(Mvt,{category:n},n.id))]}),fab:b(Pvt,{})})};function Pa(){return br({queryKey:[st.QUERY_PROFILE],queryFn:k$e})}const Avt=()=>{const e=Et();return It({mutationFn:t=>M$e(t),onSuccess:async()=>{await e.invalidateQueries({queryKey:[st.QUERY_PROFILE]})}})},W1=[{range:"obese",color:"#FF5733",min:30,max:100},{range:"overweight",color:"#FFC107",min:25,max:30},{range:"normal",color:"#90EE90",min:18.5,max:25},{range:"underweight",color:"#FFC300",min:0,max:18.5}],f1=e=>{const t=W1.find(n=>n.range===e);return t?t.color:"gray"},Rvt=()=>{const[e]=Re(),t=Y0(),n=Pa(),[r,o]=w.useState(),[i,a]=w.useState();w.useEffect(()=>{var u;if(t.data&&t.data.length>0){const d=t.data[0],f=(u=n.data)!=null&&u.useMetric?d.weight:d.weight*.453592;a(f)}},[t.data,n.data]),w.useEffect(()=>{var u;(u=n.data)!=null&&u.height&&o(n.data.height)},[n.data]);const l=(()=>{if(r&&i){const u=r/100;return i/(u*u)}return null})();if(t.isLoading||n.isLoading)return b(wr,{});const c=[];for(let u=140;u<=220;u+=10){const d=u/100,f={height:u};let h=0;W1.forEach((g,y)=>{const v=g.max>100?100:g.max;let x=v*d*d-h;x=Math.min(x,150-h),y===0?f[g.range]=x:f[g.range]=f[W1[y-1].range]+x,h=Math.min(v*d*d,150)}),c.push(f)}return b(es,{title:e("bmi.calculator"),mainContent:b(xt,{children:Q(_t,{spacing:2,children:[Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:6},children:b(tn,{label:e("height"),fullWidth:!0,slotProps:{input:{endAdornment:b(tt,{children:e("cm")})}},type:"number",value:r??"",onChange:u=>o(parseFloat(u.target.value))})}),b(ye,{size:{xs:12,sm:6},children:b(tn,{label:e("weight"),slotProps:{input:{endAdornment:b(tt,{children:e("server.kg")})}},fullWidth:!0,type:"number",value:i??"",onChange:u=>a(parseFloat(u.target.value))})})]}),l!==null&&b(tt,{variant:"h6",children:e("bmi.result",{value:l.toFixed(1)})}),b(Fu,{width:"100%",height:400,children:Q(C8e,{data:c,children:[b(Xa,{dataKey:"height",type:"number",domain:[140,220],unit:"cm"}),b(Ja,{domain:[40,150],tickFormatter:u=>Math.round(u).toString(),unit:"kg"}),b(Sf,{strokeDasharray:"3 3"}),b(ua,{formatter:(u,d)=>[Math.round(u),e("bmi."+d)]}),W1.map(u=>b(Cf,{type:"monotone",dataKey:u.range,stroke:"black",fill:u.color,fillOpacity:.8},u.range)),l!==null&&b($0,{x:r,y:i,r:8,fill:"black",stroke:"none"})]})}),Q(_t,{direction:"row",justifyContent:"center",children:[b(en,{height:20,width:20,sx:{backgroundColor:f1("obese")}}),e("bmi.obese"),b(en,{height:20,width:20,sx:{backgroundColor:f1("overweight"),marginLeft:2}}),e("bmi.overweight"),b(en,{height:20,width:20,sx:{backgroundColor:f1("normal"),marginLeft:2}}),e("bmi.normal"),b(en,{height:20,width:20,sx:{backgroundColor:f1("underweight"),marginLeft:2}}),e("bmi.underweight")]})]})})})},Dvt=e=>{var r,o,i,a;const[t,n]=Re();return Q(Zt,{children:[b(Te,{sx:{paddingX:1},children:b(Nl,{alt:(r=e.item.ingredient)==null?void 0:r.name,src:(i=(o=e.item.ingredient)==null?void 0:o.image)==null?void 0:i.url,sx:{width:45,height:45},children:b(_u,{})})}),Q(Te,{sx:{paddingX:1},children:[e.item.amountString," ",(a=e.item.ingredient)==null?void 0:a.name]}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.item.nutritionalValues.energy,n.language),kj:wi(e.item.nutritionalValues.energyKj,n.language)})}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.item.nutritionalValues.protein,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.item.nutritionalValues.carbohydrates,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.item.nutritionalValues.fat,n.language)})]},e.item.id)},XL=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{children:[b(Du,{children:Q(Zt,{children:[b(Te,{}),b(Te,{}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.energy")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.protein")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.carbohydrates")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.fat")})]})}),Q(Fl,{children:[e.items.map(r=>b(Dvt,{item:r},r.id)),e.showSum&&Q(Zt,{children:[b(Te,{sx:{paddingX:1},children:" "}),b(Te,{sx:{paddingX:1},children:t("total")}),b(Te,{align:"right",sx:{paddingX:1},children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.values.energy,n.language),kj:wi(e.values.energyKj,n.language)})}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.values.protein,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.values.carbohydrates,n.language)}),b(Te,{align:"right",sx:{paddingX:1},children:Rn(e.values.fat,n.language)})]})]})]})})},_vt=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("nutrition.macronutrient")}),b(Te,{align:"right",children:t("nutrition.planned")}),b(Te,{align:"right",children:t("nutrition.logged")}),b(Te,{align:"right",children:t("nutrition.difference")})]})}),Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("nutrition.energy")}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.planned.energy,n.language),kj:wi(e.planned.energyKj,n.language)})}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.logged.energy,n.language),kj:wi(e.logged.energyKj,n.language)})}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.logged.energy-e.planned.energy,n.language),kj:wi(e.logged.energyKj-e.planned.energyKj,n.language)})})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.protein")}),b(Te,{align:"right",children:Rn(e.planned.protein,n.language)}),b(Te,{align:"right",children:Rn(e.logged.protein,n.language)}),b(Te,{align:"right",children:Rn(e.logged.protein-e.planned.protein,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.carbohydrates")}),b(Te,{align:"right",children:Rn(e.planned.carbohydrates,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydrates,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydrates-e.planned.carbohydrates,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),b(Te,{align:"right",children:Rn(e.planned.carbohydratesSugar,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydratesSugar,n.language)}),b(Te,{align:"right",children:Rn(e.logged.carbohydratesSugar-e.planned.carbohydratesSugar,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fat")}),b(Te,{align:"right",children:Rn(e.planned.fat,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fat,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fat-e.planned.fat,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{paddingLeft:5},children:t("nutrition.ofWhichSaturated")}),b(Te,{align:"right",children:Rn(e.planned.fatSaturated,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fatSaturated,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fatSaturated-e.planned.fatSaturated,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.others")}),b(Te,{}),b(Te,{}),b(Te,{})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fibres")}),b(Te,{align:"right",children:Rn(e.planned.fiber,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fiber,n.language)}),b(Te,{align:"right",children:Rn(e.logged.fiber-e.planned.fiber,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.sodium")}),b(Te,{align:"right",children:Rn(e.planned.sodium,n.language)}),b(Te,{align:"right",children:Rn(e.logged.sodium,n.language)}),b(Te,{align:"right",children:Rn(e.logged.sodium-e.planned.sodium,n.language)})]})]})]})})},rX=()=>{const[e]=Re(),t=Ea(),n=parseInt(t.planId);if(Number.isNaN(n))return b("p",{children:"Please pass an integer as the nutritional plan id."});const r=new Date(t.date),o=mMe(n,t.date);return o.isLoading?b(wr,{}):b(es,{title:e("nutrition.nutritionalDiary"),mainContent:b(xt,{children:Q(_t,{spacing:2,children:[b(tt,{gutterBottom:!0,variant:"h4",children:r.toLocaleDateString()}),b(_vt,{logged:o.data.loggedNutritionalValuesDate(r),planned:o.data.plannedNutritionalValues}),b(XL,{values:o.data.loggedNutritionalValuesDate(r),items:o.data.loggedEntriesDate(r),showSum:!0})]})})})};function*cS(e){let t;e<=3?t=Uke:e<=5?t=Hke:t=Vke;for(const n of t)yield n}const $vt=e=>{const[t,n]=Re(),r=cS(3),o=[{name:t("nutrition.carbohydrates"),value:e.data.carbohydrates},{name:t("nutrition.protein"),value:e.data.protein},{name:t("nutrition.fat"),value:e.data.fat}],i=Math.PI/180;return b(Fu,{width:"100%",height:300,children:Q(cae,{children:[b(Rc,{data:o,labelLine:!1,label:({cx:s,cy:l,midAngle:c,innerRadius:u,outerRadius:d,payload:f})=>{const h=u+(d-u)*.4,g=s+h*Math.cos(-c*i),y=l+h*Math.sin(-c*i);return b("text",{x:g,y,fill:"white",textAnchor:"middle",dominantBaseline:"central",children:Rn(f.value,n.language)})},fill:"#8884d8",dataKey:"value",children:o.map((s,l)=>b(Ny,{fill:r.next().value},`cell-${l}`))}),b(hc,{})]})})},Nvt=({showPlanned:e,planned:t,today:n,avg7Days:r})=>{const[o,i]=Re(),a=cS(3),s=[{name:o("nutrition.protein"),planned:t.protein,today:n.protein,avg7Days:r.protein},{name:o("nutrition.carbohydrates"),planned:t.carbohydrates,today:n.carbohydrates,avg7Days:r.carbohydrates},{name:o("nutrition.sugar"),planned:t.carbohydratesSugar,today:n.carbohydratesSugar,avg7Days:r.carbohydratesSugar},{name:o("nutrition.fat"),planned:t.fat,today:n.fat,avg7Days:r.fat},{name:o("nutrition.saturatedFat"),planned:t.fatSaturated,today:n.fatSaturated,avg7Days:r.fatSaturated}];return b(Fu,{width:"100%",height:300,children:Q(lae,{data:s,margin:{top:20,right:30,left:20,bottom:5},children:[b(Sf,{strokeDasharray:"3 4"}),b(Xa,{dataKey:"name"}),b(Ja,{type:"number",orientation:"left",unit:o("nutrition.gramShort")}),b(ua,{formatter:l=>wi(l,i.language)}),b(hc,{}),e&&b(yc,{dataKey:"planned",unit:o("nutrition.gramShort"),name:o("nutrition.planned"),fill:a.next().value}),b(yc,{dataKey:"today",unit:o("nutrition.gramShort"),name:o("nutrition.today"),fill:a.next().value}),b(yc,{dataKey:"avg7Days",unit:o("nutrition.gramShort"),name:o("nutrition.7dayAvg"),fill:a.next().value})]})})},Lvt=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("date")}),b(Te,{align:"right",children:t("nutrition.logged")}),b(Te,{align:"right",children:t("nutrition.difference")})]})}),b(Fl,{children:Array.from(e.logged).map(([r])=>{var o,i;return Q(Zt,{children:[b(Te,{children:b(lo,{to:Qt(Kt.NUTRITION_DIARY,n.language,{id:e.planId,date:r}),children:new Date(r).toLocaleDateString(n.language)})}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcal",{value:wi((o=e.logged.get(r))==null?void 0:o.nutritionalValues.energy,n.language)})}),b(Te,{align:"right",children:wi(((i=e.logged.get(r))==null?void 0:i.nutritionalValues.energy)-e.planned.energy,n.language)})]},r)})})]})})},Fvt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(pz,{closeFn:o})})]})},jvt=e=>{const[t]=Re(),[n,r]=X.useState(!1),o=()=>r(!0),i=()=>r(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:o,sx:{position:"fixed",bottom:"5rem",right:a=>a.spacing(2),zIndex:9},children:b(g0,{})}),b(ki,{title:t("nutrition.addNutritionalDiary"),isOpen:n,closeFn:i,children:b(fz,{closeFn:i,planId:e.plan.id,meals:e.plan.meals})})]})},Nue=({meal:e,planId:t,closeFn:n})=>{const[r,o]=Re(),i=xMe(t),a=CMe(t),s=_o({name:Ro().required().max(25,r("forms.maxLength",{chars:"25"})).min(3,r("forms.minLength",{chars:"3"})),time:wc().required()});return b(ci,{initialValues:{name:e?e.name:"",time:e?e.time:new Date},validationSchema:s,onSubmit:async l=>{l.time instanceof Date||(l.time=l.time.toJSDate());const c={...l,time:Bw(l.time)};e?a.mutate({...c,plan:t,id:e.id}):i.mutate({...c,plan:t}),n&&n()},children:l=>b(Zo,{children:Q(_t,{spacing:2,children:[b(tn,{fullWidth:!0,id:"name",label:r("description"),error:l.touched.name&&!!l.errors.name,helperText:l.touched.name&&l.errors.name,...l.getFieldProps("name")}),b(vc,{dateAdapter:pu,adapterLocale:o.language,children:b(vL,{label:r("timeOfDay"),value:l.values.time!==null?yt.fromJSDate(l.values.time):null,onChange:c=>l.setFieldValue("time",c)})}),Q(_t,{direction:"row",justifyContent:"end",spacing:2,children:[n!==void 0&&b(at,{color:"primary",variant:"outlined",onClick:()=>n(),children:r("close")}),b(at,{disabled:i.isPending||a.isPending,color:"primary",variant:"contained",type:"submit",children:r("submit")})]})]})})})},Bvt=e=>{const[t]=Re(),n=cS(3),r=[{name:t("nutrition.energy"),value:e.logged.energy/e.planned.energy*100},{name:t("nutrition.protein"),value:e.logged.protein/e.planned.protein*100},{name:t("nutrition.carbohydrates"),value:e.logged.carbohydrates/e.planned.carbohydrates*100},{name:t("nutrition.fat"),value:e.logged.fat/e.planned.fat*100}];return b(Fu,{width:"100%",height:150,children:Q(lae,{data:r,layout:"vertical",margin:{left:60},children:[b(Sf,{strokeDasharray:"3 4"}),b(Xa,{type:"number",unit:"%"}),b(Ja,{type:"category",dataKey:"name"}),b(yc,{dataKey:"value",unit:"%",fill:n.next().value})]})})},Lue=({planId:e,item:t,mealId:n,closeFn:r})=>{const[o]=Re(),i=TMe(e),a=OMe(e),s=kMe(e),l=()=>{t&&s.mutate(t.id),r&&r()},c=_o({amount:wo().required(o("forms.fieldRequired")).max(1e3,o("forms.maxValue",{value:"1000"})).min(1,o("forms.minValue",{value:"1"})),ingredient:wo().required(o("forms.fieldRequired"))});return b(ci,{initialValues:{amount:t?t.amount:0,ingredient:t?t.ingredientId:0},validationSchema:c,onSubmit:async u=>{const d={...u,meal:n,weight_unit:null};t?a.mutate({...d,id:t.id}):i.mutate(d),r&&r()},children:u=>{var d;return b(Zo,{children:Q(_t,{spacing:2,children:[b(ZB,{callback:f=>u.setFieldValue("ingredient",f?f.data.id:null),initialIngredient:t?(d=t.ingredient)==null?void 0:d.name:null}),b(tn,{fullWidth:!0,id:"amount",label:"amount",InputProps:{endAdornment:b(ro,{position:"end",children:o("nutrition.gramShort")})},error:u.touched.amount&&!!u.errors.amount,helperText:u.touched.amount&&u.errors.amount,...u.getFieldProps("amount")}),Q(_t,{direction:"row",justifyContent:"end",spacing:2,children:[r!==void 0&&t!==void 0&&b(at,{color:"error",variant:"outlined",onClick:l,children:o("delete")}),r!==void 0&&b(at,{color:"primary",variant:"outlined",onClick:()=>r(),children:o("close")}),b(at,{color:"primary",variant:"contained",type:"submit",children:o("submit")})]})]})})}})},zvt=e=>{const t=ste(e.planId),n=SMe(e.planId),[r]=Re(),[o,i]=X.useState(!1),[a,s]=w.useState(null),[l,c]=w.useState(!1),[u,d]=w.useState(!1),f=!!a,h=A=>{s(A.currentTarget)},g=()=>{y(),S()},y=()=>{s(null)},v=()=>{I(),s(null)},x=()=>{n.mutate(e.meal.id)},S=()=>c(!0),C=()=>c(!1),I=()=>d(!0),E=()=>d(!1),T=(A,k)=>{k!=="clickaway"&&i(!1)},O=()=>{const A=e.meal.items.map(k=>({plan:e.planId,meal:e.meal.id,mealItem:k.id,ingredient:k.ingredientId,weight_unit:k.weightUnitId,datetime:new Date().toISOString(),amount:k.amount}));t.mutate(A),i(!0)};return Q(xt,{children:[!e.onlyLogging&&b(Do,{title:r("nutrition.logThisMeal"),children:b(on,{"aria-label":"settings",onClick:O,children:b(g0,{})})}),b(on,{"aria-label":"settings",onClick:h,children:b(gz,{})}),b(on,{"aria-label":"settings",onClick:e.handleExpanded,children:e.isExpanded?b(cle,{}):b(ule,{})}),Q(Sa,{anchorEl:a,open:f,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:g,children:r("edit")}),b(Ft,{onClick:v,children:r("delete")})]}),b(ki,{title:r("edit"),isOpen:l,closeFn:C,children:b(Nue,{meal:e.meal,closeFn:C,planId:e.planId})}),b(aO,{title:r("deleteConfirmation",{name:e.meal.name}),message:r("nutrition.mealDeleteInfo"),isOpen:u,closeFn:E,deleteFn:x}),b(II,{open:o,autoHideDuration:NI,onClose:T,children:b(Ii,{onClose:T,severity:"success",sx:{width:"100%"},children:r("nutrition.diaryEntrySaved")})})]})},Vvt=e=>{var o,i,a,s;const[t,n]=w.useState(!1),r=()=>n(!t);return Q(xt,{children:[Q(Ka,{children:[b(JF,{onClick:r,sx:{"&:hover":{cursor:"pointer"}},children:b(Nl,{alt:(o=e.mealItem.ingredient)==null?void 0:o.name,src:(a=(i=e.mealItem.ingredient)==null?void 0:i.image)==null?void 0:a.url,sx:{width:45,height:45},children:b(_u,{})})}),b(uo,{primary:`${e.mealItem.amountString} ${(s=e.mealItem.ingredient)==null?void 0:s.name}`})]}),b(Ls,{in:t,timeout:"auto",unmountOnExit:!0,sx:{width:"100%"},children:b(Ka,{children:b(uo,{children:b(Lue,{planId:e.planId,mealId:e.mealId,item:e.mealItem,closeFn:r})})})})]})},oX=e=>{const t=Lr(),n=e.meal.id!==O1,[r]=Re(),[o,i]=w.useState(!1),a=()=>i(!o),[s,l]=w.useState(!1),c=()=>{l(!s),d(!1)},[u,d]=w.useState(!1),f=()=>{d(!u),l(!1)};return Q(fo,{children:[b(Vl,{sx:{bgcolor:t.palette.grey[300]},action:e.meal.id!==O1&&b(zvt,{meal:e.meal,planId:e.planId,onlyLogging:e.onlyLogging,isExpanded:o,handleExpanded:a}),title:e.meal.name,subheader:e.meal.timeHHMMLocale}),Q(Pi,{sx:{paddingY:0},children:[Q(Ls,{in:o,timeout:"auto",unmountOnExit:!0,children:[!e.onlyLogging&&b(XL,{showSum:n,items:e.meal.items,values:e.meal.plannedNutritionalValues}),b(tt,{gutterBottom:!0,variant:"h6",sx:{my:2},children:r("nutrition.loggedToday")}),!e.meal.plannedNutritionalValues.isEmpty&&b(Bvt,{logged:e.meal.loggedNutritionalValuesToday,planned:e.meal.plannedNutritionalValues}),b(XL,{showSum:n,items:e.meal.diaryEntriesToday,values:e.meal.loggedNutritionalValuesToday})]}),!o&&b(xa,{children:e.meal.items.map(h=>b(Vvt,{mealItem:h,planId:e.planId,mealId:e.meal.id},h.id))})]}),Q(Ys,{children:[!e.onlyLogging&&b(Do,{title:r("nutrition.addMealItem"),children:b(on,{onClick:c,children:b($o,{})})}),b(Do,{title:r("nutrition.addNutritionalDiary"),children:b(on,{onClick:f,children:b(g0,{})})})]}),b(Ls,{in:s,timeout:"auto",unmountOnExit:!0,children:Q(Pi,{sx:{paddingY:0},children:[b("p",{children:b("b",{children:r("nutrition.addMealItem")})}),b(Lue,{planId:e.planId,mealId:e.meal.id,closeFn:c})]})}),b(Ls,{in:u,timeout:"auto",unmountOnExit:!0,children:Q(Pi,{sx:{paddingY:0},children:[b("p",{children:b("b",{children:r("nutrition.addNutritionalDiary")})}),b(fz,{closeFn:f,planId:e.planId,mealId:e.meal.id!==O1?e.meal.id:null})]})})]})},iX=e=>{const[t,n]=Re();return b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("nutrition.macronutrient")}),b(Te,{align:"right",children:t("total")}),b(Te,{align:"right",children:t("nutrition.percentEnergy")})]})}),Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("nutrition.energy")}),b(Te,{align:"right",children:t("nutrition.valueEnergyKcalKj",{kcal:wi(e.values.energy,n.language),kj:wi(e.values.energyKj,n.language)})}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.protein")}),b(Te,{align:"right",children:Rn(e.values.protein,n.language)}),b(Te,{align:"right",children:LM(e.values.percent.protein,n.language)})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.carbohydrates")}),b(Te,{align:"right",children:Rn(e.values.carbohydrates,n.language)}),b(Te,{align:"right",children:LM(e.values.percent.carbohydrates,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{pl:5},children:t("nutrition.ofWhichSugars")}),b(Te,{align:"right",children:Rn(e.values.carbohydratesSugar,n.language)}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fat")}),b(Te,{align:"right",children:Rn(e.values.fat,n.language)}),b(Te,{align:"right",children:LM(e.values.percent.fat,n.language)})]}),Q(Zt,{children:[b(Te,{sx:{pl:5},children:t("nutrition.ofWhichSaturated")}),b(Te,{align:"right",children:Rn(e.values.fatSaturated,n.language)}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.others")}),b(Te,{children:" "}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.fibres")}),b(Te,{align:"right",children:Rn(e.values.fiber,n.language)}),b(Te,{align:"right"})]}),Q(Zt,{children:[b(Te,{children:t("nutrition.sodium")}),b(Te,{align:"right",children:Rn(e.values.sodium,n.language)}),b(Te,{align:"right"})]})]})]})})},Hvt=e=>{const t=yMe(e.plan.id),n=zu(),[r,o]=Re(),[i,a]=X.useState(null),[s,l]=X.useState(!1),[c,u]=X.useState(!1),d=!!i,f=O=>{a(O.currentTarget)},h=()=>{g(),C()},g=()=>{a(null)},y=()=>{E(),a(null)},v=()=>{t.mutate(e.plan.id),n(Qt(Kt.NUTRITION_OVERVIEW))},x=()=>window.location.href=Qt(Kt.NUTRITION_PLAN_PDF,o.language,{id:e.plan.id}),S=()=>window.location.href=Qt(Kt.NUTRITION_PLAN_COPY,o.language,{id:e.plan.id}),C=()=>l(!0),I=()=>l(!1),E=()=>u(!0),T=()=>u(!1);return Q(xt,{children:[b(at,{onClick:f,children:b(mz,{})}),Q(Sa,{anchorEl:i,open:d,onClose:g,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:h,children:r("edit")}),b(Ft,{onClick:x,children:r("downloadAsPdf")}),b(Ft,{onClick:S,children:r("nutrition.copyPlan")}),b(Ft,{onClick:y,children:r("delete")})]}),b(ki,{title:r("edit"),isOpen:s,closeFn:I,children:b(pz,{plan:e.plan,closeFn:I})}),b(aO,{title:r("deleteConfirmation",{name:e.plan.description}),message:r("nutrition.planDeleteInfo"),isOpen:c,closeFn:T,deleteFn:v})]})},Uvt=e=>{const[t]=Re(),n=e.plan.plannedNutritionalValues,r=e.plan.loggedNutritionalValuesToday,o=e.plan.percentageValuesLoggedToday;return b(xt,{children:Q(_t,{direction:"column",spacing:1,children:[b(tt,{gutterBottom:!0,variant:"h6",children:t("nutrition.goalsTitle")}),b(Gm,{title:t("nutrition.protein"),percentage:o.protein,logged:r.protein,planned:n.protein}),b(Gm,{title:t("nutrition.carbohydrates"),percentage:o.carbohydrates,logged:r.carbohydrates,planned:n.carbohydrates}),b(Gm,{title:t("nutrition.fat"),percentage:o.fat,logged:r.fat,planned:n.fat})]})})},Wvt=()=>{const[e]=Re(),t=Ea(),n=parseInt(t.planId??"");if(Number.isNaN(n))return b("p",{children:"Please pass an integer as the nutritional plan id."});const r=hMe(n),[o,i]=w.useState(!1),a=()=>i(!o),s=r.data;return r.isLoading?b(wr,{}):b(es,{title:s.description,optionsMenu:b(Hvt,{plan:s}),mainContent:b(xt,{children:Q(_t,{spacing:2,children:[s.meals.map(l=>b(oX,{meal:l,planId:s.id,onlyLogging:s.onlyLogging},l.id)),b(oX,{meal:r.data.pseudoMealOthers(e("nutrition.pseudoMealTitle")),planId:s.id,onlyLogging:!0},-1),!s.onlyLogging&&Q(xt,{children:[b(Do,{title:e("nutrition.addMeal"),children:b(on,{onClick:a,children:b($o,{})})}),Q(Ls,{in:o,timeout:"auto",unmountOnExit:!0,children:[b("p",{children:b("b",{children:e("nutrition.addMeal")})}),b(Nue,{planId:s.id,closeFn:a})]})]}),b(iX,{values:s.plannedNutritionalValues}),s.hasAnyPlanned&&b($vt,{data:s.plannedNutritionalValues}),b(tt,{gutterBottom:!0,variant:"h4",children:e("nutrition.logged")}),b(Nvt,{showPlanned:s.hasAnyPlanned,planned:s.plannedNutritionalValues,today:s.loggedNutritionalValuesToday,avg7Days:s.loggedNutritionalValues7DayAvg}),b(iX,{values:s.loggedNutritionalValuesToday}),b(Lvt,{planId:s.id,logged:s.groupDiaryEntries,planned:s.plannedNutritionalValues})]})}),sideBar:b(Uvt,{plan:s}),fab:b(jvt,{plan:s})})},Gvt=()=>{var n;const e=fMe(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("nutrition.plans"),mainContent:Q(_t,{spacing:2,children:[((n=e.data)==null?void 0:n.length)===0&&b(ih,{}),b(Kvt,{plans:e.data})]}),fab:b(Fvt,{})})},qvt=e=>{const[t,n]=Re(),r=Qt(Kt.NUTRITION_DETAIL,n.language,{id:e.plan.id});return Q(xt,{children:[b(Ka,{sx:{p:0},children:Q(mf,{component:"a",href:r,children:[b(uo,{primary:e.plan.description!==""?e.plan.description:t("routines.routine"),secondary:e.plan.creationDate.toLocaleDateString()}),b(sle,{})]})}),b(Ti,{component:"li"})]})},Kvt=e=>b(Kr,{children:b(xa,{sx:{py:0},children:e.plans.map(t=>b(qvt,{plan:t},t.id))},"abc")});function Ru(e){const[t,n]=Za(e.fieldName),r=e.fullwidth??!0;return b(tn,{fullWidth:r,id:e.fieldName,label:e.title,variant:"standard",error:n.touched&&!!n.error,helperText:n.touched&&n.error,...t,...e.fieldProps})}const Yvt=e=>{const{t}=Re(),n=U0(e.routineId),r=[{value:"normal",label:t("routines.set.normalSet")},{value:"dropset",label:t("routines.set.dropSet")},{value:"myo",label:t("routines.set.myo")},{value:"partial",label:t("routines.set.partial")},{value:"forced",label:t("routines.set.forced")},{value:"tut",label:t("routines.set.tut")},{value:"iso",label:t("routines.set.iso")},{value:"jump",label:t("routines.set.jump")}],o=i=>{n.mutate({id:e.slotEntry.id,type:i})};return b(xt,{children:b(tn,{fullWidth:!0,select:!0,label:t("routines.set.type"),variant:"standard",value:e.slotEntry.type,disabled:n.isPending,onChange:i=>o(i.target.value),children:r.map(i=>b(Ft,{value:i.value,children:i.label},i.value))})})},Qvt=e=>{var a;const{t}=Re(),n=U0(e.routineId),r=crt();if(r.isLoading)return b(zp,{});const o=(a=r.data)==null?void 0:a.map(s=>({value:s.id,label:s.name})),i=s=>{n.mutate({id:e.slotEntry.id,repetition_unit:parseInt(s)})};return b(xt,{children:b(tn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.repetitionUnitId,disabled:n.isPending,onChange:s=>i(s.target.value),children:o.map(s=>b(Ft,{value:s.value,children:s.label},s.value))})})},Xvt=e=>{var s;const{t}=Re(),n=U0(e.routineId),r=lrt(),o=Pa();if(r.isLoading||o.isLoading)return b(zp,{});const i=(s=r.data)==null?void 0:s.map(l=>({value:l.id,label:l.name})),a=l=>{n.mutate({id:e.slotEntry.id,weight_unit:parseInt(l)})};return b(xt,{children:b(tn,{fullWidth:!0,select:!0,label:t("unit"),variant:"standard",value:e.slotEntry.weightUnitId,disabled:n.isPending,onChange:l=>a(l.target.value),children:i.map(l=>b(Ft,{value:l.value,children:l.label},l.value))})})};function Jvt(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}const WP=e=>{const{t}=Re(),n=U0(e.routineId),r=Avt(),[o,i]=w.useState(e.initialValue===null?"":e.initialValue),a=w.useCallback(Jvt(l=>{let c=parseFloat(l);Number.isNaN(c)&&(c=null);const u=e.rounding==="weight"?{weight_rounding:c}:{reps_rounding:c};e.editProfile?r.mutate(u):n.mutate({id:e.entryId,...u})},nte),[]),s=l=>{i(l),a(l)};return b(tn,{fullWidth:!0,label:e.rounding==="weight"?t("weight"):t("routines.reps"),variant:"standard",value:o,disabled:n.isPending||r.isPending,onChange:l=>s(l.target.value)})},Zz=({routine:e,closeFn:t})=>{const[n,r]=Re(),o=Tnt(),i=tle(e==null?void 0:e.id),a=zu(),[s,l]=w.useState(e?yt.fromJSDate(e.start):yt.now()),[c,u]=w.useState(e?yt.fromJSDate(e.end):yt.now().plus({weeks:WDe})),d=c.diff(s,["weeks","days"]),f=Math.floor(d.weeks),h=Math.floor(d.days),g=_o({name:Ro().required().max(p3,n("forms.maxLength",{chars:p3})).min(f3,n("forms.minLength",{chars:f3})),description:Ro().max(h3,n("forms.maxLength",{chars:h3})),start:wc().required(),end:wc().required().min(dz("start"),n("forms.endBeforeStart")).test("hasMinimumDuration",n("routines.minLengthRoutine",{number:m3}),function(y){const v=this.parent.start;if(v&&y){const x=yt.fromJSDate(v);return yt.fromJSDate(y).diff(x,"weeks").weeks>=m3}return!0}).test("hasMaximumDuration",n("routines.maxLengthRoutine",{number:g3}),function(y){const v=this.parent.start;if(v&&y){const x=yt.fromJSDate(v);return yt.fromJSDate(y).diff(x,"weeks").weeks<=g3}return!0}),fitInWeek:mu()});return b(ci,{initialValues:{name:e?e.name:"",description:e?e.description:"",start:s,end:c,fitInWeek:e?e.fitInWeek:!0},validationSchema:g,onSubmit:async y=>{var v,x,S,C;if(e)i.mutate({...y,fit_in_week:y.fitInWeek,start:(v=y.start)==null?void 0:v.toISODate(),end:(x=y.end)==null?void 0:x.toISODate(),id:e.id});else{const I=await o.mutateAsync({...y,fit_in_week:y.fitInWeek,start:(S=y.start)==null?void 0:S.toISODate(),end:(C=y.end)==null?void 0:C.toISODate()});a(Qt(Kt.ROUTINE_EDIT,r.language,{id:I.id})),t&&t()}},children:y=>b(Zo,{children:Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:5},children:b(Ru,{fieldName:"name",title:n("name")})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:r.language,children:b(kx,{defaultValue:yt.now(),label:n("start"),value:s,onChange:v=>{v&&(y.setFieldValue("start",v),l(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start?String(y.errors.start):""}}})})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:r.language,children:b(kx,{defaultValue:yt.now(),label:n("end"),value:c,onChange:v=>{v&&(y.setFieldValue("end",v),u(v))},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end?String(y.errors.end):""}}})})}),b(ye,{size:{xs:12,sm:1},sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},children:h===0?n("durationWeeks",{number:f}):n("durationWeeksDays",{nrWeeks:f,nrDays:h})}),b(ye,{size:12,children:b(Ru,{fieldName:"description",title:n("description"),fieldProps:{multiline:!0,rows:4}})}),Q(ye,{size:12,children:[b(ba,{control:b(li,{checked:y.values.fitInWeek,...y.getFieldProps("fitInWeek")}),label:n("routines.fitDaysInWeek")}),b(Do,{title:n("routines.fitDaysInWeekHelpText"),children:b(on,{size:"small",children:b(Dx,{fontSize:"inherit"})})})]}),b(ye,{size:12,children:b(at,{disabled:y.isSubmitting,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("save")})})]})})})},Zvt=e=>{const t=Pa(),{t:n}=Re(),[r,o]=X.useState(null),i=!!r,a=l=>{o(l.currentTarget)},s=()=>{o(null)};return Q(_t,{direction:"row",children:[b(at,{variant:"text",id:"basic-button","aria-controls":i?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":i?"true":void 0,onClick:a,children:n("routines.defaultRounding")}),Q(Sa,{id:"basic-menu",anchorEl:r,open:i,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{children:b(WP,{routineId:e.routineId,rounding:"weight",editProfile:!0,initialValue:t.data.weightRounding})}),b(Ft,{children:b(WP,{routineId:e.routineId,rounding:"reps",editProfile:!0,initialValue:t.data.repetitionsRounding})})]}),b(Do,{title:n("routines.roundingHelp"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]})},ebt=()=>b(ye,{container:!0,children:b(ye,{size:6,offset:3,children:b(Zz,{})})}),tbt=e=>{const{t}=Re(),n=tle(e.routine.id),[r,o]=w.useState(e.routine.isTemplate),[i,a]=w.useState(e.routine.isPublic),s=u=>{const d=u&&i;o(u),a(d),c(u,d)},l=u=>{const d=u&&r;a(d),c(r,d)},c=(u,d)=>{n.mutate({id:e.routine.id,is_template:u,is_public:d})};return Q(ye,{container:!0,spacing:2,children:[b(ye,{size:12,children:Q(_t,{children:[b(ba,{disabled:n.isPending,control:b(li,{checked:r,onChange:async()=>s(!r)}),label:t("routines.template")}),b(tt,{variant:"caption",children:t("routines.templatesHelpText")})]})}),b(ye,{size:12,children:Q(_t,{children:[b(ba,{disabled:n.isPending||!r,control:b(li,{checked:i,onChange:async()=>l(!i)}),label:t("routines.publicTemplate")}),b(tt,{variant:"caption",children:t("routines.publicTemplateHelpText")})]})})]})},nbt=e=>{const t=zu(),n=Ont(e.routine.id),[r,o]=Re(),[i,a]=w.useState(null),[s,l]=w.useState(0),c=!!i,u=x=>{a(x.currentTarget)},d=()=>{l(1),y()},f=()=>{l(2),y()},h=async()=>{await n.mutateAsync(),t(Qt(Kt.ROUTINE_OVERVIEW,o.language))},g=()=>{l(0)},y=()=>{a(null)},v=()=>window.location.href=Qt(Kt.ROUTINE_EDIT,o.language,{id:e.routine.id});return Q("div",{children:[b(at,{onClick:u,children:b(mz,{})}),Q(Sa,{anchorEl:i,open:c,onClose:y,MenuListProps:{"aria-labelledby":"basic-button"},children:[!e.routine.isTemplate&&b(Ft,{onClick:v,children:r("edit")}),b(Ft,{component:lo,to:Qt(Kt.ROUTINE_DETAIL_TABLE,o.language,{id:e.routine.id}),children:"Table view"}),b(Ft,{component:lo,to:Qt(Kt.ROUTINE_LOGS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.logsOverview")}),b(Ft,{component:lo,to:Qt(Kt.ROUTINE_STATS_OVERVIEW,o.language,{id:e.routine.id}),children:r("routines.statsOverview")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_COPY,o.language,{id:e.routine.id}),children:r("routines.duplicate")}),b(Ft,{onClick:f,children:r("routines.markAsTemplate")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_PDF_TABLE,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-table.pdf`,children:r("routines.downloadPdfTable")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_PDF_LOGS,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-logs.pdf`,children:r("routines.downloadPdfLogs")}),b(Ft,{component:"a",href:Qt(Kt.ROUTINE_ICAL,o.language,{id:e.routine.id}),download:`Routine-${e.routine.id}-calendar.ics`,children:r("routines.downloadIcal")}),b(Ti,{}),b(Ft,{onClick:d,children:r("delete")})]}),Q($w,{open:s===1,onClose:g,children:[b(cE,{id:"alert-dialog-title",children:r("delete")}),b(Lw,{children:b(N4,{id:"alert-dialog-description",children:r("deleteConfirmation",{name:e.routine.name})})}),Q(Nw,{children:[b(at,{onClick:g,children:r("cancel")}),b(at,{onClick:h,color:"error",autoFocus:!0,children:r("delete")})]})]}),Q($w,{open:s===2,onClose:g,children:[b(cE,{children:r("routines.markAsTemplate")}),b(Lw,{children:b(N4,{children:b(tbt,{routine:e.routine})})}),b(Nw,{children:b(at,{onClick:g,children:r("close")})})]})]})},rbt=()=>{const{t:e}=Re(),t=Ea(),n=parseInt(t.routineId??"");if(Number.isNaN(n))return b("p",{children:"Please pass an integer as the routine id."});const r=_c(n),o=r.data;return b(UT,{query:r,child:r.isSuccess&&b(es,{title:o.name,subTitle:`${o.start.toLocaleDateString()} - ${o.end.toLocaleDateString()} (${o.durationText})`,optionsMenu:Q(xt,{children:[o.isTemplate&&b(Pu,{label:e("routines.template"),size:"small"}),b(nbt,{routine:r.data})]}),mainContent:Q(_t,{spacing:2,children:[o.description!==""&&b(tt,{variant:"body2",sx:{whiteSpace:"pre-line"},children:o==null?void 0:o.description}),o.dayDataCurrentIteration.filter(i=>i.day!==null).map((i,a)=>b(Cz,{routineId:n,dayData:i},a))]}),sideBar:Q(_t,{children:[b(en,{height:40}),Q(ye,{container:!0,children:[b(ye,{size:6,children:b(zl,{primaryMuscles:o.mainMuscles.filter(i=>i.isFront),secondaryMuscles:o.secondaryMuscles.filter(i=>i.isFront),isFront:!0})}),b(ye,{size:6,children:b(zl,{primaryMuscles:o.mainMuscles.filter(i=>!i.isFront),secondaryMuscles:o.secondaryMuscles.filter(i=>!i.isFront),isFront:!1})})]})]})})})},obt=()=>{const{t:e,i18n:t}=Re(),n=Ea(),r=n.routineId?parseInt(n.routineId):0,o=_c(r),i=ele(r),[a,s]=X.useState(!1);return b(UT,{query:o,child:o.isSuccess&&b(J0,{title:o.data.name,backToUrl:Qt(Kt.ROUTINE_DETAIL,t.language,{id:r}),maxWidth:!1,children:Q(_t,{children:[b(ba,{control:b(li,{checked:a,onChange:(l,c)=>s(c)}),label:e("routines.alsoShowLogs")}),b(Fue,{routine:o.data,showLogs:a,logData:i.data})]})})})},ibt=Oz({stickyColumn:{position:"sticky",left:0,zIndex:1},stickyHeader:{position:"sticky",top:0,zIndex:2,background:"white"},whiteBg:{backgroundColor:"white"}});function abt(e,t,n){return e==null?null:t!=null&&n!==null&&n!==void 0?e<t?"lower":e>n?"higher":"match":t!=null?e<t?"lower":e>t?"higher":"match":null}const Fue=e=>{const{t,i18n:n}=Re(),r=Lr(),o=ibt(),i=$c(),a=e.showLogs??!1,s=e.logData??[];let l;i.isSuccess&&(l=Tu(n.language,i.data));const c={};for(const x of s)for(const S of x.logs)S.iteration!==null&&(c[S.iteration]||(c[S.iteration]=[]),c[S.iteration].push(S));const u=Object.keys(e.routine.groupedDayDataByIteration).map(x=>parseInt(x));function d(){return b(Zt,{children:u.map(x=>{const S=x===1?b(Te,{className:o.stickyColumn}):null;return Q(X.Fragment,{children:[S,b(Te,{align:"center",children:t("routines.sets")}),b(Te,{align:"center",sx:{minWidth:40},children:t("routines.reps")}),b(Te,{align:"center",sx:{minWidth:40},children:t("weight")}),b(Te,{align:"center",sx:{minWidth:60},children:t("routines.restTime")}),b(Te,{align:"center",sx:{minWidth:40},children:t("routines.rir")})]},`header-${x}`)})})}function f(){return b(Zt,{children:u.map(x=>{const S=x===1?b(Te,{className:o.stickyColumn}):null;return Q(X.Fragment,{children:[S,b(Te,{colSpan:5,children:b(tt,{variant:"h6",children:t("routines.weekNr",{number:x})})})]},`header-iteration-${x}`)})})}function h(x,S){var E;const C={borderBottomWidth:a?0:null,minWidth:40};function I(T,O,A){return Q(xt,{children:[T===null||O===null?"-/-":O,T!==null&&A!==null&&Q(xt,{children:[" - ",A]})]})}return Q(Zt,{children:[b(Te,{className:o.stickyColumn,sx:{minWidth:150,backgroundColor:"white",borderBottomWidth:a?0:null},children:(E=x.exercise)==null?void 0:E.getTranslation(l).name}),u.map(T=>{const O=e.routine.getSetConfigData(S.id,T,x.id);return Q(X.Fragment,{children:[b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.nrOfSets,O==null?void 0:O.maxNrOfSets)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.repetitions,O==null?void 0:O.maxRepetitions)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.weight,O==null?void 0:O.maxWeight)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.restTime,O==null?void 0:O.maxRestTime)}),b(Te,{align:"center",sx:C,children:I(O,O==null?void 0:O.rir,O==null?void 0:O.maxRir)})]},T)})]})}function g(x,S,C,I){const E=abt(x,S,C);x===105&&console.log(x,S,C,I,E);const T=17;return I=I??!0,E===null?null:E==="lower"?b(qrt,{sx:{fontSize:T},color:I?"error":"success"}):E==="higher"?b(jrt,{sx:{fontSize:T},color:I?"success":"error"}):b(Drt,{sx:{fontSize:T},color:"success"})}function y(x,S){return Q(Zt,{children:[b(Te,{sx:{verticalAlign:"top",backgroundColor:"white"},className:o.stickyColumn,children:b("small",{children:t("nutrition.logged")})}),u.map(C=>{const I=e.routine.getSetConfigData(S.id,C,x.id),T=(c[C]??[]).filter(O=>O.slotEntryId===x.id);return Q(X.Fragment,{children:[b(Te,{align:"center",sx:{verticalAlign:"top"}}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.repetitions??"-/-",g(O.repetitions,I==null?void 0:I.repetitions,I==null?void 0:I.maxRepetitions)]})},A))}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.weight??"-/-",g(O.weight,I==null?void 0:I.weight,I==null?void 0:I.maxWeight)]})},A))}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.restTime??"-/-",g(O.restTime,I==null?void 0:I.restTime,I==null?void 0:I.maxRestTime)]})},A))}),b(Te,{align:"center",sx:{verticalAlign:"top"},children:T.map((O,A)=>b(_t,{children:Q("span",{children:[O.rir??"-/-",g(O.rir,I==null?void 0:I.rir,I==null?void 0:I.maxRir,!1)]})},A))})]},C)})]})}function v(){return b(xt,{children:e.routine.days.map(x=>Q(X.Fragment,{children:[Q(Zt,{children:[b(Te,{sx:{backgroundColor:r.palette.action.hover},className:o.stickyColumn,children:b("b",{children:x.getDisplayName()})}),b(Te,{sx:{backgroundColor:r.palette.action.hover},colSpan:5*u.length})]}),x.slots.map((S,C)=>b(X.Fragment,{children:S.entries.map((I,E)=>Q(X.Fragment,{children:[h(I,x),a&&y(I,x)]},E))},C))]},x.id))})}return b(Iu,{maxWidth:!1,sx:{overflowX:"scroll",display:"flex",height:"80vh"},children:b(jl,{children:Q(Ll,{size:"small",children:[Q(Du,{className:o.stickyHeader,children:[f(),d()]}),b(Fl,{children:v()})]})})})};function $i(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var sbt=typeof Symbol=="function"&&Symbol.observable||"@@observable",aX=sbt,sX=()=>Math.random().toString(36).substring(7).split("").join("."),lbt={INIT:`@@redux/INIT${sX()}`,REPLACE:`@@redux/REPLACE${sX()}`},lX=lbt;function cbt(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function jue(e,t,n){if(typeof e!="function")throw new Error($i(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error($i(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error($i(1));return n(jue)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,l=!1;function c(){a===i&&(a=new Map,i.forEach((v,x)=>{a.set(x,v)}))}function u(){if(l)throw new Error($i(3));return o}function d(v){if(typeof v!="function")throw new Error($i(4));if(l)throw new Error($i(5));let x=!0;c();const S=s++;return a.set(S,v),function(){if(x){if(l)throw new Error($i(6));x=!1,c(),a.delete(S),i=null}}}function f(v){if(!cbt(v))throw new Error($i(7));if(typeof v.type>"u")throw new Error($i(8));if(typeof v.type!="string")throw new Error($i(17));if(l)throw new Error($i(9));try{l=!0,o=r(o,v)}finally{l=!1}return(i=a).forEach(S=>{S()}),v}function h(v){if(typeof v!="function")throw new Error($i(10));r=v,f({type:lX.REPLACE})}function g(){const v=d;return{subscribe(x){if(typeof x!="object"||x===null)throw new Error($i(11));function S(){const I=x;I.next&&I.next(u())}return S(),{unsubscribe:v(S)}},[aX](){return this}}}return f({type:lX.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:h,[aX]:g}}function cX(e,t){return function(...n){return t(e.apply(this,n))}}function uX(e,t){if(typeof e=="function")return cX(e,t);if(typeof e!="object"||e===null)throw new Error($i(16));const n={};for(const r in e){const o=e[r];typeof o=="function"&&(n[r]=cX(o,t))}return n}function Bue(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function ubt(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error($i(15))};const a={getState:o.getState,dispatch:(l,...c)=>i(l,...c)},s=e.map(l=>l(a));return i=Bue(...s)(o.dispatch),{...o,dispatch:i}}}var b$={exports:{}},w$={};/*** @license React* use-sync-external-store-with-selector.production.js*@@ -501,4 +501,4 @@ ${te.current.stack}-moz-user-select: none;-ms-user-select: none;overflow-anchor: none;- `}}];return{always:Ob(a,"always"),resting:Ob(a,"resting"),dragging:Ob(a,"dragging"),dropAnimating:Ob(a,"dropAnimating"),userCancel:Ob(a,"userCancel")}};const Ga=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect,k$=()=>{const e=document.querySelector("head");return e||vt(),e},NX=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function $0t(e,t){const n=Vn(()=>_0t(e),[e]),r=w.useRef(null),o=w.useRef(null),i=Wt(Yo(d=>{const f=o.current;f||vt(),f.textContent=d}),[]),a=Wt(d=>{const f=r.current;f||vt(),f.textContent=d},[]);Ga(()=>{!r.current&&!o.current||vt();const d=NX(t),f=NX(t);return r.current=d,o.current=f,d.setAttribute(`${sy}-always`,e),f.setAttribute(`${sy}-dynamic`,e),k$().appendChild(d),k$().appendChild(f),a(n.always),i(n.resting),()=>{const h=g=>{const y=g.current;y||vt(),k$().removeChild(y),g.current=null};h(r),h(o)}},[t,a,i,n.always,n.resting,e]);const s=Wt(()=>i(n.dragging),[i,n.dragging]),l=Wt(d=>{if(d==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),c=Wt(()=>{o.current&&i(n.resting)},[i,n.resting]);return Vn(()=>({dragging:s,dropping:l,resting:c}),[s,l,c])}function Rde(e,t){return Array.from(e.querySelectorAll(t))}var Dde=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function dO(e){return e instanceof Dde(e).HTMLElement}function N0t(e,t){const n=`[${ly.contextId}="${e}"]`,r=Rde(document,n);if(!r.length)return null;const o=r.find(i=>i.getAttribute(ly.draggableId)===t);return!o||!dO(o)?null:o}function L0t(e){const t=w.useRef({}),n=w.useRef(null),r=w.useRef(null),o=w.useRef(!1),i=Wt(function(f,h){const g={id:f,focus:h};return t.current[f]=g,function(){const v=t.current;v[f]!==g&&delete v[f]}},[]),a=Wt(function(f){const h=N0t(e,f);h&&h!==document.activeElement&&h.focus()},[e]),s=Wt(function(f,h){n.current===f&&(n.current=h)},[]),l=Wt(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const f=n.current;f&&a(f)}))},[a]),c=Wt(function(f){n.current=null;const h=document.activeElement;h&&h.getAttribute(ly.draggableId)===f&&(n.current=f)},[]);return Ga(()=>(o.current=!0,function(){o.current=!1;const f=r.current;f&&cancelAnimationFrame(f)}),[]),Vn(()=>({register:i,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:s}),[i,c,l,s])}function F0t(){const e={draggables:{},droppables:{}},t=[];function n(d){return t.push(d),function(){const h=t.indexOf(d);h!==-1&&t.splice(h,1)}}function r(d){t.length&&t.forEach(f=>f(d))}function o(d){return e.draggables[d]||null}function i(d){const f=o(d);return f||vt(),f}const a={register:d=>{e.draggables[d.descriptor.id]=d,r({type:"ADDITION",value:d})},update:(d,f)=>{const h=e.draggables[f.descriptor.id];h&&h.uniqueId===d.uniqueId&&(delete e.draggables[f.descriptor.id],e.draggables[d.descriptor.id]=d)},unregister:d=>{const f=d.descriptor.id,h=o(f);h&&d.uniqueId===h.uniqueId&&(delete e.draggables[f],e.droppables[d.descriptor.droppableId]&&r({type:"REMOVAL",value:d}))},getById:i,findById:o,exists:d=>!!o(d),getAllByType:d=>Object.values(e.draggables).filter(f=>f.descriptor.type===d)};function s(d){return e.droppables[d]||null}function l(d){const f=s(d);return f||vt(),f}const c={register:d=>{e.droppables[d.descriptor.id]=d},unregister:d=>{const f=s(d.descriptor.id);f&&d.uniqueId===f.uniqueId&&delete e.droppables[d.descriptor.id]},getById:l,findById:s,exists:d=>!!s(d),getAllByType:d=>Object.values(e.droppables).filter(f=>f.descriptor.type===d)};function u(){e.draggables={},e.droppables={},t.length=0}return{draggable:a,droppable:c,subscribe:n,clean:u}}function j0t(){const e=Vn(F0t,[]);return w.useEffect(()=>function(){e.clean()},[e]),e}var vV=X.createContext(null),ZP=()=>{const e=document.body;return e||vt(),e};const B0t={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},z0t=e=>`rfd-announcement-${e}`;function V0t(e){const t=Vn(()=>z0t(e),[e]),n=w.useRef(null);return w.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),YP(i.style,B0t),ZP().appendChild(i),function(){setTimeout(function(){const l=ZP();l.contains(i)&&l.removeChild(i),i===n.current&&(n.current=null)})}},[t]),Wt(o=>{const i=n.current;if(i){i.textContent=o;return}},[])}const H0t={separator:"::"};function bV(e,t=H0t){const n=X.useId();return Vn(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function U0t({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function W0t({contextId:e,text:t}){const n=bV("hidden-text",{separator:"-"}),r=Vn(()=>U0t({contextId:e,uniqueId:n}),[n,e]);return w.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",ZP().appendChild(i),function(){const s=ZP();s.contains(i)&&s.removeChild(i)}},[r,t]),r}var fO=X.createContext(null);function _de(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),t}function G0t(){let e=null;function t(){return!!e}function n(a){return a===e}function r(a){e&&vt();const s={abandon:a};return e=s,s}function o(){e||vt(),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function qx(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const q0t=9,K0t=13,wV=27,$de=32,Y0t=33,Q0t=34,X0t=35,J0t=36,Z0t=37,eSt=38,tSt=39,nSt=40,rSt={[K0t]:!0,[q0t]:!0};var Nde=e=>{rSt[e.keyCode]&&e.preventDefault()};const pO=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),Lde=0,LX=5;function oSt(e,t){return Math.abs(t.x-e.x)>=LX||Math.abs(t.y-e.y)>=LX}const FX={type:"IDLE"};function iSt({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:a,clientY:s}=o;if(i!==Lde)return;const l={x:a,y:s},c=n();if(c.type==="DRAGGING"){o.preventDefault(),c.actions.move(l);return}c.type!=="PENDING"&&vt();const u=c.point;if(!oSt(u,l))return;o.preventDefault();const d=c.actions.fluidLift(l);r({type:"DRAGGING",actions:d})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===wV){o.preventDefault(),e();return}Nde(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&vt(),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:pO,fn:e}]}function aSt(e){const t=w.useRef(FX),n=w.useRef(Kd),r=Vn(()=>({eventName:"mousedown",fn:function(d){if(d.defaultPrevented||d.button!==Lde||d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)return;const f=e.findClosestDraggableId(d);if(!f)return;const h=e.tryGetLock(f,a,{sourceEvent:d});if(!h)return;d.preventDefault();const g={x:d.clientX,y:d.clientY};n.current(),c(h,g)}}),[e]),o=Vn(()=>({eventName:"webkitmouseforcewillbegin",fn:u=>{if(u.defaultPrevented)return;const d=e.findClosestDraggableId(u);if(!d)return;const f=e.findOptionsForDraggable(d);f&&(f.shouldRespectForcePress||e.canGetLock(d)&&u.preventDefault())}}),[e]),i=Wt(function(){const d={passive:!1,capture:!0};n.current=$s(window,[o,r],d)},[o,r]),a=Wt(()=>{t.current.type!=="IDLE"&&(t.current=FX,n.current(),i())},[i]),s=Wt(()=>{const u=t.current;a(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[a]),l=Wt(function(){const d={capture:!0,passive:!1},f=iSt({cancel:s,completed:a,getPhase:()=>t.current,setPhase:h=>{t.current=h}});n.current=$s(window,f,d)},[s,a]),c=Wt(function(d,f){t.current.type!=="IDLE"&&vt(),t.current={type:"PENDING",point:f,actions:d},l()},[l]);Ga(function(){return i(),function(){n.current()}},[i])}function sSt(){}const lSt={[Q0t]:!0,[Y0t]:!0,[J0t]:!0,[X0t]:!0};function cSt(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===wV){o.preventDefault(),n();return}if(o.keyCode===$de){o.preventDefault(),r();return}if(o.keyCode===nSt){o.preventDefault(),e.moveDown();return}if(o.keyCode===eSt){o.preventDefault(),e.moveUp();return}if(o.keyCode===tSt){o.preventDefault(),e.moveRight();return}if(o.keyCode===Z0t){o.preventDefault(),e.moveLeft();return}if(lSt[o.keyCode]){o.preventDefault();return}Nde(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:pO,fn:n}]}function uSt(e){const t=w.useRef(sSt),n=Vn(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==$de)return;const a=e.findClosestDraggableId(i);if(!a)return;const s=e.tryGetLock(a,u,{sourceEvent:i});if(!s)return;i.preventDefault();let l=!0;const c=s.snapLift();t.current();function u(){l||vt(),l=!1,t.current(),r()}t.current=$s(window,cSt(c,u),{capture:!0,passive:!1})}}),[e]),r=Wt(function(){const i={passive:!1,capture:!0};t.current=$s(window,[n],i)},[n]);Ga(function(){return r(),function(){t.current()}},[r])}const M$={type:"IDLE"},dSt=120,fSt=.15;function pSt({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===wV&&n.preventDefault(),e()}},{eventName:pO,fn:e}]}function hSt({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:a}=r.touches[0],s={x:i,y:a};r.preventDefault(),o.actions.move(s)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&vt();const i=r.touches[0];if(!i||!(i.force>=fSt))return;const s=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){s&&e();return}if(s){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:pO,fn:e}]}function mSt(e){const t=w.useRef(M$),n=w.useRef(Kd),r=Wt(function(){return t.current},[]),o=Wt(function(h){t.current=h},[]),i=Vn(()=>({eventName:"touchstart",fn:function(h){if(h.defaultPrevented)return;const g=e.findClosestDraggableId(h);if(!g)return;const y=e.tryGetLock(g,s,{sourceEvent:h});if(!y)return;const v=h.touches[0],{clientX:x,clientY:S}=v,C={x,y:S};n.current(),d(y,C)}}),[e]),a=Wt(function(){const h={capture:!0,passive:!1};n.current=$s(window,[i],h)},[i]),s=Wt(()=>{const f=t.current;f.type!=="IDLE"&&(f.type==="PENDING"&&clearTimeout(f.longPressTimerId),o(M$),n.current(),a())},[a,o]),l=Wt(()=>{const f=t.current;s(),f.type==="DRAGGING"&&f.actions.cancel({shouldBlockNextClick:!0}),f.type==="PENDING"&&f.actions.abort()},[s]),c=Wt(function(){const h={capture:!0,passive:!1},g={cancel:l,completed:s,getPhase:r},y=$s(window,hSt(g),h),v=$s(window,pSt(g),h);n.current=function(){y(),v()}},[l,r,s]),u=Wt(function(){const h=r();h.type!=="PENDING"&&vt();const g=h.actions.fluidLift(h.point);o({type:"DRAGGING",actions:g,hasMoved:!1})},[r,o]),d=Wt(function(h,g){r().type!=="IDLE"&&vt();const y=setTimeout(u,dSt);o({type:"PENDING",point:g,actions:h,longPressTimerId:y}),c()},[c,r,o,u]);Ga(function(){return a(),function(){n.current();const g=r();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),o(M$))}},[r,a,o]),Ga(function(){return $s(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const gSt=["input","button","textarea","select","option","optgroup","video","audio"];function Fde(e,t){if(t==null)return!1;if(gSt.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:Fde(e,t.parentElement)}function ySt(e,t){const n=t.target;return dO(n)?Fde(e,n):!1}var vSt=e=>Ol(e.getBoundingClientRect()).center;function bSt(e){return e instanceof Dde(e).Element}const wSt=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function jde(e,t){return e==null?null:e[wSt](t)?e:jde(e.parentElement,t)}function xSt(e,t){return e.closest?e.closest(t):jde(e,t)}function SSt(e){return`[${ly.contextId}="${e}"]`}function CSt(e,t){const n=t.target;if(!bSt(n))return null;const r=SSt(e),o=xSt(n,r);return!o||!dO(o)?null:o}function ESt(e,t){const n=CSt(e,t);return n?n.getAttribute(ly.draggableId):null}function PSt(e,t){const n=`[${oF.contextId}="${e}"]`,o=Rde(document,n).find(i=>i.getAttribute(oF.id)===t);return!o||!dO(o)?null:o}function ISt(e){e.preventDefault()}function h1({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function Bde({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return!(!o||!o.options.isEnabled||!Ode(t.getState(),r))}function TSt({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!Bde({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const l=r.draggable.getById(o),c=PSt(t,l.descriptor.id);if(!c||a&&!l.options.canDragInteractiveElements&&ySt(c,a))return null;const u=e.claim(i||Kd);let d="PRE_DRAG";function f(){return l.options.shouldRespectForcePress}function h(){return e.isActive(u)}function g(E,T){h1({expected:E,phase:d,isLockActive:h,shouldWarn:!0})&&n.dispatch(T())}const y=g.bind(null,"DRAGGING");function v(E){function T(){e.release(),d="COMPLETED"}d!=="PRE_DRAG"&&(T(),vt()),n.dispatch(xxt(E.liftActionArgs)),d="DRAGGING";function O(A,k={shouldBlockNextClick:!1}){if(E.cleanup(),k.shouldBlockNextClick){const M=$s(window,[{eventName:"click",fn:ISt,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(M)}T(),n.dispatch(wde({reason:A}))}return{isActive:()=>h1({expected:"DRAGGING",phase:d,isLockActive:h,shouldWarn:!1}),shouldRespectForcePress:f,drop:A=>O("DROP",A),cancel:A=>O("CANCEL",A),...E.actions}}function x(E){const T=zx(A=>{y(()=>bde({client:A}))});return{...v({liftActionArgs:{id:o,clientSelection:E,movementMode:"FLUID"},cleanup:()=>T.cancel(),actions:{move:T}}),move:T}}function S(){const E={moveUp:()=>y(Mxt),moveRight:()=>y(Rxt),moveDown:()=>y(Axt),moveLeft:()=>y(Dxt)};return v({liftActionArgs:{id:o,clientSelection:vSt(c),movementMode:"SNAP"},cleanup:Kd,actions:E})}function C(){h1({expected:"PRE_DRAG",phase:d,isLockActive:h,shouldWarn:!0})&&e.release()}return{isActive:()=>h1({expected:"PRE_DRAG",phase:d,isLockActive:h,shouldWarn:!1}),shouldRespectForcePress:f,fluidLift:x,snapLift:S,abort:C}}const OSt=[aSt,uSt,mSt];function kSt({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?OSt:[],...r||[]],a=w.useState(()=>G0t())[0],s=Wt(function(v,x){qx(v)&&!qx(x)&&a.tryAbandon()},[a]);Ga(function(){let v=t.getState();return t.subscribe(()=>{const S=t.getState();s(v,S),v=S})},[a,t,s]),Ga(()=>a.tryAbandon,[a.tryAbandon]);const l=Wt(y=>Bde({lockAPI:a,registry:n,store:t,draggableId:y}),[a,n,t]),c=Wt((y,v,x)=>TSt({lockAPI:a,registry:n,contextId:e,store:t,draggableId:y,forceSensorStop:v||null,sourceEvent:x&&x.sourceEvent?x.sourceEvent:null}),[e,a,n,t]),u=Wt(y=>ESt(e,y),[e]),d=Wt(y=>{const v=n.draggable.findById(y);return v?v.options:null},[n.draggable]),f=Wt(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(dV()))},[a,t]),h=Wt(()=>a.isClaimed(),[a]),g=Vn(()=>({canGetLock:l,tryGetLock:c,findClosestDraggableId:u,findOptionsForDraggable:d,tryReleaseLock:f,isLockClaimed:h}),[l,c,u,d,f,h]);for(let y=0;y<i.length;y++)i[y](g)}const MSt=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};u0.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),ASt=e=>({...Gx,...e.autoScrollerOptions,durationDampening:{...Gx.durationDampening,...e.autoScrollerOptions}});function kb(e){return e.current||vt(),e.current}function RSt(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,a=w.useRef(null),s=_de(e),l=Wt(()=>MSt(s.current),[s]),c=Wt(()=>ASt(s.current),[s]),u=V0t(t),d=W0t({contextId:t,text:i}),f=$0t(t,o),h=Wt(M=>{kb(a).dispatch(M)},[]),g=Vn(()=>uX({publishWhileDragging:Cxt,updateDroppableScroll:Pxt,updateDroppableIsEnabled:Ixt,updateDroppableIsCombineEnabled:Txt,collectionStarting:Ext},h),[h]),y=j0t(),v=Vn(()=>p0t(y,g),[y,g]),x=Vn(()=>M0t({scrollWindow:h0t,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:c,...uX({move:bde},h)}),[v.scrollDroppable,h,c]),S=L0t(t),C=Vn(()=>c0t({announce:u,autoScroller:x,dimensionMarshal:v,focusMarshal:S,getResponders:l,styleMarshal:f}),[u,x,v,S,l,f]);a.current=C;const I=Wt(()=>{const M=kb(a);M.getState().phase!=="IDLE"&&M.dispatch(dV())},[]),E=Wt(()=>{const M=kb(a).getState();return M.phase==="DROP_ANIMATING"?!0:M.phase==="IDLE"?!1:M.isDragging},[]),T=Vn(()=>({isDragging:E,tryAbort:I}),[E,I]);n(T);const O=Wt(M=>Ode(kb(a).getState(),M),[]),A=Wt(()=>rp(kb(a).getState()),[]),k=Vn(()=>({marshal:v,focus:S,contextId:t,canLift:O,isMovementAllowed:A,dragHandleUsageInstructionsId:d,registry:y}),[t,v,d,S,O,A,y]);return kSt({contextId:t,store:C,registry:y,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),w.useEffect(()=>I,[I]),X.createElement(fO.Provider,{value:k},X.createElement(iwt,{context:vV,store:C},e.children))}function DSt(){return X.useId()}function zde(e){const t=DSt(),n=e.dragHandleUsageInstructions||G1.dragHandleUsageInstructions;return X.createElement(uwt,null,r=>X.createElement(RSt,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const jX={dragging:5e3,dropAnimating:4500},_St=(e,t)=>t?Iw.drop(t.duration):e?Iw.snap:Iw.fluid,$St=(e,t)=>{if(e)return t?Wx.opacity.drop:Wx.opacity.combining},NSt=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function LSt(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,a=!!o,s=NSt(e),l=!!i,c=l?nF.drop(r,a):nF.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:_St(s,i),transform:c,opacity:$St(a,l),zIndex:l?jX.dropAnimating:jX.dragging,pointerEvents:"none"}}function FSt(e){return{transform:nF.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function jSt(e){return e.type==="DRAGGING"?LSt(e):FSt(e)}function BSt(e,t,n=Qo){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=que(o,r),a=KP(i,n),s={client:i,tagName:t.tagName.toLowerCase(),display:r.display},l={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:s,displaceBy:l,client:i,page:a}}function zSt(e){const t=bV("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:s}=e,l=Vn(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:s}),[i,s,a]),c=Wt(h=>{const g=o();return g||vt(),BSt(n,g,h)},[n,o]),u=Vn(()=>({uniqueId:t,descriptor:n,options:l,getDimension:c}),[n,c,l,t]),d=w.useRef(u),f=w.useRef(!0);Ga(()=>(r.draggable.register(d.current),()=>r.draggable.unregister(d.current)),[r.draggable]),Ga(()=>{if(f.current){f.current=!1;return}const h=d.current;d.current=u,r.draggable.update(u,h)},[u,r.draggable])}var xV=X.createContext(null);function eI(e){const t=w.useContext(e);return t||vt(),t}function VSt(e){e.preventDefault()}const HSt=e=>{const t=w.useRef(null),n=Wt((T=null)=>{t.current=T},[]),r=Wt(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:a}=eI(fO),{type:s,droppableId:l}=eI(xV),c=Vn(()=>({id:e.draggableId,index:e.index,type:s,droppableId:l}),[e.draggableId,e.index,s,l]),{children:u,draggableId:d,isEnabled:f,shouldRespectForcePress:h,canDragInteractiveElements:g,isClone:y,mapped:v,dropAnimationFinished:x}=e;if(!y){const T=Vn(()=>({descriptor:c,registry:a,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:h,isEnabled:f}),[c,a,r,g,h,f]);zSt(T)}const S=Vn(()=>f?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":d,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:VSt}:null,[o,i,d,f]),C=Wt(T=>{v.type==="DRAGGING"&&v.dropping&&T.propertyName==="transform"&&u0.flushSync(x)},[x,v]),I=Vn(()=>{const T=jSt(v),O=v.type==="DRAGGING"&&v.dropping?C:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":d,style:T,onTransitionEnd:O},dragHandleProps:S}},[o,S,d,v,C,n]),E=Vn(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return X.createElement(X.Fragment,null,u(I,v.snapshot,E))};var Vde=(e,t)=>e===t,Hde=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const USt=e=>e.combine?e.combine.draggableId:null,WSt=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function GSt(){const e=Yo((o,i)=>({x:o,y:i})),t=Yo((o,i,a=null,s=null,l=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!l,dropAnimation:l,mode:o,draggingOver:a,combineWith:s,combineTargetFor:null})),n=Yo((o,i,a,s,l=null,c=null,u=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:c,mode:i,offset:o,dimension:a,forceShouldAnimate:u,snapshot:t(i,s,l,c,null)}}));return(o,i)=>{if(qx(o)){if(o.critical.draggable.id!==i.draggableId)return null;const a=o.current.client.offset,s=o.dimensions.draggables[i.draggableId],l=Wa(o.impact),c=WSt(o.impact),u=o.forceShouldAnimate;return n(e(a.x,a.y),o.movementMode,s,i.isClone,l,c,u)}if(o.phase==="DROP_ANIMATING"){const a=o.completed;if(a.result.draggableId!==i.draggableId)return null;const s=i.isClone,l=o.dimensions.draggables[i.draggableId],c=a.result,u=c.mode,d=Hde(c),f=USt(c),g={duration:o.dropDuration,curve:pV.drop,moveTo:o.newHomeClientOffset,opacity:f?Wx.opacity.drop:null,scale:f?Wx.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:l,dropping:g,draggingOver:d,combineWith:f,mode:u,forceShouldAnimate:null,snapshot:t(u,s,d,f,g)}}}return null}}function Ude(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const qSt={mapped:{type:"SECONDARY",offset:Qo,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Ude(null)}};function KSt(){const e=Yo((a,s)=>({x:a,y:s})),t=Yo(Ude),n=Yo((a,s=null,l)=>({mapped:{type:"SECONDARY",offset:a,combineTargetFor:s,shouldAnimateDisplacement:l,snapshot:t(s)}})),r=a=>a?n(Qo,a,!0):null,o=(a,s,l,c)=>{const u=l.displaced.visible[a],d=!!(c.inVirtualList&&c.effected[a]),f=lO(l),h=f&&f.draggableId===a?s:null;if(!u){if(!d)return r(h);if(l.displaced.invisible[a])return null;const v=lv(c.displacedBy.point),x=e(v.x,v.y);return n(x,h,!0)}if(d)return r(h);const g=l.displacedBy.point,y=e(g.x,g.y);return n(y,h,u.shouldAnimate)};return(a,s)=>{if(qx(a))return a.critical.draggable.id===s.draggableId?null:o(s.draggableId,a.critical.draggable.id,a.impact,a.afterCritical);if(a.phase==="DROP_ANIMATING"){const l=a.completed;return l.result.draggableId===s.draggableId?null:o(s.draggableId,l.result.draggableId,l.impact,l.afterCritical)}return null}}const YSt=()=>{const e=GSt(),t=KSt();return(r,o)=>e(r,o)||t(r,o)||qSt},QSt={dropAnimationFinished:xde},XSt=Gue(YSt,QSt,null,{context:vV,areStatePropsEqual:Vde})(HSt);function Wde(e){return eI(xV).isUsingCloneFor===e.draggableId&&!e.isClone?null:X.createElement(XSt,e)}function Gde(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return X.createElement(Wde,YP({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const qde=e=>t=>e===t,JSt=qde("scroll"),ZSt=qde("auto"),BX=(e,t)=>t(e.overflowX)||t(e.overflowY),eCt=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return BX(n,JSt)||BX(n,ZSt)},tCt=()=>!1,Kde=e=>e==null?null:e===document.body?tCt()?e:null:e===document.documentElement?null:eCt(e)?e:Kde(e.parentElement);var iF=e=>({x:e.scrollLeft,y:e.scrollTop});const Yde=e=>e?window.getComputedStyle(e).position==="fixed"?!0:Yde(e.parentElement):!1;var nCt=e=>{const t=Kde(e),n=Yde(e);return{closestScrollable:t,isFixedOnPage:n}},rCt=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:a,closest:s})=>{const l=(()=>{if(!s)return null;const{scrollSize:f,client:h}=s,g=Pde({scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,height:h.paddingBox.height,width:h.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:h,scrollSize:f,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:g,diff:{value:Qo,displacement:Qo}}}})(),c=o==="vertical"?aV:ode,u=ay({page:a,withPlaceholder:null,axis:c,frame:l});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:u}};const oCt=(e,t)=>{const n=Kue(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,a=o+t.scrollWidth,l=nV({top:r,right:a,bottom:i,left:o},n.border);return rV({borderBox:l,margin:n.margin,border:n.border,padding:n.padding})};var iCt=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:s})=>{const l=n.closestScrollable,c=oCt(e,l),u=KP(c,r),d=(()=>{if(!l)return null;const h=Kue(l),g={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:h,page:KP(h,r),scroll:iF(l),scrollSize:g,shouldClipSubject:s}})();return rCt({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:u,closest:d})};const aCt={passive:!1},sCt={passive:!0};var zX=e=>e.shouldPublishImmediately?aCt:sCt;const m1=e=>e&&e.env.closestScrollable||null;function lCt(e){const t=w.useRef(null),n=eI(fO),r=bV("droppable"),{registry:o,marshal:i}=n,a=_de(e),s=Vn(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),l=w.useRef(s),c=Vn(()=>Yo((I,E)=>{t.current||vt();const T={x:I,y:E};i.updateDroppableScroll(s.id,T)}),[s.id,i]),u=Wt(()=>{const I=t.current;return!I||!I.env.closestScrollable?Qo:iF(I.env.closestScrollable)},[]),d=Wt(()=>{const I=u();c(I.x,I.y)},[u,c]),f=Vn(()=>zx(d),[d]),h=Wt(()=>{const I=t.current,E=m1(I);if(I&&E||vt(),I.scrollOptions.shouldPublishImmediately){d();return}f()},[f,d]),g=Wt((I,E)=>{t.current&&vt();const T=a.current,O=T.getDroppableRef();O||vt();const A=nCt(O),k={ref:O,descriptor:s,env:A,scrollOptions:E};t.current=k;const M=iCt({ref:O,descriptor:s,env:A,windowScroll:I,direction:T.direction,isDropDisabled:T.isDropDisabled,isCombineEnabled:T.isCombineEnabled,shouldClipSubject:!T.ignoreContainerClipping}),R=A.closestScrollable;return R&&(R.setAttribute($X.contextId,n.contextId),R.addEventListener("scroll",h,zX(k.scrollOptions))),M},[n.contextId,s,h,a]),y=Wt(()=>{const I=t.current,E=m1(I);return I&&E||vt(),iF(E)},[]),v=Wt(()=>{const I=t.current;I||vt();const E=m1(I);t.current=null,E&&(f.cancel(),E.removeAttribute($X.contextId),E.removeEventListener("scroll",h,zX(I.scrollOptions)))},[h,f]),x=Wt(I=>{const E=t.current;E||vt();const T=m1(E);T||vt(),T.scrollTop+=I.y,T.scrollLeft+=I.x},[]),S=Vn(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:y,dragStopped:v,scroll:x}),[v,g,y,x]),C=Vn(()=>({uniqueId:r,descriptor:s,callbacks:S}),[S,s,r]);Ga(()=>(l.current=C.descriptor,o.droppable.register(C),()=>{t.current&&v(),o.droppable.unregister(C)}),[S,s,v,C,i,o.droppable]),Ga(()=>{t.current&&i.updateDroppableIsEnabled(l.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),Ga(()=>{t.current&&i.updateDroppableIsCombineEnabled(l.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function A$(){}const VX={width:0,height:0,margin:ywt},cCt=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?VX:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},uCt=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=cCt({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?Iw.placeholder:null}},dCt=e=>{const t=w.useRef(null),n=Wt(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:a}=e,[s,l]=w.useState(e.animate==="open");w.useEffect(()=>s?r!=="open"?(n(),l(!1),A$):t.current?A$:(t.current=setTimeout(()=>{t.current=null,l(!1)}),n):A$,[r,s,n]);const c=Wt(d=>{d.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),u=uCt({isAnimatingOpenOnMount:s,animate:e.animate,placeholder:e.placeholder});return X.createElement(e.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":a,onTransitionEnd:c,ref:e.innerRef})};var fCt=X.memo(dCt);class pCt extends X.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const hCt=e=>{const t=w.useContext(fO);t||vt();const{contextId:n,isMovementAllowed:r}=t,o=w.useRef(null),i=w.useRef(null),{children:a,droppableId:s,type:l,mode:c,direction:u,ignoreContainerClipping:d,isDropDisabled:f,isCombineEnabled:h,snapshot:g,useClone:y,updateViewportMaxScroll:v,getContainerForClone:x}=e,S=Wt(()=>o.current,[]),C=Wt((R=null)=>{o.current=R},[]);Wt(()=>i.current,[]);const I=Wt((R=null)=>{i.current=R},[]),E=Wt(()=>{r()&&v({maxScroll:Tde()})},[r,v]);lCt({droppableId:s,type:l,mode:c,direction:u,isDropDisabled:f,isCombineEnabled:h,ignoreContainerClipping:d,getDroppableRef:S});const T=Vn(()=>X.createElement(pCt,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:R,data:$,animate:L})=>X.createElement(fCt,{placeholder:$,onClose:R,innerRef:I,animate:L,contextId:n,onTransitionEnd:E})),[n,E,e.placeholder,e.shouldAnimatePlaceholder,I]),O=Vn(()=>({innerRef:C,placeholder:T,droppableProps:{"data-rfd-droppable-id":s,"data-rfd-droppable-context-id":n}}),[n,s,T,C]),A=y?y.dragging.draggableId:null,k=Vn(()=>({droppableId:s,type:l,isUsingCloneFor:A}),[s,A,l]);function M(){if(!y)return null;const{dragging:R,render:$}=y,L=X.createElement(Wde,{draggableId:R.draggableId,index:R.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(z,N)=>$(z,N,R));return Lb.createPortal(L,x())}return X.createElement(xV.Provider,{value:k},a(O,g),M())};function mCt(){return document.body||vt(),document.body}const HX={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:mCt},Qde=e=>{let t={...e},n;for(n in HX)e[n]===void 0&&(t={...t,[n]:HX[n]});return t},R$=(e,t)=>e===t.droppable.type,UX=(e,t)=>t.draggables[e.draggable.id],gCt=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=Yo(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=Yo((i,a,s,l,c,u)=>{const d=c.descriptor.id;if(c.descriptor.droppableId===i){const g=u?{render:u,dragging:n(c.descriptor)}:null,y={isDraggingOver:s,draggingOverWith:s?d:null,draggingFromThisWith:d,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!1,snapshot:y,useClone:g}}if(!a)return t;if(!l)return e;const h={isDraggingOver:s,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:h,useClone:null}});return(i,a)=>{const s=Qde(a),l=s.droppableId,c=s.type,u=!s.isDropDisabled,d=s.renderClone;if(qx(i)){const f=i.critical;if(!R$(c,f))return t;const h=UX(f,i.dimensions),g=Wa(i.impact)===l;return r(l,u,g,g,h,d)}if(i.phase==="DROP_ANIMATING"){const f=i.completed;if(!R$(c,f.critical))return t;const h=UX(f.critical,i.dimensions);return r(l,u,Hde(f.result)===l,Wa(f.impact)===l,h,d)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const f=i.completed;if(!R$(c,f.critical))return t;const h=Wa(f.impact)===l,g=!!(f.impact.at&&f.impact.at.type==="COMBINE"),y=f.critical.droppable.id===l;return h?g?e:t:y?e:t}return t}},yCt={updateViewportMaxScroll:kxt},Xde=Gue(gCt,yCt,(e,t,n)=>({...Qde(n),...e,...t}),{context:vV,areStatePropsEqual:Vde})(hCt);function vCt(e){return je("MuiLoadingButton",e)}const Xc=Be("MuiLoadingButton",["root","label","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),bCt=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],label:["label"],startIcon:[t&&`startIconLoading${we(n)}`],endIcon:[t&&`endIconLoading${we(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${we(n)}`]},i=Oe(o,vCt,r);return{...r,...i}},wCt=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",xCt=se(at,{shouldForwardProp:e=>wCt(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Xc.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Xc.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(rt(({theme:e})=>({display:"inline-flex",[`& .${Xc.startIconLoadingStart}, & .${Xc.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0},variants:[{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Xc.loading}`]:{color:"transparent"}}},{props:({ownerState:t})=>t.loadingPosition==="start"&&t.fullWidth,style:{[`& .${Xc.startIconLoadingStart}, & .${Xc.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0,marginRight:-8}}},{props:({ownerState:t})=>t.loadingPosition==="end"&&t.fullWidth,style:{[`& .${Xc.startIconLoadingStart}, & .${Xc.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0,marginLeft:-8}}}]}))),SCt=se("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${we(n.loadingPosition)}`]]}})(rt(({theme:e})=>({position:"absolute",visibility:"visible",display:"flex",variants:[{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:({loadingPosition:t,ownerState:n})=>t==="start"&&n.size!=="small",style:{left:14}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:({loadingPosition:t,ownerState:n})=>t==="end"&&n.size!=="small",style:{right:14}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:({ownerState:t})=>t.loadingPosition==="start"&&t.fullWidth,style:{position:"relative",left:-10}},{props:({ownerState:t})=>t.loadingPosition==="end"&&t.fullWidth,style:{position:"relative",right:-10}}]}))),WX=se("span",{name:"MuiLoadingButton",slot:"Label",overridesResolver:(e,t)=>[t.label]})({display:"inherit",alignItems:"inherit",justifyContent:"inherit"}),CCt=w.forwardRef(function(t,n){const r=w.useContext(WF),o=Xd(r,t),i=lt({props:o,name:"MuiLoadingButton"}),{children:a,disabled:s=!1,id:l,loading:c=!1,loadingIndicator:u,loadingPosition:d="center",variant:f="text",...h}=i,g=Dn(l),y=u??_.jsx(yy,{"aria-labelledby":g,color:"inherit",size:16}),v={...i,disabled:s,loading:c,loadingIndicator:y,loadingPosition:d,variant:f},x=bCt(v),S=c?_.jsx(SCt,{className:x.loadingIndicator,ownerState:v,children:y}):null;return _.jsxs(xCt,{disabled:s||c,id:g,ref:n,...h,variant:f,classes:x,ownerState:v,children:[v.loadingPosition==="end"?_.jsx(WX,{className:x.label,children:a}):S,v.loadingPosition==="end"?S:_.jsx(WX,{className:x.label,children:a})]})}),ECt=e=>{const{t}=Re(),n=trt(e.routineId),r=ort(e.routineId),[o,i]=w.useState(!1),[a,s]=w.useState(!1),[l,c]=w.useState(e.day.isRest),u=()=>{l?(c(!1),I({isRest:!1})):s(!0)},d=()=>s(!1),f=()=>{I({isRest:!l}),c(!l),s(!1)},h=()=>i(!0),g=()=>{e.setSelectedDayIndex(null),r.mutate(e.day.id),i(!1)},y=()=>i(!1),v=3,x=20,S=1e3,C=_o().shape({name:Ro().max(x,t("forms.maxLength",{chars:x})).min(v,t("forms.minLength",{chars:v})).required("Name is required"),description:Ro().max(S,t("forms.maxLength",{chars:S})),isRest:mu(),needsLogsToAdvance:mu()}),I=E=>n.mutate({id:e.day.id,routine:e.routineId,...E.name!==void 0&&{name:E.name},...E.description!==void 0&&{description:E.description},...E.isRest!==void 0&&{is_rest:l},...E.needsLogsToAdvance!==void 0&&{need_logs_to_advance:E.needsLogsToAdvance}});return b(xt,{children:b(ci,{initialValues:{name:e.day.name,description:e.day.description,isRest:e.day.isRest,needsLogsToAdvance:e.day.needLogsToAdvance},validationSchema:C,onSubmit:(E,{setSubmitting:T})=>{I(E),T(!1)},initialTouched:{name:!0,description:!0,isRest:!0,needsLogsToAdvance:!0},children:E=>Q(Zo,{children:[Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:6},children:b(Ru,{fieldName:"name",title:"Name",fieldProps:{disabled:l}})}),b(ye,{size:{xs:6,sm:2},children:b(ba,{control:b(li,{checked:l,onChange:u}),label:t("routines.restDay")})}),Q(ye,{size:{xs:6,sm:4},children:[b(ba,{disabled:l,control:b(li,{checked:E.values.needsLogsToAdvance,...E.getFieldProps("needsLogsToAdvance")}),label:t("routines.needsLogsToAdvance")}),b(Do,{title:t("routines.needsLogsToAdvanceHelpText"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]}),b(ye,{size:12,children:b(Ru,{fieldName:"description",title:"Description",fieldProps:{multiline:!0,rows:4,disabled:l}})}),Q(ye,{size:8,children:[n.isPending?b(CCt,{loading:!0,variant:"contained",color:"primary",children:t("save")}):b(at,{variant:"contained",color:"primary",type:"submit",disabled:l,children:t("save")})," ",b(at,{variant:"outlined",startIcon:b(W0,{}),onClick:h,disabled:n.isPending,children:t("delete")})]}),b(ye,{size:4,sx:{display:"flex",justifyContent:"flex-end"},children:b(Zvt,{routineId:e.routineId})})]}),Q($w,{open:a,onClose:d,children:[b(cE,{children:t("routines.confirmRestDay")}),b(Lw,{children:t("routines.confirmRestDayHelpText")}),Q(Nw,{children:[b(at,{onClick:d,children:t("cancel")}),b(at,{onClick:f,children:t("continue")})]})]}),b(aO,{title:t("deleteConfirmation",{name:e.day.getDisplayName()}),message:t("routines.deleteDayConfirmation"),isOpen:o,closeFn:y,deleteFn:g})]})})})},PCt=e=>{const{t}=Re(),n=drt(e.routineId),[r,o]=w.useState(e.slot.comment),[i,a]=w.useState(!1),s=c=>{a(!0),o(c)},l=()=>{i&&(n.mutate({id:e.slot.id,comment:r}),a(!1))};return b(xt,{children:b(tn,{label:t("comment"),variant:"standard",fullWidth:!0,size:"small",value:r,disabled:n.isPending,onChange:c=>s(c.target.value),onBlur:l,InputProps:{endAdornment:n.isPending&&b(zp,{})}})})},ICt={weight:{edit:Mnt,add:Ant,delete:Rnt},"max-weight":{edit:Dnt,add:_nt,delete:$nt},reps:{edit:Nnt,add:Lnt,delete:Fnt},"max-reps":{edit:jnt,add:vY,delete:Bnt},sets:{edit:znt,add:Vnt,delete:Hnt},"max-sets":{edit:Unt,add:Wnt,delete:vY},rest:{edit:Ynt,add:Qnt,delete:Xnt},"max-rest":{edit:Jnt,add:Znt,delete:ert},rir:{edit:nle,add:rle,delete:ole},"max-rir":{edit:Gnt,add:qnt,delete:Knt}},GX=e=>{var C,I,E,T;const{t}=Re(),{edit:n,add:r,delete:o}=ICt[e.type],i=n(e.routineId),a=r(e.routineId),s=o(e.routineId),[l,c]=w.useState(((C=e.config)==null?void 0:C.value)||""),[u,d]=w.useState(null),[f,h]=w.useState(null),g=["sets","max-sets","rir","max-rir","rest","max-rest"].includes(e.type),y=g?parseInt:parseFloat,v=O=>{const A={slot_entry:e.slotEntryId,value:y(O)};O===""?e.config&&s.mutate(e.config.id):e.config?i.mutate({id:e.config.id,...A}):a.mutate({iteration:1,operation:Li,step:"abs",requirements:null,...A})},x=O=>{if(c(O),O!==""&&Number.isNaN(y(O))){d(t(g?"forms.enterInteger":"forms.enterNumber"));return}else d(null);f&&clearTimeout(f),h(setTimeout(()=>v(O),nte))},S=i.isPending||a.isPending||s.isPending;return b(tn,{slotProps:{input:{endAdornment:S&&b(zp,{})}},inputProps:{"data-testid":`${e.type}-field`},label:e.type,value:l,fullWidth:!0,variant:"standard",disabled:S,onChange:O=>x(O.target.value),error:!!u||i.isError||a.isError||s.isError,helperText:u||((I=i.error)==null?void 0:I.message)||((E=a.error)==null?void 0:E.message)||((T=s.error)==null?void 0:T.message)})},TCt=e=>{const{setFieldValue:t}=uz(),{t:n}=Re(),r=e.disabled??!1,[o,i]=w.useState(e.values),[a,s]=X.useState(null),l=u=>{o.includes(u)?i(o.filter(d=>d!==u)):i([...o,u])},c=async()=>{await t(e.fieldName,o),s(null)};return Q(xt,{children:[b(on,{disabled:r,onClick:u=>s(u.currentTarget),children:a?b(brt,{fontSize:"small"}):b(Grt,{fontSize:"small"})}),Q(Sa,{anchorEl:a,open:!!a,onClose:()=>s(null),children:[...$2.map((u,d)=>Q(Ft,{onClick:()=>l(u),children:[b(si,{children:o.includes(u)?b(Ert,{fontSize:"small"}):b(Prt,{fontSize:"small"})}),b(uo,{children:u})]})),b(Ti,{}),b(Ft,{children:b(at,{color:"primary",variant:"contained",type:"submit",size:"small",onClick:c,children:n("save")})})]})]})},OCt=e=>{var i;const t=nle(e.routineId),n=ole(e.routineId),r=rle(e.routineId),o=a=>{const s={value:parseFloat(a)};a===""?e.config&&n.mutate(e.config.id):e.config!==void 0?t.mutate({id:e.config.id,...s}):r.mutate({slot_entry:e.slotEntryId,iteration:1,operation:Li,...s})};return b(tn,{fullWidth:!0,select:!0,label:"RiR",variant:"standard",defaultValue:"",value:(i=e.config)==null?void 0:i.value,disabled:t.isPending,onChange:a=>o(a.target.value),children:Ste.map(a=>b(Ft,{value:a.value,children:a.label},a.value))})};function kCt(e){let t="";for(;e>0;)e--,t=String.fromCharCode(97+e%26)+t,e=Math.floor(e/26);return t}const dl=(e,t,n,r)=>t.length>0?b(GX,{config:t[0],type:e,routineId:n}):b(GX,{type:e,routineId:n,slotEntryId:r}),MCt=e=>{const{t}=Re();return Q(xt,{children:[e.slot.entries.length===0&&Q(Ii,{severity:"warning",children:[b(hg,{children:t("routines.setHasNoExercises")}),t("nothingHereYetAction")]}),e.slot.entries.map((n,r)=>b(ACt,{slotEntry:n,routineId:e.routineId,simpleMode:e.simpleMode,index:r,total:e.slot.entries.length},n.id))]})},ACt=e=>{var g;const{t,i18n:n}=Re(),[r,o]=w.useState(!1),i=()=>o(!r),a=$c(),s=U0(e.routineId),l=srt(e.routineId),c=s.isPending||l.isPending,u=y=>{y!==null&&(s.mutate({id:e.slotEntry.id,exercise:y.data.base_id}),o(!1))};let d;a.isSuccess&&(d=Tu(n.language,a.data));const f=()=>e.simpleMode?Q(X.Fragment,{children:[b(ye,{size:{xs:12,sm:2},children:dl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)},`sets-config-${e.slotEntry.id}`),b(ye,{size:{xs:12,sm:3},children:dl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)},`weight-config-${e.slotEntry.id}`),b(ye,{size:{xs:12,sm:3},children:dl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)},`reps-config-${e.slotEntry.id}`)]}):Q(X.Fragment,{children:[b(ye,{size:{xs:6,sm:1},children:dl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:1},children:dl("max-sets",e.slotEntry.maxNrOfSetsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},children:b(Yvt,{routineId:e.routineId,slotEntry:e.slotEntry})}),b(ye,{size:{xs:12,sm:2},children:b(OCt,{routineId:e.routineId,config:e.slotEntry.rirConfigs.length>0?e.slotEntry.rirConfigs[0]:void 0,slotEntryId:e.slotEntry.id})}),b(ye,{size:{xs:6,sm:1},children:dl("rest",e.slotEntry.restTimeConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:1},children:dl("max-rest",e.slotEntry.maxRestTimeConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},offset:{sm:4},children:dl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},children:dl("max-weight",e.slotEntry.maxWeightConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:12,sm:4},children:b(Xvt,{slotEntry:e.slotEntry,routineId:e.routineId})}),b(ye,{size:{xs:6,sm:2},offset:{sm:4},children:dl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},children:dl("max-reps",e.slotEntry.maxRepetitionsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:12,sm:4},children:b(Qvt,{slotEntry:e.slotEntry,routineId:e.routineId})})]}),h=e.total>1?kCt(e.index+1)+") ":"";return b(X.Fragment,{children:Q(ye,{container:!0,paddingTop:1,spacing:1,children:[Q(ye,{size:{xs:3,sm:1},alignContent:"center",children:[b(on,{size:"small",onClick:i,disabled:c,children:r?b(Art,{}):b(hz,{})}),b(on,{size:"small",onClick:()=>l.mutate(e.slotEntry.id),disabled:c,children:b(kP,{})})]}),b(ye,{size:{xs:9,sm:3},alignContent:"center",children:Q(tt,{variant:"body1",children:[h," ",(g=e.slotEntry.exercise)==null?void 0:g.getTranslation(d).name]})}),r&&Q(X.Fragment,{children:[b(ye,{size:{xs:12,sm:8},children:b(ty,{callback:u})}),b(ye,{size:{xs:12,sm:4}})]}),e.slotEntry.hasProgressionRules?b(ye,{size:8,children:b(Ii,{severity:"info",variant:"standard",sx:{mt:2},children:t("routines.exerciseHasProgression")})}):f()]})})},RCt=e=>{const{t}=Re(),n=_c(e.routineId),r=nrt(e.routineId),o=rrt(e.routineId),i=u=>({background:u?"lightblue":void 0}),a=(u,d)=>({backgroundColor:"white",margin:4,...d,opacity:1}),s=()=>{e.setSelectedDayIndex(null)},l=u=>{if(!u.destination)return;const d=Array.from(n.data.days),[f]=d.splice(u.source.index,1);d.splice(u.destination.index,0,f),e.setSelectedDayIndex(u.destination.index),n.data.days=d,r.mutate(d.map((h,g)=>({id:h.id,order:g+1})))},c=async()=>{const u={routine:e.routineId,name:`${t("routines.newDay")} ${n.data.days.length+1}`,order:n.data.days.length+1,is_rest:!1,need_logs_to_advance:!1};await o.mutateAsync(u),e.setSelectedDayIndex(n.data.days.length)};return n.isLoading?b(wr,{}):Q(ye,{container:!0,direction:"row",spacing:1,children:[b(ye,{size:12,children:b(_t,{direction:"row",children:Q(zde,{onDragEnd:l,onDragStart:s,children:[b(Xde,{droppableId:"dayDroppable",direction:"horizontal",children:(u,d)=>Q(Cee,{ref:u.innerRef,...u.droppableProps,value:e.selectedDayIndex,variant:"scrollable",scrollButtons:"auto",style:i(d.isDraggingOver),children:[n.data.days.map((f,h)=>b(Gde,{draggableId:f.id.toString(),index:h,children:(g,y)=>b(w2,{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,style:a(y.isDragging,g.draggableProps.style??{}),label:f.getDisplayName(),value:f.id,icon:b(lle,{}),iconPosition:"start",onClick:()=>e.setSelectedDayIndex(h)})},f.id)),u.placeholder]})}),b(at,{startIcon:o.isPending?b(zp,{}):b($o,{}),onClick:c,disabled:o.isPending,children:t("routines.addDay")})]})})}),n.data.days.length===0&&b(ye,{size:12,children:Q(Ii,{severity:"info",children:[b(hg,{children:t("routines.routineHasNoDays")}),t("nothingHereYetAction")]})})]})},DCt=e=>{const[t,n]=Re(),r=prt(e.routineId),o=art(e.routineId),i=urt(e.routineId),a=frt(e.routineId),s=Pa(),l=Lr(),[c,u]=w.useState(!1),[d,f]=w.useState(null),[h,g]=w.useState(null),[y,v]=w.useState(!0),x=(k,M)=>{h!==null&&(M==="timeout"?(r.mutate(h.id),g(null)):M!=="clickaway"&&(e.day.slots=[...e.day.slots,h].sort((R,$)=>R.order-$.order),g(null))),u(!1)},S=k=>{const M=e.day.slots.findIndex(R=>R.id===k);if(M!==-1){const R=[...e.day.slots],[$]=R.splice(M,1);e.day.slots=R,g($),u(!0)}},C=k=>{if(e.day.slots.find(R=>R.id===k)===void 0){console.info(`Could not find slot with id ${k} to add config`);return}f(d===k?null:k)},I=()=>i.mutate({day:e.day.id,order:e.day.slots.length+1}),E=8,T=k=>{if(!k.destination)return;const M=Array.from(e.day.slots),[R]=M.splice(k.source.index,1);M.splice(k.destination.index,0,R),a.mutate(M.map(($,L)=>({id:$.id,order:L+1}))),e.day.slots=M},O=k=>({background:k?"lightblue":void 0}),A=(k,M)=>({border:k?`1px solid ${l.palette.grey[900]}`:`1px solid ${l.palette.grey[300]}`,backgroundColor:"white",marginBottom:E,...M});return Q(xt,{children:[b(ECt,{routineId:e.routineId,day:e.day,setSelectedDayIndex:e.setSelectedDayIndex},`day-form-${e.day.id}`),!e.day.isRest&&e.day.slots.length>0&&Q(xt,{children:[b(en,{height:40}),b(ba,{control:b(li,{checked:y,onChange:()=>v(!y)}),label:t("routines.simpleMode")})]}),b(en,{height:20}),b(zde,{onDragEnd:T,children:b(Xde,{droppableId:"setDroppable",direction:"vertical",children:(k,M)=>b("div",{...k.droppableProps,ref:k.innerRef,style:O(M.isDraggingOver),children:e.day.slots.map((R,$)=>Q(X.Fragment,{children:[b(Gde,{draggableId:R.id.toString(),index:$,children:(L,z)=>Q(ye,{container:!0,padding:1,ref:L.innerRef,...L.draggableProps,style:A(z.isDragging,L.draggableProps.style??{}),children:[b(ye,{sx:{backgroundColor:l.palette.common.white},size:12,children:Q(ye,{container:!0,justifyContent:"space-between",alignItems:"center",children:[b(ye,{children:Q(tt,{variant:"h6",children:[b(on,{...L.dragHandleProps,children:b(lle,{})}),b(on,{onClick:()=>S(R.id),children:b(W0,{})}),R.entries.length>1?t("routines.supersetNr",{number:$+1}):t("routines.exerciseNr",{number:$+1})]})}),b(ye,{children:R.entries.length>0&&Q(GF,{variant:"outlined",children:[b(at,{onClick:()=>C(R.id),size:"small",disabled:o.isPending,startIcon:o.isPending?b(zp,{}):b($o,{}),children:t("routines.addSuperset")}),R.entries.length>0&&b(at,{startIcon:b(Krt,{}),component:io,size:"small",to:Qt(Kt.ROUTINE_EDIT_PROGRESSION,n.language,{id:e.routineId,id2:R.id}),children:t("routines.editProgression")})]})})]})}),!y&&Q(ye,{size:12,children:[b(PCt,{routineId:e.routineId,slot:R},`slot-form-${R.id}`),b(en,{height:10})]}),b(ye,{size:12,children:b(MCt,{slot:R,routineId:e.routineId,simpleMode:y})}),(d===R.id||R.entries.length===0)&&Q(ye,{size:12,children:[b(en,{height:20}),b(ty,{callback:N=>{N!==null&&(o.mutate({slot:R.id,exercise:N.data.base_id,type:"normal",order:R.entries.length+1,weight_unit:s.data.useMetric?Nke:Lke}),f(null))}})]})]})},R.id),b(en,{height:0,children:k.placeholder})]},`slot-${R.id}-${$}`))})})}),b(II,{open:c,autoHideDuration:NI,onClose:x,children:b(Ii,{severity:"success",variant:"filled",sx:{width:"100%"},action:b(at,{color:"warning",variant:"contained",size:"small",onClick:x,children:t("undo")}),children:"Set successfully deleted"})}),!e.day.isRest&&b(at,{variant:"contained",color:"primary",startIcon:i.isPending?b(zp,{}):b($o,{}),onClick:I,children:t("routines.addExercise")})]})},_Ct=()=>{var c;const{t:e,i18n:t}=Re(),n=Lr(),r=Pa(),o=Ea(),i=o.routineId?parseInt(o.routineId):0,a=_c(i),[s,l]=w.useState(null);return a.isLoading||r.isLoading?b(wr,{}):a.isError?Q("p",{children:["Error: ",a.error.message]}):(s===null&&a.data.days.length>0&&l(0),Q(J0,{title:e("editName",{name:(c=a.data)==null?void 0:c.name}),backToUrl:Qt(Kt.ROUTINE_DETAIL,t.language,{id:i}),children:[Q(ye,{container:!0,children:[b(ye,{size:12,children:b(Zz,{routine:a.data})}),Q(ye,{size:12,children:[b(en,{height:20}),b(RCt,{routineId:i,selectedDayIndex:s,setSelectedDayIndex:l})]}),s!==null&&b(xt,{children:b(ye,{size:12,sx:{backgroundColor:n.palette.grey[100],padding:1},children:b(en,{children:b(DCt,{day:a.data.days[s],routineId:i,setSelectedDayIndex:l})})})})]}),a.data.days.length>0&&Q(_t,{spacing:2,sx:{mt:2},children:[b(en,{height:40}),b(tt,{variant:"h4",children:e("routines.resultingRoutine")}),b(Ti,{}),Q(en,{children:[b(Eit,{}),b(en,{height:20}),b(Fue,{routine:a.data})]})]})]}))},$Ct=({initialSession:e,dayId:t,routineId:n,selectedDate:r,setSelectedDate:o})=>{let i;const[a,s]=Re(),[l,c]=X.useState(e),u=mrt(),d=grt(l==null?void 0:l.id),f=hrt(n,{routine:n,date:co(r.toJSDate()),day:t}),h=u.isPending||d.isPending||f.isLoading,g=_o({notes:Ro().max(y3,a("forms.maxLength",{chars:y3})),date:wc().required(),start:wc().nullable(),end:wc().nullable().min(dz("start"),a("forms.endBeforeStart")),fitInWeek:mu()});return w.useEffect(()=>{f.data?(i.setValues({notes:f.data.notes||"",impression:f.data.impression||ib,date:f.data.date,start:f.data.timeStart?yt.fromJSDate(f.data.timeStart):null,end:f.data.timeEnd?yt.fromJSDate(f.data.timeEnd):null}),c(f.data)):f.isSuccess&&!f.data&&(i.setValues({notes:"",impression:ib,date:(e==null?void 0:e.date)||yt.now().toJSDate(),start:e!=null&&e.timeStart?yt.fromJSDate(e.timeStart):null,end:e!=null&&e.timeEnd?yt.fromJSDate(e.timeEnd):null}),c(void 0))},[f.data,f.isSuccess,e,r]),b(ci,{enableReinitialize:!0,initialValues:{notes:l!==void 0?l.notes:"",date:l!==void 0?l.date:new Date,start:l!==void 0&&l.timeStart!==null?yt.fromJSDate(l.timeStart):null,end:l!==void 0&&l.timeEnd!==null?yt.fromJSDate(l.timeEnd):null,impression:l!==void 0?l.impression:ib},innerRef:y=>i=y,validationSchema:g,onSubmit:async y=>{const v={day:t,routine:n,date:co(r.toJSDate()),notes:y.notes,impression:y.impression,time_start:y.start?Bw(y.start.toJSDate()):null,time_end:y.end?Bw(y.end.toJSDate()):null};l!==void 0?await d.mutateAsync({...v,id:l.id}):await u.mutateAsync(v)},children:y=>b(Zo,{children:Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:6},children:b(vc,{dateAdapter:pu,adapterLocale:s.language,children:b(kx,{value:r,defaultValue:yt.now(),label:a("date"),onChange:v=>{v&&(y.setFieldValue("date",v),o(v))},disableFuture:!0,slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.date&&!!y.errors.date}}})})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:s.language,children:b(vL,{label:a("start"),...y.getFieldProps("start"),onChange:v=>{v&&y.setFieldValue("start",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start}}})})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:s.language,children:b(vL,{label:a("end"),...y.getFieldProps("end"),onChange:v=>{v&&y.setFieldValue("end",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end}}})})}),b(ye,{size:12,children:b(Ru,{fieldName:"notes",title:a("notes"),fieldProps:{multiline:!0,rows:4}})}),Q(ye,{size:12,children:[b(tt,{variant:"caption",children:a("routines.impression")}),Q(GF,{fullWidth:!0,color:"primary",children:[Q(at,{size:"small",color:"info",variant:y.values.impression===v3?"contained":"outlined",onClick:()=>y.setFieldValue("impression",v3),children:[b(Wrt,{}),a("routines.impressionBad")]}),Q(at,{size:"small",color:"info",variant:y.values.impression===ib?"contained":"outlined",onClick:()=>y.setFieldValue("impression",ib),children:[b(Hrt,{}),a("routines.impressionNeutral")]}),Q(at,{size:"small",color:"info",variant:y.values.impression===b3?"contained":"outlined",onClick:()=>y.setFieldValue("impression",b3),children:[b(Urt,{}),a("routines.impressionGood")]})]})]}),b(ye,{size:12,display:"flex",justifyContent:"end",children:b(at,{disabled:h,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:a("submit")})})]})})})},NCt=({dayId:e,routineId:t,selectedDate:n})=>{const{t:r,i18n:o}=Re(),[i,a]=w.useState(!1),s=_c(t),l=irt(t),c=$c(),u=()=>a(!1),[d,f]=w.useState(null);let h;if(c.isSuccess&&(h=Tu(o.language,c.data)),s.isLoading)return b(wr,{});const g=s.data,y=(g==null?void 0:g.getDayData(e,n.toJSDate()))??[],v=y.length===0,x=_o({logs:Dp().of(_o().shape({rir:wo().nullable(),repetitions:wo().typeError(r("forms.enterNumber")).nullable(),weight:wo().typeError(r("forms.enterNumber")).nullable()}))}),S=async T=>{const O=v?null:y[0].iteration,A=T.logs.filter(k=>k.rir!==""||k.repetitions!==""||k.weight!=="").map(k=>{var M,R,$;return{date:n.toISO(),iteration:O,exercise:(M=k.exercise)==null?void 0:M.id,day:e,routine:t,slot_entry:k.slotEntry,rir:k.rir!==""?k.rir:null,rir_target:k.rirTarget!==""?k.rirTarget:null,repetitions_unit:(R=k.repetitionsUnit)==null?void 0:R.id,repetitions:k.repetitions!==""?k.repetitions:null,repetitions_target:k.repetitionsTarget!==""?k.repetitionsTarget:null,weight_unit:($=k.weightUnit)==null?void 0:$.id,weight:k.weight!==""?k.weight:null,weight_target:k.weightTarget!==""?k.weightTarget:null}});await l.mutateAsync(A),a(!0)},C=async(T,O)=>{if(T===null)return;const A=O.values.logs.map(k=>d===k.exercise.id?{...k,weight:"",weightTarget:"",repetitions:"",repetitionsTarget:"",rir:"",rirTarget:"",exercise:T.exercise}:k);await O.setValues({...O.values,logs:A}),f(null)},I={logs:[]},E=v?g.dayDataCurrentIteration.filter(T=>T.day.id===e):y;for(const T of E)for(const O of T.slots)for(const A of O.setConfigs)for(let k=0;k<A.nrOfSets;k++)I.logs.push({exercise:A.exercise,repetitionsUnit:A.repetitionsUnit,weightUnit:A.weightUnit,slotEntry:A.slotEntryId,rir:!v&&A.rir!==null?A.rir:"",rirTarget:!v&&A.rir!==null?A.rir:"",repetitions:!v&&A.repetitions!==null?A.repetitions:"",repetitionsTarget:!v&&A.repetitions!==null?A.repetitions:"",weight:!v&&A.weight!==null?A.weight:"",weightTarget:!v&&A.weight!==null?A.weight:""});return Q(xt,{children:[v&&b(Ii,{severity:"info",sx:{marginTop:2},children:r("routines.weightLogNotPlanned")}),b(ci,{enableReinitialize:!0,initialValues:I,validationSchema:x,onSubmit:S,children:T=>Q(Zo,{children:[b(jse,{name:"logs",children:({insert:O,remove:A,push:k})=>b(xt,{children:T.values.logs.map((M,R)=>{var $,L,z,N;return Q(ye,{container:!0,spacing:1,sx:{mt:2},children:[(R===0||R>0&&T.values.logs[R-1].exercise.id!=T.values.logs[R].exercise.id)&&Q(xt,{children:[Q(ye,{size:12,children:[d!==T.values.logs[R].exercise.id&&b(tt,{variant:"h6",children:($=T.values.logs[R].exercise)==null?void 0:$.getTranslation(h).name}),d===T.values.logs[R].exercise.id&&b(ty,{loadExercise:!0,callback:B=>C(B,T)})]}),Q(ye,{size:12,children:[Q(at,{type:"button",size:"small",onClick:()=>O(R,{exercise:T.values.logs[R].exercise,repetitions:T.values.logs[R].repetitions,weight:T.values.logs[R].weight}),children:[b($o,{}),r("routines.addAdditionalLog")]}),Q(at,{type:"button",size:"small",onClick:()=>{d===T.values.logs[R].exercise.id?f(null):f(T.values.logs[R].exercise.id)},children:[b(Yrt,{}),r("exercises.swapExercise")]}),Q(at,{type:"button",size:"small",onClick:async()=>await T.setValues({...T.values,logs:T.values.logs.filter(B=>B.exercise.id!==T.values.logs[R].exercise.id)}),children:[b(kP,{}),r("delete")]})]})]}),b(ye,{size:4,children:b(Ru,{fieldName:`logs.${R}.repetitions`,title:r("server.repetitions"),fieldProps:{slotProps:{input:{endAdornment:b(ro,{position:"end",children:((L=T.values.logs[R].repetitionsUnit)==null?void 0:L.id)!==$ke?b(tt,{variant:"caption",children:(z=T.values.logs[R].repetitionsUnit)==null?void 0:z.name}):null})}}}})}),b(ye,{size:4,children:b(Ru,{fieldName:`logs.${R}.weight`,title:r("weight"),fieldProps:{slotProps:{input:{endAdornment:b(ro,{position:"end",children:b(tt,{variant:"caption",children:(N=T.values.logs[R].weightUnit)==null?void 0:N.name})})}}}})}),b(ye,{size:3,children:b(tn,{fullWidth:!0,select:!0,label:r("routines.rir"),variant:"standard",...T.getFieldProps(`logs.${R}.rir`),children:Ste.map(B=>b(Ft,{value:B.value,children:B.label},B.value))})}),b(ye,{size:1,children:b(on,{size:"small",onClick:()=>A(R),children:b(kP,{})})})]},R)})})}),b(ye,{container:!0,spacing:2,children:b(ye,{size:12,display:"flex",justifyContent:"end",children:b(at,{color:"primary",disabled:!T.isValid||T.isSubmitting||l.isPending,variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})})]})}),b(II,{open:i,autoHideDuration:NI,onClose:u,children:b(Ii,{onClose:u,severity:"success",sx:{width:"100%"},children:r("success")})})]})},LCt=()=>{const e=Ea(),{t,i18n:n}=Re(),[r,o]=w.useState(yt.now()),i=parseInt(e.routineId??"");if(Number.isNaN(i))return b("p",{children:"Please pass an integer as the routine id."});const a=parseInt(e.dayId??"");return Number.isNaN(a)?b("p",{children:"Please pass an integer as the day id."}):b(es,{title:t("routines.addWeightLog"),backToUrl:Qt(Kt.ROUTINE_DETAIL,n.language,{id:i}),mainContent:Q(_t,{children:[b($Ct,{routineId:i,dayId:a,selectedDate:r,setSelectedDate:o}),b(tt,{variant:"h5",children:t("exercises.exercises")}),b(tt,{variant:"body2",children:t("routines.impressionHelpText")}),b(NCt,{routineId:i,dayId:a,selectedDate:r})]})})},Mb=e=>{var y,v;const{t}=Re(),[n,r]=w.useState(!0),[o,i]=w.useState([]),a=knt(e.routineId),s=e.forceInteger??!1;let l,c,u="";switch(e.type){case"weight":l=bt.WEIGHT_CONFIG,c=bt.MAX_WEIGHT_CONFIG,u=t("weight");break;case"reps":l=bt.REPETITIONS_CONFIG,c=bt.MAX_REPS_CONFIG,u=t("server.repetitions");break;case"sets":l=bt.NR_OF_SETS_CONFIG,c=bt.MAX_NR_OF_SETS_CONFIG,u=t("routines.sets");break;case"rest":l=bt.REST_CONFIG,c=bt.MAX_REST_CONFIG,u=t("routines.restTime");break;case"rir":l=bt.RIR_CONFIG,c=bt.MAX_RIR_CONFIG,u=t("routines.rir");break}const d=_o({entries:Dp().of(_o().shape({edited:mu(),iteration:wo().required(),value:wo().when("forceInteger",{is:!0,then:x=>x.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:x=>x.typeError(t("forms.enterNumber")).nullable().notRequired()}),valueMax:wo().typeError(t("forms.enterNumber")).nullable().when("forceInteger",{is:!0,then:x=>x.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:x=>x.typeError(t("forms.enterNumber")).nullable().notRequired()}).when("operation",{is:Li,then:x=>x.min(dz("value"),t("forms.maxLessThanMin")),otherwise:x=>x}),operation:Ro().required(),operationMax:Ro().required(),requirements:Dp().of(Ro().oneOf($2)),requirementsMax:Dp().of(Ro().oneOf($2)),repeat:mu(),repeatMax:mu()})).test("inter-entry-validation","Your error message here",function(x,S){const{createError:C}=this,I=x;for(let E=0;E<I.length;E++){const T=I[E];if(T.iteration>1&&T.operation!==Li){let O=!1,A=!1;for(let k=0;k<E;k++)I[k].operation===Li&&I[k].value!==""&&I[k].edited&&(O=!0),I[k].operation===Li&&I[k].valueMax!==""&&I[k].edited&&(A=!0);if(!O)return C({path:`entries[${E}].value`,message:t("routines.progressionNeedsReplace")});if(!A)return C({path:`entries[${E}].valueMax`,message:t("routines.progressionNeedsReplace")})}}return!0})}),f=(x,S)=>({forceInteger:s,edited:S,iteration:x,id:null,idMax:null,value:"",valueMax:"",operation:Li,operationMax:Li,step:"abs",stepMax:"abs",requirements:[],requirementsMax:[],repeat:!1,repeatMax:!1}),h={entries:[]};for(const x of e.iterations){const S=e.configs.find(I=>I.iteration===x),C=e.configsMax.find(I=>I.iteration===x);S===void 0?h.entries.push(f(x,!1)):h.entries.push({forceInteger:s,edited:!0,id:S.id,idMax:C===void 0?null:C.id,iteration:x,value:String(S.value),valueMax:C===void 0?"":String(C.value),operation:S.operation,operationMax:C===void 0?Li:S.operation,step:S.step,stepMax:C===void 0?"abs":C.step,requirements:((y=S.requirements)==null?void 0:y.rules)??[],requirementsMax:C===void 0?[]:((v=C.requirements)==null?void 0:v.rules)??[],repeat:S.repeat,repeatMax:C===void 0?!1:S.repeat})}const g=x=>{const S=x.entries.filter(k=>k.edited),C=S.filter(k=>k.id!==null).map(k=>({id:k.id,slot_entry:e.slotEntryId,value:k.value,iteration:k.iteration,operation:k.operation,step:k.step,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),I=S.filter(k=>k.id===null&&k.value!=="").map(k=>({slot_entry:e.slotEntryId,value:k.value,iteration:k.iteration,operation:k.operation,step:k.step,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),E=e.configs.filter(k=>o.includes(k.iteration)).map(k=>k.id);S.forEach(k=>{k.value===""&&k.id!==null&&!E.includes(k.id)&&E.push(k.id)});const T=S.filter(k=>k.idMax!==null&&k.valueMax!=="").map(k=>({id:k.idMax,slot_entry:e.slotEntryId,value:k.valueMax,iteration:k.iteration,operation:k.operation,step:k.step,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),O=S.filter(k=>k.idMax===null&&k.valueMax!=="").map(k=>({iteration:k.iteration,slot_entry:e.slotEntryId,value:k.valueMax,operation:k.operation,step:k.stepMax,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),A=e.configsMax.filter(k=>o.includes(k.iteration)).map(k=>k.id);S.forEach(k=>{k.valueMax===""&&k.idMax!==null&&!E.includes(k.idMax)&&A.push(k.idMax)}),a.mutate({toAdd:I,toDelete:E,toEdit:C,apiPath:l}),a.mutate({toAdd:O,toDelete:A,toEdit:T,apiPath:c})};return b(xt,{children:Q(_t,{sx:{width:"100%"},children:[b(tt,{variant:"h6",children:u}),b(ci,{enableReinitialize:!0,initialValues:h,validationSchema:d,onSubmit:(x,{setSubmitting:S})=>{g(x),S(!1)},children:x=>b(Zo,{children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:4,offset:2,textAlign:"center",children:t("value")}),b(ye,{size:6,children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:3,children:t("routines.operation")}),b(ye,{size:3,children:t("routines.step")}),Q(ye,{size:3,textAlign:"center",children:[t("routines.requirements"),b("br",{}),b(Do,{title:t("routines.requirementsHelpText"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]}),Q(ye,{size:3,textAlign:"center",children:[t("routines.repeat"),b("br",{}),b(Do,{title:t("routines.repeatHelpText"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]})]})}),b(ye,{size:12,children:b(Ti,{})}),b(jse,{name:"entries",validateOnChange:!0,children:({insert:S,remove:C})=>b(xt,{children:x.values.entries.map((I,E)=>Q(X.Fragment,{children:[Q(ye,{size:2,display:"flex",justifyContent:"space-around",alignItems:"center",children:[e.cycleLength===7?t("routines.weekNr",{number:I.iteration}):t("routines.workoutNr",{number:I.iteration}),I.edited?b(on,{disabled:I.iteration===1&&x.values.entries.filter(T=>T.edited&&T.iteration!==1).length>0,size:"small",onClick:()=>{I.id!==null&&i([...o,I.iteration]),C(E),S(E,f(I.iteration,!1))},children:b(W0,{})}):b(on,{size:"small",onClick:()=>{C(E),S(E,f(I.iteration,!0))},children:b($o,{})})]}),b(ye,{size:2,children:I.edited&&b(Ru,{fieldName:`entries.${E}.value`,title:t("min"),fullwidth:!0})}),b(ye,{size:2,children:I.edited&&b(Ru,{fieldName:`entries.${E}.valueMax`,title:t("max"),fullwidth:!0})}),b(ye,{size:6,children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:3,children:I.edited&&b(tn,{disabled:I.iteration===1,fullWidth:!0,select:!0,label:t("routines.operation"),variant:"standard",...x.getFieldProps(`entries.${E}.operation`),onChange:async T=>{x.handleChange(T),T.target.value===Li&&(await x.setFieldValue(`entries.${E}.requirements`,[]),await x.setFieldValue(`entries.${E}.repeat`,!1))},children:fAe.map(T=>b(Ft,{value:T.value,children:T.label},T.value))})}),b(ye,{size:3,children:I.edited&&Q(tn,{disabled:I.iteration===1||I.operation===Li,fullWidth:!0,select:!0,label:t("routines.step"),variant:"standard",...x.getFieldProps(`entries.${E}.step`),children:[dAe.map(T=>b(Ft,{value:T.value,children:T.label},T.value)),(I.iteration===1||I.operation===Li)&&b(Ft,{value:"na",children:"n/a"},"na")]})}),Q(ye,{size:3,textAlign:"center",children:[I.edited&&b(TCt,{disabled:I.iteration===1||I.operation===Li,values:I.requirements,fieldName:`entries.${E}.requirements`}),I.requirements.length>=0&&b("br",{}),I.requirements.length>=0&&I.requirements.map((T,O)=>Q(tt,{variant:"caption",children:[T," "]},O))]}),b(ye,{size:3,textAlign:"center",children:I.edited&&b(li,{checked:x.values.entries[E].repeat,...x.getFieldProps(`entries.${E}.repeat`),disabled:I.iteration===1||I.operation===Li})})]})})]},E))})}),b(ye,{size:12,display:"flex",justifyContent:"end",children:b(at,{color:"primary",disabled:!x.isValid||x.isSubmitting||!x.dirty,variant:"contained",type:"submit",sx:{mt:2},children:t("save")})}),b(ye,{size:12,children:b(en,{height:20})})]})})})]})})},FCt=()=>{const{t:e,i18n:t}=Re(),n=Ea(),r=n.routineId?parseInt(n.routineId):-1,o=n.slotId?parseInt(n.slotId):-1,i=_c(r),a=$c();if(i.isLoading)return b(wr,{});const s=i.data;let l;a.isSuccess&&(l=Tu(t.language,a.data));let c=null;for(const d of s.days){const f=d.slots.find(h=>h.id===o);if(f){c=f;break}}if(c===null)return b("p",{children:"Slot not found!"});const u=Object.keys(s.groupedDayDataByIteration).map(Number);return b(xt,{children:b(J0,{title:e("routines.editProgression"),backToUrl:Qt(Kt.ROUTINE_EDIT,t.language,{id:r}),children:c.entries.map(d=>{var f;return Q(X.Fragment,{children:[b(tt,{variant:"h5",gutterBottom:!0,children:(f=d.exercise)==null?void 0:f.getTranslation(l).name}),Q(ye,{container:!0,spacing:1,children:[b(ye,{size:2,display:"flex",alignItems:"end",children:b(tt,{variant:"body2",children:e("routines.rounding")})}),b(ye,{size:5,children:b(WP,{routineId:r,entryId:d.id,initialValue:d.weightRounding,rounding:"weight",editProfile:!1})}),b(ye,{size:5,children:b(WP,{routineId:r,entryId:d.id,initialValue:d.repetitionRounding,rounding:"reps",editProfile:!1})}),b(Mb,{type:"sets",configs:d.nrOfSetsConfigs,configsMax:d.maxNrOfSetsConfigs,slotEntryId:d.id,routineId:r,iterations:u,forceInteger:!0,cycleLength:s.cycleLength}),b(Mb,{type:"weight",configs:d.weightConfigs,configsMax:d.maxWeightConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),b(Mb,{type:"reps",configs:d.repetitionsConfigs,configsMax:d.maxRepetitionsConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),b(Mb,{type:"rir",configs:d.rirConfigs,configsMax:d.maxRirConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),b(Mb,{type:"rest",configs:d.restTimeConfigs,configsMax:d.maxRestTimeConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength})]})]},d.id)})})})},jCt=()=>{const{t:e,i18n:t}=Re(),n=Ea(),r=parseInt(n.routineId??"");if(Number.isNaN(r))return b("p",{children:"Please pass an integer as the routine id."});const o=_c(r),i=o.data;return b(UT,{query:o,child:o.isSuccess&&b(es,{title:i!=null&&i.isPublic?e("routines.publicTemplate"):e("routines.template"),subTitle:i.name,mainContent:Q(_t,{spacing:2,children:[Q(tt,{variant:"subtitle1",children:[i.start.toLocaleDateString()," - ",i.end.toLocaleDateString()," (",i.durationText,")"]}),i.description!==""&&b(tt,{variant:"body2",sx:{whiteSpace:"pre-line"},children:i==null?void 0:i.description}),b(at,{component:"a",href:Qt(Kt.ROUTINE_COPY,t.language,{id:r}),variant:"contained",children:e("routines.copyAndUseTemplate")}),i.dayDataCurrentIteration.filter(a=>a.day!==null).map((a,s)=>b(Cz,{dayData:a,routineId:r,readOnly:!0},`dayDetails-${s}`))]}),sideBar:Q(_t,{children:[b(en,{height:40}),Q(ye,{container:!0,children:[b(ye,{size:6,children:b(zl,{primaryMuscles:i.mainMuscles.filter(a=>a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>a.isFront),isFront:!0})}),b(ye,{size:6,children:b(zl,{primaryMuscles:i.mainMuscles.filter(a=>!a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>!a.isFront),isFront:!1})})]})]})})})},BCt=e=>{var u;const[t,n]=Re(),[r,o]=X.useState(null),i=!!r,a=d=>{o(d.currentTarget)},s=()=>{o(null)},l=()=>window.location.href=Qt(Kt.ROUTINE_EDIT_LOG,n.language,{id:e.log.id}),c=()=>window.location.href=Qt(Kt.ROUTINE_DELETE_LOG,n.language,{id:e.log.id});return Q(Zt,{children:[b(Te,{component:"th",scope:"row",children:yt.fromJSDate(e.log.date).toLocaleString(yt.DATE_MED)}),b(Te,{children:e.log.repetitions}),Q(Te,{children:[e.log.weight,(u=e.log.weightUnitObj)==null?void 0:u.name]}),b(Te,{children:e.log.rirString}),Q(Te,{children:[b(on,{"aria-label":"settings",onClick:a,children:b(gz,{fontSize:"small"})}),Q(Sa,{id:"basic-menu",anchorEl:r,open:i,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:[Q(Ft,{onClick:l,children:[b(hz,{}),t("edit")]}),Q(Ft,{onClick:c,children:[b(W0,{}),t("delete")]})]})]})]},e.log.id)},zCt=e=>{const{t}=Re();let n=e.logEntries??[];const r=[5,10,20],[o,i]=X.useState(r[0]),[a,s]=X.useState(0),l=(u,d)=>{s(d)},c=u=>{i(parseInt(u.target.value,10)),s(0)};return Q(xt,{children:[b(tt,{variant:"h6",sx:{mt:4},children:e.exercise.getTranslation().name}),Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,md:5},children:Q(jl,{children:[Q(Ll,{"aria-label":"simple table",size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("date")}),b(Te,{children:t("routines.reps")}),b(Te,{children:t("weight")}),b(Te,{children:t("routines.rir")}),b(Te,{})]})}),b(Fl,{children:n.slice(a*o,a*o+o).map(u=>b(BCt,{log:u},u.id))})]}),b(nj,{rowsPerPageOptions:r,component:"div",count:n.length,rowsPerPage:o,page:a,onPageChange:l,onRowsPerPageChange:c})]})}),b(ye,{size:{xs:12,md:7},children:b(UCt,{data:n},e.exercise.id)})]})]})},VCt=e=>e.map(t=>({id:t.id,value:t.weight,time:t.date.getTime(),entry:t})),HCt=({active:e,payload:t,label:n})=>{var r,o,i;if(e){let a="";return(r=t==null?void 0:t[1].payload)!=null&&r.entry.rir&&(a=`, ${(o=t==null?void 0:t[1].payload)==null?void 0:o.entry.rir} RiR`),b(fo,{children:Q(Pi,{children:[b(tt,{variant:"body1",children:yt.fromMillis(t==null?void 0:t[0].value).toLocaleString(yt.DATE_MED)}),Q(tt,{variant:"body2",children:[(i=t==null?void 0:t[1].payload)==null?void 0:i.entry.reps," × ",t==null?void 0:t[1].value,t==null?void 0:t[1].unit,a]})]})})}return null},UCt=e=>{let t;t=e.data.reduce(function(r,o){return r.set(o.repetitions,r.get(o.repetitions)||[]),r.get(o.repetitions).push(o),r},new Map);const n=cS(t.size);return b(en,{children:b(Fu,{width:"100%",height:250,children:Q(S8e,{children:[b(Xa,{dataKey:"time",domain:["auto","auto"],name:"Time",tickFormatter:r=>yt.fromMillis(r).toLocaleString(yt.DATE_MED),type:"number"}),b(Ja,{domain:["auto","auto"],dataKey:"value",name:"Value",unit:"kg"}),Array.from(t).map(([r,o])=>{const i=n.next().value,a=VCt(o);return b(N0,{data:a,fill:i,line:{stroke:i},lineType:"joint",lineJointType:"monotoneX",name:r.toString()},r)}),b(ua,{content:b(HCt,{})}),b(Sf,{strokeDasharray:"3 3"}),b(hc,{})]})})})},WCt=()=>{const e=Ea(),t=e.routineId?parseInt(e.routineId):0,[n,r]=Re(),o=ele(t),i=_c(t);if(o.isLoading||i.isLoading)return b(wr,{});let a=new Map;return console.log(o.data),a=o.data.reduce((s,l)=>(l.logs.forEach(c=>{const u=c.exerciseId;s.set(u,s.get(u)||[]),s.get(u).push(c)}),s),a),Q(J0,{title:n("routines.logsHeader"),backToUrl:Qt(Kt.ROUTINE_DETAIL,r.language,{id:t}),optionsMenu:b(Do,{title:n("routines.statsOverview"),children:b(on,{component:"a",href:Qt(Kt.ROUTINE_STATS_OVERVIEW,r.language,{id:t}),children:b(ale,{})})}),children:[b(tt,{variant:"body1",children:n("routines.logsFilterNote")}),i.data.dayDataCurrentIteration.filter(s=>s.day!==null&&!s.day.isRest).map((s,l)=>Q(X.Fragment,{children:[Q(_t,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:"center",sx:{mt:4},children:[b(tt,{variant:"h4",children:s.day.name}),b(at,{component:io,to:Qt(Kt.ROUTINE_ADD_LOG,r.language,{id:t,id2:s.day.id}),variant:"contained",children:n("routines.addLogToDay")})]}),s.slots.map(c=>c.exercises.map(u=>b(zCt,{exercise:u,logEntries:a.get(u.id)},u.id)))]},l))]})};var op=(e=>(e.Volume="volume",e.Sets="sets",e.Intensity="intensity",e))(op||{}),ip=(e=>(e.Mesocycle="mesocycle",e.Weekly="weekly",e.Iteration="iteration",e.Daily="daily",e))(ip||{}),ew=(e=>(e.Exercises="exercises",e.Muscles="muscles",e.Total="total",e))(ew||{});const D$=({label:e,options:t,value:n,onChange:r})=>Q(rh,{fullWidth:!0,children:[b(oh,{id:`${e}-label`,children:e}),b(gf,{labelId:`${e}-label`,id:`${e}-select`,value:n,label:e,onChange:r,children:t.map(o=>b(Ft,{value:o.value,children:o.label},o.value))})]});function GCt(e,t,n,r,o){switch(r){case"exercises":{const i=Object.keys(o.exercises).map(s=>{var l,c;return(c=(l=e.find(u=>u.id===parseInt(s)))==null?void 0:l.getTranslation(t))==null?void 0:c.name}),a=Object.keys(o.exercises).map(Number);return{headers:i,data:a.map(s=>o.exercises[s])}}case"muscles":{const i=Object.keys(o.muscle).map(s=>{var l;return qr.t(Ki((l=n.find(c=>c.id===parseInt(s)))==null?void 0:l.nameEn))}),a=Object.keys(o.muscle).map(Number);return{headers:i,data:a.map(s=>o.muscle[s])}}case"total":return{headers:[qr.t("total")],data:[o.total]};default:return{headers:[],data:[]}}}const qCt=(e,t,n,r,o,i,a,s)=>{const l={},c=e[t];let u=[],d=[];const f=(y,v)=>GCt(o,a,i,y,v);d=(y=>{let v=[];switch(n){case"mesocycle":v=f(r,c.mesocycle).headers;break;case"iteration":for(const x in c.iteration)v=v.concat(f(r,c.iteration[x]).headers);break;case"weekly":for(const x in c.weekly)v=v.concat(f(r,c.weekly[x]).headers);break;case"daily":for(const x in c.daily)v=v.concat(f(r,c.daily[x]).headers);break}return[...new Set(v)]})(),d.forEach(y=>{l[y]=0});function g(y,v){d.map(S=>y[f(r,v).headers.indexOf(S)]).forEach((S,C)=>{S!==void 0&&(l[d[C]]+=S)})}switch(n){case"mesocycle":{const{data:y}=f(r,c.mesocycle);u=[{key:qr.t("total"),values:d.map(v=>y[d.indexOf(v)])}];break}case"iteration":{u=Object.entries(c.iteration).map(([y,v])=>{const{data:x}=f(r,v);return g(x,v),{key:`iteration ${y}`,values:d.map(S=>x[f(r,v).headers.indexOf(S)])}});break}case"weekly":{u=Object.entries(c.weekly).map(([y,v])=>{const{data:x}=f(r,v);return g(x,v),{key:`week ${y}`,values:d.map(S=>x[f(r,v).headers.indexOf(S)])}});break}case"daily":{u=Object.entries(c.daily).map(([y,v])=>{const{data:x}=f(r,v);return g(x,v),{key:new Date(y).toLocaleDateString(s),values:d.map(S=>x[f(r,v).headers.indexOf(S)])}});break}}return{headers:d,data:u,totals:l}};function KCt(e){const t=[];return e.headers.forEach(n=>{t.push({name:n,data:[]})}),e.data.forEach(n=>{n.values.forEach((r,o)=>{var a;const i=e.headers[o];i&&((a=t.find(s=>s.name===i))==null||a.data.push({category:n.key.toString(),value:r}))})}),t}const YCt=()=>{const e=Lr(),[t,n]=Re(),r=Ea(),[o,i]=w.useState(op.Volume),[a,s]=w.useState(ip.Daily),[l,c]=w.useState(ew.Exercises),u=parseInt(r.routineId??"");if(Number.isNaN(u))return b("p",{children:"Please pass an integer as the routine id."});const d=_c(u),f=Snt(u),h=Yy(),g=$c();if(f.isLoading||d.isLoading||h.isLoading||g.isLoading)return b(wr,{});const y=Tu(n.language,g.data),v=d.data,x=[{value:op.Volume,label:t("routines.volume")},{value:op.Sets,label:t("routines.sets")},{value:op.Intensity,label:t("routines.intensity")}],S=[{value:ip.Mesocycle,label:t("routines.currentRoutine")},{value:ip.Weekly,label:t("routines.weekly")},{value:ip.Iteration,label:t("routines.iteration")},{value:ip.Daily,label:t("routines.daily")}],C=[{value:ew.Exercises,label:t("exercises.exercises")},{value:ew.Muscles,label:t("exercises.muscles")},{value:ew.Total,label:t("total")}],I=R=>{i(R.target.value)},E=R=>{s(R.target.value)},T=R=>{c(R.target.value)},O=qCt(f.data,o,a,l,v.exercises,h.data,y,n.language),A=KCt(O),k=()=>b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{}),O.headers.map(R=>b(Te,{sx:{textAlign:"right"},children:R},R))]})}),Q(Fl,{children:[O.data.map(R=>Q(Zt,{children:[b(Te,{children:R.key}),R.values.map(($,L)=>b(Te,{sx:{textAlign:"right"},children:($==null?void 0:$.toFixed(o===op.Intensity?2:0))||""},L))]},R.key)),a!==ip.Mesocycle&&Q(Zt,{children:[b(Te,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200},children:t("total")}),O.headers.map(R=>{var $;return b(Te,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200,textAlign:"right"},children:($=O.totals[R==null?void 0:R.toString()])==null?void 0:$.toFixed(o===op.Intensity?2:0)},R)})]})]})]})}),M=cS(A.length);return b(J0,{title:`${t("routines.statsOverview")} - ${v.name}`,backToUrl:Qt(Kt.ROUTINE_DETAIL,n.language,{id:u}),optionsMenu:b(Do,{title:t("routines.logsOverview"),children:b(on,{component:"a",href:Qt(Kt.ROUTINE_LOGS_OVERVIEW,n.language,{id:u}),children:b(ale,{})})}),children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:2,offset:3,children:b(D$,{label:"type",options:x,value:o,onChange:I})}),b(ye,{size:2,children:b(D$,{label:"sub type",options:S,value:a,onChange:E})}),b(ye,{size:2,children:b(D$,{label:"group by",options:C,value:l,onChange:T})}),b(ye,{size:12,children:b(en,{width:"100%",height:400,children:b(Fu,{width:"100%",height:"100%",children:Q(AB,{width:500,height:300,children:[b(Sf,{strokeDasharray:"3 3"}),b(Xa,{dataKey:"category",type:"category",allowDuplicatedCategory:!1}),b(Ja,{dataKey:"value"}),b(ua,{formatter:R=>Number.isInteger(R)?R.toFixed(0):R.toFixed(2)}),b(hc,{layout:"vertical",verticalAlign:"middle",align:"right",wrapperStyle:{paddingLeft:"20px"}}),A.map(R=>b(uh,{dataKey:"value",data:R.data,name:R.name,stroke:M.next().value},R.name))]})})})}),Q(ye,{size:12,children:[b(en,{height:20}),k()]})]})})},QCt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Zz,{closeFn:o})})]})},SV=e=>{const[t,n]=Re(),r=e.linkDestination??Kt.ROUTINE_DETAIL,o=Qt(r,n.language,{id:e.routine.id});return Q(xt,{children:[b(Ka,{sx:{p:0},children:Q(mf,{component:"a",href:o,children:[b(uo,{primary:e.routine.name!==""?e.routine.name:t("routines.routine"),secondary:`${e.routine.durationText} (${e.routine.start.toLocaleDateString()} - ${e.routine.end.toLocaleDateString()})`}),b(sle,{})]})}),b(Ti,{component:"li"})]})},qX=()=>{const e=Cnt(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("routines.routines"),mainContent:b(xt,{children:e.data.length===0?b(ih,{}):b(Kr,{children:b(xa,{sx:{py:0},children:e.data.map(n=>b(SV,{routine:n},n.id))},"abc")})}),fab:b(QCt,{})})},XCt=()=>{const e=Ent(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("routines.templates"),mainContent:b(xt,{children:e.data.length===0?b(ih,{}):b(Kr,{children:b(xa,{sx:{py:0},children:e.data.map(n=>b(SV,{routine:n,linkDestination:Kt.TEMPLATE_DETAIL},n.id))},"abc")})})})},JCt=()=>{const e=Pnt(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("routines.publicTemplates"),mainContent:b(xt,{children:e.data.length===0?b(ih,{}):b(Kr,{children:b(xa,{sx:{py:0},children:e.data.map(n=>b(SV,{routine:n,linkDestination:Kt.TEMPLATE_DETAIL},n.id))},"abc")})})})},ZCt=()=>b("div",{children:"About Page"});function CV(e){const[t]=Re(),[n,r,o]=Za(e.fieldName);return b($l,{multiple:!0,freeSolo:!0,id:e.fieldName,value:n.value,options:n.value,onChange:(i,a)=>{o.setValue(a)},renderTags:(i,a)=>i.map((s,l)=>gF(Pu,{label:s,...a({index:l}),key:l})),onBlur:n.onBlur,renderInput:i=>b(tn,{...i,id:"exerciseAliases",variant:"standard",label:t("exercises.alternativeNames"),error:r.touched&&!!r.error,helperText:r.touched&&r.error,value:n.value})})}function e1t(e){const[t]=Re(),[n,r,o]=Za(e.fieldName);return b($l,{multiple:!0,id:e.fieldName,options:e.options.map(i=>i.id),getOptionLabel:i=>t(Ki(e.options.find(a=>a.id===i).name)),...n,onChange:(i,a)=>{o.setValue(a)},renderInput:i=>b(tn,{variant:"standard",label:t("exercises.equipment"),value:n.value,...i})})}function EV(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("name"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function t1t(e){const[t]=Re(),[n,r]=Za(e.fieldName);return Q(rh,{fullWidth:!0,children:[b(oh,{id:"label-category",children:t("category")}),b(gf,{labelId:"label-category",id:"category",label:t("category"),error:r.touched&&!!r.error,...n,children:e.options}),r.touched&&!!r.error&&b(h0,{error:!0,children:r.error})]})}const Jde=5,Zde=40,PV=e=>Ro().min(Jde,e("forms.valueTooShort")).max(Zde,e("forms.valueTooLong")).required(e("forms.fieldRequired")),IV=e=>Dp().ensure().compact().of(Ro().min(Jde,e("forms.valueTooShort")).max(Zde,e("forms.valueTooLong"))),TV=e=>Ro().min(40,e("forms.valueTooShort")).required(e("forms.fieldRequired")),efe=e=>Dp().ensure().compact().of(Ro().min(15,e("forms.valueTooShort"))),n1t=e=>wo().required(e("forms.fieldRequired"));var tfe=(e=>(e[e.SET_NOTIFICATION=0]="SET_NOTIFICATION",e))(tfe||{}),zn=(e=>(e[e.RESET=0]="RESET",e[e.SET_NAME_EN=1]="SET_NAME_EN",e[e.SET_ALIASES_EN=2]="SET_ALIASES_EN",e[e.SET_DESCRIPTION_EN=3]="SET_DESCRIPTION_EN",e[e.SET_NOTES_EN=4]="SET_NOTES_EN",e[e.SET_CATEGORY=5]="SET_CATEGORY",e[e.SET_EQUIPMENT=6]="SET_EQUIPMENT",e[e.SET_PRIMARY_MUSCLES=7]="SET_PRIMARY_MUSCLES",e[e.SET_MUSCLES_SECONDARY=8]="SET_MUSCLES_SECONDARY",e[e.SET_VARIATION_ID=9]="SET_VARIATION_ID",e[e.SET_NEW_VARIATION_BASE_ID=10]="SET_NEW_VARIATION_BASE_ID",e[e.SET_LANGUAGE=11]="SET_LANGUAGE",e[e.SET_NAME_I18N=12]="SET_NAME_I18N",e[e.SET_ALIASES_I18N=13]="SET_ALIASES_I18N",e[e.SET_DESCRIPTION_I18N=14]="SET_DESCRIPTION_I18N",e[e.SET_NOTES_I18N=15]="SET_NOTES_I18N",e[e.SET_IMAGES=16]="SET_IMAGES",e))(zn||{});const KX=e=>({type:tfe.SET_NOTIFICATION,payload:e}),YX={notification:{notify:!1,message:"",severity:void 0,title:"",type:void 0}},r1t=w.createContext([YX,()=>YX]),o1t=()=>w.useContext(r1t),i1t=e=>({type:zn.SET_NAME_EN,payload:e}),a1t=e=>({type:zn.SET_DESCRIPTION_EN,payload:e}),s1t=e=>({type:zn.SET_NOTES_EN,payload:e}),l1t=e=>({type:zn.SET_ALIASES_EN,payload:e}),c1t=e=>({type:zn.SET_NAME_I18N,payload:e}),u1t=e=>({type:zn.SET_DESCRIPTION_I18N,payload:e}),d1t=e=>({type:zn.SET_NOTES_I18N,payload:e}),f1t=e=>({type:zn.SET_ALIASES_I18N,payload:e}),p1t=e=>({type:zn.SET_CATEGORY,payload:e}),h1t=e=>({type:zn.SET_EQUIPMENT,payload:e}),m1t=e=>({type:zn.SET_PRIMARY_MUSCLES,payload:e}),g1t=e=>({type:zn.SET_MUSCLES_SECONDARY,payload:e}),y1t=e=>({type:zn.SET_VARIATION_ID,payload:e}),v1t=e=>({type:zn.SET_NEW_VARIATION_BASE_ID,payload:e}),b1t=e=>({type:zn.SET_LANGUAGE,payload:e}),w1t=e=>({type:zn.SET_IMAGES,payload:e}),x1t=(e,t)=>{if(t===void 0)return e;switch(t.type){case zn.RESET:return tI;case zn.SET_NAME_EN:return{...e,nameEn:t.payload};case zn.SET_DESCRIPTION_EN:return{...e,descriptionEn:t.payload};case zn.SET_NOTES_EN:return{...e,notesEn:t.payload};case zn.SET_ALIASES_EN:return{...e,alternativeNamesEn:t.payload};case zn.SET_CATEGORY:return{...e,category:t.payload};case zn.SET_EQUIPMENT:return{...e,equipment:t.payload};case zn.SET_PRIMARY_MUSCLES:return{...e,muscles:t.payload};case zn.SET_MUSCLES_SECONDARY:return{...e,musclesSecondary:t.payload};case zn.SET_VARIATION_ID:return{...e,variationId:t.payload};case zn.SET_NEW_VARIATION_BASE_ID:return{...e,newVariationExerciseId:t.payload};case zn.SET_LANGUAGE:return{...e,languageId:t.payload};case zn.SET_NAME_I18N:return{...e,nameI18n:t.payload};case zn.SET_DESCRIPTION_I18N:return{...e,descriptionI18n:t.payload};case zn.SET_NOTES_I18N:return{...e,notesI18n:t.payload};case zn.SET_ALIASES_I18N:return{...e,alternativeNamesI18n:t.payload};case zn.SET_IMAGES:return{...e,images:t.payload};default:return e}},tI={category:null,muscles:[],musclesSecondary:[],variationId:null,newVariationExerciseId:null,languageId:null,equipment:[],nameEn:"",descriptionEn:"",alternativeNamesEn:[],notesEn:[],nameI18n:"",alternativeNamesI18n:[],descriptionI18n:"",notesI18n:[],images:[]},nfe=w.createContext([tI,()=>tI]),S1t=({children:e})=>{const[t,n]=w.useReducer(x1t,tI);return b(nfe.Provider,{value:[t,n],children:e})},dv=()=>w.useContext(nfe),C1t=({onContinue:e})=>{const[t]=Re(),[n,r]=dv(),[o,i]=w.useState(n.muscles),[a,s]=w.useState(n.musclesSecondary);w.useEffect(()=>{r(m1t(o))},[r,o]),w.useEffect(()=>{r(g1t(a))},[r,a]);const l=WT(),c=Yy(),u=GT(),d=_o({nameEn:PV(t),newAlternativeNameEn:IV(t),category:n1t(t)});return b(ci,{initialValues:{nameEn:n.nameEn,newAlternativeNameEn:n.alternativeNamesEn,category:n.category!==null?n.category:"",muscles:n.muscles,equipment:n.equipment,musclesSecondary:n.musclesSecondary},validationSchema:d,onSubmit:f=>{r(i1t(f.nameEn)),r(p1t(f.category)),r(l1t(f.newAlternativeNameEn)),r(h1t(f.equipment)),e()},children:f=>Q(Zo,{children:[Q(_t,{spacing:2,children:[b(EV,{fieldName:"nameEn"}),b(CV,{fieldName:"newAlternativeNameEn"}),l.isLoading?Q(en,{children:[" ",b(Ba,{})," "]}):b(t1t,{fieldName:"category",options:l.data.map(h=>b(Ft,{value:h.id,children:t(Ki(h.name))},h.id))}),u.isLoading?Q(en,{children:[" ",b(Ba,{})," "]}):b(e1t,{fieldName:"equipment",options:u.data}),c.isLoading?Q(en,{children:[" ",b(Ba,{})," "]}):Q(xt,{children:[b($l,{multiple:!0,id:"muscles",options:c.data.map(h=>h.id),getOptionDisabled:h=>a.includes(h),getOptionLabel:h=>c.data.find(g=>g.id===h).getName(t),value:o,onChange:(h,g)=>{i(g)},renderInput:h=>b(tn,{...h,variant:"standard",label:t("exercises.muscles"),value:f.getFieldProps("muscles").value,onChange:g=>{f.setFieldValue(f.getFieldProps("muscles").name,g.target.value)}})}),b($l,{multiple:!0,id:"secondary-muscles",options:c.data.map(h=>h.id),getOptionDisabled:h=>o.includes(h),getOptionLabel:h=>c.data.find(g=>g.id===h).getName(t),value:a,onChange:(h,g)=>{s(g)},renderInput:h=>b(tn,{...h,variant:"standard",label:t("exercises.secondaryMuscles"),value:f.getFieldProps("muscles").value})})]}),Q(ye,{container:!0,children:[b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:o.map(h=>c.data.find(g=>g.id===h)),secondaryMuscles:a.map(h=>c.data.find(g=>g.id===h)),isFront:!0})}),b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:o.map(h=>c.data.find(g=>g.id===h)),secondaryMuscles:a.map(h=>c.data.find(g=>g.id===h)),isFront:!1})})]})]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:b("div",{children:b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:t("continue")})})})})})]})})};function E1t(e,t){const n=new Map;return e.forEach(r=>{const o=t(r),i=n.get(o);i?i.push(r):n.set(o,[r])}),n}const QX=({exercises:e})=>{const r=e[0].variationId,o=e[0].id,[i,a]=dv(),[s,l]=w.useState(!1),[c,u]=w.useState(i.variationId),[d,f]=w.useState(i.newVariationExerciseId);w.useEffect(()=>{a(y1t(c))},[a,c]),w.useEffect(()=>{a(v1t(d))},[a,d]);const h=(y,v)=>()=>{y!==null?(v=null,y===i.variationId&&(y=null)):(y=null,v===i.newVariationExerciseId&&(v=null)),u(y),f(v)};let g;return r===null?g=i.newVariationExerciseId===o:g=r===i.variationId,b(Ka,{disableGutters:!0,children:b(mf,{onClick:h(r,o),children:Q(ye,{container:!0,children:[b(ye,{display:"flex",justifyContent:"start",alignItems:"center",size:{xs:12,sm:3},children:b(F0e,{max:4,spacing:"small",children:e.map(y=>y.mainImage?b(Nl,{src:y.mainImage.url},y.id):b(Nl,{children:b(_u,{})},y.id))})}),Q(ye,{size:{xs:10,sm:7},children:[e.slice(0,s?e.length:5).map(y=>b("p",{style:{margin:0},children:y.getTranslation().name},y.id)),!s&&e.length>5?b(xy,{onMouseEnter:()=>l(!0)}):null]}),b(ye,{display:"flex",justifyContent:"end",size:{xs:2,sm:2},children:b(li,{edge:"start",checked:g,tabIndex:-1,disableRipple:!0},`variation-${r}`)}),b(ye,{size:12,children:b(Ti,{sx:{pt:1}})})]})})})},P1t=({onContinue:e,onBack:t})=>{const[n]=Re(),r=dle(),[o,i]=w.useState("");let a=[],s=new Map;return r.isSuccess&&(a=r.data,o!==""&&(a=a.filter(l=>l.getTranslation().name.toLowerCase().includes(o.toLowerCase())))),s=E1t(a.filter(l=>l.variationId!==null),l=>l.variationId),Q(xt,{children:[Q(ye,{container:!0,children:[b(ye,{size:{xs:12,sm:6},children:b(tt,{children:n("exercises.whatVariationsExist")})}),b(ye,{display:"flex",justifyContent:"end",size:{xs:12,sm:6},children:b(tn,{label:n("exercises.filterVariations"),variant:"standard",onChange:l=>i(l.target.value),InputProps:{startAdornment:b(ro,{position:"start",children:b(JB,{})})}})})]}),r.isLoading?b(wr,{}):b(Kr,{elevation:2,sx:{mt:2},children:Q(xa,{style:{maxHeight:"400px",overflowY:"scroll"},children:[a.filter(l=>l.variationId===null).map(l=>b(QX,{exercises:[l]},"base-"+l.id)),[...s.keys()].map(l=>b(QX,{exercises:s.get(l)},"variation-"+l))]})}),Q(Ii,{severity:"info",variant:"filled",sx:{mt:2},children:[b(hg,{children:n("exercises.identicalExercise")}),n("exercises.identicalExercisePleaseDiscard")]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[b(at,{disabled:!1,onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",onClick:e,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})};function I1t(e){const{t}=Re(),[n,r]=X.useState(e.initial.toString()),o=WT(),i=Pa(),a=async s=>{r(s.target.value),await yj(e.exerciseId,{category:parseInt(s.target.value),license_author:i.data.username})};return o.isSuccess?Q(rh,{fullWidth:!0,children:[b(oh,{id:"label-category",children:t("category")}),b(gf,{labelId:"label-category",id:"category",label:t("category"),value:n,onChange:a,children:o.data.map(s=>b(Ft,{value:s.id,children:t(Ki(s.name))},s.id))})]}):null}function T1t(e){const{t}=Re(),[n,r]=X.useState(e.initial),o=GT(),i=Pa(),a=async s=>{r(s),await yj(e.exerciseId,{equipment:s,license_author:i.data.username})};return o.isSuccess?b($l,{multiple:!0,value:n,options:o.data.map(s=>s.id),getOptionLabel:s=>t(Ki(o.data.find(l=>l.id===s).name)),onChange:(s,l)=>a(l),renderInput:s=>b(tn,{variant:"standard",label:t("exercises.equipment"),value:n,...s})}):null}var Ko=function(){return Ko=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ko.apply(this,arguments)};function hO(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function XX(e){if(e){var t=e.textContent,n=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/;e.style.direction=t&&n.test(t[0])?"rtl":"ltr"}}function rfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(Boolean).join(" ")}function O1t(){if(document.selection)return document.selection.createRange().parentElement();var e=window.getSelection();if(e&&e.rangeCount>0)return e.getRangeAt(0).startContainer.parentNode||void 0}function JX(e){return e?e.replace(/ |\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>"):""}function k1t(e){var t=document.createTextNode("");e.appendChild(t);var n=document.activeElement===e;if(t!==null&&t.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var o=document.createRange();o.setStart(t,t.nodeValue.length),o.collapse(!0),r.removeAllRanges(),r.addRange(o)}e instanceof HTMLElement&&e.focus()}}function ofe(e,t){typeof t=="function"?t(e):typeof t=="object"&&t&&(t.current=e)}var M1t=X.memo(X.forwardRef(function(t,n){var r=t.className,o=t.disabled,i=t.tagName,a=t.value,s=a===void 0?"":a,l=t.placeholder,c=hO(t,["className","disabled","tagName","value","placeholder"]),u=X.useRef(),d=X.useRef(s),f=X.useRef(c);return X.useEffect(function(){f.current=c;var h=u.current;h&&JX(d.current)!==JX(s)&&(d.current=s,h.innerHTML=s,k1t(h))}),X.useMemo(function(){function h(v){u.current=v,XX(v),ofe(v,n)}function g(v){var x,S,C=u.current;if(C){var I=C.innerHTML;I!==d.current&&((S=(x=f.current).onChange)===null||S===void 0||S.call(x,Ko(Ko({},v),{target:{value:I,name:c.name}}))),XX(C),d.current=I}}var y=rfe("rsw-ce",r);return X.createElement(i||"div",Ko(Ko({},c),{className:y,contentEditable:!o,dangerouslySetInnerHTML:{__html:s},onBlur:function(v){return(f.current.onBlur||g)(v)},onInput:g,onKeyDown:function(v){return(f.current.onKeyDown||g)(v)},onKeyUp:function(v){return(f.current.onKeyUp||g)(v)},placeholder:l,ref:h}))},[r,o,l,i])})),ife=X.createContext(void 0);function afe(e){var t=e.children,n=X.useState({htmlMode:!1,update:i}),r=n[0],o=n[1];function i(a){o(function(s){return Ko(Ko({},s),a)})}return X.createElement(ife.Provider,{value:r},t)}function fS(){var e=X.useContext(ife);if(!e)throw new Error("You should wrap your component by EditorProvider");return e}var ZX=[],Ab=[];function A1t(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",o=t.singleTag===!0,i=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=ZX.indexOf(i);a===-1&&(a=ZX.push(i)-1,Ab[a]={}),n=Ab[a]&&Ab[a][r]?Ab[a][r]:Ab[a][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),t.attributes)for(var c=Object.keys(t.attributes),u=0;u<c.length;u++)l.setAttribute(c[u],t.attributes[c[u]]);var d=r==="prepend"?"afterbegin":"beforeend";return i.insertAdjacentElement(d,l),l}}var R1t=".rsw-editor{border:1px solid #ddd;border-radius:.375rem;display:flex;flex-direction:column;min-height:100px;overflow:hidden}.rsw-ce{flex:1 0 auto;padding:.5rem}.rsw-ce:focus{outline:1px solid #668}.rsw-ce[contentEditable=true]:empty:not(:focus):before{color:grey;content:attr(placeholder);pointer-events:none}.rsw-html{background:transparent;border:none;font-family:monospace,Courier New}.rsw-separator{align-self:stretch;border-right:1px solid #ddd;display:flex;margin:0 3px}.rsw-dd{box-sizing:border-box;outline:none}.rsw-btn{background:transparent;border:0;color:#222;cursor:pointer;font-size:1em;height:2em;outline:none;padding:0;width:2em}.rsw-btn:hover{background:#eaeaea}.rsw-btn[data-active=true]{background:#e0e0e0}.rsw-toolbar{align-items:center;background-color:#f5f5f5;border-bottom:1px solid #ddd;display:flex}";A1t(R1t,{});var sfe=X.forwardRef(function(t,n){var r=t.autoFocus,o=t.children,i=t.containerProps,a=t.onSelect,s=hO(t,["autoFocus","children","containerProps","onSelect"]),l=fS();X.useEffect(function(){return document.addEventListener("click",c),function(){return document.removeEventListener("click",c)}});function c(h){var g;h.target!==l.$el&&(!((g=l.$el)===null||g===void 0)&&g.contains(h.target)||l.update({$selection:void 0}))}function u(h){a==null||a(h),l.update({$selection:O1t()})}function d(h){l.update({$el:h}),ofe(h,n),r&&h&&l.$el===void 0&&h.focus()}var f=rfe("rsw-editor",i==null?void 0:i.className);return l.htmlMode?X.createElement("div",Ko({},i,{className:f}),o,X.createElement("textarea",Ko({},s,{className:"rsw-ce rsw-html"}))):X.createElement("div",Ko({},i,{className:f}),o,X.createElement(M1t,Ko({},s,{ref:d,onSelect:u})))});function D1t(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},X.createElement("path",{fill:"currentColor",d:"M6.99938 12.998v-2H20.9994v2H6.99938zm0 6.0001v-2H20.9994v2H6.99938zm0-12.00001v-2H20.9994v2H6.99938zm-4 1v-3h-1v-1h2v4h-1zm-1 9.00001v-1h3v4h-3v-1h2v-.5h-1v-1h1v-.5h-2zM4.25 10c.41421 0 .75.3358.75.75 0 .2024-.08017.3861-.2105.521L3.11983 13H5v1H2v-.9218L4 11H2v-1h2.25z"}))}function _1t(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},X.createElement("path",{fill:"currentColor",d:"M7 5h14v2H7V5zm0 8v-2h14v2H7zM4 4.50001c.83 0 1.5.66992 1.5 1.5 0 .83007-.67 1.5-1.5 1.5s-1.5-.66993-1.5-1.5c0-.83008.67-1.5 1.5-1.5zM4 10.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zM7 19v-2h14v2H7zm-3-2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z"}))}var lfe=Fc("Bold","𝐁","bold"),cfe=Fc("Bullet list",X.createElement(_1t,null),"insertUnorderedList"),$1t=Fc("Clear formatting","T̲ₓ","removeFormat"),ufe=Fc("Italic","𝑰","italic"),N1t=Fc("Strike through",X.createElement("s",null,"ab"),"strikeThrough"),L1t=Fc("Link","🔗",function(e){var t=e.$selection;(t==null?void 0:t.nodeName)==="A"?document.execCommand("unlink"):document.execCommand("createLink",!1,prompt("URL","")||void 0)}),dfe=Fc("Numbered list",X.createElement(D1t,null),"insertOrderedList"),ffe=Fc("Redo","↷","redo"),pfe=Fc("Underline",X.createElement("span",{style:{textDecoration:"underline"}},"𝐔"),"underline"),hfe=Fc("Undo","↶","undo");function Fc(e,t,n){return r.displayName=e.replace(/\s/g,""),r;function r(o){var i=fS(),a=i.$el,s=i.$selection,l=!1;typeof n=="string"&&(l=!!s&&document.queryCommandState(n));function c(u){u.preventDefault(),document.activeElement!==a&&(a==null||a.focus()),typeof n=="function"?n(i):document.execCommand(n)}return i.htmlMode?null:X.createElement("button",Ko({className:"rsw-btn","data-active":l,onMouseDown:c,tabIndex:-1,title:e,type:"button"},o),t)}}var F1t=j1t("Styles",[["Normal","formatBlock","DIV"],["𝗛𝗲𝗮𝗱𝗲𝗿 𝟭","formatBlock","H1"],["Header 2","formatBlock","H2"],["𝙲𝚘𝚍𝚎","formatBlock","PRE"]]);function j1t(e,t){return n.displayName=e,n;function n(r){var o=fS(),i=o.$el,a=o.$selection,s=o.htmlMode;if(s)return null;var l=t.findIndex(function(u){return u[1]==="formatBlock"&&(a==null?void 0:a.nodeName)===u[2]});return X.createElement(B1t,Ko({},r,{items:t,onChange:c,selected:l,tabIndex:-1,title:e}));function c(u){var d=u.target,f=d.value,h=parseInt(f,10),g=t[h]||[],y=g[1],v=g[2];u.preventDefault(),document.activeElement!==i&&(i==null||i.focus()),typeof y=="function"?y(o):y&&document.execCommand(y,!1,v),setTimeout(function(){return d.value=f},10)}}}function B1t(e){var t=e.items,n=e.selected,r=hO(e,["items","selected"]);return X.createElement("select",Ko({},r,{value:n,className:"rsw-dd"}),X.createElement("option",{hidden:!0},r.title),t.map(function(o,i){return X.createElement("option",{key:o[2],value:i},o[0])}))}function z1t(e){var t=hO(e,[]),n=fS();function r(){n.update({htmlMode:!n.htmlMode})}return X.createElement("button",Ko({className:"rsw-btn","data-active":n.htmlMode,onClick:r,tabIndex:-1,title:"HTML mode",type:"button"},t),"</>")}function Lm(){var e=fS();return e.htmlMode?null:X.createElement("div",{className:"rsw-separator"})}function mfe(e){return X.createElement("div",Ko({},e,{className:"rsw-toolbar"}))}X.forwardRef(function(t,n){return X.createElement(afe,null,X.createElement(sfe,Ko({},t,{ref:n}),X.createElement(mfe,null,X.createElement(hfe,null),X.createElement(ffe,null),X.createElement(Lm,null),X.createElement(lfe,null),X.createElement(ufe,null),X.createElement(pfe,null),X.createElement(N1t,null),X.createElement(Lm,null),X.createElement(dfe,null),X.createElement(cfe,null),X.createElement(Lm,null),X.createElement(L1t,null),X.createElement($1t,null),X.createElement(z1t,null),X.createElement(Lm,null),X.createElement(F1t,null))))});function V1t(e){return b(afe,{children:b(sfe,{...e,children:Q(mfe,{children:[b(lfe,{}),b(ufe,{}),b(pfe,{}),b(Lm,{}),b(cfe,{}),b(dfe,{}),b(Lm,{}),b(hfe,{}),b(ffe,{})]})})})}function OV(e){const[t,n,r]=Za(e.fieldName);return Q(xt,{children:[b("div",{"data-testid":"jodit-editor",children:b(V1t,{value:t.value,onChange:o=>r.setValue(o.target.value)})}),n.touched&&!!n.error&&b(h0,{error:!0,children:n.error})]})}const H1t=({exerciseId:e,image:t,canDelete:n})=>{const[r]=Re(),o=eot(e);return Q(fo,{children:[b(Ec,{component:"img",image:t.url,sx:{height:120},alt:""}),b(Ys,{children:n&&b(at,{color:"primary",onClick:()=>o.mutate(t.id),children:r("delete")})})]})},U1t=({exerciseId:e})=>{const[t]=Re(),n=Pa(),r=tot(e),o=async i=>{var s;if(!((s=i.target.files)!=null&&s.length))return;const[a]=i.target.files;n.isSuccess&&await r.mutate({exerciseId:e,image:a,imageData:{url:"",file:a,author:"",authorUrl:"",title:"",objectUrl:"",derivativeSourceUrl:"",style:""}})};return Q(fo,{children:[b(Ec,{children:b(en,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:b(ile,{sx:{fontSize:80,color:"gray"}})})}),b(Ys,{children:Q(at,{component:"label",children:[t("add"),b("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:o})]})})]})};function eJ(e){const{t}=Re(),n=Yy(),r=async o=>{e.setValue(o),await yj(e.exerciseId,e.isMain?{muscles:o}:{muscles_secondary:o})};return n.isSuccess?b($l,{multiple:!0,options:n.data.map(o=>o.id),getOptionDisabled:o=>e.blocked.includes(o),getOptionLabel:o=>n.data.find(i=>i.id===o).getName(t),value:e.value,onChange:(o,i)=>r(i),renderInput:o=>b(tn,{...o,variant:"standard",label:t(e.isMain?"exercises.muscles":"exercises.secondaryMuscles"),value:e.value})}):null}const W1t=({video:e,canDelete:t})=>{const[n]=Re();return Q(fo,{children:[b(Ec,{component:"video",src:e.url,sx:{height:120},controls:!0,preload:"metadata"}),b(Ys,{children:t&&b(at,{color:"primary",onClick:()=>lAe(e.id),children:n("delete")})})]})},G1t=({exerciseId:e})=>{const[t]=Re(),n=Pa(),r=async o=>{var a;if(!((a=o.target.files)!=null&&a.length))return;const[i]=o.target.files;n.isSuccess&&await sAe(e,n.data.username,i)};return Q(fo,{children:[b(Ec,{children:b(en,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:b(ile,{sx:{fontSize:80,color:"gray"}})})}),b(Ys,{children:Q(at,{component:"label",children:[t("add"),b("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"video/*",capture:"environment",onChange:r})]})})]})},q1t="check-permission",K1t=async e=>{const t=dt(q1t,{query:{permission:e}}),n=await nt.get(t,{headers:pt()});return n.status===400?!1:n.data.result};function Od(e){return br({queryKey:[Bke,e],queryFn:()=>K1t(e.valueOf())})}var au=(e=>(e.EDIT_EXERCISE="exercises.change_exercise",e.DELETE_EXERCISE="exercises.delete_exercise",e.ADD_IMAGE="exercises.add_exerciseimage",e.EDIT_IMAGE="exercises.change_exerciseimage",e.DELETE_IMAGE="exercises.delete_exerciseimage",e.ADD_VIDEO="exercises.add_exercisevideo",e.EDIT_VIDEO="exercises.change_exercisevideo",e.DELETE_VIDEO="exercises.delete_exercisevideo",e))(au||{});const Y1t=({exerciseId:e,language:t})=>{const[n]=Re(),[r,o]=w.useState(!1),[i,a]=w.useState([]),[s,l]=w.useState([]),c=Xrt(e),u=Jrt(e),d=Zrt(e),f=Od(au.ADD_IMAGE),h=Od(au.DELETE_IMAGE),g=Od(au.ADD_VIDEO),y=Od(au.DELETE_VIDEO),v=Od(au.EDIT_EXERCISE),x=Yy(),S=Pa(),C=c.data;if(w.useEffect(()=>{c.data!==void 0&&(a(C.muscles.map(k=>k.id)),l(C.musclesSecondary.map(k=>k.id)))},[c.data]),c.isLoading||x.isLoading||c.isLoading||S.isLoading||f.isLoading||h.isLoading||g.isLoading||y.isLoading||v.isLoading)return b(Ba,{});const I=C.getTranslation(t),T=t.id!==(I==null?void 0:I.language)?new hte(null,null,"","",t.id):I,O=C.getTranslation(),A=_o({name:PV(n),alternativeNames:IV(n),description:TV(n)});return Q(xt,{children:[b(ci,{initialValues:{name:T.name,alternativeNames:T.aliases.map(k=>k.alias),description:T.description},enableReinitialize:!0,validationSchema:A,onSubmit:async k=>{const M=T.id?await d.mutateAsync({id:T.id,exerciseId:C.id,languageId:t.id,name:k.name,description:k.description,author:""}):await u.mutateAsync({exerciseId:C.id,languageId:t.id,name:k.name,description:k.description,author:S.data.username}),R=T.aliases.map(N=>N.alias),$=k.alternativeNames,L=$.filter(N=>!R.includes(N));let z=R.filter(N=>!$.includes(N));L.forEach(N=>{_2(M.id,N)}),z.forEach(N=>{aAe(T.aliases.find(B=>B.alias===N).id)}),o(!0)},children:b(Zo,{children:Q(ye,{container:!0,spacing:1,children:[r&&Q(ye,{size:12,children:[b(Ii,{severity:"success",action:b(on,{"aria-label":"close",size:"small",color:"inherit",onClick:()=>{o(!1)},children:b(y0,{fontSize:"inherit"})}),children:n("exercises.successfullyUpdated")}),b(ri,{})]}),b(ye,{size:6,children:b(tt,{variant:"h5",children:n("English")})}),b(ye,{size:6,children:Q(tt,{variant:"h5",children:[t.nameLong," (",t.nameShort,")"]})}),Q(ye,{size:12,children:[b(ri,{}),b(tt,{variant:"h6",children:n("name")})]}),Q(ye,{size:6,children:[O.name,b("ul",{children:O.aliases.map(k=>b("li",{children:k.alias},k.id))})]}),Q(ye,{size:6,children:[b(en,{mb:2,children:b(EV,{fieldName:"name"})}),b(CV,{fieldName:"alternativeNames"})]}),b(ye,{size:12,children:b(ri,{})}),b(ye,{size:12,children:b(tt,{variant:"h6",children:n("exercises.description")})}),b(ye,{size:{xs:12,md:6},children:b("div",{dangerouslySetInnerHTML:{__html:O.description}})}),b(ye,{size:{xs:12,md:6},children:b(OV,{fieldName:"description"})}),v.data&&Q(xt,{children:[b(ye,{size:12,children:b(ri,{})}),b(ye,{size:{xs:12,md:6},children:b(I1t,{exerciseId:C.id,initial:C.category.id})}),b(ye,{size:{xs:12,md:6},children:b(T1t,{exerciseId:C.id,initial:C.equipment.map(k=>k.id)})})]}),Q(ye,{size:12,children:[b(ri,{}),b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},disabled:c.isLoading||u.isPending||d.isPending,children:n("save")})]})]})})}),b(ri,{}),b(tt,{variant:"h6",children:n("images")}),Q(ye,{container:!0,spacing:2,mt:2,children:[f.data&&b(ye,{size:{md:3},children:b(U1t,{exerciseId:C.id})},"add"),C.images.map(k=>b(ye,{size:{md:3},children:b(H1t,{exerciseId:C.id,image:k,canDelete:h.data})},k.id))]}),b(ri,{}),b(tt,{variant:"h6",children:n("videos")}),Q(ye,{container:!0,spacing:2,mt:2,children:[g.data&&b(ye,{size:{md:3},children:b(G1t,{exerciseId:C.id})},"add"),C.videos.map(k=>b(ye,{size:{md:3},children:b(W1t,{video:k,canDelete:y.data})},k.id))]}),v.data&&Q(xt,{children:[b(ri,{}),b(tt,{variant:"h6",children:n("exercises.muscles")}),Q(ye,{container:!0,spacing:1,mt:2,children:[b(ye,{size:{xs:12,md:6},children:b(eJ,{exerciseId:C.id,value:i,setValue:a,blocked:s,isMain:!0})}),b(ye,{size:{xs:12,md:6},children:b(eJ,{exerciseId:C.id,value:s,setValue:l,blocked:i,isMain:!1})}),b(ye,{size:{sm:6},offset:{md:3},children:Q(ye,{container:!0,children:[b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:i.map(k=>x.data.find(M=>M.id===k)),secondaryMuscles:s.map(k=>x.data.find(M=>M.id===k)),isFront:!0})}),b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:i.map(k=>x.data.find(M=>M.id===k)),secondaryMuscles:s.map(k=>x.data.find(M=>M.id===k)),isFront:!1})})]})})]})]})]})},Q1t=({mainImage:e,sideImages:t})=>Q(ye,{container:!0,spacing:1,children:[e&&b(ye,{size:12,children:b(fo,{children:b(Ec,{component:"img",image:e.url,alt:""})})}),t.map(n=>b(ye,{size:6,children:b(fo,{children:b(Ec,{component:"img",image:n.url,sx:{height:120},alt:""})})},n.id))]}),X1t=({videos:e})=>b(ye,{container:!0,spacing:1,children:e.map(t=>b(ye,{size:6,children:b(fo,{children:b(Ec,{component:"video",src:t.url,sx:{height:120},controls:!0,muted:!0,preload:"metadata"})})},t.id))});function kV(){var r,o;const e=Pa(),t=Od(au.EDIT_EXERCISE),n={canContribute:!1,anonymous:!0,emailVerified:!1,admin:!1};if(e.isSuccess&&t.isSuccess){if(e.data===null)return n;n.anonymous=!1,(r=e.data)!=null&&r.emailVerified&&(n.emailVerified=!0),t.data&&(n.admin=!0),(n.admin||(o=e.data)!=null&&o.isTrustworthy)&&(n.canContribute=!0)}return n}const J1t=({setEditMode:e})=>{const[t]=Re();return Q(en,{mb:2,paddingY:2,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[b(tt,{variant:"h5",children:t("exercises.exerciseNotTranslated")}),b(tt,{gutterBottom:!0,variant:"body1",component:"div",children:t("exercises.exerciseNotTranslatedBody")}),b(at,{variant:"contained",onClick:()=>e(!0),children:t("exercises.translateExerciseNow")})]})},Z1t=({exercise:e,variations:t,language:n,setEditMode:r})=>{var l;const[o]=Re(),i=kV(),a=e.getTranslation(n),s=n&&n.id!==a.language;return Q(ye,{container:!0,children:[s&&i.canContribute&&b(ye,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:12},children:b(J1t,{setEditMode:r})}),Q(ye,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:8},children:[(a==null?void 0:a.aliases.length)>0&&Q(xt,{children:[Q("p",{children:[o("exercises.alsoKnownAs")," ",(l=a==null?void 0:a.aliases)==null?void 0:l.map(c=>c.alias).join(", ")]}),b(ri,{})]}),b(tt,{variant:"h5",children:o("exercises.description")}),b("div",{dangerouslySetInnerHTML:{__html:a==null?void 0:a.description}}),b(ri,{}),(a==null?void 0:a.notes.length)>0&&b(tt,{variant:"h5",children:o("exercises.notes")}),b("ul",{children:a==null?void 0:a.notes.map(c=>b("li",{children:c.note},c.id))}),b(ri,{}),b(tt,{variant:"h5",children:o("exercises.muscles")}),Q(ye,{container:!0,children:[b(ye,{order:{xs:1},size:{xs:6,md:3},children:b(zl,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!0})}),Q(ye,{order:{xs:2,md:3},size:{xs:6,md:3},children:[b("h3",{children:o("exercises.primaryMuscles")}),b("ul",{children:e.muscles.map(c=>b("li",{children:c.getName(o)},c.id))})]}),b(ye,{order:{xs:3,md:2},size:{xs:6,md:3},children:b(zl,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!1})}),Q(ye,{order:{xs:4},size:{xs:6,md:3},children:[b("h3",{children:o("exercises.secondaryMuscles")}),b("ul",{children:e.musclesSecondary.map(c=>b("li",{children:c.getName(o)},c.id))})]})]}),b(ri,{})]}),Q(ye,{order:{xs:1,sm:2},size:{xs:12,sm:5,md:4},children:[b(Q1t,{mainImage:e.mainImage,sideImages:e.sideImages}),b(ri,{}),b(X1t,{videos:e.videos})]}),Q(ye,{order:{xs:3},size:12,children:[b(Ti,{}),b(ri,{}),t.length>0&&b(tt,{variant:"h5",children:o("exercises.variations")}),b(ye,{container:!0,spacing:2,children:t.map(c=>b(ye,{size:{xs:6,md:2},children:b(Qle,{exercise:c,language:n},c.id)},c.id))})]}),b(ye,{order:{xs:4},size:12,children:Q(tt,{variant:"caption",display:"block",mt:2,children:["The text on this page is available under the ",b("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/deed",children:"CC BY-SA 4 License"}),"."]})})]})};function eEt(e){var d,f;const[t,n]=X.useState(null),[r,o]=X.useState(null),[i]=Re(),a=zu(),s=()=>{o(null),n(null)},l=async()=>{var h;await nAe((h=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:h.id),e.onClose(),e.onChangeLanguage()},c=async(h=!1)=>{h?await PW(e.currentExercise.id,r==null?void 0:r.uuid):await PW(e.currentExercise.id),e.onClose(),a("../overview")},u=async h=>{const g=h!==void 0?h:t;if(g!==null)try{const y=await w0(g);o(y)}catch{o(null)}};return Q(xt,{children:[b(cE,{id:"alert-dialog-title",children:i("delete")}),Q(Lw,{children:[b("p",{children:i("exercises.deleteExerciseBody",{name:(d=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:d.name,language:(f=e.currentLanguage)==null?void 0:f.nameLong})}),b("p",{children:i("cannotBeUndone")}),b("p",{children:b("b",{children:i("exercises.replacements")})}),b("p",{children:i("exercises.replacementsInfoText")}),b("p",{children:i("exercises.replacementsSearch")}),b(ty,{callback:h=>{h!==null&&(n(h.data.base_id),u(h.data.base_id))}}),b(tn,{"data-testid":"exercise-id-field",id:"foo",label:"Exercise ID",onBlur:()=>u(),onChange:async h=>{n(h.target.value!==""?parseInt(h.target.value):null)},value:t??"",InputProps:{endAdornment:b(ro,{position:"start",children:b(on,{onClick:()=>u(),children:b(xrt,{})})})},fullWidth:!0,variant:"standard"}),r===null&&b(xt,{children:b("p",{children:b("i",{children:i("exercises.noReplacementSelected")})})}),r!==null&&Q(xt,{children:[Q("p",{children:["Selected exercise for replacement:",b(Do,{title:i("copyToClipboard"),children:b(on,{onClick:()=>navigator.clipboard.writeText(r.id.toString()),children:b(krt,{})})})]}),Q(Ka,{disablePadding:!0,children:[b(JF,{children:b(Nl,{children:r.mainImage?b(Nl,{alt:"",src:`${cj}${r.mainImage.url}`,variant:"rounded"}):b(_u,{})})}),b(uo,{primary:r.getTranslation().name,secondary:`${r.id} (${r.uuid})`}),b(on,{onClick:s,children:b(Trt,{})})]})]})]}),Q(Nw,{children:[b(at,{onClick:()=>e.onClose(),children:i("cancel")}),b(at,{"data-testid":"button-delete-translation",size:"small",onClick:l,variant:"contained",children:i("exercises.deleteTranslation")}),b(at,{"data-testid":"button-delete-all",size:"small",onClick:()=>c(),variant:"contained",children:i("exercises.deleteExerciseFull")}),b(at,{"data-testid":"button-delete-and-replace",size:"small",disabled:r===null,onClick:()=>c(!0),variant:"contained",children:i("exercises.deleteExerciseReplace")})]})]})}const tEt="_root_l288f_1",nEt="_detail_language_l288f_4",rEt="_detail_l288f_4",oEt="_languages_l288f_28",iEt="_language_l288f_28",aEt="_header_l288f_52",sEt="_toolbar_l288f_55",Xf={root:tEt,detail_language:nEt,detail:rEt,languages:oEt,language:iEt,header:aEt,toolbar:sEt},lEt=({exercise:e,languages:t,changeLanguage:n,language:r,setEditMode:o,editMode:i})=>{var E,T,O;const[a,s]=w.useState(null),[l,c]=X.useState(!1),u=!!a,[d]=Re(),f=Od(au.DELETE_EXERCISE),h=Od(au.EDIT_EXERCISE),g=Pa(),y=g.isSuccess&&g.data===null;let v=!1;g.isSuccess&&h.isSuccess&&(v=h.data||g.data!==null&&g.data.isTrustworthy);const x=A=>{s(A.currentTarget)},S=()=>{s(null)},C=A=>{n(A),S()},I=t.map(A=>Q(Ft,{onClick:()=>C(A),selected:(r==null?void 0:r.id)===A.id,children:[b(uo,{children:A.nameLong}),b(si,{children:e.availableLanguages.includes(A.id)?b(zrt,{}):b($o,{})})]},A.nameShort));return b(ye,{container:!0,children:b(ye,{size:12,children:Q("div",{className:Xf.root,children:[b($w,{open:l,onClose:()=>c(!1),children:b(eEt,{onClose:()=>c(!1),onChangeLanguage:()=>n(t[0]),currentExercise:e,currentLanguage:r})}),Q("div",{className:Xf.detail_language,children:[Q("div",{className:Xf.detail,children:[b(io,{to:"../overview",children:d("exercises.exercises")})," > ",(E=e.getTranslation(r))==null?void 0:E.name]}),b("div",{className:Xf.languages,children:Q("div",{className:Xf.language,children:[b(at,{size:"small",id:"basic-button",onClick:x,startIcon:b(gz,{}),children:r==null?void 0:r.nameLong}),Q(Sa,{id:"basic-menu",anchorEl:a,open:u,onClose:S,MenuListProps:{"aria-labelledby":"basic-button"},sx:{padding:20},children:[b(Ft,{disabled:!0,children:d("exercises.changeExerciseLanguage")}),b(Ti,{}),I]})]})})]}),Q("div",{className:Xf.header,children:[b(tt,{gutterBottom:!0,variant:"h2",margin:0,sx:{mt:2},children:(T=e.getTranslation(r))==null?void 0:T.name}),!y&&Q("nav",{className:Xf.toolbar,children:[f.isSuccess&&f.data&&(r==null?void 0:r.id)===((O=e.getTranslation(r))==null?void 0:O.language)&&b(at,{onClick:()=>c(!0),children:d("delete")}),v&&b(at,{onClick:()=>o(!0),disabled:i,children:"EDIT"}),b(at,{onClick:()=>o(!1),disabled:!i,children:"VIEW"})]})]}),Q(_t,{direction:"row",spacing:1,mt:2,children:[b(Pu,{label:d(Ki(e.category.name)),size:"small"}),e.equipment.map(A=>b(Pu,{label:d(Ki(A.name)),variant:"outlined",size:"small"},A.id))]})]})})})},ri=()=>b(en,{sx:{height:20}}),cEt=()=>{var g;const[e,t]=w.useState(Dke),[n,r]=w.useState(!1),o=Ea(),i=parseInt(o.exerciseId??"");if(Number.isNaN(i))return b("p",{children:"Please pass an integer as the exercise id."});const{i18n:a}=Re(),s=zu(),l=$c(),c=br({queryKey:[jke,i],queryFn:()=>w0(i),enabled:l.isSuccess}),u=br({queryKey:[Fke,(g=c.data)==null?void 0:g.variationId],queryFn:()=>{var y;return XMe((y=c.data)==null?void 0:y.variationId)},enabled:c.isSuccess});if(X.useEffect(()=>{if(l.data===void 0)return;const y=Tu(a.language,l.data);t(y)},[l.data]),c.isError||l.isError||u.isError)return s("/not-found"),null;const d=y=>{const v=Tu(y.nameShort,l.data);v!==void 0&&t(v)},f=u.isSuccess?u.data.filter(y=>y.id!==i):[];let h;return c.isSuccess&&l.isSuccess&&(h=n?b(Y1t,{exerciseId:c.data.id,language:e}):b(Z1t,{exercise:c.data,language:e,variations:f,setEditMode:r})),Q(xt,{children:[c.isSuccess&&l.isSuccess&&b(Iu,{children:b(lEt,{exercise:c.data,languages:l.data,changeLanguage:d,language:e,setEditMode:r,editMode:n})}),b(ri,{}),Q(Iu,{maxWidth:"lg",children:[c.isLoading&&l.isLoading&&b(Ba,{}),h]})]})};function gfe(e){const[t]=Re(),[n,r,o]=Za(e.fieldName),[i,a]=w.useState(""),s=u=>{o.setValue(n.value.filter((d,f)=>f!==u))},l=(u,d)=>{n.value[u]=d,o.setValue(n.value)},c=()=>{n.value.push(i),o.setValue(n.value),a("")};return Q(xt,{children:[b(ye,{size:12,children:b(tn,{fullWidth:!0,label:t("exercises.newNote"),sx:{mb:3},variant:"standard",value:i,onChange:u=>a(u.target.value),error:r.touched&&!!r.error,helperText:r.touched&&r.error?r.error:t("exercises.notesHelpText"),InputProps:{endAdornment:b(ro,{position:"end",children:b(on,{onClick:c,children:b($o,{})})})}})}),n.value.map((u,d)=>b(tn,{fullWidth:!0,value:u,onChange:f=>l(d,f.target.value),sx:{mt:2},variant:"standard",error:r.touched&&!!r.error,InputProps:{endAdornment:b(ro,{position:"end",children:b(on,{onClick:()=>s(d),children:b(W0,{})})})}},d))]})}const uEt=({onContinue:e,onBack:t})=>{const[n]=Re(),[r,o]=dv(),i=_o({description:TV(n),notes:efe(n)});return b(ci,{initialValues:{description:r.descriptionEn,notes:r.notesEn},validationSchema:i,onSubmit:a=>{o(a1t(a.description)),o(s1t(a.notes)),e()},children:b(Zo,{children:Q(_t,{children:[b(OV,{fieldName:"description"}),b(ri,{}),b(gfe,{fieldName:"notes"}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[b(at,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})})},dEt=({onContinue:e,onBack:t})=>{const[n]=Re(),r=$c(),[o,i]=dv(),[a,s]=w.useState(o.languageId!==null),l=_o(a?{description:TV(n),name:PV(n),alternativeNames:IV(n),notes:efe(n),language:wo().required()}:{});return b(ci,{initialValues:{name:o.nameI18n,alternativeNames:o.alternativeNamesI18n,description:o.descriptionI18n,language:o.languageId===null?"":o.languageId,notes:o.notesI18n},validationSchema:l,onSubmit:c=>{i(c1t(c.name)),i(u1t(c.description)),i(f1t(c.alternativeNames)),i(b1t(c.language===""?null:c.language)),i(d1t(c.notes)),e()},children:c=>Q(Zo,{children:[Q(_t,{spacing:2,children:[b(Fw,{children:b(ba,{checked:a,onClick:()=>s(!a),control:b(li,{}),label:n("exercises.translateExerciseNow")})}),a&&Q(xt,{children:[r.isLoading?b(en,{children:b(Ba,{})}):Q(rh,{fullWidth:!0,children:[b(oh,{id:"label-language",children:n("language")}),b(gf,{labelId:"label-language",id:"language",value:c.getFieldProps("language").value,onChange:u=>{c.setFieldValue(c.getFieldProps("language").name,u.target.value)},label:n("language"),error:!!(c.touched.language&&c.errors.language),children:r.data.filter(u=>u.id!==Hp).map(u=>Q(Ft,{value:u.id,children:[u.nameShort," - ",u.nameLong]},u.id))})]}),b(EV,{fieldName:"name"}),b(CV,{fieldName:"alternativeNames"}),b(OV,{fieldName:"description"}),b(ri,{}),b(gfe,{fieldName:"notes"})]})]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[b(at,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})};function fEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authors"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function pEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authorProfile"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function hEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.derivativeSourceUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:t("licenses.derivativeSourceUrlHelper")||r.touched&&r.error,...n})}function mEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalObjectUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function gEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalTitle"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function yEt(e){const[t]=Re(),[n,r]=w.useState(nu.PHOTO),[o,i,a]=Za(e.fieldName);return Q(ATe,{value:n,exclusive:!0,fullWidth:!0,onChange:(l,c)=>{r(c),a.setValue(c)},"aria-label":"text alignment",children:[b(tb,{value:nu.PHOTO,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(Brt,{}),b(tt,{variant:"caption",children:t("exercises.imageStylePhoto")})]})}),b(tb,{value:nu.THREE_D,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(_rt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyle3D")})]})}),b(tb,{value:nu.LINE_ART,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b($rt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyleLine")})]})}),b(tb,{value:nu.LOW_POLY,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(Nrt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyleLowPoly")})]})}),b(tb,{value:nu.OTHER,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(Lrt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyleOther")})]})})]})}const vEt=({onContinue:e,onBack:t})=>{const[n]=Re(),r=Pa(),[o,i]=dv(),[a,s]=w.useState(o.images),[l,c]=w.useState(void 0),[u,d]=X.useState(!1),f=()=>d(!1);w.useEffect(()=>{i(w1t(a))},[i,a]);const h=S=>{var E;if(!((E=S.target.files)!=null&&E.length))return;const[C]=S.target.files,I=URL.createObjectURL(C);d(!0),c({url:I,file:C,author:"",authorUrl:"",title:"",derivativeSourceUrl:"",objectUrl:"",style:nu.PHOTO.toString()})},g=S=>{s(a.concat({url:l==null?void 0:l.url,file:l==null?void 0:l.file,author:S.author,authorUrl:S.authorUrl,title:S.title,derivativeSourceUrl:S.derivativeSourceUrl,objectUrl:S.objectUrl,style:S.imageStyle.toString()})),f()},y=S=>{const C=a.filter(I=>I.url!==S);s(C)},v=()=>{e()};return Q("div",{children:[b(by,{open:u,onClose:f,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(en,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:600,bgcolor:"background.paper",boxShadow:24,p:4},children:[b(tt,{id:"modal-modal-title",variant:"h6",component:"h2",children:n("exercises.imageDetails")}),Q(ye,{container:!0,spacing:2,children:[b(ye,{size:4,children:l&&b("img",{style:{width:"100%"},src:l.url,alt:"",loading:"lazy"})}),b(ye,{size:8,children:b(ci,{initialValues:{title:"",objectUrl:"",author:r.isSuccess?r.data.username:"",authorUrl:"",derivativeSourceUrl:"",imageStyle:nu.PHOTO},onSubmit:S=>{console.log(S),g(S)},children:S=>Q(Zo,{children:[Q(_t,{spacing:2,children:[b(gEt,{fieldName:"title"}),b(mEt,{fieldName:"objectUrl"}),b(fEt,{fieldName:"author"}),b(pEt,{fieldName:"authorUrl"}),b(hEt,{fieldName:"derivativeSourceUrl"}),b(yEt,{fieldName:"imageStyle"}),Q(Ii,{icon:b(cle,{fontSize:"inherit"}),severity:"info",children:["By submitting this image, you agree to release it under the ",b("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/",target:"_blank",rel:"noreferrer",children:"CC BY-SA 4.0"})," license. The image must be either your own work or the author must have released in under a license compatible with CC BY-SA 4.0."]})]}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("add")})})]})})})]})]})}),b(tt,{children:n("exercises.compatibleImagesCC")}),Q(_t,{direction:"row",justifyContent:"center",children:[Q("div",{children:[b("label",{htmlFor:"camera-input",children:b(Crt,{fontSize:"large",sx:{m:2}})}),b("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:h})]}),Q("div",{children:[b("label",{htmlFor:"image-input",children:b(Ort,{fontSize:"large",sx:{m:2}})}),b("input",{type:"file",accept:"image/*",name:"image-file",id:"image-input",style:{display:"none"},onChange:h})]})]}),b(see,{cols:3,style:{maxHeight:"400px"},children:a.map(S=>Q(lee,{children:[b("img",{style:{maxHeight:"400px",maxWidth:"400px"},src:S.url,alt:"",loading:"lazy"}),b(k1e,{title:S.title,subtitle:S.author,actionIcon:b(on,{onClick:()=>y(S.url),sx:{color:"white"},children:b(Mrt,{})})})]},S.url))}),b(tt,{children:n("forms.supportedImageFormats")}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q(xt,{children:[b(at,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",onClick:v,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})},bEt="exercisecomment",tJ=async e=>{const t=new pte,n=dt(bEt),r=await nt.post(n,t.toJson(e),{headers:pt()});return t.fromJson(r.data)},wEt="variation",xEt=async()=>{const e=dt(wEt);return(await nt.post(e,{},{headers:pt()})).data.id},SEt=({onBack:e})=>{const[t,n]=Re(),[r]=dv(),o=zu(),i=WT(),a=$c(),s=Yy(),l=GT(),c=Pa(),[u,d]=w.useState("initial"),f=async()=>{d("loading");let g;r.newVariationExerciseId!==null?g=await xEt():g=r.variationId;const y=await JMe(r.category,r.equipment,r.muscles,r.musclesSecondary,g,c.data.username),v=await D2({exerciseId:y,languageId:Hp,name:r.nameEn,description:r.descriptionEn,author:c.data.username});for(const x of r.alternativeNamesEn)await _2(v.id,x);for(const x of r.images)await bte({exerciseId:y,image:x.file,imageData:x});for(const x of r.notesEn)await tJ(new R2(null,v.id,x));if(r.languageId!==null){const x=await D2({exerciseId:y,languageId:r.languageId,name:r.nameI18n,description:r.descriptionI18n,author:c.data.username});for(const S of r.alternativeNamesI18n)await _2(x.id,S);for(const S of r.notesI18n)await tJ(new R2(null,x.id,S))}console.log("Exercise created"),d("done")},h=()=>{o(Qt(Kt.EXERCISE_OVERVIEW,n.language))};return l.isLoading||a.isLoading||s.isLoading||i.isLoading?b(wr,{}):Q(xt,{children:[b(tt,{variant:"h6",children:t("exercises.step1HeaderBasics")}),b(jl,{children:b(Ll,{children:Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("name")}),b(Te,{children:r.nameEn})]}),Q(Zt,{children:[b(Te,{children:t("exercises.alternativeNames")}),b(Te,{children:r.alternativeNamesEn.join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("description")}),b(Te,{children:r.descriptionEn})]}),Q(Zt,{children:[b(Te,{children:t("exercises.notes")}),b(Te,{children:r.notesEn.map(g=>Q(xt,{children:[g,b("br",{})]}))})]}),Q(Zt,{children:[b(Te,{children:t("category")}),b(Te,{children:t(Ki(i.data.find(g=>g.id===r.category).name))})]}),Q(Zt,{children:[b(Te,{children:t("exercises.equipment")}),b(Te,{children:r.equipment.map(g=>t(Ki(l.data.find(y=>y.id===g).name))).join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("exercises.muscles")}),b(Te,{children:r.muscles.map(g=>s.data.find(y=>y.id===g).getName(t)).join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("exercises.secondaryMuscles")}),b(Te,{children:r.musclesSecondary.map(g=>s.data.find(y=>y.id===g).getName(t)).join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("exercises.variations")}),Q(Te,{children:[r.variationId," / ",r.newVariationExerciseId]})]})]})})}),r.images.length>0&&b(see,{cols:3,style:{maxHeight:"200px"},children:r.images.map(g=>b(lee,{children:b("img",{style:{maxHeight:"200px",maxWidth:"200px"},src:g.url,alt:"",loading:"lazy"})},g.url))}),r.languageId!==null&&Q(xt,{children:[b(tt,{variant:"h6",sx:{mt:3},children:a.data.find(g=>g.id===r.languageId).nameLong}),b(jl,{children:b(Ll,{children:Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("name")}),b(Te,{children:r.nameI18n})]}),Q(Zt,{children:[b(Te,{children:t("exercises.alternativeNames")}),b(Te,{children:r.alternativeNamesI18n.join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("description")}),b(Te,{children:r.descriptionI18n})]}),Q(Zt,{children:[b(Te,{children:t("exercises.notes")}),b(Te,{children:r.notesI18n.map(g=>Q(xt,{children:[g,b("br",{})]}))})]})]})})})]}),u!=="done"?b(Ii,{severity:"info",sx:{mt:2},children:t("exercises.checkInformationBeforeSubmitting")}):Q(Ii,{severity:"success",sx:{mt:2},children:[b(hg,{children:t("success")}),t("exercises.cacheWarning")]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[u!=="done"&&b(at,{onClick:e,sx:{mt:1,mr:1},children:t("goBack")}),u!=="done"&&b(at,{variant:"contained",disabled:u!=="initial",onClick:f,sx:{mt:1,mr:1},color:"info",children:t("exercises.submitExercise")}),u==="done"&&Q(at,{variant:"contained",onClick:h,sx:{mt:1,mr:1},color:"success",children:[t("overview"),b(Frt,{})]})]})})})})]})},CEt=()=>{const[e]=Re(),[t,n]=X.useState(0),r=()=>{n(i=>i+1)},o=()=>{n(i=>i-1)};return b(S1t,{children:Q(Iu,{maxWidth:"md",children:[b(_t,{direction:"row",children:b(tt,{gutterBottom:!0,variant:"h3",component:"div",children:e("exercises.contributeExercise")})}),b(en,{children:Q(fIe,{activeStep:t,orientation:"vertical",children:[Q(Qh,{children:[b(ep,{children:e("exercises.step1HeaderBasics")}),b(Xh,{children:b(C1t,{onContinue:r,onBack:o})})]},1),Q(Qh,{children:[b(ep,{children:e("exercises.variations")}),b(Xh,{children:b(P1t,{onContinue:r,onBack:o})})]},2),Q(Qh,{children:[b(ep,{children:e("description")}),b(Xh,{children:b(uEt,{onContinue:r,onBack:o})})]},3),Q(Qh,{children:[b(ep,{children:e("translation")}),b(Xh,{children:b(dEt,{onContinue:r,onBack:o})})]},4),Q(Qh,{children:[b(ep,{children:e("images")}),b(Xh,{children:b(vEt,{onContinue:r,onBack:o})})]},5),Q(Qh,{children:[b(ep,{children:e("overview")}),b(Xh,{children:b(SEt,{onBack:o})})]},6)]})})]})})},EEt=()=>{const[e]=Re(),t=kV();return Q(Iu,{maxWidth:"md",children:[b(tt,{variant:"h3",children:e("exercises.notEnoughRightsHeader")}),Q(en,{marginTop:4,padding:4,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[b(tt,{mb:2,children:e("exercises.notEnoughRights",{days:_ke})}),!t.anonymous&&!t.emailVerified&&b(at,{variant:"contained",href:"/user/preferences",endIcon:b(wrt,{}),children:e("preferences")})]})]})},PEt=()=>{const e=kV();return b(xt,{children:e.canContribute?b(CEt,{}):b(EEt,{})})},IEt=()=>b("div",{children:"Add Weight Page"}),TEt=({day:e,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})=>{const i=Lr(),a=Zd(i.breakpoints.down("sm")),s=Zd(i.breakpoints.down("md")),l=kl(e.date,r.date),c=kl(e.date,n),u=e.date.getMonth()===t&&(e.date.getDate()<=n.getDate()||e.date.getMonth()<n.getMonth()||e.date.getFullYear()<n.getFullYear()),d=e.date.getDay()===6||e.date.getDay()===0,f=()=>l||c?"white":u?d?"#E53945":"black":"gray",h=()=>a?35:s?40:50,g=()=>a?8:s?9:10,y=()=>e.measurements.length>0||e.weightEntry!==void 0,v=()=>{u&&o(e)},x=h(),S=g();return Q("div",{style:{position:"relative",width:`${x}px`,height:`${x+S/2}px`,display:"flex",flexDirection:"column",alignItems:"center"},children:[b("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:`${x}px`,height:`${x}px`,fontSize:a?"0.8rem":s?"0.9rem":"1rem",color:l||c?"white":f(),backgroundColor:l?"#E53945":c?"#FEC107":"transparent",borderRadius:"50%",fontWeight:"bold",cursor:u?"pointer":"default",opacity:e.date.getMonth()!==t?.25:1},"data-testid":`day-${co(e.date)}`,onClick:v,children:e.date.getDate()}),y()&&b("div",{style:{width:`${S}px`,height:`${S}px`,backgroundColor:"black",borderRadius:"50%",position:"absolute",bottom:0,left:"50%",transform:"translateX(-50%)",zIndex:2}})]})},OEt=({days:e,currentMonth:t,currentDate:n,selectedDay:r,onDayClick:o})=>{const{i18n:i}=Re(),a=Array.from({length:7},(s,l)=>new Date(1970,0,l+5).toLocaleString(i.language,{weekday:"short"}));return Q(ye,{container:!0,spacing:1,rowSpacing:2,children:[a.map((s,l)=>b(ye,{size:12/7,children:b(tt,{variant:"body1",sx:{fontWeight:"bold",textAlign:"center"},children:s})},`weekday-${l}`)),e.map((s,l)=>b(ye,{size:12/7,sx:{display:"flex",justifyContent:"center"},children:b(TEt,{day:s,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})},`day-${l}`))]})},kEt=({currentMonth:e,currentYear:t,onPrevMonth:n,onNextMonth:r})=>{const{i18n:o}=Re(),i=Array.from({length:12},(a,s)=>new Date(2024,s,1).toLocaleString(o.language,{month:"long"}));return Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",paddingBottom:"3%"},children:[b(at,{variant:"outlined",onClick:n,children:"<"}),Q(tt,{variant:"h5",children:[i[e]," ",t]}),b(at,{variant:"outlined",onClick:r,children:">"})]})};class MEt{constructor(t,n,r,o){this.name=t,this.unit=n,this.value=r,this.date=o}}const AEt=({selectedDay:e})=>{const[t]=Re(),n=t("no_entries_for_day");return Q(fo,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"60%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2}},children:[b(Vl,{title:Q(tt,{variant:"h5",component:"div",sx:{fontWeight:"bold"},children:[t("entries")," - ",e.date.toLocaleDateString()]})}),Q(Pi,{sx:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",gap:2},children:[Q("div",{className:"flex items-center gap-2",children:[Q("span",{className:"font-extrabold",children:[t("weight"),": "]}),b("span",{className:`${e.weightEntry?"text-xl font-semibold":"text-gray-500"}`,children:e.weightEntry?`${e.weightEntry.weight.toFixed(1)} kg`:n})]}),Q("div",{className:"flex flex-col gap-1",children:[Q("span",{className:"font-bold",children:[t("measurements.measurements"),": "]}),e.measurements.length===0?b("span",{className:"text-gray-500 mt-1",children:n}):b("div",{className:"flex flex-col gap-0.5",children:e.measurements.map(r=>Q("div",{children:[r.name,": ",r.value," ",r.unit]},r.name))})]})]})]})};function REt(){const t=Jle().data;return(t==null?void 0:t.flatMap(n=>n.entries.map(r=>new MEt(n.name,n.unit,r.value,r.date))))??[]}const DEt=()=>{const[e]=Re(),n=Y0().data,r=REt(),o=(C,I)=>{const E=new Date(C,I,1),T=[];let A=new Date(C,I,1).getDay();A=A===0?6:A-1;for(let R=0;R<A;R++)T.push({date:new Date(C,I,-A+R+1),weightEntry:void 0,measurements:[]});for(;E.getMonth()===I;)T.push({date:new Date(E),weightEntry:n==null?void 0:n.find(R=>kl(R.date,E)),measurements:r.filter(R=>kl(R.date,E))}),E.setDate(E.getDate()+1);A=new Date(C,I+1,0).getDay();const M=A===0?0:7-A;for(let R=1;R<=M;R++)T.push({date:new Date(C,I+1,R),weightEntry:void 0,measurements:[]});return T},i=new Date,a={date:i,weightEntry:void 0,measurements:[]},[s,l]=w.useState(i.getMonth()),[c,u]=w.useState(i.getFullYear()),d=o(c,s),[f,h]=w.useState(d.find(C=>kl(C.date,i))||a),g=Lr(),y=Zd(g.breakpoints.down("sm"));w.useEffect(()=>{l(f.date.getMonth()),u(f.date.getFullYear())},[f]);const v=C=>{h(C)},x=()=>{s===0?(l(11),u(c-1)):l(s-1)},S=()=>{(s<i.getMonth()||c<i.getFullYear())&&(s===11?(l(0),u(c+1)):l(s+1))};return Q(en,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",md:"row"},height:{xs:"auto",md:"calc(100vh - 130px)"},width:"100%"},children:[Q(fo,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"auto%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2},display:"flex",flexDirection:"column"},children:[b(Vl,{sx:{"& .MuiCardHeader-content":{width:"100%"}},title:b("div",{style:{display:"flex",flexDirection:"column",width:"100%"},children:Q("div",{style:{display:"flex",alignItems:"center",marginBottom:"16px"},children:[b(Srt,{style:{width:y?"28px":"32px",height:y?"28px":"32px",marginRight:"12px"}}),b("span",{style:{fontSize:y?"1.5rem":"1.8rem",fontWeight:"bold"},children:e("calendar")})]})})}),Q(Pi,{sx:{overflow:"auto",flex:1,"&:last-child":{paddingBottom:2}},children:[b(kEt,{currentMonth:s,currentYear:c,onPrevMonth:x,onNextMonth:S}),b(OEt,{days:d,currentMonth:s,currentDate:i,selectedDay:f,onDayClick:v})]})]}),b(AEt,{selectedDay:f})]})},_Et=()=>b("div",{children:b(DEt,{})}),$Et=()=>b("div",{children:"Calories Calculator Page"}),NEt=()=>b("div",{children:"Equipments Page"}),LEt=()=>b("div",{children:"Gallery Page"}),FEt=()=>b("div",{children:"Ingredients Page"}),jEt=()=>b("div",{children:"Login Page"}),BEt=()=>b("div",{children:"Preferences Page"}),zEt=()=>b("div",{children:"RestApi Page"}),VEt=({weight:e})=>{const t=Oit(),[n]=Re(),[r,o]=X.useState(null),[i,a]=X.useState(!1),s=!!r,l=g=>{o(g.currentTarget)},c=()=>{u(),f()},u=()=>{o(null)},d=()=>{t.mutate(e.id),o(null)},f=()=>a(!0),h=()=>a(!1);return Q("div",{children:[b(at,{onClick:l,children:b(vrt,{})}),Q(Sa,{anchorEl:r,open:s,onClose:u,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:c,children:n("edit")}),b(Ft,{onClick:d,children:n("delete")})]}),b(ki,{title:n("edit"),isOpen:i,closeFn:h,children:b(Jy,{weightEntry:e,closeFn:h})})]})},HEt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"primary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Jy,{closeFn:o})})]})},UEt=e=>e.map((t,n)=>n===0?{entry:t,change:0,days:Math.abs(t.date.getTime()-t.date.getTime())/(1e3*60*60*24)}:{entry:t,change:e[n].weight-e[n-1].weight,days:Math.abs(t.date.getTime()-e[n-1].date.getTime())/(1e3*60*60*24)}),WEt=Oz(e=>({table:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),GEt=({weights:e})=>{const t=[10,50,100],[n]=Re(),r=WEt(),o=UEt(e),[i,a]=w.useState(t[0]),[s,l]=w.useState(0),c=(d,f)=>{l(f)},u=d=>{a(parseInt(d.target.value,10)),l(0)};return Q("div",{className:r.table,children:[Q(jl,{children:[Q(Ll,{sx:{minWidth:650},"aria-label":"simple table",children:[b(Du,{children:Q(Zt,{children:[b(Te,{align:"center",children:n("date")}),b(Te,{align:"center",children:n("weight")}),b(Te,{align:"center",children:n("difference")}),b(Te,{align:"center",children:n("days")}),b(Te,{align:"center"})]})}),b(Fl,{children:o.slice(s*i,s*i+i).map(d=>Q(Zt,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[b(Te,{component:"th",scope:"row",align:"center",children:d.entry.date.toLocaleDateString()}),b(Te,{align:"center",children:d.entry.weight}),b(Te,{align:"center",children:+d.change.toFixed(2)}),b(Te,{align:"center",children:d.days}),b(Te,{align:"center",children:b(VEt,{weight:d.entry})})]},d.entry.date.toLocaleDateString()))})]}),b(nj,{rowsPerPageOptions:t,component:"div",count:o.length,rowsPerPage:i,page:s,onPageChange:c,onRowsPerPageChange:u})]}),b(HEt,{})]})},qEt=()=>{const[e]=Re(),[t,n]=w.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Jy,{closeFn:o})})]})},KEt=({currentFilter:e,onFilterChange:t})=>{const[n]=Re(),r=Lr(),o=i=>{e!==i&&t(i)};return Q(GF,{variant:"outlined",sx:{mb:2},children:[b(at,{onClick:()=>o(""),color:e===""?"primary":"inherit",variant:e===""?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("all")}),b(at,{onClick:()=>o("lastYear"),color:e==="lastYear"?"primary":"inherit",variant:e==="lastYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastYear")}),b(at,{onClick:()=>o("lastHalfYear"),color:e==="lastHalfYear"?"primary":"inherit",variant:e==="lastHalfYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastHalfYear")}),b(at,{onClick:()=>o("lastMonth"),color:e==="lastMonth"?"primary":"inherit",variant:e==="lastMonth"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastMonth")}),b(at,{onClick:()=>o("lastWeek"),color:e==="lastWeek"?"primary":"inherit",variant:e==="lastWeek"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastWeek")})]})},YEt=()=>{const[e]=Re(),[t,n]=w.useState("lastYear"),r=Y0(t),o=i=>{n(i)};return r.isLoading?b(wr,{}):b(es,{title:e("weight"),mainContent:Q(_t,{spacing:2,children:[b(KEt,{currentFilter:t,onFilterChange:o}),r.data.length===0&&b(ih,{}),r.data.length!==0&&Q(xt,{children:[b(Wle,{weights:r.data}),b(en,{sx:{mt:4}}),b(GEt,{weights:r.data})]})]}),fab:b(qEt,{})})},QEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Weight"}),Q(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:[b(Ft,{component:io,to:Qt(Kt.WEIGHT_OVERVIEW,e.language),children:"Weight overview"}),b(Ft,{component:io,to:Qt(Kt.WEIGHT_ADD,e.language),children:"Add weight entry"})]})]})},XEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Measurements"}),b(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:b(Ft,{component:io,to:Qt(Kt.MEASUREMENT_OVERVIEW,e.language),children:"Overview"})})]})},JEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Nutrition"}),b(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:b(Ft,{component:io,to:Qt(Kt.NUTRITION_OVERVIEW,e.language),children:"Overview"})})]})},ZEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Routines"}),Q(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:[b(Ft,{component:io,to:Qt(Kt.ROUTINE_OVERVIEW,e.language),children:"Routine overview"}),b(Ft,{component:io,to:Qt(Kt.PRIVATE_TEMPLATE_OVERVIEW,e.language),children:"Private template overview"}),b(Ft,{component:io,to:Qt(Kt.PUBLIC_TEMPLATE_OVERVIEW,e.language),children:"Public template overview"}),b(Ft,{component:io,to:Qt(Kt.EXERCISE_OVERVIEW,e.language),children:"Exercise overview"}),b(Ft,{component:io,to:Qt(Kt.EXERCISE_CONTRIBUTE,e.language),children:"Contribute exercise"}),b(Ft,{component:io,to:Qt(Kt.CALENDAR,e.language),children:"Calendar"})]})]})},ePt=()=>b(Owe,{position:"static",children:Q(wee,{children:[b(tt,{variant:"h6",component:"div",mr:3,children:"wger"}),b(ZEt,{}),b(QEt,{}),b(XEt,{}),b(JEt,{})]})}),tPt=()=>b(YEt,{}),nPt=()=>b("div",{children:"Workout Page"}),_$=()=>b(cEt,{}),MV=()=>Q(Wot,{children:[Q(Ut,{path:"/:lang",children:[Q(Ut,{path:"workout",children:[b(Ut,{path:"overview",element:b(nPt,{})}),b(Ut,{path:"gallery",element:b(LEt,{})})]}),Q(Ut,{path:"routine",children:[b(Ut,{index:!0,element:b(qX,{})}),b(Ut,{path:"overview",element:b(qX,{})}),b(Ut,{path:"calendar",element:b(_Et,{})}),b(Ut,{path:"add",element:b(ebt,{})}),Q(Ut,{path:":routineId",children:[b(Ut,{path:"day/:dayId",children:b(Ut,{path:"add-logs",element:b(LCt,{})})}),Q(Ut,{path:"edit",children:[b(Ut,{index:!0,element:b(_Ct,{})}),b(Ut,{path:"progression/:slotId",element:b(FCt,{})})]}),b(Ut,{path:"view",element:b(rbt,{})}),b(Ut,{path:"table",element:b(obt,{})}),b(Ut,{path:"logs",element:b(WCt,{})}),b(Ut,{path:"statistics",element:b(YCt,{})})]}),Q(Ut,{path:"templates",children:[b(Ut,{path:":routineId",children:b(Ut,{path:"view",element:b(jCt,{})})}),Q(Ut,{path:"overview",children:[b(Ut,{path:"private",element:b(XCt,{})}),b(Ut,{path:"public",element:b(JCt,{})})]})]})]}),Q(Ut,{path:"measurement",children:[b(Ut,{index:!0,element:b(nX,{})}),b(Ut,{path:"overview",element:b(nX,{})}),b(Ut,{path:"category/:categoryId",element:b(kvt,{})})]}),Q(Ut,{path:"exercise",children:[b(Ut,{index:!0,element:b(zY,{})}),b(Ut,{path:"overview",element:b(zY,{})}),b(Ut,{path:":exerciseId",element:b(_$,{}),children:b(Ut,{path:"view",element:b(_$,{}),children:b(Ut,{path:":slug",element:b(_$,{})})})}),b(Ut,{path:"contribute",element:b(PEt,{})})]}),Q(Ut,{path:"weight",children:[b(Ut,{path:"overview",element:b(tPt,{})}),b(Ut,{path:"add",element:b(IEt,{})})]}),Q(Ut,{path:"nutrition",children:[b(Ut,{path:"overview",element:b(Gvt,{})}),Q(Ut,{path:":planId",children:[b(Ut,{path:"view",element:b(Wvt,{})}),b(Ut,{path:":date",element:b(rX,{})}),b(Ut,{path:"diary",element:b(rX,{})})]}),Q(Ut,{path:"calculator",children:[b(Ut,{path:"bmi",element:b(Rvt,{})}),b(Ut,{path:"calories",element:b($Et,{})})]}),b(Ut,{path:"ingredient",children:b(Ut,{path:"overview",element:b(FEt,{})})})]}),Q(Ut,{path:"software",children:[b(Ut,{path:"about-us",element:b(ZCt,{})}),b(Ut,{path:"api",element:b(zEt,{})}),b(Ut,{path:"equipment",element:b(NEt,{})})]}),b(Ut,{path:"login",element:b(jEt,{})}),b(Ut,{path:"user",children:b(Ut,{path:"preferences",element:b(BEt,{})})})]}),b(Ut,{path:"/",element:b(Bst,{})}),b(Ut,{path:"*",element:b("main",{style:{padding:"1rem"},children:b("p",{children:"404, Page NOT FOUND"})})})]}),rPt="_notification_bbb61_1",nJ={notification:rPt},oPt=()=>{const[e,t]=o1t(),n=()=>{t(KX({notify:!1,message:"",severity:void 0,title:"",type:void 0}))},r=()=>{t(KX({notify:!1,message:"",severity:void 0,title:"",type:void 0,undo:!0}))};return e.notification.notify?e.notification.type==="delete"?Q(Ii,{className:nJ.notification,severity:e.notification.severity,action:b(at,{color:"inherit",size:"small",onClick:r,children:"UNDO"}),variant:"filled",children:[b(hg,{children:e.notification.title}),b("strong",{children:e.notification.message})]}):Q(Ii,{className:nJ.notification,severity:e.notification.severity,onClose:()=>n(),variant:"filled",children:[b(hg,{children:e.notification.title}),b("strong",{children:e.notification.message})]}):null};function iPt(){return Q(ye,{container:!0,children:[b(ye,{size:12,children:b(ePt,{})}),b(ye,{size:12,children:b(oPt,{})}),b(ye,{size:12,children:b(MV,{})})]})}const{slice:aPt,forEach:sPt}=[];function lPt(e){return sPt.call(aPt.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const rJ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,cPt=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let i=`${e}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!rJ.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!rJ.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},oJ={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=cPt(e,encodeURIComponent(t),o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e){this.create(e,"",-1)}};var uPt={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return oJ.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&typeof document<"u"&&oJ.create(n,e,r,o,i)}},dPt={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const a=o.substring(1).split("&");for(let s=0;s<a.length;s++){const l=a[s].indexOf("=");l>0&&a[s].substring(0,l)===t&&(n=a[s].substring(l+1))}}return n}};let Rb=null;const iJ=()=>{if(Rb!==null)return Rb;try{Rb=window!=="undefined"&&window.localStorage!==null;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Rb=!1}return Rb};var fPt={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&iJ())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&iJ()&&window.localStorage.setItem(n,e)}};let Db=null;const aJ=()=>{if(Db!==null)return Db;try{Db=window!=="undefined"&&window.sessionStorage!==null;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Db=!1}return Db};var pPt={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&aJ())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&aJ()&&window.sessionStorage.setItem(n,e)}},hPt={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)t.push(n[i]);r&&t.push(r),o&&t.push(o)}return t.length>0?t:void 0}},mPt={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},gPt={name:"path",lookup(e){var o;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof t=="number"?t:0])==null?void 0:o.replace("/",""):void 0}},yPt={name:"subdomain",lookup(e){var o,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let yfe=!1;try{document.cookie,yfe=!0}catch{}const vfe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];yfe||vfe.splice(1,1);const vPt=()=>({order:vfe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class bfe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=lPt(n,this.options||{},vPt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(uPt),this.addDetector(dPt),this.addDetector(fPt),this.addDetector(pPt),this.addDetector(hPt),this.addDetector(mPt),this.addDetector(gPt),this.addDetector(yPt)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}bfe.type="languageDetector";function aF(e){"@babel/helpers - typeof";return aF=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aF(e)}function wfe(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":aF(XMLHttpRequest))==="object"}function bPt(e){return!!e&&typeof e.then=="function"}function wPt(e){return bPt(e)?e:Promise.resolve(e)}function sJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sJ(Object(n),!0).forEach(function(r){xPt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sJ(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xPt(e,t,n){return(t=SPt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SPt(e){var t=CPt(e,"string");return eh(t)=="symbol"?t:t+""}function CPt(e,t){if(eh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}var cf=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?cf=global.fetch:typeof window<"u"&&window.fetch&&(cf=window.fetch);var Kx;wfe()&&(typeof global<"u"&&global.XMLHttpRequest?Kx=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Kx=window.XMLHttpRequest));var nI;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?nI=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(nI=window.ActiveXObject));typeof cf!="function"&&(cf=void 0);if(!cf&&!Kx&&!nI)try{Kve(()=>import("./browser-ponyfill-CC9JzGyT.js").then(e=>e.b),[]).then(function(e){cf=e.default}).catch(function(){})}catch{}var sF=function(t,n){if(n&&eh(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},cJ=function(t,n,r,o){var i=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(o){var a=o(t,n);if(a instanceof Promise){a.then(i).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(i).catch(r):cf(t,n).then(i).catch(r)},uJ=!1,EPt=function(t,n,r,o){t.queryStringParams&&(n=sF(n,t.queryStringParams));var i=lJ({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=lJ({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:i},uJ?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{cJ(n,s,o,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return o(c);try{Object.keys(a).forEach(function(u){delete s[u]}),cJ(n,s,o,l),uJ=!0}catch(u){o(u)}}},PPt=function(t,n,r,o){r&&eh(r)==="object"&&(r=sF("",r).slice(1)),t.queryStringParams&&(n=sF(n,t.queryStringParams));try{var i=Kx?new Kx:new nI("MSXML2.XMLHTTP.3.0");i.open(r?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(l){console&&console.log(l)}},IPt=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},cf&&n.indexOf("file:")!==0)return EPt(t,n,r,o);if(wfe()||typeof ActiveXObject=="function")return PPt(t,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function cy(e){"@babel/helpers - typeof";return cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cy(e)}function dJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dJ(Object(n),!0).forEach(function(r){xfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dJ(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TPt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OPt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sfe(r.key),r)}}function kPt(e,t,n){return t&&OPt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xfe(e,t,n){return(t=Sfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sfe(e){var t=MPt(e,"string");return cy(t)=="symbol"?t:t+""}function MPt(e,t){if(cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var APt=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return xfe({},r,o||"")},parseLoadPayload:function(n,r){},request:IPt,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Cfe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};TPt(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return kPt(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=$$($$($$({},APt()),this.options||{}),o),this.allOptions=i,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);cy(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=wPt(l),l.then(function(c){if(!c)return a(null,{});var u=s.services.interpolator.interpolate(c,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(u,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this,s=typeof o=="string"?[o]:o,l=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,c,function(u,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&u&&u.message){var f=u.message.toLowerCase(),h=["failed","fetch","network","load"].find(function(v){return f.indexOf(v)>-1});if(h)return r("failed loading "+n+": "+u.message,!0)}if(u)return r(u,!1);var g,y;try{typeof d.data=="string"?g=a.options.parse(d.data,o,i):g=d.data}catch{y="failed parsing "+n+" to json"}if(y)return r(y,!1);r(null,g)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,i),c=0,u=[],d=[];n.forEach(function(f){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(f,r));var g=s.services.interpolator.interpolate(h,{lng:f,ns:r});s.options.request(s.options,g,l,function(y,v){c+=1,u.push(y),d.push(v),c===n.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(d){var f=i.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){o.read(u,d,"read",null,null,function(f,h){f&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),f),!f&&h&&a.log("loaded namespace ".concat(d," for language ").concat(u),h),o.loaded("".concat(u,"|").concat(d),f,h)})})})}}}])}();Cfe.type="backend";qr.use(Cfe).use(bfe).use(HTe).init({load:"languageOnly",detection:{order:["path","navigator","htmlTag"]},fallbackLng:"en",interpolation:{escapeValue:!1},backend:{loadPath:"/static/react/locales/{{lng}}/{{ns}}.json"}});const fv=new Mve({defaultOptions:{queries:{retry:3,staleTime:1e3*60*5,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:"always"}}}),RPt=e=>{const t=document.getElementById(e);if(t===null)return;const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),o=document.createElement("style"),i=document.getElementById("react-css");if(i){const l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("href",i.href),n.appendChild(i)}n.appendChild(r),n.appendChild(o);const a=NJ({key:"css",prepend:!0,container:o});bh.createRoot(r).render(b(tme,{value:a,children:b(w.Suspense,{fallback:b(Ba,{}),children:b(Sz,{children:b(th,{theme:Ovt(r),children:b(gy,{client:fv,children:b(MV,{})})})})})}))},fJ=document.getElementById("root");fJ&&bh.createRoot(fJ).render(b(X.StrictMode,{children:b(w.Suspense,{fallback:b(Ba,{}),children:b(Sz,{children:b(th,{theme:xh,children:Q(gy,{client:fv,children:[b(iPt,{}),b(Yve,{})]})})})})}));const pJ=document.getElementById("react-page-no-shadow-dom");pJ&&bh.createRoot(pJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(Sz,{children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(MV,{})})})})}));RPt("react-page");const hJ=document.getElementById("react-weight-dashboard");hJ&&bh.createRoot(hJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(Gle,{})})})}));const mJ=document.getElementById("react-nutrition-dashboard");mJ&&bh.createRoot(mJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(Jse,{})})})}));const gJ=document.getElementById("react-routine-dashboard");gJ&&bh.createRoot(gJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(Ole,{})})})}));const yJ=document.getElementById("react-ingredient-search");yJ&&bh.createRoot(yJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(Fst,{})})}));export{vC as c,Fn as g};+ `}}];return{always:Ob(a,"always"),resting:Ob(a,"resting"),dragging:Ob(a,"dragging"),dropAnimating:Ob(a,"dropAnimating"),userCancel:Ob(a,"userCancel")}};const Ga=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect,k$=()=>{const e=document.querySelector("head");return e||vt(),e},NX=e=>{const t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t};function $0t(e,t){const n=Vn(()=>_0t(e),[e]),r=w.useRef(null),o=w.useRef(null),i=Wt(Yo(d=>{const f=o.current;f||vt(),f.textContent=d}),[]),a=Wt(d=>{const f=r.current;f||vt(),f.textContent=d},[]);Ga(()=>{!r.current&&!o.current||vt();const d=NX(t),f=NX(t);return r.current=d,o.current=f,d.setAttribute(`${sy}-always`,e),f.setAttribute(`${sy}-dynamic`,e),k$().appendChild(d),k$().appendChild(f),a(n.always),i(n.resting),()=>{const h=g=>{const y=g.current;y||vt(),k$().removeChild(y),g.current=null};h(r),h(o)}},[t,a,i,n.always,n.resting,e]);const s=Wt(()=>i(n.dragging),[i,n.dragging]),l=Wt(d=>{if(d==="DROP"){i(n.dropAnimating);return}i(n.userCancel)},[i,n.dropAnimating,n.userCancel]),c=Wt(()=>{o.current&&i(n.resting)},[i,n.resting]);return Vn(()=>({dragging:s,dropping:l,resting:c}),[s,l,c])}function Rde(e,t){return Array.from(e.querySelectorAll(t))}var Dde=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window;function dO(e){return e instanceof Dde(e).HTMLElement}function N0t(e,t){const n=`[${ly.contextId}="${e}"]`,r=Rde(document,n);if(!r.length)return null;const o=r.find(i=>i.getAttribute(ly.draggableId)===t);return!o||!dO(o)?null:o}function L0t(e){const t=w.useRef({}),n=w.useRef(null),r=w.useRef(null),o=w.useRef(!1),i=Wt(function(f,h){const g={id:f,focus:h};return t.current[f]=g,function(){const v=t.current;v[f]!==g&&delete v[f]}},[]),a=Wt(function(f){const h=N0t(e,f);h&&h!==document.activeElement&&h.focus()},[e]),s=Wt(function(f,h){n.current===f&&(n.current=h)},[]),l=Wt(function(){r.current||o.current&&(r.current=requestAnimationFrame(()=>{r.current=null;const f=n.current;f&&a(f)}))},[a]),c=Wt(function(f){n.current=null;const h=document.activeElement;h&&h.getAttribute(ly.draggableId)===f&&(n.current=f)},[]);return Ga(()=>(o.current=!0,function(){o.current=!1;const f=r.current;f&&cancelAnimationFrame(f)}),[]),Vn(()=>({register:i,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:s}),[i,c,l,s])}function F0t(){const e={draggables:{},droppables:{}},t=[];function n(d){return t.push(d),function(){const h=t.indexOf(d);h!==-1&&t.splice(h,1)}}function r(d){t.length&&t.forEach(f=>f(d))}function o(d){return e.draggables[d]||null}function i(d){const f=o(d);return f||vt(),f}const a={register:d=>{e.draggables[d.descriptor.id]=d,r({type:"ADDITION",value:d})},update:(d,f)=>{const h=e.draggables[f.descriptor.id];h&&h.uniqueId===d.uniqueId&&(delete e.draggables[f.descriptor.id],e.draggables[d.descriptor.id]=d)},unregister:d=>{const f=d.descriptor.id,h=o(f);h&&d.uniqueId===h.uniqueId&&(delete e.draggables[f],e.droppables[d.descriptor.droppableId]&&r({type:"REMOVAL",value:d}))},getById:i,findById:o,exists:d=>!!o(d),getAllByType:d=>Object.values(e.draggables).filter(f=>f.descriptor.type===d)};function s(d){return e.droppables[d]||null}function l(d){const f=s(d);return f||vt(),f}const c={register:d=>{e.droppables[d.descriptor.id]=d},unregister:d=>{const f=s(d.descriptor.id);f&&d.uniqueId===f.uniqueId&&delete e.droppables[d.descriptor.id]},getById:l,findById:s,exists:d=>!!s(d),getAllByType:d=>Object.values(e.droppables).filter(f=>f.descriptor.type===d)};function u(){e.draggables={},e.droppables={},t.length=0}return{draggable:a,droppable:c,subscribe:n,clean:u}}function j0t(){const e=Vn(F0t,[]);return w.useEffect(()=>function(){e.clean()},[e]),e}var vV=X.createContext(null),ZP=()=>{const e=document.body;return e||vt(),e};const B0t={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},z0t=e=>`rfd-announcement-${e}`;function V0t(e){const t=Vn(()=>z0t(e),[e]),n=w.useRef(null);return w.useEffect(function(){const i=document.createElement("div");return n.current=i,i.id=t,i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true"),YP(i.style,B0t),ZP().appendChild(i),function(){setTimeout(function(){const l=ZP();l.contains(i)&&l.removeChild(i),i===n.current&&(n.current=null)})}},[t]),Wt(o=>{const i=n.current;if(i){i.textContent=o;return}},[])}const H0t={separator:"::"};function bV(e,t=H0t){const n=X.useId();return Vn(()=>`${e}${t.separator}${n}`,[t.separator,e,n])}function U0t({contextId:e,uniqueId:t}){return`rfd-hidden-text-${e}-${t}`}function W0t({contextId:e,text:t}){const n=bV("hidden-text",{separator:"-"}),r=Vn(()=>U0t({contextId:e,uniqueId:n}),[n,e]);return w.useEffect(function(){const i=document.createElement("div");return i.id=r,i.textContent=t,i.style.display="none",ZP().appendChild(i),function(){const s=ZP();s.contains(i)&&s.removeChild(i)}},[r,t]),r}var fO=X.createContext(null);function _de(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),t}function G0t(){let e=null;function t(){return!!e}function n(a){return a===e}function r(a){e&&vt();const s={abandon:a};return e=s,s}function o(){e||vt(),e=null}function i(){e&&(e.abandon(),o())}return{isClaimed:t,isActive:n,claim:r,release:o,tryAbandon:i}}function qx(e){return e.phase==="IDLE"||e.phase==="DROP_ANIMATING"?!1:e.isDragging}const q0t=9,K0t=13,wV=27,$de=32,Y0t=33,Q0t=34,X0t=35,J0t=36,Z0t=37,eSt=38,tSt=39,nSt=40,rSt={[K0t]:!0,[q0t]:!0};var Nde=e=>{rSt[e.keyCode]&&e.preventDefault()};const pO=(()=>{const e="visibilitychange";return typeof document>"u"?e:[e,`ms${e}`,`webkit${e}`,`moz${e}`,`o${e}`].find(r=>`on${r}`in document)||e})(),Lde=0,LX=5;function oSt(e,t){return Math.abs(t.x-e.x)>=LX||Math.abs(t.y-e.y)>=LX}const FX={type:"IDLE"};function iSt({cancel:e,completed:t,getPhase:n,setPhase:r}){return[{eventName:"mousemove",fn:o=>{const{button:i,clientX:a,clientY:s}=o;if(i!==Lde)return;const l={x:a,y:s},c=n();if(c.type==="DRAGGING"){o.preventDefault(),c.actions.move(l);return}c.type!=="PENDING"&&vt();const u=c.point;if(!oSt(u,l))return;o.preventDefault();const d=c.actions.fluidLift(l);r({type:"DRAGGING",actions:d})}},{eventName:"mouseup",fn:o=>{const i=n();if(i.type!=="DRAGGING"){e();return}o.preventDefault(),i.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{n().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(n().type==="PENDING"){e();return}if(o.keyCode===wV){o.preventDefault(),e();return}Nde(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{n().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const i=n();if(i.type==="IDLE"&&vt(),i.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:pO,fn:e}]}function aSt(e){const t=w.useRef(FX),n=w.useRef(Kd),r=Vn(()=>({eventName:"mousedown",fn:function(d){if(d.defaultPrevented||d.button!==Lde||d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)return;const f=e.findClosestDraggableId(d);if(!f)return;const h=e.tryGetLock(f,a,{sourceEvent:d});if(!h)return;d.preventDefault();const g={x:d.clientX,y:d.clientY};n.current(),c(h,g)}}),[e]),o=Vn(()=>({eventName:"webkitmouseforcewillbegin",fn:u=>{if(u.defaultPrevented)return;const d=e.findClosestDraggableId(u);if(!d)return;const f=e.findOptionsForDraggable(d);f&&(f.shouldRespectForcePress||e.canGetLock(d)&&u.preventDefault())}}),[e]),i=Wt(function(){const d={passive:!1,capture:!0};n.current=$s(window,[o,r],d)},[o,r]),a=Wt(()=>{t.current.type!=="IDLE"&&(t.current=FX,n.current(),i())},[i]),s=Wt(()=>{const u=t.current;a(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[a]),l=Wt(function(){const d={capture:!0,passive:!1},f=iSt({cancel:s,completed:a,getPhase:()=>t.current,setPhase:h=>{t.current=h}});n.current=$s(window,f,d)},[s,a]),c=Wt(function(d,f){t.current.type!=="IDLE"&&vt(),t.current={type:"PENDING",point:f,actions:d},l()},[l]);Ga(function(){return i(),function(){n.current()}},[i])}function sSt(){}const lSt={[Q0t]:!0,[Y0t]:!0,[J0t]:!0,[X0t]:!0};function cSt(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:o=>{if(o.keyCode===wV){o.preventDefault(),n();return}if(o.keyCode===$de){o.preventDefault(),r();return}if(o.keyCode===nSt){o.preventDefault(),e.moveDown();return}if(o.keyCode===eSt){o.preventDefault(),e.moveUp();return}if(o.keyCode===tSt){o.preventDefault(),e.moveRight();return}if(o.keyCode===Z0t){o.preventDefault(),e.moveLeft();return}if(lSt[o.keyCode]){o.preventDefault();return}Nde(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:pO,fn:n}]}function uSt(e){const t=w.useRef(sSt),n=Vn(()=>({eventName:"keydown",fn:function(i){if(i.defaultPrevented||i.keyCode!==$de)return;const a=e.findClosestDraggableId(i);if(!a)return;const s=e.tryGetLock(a,u,{sourceEvent:i});if(!s)return;i.preventDefault();let l=!0;const c=s.snapLift();t.current();function u(){l||vt(),l=!1,t.current(),r()}t.current=$s(window,cSt(c,u),{capture:!0,passive:!1})}}),[e]),r=Wt(function(){const i={passive:!1,capture:!0};t.current=$s(window,[n],i)},[n]);Ga(function(){return r(),function(){t.current()}},[r])}const M$={type:"IDLE"},dSt=120,fSt=.15;function pSt({cancel:e,getPhase:t}){return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:n=>{n.preventDefault()}},{eventName:"keydown",fn:n=>{if(t().type!=="DRAGGING"){e();return}n.keyCode===wV&&n.preventDefault(),e()}},{eventName:pO,fn:e}]}function hSt({cancel:e,completed:t,getPhase:n}){return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:i,clientY:a}=r.touches[0],s={x:i,y:a};r.preventDefault(),o.actions.move(s)}},{eventName:"touchend",fn:r=>{const o=n();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(n().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=n();o.type==="IDLE"&&vt();const i=r.touches[0];if(!i||!(i.force>=fSt))return;const s=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){s&&e();return}if(s){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:pO,fn:e}]}function mSt(e){const t=w.useRef(M$),n=w.useRef(Kd),r=Wt(function(){return t.current},[]),o=Wt(function(h){t.current=h},[]),i=Vn(()=>({eventName:"touchstart",fn:function(h){if(h.defaultPrevented)return;const g=e.findClosestDraggableId(h);if(!g)return;const y=e.tryGetLock(g,s,{sourceEvent:h});if(!y)return;const v=h.touches[0],{clientX:x,clientY:S}=v,C={x,y:S};n.current(),d(y,C)}}),[e]),a=Wt(function(){const h={capture:!0,passive:!1};n.current=$s(window,[i],h)},[i]),s=Wt(()=>{const f=t.current;f.type!=="IDLE"&&(f.type==="PENDING"&&clearTimeout(f.longPressTimerId),o(M$),n.current(),a())},[a,o]),l=Wt(()=>{const f=t.current;s(),f.type==="DRAGGING"&&f.actions.cancel({shouldBlockNextClick:!0}),f.type==="PENDING"&&f.actions.abort()},[s]),c=Wt(function(){const h={capture:!0,passive:!1},g={cancel:l,completed:s,getPhase:r},y=$s(window,hSt(g),h),v=$s(window,pSt(g),h);n.current=function(){y(),v()}},[l,r,s]),u=Wt(function(){const h=r();h.type!=="PENDING"&&vt();const g=h.actions.fluidLift(h.point);o({type:"DRAGGING",actions:g,hasMoved:!1})},[r,o]),d=Wt(function(h,g){r().type!=="IDLE"&&vt();const y=setTimeout(u,dSt);o({type:"PENDING",point:g,actions:h,longPressTimerId:y}),c()},[c,r,o,u]);Ga(function(){return a(),function(){n.current();const g=r();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),o(M$))}},[r,a,o]),Ga(function(){return $s(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const gSt=["input","button","textarea","select","option","optgroup","video","audio"];function Fde(e,t){if(t==null)return!1;if(gSt.includes(t.tagName.toLowerCase()))return!0;const r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:Fde(e,t.parentElement)}function ySt(e,t){const n=t.target;return dO(n)?Fde(e,n):!1}var vSt=e=>Ol(e.getBoundingClientRect()).center;function bSt(e){return e instanceof Dde(e).Element}const wSt=(()=>{const e="matches";return typeof document>"u"?e:[e,"msMatchesSelector","webkitMatchesSelector"].find(r=>r in Element.prototype)||e})();function jde(e,t){return e==null?null:e[wSt](t)?e:jde(e.parentElement,t)}function xSt(e,t){return e.closest?e.closest(t):jde(e,t)}function SSt(e){return`[${ly.contextId}="${e}"]`}function CSt(e,t){const n=t.target;if(!bSt(n))return null;const r=SSt(e),o=xSt(n,r);return!o||!dO(o)?null:o}function ESt(e,t){const n=CSt(e,t);return n?n.getAttribute(ly.draggableId):null}function PSt(e,t){const n=`[${oF.contextId}="${e}"]`,o=Rde(document,n).find(i=>i.getAttribute(oF.id)===t);return!o||!dO(o)?null:o}function ISt(e){e.preventDefault()}function h1({expected:e,phase:t,isLockActive:n,shouldWarn:r}){return!(!n()||e!==t)}function Bde({lockAPI:e,store:t,registry:n,draggableId:r}){if(e.isClaimed())return!1;const o=n.draggable.findById(r);return!(!o||!o.options.isEnabled||!Ode(t.getState(),r))}function TSt({lockAPI:e,contextId:t,store:n,registry:r,draggableId:o,forceSensorStop:i,sourceEvent:a}){if(!Bde({lockAPI:e,store:n,registry:r,draggableId:o}))return null;const l=r.draggable.getById(o),c=PSt(t,l.descriptor.id);if(!c||a&&!l.options.canDragInteractiveElements&&ySt(c,a))return null;const u=e.claim(i||Kd);let d="PRE_DRAG";function f(){return l.options.shouldRespectForcePress}function h(){return e.isActive(u)}function g(E,T){h1({expected:E,phase:d,isLockActive:h,shouldWarn:!0})&&n.dispatch(T())}const y=g.bind(null,"DRAGGING");function v(E){function T(){e.release(),d="COMPLETED"}d!=="PRE_DRAG"&&(T(),vt()),n.dispatch(xxt(E.liftActionArgs)),d="DRAGGING";function O(A,k={shouldBlockNextClick:!1}){if(E.cleanup(),k.shouldBlockNextClick){const M=$s(window,[{eventName:"click",fn:ISt,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(M)}T(),n.dispatch(wde({reason:A}))}return{isActive:()=>h1({expected:"DRAGGING",phase:d,isLockActive:h,shouldWarn:!1}),shouldRespectForcePress:f,drop:A=>O("DROP",A),cancel:A=>O("CANCEL",A),...E.actions}}function x(E){const T=zx(A=>{y(()=>bde({client:A}))});return{...v({liftActionArgs:{id:o,clientSelection:E,movementMode:"FLUID"},cleanup:()=>T.cancel(),actions:{move:T}}),move:T}}function S(){const E={moveUp:()=>y(Mxt),moveRight:()=>y(Rxt),moveDown:()=>y(Axt),moveLeft:()=>y(Dxt)};return v({liftActionArgs:{id:o,clientSelection:vSt(c),movementMode:"SNAP"},cleanup:Kd,actions:E})}function C(){h1({expected:"PRE_DRAG",phase:d,isLockActive:h,shouldWarn:!0})&&e.release()}return{isActive:()=>h1({expected:"PRE_DRAG",phase:d,isLockActive:h,shouldWarn:!1}),shouldRespectForcePress:f,fluidLift:x,snapLift:S,abort:C}}const OSt=[aSt,uSt,mSt];function kSt({contextId:e,store:t,registry:n,customSensors:r,enableDefaultSensors:o}){const i=[...o?OSt:[],...r||[]],a=w.useState(()=>G0t())[0],s=Wt(function(v,x){qx(v)&&!qx(x)&&a.tryAbandon()},[a]);Ga(function(){let v=t.getState();return t.subscribe(()=>{const S=t.getState();s(v,S),v=S})},[a,t,s]),Ga(()=>a.tryAbandon,[a.tryAbandon]);const l=Wt(y=>Bde({lockAPI:a,registry:n,store:t,draggableId:y}),[a,n,t]),c=Wt((y,v,x)=>TSt({lockAPI:a,registry:n,contextId:e,store:t,draggableId:y,forceSensorStop:v||null,sourceEvent:x&&x.sourceEvent?x.sourceEvent:null}),[e,a,n,t]),u=Wt(y=>ESt(e,y),[e]),d=Wt(y=>{const v=n.draggable.findById(y);return v?v.options:null},[n.draggable]),f=Wt(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(dV()))},[a,t]),h=Wt(()=>a.isClaimed(),[a]),g=Vn(()=>({canGetLock:l,tryGetLock:c,findClosestDraggableId:u,findOptionsForDraggable:d,tryReleaseLock:f,isLockClaimed:h}),[l,c,u,d,f,h]);for(let y=0;y<i.length;y++)i[y](g)}const MSt=e=>({onBeforeCapture:t=>{const n=()=>{e.onBeforeCapture&&e.onBeforeCapture(t)};u0.flushSync(n)},onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}),ASt=e=>({...Gx,...e.autoScrollerOptions,durationDampening:{...Gx.durationDampening,...e.autoScrollerOptions}});function kb(e){return e.current||vt(),e.current}function RSt(e){const{contextId:t,setCallbacks:n,sensors:r,nonce:o,dragHandleUsageInstructions:i}=e,a=w.useRef(null),s=_de(e),l=Wt(()=>MSt(s.current),[s]),c=Wt(()=>ASt(s.current),[s]),u=V0t(t),d=W0t({contextId:t,text:i}),f=$0t(t,o),h=Wt(M=>{kb(a).dispatch(M)},[]),g=Vn(()=>uX({publishWhileDragging:Cxt,updateDroppableScroll:Pxt,updateDroppableIsEnabled:Ixt,updateDroppableIsCombineEnabled:Txt,collectionStarting:Ext},h),[h]),y=j0t(),v=Vn(()=>p0t(y,g),[y,g]),x=Vn(()=>M0t({scrollWindow:h0t,scrollDroppable:v.scrollDroppable,getAutoScrollerOptions:c,...uX({move:bde},h)}),[v.scrollDroppable,h,c]),S=L0t(t),C=Vn(()=>c0t({announce:u,autoScroller:x,dimensionMarshal:v,focusMarshal:S,getResponders:l,styleMarshal:f}),[u,x,v,S,l,f]);a.current=C;const I=Wt(()=>{const M=kb(a);M.getState().phase!=="IDLE"&&M.dispatch(dV())},[]),E=Wt(()=>{const M=kb(a).getState();return M.phase==="DROP_ANIMATING"?!0:M.phase==="IDLE"?!1:M.isDragging},[]),T=Vn(()=>({isDragging:E,tryAbort:I}),[E,I]);n(T);const O=Wt(M=>Ode(kb(a).getState(),M),[]),A=Wt(()=>rp(kb(a).getState()),[]),k=Vn(()=>({marshal:v,focus:S,contextId:t,canLift:O,isMovementAllowed:A,dragHandleUsageInstructionsId:d,registry:y}),[t,v,d,S,O,A,y]);return kSt({contextId:t,store:C,registry:y,customSensors:r||null,enableDefaultSensors:e.enableDefaultSensors!==!1}),w.useEffect(()=>I,[I]),X.createElement(fO.Provider,{value:k},X.createElement(iwt,{context:vV,store:C},e.children))}function DSt(){return X.useId()}function zde(e){const t=DSt(),n=e.dragHandleUsageInstructions||G1.dragHandleUsageInstructions;return X.createElement(uwt,null,r=>X.createElement(RSt,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd,autoScrollerOptions:e.autoScrollerOptions},e.children))}const jX={dragging:5e3,dropAnimating:4500},_St=(e,t)=>t?Iw.drop(t.duration):e?Iw.snap:Iw.fluid,$St=(e,t)=>{if(e)return t?Wx.opacity.drop:Wx.opacity.combining},NSt=e=>e.forceShouldAnimate!=null?e.forceShouldAnimate:e.mode==="SNAP";function LSt(e){const n=e.dimension.client,{offset:r,combineWith:o,dropping:i}=e,a=!!o,s=NSt(e),l=!!i,c=l?nF.drop(r,a):nF.moveTo(r);return{position:"fixed",top:n.marginBox.top,left:n.marginBox.left,boxSizing:"border-box",width:n.borderBox.width,height:n.borderBox.height,transition:_St(s,i),transform:c,opacity:$St(a,l),zIndex:l?jX.dropAnimating:jX.dragging,pointerEvents:"none"}}function FSt(e){return{transform:nF.moveTo(e.offset),transition:e.shouldAnimateDisplacement?void 0:"none"}}function jSt(e){return e.type==="DRAGGING"?LSt(e):FSt(e)}function BSt(e,t,n=Qo){const r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=que(o,r),a=KP(i,n),s={client:i,tagName:t.tagName.toLowerCase(),display:r.display},l={x:i.marginBox.width,y:i.marginBox.height};return{descriptor:e,placeholder:s,displaceBy:l,client:i,page:a}}function zSt(e){const t=bV("draggable"),{descriptor:n,registry:r,getDraggableRef:o,canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:s}=e,l=Vn(()=>({canDragInteractiveElements:i,shouldRespectForcePress:a,isEnabled:s}),[i,s,a]),c=Wt(h=>{const g=o();return g||vt(),BSt(n,g,h)},[n,o]),u=Vn(()=>({uniqueId:t,descriptor:n,options:l,getDimension:c}),[n,c,l,t]),d=w.useRef(u),f=w.useRef(!0);Ga(()=>(r.draggable.register(d.current),()=>r.draggable.unregister(d.current)),[r.draggable]),Ga(()=>{if(f.current){f.current=!1;return}const h=d.current;d.current=u,r.draggable.update(u,h)},[u,r.draggable])}var xV=X.createContext(null);function eI(e){const t=w.useContext(e);return t||vt(),t}function VSt(e){e.preventDefault()}const HSt=e=>{const t=w.useRef(null),n=Wt((T=null)=>{t.current=T},[]),r=Wt(()=>t.current,[]),{contextId:o,dragHandleUsageInstructionsId:i,registry:a}=eI(fO),{type:s,droppableId:l}=eI(xV),c=Vn(()=>({id:e.draggableId,index:e.index,type:s,droppableId:l}),[e.draggableId,e.index,s,l]),{children:u,draggableId:d,isEnabled:f,shouldRespectForcePress:h,canDragInteractiveElements:g,isClone:y,mapped:v,dropAnimationFinished:x}=e;if(!y){const T=Vn(()=>({descriptor:c,registry:a,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:h,isEnabled:f}),[c,a,r,g,h,f]);zSt(T)}const S=Vn(()=>f?{tabIndex:0,role:"button","aria-describedby":i,"data-rfd-drag-handle-draggable-id":d,"data-rfd-drag-handle-context-id":o,draggable:!1,onDragStart:VSt}:null,[o,i,d,f]),C=Wt(T=>{v.type==="DRAGGING"&&v.dropping&&T.propertyName==="transform"&&u0.flushSync(x)},[x,v]),I=Vn(()=>{const T=jSt(v),O=v.type==="DRAGGING"&&v.dropping?C:void 0;return{innerRef:n,draggableProps:{"data-rfd-draggable-context-id":o,"data-rfd-draggable-id":d,style:T,onTransitionEnd:O},dragHandleProps:S}},[o,S,d,v,C,n]),E=Vn(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return X.createElement(X.Fragment,null,u(I,v.snapshot,E))};var Vde=(e,t)=>e===t,Hde=e=>{const{combine:t,destination:n}=e;return n?n.droppableId:t?t.droppableId:null};const USt=e=>e.combine?e.combine.draggableId:null,WSt=e=>e.at&&e.at.type==="COMBINE"?e.at.combine.draggableId:null;function GSt(){const e=Yo((o,i)=>({x:o,y:i})),t=Yo((o,i,a=null,s=null,l=null)=>({isDragging:!0,isClone:i,isDropAnimating:!!l,dropAnimation:l,mode:o,draggingOver:a,combineWith:s,combineTargetFor:null})),n=Yo((o,i,a,s,l=null,c=null,u=null)=>({mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:c,mode:i,offset:o,dimension:a,forceShouldAnimate:u,snapshot:t(i,s,l,c,null)}}));return(o,i)=>{if(qx(o)){if(o.critical.draggable.id!==i.draggableId)return null;const a=o.current.client.offset,s=o.dimensions.draggables[i.draggableId],l=Wa(o.impact),c=WSt(o.impact),u=o.forceShouldAnimate;return n(e(a.x,a.y),o.movementMode,s,i.isClone,l,c,u)}if(o.phase==="DROP_ANIMATING"){const a=o.completed;if(a.result.draggableId!==i.draggableId)return null;const s=i.isClone,l=o.dimensions.draggables[i.draggableId],c=a.result,u=c.mode,d=Hde(c),f=USt(c),g={duration:o.dropDuration,curve:pV.drop,moveTo:o.newHomeClientOffset,opacity:f?Wx.opacity.drop:null,scale:f?Wx.scale.drop:null};return{mapped:{type:"DRAGGING",offset:o.newHomeClientOffset,dimension:l,dropping:g,draggingOver:d,combineWith:f,mode:u,forceShouldAnimate:null,snapshot:t(u,s,d,f,g)}}}return null}}function Ude(e=null){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}const qSt={mapped:{type:"SECONDARY",offset:Qo,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:Ude(null)}};function KSt(){const e=Yo((a,s)=>({x:a,y:s})),t=Yo(Ude),n=Yo((a,s=null,l)=>({mapped:{type:"SECONDARY",offset:a,combineTargetFor:s,shouldAnimateDisplacement:l,snapshot:t(s)}})),r=a=>a?n(Qo,a,!0):null,o=(a,s,l,c)=>{const u=l.displaced.visible[a],d=!!(c.inVirtualList&&c.effected[a]),f=lO(l),h=f&&f.draggableId===a?s:null;if(!u){if(!d)return r(h);if(l.displaced.invisible[a])return null;const v=lv(c.displacedBy.point),x=e(v.x,v.y);return n(x,h,!0)}if(d)return r(h);const g=l.displacedBy.point,y=e(g.x,g.y);return n(y,h,u.shouldAnimate)};return(a,s)=>{if(qx(a))return a.critical.draggable.id===s.draggableId?null:o(s.draggableId,a.critical.draggable.id,a.impact,a.afterCritical);if(a.phase==="DROP_ANIMATING"){const l=a.completed;return l.result.draggableId===s.draggableId?null:o(s.draggableId,l.result.draggableId,l.impact,l.afterCritical)}return null}}const YSt=()=>{const e=GSt(),t=KSt();return(r,o)=>e(r,o)||t(r,o)||qSt},QSt={dropAnimationFinished:xde},XSt=Gue(YSt,QSt,null,{context:vV,areStatePropsEqual:Vde})(HSt);function Wde(e){return eI(xV).isUsingCloneFor===e.draggableId&&!e.isClone?null:X.createElement(XSt,e)}function Gde(e){const t=typeof e.isDragDisabled=="boolean"?!e.isDragDisabled:!0,n=!!e.disableInteractiveElementBlocking,r=!!e.shouldRespectForcePress;return X.createElement(Wde,YP({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}const qde=e=>t=>e===t,JSt=qde("scroll"),ZSt=qde("auto"),BX=(e,t)=>t(e.overflowX)||t(e.overflowY),eCt=e=>{const t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return BX(n,JSt)||BX(n,ZSt)},tCt=()=>!1,Kde=e=>e==null?null:e===document.body?tCt()?e:null:e===document.documentElement?null:eCt(e)?e:Kde(e.parentElement);var iF=e=>({x:e.scrollLeft,y:e.scrollTop});const Yde=e=>e?window.getComputedStyle(e).position==="fixed"?!0:Yde(e.parentElement):!1;var nCt=e=>{const t=Kde(e),n=Yde(e);return{closestScrollable:t,isFixedOnPage:n}},rCt=({descriptor:e,isEnabled:t,isCombineEnabled:n,isFixedOnPage:r,direction:o,client:i,page:a,closest:s})=>{const l=(()=>{if(!s)return null;const{scrollSize:f,client:h}=s,g=Pde({scrollHeight:f.scrollHeight,scrollWidth:f.scrollWidth,height:h.paddingBox.height,width:h.paddingBox.width});return{pageMarginBox:s.page.marginBox,frameClient:h,scrollSize:f,shouldClipSubject:s.shouldClipSubject,scroll:{initial:s.scroll,current:s.scroll,max:g,diff:{value:Qo,displacement:Qo}}}})(),c=o==="vertical"?aV:ode,u=ay({page:a,withPlaceholder:null,axis:c,frame:l});return{descriptor:e,isCombineEnabled:n,isFixedOnPage:r,axis:c,isEnabled:t,client:i,page:a,frame:l,subject:u}};const oCt=(e,t)=>{const n=Kue(e);if(!t||e!==t)return n;const r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,a=o+t.scrollWidth,l=nV({top:r,right:a,bottom:i,left:o},n.border);return rV({borderBox:l,margin:n.margin,border:n.border,padding:n.padding})};var iCt=({ref:e,descriptor:t,env:n,windowScroll:r,direction:o,isDropDisabled:i,isCombineEnabled:a,shouldClipSubject:s})=>{const l=n.closestScrollable,c=oCt(e,l),u=KP(c,r),d=(()=>{if(!l)return null;const h=Kue(l),g={scrollHeight:l.scrollHeight,scrollWidth:l.scrollWidth};return{client:h,page:KP(h,r),scroll:iF(l),scrollSize:g,shouldClipSubject:s}})();return rCt({descriptor:t,isEnabled:!i,isCombineEnabled:a,isFixedOnPage:n.isFixedOnPage,direction:o,client:c,page:u,closest:d})};const aCt={passive:!1},sCt={passive:!0};var zX=e=>e.shouldPublishImmediately?aCt:sCt;const m1=e=>e&&e.env.closestScrollable||null;function lCt(e){const t=w.useRef(null),n=eI(fO),r=bV("droppable"),{registry:o,marshal:i}=n,a=_de(e),s=Vn(()=>({id:e.droppableId,type:e.type,mode:e.mode}),[e.droppableId,e.mode,e.type]),l=w.useRef(s),c=Vn(()=>Yo((I,E)=>{t.current||vt();const T={x:I,y:E};i.updateDroppableScroll(s.id,T)}),[s.id,i]),u=Wt(()=>{const I=t.current;return!I||!I.env.closestScrollable?Qo:iF(I.env.closestScrollable)},[]),d=Wt(()=>{const I=u();c(I.x,I.y)},[u,c]),f=Vn(()=>zx(d),[d]),h=Wt(()=>{const I=t.current,E=m1(I);if(I&&E||vt(),I.scrollOptions.shouldPublishImmediately){d();return}f()},[f,d]),g=Wt((I,E)=>{t.current&&vt();const T=a.current,O=T.getDroppableRef();O||vt();const A=nCt(O),k={ref:O,descriptor:s,env:A,scrollOptions:E};t.current=k;const M=iCt({ref:O,descriptor:s,env:A,windowScroll:I,direction:T.direction,isDropDisabled:T.isDropDisabled,isCombineEnabled:T.isCombineEnabled,shouldClipSubject:!T.ignoreContainerClipping}),R=A.closestScrollable;return R&&(R.setAttribute($X.contextId,n.contextId),R.addEventListener("scroll",h,zX(k.scrollOptions))),M},[n.contextId,s,h,a]),y=Wt(()=>{const I=t.current,E=m1(I);return I&&E||vt(),iF(E)},[]),v=Wt(()=>{const I=t.current;I||vt();const E=m1(I);t.current=null,E&&(f.cancel(),E.removeAttribute($X.contextId),E.removeEventListener("scroll",h,zX(I.scrollOptions)))},[h,f]),x=Wt(I=>{const E=t.current;E||vt();const T=m1(E);T||vt(),T.scrollTop+=I.y,T.scrollLeft+=I.x},[]),S=Vn(()=>({getDimensionAndWatchScroll:g,getScrollWhileDragging:y,dragStopped:v,scroll:x}),[v,g,y,x]),C=Vn(()=>({uniqueId:r,descriptor:s,callbacks:S}),[S,s,r]);Ga(()=>(l.current=C.descriptor,o.droppable.register(C),()=>{t.current&&v(),o.droppable.unregister(C)}),[S,s,v,C,i,o.droppable]),Ga(()=>{t.current&&i.updateDroppableIsEnabled(l.current.id,!e.isDropDisabled)},[e.isDropDisabled,i]),Ga(()=>{t.current&&i.updateDroppableIsCombineEnabled(l.current.id,e.isCombineEnabled)},[e.isCombineEnabled,i])}function A$(){}const VX={width:0,height:0,margin:ywt},cCt=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>e||n==="close"?VX:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin},uCt=({isAnimatingOpenOnMount:e,placeholder:t,animate:n})=>{const r=cCt({isAnimatingOpenOnMount:e,placeholder:t,animate:n});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:n!=="none"?Iw.placeholder:null}},dCt=e=>{const t=w.useRef(null),n=Wt(()=>{t.current&&(clearTimeout(t.current),t.current=null)},[]),{animate:r,onTransitionEnd:o,onClose:i,contextId:a}=e,[s,l]=w.useState(e.animate==="open");w.useEffect(()=>s?r!=="open"?(n(),l(!1),A$):t.current?A$:(t.current=setTimeout(()=>{t.current=null,l(!1)}),n):A$,[r,s,n]);const c=Wt(d=>{d.propertyName==="height"&&(o(),r==="close"&&i())},[r,i,o]),u=uCt({isAnimatingOpenOnMount:s,animate:e.animate,placeholder:e.placeholder});return X.createElement(e.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":a,onTransitionEnd:c,ref:e.innerRef})};var fCt=X.memo(dCt);class pCt extends X.PureComponent{constructor(...t){super(...t),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(t,n){return t.shouldAnimate?t.on?{isVisible:!0,data:t.on,animate:"open"}:n.isVisible?{isVisible:!0,data:n.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!t.on,data:t.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const t={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(t)}}const hCt=e=>{const t=w.useContext(fO);t||vt();const{contextId:n,isMovementAllowed:r}=t,o=w.useRef(null),i=w.useRef(null),{children:a,droppableId:s,type:l,mode:c,direction:u,ignoreContainerClipping:d,isDropDisabled:f,isCombineEnabled:h,snapshot:g,useClone:y,updateViewportMaxScroll:v,getContainerForClone:x}=e,S=Wt(()=>o.current,[]),C=Wt((R=null)=>{o.current=R},[]);Wt(()=>i.current,[]);const I=Wt((R=null)=>{i.current=R},[]),E=Wt(()=>{r()&&v({maxScroll:Tde()})},[r,v]);lCt({droppableId:s,type:l,mode:c,direction:u,isDropDisabled:f,isCombineEnabled:h,ignoreContainerClipping:d,getDroppableRef:S});const T=Vn(()=>X.createElement(pCt,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},({onClose:R,data:$,animate:L})=>X.createElement(fCt,{placeholder:$,onClose:R,innerRef:I,animate:L,contextId:n,onTransitionEnd:E})),[n,E,e.placeholder,e.shouldAnimatePlaceholder,I]),O=Vn(()=>({innerRef:C,placeholder:T,droppableProps:{"data-rfd-droppable-id":s,"data-rfd-droppable-context-id":n}}),[n,s,T,C]),A=y?y.dragging.draggableId:null,k=Vn(()=>({droppableId:s,type:l,isUsingCloneFor:A}),[s,A,l]);function M(){if(!y)return null;const{dragging:R,render:$}=y,L=X.createElement(Wde,{draggableId:R.draggableId,index:R.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(z,N)=>$(z,N,R));return Lb.createPortal(L,x())}return X.createElement(xV.Provider,{value:k},a(O,g),M())};function mCt(){return document.body||vt(),document.body}const HX={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:mCt},Qde=e=>{let t={...e},n;for(n in HX)e[n]===void 0&&(t={...t,[n]:HX[n]});return t},R$=(e,t)=>e===t.droppable.type,UX=(e,t)=>t.draggables[e.draggable.id],gCt=()=>{const e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t={...e,shouldAnimatePlaceholder:!1},n=Yo(i=>({draggableId:i.id,type:i.type,source:{index:i.index,droppableId:i.droppableId}})),r=Yo((i,a,s,l,c,u)=>{const d=c.descriptor.id;if(c.descriptor.droppableId===i){const g=u?{render:u,dragging:n(c.descriptor)}:null,y={isDraggingOver:s,draggingOverWith:s?d:null,draggingFromThisWith:d,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!1,snapshot:y,useClone:g}}if(!a)return t;if(!l)return e;const h={isDraggingOver:s,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:h,useClone:null}});return(i,a)=>{const s=Qde(a),l=s.droppableId,c=s.type,u=!s.isDropDisabled,d=s.renderClone;if(qx(i)){const f=i.critical;if(!R$(c,f))return t;const h=UX(f,i.dimensions),g=Wa(i.impact)===l;return r(l,u,g,g,h,d)}if(i.phase==="DROP_ANIMATING"){const f=i.completed;if(!R$(c,f.critical))return t;const h=UX(f.critical,i.dimensions);return r(l,u,Hde(f.result)===l,Wa(f.impact)===l,h,d)}if(i.phase==="IDLE"&&i.completed&&!i.shouldFlush){const f=i.completed;if(!R$(c,f.critical))return t;const h=Wa(f.impact)===l,g=!!(f.impact.at&&f.impact.at.type==="COMBINE"),y=f.critical.droppable.id===l;return h?g?e:t:y?e:t}return t}},yCt={updateViewportMaxScroll:kxt},Xde=Gue(gCt,yCt,(e,t,n)=>({...Qde(n),...e,...t}),{context:vV,areStatePropsEqual:Vde})(hCt);function vCt(e){return je("MuiLoadingButton",e)}const Xc=Be("MuiLoadingButton",["root","label","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),bCt=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],label:["label"],startIcon:[t&&`startIconLoading${we(n)}`],endIcon:[t&&`endIconLoading${we(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${we(n)}`]},i=Oe(o,vCt,r);return{...r,...i}},wCt=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",xCt=se(at,{shouldForwardProp:e=>wCt(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Xc.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Xc.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(rt(({theme:e})=>({display:"inline-flex",[`& .${Xc.startIconLoadingStart}, & .${Xc.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0},variants:[{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Xc.loading}`]:{color:"transparent"}}},{props:({ownerState:t})=>t.loadingPosition==="start"&&t.fullWidth,style:{[`& .${Xc.startIconLoadingStart}, & .${Xc.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0,marginRight:-8}}},{props:({ownerState:t})=>t.loadingPosition==="end"&&t.fullWidth,style:{[`& .${Xc.startIconLoadingStart}, & .${Xc.endIconLoadingEnd}`]:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0,marginLeft:-8}}}]}))),SCt=se("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${we(n.loadingPosition)}`]]}})(rt(({theme:e})=>({position:"absolute",visibility:"visible",display:"flex",variants:[{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:({loadingPosition:t,ownerState:n})=>t==="start"&&n.size!=="small",style:{left:14}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:({loadingPosition:t,ownerState:n})=>t==="end"&&n.size!=="small",style:{right:14}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:({ownerState:t})=>t.loadingPosition==="start"&&t.fullWidth,style:{position:"relative",left:-10}},{props:({ownerState:t})=>t.loadingPosition==="end"&&t.fullWidth,style:{position:"relative",right:-10}}]}))),WX=se("span",{name:"MuiLoadingButton",slot:"Label",overridesResolver:(e,t)=>[t.label]})({display:"inherit",alignItems:"inherit",justifyContent:"inherit"}),CCt=w.forwardRef(function(t,n){const r=w.useContext(WF),o=Xd(r,t),i=lt({props:o,name:"MuiLoadingButton"}),{children:a,disabled:s=!1,id:l,loading:c=!1,loadingIndicator:u,loadingPosition:d="center",variant:f="text",...h}=i,g=Dn(l),y=u??_.jsx(yy,{"aria-labelledby":g,color:"inherit",size:16}),v={...i,disabled:s,loading:c,loadingIndicator:y,loadingPosition:d,variant:f},x=bCt(v),S=c?_.jsx(SCt,{className:x.loadingIndicator,ownerState:v,children:y}):null;return _.jsxs(xCt,{disabled:s||c,id:g,ref:n,...h,variant:f,classes:x,ownerState:v,children:[v.loadingPosition==="end"?_.jsx(WX,{className:x.label,children:a}):S,v.loadingPosition==="end"?S:_.jsx(WX,{className:x.label,children:a})]})}),ECt=e=>{const{t}=Re(),n=trt(e.routineId),r=ort(e.routineId),[o,i]=w.useState(!1),[a,s]=w.useState(!1),[l,c]=w.useState(e.day.isRest),u=()=>{l?(c(!1),I({isRest:!1})):s(!0)},d=()=>s(!1),f=()=>{I({isRest:!l}),c(!l),s(!1)},h=()=>i(!0),g=()=>{e.setSelectedDayIndex(null),r.mutate(e.day.id),i(!1)},y=()=>i(!1),v=3,x=20,S=1e3,C=_o().shape({name:Ro().max(x,t("forms.maxLength",{chars:x})).min(v,t("forms.minLength",{chars:v})).required("Name is required"),description:Ro().max(S,t("forms.maxLength",{chars:S})),isRest:mu(),needsLogsToAdvance:mu()}),I=E=>n.mutate({id:e.day.id,routine:e.routineId,...E.name!==void 0&&{name:E.name},...E.description!==void 0&&{description:E.description},...E.isRest!==void 0&&{is_rest:l},...E.needsLogsToAdvance!==void 0&&{need_logs_to_advance:E.needsLogsToAdvance}});return b(xt,{children:b(ci,{initialValues:{name:e.day.name,description:e.day.description,isRest:e.day.isRest,needsLogsToAdvance:e.day.needLogsToAdvance},validationSchema:C,onSubmit:(E,{setSubmitting:T})=>{I(E),T(!1)},initialTouched:{name:!0,description:!0,isRest:!0,needsLogsToAdvance:!0},children:E=>Q(Zo,{children:[Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:6},children:b(Ru,{fieldName:"name",title:"Name",fieldProps:{disabled:l}})}),b(ye,{size:{xs:6,sm:2},children:b(ba,{control:b(li,{checked:l,onChange:u}),label:t("routines.restDay")})}),Q(ye,{size:{xs:6,sm:4},children:[b(ba,{disabled:l,control:b(li,{checked:E.values.needsLogsToAdvance,...E.getFieldProps("needsLogsToAdvance")}),label:t("routines.needsLogsToAdvance")}),b(Do,{title:t("routines.needsLogsToAdvanceHelpText"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]}),b(ye,{size:12,children:b(Ru,{fieldName:"description",title:"Description",fieldProps:{multiline:!0,rows:4,disabled:l}})}),Q(ye,{size:8,children:[n.isPending?b(CCt,{loading:!0,variant:"contained",color:"primary",children:t("save")}):b(at,{variant:"contained",color:"primary",type:"submit",disabled:l,children:t("save")})," ",b(at,{variant:"outlined",startIcon:b(W0,{}),onClick:h,disabled:n.isPending,children:t("delete")})]}),b(ye,{size:4,sx:{display:"flex",justifyContent:"flex-end"},children:b(Zvt,{routineId:e.routineId})})]}),Q($w,{open:a,onClose:d,children:[b(cE,{children:t("routines.confirmRestDay")}),b(Lw,{children:t("routines.confirmRestDayHelpText")}),Q(Nw,{children:[b(at,{onClick:d,children:t("cancel")}),b(at,{onClick:f,children:t("continue")})]})]}),b(aO,{title:t("deleteConfirmation",{name:e.day.getDisplayName()}),message:t("routines.deleteDayConfirmation"),isOpen:o,closeFn:y,deleteFn:g})]})})})},PCt=e=>{const{t}=Re(),n=drt(e.routineId),[r,o]=w.useState(e.slot.comment),[i,a]=w.useState(!1),s=c=>{a(!0),o(c)},l=()=>{i&&(n.mutate({id:e.slot.id,comment:r}),a(!1))};return b(xt,{children:b(tn,{label:t("comment"),variant:"standard",fullWidth:!0,size:"small",value:r,disabled:n.isPending,onChange:c=>s(c.target.value),onBlur:l,InputProps:{endAdornment:n.isPending&&b(zp,{})}})})},ICt={weight:{edit:Mnt,add:Ant,delete:Rnt},"max-weight":{edit:Dnt,add:_nt,delete:$nt},reps:{edit:Nnt,add:Lnt,delete:Fnt},"max-reps":{edit:jnt,add:vY,delete:Bnt},sets:{edit:znt,add:Vnt,delete:Hnt},"max-sets":{edit:Unt,add:Wnt,delete:vY},rest:{edit:Ynt,add:Qnt,delete:Xnt},"max-rest":{edit:Jnt,add:Znt,delete:ert},rir:{edit:nle,add:rle,delete:ole},"max-rir":{edit:Gnt,add:qnt,delete:Knt}},GX=e=>{var C,I,E,T;const{t}=Re(),{edit:n,add:r,delete:o}=ICt[e.type],i=n(e.routineId),a=r(e.routineId),s=o(e.routineId),[l,c]=w.useState(((C=e.config)==null?void 0:C.value)||""),[u,d]=w.useState(null),[f,h]=w.useState(null),g=["sets","max-sets","rir","max-rir","rest","max-rest"].includes(e.type),y=g?parseInt:parseFloat,v=O=>{const A={slot_entry:e.slotEntryId,value:y(O)};O===""?e.config&&s.mutate(e.config.id):e.config?i.mutate({id:e.config.id,...A}):a.mutate({iteration:1,operation:Li,step:"abs",requirements:null,...A})},x=O=>{if(c(O),O!==""&&Number.isNaN(y(O))){d(t(g?"forms.enterInteger":"forms.enterNumber"));return}else d(null);f&&clearTimeout(f),h(setTimeout(()=>v(O),nte))},S=i.isPending||a.isPending||s.isPending;return b(tn,{slotProps:{input:{endAdornment:S&&b(zp,{})}},inputProps:{"data-testid":`${e.type}-field`},label:e.type,value:l,fullWidth:!0,variant:"standard",disabled:S,onChange:O=>x(O.target.value),error:!!u||i.isError||a.isError||s.isError,helperText:u||((I=i.error)==null?void 0:I.message)||((E=a.error)==null?void 0:E.message)||((T=s.error)==null?void 0:T.message)})},TCt=e=>{const{setFieldValue:t}=uz(),{t:n}=Re(),r=e.disabled??!1,[o,i]=w.useState(e.values),[a,s]=X.useState(null),l=u=>{o.includes(u)?i(o.filter(d=>d!==u)):i([...o,u])},c=async()=>{await t(e.fieldName,o),s(null)};return Q(xt,{children:[b(on,{disabled:r,onClick:u=>s(u.currentTarget),children:a?b(brt,{fontSize:"small"}):b(Grt,{fontSize:"small"})}),Q(Sa,{anchorEl:a,open:!!a,onClose:()=>s(null),children:[...$2.map((u,d)=>Q(Ft,{onClick:()=>l(u),children:[b(si,{children:o.includes(u)?b(Ert,{fontSize:"small"}):b(Prt,{fontSize:"small"})}),b(uo,{children:u})]})),b(Ti,{}),b(Ft,{children:b(at,{color:"primary",variant:"contained",type:"submit",size:"small",onClick:c,children:n("save")})})]})]})},OCt=e=>{var i;const t=nle(e.routineId),n=ole(e.routineId),r=rle(e.routineId),o=a=>{const s={value:parseFloat(a)};a===""?e.config&&n.mutate(e.config.id):e.config!==void 0?t.mutate({id:e.config.id,...s}):r.mutate({slot_entry:e.slotEntryId,iteration:1,operation:Li,...s})};return b(tn,{fullWidth:!0,select:!0,label:"RiR",variant:"standard",defaultValue:"",value:(i=e.config)==null?void 0:i.value,disabled:t.isPending,onChange:a=>o(a.target.value),children:Ste.map(a=>b(Ft,{value:a.value,children:a.label},a.value))})};function kCt(e){let t="";for(;e>0;)e--,t=String.fromCharCode(97+e%26)+t,e=Math.floor(e/26);return t}const dl=(e,t,n,r)=>t.length>0?b(GX,{config:t[0],type:e,routineId:n}):b(GX,{type:e,routineId:n,slotEntryId:r}),MCt=e=>{const{t}=Re();return Q(xt,{children:[e.slot.entries.length===0&&Q(Ii,{severity:"warning",children:[b(hg,{children:t("routines.setHasNoExercises")}),t("nothingHereYetAction")]}),e.slot.entries.map((n,r)=>b(ACt,{slotEntry:n,routineId:e.routineId,simpleMode:e.simpleMode,index:r,total:e.slot.entries.length},n.id))]})},ACt=e=>{var g;const{t,i18n:n}=Re(),[r,o]=w.useState(!1),i=()=>o(!r),a=$c(),s=U0(e.routineId),l=srt(e.routineId),c=s.isPending||l.isPending,u=y=>{y!==null&&(s.mutate({id:e.slotEntry.id,exercise:y.data.base_id}),o(!1))};let d;a.isSuccess&&(d=Tu(n.language,a.data));const f=()=>e.simpleMode?Q(X.Fragment,{children:[b(ye,{size:{xs:12,sm:2},children:dl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)},`sets-config-${e.slotEntry.id}`),b(ye,{size:{xs:12,sm:3},children:dl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)},`weight-config-${e.slotEntry.id}`),b(ye,{size:{xs:12,sm:3},children:dl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)},`reps-config-${e.slotEntry.id}`)]}):Q(X.Fragment,{children:[b(ye,{size:{xs:6,sm:1},children:dl("sets",e.slotEntry.nrOfSetsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:1},children:dl("max-sets",e.slotEntry.maxNrOfSetsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},children:b(Yvt,{routineId:e.routineId,slotEntry:e.slotEntry})}),b(ye,{size:{xs:12,sm:2},children:b(OCt,{routineId:e.routineId,config:e.slotEntry.rirConfigs.length>0?e.slotEntry.rirConfigs[0]:void 0,slotEntryId:e.slotEntry.id})}),b(ye,{size:{xs:6,sm:1},children:dl("rest",e.slotEntry.restTimeConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:1},children:dl("max-rest",e.slotEntry.maxRestTimeConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},offset:{sm:4},children:dl("weight",e.slotEntry.weightConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},children:dl("max-weight",e.slotEntry.maxWeightConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:12,sm:4},children:b(Xvt,{slotEntry:e.slotEntry,routineId:e.routineId})}),b(ye,{size:{xs:6,sm:2},offset:{sm:4},children:dl("reps",e.slotEntry.repetitionsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:6,sm:2},children:dl("max-reps",e.slotEntry.maxRepetitionsConfigs,e.routineId,e.slotEntry.id)}),b(ye,{size:{xs:12,sm:4},children:b(Qvt,{slotEntry:e.slotEntry,routineId:e.routineId})})]}),h=e.total>1?kCt(e.index+1)+") ":"";return b(X.Fragment,{children:Q(ye,{container:!0,paddingTop:1,spacing:1,children:[Q(ye,{size:{xs:3,sm:1},alignContent:"center",children:[b(on,{size:"small",onClick:i,disabled:c,children:r?b(Art,{}):b(hz,{})}),b(on,{size:"small",onClick:()=>l.mutate(e.slotEntry.id),disabled:c,children:b(kP,{})})]}),b(ye,{size:{xs:9,sm:3},alignContent:"center",children:Q(tt,{variant:"body1",children:[h," ",(g=e.slotEntry.exercise)==null?void 0:g.getTranslation(d).name]})}),r&&Q(X.Fragment,{children:[b(ye,{size:{xs:12,sm:8},children:b(ty,{callback:u})}),b(ye,{size:{xs:12,sm:4}})]}),e.slotEntry.hasProgressionRules?b(ye,{size:8,children:b(Ii,{severity:"info",variant:"standard",sx:{mt:2},children:t("routines.exerciseHasProgression")})}):f()]})})},RCt=e=>{const{t}=Re(),n=_c(e.routineId),r=nrt(e.routineId),o=rrt(e.routineId),i=u=>({background:u?"lightblue":void 0}),a=(u,d)=>({backgroundColor:"white",margin:4,...d,opacity:1}),s=()=>{e.setSelectedDayIndex(null)},l=u=>{if(!u.destination)return;const d=Array.from(n.data.days),[f]=d.splice(u.source.index,1);d.splice(u.destination.index,0,f),e.setSelectedDayIndex(u.destination.index),n.data.days=d,r.mutate(d.map((h,g)=>({id:h.id,order:g+1})))},c=async()=>{const u={routine:e.routineId,name:`${t("routines.newDay")} ${n.data.days.length+1}`,order:n.data.days.length+1,is_rest:!1,need_logs_to_advance:!1};await o.mutateAsync(u),e.setSelectedDayIndex(n.data.days.length)};return n.isLoading?b(wr,{}):Q(ye,{container:!0,direction:"row",spacing:1,children:[b(ye,{size:12,children:b(_t,{direction:"row",children:Q(zde,{onDragEnd:l,onDragStart:s,children:[b(Xde,{droppableId:"dayDroppable",direction:"horizontal",children:(u,d)=>Q(Cee,{ref:u.innerRef,...u.droppableProps,value:e.selectedDayIndex,variant:"scrollable",scrollButtons:"auto",style:i(d.isDraggingOver),children:[n.data.days.map((f,h)=>b(Gde,{draggableId:f.id.toString(),index:h,children:(g,y)=>b(w2,{ref:g.innerRef,...g.draggableProps,...g.dragHandleProps,style:a(y.isDragging,g.draggableProps.style??{}),label:f.getDisplayName(),value:f.id,icon:b(lle,{}),iconPosition:"start",onClick:()=>e.setSelectedDayIndex(h)})},f.id)),u.placeholder]})}),b(at,{startIcon:o.isPending?b(zp,{}):b($o,{}),onClick:c,disabled:o.isPending,children:t("routines.addDay")})]})})}),n.data.days.length===0&&b(ye,{size:12,children:Q(Ii,{severity:"info",children:[b(hg,{children:t("routines.routineHasNoDays")}),t("nothingHereYetAction")]})})]})},DCt=e=>{const[t,n]=Re(),r=prt(e.routineId),o=art(e.routineId),i=urt(e.routineId),a=frt(e.routineId),s=Pa(),l=Lr(),[c,u]=w.useState(!1),[d,f]=w.useState(null),[h,g]=w.useState(null),[y,v]=w.useState(!0),x=(k,M)=>{h!==null&&(M==="timeout"?(r.mutate(h.id),g(null)):M!=="clickaway"&&(e.day.slots=[...e.day.slots,h].sort((R,$)=>R.order-$.order),g(null))),u(!1)},S=k=>{const M=e.day.slots.findIndex(R=>R.id===k);if(M!==-1){const R=[...e.day.slots],[$]=R.splice(M,1);e.day.slots=R,g($),u(!0)}},C=k=>{if(e.day.slots.find(R=>R.id===k)===void 0){console.info(`Could not find slot with id ${k} to add config`);return}f(d===k?null:k)},I=()=>i.mutate({day:e.day.id,order:e.day.slots.length+1}),E=8,T=k=>{if(!k.destination)return;const M=Array.from(e.day.slots),[R]=M.splice(k.source.index,1);M.splice(k.destination.index,0,R),a.mutate(M.map(($,L)=>({id:$.id,order:L+1}))),e.day.slots=M},O=k=>({background:k?"lightblue":void 0}),A=(k,M)=>({border:k?`1px solid ${l.palette.grey[900]}`:`1px solid ${l.palette.grey[300]}`,backgroundColor:"white",marginBottom:E,...M});return Q(xt,{children:[b(ECt,{routineId:e.routineId,day:e.day,setSelectedDayIndex:e.setSelectedDayIndex},`day-form-${e.day.id}`),!e.day.isRest&&e.day.slots.length>0&&Q(xt,{children:[b(en,{height:40}),b(ba,{control:b(li,{checked:y,onChange:()=>v(!y)}),label:t("routines.simpleMode")})]}),b(en,{height:20}),b(zde,{onDragEnd:T,children:b(Xde,{droppableId:"setDroppable",direction:"vertical",children:(k,M)=>b("div",{...k.droppableProps,ref:k.innerRef,style:O(M.isDraggingOver),children:e.day.slots.map((R,$)=>Q(X.Fragment,{children:[b(Gde,{draggableId:R.id.toString(),index:$,children:(L,z)=>Q(ye,{container:!0,padding:1,ref:L.innerRef,...L.draggableProps,style:A(z.isDragging,L.draggableProps.style??{}),children:[b(ye,{sx:{backgroundColor:l.palette.common.white},size:12,children:Q(ye,{container:!0,justifyContent:"space-between",alignItems:"center",children:[b(ye,{children:Q(tt,{variant:"h6",children:[b(on,{...L.dragHandleProps,children:b(lle,{})}),b(on,{onClick:()=>S(R.id),children:b(W0,{})}),R.entries.length>1?t("routines.supersetNr",{number:$+1}):t("routines.exerciseNr",{number:$+1})]})}),b(ye,{children:R.entries.length>0&&Q(GF,{variant:"outlined",children:[b(at,{onClick:()=>C(R.id),size:"small",disabled:o.isPending,startIcon:o.isPending?b(zp,{}):b($o,{}),children:t("routines.addSuperset")}),R.entries.length>0&&b(at,{startIcon:b(Krt,{}),component:lo,size:"small",to:Qt(Kt.ROUTINE_EDIT_PROGRESSION,n.language,{id:e.routineId,id2:R.id}),children:t("routines.editProgression")})]})})]})}),!y&&Q(ye,{size:12,children:[b(PCt,{routineId:e.routineId,slot:R},`slot-form-${R.id}`),b(en,{height:10})]}),b(ye,{size:12,children:b(MCt,{slot:R,routineId:e.routineId,simpleMode:y})}),(d===R.id||R.entries.length===0)&&Q(ye,{size:12,children:[b(en,{height:20}),b(ty,{callback:N=>{N!==null&&(o.mutate({slot:R.id,exercise:N.data.base_id,type:"normal",order:R.entries.length+1,weight_unit:s.data.useMetric?Nke:Lke}),f(null))}})]})]})},R.id),b(en,{height:0,children:k.placeholder})]},`slot-${R.id}-${$}`))})})}),b(II,{open:c,autoHideDuration:NI,onClose:x,children:b(Ii,{severity:"success",variant:"filled",sx:{width:"100%"},action:b(at,{color:"warning",variant:"contained",size:"small",onClick:x,children:t("undo")}),children:"Set successfully deleted"})}),!e.day.isRest&&b(at,{variant:"contained",color:"primary",startIcon:i.isPending?b(zp,{}):b($o,{}),onClick:I,children:t("routines.addExercise")})]})},_Ct=()=>{var c;const{t:e,i18n:t}=Re(),n=Lr(),r=Pa(),o=Ea(),i=o.routineId?parseInt(o.routineId):0,a=_c(i),[s,l]=w.useState(null);return a.isLoading||r.isLoading?b(wr,{}):a.isError?Q("p",{children:["Error: ",a.error.message]}):(s===null&&a.data.days.length>0&&l(0),Q(J0,{title:e("editName",{name:(c=a.data)==null?void 0:c.name}),backToUrl:Qt(Kt.ROUTINE_DETAIL,t.language,{id:i}),children:[Q(ye,{container:!0,children:[b(ye,{size:12,children:b(Zz,{routine:a.data})}),Q(ye,{size:12,children:[b(en,{height:20}),b(RCt,{routineId:i,selectedDayIndex:s,setSelectedDayIndex:l})]}),s!==null&&b(xt,{children:b(ye,{size:12,sx:{backgroundColor:n.palette.grey[100],padding:1},children:b(en,{children:b(DCt,{day:a.data.days[s],routineId:i,setSelectedDayIndex:l})})})})]}),a.data.days.length>0&&Q(_t,{spacing:2,sx:{mt:2},children:[b(en,{height:40}),b(tt,{variant:"h4",children:e("routines.resultingRoutine")}),b(Ti,{}),Q(en,{children:[b(Eit,{}),b(en,{height:20}),b(Fue,{routine:a.data})]})]})]}))},$Ct=({initialSession:e,dayId:t,routineId:n,selectedDate:r,setSelectedDate:o})=>{let i;const[a,s]=Re(),[l,c]=X.useState(e),u=mrt(),d=grt(l==null?void 0:l.id),f=hrt(n,{routine:n,date:co(r.toJSDate()),day:t}),h=u.isPending||d.isPending||f.isLoading,g=_o({notes:Ro().max(y3,a("forms.maxLength",{chars:y3})),date:wc().required(),start:wc().nullable(),end:wc().nullable().min(dz("start"),a("forms.endBeforeStart")),fitInWeek:mu()});return w.useEffect(()=>{f.data?(i.setValues({notes:f.data.notes||"",impression:f.data.impression||ib,date:f.data.date,start:f.data.timeStart?yt.fromJSDate(f.data.timeStart):null,end:f.data.timeEnd?yt.fromJSDate(f.data.timeEnd):null}),c(f.data)):f.isSuccess&&!f.data&&(i.setValues({notes:"",impression:ib,date:(e==null?void 0:e.date)||yt.now().toJSDate(),start:e!=null&&e.timeStart?yt.fromJSDate(e.timeStart):null,end:e!=null&&e.timeEnd?yt.fromJSDate(e.timeEnd):null}),c(void 0))},[f.data,f.isSuccess,e,r]),b(ci,{enableReinitialize:!0,initialValues:{notes:l!==void 0?l.notes:"",date:l!==void 0?l.date:new Date,start:l!==void 0&&l.timeStart!==null?yt.fromJSDate(l.timeStart):null,end:l!==void 0&&l.timeEnd!==null?yt.fromJSDate(l.timeEnd):null,impression:l!==void 0?l.impression:ib},innerRef:y=>i=y,validationSchema:g,onSubmit:async y=>{const v={day:t,routine:n,date:co(r.toJSDate()),notes:y.notes,impression:y.impression,time_start:y.start?Bw(y.start.toJSDate()):null,time_end:y.end?Bw(y.end.toJSDate()):null};l!==void 0?await d.mutateAsync({...v,id:l.id}):await u.mutateAsync(v)},children:y=>b(Zo,{children:Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,sm:6},children:b(vc,{dateAdapter:pu,adapterLocale:s.language,children:b(kx,{value:r,defaultValue:yt.now(),label:a("date"),onChange:v=>{v&&(y.setFieldValue("date",v),o(v))},disableFuture:!0,slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.date&&!!y.errors.date}}})})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:s.language,children:b(vL,{label:a("start"),...y.getFieldProps("start"),onChange:v=>{v&&y.setFieldValue("start",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.start&&!!y.errors.start,helperText:y.touched.start&&y.errors.start}}})})}),b(ye,{size:{xs:6,sm:3},children:b(vc,{dateAdapter:pu,adapterLocale:s.language,children:b(vL,{label:a("end"),...y.getFieldProps("end"),onChange:v=>{v&&y.setFieldValue("end",v)},slotProps:{textField:{variant:"standard",fullWidth:!0,error:y.touched.end&&!!y.errors.end,helperText:y.touched.end&&y.errors.end}}})})}),b(ye,{size:12,children:b(Ru,{fieldName:"notes",title:a("notes"),fieldProps:{multiline:!0,rows:4}})}),Q(ye,{size:12,children:[b(tt,{variant:"caption",children:a("routines.impression")}),Q(GF,{fullWidth:!0,color:"primary",children:[Q(at,{size:"small",color:"info",variant:y.values.impression===v3?"contained":"outlined",onClick:()=>y.setFieldValue("impression",v3),children:[b(Wrt,{}),a("routines.impressionBad")]}),Q(at,{size:"small",color:"info",variant:y.values.impression===ib?"contained":"outlined",onClick:()=>y.setFieldValue("impression",ib),children:[b(Hrt,{}),a("routines.impressionNeutral")]}),Q(at,{size:"small",color:"info",variant:y.values.impression===b3?"contained":"outlined",onClick:()=>y.setFieldValue("impression",b3),children:[b(Urt,{}),a("routines.impressionGood")]})]})]}),b(ye,{size:12,display:"flex",justifyContent:"end",children:b(at,{disabled:h,color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:a("submit")})})]})})})},NCt=({dayId:e,routineId:t,selectedDate:n})=>{const{t:r,i18n:o}=Re(),[i,a]=w.useState(!1),s=_c(t),l=irt(t),c=$c(),u=()=>a(!1),[d,f]=w.useState(null);let h;if(c.isSuccess&&(h=Tu(o.language,c.data)),s.isLoading)return b(wr,{});const g=s.data,y=(g==null?void 0:g.getDayData(e,n.toJSDate()))??[],v=y.length===0,x=_o({logs:Dp().of(_o().shape({rir:wo().nullable(),repetitions:wo().typeError(r("forms.enterNumber")).nullable(),weight:wo().typeError(r("forms.enterNumber")).nullable()}))}),S=async T=>{const O=v?null:y[0].iteration,A=T.logs.filter(k=>k.rir!==""||k.repetitions!==""||k.weight!=="").map(k=>{var M,R,$;return{date:n.toISO(),iteration:O,exercise:(M=k.exercise)==null?void 0:M.id,day:e,routine:t,slot_entry:k.slotEntry,rir:k.rir!==""?k.rir:null,rir_target:k.rirTarget!==""?k.rirTarget:null,repetitions_unit:(R=k.repetitionsUnit)==null?void 0:R.id,repetitions:k.repetitions!==""?k.repetitions:null,repetitions_target:k.repetitionsTarget!==""?k.repetitionsTarget:null,weight_unit:($=k.weightUnit)==null?void 0:$.id,weight:k.weight!==""?k.weight:null,weight_target:k.weightTarget!==""?k.weightTarget:null}});await l.mutateAsync(A),a(!0)},C=async(T,O)=>{if(T===null)return;const A=O.values.logs.map(k=>d===k.exercise.id?{...k,weight:"",weightTarget:"",repetitions:"",repetitionsTarget:"",rir:"",rirTarget:"",exercise:T.exercise}:k);await O.setValues({...O.values,logs:A}),f(null)},I={logs:[]},E=v?g.dayDataCurrentIteration.filter(T=>T.day.id===e):y;for(const T of E)for(const O of T.slots)for(const A of O.setConfigs)for(let k=0;k<A.nrOfSets;k++)I.logs.push({exercise:A.exercise,repetitionsUnit:A.repetitionsUnit,weightUnit:A.weightUnit,slotEntry:A.slotEntryId,rir:!v&&A.rir!==null?A.rir:"",rirTarget:!v&&A.rir!==null?A.rir:"",repetitions:!v&&A.repetitions!==null?A.repetitions:"",repetitionsTarget:!v&&A.repetitions!==null?A.repetitions:"",weight:!v&&A.weight!==null?A.weight:"",weightTarget:!v&&A.weight!==null?A.weight:""});return Q(xt,{children:[v&&b(Ii,{severity:"info",sx:{marginTop:2},children:r("routines.weightLogNotPlanned")}),b(ci,{enableReinitialize:!0,initialValues:I,validationSchema:x,onSubmit:S,children:T=>Q(Zo,{children:[b(jse,{name:"logs",children:({insert:O,remove:A,push:k})=>b(xt,{children:T.values.logs.map((M,R)=>{var $,L,z,N;return Q(ye,{container:!0,spacing:1,sx:{mt:2},children:[(R===0||R>0&&T.values.logs[R-1].exercise.id!=T.values.logs[R].exercise.id)&&Q(xt,{children:[Q(ye,{size:12,children:[d!==T.values.logs[R].exercise.id&&b(tt,{variant:"h6",children:($=T.values.logs[R].exercise)==null?void 0:$.getTranslation(h).name}),d===T.values.logs[R].exercise.id&&b(ty,{loadExercise:!0,callback:B=>C(B,T)})]}),Q(ye,{size:12,children:[Q(at,{type:"button",size:"small",onClick:()=>O(R,{exercise:T.values.logs[R].exercise,repetitions:T.values.logs[R].repetitions,weight:T.values.logs[R].weight}),children:[b($o,{}),r("routines.addAdditionalLog")]}),Q(at,{type:"button",size:"small",onClick:()=>{d===T.values.logs[R].exercise.id?f(null):f(T.values.logs[R].exercise.id)},children:[b(Yrt,{}),r("exercises.swapExercise")]}),Q(at,{type:"button",size:"small",onClick:async()=>await T.setValues({...T.values,logs:T.values.logs.filter(B=>B.exercise.id!==T.values.logs[R].exercise.id)}),children:[b(kP,{}),r("delete")]})]})]}),b(ye,{size:4,children:b(Ru,{fieldName:`logs.${R}.repetitions`,title:r("server.repetitions"),fieldProps:{slotProps:{input:{endAdornment:b(ro,{position:"end",children:((L=T.values.logs[R].repetitionsUnit)==null?void 0:L.id)!==$ke?b(tt,{variant:"caption",children:(z=T.values.logs[R].repetitionsUnit)==null?void 0:z.name}):null})}}}})}),b(ye,{size:4,children:b(Ru,{fieldName:`logs.${R}.weight`,title:r("weight"),fieldProps:{slotProps:{input:{endAdornment:b(ro,{position:"end",children:b(tt,{variant:"caption",children:(N=T.values.logs[R].weightUnit)==null?void 0:N.name})})}}}})}),b(ye,{size:3,children:b(tn,{fullWidth:!0,select:!0,label:r("routines.rir"),variant:"standard",...T.getFieldProps(`logs.${R}.rir`),children:Ste.map(B=>b(Ft,{value:B.value,children:B.label},B.value))})}),b(ye,{size:1,children:b(on,{size:"small",onClick:()=>A(R),children:b(kP,{})})})]},R)})})}),b(ye,{container:!0,spacing:2,children:b(ye,{size:12,display:"flex",justifyContent:"end",children:b(at,{color:"primary",disabled:!T.isValid||T.isSubmitting||l.isPending,variant:"contained",type:"submit",sx:{mt:2},children:r("submit")})})})]})}),b(II,{open:i,autoHideDuration:NI,onClose:u,children:b(Ii,{onClose:u,severity:"success",sx:{width:"100%"},children:r("success")})})]})},LCt=()=>{const e=Ea(),{t,i18n:n}=Re(),[r,o]=w.useState(yt.now()),i=parseInt(e.routineId??"");if(Number.isNaN(i))return b("p",{children:"Please pass an integer as the routine id."});const a=parseInt(e.dayId??"");return Number.isNaN(a)?b("p",{children:"Please pass an integer as the day id."}):b(es,{title:t("routines.addWeightLog"),backToUrl:Qt(Kt.ROUTINE_DETAIL,n.language,{id:i}),mainContent:Q(_t,{children:[b($Ct,{routineId:i,dayId:a,selectedDate:r,setSelectedDate:o}),b(tt,{variant:"h5",children:t("exercises.exercises")}),b(tt,{variant:"body2",children:t("routines.impressionHelpText")}),b(NCt,{routineId:i,dayId:a,selectedDate:r})]})})},Mb=e=>{var y,v;const{t}=Re(),[n,r]=w.useState(!0),[o,i]=w.useState([]),a=knt(e.routineId),s=e.forceInteger??!1;let l,c,u="";switch(e.type){case"weight":l=bt.WEIGHT_CONFIG,c=bt.MAX_WEIGHT_CONFIG,u=t("weight");break;case"reps":l=bt.REPETITIONS_CONFIG,c=bt.MAX_REPS_CONFIG,u=t("server.repetitions");break;case"sets":l=bt.NR_OF_SETS_CONFIG,c=bt.MAX_NR_OF_SETS_CONFIG,u=t("routines.sets");break;case"rest":l=bt.REST_CONFIG,c=bt.MAX_REST_CONFIG,u=t("routines.restTime");break;case"rir":l=bt.RIR_CONFIG,c=bt.MAX_RIR_CONFIG,u=t("routines.rir");break}const d=_o({entries:Dp().of(_o().shape({edited:mu(),iteration:wo().required(),value:wo().when("forceInteger",{is:!0,then:x=>x.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:x=>x.typeError(t("forms.enterNumber")).nullable().notRequired()}),valueMax:wo().typeError(t("forms.enterNumber")).nullable().when("forceInteger",{is:!0,then:x=>x.integer(t("forms.enterInteger")).typeError(t("forms.enterNumber")),otherwise:x=>x.typeError(t("forms.enterNumber")).nullable().notRequired()}).when("operation",{is:Li,then:x=>x.min(dz("value"),t("forms.maxLessThanMin")),otherwise:x=>x}),operation:Ro().required(),operationMax:Ro().required(),requirements:Dp().of(Ro().oneOf($2)),requirementsMax:Dp().of(Ro().oneOf($2)),repeat:mu(),repeatMax:mu()})).test("inter-entry-validation","Your error message here",function(x,S){const{createError:C}=this,I=x;for(let E=0;E<I.length;E++){const T=I[E];if(T.iteration>1&&T.operation!==Li){let O=!1,A=!1;for(let k=0;k<E;k++)I[k].operation===Li&&I[k].value!==""&&I[k].edited&&(O=!0),I[k].operation===Li&&I[k].valueMax!==""&&I[k].edited&&(A=!0);if(!O)return C({path:`entries[${E}].value`,message:t("routines.progressionNeedsReplace")});if(!A)return C({path:`entries[${E}].valueMax`,message:t("routines.progressionNeedsReplace")})}}return!0})}),f=(x,S)=>({forceInteger:s,edited:S,iteration:x,id:null,idMax:null,value:"",valueMax:"",operation:Li,operationMax:Li,step:"abs",stepMax:"abs",requirements:[],requirementsMax:[],repeat:!1,repeatMax:!1}),h={entries:[]};for(const x of e.iterations){const S=e.configs.find(I=>I.iteration===x),C=e.configsMax.find(I=>I.iteration===x);S===void 0?h.entries.push(f(x,!1)):h.entries.push({forceInteger:s,edited:!0,id:S.id,idMax:C===void 0?null:C.id,iteration:x,value:String(S.value),valueMax:C===void 0?"":String(C.value),operation:S.operation,operationMax:C===void 0?Li:S.operation,step:S.step,stepMax:C===void 0?"abs":C.step,requirements:((y=S.requirements)==null?void 0:y.rules)??[],requirementsMax:C===void 0?[]:((v=C.requirements)==null?void 0:v.rules)??[],repeat:S.repeat,repeatMax:C===void 0?!1:S.repeat})}const g=x=>{const S=x.entries.filter(k=>k.edited),C=S.filter(k=>k.id!==null).map(k=>({id:k.id,slot_entry:e.slotEntryId,value:k.value,iteration:k.iteration,operation:k.operation,step:k.step,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),I=S.filter(k=>k.id===null&&k.value!=="").map(k=>({slot_entry:e.slotEntryId,value:k.value,iteration:k.iteration,operation:k.operation,step:k.step,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),E=e.configs.filter(k=>o.includes(k.iteration)).map(k=>k.id);S.forEach(k=>{k.value===""&&k.id!==null&&!E.includes(k.id)&&E.push(k.id)});const T=S.filter(k=>k.idMax!==null&&k.valueMax!=="").map(k=>({id:k.idMax,slot_entry:e.slotEntryId,value:k.valueMax,iteration:k.iteration,operation:k.operation,step:k.step,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),O=S.filter(k=>k.idMax===null&&k.valueMax!=="").map(k=>({iteration:k.iteration,slot_entry:e.slotEntryId,value:k.valueMax,operation:k.operation,step:k.stepMax,repeat:k.repeat,requirements:{rules:k.requirements??[]}})),A=e.configsMax.filter(k=>o.includes(k.iteration)).map(k=>k.id);S.forEach(k=>{k.valueMax===""&&k.idMax!==null&&!E.includes(k.idMax)&&A.push(k.idMax)}),a.mutate({toAdd:I,toDelete:E,toEdit:C,apiPath:l}),a.mutate({toAdd:O,toDelete:A,toEdit:T,apiPath:c})};return b(xt,{children:Q(_t,{sx:{width:"100%"},children:[b(tt,{variant:"h6",children:u}),b(ci,{enableReinitialize:!0,initialValues:h,validationSchema:d,onSubmit:(x,{setSubmitting:S})=>{g(x),S(!1)},children:x=>b(Zo,{children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:4,offset:2,textAlign:"center",children:t("value")}),b(ye,{size:6,children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:3,children:t("routines.operation")}),b(ye,{size:3,children:t("routines.step")}),Q(ye,{size:3,textAlign:"center",children:[t("routines.requirements"),b("br",{}),b(Do,{title:t("routines.requirementsHelpText"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]}),Q(ye,{size:3,textAlign:"center",children:[t("routines.repeat"),b("br",{}),b(Do,{title:t("routines.repeatHelpText"),children:b(on,{onClick:()=>{},children:b(Dx,{fontSize:"small"})})})]})]})}),b(ye,{size:12,children:b(Ti,{})}),b(jse,{name:"entries",validateOnChange:!0,children:({insert:S,remove:C})=>b(xt,{children:x.values.entries.map((I,E)=>Q(X.Fragment,{children:[Q(ye,{size:2,display:"flex",justifyContent:"space-around",alignItems:"center",children:[e.cycleLength===7?t("routines.weekNr",{number:I.iteration}):t("routines.workoutNr",{number:I.iteration}),I.edited?b(on,{disabled:I.iteration===1&&x.values.entries.filter(T=>T.edited&&T.iteration!==1).length>0,size:"small",onClick:()=>{I.id!==null&&i([...o,I.iteration]),C(E),S(E,f(I.iteration,!1))},children:b(W0,{})}):b(on,{size:"small",onClick:()=>{C(E),S(E,f(I.iteration,!0))},children:b($o,{})})]}),b(ye,{size:2,children:I.edited&&b(Ru,{fieldName:`entries.${E}.value`,title:t("min"),fullwidth:!0})}),b(ye,{size:2,children:I.edited&&b(Ru,{fieldName:`entries.${E}.valueMax`,title:t("max"),fullwidth:!0})}),b(ye,{size:6,children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:3,children:I.edited&&b(tn,{disabled:I.iteration===1,fullWidth:!0,select:!0,label:t("routines.operation"),variant:"standard",...x.getFieldProps(`entries.${E}.operation`),onChange:async T=>{x.handleChange(T),T.target.value===Li&&(await x.setFieldValue(`entries.${E}.requirements`,[]),await x.setFieldValue(`entries.${E}.repeat`,!1))},children:fAe.map(T=>b(Ft,{value:T.value,children:T.label},T.value))})}),b(ye,{size:3,children:I.edited&&Q(tn,{disabled:I.iteration===1||I.operation===Li,fullWidth:!0,select:!0,label:t("routines.step"),variant:"standard",...x.getFieldProps(`entries.${E}.step`),children:[dAe.map(T=>b(Ft,{value:T.value,children:T.label},T.value)),(I.iteration===1||I.operation===Li)&&b(Ft,{value:"na",children:"n/a"},"na")]})}),Q(ye,{size:3,textAlign:"center",children:[I.edited&&b(TCt,{disabled:I.iteration===1||I.operation===Li,values:I.requirements,fieldName:`entries.${E}.requirements`}),I.requirements.length>=0&&b("br",{}),I.requirements.length>=0&&I.requirements.map((T,O)=>Q(tt,{variant:"caption",children:[T," "]},O))]}),b(ye,{size:3,textAlign:"center",children:I.edited&&b(li,{checked:x.values.entries[E].repeat,...x.getFieldProps(`entries.${E}.repeat`),disabled:I.iteration===1||I.operation===Li})})]})})]},E))})}),b(ye,{size:12,display:"flex",justifyContent:"end",children:b(at,{color:"primary",disabled:!x.isValid||x.isSubmitting||!x.dirty,variant:"contained",type:"submit",sx:{mt:2},children:t("save")})}),b(ye,{size:12,children:b(en,{height:20})})]})})})]})})},FCt=()=>{const{t:e,i18n:t}=Re(),n=Ea(),r=n.routineId?parseInt(n.routineId):-1,o=n.slotId?parseInt(n.slotId):-1,i=_c(r),a=$c();if(i.isLoading)return b(wr,{});const s=i.data;let l;a.isSuccess&&(l=Tu(t.language,a.data));let c=null;for(const d of s.days){const f=d.slots.find(h=>h.id===o);if(f){c=f;break}}if(c===null)return b("p",{children:"Slot not found!"});const u=Object.keys(s.groupedDayDataByIteration).map(Number);return b(xt,{children:b(J0,{title:e("routines.editProgression"),backToUrl:Qt(Kt.ROUTINE_EDIT,t.language,{id:r}),children:c.entries.map(d=>{var f;return Q(X.Fragment,{children:[b(tt,{variant:"h5",gutterBottom:!0,children:(f=d.exercise)==null?void 0:f.getTranslation(l).name}),Q(ye,{container:!0,spacing:1,children:[b(ye,{size:2,display:"flex",alignItems:"end",children:b(tt,{variant:"body2",children:e("routines.rounding")})}),b(ye,{size:5,children:b(WP,{routineId:r,entryId:d.id,initialValue:d.weightRounding,rounding:"weight",editProfile:!1})}),b(ye,{size:5,children:b(WP,{routineId:r,entryId:d.id,initialValue:d.repetitionRounding,rounding:"reps",editProfile:!1})}),b(Mb,{type:"sets",configs:d.nrOfSetsConfigs,configsMax:d.maxNrOfSetsConfigs,slotEntryId:d.id,routineId:r,iterations:u,forceInteger:!0,cycleLength:s.cycleLength}),b(Mb,{type:"weight",configs:d.weightConfigs,configsMax:d.maxWeightConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),b(Mb,{type:"reps",configs:d.repetitionsConfigs,configsMax:d.maxRepetitionsConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),b(Mb,{type:"rir",configs:d.rirConfigs,configsMax:d.maxRirConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength}),b(Mb,{type:"rest",configs:d.restTimeConfigs,configsMax:d.maxRestTimeConfigs,slotEntryId:d.id,routineId:r,iterations:u,cycleLength:s.cycleLength})]})]},d.id)})})})},jCt=()=>{const{t:e,i18n:t}=Re(),n=Ea(),r=parseInt(n.routineId??"");if(Number.isNaN(r))return b("p",{children:"Please pass an integer as the routine id."});const o=_c(r),i=o.data;return b(UT,{query:o,child:o.isSuccess&&b(es,{title:i!=null&&i.isPublic?e("routines.publicTemplate"):e("routines.template"),subTitle:i.name,mainContent:Q(_t,{spacing:2,children:[Q(tt,{variant:"subtitle1",children:[i.start.toLocaleDateString()," - ",i.end.toLocaleDateString()," (",i.durationText,")"]}),i.description!==""&&b(tt,{variant:"body2",sx:{whiteSpace:"pre-line"},children:i==null?void 0:i.description}),b(at,{component:"a",href:Qt(Kt.ROUTINE_COPY,t.language,{id:r}),variant:"contained",children:e("routines.copyAndUseTemplate")}),i.dayDataCurrentIteration.filter(a=>a.day!==null).map((a,s)=>b(Cz,{dayData:a,routineId:r,readOnly:!0},`dayDetails-${s}`))]}),sideBar:Q(_t,{children:[b(en,{height:40}),Q(ye,{container:!0,children:[b(ye,{size:6,children:b(zl,{primaryMuscles:i.mainMuscles.filter(a=>a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>a.isFront),isFront:!0})}),b(ye,{size:6,children:b(zl,{primaryMuscles:i.mainMuscles.filter(a=>!a.isFront),secondaryMuscles:i.secondaryMuscles.filter(a=>!a.isFront),isFront:!1})})]})]})})})},BCt=e=>{var u;const[t,n]=Re(),[r,o]=X.useState(null),i=!!r,a=d=>{o(d.currentTarget)},s=()=>{o(null)},l=()=>window.location.href=Qt(Kt.ROUTINE_EDIT_LOG,n.language,{id:e.log.id}),c=()=>window.location.href=Qt(Kt.ROUTINE_DELETE_LOG,n.language,{id:e.log.id});return Q(Zt,{children:[b(Te,{component:"th",scope:"row",children:yt.fromJSDate(e.log.date).toLocaleString(yt.DATE_MED)}),b(Te,{children:e.log.repetitions}),Q(Te,{children:[e.log.weight,(u=e.log.weightUnitObj)==null?void 0:u.name]}),b(Te,{children:e.log.rirString}),Q(Te,{children:[b(on,{"aria-label":"settings",onClick:a,children:b(gz,{fontSize:"small"})}),Q(Sa,{id:"basic-menu",anchorEl:r,open:i,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:[Q(Ft,{onClick:l,children:[b(hz,{}),t("edit")]}),Q(Ft,{onClick:c,children:[b(W0,{}),t("delete")]})]})]})]},e.log.id)},zCt=e=>{const{t}=Re();let n=e.logEntries??[];const r=[5,10,20],[o,i]=X.useState(r[0]),[a,s]=X.useState(0),l=(u,d)=>{s(d)},c=u=>{i(parseInt(u.target.value,10)),s(0)};return Q(xt,{children:[b(tt,{variant:"h6",sx:{mt:4},children:e.exercise.getTranslation().name}),Q(ye,{container:!0,spacing:2,children:[b(ye,{size:{xs:12,md:5},children:Q(jl,{children:[Q(Ll,{"aria-label":"simple table",size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{children:t("date")}),b(Te,{children:t("routines.reps")}),b(Te,{children:t("weight")}),b(Te,{children:t("routines.rir")}),b(Te,{})]})}),b(Fl,{children:n.slice(a*o,a*o+o).map(u=>b(BCt,{log:u},u.id))})]}),b(nj,{rowsPerPageOptions:r,component:"div",count:n.length,rowsPerPage:o,page:a,onPageChange:l,onRowsPerPageChange:c})]})}),b(ye,{size:{xs:12,md:7},children:b(UCt,{data:n},e.exercise.id)})]})]})},VCt=e=>e.map(t=>({id:t.id,value:t.weight,time:t.date.getTime(),entry:t})),HCt=({active:e,payload:t,label:n})=>{var r,o,i;if(e){let a="";return(r=t==null?void 0:t[1].payload)!=null&&r.entry.rir&&(a=`, ${(o=t==null?void 0:t[1].payload)==null?void 0:o.entry.rir} RiR`),b(fo,{children:Q(Pi,{children:[b(tt,{variant:"body1",children:yt.fromMillis(t==null?void 0:t[0].value).toLocaleString(yt.DATE_MED)}),Q(tt,{variant:"body2",children:[(i=t==null?void 0:t[1].payload)==null?void 0:i.entry.reps," × ",t==null?void 0:t[1].value,t==null?void 0:t[1].unit,a]})]})})}return null},UCt=e=>{let t;t=e.data.reduce(function(r,o){return r.set(o.repetitions,r.get(o.repetitions)||[]),r.get(o.repetitions).push(o),r},new Map);const n=cS(t.size);return b(en,{children:b(Fu,{width:"100%",height:250,children:Q(S8e,{children:[b(Xa,{dataKey:"time",domain:["auto","auto"],name:"Time",tickFormatter:r=>yt.fromMillis(r).toLocaleString(yt.DATE_MED),type:"number"}),b(Ja,{domain:["auto","auto"],dataKey:"value",name:"Value",unit:"kg"}),Array.from(t).map(([r,o])=>{const i=n.next().value,a=VCt(o);return b(N0,{data:a,fill:i,line:{stroke:i},lineType:"joint",lineJointType:"monotoneX",name:r.toString()},r)}),b(ua,{content:b(HCt,{})}),b(Sf,{strokeDasharray:"3 3"}),b(hc,{})]})})})},WCt=()=>{const e=Ea(),t=e.routineId?parseInt(e.routineId):0,[n,r]=Re(),o=ele(t),i=_c(t);if(o.isLoading||i.isLoading)return b(wr,{});let a=new Map;return console.log(o.data),a=o.data.reduce((s,l)=>(l.logs.forEach(c=>{const u=c.exerciseId;s.set(u,s.get(u)||[]),s.get(u).push(c)}),s),a),Q(J0,{title:n("routines.logsHeader"),backToUrl:Qt(Kt.ROUTINE_DETAIL,r.language,{id:t}),optionsMenu:b(Do,{title:n("routines.statsOverview"),children:b(on,{component:"a",href:Qt(Kt.ROUTINE_STATS_OVERVIEW,r.language,{id:t}),children:b(ale,{})})}),children:[b(tt,{variant:"body1",children:n("routines.logsFilterNote")}),i.data.dayDataCurrentIteration.filter(s=>s.day!==null&&!s.day.isRest).map((s,l)=>Q(X.Fragment,{children:[Q(_t,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:"center",sx:{mt:4},children:[b(tt,{variant:"h4",children:s.day.name}),b(at,{component:lo,to:Qt(Kt.ROUTINE_ADD_LOG,r.language,{id:t,id2:s.day.id}),variant:"contained",children:n("routines.addLogToDay")})]}),s.slots.map(c=>c.exercises.map(u=>b(zCt,{exercise:u,logEntries:a.get(u.id)},u.id)))]},l))]})};var op=(e=>(e.Volume="volume",e.Sets="sets",e.Intensity="intensity",e))(op||{}),ip=(e=>(e.Mesocycle="mesocycle",e.Weekly="weekly",e.Iteration="iteration",e.Daily="daily",e))(ip||{}),ew=(e=>(e.Exercises="exercises",e.Muscles="muscles",e.Total="total",e))(ew||{});const D$=({label:e,options:t,value:n,onChange:r})=>Q(rh,{fullWidth:!0,children:[b(oh,{id:`${e}-label`,children:e}),b(gf,{labelId:`${e}-label`,id:`${e}-select`,value:n,label:e,onChange:r,children:t.map(o=>b(Ft,{value:o.value,children:o.label},o.value))})]});function GCt(e,t,n,r,o){switch(r){case"exercises":{const i=Object.keys(o.exercises).map(s=>{var l,c;return(c=(l=e.find(u=>u.id===parseInt(s)))==null?void 0:l.getTranslation(t))==null?void 0:c.name}),a=Object.keys(o.exercises).map(Number);return{headers:i,data:a.map(s=>o.exercises[s])}}case"muscles":{const i=Object.keys(o.muscle).map(s=>{var l;return qr.t(Ki((l=n.find(c=>c.id===parseInt(s)))==null?void 0:l.nameEn))}),a=Object.keys(o.muscle).map(Number);return{headers:i,data:a.map(s=>o.muscle[s])}}case"total":return{headers:[qr.t("total")],data:[o.total]};default:return{headers:[],data:[]}}}const qCt=(e,t,n,r,o,i,a,s)=>{const l={},c=e[t];let u=[],d=[];const f=(y,v)=>GCt(o,a,i,y,v);d=(y=>{let v=[];switch(n){case"mesocycle":v=f(r,c.mesocycle).headers;break;case"iteration":for(const x in c.iteration)v=v.concat(f(r,c.iteration[x]).headers);break;case"weekly":for(const x in c.weekly)v=v.concat(f(r,c.weekly[x]).headers);break;case"daily":for(const x in c.daily)v=v.concat(f(r,c.daily[x]).headers);break}return[...new Set(v)]})(),d.forEach(y=>{l[y]=0});function g(y,v){d.map(S=>y[f(r,v).headers.indexOf(S)]).forEach((S,C)=>{S!==void 0&&(l[d[C]]+=S)})}switch(n){case"mesocycle":{const{data:y}=f(r,c.mesocycle);u=[{key:qr.t("total"),values:d.map(v=>y[d.indexOf(v)])}];break}case"iteration":{u=Object.entries(c.iteration).map(([y,v])=>{const{data:x}=f(r,v);return g(x,v),{key:`iteration ${y}`,values:d.map(S=>x[f(r,v).headers.indexOf(S)])}});break}case"weekly":{u=Object.entries(c.weekly).map(([y,v])=>{const{data:x}=f(r,v);return g(x,v),{key:`week ${y}`,values:d.map(S=>x[f(r,v).headers.indexOf(S)])}});break}case"daily":{u=Object.entries(c.daily).map(([y,v])=>{const{data:x}=f(r,v);return g(x,v),{key:new Date(y).toLocaleDateString(s),values:d.map(S=>x[f(r,v).headers.indexOf(S)])}});break}}return{headers:d,data:u,totals:l}};function KCt(e){const t=[];return e.headers.forEach(n=>{t.push({name:n,data:[]})}),e.data.forEach(n=>{n.values.forEach((r,o)=>{var a;const i=e.headers[o];i&&((a=t.find(s=>s.name===i))==null||a.data.push({category:n.key.toString(),value:r}))})}),t}const YCt=()=>{const e=Lr(),[t,n]=Re(),r=Ea(),[o,i]=w.useState(op.Volume),[a,s]=w.useState(ip.Daily),[l,c]=w.useState(ew.Exercises),u=parseInt(r.routineId??"");if(Number.isNaN(u))return b("p",{children:"Please pass an integer as the routine id."});const d=_c(u),f=Snt(u),h=Yy(),g=$c();if(f.isLoading||d.isLoading||h.isLoading||g.isLoading)return b(wr,{});const y=Tu(n.language,g.data),v=d.data,x=[{value:op.Volume,label:t("routines.volume")},{value:op.Sets,label:t("routines.sets")},{value:op.Intensity,label:t("routines.intensity")}],S=[{value:ip.Mesocycle,label:t("routines.currentRoutine")},{value:ip.Weekly,label:t("routines.weekly")},{value:ip.Iteration,label:t("routines.iteration")},{value:ip.Daily,label:t("routines.daily")}],C=[{value:ew.Exercises,label:t("exercises.exercises")},{value:ew.Muscles,label:t("exercises.muscles")},{value:ew.Total,label:t("total")}],I=R=>{i(R.target.value)},E=R=>{s(R.target.value)},T=R=>{c(R.target.value)},O=qCt(f.data,o,a,l,v.exercises,h.data,y,n.language),A=KCt(O),k=()=>b(jl,{children:Q(Ll,{size:"small",children:[b(Du,{children:Q(Zt,{children:[b(Te,{}),O.headers.map(R=>b(Te,{sx:{textAlign:"right"},children:R},R))]})}),Q(Fl,{children:[O.data.map(R=>Q(Zt,{children:[b(Te,{children:R.key}),R.values.map(($,L)=>b(Te,{sx:{textAlign:"right"},children:($==null?void 0:$.toFixed(o===op.Intensity?2:0))||""},L))]},R.key)),a!==ip.Mesocycle&&Q(Zt,{children:[b(Te,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200},children:t("total")}),O.headers.map(R=>{var $;return b(Te,{sx:{fontWeight:"bold",backgroundColor:e.palette.grey.A200,textAlign:"right"},children:($=O.totals[R==null?void 0:R.toString()])==null?void 0:$.toFixed(o===op.Intensity?2:0)},R)})]})]})]})}),M=cS(A.length);return b(J0,{title:`${t("routines.statsOverview")} - ${v.name}`,backToUrl:Qt(Kt.ROUTINE_DETAIL,n.language,{id:u}),optionsMenu:b(Do,{title:t("routines.logsOverview"),children:b(on,{component:"a",href:Qt(Kt.ROUTINE_LOGS_OVERVIEW,n.language,{id:u}),children:b(ale,{})})}),children:Q(ye,{container:!0,spacing:1,children:[b(ye,{size:2,offset:3,children:b(D$,{label:"type",options:x,value:o,onChange:I})}),b(ye,{size:2,children:b(D$,{label:"sub type",options:S,value:a,onChange:E})}),b(ye,{size:2,children:b(D$,{label:"group by",options:C,value:l,onChange:T})}),b(ye,{size:12,children:b(en,{width:"100%",height:400,children:b(Fu,{width:"100%",height:"100%",children:Q(AB,{width:500,height:300,children:[b(Sf,{strokeDasharray:"3 3"}),b(Xa,{dataKey:"category",type:"category",allowDuplicatedCategory:!1}),b(Ja,{dataKey:"value"}),b(ua,{formatter:R=>Number.isInteger(R)?R.toFixed(0):R.toFixed(2)}),b(hc,{layout:"vertical",verticalAlign:"middle",align:"right",wrapperStyle:{paddingLeft:"20px"}}),A.map(R=>b(uh,{dataKey:"value",data:R.data,name:R.name,stroke:M.next().value},R.name))]})})})}),Q(ye,{size:12,children:[b(en,{height:20}),k()]})]})})},QCt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Zz,{closeFn:o})})]})},SV=e=>{const[t,n]=Re(),r=e.linkDestination??Kt.ROUTINE_DETAIL,o=Qt(r,n.language,{id:e.routine.id});return Q(xt,{children:[b(Ka,{sx:{p:0},children:Q(mf,{component:"a",href:o,children:[b(uo,{primary:e.routine.name!==""?e.routine.name:t("routines.routine"),secondary:`${e.routine.durationText} (${e.routine.start.toLocaleDateString()} - ${e.routine.end.toLocaleDateString()})`}),b(sle,{})]})}),b(Ti,{component:"li"})]})},qX=()=>{const e=Cnt(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("routines.routines"),mainContent:b(xt,{children:e.data.length===0?b(ih,{}):b(Kr,{children:b(xa,{sx:{py:0},children:e.data.map(n=>b(SV,{routine:n},n.id))},"abc")})}),fab:b(QCt,{})})},XCt=()=>{const e=Ent(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("routines.templates"),mainContent:b(xt,{children:e.data.length===0?b(ih,{}):b(Kr,{children:b(xa,{sx:{py:0},children:e.data.map(n=>b(SV,{routine:n,linkDestination:Kt.TEMPLATE_DETAIL},n.id))},"abc")})})})},JCt=()=>{const e=Pnt(),[t]=Re();return e.isLoading?b(wr,{}):b(es,{title:t("routines.publicTemplates"),mainContent:b(xt,{children:e.data.length===0?b(ih,{}):b(Kr,{children:b(xa,{sx:{py:0},children:e.data.map(n=>b(SV,{routine:n,linkDestination:Kt.TEMPLATE_DETAIL},n.id))},"abc")})})})},ZCt=()=>b("div",{children:"About Page"});function CV(e){const[t]=Re(),[n,r,o]=Za(e.fieldName);return b($l,{multiple:!0,freeSolo:!0,id:e.fieldName,value:n.value,options:n.value,onChange:(i,a)=>{o.setValue(a)},renderTags:(i,a)=>i.map((s,l)=>gF(Pu,{label:s,...a({index:l}),key:l})),onBlur:n.onBlur,renderInput:i=>b(tn,{...i,id:"exerciseAliases",variant:"standard",label:t("exercises.alternativeNames"),error:r.touched&&!!r.error,helperText:r.touched&&r.error,value:n.value})})}function e1t(e){const[t]=Re(),[n,r,o]=Za(e.fieldName);return b($l,{multiple:!0,id:e.fieldName,options:e.options.map(i=>i.id),getOptionLabel:i=>t(Ki(e.options.find(a=>a.id===i).name)),...n,onChange:(i,a)=>{o.setValue(a)},renderInput:i=>b(tn,{variant:"standard",label:t("exercises.equipment"),value:n.value,...i})})}function EV(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("name"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function t1t(e){const[t]=Re(),[n,r]=Za(e.fieldName);return Q(rh,{fullWidth:!0,children:[b(oh,{id:"label-category",children:t("category")}),b(gf,{labelId:"label-category",id:"category",label:t("category"),error:r.touched&&!!r.error,...n,children:e.options}),r.touched&&!!r.error&&b(h0,{error:!0,children:r.error})]})}const Jde=5,Zde=40,PV=e=>Ro().min(Jde,e("forms.valueTooShort")).max(Zde,e("forms.valueTooLong")).required(e("forms.fieldRequired")),IV=e=>Dp().ensure().compact().of(Ro().min(Jde,e("forms.valueTooShort")).max(Zde,e("forms.valueTooLong"))),TV=e=>Ro().min(40,e("forms.valueTooShort")).required(e("forms.fieldRequired")),efe=e=>Dp().ensure().compact().of(Ro().min(15,e("forms.valueTooShort"))),n1t=e=>wo().required(e("forms.fieldRequired"));var tfe=(e=>(e[e.SET_NOTIFICATION=0]="SET_NOTIFICATION",e))(tfe||{}),zn=(e=>(e[e.RESET=0]="RESET",e[e.SET_NAME_EN=1]="SET_NAME_EN",e[e.SET_ALIASES_EN=2]="SET_ALIASES_EN",e[e.SET_DESCRIPTION_EN=3]="SET_DESCRIPTION_EN",e[e.SET_NOTES_EN=4]="SET_NOTES_EN",e[e.SET_CATEGORY=5]="SET_CATEGORY",e[e.SET_EQUIPMENT=6]="SET_EQUIPMENT",e[e.SET_PRIMARY_MUSCLES=7]="SET_PRIMARY_MUSCLES",e[e.SET_MUSCLES_SECONDARY=8]="SET_MUSCLES_SECONDARY",e[e.SET_VARIATION_ID=9]="SET_VARIATION_ID",e[e.SET_NEW_VARIATION_BASE_ID=10]="SET_NEW_VARIATION_BASE_ID",e[e.SET_LANGUAGE=11]="SET_LANGUAGE",e[e.SET_NAME_I18N=12]="SET_NAME_I18N",e[e.SET_ALIASES_I18N=13]="SET_ALIASES_I18N",e[e.SET_DESCRIPTION_I18N=14]="SET_DESCRIPTION_I18N",e[e.SET_NOTES_I18N=15]="SET_NOTES_I18N",e[e.SET_IMAGES=16]="SET_IMAGES",e))(zn||{});const KX=e=>({type:tfe.SET_NOTIFICATION,payload:e}),YX={notification:{notify:!1,message:"",severity:void 0,title:"",type:void 0}},r1t=w.createContext([YX,()=>YX]),o1t=()=>w.useContext(r1t),i1t=e=>({type:zn.SET_NAME_EN,payload:e}),a1t=e=>({type:zn.SET_DESCRIPTION_EN,payload:e}),s1t=e=>({type:zn.SET_NOTES_EN,payload:e}),l1t=e=>({type:zn.SET_ALIASES_EN,payload:e}),c1t=e=>({type:zn.SET_NAME_I18N,payload:e}),u1t=e=>({type:zn.SET_DESCRIPTION_I18N,payload:e}),d1t=e=>({type:zn.SET_NOTES_I18N,payload:e}),f1t=e=>({type:zn.SET_ALIASES_I18N,payload:e}),p1t=e=>({type:zn.SET_CATEGORY,payload:e}),h1t=e=>({type:zn.SET_EQUIPMENT,payload:e}),m1t=e=>({type:zn.SET_PRIMARY_MUSCLES,payload:e}),g1t=e=>({type:zn.SET_MUSCLES_SECONDARY,payload:e}),y1t=e=>({type:zn.SET_VARIATION_ID,payload:e}),v1t=e=>({type:zn.SET_NEW_VARIATION_BASE_ID,payload:e}),b1t=e=>({type:zn.SET_LANGUAGE,payload:e}),w1t=e=>({type:zn.SET_IMAGES,payload:e}),x1t=(e,t)=>{if(t===void 0)return e;switch(t.type){case zn.RESET:return tI;case zn.SET_NAME_EN:return{...e,nameEn:t.payload};case zn.SET_DESCRIPTION_EN:return{...e,descriptionEn:t.payload};case zn.SET_NOTES_EN:return{...e,notesEn:t.payload};case zn.SET_ALIASES_EN:return{...e,alternativeNamesEn:t.payload};case zn.SET_CATEGORY:return{...e,category:t.payload};case zn.SET_EQUIPMENT:return{...e,equipment:t.payload};case zn.SET_PRIMARY_MUSCLES:return{...e,muscles:t.payload};case zn.SET_MUSCLES_SECONDARY:return{...e,musclesSecondary:t.payload};case zn.SET_VARIATION_ID:return{...e,variationId:t.payload};case zn.SET_NEW_VARIATION_BASE_ID:return{...e,newVariationExerciseId:t.payload};case zn.SET_LANGUAGE:return{...e,languageId:t.payload};case zn.SET_NAME_I18N:return{...e,nameI18n:t.payload};case zn.SET_DESCRIPTION_I18N:return{...e,descriptionI18n:t.payload};case zn.SET_NOTES_I18N:return{...e,notesI18n:t.payload};case zn.SET_ALIASES_I18N:return{...e,alternativeNamesI18n:t.payload};case zn.SET_IMAGES:return{...e,images:t.payload};default:return e}},tI={category:null,muscles:[],musclesSecondary:[],variationId:null,newVariationExerciseId:null,languageId:null,equipment:[],nameEn:"",descriptionEn:"",alternativeNamesEn:[],notesEn:[],nameI18n:"",alternativeNamesI18n:[],descriptionI18n:"",notesI18n:[],images:[]},nfe=w.createContext([tI,()=>tI]),S1t=({children:e})=>{const[t,n]=w.useReducer(x1t,tI);return b(nfe.Provider,{value:[t,n],children:e})},dv=()=>w.useContext(nfe),C1t=({onContinue:e})=>{const[t]=Re(),[n,r]=dv(),[o,i]=w.useState(n.muscles),[a,s]=w.useState(n.musclesSecondary);w.useEffect(()=>{r(m1t(o))},[r,o]),w.useEffect(()=>{r(g1t(a))},[r,a]);const l=WT(),c=Yy(),u=GT(),d=_o({nameEn:PV(t),newAlternativeNameEn:IV(t),category:n1t(t)});return b(ci,{initialValues:{nameEn:n.nameEn,newAlternativeNameEn:n.alternativeNamesEn,category:n.category!==null?n.category:"",muscles:n.muscles,equipment:n.equipment,musclesSecondary:n.musclesSecondary},validationSchema:d,onSubmit:f=>{r(i1t(f.nameEn)),r(p1t(f.category)),r(l1t(f.newAlternativeNameEn)),r(h1t(f.equipment)),e()},children:f=>Q(Zo,{children:[Q(_t,{spacing:2,children:[b(EV,{fieldName:"nameEn"}),b(CV,{fieldName:"newAlternativeNameEn"}),l.isLoading?Q(en,{children:[" ",b(Ba,{})," "]}):b(t1t,{fieldName:"category",options:l.data.map(h=>b(Ft,{value:h.id,children:t(Ki(h.name))},h.id))}),u.isLoading?Q(en,{children:[" ",b(Ba,{})," "]}):b(e1t,{fieldName:"equipment",options:u.data}),c.isLoading?Q(en,{children:[" ",b(Ba,{})," "]}):Q(xt,{children:[b($l,{multiple:!0,id:"muscles",options:c.data.map(h=>h.id),getOptionDisabled:h=>a.includes(h),getOptionLabel:h=>c.data.find(g=>g.id===h).getName(t),value:o,onChange:(h,g)=>{i(g)},renderInput:h=>b(tn,{...h,variant:"standard",label:t("exercises.muscles"),value:f.getFieldProps("muscles").value,onChange:g=>{f.setFieldValue(f.getFieldProps("muscles").name,g.target.value)}})}),b($l,{multiple:!0,id:"secondary-muscles",options:c.data.map(h=>h.id),getOptionDisabled:h=>o.includes(h),getOptionLabel:h=>c.data.find(g=>g.id===h).getName(t),value:a,onChange:(h,g)=>{s(g)},renderInput:h=>b(tn,{...h,variant:"standard",label:t("exercises.secondaryMuscles"),value:f.getFieldProps("muscles").value})})]}),Q(ye,{container:!0,children:[b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:o.map(h=>c.data.find(g=>g.id===h)),secondaryMuscles:a.map(h=>c.data.find(g=>g.id===h)),isFront:!0})}),b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:o.map(h=>c.data.find(g=>g.id===h)),secondaryMuscles:a.map(h=>c.data.find(g=>g.id===h)),isFront:!1})})]})]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:b("div",{children:b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:t("continue")})})})})})]})})};function E1t(e,t){const n=new Map;return e.forEach(r=>{const o=t(r),i=n.get(o);i?i.push(r):n.set(o,[r])}),n}const QX=({exercises:e})=>{const r=e[0].variationId,o=e[0].id,[i,a]=dv(),[s,l]=w.useState(!1),[c,u]=w.useState(i.variationId),[d,f]=w.useState(i.newVariationExerciseId);w.useEffect(()=>{a(y1t(c))},[a,c]),w.useEffect(()=>{a(v1t(d))},[a,d]);const h=(y,v)=>()=>{y!==null?(v=null,y===i.variationId&&(y=null)):(y=null,v===i.newVariationExerciseId&&(v=null)),u(y),f(v)};let g;return r===null?g=i.newVariationExerciseId===o:g=r===i.variationId,b(Ka,{disableGutters:!0,children:b(mf,{onClick:h(r,o),children:Q(ye,{container:!0,children:[b(ye,{display:"flex",justifyContent:"start",alignItems:"center",size:{xs:12,sm:3},children:b(F0e,{max:4,spacing:"small",children:e.map(y=>y.mainImage?b(Nl,{src:y.mainImage.url},y.id):b(Nl,{children:b(_u,{})},y.id))})}),Q(ye,{size:{xs:10,sm:7},children:[e.slice(0,s?e.length:5).map(y=>b("p",{style:{margin:0},children:y.getTranslation().name},y.id)),!s&&e.length>5?b(xy,{onMouseEnter:()=>l(!0)}):null]}),b(ye,{display:"flex",justifyContent:"end",size:{xs:2,sm:2},children:b(li,{edge:"start",checked:g,tabIndex:-1,disableRipple:!0},`variation-${r}`)}),b(ye,{size:12,children:b(Ti,{sx:{pt:1}})})]})})})},P1t=({onContinue:e,onBack:t})=>{const[n]=Re(),r=dle(),[o,i]=w.useState("");let a=[],s=new Map;return r.isSuccess&&(a=r.data,o!==""&&(a=a.filter(l=>l.getTranslation().name.toLowerCase().includes(o.toLowerCase())))),s=E1t(a.filter(l=>l.variationId!==null),l=>l.variationId),Q(xt,{children:[Q(ye,{container:!0,children:[b(ye,{size:{xs:12,sm:6},children:b(tt,{children:n("exercises.whatVariationsExist")})}),b(ye,{display:"flex",justifyContent:"end",size:{xs:12,sm:6},children:b(tn,{label:n("exercises.filterVariations"),variant:"standard",onChange:l=>i(l.target.value),InputProps:{startAdornment:b(ro,{position:"start",children:b(JB,{})})}})})]}),r.isLoading?b(wr,{}):b(Kr,{elevation:2,sx:{mt:2},children:Q(xa,{style:{maxHeight:"400px",overflowY:"scroll"},children:[a.filter(l=>l.variationId===null).map(l=>b(QX,{exercises:[l]},"base-"+l.id)),[...s.keys()].map(l=>b(QX,{exercises:s.get(l)},"variation-"+l))]})}),Q(Ii,{severity:"info",variant:"filled",sx:{mt:2},children:[b(hg,{children:n("exercises.identicalExercise")}),n("exercises.identicalExercisePleaseDiscard")]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[b(at,{disabled:!1,onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",onClick:e,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})};function I1t(e){const{t}=Re(),[n,r]=X.useState(e.initial.toString()),o=WT(),i=Pa(),a=async s=>{r(s.target.value),await yj(e.exerciseId,{category:parseInt(s.target.value),license_author:i.data.username})};return o.isSuccess?Q(rh,{fullWidth:!0,children:[b(oh,{id:"label-category",children:t("category")}),b(gf,{labelId:"label-category",id:"category",label:t("category"),value:n,onChange:a,children:o.data.map(s=>b(Ft,{value:s.id,children:t(Ki(s.name))},s.id))})]}):null}function T1t(e){const{t}=Re(),[n,r]=X.useState(e.initial),o=GT(),i=Pa(),a=async s=>{r(s),await yj(e.exerciseId,{equipment:s,license_author:i.data.username})};return o.isSuccess?b($l,{multiple:!0,value:n,options:o.data.map(s=>s.id),getOptionLabel:s=>t(Ki(o.data.find(l=>l.id===s).name)),onChange:(s,l)=>a(l),renderInput:s=>b(tn,{variant:"standard",label:t("exercises.equipment"),value:n,...s})}):null}var Ko=function(){return Ko=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ko.apply(this,arguments)};function hO(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function XX(e){if(e){var t=e.textContent,n=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/;e.style.direction=t&&n.test(t[0])?"rtl":"ltr"}}function rfe(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(Boolean).join(" ")}function O1t(){if(document.selection)return document.selection.createRange().parentElement();var e=window.getSelection();if(e&&e.rangeCount>0)return e.getRangeAt(0).startContainer.parentNode||void 0}function JX(e){return e?e.replace(/ |\u202F|\u00A0/g," ").replace(/<br \/>/g,"<br>"):""}function k1t(e){var t=document.createTextNode("");e.appendChild(t);var n=document.activeElement===e;if(t!==null&&t.nodeValue!==null&&n){var r=window.getSelection();if(r!==null){var o=document.createRange();o.setStart(t,t.nodeValue.length),o.collapse(!0),r.removeAllRanges(),r.addRange(o)}e instanceof HTMLElement&&e.focus()}}function ofe(e,t){typeof t=="function"?t(e):typeof t=="object"&&t&&(t.current=e)}var M1t=X.memo(X.forwardRef(function(t,n){var r=t.className,o=t.disabled,i=t.tagName,a=t.value,s=a===void 0?"":a,l=t.placeholder,c=hO(t,["className","disabled","tagName","value","placeholder"]),u=X.useRef(),d=X.useRef(s),f=X.useRef(c);return X.useEffect(function(){f.current=c;var h=u.current;h&&JX(d.current)!==JX(s)&&(d.current=s,h.innerHTML=s,k1t(h))}),X.useMemo(function(){function h(v){u.current=v,XX(v),ofe(v,n)}function g(v){var x,S,C=u.current;if(C){var I=C.innerHTML;I!==d.current&&((S=(x=f.current).onChange)===null||S===void 0||S.call(x,Ko(Ko({},v),{target:{value:I,name:c.name}}))),XX(C),d.current=I}}var y=rfe("rsw-ce",r);return X.createElement(i||"div",Ko(Ko({},c),{className:y,contentEditable:!o,dangerouslySetInnerHTML:{__html:s},onBlur:function(v){return(f.current.onBlur||g)(v)},onInput:g,onKeyDown:function(v){return(f.current.onKeyDown||g)(v)},onKeyUp:function(v){return(f.current.onKeyUp||g)(v)},placeholder:l,ref:h}))},[r,o,l,i])})),ife=X.createContext(void 0);function afe(e){var t=e.children,n=X.useState({htmlMode:!1,update:i}),r=n[0],o=n[1];function i(a){o(function(s){return Ko(Ko({},s),a)})}return X.createElement(ife.Provider,{value:r},t)}function fS(){var e=X.useContext(ife);if(!e)throw new Error("You should wrap your component by EditorProvider");return e}var ZX=[],Ab=[];function A1t(e,t){if(e&&typeof document<"u"){var n,r=t.prepend===!0?"prepend":"append",o=t.singleTag===!0,i=typeof t.container=="string"?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(o){var a=ZX.indexOf(i);a===-1&&(a=ZX.push(i)-1,Ab[a]={}),n=Ab[a]&&Ab[a][r]?Ab[a][r]:Ab[a][r]=s()}else n=s();e.charCodeAt(0)===65279&&(e=e.substring(1)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(document.createTextNode(e))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),t.attributes)for(var c=Object.keys(t.attributes),u=0;u<c.length;u++)l.setAttribute(c[u],t.attributes[c[u]]);var d=r==="prepend"?"afterbegin":"beforeend";return i.insertAdjacentElement(d,l),l}}var R1t=".rsw-editor{border:1px solid #ddd;border-radius:.375rem;display:flex;flex-direction:column;min-height:100px;overflow:hidden}.rsw-ce{flex:1 0 auto;padding:.5rem}.rsw-ce:focus{outline:1px solid #668}.rsw-ce[contentEditable=true]:empty:not(:focus):before{color:grey;content:attr(placeholder);pointer-events:none}.rsw-html{background:transparent;border:none;font-family:monospace,Courier New}.rsw-separator{align-self:stretch;border-right:1px solid #ddd;display:flex;margin:0 3px}.rsw-dd{box-sizing:border-box;outline:none}.rsw-btn{background:transparent;border:0;color:#222;cursor:pointer;font-size:1em;height:2em;outline:none;padding:0;width:2em}.rsw-btn:hover{background:#eaeaea}.rsw-btn[data-active=true]{background:#e0e0e0}.rsw-toolbar{align-items:center;background-color:#f5f5f5;border-bottom:1px solid #ddd;display:flex}";A1t(R1t,{});var sfe=X.forwardRef(function(t,n){var r=t.autoFocus,o=t.children,i=t.containerProps,a=t.onSelect,s=hO(t,["autoFocus","children","containerProps","onSelect"]),l=fS();X.useEffect(function(){return document.addEventListener("click",c),function(){return document.removeEventListener("click",c)}});function c(h){var g;h.target!==l.$el&&(!((g=l.$el)===null||g===void 0)&&g.contains(h.target)||l.update({$selection:void 0}))}function u(h){a==null||a(h),l.update({$selection:O1t()})}function d(h){l.update({$el:h}),ofe(h,n),r&&h&&l.$el===void 0&&h.focus()}var f=rfe("rsw-editor",i==null?void 0:i.className);return l.htmlMode?X.createElement("div",Ko({},i,{className:f}),o,X.createElement("textarea",Ko({},s,{className:"rsw-ce rsw-html"}))):X.createElement("div",Ko({},i,{className:f}),o,X.createElement(M1t,Ko({},s,{ref:d,onSelect:u})))});function D1t(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},X.createElement("path",{fill:"currentColor",d:"M6.99938 12.998v-2H20.9994v2H6.99938zm0 6.0001v-2H20.9994v2H6.99938zm0-12.00001v-2H20.9994v2H6.99938zm-4 1v-3h-1v-1h2v4h-1zm-1 9.00001v-1h3v4h-3v-1h2v-.5h-1v-1h1v-.5h-2zM4.25 10c.41421 0 .75.3358.75.75 0 .2024-.08017.3861-.2105.521L3.11983 13H5v1H2v-.9218L4 11H2v-1h2.25z"}))}function _1t(){return X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",style:{verticalAlign:"text-top"}},X.createElement("path",{fill:"currentColor",d:"M7 5h14v2H7V5zm0 8v-2h14v2H7zM4 4.50001c.83 0 1.5.66992 1.5 1.5 0 .83007-.67 1.5-1.5 1.5s-1.5-.66993-1.5-1.5c0-.83008.67-1.5 1.5-1.5zM4 10.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zM7 19v-2h14v2H7zm-3-2.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z"}))}var lfe=Fc("Bold","𝐁","bold"),cfe=Fc("Bullet list",X.createElement(_1t,null),"insertUnorderedList"),$1t=Fc("Clear formatting","T̲ₓ","removeFormat"),ufe=Fc("Italic","𝑰","italic"),N1t=Fc("Strike through",X.createElement("s",null,"ab"),"strikeThrough"),L1t=Fc("Link","🔗",function(e){var t=e.$selection;(t==null?void 0:t.nodeName)==="A"?document.execCommand("unlink"):document.execCommand("createLink",!1,prompt("URL","")||void 0)}),dfe=Fc("Numbered list",X.createElement(D1t,null),"insertOrderedList"),ffe=Fc("Redo","↷","redo"),pfe=Fc("Underline",X.createElement("span",{style:{textDecoration:"underline"}},"𝐔"),"underline"),hfe=Fc("Undo","↶","undo");function Fc(e,t,n){return r.displayName=e.replace(/\s/g,""),r;function r(o){var i=fS(),a=i.$el,s=i.$selection,l=!1;typeof n=="string"&&(l=!!s&&document.queryCommandState(n));function c(u){u.preventDefault(),document.activeElement!==a&&(a==null||a.focus()),typeof n=="function"?n(i):document.execCommand(n)}return i.htmlMode?null:X.createElement("button",Ko({className:"rsw-btn","data-active":l,onMouseDown:c,tabIndex:-1,title:e,type:"button"},o),t)}}var F1t=j1t("Styles",[["Normal","formatBlock","DIV"],["𝗛𝗲𝗮𝗱𝗲𝗿 𝟭","formatBlock","H1"],["Header 2","formatBlock","H2"],["𝙲𝚘𝚍𝚎","formatBlock","PRE"]]);function j1t(e,t){return n.displayName=e,n;function n(r){var o=fS(),i=o.$el,a=o.$selection,s=o.htmlMode;if(s)return null;var l=t.findIndex(function(u){return u[1]==="formatBlock"&&(a==null?void 0:a.nodeName)===u[2]});return X.createElement(B1t,Ko({},r,{items:t,onChange:c,selected:l,tabIndex:-1,title:e}));function c(u){var d=u.target,f=d.value,h=parseInt(f,10),g=t[h]||[],y=g[1],v=g[2];u.preventDefault(),document.activeElement!==i&&(i==null||i.focus()),typeof y=="function"?y(o):y&&document.execCommand(y,!1,v),setTimeout(function(){return d.value=f},10)}}}function B1t(e){var t=e.items,n=e.selected,r=hO(e,["items","selected"]);return X.createElement("select",Ko({},r,{value:n,className:"rsw-dd"}),X.createElement("option",{hidden:!0},r.title),t.map(function(o,i){return X.createElement("option",{key:o[2],value:i},o[0])}))}function z1t(e){var t=hO(e,[]),n=fS();function r(){n.update({htmlMode:!n.htmlMode})}return X.createElement("button",Ko({className:"rsw-btn","data-active":n.htmlMode,onClick:r,tabIndex:-1,title:"HTML mode",type:"button"},t),"</>")}function Lm(){var e=fS();return e.htmlMode?null:X.createElement("div",{className:"rsw-separator"})}function mfe(e){return X.createElement("div",Ko({},e,{className:"rsw-toolbar"}))}X.forwardRef(function(t,n){return X.createElement(afe,null,X.createElement(sfe,Ko({},t,{ref:n}),X.createElement(mfe,null,X.createElement(hfe,null),X.createElement(ffe,null),X.createElement(Lm,null),X.createElement(lfe,null),X.createElement(ufe,null),X.createElement(pfe,null),X.createElement(N1t,null),X.createElement(Lm,null),X.createElement(dfe,null),X.createElement(cfe,null),X.createElement(Lm,null),X.createElement(L1t,null),X.createElement($1t,null),X.createElement(z1t,null),X.createElement(Lm,null),X.createElement(F1t,null))))});function V1t(e){return b(afe,{children:b(sfe,{...e,children:Q(mfe,{children:[b(lfe,{}),b(ufe,{}),b(pfe,{}),b(Lm,{}),b(cfe,{}),b(dfe,{}),b(Lm,{}),b(hfe,{}),b(ffe,{})]})})})}function OV(e){const[t,n,r]=Za(e.fieldName);return Q(xt,{children:[b("div",{"data-testid":"jodit-editor",children:b(V1t,{value:t.value,onChange:o=>r.setValue(o.target.value)})}),n.touched&&!!n.error&&b(h0,{error:!0,children:n.error})]})}const H1t=({exerciseId:e,image:t,canDelete:n})=>{const[r]=Re(),o=eot(e);return Q(fo,{children:[b(Ec,{component:"img",image:t.url,sx:{height:120},alt:""}),b(Ys,{children:n&&b(at,{color:"primary",onClick:()=>o.mutate(t.id),children:r("delete")})})]})},U1t=({exerciseId:e})=>{const[t]=Re(),n=Pa(),r=tot(e),o=async i=>{var s;if(!((s=i.target.files)!=null&&s.length))return;const[a]=i.target.files;n.isSuccess&&await r.mutate({exerciseId:e,image:a,imageData:{url:"",file:a,author:"",authorUrl:"",title:"",objectUrl:"",derivativeSourceUrl:"",style:""}})};return Q(fo,{children:[b(Ec,{children:b(en,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:b(ile,{sx:{fontSize:80,color:"gray"}})})}),b(Ys,{children:Q(at,{component:"label",children:[t("add"),b("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:o})]})})]})};function eJ(e){const{t}=Re(),n=Yy(),r=async o=>{e.setValue(o),await yj(e.exerciseId,e.isMain?{muscles:o}:{muscles_secondary:o})};return n.isSuccess?b($l,{multiple:!0,options:n.data.map(o=>o.id),getOptionDisabled:o=>e.blocked.includes(o),getOptionLabel:o=>n.data.find(i=>i.id===o).getName(t),value:e.value,onChange:(o,i)=>r(i),renderInput:o=>b(tn,{...o,variant:"standard",label:t(e.isMain?"exercises.muscles":"exercises.secondaryMuscles"),value:e.value})}):null}const W1t=({video:e,canDelete:t})=>{const[n]=Re();return Q(fo,{children:[b(Ec,{component:"video",src:e.url,sx:{height:120},controls:!0,preload:"metadata"}),b(Ys,{children:t&&b(at,{color:"primary",onClick:()=>lAe(e.id),children:n("delete")})})]})},G1t=({exerciseId:e})=>{const[t]=Re(),n=Pa(),r=async o=>{var a;if(!((a=o.target.files)!=null&&a.length))return;const[i]=o.target.files;n.isSuccess&&await sAe(e,n.data.username,i)};return Q(fo,{children:[b(Ec,{children:b(en,{sx:{backgroundColor:"lightgray",height:120},display:"flex",alignItems:"center",justifyContent:"center",children:b(ile,{sx:{fontSize:80,color:"gray"}})})}),b(Ys,{children:Q(at,{component:"label",children:[t("add"),b("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"video/*",capture:"environment",onChange:r})]})})]})},q1t="check-permission",K1t=async e=>{const t=dt(q1t,{query:{permission:e}}),n=await nt.get(t,{headers:pt()});return n.status===400?!1:n.data.result};function Od(e){return br({queryKey:[Bke,e],queryFn:()=>K1t(e.valueOf())})}var au=(e=>(e.EDIT_EXERCISE="exercises.change_exercise",e.DELETE_EXERCISE="exercises.delete_exercise",e.ADD_IMAGE="exercises.add_exerciseimage",e.EDIT_IMAGE="exercises.change_exerciseimage",e.DELETE_IMAGE="exercises.delete_exerciseimage",e.ADD_VIDEO="exercises.add_exercisevideo",e.EDIT_VIDEO="exercises.change_exercisevideo",e.DELETE_VIDEO="exercises.delete_exercisevideo",e))(au||{});const Y1t=({exerciseId:e,language:t})=>{const[n]=Re(),[r,o]=w.useState(!1),[i,a]=w.useState([]),[s,l]=w.useState([]),c=Xrt(e),u=Jrt(e),d=Zrt(e),f=Od(au.ADD_IMAGE),h=Od(au.DELETE_IMAGE),g=Od(au.ADD_VIDEO),y=Od(au.DELETE_VIDEO),v=Od(au.EDIT_EXERCISE),x=Yy(),S=Pa(),C=c.data;if(w.useEffect(()=>{c.data!==void 0&&(a(C.muscles.map(k=>k.id)),l(C.musclesSecondary.map(k=>k.id)))},[c.data]),c.isLoading||x.isLoading||c.isLoading||S.isLoading||f.isLoading||h.isLoading||g.isLoading||y.isLoading||v.isLoading)return b(Ba,{});const I=C.getTranslation(t),T=t.id!==(I==null?void 0:I.language)?new hte(null,null,"","",t.id):I,O=C.getTranslation(),A=_o({name:PV(n),alternativeNames:IV(n),description:TV(n)});return Q(xt,{children:[b(ci,{initialValues:{name:T.name,alternativeNames:T.aliases.map(k=>k.alias),description:T.description},enableReinitialize:!0,validationSchema:A,onSubmit:async k=>{const M=T.id?await d.mutateAsync({id:T.id,exerciseId:C.id,languageId:t.id,name:k.name,description:k.description,author:""}):await u.mutateAsync({exerciseId:C.id,languageId:t.id,name:k.name,description:k.description,author:S.data.username}),R=T.aliases.map(N=>N.alias),$=k.alternativeNames,L=$.filter(N=>!R.includes(N));let z=R.filter(N=>!$.includes(N));L.forEach(N=>{_2(M.id,N)}),z.forEach(N=>{aAe(T.aliases.find(B=>B.alias===N).id)}),o(!0)},children:b(Zo,{children:Q(ye,{container:!0,spacing:1,children:[r&&Q(ye,{size:12,children:[b(Ii,{severity:"success",action:b(on,{"aria-label":"close",size:"small",color:"inherit",onClick:()=>{o(!1)},children:b(y0,{fontSize:"inherit"})}),children:n("exercises.successfullyUpdated")}),b(ri,{})]}),b(ye,{size:6,children:b(tt,{variant:"h5",children:n("English")})}),b(ye,{size:6,children:Q(tt,{variant:"h5",children:[t.nameLong," (",t.nameShort,")"]})}),Q(ye,{size:12,children:[b(ri,{}),b(tt,{variant:"h6",children:n("name")})]}),Q(ye,{size:6,children:[O.name,b("ul",{children:O.aliases.map(k=>b("li",{children:k.alias},k.id))})]}),Q(ye,{size:6,children:[b(en,{mb:2,children:b(EV,{fieldName:"name"})}),b(CV,{fieldName:"alternativeNames"})]}),b(ye,{size:12,children:b(ri,{})}),b(ye,{size:12,children:b(tt,{variant:"h6",children:n("exercises.description")})}),b(ye,{size:{xs:12,md:6},children:b("div",{dangerouslySetInnerHTML:{__html:O.description}})}),b(ye,{size:{xs:12,md:6},children:b(OV,{fieldName:"description"})}),v.data&&Q(xt,{children:[b(ye,{size:12,children:b(ri,{})}),b(ye,{size:{xs:12,md:6},children:b(I1t,{exerciseId:C.id,initial:C.category.id})}),b(ye,{size:{xs:12,md:6},children:b(T1t,{exerciseId:C.id,initial:C.equipment.map(k=>k.id)})})]}),Q(ye,{size:12,children:[b(ri,{}),b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},disabled:c.isLoading||u.isPending||d.isPending,children:n("save")})]})]})})}),b(ri,{}),b(tt,{variant:"h6",children:n("images")}),Q(ye,{container:!0,spacing:2,mt:2,children:[f.data&&b(ye,{size:{md:3},children:b(U1t,{exerciseId:C.id})},"add"),C.images.map(k=>b(ye,{size:{md:3},children:b(H1t,{exerciseId:C.id,image:k,canDelete:h.data})},k.id))]}),b(ri,{}),b(tt,{variant:"h6",children:n("videos")}),Q(ye,{container:!0,spacing:2,mt:2,children:[g.data&&b(ye,{size:{md:3},children:b(G1t,{exerciseId:C.id})},"add"),C.videos.map(k=>b(ye,{size:{md:3},children:b(W1t,{video:k,canDelete:y.data})},k.id))]}),v.data&&Q(xt,{children:[b(ri,{}),b(tt,{variant:"h6",children:n("exercises.muscles")}),Q(ye,{container:!0,spacing:1,mt:2,children:[b(ye,{size:{xs:12,md:6},children:b(eJ,{exerciseId:C.id,value:i,setValue:a,blocked:s,isMain:!0})}),b(ye,{size:{xs:12,md:6},children:b(eJ,{exerciseId:C.id,value:s,setValue:l,blocked:i,isMain:!1})}),b(ye,{size:{sm:6},offset:{md:3},children:Q(ye,{container:!0,children:[b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:i.map(k=>x.data.find(M=>M.id===k)),secondaryMuscles:s.map(k=>x.data.find(M=>M.id===k)),isFront:!0})}),b(ye,{display:"flex",justifyContent:"center",size:6,children:b(zl,{primaryMuscles:i.map(k=>x.data.find(M=>M.id===k)),secondaryMuscles:s.map(k=>x.data.find(M=>M.id===k)),isFront:!1})})]})})]})]})]})},Q1t=({mainImage:e,sideImages:t})=>Q(ye,{container:!0,spacing:1,children:[e&&b(ye,{size:12,children:b(fo,{children:b(Ec,{component:"img",image:e.url,alt:""})})}),t.map(n=>b(ye,{size:6,children:b(fo,{children:b(Ec,{component:"img",image:n.url,sx:{height:120},alt:""})})},n.id))]}),X1t=({videos:e})=>b(ye,{container:!0,spacing:1,children:e.map(t=>b(ye,{size:6,children:b(fo,{children:b(Ec,{component:"video",src:t.url,sx:{height:120},controls:!0,muted:!0,preload:"metadata"})})},t.id))});function kV(){var r,o;const e=Pa(),t=Od(au.EDIT_EXERCISE),n={canContribute:!1,anonymous:!0,emailVerified:!1,admin:!1};if(e.isSuccess&&t.isSuccess){if(e.data===null)return n;n.anonymous=!1,(r=e.data)!=null&&r.emailVerified&&(n.emailVerified=!0),t.data&&(n.admin=!0),(n.admin||(o=e.data)!=null&&o.isTrustworthy)&&(n.canContribute=!0)}return n}const J1t=({setEditMode:e})=>{const[t]=Re();return Q(en,{mb:2,paddingY:2,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[b(tt,{variant:"h5",children:t("exercises.exerciseNotTranslated")}),b(tt,{gutterBottom:!0,variant:"body1",component:"div",children:t("exercises.exerciseNotTranslatedBody")}),b(at,{variant:"contained",onClick:()=>e(!0),children:t("exercises.translateExerciseNow")})]})},Z1t=({exercise:e,variations:t,language:n,setEditMode:r})=>{var l;const[o]=Re(),i=kV(),a=e.getTranslation(n),s=n&&n.id!==a.language;return Q(ye,{container:!0,children:[s&&i.canContribute&&b(ye,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:12},children:b(J1t,{setEditMode:r})}),Q(ye,{order:{xs:2,sm:1},size:{xs:12,sm:7,md:8},children:[(a==null?void 0:a.aliases.length)>0&&Q(xt,{children:[Q("p",{children:[o("exercises.alsoKnownAs")," ",(l=a==null?void 0:a.aliases)==null?void 0:l.map(c=>c.alias).join(", ")]}),b(ri,{})]}),b(tt,{variant:"h5",children:o("exercises.description")}),b("div",{dangerouslySetInnerHTML:{__html:a==null?void 0:a.description}}),b(ri,{}),(a==null?void 0:a.notes.length)>0&&b(tt,{variant:"h5",children:o("exercises.notes")}),b("ul",{children:a==null?void 0:a.notes.map(c=>b("li",{children:c.note},c.id))}),b(ri,{}),b(tt,{variant:"h5",children:o("exercises.muscles")}),Q(ye,{container:!0,children:[b(ye,{order:{xs:1},size:{xs:6,md:3},children:b(zl,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!0})}),Q(ye,{order:{xs:2,md:3},size:{xs:6,md:3},children:[b("h3",{children:o("exercises.primaryMuscles")}),b("ul",{children:e.muscles.map(c=>b("li",{children:c.getName(o)},c.id))})]}),b(ye,{order:{xs:3,md:2},size:{xs:6,md:3},children:b(zl,{primaryMuscles:e.muscles,secondaryMuscles:e.musclesSecondary,isFront:!1})}),Q(ye,{order:{xs:4},size:{xs:6,md:3},children:[b("h3",{children:o("exercises.secondaryMuscles")}),b("ul",{children:e.musclesSecondary.map(c=>b("li",{children:c.getName(o)},c.id))})]})]}),b(ri,{})]}),Q(ye,{order:{xs:1,sm:2},size:{xs:12,sm:5,md:4},children:[b(Q1t,{mainImage:e.mainImage,sideImages:e.sideImages}),b(ri,{}),b(X1t,{videos:e.videos})]}),Q(ye,{order:{xs:3},size:12,children:[b(Ti,{}),b(ri,{}),t.length>0&&b(tt,{variant:"h5",children:o("exercises.variations")}),b(ye,{container:!0,spacing:2,children:t.map(c=>b(ye,{size:{xs:6,md:2},children:b(Qle,{exercise:c,language:n},c.id)},c.id))})]}),b(ye,{order:{xs:4},size:12,children:Q(tt,{variant:"caption",display:"block",mt:2,children:["The text on this page is available under the ",b("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/deed",children:"CC BY-SA 4 License"}),"."]})})]})};function eEt(e){var d,f;const[t,n]=X.useState(null),[r,o]=X.useState(null),[i]=Re(),a=zu(),s=()=>{o(null),n(null)},l=async()=>{var h;await nAe((h=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:h.id),e.onClose(),e.onChangeLanguage()},c=async(h=!1)=>{h?await PW(e.currentExercise.id,r==null?void 0:r.uuid):await PW(e.currentExercise.id),e.onClose(),a("../overview")},u=async h=>{const g=h!==void 0?h:t;if(g!==null)try{const y=await w0(g);o(y)}catch{o(null)}};return Q(xt,{children:[b(cE,{id:"alert-dialog-title",children:i("delete")}),Q(Lw,{children:[b("p",{children:i("exercises.deleteExerciseBody",{name:(d=e.currentExercise.getTranslation(e.currentLanguage))==null?void 0:d.name,language:(f=e.currentLanguage)==null?void 0:f.nameLong})}),b("p",{children:i("cannotBeUndone")}),b("p",{children:b("b",{children:i("exercises.replacements")})}),b("p",{children:i("exercises.replacementsInfoText")}),b("p",{children:i("exercises.replacementsSearch")}),b(ty,{callback:h=>{h!==null&&(n(h.data.base_id),u(h.data.base_id))}}),b(tn,{"data-testid":"exercise-id-field",id:"foo",label:"Exercise ID",onBlur:()=>u(),onChange:async h=>{n(h.target.value!==""?parseInt(h.target.value):null)},value:t??"",InputProps:{endAdornment:b(ro,{position:"start",children:b(on,{onClick:()=>u(),children:b(xrt,{})})})},fullWidth:!0,variant:"standard"}),r===null&&b(xt,{children:b("p",{children:b("i",{children:i("exercises.noReplacementSelected")})})}),r!==null&&Q(xt,{children:[Q("p",{children:["Selected exercise for replacement:",b(Do,{title:i("copyToClipboard"),children:b(on,{onClick:()=>navigator.clipboard.writeText(r.id.toString()),children:b(krt,{})})})]}),Q(Ka,{disablePadding:!0,children:[b(JF,{children:b(Nl,{children:r.mainImage?b(Nl,{alt:"",src:`${cj}${r.mainImage.url}`,variant:"rounded"}):b(_u,{})})}),b(uo,{primary:r.getTranslation().name,secondary:`${r.id} (${r.uuid})`}),b(on,{onClick:s,children:b(Trt,{})})]})]})]}),Q(Nw,{children:[b(at,{onClick:()=>e.onClose(),children:i("cancel")}),b(at,{"data-testid":"button-delete-translation",size:"small",onClick:l,variant:"contained",children:i("exercises.deleteTranslation")}),b(at,{"data-testid":"button-delete-all",size:"small",onClick:()=>c(),variant:"contained",children:i("exercises.deleteExerciseFull")}),b(at,{"data-testid":"button-delete-and-replace",size:"small",disabled:r===null,onClick:()=>c(!0),variant:"contained",children:i("exercises.deleteExerciseReplace")})]})]})}const tEt="_root_l288f_1",nEt="_detail_language_l288f_4",rEt="_detail_l288f_4",oEt="_languages_l288f_28",iEt="_language_l288f_28",aEt="_header_l288f_52",sEt="_toolbar_l288f_55",Xf={root:tEt,detail_language:nEt,detail:rEt,languages:oEt,language:iEt,header:aEt,toolbar:sEt},lEt=({exercise:e,languages:t,changeLanguage:n,language:r,setEditMode:o,editMode:i})=>{var E,T,O;const[a,s]=w.useState(null),[l,c]=X.useState(!1),u=!!a,[d]=Re(),f=Od(au.DELETE_EXERCISE),h=Od(au.EDIT_EXERCISE),g=Pa(),y=g.isSuccess&&g.data===null;let v=!1;g.isSuccess&&h.isSuccess&&(v=h.data||g.data!==null&&g.data.isTrustworthy);const x=A=>{s(A.currentTarget)},S=()=>{s(null)},C=A=>{n(A),S()},I=t.map(A=>Q(Ft,{onClick:()=>C(A),selected:(r==null?void 0:r.id)===A.id,children:[b(uo,{children:A.nameLong}),b(si,{children:e.availableLanguages.includes(A.id)?b(zrt,{}):b($o,{})})]},A.nameShort));return b(ye,{container:!0,children:b(ye,{size:12,children:Q("div",{className:Xf.root,children:[b($w,{open:l,onClose:()=>c(!1),children:b(eEt,{onClose:()=>c(!1),onChangeLanguage:()=>n(t[0]),currentExercise:e,currentLanguage:r})}),Q("div",{className:Xf.detail_language,children:[Q("div",{className:Xf.detail,children:[b(lo,{to:"../overview",children:d("exercises.exercises")})," > ",(E=e.getTranslation(r))==null?void 0:E.name]}),b("div",{className:Xf.languages,children:Q("div",{className:Xf.language,children:[b(at,{size:"small",id:"basic-button",onClick:x,startIcon:b(gz,{}),children:r==null?void 0:r.nameLong}),Q(Sa,{id:"basic-menu",anchorEl:a,open:u,onClose:S,MenuListProps:{"aria-labelledby":"basic-button"},sx:{padding:20},children:[b(Ft,{disabled:!0,children:d("exercises.changeExerciseLanguage")}),b(Ti,{}),I]})]})})]}),Q("div",{className:Xf.header,children:[b(tt,{gutterBottom:!0,variant:"h2",margin:0,sx:{mt:2},children:(T=e.getTranslation(r))==null?void 0:T.name}),!y&&Q("nav",{className:Xf.toolbar,children:[f.isSuccess&&f.data&&(r==null?void 0:r.id)===((O=e.getTranslation(r))==null?void 0:O.language)&&b(at,{onClick:()=>c(!0),children:d("delete")}),v&&b(at,{onClick:()=>o(!0),disabled:i,children:"EDIT"}),b(at,{onClick:()=>o(!1),disabled:!i,children:"VIEW"})]})]}),Q(_t,{direction:"row",spacing:1,mt:2,children:[b(Pu,{label:d(Ki(e.category.name)),size:"small"}),e.equipment.map(A=>b(Pu,{label:d(Ki(A.name)),variant:"outlined",size:"small"},A.id))]})]})})})},ri=()=>b(en,{sx:{height:20}}),cEt=()=>{var g;const[e,t]=w.useState(Dke),[n,r]=w.useState(!1),o=Ea(),i=parseInt(o.exerciseId??"");if(Number.isNaN(i))return b("p",{children:"Please pass an integer as the exercise id."});const{i18n:a}=Re(),s=zu(),l=$c(),c=br({queryKey:[jke,i],queryFn:()=>w0(i),enabled:l.isSuccess}),u=br({queryKey:[Fke,(g=c.data)==null?void 0:g.variationId],queryFn:()=>{var y;return XMe((y=c.data)==null?void 0:y.variationId)},enabled:c.isSuccess});if(X.useEffect(()=>{if(l.data===void 0)return;const y=Tu(a.language,l.data);t(y)},[l.data]),c.isError||l.isError||u.isError)return s("/not-found"),null;const d=y=>{const v=Tu(y.nameShort,l.data);v!==void 0&&t(v)},f=u.isSuccess?u.data.filter(y=>y.id!==i):[];let h;return c.isSuccess&&l.isSuccess&&(h=n?b(Y1t,{exerciseId:c.data.id,language:e}):b(Z1t,{exercise:c.data,language:e,variations:f,setEditMode:r})),Q(xt,{children:[c.isSuccess&&l.isSuccess&&b(Iu,{children:b(lEt,{exercise:c.data,languages:l.data,changeLanguage:d,language:e,setEditMode:r,editMode:n})}),b(ri,{}),Q(Iu,{maxWidth:"lg",children:[c.isLoading&&l.isLoading&&b(Ba,{}),h]})]})};function gfe(e){const[t]=Re(),[n,r,o]=Za(e.fieldName),[i,a]=w.useState(""),s=u=>{o.setValue(n.value.filter((d,f)=>f!==u))},l=(u,d)=>{n.value[u]=d,o.setValue(n.value)},c=()=>{n.value.push(i),o.setValue(n.value),a("")};return Q(xt,{children:[b(ye,{size:12,children:b(tn,{fullWidth:!0,label:t("exercises.newNote"),sx:{mb:3},variant:"standard",value:i,onChange:u=>a(u.target.value),error:r.touched&&!!r.error,helperText:r.touched&&r.error?r.error:t("exercises.notesHelpText"),InputProps:{endAdornment:b(ro,{position:"end",children:b(on,{onClick:c,children:b($o,{})})})}})}),n.value.map((u,d)=>b(tn,{fullWidth:!0,value:u,onChange:f=>l(d,f.target.value),sx:{mt:2},variant:"standard",error:r.touched&&!!r.error,InputProps:{endAdornment:b(ro,{position:"end",children:b(on,{onClick:()=>s(d),children:b(W0,{})})})}},d))]})}const uEt=({onContinue:e,onBack:t})=>{const[n]=Re(),[r,o]=dv(),i=_o({description:TV(n),notes:efe(n)});return b(ci,{initialValues:{description:r.descriptionEn,notes:r.notesEn},validationSchema:i,onSubmit:a=>{o(a1t(a.description)),o(s1t(a.notes)),e()},children:b(Zo,{children:Q(_t,{children:[b(OV,{fieldName:"description"}),b(ri,{}),b(gfe,{fieldName:"notes"}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[b(at,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})})},dEt=({onContinue:e,onBack:t})=>{const[n]=Re(),r=$c(),[o,i]=dv(),[a,s]=w.useState(o.languageId!==null),l=_o(a?{description:TV(n),name:PV(n),alternativeNames:IV(n),notes:efe(n),language:wo().required()}:{});return b(ci,{initialValues:{name:o.nameI18n,alternativeNames:o.alternativeNamesI18n,description:o.descriptionI18n,language:o.languageId===null?"":o.languageId,notes:o.notesI18n},validationSchema:l,onSubmit:c=>{i(c1t(c.name)),i(u1t(c.description)),i(f1t(c.alternativeNames)),i(b1t(c.language===""?null:c.language)),i(d1t(c.notes)),e()},children:c=>Q(Zo,{children:[Q(_t,{spacing:2,children:[b(Fw,{children:b(ba,{checked:a,onClick:()=>s(!a),control:b(li,{}),label:n("exercises.translateExerciseNow")})}),a&&Q(xt,{children:[r.isLoading?b(en,{children:b(Ba,{})}):Q(rh,{fullWidth:!0,children:[b(oh,{id:"label-language",children:n("language")}),b(gf,{labelId:"label-language",id:"language",value:c.getFieldProps("language").value,onChange:u=>{c.setFieldValue(c.getFieldProps("language").name,u.target.value)},label:n("language"),error:!!(c.touched.language&&c.errors.language),children:r.data.filter(u=>u.id!==Hp).map(u=>Q(Ft,{value:u.id,children:[u.nameShort," - ",u.nameLong]},u.id))})]}),b(EV,{fieldName:"name"}),b(CV,{fieldName:"alternativeNames"}),b(OV,{fieldName:"description"}),b(ri,{}),b(gfe,{fieldName:"notes"})]})]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[b(at,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",type:"submit",sx:{mt:1,mr:1},children:n("continue")})]})})})})]})})};function fEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authors"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function pEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.authorProfile"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function hEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.derivativeSourceUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:t("licenses.derivativeSourceUrlHelper")||r.touched&&r.error,...n})}function mEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalObjectUrl"),variant:"standard",placeholder:"https://",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function gEt(e){const[t]=Re(),[n,r]=Za(e.fieldName);return b(tn,{fullWidth:!0,id:e.fieldName,label:t("licenses.originalTitle"),variant:"standard",error:r.touched&&!!r.error,helperText:r.touched&&r.error,...n})}function yEt(e){const[t]=Re(),[n,r]=w.useState(nu.PHOTO),[o,i,a]=Za(e.fieldName);return Q(ATe,{value:n,exclusive:!0,fullWidth:!0,onChange:(l,c)=>{r(c),a.setValue(c)},"aria-label":"text alignment",children:[b(tb,{value:nu.PHOTO,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(Brt,{}),b(tt,{variant:"caption",children:t("exercises.imageStylePhoto")})]})}),b(tb,{value:nu.THREE_D,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(_rt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyle3D")})]})}),b(tb,{value:nu.LINE_ART,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b($rt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyleLine")})]})}),b(tb,{value:nu.LOW_POLY,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(Nrt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyleLowPoly")})]})}),b(tb,{value:nu.OTHER,children:Q(_t,{justifyContent:"center",alignItems:"center",children:[b(Lrt,{}),b(tt,{variant:"caption",children:t("exercises.imageStyleOther")})]})})]})}const vEt=({onContinue:e,onBack:t})=>{const[n]=Re(),r=Pa(),[o,i]=dv(),[a,s]=w.useState(o.images),[l,c]=w.useState(void 0),[u,d]=X.useState(!1),f=()=>d(!1);w.useEffect(()=>{i(w1t(a))},[i,a]);const h=S=>{var E;if(!((E=S.target.files)!=null&&E.length))return;const[C]=S.target.files,I=URL.createObjectURL(C);d(!0),c({url:I,file:C,author:"",authorUrl:"",title:"",derivativeSourceUrl:"",objectUrl:"",style:nu.PHOTO.toString()})},g=S=>{s(a.concat({url:l==null?void 0:l.url,file:l==null?void 0:l.file,author:S.author,authorUrl:S.authorUrl,title:S.title,derivativeSourceUrl:S.derivativeSourceUrl,objectUrl:S.objectUrl,style:S.imageStyle.toString()})),f()},y=S=>{const C=a.filter(I=>I.url!==S);s(C)},v=()=>{e()};return Q("div",{children:[b(by,{open:u,onClose:f,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:Q(en,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:600,bgcolor:"background.paper",boxShadow:24,p:4},children:[b(tt,{id:"modal-modal-title",variant:"h6",component:"h2",children:n("exercises.imageDetails")}),Q(ye,{container:!0,spacing:2,children:[b(ye,{size:4,children:l&&b("img",{style:{width:"100%"},src:l.url,alt:"",loading:"lazy"})}),b(ye,{size:8,children:b(ci,{initialValues:{title:"",objectUrl:"",author:r.isSuccess?r.data.username:"",authorUrl:"",derivativeSourceUrl:"",imageStyle:nu.PHOTO},onSubmit:S=>{console.log(S),g(S)},children:S=>Q(Zo,{children:[Q(_t,{spacing:2,children:[b(gEt,{fieldName:"title"}),b(mEt,{fieldName:"objectUrl"}),b(fEt,{fieldName:"author"}),b(pEt,{fieldName:"authorUrl"}),b(hEt,{fieldName:"derivativeSourceUrl"}),b(yEt,{fieldName:"imageStyle"}),Q(Ii,{icon:b(cle,{fontSize:"inherit"}),severity:"info",children:["By submitting this image, you agree to release it under the ",b("a",{href:"https://creativecommons.org/licenses/by-sa/4.0/",target:"_blank",rel:"noreferrer",children:"CC BY-SA 4.0"})," license. The image must be either your own work or the author must have released in under a license compatible with CC BY-SA 4.0."]})]}),b(_t,{direction:"row",justifyContent:"end",sx:{mt:2},children:b(at,{color:"primary",variant:"contained",type:"submit",sx:{mt:2},children:n("add")})})]})})})]})]})}),b(tt,{children:n("exercises.compatibleImagesCC")}),Q(_t,{direction:"row",justifyContent:"center",children:[Q("div",{children:[b("label",{htmlFor:"camera-input",children:b(Crt,{fontSize:"large",sx:{m:2}})}),b("input",{style:{display:"none"},id:"camera-input",type:"file",accept:"image/*",capture:"environment",onChange:h})]}),Q("div",{children:[b("label",{htmlFor:"image-input",children:b(Ort,{fontSize:"large",sx:{m:2}})}),b("input",{type:"file",accept:"image/*",name:"image-file",id:"image-input",style:{display:"none"},onChange:h})]})]}),b(see,{cols:3,style:{maxHeight:"400px"},children:a.map(S=>Q(lee,{children:[b("img",{style:{maxHeight:"400px",maxWidth:"400px"},src:S.url,alt:"",loading:"lazy"}),b(k1e,{title:S.title,subtitle:S.author,actionIcon:b(on,{onClick:()=>y(S.url),sx:{color:"white"},children:b(Mrt,{})})})]},S.url))}),b(tt,{children:n("forms.supportedImageFormats")}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q(xt,{children:[b(at,{onClick:t,sx:{mt:1,mr:1},children:n("goBack")}),b(at,{variant:"contained",onClick:v,sx:{mt:1,mr:1},children:n("continue")})]})})})})]})},bEt="exercisecomment",tJ=async e=>{const t=new pte,n=dt(bEt),r=await nt.post(n,t.toJson(e),{headers:pt()});return t.fromJson(r.data)},wEt="variation",xEt=async()=>{const e=dt(wEt);return(await nt.post(e,{},{headers:pt()})).data.id},SEt=({onBack:e})=>{const[t,n]=Re(),[r]=dv(),o=zu(),i=WT(),a=$c(),s=Yy(),l=GT(),c=Pa(),[u,d]=w.useState("initial"),f=async()=>{d("loading");let g;r.newVariationExerciseId!==null?g=await xEt():g=r.variationId;const y=await JMe(r.category,r.equipment,r.muscles,r.musclesSecondary,g,c.data.username),v=await D2({exerciseId:y,languageId:Hp,name:r.nameEn,description:r.descriptionEn,author:c.data.username});for(const x of r.alternativeNamesEn)await _2(v.id,x);for(const x of r.images)await bte({exerciseId:y,image:x.file,imageData:x});for(const x of r.notesEn)await tJ(new R2(null,v.id,x));if(r.languageId!==null){const x=await D2({exerciseId:y,languageId:r.languageId,name:r.nameI18n,description:r.descriptionI18n,author:c.data.username});for(const S of r.alternativeNamesI18n)await _2(x.id,S);for(const S of r.notesI18n)await tJ(new R2(null,x.id,S))}console.log("Exercise created"),d("done")},h=()=>{o(Qt(Kt.EXERCISE_OVERVIEW,n.language))};return l.isLoading||a.isLoading||s.isLoading||i.isLoading?b(wr,{}):Q(xt,{children:[b(tt,{variant:"h6",children:t("exercises.step1HeaderBasics")}),b(jl,{children:b(Ll,{children:Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("name")}),b(Te,{children:r.nameEn})]}),Q(Zt,{children:[b(Te,{children:t("exercises.alternativeNames")}),b(Te,{children:r.alternativeNamesEn.join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("description")}),b(Te,{children:r.descriptionEn})]}),Q(Zt,{children:[b(Te,{children:t("exercises.notes")}),b(Te,{children:r.notesEn.map(g=>Q(xt,{children:[g,b("br",{})]}))})]}),Q(Zt,{children:[b(Te,{children:t("category")}),b(Te,{children:t(Ki(i.data.find(g=>g.id===r.category).name))})]}),Q(Zt,{children:[b(Te,{children:t("exercises.equipment")}),b(Te,{children:r.equipment.map(g=>t(Ki(l.data.find(y=>y.id===g).name))).join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("exercises.muscles")}),b(Te,{children:r.muscles.map(g=>s.data.find(y=>y.id===g).getName(t)).join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("exercises.secondaryMuscles")}),b(Te,{children:r.musclesSecondary.map(g=>s.data.find(y=>y.id===g).getName(t)).join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("exercises.variations")}),Q(Te,{children:[r.variationId," / ",r.newVariationExerciseId]})]})]})})}),r.images.length>0&&b(see,{cols:3,style:{maxHeight:"200px"},children:r.images.map(g=>b(lee,{children:b("img",{style:{maxHeight:"200px",maxWidth:"200px"},src:g.url,alt:"",loading:"lazy"})},g.url))}),r.languageId!==null&&Q(xt,{children:[b(tt,{variant:"h6",sx:{mt:3},children:a.data.find(g=>g.id===r.languageId).nameLong}),b(jl,{children:b(Ll,{children:Q(Fl,{children:[Q(Zt,{children:[b(Te,{children:t("name")}),b(Te,{children:r.nameI18n})]}),Q(Zt,{children:[b(Te,{children:t("exercises.alternativeNames")}),b(Te,{children:r.alternativeNamesI18n.join(", ")})]}),Q(Zt,{children:[b(Te,{children:t("description")}),b(Te,{children:r.descriptionI18n})]}),Q(Zt,{children:[b(Te,{children:t("exercises.notes")}),b(Te,{children:r.notesI18n.map(g=>Q(xt,{children:[g,b("br",{})]}))})]})]})})})]}),u!=="done"?b(Ii,{severity:"info",sx:{mt:2},children:t("exercises.checkInformationBeforeSubmitting")}):Q(Ii,{severity:"success",sx:{mt:2},children:[b(hg,{children:t("success")}),t("exercises.cacheWarning")]}),b(ye,{container:!0,children:b(ye,{display:"flex",justifyContent:"end",size:12,children:b(en,{sx:{mb:2},children:Q("div",{children:[u!=="done"&&b(at,{onClick:e,sx:{mt:1,mr:1},children:t("goBack")}),u!=="done"&&b(at,{variant:"contained",disabled:u!=="initial",onClick:f,sx:{mt:1,mr:1},color:"info",children:t("exercises.submitExercise")}),u==="done"&&Q(at,{variant:"contained",onClick:h,sx:{mt:1,mr:1},color:"success",children:[t("overview"),b(Frt,{})]})]})})})})]})},CEt=()=>{const[e]=Re(),[t,n]=X.useState(0),r=()=>{n(i=>i+1)},o=()=>{n(i=>i-1)};return b(S1t,{children:Q(Iu,{maxWidth:"md",children:[b(_t,{direction:"row",children:b(tt,{gutterBottom:!0,variant:"h3",component:"div",children:e("exercises.contributeExercise")})}),b(en,{children:Q(fIe,{activeStep:t,orientation:"vertical",children:[Q(Qh,{children:[b(ep,{children:e("exercises.step1HeaderBasics")}),b(Xh,{children:b(C1t,{onContinue:r,onBack:o})})]},1),Q(Qh,{children:[b(ep,{children:e("exercises.variations")}),b(Xh,{children:b(P1t,{onContinue:r,onBack:o})})]},2),Q(Qh,{children:[b(ep,{children:e("description")}),b(Xh,{children:b(uEt,{onContinue:r,onBack:o})})]},3),Q(Qh,{children:[b(ep,{children:e("translation")}),b(Xh,{children:b(dEt,{onContinue:r,onBack:o})})]},4),Q(Qh,{children:[b(ep,{children:e("images")}),b(Xh,{children:b(vEt,{onContinue:r,onBack:o})})]},5),Q(Qh,{children:[b(ep,{children:e("overview")}),b(Xh,{children:b(SEt,{onBack:o})})]},6)]})})]})})},EEt=()=>{const[e]=Re(),t=kV();return Q(Iu,{maxWidth:"md",children:[b(tt,{variant:"h3",children:e("exercises.notEnoughRightsHeader")}),Q(en,{marginTop:4,padding:4,sx:{width:"100%",backgroundColor:"#ebebeb",textAlign:"center"},children:[b(tt,{mb:2,children:e("exercises.notEnoughRights",{days:_ke})}),!t.anonymous&&!t.emailVerified&&b(at,{variant:"contained",href:"/user/preferences",endIcon:b(wrt,{}),children:e("preferences")})]})]})},PEt=()=>{const e=kV();return b(xt,{children:e.canContribute?b(CEt,{}):b(EEt,{})})},IEt=()=>b("div",{children:"Add Weight Page"}),TEt=({day:e,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})=>{const i=Lr(),a=Zd(i.breakpoints.down("sm")),s=Zd(i.breakpoints.down("md")),l=kl(e.date,r.date),c=kl(e.date,n),u=e.date.getMonth()===t&&(e.date.getDate()<=n.getDate()||e.date.getMonth()<n.getMonth()||e.date.getFullYear()<n.getFullYear()),d=e.date.getDay()===6||e.date.getDay()===0,f=()=>l||c?"white":u?d?"#E53945":"black":"gray",h=()=>a?35:s?40:50,g=()=>a?8:s?9:10,y=()=>e.measurements.length>0||e.weightEntry!==void 0,v=()=>{u&&o(e)},x=h(),S=g();return Q("div",{style:{position:"relative",width:`${x}px`,height:`${x+S/2}px`,display:"flex",flexDirection:"column",alignItems:"center"},children:[b("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:`${x}px`,height:`${x}px`,fontSize:a?"0.8rem":s?"0.9rem":"1rem",color:l||c?"white":f(),backgroundColor:l?"#E53945":c?"#FEC107":"transparent",borderRadius:"50%",fontWeight:"bold",cursor:u?"pointer":"default",opacity:e.date.getMonth()!==t?.25:1},"data-testid":`day-${co(e.date)}`,onClick:v,children:e.date.getDate()}),y()&&b("div",{style:{width:`${S}px`,height:`${S}px`,backgroundColor:"black",borderRadius:"50%",position:"absolute",bottom:0,left:"50%",transform:"translateX(-50%)",zIndex:2}})]})},OEt=({days:e,currentMonth:t,currentDate:n,selectedDay:r,onDayClick:o})=>{const{i18n:i}=Re(),a=Array.from({length:7},(s,l)=>new Date(1970,0,l+5).toLocaleString(i.language,{weekday:"short"}));return Q(ye,{container:!0,spacing:1,rowSpacing:2,children:[a.map((s,l)=>b(ye,{size:12/7,children:b(tt,{variant:"body1",sx:{fontWeight:"bold",textAlign:"center"},children:s})},`weekday-${l}`)),e.map((s,l)=>b(ye,{size:12/7,sx:{display:"flex",justifyContent:"center"},children:b(TEt,{day:s,currentMonth:t,currentDate:n,selectedDay:r,onClick:o})},`day-${l}`))]})},kEt=({currentMonth:e,currentYear:t,onPrevMonth:n,onNextMonth:r})=>{const{i18n:o}=Re(),i=Array.from({length:12},(a,s)=>new Date(2024,s,1).toLocaleString(o.language,{month:"long"}));return Q("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",paddingBottom:"3%"},children:[b(at,{variant:"outlined",onClick:n,children:"<"}),Q(tt,{variant:"h5",children:[i[e]," ",t]}),b(at,{variant:"outlined",onClick:r,children:">"})]})};class MEt{constructor(t,n,r,o){this.name=t,this.unit=n,this.value=r,this.date=o}}const AEt=({selectedDay:e})=>{const[t]=Re(),n=t("no_entries_for_day");return Q(fo,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"60%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2}},children:[b(Vl,{title:Q(tt,{variant:"h5",component:"div",sx:{fontWeight:"bold"},children:[t("entries")," - ",e.date.toLocaleDateString()]})}),Q(Pi,{sx:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",gap:2},children:[Q("div",{className:"flex items-center gap-2",children:[Q("span",{className:"font-extrabold",children:[t("weight"),": "]}),b("span",{className:`${e.weightEntry?"text-xl font-semibold":"text-gray-500"}`,children:e.weightEntry?`${e.weightEntry.weight.toFixed(1)} kg`:n})]}),Q("div",{className:"flex flex-col gap-1",children:[Q("span",{className:"font-bold",children:[t("measurements.measurements"),": "]}),e.measurements.length===0?b("span",{className:"text-gray-500 mt-1",children:n}):b("div",{className:"flex flex-col gap-0.5",children:e.measurements.map(r=>Q("div",{children:[r.name,": ",r.value," ",r.unit]},r.name))})]})]})]})};function REt(){const t=Jle().data;return(t==null?void 0:t.flatMap(n=>n.entries.map(r=>new MEt(n.name,n.unit,r.value,r.date))))??[]}const DEt=()=>{const[e]=Re(),n=Y0().data,r=REt(),o=(C,I)=>{const E=new Date(C,I,1),T=[];let A=new Date(C,I,1).getDay();A=A===0?6:A-1;for(let R=0;R<A;R++)T.push({date:new Date(C,I,-A+R+1),weightEntry:void 0,measurements:[]});for(;E.getMonth()===I;)T.push({date:new Date(E),weightEntry:n==null?void 0:n.find(R=>kl(R.date,E)),measurements:r.filter(R=>kl(R.date,E))}),E.setDate(E.getDate()+1);A=new Date(C,I+1,0).getDay();const M=A===0?0:7-A;for(let R=1;R<=M;R++)T.push({date:new Date(C,I+1,R),weightEntry:void 0,measurements:[]});return T},i=new Date,a={date:i,weightEntry:void 0,measurements:[]},[s,l]=w.useState(i.getMonth()),[c,u]=w.useState(i.getFullYear()),d=o(c,s),[f,h]=w.useState(d.find(C=>kl(C.date,i))||a),g=Lr(),y=Zd(g.breakpoints.down("sm"));w.useEffect(()=>{l(f.date.getMonth()),u(f.date.getFullYear())},[f]);const v=C=>{h(C)},x=()=>{s===0?(l(11),u(c-1)):l(s-1)},S=()=>{(s<i.getMonth()||c<i.getFullYear())&&(s===11?(l(0),u(c+1)):l(s+1))};return Q(en,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",md:"row"},height:{xs:"auto",md:"calc(100vh - 130px)"},width:"100%"},children:[Q(fo,{sx:{width:{xs:"auto",md:"65%"},height:{xs:"auto%",md:"100%"},m:{xs:0,sm:1,md:2},p:{xs:1,sm:1.5,md:2},display:"flex",flexDirection:"column"},children:[b(Vl,{sx:{"& .MuiCardHeader-content":{width:"100%"}},title:b("div",{style:{display:"flex",flexDirection:"column",width:"100%"},children:Q("div",{style:{display:"flex",alignItems:"center",marginBottom:"16px"},children:[b(Srt,{style:{width:y?"28px":"32px",height:y?"28px":"32px",marginRight:"12px"}}),b("span",{style:{fontSize:y?"1.5rem":"1.8rem",fontWeight:"bold"},children:e("calendar")})]})})}),Q(Pi,{sx:{overflow:"auto",flex:1,"&:last-child":{paddingBottom:2}},children:[b(kEt,{currentMonth:s,currentYear:c,onPrevMonth:x,onNextMonth:S}),b(OEt,{days:d,currentMonth:s,currentDate:i,selectedDay:f,onDayClick:v})]})]}),b(AEt,{selectedDay:f})]})},_Et=()=>b("div",{children:b(DEt,{})}),$Et=()=>b("div",{children:"Calories Calculator Page"}),NEt=()=>b("div",{children:"Equipments Page"}),LEt=()=>b("div",{children:"Gallery Page"}),FEt=()=>b("div",{children:"Ingredients Page"}),jEt=()=>b("div",{children:"Login Page"}),BEt=()=>b("div",{children:"Preferences Page"}),zEt=()=>b("div",{children:"RestApi Page"}),VEt=({weight:e})=>{const t=Oit(),[n]=Re(),[r,o]=X.useState(null),[i,a]=X.useState(!1),s=!!r,l=g=>{o(g.currentTarget)},c=()=>{u(),f()},u=()=>{o(null)},d=()=>{t.mutate(e.id),o(null)},f=()=>a(!0),h=()=>a(!1);return Q("div",{children:[b(at,{onClick:l,children:b(vrt,{})}),Q(Sa,{anchorEl:r,open:s,onClose:u,MenuListProps:{"aria-labelledby":"basic-button"},children:[b(Ft,{onClick:c,children:n("edit")}),b(Ft,{onClick:d,children:n("delete")})]}),b(ki,{title:n("edit"),isOpen:i,closeFn:h,children:b(Jy,{weightEntry:e,closeFn:h})})]})},HEt=()=>{const[e]=Re(),[t,n]=X.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"primary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Jy,{closeFn:o})})]})},UEt=e=>e.map((t,n)=>n===0?{entry:t,change:0,days:Math.abs(t.date.getTime()-t.date.getTime())/(1e3*60*60*24)}:{entry:t,change:e[n].weight-e[n-1].weight,days:Math.abs(t.date.getTime()-e[n-1].date.getTime())/(1e3*60*60*24)}),WEt=Oz(e=>({table:{"& .MuiPaper-root":{border:"1px solid #bababa"}}})),GEt=({weights:e})=>{const t=[10,50,100],[n]=Re(),r=WEt(),o=UEt(e),[i,a]=w.useState(t[0]),[s,l]=w.useState(0),c=(d,f)=>{l(f)},u=d=>{a(parseInt(d.target.value,10)),l(0)};return Q("div",{className:r.table,children:[Q(jl,{children:[Q(Ll,{sx:{minWidth:650},"aria-label":"simple table",children:[b(Du,{children:Q(Zt,{children:[b(Te,{align:"center",children:n("date")}),b(Te,{align:"center",children:n("weight")}),b(Te,{align:"center",children:n("difference")}),b(Te,{align:"center",children:n("days")}),b(Te,{align:"center"})]})}),b(Fl,{children:o.slice(s*i,s*i+i).map(d=>Q(Zt,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[b(Te,{component:"th",scope:"row",align:"center",children:d.entry.date.toLocaleDateString()}),b(Te,{align:"center",children:d.entry.weight}),b(Te,{align:"center",children:+d.change.toFixed(2)}),b(Te,{align:"center",children:d.days}),b(Te,{align:"center",children:b(VEt,{weight:d.entry})})]},d.entry.date.toLocaleDateString()))})]}),b(nj,{rowsPerPageOptions:t,component:"div",count:o.length,rowsPerPage:i,page:s,onPageChange:c,onRowsPerPageChange:u})]}),b(HEt,{})]})},qEt=()=>{const[e]=Re(),[t,n]=w.useState(!1),r=()=>n(!0),o=()=>n(!1);return Q("div",{children:[b(nh,{color:"secondary","aria-label":"add",onClick:r,sx:{position:"fixed",bottom:"5rem",right:i=>i.spacing(2),zIndex:9},children:b($o,{})}),b(ki,{title:e("add"),isOpen:t,closeFn:o,children:b(Jy,{closeFn:o})})]})},KEt=({currentFilter:e,onFilterChange:t})=>{const[n]=Re(),r=Lr(),o=i=>{e!==i&&t(i)};return Q(GF,{variant:"outlined",sx:{mb:2},children:[b(at,{onClick:()=>o(""),color:e===""?"primary":"inherit",variant:e===""?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("all")}),b(at,{onClick:()=>o("lastYear"),color:e==="lastYear"?"primary":"inherit",variant:e==="lastYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastYear")}),b(at,{onClick:()=>o("lastHalfYear"),color:e==="lastHalfYear"?"primary":"inherit",variant:e==="lastHalfYear"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastHalfYear")}),b(at,{onClick:()=>o("lastMonth"),color:e==="lastMonth"?"primary":"inherit",variant:e==="lastMonth"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastMonth")}),b(at,{onClick:()=>o("lastWeek"),color:e==="lastWeek"?"primary":"inherit",variant:e==="lastWeek"?"contained":"outlined",sx:{fontFamily:r.typography.fontFamily},children:n("lastWeek")})]})},YEt=()=>{const[e]=Re(),[t,n]=w.useState("lastYear"),r=Y0(t),o=i=>{n(i)};return r.isLoading?b(wr,{}):b(es,{title:e("weight"),mainContent:Q(_t,{spacing:2,children:[b(KEt,{currentFilter:t,onFilterChange:o}),r.data.length===0&&b(ih,{}),r.data.length!==0&&Q(xt,{children:[b(Wle,{weights:r.data}),b(en,{sx:{mt:4}}),b(GEt,{weights:r.data})]})]}),fab:b(qEt,{})})},QEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Weight"}),Q(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:[b(Ft,{component:lo,to:Qt(Kt.WEIGHT_OVERVIEW,e.language),children:"Weight overview"}),b(Ft,{component:lo,to:Qt(Kt.WEIGHT_ADD,e.language),children:"Add weight entry"})]})]})},XEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Measurements"}),b(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:b(Ft,{component:lo,to:Qt(Kt.MEASUREMENT_OVERVIEW,e.language),children:"Overview"})})]})},JEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Nutrition"}),b(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:b(Ft,{component:lo,to:Qt(Kt.NUTRITION_OVERVIEW,e.language),children:"Overview"})})]})},ZEt=()=>{const{i18n:e}=Re(),[t,n]=X.useState(null);return Q(xt,{children:[b(at,{color:"inherit",onClick:r=>n(r.currentTarget),children:"Routines"}),Q(Sa,{anchorEl:t,open:!!t,onClose:()=>n(null),children:[b(Ft,{component:lo,to:Qt(Kt.ROUTINE_OVERVIEW,e.language),children:"Routine overview"}),b(Ft,{component:lo,to:Qt(Kt.PRIVATE_TEMPLATE_OVERVIEW,e.language),children:"Private template overview"}),b(Ft,{component:lo,to:Qt(Kt.PUBLIC_TEMPLATE_OVERVIEW,e.language),children:"Public template overview"}),b(Ft,{component:lo,to:Qt(Kt.EXERCISE_OVERVIEW,e.language),children:"Exercise overview"}),b(Ft,{component:lo,to:Qt(Kt.EXERCISE_CONTRIBUTE,e.language),children:"Contribute exercise"}),b(Ft,{component:lo,to:Qt(Kt.CALENDAR,e.language),children:"Calendar"})]})]})},ePt=()=>b(Owe,{position:"static",children:Q(wee,{children:[b(tt,{variant:"h6",component:"div",mr:3,children:"wger"}),b(ZEt,{}),b(QEt,{}),b(XEt,{}),b(JEt,{})]})}),tPt=()=>b(YEt,{}),nPt=()=>b("div",{children:"Workout Page"}),_$=()=>b(cEt,{}),MV=()=>Q(Wot,{children:[Q(Ut,{path:"/:lang",children:[Q(Ut,{path:"workout",children:[b(Ut,{path:"overview",element:b(nPt,{})}),b(Ut,{path:"gallery",element:b(LEt,{})})]}),Q(Ut,{path:"routine",children:[b(Ut,{index:!0,element:b(qX,{})}),b(Ut,{path:"overview",element:b(qX,{})}),b(Ut,{path:"calendar",element:b(_Et,{})}),b(Ut,{path:"add",element:b(ebt,{})}),Q(Ut,{path:":routineId",children:[b(Ut,{path:"day/:dayId",children:b(Ut,{path:"add-logs",element:b(LCt,{})})}),Q(Ut,{path:"edit",children:[b(Ut,{index:!0,element:b(_Ct,{})}),b(Ut,{path:"progression/:slotId",element:b(FCt,{})})]}),b(Ut,{path:"view",element:b(rbt,{})}),b(Ut,{path:"table",element:b(obt,{})}),b(Ut,{path:"logs",element:b(WCt,{})}),b(Ut,{path:"statistics",element:b(YCt,{})})]}),Q(Ut,{path:"templates",children:[b(Ut,{path:":routineId",children:b(Ut,{path:"view",element:b(jCt,{})})}),Q(Ut,{path:"overview",children:[b(Ut,{path:"private",element:b(XCt,{})}),b(Ut,{path:"public",element:b(JCt,{})})]})]})]}),Q(Ut,{path:"measurement",children:[b(Ut,{index:!0,element:b(nX,{})}),b(Ut,{path:"overview",element:b(nX,{})}),b(Ut,{path:"category/:categoryId",element:b(kvt,{})})]}),Q(Ut,{path:"exercise",children:[b(Ut,{index:!0,element:b(zY,{})}),b(Ut,{path:"overview",element:b(zY,{})}),b(Ut,{path:":exerciseId",element:b(_$,{}),children:b(Ut,{path:"view",element:b(_$,{}),children:b(Ut,{path:":slug",element:b(_$,{})})})}),b(Ut,{path:"contribute",element:b(PEt,{})})]}),Q(Ut,{path:"weight",children:[b(Ut,{path:"overview",element:b(tPt,{})}),b(Ut,{path:"add",element:b(IEt,{})})]}),Q(Ut,{path:"nutrition",children:[b(Ut,{path:"overview",element:b(Gvt,{})}),Q(Ut,{path:":planId",children:[b(Ut,{path:"view",element:b(Wvt,{})}),b(Ut,{path:":date",element:b(rX,{})}),b(Ut,{path:"diary",element:b(rX,{})})]}),Q(Ut,{path:"calculator",children:[b(Ut,{path:"bmi",element:b(Rvt,{})}),b(Ut,{path:"calories",element:b($Et,{})})]}),b(Ut,{path:"ingredient",children:b(Ut,{path:"overview",element:b(FEt,{})})})]}),Q(Ut,{path:"software",children:[b(Ut,{path:"about-us",element:b(ZCt,{})}),b(Ut,{path:"api",element:b(zEt,{})}),b(Ut,{path:"equipment",element:b(NEt,{})})]}),b(Ut,{path:"login",element:b(jEt,{})}),b(Ut,{path:"user",children:b(Ut,{path:"preferences",element:b(BEt,{})})})]}),b(Ut,{path:"/",element:b(Bst,{})}),b(Ut,{path:"*",element:b("main",{style:{padding:"1rem"},children:b("p",{children:"404, Page NOT FOUND"})})})]}),rPt="_notification_bbb61_1",nJ={notification:rPt},oPt=()=>{const[e,t]=o1t(),n=()=>{t(KX({notify:!1,message:"",severity:void 0,title:"",type:void 0}))},r=()=>{t(KX({notify:!1,message:"",severity:void 0,title:"",type:void 0,undo:!0}))};return e.notification.notify?e.notification.type==="delete"?Q(Ii,{className:nJ.notification,severity:e.notification.severity,action:b(at,{color:"inherit",size:"small",onClick:r,children:"UNDO"}),variant:"filled",children:[b(hg,{children:e.notification.title}),b("strong",{children:e.notification.message})]}):Q(Ii,{className:nJ.notification,severity:e.notification.severity,onClose:()=>n(),variant:"filled",children:[b(hg,{children:e.notification.title}),b("strong",{children:e.notification.message})]}):null};function iPt(){return Q(ye,{container:!0,children:[b(ye,{size:12,children:b(ePt,{})}),b(ye,{size:12,children:b(oPt,{})}),b(ye,{size:12,children:b(MV,{})})]})}const{slice:aPt,forEach:sPt}=[];function lPt(e){return sPt.call(aPt.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}const rJ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,cPt=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let i=`${e}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!rJ.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!rJ.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},oJ={create(e,t,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=cPt(e,encodeURIComponent(t),o)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return o.substring(t.length,o.length)}return null},remove(e){this.create(e,"",-1)}};var uPt={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return oJ.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=t;n&&typeof document<"u"&&oJ.create(n,e,r,o,i)}},dPt={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const a=o.substring(1).split("&");for(let s=0;s<a.length;s++){const l=a[s].indexOf("=");l>0&&a[s].substring(0,l)===t&&(n=a[s].substring(l+1))}}return n}};let Rb=null;const iJ=()=>{if(Rb!==null)return Rb;try{Rb=window!=="undefined"&&window.localStorage!==null;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Rb=!1}return Rb};var fPt={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&iJ())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&iJ()&&window.localStorage.setItem(n,e)}};let Db=null;const aJ=()=>{if(Db!==null)return Db;try{Db=window!=="undefined"&&window.sessionStorage!==null;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Db=!1}return Db};var pPt={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&aJ())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&aJ()&&window.sessionStorage.setItem(n,e)}},hPt={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)t.push(n[i]);r&&t.push(r),o&&t.push(o)}return t.length>0?t:void 0}},mPt={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},gPt={name:"path",lookup(e){var o;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof t=="number"?t:0])==null?void 0:o.replace("/",""):void 0}},yPt={name:"subdomain",lookup(e){var o,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let yfe=!1;try{document.cookie,yfe=!0}catch{}const vfe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];yfe||vfe.splice(1,1);const vPt=()=>({order:vfe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class bfe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=lPt(n,this.options||{},vPt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(uPt),this.addDetector(dPt),this.addDetector(fPt),this.addDetector(pPt),this.addDetector(hPt),this.addDetector(mPt),this.addDetector(gPt),this.addDetector(yPt)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}bfe.type="languageDetector";function aF(e){"@babel/helpers - typeof";return aF=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aF(e)}function wfe(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":aF(XMLHttpRequest))==="object"}function bPt(e){return!!e&&typeof e.then=="function"}function wPt(e){return bPt(e)?e:Promise.resolve(e)}function sJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sJ(Object(n),!0).forEach(function(r){xPt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sJ(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xPt(e,t,n){return(t=SPt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SPt(e){var t=CPt(e,"string");return eh(t)=="symbol"?t:t+""}function CPt(e,t){if(eh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eh(e){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eh(e)}var cf=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?cf=global.fetch:typeof window<"u"&&window.fetch&&(cf=window.fetch);var Kx;wfe()&&(typeof global<"u"&&global.XMLHttpRequest?Kx=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Kx=window.XMLHttpRequest));var nI;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?nI=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(nI=window.ActiveXObject));typeof cf!="function"&&(cf=void 0);if(!cf&&!Kx&&!nI)try{Kve(()=>import("./browser-ponyfill-B192JBpY.js").then(e=>e.b),[]).then(function(e){cf=e.default}).catch(function(){})}catch{}var sF=function(t,n){if(n&&eh(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},cJ=function(t,n,r,o){var i=function(l){if(!l.ok)return r(l.statusText||"Error",{status:l.status});l.text().then(function(c){r(null,{status:l.status,data:c})}).catch(r)};if(o){var a=o(t,n);if(a instanceof Promise){a.then(i).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(i).catch(r):cf(t,n).then(i).catch(r)},uJ=!1,EPt=function(t,n,r,o){t.queryStringParams&&(n=sF(n,t.queryStringParams));var i=lJ({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=lJ({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:i},uJ?{}:a),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{cJ(n,s,o,l)}catch(c){if(!a||Object.keys(a).length===0||!c.message||c.message.indexOf("not implemented")<0)return o(c);try{Object.keys(a).forEach(function(u){delete s[u]}),cJ(n,s,o,l),uJ=!0}catch(u){o(u)}}},PPt=function(t,n,r,o){r&&eh(r)==="object"&&(r=sF("",r).slice(1)),t.queryStringParams&&(n=sF(n,t.queryStringParams));try{var i=Kx?new Kx:new nI("MSXML2.XMLHTTP.3.0");i.open(r?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(l){console&&console.log(l)}},IPt=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},cf&&n.indexOf("file:")!==0)return EPt(t,n,r,o);if(wfe()||typeof ActiveXObject=="function")return PPt(t,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function cy(e){"@babel/helpers - typeof";return cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cy(e)}function dJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dJ(Object(n),!0).forEach(function(r){xfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dJ(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TPt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OPt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Sfe(r.key),r)}}function kPt(e,t,n){return t&&OPt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xfe(e,t,n){return(t=Sfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sfe(e){var t=MPt(e,"string");return cy(t)=="symbol"?t:t+""}function MPt(e,t){if(cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var APt=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return xfe({},r,o||"")},parseLoadPayload:function(n,r){},request:IPt,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Cfe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};TPt(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return kPt(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=$$($$($$({},APt()),this.options||{}),o),this.allOptions=i,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);cy(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=wPt(l),l.then(function(c){if(!c)return a(null,{});var u=s.services.interpolator.interpolate(c,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(u,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this,s=typeof o=="string"?[o]:o,l=typeof i=="string"?[i]:i,c=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,c,function(u,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&u&&u.message){var f=u.message.toLowerCase(),h=["failed","fetch","network","load"].find(function(v){return f.indexOf(v)>-1});if(h)return r("failed loading "+n+": "+u.message,!0)}if(u)return r(u,!1);var g,y;try{typeof d.data=="string"?g=a.options.parse(d.data,o,i):g=d.data}catch{y="failed parsing "+n+" to json"}if(y)return r(y,!1);r(null,g)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,i),c=0,u=[],d=[];n.forEach(function(f){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(f,r));var g=s.services.interpolator.interpolate(h,{lng:f,ns:r});s.options.request(s.options,g,l,function(y,v){c+=1,u.push(y),d.push(v),c===n.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],c=function(d){var f=i.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};c(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return c(u)}),l.forEach(function(u){n.allOptions.ns.forEach(function(d){o.read(u,d,"read",null,null,function(f,h){f&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),f),!f&&h&&a.log("loaded namespace ".concat(d," for language ").concat(u),h),o.loaded("".concat(u,"|").concat(d),f,h)})})})}}}])}();Cfe.type="backend";qr.use(Cfe).use(bfe).use(HTe).init({load:"languageOnly",detection:{order:["path","navigator","htmlTag"]},fallbackLng:"en",interpolation:{escapeValue:!1},backend:{loadPath:"/static/react/locales/{{lng}}/{{ns}}.json"}});const fv=new Mve({defaultOptions:{queries:{retry:3,staleTime:1e3*60*5,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:"always"}}}),RPt=e=>{const t=document.getElementById(e);if(t===null)return;const n=t.attachShadow({mode:"open"}),r=document.createElement("div"),o=document.createElement("style"),i=document.getElementById("react-css");if(i){const l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("href",i.href),n.appendChild(i)}n.appendChild(r),n.appendChild(o);const a=NJ({key:"css",prepend:!0,container:o});bh.createRoot(r).render(b(tme,{value:a,children:b(w.Suspense,{fallback:b(Ba,{}),children:b(Sz,{children:b(th,{theme:Ovt(r),children:b(gy,{client:fv,children:b(MV,{})})})})})}))},fJ=document.getElementById("root");fJ&&bh.createRoot(fJ).render(b(X.StrictMode,{children:b(w.Suspense,{fallback:b(Ba,{}),children:b(Sz,{children:b(th,{theme:xh,children:Q(gy,{client:fv,children:[b(iPt,{}),b(Yve,{})]})})})})}));const pJ=document.getElementById("react-page-no-shadow-dom");pJ&&bh.createRoot(pJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(Sz,{children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(MV,{})})})})}));RPt("react-page");const hJ=document.getElementById("react-weight-dashboard");hJ&&bh.createRoot(hJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(Gle,{})})})}));const mJ=document.getElementById("react-nutrition-dashboard");mJ&&bh.createRoot(mJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(Jse,{})})})}));const gJ=document.getElementById("react-routine-dashboard");gJ&&bh.createRoot(gJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(gy,{client:fv,children:b(Ole,{})})})}));const yJ=document.getElementById("react-ingredient-search");yJ&&bh.createRoot(yJ).render(b(w.Suspense,{fallback:b(Ba,{}),children:b(th,{theme:xh,children:b(Fst,{})})}));export{vC as c,Fn as g};