@revisium/admin 2.1.0-alpha.6 → 2.1.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,7 @@ var Kce=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Grt=Kce((bnt
|
|
|
5
5
|
`+I[L].replace(" at new "," at ");return d.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",d.displayName)),le}while(1<=L&&0<=K);break}}}finally{J=!1,Error.prepareStackTrace=y}return(d=d?d.displayName||d.name:"")?H(d):""}function W(d){switch(d.tag){case 5:return H(d.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return d=F(d.type,!1),d;case 11:return d=F(d.type.render,!1),d;case 1:return d=F(d.type,!0),d;default:return""}}function ae(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case R:return"Fragment";case T:return"Portal";case A:return"Profiler";case $:return"StrictMode";case q:return"Suspense";case N:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case Q:return(d.displayName||"Context")+".Consumer";case M:return(d._context.displayName||"Context")+".Provider";case V:var f=d.render;return d=d.displayName,d||(d=f.displayName||f.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case B:return f=d.displayName||null,f!==null?f:ae(d.type)||"Memo";case re:f=d._payload,d=d._init;try{return ae(d(f))}catch{}}return null}function we(d){var f=d.type;switch(d.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return d=f.render,d=d.displayName||d.name||"",f.displayName||(d!==""?"ForwardRef("+d+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(f);case 8:return f===$?"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 f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function G(d){switch(typeof d){case"boolean":case"number":case"string":case"undefined":return d;case"object":return d;default:return""}}function ue(d){var f=d.type;return(d=d.nodeName)&&d.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function Te(d){var f=ue(d)?"checked":"value",y=Object.getOwnPropertyDescriptor(d.constructor.prototype,f),C=""+d[f];if(!d.hasOwnProperty(f)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var I=y.get,j=y.set;return Object.defineProperty(d,f,{configurable:!0,get:function(){return I.call(this)},set:function(L){C=""+L,j.call(this,L)}}),Object.defineProperty(d,f,{enumerable:y.enumerable}),{getValue:function(){return C},setValue:function(L){C=""+L},stopTracking:function(){d._valueTracker=null,delete d[f]}}}}function te(d){d._valueTracker||(d._valueTracker=Te(d))}function oe(d){if(!d)return!1;var f=d._valueTracker;if(!f)return!0;var y=f.getValue(),C="";return d&&(C=ue(d)?d.checked?"true":"false":d.value),d=C,d!==y?(f.setValue(d),!0):!1}function Oe(d){if(d=d||(typeof document<"u"?document:void 0),typeof d>"u")return null;try{return d.activeElement||d.body}catch{return d.body}}function Re(d,f){var y=f.checked;return X({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:y??d._wrapperState.initialChecked})}function Ve(d,f){var y=f.defaultValue==null?"":f.defaultValue,C=f.checked!=null?f.checked:f.defaultChecked;y=G(f.value!=null?f.value:y),d._wrapperState={initialChecked:C,initialValue:y,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function We(d,f){f=f.checked,f!=null&&k(d,"checked",f,!1)}function Gt(d,f){We(d,f);var y=G(f.value),C=f.type;if(y!=null)C==="number"?(y===0&&d.value===""||d.value!=y)&&(d.value=""+y):d.value!==""+y&&(d.value=""+y);else if(C==="submit"||C==="reset"){d.removeAttribute("value");return}f.hasOwnProperty("value")?wr(d,f.type,y):f.hasOwnProperty("defaultValue")&&wr(d,f.type,G(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(d.defaultChecked=!!f.defaultChecked)}function $r(d,f,y){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var C=f.type;if(!(C!=="submit"&&C!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+d._wrapperState.initialValue,y||f===d.value||(d.value=f),d.defaultValue=f}y=d.name,y!==""&&(d.name=""),d.defaultChecked=!!d._wrapperState.initialChecked,y!==""&&(d.name=y)}function wr(d,f,y){(f!=="number"||Oe(d.ownerDocument)!==d)&&(y==null?d.defaultValue=""+d._wrapperState.initialValue:d.defaultValue!==""+y&&(d.defaultValue=""+y))}var Sr=Array.isArray;function ur(d,f,y,C){if(d=d.options,f){f={};for(var I=0;I<y.length;I++)f["$"+y[I]]=!0;for(y=0;y<d.length;y++)I=f.hasOwnProperty("$"+d[y].value),d[y].selected!==I&&(d[y].selected=I),I&&C&&(d[y].defaultSelected=!0)}else{for(y=""+G(y),f=null,I=0;I<d.length;I++){if(d[I].value===y){d[I].selected=!0,C&&(d[I].defaultSelected=!0);return}f!==null||d[I].disabled||(f=d[I])}f!==null&&(f.selected=!0)}}function Fr(d,f){if(f.dangerouslySetInnerHTML!=null)throw Error(r(91));return X({},f,{value:void 0,defaultValue:void 0,children:""+d._wrapperState.initialValue})}function Xt(d,f){var y=f.value;if(y==null){if(y=f.children,f=f.defaultValue,y!=null){if(f!=null)throw Error(r(92));if(Sr(y)){if(1<y.length)throw Error(r(93));y=y[0]}f=y}f==null&&(f=""),y=f}d._wrapperState={initialValue:G(y)}}function Ti(d,f){var y=G(f.value),C=G(f.defaultValue);y!=null&&(y=""+y,y!==d.value&&(d.value=y),f.defaultValue==null&&d.defaultValue!==y&&(d.defaultValue=y)),C!=null&&(d.defaultValue=""+C)}function pi(d){var f=d.textContent;f===d._wrapperState.initialValue&&f!==""&&f!==null&&(d.value=f)}function ni(d){switch(d){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 Fi(d,f){return d==null||d==="http://www.w3.org/1999/xhtml"?ni(f):d==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":d}var No,Kn=function(d){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,y,C,I){MSApp.execUnsafeLocalFunction(function(){return d(f,y,C,I)})}:d}(function(d,f){if(d.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in d)d.innerHTML=f;else{for(No=No||document.createElement("div"),No.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=No.firstChild;d.firstChild;)d.removeChild(d.firstChild);for(;f.firstChild;)d.appendChild(f.firstChild)}});function no(d,f){if(f){var y=d.firstChild;if(y&&y===d.lastChild&&y.nodeType===3){y.nodeValue=f;return}}d.textContent=f}var gi={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},Ac=["Webkit","ms","Moz","O"];Object.keys(gi).forEach(function(d){Ac.forEach(function(f){f=f+d.charAt(0).toUpperCase()+d.substring(1),gi[f]=gi[d]})});function Ha(d,f,y){return f==null||typeof f=="boolean"||f===""?"":y||typeof f!="number"||f===0||gi.hasOwnProperty(d)&&gi[d]?(""+f).trim():f+"px"}function Vu(d,f){d=d.style;for(var y in f)if(f.hasOwnProperty(y)){var C=y.indexOf("--")===0,I=Ha(y,f[y],C);y==="float"&&(y="cssFloat"),C?d.setProperty(y,I):d[y]=I}}var Mv=X({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 Nc(d,f){if(f){if(Mv[d]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(r(137,d));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(r(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(r(61))}if(f.style!=null&&typeof f.style!="object")throw Error(r(62))}}function Ei(d,f){if(d.indexOf("-")===-1)return typeof f.is=="string";switch(d){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 Fu=null;function Mc(d){return d=d.target||d.srcElement||window,d.correspondingUseElement&&(d=d.correspondingUseElement),d.nodeType===3?d.parentNode:d}var Ch=null,Ga=null,$l=null;function kh(d){if(d=ey(d)){if(typeof Ch!="function")throw Error(r(280));var f=d.stateNode;f&&(f=Nx(f),Ch(d.stateNode,d.type,f))}}function Xa(d){Ga?$l?$l.push(d):$l=[d]:Ga=d}function fe(){if(Ga){var d=Ga,f=$l;if($l=Ga=null,kh(d),f)for(d=0;d<f.length;d++)kh(f[d])}}function be(d,f){return d(f)}function Ce(){}var Le=!1;function tt(d,f,y){if(Le)return d(f,y);Le=!0;try{return be(d,f,y)}finally{Le=!1,(Ga!==null||$l!==null)&&(Ce(),fe())}}function Et(d,f){var y=d.stateNode;if(y===null)return null;var C=Nx(y);if(C===null)return null;y=C[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(C=!C.disabled)||(d=d.type,C=!(d==="button"||d==="input"||d==="select"||d==="textarea")),d=!C;break e;default:d=!1}if(d)return null;if(y&&typeof y!="function")throw Error(r(231,f,typeof y));return y}var gt=!1;if(a)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){gt=!0}}),window.addEventListener("test",rt,rt),window.removeEventListener("test",rt,rt)}catch{gt=!1}function Nt(d,f,y,C,I,j,L,K,le){var xe=Array.prototype.slice.call(arguments,3);try{f.apply(y,xe)}catch($e){this.onError($e)}}var Z=!1,U=null,ie=!1,de=null,ge={onError:function(d){Z=!0,U=d}};function Ze(d,f,y,C,I,j,L,K,le){Z=!1,U=null,Nt.apply(ge,arguments)}function dt(d,f,y,C,I,j,L,K,le){if(Ze.apply(this,arguments),Z){if(Z){var xe=U;Z=!1,U=null}else throw Error(r(198));ie||(ie=!0,de=xe)}}function Tt(d){var f=d,y=d;if(d.alternate)for(;f.return;)f=f.return;else{d=f;do f=d,(f.flags&4098)!==0&&(y=f.return),d=f.return;while(d)}return f.tag===3?y:null}function dr(d){if(d.tag===13){var f=d.memoizedState;if(f===null&&(d=d.alternate,d!==null&&(f=d.memoizedState)),f!==null)return f.dehydrated}return null}function Tr(d){if(Tt(d)!==d)throw Error(r(188))}function Vt(d){var f=d.alternate;if(!f){if(f=Tt(d),f===null)throw Error(r(188));return f!==d?null:d}for(var y=d,C=f;;){var I=y.return;if(I===null)break;var j=I.alternate;if(j===null){if(C=I.return,C!==null){y=C;continue}break}if(I.child===j.child){for(j=I.child;j;){if(j===y)return Tr(I),d;if(j===C)return Tr(I),f;j=j.sibling}throw Error(r(188))}if(y.return!==C.return)y=I,C=j;else{for(var L=!1,K=I.child;K;){if(K===y){L=!0,y=I,C=j;break}if(K===C){L=!0,C=I,y=j;break}K=K.sibling}if(!L){for(K=j.child;K;){if(K===y){L=!0,y=j,C=I;break}if(K===C){L=!0,C=j,y=I;break}K=K.sibling}if(!L)throw Error(r(189))}}if(y.alternate!==C)throw Error(r(190))}if(y.tag!==3)throw Error(r(188));return y.stateNode.current===y?d:f}function Yt(d){return d=Vt(d),d!==null?Qr(d):null}function Qr(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){var f=Qr(d);if(f!==null)return f;d=d.sibling}return null}var kt=e.unstable_scheduleCallback,Cr=e.unstable_cancelCallback,yt=e.unstable_shouldYield,Ut=e.unstable_requestPaint,Wt=e.unstable_now,Ar=e.unstable_getCurrentPriorityLevel,mi=e.unstable_ImmediatePriority,ca=e.unstable_UserBlockingPriority,Ho=e.unstable_NormalPriority,Go=e.unstable_LowPriority,Is=e.unstable_IdlePriority,ua=null,vi=null;function Ph(d){if(vi&&typeof vi.onCommitFiberRoot=="function")try{vi.onCommitFiberRoot(ua,d,void 0,(d.current.flags&128)===128)}catch{}}var Xo=Math.clz32?Math.clz32:Op,bx=Math.log,bp=Math.LN2;function Op(d){return d>>>=0,d===0?32:31-(bx(d)/bp|0)|0}var Dc=64,_h=4194304;function Qu(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function Al(d,f){var y=d.pendingLanes;if(y===0)return 0;var C=0,I=d.suspendedLanes,j=d.pingedLanes,L=y&268435455;if(L!==0){var K=L&~I;K!==0?C=Qu(K):(j&=L,j!==0&&(C=Qu(j)))}else L=y&~I,L!==0?C=Qu(L):j!==0&&(C=Qu(j));if(C===0)return 0;if(f!==0&&f!==C&&(f&I)===0&&(I=C&-C,j=f&-f,I>=j||I===16&&(j&4194240)!==0))return f;if((C&4)!==0&&(C|=y&16),f=d.entangledLanes,f!==0)for(d=d.entanglements,f&=C;0<f;)y=31-Xo(f),I=1<<y,C|=d[y],f&=~I;return C}function vle(d,f){switch(d){case 1:case 2:case 4:return f+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 f+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 yle(d,f){for(var y=d.suspendedLanes,C=d.pingedLanes,I=d.expirationTimes,j=d.pendingLanes;0<j;){var L=31-Xo(j),K=1<<L,le=I[L];le===-1?((K&y)===0||(K&C)!==0)&&(I[L]=vle(K,f)):le<=f&&(d.expiredLanes|=K),j&=~K}}function bT(d){return d=d.pendingLanes&-1073741825,d!==0?d:d&1073741824?1073741824:0}function g5(){var d=Dc;return Dc<<=1,(Dc&4194240)===0&&(Dc=64),d}function OT(d){for(var f=[],y=0;31>y;y++)f.push(d);return f}function Dv(d,f,y){d.pendingLanes|=f,f!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,f=31-Xo(f),d[f]=y}function ble(d,f){var y=d.pendingLanes&~f;d.pendingLanes=f,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=f,d.mutableReadLanes&=f,d.entangledLanes&=f,f=d.entanglements;var C=d.eventTimes;for(d=d.expirationTimes;0<y;){var I=31-Xo(y),j=1<<I;f[I]=0,C[I]=-1,d[I]=-1,y&=~j}}function xT(d,f){var y=d.entangledLanes|=f;for(d=d.entanglements;y;){var C=31-Xo(y),I=1<<C;I&f|d[C]&f&&(d[C]|=f),y&=~I}}var Br=0;function m5(d){return d&=-d,1<d?4<d?(d&268435455)!==0?16:536870912:4:1}var v5,wT,y5,b5,O5,ST=!1,Ox=[],Bu=null,zu=null,qu=null,Lv=new Map,Vv=new Map,Wu=[],Ole="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 x5(d,f){switch(d){case"focusin":case"focusout":Bu=null;break;case"dragenter":case"dragleave":zu=null;break;case"mouseover":case"mouseout":qu=null;break;case"pointerover":case"pointerout":Lv.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vv.delete(f.pointerId)}}function Fv(d,f,y,C,I,j){return d===null||d.nativeEvent!==j?(d={blockedOn:f,domEventName:y,eventSystemFlags:C,nativeEvent:j,targetContainers:[I]},f!==null&&(f=ey(f),f!==null&&wT(f)),d):(d.eventSystemFlags|=C,f=d.targetContainers,I!==null&&f.indexOf(I)===-1&&f.push(I),d)}function xle(d,f,y,C,I){switch(f){case"focusin":return Bu=Fv(Bu,d,f,y,C,I),!0;case"dragenter":return zu=Fv(zu,d,f,y,C,I),!0;case"mouseover":return qu=Fv(qu,d,f,y,C,I),!0;case"pointerover":var j=I.pointerId;return Lv.set(j,Fv(Lv.get(j)||null,d,f,y,C,I)),!0;case"gotpointercapture":return j=I.pointerId,Vv.set(j,Fv(Vv.get(j)||null,d,f,y,C,I)),!0}return!1}function w5(d){var f=Th(d.target);if(f!==null){var y=Tt(f);if(y!==null){if(f=y.tag,f===13){if(f=dr(y),f!==null){d.blockedOn=f,O5(d.priority,function(){y5(y)});return}}else if(f===3&&y.stateNode.current.memoizedState.isDehydrated){d.blockedOn=y.tag===3?y.stateNode.containerInfo:null;return}}}d.blockedOn=null}function xx(d){if(d.blockedOn!==null)return!1;for(var f=d.targetContainers;0<f.length;){var y=kT(d.domEventName,d.eventSystemFlags,f[0],d.nativeEvent);if(y===null){y=d.nativeEvent;var C=new y.constructor(y.type,y);Fu=C,y.target.dispatchEvent(C),Fu=null}else return f=ey(y),f!==null&&wT(f),d.blockedOn=y,!1;f.shift()}return!0}function S5(d,f,y){xx(d)&&y.delete(f)}function wle(){ST=!1,Bu!==null&&xx(Bu)&&(Bu=null),zu!==null&&xx(zu)&&(zu=null),qu!==null&&xx(qu)&&(qu=null),Lv.forEach(S5),Vv.forEach(S5)}function Qv(d,f){d.blockedOn===f&&(d.blockedOn=null,ST||(ST=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,wle)))}function Bv(d){function f(I){return Qv(I,d)}if(0<Ox.length){Qv(Ox[0],d);for(var y=1;y<Ox.length;y++){var C=Ox[y];C.blockedOn===d&&(C.blockedOn=null)}}for(Bu!==null&&Qv(Bu,d),zu!==null&&Qv(zu,d),qu!==null&&Qv(qu,d),Lv.forEach(f),Vv.forEach(f),y=0;y<Wu.length;y++)C=Wu[y],C.blockedOn===d&&(C.blockedOn=null);for(;0<Wu.length&&(y=Wu[0],y.blockedOn===null);)w5(y),y.blockedOn===null&&Wu.shift()}var xp=P.ReactCurrentBatchConfig,wx=!0;function Sle(d,f,y,C){var I=Br,j=xp.transition;xp.transition=null;try{Br=1,CT(d,f,y,C)}finally{Br=I,xp.transition=j}}function Cle(d,f,y,C){var I=Br,j=xp.transition;xp.transition=null;try{Br=4,CT(d,f,y,C)}finally{Br=I,xp.transition=j}}function CT(d,f,y,C){if(wx){var I=kT(d,f,y,C);if(I===null)BT(d,f,C,Sx,y),x5(d,C);else if(xle(I,d,f,y,C))C.stopPropagation();else if(x5(d,C),f&4&&-1<Ole.indexOf(d)){for(;I!==null;){var j=ey(I);if(j!==null&&v5(j),j=kT(d,f,y,C),j===null&&BT(d,f,C,Sx,y),j===I)break;I=j}I!==null&&C.stopPropagation()}else BT(d,f,C,null,y)}}var Sx=null;function kT(d,f,y,C){if(Sx=null,d=Mc(C),d=Th(d),d!==null)if(f=Tt(d),f===null)d=null;else if(y=f.tag,y===13){if(d=dr(f),d!==null)return d;d=null}else if(y===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;d=null}else f!==d&&(d=null);return Sx=d,null}function C5(d){switch(d){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(Ar()){case mi:return 1;case ca:return 4;case Ho:case Go:return 16;case Is:return 536870912;default:return 16}default:return 16}}var Uu=null,PT=null,Cx=null;function k5(){if(Cx)return Cx;var d,f=PT,y=f.length,C,I="value"in Uu?Uu.value:Uu.textContent,j=I.length;for(d=0;d<y&&f[d]===I[d];d++);var L=y-d;for(C=1;C<=L&&f[y-C]===I[j-C];C++);return Cx=I.slice(d,1<C?1-C:void 0)}function kx(d){var f=d.keyCode;return"charCode"in d?(d=d.charCode,d===0&&f===13&&(d=13)):d=f,d===10&&(d=13),32<=d||d===13?d:0}function Px(){return!0}function P5(){return!1}function js(d){function f(y,C,I,j,L){this._reactName=y,this._targetInst=I,this.type=C,this.nativeEvent=j,this.target=L,this.currentTarget=null;for(var K in d)d.hasOwnProperty(K)&&(y=d[K],this[K]=y?y(j):j[K]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?Px:P5,this.isPropagationStopped=P5,this}return X(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var y=this.nativeEvent;y&&(y.preventDefault?y.preventDefault():typeof y.returnValue!="unknown"&&(y.returnValue=!1),this.isDefaultPrevented=Px)},stopPropagation:function(){var y=this.nativeEvent;y&&(y.stopPropagation?y.stopPropagation():typeof y.cancelBubble!="unknown"&&(y.cancelBubble=!0),this.isPropagationStopped=Px)},persist:function(){},isPersistent:Px}),f}var wp={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(d){return d.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_T=js(wp),zv=X({},wp,{view:0,detail:0}),kle=js(zv),TT,ET,qv,_x=X({},zv,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:IT,button:0,buttons:0,relatedTarget:function(d){return d.relatedTarget===void 0?d.fromElement===d.srcElement?d.toElement:d.fromElement:d.relatedTarget},movementX:function(d){return"movementX"in d?d.movementX:(d!==qv&&(qv&&d.type==="mousemove"?(TT=d.screenX-qv.screenX,ET=d.screenY-qv.screenY):ET=TT=0,qv=d),TT)},movementY:function(d){return"movementY"in d?d.movementY:ET}}),_5=js(_x),Ple=X({},_x,{dataTransfer:0}),_le=js(Ple),Tle=X({},zv,{relatedTarget:0}),RT=js(Tle),Ele=X({},wp,{animationName:0,elapsedTime:0,pseudoElement:0}),Rle=js(Ele),Ile=X({},wp,{clipboardData:function(d){return"clipboardData"in d?d.clipboardData:window.clipboardData}}),jle=js(Ile),$le=X({},wp,{data:0}),T5=js($le),Ale={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nle={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"},Mle={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dle(d){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(d):(d=Mle[d])?!!f[d]:!1}function IT(){return Dle}var Lle=X({},zv,{key:function(d){if(d.key){var f=Ale[d.key]||d.key;if(f!=="Unidentified")return f}return d.type==="keypress"?(d=kx(d),d===13?"Enter":String.fromCharCode(d)):d.type==="keydown"||d.type==="keyup"?Nle[d.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:IT,charCode:function(d){return d.type==="keypress"?kx(d):0},keyCode:function(d){return d.type==="keydown"||d.type==="keyup"?d.keyCode:0},which:function(d){return d.type==="keypress"?kx(d):d.type==="keydown"||d.type==="keyup"?d.keyCode:0}}),Vle=js(Lle),Fle=X({},_x,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),E5=js(Fle),Qle=X({},zv,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:IT}),Ble=js(Qle),zle=X({},wp,{propertyName:0,elapsedTime:0,pseudoElement:0}),qle=js(zle),Wle=X({},_x,{deltaX:function(d){return"deltaX"in d?d.deltaX:"wheelDeltaX"in d?-d.wheelDeltaX:0},deltaY:function(d){return"deltaY"in d?d.deltaY:"wheelDeltaY"in d?-d.wheelDeltaY:"wheelDelta"in d?-d.wheelDelta:0},deltaZ:0,deltaMode:0}),Ule=js(Wle),Hle=[9,13,27,32],jT=a&&"CompositionEvent"in window,Wv=null;a&&"documentMode"in document&&(Wv=document.documentMode);var Gle=a&&"TextEvent"in window&&!Wv,R5=a&&(!jT||Wv&&8<Wv&&11>=Wv),I5=" ",j5=!1;function $5(d,f){switch(d){case"keyup":return Hle.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function A5(d){return d=d.detail,typeof d=="object"&&"data"in d?d.data:null}var Sp=!1;function Xle(d,f){switch(d){case"compositionend":return A5(f);case"keypress":return f.which!==32?null:(j5=!0,I5);case"textInput":return d=f.data,d===I5&&j5?null:d;default:return null}}function Zle(d,f){if(Sp)return d==="compositionend"||!jT&&$5(d,f)?(d=k5(),Cx=PT=Uu=null,Sp=!1,d):null;switch(d){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return R5&&f.locale!=="ko"?null:f.data;default:return null}}var Yle={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 N5(d){var f=d&&d.nodeName&&d.nodeName.toLowerCase();return f==="input"?!!Yle[d.type]:f==="textarea"}function M5(d,f,y,C){Xa(C),f=jx(f,"onChange"),0<f.length&&(y=new _T("onChange","change",null,y,C),d.push({event:y,listeners:f}))}var Uv=null,Hv=null;function Kle(d){eV(d,0)}function Tx(d){var f=Tp(d);if(oe(f))return d}function Jle(d,f){if(d==="change")return f}var D5=!1;if(a){var $T;if(a){var AT="oninput"in document;if(!AT){var L5=document.createElement("div");L5.setAttribute("oninput","return;"),AT=typeof L5.oninput=="function"}$T=AT}else $T=!1;D5=$T&&(!document.documentMode||9<document.documentMode)}function V5(){Uv&&(Uv.detachEvent("onpropertychange",F5),Hv=Uv=null)}function F5(d){if(d.propertyName==="value"&&Tx(Hv)){var f=[];M5(f,Hv,d,Mc(d)),tt(Kle,f)}}function ece(d,f,y){d==="focusin"?(V5(),Uv=f,Hv=y,Uv.attachEvent("onpropertychange",F5)):d==="focusout"&&V5()}function tce(d){if(d==="selectionchange"||d==="keyup"||d==="keydown")return Tx(Hv)}function rce(d,f){if(d==="click")return Tx(f)}function nce(d,f){if(d==="input"||d==="change")return Tx(f)}function ice(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var Za=typeof Object.is=="function"?Object.is:ice;function Gv(d,f){if(Za(d,f))return!0;if(typeof d!="object"||d===null||typeof f!="object"||f===null)return!1;var y=Object.keys(d),C=Object.keys(f);if(y.length!==C.length)return!1;for(C=0;C<y.length;C++){var I=y[C];if(!l.call(f,I)||!Za(d[I],f[I]))return!1}return!0}function Q5(d){for(;d&&d.firstChild;)d=d.firstChild;return d}function B5(d,f){var y=Q5(d);d=0;for(var C;y;){if(y.nodeType===3){if(C=d+y.textContent.length,d<=f&&C>=f)return{node:y,offset:f-d};d=C}e:{for(;y;){if(y.nextSibling){y=y.nextSibling;break e}y=y.parentNode}y=void 0}y=Q5(y)}}function z5(d,f){return d&&f?d===f?!0:d&&d.nodeType===3?!1:f&&f.nodeType===3?z5(d,f.parentNode):"contains"in d?d.contains(f):d.compareDocumentPosition?!!(d.compareDocumentPosition(f)&16):!1:!1}function q5(){for(var d=window,f=Oe();f instanceof d.HTMLIFrameElement;){try{var y=typeof f.contentWindow.location.href=="string"}catch{y=!1}if(y)d=f.contentWindow;else break;f=Oe(d.document)}return f}function NT(d){var f=d&&d.nodeName&&d.nodeName.toLowerCase();return f&&(f==="input"&&(d.type==="text"||d.type==="search"||d.type==="tel"||d.type==="url"||d.type==="password")||f==="textarea"||d.contentEditable==="true")}function oce(d){var f=q5(),y=d.focusedElem,C=d.selectionRange;if(f!==y&&y&&y.ownerDocument&&z5(y.ownerDocument.documentElement,y)){if(C!==null&&NT(y)){if(f=C.start,d=C.end,d===void 0&&(d=f),"selectionStart"in y)y.selectionStart=f,y.selectionEnd=Math.min(d,y.value.length);else if(d=(f=y.ownerDocument||document)&&f.defaultView||window,d.getSelection){d=d.getSelection();var I=y.textContent.length,j=Math.min(C.start,I);C=C.end===void 0?j:Math.min(C.end,I),!d.extend&&j>C&&(I=C,C=j,j=I),I=B5(y,j);var L=B5(y,C);I&&L&&(d.rangeCount!==1||d.anchorNode!==I.node||d.anchorOffset!==I.offset||d.focusNode!==L.node||d.focusOffset!==L.offset)&&(f=f.createRange(),f.setStart(I.node,I.offset),d.removeAllRanges(),j>C?(d.addRange(f),d.extend(L.node,L.offset)):(f.setEnd(L.node,L.offset),d.addRange(f)))}}for(f=[],d=y;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<f.length;y++)d=f[y],d.element.scrollLeft=d.left,d.element.scrollTop=d.top}}var sce=a&&"documentMode"in document&&11>=document.documentMode,Cp=null,MT=null,Xv=null,DT=!1;function W5(d,f,y){var C=y.window===y?y.document:y.nodeType===9?y:y.ownerDocument;DT||Cp==null||Cp!==Oe(C)||(C=Cp,"selectionStart"in C&&NT(C)?C={start:C.selectionStart,end:C.selectionEnd}:(C=(C.ownerDocument&&C.ownerDocument.defaultView||window).getSelection(),C={anchorNode:C.anchorNode,anchorOffset:C.anchorOffset,focusNode:C.focusNode,focusOffset:C.focusOffset}),Xv&&Gv(Xv,C)||(Xv=C,C=jx(MT,"onSelect"),0<C.length&&(f=new _T("onSelect","select",null,f,y),d.push({event:f,listeners:C}),f.target=Cp)))}function Ex(d,f){var y={};return y[d.toLowerCase()]=f.toLowerCase(),y["Webkit"+d]="webkit"+f,y["Moz"+d]="moz"+f,y}var kp={animationend:Ex("Animation","AnimationEnd"),animationiteration:Ex("Animation","AnimationIteration"),animationstart:Ex("Animation","AnimationStart"),transitionend:Ex("Transition","TransitionEnd")},LT={},U5={};a&&(U5=document.createElement("div").style,"AnimationEvent"in window||(delete kp.animationend.animation,delete kp.animationiteration.animation,delete kp.animationstart.animation),"TransitionEvent"in window||delete kp.transitionend.transition);function Rx(d){if(LT[d])return LT[d];if(!kp[d])return d;var f=kp[d],y;for(y in f)if(f.hasOwnProperty(y)&&y in U5)return LT[d]=f[y];return d}var H5=Rx("animationend"),G5=Rx("animationiteration"),X5=Rx("animationstart"),Z5=Rx("transitionend"),Y5=new Map,K5="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 Hu(d,f){Y5.set(d,f),o(f,[d])}for(var VT=0;VT<K5.length;VT++){var FT=K5[VT],ace=FT.toLowerCase(),lce=FT[0].toUpperCase()+FT.slice(1);Hu(ace,"on"+lce)}Hu(H5,"onAnimationEnd"),Hu(G5,"onAnimationIteration"),Hu(X5,"onAnimationStart"),Hu("dblclick","onDoubleClick"),Hu("focusin","onFocus"),Hu("focusout","onBlur"),Hu(Z5,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zv="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(" "),cce=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zv));function J5(d,f,y){var C=d.type||"unknown-event";d.currentTarget=y,dt(C,f,void 0,d),d.currentTarget=null}function eV(d,f){f=(f&4)!==0;for(var y=0;y<d.length;y++){var C=d[y],I=C.event;C=C.listeners;e:{var j=void 0;if(f)for(var L=C.length-1;0<=L;L--){var K=C[L],le=K.instance,xe=K.currentTarget;if(K=K.listener,le!==j&&I.isPropagationStopped())break e;J5(I,K,xe),j=le}else for(L=0;L<C.length;L++){if(K=C[L],le=K.instance,xe=K.currentTarget,K=K.listener,le!==j&&I.isPropagationStopped())break e;J5(I,K,xe),j=le}}}if(ie)throw d=de,ie=!1,de=null,d}function Pn(d,f){var y=f[GT];y===void 0&&(y=f[GT]=new Set);var C=d+"__bubble";y.has(C)||(tV(f,d,2,!1),y.add(C))}function QT(d,f,y){var C=0;f&&(C|=4),tV(y,d,C,f)}var Ix="_reactListening"+Math.random().toString(36).slice(2);function Yv(d){if(!d[Ix]){d[Ix]=!0,n.forEach(function(y){y!=="selectionchange"&&(cce.has(y)||QT(y,!1,d),QT(y,!0,d))});var f=d.nodeType===9?d:d.ownerDocument;f===null||f[Ix]||(f[Ix]=!0,QT("selectionchange",!1,f))}}function tV(d,f,y,C){switch(C5(f)){case 1:var I=Sle;break;case 4:I=Cle;break;default:I=CT}y=I.bind(null,f,y,d),I=void 0,!gt||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(I=!0),C?I!==void 0?d.addEventListener(f,y,{capture:!0,passive:I}):d.addEventListener(f,y,!0):I!==void 0?d.addEventListener(f,y,{passive:I}):d.addEventListener(f,y,!1)}function BT(d,f,y,C,I){var j=C;if((f&1)===0&&(f&2)===0&&C!==null)e:for(;;){if(C===null)return;var L=C.tag;if(L===3||L===4){var K=C.stateNode.containerInfo;if(K===I||K.nodeType===8&&K.parentNode===I)break;if(L===4)for(L=C.return;L!==null;){var le=L.tag;if((le===3||le===4)&&(le=L.stateNode.containerInfo,le===I||le.nodeType===8&&le.parentNode===I))return;L=L.return}for(;K!==null;){if(L=Th(K),L===null)return;if(le=L.tag,le===5||le===6){C=j=L;continue e}K=K.parentNode}}C=C.return}tt(function(){var xe=j,$e=Mc(y),Ne=[];e:{var je=Y5.get(d);if(je!==void 0){var nt=_T,ct=d;switch(d){case"keypress":if(kx(y)===0)break e;case"keydown":case"keyup":nt=Vle;break;case"focusin":ct="focus",nt=RT;break;case"focusout":ct="blur",nt=RT;break;case"beforeblur":case"afterblur":nt=RT;break;case"click":if(y.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":nt=_5;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":nt=_le;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":nt=Ble;break;case H5:case G5:case X5:nt=Rle;break;case Z5:nt=qle;break;case"scroll":nt=kle;break;case"wheel":nt=Ule;break;case"copy":case"cut":case"paste":nt=jle;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":nt=E5}var ht=(f&4)!==0,ai=!ht&&d==="scroll",me=ht?je!==null?je+"Capture":null:je;ht=[];for(var ce=xe,ve;ce!==null;){ve=ce;var Fe=ve.stateNode;if(ve.tag===5&&Fe!==null&&(ve=Fe,me!==null&&(Fe=Et(ce,me),Fe!=null&&ht.push(Kv(ce,Fe,ve)))),ai)break;ce=ce.return}0<ht.length&&(je=new nt(je,ct,null,y,$e),Ne.push({event:je,listeners:ht}))}}if((f&7)===0){e:{if(je=d==="mouseover"||d==="pointerover",nt=d==="mouseout"||d==="pointerout",je&&y!==Fu&&(ct=y.relatedTarget||y.fromElement)&&(Th(ct)||ct[Lc]))break e;if((nt||je)&&(je=$e.window===$e?$e:(je=$e.ownerDocument)?je.defaultView||je.parentWindow:window,nt?(ct=y.relatedTarget||y.toElement,nt=xe,ct=ct?Th(ct):null,ct!==null&&(ai=Tt(ct),ct!==ai||ct.tag!==5&&ct.tag!==6)&&(ct=null)):(nt=null,ct=xe),nt!==ct)){if(ht=_5,Fe="onMouseLeave",me="onMouseEnter",ce="mouse",(d==="pointerout"||d==="pointerover")&&(ht=E5,Fe="onPointerLeave",me="onPointerEnter",ce="pointer"),ai=nt==null?je:Tp(nt),ve=ct==null?je:Tp(ct),je=new ht(Fe,ce+"leave",nt,y,$e),je.target=ai,je.relatedTarget=ve,Fe=null,Th($e)===xe&&(ht=new ht(me,ce+"enter",ct,y,$e),ht.target=ve,ht.relatedTarget=ai,Fe=ht),ai=Fe,nt&&ct)t:{for(ht=nt,me=ct,ce=0,ve=ht;ve;ve=Pp(ve))ce++;for(ve=0,Fe=me;Fe;Fe=Pp(Fe))ve++;for(;0<ce-ve;)ht=Pp(ht),ce--;for(;0<ve-ce;)me=Pp(me),ve--;for(;ce--;){if(ht===me||me!==null&&ht===me.alternate)break t;ht=Pp(ht),me=Pp(me)}ht=null}else ht=null;nt!==null&&rV(Ne,je,nt,ht,!1),ct!==null&&ai!==null&&rV(Ne,ai,ct,ht,!0)}}e:{if(je=xe?Tp(xe):window,nt=je.nodeName&&je.nodeName.toLowerCase(),nt==="select"||nt==="input"&&je.type==="file")var pt=Jle;else if(N5(je))if(D5)pt=nce;else{pt=tce;var Pt=ece}else(nt=je.nodeName)&&nt.toLowerCase()==="input"&&(je.type==="checkbox"||je.type==="radio")&&(pt=rce);if(pt&&(pt=pt(d,xe))){M5(Ne,pt,y,$e);break e}Pt&&Pt(d,je,xe),d==="focusout"&&(Pt=je._wrapperState)&&Pt.controlled&&je.type==="number"&&wr(je,"number",je.value)}switch(Pt=xe?Tp(xe):window,d){case"focusin":(N5(Pt)||Pt.contentEditable==="true")&&(Cp=Pt,MT=xe,Xv=null);break;case"focusout":Xv=MT=Cp=null;break;case"mousedown":DT=!0;break;case"contextmenu":case"mouseup":case"dragend":DT=!1,W5(Ne,y,$e);break;case"selectionchange":if(sce)break;case"keydown":case"keyup":W5(Ne,y,$e)}var _t;if(jT)e:{switch(d){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else Sp?$5(d,y)&&(At="onCompositionEnd"):d==="keydown"&&y.keyCode===229&&(At="onCompositionStart");At&&(R5&&y.locale!=="ko"&&(Sp||At!=="onCompositionStart"?At==="onCompositionEnd"&&Sp&&(_t=k5()):(Uu=$e,PT="value"in Uu?Uu.value:Uu.textContent,Sp=!0)),Pt=jx(xe,At),0<Pt.length&&(At=new T5(At,d,null,y,$e),Ne.push({event:At,listeners:Pt}),_t?At.data=_t:(_t=A5(y),_t!==null&&(At.data=_t)))),(_t=Gle?Xle(d,y):Zle(d,y))&&(xe=jx(xe,"onBeforeInput"),0<xe.length&&($e=new T5("onBeforeInput","beforeinput",null,y,$e),Ne.push({event:$e,listeners:xe}),$e.data=_t))}eV(Ne,f)})}function Kv(d,f,y){return{instance:d,listener:f,currentTarget:y}}function jx(d,f){for(var y=f+"Capture",C=[];d!==null;){var I=d,j=I.stateNode;I.tag===5&&j!==null&&(I=j,j=Et(d,y),j!=null&&C.unshift(Kv(d,j,I)),j=Et(d,f),j!=null&&C.push(Kv(d,j,I))),d=d.return}return C}function Pp(d){if(d===null)return null;do d=d.return;while(d&&d.tag!==5);return d||null}function rV(d,f,y,C,I){for(var j=f._reactName,L=[];y!==null&&y!==C;){var K=y,le=K.alternate,xe=K.stateNode;if(le!==null&&le===C)break;K.tag===5&&xe!==null&&(K=xe,I?(le=Et(y,j),le!=null&&L.unshift(Kv(y,le,K))):I||(le=Et(y,j),le!=null&&L.push(Kv(y,le,K)))),y=y.return}L.length!==0&&d.push({event:f,listeners:L})}var uce=/\r\n?/g,dce=/\u0000|\uFFFD/g;function nV(d){return(typeof d=="string"?d:""+d).replace(uce,`
|
|
6
6
|
`).replace(dce,"")}function $x(d,f,y){if(f=nV(f),nV(d)!==f&&y)throw Error(r(425))}function Ax(){}var zT=null,qT=null;function WT(d,f){return d==="textarea"||d==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var UT=typeof setTimeout=="function"?setTimeout:void 0,hce=typeof clearTimeout=="function"?clearTimeout:void 0,iV=typeof Promise=="function"?Promise:void 0,fce=typeof queueMicrotask=="function"?queueMicrotask:typeof iV<"u"?function(d){return iV.resolve(null).then(d).catch(pce)}:UT;function pce(d){setTimeout(function(){throw d})}function HT(d,f){var y=f,C=0;do{var I=y.nextSibling;if(d.removeChild(y),I&&I.nodeType===8)if(y=I.data,y==="/$"){if(C===0){d.removeChild(I),Bv(f);return}C--}else y!=="$"&&y!=="$?"&&y!=="$!"||C++;y=I}while(y);Bv(f)}function Gu(d){for(;d!=null;d=d.nextSibling){var f=d.nodeType;if(f===1||f===3)break;if(f===8){if(f=d.data,f==="$"||f==="$!"||f==="$?")break;if(f==="/$")return null}}return d}function oV(d){d=d.previousSibling;for(var f=0;d;){if(d.nodeType===8){var y=d.data;if(y==="$"||y==="$!"||y==="$?"){if(f===0)return d;f--}else y==="/$"&&f++}d=d.previousSibling}return null}var _p=Math.random().toString(36).slice(2),Nl="__reactFiber$"+_p,Jv="__reactProps$"+_p,Lc="__reactContainer$"+_p,GT="__reactEvents$"+_p,gce="__reactListeners$"+_p,mce="__reactHandles$"+_p;function Th(d){var f=d[Nl];if(f)return f;for(var y=d.parentNode;y;){if(f=y[Lc]||y[Nl]){if(y=f.alternate,f.child!==null||y!==null&&y.child!==null)for(d=oV(d);d!==null;){if(y=d[Nl])return y;d=oV(d)}return f}d=y,y=d.parentNode}return null}function ey(d){return d=d[Nl]||d[Lc],!d||d.tag!==5&&d.tag!==6&&d.tag!==13&&d.tag!==3?null:d}function Tp(d){if(d.tag===5||d.tag===6)return d.stateNode;throw Error(r(33))}function Nx(d){return d[Jv]||null}var XT=[],Ep=-1;function Xu(d){return{current:d}}function _n(d){0>Ep||(d.current=XT[Ep],XT[Ep]=null,Ep--)}function cn(d,f){Ep++,XT[Ep]=d.current,d.current=f}var Zu={},xo=Xu(Zu),Zo=Xu(!1),Eh=Zu;function Rp(d,f){var y=d.type.contextTypes;if(!y)return Zu;var C=d.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===f)return C.__reactInternalMemoizedMaskedChildContext;var I={},j;for(j in y)I[j]=f[j];return C&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=f,d.__reactInternalMemoizedMaskedChildContext=I),I}function Yo(d){return d=d.childContextTypes,d!=null}function Mx(){_n(Zo),_n(xo)}function sV(d,f,y){if(xo.current!==Zu)throw Error(r(168));cn(xo,f),cn(Zo,y)}function aV(d,f,y){var C=d.stateNode;if(f=f.childContextTypes,typeof C.getChildContext!="function")return y;C=C.getChildContext();for(var I in C)if(!(I in f))throw Error(r(108,we(d)||"Unknown",I));return X({},y,C)}function Dx(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||Zu,Eh=xo.current,cn(xo,d),cn(Zo,Zo.current),!0}function lV(d,f,y){var C=d.stateNode;if(!C)throw Error(r(169));y?(d=aV(d,f,Eh),C.__reactInternalMemoizedMergedChildContext=d,_n(Zo),_n(xo),cn(xo,d)):_n(Zo),cn(Zo,y)}var Vc=null,Lx=!1,ZT=!1;function cV(d){Vc===null?Vc=[d]:Vc.push(d)}function vce(d){Lx=!0,cV(d)}function Yu(){if(!ZT&&Vc!==null){ZT=!0;var d=0,f=Br;try{var y=Vc;for(Br=1;d<y.length;d++){var C=y[d];do C=C(!0);while(C!==null)}Vc=null,Lx=!1}catch(I){throw Vc!==null&&(Vc=Vc.slice(d+1)),kt(mi,Yu),I}finally{Br=f,ZT=!1}}return null}var Ip=[],jp=0,Vx=null,Fx=0,da=[],ha=0,Rh=null,Fc=1,Qc="";function Ih(d,f){Ip[jp++]=Fx,Ip[jp++]=Vx,Vx=d,Fx=f}function uV(d,f,y){da[ha++]=Fc,da[ha++]=Qc,da[ha++]=Rh,Rh=d;var C=Fc;d=Qc;var I=32-Xo(C)-1;C&=~(1<<I),y+=1;var j=32-Xo(f)+I;if(30<j){var L=I-I%5;j=(C&(1<<L)-1).toString(32),C>>=L,I-=L,Fc=1<<32-Xo(f)+I|y<<I|C,Qc=j+d}else Fc=1<<j|y<<I|C,Qc=d}function YT(d){d.return!==null&&(Ih(d,1),uV(d,1,0))}function KT(d){for(;d===Vx;)Vx=Ip[--jp],Ip[jp]=null,Fx=Ip[--jp],Ip[jp]=null;for(;d===Rh;)Rh=da[--ha],da[ha]=null,Qc=da[--ha],da[ha]=null,Fc=da[--ha],da[ha]=null}var $s=null,As=null,Ln=!1,Ya=null;function dV(d,f){var y=ma(5,null,null,0);y.elementType="DELETED",y.stateNode=f,y.return=d,f=d.deletions,f===null?(d.deletions=[y],d.flags|=16):f.push(y)}function hV(d,f){switch(d.tag){case 5:var y=d.type;return f=f.nodeType!==1||y.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(d.stateNode=f,$s=d,As=Gu(f.firstChild),!0):!1;case 6:return f=d.pendingProps===""||f.nodeType!==3?null:f,f!==null?(d.stateNode=f,$s=d,As=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(y=Rh!==null?{id:Fc,overflow:Qc}:null,d.memoizedState={dehydrated:f,treeContext:y,retryLane:1073741824},y=ma(18,null,null,0),y.stateNode=f,y.return=d,d.child=y,$s=d,As=null,!0):!1;default:return!1}}function JT(d){return(d.mode&1)!==0&&(d.flags&128)===0}function eE(d){if(Ln){var f=As;if(f){var y=f;if(!hV(d,f)){if(JT(d))throw Error(r(418));f=Gu(y.nextSibling);var C=$s;f&&hV(d,f)?dV(C,y):(d.flags=d.flags&-4097|2,Ln=!1,$s=d)}}else{if(JT(d))throw Error(r(418));d.flags=d.flags&-4097|2,Ln=!1,$s=d}}}function fV(d){for(d=d.return;d!==null&&d.tag!==5&&d.tag!==3&&d.tag!==13;)d=d.return;$s=d}function Qx(d){if(d!==$s)return!1;if(!Ln)return fV(d),Ln=!0,!1;var f;if((f=d.tag!==3)&&!(f=d.tag!==5)&&(f=d.type,f=f!=="head"&&f!=="body"&&!WT(d.type,d.memoizedProps)),f&&(f=As)){if(JT(d))throw pV(),Error(r(418));for(;f;)dV(d,f),f=Gu(f.nextSibling)}if(fV(d),d.tag===13){if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));e:{for(d=d.nextSibling,f=0;d;){if(d.nodeType===8){var y=d.data;if(y==="/$"){if(f===0){As=Gu(d.nextSibling);break e}f--}else y!=="$"&&y!=="$!"&&y!=="$?"||f++}d=d.nextSibling}As=null}}else As=$s?Gu(d.stateNode.nextSibling):null;return!0}function pV(){for(var d=As;d;)d=Gu(d.nextSibling)}function $p(){As=$s=null,Ln=!1}function tE(d){Ya===null?Ya=[d]:Ya.push(d)}var yce=P.ReactCurrentBatchConfig;function ty(d,f,y){if(d=y.ref,d!==null&&typeof d!="function"&&typeof d!="object"){if(y._owner){if(y=y._owner,y){if(y.tag!==1)throw Error(r(309));var C=y.stateNode}if(!C)throw Error(r(147,d));var I=C,j=""+d;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===j?f.ref:(f=function(L){var K=I.refs;L===null?delete K[j]:K[j]=L},f._stringRef=j,f)}if(typeof d!="string")throw Error(r(284));if(!y._owner)throw Error(r(290,d))}return d}function Bx(d,f){throw d=Object.prototype.toString.call(f),Error(r(31,d==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":d))}function gV(d){var f=d._init;return f(d._payload)}function mV(d){function f(me,ce){if(d){var ve=me.deletions;ve===null?(me.deletions=[ce],me.flags|=16):ve.push(ce)}}function y(me,ce){if(!d)return null;for(;ce!==null;)f(me,ce),ce=ce.sibling;return null}function C(me,ce){for(me=new Map;ce!==null;)ce.key!==null?me.set(ce.key,ce):me.set(ce.index,ce),ce=ce.sibling;return me}function I(me,ce){return me=od(me,ce),me.index=0,me.sibling=null,me}function j(me,ce,ve){return me.index=ve,d?(ve=me.alternate,ve!==null?(ve=ve.index,ve<ce?(me.flags|=2,ce):ve):(me.flags|=2,ce)):(me.flags|=1048576,ce)}function L(me){return d&&me.alternate===null&&(me.flags|=2),me}function K(me,ce,ve,Fe){return ce===null||ce.tag!==6?(ce=UE(ve,me.mode,Fe),ce.return=me,ce):(ce=I(ce,ve),ce.return=me,ce)}function le(me,ce,ve,Fe){var pt=ve.type;return pt===R?$e(me,ce,ve.props.children,Fe,ve.key):ce!==null&&(ce.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===re&&gV(pt)===ce.type)?(Fe=I(ce,ve.props),Fe.ref=ty(me,ce,ve),Fe.return=me,Fe):(Fe=hw(ve.type,ve.key,ve.props,null,me.mode,Fe),Fe.ref=ty(me,ce,ve),Fe.return=me,Fe)}function xe(me,ce,ve,Fe){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==ve.containerInfo||ce.stateNode.implementation!==ve.implementation?(ce=HE(ve,me.mode,Fe),ce.return=me,ce):(ce=I(ce,ve.children||[]),ce.return=me,ce)}function $e(me,ce,ve,Fe,pt){return ce===null||ce.tag!==7?(ce=Vh(ve,me.mode,Fe,pt),ce.return=me,ce):(ce=I(ce,ve),ce.return=me,ce)}function Ne(me,ce,ve){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return ce=UE(""+ce,me.mode,ve),ce.return=me,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case _:return ve=hw(ce.type,ce.key,ce.props,null,me.mode,ve),ve.ref=ty(me,null,ce),ve.return=me,ve;case T:return ce=HE(ce,me.mode,ve),ce.return=me,ce;case re:var Fe=ce._init;return Ne(me,Fe(ce._payload),ve)}if(Sr(ce)||se(ce))return ce=Vh(ce,me.mode,ve,null),ce.return=me,ce;Bx(me,ce)}return null}function je(me,ce,ve,Fe){var pt=ce!==null?ce.key:null;if(typeof ve=="string"&&ve!==""||typeof ve=="number")return pt!==null?null:K(me,ce,""+ve,Fe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case _:return ve.key===pt?le(me,ce,ve,Fe):null;case T:return ve.key===pt?xe(me,ce,ve,Fe):null;case re:return pt=ve._init,je(me,ce,pt(ve._payload),Fe)}if(Sr(ve)||se(ve))return pt!==null?null:$e(me,ce,ve,Fe,null);Bx(me,ve)}return null}function nt(me,ce,ve,Fe,pt){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return me=me.get(ve)||null,K(ce,me,""+Fe,pt);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case _:return me=me.get(Fe.key===null?ve:Fe.key)||null,le(ce,me,Fe,pt);case T:return me=me.get(Fe.key===null?ve:Fe.key)||null,xe(ce,me,Fe,pt);case re:var Pt=Fe._init;return nt(me,ce,ve,Pt(Fe._payload),pt)}if(Sr(Fe)||se(Fe))return me=me.get(ve)||null,$e(ce,me,Fe,pt,null);Bx(ce,Fe)}return null}function ct(me,ce,ve,Fe){for(var pt=null,Pt=null,_t=ce,At=ce=0,zi=null;_t!==null&&At<ve.length;At++){_t.index>At?(zi=_t,_t=null):zi=_t.sibling;var kr=je(me,_t,ve[At],Fe);if(kr===null){_t===null&&(_t=zi);break}d&&_t&&kr.alternate===null&&f(me,_t),ce=j(kr,ce,At),Pt===null?pt=kr:Pt.sibling=kr,Pt=kr,_t=zi}if(At===ve.length)return y(me,_t),Ln&&Ih(me,At),pt;if(_t===null){for(;At<ve.length;At++)_t=Ne(me,ve[At],Fe),_t!==null&&(ce=j(_t,ce,At),Pt===null?pt=_t:Pt.sibling=_t,Pt=_t);return Ln&&Ih(me,At),pt}for(_t=C(me,_t);At<ve.length;At++)zi=nt(_t,me,At,ve[At],Fe),zi!==null&&(d&&zi.alternate!==null&&_t.delete(zi.key===null?At:zi.key),ce=j(zi,ce,At),Pt===null?pt=zi:Pt.sibling=zi,Pt=zi);return d&&_t.forEach(function(sd){return f(me,sd)}),Ln&&Ih(me,At),pt}function ht(me,ce,ve,Fe){var pt=se(ve);if(typeof pt!="function")throw Error(r(150));if(ve=pt.call(ve),ve==null)throw Error(r(151));for(var Pt=pt=null,_t=ce,At=ce=0,zi=null,kr=ve.next();_t!==null&&!kr.done;At++,kr=ve.next()){_t.index>At?(zi=_t,_t=null):zi=_t.sibling;var sd=je(me,_t,kr.value,Fe);if(sd===null){_t===null&&(_t=zi);break}d&&_t&&sd.alternate===null&&f(me,_t),ce=j(sd,ce,At),Pt===null?pt=sd:Pt.sibling=sd,Pt=sd,_t=zi}if(kr.done)return y(me,_t),Ln&&Ih(me,At),pt;if(_t===null){for(;!kr.done;At++,kr=ve.next())kr=Ne(me,kr.value,Fe),kr!==null&&(ce=j(kr,ce,At),Pt===null?pt=kr:Pt.sibling=kr,Pt=kr);return Ln&&Ih(me,At),pt}for(_t=C(me,_t);!kr.done;At++,kr=ve.next())kr=nt(_t,me,At,kr.value,Fe),kr!==null&&(d&&kr.alternate!==null&&_t.delete(kr.key===null?At:kr.key),ce=j(kr,ce,At),Pt===null?pt=kr:Pt.sibling=kr,Pt=kr);return d&&_t.forEach(function(Yce){return f(me,Yce)}),Ln&&Ih(me,At),pt}function ai(me,ce,ve,Fe){if(typeof ve=="object"&&ve!==null&&ve.type===R&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case _:e:{for(var pt=ve.key,Pt=ce;Pt!==null;){if(Pt.key===pt){if(pt=ve.type,pt===R){if(Pt.tag===7){y(me,Pt.sibling),ce=I(Pt,ve.props.children),ce.return=me,me=ce;break e}}else if(Pt.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===re&&gV(pt)===Pt.type){y(me,Pt.sibling),ce=I(Pt,ve.props),ce.ref=ty(me,Pt,ve),ce.return=me,me=ce;break e}y(me,Pt);break}else f(me,Pt);Pt=Pt.sibling}ve.type===R?(ce=Vh(ve.props.children,me.mode,Fe,ve.key),ce.return=me,me=ce):(Fe=hw(ve.type,ve.key,ve.props,null,me.mode,Fe),Fe.ref=ty(me,ce,ve),Fe.return=me,me=Fe)}return L(me);case T:e:{for(Pt=ve.key;ce!==null;){if(ce.key===Pt)if(ce.tag===4&&ce.stateNode.containerInfo===ve.containerInfo&&ce.stateNode.implementation===ve.implementation){y(me,ce.sibling),ce=I(ce,ve.children||[]),ce.return=me,me=ce;break e}else{y(me,ce);break}else f(me,ce);ce=ce.sibling}ce=HE(ve,me.mode,Fe),ce.return=me,me=ce}return L(me);case re:return Pt=ve._init,ai(me,ce,Pt(ve._payload),Fe)}if(Sr(ve))return ct(me,ce,ve,Fe);if(se(ve))return ht(me,ce,ve,Fe);Bx(me,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,ce!==null&&ce.tag===6?(y(me,ce.sibling),ce=I(ce,ve),ce.return=me,me=ce):(y(me,ce),ce=UE(ve,me.mode,Fe),ce.return=me,me=ce),L(me)):y(me,ce)}return ai}var Ap=mV(!0),vV=mV(!1),zx=Xu(null),qx=null,Np=null,rE=null;function nE(){rE=Np=qx=null}function iE(d){var f=zx.current;_n(zx),d._currentValue=f}function oE(d,f,y){for(;d!==null;){var C=d.alternate;if((d.childLanes&f)!==f?(d.childLanes|=f,C!==null&&(C.childLanes|=f)):C!==null&&(C.childLanes&f)!==f&&(C.childLanes|=f),d===y)break;d=d.return}}function Mp(d,f){qx=d,rE=Np=null,d=d.dependencies,d!==null&&d.firstContext!==null&&((d.lanes&f)!==0&&(Ko=!0),d.firstContext=null)}function fa(d){var f=d._currentValue;if(rE!==d)if(d={context:d,memoizedValue:f,next:null},Np===null){if(qx===null)throw Error(r(308));Np=d,qx.dependencies={lanes:0,firstContext:d}}else Np=Np.next=d;return f}var jh=null;function sE(d){jh===null?jh=[d]:jh.push(d)}function yV(d,f,y,C){var I=f.interleaved;return I===null?(y.next=y,sE(f)):(y.next=I.next,I.next=y),f.interleaved=y,Bc(d,C)}function Bc(d,f){d.lanes|=f;var y=d.alternate;for(y!==null&&(y.lanes|=f),y=d,d=d.return;d!==null;)d.childLanes|=f,y=d.alternate,y!==null&&(y.childLanes|=f),y=d,d=d.return;return y.tag===3?y.stateNode:null}var Ku=!1;function aE(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bV(d,f){d=d.updateQueue,f.updateQueue===d&&(f.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,effects:d.effects})}function zc(d,f){return{eventTime:d,lane:f,tag:0,payload:null,callback:null,next:null}}function Ju(d,f,y){var C=d.updateQueue;if(C===null)return null;if(C=C.shared,(br&2)!==0){var I=C.pending;return I===null?f.next=f:(f.next=I.next,I.next=f),C.pending=f,Bc(d,y)}return I=C.interleaved,I===null?(f.next=f,sE(C)):(f.next=I.next,I.next=f),C.interleaved=f,Bc(d,y)}function Wx(d,f,y){if(f=f.updateQueue,f!==null&&(f=f.shared,(y&4194240)!==0)){var C=f.lanes;C&=d.pendingLanes,y|=C,f.lanes=y,xT(d,y)}}function OV(d,f){var y=d.updateQueue,C=d.alternate;if(C!==null&&(C=C.updateQueue,y===C)){var I=null,j=null;if(y=y.firstBaseUpdate,y!==null){do{var L={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};j===null?I=j=L:j=j.next=L,y=y.next}while(y!==null);j===null?I=j=f:j=j.next=f}else I=j=f;y={baseState:C.baseState,firstBaseUpdate:I,lastBaseUpdate:j,shared:C.shared,effects:C.effects},d.updateQueue=y;return}d=y.lastBaseUpdate,d===null?y.firstBaseUpdate=f:d.next=f,y.lastBaseUpdate=f}function Ux(d,f,y,C){var I=d.updateQueue;Ku=!1;var j=I.firstBaseUpdate,L=I.lastBaseUpdate,K=I.shared.pending;if(K!==null){I.shared.pending=null;var le=K,xe=le.next;le.next=null,L===null?j=xe:L.next=xe,L=le;var $e=d.alternate;$e!==null&&($e=$e.updateQueue,K=$e.lastBaseUpdate,K!==L&&(K===null?$e.firstBaseUpdate=xe:K.next=xe,$e.lastBaseUpdate=le))}if(j!==null){var Ne=I.baseState;L=0,$e=xe=le=null,K=j;do{var je=K.lane,nt=K.eventTime;if((C&je)===je){$e!==null&&($e=$e.next={eventTime:nt,lane:0,tag:K.tag,payload:K.payload,callback:K.callback,next:null});e:{var ct=d,ht=K;switch(je=f,nt=y,ht.tag){case 1:if(ct=ht.payload,typeof ct=="function"){Ne=ct.call(nt,Ne,je);break e}Ne=ct;break e;case 3:ct.flags=ct.flags&-65537|128;case 0:if(ct=ht.payload,je=typeof ct=="function"?ct.call(nt,Ne,je):ct,je==null)break e;Ne=X({},Ne,je);break e;case 2:Ku=!0}}K.callback!==null&&K.lane!==0&&(d.flags|=64,je=I.effects,je===null?I.effects=[K]:je.push(K))}else nt={eventTime:nt,lane:je,tag:K.tag,payload:K.payload,callback:K.callback,next:null},$e===null?(xe=$e=nt,le=Ne):$e=$e.next=nt,L|=je;if(K=K.next,K===null){if(K=I.shared.pending,K===null)break;je=K,K=je.next,je.next=null,I.lastBaseUpdate=je,I.shared.pending=null}}while(!0);if($e===null&&(le=Ne),I.baseState=le,I.firstBaseUpdate=xe,I.lastBaseUpdate=$e,f=I.shared.interleaved,f!==null){I=f;do L|=I.lane,I=I.next;while(I!==f)}else j===null&&(I.shared.lanes=0);Nh|=L,d.lanes=L,d.memoizedState=Ne}}function xV(d,f,y){if(d=f.effects,f.effects=null,d!==null)for(f=0;f<d.length;f++){var C=d[f],I=C.callback;if(I!==null){if(C.callback=null,C=y,typeof I!="function")throw Error(r(191,I));I.call(C)}}}var ry={},Ml=Xu(ry),ny=Xu(ry),iy=Xu(ry);function $h(d){if(d===ry)throw Error(r(174));return d}function lE(d,f){switch(cn(iy,f),cn(ny,d),cn(Ml,ry),d=f.nodeType,d){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:Fi(null,"");break;default:d=d===8?f.parentNode:f,f=d.namespaceURI||null,d=d.tagName,f=Fi(f,d)}_n(Ml),cn(Ml,f)}function Dp(){_n(Ml),_n(ny),_n(iy)}function wV(d){$h(iy.current);var f=$h(Ml.current),y=Fi(f,d.type);f!==y&&(cn(ny,d),cn(Ml,y))}function cE(d){ny.current===d&&(_n(Ml),_n(ny))}var Jn=Xu(0);function Hx(d){for(var f=d;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||y.data==="$?"||y.data==="$!"))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===d)break;for(;f.sibling===null;){if(f.return===null||f.return===d)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var uE=[];function dE(){for(var d=0;d<uE.length;d++)uE[d]._workInProgressVersionPrimary=null;uE.length=0}var Gx=P.ReactCurrentDispatcher,hE=P.ReactCurrentBatchConfig,Ah=0,ei=null,Ri=null,Qi=null,Xx=!1,oy=!1,sy=0,bce=0;function wo(){throw Error(r(321))}function fE(d,f){if(f===null)return!1;for(var y=0;y<f.length&&y<d.length;y++)if(!Za(d[y],f[y]))return!1;return!0}function pE(d,f,y,C,I,j){if(Ah=j,ei=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Gx.current=d===null||d.memoizedState===null?Sce:Cce,d=y(C,I),oy){j=0;do{if(oy=!1,sy=0,25<=j)throw Error(r(301));j+=1,Qi=Ri=null,f.updateQueue=null,Gx.current=kce,d=y(C,I)}while(oy)}if(Gx.current=Kx,f=Ri!==null&&Ri.next!==null,Ah=0,Qi=Ri=ei=null,Xx=!1,f)throw Error(r(300));return d}function gE(){var d=sy!==0;return sy=0,d}function Dl(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qi===null?ei.memoizedState=Qi=d:Qi=Qi.next=d,Qi}function pa(){if(Ri===null){var d=ei.alternate;d=d!==null?d.memoizedState:null}else d=Ri.next;var f=Qi===null?ei.memoizedState:Qi.next;if(f!==null)Qi=f,Ri=d;else{if(d===null)throw Error(r(310));Ri=d,d={memoizedState:Ri.memoizedState,baseState:Ri.baseState,baseQueue:Ri.baseQueue,queue:Ri.queue,next:null},Qi===null?ei.memoizedState=Qi=d:Qi=Qi.next=d}return Qi}function ay(d,f){return typeof f=="function"?f(d):f}function mE(d){var f=pa(),y=f.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=d;var C=Ri,I=C.baseQueue,j=y.pending;if(j!==null){if(I!==null){var L=I.next;I.next=j.next,j.next=L}C.baseQueue=I=j,y.pending=null}if(I!==null){j=I.next,C=C.baseState;var K=L=null,le=null,xe=j;do{var $e=xe.lane;if((Ah&$e)===$e)le!==null&&(le=le.next={lane:0,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),C=xe.hasEagerState?xe.eagerState:d(C,xe.action);else{var Ne={lane:$e,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null};le===null?(K=le=Ne,L=C):le=le.next=Ne,ei.lanes|=$e,Nh|=$e}xe=xe.next}while(xe!==null&&xe!==j);le===null?L=C:le.next=K,Za(C,f.memoizedState)||(Ko=!0),f.memoizedState=C,f.baseState=L,f.baseQueue=le,y.lastRenderedState=C}if(d=y.interleaved,d!==null){I=d;do j=I.lane,ei.lanes|=j,Nh|=j,I=I.next;while(I!==d)}else I===null&&(y.lanes=0);return[f.memoizedState,y.dispatch]}function vE(d){var f=pa(),y=f.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=d;var C=y.dispatch,I=y.pending,j=f.memoizedState;if(I!==null){y.pending=null;var L=I=I.next;do j=d(j,L.action),L=L.next;while(L!==I);Za(j,f.memoizedState)||(Ko=!0),f.memoizedState=j,f.baseQueue===null&&(f.baseState=j),y.lastRenderedState=j}return[j,C]}function SV(){}function CV(d,f){var y=ei,C=pa(),I=f(),j=!Za(C.memoizedState,I);if(j&&(C.memoizedState=I,Ko=!0),C=C.queue,yE(_V.bind(null,y,C,d),[d]),C.getSnapshot!==f||j||Qi!==null&&Qi.memoizedState.tag&1){if(y.flags|=2048,ly(9,PV.bind(null,y,C,I,f),void 0,null),Bi===null)throw Error(r(349));(Ah&30)!==0||kV(y,f,I)}return I}function kV(d,f,y){d.flags|=16384,d={getSnapshot:f,value:y},f=ei.updateQueue,f===null?(f={lastEffect:null,stores:null},ei.updateQueue=f,f.stores=[d]):(y=f.stores,y===null?f.stores=[d]:y.push(d))}function PV(d,f,y,C){f.value=y,f.getSnapshot=C,TV(f)&&EV(d)}function _V(d,f,y){return y(function(){TV(f)&&EV(d)})}function TV(d){var f=d.getSnapshot;d=d.value;try{var y=f();return!Za(d,y)}catch{return!0}}function EV(d){var f=Bc(d,1);f!==null&&tl(f,d,1,-1)}function RV(d){var f=Dl();return typeof d=="function"&&(d=d()),f.memoizedState=f.baseState=d,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ay,lastRenderedState:d},f.queue=d,d=d.dispatch=wce.bind(null,ei,d),[f.memoizedState,d]}function ly(d,f,y,C){return d={tag:d,create:f,destroy:y,deps:C,next:null},f=ei.updateQueue,f===null?(f={lastEffect:null,stores:null},ei.updateQueue=f,f.lastEffect=d.next=d):(y=f.lastEffect,y===null?f.lastEffect=d.next=d:(C=y.next,y.next=d,d.next=C,f.lastEffect=d)),d}function IV(){return pa().memoizedState}function Zx(d,f,y,C){var I=Dl();ei.flags|=d,I.memoizedState=ly(1|f,y,void 0,C===void 0?null:C)}function Yx(d,f,y,C){var I=pa();C=C===void 0?null:C;var j=void 0;if(Ri!==null){var L=Ri.memoizedState;if(j=L.destroy,C!==null&&fE(C,L.deps)){I.memoizedState=ly(f,y,j,C);return}}ei.flags|=d,I.memoizedState=ly(1|f,y,j,C)}function jV(d,f){return Zx(8390656,8,d,f)}function yE(d,f){return Yx(2048,8,d,f)}function $V(d,f){return Yx(4,2,d,f)}function AV(d,f){return Yx(4,4,d,f)}function NV(d,f){if(typeof f=="function")return d=d(),f(d),function(){f(null)};if(f!=null)return d=d(),f.current=d,function(){f.current=null}}function MV(d,f,y){return y=y!=null?y.concat([d]):null,Yx(4,4,NV.bind(null,f,d),y)}function bE(){}function DV(d,f){var y=pa();f=f===void 0?null:f;var C=y.memoizedState;return C!==null&&f!==null&&fE(f,C[1])?C[0]:(y.memoizedState=[d,f],d)}function LV(d,f){var y=pa();f=f===void 0?null:f;var C=y.memoizedState;return C!==null&&f!==null&&fE(f,C[1])?C[0]:(d=d(),y.memoizedState=[d,f],d)}function VV(d,f,y){return(Ah&21)===0?(d.baseState&&(d.baseState=!1,Ko=!0),d.memoizedState=y):(Za(y,f)||(y=g5(),ei.lanes|=y,Nh|=y,d.baseState=!0),f)}function Oce(d,f){var y=Br;Br=y!==0&&4>y?y:4,d(!0);var C=hE.transition;hE.transition={};try{d(!1),f()}finally{Br=y,hE.transition=C}}function FV(){return pa().memoizedState}function xce(d,f,y){var C=nd(d);if(y={lane:C,action:y,hasEagerState:!1,eagerState:null,next:null},QV(d))BV(f,y);else if(y=yV(d,f,y,C),y!==null){var I=Do();tl(y,d,C,I),zV(y,f,C)}}function wce(d,f,y){var C=nd(d),I={lane:C,action:y,hasEagerState:!1,eagerState:null,next:null};if(QV(d))BV(f,I);else{var j=d.alternate;if(d.lanes===0&&(j===null||j.lanes===0)&&(j=f.lastRenderedReducer,j!==null))try{var L=f.lastRenderedState,K=j(L,y);if(I.hasEagerState=!0,I.eagerState=K,Za(K,L)){var le=f.interleaved;le===null?(I.next=I,sE(f)):(I.next=le.next,le.next=I),f.interleaved=I;return}}catch{}finally{}y=yV(d,f,I,C),y!==null&&(I=Do(),tl(y,d,C,I),zV(y,f,C))}}function QV(d){var f=d.alternate;return d===ei||f!==null&&f===ei}function BV(d,f){oy=Xx=!0;var y=d.pending;y===null?f.next=f:(f.next=y.next,y.next=f),d.pending=f}function zV(d,f,y){if((y&4194240)!==0){var C=f.lanes;C&=d.pendingLanes,y|=C,f.lanes=y,xT(d,y)}}var Kx={readContext:fa,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useInsertionEffect:wo,useLayoutEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useMutableSource:wo,useSyncExternalStore:wo,useId:wo,unstable_isNewReconciler:!1},Sce={readContext:fa,useCallback:function(d,f){return Dl().memoizedState=[d,f===void 0?null:f],d},useContext:fa,useEffect:jV,useImperativeHandle:function(d,f,y){return y=y!=null?y.concat([d]):null,Zx(4194308,4,NV.bind(null,f,d),y)},useLayoutEffect:function(d,f){return Zx(4194308,4,d,f)},useInsertionEffect:function(d,f){return Zx(4,2,d,f)},useMemo:function(d,f){var y=Dl();return f=f===void 0?null:f,d=d(),y.memoizedState=[d,f],d},useReducer:function(d,f,y){var C=Dl();return f=y!==void 0?y(f):f,C.memoizedState=C.baseState=f,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:f},C.queue=d,d=d.dispatch=xce.bind(null,ei,d),[C.memoizedState,d]},useRef:function(d){var f=Dl();return d={current:d},f.memoizedState=d},useState:RV,useDebugValue:bE,useDeferredValue:function(d){return Dl().memoizedState=d},useTransition:function(){var d=RV(!1),f=d[0];return d=Oce.bind(null,d[1]),Dl().memoizedState=d,[f,d]},useMutableSource:function(){},useSyncExternalStore:function(d,f,y){var C=ei,I=Dl();if(Ln){if(y===void 0)throw Error(r(407));y=y()}else{if(y=f(),Bi===null)throw Error(r(349));(Ah&30)!==0||kV(C,f,y)}I.memoizedState=y;var j={value:y,getSnapshot:f};return I.queue=j,jV(_V.bind(null,C,j,d),[d]),C.flags|=2048,ly(9,PV.bind(null,C,j,y,f),void 0,null),y},useId:function(){var d=Dl(),f=Bi.identifierPrefix;if(Ln){var y=Qc,C=Fc;y=(C&~(1<<32-Xo(C)-1)).toString(32)+y,f=":"+f+"R"+y,y=sy++,0<y&&(f+="H"+y.toString(32)),f+=":"}else y=bce++,f=":"+f+"r"+y.toString(32)+":";return d.memoizedState=f},unstable_isNewReconciler:!1},Cce={readContext:fa,useCallback:DV,useContext:fa,useEffect:yE,useImperativeHandle:MV,useInsertionEffect:$V,useLayoutEffect:AV,useMemo:LV,useReducer:mE,useRef:IV,useState:function(){return mE(ay)},useDebugValue:bE,useDeferredValue:function(d){var f=pa();return VV(f,Ri.memoizedState,d)},useTransition:function(){var d=mE(ay)[0],f=pa().memoizedState;return[d,f]},useMutableSource:SV,useSyncExternalStore:CV,useId:FV,unstable_isNewReconciler:!1},kce={readContext:fa,useCallback:DV,useContext:fa,useEffect:yE,useImperativeHandle:MV,useInsertionEffect:$V,useLayoutEffect:AV,useMemo:LV,useReducer:vE,useRef:IV,useState:function(){return vE(ay)},useDebugValue:bE,useDeferredValue:function(d){var f=pa();return Ri===null?f.memoizedState=d:VV(f,Ri.memoizedState,d)},useTransition:function(){var d=vE(ay)[0],f=pa().memoizedState;return[d,f]},useMutableSource:SV,useSyncExternalStore:CV,useId:FV,unstable_isNewReconciler:!1};function Ka(d,f){if(d&&d.defaultProps){f=X({},f),d=d.defaultProps;for(var y in d)f[y]===void 0&&(f[y]=d[y]);return f}return f}function OE(d,f,y,C){f=d.memoizedState,y=y(C,f),y=y==null?f:X({},f,y),d.memoizedState=y,d.lanes===0&&(d.updateQueue.baseState=y)}var Jx={isMounted:function(d){return(d=d._reactInternals)?Tt(d)===d:!1},enqueueSetState:function(d,f,y){d=d._reactInternals;var C=Do(),I=nd(d),j=zc(C,I);j.payload=f,y!=null&&(j.callback=y),f=Ju(d,j,I),f!==null&&(tl(f,d,I,C),Wx(f,d,I))},enqueueReplaceState:function(d,f,y){d=d._reactInternals;var C=Do(),I=nd(d),j=zc(C,I);j.tag=1,j.payload=f,y!=null&&(j.callback=y),f=Ju(d,j,I),f!==null&&(tl(f,d,I,C),Wx(f,d,I))},enqueueForceUpdate:function(d,f){d=d._reactInternals;var y=Do(),C=nd(d),I=zc(y,C);I.tag=2,f!=null&&(I.callback=f),f=Ju(d,I,C),f!==null&&(tl(f,d,C,y),Wx(f,d,C))}};function qV(d,f,y,C,I,j,L){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(C,j,L):f.prototype&&f.prototype.isPureReactComponent?!Gv(y,C)||!Gv(I,j):!0}function WV(d,f,y){var C=!1,I=Zu,j=f.contextType;return typeof j=="object"&&j!==null?j=fa(j):(I=Yo(f)?Eh:xo.current,C=f.contextTypes,j=(C=C!=null)?Rp(d,I):Zu),f=new f(y,j),d.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Jx,d.stateNode=f,f._reactInternals=d,C&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=I,d.__reactInternalMemoizedMaskedChildContext=j),f}function UV(d,f,y,C){d=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(y,C),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(y,C),f.state!==d&&Jx.enqueueReplaceState(f,f.state,null)}function xE(d,f,y,C){var I=d.stateNode;I.props=y,I.state=d.memoizedState,I.refs={},aE(d);var j=f.contextType;typeof j=="object"&&j!==null?I.context=fa(j):(j=Yo(f)?Eh:xo.current,I.context=Rp(d,j)),I.state=d.memoizedState,j=f.getDerivedStateFromProps,typeof j=="function"&&(OE(d,f,j,y),I.state=d.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(f=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),f!==I.state&&Jx.enqueueReplaceState(I,I.state,null),Ux(d,y,I,C),I.state=d.memoizedState),typeof I.componentDidMount=="function"&&(d.flags|=4194308)}function Lp(d,f){try{var y="",C=f;do y+=W(C),C=C.return;while(C);var I=y}catch(j){I=`
|
|
7
7
|
Error generating stack: `+j.message+`
|
|
8
|
-
`+j.stack}return{value:d,source:f,stack:I,digest:null}}function wE(d,f,y){return{value:d,source:null,stack:y??null,digest:f??null}}function SE(d,f){try{console.error(f.value)}catch(y){setTimeout(function(){throw y})}}var Pce=typeof WeakMap=="function"?WeakMap:Map;function HV(d,f,y){y=zc(-1,y),y.tag=3,y.payload={element:null};var C=f.value;return y.callback=function(){sw||(sw=!0,LE=C),SE(d,f)},y}function GV(d,f,y){y=zc(-1,y),y.tag=3;var C=d.type.getDerivedStateFromError;if(typeof C=="function"){var I=f.value;y.payload=function(){return C(I)},y.callback=function(){SE(d,f)}}var j=d.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(y.callback=function(){SE(d,f),typeof C!="function"&&(td===null?td=new Set([this]):td.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})}),y}function XV(d,f,y){var C=d.pingCache;if(C===null){C=d.pingCache=new Pce;var I=new Set;C.set(f,I)}else I=C.get(f),I===void 0&&(I=new Set,C.set(f,I));I.has(y)||(I.add(y),d=Fce.bind(null,d,f,y),f.then(d,d))}function ZV(d){do{var f;if((f=d.tag===13)&&(f=d.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return d;d=d.return}while(d!==null);return null}function YV(d,f,y,C,I){return(d.mode&1)===0?(d===f?d.flags|=65536:(d.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(f=zc(-1,1),f.tag=2,Ju(y,f,1))),y.lanes|=1),d):(d.flags|=65536,d.lanes=I,d)}var _ce=P.ReactCurrentOwner,Ko=!1;function Mo(d,f,y,C){f.child=d===null?vV(f,null,y,C):Ap(f,d.child,y,C)}function KV(d,f,y,C,I){y=y.render;var j=f.ref;return Mp(f,I),C=pE(d,f,y,C,j,I),y=gE(),d!==null&&!Ko?(f.updateQueue=d.updateQueue,f.flags&=-2053,d.lanes&=~I,qc(d,f,I)):(Ln&&y&&YT(f),f.flags|=1,Mo(d,f,C,I),f.child)}function JV(d,f,y,C,I){if(d===null){var j=y.type;return typeof j=="function"&&!WE(j)&&j.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(f.tag=15,f.type=j,e4(d,f,j,C,I)):(d=hw(y.type,null,C,f,f.mode,I),d.ref=f.ref,d.return=f,f.child=d)}if(j=d.child,(d.lanes&I)===0){var L=j.memoizedProps;if(y=y.compare,y=y!==null?y:Gv,y(L,C)&&d.ref===f.ref)return qc(d,f,I)}return f.flags|=1,d=od(j,C),d.ref=f.ref,d.return=f,f.child=d}function e4(d,f,y,C,I){if(d!==null){var j=d.memoizedProps;if(Gv(j,C)&&d.ref===f.ref)if(Ko=!1,f.pendingProps=C=j,(d.lanes&I)!==0)(d.flags&131072)!==0&&(Ko=!0);else return f.lanes=d.lanes,qc(d,f,I)}return CE(d,f,y,C,I)}function t4(d,f,y){var C=f.pendingProps,I=C.children,j=d!==null?d.memoizedState:null;if(C.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null,transitions:null},cn(Fp,Ns),Ns|=y;else{if((y&1073741824)===0)return d=j!==null?j.baseLanes|y:y,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:d,cachePool:null,transitions:null},f.updateQueue=null,cn(Fp,Ns),Ns|=d,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=j!==null?j.baseLanes:y,cn(Fp,Ns),Ns|=C}else j!==null?(C=j.baseLanes|y,f.memoizedState=null):C=y,cn(Fp,Ns),Ns|=C;return Mo(d,f,I,y),f.child}function r4(d,f){var y=f.ref;(d===null&&y!==null||d!==null&&d.ref!==y)&&(f.flags|=512,f.flags|=2097152)}function CE(d,f,y,C,I){var j=Yo(y)?Eh:xo.current;return j=Rp(f,j),Mp(f,I),y=pE(d,f,y,C,j,I),C=gE(),d!==null&&!Ko?(f.updateQueue=d.updateQueue,f.flags&=-2053,d.lanes&=~I,qc(d,f,I)):(Ln&&C&&YT(f),f.flags|=1,Mo(d,f,y,I),f.child)}function n4(d,f,y,C,I){if(Yo(y)){var j=!0;Dx(f)}else j=!1;if(Mp(f,I),f.stateNode===null)tw(d,f),WV(f,y,C),xE(f,y,C,I),C=!0;else if(d===null){var L=f.stateNode,K=f.memoizedProps;L.props=K;var le=L.context,xe=y.contextType;typeof xe=="object"&&xe!==null?xe=fa(xe):(xe=Yo(y)?Eh:xo.current,xe=Rp(f,xe));var $e=y.getDerivedStateFromProps,Ne=typeof $e=="function"||typeof L.getSnapshotBeforeUpdate=="function";Ne||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(K!==C||le!==xe)&&UV(f,L,C,xe),Ku=!1;var je=f.memoizedState;L.state=je,Ux(f,C,L,I),le=f.memoizedState,K!==C||je!==le||Zo.current||Ku?(typeof $e=="function"&&(OE(f,y,$e,C),le=f.memoizedState),(K=Ku||qV(f,y,K,C,je,le,xe))?(Ne||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(f.flags|=4194308)):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=C,f.memoizedState=le),L.props=C,L.state=le,L.context=xe,C=K):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),C=!1)}else{L=f.stateNode,bV(d,f),K=f.memoizedProps,xe=f.type===f.elementType?K:Ka(f.type,K),L.props=xe,Ne=f.pendingProps,je=L.context,le=y.contextType,typeof le=="object"&&le!==null?le=fa(le):(le=Yo(y)?Eh:xo.current,le=Rp(f,le));var nt=y.getDerivedStateFromProps;($e=typeof nt=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(K!==Ne||je!==le)&&UV(f,L,C,le),Ku=!1,je=f.memoizedState,L.state=je,Ux(f,C,L,I);var ct=f.memoizedState;K!==Ne||je!==ct||Zo.current||Ku?(typeof nt=="function"&&(OE(f,y,nt,C),ct=f.memoizedState),(xe=Ku||qV(f,y,xe,C,je,ct,le)||!1)?($e||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(C,ct,le),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(C,ct,le)),typeof L.componentDidUpdate=="function"&&(f.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof L.componentDidUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=1024),f.memoizedProps=C,f.memoizedState=ct),L.props=C,L.state=ct,L.context=le,C=xe):(typeof L.componentDidUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=1024),C=!1)}return kE(d,f,y,C,j,I)}function kE(d,f,y,C,I,j){r4(d,f);var L=(f.flags&128)!==0;if(!C&&!L)return I&&lV(f,y,!1),qc(d,f,j);C=f.stateNode,_ce.current=f;var K=L&&typeof y.getDerivedStateFromError!="function"?null:C.render();return f.flags|=1,d!==null&&L?(f.child=Ap(f,d.child,null,j),f.child=Ap(f,null,K,j)):Mo(d,f,K,j),f.memoizedState=C.state,I&&lV(f,y,!0),f.child}function i4(d){var f=d.stateNode;f.pendingContext?sV(d,f.pendingContext,f.pendingContext!==f.context):f.context&&sV(d,f.context,!1),lE(d,f.containerInfo)}function o4(d,f,y,C,I){return $p(),tE(I),f.flags|=256,Mo(d,f,y,C),f.child}var PE={dehydrated:null,treeContext:null,retryLane:0};function _E(d){return{baseLanes:d,cachePool:null,transitions:null}}function s4(d,f,y){var C=f.pendingProps,I=Jn.current,j=!1,L=(f.flags&128)!==0,K;if((K=L)||(K=d!==null&&d.memoizedState===null?!1:(I&2)!==0),K?(j=!0,f.flags&=-129):(d===null||d.memoizedState!==null)&&(I|=1),cn(Jn,I&1),d===null)return eE(f),d=f.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?((f.mode&1)===0?f.lanes=1:d.data==="$!"?f.lanes=8:f.lanes=1073741824,null):(L=C.children,d=C.fallback,j?(C=f.mode,j=f.child,L={mode:"hidden",children:L},(C&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=L):j=fw(L,C,0,null),d=Vh(d,C,y,null),j.return=f,d.return=f,j.sibling=d,f.child=j,f.child.memoizedState=_E(y),f.memoizedState=PE,d):TE(f,L));if(I=d.memoizedState,I!==null&&(K=I.dehydrated,K!==null))return Tce(d,f,L,C,K,I,y);if(j){j=C.fallback,L=f.mode,I=d.child,K=I.sibling;var le={mode:"hidden",children:C.children};return(L&1)===0&&f.child!==I?(C=f.child,C.childLanes=0,C.pendingProps=le,f.deletions=null):(C=od(I,le),C.subtreeFlags=I.subtreeFlags&14680064),K!==null?j=od(K,j):(j=Vh(j,L,y,null),j.flags|=2),j.return=f,C.return=f,C.sibling=j,f.child=C,C=j,j=f.child,L=d.child.memoizedState,L=L===null?_E(y):{baseLanes:L.baseLanes|y,cachePool:null,transitions:L.transitions},j.memoizedState=L,j.childLanes=d.childLanes&~y,f.memoizedState=PE,C}return j=d.child,d=j.sibling,C=od(j,{mode:"visible",children:C.children}),(f.mode&1)===0&&(C.lanes=y),C.return=f,C.sibling=null,d!==null&&(y=f.deletions,y===null?(f.deletions=[d],f.flags|=16):y.push(d)),f.child=C,f.memoizedState=null,C}function TE(d,f){return f=fw({mode:"visible",children:f},d.mode,0,null),f.return=d,d.child=f}function ew(d,f,y,C){return C!==null&&tE(C),Ap(f,d.child,null,y),d=TE(f,f.pendingProps.children),d.flags|=2,f.memoizedState=null,d}function Tce(d,f,y,C,I,j,L){if(y)return f.flags&256?(f.flags&=-257,C=wE(Error(r(422))),ew(d,f,L,C)):f.memoizedState!==null?(f.child=d.child,f.flags|=128,null):(j=C.fallback,I=f.mode,C=fw({mode:"visible",children:C.children},I,0,null),j=Vh(j,I,L,null),j.flags|=2,C.return=f,j.return=f,C.sibling=j,f.child=C,(f.mode&1)!==0&&Ap(f,d.child,null,L),f.child.memoizedState=_E(L),f.memoizedState=PE,j);if((f.mode&1)===0)return ew(d,f,L,null);if(I.data==="$!"){if(C=I.nextSibling&&I.nextSibling.dataset,C)var K=C.dgst;return C=K,j=Error(r(419)),C=wE(j,C,void 0),ew(d,f,L,C)}if(K=(L&d.childLanes)!==0,Ko||K){if(C=Bi,C!==null){switch(L&-L){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=(I&(C.suspendedLanes|L))!==0?0:I,I!==0&&I!==j.retryLane&&(j.retryLane=I,Bc(d,I),tl(C,d,I,-1))}return qE(),C=wE(Error(r(421))),ew(d,f,L,C)}return I.data==="$?"?(f.flags|=128,f.child=d.child,f=Qce.bind(null,d),I._reactRetry=f,null):(d=j.treeContext,As=Gu(I.nextSibling),$s=f,Ln=!0,Ya=null,d!==null&&(da[ha++]=Fc,da[ha++]=Qc,da[ha++]=Rh,Fc=d.id,Qc=d.overflow,Rh=f),f=TE(f,C.children),f.flags|=4096,f)}function a4(d,f,y){d.lanes|=f;var C=d.alternate;C!==null&&(C.lanes|=f),oE(d.return,f,y)}function EE(d,f,y,C,I){var j=d.memoizedState;j===null?d.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:C,tail:y,tailMode:I}:(j.isBackwards=f,j.rendering=null,j.renderingStartTime=0,j.last=C,j.tail=y,j.tailMode=I)}function l4(d,f,y){var C=f.pendingProps,I=C.revealOrder,j=C.tail;if(Mo(d,f,C.children,y),C=Jn.current,(C&2)!==0)C=C&1|2,f.flags|=128;else{if(d!==null&&(d.flags&128)!==0)e:for(d=f.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&a4(d,y,f);else if(d.tag===19)a4(d,y,f);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===f)break e;for(;d.sibling===null;){if(d.return===null||d.return===f)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}C&=1}if(cn(Jn,C),(f.mode&1)===0)f.memoizedState=null;else switch(I){case"forwards":for(y=f.child,I=null;y!==null;)d=y.alternate,d!==null&&Hx(d)===null&&(I=y),y=y.sibling;y=I,y===null?(I=f.child,f.child=null):(I=y.sibling,y.sibling=null),EE(f,!1,I,y,j);break;case"backwards":for(y=null,I=f.child,f.child=null;I!==null;){if(d=I.alternate,d!==null&&Hx(d)===null){f.child=I;break}d=I.sibling,I.sibling=y,y=I,I=d}EE(f,!0,y,null,j);break;case"together":EE(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function tw(d,f){(f.mode&1)===0&&d!==null&&(d.alternate=null,f.alternate=null,f.flags|=2)}function qc(d,f,y){if(d!==null&&(f.dependencies=d.dependencies),Nh|=f.lanes,(y&f.childLanes)===0)return null;if(d!==null&&f.child!==d.child)throw Error(r(153));if(f.child!==null){for(d=f.child,y=od(d,d.pendingProps),f.child=y,y.return=f;d.sibling!==null;)d=d.sibling,y=y.sibling=od(d,d.pendingProps),y.return=f;y.sibling=null}return f.child}function Ece(d,f,y){switch(f.tag){case 3:i4(f),$p();break;case 5:wV(f);break;case 1:Yo(f.type)&&Dx(f);break;case 4:lE(f,f.stateNode.containerInfo);break;case 10:var C=f.type._context,I=f.memoizedProps.value;cn(zx,C._currentValue),C._currentValue=I;break;case 13:if(C=f.memoizedState,C!==null)return C.dehydrated!==null?(cn(Jn,Jn.current&1),f.flags|=128,null):(y&f.child.childLanes)!==0?s4(d,f,y):(cn(Jn,Jn.current&1),d=qc(d,f,y),d!==null?d.sibling:null);cn(Jn,Jn.current&1);break;case 19:if(C=(y&f.childLanes)!==0,(d.flags&128)!==0){if(C)return l4(d,f,y);f.flags|=128}if(I=f.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),cn(Jn,Jn.current),C)break;return null;case 22:case 23:return f.lanes=0,t4(d,f,y)}return qc(d,f,y)}var c4,RE,u4,d4;c4=function(d,f){for(var y=f.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===f)break;for(;y.sibling===null;){if(y.return===null||y.return===f)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},RE=function(){},u4=function(d,f,y,C){var I=d.memoizedProps;if(I!==C){d=f.stateNode,$h(Ml.current);var j=null;switch(y){case"input":I=Re(d,I),C=Re(d,C),j=[];break;case"select":I=X({},I,{value:void 0}),C=X({},C,{value:void 0}),j=[];break;case"textarea":I=Fr(d,I),C=Fr(d,C),j=[];break;default:typeof I.onClick!="function"&&typeof C.onClick=="function"&&(d.onclick=Ax)}Nc(y,C);var L;y=null;for(xe in I)if(!C.hasOwnProperty(xe)&&I.hasOwnProperty(xe)&&I[xe]!=null)if(xe==="style"){var K=I[xe];for(L in K)K.hasOwnProperty(L)&&(y||(y={}),y[L]="")}else xe!=="dangerouslySetInnerHTML"&&xe!=="children"&&xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&xe!=="autoFocus"&&(i.hasOwnProperty(xe)?j||(j=[]):(j=j||[]).push(xe,null));for(xe in C){var le=C[xe];if(K=I?.[xe],C.hasOwnProperty(xe)&&le!==K&&(le!=null||K!=null))if(xe==="style")if(K){for(L in K)!K.hasOwnProperty(L)||le&&le.hasOwnProperty(L)||(y||(y={}),y[L]="");for(L in le)le.hasOwnProperty(L)&&K[L]!==le[L]&&(y||(y={}),y[L]=le[L])}else y||(j||(j=[]),j.push(xe,y)),y=le;else xe==="dangerouslySetInnerHTML"?(le=le?le.__html:void 0,K=K?K.__html:void 0,le!=null&&K!==le&&(j=j||[]).push(xe,le)):xe==="children"?typeof le!="string"&&typeof le!="number"||(j=j||[]).push(xe,""+le):xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&(i.hasOwnProperty(xe)?(le!=null&&xe==="onScroll"&&Pn("scroll",d),j||K===le||(j=[])):(j=j||[]).push(xe,le))}y&&(j=j||[]).push("style",y);var xe=j;(f.updateQueue=xe)&&(f.flags|=4)}},d4=function(d,f,y,C){y!==C&&(f.flags|=4)};function cy(d,f){if(!Ln)switch(d.tailMode){case"hidden":f=d.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?d.tail=null:y.sibling=null;break;case"collapsed":y=d.tail;for(var C=null;y!==null;)y.alternate!==null&&(C=y),y=y.sibling;C===null?f||d.tail===null?d.tail=null:d.tail.sibling=null:C.sibling=null}}function So(d){var f=d.alternate!==null&&d.alternate.child===d.child,y=0,C=0;if(f)for(var I=d.child;I!==null;)y|=I.lanes|I.childLanes,C|=I.subtreeFlags&14680064,C|=I.flags&14680064,I.return=d,I=I.sibling;else for(I=d.child;I!==null;)y|=I.lanes|I.childLanes,C|=I.subtreeFlags,C|=I.flags,I.return=d,I=I.sibling;return d.subtreeFlags|=C,d.childLanes=y,f}function Rce(d,f,y){var C=f.pendingProps;switch(KT(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return So(f),null;case 1:return Yo(f.type)&&Mx(),So(f),null;case 3:return C=f.stateNode,Dp(),_n(Zo),_n(xo),dE(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(d===null||d.child===null)&&(Qx(f)?f.flags|=4:d===null||d.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Ya!==null&&(QE(Ya),Ya=null))),RE(d,f),So(f),null;case 5:cE(f);var I=$h(iy.current);if(y=f.type,d!==null&&f.stateNode!=null)u4(d,f,y,C,I),d.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!C){if(f.stateNode===null)throw Error(r(166));return So(f),null}if(d=$h(Ml.current),Qx(f)){C=f.stateNode,y=f.type;var j=f.memoizedProps;switch(C[Nl]=f,C[Jv]=j,d=(f.mode&1)!==0,y){case"dialog":Pn("cancel",C),Pn("close",C);break;case"iframe":case"object":case"embed":Pn("load",C);break;case"video":case"audio":for(I=0;I<Zv.length;I++)Pn(Zv[I],C);break;case"source":Pn("error",C);break;case"img":case"image":case"link":Pn("error",C),Pn("load",C);break;case"details":Pn("toggle",C);break;case"input":Ve(C,j),Pn("invalid",C);break;case"select":C._wrapperState={wasMultiple:!!j.multiple},Pn("invalid",C);break;case"textarea":Xt(C,j),Pn("invalid",C)}Nc(y,j),I=null;for(var L in j)if(j.hasOwnProperty(L)){var K=j[L];L==="children"?typeof K=="string"?C.textContent!==K&&(j.suppressHydrationWarning!==!0&&$x(C.textContent,K,d),I=["children",K]):typeof K=="number"&&C.textContent!==""+K&&(j.suppressHydrationWarning!==!0&&$x(C.textContent,K,d),I=["children",""+K]):i.hasOwnProperty(L)&&K!=null&&L==="onScroll"&&Pn("scroll",C)}switch(y){case"input":te(C),$r(C,j,!0);break;case"textarea":te(C),pi(C);break;case"select":case"option":break;default:typeof j.onClick=="function"&&(C.onclick=Ax)}C=I,f.updateQueue=C,C!==null&&(f.flags|=4)}else{L=I.nodeType===9?I:I.ownerDocument,d==="http://www.w3.org/1999/xhtml"&&(d=ni(y)),d==="http://www.w3.org/1999/xhtml"?y==="script"?(d=L.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild)):typeof C.is=="string"?d=L.createElement(y,{is:C.is}):(d=L.createElement(y),y==="select"&&(L=d,C.multiple?L.multiple=!0:C.size&&(L.size=C.size))):d=L.createElementNS(d,y),d[Nl]=f,d[Jv]=C,c4(d,f,!1,!1),f.stateNode=d;e:{switch(L=Ei(y,C),y){case"dialog":Pn("cancel",d),Pn("close",d),I=C;break;case"iframe":case"object":case"embed":Pn("load",d),I=C;break;case"video":case"audio":for(I=0;I<Zv.length;I++)Pn(Zv[I],d);I=C;break;case"source":Pn("error",d),I=C;break;case"img":case"image":case"link":Pn("error",d),Pn("load",d),I=C;break;case"details":Pn("toggle",d),I=C;break;case"input":Ve(d,C),I=Re(d,C),Pn("invalid",d);break;case"option":I=C;break;case"select":d._wrapperState={wasMultiple:!!C.multiple},I=X({},C,{value:void 0}),Pn("invalid",d);break;case"textarea":Xt(d,C),I=Fr(d,C),Pn("invalid",d);break;default:I=C}Nc(y,I),K=I;for(j in K)if(K.hasOwnProperty(j)){var le=K[j];j==="style"?Vu(d,le):j==="dangerouslySetInnerHTML"?(le=le?le.__html:void 0,le!=null&&Kn(d,le)):j==="children"?typeof le=="string"?(y!=="textarea"||le!=="")&&no(d,le):typeof le=="number"&&no(d,""+le):j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&j!=="autoFocus"&&(i.hasOwnProperty(j)?le!=null&&j==="onScroll"&&Pn("scroll",d):le!=null&&k(d,j,le,L))}switch(y){case"input":te(d),$r(d,C,!1);break;case"textarea":te(d),pi(d);break;case"option":C.value!=null&&d.setAttribute("value",""+G(C.value));break;case"select":d.multiple=!!C.multiple,j=C.value,j!=null?ur(d,!!C.multiple,j,!1):C.defaultValue!=null&&ur(d,!!C.multiple,C.defaultValue,!0);break;default:typeof I.onClick=="function"&&(d.onclick=Ax)}switch(y){case"button":case"input":case"select":case"textarea":C=!!C.autoFocus;break e;case"img":C=!0;break e;default:C=!1}}C&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return So(f),null;case 6:if(d&&f.stateNode!=null)d4(d,f,d.memoizedProps,C);else{if(typeof C!="string"&&f.stateNode===null)throw Error(r(166));if(y=$h(iy.current),$h(Ml.current),Qx(f)){if(C=f.stateNode,y=f.memoizedProps,C[Nl]=f,(j=C.nodeValue!==y)&&(d=$s,d!==null))switch(d.tag){case 3:$x(C.nodeValue,y,(d.mode&1)!==0);break;case 5:d.memoizedProps.suppressHydrationWarning!==!0&&$x(C.nodeValue,y,(d.mode&1)!==0)}j&&(f.flags|=4)}else C=(y.nodeType===9?y:y.ownerDocument).createTextNode(C),C[Nl]=f,f.stateNode=C}return So(f),null;case 13:if(_n(Jn),C=f.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(Ln&&As!==null&&(f.mode&1)!==0&&(f.flags&128)===0)pV(),$p(),f.flags|=98560,j=!1;else if(j=Qx(f),C!==null&&C.dehydrated!==null){if(d===null){if(!j)throw Error(r(318));if(j=f.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(r(317));j[Nl]=f}else $p(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;So(f),j=!1}else Ya!==null&&(QE(Ya),Ya=null),j=!0;if(!j)return f.flags&65536?f:null}return(f.flags&128)!==0?(f.lanes=y,f):(C=C!==null,C!==(d!==null&&d.memoizedState!==null)&&C&&(f.child.flags|=8192,(f.mode&1)!==0&&(d===null||(Jn.current&1)!==0?Ii===0&&(Ii=3):qE())),f.updateQueue!==null&&(f.flags|=4),So(f),null);case 4:return Dp(),RE(d,f),d===null&&Yv(f.stateNode.containerInfo),So(f),null;case 10:return iE(f.type._context),So(f),null;case 17:return Yo(f.type)&&Mx(),So(f),null;case 19:if(_n(Jn),j=f.memoizedState,j===null)return So(f),null;if(C=(f.flags&128)!==0,L=j.rendering,L===null)if(C)cy(j,!1);else{if(Ii!==0||d!==null&&(d.flags&128)!==0)for(d=f.child;d!==null;){if(L=Hx(d),L!==null){for(f.flags|=128,cy(j,!1),C=L.updateQueue,C!==null&&(f.updateQueue=C,f.flags|=4),f.subtreeFlags=0,C=y,y=f.child;y!==null;)j=y,d=C,j.flags&=14680066,L=j.alternate,L===null?(j.childLanes=0,j.lanes=d,j.child=null,j.subtreeFlags=0,j.memoizedProps=null,j.memoizedState=null,j.updateQueue=null,j.dependencies=null,j.stateNode=null):(j.childLanes=L.childLanes,j.lanes=L.lanes,j.child=L.child,j.subtreeFlags=0,j.deletions=null,j.memoizedProps=L.memoizedProps,j.memoizedState=L.memoizedState,j.updateQueue=L.updateQueue,j.type=L.type,d=L.dependencies,j.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),y=y.sibling;return cn(Jn,Jn.current&1|2),f.child}d=d.sibling}j.tail!==null&&Wt()>Qp&&(f.flags|=128,C=!0,cy(j,!1),f.lanes=4194304)}else{if(!C)if(d=Hx(L),d!==null){if(f.flags|=128,C=!0,y=d.updateQueue,y!==null&&(f.updateQueue=y,f.flags|=4),cy(j,!0),j.tail===null&&j.tailMode==="hidden"&&!L.alternate&&!Ln)return So(f),null}else 2*Wt()-j.renderingStartTime>Qp&&y!==1073741824&&(f.flags|=128,C=!0,cy(j,!1),f.lanes=4194304);j.isBackwards?(L.sibling=f.child,f.child=L):(y=j.last,y!==null?y.sibling=L:f.child=L,j.last=L)}return j.tail!==null?(f=j.tail,j.rendering=f,j.tail=f.sibling,j.renderingStartTime=Wt(),f.sibling=null,y=Jn.current,cn(Jn,C?y&1|2:y&1),f):(So(f),null);case 22:case 23:return zE(),C=f.memoizedState!==null,d!==null&&d.memoizedState!==null!==C&&(f.flags|=8192),C&&(f.mode&1)!==0?(Ns&1073741824)!==0&&(So(f),f.subtreeFlags&6&&(f.flags|=8192)):So(f),null;case 24:return null;case 25:return null}throw Error(r(156,f.tag))}function Ice(d,f){switch(KT(f),f.tag){case 1:return Yo(f.type)&&Mx(),d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 3:return Dp(),_n(Zo),_n(xo),dE(),d=f.flags,(d&65536)!==0&&(d&128)===0?(f.flags=d&-65537|128,f):null;case 5:return cE(f),null;case 13:if(_n(Jn),d=f.memoizedState,d!==null&&d.dehydrated!==null){if(f.alternate===null)throw Error(r(340));$p()}return d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 19:return _n(Jn),null;case 4:return Dp(),null;case 10:return iE(f.type._context),null;case 22:case 23:return zE(),null;case 24:return null;default:return null}}var rw=!1,Co=!1,jce=typeof WeakSet=="function"?WeakSet:Set,at=null;function Vp(d,f){var y=d.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(C){ii(d,f,C)}else y.current=null}function IE(d,f,y){try{y()}catch(C){ii(d,f,C)}}var h4=!1;function $ce(d,f){if(zT=wx,d=q5(),NT(d)){if("selectionStart"in d)var y={start:d.selectionStart,end:d.selectionEnd};else e:{y=(y=d.ownerDocument)&&y.defaultView||window;var C=y.getSelection&&y.getSelection();if(C&&C.rangeCount!==0){y=C.anchorNode;var I=C.anchorOffset,j=C.focusNode;C=C.focusOffset;try{y.nodeType,j.nodeType}catch{y=null;break e}var L=0,K=-1,le=-1,xe=0,$e=0,Ne=d,je=null;t:for(;;){for(var nt;Ne!==y||I!==0&&Ne.nodeType!==3||(K=L+I),Ne!==j||C!==0&&Ne.nodeType!==3||(le=L+C),Ne.nodeType===3&&(L+=Ne.nodeValue.length),(nt=Ne.firstChild)!==null;)je=Ne,Ne=nt;for(;;){if(Ne===d)break t;if(je===y&&++xe===I&&(K=L),je===j&&++$e===C&&(le=L),(nt=Ne.nextSibling)!==null)break;Ne=je,je=Ne.parentNode}Ne=nt}y=K===-1||le===-1?null:{start:K,end:le}}else y=null}y=y||{start:0,end:0}}else y=null;for(qT={focusedElem:d,selectionRange:y},wx=!1,at=f;at!==null;)if(f=at,d=f.child,(f.subtreeFlags&1028)!==0&&d!==null)d.return=f,at=d;else for(;at!==null;){f=at;try{var ct=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(ct!==null){var ht=ct.memoizedProps,ai=ct.memoizedState,me=f.stateNode,ce=me.getSnapshotBeforeUpdate(f.elementType===f.type?ht:Ka(f.type,ht),ai);me.__reactInternalSnapshotBeforeUpdate=ce}break;case 3:var ve=f.stateNode.containerInfo;ve.nodeType===1?ve.textContent="":ve.nodeType===9&&ve.documentElement&&ve.removeChild(ve.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Fe){ii(f,f.return,Fe)}if(d=f.sibling,d!==null){d.return=f.return,at=d;break}at=f.return}return ct=h4,h4=!1,ct}function uy(d,f,y){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var I=C=C.next;do{if((I.tag&d)===d){var j=I.destroy;I.destroy=void 0,j!==void 0&&IE(f,y,j)}I=I.next}while(I!==C)}}function nw(d,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&d)===d){var C=y.create;y.destroy=C()}y=y.next}while(y!==f)}}function jE(d){var f=d.ref;if(f!==null){var y=d.stateNode;switch(d.tag){case 5:d=y;break;default:d=y}typeof f=="function"?f(d):f.current=d}}function f4(d){var f=d.alternate;f!==null&&(d.alternate=null,f4(f)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(f=d.stateNode,f!==null&&(delete f[Nl],delete f[Jv],delete f[GT],delete f[gce],delete f[mce])),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function p4(d){return d.tag===5||d.tag===3||d.tag===4}function g4(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||p4(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function $E(d,f,y){var C=d.tag;if(C===5||C===6)d=d.stateNode,f?y.nodeType===8?y.parentNode.insertBefore(d,f):y.insertBefore(d,f):(y.nodeType===8?(f=y.parentNode,f.insertBefore(d,y)):(f=y,f.appendChild(d)),y=y._reactRootContainer,y!=null||f.onclick!==null||(f.onclick=Ax));else if(C!==4&&(d=d.child,d!==null))for($E(d,f,y),d=d.sibling;d!==null;)$E(d,f,y),d=d.sibling}function AE(d,f,y){var C=d.tag;if(C===5||C===6)d=d.stateNode,f?y.insertBefore(d,f):y.appendChild(d);else if(C!==4&&(d=d.child,d!==null))for(AE(d,f,y),d=d.sibling;d!==null;)AE(d,f,y),d=d.sibling}var io=null,Ja=!1;function ed(d,f,y){for(y=y.child;y!==null;)m4(d,f,y),y=y.sibling}function m4(d,f,y){if(vi&&typeof vi.onCommitFiberUnmount=="function")try{vi.onCommitFiberUnmount(ua,y)}catch{}switch(y.tag){case 5:Co||Vp(y,f);case 6:var C=io,I=Ja;io=null,ed(d,f,y),io=C,Ja=I,io!==null&&(Ja?(d=io,y=y.stateNode,d.nodeType===8?d.parentNode.removeChild(y):d.removeChild(y)):io.removeChild(y.stateNode));break;case 18:io!==null&&(Ja?(d=io,y=y.stateNode,d.nodeType===8?HT(d.parentNode,y):d.nodeType===1&&HT(d,y),Bv(d)):HT(io,y.stateNode));break;case 4:C=io,I=Ja,io=y.stateNode.containerInfo,Ja=!0,ed(d,f,y),io=C,Ja=I;break;case 0:case 11:case 14:case 15:if(!Co&&(C=y.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){I=C=C.next;do{var j=I,L=j.destroy;j=j.tag,L!==void 0&&((j&2)!==0||(j&4)!==0)&&IE(y,f,L),I=I.next}while(I!==C)}ed(d,f,y);break;case 1:if(!Co&&(Vp(y,f),C=y.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=y.memoizedProps,C.state=y.memoizedState,C.componentWillUnmount()}catch(K){ii(y,f,K)}ed(d,f,y);break;case 21:ed(d,f,y);break;case 22:y.mode&1?(Co=(C=Co)||y.memoizedState!==null,ed(d,f,y),Co=C):ed(d,f,y);break;default:ed(d,f,y)}}function v4(d){var f=d.updateQueue;if(f!==null){d.updateQueue=null;var y=d.stateNode;y===null&&(y=d.stateNode=new jce),f.forEach(function(C){var I=Bce.bind(null,d,C);y.has(C)||(y.add(C),C.then(I,I))})}}function el(d,f){var y=f.deletions;if(y!==null)for(var C=0;C<y.length;C++){var I=y[C];try{var j=d,L=f,K=L;e:for(;K!==null;){switch(K.tag){case 5:io=K.stateNode,Ja=!1;break e;case 3:io=K.stateNode.containerInfo,Ja=!0;break e;case 4:io=K.stateNode.containerInfo,Ja=!0;break e}K=K.return}if(io===null)throw Error(r(160));m4(j,L,I),io=null,Ja=!1;var le=I.alternate;le!==null&&(le.return=null),I.return=null}catch(xe){ii(I,f,xe)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)y4(f,d),f=f.sibling}function y4(d,f){var y=d.alternate,C=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:if(el(f,d),Ll(d),C&4){try{uy(3,d,d.return),nw(3,d)}catch(ht){ii(d,d.return,ht)}try{uy(5,d,d.return)}catch(ht){ii(d,d.return,ht)}}break;case 1:el(f,d),Ll(d),C&512&&y!==null&&Vp(y,y.return);break;case 5:if(el(f,d),Ll(d),C&512&&y!==null&&Vp(y,y.return),d.flags&32){var I=d.stateNode;try{no(I,"")}catch(ht){ii(d,d.return,ht)}}if(C&4&&(I=d.stateNode,I!=null)){var j=d.memoizedProps,L=y!==null?y.memoizedProps:j,K=d.type,le=d.updateQueue;if(d.updateQueue=null,le!==null)try{K==="input"&&j.type==="radio"&&j.name!=null&&We(I,j),Ei(K,L);var xe=Ei(K,j);for(L=0;L<le.length;L+=2){var $e=le[L],Ne=le[L+1];$e==="style"?Vu(I,Ne):$e==="dangerouslySetInnerHTML"?Kn(I,Ne):$e==="children"?no(I,Ne):k(I,$e,Ne,xe)}switch(K){case"input":Gt(I,j);break;case"textarea":Ti(I,j);break;case"select":var je=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!j.multiple;var nt=j.value;nt!=null?ur(I,!!j.multiple,nt,!1):je!==!!j.multiple&&(j.defaultValue!=null?ur(I,!!j.multiple,j.defaultValue,!0):ur(I,!!j.multiple,j.multiple?[]:"",!1))}I[Jv]=j}catch(ht){ii(d,d.return,ht)}}break;case 6:if(el(f,d),Ll(d),C&4){if(d.stateNode===null)throw Error(r(162));I=d.stateNode,j=d.memoizedProps;try{I.nodeValue=j}catch(ht){ii(d,d.return,ht)}}break;case 3:if(el(f,d),Ll(d),C&4&&y!==null&&y.memoizedState.isDehydrated)try{Bv(f.containerInfo)}catch(ht){ii(d,d.return,ht)}break;case 4:el(f,d),Ll(d);break;case 13:el(f,d),Ll(d),I=d.child,I.flags&8192&&(j=I.memoizedState!==null,I.stateNode.isHidden=j,!j||I.alternate!==null&&I.alternate.memoizedState!==null||(DE=Wt())),C&4&&v4(d);break;case 22:if($e=y!==null&&y.memoizedState!==null,d.mode&1?(Co=(xe=Co)||$e,el(f,d),Co=xe):el(f,d),Ll(d),C&8192){if(xe=d.memoizedState!==null,(d.stateNode.isHidden=xe)&&!$e&&(d.mode&1)!==0)for(at=d,$e=d.child;$e!==null;){for(Ne=at=$e;at!==null;){switch(je=at,nt=je.child,je.tag){case 0:case 11:case 14:case 15:uy(4,je,je.return);break;case 1:Vp(je,je.return);var ct=je.stateNode;if(typeof ct.componentWillUnmount=="function"){C=je,y=je.return;try{f=C,ct.props=f.memoizedProps,ct.state=f.memoizedState,ct.componentWillUnmount()}catch(ht){ii(C,y,ht)}}break;case 5:Vp(je,je.return);break;case 22:if(je.memoizedState!==null){x4(Ne);continue}}nt!==null?(nt.return=je,at=nt):x4(Ne)}$e=$e.sibling}e:for($e=null,Ne=d;;){if(Ne.tag===5){if($e===null){$e=Ne;try{I=Ne.stateNode,xe?(j=I.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none"):(K=Ne.stateNode,le=Ne.memoizedProps.style,L=le!=null&&le.hasOwnProperty("display")?le.display:null,K.style.display=Ha("display",L))}catch(ht){ii(d,d.return,ht)}}}else if(Ne.tag===6){if($e===null)try{Ne.stateNode.nodeValue=xe?"":Ne.memoizedProps}catch(ht){ii(d,d.return,ht)}}else if((Ne.tag!==22&&Ne.tag!==23||Ne.memoizedState===null||Ne===d)&&Ne.child!==null){Ne.child.return=Ne,Ne=Ne.child;continue}if(Ne===d)break e;for(;Ne.sibling===null;){if(Ne.return===null||Ne.return===d)break e;$e===Ne&&($e=null),Ne=Ne.return}$e===Ne&&($e=null),Ne.sibling.return=Ne.return,Ne=Ne.sibling}}break;case 19:el(f,d),Ll(d),C&4&&v4(d);break;case 21:break;default:el(f,d),Ll(d)}}function Ll(d){var f=d.flags;if(f&2){try{e:{for(var y=d.return;y!==null;){if(p4(y)){var C=y;break e}y=y.return}throw Error(r(160))}switch(C.tag){case 5:var I=C.stateNode;C.flags&32&&(no(I,""),C.flags&=-33);var j=g4(d);AE(d,j,I);break;case 3:case 4:var L=C.stateNode.containerInfo,K=g4(d);$E(d,K,L);break;default:throw Error(r(161))}}catch(le){ii(d,d.return,le)}d.flags&=-3}f&4096&&(d.flags&=-4097)}function Ace(d,f,y){at=d,b4(d)}function b4(d,f,y){for(var C=(d.mode&1)!==0;at!==null;){var I=at,j=I.child;if(I.tag===22&&C){var L=I.memoizedState!==null||rw;if(!L){var K=I.alternate,le=K!==null&&K.memoizedState!==null||Co;K=rw;var xe=Co;if(rw=L,(Co=le)&&!xe)for(at=I;at!==null;)L=at,le=L.child,L.tag===22&&L.memoizedState!==null?w4(I):le!==null?(le.return=L,at=le):w4(I);for(;j!==null;)at=j,b4(j),j=j.sibling;at=I,rw=K,Co=xe}O4(d)}else(I.subtreeFlags&8772)!==0&&j!==null?(j.return=I,at=j):O4(d)}}function O4(d){for(;at!==null;){var f=at;if((f.flags&8772)!==0){var y=f.alternate;try{if((f.flags&8772)!==0)switch(f.tag){case 0:case 11:case 15:Co||nw(5,f);break;case 1:var C=f.stateNode;if(f.flags&4&&!Co)if(y===null)C.componentDidMount();else{var I=f.elementType===f.type?y.memoizedProps:Ka(f.type,y.memoizedProps);C.componentDidUpdate(I,y.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var j=f.updateQueue;j!==null&&xV(f,j,C);break;case 3:var L=f.updateQueue;if(L!==null){if(y=null,f.child!==null)switch(f.child.tag){case 5:y=f.child.stateNode;break;case 1:y=f.child.stateNode}xV(f,L,y)}break;case 5:var K=f.stateNode;if(y===null&&f.flags&4){y=K;var le=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":le.autoFocus&&y.focus();break;case"img":le.src&&(y.src=le.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var xe=f.alternate;if(xe!==null){var $e=xe.memoizedState;if($e!==null){var Ne=$e.dehydrated;Ne!==null&&Bv(Ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Co||f.flags&512&&jE(f)}catch(je){ii(f,f.return,je)}}if(f===d){at=null;break}if(y=f.sibling,y!==null){y.return=f.return,at=y;break}at=f.return}}function x4(d){for(;at!==null;){var f=at;if(f===d){at=null;break}var y=f.sibling;if(y!==null){y.return=f.return,at=y;break}at=f.return}}function w4(d){for(;at!==null;){var f=at;try{switch(f.tag){case 0:case 11:case 15:var y=f.return;try{nw(4,f)}catch(le){ii(f,y,le)}break;case 1:var C=f.stateNode;if(typeof C.componentDidMount=="function"){var I=f.return;try{C.componentDidMount()}catch(le){ii(f,I,le)}}var j=f.return;try{jE(f)}catch(le){ii(f,j,le)}break;case 5:var L=f.return;try{jE(f)}catch(le){ii(f,L,le)}}}catch(le){ii(f,f.return,le)}if(f===d){at=null;break}var K=f.sibling;if(K!==null){K.return=f.return,at=K;break}at=f.return}}var Nce=Math.ceil,iw=P.ReactCurrentDispatcher,NE=P.ReactCurrentOwner,ga=P.ReactCurrentBatchConfig,br=0,Bi=null,yi=null,oo=0,Ns=0,Fp=Xu(0),Ii=0,dy=null,Nh=0,ow=0,ME=0,hy=null,Jo=null,DE=0,Qp=1/0,Wc=null,sw=!1,LE=null,td=null,aw=!1,rd=null,lw=0,fy=0,VE=null,cw=-1,uw=0;function Do(){return(br&6)!==0?Wt():cw!==-1?cw:cw=Wt()}function nd(d){return(d.mode&1)===0?1:(br&2)!==0&&oo!==0?oo&-oo:yce.transition!==null?(uw===0&&(uw=g5()),uw):(d=Br,d!==0||(d=window.event,d=d===void 0?16:C5(d.type)),d)}function tl(d,f,y,C){if(50<fy)throw fy=0,VE=null,Error(r(185));Dv(d,y,C),((br&2)===0||d!==Bi)&&(d===Bi&&((br&2)===0&&(ow|=y),Ii===4&&id(d,oo)),es(d,C),y===1&&br===0&&(f.mode&1)===0&&(Qp=Wt()+500,Lx&&Yu()))}function es(d,f){var y=d.callbackNode;yle(d,f);var C=Al(d,d===Bi?oo:0);if(C===0)y!==null&&Cr(y),d.callbackNode=null,d.callbackPriority=0;else if(f=C&-C,d.callbackPriority!==f){if(y!=null&&Cr(y),f===1)d.tag===0?vce(C4.bind(null,d)):cV(C4.bind(null,d)),fce(function(){(br&6)===0&&Yu()}),y=null;else{switch(m5(C)){case 1:y=mi;break;case 4:y=ca;break;case 16:y=Ho;break;case 536870912:y=Is;break;default:y=Ho}y=j4(y,S4.bind(null,d))}d.callbackPriority=f,d.callbackNode=y}}function S4(d,f){if(cw=-1,uw=0,(br&6)!==0)throw Error(r(327));var y=d.callbackNode;if(Bp()&&d.callbackNode!==y)return null;var C=Al(d,d===Bi?oo:0);if(C===0)return null;if((C&30)!==0||(C&d.expiredLanes)!==0||f)f=dw(d,C);else{f=C;var I=br;br|=2;var j=P4();(Bi!==d||oo!==f)&&(Wc=null,Qp=Wt()+500,Dh(d,f));do try{Lce();break}catch(K){k4(d,K)}while(!0);nE(),iw.current=j,br=I,yi!==null?f=0:(Bi=null,oo=0,f=Ii)}if(f!==0){if(f===2&&(I=bT(d),I!==0&&(C=I,f=FE(d,I))),f===1)throw y=dy,Dh(d,0),id(d,C),es(d,Wt()),y;if(f===6)id(d,C);else{if(I=d.current.alternate,(C&30)===0&&!Mce(I)&&(f=dw(d,C),f===2&&(j=bT(d),j!==0&&(C=j,f=FE(d,j))),f===1))throw y=dy,Dh(d,0),id(d,C),es(d,Wt()),y;switch(d.finishedWork=I,d.finishedLanes=C,f){case 0:case 1:throw Error(r(345));case 2:Lh(d,Jo,Wc);break;case 3:if(id(d,C),(C&130023424)===C&&(f=DE+500-Wt(),10<f)){if(Al(d,0)!==0)break;if(I=d.suspendedLanes,(I&C)!==C){Do(),d.pingedLanes|=d.suspendedLanes&I;break}d.timeoutHandle=UT(Lh.bind(null,d,Jo,Wc),f);break}Lh(d,Jo,Wc);break;case 4:if(id(d,C),(C&4194240)===C)break;for(f=d.eventTimes,I=-1;0<C;){var L=31-Xo(C);j=1<<L,L=f[L],L>I&&(I=L),C&=~j}if(C=I,C=Wt()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*Nce(C/1960))-C,10<C){d.timeoutHandle=UT(Lh.bind(null,d,Jo,Wc),C);break}Lh(d,Jo,Wc);break;case 5:Lh(d,Jo,Wc);break;default:throw Error(r(329))}}}return es(d,Wt()),d.callbackNode===y?S4.bind(null,d):null}function FE(d,f){var y=hy;return d.current.memoizedState.isDehydrated&&(Dh(d,f).flags|=256),d=dw(d,f),d!==2&&(f=Jo,Jo=y,f!==null&&QE(f)),d}function QE(d){Jo===null?Jo=d:Jo.push.apply(Jo,d)}function Mce(d){for(var f=d;;){if(f.flags&16384){var y=f.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var C=0;C<y.length;C++){var I=y[C],j=I.getSnapshot;I=I.value;try{if(!Za(j(),I))return!1}catch{return!1}}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===d)break;for(;f.sibling===null;){if(f.return===null||f.return===d)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function id(d,f){for(f&=~ME,f&=~ow,d.suspendedLanes|=f,d.pingedLanes&=~f,d=d.expirationTimes;0<f;){var y=31-Xo(f),C=1<<y;d[y]=-1,f&=~C}}function C4(d){if((br&6)!==0)throw Error(r(327));Bp();var f=Al(d,0);if((f&1)===0)return es(d,Wt()),null;var y=dw(d,f);if(d.tag!==0&&y===2){var C=bT(d);C!==0&&(f=C,y=FE(d,C))}if(y===1)throw y=dy,Dh(d,0),id(d,f),es(d,Wt()),y;if(y===6)throw Error(r(345));return d.finishedWork=d.current.alternate,d.finishedLanes=f,Lh(d,Jo,Wc),es(d,Wt()),null}function BE(d,f){var y=br;br|=1;try{return d(f)}finally{br=y,br===0&&(Qp=Wt()+500,Lx&&Yu())}}function Mh(d){rd!==null&&rd.tag===0&&(br&6)===0&&Bp();var f=br;br|=1;var y=ga.transition,C=Br;try{if(ga.transition=null,Br=1,d)return d()}finally{Br=C,ga.transition=y,br=f,(br&6)===0&&Yu()}}function zE(){Ns=Fp.current,_n(Fp)}function Dh(d,f){d.finishedWork=null,d.finishedLanes=0;var y=d.timeoutHandle;if(y!==-1&&(d.timeoutHandle=-1,hce(y)),yi!==null)for(y=yi.return;y!==null;){var C=y;switch(KT(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&Mx();break;case 3:Dp(),_n(Zo),_n(xo),dE();break;case 5:cE(C);break;case 4:Dp();break;case 13:_n(Jn);break;case 19:_n(Jn);break;case 10:iE(C.type._context);break;case 22:case 23:zE()}y=y.return}if(Bi=d,yi=d=od(d.current,null),oo=Ns=f,Ii=0,dy=null,ME=ow=Nh=0,Jo=hy=null,jh!==null){for(f=0;f<jh.length;f++)if(y=jh[f],C=y.interleaved,C!==null){y.interleaved=null;var I=C.next,j=y.pending;if(j!==null){var L=j.next;j.next=I,C.next=L}y.pending=C}jh=null}return d}function k4(d,f){do{var y=yi;try{if(nE(),Gx.current=Kx,Xx){for(var C=ei.memoizedState;C!==null;){var I=C.queue;I!==null&&(I.pending=null),C=C.next}Xx=!1}if(Ah=0,Qi=Ri=ei=null,oy=!1,sy=0,NE.current=null,y===null||y.return===null){Ii=1,dy=f,yi=null;break}e:{var j=d,L=y.return,K=y,le=f;if(f=oo,K.flags|=32768,le!==null&&typeof le=="object"&&typeof le.then=="function"){var xe=le,$e=K,Ne=$e.tag;if(($e.mode&1)===0&&(Ne===0||Ne===11||Ne===15)){var je=$e.alternate;je?($e.updateQueue=je.updateQueue,$e.memoizedState=je.memoizedState,$e.lanes=je.lanes):($e.updateQueue=null,$e.memoizedState=null)}var nt=ZV(L);if(nt!==null){nt.flags&=-257,YV(nt,L,K,j,f),nt.mode&1&&XV(j,xe,f),f=nt,le=xe;var ct=f.updateQueue;if(ct===null){var ht=new Set;ht.add(le),f.updateQueue=ht}else ct.add(le);break e}else{if((f&1)===0){XV(j,xe,f),qE();break e}le=Error(r(426))}}else if(Ln&&K.mode&1){var ai=ZV(L);if(ai!==null){(ai.flags&65536)===0&&(ai.flags|=256),YV(ai,L,K,j,f),tE(Lp(le,K));break e}}j=le=Lp(le,K),Ii!==4&&(Ii=2),hy===null?hy=[j]:hy.push(j),j=L;do{switch(j.tag){case 3:j.flags|=65536,f&=-f,j.lanes|=f;var me=HV(j,le,f);OV(j,me);break e;case 1:K=le;var ce=j.type,ve=j.stateNode;if((j.flags&128)===0&&(typeof ce.getDerivedStateFromError=="function"||ve!==null&&typeof ve.componentDidCatch=="function"&&(td===null||!td.has(ve)))){j.flags|=65536,f&=-f,j.lanes|=f;var Fe=GV(j,K,f);OV(j,Fe);break e}}j=j.return}while(j!==null)}T4(y)}catch(pt){f=pt,yi===y&&y!==null&&(yi=y=y.return);continue}break}while(!0)}function P4(){var d=iw.current;return iw.current=Kx,d===null?Kx:d}function qE(){(Ii===0||Ii===3||Ii===2)&&(Ii=4),Bi===null||(Nh&268435455)===0&&(ow&268435455)===0||id(Bi,oo)}function dw(d,f){var y=br;br|=2;var C=P4();(Bi!==d||oo!==f)&&(Wc=null,Dh(d,f));do try{Dce();break}catch(I){k4(d,I)}while(!0);if(nE(),br=y,iw.current=C,yi!==null)throw Error(r(261));return Bi=null,oo=0,Ii}function Dce(){for(;yi!==null;)_4(yi)}function Lce(){for(;yi!==null&&!yt();)_4(yi)}function _4(d){var f=I4(d.alternate,d,Ns);d.memoizedProps=d.pendingProps,f===null?T4(d):yi=f,NE.current=null}function T4(d){var f=d;do{var y=f.alternate;if(d=f.return,(f.flags&32768)===0){if(y=Rce(y,f,Ns),y!==null){yi=y;return}}else{if(y=Ice(y,f),y!==null){y.flags&=32767,yi=y;return}if(d!==null)d.flags|=32768,d.subtreeFlags=0,d.deletions=null;else{Ii=6,yi=null;return}}if(f=f.sibling,f!==null){yi=f;return}yi=f=d}while(f!==null);Ii===0&&(Ii=5)}function Lh(d,f,y){var C=Br,I=ga.transition;try{ga.transition=null,Br=1,Vce(d,f,y,C)}finally{ga.transition=I,Br=C}return null}function Vce(d,f,y,C){do Bp();while(rd!==null);if((br&6)!==0)throw Error(r(327));y=d.finishedWork;var I=d.finishedLanes;if(y===null)return null;if(d.finishedWork=null,d.finishedLanes=0,y===d.current)throw Error(r(177));d.callbackNode=null,d.callbackPriority=0;var j=y.lanes|y.childLanes;if(ble(d,j),d===Bi&&(yi=Bi=null,oo=0),(y.subtreeFlags&2064)===0&&(y.flags&2064)===0||aw||(aw=!0,j4(Ho,function(){return Bp(),null})),j=(y.flags&15990)!==0,(y.subtreeFlags&15990)!==0||j){j=ga.transition,ga.transition=null;var L=Br;Br=1;var K=br;br|=4,NE.current=null,$ce(d,y),y4(y,d),oce(qT),wx=!!zT,qT=zT=null,d.current=y,Ace(y),Ut(),br=K,Br=L,ga.transition=j}else d.current=y;if(aw&&(aw=!1,rd=d,lw=I),j=d.pendingLanes,j===0&&(td=null),Ph(y.stateNode),es(d,Wt()),f!==null)for(C=d.onRecoverableError,y=0;y<f.length;y++)I=f[y],C(I.value,{componentStack:I.stack,digest:I.digest});if(sw)throw sw=!1,d=LE,LE=null,d;return(lw&1)!==0&&d.tag!==0&&Bp(),j=d.pendingLanes,(j&1)!==0?d===VE?fy++:(fy=0,VE=d):fy=0,Yu(),null}function Bp(){if(rd!==null){var d=m5(lw),f=ga.transition,y=Br;try{if(ga.transition=null,Br=16>d?16:d,rd===null)var C=!1;else{if(d=rd,rd=null,lw=0,(br&6)!==0)throw Error(r(331));var I=br;for(br|=4,at=d.current;at!==null;){var j=at,L=j.child;if((at.flags&16)!==0){var K=j.deletions;if(K!==null){for(var le=0;le<K.length;le++){var xe=K[le];for(at=xe;at!==null;){var $e=at;switch($e.tag){case 0:case 11:case 15:uy(8,$e,j)}var Ne=$e.child;if(Ne!==null)Ne.return=$e,at=Ne;else for(;at!==null;){$e=at;var je=$e.sibling,nt=$e.return;if(f4($e),$e===xe){at=null;break}if(je!==null){je.return=nt,at=je;break}at=nt}}}var ct=j.alternate;if(ct!==null){var ht=ct.child;if(ht!==null){ct.child=null;do{var ai=ht.sibling;ht.sibling=null,ht=ai}while(ht!==null)}}at=j}}if((j.subtreeFlags&2064)!==0&&L!==null)L.return=j,at=L;else e:for(;at!==null;){if(j=at,(j.flags&2048)!==0)switch(j.tag){case 0:case 11:case 15:uy(9,j,j.return)}var me=j.sibling;if(me!==null){me.return=j.return,at=me;break e}at=j.return}}var ce=d.current;for(at=ce;at!==null;){L=at;var ve=L.child;if((L.subtreeFlags&2064)!==0&&ve!==null)ve.return=L,at=ve;else e:for(L=ce;at!==null;){if(K=at,(K.flags&2048)!==0)try{switch(K.tag){case 0:case 11:case 15:nw(9,K)}}catch(pt){ii(K,K.return,pt)}if(K===L){at=null;break e}var Fe=K.sibling;if(Fe!==null){Fe.return=K.return,at=Fe;break e}at=K.return}}if(br=I,Yu(),vi&&typeof vi.onPostCommitFiberRoot=="function")try{vi.onPostCommitFiberRoot(ua,d)}catch{}C=!0}return C}finally{Br=y,ga.transition=f}}return!1}function E4(d,f,y){f=Lp(y,f),f=HV(d,f,1),d=Ju(d,f,1),f=Do(),d!==null&&(Dv(d,1,f),es(d,f))}function ii(d,f,y){if(d.tag===3)E4(d,d,y);else for(;f!==null;){if(f.tag===3){E4(f,d,y);break}else if(f.tag===1){var C=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(td===null||!td.has(C))){d=Lp(y,d),d=GV(f,d,1),f=Ju(f,d,1),d=Do(),f!==null&&(Dv(f,1,d),es(f,d));break}}f=f.return}}function Fce(d,f,y){var C=d.pingCache;C!==null&&C.delete(f),f=Do(),d.pingedLanes|=d.suspendedLanes&y,Bi===d&&(oo&y)===y&&(Ii===4||Ii===3&&(oo&130023424)===oo&&500>Wt()-DE?Dh(d,0):ME|=y),es(d,f)}function R4(d,f){f===0&&((d.mode&1)===0?f=1:(f=_h,_h<<=1,(_h&130023424)===0&&(_h=4194304)));var y=Do();d=Bc(d,f),d!==null&&(Dv(d,f,y),es(d,y))}function Qce(d){var f=d.memoizedState,y=0;f!==null&&(y=f.retryLane),R4(d,y)}function Bce(d,f){var y=0;switch(d.tag){case 13:var C=d.stateNode,I=d.memoizedState;I!==null&&(y=I.retryLane);break;case 19:C=d.stateNode;break;default:throw Error(r(314))}C!==null&&C.delete(f),R4(d,y)}var I4;I4=function(d,f,y){if(d!==null)if(d.memoizedProps!==f.pendingProps||Zo.current)Ko=!0;else{if((d.lanes&y)===0&&(f.flags&128)===0)return Ko=!1,Ece(d,f,y);Ko=(d.flags&131072)!==0}else Ko=!1,Ln&&(f.flags&1048576)!==0&&uV(f,Fx,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;tw(d,f),d=f.pendingProps;var I=Rp(f,xo.current);Mp(f,y),I=pE(null,f,C,d,I,y);var j=gE();return f.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Yo(C)?(j=!0,Dx(f)):j=!1,f.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,aE(f),I.updater=Jx,f.stateNode=I,I._reactInternals=f,xE(f,C,d,y),f=kE(null,f,C,!0,j,y)):(f.tag=0,Ln&&j&&YT(f),Mo(null,f,I,y),f=f.child),f;case 16:C=f.elementType;e:{switch(tw(d,f),d=f.pendingProps,I=C._init,C=I(C._payload),f.type=C,I=f.tag=qce(C),d=Ka(C,d),I){case 0:f=CE(null,f,C,d,y);break e;case 1:f=n4(null,f,C,d,y);break e;case 11:f=KV(null,f,C,d,y);break e;case 14:f=JV(null,f,C,Ka(C.type,d),y);break e}throw Error(r(306,C,""))}return f;case 0:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),CE(d,f,C,I,y);case 1:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),n4(d,f,C,I,y);case 3:e:{if(i4(f),d===null)throw Error(r(387));C=f.pendingProps,j=f.memoizedState,I=j.element,bV(d,f),Ux(f,C,null,y);var L=f.memoizedState;if(C=L.element,j.isDehydrated)if(j={element:C,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},f.updateQueue.baseState=j,f.memoizedState=j,f.flags&256){I=Lp(Error(r(423)),f),f=o4(d,f,C,y,I);break e}else if(C!==I){I=Lp(Error(r(424)),f),f=o4(d,f,C,y,I);break e}else for(As=Gu(f.stateNode.containerInfo.firstChild),$s=f,Ln=!0,Ya=null,y=vV(f,null,C,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if($p(),C===I){f=qc(d,f,y);break e}Mo(d,f,C,y)}f=f.child}return f;case 5:return wV(f),d===null&&eE(f),C=f.type,I=f.pendingProps,j=d!==null?d.memoizedProps:null,L=I.children,WT(C,I)?L=null:j!==null&&WT(C,j)&&(f.flags|=32),r4(d,f),Mo(d,f,L,y),f.child;case 6:return d===null&&eE(f),null;case 13:return s4(d,f,y);case 4:return lE(f,f.stateNode.containerInfo),C=f.pendingProps,d===null?f.child=Ap(f,null,C,y):Mo(d,f,C,y),f.child;case 11:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),KV(d,f,C,I,y);case 7:return Mo(d,f,f.pendingProps,y),f.child;case 8:return Mo(d,f,f.pendingProps.children,y),f.child;case 12:return Mo(d,f,f.pendingProps.children,y),f.child;case 10:e:{if(C=f.type._context,I=f.pendingProps,j=f.memoizedProps,L=I.value,cn(zx,C._currentValue),C._currentValue=L,j!==null)if(Za(j.value,L)){if(j.children===I.children&&!Zo.current){f=qc(d,f,y);break e}}else for(j=f.child,j!==null&&(j.return=f);j!==null;){var K=j.dependencies;if(K!==null){L=j.child;for(var le=K.firstContext;le!==null;){if(le.context===C){if(j.tag===1){le=zc(-1,y&-y),le.tag=2;var xe=j.updateQueue;if(xe!==null){xe=xe.shared;var $e=xe.pending;$e===null?le.next=le:(le.next=$e.next,$e.next=le),xe.pending=le}}j.lanes|=y,le=j.alternate,le!==null&&(le.lanes|=y),oE(j.return,y,f),K.lanes|=y;break}le=le.next}}else if(j.tag===10)L=j.type===f.type?null:j.child;else if(j.tag===18){if(L=j.return,L===null)throw Error(r(341));L.lanes|=y,K=L.alternate,K!==null&&(K.lanes|=y),oE(L,y,f),L=j.sibling}else L=j.child;if(L!==null)L.return=j;else for(L=j;L!==null;){if(L===f){L=null;break}if(j=L.sibling,j!==null){j.return=L.return,L=j;break}L=L.return}j=L}Mo(d,f,I.children,y),f=f.child}return f;case 9:return I=f.type,C=f.pendingProps.children,Mp(f,y),I=fa(I),C=C(I),f.flags|=1,Mo(d,f,C,y),f.child;case 14:return C=f.type,I=Ka(C,f.pendingProps),I=Ka(C.type,I),JV(d,f,C,I,y);case 15:return e4(d,f,f.type,f.pendingProps,y);case 17:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),tw(d,f),f.tag=1,Yo(C)?(d=!0,Dx(f)):d=!1,Mp(f,y),WV(f,C,I),xE(f,C,I,y),kE(null,f,C,!0,d,y);case 19:return l4(d,f,y);case 22:return t4(d,f,y)}throw Error(r(156,f.tag))};function j4(d,f){return kt(d,f)}function zce(d,f,y,C){this.tag=d,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ma(d,f,y,C){return new zce(d,f,y,C)}function WE(d){return d=d.prototype,!(!d||!d.isReactComponent)}function qce(d){if(typeof d=="function")return WE(d)?1:0;if(d!=null){if(d=d.$$typeof,d===V)return 11;if(d===B)return 14}return 2}function od(d,f){var y=d.alternate;return y===null?(y=ma(d.tag,f,d.key,d.mode),y.elementType=d.elementType,y.type=d.type,y.stateNode=d.stateNode,y.alternate=d,d.alternate=y):(y.pendingProps=f,y.type=d.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=d.flags&14680064,y.childLanes=d.childLanes,y.lanes=d.lanes,y.child=d.child,y.memoizedProps=d.memoizedProps,y.memoizedState=d.memoizedState,y.updateQueue=d.updateQueue,f=d.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=d.sibling,y.index=d.index,y.ref=d.ref,y}function hw(d,f,y,C,I,j){var L=2;if(C=d,typeof d=="function")WE(d)&&(L=1);else if(typeof d=="string")L=5;else e:switch(d){case R:return Vh(y.children,I,j,f);case $:L=8,I|=8;break;case A:return d=ma(12,y,f,I|2),d.elementType=A,d.lanes=j,d;case q:return d=ma(13,y,f,I),d.elementType=q,d.lanes=j,d;case N:return d=ma(19,y,f,I),d.elementType=N,d.lanes=j,d;case he:return fw(y,I,j,f);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case M:L=10;break e;case Q:L=9;break e;case V:L=11;break e;case B:L=14;break e;case re:L=16,C=null;break e}throw Error(r(130,d==null?d:typeof d,""))}return f=ma(L,y,f,I),f.elementType=d,f.type=C,f.lanes=j,f}function Vh(d,f,y,C){return d=ma(7,d,C,f),d.lanes=y,d}function fw(d,f,y,C){return d=ma(22,d,C,f),d.elementType=he,d.lanes=y,d.stateNode={isHidden:!1},d}function UE(d,f,y){return d=ma(6,d,null,f),d.lanes=y,d}function HE(d,f,y){return f=ma(4,d.children!==null?d.children:[],d.key,f),f.lanes=y,f.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},f}function Wce(d,f,y,C,I){this.tag=f,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=OT(0),this.expirationTimes=OT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=OT(0),this.identifierPrefix=C,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function GE(d,f,y,C,I,j,L,K,le){return d=new Wce(d,f,y,K,le),f===1?(f=1,j===!0&&(f|=8)):f=0,j=ma(3,null,null,f),d.current=j,j.stateNode=d,j.memoizedState={element:C,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},aE(j),d}function Uce(d,f,y){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:C==null?null:""+C,children:d,containerInfo:f,implementation:y}}function $4(d){if(!d)return Zu;d=d._reactInternals;e:{if(Tt(d)!==d||d.tag!==1)throw Error(r(170));var f=d;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Yo(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(r(171))}if(d.tag===1){var y=d.type;if(Yo(y))return aV(d,y,f)}return f}function A4(d,f,y,C,I,j,L,K,le){return d=GE(y,C,!0,d,I,j,L,K,le),d.context=$4(null),y=d.current,C=Do(),I=nd(y),j=zc(C,I),j.callback=f??null,Ju(y,j,I),d.current.lanes=I,Dv(d,I,C),es(d,C),d}function pw(d,f,y,C){var I=f.current,j=Do(),L=nd(I);return y=$4(y),f.context===null?f.context=y:f.pendingContext=y,f=zc(j,L),f.payload={element:d},C=C===void 0?null:C,C!==null&&(f.callback=C),d=Ju(I,f,L),d!==null&&(tl(d,I,L,j),Wx(d,I,L)),L}function gw(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return d.child.stateNode;default:return d.child.stateNode}}function N4(d,f){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var y=d.retryLane;d.retryLane=y!==0&&y<f?y:f}}function XE(d,f){N4(d,f),(d=d.alternate)&&N4(d,f)}function Hce(){return null}var M4=typeof reportError=="function"?reportError:function(d){console.error(d)};function ZE(d){this._internalRoot=d}mw.prototype.render=ZE.prototype.render=function(d){var f=this._internalRoot;if(f===null)throw Error(r(409));pw(d,f,null,null)},mw.prototype.unmount=ZE.prototype.unmount=function(){var d=this._internalRoot;if(d!==null){this._internalRoot=null;var f=d.containerInfo;Mh(function(){pw(null,d,null,null)}),f[Lc]=null}};function mw(d){this._internalRoot=d}mw.prototype.unstable_scheduleHydration=function(d){if(d){var f=b5();d={blockedOn:null,target:d,priority:f};for(var y=0;y<Wu.length&&f!==0&&f<Wu[y].priority;y++);Wu.splice(y,0,d),y===0&&w5(d)}};function YE(d){return!(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)}function vw(d){return!(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11&&(d.nodeType!==8||d.nodeValue!==" react-mount-point-unstable "))}function D4(){}function Gce(d,f,y,C,I){if(I){if(typeof C=="function"){var j=C;C=function(){var xe=gw(L);j.call(xe)}}var L=A4(f,C,d,0,null,!1,!1,"",D4);return d._reactRootContainer=L,d[Lc]=L.current,Yv(d.nodeType===8?d.parentNode:d),Mh(),L}for(;I=d.lastChild;)d.removeChild(I);if(typeof C=="function"){var K=C;C=function(){var xe=gw(le);K.call(xe)}}var le=GE(d,0,!1,null,null,!1,!1,"",D4);return d._reactRootContainer=le,d[Lc]=le.current,Yv(d.nodeType===8?d.parentNode:d),Mh(function(){pw(f,le,y,C)}),le}function yw(d,f,y,C,I){var j=y._reactRootContainer;if(j){var L=j;if(typeof I=="function"){var K=I;I=function(){var le=gw(L);K.call(le)}}pw(f,L,d,I)}else L=Gce(y,f,d,I,C);return gw(L)}v5=function(d){switch(d.tag){case 3:var f=d.stateNode;if(f.current.memoizedState.isDehydrated){var y=Qu(f.pendingLanes);y!==0&&(xT(f,y|1),es(f,Wt()),(br&6)===0&&(Qp=Wt()+500,Yu()))}break;case 13:Mh(function(){var C=Bc(d,1);if(C!==null){var I=Do();tl(C,d,1,I)}}),XE(d,1)}},wT=function(d){if(d.tag===13){var f=Bc(d,134217728);if(f!==null){var y=Do();tl(f,d,134217728,y)}XE(d,134217728)}},y5=function(d){if(d.tag===13){var f=nd(d),y=Bc(d,f);if(y!==null){var C=Do();tl(y,d,f,C)}XE(d,f)}},b5=function(){return Br},O5=function(d,f){var y=Br;try{return Br=d,f()}finally{Br=y}},Ch=function(d,f,y){switch(f){case"input":if(Gt(d,y),f=y.name,y.type==="radio"&&f!=null){for(y=d;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<y.length;f++){var C=y[f];if(C!==d&&C.form===d.form){var I=Nx(C);if(!I)throw Error(r(90));oe(C),Gt(C,I)}}}break;case"textarea":Ti(d,y);break;case"select":f=y.value,f!=null&&ur(d,!!y.multiple,f,!1)}},be=BE,Ce=Mh;var Xce={usingClientEntryPoint:!1,Events:[ey,Tp,Nx,Xa,fe,BE]},py={findFiberByHostInstance:Th,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zce={bundleType:py.bundleType,version:py.version,rendererPackageName:py.rendererPackageName,rendererConfig:py.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(d){return d=Yt(d),d===null?null:d.stateNode},findFiberByHostInstance:py.findFiberByHostInstance||Hce,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 bw=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bw.isDisabled&&bw.supportsFiber)try{ua=bw.inject(Zce),vi=bw}catch{}}return ts.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xce,ts.createPortal=function(d,f){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!YE(f))throw Error(r(200));return Uce(d,f,null,y)},ts.createRoot=function(d,f){if(!YE(d))throw Error(r(299));var y=!1,C="",I=M4;return f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),f=GE(d,1,!1,null,null,y,!1,C,I),d[Lc]=f.current,Yv(d.nodeType===8?d.parentNode:d),new ZE(f)},ts.findDOMNode=function(d){if(d==null)return null;if(d.nodeType===1)return d;var f=d._reactInternals;if(f===void 0)throw typeof d.render=="function"?Error(r(188)):(d=Object.keys(d).join(","),Error(r(268,d)));return d=Yt(f),d=d===null?null:d.stateNode,d},ts.flushSync=function(d){return Mh(d)},ts.hydrate=function(d,f,y){if(!vw(f))throw Error(r(200));return yw(null,d,f,!0,y)},ts.hydrateRoot=function(d,f,y){if(!YE(d))throw Error(r(405));var C=y!=null&&y.hydratedSources||null,I=!1,j="",L=M4;if(y!=null&&(y.unstable_strictMode===!0&&(I=!0),y.identifierPrefix!==void 0&&(j=y.identifierPrefix),y.onRecoverableError!==void 0&&(L=y.onRecoverableError)),f=A4(f,null,d,1,y??null,I,!1,j,L),d[Lc]=f.current,Yv(d),C)for(d=0;d<C.length;d++)y=C[d],I=y._getVersion,I=I(y._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[y,I]:f.mutableSourceEagerHydrationData.push(y,I);return new mw(f)},ts.render=function(d,f,y){if(!vw(f))throw Error(r(200));return yw(null,d,f,!1,y)},ts.unmountComponentAtNode=function(d){if(!vw(d))throw Error(r(40));return d._reactRootContainer?(Mh(function(){yw(null,null,d,!1,function(){d._reactRootContainer=null,d[Lc]=null})}),!0):!1},ts.unstable_batchedUpdates=BE,ts.unstable_renderSubtreeIntoContainer=function(d,f,y,C){if(!vw(y))throw Error(r(200));if(d==null||d._reactInternals===void 0)throw Error(r(38));return yw(d,f,y,!1,C)},ts.version="18.3.1-next-f1338f8080-20240426",ts}var U4;function k9(){if(U4)return eR.exports;U4=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),eR.exports=iue(),eR.exports}var H4;function oue(){if(H4)return Ow;H4=1;var t=k9();return Ow.createRoot=t.createRoot,Ow.hydrateRoot=t.hydrateRoot,Ow}var sue=oue();const aue={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"dc294e7",MODE:"production",PACKAGE_VERSION:"2.1.0-alpha.6",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},Vg=t=>{const e=aue[t];return window.__env__?.[t]||e};function P9(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var lue=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,cue=P9(function(t){return lue.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function uue(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function due(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var hue=function(){function t(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(due(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=uue(i);try{o.insertRule(n,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){var i;return(i=n.parentNode)==null?void 0:i.removeChild(n)}),this.tags=[],this.ctr=0},t}(),ko="-ms-",PC="-moz-",Er="-webkit-",_9="comm",fN="rule",pN="decl",fue="@import",T9="@keyframes",pue="@layer",gue=Math.abs,vP=String.fromCharCode,mue=Object.assign;function vue(t,e){return fo(t,0)^45?(((e<<2^fo(t,0))<<2^fo(t,1))<<2^fo(t,2))<<2^fo(t,3):0}function E9(t){return t.trim()}function yue(t,e){return(t=e.exec(t))?t[0]:t}function Rr(t,e,r){return t.replace(e,r)}function Wj(t,e){return t.indexOf(e)}function fo(t,e){return t.charCodeAt(e)|0}function eb(t,e,r){return t.slice(e,r)}function Gl(t){return t.length}function gN(t){return t.length}function xw(t,e){return e.push(t),t}function bue(t,e){return t.map(e).join("")}var yP=1,am=1,R9=0,Os=0,Ci=0,zm="";function bP(t,e,r,n,i,o,s){return{value:t,root:e,parent:r,type:n,props:i,children:o,line:yP,column:am,length:s,return:""}}function my(t,e){return mue(bP("",null,null,"",null,null,0),t,{length:-t.length},e)}function Oue(){return Ci}function xue(){return Ci=Os>0?fo(zm,--Os):0,am--,Ci===10&&(am=1,yP--),Ci}function Ys(){return Ci=Os<R9?fo(zm,Os++):0,am++,Ci===10&&(am=1,yP++),Ci}function lc(){return fo(zm,Os)}function IS(){return Os}function xO(t,e){return eb(zm,t,e)}function tb(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function I9(t){return yP=am=1,R9=Gl(zm=t),Os=0,[]}function j9(t){return zm="",t}function jS(t){return E9(xO(Os-1,Uj(t===91?t+2:t===40?t+1:t)))}function wue(t){for(;(Ci=lc())&&Ci<33;)Ys();return tb(t)>2||tb(Ci)>3?"":" "}function Sue(t,e){for(;--e&&Ys()&&!(Ci<48||Ci>102||Ci>57&&Ci<65||Ci>70&&Ci<97););return xO(t,IS()+(e<6&&lc()==32&&Ys()==32))}function Uj(t){for(;Ys();)switch(Ci){case t:return Os;case 34:case 39:t!==34&&t!==39&&Uj(Ci);break;case 40:t===41&&Uj(t);break;case 92:Ys();break}return Os}function Cue(t,e){for(;Ys()&&t+Ci!==57;)if(t+Ci===84&&lc()===47)break;return"/*"+xO(e,Os-1)+"*"+vP(t===47?t:Ys())}function kue(t){for(;!tb(lc());)Ys();return xO(t,Os)}function Pue(t){return j9($S("",null,null,null,[""],t=I9(t),0,[0],t))}function $S(t,e,r,n,i,o,s,a,l){for(var c=0,u=0,p=s,m=0,v=0,b=0,O=1,x=1,S=1,w=0,k="",P=i,_=o,T=n,R=k;x;)switch(b=w,w=Ys()){case 40:if(b!=108&&fo(R,p-1)==58){Wj(R+=Rr(jS(w),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:R+=jS(w);break;case 9:case 10:case 13:case 32:R+=wue(b);break;case 92:R+=Sue(IS()-1,7);continue;case 47:switch(lc()){case 42:case 47:xw(_ue(Cue(Ys(),IS()),e,r),l);break;default:R+="/"}break;case 123*O:a[c++]=Gl(R)*S;case 125*O:case 59:case 0:switch(w){case 0:case 125:x=0;case 59+u:S==-1&&(R=Rr(R,/\f/g,"")),v>0&&Gl(R)-p&&xw(v>32?X4(R+";",n,r,p-1):X4(Rr(R," ","")+";",n,r,p-2),l);break;case 59:R+=";";default:if(xw(T=G4(R,e,r,c,u,i,a,k,P=[],_=[],p),o),w===123)if(u===0)$S(R,e,T,T,P,o,p,a,_);else switch(m===99&&fo(R,3)===110?100:m){case 100:case 108:case 109:case 115:$S(t,T,T,n&&xw(G4(t,T,T,0,0,i,a,k,i,P=[],p),_),i,_,p,a,n?P:_);break;default:$S(R,T,T,T,[""],_,0,a,_)}}c=u=v=0,O=S=1,k=R="",p=s;break;case 58:p=1+Gl(R),v=b;default:if(O<1){if(w==123)--O;else if(w==125&&O++==0&&xue()==125)continue}switch(R+=vP(w),w*O){case 38:S=u>0?1:(R+="\f",-1);break;case 44:a[c++]=(Gl(R)-1)*S,S=1;break;case 64:lc()===45&&(R+=jS(Ys())),m=lc(),u=p=Gl(k=R+=kue(IS())),w++;break;case 45:b===45&&Gl(R)==2&&(O=0)}}return o}function G4(t,e,r,n,i,o,s,a,l,c,u){for(var p=i-1,m=i===0?o:[""],v=gN(m),b=0,O=0,x=0;b<n;++b)for(var S=0,w=eb(t,p+1,p=gue(O=s[b])),k=t;S<v;++S)(k=E9(O>0?m[S]+" "+w:Rr(w,/&\f/g,m[S])))&&(l[x++]=k);return bP(t,e,r,i===0?fN:a,l,c,u)}function _ue(t,e,r){return bP(t,e,r,_9,vP(Oue()),eb(t,2,-2),0)}function X4(t,e,r,n){return bP(t,e,r,pN,eb(t,0,n),eb(t,n+1,-1),n)}function Fg(t,e){for(var r="",n=gN(t),i=0;i<n;i++)r+=e(t[i],i,t,e)||"";return r}function Tue(t,e,r,n){switch(t.type){case pue:if(t.children.length)break;case fue:case pN:return t.return=t.return||t.value;case _9:return"";case T9:return t.return=t.value+"{"+Fg(t.children,n)+"}";case fN:t.value=t.props.join(",")}return Gl(r=Fg(t.children,n))?t.return=t.value+"{"+r+"}":""}function Eue(t){var e=gN(t);return function(r,n,i,o){for(var s="",a=0;a<e;a++)s+=t[a](r,n,i,o)||"";return s}}function Rue(t){return function(e){e.root||(e=e.return)&&t(e)}}var Iue=function(e,r,n){for(var i=0,o=0;i=o,o=lc(),i===38&&o===12&&(r[n]=1),!tb(o);)Ys();return xO(e,Os)},jue=function(e,r){var n=-1,i=44;do switch(tb(i)){case 0:i===38&&lc()===12&&(r[n]=1),e[n]+=Iue(Os-1,r,n);break;case 2:e[n]+=jS(i);break;case 4:if(i===44){e[++n]=lc()===58?"&\f":"",r[n]=e[n].length;break}default:e[n]+=vP(i)}while(i=Ys());return e},$ue=function(e,r){return j9(jue(I9(e),r))},Z4=new WeakMap,Aue=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var r=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&r.charCodeAt(0)!==58&&!Z4.get(n))&&!i){Z4.set(e,!0);for(var o=[],s=$ue(r,o),a=n.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},Nue=function(e){if(e.type==="decl"){var r=e.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(e.return="",e.value="")}};function $9(t,e){switch(vue(t,e)){case 5103:return Er+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Er+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Er+t+PC+t+ko+t+t;case 6828:case 4268:return Er+t+ko+t+t;case 6165:return Er+t+ko+"flex-"+t+t;case 5187:return Er+t+Rr(t,/(\w+).+(:[^]+)/,Er+"box-$1$2"+ko+"flex-$1$2")+t;case 5443:return Er+t+ko+"flex-item-"+Rr(t,/flex-|-self/,"")+t;case 4675:return Er+t+ko+"flex-line-pack"+Rr(t,/align-content|flex-|-self/,"")+t;case 5548:return Er+t+ko+Rr(t,"shrink","negative")+t;case 5292:return Er+t+ko+Rr(t,"basis","preferred-size")+t;case 6060:return Er+"box-"+Rr(t,"-grow","")+Er+t+ko+Rr(t,"grow","positive")+t;case 4554:return Er+Rr(t,/([^-])(transform)/g,"$1"+Er+"$2")+t;case 6187:return Rr(Rr(Rr(t,/(zoom-|grab)/,Er+"$1"),/(image-set)/,Er+"$1"),t,"")+t;case 5495:case 3959:return Rr(t,/(image-set\([^]*)/,Er+"$1$`$1");case 4968:return Rr(Rr(t,/(.+:)(flex-)?(.*)/,Er+"box-pack:$3"+ko+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Er+t+t;case 4095:case 3583:case 4068:case 2532:return Rr(t,/(.+)-inline(.+)/,Er+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Gl(t)-1-e>6)switch(fo(t,e+1)){case 109:if(fo(t,e+4)!==45)break;case 102:return Rr(t,/(.+:)(.+)-([^]+)/,"$1"+Er+"$2-$3$1"+PC+(fo(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Wj(t,"stretch")?$9(Rr(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(fo(t,e+1)!==115)break;case 6444:switch(fo(t,Gl(t)-3-(~Wj(t,"!important")&&10))){case 107:return Rr(t,":",":"+Er)+t;case 101:return Rr(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Er+(fo(t,14)===45?"inline-":"")+"box$3$1"+Er+"$2$3$1"+ko+"$2box$3")+t}break;case 5936:switch(fo(t,e+11)){case 114:return Er+t+ko+Rr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Er+t+ko+Rr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Er+t+ko+Rr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Er+t+ko+t+t}return t}var Mue=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case pN:e.return=$9(e.value,e.length);break;case T9:return Fg([my(e,{value:Rr(e.value,"@","@"+Er)})],i);case fN:if(e.length)return bue(e.props,function(o){switch(yue(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Fg([my(e,{props:[Rr(o,/:(read-\w+)/,":"+PC+"$1")]})],i);case"::placeholder":return Fg([my(e,{props:[Rr(o,/:(plac\w+)/,":"+Er+"input-$1")]}),my(e,{props:[Rr(o,/:(plac\w+)/,":"+PC+"$1")]}),my(e,{props:[Rr(o,/:(plac\w+)/,ko+"input-$1")]})],i)}return""})}},Due=[Mue],Lue=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(O){var x=O.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(O),O.setAttribute("data-s",""))})}var i=e.stylisPlugins||Due,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(O){for(var x=O.getAttribute("data-emotion").split(" "),S=1;S<x.length;S++)o[x[S]]=!0;a.push(O)});var l,c=[Aue,Nue];{var u,p=[Tue,Rue(function(O){u.insert(O)})],m=Eue(c.concat(i,p)),v=function(x){return Fg(Pue(x),m)};l=function(x,S,w,k){u=w,v(x?x+"{"+S.styles+"}":S.styles),k&&(b.inserted[S.name]=!0)}}var b={key:r,sheet:new hue({key:r,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return b.sheet.hydrate(a),b};function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},$t.apply(null,arguments)}var nR={exports:{}},Nr={};var Y4;function Vue(){if(Y4)return Nr;Y4=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,p=t?Symbol.for("react.suspense"):60113,m=t?Symbol.for("react.suspense_list"):60120,v=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,O=t?Symbol.for("react.block"):60121,x=t?Symbol.for("react.fundamental"):60117,S=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function k(_){if(typeof _=="object"&&_!==null){var T=_.$$typeof;switch(T){case e:switch(_=_.type,_){case l:case c:case n:case o:case i:case p:return _;default:switch(_=_&&_.$$typeof,_){case a:case u:case b:case v:case s:return _;default:return T}}case r:return T}}}function P(_){return k(_)===c}return Nr.AsyncMode=l,Nr.ConcurrentMode=c,Nr.ContextConsumer=a,Nr.ContextProvider=s,Nr.Element=e,Nr.ForwardRef=u,Nr.Fragment=n,Nr.Lazy=b,Nr.Memo=v,Nr.Portal=r,Nr.Profiler=o,Nr.StrictMode=i,Nr.Suspense=p,Nr.isAsyncMode=function(_){return P(_)||k(_)===l},Nr.isConcurrentMode=P,Nr.isContextConsumer=function(_){return k(_)===a},Nr.isContextProvider=function(_){return k(_)===s},Nr.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===e},Nr.isForwardRef=function(_){return k(_)===u},Nr.isFragment=function(_){return k(_)===n},Nr.isLazy=function(_){return k(_)===b},Nr.isMemo=function(_){return k(_)===v},Nr.isPortal=function(_){return k(_)===r},Nr.isProfiler=function(_){return k(_)===o},Nr.isStrictMode=function(_){return k(_)===i},Nr.isSuspense=function(_){return k(_)===p},Nr.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===n||_===c||_===o||_===i||_===p||_===m||typeof _=="object"&&_!==null&&(_.$$typeof===b||_.$$typeof===v||_.$$typeof===s||_.$$typeof===a||_.$$typeof===u||_.$$typeof===x||_.$$typeof===S||_.$$typeof===w||_.$$typeof===O)},Nr.typeOf=k,Nr}var K4;function Fue(){return K4||(K4=1,nR.exports=Vue()),nR.exports}var iR,J4;function Que(){if(J4)return iR;J4=1;var t=Fue(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[t.ForwardRef]=n,o[t.Memo]=i;function s(b){return t.isMemo(b)?i:o[b.$$typeof]||e}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function v(b,O,x){if(typeof O!="string"){if(m){var S=p(O);S&&S!==m&&v(b,S,x)}var w=l(O);c&&(w=w.concat(c(O)));for(var k=s(b),P=s(O),_=0;_<w.length;++_){var T=w[_];if(!r[T]&&!(x&&x[T])&&!(P&&P[T])&&!(k&&k[T])){var R=u(O,T);try{a(b,T,R)}catch{}}}}return b}return iR=v,iR}Que();var Bue=!0;function A9(t,e,r){var n="";return r.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(n+=i+" ")}),n}var mN=function(e,r,n){var i=e.key+"-"+r.name;(n===!1||Bue===!1)&&e.registered[i]===void 0&&(e.registered[i]=r.styles)},vN=function(e,r,n){mN(e,r,n);var i=e.key+"-"+r.name;if(e.inserted[r.name]===void 0){var o=r;do e.insert(r===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function zue(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var que={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Wue=/[A-Z]|^ms/g,Uue=/_EMO_([^_]+?)_([^]*?)_EMO_/g,N9=function(e){return e.charCodeAt(1)===45},eF=function(e){return e!=null&&typeof e!="boolean"},oR=P9(function(t){return N9(t)?t:t.replace(Wue,"-$&").toLowerCase()}),tF=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(Uue,function(n,i,o){return Xl={name:i,styles:o,next:Xl},i})}return que[e]!==1&&!N9(e)&&typeof r=="number"&&r!==0?r+"px":r};function rb(t,e,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return Xl={name:i.name,styles:i.styles,next:Xl},i.name;var o=r;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Xl={name:s.name,styles:s.styles,next:Xl},s=s.next;var a=o.styles+";";return a}return Hue(t,e,r)}case"function":{if(t!==void 0){var l=Xl,c=r(t);return Xl=l,rb(t,e,c)}break}}var u=r;if(e==null)return u;var p=e[u];return p!==void 0?p:u}function Hue(t,e,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=rb(t,e,r[i])+";";else for(var o in r){var s=r[o];if(typeof s!="object"){var a=s;e!=null&&e[a]!==void 0?n+=o+"{"+e[a]+"}":eF(a)&&(n+=oR(o)+":"+tF(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var l=0;l<s.length;l++)eF(s[l])&&(n+=oR(o)+":"+tF(o,s[l])+";");else{var c=rb(t,e,s);switch(o){case"animation":case"animationName":{n+=oR(o)+":"+c+";";break}default:n+=o+"{"+c+"}"}}}return n}var rF=/label:\s*([^\s;{]+)\s*(;|$)/g,Xl;function yN(t,e,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var n=!0,i="";Xl=void 0;var o=t[0];if(o==null||o.raw===void 0)n=!1,i+=rb(r,e,o);else{var s=o;i+=s[0]}for(var a=1;a<t.length;a++)if(i+=rb(r,e,t[a]),n){var l=o;i+=l[a]}rF.lastIndex=0;for(var c="",u;(u=rF.exec(i))!==null;)c+="-"+u[1];var p=zue(i)+c;return{name:p,styles:i,next:Xl}}var Gue=function(e){return e()},M9=qj.useInsertionEffect?qj.useInsertionEffect:!1,D9=M9||Gue,nF=M9||E.useLayoutEffect,L9=E.createContext(typeof HTMLElement<"u"?Lue({key:"css"}):null);L9.Provider;var bN=function(e){return E.forwardRef(function(r,n){var i=E.useContext(L9);return e(r,i,n)})},ON=E.createContext({}),xN={}.hasOwnProperty,Hj="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Xue=function(e,r){var n={};for(var i in r)xN.call(r,i)&&(n[i]=r[i]);return n[Hj]=e,n},Zue=function(e){var r=e.cache,n=e.serialized,i=e.isStringTag;return mN(r,n,i),D9(function(){return vN(r,n,i)}),null},Yue=bN(function(t,e,r){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var i=t[Hj],o=[n],s="";typeof t.className=="string"?s=A9(e.registered,o,t.className):t.className!=null&&(s=t.className+" ");var a=yN(o,void 0,E.useContext(ON));s+=e.key+"-"+a.name;var l={};for(var c in t)xN.call(t,c)&&c!=="css"&&c!==Hj&&(l[c]=t[c]);return l.className=s,r&&(l.ref=r),E.createElement(E.Fragment,null,E.createElement(Zue,{cache:e,serialized:a,isStringTag:typeof i=="string"}),E.createElement(i,l))}),Kue=Yue,iF=function(e,r){var n=arguments;if(r==null||!xN.call(r,"css"))return E.createElement.apply(void 0,n);var i=n.length,o=new Array(i);o[0]=Kue,o[1]=Xue(e,r);for(var s=2;s<i;s++)o[s]=n[s];return E.createElement.apply(null,o)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(iF||(iF={}));var oF=bN(function(t,e){var r=t.styles,n=yN([r],void 0,E.useContext(ON)),i=E.useRef();return nF(function(){var o=e.key+"-global",s=new e.sheet.constructor({key:o,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),a=!1,l=document.querySelector('style[data-emotion="'+o+" "+n.name+'"]');return e.sheet.tags.length&&(s.before=e.sheet.tags[0]),l!==null&&(a=!0,l.setAttribute("data-emotion",o),s.hydrate([l])),i.current=[s,a],function(){s.flush()}},[e]),nF(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(n.next!==void 0&&vN(e,n.next,!0),s.tags.length){var l=s.tags[s.tags.length-1].nextElementSibling;s.before=l,s.flush()}e.insert("",n,s,!1)},[e,n.name]),null});function Jue(...t){return function(...r){t.forEach(n=>n?.(...r))}}const ede=(...t)=>t.map(e=>e?.trim?.()).filter(Boolean).join(" "),tde=/^on[A-Z]/;function nb(...t){let e={};for(let r of t){for(let n in e){if(tde.test(n)&&typeof e[n]=="function"&&typeof r[n]=="function"){e[n]=Jue(e[n],r[n]);continue}if(n==="className"||n==="class"){e[n]=ede(e[n],r[n]);continue}if(n==="style"){e[n]=Object.assign({},e[n]??{},r[n]??{});continue}e[n]=r[n]!==void 0?r[n]:e[n]}for(let n in r)e[n]===void 0&&(e[n]=r[n])}return e}function sF(t,e){if(t!=null){if(typeof t=="function")return t(e);try{t.current=e}catch{throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}}}function rde(...t){const e=t.filter(n=>n!=null),r=new Map;return n=>(e.forEach(i=>{const o=sF(i,n);o&&r.set(i,o)}),()=>{e.forEach(i=>{const o=r.get(i);o&&typeof o=="function"?o():sF(i,null)}),r.clear()})}function wO(t){const e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}const Io=(...t)=>t.filter(Boolean).map(e=>e.trim()).join(" ");function nde(t){return t.default||t}const ds=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),Aa=t=>typeof t=="string",wN=t=>typeof t=="function";function ide(t){const e=E.version;return!Aa(e)||e.startsWith("18.")?t?.ref:t?.props?.ref}const SN=(...t)=>{const e=t.reduce((r,n)=>(n?.forEach(i=>r.add(i)),r),new Set([]));return Array.from(e)};function ode(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function Qg(t={}){const{name:e,strict:r=!0,hookName:n="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=t,a=E.createContext(s);a.displayName=e;function l(){const c=E.useContext(a);if(!c&&r){const u=new Error(o??ode(n,i));throw u.name="ContextError",Error.captureStackTrace?.(u,l),u}return c}return[a.Provider,l,a]}const[sde,OP]=Qg({name:"ChakraContext",strict:!0,providerName:"<ChakraProvider />"});function aF(t){const{value:e,children:r}=t;return h.jsxs(sde,{value:e,children:[!e._config.disableLayers&&h.jsx(oF,{styles:e.layers.atRule}),h.jsx(oF,{styles:e._global}),r]})}const ade=(t,e)=>{const r={},n={},i=Object.keys(t);for(const o of i)e(o)?n[o]=t[o]:r[o]=t[o];return[n,r]},Bg=(t,e)=>{const r=wN(e)?e:n=>e.includes(n);return ade(t,r)},lde=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function cde(t){return typeof t=="string"&&lde.has(t)}function ude(t,e,r){const{css:n,isValidProperty:i}=OP(),{children:o,...s}=t,a=E.useMemo(()=>{const[m,v]=Bg(s,w=>r(w,e.variantKeys)),[b,O]=Bg(v,e.variantKeys),[x,S]=Bg(O,i);return{forwardedProps:m,variantProps:b,styleProps:x,elementProps:S}},[e.variantKeys,r,s,i]),{css:l,...c}=a.styleProps,u=E.useMemo(()=>{const m={...a.variantProps};return e.variantKeys.includes("colorPalette")||(m.colorPalette=s.colorPalette),e.variantKeys.includes("orientation")||(m.orientation=s.orientation),e(m)},[e,a.variantProps,s.colorPalette,s.orientation]);return{styles:E.useMemo(()=>n(u,...dde(l),c),[n,u,l,c]),props:{...a.forwardedProps,...a.elementProps,children:o}}}const dde=t=>(Array.isArray(t)?t:[t]).filter(Boolean).flat(),hde=nde(cue),fde=hde,pde=t=>t!=="theme",gde=(t,e,r)=>{let n;if(e){const i=e.shouldForwardProp;n=t.__emotion_forwardProp&&i?o=>t.__emotion_forwardProp(o)&&i(o):i}return typeof n!="function"&&r&&(n=t.__emotion_forwardProp),n};let mde=typeof document<"u";const lF=({cache:t,serialized:e,isStringTag:r})=>{mN(t,e,r);const n=D9(()=>vN(t,e,r));if(!mde&&n!==void 0){let i=e.name,o=e.next;for(;o!==void 0;)i=Io(i,o.name),o=o.next;return h.jsx("style",{"data-emotion":Io(t.key,i),dangerouslySetInnerHTML:{__html:n},nonce:t.sheet.nonce})}return null},cF={path:["d"],text:["x","y"],circle:["cx","cy","r"],rect:["width","height","x","y","rx","ry"],ellipse:["cx","cy","rx","ry"],g:["transform"],stop:["offset","stopOpacity"]},vde=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),yde=(t,e={},r={})=>{if(vde(cF,t)){r.forwardProps||(r.forwardProps=[]);const c=cF[t];r.forwardProps=SN([...r.forwardProps,...c])}const n=t.__emotion_real===t,i=n&&t.__emotion_base||t;let o,s;r!==void 0&&(o=r.label,s=r.target);let a=[];const l=bN((c,u,p)=>{const{cva:m,isValidProperty:v}=OP(),b=e.__cva__?e:m(e),O=Ode(t.__emotion_cva,b),x=B=>(re,he)=>B.includes(re)?!0:!he?.includes(re)&&!v(re);!r.shouldForwardProp&&r.forwardProps&&(r.shouldForwardProp=x(r.forwardProps));const S=(B,re)=>{const he=typeof t=="string"&&t.charCodeAt(0)>96?fde:pde,ne=!re?.includes(B)&&!v(B);return he(B)&&ne},w=gde(t,r,n)||S,k=E.useMemo(()=>Object.assign({},r.defaultProps,wO(c)),[c]),{props:P,styles:_}=ude(k,O,w);let T="",R=[_],$=P;if(P.theme==null){$={};for(let B in P)$[B]=P[B];$.theme=E.useContext(ON)}typeof P.className=="string"?T=A9(u.registered,R,P.className):P.className!=null&&(T=Io(T,P.className));const A=yN(a.concat(R),u.registered,$);A.styles&&(T=Io(T,`${u.key}-${A.name}`)),s!==void 0&&(T=Io(T,s));const M=!w("as");let Q=M&&P.as||i,V={};for(let B in P)if(!(M&&B==="as")){if(cde(B)){const re=B.replace("html","").toLowerCase();V[re]=P[B];continue}w(B)&&(V[B]=P[B])}let q=T.trim();q?V.className=q:Reflect.deleteProperty(V,"className"),V.ref=p;const N=r.forwardAsChild||r.forwardProps?.includes("asChild");if(P.asChild&&!N){const B=E.isValidElement(P.children)?E.Children.only(P.children):E.Children.toArray(P.children).find(E.isValidElement);if(!B)throw new Error("[chakra-ui > factory] No valid child found");Q=B.type,V.children=null,Reflect.deleteProperty(V,"asChild"),V=nb(V,B.props),V.ref=rde(p,ide(B))}return V.as&&N?(V.as=void 0,h.jsxs(E.Fragment,{children:[h.jsx(lF,{cache:u,serialized:A,isStringTag:typeof Q=="string"}),h.jsx(Q,{asChild:!0,...V,children:h.jsx(P.as,{children:V.children})})]})):h.jsxs(E.Fragment,{children:[h.jsx(lF,{cache:u,serialized:A,isStringTag:typeof Q=="string"}),h.jsx(Q,{...V})]})});return l.displayName=o!==void 0?o:`chakra(${typeof i=="string"?i:i.displayName||i.name||"Component"})`,l.__emotion_real=l,l.__emotion_base=i,l.__emotion_forwardProp=r.shouldForwardProp,l.__emotion_cva=e,Object.defineProperty(l,"toString",{value(){return`.${s}`}}),l},sR=yde.bind(),aR=new Map,bde=new Proxy(sR,{apply(t,e,r){return sR(...r)},get(t,e){return aR.has(e)||aR.set(e,sR(e)),aR.get(e)}}),_r=bde,Ode=(t,e)=>t&&!e?t:!t&&e?e:t.merge(e),z=_r("div");z.displayName="Box";const V9=Object.freeze({}),F9=Object.freeze({});function xP(t){const{key:e,recipe:r}=t,n=OP();return E.useMemo(()=>{const i=r||(e!=null?n.getRecipe(e):{});return n.cva(structuredClone(i))},[e,r,n])}const xde=t=>t.charAt(0).toUpperCase()+t.slice(1);function Sl(t){const{key:e,recipe:r}=t,n=xde(e||r.className||"Component"),[i,o]=Qg({strict:!1,name:`${n}PropsContext`,providerName:`${n}PropsContext`});function s(c){const{unstyled:u,...p}=c,m=xP({key:e,recipe:p.recipe||r}),[v,b]=E.useMemo(()=>m.splitVariantProps(p),[m,p]);return{styles:u?V9:m(v),className:m.className,props:b}}const a=(c,u)=>{const p=_r(c,{},u),m=E.forwardRef((v,b)=>{const O=o(),x=E.useMemo(()=>nb(O,v),[v,O]),{styles:S,className:w,props:k}=s(x);return h.jsx(p,{...k,ref:b,css:[S,x.css],className:Io(w,x.className)})});return m.displayName=c.displayName||c.name,m};function l(){return i}return{withContext:a,PropsProvider:i,withPropsProvider:l,usePropsContext:o,useRecipeResult:s}}var wde=Object.defineProperty,Q9=t=>{throw TypeError(t)},Sde=(t,e,r)=>e in t?wde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ad=(t,e,r)=>Sde(t,typeof e!="symbol"?e+"":e,r),Cde=(t,e,r)=>e.has(t)||Q9("Cannot "+r),uF=(t,e,r)=>(Cde(t,e,"read from private field"),e.get(t)),kde=(t,e,r)=>e.has(t)?Q9("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r);function AS(t){return t==null?[]:Array.isArray(t)?t:[t]}var zg=t=>t[0],wP=t=>t[t.length-1],Pde=(t,e)=>t.indexOf(e)!==-1,ff=(t,...e)=>t.concat(e),wf=(t,...e)=>t.filter(r=>!e.includes(r)),Og=t=>Array.from(new Set(t)),lR=(t,e)=>{const r=new Set(e);return t.filter(n=>!r.has(n))},lm=(t,e)=>Pde(t,e)?wf(t,e):ff(t,e);function B9(t,e,r={}){const{step:n=1,loop:i=!0}=r,o=e+n,s=t.length,a=s-1;return e===-1?n>0?0:a:o<0?i?a:0:o>=s?i?0:e>s?s:e:o}function _de(t,e,r={}){return t[B9(t,e,r)]}function Tde(t,e,r={}){const{step:n=1,loop:i=!0}=r;return B9(t,e,{step:-n,loop:i})}function Ede(t,e,r={}){return t[Tde(t,e,r)]}function dF(t,e){return t.reduce(([r,n],i)=>(e(i)?r.push(i):n.push(i),[r,n]),[[],[]])}var hF=t=>t?.constructor.name==="Array",Rde=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Ks(t[r],e[r]))return!1;return!0},Ks=(t,e)=>{if(Object.is(t,e))return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(typeof t?.isEqual=="function"&&typeof e?.isEqual=="function")return t.isEqual(e);if(typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();if(hF(t)&&hF(e))return Rde(Array.from(t),Array.from(e));if(typeof t!="object"||typeof e!="object")return!1;const r=Object.keys(e??Object.create(null)),n=r.length;for(let i=0;i<n;i++)if(!Reflect.has(t,r[i]))return!1;for(let i=0;i<n;i++){const o=r[i];if(!Ks(t[o],e[o]))return!1}return!0},s0=t=>Array.isArray(t),Ide=t=>t===!0||t===!1,z9=t=>t!=null&&typeof t=="object",pf=t=>z9(t)&&!s0(t),NS=t=>typeof t=="string",kd=t=>typeof t=="function",jde=t=>t==null,ll=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),$de=t=>Object.prototype.toString.call(t),q9=Function.prototype.toString,Ade=q9.call(Object),Nde=t=>{if(!z9(t)||$de(t)!="[object Object]"||Lde(t))return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const r=ll(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&q9.call(r)==Ade},Mde=t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&"props"in t,Dde=t=>typeof t=="object"&&t!==null&&"__v_isVNode"in t,Lde=t=>Mde(t)||Dde(t),ww=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,fF=t=>t,Vde=t=>t(),Fde=()=>{},ib=(...t)=>(...e)=>{t.forEach(function(r){r?.(...e)})},W9=(()=>{let t=0;return()=>(t++,t.toString(36))})();function Kc(t,e,...r){if(t in e){const i=e[t];return kd(i)?i(...r):i}const n=new Error(`No matching key: ${JSON.stringify(t)} in ${JSON.stringify(Object.keys(e))}`);throw Error.captureStackTrace?.(n,Kc),n}var U9=(t,e)=>{try{return t()}catch(r){return r instanceof Error&&Error.captureStackTrace?.(r,U9),e?.()}},{floor:H9,abs:pF,round:SP,min:Qde,max:Bde,pow:zde,sign:qde}=Math,Gj=t=>Number.isNaN(t),uh=t=>Gj(t)?0:t,G9=(t,e)=>(t%e+e)%e,Wde=(t,e)=>(t%e+e)%e,Ude=(t,e)=>uh(t)>=e,Hde=(t,e)=>uh(t)<=e,Gde=(t,e,r)=>{const n=uh(t),i=e==null||n>=e,o=r==null||n<=r;return i&&o},Xde=(t,e,r)=>SP((uh(t)-e)/r)*r+e,Eo=(t,e,r)=>Qde(Bde(uh(t),e),r),Zde=(t,e,r)=>(uh(t)-e)/(r-e),Yde=(t,e,r,n)=>Eo(Xde(t*(r-e)+e,e,n),e,r),gF=(t,e)=>{let r=t,n=e.toString(),i=n.indexOf("."),o=i>=0?n.length-i:0;if(o>0){let s=zde(10,o);r=SP(r*s)/s}return r},cR=(t,e)=>typeof e=="number"?H9(t*e+.5)/e:SP(t),mF=(t,e,r,n)=>{const i=e!=null?Number(e):0,o=Number(r),s=(t-i)%n;let a=pF(s)*2>=n?t+qde(s)*(n-pF(s)):t-s;if(a=gF(a,n),!Gj(i)&&a<i)a=i;else if(!Gj(o)&&a>o){const l=H9((o-i)/n),c=i+l*n;a=l<=0||c<i?o:c}return gF(a,n)},On=(t,e=0,r=10)=>{const n=Math.pow(r,e);return SP(t*n)/n},vF=t=>{if(!Number.isFinite(t))return 0;let e=1,r=0;for(;Math.round(t*e)/e!==t;)e*=10,r+=1;return r},X9=(t,e,r)=>{let n=e==="+"?t+r:t-r;if(t%1!==0||r%1!==0){const i=10**Math.max(vF(t),vF(r));t=Math.round(t*i),r=Math.round(r*i),n=e==="+"?t+r:t-r,n/=i}return n},Kde=(t,e)=>X9(uh(t),"+",e),Jde=(t,e)=>X9(uh(t),"-",e),ba=t=>typeof t=="number"?`${t}px`:t;function qm(t){if(!Nde(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(n=>typeof n=="string"),r={};for(const n of e){const i=t[n];i!==void 0&&(r[n]=qm(i))}return r}function ehe(t,e=Object.is){let r={...t};const n=new Set,i=u=>(n.add(u),()=>n.delete(u)),o=()=>{n.forEach(u=>u())};return{subscribe:i,get:u=>r[u],set:(u,p)=>{e(r[u],p)||(r[u]=p,o())},update:u=>{let p=!1;for(const m in u){const v=u[m];v!==void 0&&!e(r[m],v)&&(r[m]=v,p=!0)}p&&o()},snapshot:()=>({...r})}}var Sw=()=>performance.now(),MS,the=class{constructor(t){this.onTick=t,ad(this,"frameId",null),ad(this,"pausedAtMs",null),ad(this,"context"),ad(this,"cancelFrame",()=>{this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}),ad(this,"setStartMs",e=>{this.context.startMs=e}),ad(this,"start",()=>{if(this.frameId!==null)return;const e=Sw();this.pausedAtMs!==null?(this.context.startMs+=e-this.pausedAtMs,this.pausedAtMs=null):this.context.startMs=e,this.frameId=requestAnimationFrame(uF(this,MS))}),ad(this,"pause",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=Sw())}),ad(this,"stop",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=null)}),kde(this,MS,e=>{if(this.context.now=e,this.context.deltaMs=e-this.context.startMs,this.onTick(this.context)===!1){this.stop();return}this.frameId=requestAnimationFrame(uF(this,MS))}),this.context={now:0,startMs:Sw(),deltaMs:0}}get elapsedMs(){return this.pausedAtMs!==null?this.pausedAtMs-this.context.startMs:Sw()-this.context.startMs}};MS=new WeakMap;function uR(t,e){const r=new the(({deltaMs:n})=>{if(n>=e)return t(),!1});return r.start(),()=>r.stop()}function cm(...t){t.length===1?t[0]:t[1],t.length===2&&t[0]}function Z9(t,e){if(t==null)throw new Error(e())}function Y9(t,e,r){let n=[];for(const i of e)t[i]==null&&n.push(i);if(n.length>0)throw new Error(`[zag-js${r?` > ${r}`:""}] missing required props: ${n.join(", ")}`)}function rhe(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function Cn(t={}){const{name:e,strict:r=!0,hookName:n="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=t,a=E.createContext(s);a.displayName=e;function l(){const c=E.useContext(a);if(!c&&r){const u=new Error(o??rhe(n,i));throw u.name="ContextError",Error.captureStackTrace?.(u,l),u}return c}return[a.Provider,l,a]}const[Zrt,Cs]=Cn({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}});function nhe(t){if(!t)return;const e=t.selectionStart??0,r=t.selectionEnd??0;Math.abs(r-e)===0&&e===0&&t.setSelectionRange(t.value.length,t.value.length)}var yF=t=>Math.max(0,Math.min(1,t)),ihe=(t,e)=>t.map((r,n)=>t[(Math.max(e,0)+n)%t.length]),dR=(...t)=>e=>t.reduce((r,n)=>n(r),e),xg=()=>{},CP=t=>typeof t=="object"&&t!==null,K9=2147483647,st=t=>t?"":void 0,J9=t=>t?"true":void 0,ohe=1,she=9,ahe=11,Yi=t=>CP(t)&&t.nodeType===ohe&&typeof t.nodeName=="string",kP=t=>CP(t)&&t.nodeType===she,lhe=t=>CP(t)&&t===t.window,eU=t=>Yi(t)?t.localName||"":"#document";function che(t){return["html","body","#document"].includes(eU(t))}var uhe=t=>CP(t)&&t.nodeType!==void 0,jf=t=>uhe(t)&&t.nodeType===ahe&&"host"in t,dhe=t=>Yi(t)&&t.localName==="input",tU=t=>!!t?.matches("a[href]"),hhe=t=>Yi(t)?t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0:!1;function Pd(t){if(!t)return!1;const e=t.getRootNode();return qg(e)===t}var fhe=/(textarea|select)/;function CN(t){if(t==null||!Yi(t))return!1;try{return dhe(t)&&t.selectionStart!=null||fhe.test(t.localName)||t.isContentEditable||t.getAttribute("contenteditable")==="true"||t.getAttribute("contenteditable")===""}catch{return!1}}function ys(t,e){if(!t||!e||!Yi(t)||!Yi(e))return!1;const r=e.getRootNode?.();if(t===e||t.contains(e))return!0;if(r&&jf(r)){let n=e;for(;n;){if(t===n)return!0;n=n.parentNode||n.host}}return!1}function ks(t){return kP(t)?t:lhe(t)?t.document:t?.ownerDocument??document}function phe(t){return ks(t).documentElement}function hi(t){return jf(t)?hi(t.host):kP(t)?t.defaultView??window:Yi(t)?t.ownerDocument?.defaultView??window:window}function qg(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(!r||r===e)break;e=r}return e}function ghe(t){if(eU(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jf(t)&&t.host||phe(t);return jf(e)?e.host:e}function kN(t){let e;try{if(e=t.getRootNode({composed:!0}),kP(e)||jf(e))return e}catch{}return t.ownerDocument??document}var hR=new WeakMap;function $f(t){return hR.has(t)||hR.set(t,hi(t).getComputedStyle(t)),hR.get(t)}var PN=new Set(["menu","listbox","dialog","grid","tree","region"]),mhe=t=>PN.has(t),rU=t=>t.getAttribute("aria-controls")?.split(" ")||[];function nU(t,e){const r=new Set,n=kN(t),i=o=>{const s=o.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const l=rU(a);for(const c of l){if(!c||r.has(c))continue;r.add(c);const u=n.getElementById(c);if(u){const p=u.getAttribute("role"),m=u.getAttribute("aria-modal")==="true";if(p&&mhe(p)&&!m&&(u===e||u.contains(e)||i(u)))return!0}}}return!1};return i(t)}function iU(t,e){const r=kN(t),n=new Set,i=o=>{const s=o.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const l=rU(a);for(const c of l){if(!c||n.has(c))continue;n.add(c);const u=r.getElementById(c);if(u){const p=u.getAttribute("role"),m=u.getAttribute("aria-modal")==="true";p&&PN.has(p)&&!m&&(e(u),i(u))}}}};i(t)}function vhe(t){const e=new Set;return iU(t,r=>{t.contains(r)||e.add(r)}),Array.from(e)}function yhe(t){const e=t.getAttribute("role");return!!(e&&PN.has(e))}function bhe(t){return t.hasAttribute("aria-controls")&&t.getAttribute("aria-expanded")==="true"}function Ohe(t){return bhe(t)?!0:!!t.querySelector?.('[aria-controls][aria-expanded="true"]')}function xhe(t){if(!t.id)return!1;const e=kN(t),r=CSS.escape(t.id),n=`[aria-controls~="${r}"][aria-expanded="true"], [aria-controls="${r}"][aria-expanded="true"]`;return!!(e.querySelector(n)&&yhe(t))}var PP=()=>typeof document<"u";function whe(){return navigator.userAgentData?.platform??navigator.platform}function She(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:r})=>`${e}/${r}`).join(" "):navigator.userAgent}var _N=t=>PP()&&t.test(whe()),oU=t=>PP()&&t.test(She()),Che=t=>PP()&&t.test(navigator.vendor),bF=()=>PP()&&!!navigator.maxTouchPoints,khe=()=>_N(/^iPhone/i),Phe=()=>_N(/^iPad/i)||SO()&&navigator.maxTouchPoints>1,_P=()=>khe()||Phe(),_he=()=>SO()||_P(),SO=()=>_N(/^Mac/i),Wm=()=>_he()&&Che(/apple/i),The=()=>oU(/Firefox/i),Ehe=()=>oU(/Android/i);function Rhe(t){return t.composedPath?.()??t.nativeEvent?.composedPath?.()}function ti(t){return Rhe(t)?.[0]??t.target}function Xj(t){const e=t.currentTarget;if(!e||!e.matches("a[href], button[type='submit'], input[type='submit']"))return!1;const n=t.button===1,i=Ihe(t);return n||i}function OF(t){const e=t.currentTarget;if(!e)return!1;const r=e.localName;return t.altKey?r==="a"||r==="button"&&e.type==="submit"||r==="input"&&e.type==="submit":!1}function sU(t){return Dhe(t).isComposing||t.keyCode===229}function Ihe(t){return SO()?t.metaKey:t.ctrlKey}function jhe(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey}function $he(t){return t.pointerType===""&&t.isTrusted?!0:Ehe()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}var aU=t=>t.button===0,lU=t=>t.button===2||SO()&&t.ctrlKey&&t.button===0,Ahe=t=>t.ctrlKey||t.altKey||t.metaKey,Nhe=t=>"touches"in t&&t.touches.length>0,Mhe={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},xF={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function _C(t,e={}){const{dir:r="ltr",orientation:n="horizontal"}=e;let i=t.key;return i=Mhe[i]??i,r==="rtl"&&n==="horizontal"&&i in xF&&(i=xF[i]),i}function Dhe(t){return t.nativeEvent??t}function su(t,e="client"){const r=Nhe(t)?t.touches[0]||t.changedTouches[0]:t;return{x:r[`${e}X`],y:r[`${e}Y`]}}var hr=(t,e,r,n)=>{const i=typeof t=="function"?t():t;return i?.addEventListener(e,r,n),()=>{i?.removeEventListener(e,r,n)}};function cU(t,e){const{type:r="HTMLInputElement",property:n="value"}=e,i=hi(t)[r].prototype;return Object.getOwnPropertyDescriptor(i,n)??{}}function Lhe(t){if(t.localName==="input")return"HTMLInputElement";if(t.localName==="textarea")return"HTMLTextAreaElement";if(t.localName==="select")return"HTMLSelectElement"}function CO(t,e,r="value"){if(!t)return;const n=Lhe(t);n&&cU(t,{type:n,property:r}).set?.call(t,e),t.setAttribute(r,e)}function TN(t,e){if(!t)return;cU(t,{type:"HTMLInputElement",property:"checked"}).set?.call(t,e),e?t.setAttribute("checked",""):t.removeAttribute("checked")}function Vhe(t,e){const{value:r,bubbles:n=!0}=e;if(!t)return;const i=hi(t);t instanceof i.HTMLInputElement&&(CO(t,`${r}`),t.dispatchEvent(new i.Event("input",{bubbles:n})))}function uU(t,e){const{checked:r,bubbles:n=!0}=e;if(!t)return;const i=hi(t);t instanceof i.HTMLInputElement&&(TN(t,r),t.dispatchEvent(new i.Event("click",{bubbles:n})))}function Fhe(t){return Qhe(t)?t.form:t.closest("form")}function Qhe(t){return t.matches("textarea, input, select, button")}function Bhe(t,e){if(!t)return;const r=Fhe(t),n=i=>{i.defaultPrevented||e()};return r?.addEventListener("reset",n,{passive:!0}),()=>r?.removeEventListener("reset",n)}function zhe(t,e){const r=t?.closest("fieldset");if(!r)return;e(r.disabled);const n=hi(r),i=new n.MutationObserver(()=>e(r.disabled));return i.observe(r,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function kO(t,e){if(!t)return;const{onFieldsetDisabledChange:r,onFormReset:n}=e,i=[Bhe(t,n),zhe(t,r)];return()=>i.forEach(o=>o?.())}var dU=t=>Yi(t)&&t.tagName==="IFRAME",qhe=t=>!Number.isNaN(parseInt(t.getAttribute("tabindex")||"0",10)),Whe=t=>parseInt(t.getAttribute("tabindex")||"0",10)<0,EN="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",RN=(t,e=!1)=>{if(!t)return[];const r=Array.from(t.querySelectorAll(EN));(e==!0||e=="if-empty"&&r.length===0)&&Yi(t)&&Ld(t)&&r.unshift(t);const i=r.filter(Ld);return i.forEach((o,s)=>{if(dU(o)&&o.contentDocument){const a=o.contentDocument.body;i.splice(s,1,...RN(a))}}),i};function Ld(t){return!t||t.closest("[inert]")?!1:t.matches(EN)&&hhe(t)}function Um(t,e){if(!t)return[];const r=Array.from(t.querySelectorAll(EN)),n=r.filter(md);return e&&md(t)&&n.unshift(t),n.forEach((i,o)=>{if(dU(i)&&i.contentDocument){const s=i.contentDocument.body,a=Um(s);n.splice(o,1,...a)}}),!n.length&&e?r:n}function md(t){return t!=null&&t.tabIndex>0?!0:Ld(t)&&!Whe(t)}function hU(t,e){const r=Um(t,e),n=r[0]||null,i=r[r.length-1]||null;return[n,i]}function Uhe(t,e){const r=Um(t),n=t?.ownerDocument||document,i=e??qg(n);if(!i)return null;const o=r.indexOf(i);return r[o+1]||null}function vy(t){return t.tabIndex<0&&(/^(audio|video|details)$/.test(t.localName)||CN(t))&&!qhe(t)?0:t.tabIndex}function ob(t){const{root:e,getInitialEl:r,filter:n,enabled:i=!0}=t;if(!i)return;let o=null;if(o||(o=typeof r=="function"?r():r),o||(o=e?.querySelector("[data-autofocus],[autofocus]")),!o){const s=Um(e);o=n?s.filter(n)[0]:s[0]}return o||e||void 0}function Hhe(t){const e=t.currentTarget;if(!e)return!1;const[r,n]=hU(e);return!(Pd(r)&&t.shiftKey||Pd(n)&&!t.shiftKey||!r&&!n)}function PO(t){const e=new Set;function r(n){const i=globalThis.requestAnimationFrame(n);e.add(()=>globalThis.cancelAnimationFrame(i))}return r(()=>r(t)),function(){e.forEach(i=>i())}}function wt(t){let e;const r=globalThis.requestAnimationFrame(()=>{e=t()});return()=>{globalThis.cancelAnimationFrame(r),e?.()}}function Ghe(t,e,r){const n=wt(()=>{t.removeEventListener(e,i,!0),r()}),i=()=>{n(),r()};return t.addEventListener(e,i,{once:!0,capture:!0}),n}function Xhe(t,e){if(!t)return;const{attributes:r,callback:n}=e,i=t.ownerDocument.defaultView||window,o=new i.MutationObserver(s=>{for(const a of s)a.type==="attributes"&&a.attributeName&&r.includes(a.attributeName)&&n(a)});return o.observe(t,{attributes:!0,attributeFilter:r}),()=>o.disconnect()}function TP(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=typeof t=="function"?t():t;i.push(Xhe(o,e))})),()=>{i.forEach(o=>o?.())}}function Zhe(t,e){const{callback:r}=e;if(!t)return;const n=t.ownerDocument.defaultView||window,i=new n.MutationObserver(r);return i.observe(t,{childList:!0,subtree:!0}),()=>i.disconnect()}function Yhe(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=typeof t=="function"?t():t;i.push(Zhe(o,e))})),()=>{i.forEach(o=>o?.())}}function IN(t){const e=()=>{const r=hi(t);t.dispatchEvent(new r.MouseEvent("click"))};The()?Ghe(t,"keyup",e):queueMicrotask(e)}function TC(t){const e=ghe(t);return che(e)?ks(e).body:Yi(e)&&jN(e)?e:TC(e)}function fU(t,e=[]){const r=TC(t),n=r===t.ownerDocument.body,i=hi(r);return n?e.concat(i,i.visualViewport||[],jN(r)?r:[]):e.concat(r,fU(r,[]))}var Khe=/auto|scroll|overlay|hidden|clip/,Jhe=new Set(["inline","contents"]);function jN(t){const e=hi(t),{overflow:r,overflowX:n,overflowY:i,display:o}=e.getComputedStyle(t);return Khe.test(r+i+n)&&!Jhe.has(o)}function efe(t){return t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth}function EC(t,e){const{rootEl:r,...n}=e||{};!t||!r||!jN(r)||!efe(r)||t.scrollIntoView(n)}function pU(t,e){const{left:r,top:n,width:i,height:o}=e.getBoundingClientRect(),s={x:t.x-r,y:t.y-n},a={x:yF(s.x/i),y:yF(s.y/o)};function l(c={}){const{dir:u="ltr",orientation:p="horizontal",inverted:m}=c,v=typeof m=="object"?m.x:m,b=typeof m=="object"?m.y:m;return p==="horizontal"?u==="rtl"||v?1-a.x:a.x:b?1-a.y:a.y}return{offset:s,percent:a,getPercentValue:l}}function tfe(t,e){const r=t.body,n="pointerLockElement"in t||"mozPointerLockElement"in t,i=()=>!!t.pointerLockElement;function o(){}function s(l){i(),console.error("PointerLock error occurred:",l),t.exitPointerLock()}if(!n)return;try{r.requestPointerLock()}catch{}const a=[hr(t,"pointerlockchange",o,!1),hr(t,"pointerlockerror",s,!1)];return()=>{a.forEach(l=>l()),t.exitPointerLock()}}var wg="default",Zj="",DS=new WeakMap;function rfe(t={}){const{target:e,doc:r}=t,n=r??document,i=n.documentElement;return _P()?(wg==="default"&&(Zj=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),wg="disabled"):e&&(DS.set(e,e.style.userSelect),e.style.userSelect="none"),()=>nfe({target:e,doc:n})}function nfe(t={}){const{target:e,doc:r}=t,i=(r??document).documentElement;if(_P()){if(wg!=="disabled")return;wg="restoring",setTimeout(()=>{PO(()=>{wg==="restoring"&&(i.style.webkitUserSelect==="none"&&(i.style.webkitUserSelect=Zj||""),Zj="",wg="default")})},300)}else if(e&&DS.has(e)){const o=DS.get(e);e.style.userSelect==="none"&&(e.style.userSelect=o??""),e.getAttribute("style")===""&&e.removeAttribute("style"),DS.delete(e)}}function gU(t={}){const{defer:e,target:r,...n}=t,i=e?wt:s=>s(),o=[];return o.push(i(()=>{const s=typeof r=="function"?r():r;o.push(rfe({...n,target:s}))})),()=>{o.forEach(s=>s?.())}}function mU(t,e){const{onPointerMove:r,onPointerUp:n}=e,i=a=>{const l=su(a),c=Math.sqrt(l.x**2+l.y**2),u=a.pointerType==="touch"?10:5;if(!(c<u)){if(a.pointerType==="mouse"&&a.button===0){o(a);return}r({point:l,event:a})}},o=a=>{const l=su(a);n({point:l,event:a})},s=[hr(t,"pointermove",i,!1),hr(t,"pointerup",o,!1),hr(t,"pointercancel",o,!1),hr(t,"contextmenu",o,!1),gU({doc:t})];return()=>{s.forEach(a=>a())}}function vU(t){const{pointerNode:e,keyboardNode:r=e,onPress:n,onPressStart:i,onPressEnd:o,isValidKey:s=w=>w.key==="Enter"}=t;if(!e)return xg;const a=hi(e);let l=xg,c=xg,u=xg;const p=w=>({point:su(w),event:w});function m(w){i?.(p(w))}function v(w){o?.(p(w))}const O=hr(e,"pointerdown",w=>{c();const P=hr(a,"pointerup",T=>{const R=ti(T);ys(e,R)?n?.(p(T)):o?.(p(T))},{passive:!n,once:!0}),_=hr(a,"pointercancel",v,{passive:!o,once:!0});c=dR(P,_),Pd(r)&&w.pointerType==="mouse"&&w.preventDefault(),m(w)},{passive:!i}),x=hr(r,"focus",S);l=dR(O,x);function S(){const w=T=>{if(!s(T))return;const R=A=>{if(!s(A))return;const M=new a.PointerEvent("pointerup"),Q=p(M);n?.(Q),o?.(Q)};c(),c=hr(r,"keyup",R);const $=new a.PointerEvent("pointerdown");m($)},k=()=>{const T=new a.PointerEvent("pointercancel");v(T)},P=hr(r,"keydown",w),_=hr(r,"blur",k);u=dR(P,_)}return()=>{l(),c(),u()}}function ife(t,e={}){const{triggerElement:r,onFocus:n,onFocusEnter:i}=e,o=t?.ownerDocument||document,s=o.body;function a(l){if(l.key!=="Tab")return;let c=null;const[u,p]=hU(t,!0),m=Uhe(s,r),v=!u&&!p;l.shiftKey&&Pd(m)?(i?.(),c=p):l.shiftKey&&(Pd(u)||v)?c=r:!l.shiftKey&&Pd(r)?(i?.(),c=u):!l.shiftKey&&(Pd(p)||v)&&(c=m),c&&(l.preventDefault(),typeof n=="function"?n(c):c.focus())}return hr(o,"keydown",a,!0)}function ofe(t,e){const{defer:r,triggerElement:n,...i}=e,o=r?wt:a=>a(),s=[];return s.push(o(()=>{const a=typeof t=="function"?t():t,l=typeof n=="function"?n():n;s.push(ife(a,{triggerElement:l,...i}))})),()=>{s.forEach(a=>a?.())}}function sb(t,e){return Array.from(t?.querySelectorAll(e)??[])}function Hm(t,e){return t?.querySelector(e)??null}var $N=t=>t.id;function yU(t,e,r=$N){return t.find(n=>r(n)===e)}function AN(t,e,r=$N){const n=yU(t,e,r);return n?t.indexOf(n):-1}function bU(t,e,r=!0){let n=AN(t,e);return n=r?(n+1)%t.length:Math.min(n+1,t.length-1),t[n]}function OU(t,e,r=!0){let n=AN(t,e);return n===-1?r?t[t.length-1]:null:(n=r?(n-1+t.length)%t.length:Math.max(0,n-1),t[n])}function sfe(t,e){const{onEntry:r,measure:n,box:i="border-box"}=e,o=(Array.isArray(t)?t:[t]).filter(Yi),s=hi(o[0]),a=c=>{const u=o.map(p=>n(p));r({rects:u,entries:c})};a([]);const l=new s.ResizeObserver(a);return o.forEach(c=>l.observe(c,{box:i})),()=>l.disconnect()}var afe=t=>t.split("").map(e=>{const r=e.charCodeAt(0);return r>0&&r<128?e:r>=128&&r<=255?`/x${r.toString(16)}`.replace("/","\\"):""}).join("").trim(),lfe=t=>afe(t.dataset?.valuetext??t.textContent??""),cfe=(t,e)=>t.trim().toLowerCase().startsWith(e.toLowerCase());function ufe(t,e,r,n=$N){const i=r?AN(t,r,n):-1;let o=r?ihe(t,i):t;return e.length===1&&(o=o.filter(a=>n(a)!==r)),o.find(a=>cfe(lfe(a),e))}function dfe(t,e,r){const n=t.getAttribute(e),i=n!=null;return t.setAttribute(e,r),()=>{i?t.setAttribute(e,n):t.removeAttribute(e)}}function ab(t,e){if(!t)return xg;const r=Object.keys(e).reduce((n,i)=>(n[i]=t.style.getPropertyValue(i),n),{});return Object.assign(t.style,e),()=>{Object.assign(t.style,r),t.style.length===0&&t.removeAttribute("style")}}function hfe(t,e,r){if(!t)return xg;const n=t.style.getPropertyValue(e);return t.style.setProperty(e,r),()=>{t.style.setProperty(e,n),t.style.length===0&&t.removeAttribute("style")}}function ffe(t,e){const{state:r,activeId:n,key:i,timeout:o=350,itemToId:s}=e,a=r.keysSoFar+i,c=a.length>1&&Array.from(a).every(b=>b===a[0])?a[0]:a;let u=t.slice();const p=ufe(u,c,n,s);function m(){clearTimeout(r.timer),r.timer=-1}function v(b){r.keysSoFar=b,m(),b!==""&&(r.timer=+setTimeout(()=>{v(""),m()},o))}return v(a),p}var lb=Object.assign(ffe,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:pfe});function pfe(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey}var xU={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function gfe(t,e,r){const{signal:n}=e;return[new Promise((s,a)=>{const l=setTimeout(()=>{a(new Error(`Timeout of ${r}ms exceeded`))},r);n.addEventListener("abort",()=>{clearTimeout(l),a(new Error("Promise aborted"))}),t.then(c=>{n.aborted||(clearTimeout(l),s(c))}).catch(c=>{n.aborted||(clearTimeout(l),a(c))})}),()=>e.abort()]}function mfe(t,e){const{timeout:r,rootNode:n}=e,i=hi(n),o=ks(n),s=new i.AbortController;return gfe(new Promise(a=>{const l=t();if(l){a(l);return}const c=new i.MutationObserver(()=>{const u=t();u&&u.isConnected&&(c.disconnect(),a(u))});c.observe(o.body,{childList:!0,subtree:!0})}),s,r)}var vfe=(...t)=>t.map(e=>e?.trim?.()).filter(Boolean).join(" "),yfe=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,wF=t=>{const e={};let r;for(;r=yfe.exec(t);)e[r[1]]=r[2];return e},bfe=(t,e)=>{if(NS(t)){if(NS(e))return`${t};${e}`;t=wF(t)}else NS(e)&&(e=wF(e));return Object.assign({},t??{},e??{})};function Ae(...t){let e={};for(let r of t){if(!r)continue;for(let i in e){if(i.startsWith("on")&&typeof e[i]=="function"&&typeof r[i]=="function"){e[i]=ib(r[i],e[i]);continue}if(i==="className"||i==="class"){e[i]=vfe(e[i],r[i]);continue}if(i==="style"){e[i]=bfe(e[i],r[i]);continue}e[i]=r[i]!==void 0?r[i]:e[i]}for(let i in r)e[i]===void 0&&(e[i]=r[i]);const n=Object.getOwnPropertySymbols(r);for(let i of n)e[i]=r[i]}return e}function SF(t,e,r){let n=[],i;return o=>{const s=t(o);return(s.length!==n.length||s.some((l,c)=>!Ks(n[c],l)))&&(n=s,i=e(s,o)),i}}function Cl(){return{and:(...t)=>function(r){return t.every(n=>r.guard(n))},or:(...t)=>function(r){return t.some(n=>r.guard(n))},not:t=>function(r){return!r.guard(t)}}}function NN(){return{guards:Cl(),createMachine:t=>t,choose:t=>function({choose:r}){return r(t)?.actions}}}var lg=(t=>(t.NotStarted="Not Started",t.Started="Started",t.Stopped="Stopped",t))(lg||{}),fR="__init__";function Ofe(t){const e=()=>t.getRootNode?.()??document,r=()=>ks(e());return{...t,getRootNode:e,getDoc:r,getWin:()=>r().defaultView??window,getActiveElement:()=>qg(e()),isActiveElement:Pd,getById:s=>e().getElementById(s)}}function Eu(...t){return e=>{const r=[];for(const n of t)if(typeof n=="function"){const i=n(e);typeof i=="function"&&r.push(i)}else n&&(n.current=e);if(r.length)return()=>{for(const n of r)n()}}}function xfe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const pR=t=>{const e=E.memo(E.forwardRef((r,n)=>{const{asChild:i,children:o,...s}=r;if(!i)return E.createElement(t,{...s,ref:n},o);if(!E.isValidElement(o))return null;const a=E.Children.only(o),l=xfe(a);return E.cloneElement(a,{...Ae(s,a.props),ref:n?Eu(n,l):l})}));return e.displayName=t.displayName||t.name,e},wfe=()=>{const t=new Map;return new Proxy(pR,{apply(e,r,n){return pR(n[0])},get(e,r){const n=r;return t.has(n)||t.set(n,pR(n)),t.get(n)}})},Ue=wfe(),[Yrt,Va]=Cn({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),{withContext:Sfe}=Sl({key:"heading"}),Cfe=Sfe("h2"),Nn=()=>(t,e)=>e.reduce((r,n)=>{const[i,o]=r,s=n;return o[s]!==void 0&&(i[s]=o[s]),delete o[s],[i,o]},[{},{...t}]),Cc=t=>Nn()(t,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function kfe(t){return new Proxy({},{get(e,r){return r==="style"?n=>t({style:n}).style:t}})}var xt=()=>t=>Array.from(new Set(t));function Pfe(t,e){const{state:r,send:n,context:i}=t,o=r.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:o,setNode(s){s&&n({type:"NODE.SET",node:s})},unmount(){n({type:"UNMOUNT"})}}}var _fe={props({props:t}){return{...t,present:!!t.present}},initialState({prop:t}){return t("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:t}){return{unmountAnimationName:t(()=>({defaultValue:null})),prevAnimationName:t(()=>({defaultValue:null})),present:t(()=>({defaultValue:!1})),initial:t(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:t,prop:e,send:r}){t([()=>e("present")],()=>{r({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:t})=>{t.get("initial")||queueMicrotask(()=>{t.set("initial",!0)})},clearInitial:({context:t})=>{t.set("initial",!1)},invokeOnExitComplete:({prop:t})=>{t("onExitComplete")?.()},setupNode:({refs:t,event:e})=>{t.get("node")!==e.node&&(t.set("node",e.node),t.set("styles",$f(e.node)))},cleanupNode:({refs:t})=>{t.set("node",null),t.set("styles",null)},syncPresence:({context:t,refs:e,send:r,prop:n})=>{const i=n("present");if(i)return r({type:"MOUNT",src:"presence.changed"});const o=e.get("node");if(!i&&o?.ownerDocument.visibilityState==="hidden")return r({type:"UNMOUNT",src:"visibilitychange"});wt(()=>{const s=Cw(e.get("styles"));t.set("unmountAnimationName",s),s==="none"||s===t.get("prevAnimationName")||e.get("styles")?.display==="none"||e.get("styles")?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:t,refs:e})=>{wt(()=>{t.set("prevAnimationName",Cw(e.get("styles")))})},clearPrevAnimationName:({context:t})=>{t.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:t,refs:e,send:r,prop:n})=>{const i=e.get("node");if(!i)return;const o=l=>{(l.composedPath?.()?.[0]??l.target)===i&&t.set("prevAnimationName",Cw(e.get("styles")))},s=l=>{const c=Cw(e.get("styles"));ti(l)===i&&c===t.get("unmountAnimationName")&&!n("present")&&r({type:"UNMOUNT",src:"animationend"})};i.addEventListener("animationstart",o),i.addEventListener("animationcancel",s),i.addEventListener("animationend",s);const a=ab(i,{animationFillMode:"forwards"});return()=>{i.removeEventListener("animationstart",o),i.removeEventListener("animationcancel",s),i.removeEventListener("animationend",s),PO(()=>a())}}}}};function Cw(t){return t?.animationName||"none"}xt()(["onExitComplete","present","immediate"]);var ep=k9();const wU=ch(ep),Tfe=mP({__proto__:null,default:wU},[ep]);var SU=typeof globalThis.document<"u"?E.useLayoutEffect:E.useEffect;function RC(t){const e=t().value??t().defaultValue,r=t().isEqual??Object.is,[n]=E.useState(e),[i,o]=E.useState(n),s=t().value!==void 0,a=E.useRef(i);a.current=s?t().value:i;const l=E.useRef(a.current);SU(()=>{l.current=a.current},[i,t().value]);const c=p=>{const m=l.current,v=kd(p)?p(m):p;t().debug&&console.log(`[bindable > ${t().debug}] setValue`,{next:v,prev:m}),s||o(v),r(v,m)||t().onChange?.(v,m)};function u(){return s?t().value:i}return{initial:n,ref:a,get:u,set(p){(t().sync?ep.flushSync:Vde)(()=>c(p))},invoke(p,m){t().onChange?.(p,m)},hash(p){return t().hash?.(p)??String(p)}}}RC.cleanup=t=>{E.useEffect(()=>t,[])};RC.ref=t=>{const e=E.useRef(t);return{get:()=>e.current,set:r=>{e.current=r}}};function Efe(t){const e=E.useRef(t);return{get(r){return e.current[r]},set(r,n){e.current[r]=n}}}var Rfe=(t,e)=>{const r=E.useRef(!1),n=E.useRef(!1);E.useEffect(()=>{if(r.current&&n.current)return e();n.current=!0},[...(t??[]).map(i=>typeof i=="function"?i():i)]),E.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[])};function Ps(t,e={}){const r=E.useMemo(()=>{const{id:Q,ids:V,getRootNode:q}=e;return Ofe({id:Q,ids:V,getRootNode:q})},[e]),n=(...Q)=>{t.debug&&console.log(...Q)},i=t.props?.({props:qm(e),scope:r})??e,o=Ife(i),s=t.context?.({prop:o,bindable:RC,scope:r,flush:CF,getContext(){return l},getComputed(){return _},getRefs(){return O},getEvent(){return v()}}),a=CU(s),l={get(Q){return a.current?.[Q].ref.current},set(Q,V){a.current?.[Q].set(V)},initial(Q){return a.current?.[Q].initial},hash(Q){const V=a.current?.[Q].get();return a.current?.[Q].hash(V)}},c=E.useRef(new Map),u=E.useRef(null),p=E.useRef(null),m=E.useRef({type:""}),v=()=>({...m.current,current(){return m.current},previous(){return p.current}}),b=()=>({...T,matches(...Q){return Q.includes(T.ref.current)},hasTag(Q){return!!t.states[T.ref.current]?.tags?.includes(Q)}}),O=Efe(t.refs?.({prop:o,context:l})??{}),x=()=>({state:b(),context:l,event:v(),prop:o,send:M,action:S,guard:w,track:Rfe,refs:O,computed:_,flush:CF,scope:r,choose:P}),S=Q=>{const V=kd(Q)?Q(x()):Q;if(!V)return;const q=V.map(N=>{const B=t.implementations?.actions?.[N];return B||cm(`[zag-js] No implementation found for action "${JSON.stringify(N)}"`),B});for(const N of q)N?.(x())},w=Q=>kd(Q)?Q(x()):t.implementations?.guards?.[Q](x()),k=Q=>{const V=kd(Q)?Q(x()):Q;if(!V)return;const q=V.map(B=>{const re=t.implementations?.effects?.[B];return re||cm(`[zag-js] No implementation found for effect "${JSON.stringify(B)}"`),re}),N=[];for(const B of q){const re=B?.(x());re&&N.push(re)}return()=>N.forEach(B=>B?.())},P=Q=>AS(Q).find(V=>{let q=!V.guard;return NS(V.guard)?q=!!w(V.guard):kd(V.guard)&&(q=V.guard(x())),q}),_=Q=>{Z9(t.computed,()=>"[zag-js] No computed object found on machine");const V=t.computed[Q];return V({context:l,event:v(),prop:o,refs:O,scope:r,computed:_})},T=RC(()=>({defaultValue:t.initialState({prop:o}),onChange(Q,V){V&&(c.current.get(V)?.(),c.current.delete(V)),V&&S(t.states[V]?.exit),S(u.current?.actions);const q=k(t.states[Q]?.effects);if(q&&c.current.set(Q,q),V===fR){S(t.entry);const N=k(t.effects);N&&c.current.set(fR,N)}S(t.states[Q]?.entry)}})),R=E.useRef(void 0),$=E.useRef(lg.NotStarted);SU(()=>{queueMicrotask(()=>{const q=$.current===lg.Started;$.current=lg.Started,n(q?"rehydrating...":"initializing...");const N=R.current??T.initial;T.invoke(N,q?T.get():fR)});const Q=c.current,V=T.ref.current;return()=>{n("unmounting..."),R.current=V,$.current=lg.Stopped,Q.forEach(q=>q?.()),c.current=new Map,u.current=null,queueMicrotask(()=>{S(t.exit)})}},[]);const A=()=>"ref"in T?T.ref.current:T.get(),M=Q=>{queueMicrotask(()=>{if($.current!==lg.Started)return;p.current=m.current,m.current=Q;let V=A();const q=t.states[V].on?.[Q.type]??t.on?.[Q.type],N=P(q);if(!N)return;u.current=N;const B=N.target??V;n("transition",Q.type,N.target||V,`(${N.actions})`);const re=B!==V;re?ep.flushSync(()=>T.set(B)):N.reenter&&!re?T.invoke(V,V):S(N.actions??[])})};return t.watch?.(x()),{state:b(),send:M,context:l,prop:o,scope:r,refs:O,computed:_,event:v(),getStatus:()=>$.current}}function CU(t){const e=E.useRef(t);return e.current=t,e}function Ife(t){const e=CU(t);return function(n){return e.current[n]}}function CF(t){queueMicrotask(()=>{ep.flushSync(()=>t())})}var oa=kfe(t=>t);function kU(t,e={}){const{sync:r=!1}=e,n=jfe(t);return E.useCallback((...i)=>r?queueMicrotask(()=>n.current?.(...i)):n.current?.(...i),[r,n])}function jfe(t){const e=E.useRef(t);return e.current=t,e}const Fa=(t={})=>{const{lazyMount:e,unmountOnExit:r,present:n,skipAnimationOnMount:i=!1,...o}=t,s=E.useRef(!1),a={...o,present:n,onExitComplete:kU(t.onExitComplete)},l=Ps(_fe,a),c=Pfe(l);c.present&&(s.current=!0);const u=!c.present&&!s.current&&e||r&&!c.present&&s.current,p=()=>({"data-state":c.skip&&i?void 0:n?"open":"closed",hidden:!c.present});return{ref:c.setNode,getPresenceProps:p,present:c.present,unmounted:u}},[kl,sa]=Cn({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),kw=_r("span"),{withContext:$fe}=Sl({key:"text"}),Y=$fe("p");function kF(t,e=[]){const r=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return E.useInsertionEffect(()=>{r.current=t}),E.useCallback((...n)=>r.current?.(...n),e)}function MN(t={}){const e=kF(t.onOpen),r=kF(t.onClose),[n,i]=E.useState(t.defaultOpen||!1),o=t.open!==void 0?t.open:n,s=t.open!==void 0,a=E.useCallback(()=>{s||i(!1),r?.()},[s,r]),l=E.useCallback(()=>{s||i(!0),e?.()},[s,e]),c=E.useCallback(()=>{o?a():l()},[o,l,a]);return{open:o,onOpen:l,onClose:a,onToggle:c,setOpen:i}}const[PU,EP]=Cn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"<AccordionProvider />"}),[Afe]=Cn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItemProvider />"}),Nfe=t=>Nn()(t,["collapsedHeight","collapsedWidth","defaultOpen","disabled","id","ids","lazyMount","onExitComplete","onOpenChange","open","unmountOnExit"]);var Ct=(t,e=[])=>({parts:(...r)=>{if(Mfe(e))return Ct(t,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>Ct(t,[...e,...r]),omit:(...r)=>Ct(t,e.filter(n=>!r.includes(n))),rename:r=>Ct(r,e),keys:()=>e,build:()=>[...new Set(e)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${zp(t)}"][data-part="${zp(n)}"]`,`& [data-scope="${zp(t)}"][data-part="${zp(n)}"]`].join(", "),attrs:{"data-scope":zp(t),"data-part":zp(n)}}}),{})}),zp=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Mfe=t=>t.length===0,_U=Ct("collapsible").parts("root","trigger","content","indicator"),Pw=_U.build(),Dfe=t=>t.ids?.root??`collapsible:${t.id}`,Yj=t=>t.ids?.content??`collapsible:${t.id}:content`,Lfe=t=>t.ids?.trigger??`collapsible:${t.id}:trigger`,yy=t=>t.getById(Yj(t));function Vfe(t,e){const{state:r,send:n,context:i,scope:o,prop:s}=t,a=r.matches("open")||r.matches("closing"),l=r.matches("open"),c=r.matches("closed"),{width:u,height:p}=i.get("size"),m=!!s("disabled"),v=s("collapsedHeight"),b=s("collapsedWidth"),O=v!=null,x=b!=null,S=O||x,w=!i.get("initial")&&l,k="ltr";return{disabled:m,visible:a,open:l,measureSize(){n({type:"size.measure"})},setOpen(P){r.matches("open")!==P&&n({type:P?"open":"close"})},getRootProps(){return e.element({...Pw.root.attrs,"data-state":l?"open":"closed",dir:k,id:Dfe(o)})},getContentProps(){return e.element({...Pw.content.attrs,id:Yj(o),"data-collapsible":"","data-state":w?void 0:l?"open":"closed","data-disabled":st(m),"data-has-collapsed-size":st(S),hidden:!a&&!S,style:{"--height":ba(p),"--width":ba(u),"--collapsed-height":ba(v),"--collapsed-width":ba(b),...c&&O&&{overflow:"hidden",minHeight:ba(v),maxHeight:ba(v)},...c&&x&&{overflow:"hidden",minWidth:ba(b),maxWidth:ba(b)}}})},getTriggerProps(){return e.element({...Pw.trigger.attrs,id:Lfe(o),dir:k,type:"button","data-state":l?"open":"closed","data-disabled":st(m),"aria-controls":Yj(o),"aria-expanded":a||!1,onClick(P){P.defaultPrevented||m||n({type:l?"close":"open"})}})},getIndicatorProps(){return e.element({...Pw.indicator.attrs,dir:k,"data-state":l?"open":"closed","data-disabled":st(m)})}}}var Ffe={initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({bindable:t}){return{size:t(()=>({defaultValue:{height:0,width:0},sync:!0})),initial:t(()=>({defaultValue:!1}))}},refs(){return{cleanup:void 0,stylesRef:void 0}},watch({track:t,prop:e,action:r}){t([()=>e("open")],()=>{r(["setInitial","computeSize","toggleVisibility"])})},exit:["clearInitial","cleanupNode"],states:{closed:{effects:["trackTabbableElements"],on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","computeSize","invokeOnOpen"]}]}},closing:{effects:["trackExitAnimation"],on:{"controlled.close":{target:"closed"},"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","invokeOnOpen"]}],close:[{guard:"isOpenControlled",actions:["invokeOnExitComplete"]},{target:"closed",actions:["setInitial","computeSize","invokeOnExitComplete"]}],"animation.end":{target:"closed",actions:["invokeOnExitComplete","clearInitial"]}}},open:{effects:["trackEnterAnimation"],on:{"controlled.close":{target:"closing"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closing",actions:["setInitial","computeSize","invokeOnClose"]}],"size.measure":{actions:["measureSize"]},"animation.end":{actions:["clearInitial"]}}}},implementations:{guards:{isOpenControlled:({prop:t})=>t("open")!=null},effects:{trackEnterAnimation:({send:t,scope:e})=>{let r;const n=wt(()=>{const i=yy(e);if(!i)return;const o=$f(i).animationName;if(!o||o==="none"){t({type:"animation.end"});return}const a=l=>{ti(l)===i&&t({type:"animation.end"})};i.addEventListener("animationend",a),r=()=>{i.removeEventListener("animationend",a)}});return()=>{n(),r?.()}},trackExitAnimation:({send:t,scope:e})=>{let r;const n=wt(()=>{const i=yy(e);if(!i)return;const o=$f(i).animationName;if(!o||o==="none"){t({type:"animation.end"});return}const a=c=>{ti(c)===i&&t({type:"animation.end"})};i.addEventListener("animationend",a);const l=ab(i,{animationFillMode:"forwards"});r=()=>{i.removeEventListener("animationend",a),PO(()=>l())}});return()=>{n(),r?.()}},trackTabbableElements:({scope:t,prop:e})=>{if(!e("collapsedHeight")&&!e("collapsedWidth"))return;const r=yy(t);if(!r)return;const n=()=>{const a=Um(r).map(l=>dfe(l,"inert",""));return()=>{a.forEach(l=>l())}};let i=n();const o=Yhe(r,{callback(){i(),i=n()}});return()=>{i(),o()}}},actions:{setInitial:({context:t,flush:e})=>{e(()=>{t.set("initial",!0)})},clearInitial:({context:t})=>{t.set("initial",!1)},cleanupNode:({refs:t})=>{t.set("stylesRef",null)},measureSize:({context:t,scope:e})=>{const r=yy(e);if(!r)return;const{height:n,width:i}=r.getBoundingClientRect();t.set("size",{height:n,width:i})},computeSize:({refs:t,scope:e,context:r})=>{t.get("cleanup")?.();const n=wt(()=>{const i=yy(e);if(!i)return;const o=i.hidden;i.style.animationName="none",i.style.animationDuration="0s",i.hidden=!1;const s=i.getBoundingClientRect();r.set("size",{height:s.height,width:s.width}),r.get("initial")&&(i.style.animationName="",i.style.animationDuration=""),i.hidden=o});t.set("cleanup",n)},invokeOnOpen:({prop:t})=>{t("onOpenChange")?.({open:!0})},invokeOnClose:({prop:t})=>{t("onOpenChange")?.({open:!1})},invokeOnExitComplete:({prop:t})=>{t("onExitComplete")?.()},toggleVisibility:({prop:t,send:e})=>{e({type:t("open")?"controlled.open":"controlled.close"})}}}};xt()(["dir","disabled","getRootNode","id","ids","collapsedHeight","collapsedWidth","onExitComplete","onOpenChange","defaultOpen","open"]);const Qfe=(t={})=>{const{lazyMount:e,unmountOnExit:r,...n}=t,i=E.useId(),o=E.useRef(!1),{dir:s}=Va(),{getRootNode:a}=Cs(),l={id:i,dir:s,getRootNode:a,...n},c=Ps(Ffe,l),u=Vfe(c,oa);u.visible&&(o.current=!0);const p=!u.visible&&!o.current&&e||r&&!u.visible&&o.current;return{...u,isUnmounted:p}},[Bfe,TU]=Cn({name:"CollapsibleContext",hookName:"useCollapsibleContext",providerName:"<CollapsibleProvider />"}),EU=E.forwardRef((t,e)=>{const[r,n]=Nfe(t),i=Qfe(r),o=Ae(i.getRootProps(),n);return h.jsx(Bfe,{value:i,children:h.jsx(Ue.div,{...o,ref:e})})});EU.displayName="CollapsibleRoot";var zfe=Object.defineProperty,qfe=(t,e,r)=>e in t?zfe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,DN=(t,e,r)=>qfe(t,e+"",r),Wfe=(t,e)=>{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0},LN=class{toHexInt(){return this.toFormat("rgba").toHexInt()}getChannelValue(t){if(t in this)return this[t];throw new Error("Unsupported color channel: "+t)}getChannelValuePercent(t,e){const r=e??this.getChannelValue(t),{minValue:n,maxValue:i}=this.getChannelRange(t);return Zde(r,n,i)}getChannelPercentValue(t,e){const{minValue:r,maxValue:n,step:i}=this.getChannelRange(t),o=Yde(e,r,n,i);return mF(o,r,n,i)}withChannelValue(t,e){const{minValue:r,maxValue:n}=this.getChannelRange(t);if(t in this){let i=this.clone();return i[t]=Eo(e,r,n),i}throw new Error("Unsupported color channel: "+t)}getColorAxes(t){let{xChannel:e,yChannel:r}=t,n=e||this.getChannels().find(s=>s!==r),i=r||this.getChannels().find(s=>s!==n),o=this.getChannels().find(s=>s!==n&&s!==i);return{xChannel:n,yChannel:i,zChannel:o}}incrementChannel(t,e){const{minValue:r,maxValue:n,step:i}=this.getChannelRange(t),o=mF(Eo(this.getChannelValue(t)+e,r,n),r,n,i);return this.withChannelValue(t,o)}decrementChannel(t,e){return this.incrementChannel(t,-e)}isEqual(t){return Wfe(this.toJSON(),t.toJSON())&&this.getChannelValue("alpha")===t.getChannelValue("alpha")}},Ufe=/^#[\da-f]+$/i,Hfe=/^rgba?\((.*)\)$/,Gfe=/[^#]/gi,RU=class LS extends LN{constructor(e,r,n,i){super(),this.red=e,this.green=r,this.blue=n,this.alpha=i}static parse(e){let r=[];if(Ufe.test(e)&&[4,5,7,9].includes(e.length)){const i=(e.length<6?e.replace(Gfe,"$&$&"):e).slice(1).split("");for(;i.length>0;)r.push(parseInt(i.splice(0,2).join(""),16));r[3]=r[3]!==void 0?r[3]/255:void 0}const n=e.match(Hfe);return n?.[1]&&(r=n[1].split(",").map(i=>Number(i.trim())).map((i,o)=>Eo(i,0,o<3?255:1))),r.length<3?void 0:new LS(r[0],r[1],r[2],r[3]??1)}toString(e){switch(e){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(this.alpha*255).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"hsb":return this.toHSB().toString("hsb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"rgba":return this;case"hsba":return this.toHSB();case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const e=this.red/255,r=this.green/255,n=this.blue/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a=o===0?0:s/o;let l=0;if(s!==0){switch(o){case e:l=(r-n)/s+(r<n?6:0);break;case r:l=(n-e)/s+2;break;case n:l=(e-r)/s+4;break}l/=6}return new QN(On(l*360,2),On(a*100,2),On(o*100,2),On(this.alpha,2))}toHSL(){const e=this.red/255,r=this.green/255,n=this.blue/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=(o+i)/2,a=o-i;let l=-1,c=-1;if(a===0)l=c=0;else{switch(c=a/(s<.5?o+i:2-o-i),o){case e:l=(r-n)/a+(r<n?6:0);break;case r:l=(n-e)/a+2;break;case n:l=(e-r)/a+4;break}l/=6}return new FN(On(l*360,2),On(c*100,2),On(s*100,2),On(this.alpha,2))}clone(){return new LS(this.red,this.green,this.blue,this.alpha)}getChannelFormatOptions(e){switch(e){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,r){let n=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return new Intl.NumberFormat(r,n).format(i)}getChannelRange(e){switch(e){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{r:this.red,g:this.green,b:this.blue,a:this.alpha}}getFormat(){return"rgba"}getChannels(){return LS.colorChannels}};DN(RU,"colorChannels",["red","green","blue"]);var VN=RU,Xfe=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,IU=class VS extends LN{constructor(e,r,n,i){super(),this.hue=e,this.saturation=r,this.lightness=n,this.alpha=i}static parse(e){let r;if(r=e.match(Xfe)){const[n,i,o,s]=(r[1]??r[2]).split(",").map(a=>Number(a.trim().replace("%","")));return new VS(G9(n,360),Eo(i,0,100),Eo(o,0,100),Eo(s??1,0,1))}}toString(e){switch(e){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${On(this.saturation,2)}%, ${On(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${On(this.saturation,2)}%, ${On(this.lightness,2)}%, ${this.alpha})`;case"hsb":return this.toHSB().toString("hsb");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsla":return this;case"hsba":return this.toHSB();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+e)}}toHSB(){let e=this.saturation/100,r=this.lightness/100,n=r+e*Math.min(r,1-r);return e=n===0?0:2*(1-r/n),new QN(On(this.hue,2),On(e*100,2),On(n*100,2),On(this.alpha,2))}toRGB(){let e=this.hue,r=this.saturation/100,n=this.lightness/100,i=r*Math.min(n,1-n),o=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return new VN(Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255),On(this.alpha,2))}clone(){return new VS(this.hue,this.saturation,this.lightness,this.alpha)}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,r){let n=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return(e==="saturation"||e==="lightness")&&(i/=100),new Intl.NumberFormat(r,n).format(i)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{h:this.hue,s:this.saturation,l:this.lightness,a:this.alpha}}getFormat(){return"hsla"}getChannels(){return VS.colorChannels}};DN(IU,"colorChannels",["hue","saturation","lightness"]);var FN=IU,Zfe=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,jU=class FS extends LN{constructor(e,r,n,i){super(),this.hue=e,this.saturation=r,this.brightness=n,this.alpha=i}static parse(e){let r;if(r=e.match(Zfe)){const[n,i,o,s]=(r[1]??r[2]).split(",").map(a=>Number(a.trim().replace("%","")));return new FS(G9(n,360),Eo(i,0,100),Eo(o,0,100),Eo(s??1,0,1))}}toString(e){switch(e){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${On(this.saturation,2)}%, ${On(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${On(this.saturation,2)}%, ${On(this.brightness,2)}%, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsba":return this;case"hsla":return this.toHSL();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+e)}}toHSL(){let e=this.saturation/100,r=this.brightness/100,n=r*(1-e/2);return e=n===0||n===1?0:(r-n)/Math.min(n,1-n),new FN(On(this.hue,2),On(e*100,2),On(n*100,2),On(this.alpha,2))}toRGB(){let e=this.hue,r=this.saturation/100,n=this.brightness/100,i=(o,s=(o+e/60)%6)=>n-r*n*Math.max(Math.min(s,4-s,1),0);return new VN(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),On(this.alpha,2))}clone(){return new FS(this.hue,this.saturation,this.brightness,this.alpha)}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,r){let n=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return(e==="saturation"||e==="brightness")&&(i/=100),new Intl.NumberFormat(r,n).format(i)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{h:this.hue,s:this.saturation,b:this.brightness,a:this.alpha}}getFormat(){return"hsba"}getChannels(){return FS.colorChannels}};DN(jU,"colorChannels",["hue","saturation","brightness"]);var QN=jU,Yfe="aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32",Kfe=t=>{const e=new Map,r=t.split(",");for(let n=0;n<r.length;n++){const[i,o]=r[n].split(":");e.set(i,`#${o}`),i.includes("gray")&&e.set(i.replace("gray","grey"),`#${o}`)}return e},PF=Kfe(Yfe),IC=t=>{if(PF.has(t))return IC(PF.get(t));const e=VN.parse(t)||QN.parse(t)||FN.parse(t);if(!e){const r=new Error("Invalid color value: "+t);throw Error.captureStackTrace?.(r,IC),r}return e};const Jfe=["top","right","bottom","left"],Wd=Math.min,Hs=Math.max,jC=Math.round,_w=Math.floor,cc=t=>({x:t,y:t}),epe={left:"right",right:"left",bottom:"top",top:"bottom"},tpe={start:"end",end:"start"};function Kj(t,e,r){return Hs(t,Wd(e,r))}function vu(t,e){return typeof t=="function"?t(e):t}function yu(t){return t.split("-")[0]}function Gm(t){return t.split("-")[1]}function BN(t){return t==="x"?"y":"x"}function zN(t){return t==="y"?"height":"width"}const rpe=new Set(["top","bottom"]);function tc(t){return rpe.has(yu(t))?"y":"x"}function qN(t){return BN(tc(t))}function npe(t,e,r){r===void 0&&(r=!1);const n=Gm(t),i=qN(t),o=zN(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=$C(s)),[s,$C(s)]}function ipe(t){const e=$C(t);return[Jj(t),e,Jj(e)]}function Jj(t){return t.replace(/start|end/g,e=>tpe[e])}const _F=["left","right"],TF=["right","left"],ope=["top","bottom"],spe=["bottom","top"];function ape(t,e,r){switch(t){case"top":case"bottom":return r?e?TF:_F:e?_F:TF;case"left":case"right":return e?ope:spe;default:return[]}}function lpe(t,e,r,n){const i=Gm(t);let o=ape(yu(t),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Jj)))),o}function $C(t){return t.replace(/left|right|bottom|top/g,e=>epe[e])}function cpe(t){return{top:0,right:0,bottom:0,left:0,...t}}function $U(t){return typeof t!="number"?cpe(t):{top:t,right:t,bottom:t,left:t}}function AC(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function EF(t,e,r){let{reference:n,floating:i}=t;const o=tc(e),s=qN(e),a=zN(s),l=yu(e),c=o==="y",u=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2,m=n[a]/2-i[a]/2;let v;switch(l){case"top":v={x:u,y:n.y-i.height};break;case"bottom":v={x:u,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:p};break;case"left":v={x:n.x-i.width,y:p};break;default:v={x:n.x,y:n.y}}switch(Gm(e)){case"start":v[s]-=m*(r&&c?-1:1);break;case"end":v[s]+=m*(r&&c?-1:1);break}return v}const upe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:p}=EF(c,n,l),m=n,v={},b=0;for(let O=0;O<a.length;O++){const{name:x,fn:S}=a[O],{x:w,y:k,data:P,reset:_}=await S({x:u,y:p,initialPlacement:n,placement:m,strategy:i,middlewareData:v,rects:c,platform:s,elements:{reference:t,floating:e}});u=w??u,p=k??p,v={...v,[x]:{...v[x],...P}},_&&b<=50&&(b++,typeof _=="object"&&(_.placement&&(m=_.placement),_.rects&&(c=_.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:p}=EF(c,m,l)),O=-1)}return{x:u,y:p,placement:m,strategy:i,middlewareData:v}};async function cb(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=vu(e,t),b=$U(v),x=a[m?p==="floating"?"reference":"floating":p],S=AC(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(x)))==null||r?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=p==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},_=AC(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:k,strategy:l}):w);return{top:(S.top-_.top+b.top)/P.y,bottom:(_.bottom-S.bottom+b.bottom)/P.y,left:(S.left-_.left+b.left)/P.x,right:(_.right-S.right+b.right)/P.x}}const dpe=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=vu(t,e)||{};if(c==null)return{};const p=$U(u),m={x:r,y:n},v=qN(i),b=zN(v),O=await s.getDimensions(c),x=v==="y",S=x?"top":"left",w=x?"bottom":"right",k=x?"clientHeight":"clientWidth",P=o.reference[b]+o.reference[v]-m[v]-o.floating[b],_=m[v]-o.reference[v],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let R=T?T[k]:0;(!R||!await(s.isElement==null?void 0:s.isElement(T)))&&(R=a.floating[k]||o.floating[b]);const $=P/2-_/2,A=R/2-O[b]/2-1,M=Wd(p[S],A),Q=Wd(p[w],A),V=M,q=R-O[b]-Q,N=R/2-O[b]/2+$,B=Kj(V,N,q),re=!l.arrow&&Gm(i)!=null&&N!==B&&o.reference[b]/2-(N<V?M:Q)-O[b]/2<0,he=re?N<V?N-V:N-q:0;return{[v]:m[v]+he,data:{[v]:B,centerOffset:N-B-he,...re&&{alignmentOffset:he}},reset:re}}}),hpe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:O=!0,...x}=vu(t,e);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const S=yu(i),w=tc(a),k=yu(a)===a,P=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=m||(k||!O?[$C(a)]:ipe(a)),T=b!=="none";!m&&T&&_.push(...lpe(a,O,b,P));const R=[a,..._],$=await cb(e,x),A=[];let M=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&A.push($[S]),p){const N=npe(i,s,P);A.push($[N[0]],$[N[1]])}if(M=[...M,{placement:i,overflows:A}],!A.every(N=>N<=0)){var Q,V;const N=(((Q=o.flip)==null?void 0:Q.index)||0)+1,B=R[N];if(B&&(!(p==="alignment"?w!==tc(B):!1)||M.every(ne=>tc(ne.placement)===w?ne.overflows[0]>0:!0)))return{data:{index:N,overflows:M},reset:{placement:B}};let re=(V=M.filter(he=>he.overflows[0]<=0).sort((he,ne)=>he.overflows[1]-ne.overflows[1])[0])==null?void 0:V.placement;if(!re)switch(v){case"bestFit":{var q;const he=(q=M.filter(ne=>{if(T){const se=tc(ne.placement);return se===w||se==="y"}return!0}).map(ne=>[ne.placement,ne.overflows.filter(se=>se>0).reduce((se,X)=>se+X,0)]).sort((ne,se)=>ne[1]-se[1])[0])==null?void 0:q[0];he&&(re=he);break}case"initialPlacement":re=a;break}if(i!==re)return{reset:{placement:re}}}return{}}}};function RF(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function IF(t){return Jfe.some(e=>t[e]>=0)}const fpe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=vu(t,e);switch(n){case"referenceHidden":{const o=await cb(e,{...i,elementContext:"reference"}),s=RF(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:IF(s)}}}case"escaped":{const o=await cb(e,{...i,altBoundary:!0}),s=RF(o,r.floating);return{data:{escapedOffsets:s,escaped:IF(s)}}}default:return{}}}}},AU=new Set(["left","top"]);async function ppe(t,e){const{placement:r,platform:n,elements:i}=t,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=yu(r),a=Gm(r),l=tc(r)==="y",c=AU.has(s)?-1:1,u=o&&l?-1:1,p=vu(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof b=="number"&&(v=a==="end"?b*-1:b),l?{x:v*u,y:m*c}:{x:m*c,y:v*u}}const gpe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await ppe(e,t);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},mpe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:S,y:w}=x;return{x:S,y:w}}},...l}=vu(t,e),c={x:r,y:n},u=await cb(e,l),p=tc(yu(i)),m=BN(p);let v=c[m],b=c[p];if(o){const x=m==="y"?"top":"left",S=m==="y"?"bottom":"right",w=v+u[x],k=v-u[S];v=Kj(w,v,k)}if(s){const x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",w=b+u[x],k=b-u[S];b=Kj(w,b,k)}const O=a.fn({...e,[m]:v,[p]:b});return{...O,data:{x:O.x-r,y:O.y-n,enabled:{[m]:o,[p]:s}}}}}},vpe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=vu(t,e),u={x:r,y:n},p=tc(i),m=BN(p);let v=u[m],b=u[p];const O=vu(a,e),x=typeof O=="number"?{mainAxis:O,crossAxis:0}:{mainAxis:0,crossAxis:0,...O};if(l){const k=m==="y"?"height":"width",P=o.reference[m]-o.floating[k]+x.mainAxis,_=o.reference[m]+o.reference[k]-x.mainAxis;v<P?v=P:v>_&&(v=_)}if(c){var S,w;const k=m==="y"?"width":"height",P=AU.has(yu(i)),_=o.reference[p]-o.floating[k]+(P&&((S=s.offset)==null?void 0:S[p])||0)+(P?0:x.crossAxis),T=o.reference[p]+o.reference[k]+(P?0:((w=s.offset)==null?void 0:w[p])||0)-(P?x.crossAxis:0);b<_?b=_:b>T&&(b=T)}return{[m]:v,[p]:b}}}},ype=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=vu(t,e),u=await cb(e,c),p=yu(i),m=Gm(i),v=tc(i)==="y",{width:b,height:O}=o.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(S=p,x=m==="end"?"top":"bottom");const w=O-u.top-u.bottom,k=b-u.left-u.right,P=Wd(O-u[x],w),_=Wd(b-u[S],k),T=!e.middlewareData.shift;let R=P,$=_;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&($=k),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(R=w),T&&!m){const M=Hs(u.left,0),Q=Hs(u.right,0),V=Hs(u.top,0),q=Hs(u.bottom,0);v?$=b-2*(M!==0||Q!==0?M+Q:Hs(u.left,u.right)):R=O-2*(V!==0||q!==0?V+q:Hs(u.top,u.bottom))}await l({...e,availableWidth:$,availableHeight:R});const A=await s.getDimensions(a.floating);return b!==A.width||O!==A.height?{reset:{rects:!0}}:{}}}};function RP(){return typeof window<"u"}function Xm(t){return NU(t)?(t.nodeName||"").toLowerCase():"#document"}function Js(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function kc(t){var e;return(e=(NU(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function NU(t){return RP()?t instanceof Node||t instanceof Js(t).Node:!1}function pl(t){return RP()?t instanceof Element||t instanceof Js(t).Element:!1}function mc(t){return RP()?t instanceof HTMLElement||t instanceof Js(t).HTMLElement:!1}function jF(t){return!RP()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Js(t).ShadowRoot}const bpe=new Set(["inline","contents"]);function _O(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=gl(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!bpe.has(i)}const Ope=new Set(["table","td","th"]);function xpe(t){return Ope.has(Xm(t))}const wpe=[":popover-open",":modal"];function IP(t){return wpe.some(e=>{try{return t.matches(e)}catch{return!1}})}const Spe=["transform","translate","scale","rotate","perspective"],Cpe=["transform","translate","scale","rotate","perspective","filter"],kpe=["paint","layout","strict","content"];function WN(t){const e=UN(),r=pl(t)?gl(t):t;return Spe.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||Cpe.some(n=>(r.willChange||"").includes(n))||kpe.some(n=>(r.contain||"").includes(n))}function Ppe(t){let e=Ud(t);for(;mc(e)&&!um(e);){if(WN(e))return e;if(IP(e))return null;e=Ud(e)}return null}function UN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _pe=new Set(["html","body","#document"]);function um(t){return _pe.has(Xm(t))}function gl(t){return Js(t).getComputedStyle(t)}function jP(t){return pl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ud(t){if(Xm(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jF(t)&&t.host||kc(t);return jF(e)?e.host:e}function MU(t){const e=Ud(t);return um(e)?t.ownerDocument?t.ownerDocument.body:t.body:mc(e)&&_O(e)?e:MU(e)}function ub(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=MU(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),s=Js(i);if(o){const a=e2(s);return e.concat(s,s.visualViewport||[],_O(i)?i:[],a&&r?ub(a):[])}return e.concat(i,ub(i,[],r))}function e2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function DU(t){const e=gl(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=mc(t),o=i?t.offsetWidth:r,s=i?t.offsetHeight:n,a=jC(r)!==o||jC(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function HN(t){return pl(t)?t:t.contextElement}function Wg(t){const e=HN(t);if(!mc(e))return cc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:o}=DU(e);let s=(o?jC(r.width):r.width)/n,a=(o?jC(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Tpe=cc(0);function LU(t){const e=Js(t);return!UN()||!e.visualViewport?Tpe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Epe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Js(t)?!1:e}function Af(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),o=HN(t);let s=cc(1);e&&(n?pl(n)&&(s=Wg(n)):s=Wg(t));const a=Epe(o,r,n)?LU(o):cc(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,p=i.height/s.y;if(o){const m=Js(o),v=n&&pl(n)?Js(n):n;let b=m,O=e2(b);for(;O&&n&&v!==b;){const x=Wg(O),S=O.getBoundingClientRect(),w=gl(O),k=S.left+(O.clientLeft+parseFloat(w.paddingLeft))*x.x,P=S.top+(O.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,p*=x.y,l+=k,c+=P,b=Js(O),O=e2(b)}}return AC({width:u,height:p,x:l,y:c})}function $P(t,e){const r=jP(t).scrollLeft;return e?e.left+r:Af(kc(t)).left+r}function VU(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-$P(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function Rpe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const o=i==="fixed",s=kc(n),a=e?IP(e.floating):!1;if(n===s||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=cc(1);const u=cc(0),p=mc(n);if((p||!p&&!o)&&((Xm(n)!=="body"||_O(s))&&(l=jP(n)),mc(n))){const v=Af(n);c=Wg(n),u.x=v.x+n.clientLeft,u.y=v.y+n.clientTop}const m=s&&!p&&!o?VU(s,l):cc(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:r.y*c.y-l.scrollTop*c.y+u.y+m.y}}function Ipe(t){return Array.from(t.getClientRects())}function jpe(t){const e=kc(t),r=jP(t),n=t.ownerDocument.body,i=Hs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Hs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+$P(t);const a=-r.scrollTop;return gl(n).direction==="rtl"&&(s+=Hs(e.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:a}}const $F=25;function $pe(t,e){const r=Js(t),n=kc(t),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const u=UN();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=$P(n);if(c<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),v=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-v);b<=$F&&(o-=b)}else c<=$F&&(o+=c);return{width:o,height:s,x:a,y:l}}const Ape=new Set(["absolute","fixed"]);function Npe(t,e){const r=Af(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,o=mc(t)?Wg(t):cc(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=n*o.y;return{width:s,height:a,x:l,y:c}}function AF(t,e,r){let n;if(e==="viewport")n=$pe(t,r);else if(e==="document")n=jpe(kc(t));else if(pl(e))n=Npe(e,r);else{const i=LU(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return AC(n)}function FU(t,e){const r=Ud(t);return r===e||!pl(r)||um(r)?!1:gl(r).position==="fixed"||FU(r,e)}function Mpe(t,e){const r=e.get(t);if(r)return r;let n=ub(t,[],!1).filter(a=>pl(a)&&Xm(a)!=="body"),i=null;const o=gl(t).position==="fixed";let s=o?Ud(t):t;for(;pl(s)&&!um(s);){const a=gl(s),l=WN(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Ape.has(i.position)||_O(s)&&!l&&FU(t,s))?n=n.filter(u=>u!==s):i=a,s=Ud(s)}return e.set(t,n),n}function Dpe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const s=[...r==="clippingAncestors"?IP(e)?[]:Mpe(e,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,u)=>{const p=AF(e,u,i);return c.top=Hs(p.top,c.top),c.right=Wd(p.right,c.right),c.bottom=Wd(p.bottom,c.bottom),c.left=Hs(p.left,c.left),c},AF(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Lpe(t){const{width:e,height:r}=DU(t);return{width:e,height:r}}function Vpe(t,e,r){const n=mc(e),i=kc(e),o=r==="fixed",s=Af(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=cc(0);function c(){l.x=$P(i)}if(n||!n&&!o)if((Xm(e)!=="body"||_O(i))&&(a=jP(e)),n){const v=Af(e,!0,o,e);l.x=v.x+e.clientLeft,l.y=v.y+e.clientTop}else i&&c();o&&!n&&i&&c();const u=i&&!n&&!o?VU(i,a):cc(0),p=s.left+a.scrollLeft-l.x-u.x,m=s.top+a.scrollTop-l.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function gR(t){return gl(t).position==="static"}function NF(t,e){if(!mc(t)||gl(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return kc(t)===r&&(r=r.ownerDocument.body),r}function QU(t,e){const r=Js(t);if(IP(t))return r;if(!mc(t)){let i=Ud(t);for(;i&&!um(i);){if(pl(i)&&!gR(i))return i;i=Ud(i)}return r}let n=NF(t,e);for(;n&&xpe(n)&&gR(n);)n=NF(n,e);return n&&um(n)&&gR(n)&&!WN(n)?r:n||Ppe(t)||r}const Fpe=async function(t){const e=this.getOffsetParent||QU,r=this.getDimensions,n=await r(t.floating);return{reference:Vpe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Qpe(t){return gl(t).direction==="rtl"}const Bpe={convertOffsetParentRelativeRectToViewportRelativeRect:Rpe,getDocumentElement:kc,getClippingRect:Dpe,getOffsetParent:QU,getElementRects:Fpe,getClientRects:Ipe,getDimensions:Lpe,getScale:Wg,isElement:pl,isRTL:Qpe};function BU(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function zpe(t,e){let r=null,n;const i=kc(t);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:p,width:m,height:v}=c;if(a||e(),!m||!v)return;const b=_w(p),O=_w(i.clientWidth-(u+m)),x=_w(i.clientHeight-(p+v)),S=_w(u),k={rootMargin:-b+"px "+-O+"px "+-x+"px "+-S+"px",threshold:Hs(0,Wd(1,l))||1};let P=!0;function _(T){const R=T[0].intersectionRatio;if(R!==l){if(!P)return s();R?s(!1,R):n=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!BU(c,t.getBoundingClientRect())&&s(),P=!1}try{r=new IntersectionObserver(_,{...k,root:i.ownerDocument})}catch{r=new IntersectionObserver(_,k)}r.observe(t)}return s(!0),o}function qpe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=HN(t),u=i||o?[...c?ub(c):[],...ub(e)]:[];u.forEach(S=>{i&&S.addEventListener("scroll",r,{passive:!0}),o&&S.addEventListener("resize",r)});const p=c&&a?zpe(c,r):null;let m=-1,v=null;s&&(v=new ResizeObserver(S=>{let[w]=S;w&&w.target===c&&v&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=v)==null||k.observe(e)})),r()}),c&&!l&&v.observe(c),v.observe(e));let b,O=l?Af(t):null;l&&x();function x(){const S=Af(t);O&&!BU(O,S)&&r(),O=S,b=requestAnimationFrame(x)}return r(),()=>{var S;u.forEach(w=>{i&&w.removeEventListener("scroll",r),o&&w.removeEventListener("resize",r)}),p?.(),(S=v)==null||S.disconnect(),v=null,l&&cancelAnimationFrame(b)}}const Wpe=gpe,Upe=mpe,Hpe=hpe,Gpe=ype,Xpe=fpe,Zpe=dpe,Ype=vpe,Kpe=(t,e,r)=>{const n=new Map,i={platform:Bpe,...r},o={...i.platform,_c:n};return upe(t,e,{...i,platform:o})};function MF(t=0,e=0,r=0,n=0){if(typeof DOMRect=="function")return new DOMRect(t,e,r,n);const i={x:t,y:e,width:r,height:n,top:e,right:t+r,bottom:e+n,left:t};return{...i,toJSON:()=>i}}function Jpe(t){if(!t)return MF();const{x:e,y:r,width:n,height:i}=t;return MF(e,r,n,i)}function ege(t,e){return{contextElement:Yi(t)?t:void 0,getBoundingClientRect:()=>{const r=t,n=e?.(r);return n||!r?Jpe(n):r.getBoundingClientRect()}}}var by=t=>({variable:t,reference:`var(${t})`}),Jc={arrowSize:by("--arrow-size"),arrowSizeHalf:by("--arrow-size-half"),arrowBg:by("--arrow-background"),transformOrigin:by("--transform-origin"),arrowOffset:by("--arrow-offset")},tge=t=>t==="top"||t==="bottom"?"y":"x";function rge(t,e){return{name:"transformOrigin",fn(r){const{elements:n,middlewareData:i,placement:o,rects:s,y:a}=r,l=o.split("-")[0],c=tge(l),u=i.arrow?.x||0,p=i.arrow?.y||0,m=e?.clientWidth||0,v=e?.clientHeight||0,b=u+m/2,O=p+v/2,x=Math.abs(i.shift?.y||0),S=s.reference.height/2,w=v/2,k=t.offset?.mainAxis??t.gutter,P=typeof k=="number"?k+w:k??w,_=x>P,T={top:`${b}px calc(100% + ${P}px)`,bottom:`${b}px ${-P}px`,left:`calc(100% + ${P}px) ${O}px`,right:`${-P}px ${O}px`}[l],R=`${b}px ${s.reference.y+S-a}px`,$=!!t.overlap&&c==="y"&&_;return n.floating.style.setProperty(Jc.transformOrigin.variable,$?R:T),{data:{transformOrigin:$?R:T}}}}}var nge={name:"rects",fn({rects:t}){return{data:t}}},ige=t=>{if(t)return{name:"shiftArrow",fn({placement:e,middlewareData:r}){if(!r.arrow)return{};const{x:n,y:i}=r.arrow,o=e.split("-")[0];return Object.assign(t.style,{left:n!=null?`${n}px`:"",top:i!=null?`${i}px`:"",[o]:`calc(100% + ${Jc.arrowOffset.reference})`}),{}}}};function oge(t){const[e,r]=t.split("-");return{side:e,align:r,hasAlign:r!=null}}function sge(t){return t.split("-")[0]}var age={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function DF(t,e){const r=t.devicePixelRatio||1;return Math.round(e*r)/r}function GN(t){return typeof t=="function"?t():t==="clipping-ancestors"?"clippingAncestors":t}function lge(t,e,r){const n=t||e.createElement("div");return Zpe({element:n,padding:r.arrowPadding})}function cge(t,e){if(!jde(e.offset??e.gutter))return Wpe(({placement:r})=>{const n=(t?.clientHeight||0)/2,i=e.offset?.mainAxis??e.gutter,o=typeof i=="number"?i+n:i??n,{hasAlign:s}=oge(r),a=s?void 0:e.shift,l=e.offset?.crossAxis??a;return qm({crossAxis:l,mainAxis:o,alignmentAxis:e.shift})})}function uge(t){if(!t.flip)return;const e=GN(t.boundary);return Hpe({...e?{boundary:e}:void 0,padding:t.overflowPadding,fallbackPlacements:t.flip===!0?void 0:t.flip})}function dge(t){if(!t.slide&&!t.overlap)return;const e=GN(t.boundary);return Upe({...e?{boundary:e}:void 0,mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding,limiter:Ype()})}function hge(t){return Gpe({padding:t.overflowPadding,apply({elements:e,rects:r,availableHeight:n,availableWidth:i}){const o=e.floating,s=Math.round(r.reference.width),a=Math.round(r.reference.height);i=Math.floor(i),n=Math.floor(n),o.style.setProperty("--reference-width",`${s}px`),o.style.setProperty("--reference-height",`${a}px`),o.style.setProperty("--available-width",`${i}px`),o.style.setProperty("--available-height",`${n}px`)}})}function fge(t){if(t.hideWhenDetached)return Xpe({strategy:"referenceHidden",boundary:GN(t.boundary)??"clippingAncestors"})}function pge(t){return t?t===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:t:{}}function gge(t,e,r={}){const n=ege(t,r.getAnchorRect);if(!e||!n)return;const i=Object.assign({},age,r),o=e.querySelector("[data-part=arrow]"),s=[cge(o,i),uge(i),dge(i),lge(o,e.ownerDocument,i),ige(o),rge({gutter:i.gutter,offset:i.offset,overlap:i.overlap},o),hge(i),fge(i),nge],{placement:a,strategy:l,onComplete:c,onPositioned:u}=i,p=async()=>{if(!n||!e)return;const O=await Kpe(n,e,{placement:a,middleware:s,strategy:l});c?.(O),u?.({placed:!0});const x=hi(e),S=DF(x,O.x),w=DF(x,O.y);e.style.setProperty("--x",`${S}px`),e.style.setProperty("--y",`${w}px`),i.hideWhenDetached&&(O.middlewareData.hide?.referenceHidden?(e.style.setProperty("visibility","hidden"),e.style.setProperty("pointer-events","none")):(e.style.removeProperty("visibility"),e.style.removeProperty("pointer-events")));const k=e.firstElementChild;if(k){const P=$f(k);e.style.setProperty("--z-index",P.zIndex)}},m=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:p,floatingElement:e}),u?.({placed:!0})):await p()},v=pge(i.listeners),b=i.listeners?qpe(n,e,m,v):Fde;return m(),()=>{b?.(),u?.({placed:!1})}}function ra(t,e,r={}){const{defer:n,...i}=r,o=n?wt:a=>a(),s=[];return s.push(o(()=>{const a=typeof t=="function"?t():t,l=typeof e=="function"?e():e;s.push(gge(a,l,i))})),()=>{s.forEach(a=>a?.())}}var mge={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function AP(t={}){const{placement:e,sameWidth:r,fitViewport:n,strategy:i="absolute"}=t;return{arrow:{position:"absolute",width:Jc.arrowSize.reference,height:Jc.arrowSize.reference,[Jc.arrowSizeHalf.variable]:`calc(${Jc.arrowSize.reference} / 2)`,[Jc.arrowOffset.variable]:`calc(${Jc.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:e?mge[e.split("-")[0]]:void 0,background:Jc.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:r?void 0:"max-content",width:r?"var(--reference-width)":void 0,maxWidth:n?"var(--available-width)":void 0,maxHeight:n?"var(--available-height)":void 0,pointerEvents:e?void 0:"none",top:"0px",left:"0px",transform:e?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function vge(t){const e={each(r){for(let n=0;n<t.frames?.length;n+=1){const i=t.frames[n];i&&r(i)}},addEventListener(r,n,i){return e.each(o=>{try{o.document.addEventListener(r,n,i)}catch{}}),()=>{try{e.removeEventListener(r,n,i)}catch{}}},removeEventListener(r,n,i){e.each(o=>{try{o.document.removeEventListener(r,n,i)}catch{}})}};return e}function yge(t){const e=t.frameElement!=null?t.parent:null;return{addEventListener:(r,n,i)=>{try{e?.addEventListener(r,n,i)}catch{}return()=>{try{e?.removeEventListener(r,n,i)}catch{}}},removeEventListener:(r,n,i)=>{try{e?.removeEventListener(r,n,i)}catch{}}}}var LF="pointerdown.outside",VF="focus.outside";function bge(t){for(const e of t)if(Yi(e)&&Ld(e))return!0;return!1}var zU=t=>"clientY"in t;function Oge(t,e){if(!zU(e)||!t)return!1;const r=t.getBoundingClientRect();return r.width===0||r.height===0?!1:r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}function xge(t,e){return t.y<=e.y&&e.y<=t.y+t.height&&t.x<=e.x&&e.x<=t.x+t.width}function FF(t,e){if(!e||!zU(t))return!1;const r=e.scrollHeight>e.clientHeight,n=r&&t.clientX>e.offsetLeft+e.clientWidth,i=e.scrollWidth>e.clientWidth,o=i&&t.clientY>e.offsetTop+e.clientHeight,s={x:e.offsetLeft,y:e.offsetTop,width:e.clientWidth+(r?16:0),height:e.clientHeight+(i?16:0)},a={x:t.clientX,y:t.clientY};return xge(s,a)?n||o:!1}function wge(t,e){const{exclude:r,onFocusOutside:n,onPointerDownOutside:i,onInteractOutside:o,defer:s,followControlledElements:a=!0}=e;if(!t)return;const l=ks(t),c=hi(t),u=vge(c),p=yge(c);function m(k,P){if(!Yi(P)||!P.isConnected||ys(t,P)||Oge(t,k)||a&&nU(t,P))return!1;const _=l.querySelector(`[aria-controls="${t.id}"]`);if(_){const R=TC(_);if(FF(k,R))return!1}const T=TC(t);return FF(k,T)?!1:!r?.(P)}const v=new Set,b=jf(t?.getRootNode());function O(k){function P(_){const T=s&&!bF()?wt:A=>A(),R=_??k,$=R?.composedPath?.()??[R?.target];T(()=>{const A=b?$[0]:ti(k);if(!(!t||!m(k,A))){if(i||o){const M=ib(i,o);t.addEventListener(LF,M,{once:!0})}QF(t,LF,{bubbles:!1,cancelable:!0,detail:{originalEvent:R,contextmenu:lU(R),focusable:bge($),target:A}})}})}k.pointerType==="touch"?(v.forEach(_=>_()),v.add(hr(l,"click",P,{once:!0})),v.add(p.addEventListener("click",P,{once:!0})),v.add(u.addEventListener("click",P,{once:!0}))):P()}const x=new Set,S=setTimeout(()=>{x.add(hr(l,"pointerdown",O,!0)),x.add(p.addEventListener("pointerdown",O,!0)),x.add(u.addEventListener("pointerdown",O,!0))},0);function w(k){(s?wt:_=>_())(()=>{const _=ti(k);if(!(!t||!m(k,_))){if(n||o){const T=ib(n,o);t.addEventListener(VF,T,{once:!0})}QF(t,VF,{bubbles:!1,cancelable:!0,detail:{originalEvent:k,contextmenu:!1,focusable:Ld(_),target:_}})}})}return bF()||(x.add(hr(l,"focusin",w,!0)),x.add(p.addEventListener("focusin",w,!0)),x.add(u.addEventListener("focusin",w,!0))),()=>{clearTimeout(S),v.forEach(k=>k()),x.forEach(k=>k())}}function Sge(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=typeof t=="function"?t():t;i.push(wge(o,e))})),()=>{i.forEach(o=>o?.())}}function QF(t,e,r){const n=t.ownerDocument.defaultView||window,i=new n.CustomEvent(e,r);return t.dispatchEvent(i)}function Cge(t,e){const r=n=>{n.key==="Escape"&&(n.isComposing||e?.(n))};return hr(ks(t),"keydown",r,{capture:!0})}var BF="layer:request-dismiss",as={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(t=>t.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(t){const e=this.indexOf(t),r=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return e<r},isTopMost(t){return this.layers[this.count()-1]?.node===t},getNestedLayers(t){return Array.from(this.layers).slice(this.indexOf(t)+1)},getLayersByType(t){return this.layers.filter(e=>e.type===t)},getNestedLayersByType(t,e){const r=this.indexOf(t);return r===-1?[]:this.layers.slice(r+1).filter(n=>n.type===e)},getParentLayerOfType(t,e){const r=this.indexOf(t);if(!(r<=0))return this.layers.slice(0,r).reverse().find(n=>n.type===e)},countNestedLayersOfType(t,e){return this.getNestedLayersByType(t,e).length},isInNestedLayer(t,e){return this.getNestedLayers(t).some(r=>ys(r.node,e))},isInBranch(t){return Array.from(this.branches).some(e=>ys(e,t))},add(t){this.layers.push(t),this.syncLayers()},addBranch(t){this.branches.push(t)},remove(t){const e=this.indexOf(t);e<0||(e<this.count()-1&&this.getNestedLayers(t).forEach(n=>as.dismiss(n.node,t)),this.layers.splice(e,1),this.syncLayers())},removeBranch(t){const e=this.branches.indexOf(t);e>=0&&this.branches.splice(e,1)},syncLayers(){this.layers.forEach((t,e)=>{t.node.style.setProperty("--layer-index",`${e}`),t.node.removeAttribute("data-nested"),t.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(t.node,t.type)&&t.node.setAttribute("data-nested",t.type);const n=this.countNestedLayersOfType(t.node,t.type);n>0&&t.node.setAttribute("data-has-nested",t.type),t.node.style.setProperty("--nested-layer-count",`${n}`)})},indexOf(t){return this.layers.findIndex(e=>e.node===t)},dismiss(t,e){const r=this.indexOf(t);if(r===-1)return;const n=this.layers[r];Pge(t,BF,i=>{n.requestDismiss?.(i),i.defaultPrevented||n?.dismiss()}),kge(t,BF,{originalLayer:t,targetLayer:e,originalIndex:r,targetIndex:e?this.indexOf(e):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function kge(t,e,r){const n=t.ownerDocument.defaultView||window,i=new n.CustomEvent(e,{cancelable:!0,bubbles:!0,detail:r});return t.dispatchEvent(i)}function Pge(t,e,r){t.addEventListener(e,r,{once:!0})}var zF;function qF(){as.layers.forEach(({node:t})=>{t.style.pointerEvents=as.isBelowPointerBlockingLayer(t)?"none":"auto"})}function _ge(t){t.style.pointerEvents=""}function Tge(t,e){const r=ks(t),n=[];return as.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(zF=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","")})),e?.forEach(i=>{const[o,s]=mfe(()=>{const a=i();return Yi(a)?a:null},{timeout:1e3});o.then(a=>n.push(ab(a,{pointerEvents:"auto"}))),n.push(s)}),()=>{as.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=zF,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style")}),n.forEach(i=>i()))}}function Ege(t,e){const{warnOnMissingNode:r=!0}=e;if(r&&!t){cm("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!t)return;const{onDismiss:n,onRequestDismiss:i,pointerBlocking:o,exclude:s,debug:a,type:l="dialog"}=e,c={dismiss:n,node:t,type:l,pointerBlocking:o,requestDismiss:i};as.add(c),qF();function u(O){const x=ti(O.detail.originalEvent);as.isBelowPointerBlockingLayer(t)||as.isInBranch(x)||(e.onPointerDownOutside?.(O),e.onInteractOutside?.(O),!O.defaultPrevented&&(a&&console.log("onPointerDownOutside:",O.detail.originalEvent),n?.()))}function p(O){const x=ti(O.detail.originalEvent);as.isInBranch(x)||(e.onFocusOutside?.(O),e.onInteractOutside?.(O),!O.defaultPrevented&&(a&&console.log("onFocusOutside:",O.detail.originalEvent),n?.()))}function m(O){as.isTopMost(t)&&(e.onEscapeKeyDown?.(O),!O.defaultPrevented&&n&&(O.preventDefault(),n()))}function v(O){if(!t)return!1;const x=typeof s=="function"?s():s,S=Array.isArray(x)?x:[x],w=e.persistentElements?.map(k=>k()).filter(Yi);return w&&S.push(...w),S.some(k=>ys(k,O))||as.isInNestedLayer(t,O)}const b=[o?Tge(t,e.persistentElements):void 0,Cge(t,m),Sge(t,{exclude:v,onFocusOutside:p,onPointerDownOutside:u,defer:e.defer})];return()=>{as.remove(t),qF(),_ge(t),b.forEach(O=>O?.())}}function tp(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=kd(t)?t():t;i.push(Ege(o,e))})),()=>{i.forEach(o=>o?.())}}function Rge(t,e={}){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=kd(t)?t():t;if(!o){cm("[@zag-js/dismissable] branch node is `null` or `undefined`");return}as.addBranch(o),i.push(()=>{as.removeBranch(o)})})),()=>{i.forEach(o=>o?.())}}var qU=Ct("color-picker",["root","label","control","trigger","positioner","content","area","areaThumb","valueText","areaBackground","channelSlider","channelSliderLabel","channelSliderTrack","channelSliderThumb","channelSliderValueText","channelInput","transparencyGrid","swatchGroup","swatchTrigger","swatchIndicator","swatch","eyeDropperTrigger","formatTrigger","formatSelect"]);qU.build();var Ige=t=>t.ids?.hiddenInput??`color-picker:${t.id}:hidden-input`,jge=t=>t.ids?.control??`color-picker:${t.id}:control`,$ge=t=>t.ids?.trigger??`color-picker:${t.id}:trigger`,Age=t=>t.ids?.content??`color-picker:${t.id}:content`,Nge=t=>t.ids?.positioner??`color-picker:${t.id}:positioner`,Mge=t=>t.ids?.formatSelect??`color-picker:${t.id}:format-select`,Dge=t=>t.ids?.area??`color-picker:${t.id}:area`,Lge=t=>t.ids?.areaThumb??`color-picker:${t.id}:area-thumb`,Vge=(t,e)=>t.ids?.channelSliderTrack?.(e)??`color-picker:${t.id}:slider-track:${e}`,Fge=(t,e)=>t.ids?.channelSliderThumb?.(e)??`color-picker:${t.id}:slider-thumb:${e}`,QS=t=>t.getById(Age(t)),Qge=t=>t.getById(Lge(t)),Bge=(t,e)=>t.getById(Fge(t,e)),zge=t=>t.getById(Mge(t)),WF=t=>t.getById(Ige(t)),qge=t=>t.getById(Dge(t)),Wge=(t,e,r)=>{const n=qge(t);if(!n)return;const{getPercentValue:i}=pU(e,n);return{x:i({dir:r,orientation:"horizontal"}),y:i({orientation:"vertical"})}},Uge=t=>t.getById(jge(t)),mR=t=>t.getById($ge(t)),Hge=t=>t.getById(Nge(t)),Gge=(t,e)=>t.getById(Vge(t,e)),Xge=(t,e,r,n)=>{const i=Gge(t,r);if(!i)return;const{getPercentValue:o}=pU(e,i);return{x:o({dir:n,orientation:"horizontal"}),y:o({orientation:"vertical"})}},Zge=t=>[...sb(QS(t),"input[data-channel]"),...sb(Uge(t),"input[data-channel]")];function Yge(t,e){if(e==null)return"";if(e==="hex")return t.toString("hex");if(e==="css")return t.toString("css");if(e in t)return t.getChannelValue(e).toString();const r=t.getFormat()==="hsla";switch(e){case"hue":return r?t.toFormat("hsla").getChannelValue("hue").toString():t.toFormat("hsba").getChannelValue("hue").toString();case"saturation":return r?t.toFormat("hsla").getChannelValue("saturation").toString():t.toFormat("hsba").getChannelValue("saturation").toString();case"lightness":return t.toFormat("hsla").getChannelValue("lightness").toString();case"brightness":return t.toFormat("hsba").getChannelValue("brightness").toString();case"red":case"green":case"blue":return t.toFormat("rgba").getChannelValue(e).toString();default:return t.getChannelValue(e).toString()}}var UF=t=>IC(t),Kge=/^[0-9a-fA-F]{3,8}$/;function Jge(t){return Kge.test(t)}function eme(t){return t.startsWith("#")?t:Jge(t)?`#${t}`:t}var{and:tme}=Cl();tme("isOpenControlled","closeOnSelect");function HF(t,e,r){const n=Zge(t);wt(()=>{n.forEach(i=>{const o=i.dataset.channel;CO(i,Yge(r||e,o))})})}function rme(t,e){const r=zge(t);r&&wt(()=>CO(r,e))}xt()(["closeOnSelect","dir","disabled","format","defaultFormat","getRootNode","id","ids","initialFocusEl","inline","name","positioning","onFocusOutside","onFormatChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","onValueChangeEnd","defaultOpen","open","positioning","required","readOnly","value","defaultValue","invalid","openAutoFocus"]);xt()(["xChannel","yChannel"]);xt()(["channel","orientation"]);xt()(["value","disabled"]);xt()(["value","respectAlpha"]);xt()(["size"]);const[Zm,XN]=Cn({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),Ym=t=>Nn()(t,["lazyMount","unmountOnExit"]),[nme,ZN]=Cn({name:"AccordionItemPropsContext",hookName:"useAccordionItemPropsContext",providerName:"<AccordionItemPropsProvider />"}),WU=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["value","disabled"]),i=EP(),o=XN(),s=Ae(i.getItemProps(r),n),a=i.getItemState(r),l=i.getItemContentProps(r);return h.jsx(nme,{value:r,children:h.jsx(Afe,{value:a,children:h.jsx(EU,{ref:e,open:a.expanded,ids:{content:l.id},...o,...s})})})});WU.displayName="AccordionItem";const UU=E.forwardRef((t,e)=>{const r=TU();if(r.isUnmounted)return null;const n=Ae(r.getContentProps(),t);return h.jsx(Ue.div,{...n,ref:e})});UU.displayName="CollapsibleContent";const ime=Nn(),HU=E.forwardRef((t,e)=>{const r=EP(),n=ZN(),i=r.getItemContentProps(n),[,o]=ime(i,["hidden","data-state"]),s=Ae(o,t);return h.jsx(UU,{ref:e,...s})});HU.displayName="AccordionItemContent";const GU=E.forwardRef((t,e)=>{const r=EP(),n=ZN(),i=Ae(r.getItemIndicatorProps(n),t);return h.jsx(Ue.div,{...i,ref:e})});GU.displayName="AccordionItemIndicator";const XU=E.forwardRef((t,e)=>{const r=EP(),n=ZN(),i=TU(),o=r.getItemTriggerProps(n),s=Ae({...o,"aria-controls":i.isUnmounted?void 0:o["aria-controls"]},t);return h.jsx(Ue.button,{...s,ref:e})});XU.displayName="AccordionItemTrigger";var ZU=Ct("accordion").parts("root","item","itemTrigger","itemContent","itemIndicator"),Oy=ZU.build(),NC=t=>t.ids?.root??`accordion:${t.id}`,ome=(t,e)=>t.ids?.item?.(e)??`accordion:${t.id}:item:${e}`,GF=(t,e)=>t.ids?.itemContent?.(e)??`accordion:${t.id}:content:${e}`,MC=(t,e)=>t.ids?.itemTrigger?.(e)??`accordion:${t.id}:trigger:${e}`,sme=t=>t.getById(NC(t)),NP=t=>{const r=`[aria-controls][data-ownedby='${CSS.escape(NC(t))}']:not([disabled])`;return sb(sme(t),r)},ame=t=>zg(NP(t)),lme=t=>wP(NP(t)),cme=(t,e)=>bU(NP(t),MC(t,e)),ume=(t,e)=>OU(NP(t),MC(t,e));function dme(t,e){const{send:r,context:n,prop:i,scope:o,computed:s}=t,a=n.get("focusedValue"),l=n.get("value"),c=i("multiple");function u(m){let v=m;!c&&v.length>1&&(v=[v[0]]),r({type:"VALUE.SET",value:v})}function p(m){return{expanded:l.includes(m.value),focused:a===m.value,disabled:!!(m.disabled??i("disabled"))}}return{focusedValue:a,value:l,setValue:u,getItemState:p,getRootProps(){return e.element({...Oy.root.attrs,dir:i("dir"),id:NC(o),"data-orientation":i("orientation")})},getItemProps(m){const v=p(m);return e.element({...Oy.item.attrs,dir:i("dir"),id:ome(o,m.value),"data-state":v.expanded?"open":"closed","data-focus":st(v.focused),"data-disabled":st(v.disabled),"data-orientation":i("orientation")})},getItemContentProps(m){const v=p(m);return e.element({...Oy.itemContent.attrs,dir:i("dir"),role:"region",id:GF(o,m.value),"aria-labelledby":MC(o,m.value),hidden:!v.expanded,"data-state":v.expanded?"open":"closed","data-disabled":st(v.disabled),"data-focus":st(v.focused),"data-orientation":i("orientation")})},getItemIndicatorProps(m){const v=p(m);return e.element({...Oy.itemIndicator.attrs,dir:i("dir"),"aria-hidden":!0,"data-state":v.expanded?"open":"closed","data-disabled":st(v.disabled),"data-focus":st(v.focused),"data-orientation":i("orientation")})},getItemTriggerProps(m){const{value:v}=m,b=p(m);return e.button({...Oy.itemTrigger.attrs,type:"button",dir:i("dir"),id:MC(o,v),"aria-controls":GF(o,v),"aria-expanded":b.expanded,disabled:b.disabled,"data-orientation":i("orientation"),"aria-disabled":b.disabled,"data-state":b.expanded?"open":"closed","data-ownedby":NC(o),onFocus(){b.disabled||r({type:"TRIGGER.FOCUS",value:v})},onBlur(){b.disabled||r({type:"TRIGGER.BLUR"})},onClick(O){b.disabled||(Wm()&&O.currentTarget.focus(),r({type:"TRIGGER.CLICK",value:v}))},onKeyDown(O){if(O.defaultPrevented||b.disabled)return;const x={ArrowDown(){s("isHorizontal")||r({type:"GOTO.NEXT",value:v})},ArrowUp(){s("isHorizontal")||r({type:"GOTO.PREV",value:v})},ArrowRight(){s("isHorizontal")&&r({type:"GOTO.NEXT",value:v})},ArrowLeft(){s("isHorizontal")&&r({type:"GOTO.PREV",value:v})},Home(){r({type:"GOTO.FIRST",value:v})},End(){r({type:"GOTO.LAST",value:v})}},S=_C(O,{dir:i("dir"),orientation:i("orientation")}),w=x[S];w&&(w(O),O.preventDefault())}})}}}var{and:hme,not:fme}=Cl(),pme={props({props:t}){return{collapsible:!1,multiple:!1,orientation:"vertical",defaultValue:[],...t}},initialState(){return"idle"},context({prop:t,bindable:e}){return{focusedValue:e(()=>({defaultValue:null,sync:!0,onChange(r){t("onFocusChange")?.({value:r})}})),value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(r){t("onValueChange")?.({value:r})}}))}},computed:{isHorizontal:({prop:t})=>t("orientation")==="horizontal"},on:{"VALUE.SET":{actions:["setValue"]}},states:{idle:{on:{"TRIGGER.FOCUS":{target:"focused",actions:["setFocusedValue"]}}},focused:{on:{"GOTO.NEXT":{actions:["focusNextTrigger"]},"GOTO.PREV":{actions:["focusPrevTrigger"]},"TRIGGER.CLICK":[{guard:hme("isExpanded","canToggle"),actions:["collapse"]},{guard:fme("isExpanded"),actions:["expand"]}],"GOTO.FIRST":{actions:["focusFirstTrigger"]},"GOTO.LAST":{actions:["focusLastTrigger"]},"TRIGGER.BLUR":{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{canToggle:({prop:t})=>!!t("collapsible")||!!t("multiple"),isExpanded:({context:t,event:e})=>t.get("value").includes(e.value)},actions:{collapse({context:t,prop:e,event:r}){const n=e("multiple")?wf(t.get("value"),r.value):[];t.set("value",n)},expand({context:t,prop:e,event:r}){const n=e("multiple")?ff(t.get("value"),r.value):[r.value];t.set("value",n)},focusFirstTrigger({scope:t}){ame(t)?.focus()},focusLastTrigger({scope:t}){lme(t)?.focus()},focusNextTrigger({context:t,scope:e}){const r=t.get("focusedValue");if(!r)return;cme(e,r)?.focus()},focusPrevTrigger({context:t,scope:e}){const r=t.get("focusedValue");if(!r)return;ume(e,r)?.focus()},setFocusedValue({context:t,event:e}){t.set("focusedValue",e.value)},clearFocusedValue({context:t}){t.set("focusedValue",null)},setValue({context:t,event:e}){t.set("value",e.value)},coarseValue({context:t,prop:e}){!e("multiple")&&t.get("value").length>1&&(cm("The value of accordion should be a single value when multiple is false."),t.set("value",[t.get("value")[0]]))}}}};xt()(["collapsible","dir","disabled","getRootNode","id","ids","multiple","onFocusChange","onValueChange","orientation","value","defaultValue"]);xt()(["value","disabled"]);const gme=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,dir:n,getRootNode:r,...t},o=Ps(pme,i);return dme(o,oa)},YU=E.forwardRef((t,e)=>{const[r,n]=Ym(t),[i,o]=Nn()(n,["collapsible","defaultValue","disabled","id","ids","multiple","onFocusChange","onValueChange","orientation","value"]),s=gme(i),a=Ae(s.getRootProps(),o);return h.jsx(PU,{value:s,children:h.jsx(Zm,{value:r,children:h.jsx(Ue.div,{...a,ref:e})})})});YU.displayName="AccordionRoot";const KU=E.forwardRef((t,e)=>{const[r,n]=Ym(t),[{value:i},o]=Nn()(n,["value"]),s=Ae(i.getRootProps(),o);return h.jsx(PU,{value:i,children:h.jsx(Zm,{value:r,children:h.jsx(Ue.div,{...s,ref:e})})})});KU.displayName="AccordionRootProvider";var a0=(t,e)=>({x:t,y:e});function mme(t){const{x:e,y:r,width:n,height:i}=t,o=e+n/2,s=r+i/2;return{x:e,y:r,width:n,height:i,minX:e,minY:r,maxX:e+n,maxY:r+i,midX:o,midY:s,center:a0(o,s)}}function vme(t){const e=a0(t.minX,t.minY),r=a0(t.maxX,t.minY),n=a0(t.maxX,t.maxY),i=a0(t.minX,t.maxY);return{top:e,right:r,bottom:n,left:i}}function yme(t,e){const r=mme(t),{top:n,right:i,left:o,bottom:s}=vme(r),[a]=e.split("-");return{top:[o,n,i,s],right:[n,i,s,o],bottom:[n,o,s,i],left:[i,n,o,s]}[a]}function bme(t,e){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(i=!i)}return i}var JU=Ct("avatar").parts("root","image","fallback");JU.build();xt()(["dir","id","ids","onStatusChange","getRootNode"]);var qp=new WeakMap,Tw=new WeakMap,Ew={},vR=0,eH=t=>t&&(t.host||eH(t.parentNode)),Ome=(t,e)=>e.map(r=>{if(t.contains(r))return r;const n=eH(r);return n&&t.contains(n)?n:(console.error("[zag-js > ariaHidden] target",r,"in not contained inside",t,". Doing nothing"),null)}).filter(r=>!!r),xme=new Set(["script","output","status","next-route-announcer"]),wme=t=>xme.has(t.localName)||t.role==="status"||t.hasAttribute("aria-live")?!0:t.matches("[data-live-announcer]"),Sme=(t,e)=>{const{parentNode:r,markerName:n,controlAttribute:i,followControlledElements:o=!0}=e,s=Ome(r,Array.isArray(t)?t:[t]);Ew[n]||(Ew[n]=new WeakMap);const a=Ew[n],l=[],c=new Set,u=new Set(s),p=v=>{!v||c.has(v)||(c.add(v),p(v.parentNode))};s.forEach(v=>{p(v),o&&Yi(v)&&iU(v,b=>{p(b)})});const m=v=>{!v||u.has(v)||Array.prototype.forEach.call(v.children,b=>{if(c.has(b))m(b);else try{if(wme(b))return;const x=b.getAttribute(i)==="true",S=(qp.get(b)||0)+1,w=(a.get(b)||0)+1;qp.set(b,S),a.set(b,w),l.push(b),S===1&&x&&Tw.set(b,!0),w===1&&b.setAttribute(n,""),x||b.setAttribute(i,"true")}catch(O){console.error("[zag-js > ariaHidden] cannot operate on ",b,O)}})};return m(r),c.clear(),vR++,()=>{l.forEach(v=>{const b=qp.get(v)-1,O=a.get(v)-1;qp.set(v,b),a.set(v,O),b||(Tw.has(v)||v.removeAttribute(i),Tw.delete(v)),O||v.removeAttribute(n)}),vR--,vR||(qp=new WeakMap,qp=new WeakMap,Tw=new WeakMap,Ew={})}},Cme=t=>(Array.isArray(t)?t[0]:t).ownerDocument.body,kme=(t,e=Cme(t),r="data-aria-hidden",n=!0)=>{if(e)return Sme(t,{parentNode:e,markerName:r,controlAttribute:"aria-hidden",followControlledElements:n})},Pme=t=>{const e=requestAnimationFrame(()=>t());return()=>cancelAnimationFrame(e)};function YN(t,e={}){const{defer:r=!0}=e,n=r?Pme:o=>o(),i=[];return i.push(n(()=>{const s=(typeof t=="function"?t():t).filter(Boolean);s.length!==0&&i.push(kme(s))})),()=>{i.forEach(o=>o?.())}}var _me=Object.defineProperty,Tme=(t,e,r)=>e in t?_me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vn=(t,e,r)=>Tme(t,typeof e!="symbol"?e+"":e,r),XF={activateTrap(t,e){if(t.length>0){const n=t[t.length-1];n!==e&&n.pause()}const r=t.indexOf(e);r===-1||t.splice(r,1),t.push(e)},deactivateTrap(t,e){const r=t.indexOf(e);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},Eme=[],Rme=class{constructor(t,e){Vn(this,"trapStack"),Vn(this,"config"),Vn(this,"doc"),Vn(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Vn(this,"portalContainers",new Set),Vn(this,"listenerCleanups",[]),Vn(this,"handleFocus",n=>{const i=ti(n),o=this.findContainerIndex(i,n)>=0;if(o||kP(i))o&&(this.state.mostRecentlyFocusedNode=i);else{n.stopImmediatePropagation();let s,a=!0;if(this.state.mostRecentlyFocusedNode)if(vy(this.state.mostRecentlyFocusedNode)>0){const l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:c}=this.state.containerGroups[l];if(c.length>0){const u=c.findIndex(p=>p===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<c.length&&(s=c[u+1],a=!1):u-1>=0&&(s=c[u-1],a=!1))}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(c=>vy(c)>0))||(a=!1);else a=!1;a&&(s=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),s?this.tryFocus(s):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Vn(this,"handlePointerDown",n=>{const i=ti(n);if(!(this.findContainerIndex(i,n)>=0)){if(wy(this.config.clickOutsideDeactivates,n)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}wy(this.config.allowOutsideClick,n)||n.preventDefault()}}),Vn(this,"handleClick",n=>{const i=ti(n);this.findContainerIndex(i,n)>=0||wy(this.config.clickOutsideDeactivates,n)||wy(this.config.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())}),Vn(this,"handleTabKey",n=>{if(this.config.isKeyForward(n)||this.config.isKeyBackward(n)){this.state.recentNavEvent=n;const i=this.config.isKeyBackward(n),o=this.findNextNavNode({event:n,isBackward:i});if(!o)return;xy(n)&&n.preventDefault(),this.tryFocus(o)}}),Vn(this,"handleEscapeKey",n=>{Ime(n)&&wy(this.config.escapeDeactivates,n)!==!1&&(n.preventDefault(),this.deactivate())}),Vn(this,"_mutationObserver"),Vn(this,"setupMutationObserver",()=>{const n=this.doc.defaultView||window;this._mutationObserver=new n.MutationObserver(i=>{i.some(a=>Array.from(a.removedNodes).some(c=>c===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),i.some(a=>a.type==="attributes"&&(a.attributeName==="aria-controls"||a.attributeName==="aria-expanded")?!0:a.type==="childList"&&a.addedNodes.length>0?Array.from(a.addedNodes).some(l=>{if(l.nodeType!==Node.ELEMENT_NODE)return!1;const c=l;return Ohe(c)?!0:c.id&&!this.state.containers.some(u=>u.contains(c))?xhe(c):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Vn(this,"updateObservedNodes",()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(n=>{this._mutationObserver?.observe(n,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(n=>{this.observePortalContainer(n)}))}),Vn(this,"getInitialFocusNode",()=>{let n=this.getNodeForOption("initialFocus",{hasFallback:!0});if(n===!1)return!1;if(n===void 0||n&&!Ld(n)){const i=qg(this.doc);if(i&&this.findContainerIndex(i)>=0)n=i;else{const o=this.state.tabbableGroups[0];n=o&&o.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else n===null&&(n=this.getNodeForOption("fallbackFocus"));if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n.isConnected||(n=this.getNodeForOption("fallbackFocus")),n}),Vn(this,"tryFocus",n=>{if(n!==!1&&n!==qg(this.doc)){if(!n||!n.focus){this.tryFocus(this.getInitialFocusNode());return}n.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=n,jme(n)&&n.select()}}),Vn(this,"deactivate",n=>{if(!this.state.active)return this;const i={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...n};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),XF.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const o=this.getOption(i,"onDeactivate"),s=this.getOption(i,"onPostDeactivate"),a=this.getOption(i,"checkCanReturnFocus"),l=this.getOption(i,"returnFocus","returnFocusOnDeactivate");o?.();const c=()=>{ZF(()=>{if(l){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}s?.()})};if(l&&a){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return a(u).then(c,c),this}return c(),this}),Vn(this,"pause",n=>{if(this.state.paused||!this.state.active)return this;const i=this.getOption(n,"onPause"),o=this.getOption(n,"onPostPause");return this.state.paused=!0,i?.(),this.removeListeners(),this.updateObservedNodes(),o?.(),this}),Vn(this,"unpause",n=>{if(!this.state.paused||!this.state.active)return this;const i=this.getOption(n,"onUnpause"),o=this.getOption(n,"onPostUnpause");return this.state.paused=!1,i?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),o?.(),this}),Vn(this,"updateContainerElements",n=>(this.state.containers=Array.isArray(n)?n.filter(Boolean):[n].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Vn(this,"getReturnFocusNode",n=>{const i=this.getNodeForOption("setReturnFocus",{params:[n]});return i||(i===!1?!1:n)}),Vn(this,"getOption",(n,i,o)=>n&&n[i]!==void 0?n[i]:this.config[o||i]),Vn(this,"getNodeForOption",(n,{hasFallback:i=!1,params:o=[]}={})=>{let s=this.config[n];if(typeof s=="function"&&(s=s(...o)),s===!0&&(s=void 0),!s){if(s===void 0||s===!1)return s;throw new Error(`\`${n}\` was specified but was not a node, or did not return a node`)}let a=s;if(typeof s=="string"){try{a=this.doc.querySelector(s)}catch(l){throw new Error(`\`${n}\` appears to be an invalid selector; error="${l.message}"`)}if(!a&&!i)throw new Error(`\`${n}\` as selector refers to no known node`)}return a}),Vn(this,"findNextNavNode",n=>{const{event:i,isBackward:o=!1}=n,s=n.target||ti(i);this.updateTabbableNodes();let a=null;if(this.state.tabbableGroups.length>0){const l=this.findContainerIndex(s,i),c=l>=0?this.state.containerGroups[l]:void 0;if(l<0)o?a=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:a=this.state.tabbableGroups[0].firstTabbableNode;else if(o){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:p})=>s===p);if(u<0&&(c?.container===s||Ld(s)&&!md(s)&&!c?.nextTabbableNode(s,!1))&&(u=l),u>=0){const p=u===0?this.state.tabbableGroups.length-1:u-1,m=this.state.tabbableGroups[p];a=vy(s)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else xy(i)||(a=c?.nextTabbableNode(s,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:p})=>s===p);if(u<0&&(c?.container===s||Ld(s)&&!md(s)&&!c?.nextTabbableNode(s))&&(u=l),u>=0){const p=u===this.state.tabbableGroups.length-1?0:u+1,m=this.state.tabbableGroups[p];a=vy(s)>=0?m.firstTabbableNode:m.firstDomTabbableNode}else xy(i)||(a=c?.nextTabbableNode(s))}}else a=this.getNodeForOption("fallbackFocus");return a}),this.trapStack=e.trapStack||Eme;const r={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(n){return xy(n)&&!n.shiftKey},isKeyBackward(n){return xy(n)&&n.shiftKey},...e};this.doc=r.document||ks(Array.isArray(t)?t[0]:t),this.config=r,this.updateContainerElements(t),this.setupMutationObserver()}addPortalContainer(t){const e=t.parentElement;e&&!this.portalContainers.has(e)&&(this.portalContainers.add(e),this.state.active&&!this.state.paused&&this.observePortalContainer(e))}observePortalContainer(t){this._mutationObserver?.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(t=>{vhe(t).forEach(r=>{this.addPortalContainer(r)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(t,e){const r=typeof e?.composedPath=="function"?e.composedPath():void 0;return this.state.containerGroups.findIndex(({container:n,tabbableNodes:i})=>n.contains(t)||r?.includes(n)||i.find(o=>o===t)||this.isControlledElement(n,t))}isControlledElement(t,e){return this.config.followControlledElements?nU(t,e):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(t=>{const e=Um(t),r=RN(t),n=e.length>0?e[0]:void 0,i=e.length>0?e[e.length-1]:void 0,o=r.find(c=>md(c)),s=r.slice().reverse().find(c=>md(c)),a=!!e.find(c=>vy(c)>0);function l(c,u=!0){const p=e.indexOf(c);return p<0?u?r.slice(r.indexOf(c)+1).find(m=>md(m)):r.slice(0,r.indexOf(c)).reverse().find(m=>md(m)):e[p+(u?1:-1)]}return{container:t,tabbableNodes:e,focusableNodes:r,posTabIndexesFound:a,firstTabbableNode:n,lastTabbableNode:i,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(t=>t.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(t=>t.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return XF.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?ZF(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(hr(this.doc,"focusin",this.handleFocus,!0),hr(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),hr(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),hr(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),hr(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),hr(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(t=>t()),this.listenerCleanups=[],this}activate(t){if(this.state.active)return this;const e=this.getOption(t,"onActivate"),r=this.getOption(t,"onPostActivate"),n=this.getOption(t,"checkCanFocusTrap");n||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=qg(this.doc),e?.();const i=()=>{n&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r?.()};return n?(n(this.state.containers.concat()).then(i,i),this):(i(),this)}},xy=t=>t.key==="Tab",wy=(t,...e)=>typeof t=="function"?t(...e):t,Ime=t=>!t.isComposing&&t.key==="Escape",ZF=t=>setTimeout(t,0),jme=t=>t.localName==="input"&&"select"in t&&typeof t.select=="function";function tH(t,e={}){let r;const n=wt(()=>{const i=typeof t=="function"?t():t;if(i){r=new Rme(i,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...e,document:ks(i)});try{r.activate()}catch{}}});return function(){r?.deactivate(),n()}}var yR="data-scroll-lock";function $me(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function rH(t){const e=t??document,r=e.defaultView??window,{documentElement:n,body:i}=e;if(i.hasAttribute(yR))return;const s=r.innerWidth-n.clientWidth;i.setAttribute(yR,"");const a=()=>hfe(n,"--scrollbar-width",`${s}px`),l=$me(n),c=()=>ab(i,{overflow:"hidden",[l]:`${s}px`}),u=()=>{const{scrollX:m,scrollY:v,visualViewport:b}=r,O=b?.offsetLeft??0,x=b?.offsetTop??0,S=ab(i,{position:"fixed",overflow:"hidden",top:`${-(v-Math.floor(x))}px`,left:`${-(m-Math.floor(O))}px`,right:"0",[l]:`${s}px`});return()=>{S?.(),r.scrollTo({left:m,top:v,behavior:"instant"})}},p=[a(),_P()?u():c()];return()=>{p.forEach(m=>m?.()),i.removeAttribute(yR)}}const[nH,MP]=Cn({name:"CheckboxContext",hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),iH=E.forwardRef((t,e)=>{const r=MP(),n=Ae(r.getControlProps(),t);return h.jsx(Ue.div,{...n,ref:e})});iH.displayName="CheckboxControl";function Ame(t){return!(t.metaKey||!SO()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}var Nme=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Mme(t,e,r){const n=r?ti(r):null,i=hi(n);return t=t||n instanceof i.HTMLInputElement&&!Nme.has(n?.type)||n instanceof i.HTMLTextAreaElement||n instanceof i.HTMLElement&&n.isContentEditable,!(t&&e==="keyboard"&&r instanceof i.KeyboardEvent&&!Reflect.has(Dme,r.key))}var rp=null,t2=new Set,DC=new Map,Nf=!1,r2=!1,Dme={Tab:!0,Escape:!0};function DP(t,e){for(let r of t2)r(t,e)}function LC(t){Nf=!0,Ame(t)&&(rp="keyboard",DP("keyboard",t))}function wa(t){rp="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(Nf=!0,DP("pointer",t))}function oH(t){$he(t)&&(Nf=!0,rp="virtual")}function sH(t){const e=ti(t);e===hi(e)||e===ks(e)||(!Nf&&!r2&&(rp="virtual",DP("virtual",t)),Nf=!1,r2=!1)}function aH(){Nf=!1,r2=!0}function Lme(t){if(typeof window>"u"||DC.get(hi(t)))return;const e=hi(t),r=ks(t);let n=e.HTMLElement.prototype.focus;function i(){rp="virtual",DP("virtual",null),Nf=!0,n.apply(this,arguments)}try{Object.defineProperty(e.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}r.addEventListener("keydown",LC,!0),r.addEventListener("keyup",LC,!0),r.addEventListener("click",oH,!0),e.addEventListener("focus",sH,!0),e.addEventListener("blur",aH,!1),typeof e.PointerEvent<"u"?(r.addEventListener("pointerdown",wa,!0),r.addEventListener("pointermove",wa,!0),r.addEventListener("pointerup",wa,!0)):(r.addEventListener("mousedown",wa,!0),r.addEventListener("mousemove",wa,!0),r.addEventListener("mouseup",wa,!0)),e.addEventListener("beforeunload",()=>{Vme(t)},{once:!0}),DC.set(e,{focus:n})}var Vme=(t,e)=>{const r=hi(t),n=ks(t),i=DC.get(r);if(i){try{Object.defineProperty(r.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}n.removeEventListener("keydown",LC,!0),n.removeEventListener("keyup",LC,!0),n.removeEventListener("click",oH,!0),r.removeEventListener("focus",sH,!0),r.removeEventListener("blur",aH,!1),typeof r.PointerEvent<"u"?(n.removeEventListener("pointerdown",wa,!0),n.removeEventListener("pointermove",wa,!0),n.removeEventListener("pointerup",wa,!0)):(n.removeEventListener("mousedown",wa,!0),n.removeEventListener("mousemove",wa,!0),n.removeEventListener("mouseup",wa,!0)),DC.delete(r)}};function db(){return rp==="keyboard"}function KN(t={}){const{isTextInput:e,autoFocus:r,onChange:n,root:i}=t;Lme(i),n?.({isFocusVisible:r||db(),modality:rp});const o=(s,a)=>{Mme(!!e,s,a)&&n?.({isFocusVisible:db(),modality:s})};return t2.add(o),()=>{t2.delete(o)}}var lH=Ct("checkbox").parts("root","label","control","indicator"),Rw=lH.build(),cH=t=>t.ids?.root??`checkbox:${t.id}`,YF=t=>t.ids?.label??`checkbox:${t.id}:label`,Fme=t=>t.ids?.control??`checkbox:${t.id}:control`,n2=t=>t.ids?.hiddenInput??`checkbox:${t.id}:input`,Qme=t=>t.getById(cH(t)),l0=t=>t.getById(n2(t));function Bme(t,e){const{send:r,context:n,prop:i,computed:o,scope:s}=t,a=!!i("disabled"),l=!!i("readOnly"),c=!!i("required"),u=!!i("invalid"),p=!a&&n.get("focused"),m=!a&&n.get("focusVisible"),v=o("checked"),b=o("indeterminate"),O={"data-active":st(n.get("active")),"data-focus":st(p),"data-focus-visible":st(m),"data-readonly":st(l),"data-hover":st(n.get("hovered")),"data-disabled":st(a),"data-state":b?"indeterminate":v?"checked":"unchecked","data-invalid":st(u),"data-required":st(c)};return{checked:v,disabled:a,indeterminate:b,focused:p,checkedState:v,setChecked(x){r({type:"CHECKED.SET",checked:x,isTrusted:!1})},toggleChecked(){r({type:"CHECKED.TOGGLE",checked:v,isTrusted:!1})},getRootProps(){return e.label({...Rw.root.attrs,...O,dir:i("dir"),id:cH(s),htmlFor:n2(s),onPointerMove(){a||r({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){a||r({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(x){ti(x)===l0(s)&&x.stopPropagation()}})},getLabelProps(){return e.element({...Rw.label.attrs,...O,dir:i("dir"),id:YF(s)})},getControlProps(){return e.element({...Rw.control.attrs,...O,dir:i("dir"),id:Fme(s),"aria-hidden":!0})},getIndicatorProps(){return e.element({...Rw.indicator.attrs,...O,dir:i("dir"),hidden:!b&&!v})},getHiddenInputProps(){return e.input({id:n2(s),type:"checkbox",required:i("required"),defaultChecked:v,disabled:a,"aria-labelledby":YF(s),"aria-invalid":u,name:i("name"),form:i("form"),value:i("value"),style:xU,onFocus(){const x=db();r({type:"CONTEXT.SET",context:{focused:!0,focusVisible:x}})},onBlur(){r({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(x){if(l){x.preventDefault();return}const S=x.currentTarget.checked;r({type:"CHECKED.SET",checked:S,isTrusted:!0})}})}}}var{not:KF}=Cl(),zme={props({props:t}){return{value:"on",...t,defaultChecked:!!t.defaultChecked}},initialState(){return"ready"},context({prop:t,bindable:e}){return{checked:e(()=>({defaultValue:t("defaultChecked"),value:t("checked"),onChange(r){t("onCheckedChange")?.({checked:r})}})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),active:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1})),hovered:e(()=>({defaultValue:!1}))}},watch({track:t,context:e,prop:r,action:n}){t([()=>r("disabled")],()=>{n(["removeFocusIfNeeded"])}),t([()=>e.get("checked")],()=>{n(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:KF("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:KF("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:t})=>BS(t.get("checked")),checked:({context:t})=>qme(t.get("checked")),disabled:({context:t,prop:e})=>!!e("disabled")||t.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackPressEvent({context:t,computed:e,scope:r}){if(!e("disabled"))return vU({pointerNode:Qme(r),keyboardNode:l0(r),isValidKey:n=>n.key===" ",onPress:()=>t.set("active",!1),onPressStart:()=>t.set("active",!0),onPressEnd:()=>t.set("active",!1)})},trackFocusVisible({computed:t,scope:e}){if(!t("disabled"))return KN({root:e.getRootNode?.()})},trackFormControlState({context:t,scope:e}){return kO(l0(e),{onFieldsetDisabledChange(r){t.set("fieldsetDisabled",r)},onFormReset(){t.set("checked",t.initial("checked"))}})}},actions:{setContext({context:t,event:e}){for(const r in e.context)t.set(r,e.context[r])},syncInputElement({context:t,computed:e,scope:r}){const n=l0(r);n&&(TN(n,e("checked")),n.indeterminate=BS(t.get("checked")))},removeFocusIfNeeded({context:t,prop:e}){e("disabled")&&t.get("focused")&&(t.set("focused",!1),t.set("focusVisible",!1))},setChecked({context:t,event:e}){t.set("checked",e.checked)},toggleChecked({context:t,computed:e}){const r=BS(e("checked"))?!0:!e("checked");t.set("checked",r)},dispatchChangeEvent({computed:t,scope:e}){queueMicrotask(()=>{const r=l0(e);uU(r,{checked:t("checked")})})}}}};function BS(t){return t==="indeterminate"}function qme(t){return BS(t)?!1:!!t}xt()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);const uH=lH.extendWith("group");function Wme(t){const{value:e,onChange:r,defaultValue:n}=t,[i,o]=E.useState(n),s=e!==void 0,a=s?e:i,l=E.useCallback(c=>(s||o(c),r?.(c)),[s,r]);return[a,l]}function Ume(t={}){const{defaultValue:e,value:r,onValueChange:n,disabled:i,readOnly:o,name:s,invalid:a}=t,l=!(i||o),c=kU(n,{sync:!0}),[u,p]=Wme({value:r,defaultValue:e||[],onChange:c}),m=S=>u.some(w=>String(w)===String(S)),v=S=>{m(S)?O(S):b(S)},b=S=>{l&&(m(S)||p(u.concat(S)))},O=S=>{l&&p(u.filter(w=>String(w)!==String(S)))};return{isChecked:m,value:u,name:s,disabled:!!i,readOnly:!!o,invalid:!!a,setValue:p,addValue:b,toggleValue:v,getItemProps:S=>({checked:S.value!=null?m(S.value):void 0,onCheckedChange(){S.value!=null&&v(S.value)},name:s,disabled:i,readOnly:o,invalid:a})}}const[Hme,Gme]=Cn({name:"CheckboxGroupContext",hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),dH=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["defaultValue","value","onValueChange","disabled","invalid","readOnly","name"]),i=Ume(r);return h.jsx(Hme,{value:i,children:h.jsx(Ue.div,{ref:e,role:"group",...n,...uH.build().group.attrs})})});dH.displayName="CheckboxGroup";const[Krt,dh]=Cn({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),hH=E.forwardRef((t,e)=>{const r=MP(),n=Ae(r.getHiddenInputProps(),t),i=dh();return h.jsx(Ue.input,{"aria-describedby":i?.ariaDescribedby,...n,ref:e})});hH.displayName="CheckboxHiddenInput";const fH=E.forwardRef((t,e)=>{const r=MP(),n=Ae(r.getLabelProps(),t);return h.jsx(Ue.span,{...n,ref:e})});fH.displayName="CheckboxLabel";const Xme=(t={})=>{const e=Gme(),r=dh(),n=E.useMemo(()=>Ae(t,e?.getItemProps({value:t.value})??{}),[t,e]),i=E.useId(),{getRootNode:o}=Cs(),{dir:s}=Va(),a={id:i,ids:{label:r?.ids.label,hiddenInput:r?.ids.control},dir:s,disabled:r?.disabled,readOnly:r?.readOnly,invalid:r?.invalid,required:r?.required,getRootNode:o,...n},l=Ps(zme,a);return Bme(l,oa)},pH=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["checked","defaultChecked","disabled","form","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]),i=Xme(r),o=Ae(i.getRootProps(),n);return h.jsx(nH,{value:i,children:h.jsx(Ue.label,{...o,ref:e})})});pH.displayName="CheckboxRoot";const gH=E.forwardRef((t,e)=>{const[{value:r},n]=Nn()(t,["value"]),i=Ae(r.getRootProps(),n);return h.jsx(nH,{value:r,children:h.jsx(Ue.label,{...i,ref:e})})});gH.displayName="CheckboxRootProvider";var mH=Ct("clipboard").parts("root","control","trigger","indicator","input","label");mH.build();xt()(["getRootNode","id","ids","value","defaultValue","timeout","onStatusChange","onValueChange"]);xt()(["copied"]);const Zme=qU.extendWith("view");var Yme=Object.defineProperty,Kme=(t,e,r)=>e in t?Yme(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Me=(t,e,r)=>Kme(t,typeof e!="symbol"?e+"":e,r),zS={itemToValue(t){return typeof t=="string"?t:pf(t)&&ll(t,"value")?t.value:""},itemToString(t){return typeof t=="string"?t:pf(t)&&ll(t,"label")?t.label:zS.itemToValue(t)},isItemDisabled(t){return pf(t)&&ll(t,"disabled")?!!t.disabled:!1}},LP=class vH{constructor(e){this.options=e,Me(this,"items"),Me(this,"indexMap",null),Me(this,"copy",r=>new vH({...this.options,items:r??[...this.items]})),Me(this,"isEqual",r=>Ks(this.items,r.items)),Me(this,"setItems",r=>this.copy(r)),Me(this,"getValues",(r=this.items)=>{const n=[];for(const i of r){const o=this.getItemValue(i);o!=null&&n.push(o)}return n}),Me(this,"find",r=>{if(r==null)return null;const n=this.indexOf(r);return n!==-1?this.at(n):null}),Me(this,"findMany",r=>{const n=[];for(const i of r){const o=this.find(i);o!=null&&n.push(o)}return n}),Me(this,"at",r=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[r]??null;let n=0;const i=this.group();for(const[,o]of i)for(const s of o){if(n===r)return s;n++}return null}),Me(this,"sortFn",(r,n)=>{const i=this.indexOf(r),o=this.indexOf(n);return(i??0)-(o??0)}),Me(this,"sort",r=>[...r].sort(this.sortFn.bind(this))),Me(this,"getItemValue",r=>r==null?null:this.options.itemToValue?.(r)??zS.itemToValue(r)),Me(this,"getItemDisabled",r=>r==null?!1:this.options.isItemDisabled?.(r)??zS.isItemDisabled(r)),Me(this,"stringifyItem",r=>r==null?null:this.options.itemToString?.(r)??zS.itemToString(r)),Me(this,"stringify",r=>r==null?null:this.stringifyItem(this.find(r))),Me(this,"stringifyItems",(r,n=", ")=>{const i=[];for(const o of r){const s=this.stringifyItem(o);s!=null&&i.push(s)}return i.join(n)}),Me(this,"stringifyMany",(r,n)=>this.stringifyItems(this.findMany(r),n)),Me(this,"has",r=>this.indexOf(r)!==-1),Me(this,"hasItem",r=>r==null?!1:this.has(this.getItemValue(r))),Me(this,"group",()=>{const{groupBy:r,groupSort:n}=this.options;if(!r)return[["",[...this.items]]];const i=new Map;this.items.forEach((s,a)=>{const l=r(s,a);i.has(l)||i.set(l,[]),i.get(l).push(s)});let o=Array.from(i.entries());return n&&o.sort(([s],[a])=>{if(typeof n=="function")return n(s,a);if(Array.isArray(n)){const l=n.indexOf(s),c=n.indexOf(a);return l===-1?1:c===-1?-1:l-c}return n==="asc"?s.localeCompare(a):n==="desc"?a.localeCompare(s):0}),o}),Me(this,"getNextValue",(r,n=1,i=!1)=>{let o=this.indexOf(r);if(o===-1)return null;for(o=i?Math.min(o+n,this.size-1):o+n;o<=this.size&&this.getItemDisabled(this.at(o));)o++;return this.getItemValue(this.at(o))}),Me(this,"getPreviousValue",(r,n=1,i=!1)=>{let o=this.indexOf(r);if(o===-1)return null;for(o=i?Math.max(o-n,0):o-n;o>=0&&this.getItemDisabled(this.at(o));)o--;return this.getItemValue(this.at(o))}),Me(this,"indexOf",r=>{if(r==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(n=>this.getItemValue(n)===r);if(!this.indexMap){this.indexMap=new Map;let n=0;const i=this.group();for(const[,o]of i)for(const s of o){const a=this.getItemValue(s);a!=null&&this.indexMap.set(a,n),n++}}return this.indexMap.get(r)??-1}),Me(this,"getByText",(r,n)=>{const i=n!=null?this.indexOf(n):-1,o=r.length===1;for(let s=0;s<this.items.length;s++){const a=this.items[(i+s+1)%this.items.length];if(!(o&&this.getItemValue(a)===n)&&!this.getItemDisabled(a)&&Jme(this.stringifyItem(a),r))return a}}),Me(this,"search",(r,n)=>{const{state:i,currentValue:o,timeout:s=350}=n,a=i.keysSoFar+r,c=a.length>1&&Array.from(a).every(b=>b===a[0])?a[0]:a,u=this.getByText(c,o),p=this.getItemValue(u);function m(){clearTimeout(i.timer),i.timer=-1}function v(b){i.keysSoFar=b,m(),b!==""&&(i.timer=+setTimeout(()=>{v(""),m()},s))}return v(a),p}),Me(this,"update",(r,n)=>{let i=this.indexOf(r);return i===-1?this:this.copy([...this.items.slice(0,i),n,...this.items.slice(i+1)])}),Me(this,"upsert",(r,n,i="append")=>{let o=this.indexOf(r);return o===-1?(i==="append"?this.append:this.prepend)(n):this.copy([...this.items.slice(0,o),n,...this.items.slice(o+1)])}),Me(this,"insert",(r,...n)=>this.copy(Sy(this.items,r,...n))),Me(this,"insertBefore",(r,...n)=>{let i=this.indexOf(r);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(Sy(this.items,i,...n))}),Me(this,"insertAfter",(r,...n)=>{let i=this.indexOf(r);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(Sy(this.items,i+1,...n))}),Me(this,"prepend",(...r)=>this.copy(Sy(this.items,0,...r))),Me(this,"append",(...r)=>this.copy(Sy(this.items,this.items.length,...r))),Me(this,"filter",r=>{const n=this.items.filter((i,o)=>r(this.stringifyItem(i),o,i));return this.copy(n)}),Me(this,"remove",(...r)=>{const n=r.map(i=>typeof i=="string"?i:this.getItemValue(i));return this.copy(this.items.filter(i=>{const o=this.getItemValue(i);return o==null?!1:!n.includes(o)}))}),Me(this,"move",(r,n)=>{const i=this.indexOf(r);return i===-1?this:this.copy(Iw(this.items,[i],n))}),Me(this,"moveBefore",(r,...n)=>{let i=this.items.findIndex(s=>this.getItemValue(s)===r);if(i===-1)return this;let o=n.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(Iw(this.items,o,i))}),Me(this,"moveAfter",(r,...n)=>{let i=this.items.findIndex(s=>this.getItemValue(s)===r);if(i===-1)return this;let o=n.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(Iw(this.items,o,i+1))}),Me(this,"reorder",(r,n)=>this.copy(Iw(this.items,[r],n))),Me(this,"compareValue",(r,n)=>{const i=this.indexOf(r),o=this.indexOf(n);return i<o?-1:i>o?1:0}),Me(this,"range",(r,n)=>{let i=[],o=r;for(;o!=null;){if(this.find(o)&&i.push(o),o===n)return i;o=this.getNextValue(o)}return[]}),Me(this,"getValueRange",(r,n)=>r&&n?this.compareValue(r,n)<=0?this.range(r,n):this.range(n,r):[]),Me(this,"toString",()=>{let r="";for(const n of this.items){const i=this.getItemValue(n),o=this.stringifyItem(n),s=this.getItemDisabled(n),a=[i,o,s].filter(Boolean).join(":");r+=a+","}return r}),Me(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...e.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},Jme=(t,e)=>!!t?.toLowerCase().startsWith(e.toLowerCase());function Sy(t,e,...r){return[...t.slice(0,e),...r,...t.slice(e)]}function Iw(t,e,r){e=[...e].sort((i,o)=>i-o);const n=e.map(i=>t[i]);for(let i=e.length-1;i>=0;i--)t=[...t.slice(0,e[i]),...t.slice(e[i]+1)];return r=Math.max(0,r-e.filter(i=>i<r).length),[...t.slice(0,r),...n,...t.slice(r)]}function yH(t,e,r){for(let n=0;n<e.length;n++)t=r.getChildren(t,e.slice(n+1))[e[n]];return t}function eve(t){const e=tve(t),r=[],n=new Set;for(const i of e){const o=i.join();n.has(o)||(n.add(o),r.push(i))}return r}function bH(t,e){for(let r=0;r<Math.min(t.length,e.length);r++){if(t[r]<e[r])return-1;if(t[r]>e[r])return 1}return t.length-e.length}function tve(t){return t.sort(bH)}function rve(t,e){let r;return Us(t,{...e,onEnter:(n,i)=>{if(e.predicate(n,i))return r=n,"stop"}}),r}function nve(t,e){const r=[];return Us(t,{onEnter:(n,i)=>{e.predicate(n,i)&&r.push(n)},getChildren:e.getChildren}),r}function JF(t,e){let r;return Us(t,{onEnter:(n,i)=>{if(e.predicate(n,i))return r=[...i],"stop"},getChildren:e.getChildren}),r}function ive(t,e){let r=e.initialResult;return Us(t,{...e,onEnter:(n,i)=>{r=e.nextResult(r,n,i)}}),r}function ove(t,e){return ive(t,{...e,initialResult:[],nextResult:(r,n,i)=>(r.push(...e.transform(n,i)),r)})}function sve(t,e){const{predicate:r,create:n,getChildren:i}=e,o=(s,a)=>{const l=i(s,a),c=[];l.forEach((v,b)=>{const O=[...a,b],x=o(v,O);x&&c.push(x)});const u=a.length===0,p=r(s,a),m=c.length>0;return u||p||m?n(s,c,a):null};return o(t,[])||n(t,[],[])}function ave(t,e){const r=[];let n=0;const i=new Map,o=new Map;return Us(t,{getChildren:e.getChildren,onEnter:(s,a)=>{i.has(s)||i.set(s,n++);const l=e.getChildren(s,a);l.forEach(v=>{o.has(v)||o.set(v,s),i.has(v)||i.set(v,n++)});const c=l.length>0?l.map(v=>i.get(v)):void 0,u=o.get(s),p=u?i.get(u):void 0,m=i.get(s);r.push({...s,_children:c,_parent:p,_index:m})}}),r}function lve(t,e){return{type:"insert",index:t,nodes:e}}function cve(t){return{type:"remove",indexes:t}}function JN(){return{type:"replace"}}function OH(t){return[t.slice(0,-1),t[t.length-1]]}function xH(t,e,r=new Map){const[n,i]=OH(t);for(let s=n.length-1;s>=0;s--){const a=n.slice(0,s).join();switch(r.get(a)?.type){case"remove":continue}r.set(a,JN())}const o=r.get(n.join());switch(o?.type){case"remove":r.set(n.join(),{type:"removeThenInsert",removeIndexes:o.indexes,insertIndex:i,insertNodes:e});break;default:r.set(n.join(),lve(i,e))}return r}function wH(t){const e=new Map,r=new Map;for(const n of t){const i=n.slice(0,-1).join(),o=r.get(i)??[];o.push(n[n.length-1]),r.set(i,o.sort((s,a)=>s-a))}for(const n of t)for(let i=n.length-2;i>=0;i--){const o=n.slice(0,i).join();e.has(o)||e.set(o,JN())}for(const[n,i]of r)e.set(n,cve(i));return e}function uve(t,e){const r=new Map,[n,i]=OH(t);for(let o=n.length-1;o>=0;o--){const s=n.slice(0,o).join();r.set(s,JN())}return r.set(n.join(),{type:"removeThenInsert",removeIndexes:[i],insertIndex:i,insertNodes:[e]}),r}function VP(t,e,r){return dve(t,{...r,getChildren:(n,i)=>{const o=i.join();switch(e.get(o)?.type){case"replace":case"remove":case"removeThenInsert":case"insert":return r.getChildren(n,i);default:return[]}},transform:(n,i,o)=>{const s=o.join(),a=e.get(s);switch(a?.type){case"remove":return r.create(n,i.filter((u,p)=>!a.indexes.includes(p)),o);case"removeThenInsert":const l=i.filter((u,p)=>!a.removeIndexes.includes(p)),c=a.removeIndexes.reduce((u,p)=>p<u?u-1:u,a.insertIndex);return r.create(n,e6(l,c,0,...a.insertNodes),o);case"insert":return r.create(n,e6(i,a.index,0,...a.nodes),o);case"replace":return r.create(n,i,o);default:return n}}})}function e6(t,e,r,...n){return[...t.slice(0,e),...n,...t.slice(e+r)]}function dve(t,e){const r={};return Us(t,{...e,onLeave:(n,i)=>{const o=[0,...i],s=o.join(),a=e.transform(n,r[s]??[],i),l=o.slice(0,-1).join(),c=r[l]??[];c.push(a),r[l]=c}}),r[""][0]}function hve(t,e){const{nodes:r,at:n}=e;if(n.length===0)throw new Error("Can't insert nodes at the root");const i=xH(n,r);return VP(t,i,e)}function fve(t,e){if(e.at.length===0)return e.node;const r=uve(e.at,e.node);return VP(t,r,e)}function pve(t,e){if(e.indexPaths.length===0)return t;for(const n of e.indexPaths)if(n.length===0)throw new Error("Can't remove the root node");const r=wH(e.indexPaths);return VP(t,r,e)}function gve(t,e){if(e.indexPaths.length===0)return t;for(const o of e.indexPaths)if(o.length===0)throw new Error("Can't move the root node");if(e.to.length===0)throw new Error("Can't move nodes to the root");const r=eve(e.indexPaths),n=r.map(o=>yH(t,o,e)),i=xH(e.to,n,wH(r));return VP(t,i,e)}function Us(t,e){const{onEnter:r,onLeave:n,getChildren:i}=e;let o=[],s=[{node:t}];const a=e.reuseIndexPath?()=>o:()=>o.slice();for(;s.length>0;){let l=s[s.length-1];if(l.state===void 0){const u=r?.(l.node,a());if(u==="stop")return;l.state=u==="skip"?-1:0}const c=l.children||i(l.node,a());if(l.children||(l.children=c),l.state!==-1){if(l.state<c.length){let p=l.state;o.push(p),s.push({node:c[p]}),l.state=p+1;continue}if(n?.(l.node,a())==="stop")return}o.pop(),s.pop()}}var SH=class CH{constructor(e){this.options=e,Me(this,"rootNode"),Me(this,"isEqual",r=>Ks(this.rootNode,r.rootNode)),Me(this,"getNodeChildren",r=>this.options.nodeToChildren?.(r)??cg.nodeToChildren(r)??[]),Me(this,"resolveIndexPath",r=>typeof r=="string"?this.getIndexPath(r):r),Me(this,"resolveNode",r=>{const n=this.resolveIndexPath(r);return n?this.at(n):void 0}),Me(this,"getNodeChildrenCount",r=>this.options.nodeToChildrenCount?.(r)??cg.nodeToChildrenCount(r)),Me(this,"getNodeValue",r=>this.options.nodeToValue?.(r)??cg.nodeToValue(r)),Me(this,"getNodeDisabled",r=>this.options.isNodeDisabled?.(r)??cg.isNodeDisabled(r)),Me(this,"stringify",r=>{const n=this.findNode(r);return n?this.stringifyNode(n):null}),Me(this,"stringifyNode",r=>this.options.nodeToString?.(r)??cg.nodeToString(r)),Me(this,"getFirstNode",(r=this.rootNode)=>{let n;return Us(r,{getChildren:this.getNodeChildren,onEnter:(i,o)=>{if(!n&&o.length>0&&!this.getNodeDisabled(i))return n=i,"stop"}}),n}),Me(this,"getLastNode",(r=this.rootNode,n={})=>{let i;return Us(r,{getChildren:this.getNodeChildren,onEnter:(o,s)=>{if(!this.isSameNode(o,r)){if(n.skip?.({value:this.getNodeValue(o),node:o,indexPath:s}))return"skip";s.length>0&&!this.getNodeDisabled(o)&&(i=o)}}}),i}),Me(this,"at",r=>yH(this.rootNode,r,{getChildren:this.getNodeChildren})),Me(this,"findNode",(r,n=this.rootNode)=>rve(n,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===r})),Me(this,"findNodes",(r,n=this.rootNode)=>{const i=new Set(r.filter(o=>o!=null));return nve(n,{getChildren:this.getNodeChildren,predicate:o=>i.has(this.getNodeValue(o))})}),Me(this,"sort",r=>r.reduce((n,i)=>{const o=this.getIndexPath(i);return o&&n.push({value:i,indexPath:o}),n},[]).sort((n,i)=>bH(n.indexPath,i.indexPath)).map(({value:n})=>n)),Me(this,"getIndexPath",r=>JF(this.rootNode,{getChildren:this.getNodeChildren,predicate:n=>this.getNodeValue(n)===r})),Me(this,"getValue",r=>{const n=this.at(r);return n?this.getNodeValue(n):void 0}),Me(this,"getValuePath",r=>{if(!r)return[];const n=[];let i=[...r];for(;i.length>0;){const o=this.at(i);o&&n.unshift(this.getNodeValue(o)),i.pop()}return n}),Me(this,"getDepth",r=>JF(this.rootNode,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===r})?.length??0),Me(this,"isSameNode",(r,n)=>this.getNodeValue(r)===this.getNodeValue(n)),Me(this,"isRootNode",r=>this.isSameNode(r,this.rootNode)),Me(this,"contains",(r,n)=>!r||!n?!1:n.slice(0,r.length).every((i,o)=>r[o]===n[o])),Me(this,"getNextNode",(r,n={})=>{let i=!1,o;return Us(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{if(this.isRootNode(s))return;const l=this.getNodeValue(s);if(n.skip?.({value:l,node:s,indexPath:a}))return l===r&&(i=!0),"skip";if(i&&!this.getNodeDisabled(s))return o=s,"stop";l===r&&(i=!0)}}),o}),Me(this,"getPreviousNode",(r,n={})=>{let i,o=!1;return Us(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{if(this.isRootNode(s))return;const l=this.getNodeValue(s);if(n.skip?.({value:l,node:s,indexPath:a}))return"skip";if(l===r)return o=!0,"stop";this.getNodeDisabled(s)||(i=s)}}),o?i:void 0}),Me(this,"getParentNodes",r=>{const n=this.resolveIndexPath(r)?.slice();if(!n)return[];const i=[];for(;n.length>0;){n.pop();const o=this.at(n);o&&!this.isRootNode(o)&&i.unshift(o)}return i}),Me(this,"getDescendantNodes",(r,n)=>{const i=this.resolveNode(r);if(!i)return[];const o=[];return Us(i,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{a.length!==0&&(!n?.withBranch&&this.isBranchNode(s)||o.push(s))}}),o}),Me(this,"getDescendantValues",(r,n)=>this.getDescendantNodes(r,n).map(o=>this.getNodeValue(o))),Me(this,"getParentIndexPath",r=>r.slice(0,-1)),Me(this,"getParentNode",r=>{const n=this.resolveIndexPath(r);return n?this.at(this.getParentIndexPath(n)):void 0}),Me(this,"visit",r=>{const{skip:n,...i}=r;Us(this.rootNode,{...i,getChildren:this.getNodeChildren,onEnter:(o,s)=>{if(!this.isRootNode(o))return n?.({value:this.getNodeValue(o),node:o,indexPath:s})?"skip":i.onEnter?.(o,s)}})}),Me(this,"getPreviousSibling",r=>{const n=this.getParentNode(r);if(!n)return;const i=this.getNodeChildren(n);let o=r[r.length-1];for(;--o>=0;){const s=i[o];if(!this.getNodeDisabled(s))return s}}),Me(this,"getNextSibling",r=>{const n=this.getParentNode(r);if(!n)return;const i=this.getNodeChildren(n);let o=r[r.length-1];for(;++o<i.length;){const s=i[o];if(!this.getNodeDisabled(s))return s}}),Me(this,"getSiblingNodes",r=>{const n=this.getParentNode(r);return n?this.getNodeChildren(n):[]}),Me(this,"getValues",(r=this.rootNode)=>ove(r,{getChildren:this.getNodeChildren,transform:i=>[this.getNodeValue(i)]}).slice(1)),Me(this,"isValidDepth",(r,n)=>n==null?!0:typeof n=="function"?n(r.length):r.length===n),Me(this,"isBranchNode",r=>this.getNodeChildren(r).length>0||this.getNodeChildrenCount(r)!=null),Me(this,"getBranchValues",(r=this.rootNode,n={})=>{let i=[];return Us(r,{getChildren:this.getNodeChildren,onEnter:(o,s)=>{if(s.length===0)return;const a=this.getNodeValue(o);if(n.skip?.({value:a,node:o,indexPath:s}))return"skip";this.isBranchNode(o)&&this.isValidDepth(s,n.depth)&&i.push(this.getNodeValue(o))}}),i}),Me(this,"flatten",(r=this.rootNode)=>ave(r,{getChildren:this.getNodeChildren})),Me(this,"_create",(r,n)=>this.getNodeChildren(r).length>0||n.length>0?{...r,children:n}:{...r}),Me(this,"_insert",(r,n,i)=>this.copy(hve(r,{at:n,nodes:i,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"copy",r=>new CH({...this.options,rootNode:r})),Me(this,"_replace",(r,n,i)=>this.copy(fve(r,{at:n,node:i,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"_move",(r,n,i)=>this.copy(gve(r,{indexPaths:n,to:i,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"_remove",(r,n)=>this.copy(pve(r,{indexPaths:n,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"replace",(r,n)=>this._replace(this.rootNode,r,n)),Me(this,"remove",r=>this._remove(this.rootNode,r)),Me(this,"insertBefore",(r,n)=>this.getParentNode(r)?this._insert(this.rootNode,r,n):void 0),Me(this,"insertAfter",(r,n)=>{if(!this.getParentNode(r))return;const o=[...r.slice(0,-1),r[r.length-1]+1];return this._insert(this.rootNode,o,n)}),Me(this,"move",(r,n)=>this._move(this.rootNode,r,n)),Me(this,"filter",r=>{const n=sve(this.rootNode,{predicate:r,getChildren:this.getNodeChildren,create:this._create});return this.copy(n)}),Me(this,"toJSON",()=>this.getValues(this.rootNode)),this.rootNode=e.rootNode}},cg={nodeToValue(t){return typeof t=="string"?t:pf(t)&&ll(t,"value")?t.value:""},nodeToString(t){return typeof t=="string"?t:pf(t)&&ll(t,"label")?t.label:cg.nodeToValue(t)},isNodeDisabled(t){return pf(t)&&ll(t,"disabled")?!!t.disabled:!1},nodeToChildren(t){return t.children},nodeToChildrenCount(t){if(pf(t)&&ll(t,"childrenCount"))return t.childrenCount}},kH=Ct("combobox").parts("root","clearTrigger","content","control","input","item","itemGroup","itemGroupLabel","itemIndicator","itemText","label","list","positioner","trigger");kH.build();var PH=t=>new LP(t);PH.empty=()=>new LP({items:[]});var mve=t=>t.ids?.control??`combobox:${t.id}:control`,vve=t=>t.ids?.input??`combobox:${t.id}:input`,yve=t=>t.ids?.content??`combobox:${t.id}:content`,bve=t=>t.ids?.positioner??`combobox:${t.id}:popper`,Ove=t=>t.ids?.trigger??`combobox:${t.id}:toggle-btn`,xve=t=>t.ids?.clearTrigger??`combobox:${t.id}:clear-btn`,hd=t=>t.getById(yve(t)),ug=t=>t.getById(vve(t)),t6=t=>t.getById(bve(t)),r6=t=>t.getById(mve(t)),c0=t=>t.getById(Ove(t)),n6=t=>t.getById(xve(t)),Cy=(t,e)=>{if(e==null)return null;const r=`[role=option][data-value="${CSS.escape(e)}"]`;return Hm(hd(t),r)},i6=t=>{const e=ug(t);t.isActiveElement(e)||e?.focus({preventScroll:!0})},wve=t=>{const e=c0(t);t.isActiveElement(e)||e?.focus({preventScroll:!0})},{guards:Sve,createMachine:Cve,choose:kve}=NN(),{and:qi,not:Ms}=Sve;Cve({props({props:t}){return{loopFocus:!0,openOnClick:!1,defaultValue:[],closeOnSelect:!t.multiple,allowCustomValue:!1,alwaysSubmitOnEnter:!1,inputBehavior:"none",selectionBehavior:t.multiple?"clear":"replace",openOnKeyPress:!0,openOnChange:!0,composite:!0,navigate({node:e}){IN(e)},collection:PH.empty(),...t,positioning:{placement:"bottom",sameWidth:!0,...t.positioning},translations:{triggerLabel:"Toggle suggestions",clearTriggerLabel:"Clear value",...t.translations}}},initialState({prop:t}){return t("open")||t("defaultOpen")?"suggesting":"idle"},context({prop:t,bindable:e,getContext:r,getEvent:n}){return{currentPlacement:e(()=>({defaultValue:void 0})),value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),isEqual:Ks,hash(i){return i.join(",")},onChange(i){const o=r(),s=o.get("selectedItems"),a=t("collection"),l=i.map(c=>s.find(p=>a.getItemValue(p)===c)||a.find(c));o.set("selectedItems",l),t("onValueChange")?.({value:i,items:l})}})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(i){const o=t("collection").find(i);t("onHighlightChange")?.({highlightedValue:i,highlightedItem:o})}})),inputValue:e(()=>{let i=t("inputValue")||t("defaultInputValue")||"";const o=t("defaultValue")||t("value")||[];if(!i.trim()&&!t("multiple")){const s=t("collection").stringifyMany(o);i=Kc(t("selectionBehavior"),{preserve:i||s,replace:s,clear:""})}return{defaultValue:i,value:t("inputValue"),onChange(s){const a=n(),l=(a.previousEvent||a).src;t("onInputValueChange")?.({inputValue:s,reason:l})}}}),highlightedItem:e(()=>{const i=t("highlightedValue");return{defaultValue:t("collection").find(i)}}),selectedItems:e(()=>{const i=t("value")||t("defaultValue")||[];return{defaultValue:t("collection").findMany(i)}})}},computed:{isInputValueEmpty:({context:t})=>t.get("inputValue").length===0,isInteractive:({prop:t})=>!(t("readOnly")||t("disabled")),autoComplete:({prop:t})=>t("inputBehavior")==="autocomplete",autoHighlight:({prop:t})=>t("inputBehavior")==="autohighlight",hasSelectedItems:({context:t})=>t.get("value").length>0,valueAsString:({context:t,prop:e})=>e("collection").stringifyItems(t.get("selectedItems")),isCustomValue:({context:t,computed:e})=>t.get("inputValue")!==e("valueAsString")},watch({context:t,prop:e,track:r,action:n,send:i}){r([()=>t.hash("value")],()=>{n(["syncSelectedItems"])}),r([()=>t.get("inputValue")],()=>{n(["syncInputValue"])}),r([()=>t.get("highlightedValue")],()=>{n(["syncHighlightedItem","autofillInputValue"])}),r([()=>e("open")],()=>{n(["toggleVisibility"])}),r([()=>e("collection").toString()],()=>{i({type:"CHILDREN_CHANGE"})})},on:{"SELECTED_ITEMS.SYNC":{actions:["syncSelectedItems"]},"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedValue"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedValue"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setValue"]},"INPUT_VALUE.SET":{actions:["setInputValue"]},"POSITIONING.SET":{actions:["reposition"]}},entry:kve([{guard:"autoFocus",actions:["setInitialFocus"]}]),states:{idle:{tags:["idle","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":{target:"interacting"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{target:"focused",actions:["clearInputValue","clearSelectedItems","setInitialFocus"]}}},focused:{tags:["focused","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":[{guard:"isChangeEvent",target:"suggesting"},{target:"interacting"}],"INPUT.CHANGE":[{guard:qi("isOpenControlled","openOnChange"),actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{guard:"openOnChange",target:"suggesting",actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{actions:["setInputValue"]}],"LAYER.INTERACT_OUTSIDE":{target:"idle"},"INPUT.ESCAPE":{guard:qi("isCustomValue",Ms("allowCustomValue")),actions:["revertInputValue"]},"INPUT.BLUR":{target:"idle"},"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_DOWN":[{guard:qi("isOpenControlled","autoComplete"),actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"isOpenControlled",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_UP":[{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems"]}}},interacting:{tags:["open","focused"],entry:["setInitialFocus"],effects:["scrollToHighlightedItem","trackDismissableLayer","trackPlacement","hideOtherElements"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]},{actions:["scrollToHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"]},"INPUT.END":{actions:["highlightLastItem"]},"INPUT.ARROW_DOWN":[{guard:qi("autoComplete","isLastItemHighlighted"),actions:["clearHighlightedValue","scrollContentToTop"]},{actions:["highlightNextItem"]}],"INPUT.ARROW_UP":[{guard:qi("autoComplete","isFirstItemHighlighted"),actions:["clearHighlightedValue"]},{actions:["highlightPrevItem"]}],"INPUT.ENTER":[{guard:qi("isOpenControlled","isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":[{guard:"autoComplete",target:"suggesting",actions:["setInputValue"]},{target:"suggesting",actions:["clearHighlightedValue","setInputValue"]}],"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.CLICK":[{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],"LAYER.ESCAPE":[{guard:qi("isOpenControlled","autoComplete"),actions:["syncInputValue","invokeOnClose"]},{guard:"autoComplete",target:"focused",actions:["syncInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"LAYER.INTERACT_OUTSIDE":[{guard:qi("isOpenControlled","isCustomValue",Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}},suggesting:{tags:["open","focused"],effects:["trackDismissableLayer","scrollToHighlightedItem","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"autoHighlight",actions:["highlightFirstItem"]},{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]}],"INPUT.ARROW_DOWN":{target:"interacting",actions:["highlightNextItem"]},"INPUT.ARROW_UP":{target:"interacting",actions:["highlightPrevItem"]},"INPUT.HOME":{target:"interacting",actions:["highlightFirstItem"]},"INPUT.END":{target:"interacting",actions:["highlightLastItem"]},"INPUT.ENTER":[{guard:qi("isOpenControlled","isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":{actions:["setInputValue"]},"LAYER.ESCAPE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.POINTER_MOVE":{target:"interacting",actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"LAYER.INTERACT_OUTSIDE":[{guard:qi("isOpenControlled","isCustomValue",Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.CLICK":[{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}}},implementations:{guards:{isInputValueEmpty:({computed:t})=>t("isInputValueEmpty"),autoComplete:({computed:t,prop:e})=>t("autoComplete")&&!e("multiple"),autoHighlight:({computed:t})=>t("autoHighlight"),isFirstItemHighlighted:({prop:t,context:e})=>t("collection").firstValue===e.get("highlightedValue"),isLastItemHighlighted:({prop:t,context:e})=>t("collection").lastValue===e.get("highlightedValue"),isCustomValue:({computed:t})=>t("isCustomValue"),allowCustomValue:({prop:t})=>!!t("allowCustomValue"),hasHighlightedItem:({context:t})=>t.get("highlightedValue")!=null,closeOnSelect:({prop:t})=>!!t("closeOnSelect"),isOpenControlled:({prop:t})=>t("open")!=null,openOnChange:({prop:t,context:e})=>{const r=t("openOnChange");return Ide(r)?r:!!r?.({inputValue:e.get("inputValue")})},restoreFocus:({event:t})=>t.restoreFocus==null?!0:!!t.restoreFocus,isChangeEvent:({event:t})=>t.previousEvent?.type==="INPUT.CHANGE",autoFocus:({prop:t})=>!!t("autoFocus"),isHighlightedItemRemoved:({prop:t,context:e})=>!t("collection").has(e.get("highlightedValue"))},effects:{trackDismissableLayer({send:t,prop:e,scope:r}){return e("disableLayer")?void 0:tp(()=>hd(r),{type:"listbox",defer:!0,exclude:()=>[ug(r),c0(r),n6(r)],onFocusOutside:e("onFocusOutside"),onPointerDownOutside:e("onPointerDownOutside"),onInteractOutside:e("onInteractOutside"),onEscapeKeyDown(i){i.preventDefault(),i.stopPropagation(),t({type:"LAYER.ESCAPE",src:"escape-key"})},onDismiss(){t({type:"LAYER.INTERACT_OUTSIDE",src:"interact-outside",restoreFocus:!1})}})},hideOtherElements({scope:t}){return YN([ug(t),hd(t),c0(t),n6(t)])},trackPlacement({context:t,prop:e,scope:r}){const n=()=>r6(r)||c0(r),i=()=>t6(r);return t.set("currentPlacement",e("positioning").placement),ra(n,i,{...e("positioning"),defer:!0,onComplete(o){t.set("currentPlacement",o.placement)}})},scrollToHighlightedItem({context:t,prop:e,scope:r,event:n}){const i=ug(r);let o=[];const s=c=>{const u=n.current().type.includes("POINTER"),p=t.get("highlightedValue");if(u||!p)return;const m=hd(r),v=e("scrollToIndexFn");if(v){const x=e("collection").indexOf(p);v({index:x,immediate:c,getElement:()=>Cy(r,p)});return}const b=Cy(r,p),O=wt(()=>{EC(b,{rootEl:m,block:"nearest"})});o.push(O)},a=wt(()=>s(!0));o.push(a);const l=TP(i,{attributes:["aria-activedescendant"],callback:()=>s(!1)});return o.push(l),()=>{o.forEach(c=>c())}}},actions:{reposition({context:t,prop:e,scope:r,event:n}){ra(()=>r6(r),()=>t6(r),{...e("positioning"),...n.options,defer:!0,listeners:!1,onComplete(s){t.set("currentPlacement",s.placement)}})},setHighlightedValue({context:t,event:e}){e.value!=null&&t.set("highlightedValue",e.value)},clearHighlightedValue({context:t}){t.set("highlightedValue",null)},selectHighlightedItem(t){const{context:e,prop:r}=t,n=r("collection"),i=e.get("highlightedValue");if(!i||!n.has(i))return;const o=r("multiple")?lm(e.get("value"),i):[i];r("onSelect")?.({value:o,itemValue:i}),e.set("value",o);const s=Kc(r("selectionBehavior"),{preserve:e.get("inputValue"),replace:n.stringifyMany(o),clear:""});e.set("inputValue",s)},scrollToHighlightedItem({context:t,prop:e,scope:r}){PO(()=>{const n=t.get("highlightedValue");if(n==null)return;const i=Cy(r,n),o=hd(r),s=e("scrollToIndexFn");if(s){const a=e("collection").indexOf(n);s({index:a,immediate:!0,getElement:()=>Cy(r,n)});return}EC(i,{rootEl:o,block:"nearest"})})},selectItem(t){const{context:e,event:r,flush:n,prop:i}=t;r.value!=null&&n(()=>{const o=i("multiple")?lm(e.get("value"),r.value):[r.value];i("onSelect")?.({value:o,itemValue:r.value}),e.set("value",o);const s=Kc(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(o),clear:""});e.set("inputValue",s)})},clearItem(t){const{context:e,event:r,flush:n,prop:i}=t;r.value!=null&&n(()=>{const o=wf(e.get("value"),r.value);e.set("value",o);const s=Kc(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(o),clear:""});e.set("inputValue",s)})},setInitialFocus({scope:t}){wt(()=>{i6(t)})},setFinalFocus({scope:t}){wt(()=>{c0(t)?.dataset.focusable==null?i6(t):wve(t)})},syncInputValue({context:t,scope:e,event:r}){const n=ug(e);n&&(n.value=t.get("inputValue"),queueMicrotask(()=>{r.current().type!=="INPUT.CHANGE"&&nhe(n)}))},setInputValue({context:t,event:e}){t.set("inputValue",e.value)},clearInputValue({context:t}){t.set("inputValue","")},revertInputValue({context:t,prop:e,computed:r}){const n=e("selectionBehavior"),i=Kc(n,{replace:r("hasSelectedItems")?r("valueAsString"):"",preserve:t.get("inputValue"),clear:""});t.set("inputValue",i)},setValue(t){const{context:e,flush:r,event:n,prop:i}=t;r(()=>{e.set("value",n.value);const o=Kc(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(n.value),clear:""});e.set("inputValue",o)})},clearSelectedItems(t){const{context:e,flush:r,prop:n}=t;r(()=>{e.set("value",[]);const i=Kc(n("selectionBehavior"),{preserve:e.get("inputValue"),replace:n("collection").stringifyMany([]),clear:""});e.set("inputValue",i)})},scrollContentToTop({prop:t,scope:e}){const r=t("scrollToIndexFn");if(r){const n=t("collection").firstValue;r({index:0,immediate:!0,getElement:()=>Cy(e,n)})}else{const n=hd(e);if(!n)return;n.scrollTop=0}},invokeOnOpen({prop:t,event:e}){const r=o6(e);t("onOpenChange")?.({open:!0,reason:r})},invokeOnClose({prop:t,event:e}){const r=o6(e);t("onOpenChange")?.({open:!1,reason:r})},highlightFirstItem({context:t,prop:e,scope:r}){(hd(r)?queueMicrotask:wt)(()=>{const i=e("collection").firstValue;i&&t.set("highlightedValue",i)})},highlightFirstItemIfNeeded({computed:t,action:e}){t("autoHighlight")&&e(["highlightFirstItem"])},highlightLastItem({context:t,prop:e,scope:r}){(hd(r)?queueMicrotask:wt)(()=>{const i=e("collection").lastValue;i&&t.set("highlightedValue",i)})},highlightNextItem({context:t,prop:e}){let r=null;const n=t.get("highlightedValue"),i=e("collection");n?(r=i.getNextValue(n),!r&&e("loopFocus")&&(r=i.firstValue)):r=i.firstValue,r&&t.set("highlightedValue",r)},highlightPrevItem({context:t,prop:e}){let r=null;const n=t.get("highlightedValue"),i=e("collection");n?(r=i.getPreviousValue(n),!r&&e("loopFocus")&&(r=i.lastValue)):r=i.lastValue,r&&t.set("highlightedValue",r)},highlightFirstSelectedItem({context:t,prop:e}){wt(()=>{const[r]=e("collection").sort(t.get("value"));r&&t.set("highlightedValue",r)})},highlightFirstOrSelectedItem({context:t,prop:e,computed:r}){wt(()=>{let n=null;r("hasSelectedItems")?n=e("collection").sort(t.get("value"))[0]:n=e("collection").firstValue,n&&t.set("highlightedValue",n)})},highlightLastOrSelectedItem({context:t,prop:e,computed:r}){wt(()=>{const n=e("collection");let i=null;r("hasSelectedItems")?i=n.sort(t.get("value"))[0]:i=n.lastValue,i&&t.set("highlightedValue",i)})},autofillInputValue({context:t,computed:e,prop:r,event:n,scope:i}){const o=ug(i),s=r("collection");if(!e("autoComplete")||!o||!n.keypress)return;const a=s.stringify(t.get("highlightedValue"));wt(()=>{o.value=a||t.get("inputValue")})},syncSelectedItems(t){queueMicrotask(()=>{const{context:e,prop:r}=t,n=r("collection"),i=e.get("value"),o=i.map(a=>e.get("selectedItems").find(c=>n.getItemValue(c)===a)||n.find(a));e.set("selectedItems",o);const s=Kc(r("selectionBehavior"),{preserve:e.get("inputValue"),replace:n.stringifyMany(i),clear:""});e.set("inputValue",s)})},syncHighlightedItem({context:t,prop:e}){const r=e("collection").find(t.get("highlightedValue"));t.set("highlightedItem",r)},toggleVisibility({event:t,send:e,prop:r}){e({type:r("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}}});function o6(t){return(t.previousEvent||t).src}xt()(["allowCustomValue","autoFocus","closeOnSelect","collection","composite","defaultHighlightedValue","defaultInputValue","defaultOpen","defaultValue","dir","disabled","disableLayer","form","getRootNode","highlightedValue","id","ids","inputBehavior","inputValue","invalid","loopFocus","multiple","name","navigate","onFocusOutside","onHighlightChange","onInputValueChange","onInteractOutside","onOpenChange","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","openOnChange","openOnClick","openOnKeyPress","placeholder","positioning","readOnly","required","scrollToIndexFn","selectionBehavior","translations","value","alwaysSubmitOnEnter"]);xt()(["htmlFor"]);xt()(["id"]);xt()(["item","persistFocus"]);const Pve=kH.extendWith("empty"),[_H,hh]=Cn({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),TH=E.forwardRef((t,e)=>{const r=hh(),n=XN(),i=Fa({...n,present:r.open}),o=Ae(r.getBackdropProps(),i.getPresenceProps(),t);return i.unmounted?null:h.jsx(Ue.div,{...o,ref:Eu(i.ref,e)})});TH.displayName="DialogBackdrop";const EH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getCloseTriggerProps(),t);return h.jsx(Ue.button,{...n,ref:e})});EH.displayName="DialogCloseTrigger";const RH=E.forwardRef((t,e)=>{const r=hh(),n=sa(),i=Ae(r.getContentProps(),n.getPresenceProps(),t);return n.unmounted?null:h.jsx(Ue.div,{...i,ref:Eu(n.ref,e)})});RH.displayName="DialogContent";const IH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getDescriptionProps(),t);return h.jsx(Ue.div,{...n,ref:e})});IH.displayName="DialogDescription";const jH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getPositionerProps(),t);return sa().unmounted?null:h.jsx(Ue.div,{...n,ref:e})});jH.displayName="DialogPositioner";var eM=Ct("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Fh=eM.build(),$H=t=>t.ids?.positioner??`dialog:${t.id}:positioner`,AH=t=>t.ids?.backdrop??`dialog:${t.id}:backdrop`,i2=t=>t.ids?.content??`dialog:${t.id}:content`,NH=t=>t.ids?.trigger??`dialog:${t.id}:trigger`,o2=t=>t.ids?.title??`dialog:${t.id}:title`,s2=t=>t.ids?.description??`dialog:${t.id}:description`,MH=t=>t.ids?.closeTrigger??`dialog:${t.id}:close`,jw=t=>t.getById(i2(t)),_ve=t=>t.getById($H(t)),Tve=t=>t.getById(AH(t)),Eve=t=>t.getById(NH(t)),Rve=t=>t.getById(o2(t)),Ive=t=>t.getById(s2(t)),jve=t=>t.getById(MH(t));function $ve(t,e){const{state:r,send:n,context:i,prop:o,scope:s}=t,a=o("aria-label"),l=r.matches("open");return{open:l,setOpen(c){r.matches("open")!==c&&n({type:c?"OPEN":"CLOSE"})},getTriggerProps(){return e.button({...Fh.trigger.attrs,dir:o("dir"),id:NH(s),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":i2(s),onClick(c){c.defaultPrevented||n({type:"TOGGLE"})}})},getBackdropProps(){return e.element({...Fh.backdrop.attrs,dir:o("dir"),hidden:!l,id:AH(s),"data-state":l?"open":"closed"})},getPositionerProps(){return e.element({...Fh.positioner.attrs,dir:o("dir"),id:$H(s),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){const c=i.get("rendered");return e.element({...Fh.content.attrs,dir:o("dir"),role:o("role"),hidden:!l,id:i2(s),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":!0,"aria-label":a||void 0,"aria-labelledby":a||!c.title?void 0:o2(s),"aria-describedby":c.description?s2(s):void 0})},getTitleProps(){return e.element({...Fh.title.attrs,dir:o("dir"),id:o2(s)})},getDescriptionProps(){return e.element({...Fh.description.attrs,dir:o("dir"),id:s2(s)})},getCloseTriggerProps(){return e.button({...Fh.closeTrigger.attrs,dir:o("dir"),id:MH(s),type:"button",onClick(c){c.defaultPrevented||(c.stopPropagation(),n({type:"CLOSE"}))}})}}}var Ave={props({props:t,scope:e}){const r=t.role==="alertdialog",n=r?()=>jve(e):void 0,i=typeof t.modal=="boolean"?t.modal:!0;return{role:"dialog",modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:!r,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:n,...t}},initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({bindable:t}){return{rendered:t(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:t,action:e,prop:r}){t([()=>r("open")],()=>{e(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:t})=>t("open")!=null},effects:{trackDismissableElement({scope:t,send:e,prop:r}){return tp(()=>jw(t),{type:"dialog",defer:!0,pointerBlocking:r("modal"),exclude:[Eve(t)],onInteractOutside(i){r("onInteractOutside")?.(i),r("closeOnInteractOutside")||i.preventDefault()},persistentElements:r("persistentElements"),onFocusOutside:r("onFocusOutside"),onPointerDownOutside:r("onPointerDownOutside"),onRequestDismiss:r("onRequestDismiss"),onEscapeKeyDown(i){r("onEscapeKeyDown")?.(i),r("closeOnEscape")||i.preventDefault()},onDismiss(){e({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:t,prop:e}){if(e("preventScroll"))return rH(t.getDoc())},trapFocus({scope:t,prop:e}){return e("trapFocus")?tH(()=>jw(t),{preventScroll:!0,returnFocusOnDeactivate:!!e("restoreFocus"),initialFocus:e("initialFocusEl"),setReturnFocus:n=>e("finalFocusEl")?.()??n}):void 0},hideContentBelow({scope:t,prop:e}){return e("modal")?YN(()=>[jw(t)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:t,scope:e}){wt(()=>{t.set("rendered",{title:!!Rve(e),description:!!Ive(e)})})},syncZIndex({scope:t}){wt(()=>{const e=jw(t);if(!e)return;const r=$f(e);[_ve(t),Tve(t)].forEach(i=>{i?.style.setProperty("--z-index",r.zIndex),i?.style.setProperty("--layer-index",r.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:t}){t("onOpenChange")?.({open:!1})},invokeOnOpen({prop:t}){t("onOpenChange")?.({open:!0})},toggleVisibility({prop:t,send:e,event:r}){e({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}}};xt()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const Nve=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,getRootNode:r,dir:n,...t},o=Ps(Ave,i);return $ve(o,oa)},Mve=t=>{const[e,{children:r,...n}]=Cc(t),[i]=Ym(e),o=Nve(n),s=Fa(Ae({present:o.open},e));return h.jsx(_H,{value:o,children:h.jsx(Zm,{value:i,children:h.jsx(kl,{value:s,children:r})})})},Dve=t=>{const[e,{value:r,children:n}]=Cc(t),[i]=Ym(e),o=Fa(Ae({present:r.open},e));return h.jsx(_H,{value:r,children:h.jsx(Zm,{value:i,children:h.jsx(kl,{value:o,children:n})})})},DH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getTitleProps(),t);return h.jsx(Ue.h2,{...n,ref:e})});DH.displayName="DialogTitle";const LH=E.forwardRef((t,e)=>{const r=hh(),n=sa(),i=Ae({...r.getTriggerProps(),"aria-controls":n.unmounted?void 0:r.getTriggerProps()["aria-controls"]},t);return h.jsx(Ue.button,{...i,ref:e})});LH.displayName="DialogTrigger";var VH=Ct("editable").parts("root","area","label","preview","input","editTrigger","submitTrigger","cancelTrigger","control");VH.build();xt()(["activationMode","autoResize","dir","disabled","finalFocusEl","form","getRootNode","id","ids","invalid","maxLength","name","onEditChange","onFocusOutside","onInteractOutside","onPointerDownOutside","onValueChange","onValueCommit","onValueRevert","placeholder","readOnly","required","selectOnFocus","edit","defaultEdit","submitMode","translations","defaultValue","value"]);const FH=E.forwardRef((t,e)=>{const r=dh(),n=Ae(r?.getInputProps(),t);return h.jsx(Ue.input,{...n,ref:e})});FH.displayName="FieldInput";const QH=Ct("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator");QH.build();const BH=E.forwardRef((t,e)=>{const r=dh(),n=Ae(r?.getSelectProps(),t);return h.jsx(Ue.select,{...n,ref:e})});BH.displayName="FieldSelect";var Lve=t=>{if(!t)return;const e=$f(t),r=hi(t),n=ks(t),i=()=>{requestAnimationFrame(()=>{t.style.height="auto";let c;e.boxSizing==="content-box"?c=t.scrollHeight-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):c=t.scrollHeight+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),e.maxHeight!=="none"&&c>parseFloat(e.maxHeight)?(e.overflowY==="hidden"&&(t.style.overflowY="scroll"),c=parseFloat(e.maxHeight)):e.overflowY!=="hidden"&&(t.style.overflowY="hidden"),t.style.height=`${c}px`})};t.addEventListener("input",i),t.form?.addEventListener("reset",i);const o=Object.getPrototypeOf(t),s=Object.getOwnPropertyDescriptor(o,"value");Object.defineProperty(t,"value",{...s,set(){s?.set?.apply(this,arguments),i()}});const a=new r.ResizeObserver(()=>{requestAnimationFrame(()=>i())});a.observe(t);const l=new r.MutationObserver(()=>i());return l.observe(t,{attributes:!0,attributeFilter:["rows","placeholder"]}),n.fonts?.addEventListener("loadingdone",i),()=>{t.removeEventListener("input",i),t.form?.removeEventListener("reset",i),n.fonts?.removeEventListener("loadingdone",i),a.disconnect(),l.disconnect()}};const zH=E.forwardRef((t,e)=>{const{autoresize:r,...n}=t,i=E.useRef(null),o=dh(),s=Ae(o?.getTextareaProps(),{style:{resize:r?"none":void 0}},n);return E.useEffect(()=>{if(r)return Lve(i.current)},[r]),h.jsx(Ue.textarea,{...s,ref:Eu(e,i)})});zH.displayName="FieldTextarea";const qH=Ct("fieldset").parts("root","errorText","helperText","legend");qH.build();var WH=Ct("file-upload").parts("root","dropzone","item","itemDeleteTrigger","itemGroup","itemName","itemPreview","itemPreviewImage","itemSizeText","label","trigger","clearTrigger");WH.build();xt()(["accept","acceptedFiles","allowDrop","capture","defaultAcceptedFiles","dir","directory","disabled","getRootNode","id","ids","invalid","locale","maxFiles","maxFileSize","minFileSize","name","onFileAccept","onFileChange","onFileReject","preventDocumentDrop","required","transformFiles","translations","validate"]);xt()(["file","type"]);const[UH,TO]=Cn({name:"HoverCardContext",hookName:"useHoverCardContext",providerName:"<HoverCardProvider />"}),HH=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getArrowProps(),t);return h.jsx(Ue.div,{...n,ref:e})});HH.displayName="HoverCardArrow";const GH=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getArrowTipProps(),t);return h.jsx(Ue.div,{...n,ref:e})});GH.displayName="HoverCardArrowTip";const XH=E.forwardRef((t,e)=>{const r=TO(),n=sa(),i=Ae(r.getContentProps(),n.getPresenceProps(),t);return n.unmounted?null:h.jsx(Ue.div,{...i,ref:Eu(n.ref,e)})});XH.displayName="HoverCardContent";const ZH=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getPositionerProps(),t);return sa().unmounted?null:h.jsx(Ue.div,{...n,ref:e})});ZH.displayName="HoverCardPositioner";var YH=Ct("hoverCard").parts("arrow","arrowTip","trigger","positioner","content"),ky=YH.build(),KH=t=>t.ids?.trigger??`hover-card:${t.id}:trigger`,JH=t=>t.ids?.content??`hover-card:${t.id}:content`,eG=t=>t.ids?.positioner??`hover-card:${t.id}:popper`,Vve=t=>t.ids?.arrow??`hover-card:${t.id}:arrow`,bR=t=>t.getById(KH(t)),Fve=t=>t.getById(JH(t)),s6=t=>t.getById(eG(t));function Qve(t,e){const{state:r,send:n,prop:i,context:o,scope:s}=t,a=r.hasTag("open"),l=AP({...i("positioning"),placement:o.get("currentPlacement")});return{open:a,setOpen(c){r.hasTag("open")!==c&&(i("disabled")||n({type:c?"OPEN":"CLOSE"}))},reposition(c={}){n({type:"POSITIONING.SET",options:c})},getArrowProps(){return e.element({id:Vve(s),...ky.arrow.attrs,dir:i("dir"),style:l.arrow})},getArrowTipProps(){return e.element({...ky.arrowTip.attrs,dir:i("dir"),style:l.arrowTip})},getTriggerProps(){return e.element({...ky.trigger.attrs,dir:i("dir"),"data-placement":o.get("currentPlacement"),id:KH(s),"data-state":a?"open":"closed",onPointerEnter(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_ENTER",src:"trigger"}))},onPointerLeave(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_LEAVE",src:"trigger"}))},onFocus(){i("disabled")||n({type:"TRIGGER_FOCUS"})},onBlur(){i("disabled")||n({type:"TRIGGER_BLUR"})}})},getPositionerProps(){return e.element({id:eG(s),...ky.positioner.attrs,dir:i("dir"),style:l.floating})},getContentProps(){return e.element({...ky.content.attrs,dir:i("dir"),id:JH(s),hidden:!a,tabIndex:-1,"data-state":a?"open":"closed","data-placement":o.get("currentPlacement"),onPointerEnter(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_ENTER",src:"content"}))},onPointerLeave(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_LEAVE",src:"content"}))}})}}}var{not:$w,and:a6}=Cl(),Bve={props({props:t}){return{disabled:!1,openDelay:600,closeDelay:300,...t,positioning:{placement:"bottom",...t.positioning}}},initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({prop:t,bindable:e}){return{open:e(()=>({defaultValue:t("defaultOpen"),value:t("open"),onChange(r){t("onOpenChange")?.({open:r})}})),currentPlacement:e(()=>({defaultValue:void 0})),isPointer:e(()=>({defaultValue:!1}))}},watch({track:t,context:e,action:r,prop:n,send:i}){t([()=>n("disabled")],()=>{n("disabled")&&i({type:"CLOSE",src:"disabled.change"})}),t([()=>e.get("open")],()=>{r(["toggleVisibility"])})},states:{closed:{tags:["closed"],entry:["clearIsPointer"],on:{"CONTROLLED.OPEN":{target:"open"},POINTER_ENTER:{target:"opening",actions:["setIsPointer"]},TRIGGER_FOCUS:{target:"opening"},OPEN:{target:"opening"}}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{OPEN_DELAY:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},POINTER_LEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:a6("isOpenControlled",$w("isPointer")),actions:["invokeOnClose","toggleVisibility"]},{guard:$w("isPointer"),target:"closed",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],on:{"CONTROLLED.CLOSE":{target:"closed"},POINTER_ENTER:{actions:["setIsPointer"]},POINTER_LEAVE:{target:"closing"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:a6("isOpenControlled",$w("isPointer")),actions:["invokeOnClose"]},{guard:$w("isPointer"),target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}},closing:{tags:["open"],effects:["trackPositioning","waitForCloseDelay"],on:{CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"CONTROLLED.CLOSE":{target:"closed"},"CONTROLLED.OPEN":{target:"open"},POINTER_ENTER:{target:"open",actions:["setIsPointer"]}}}},implementations:{guards:{isPointer:({context:t})=>!!t.get("isPointer"),isOpenControlled:({prop:t})=>t("open")!=null},effects:{waitForOpenDelay({send:t,prop:e}){const r=setTimeout(()=>{t({type:"OPEN_DELAY"})},e("openDelay"));return()=>clearTimeout(r)},waitForCloseDelay({send:t,prop:e}){const r=setTimeout(()=>{t({type:"CLOSE_DELAY"})},e("closeDelay"));return()=>clearTimeout(r)},trackPositioning({context:t,prop:e,scope:r}){t.get("currentPlacement")||t.set("currentPlacement",e("positioning").placement);const n=()=>s6(r);return ra(bR(r),n,{...e("positioning"),defer:!0,onComplete(i){t.set("currentPlacement",i.placement)}})},trackDismissableElement({send:t,scope:e,prop:r}){return tp(()=>Fve(e),{type:"popover",defer:!0,exclude:[bR(e)],onDismiss(){t({type:"CLOSE",src:"interact-outside"})},onInteractOutside:r("onInteractOutside"),onPointerDownOutside:r("onPointerDownOutside"),onFocusOutside(i){i.preventDefault(),r("onFocusOutside")?.(i)}})}},actions:{invokeOnClose({prop:t}){t("onOpenChange")?.({open:!1})},invokeOnOpen({prop:t}){t("onOpenChange")?.({open:!0})},setIsPointer({context:t}){t.set("isPointer",!0)},clearIsPointer({context:t}){t.set("isPointer",!1)},reposition({context:t,prop:e,scope:r,event:n}){const i=()=>s6(r);ra(bR(r),i,{...e("positioning"),...n.options,defer:!0,listeners:!1,onComplete(o){t.set("currentPlacement",o.placement)}})},toggleVisibility({prop:t,event:e,send:r}){queueMicrotask(()=>{r({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})})}}}};xt()(["closeDelay","dir","getRootNode","id","ids","disabled","onOpenChange","defaultOpen","open","openDelay","positioning","onInteractOutside","onPointerDownOutside","onFocusOutside"]);const zve=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,dir:n,getRootNode:r,...t},o=Ps(Bve,i);return Qve(o,oa)},qve=t=>{const[e,{children:r,...n}]=Cc(t),i=zve(n),o=Fa(Ae({present:i.open},e));return h.jsx(UH,{value:i,children:h.jsx(kl,{value:o,children:r})})},Wve=t=>{const[e,{value:r,children:n}]=Cc(t),i=Fa(Ae({present:r.open},e));return h.jsx(UH,{value:r,children:h.jsx(kl,{value:i,children:n})})},tG=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getTriggerProps(),t);return h.jsx(Ue.button,{...n,ref:e})});tG.displayName="HoverCardTrigger";var rG=Ct("tree-view").parts("branch","branchContent","branchControl","branchIndentGuide","branchIndicator","branchText","branchTrigger","item","itemIndicator","itemText","label","nodeCheckbox","nodeRenameInput","root","tree");rG.build();var nG=t=>new SH(t);nG.empty=()=>new SH({rootNode:{children:[]}});var Uve=(t,e)=>t.ids?.node?.(e)??`tree:${t.id}:node:${e}`,Vl=(t,e)=>{e!=null&&t.getById(Uve(t,e))?.focus()},Hve=(t,e)=>`tree:${t.id}:rename-input:${e}`,l6=(t,e)=>t.getById(Hve(t,e));function Gve(t,e,r){const n=t.getDescendantValues(e),i=n.every(o=>r.includes(o));return Og(i?wf(r,...n):ff(r,...n))}function Aw(t,e){const{context:r,prop:n,refs:i}=t;if(!n("loadChildren")){r.set("expandedValue",O=>Og(ff(O,...e)));return}const o=r.get("loadingStatus"),[s,a]=dF(e,O=>o[O]==="loaded");if(s.length>0&&r.set("expandedValue",O=>Og(ff(O,...s))),a.length===0)return;const l=n("collection"),[c,u]=dF(a,O=>{const x=l.findNode(O);return l.getNodeChildren(x).length>0});if(c.length>0&&r.set("expandedValue",O=>Og(ff(O,...c))),u.length===0)return;r.set("loadingStatus",O=>({...O,...u.reduce((x,S)=>({...x,[S]:"loading"}),{})}));const p=u.map(O=>{const x=l.getIndexPath(O),S=l.getValuePath(x),w=l.findNode(O);return{id:O,indexPath:x,valuePath:S,node:w}}),m=i.get("pendingAborts"),v=n("loadChildren");Z9(v,()=>"[zag-js/tree-view] `loadChildren` is required for async expansion");const b=p.map(({id:O,indexPath:x,valuePath:S,node:w})=>{const k=m.get(O);k&&(k.abort(),m.delete(O));const P=new AbortController;return m.set(O,P),v({valuePath:S,indexPath:x,node:w,signal:P.signal})});Promise.allSettled(b).then(O=>{const x=[],S=[],w=r.get("loadingStatus");let k=n("collection");O.forEach((P,_)=>{const{id:T,indexPath:R,node:$,valuePath:A}=p[_];P.status==="fulfilled"?(w[T]="loaded",x.push(T),k=k.replace(R,{...$,children:P.value})):(m.delete(T),Reflect.deleteProperty(w,T),S.push({node:$,error:P.reason,indexPath:R,valuePath:A}))}),r.set("loadingStatus",w),x.length&&(r.set("expandedValue",P=>Og(ff(P,...x))),n("onLoadChildrenComplete")?.({collection:k})),S.length&&n("onLoadChildrenError")?.({nodes:S})})}function ld(t){const{prop:e,context:r}=t;return function({indexPath:i}){return e("collection").getValuePath(i).slice(0,-1).some(s=>!r.get("expandedValue").includes(s))}}var{and:Fl}=Cl();Fl("isMultipleSelection","moveFocus"),Fl("isShiftKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection"),Fl("isBranchFocused","isBranchExpanded"),Fl("isShiftKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection"),Fl("isCtrlKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection"),Fl("isCtrlKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection");xt()(["ids","collection","dir","expandedValue","expandOnClick","defaultFocusedValue","focusedValue","getRootNode","id","onExpandedChange","onFocusChange","onSelectionChange","checkedValue","selectedValue","selectionMode","typeahead","defaultExpandedValue","defaultSelectedValue","defaultCheckedValue","onCheckedChange","onLoadChildrenComplete","onLoadChildrenError","loadChildren","canRename","onRenameStart","onBeforeRename","onRenameComplete"]);xt()(["node","indexPath"]);var iG=Ct("listbox").parts("label","input","item","itemText","itemIndicator","itemGroup","itemGroupLabel","content","root","valueText");iG.build();xt()(["collection","defaultHighlightedValue","defaultValue","dir","disabled","deselectable","disallowSelectAll","getRootNode","highlightedValue","id","ids","loopFocus","onHighlightChange","onSelect","onValueChange","orientation","scrollToIndexFn","selectionMode","selectOnHighlight","typeahead","value"]);xt()(["item","highlightOnHover"]);xt()(["id"]);xt()(["htmlFor"]);const Xve=iG.extendWith("empty"),[oG,Ji]=Cn({name:"MenuContext",hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),sG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getArrowProps(),t);return h.jsx(Ue.div,{...n,ref:e})});sG.displayName="MenuArrow";const aG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getArrowTipProps(),t);return h.jsx(Ue.div,{...n,ref:e})});aG.displayName="MenuArrowTip";const[tM]=Cn({name:"MenuItemContext",hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[FP,lG]=Cn({name:"MenuItemPropsContext",hookName:"useMenuItemPropsContext",providerName:"<MenuItemPropsProvider />"}),cG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),i={...r,type:"checkbox"},o=Ji(),s=Ae(o.getOptionItemProps(i),n),a=o.getOptionItemState(i);return h.jsx(FP,{value:i,children:h.jsx(tM,{value:a,children:h.jsx(Ue.div,{...s,ref:e})})})});cG.displayName="MenuCheckboxItem";const uG=E.forwardRef((t,e)=>{const r=Ji(),n=sa(),i=Ae(r.getContentProps(),n.getPresenceProps(),t);return n.unmounted?null:h.jsx(Ue.div,{...i,ref:Eu(n.ref,e)})});uG.displayName="MenuContent";const dG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getContextTriggerProps(),t);return h.jsx(Ue.button,{...n,ref:e})});dG.displayName="MenuContextTrigger";const hG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getIndicatorProps(),t);return h.jsx(Ue.div,{...n,ref:e})});hG.displayName="MenuIndicator";const fG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["closeOnSelect","disabled","value","valueText","onSelect"]),i=Ji(),o=Ae(i.getItemProps(r),n),s=i.getItemState(r);return E.useEffect(()=>i.addItemListener({id:s.id,onSelect:r.onSelect}),[s.id,r.onSelect]),h.jsx(FP,{value:r,children:h.jsx(tM,{value:s,children:h.jsx(Ue.div,{...o,ref:e})})})});fG.displayName="MenuItem";const[pG,gG]=Cn({name:"MenuItemGroupContext",hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),mG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["id"]),i=Ji(),s={id:E.useId(),...r},a=Ae(i.getItemGroupProps(s),n);return h.jsx(pG,{value:s,children:h.jsx(Ue.div,{...a,ref:e})})});mG.displayName="MenuItemGroup";const vG=E.forwardRef((t,e)=>{const r=Ji(),n=gG(),i=Ae(r.getItemGroupLabelProps({htmlFor:n.id}),t);return h.jsx(Ue.div,{...i,ref:e})});vG.displayName="MenuItemGroupLabel";const yG=E.forwardRef((t,e)=>{const r=Ji(),n=lG(),i=Ae(r.getItemIndicatorProps(n),t);return h.jsx(Ue.div,{...i,ref:e})});yG.displayName="MenuItemIndicator";const bG=E.forwardRef((t,e)=>{const r=Ji(),n=lG(),i=Ae(r.getItemTextProps(n),t);return h.jsx(Ue.div,{...i,ref:e})});bG.displayName="MenuItemText";const OG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getPositionerProps(),t);return sa().unmounted?null:h.jsx(Ue.div,{...n,ref:e})});OG.displayName="MenuPositioner";const xG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["closeOnSelect","disabled","value","valueText"]),i=Ji(),o=gG(),s={...r,checked:o.value===r.value,type:"radio",onCheckedChange:()=>o.onValueChange?.({value:r.value})},a=Ae(i.getOptionItemProps(s),n),l=i.getOptionItemState(s);return h.jsx(FP,{value:s,children:h.jsx(tM,{value:l,children:h.jsx(Ue.div,{...a,ref:e})})})});xG.displayName="MenuRadioItem";const wG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["id","onValueChange","value"]),i=Ji(),s={id:E.useId(),...r},a=Ae(i.getItemGroupProps({id:s.id}),n);return h.jsx(pG,{value:s,children:h.jsx(Ue.div,{...a,ref:e})})});wG.displayName="MenuRadioItemGroup";const SG=t=>{const e=E.useRef(t),r=E.useRef(!1);E.useEffect(()=>{e.current=t}),E.useEffect(()=>{r.current!==!0&&(r.current=!0,e.current())},[])};var CG=Ct("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),Lo=CG.build(),VC=t=>t.ids?.trigger??`menu:${t.id}:trigger`,kG=t=>t.ids?.contextTrigger??`menu:${t.id}:ctx-trigger`,_0=t=>t.ids?.content??`menu:${t.id}:content`,Zve=t=>t.ids?.arrow??`menu:${t.id}:arrow`,PG=t=>t.ids?.positioner??`menu:${t.id}:popper`,Yve=(t,e)=>t.ids?.group?.(e)??`menu:${t.id}:group:${e}`,hb=(t,e)=>`${t.id}/${e}`,Qh=t=>t?.dataset.value??null,c6=(t,e)=>t.ids?.groupLabel?.(e)??`menu:${t.id}:group-label:${e}`,fd=t=>t.getById(_0(t)),u6=t=>t.getById(PG(t)),Nw=t=>t.getById(VC(t)),Kve=(t,e)=>e?t.getById(hb(t,e)):null,OR=t=>t.getById(kG(t)),EO=t=>{const r=`[role^="menuitem"][data-ownedby=${CSS.escape(_0(t))}]:not([data-disabled])`;return sb(fd(t),r)},Jve=t=>zg(EO(t)),eye=t=>wP(EO(t)),rM=(t,e)=>e?t.id===e||t.dataset.value===e:!1,tye=(t,e)=>{const r=EO(t),n=r.findIndex(i=>rM(i,e.value));return _de(r,n,{loop:e.loop??e.loopFocus})},rye=(t,e)=>{const r=EO(t),n=r.findIndex(i=>rM(i,e.value));return Ede(r,n,{loop:e.loop??e.loopFocus})},nye=(t,e)=>{const r=EO(t),n=r.find(i=>rM(i,e.value));return lb(r,{state:e.typeaheadState,key:e.key,activeId:n?.id??null})},Mw=t=>Yi(t)&&(t.dataset.disabled===""||t.hasAttribute("disabled")),iye=t=>!!t?.getAttribute("role")?.startsWith("menuitem")&&!!t?.hasAttribute("aria-controls"),a2="menu:select";function oye(t,e){if(!t)return;const r=hi(t),n=new r.CustomEvent(a2,{detail:{value:e}});t.dispatchEvent(n)}function sye(t,e){const{context:r,send:n,state:i,computed:o,prop:s,scope:a}=t,l=i.hasTag("open"),c=r.get("isSubmenu"),u=o("isTypingAhead"),p=s("composite"),m=r.get("currentPlacement"),v=r.get("anchorPoint"),b=r.get("highlightedValue"),O=AP({...s("positioning"),placement:v?"bottom":m});function x(P){return{id:hb(a,P.value),disabled:!!P.disabled,highlighted:b===P.value}}function S(P){const _=P.valueText??P.value;return{...P,id:P.value,valueText:_}}function w(P){return{...x(S(P)),checked:!!P.checked}}function k(P){const{closeOnSelect:_,valueText:T,value:R}=P,$=x(P),A=hb(a,R);return e.element({...Lo.item.attrs,id:A,role:"menuitem","aria-disabled":J9($.disabled),"data-disabled":st($.disabled),"data-ownedby":_0(a),"data-highlighted":st($.highlighted),"data-value":R,"data-valuetext":T,onDragStart(M){M.currentTarget.matches("a[href]")&&M.preventDefault()},onPointerMove(M){if($.disabled||M.pointerType!=="mouse")return;const Q=M.currentTarget;$.highlighted||n({type:"ITEM_POINTERMOVE",id:A,target:Q,closeOnSelect:_})},onPointerLeave(M){if($.disabled||M.pointerType!=="mouse"||!t.event.previous()?.type.includes("POINTER"))return;const V=M.currentTarget;n({type:"ITEM_POINTERLEAVE",id:A,target:V,closeOnSelect:_})},onPointerDown(M){if($.disabled)return;const Q=M.currentTarget;n({type:"ITEM_POINTERDOWN",target:Q,id:A,closeOnSelect:_})},onClick(M){if(OF(M)||Xj(M)||$.disabled)return;const Q=M.currentTarget;n({type:"ITEM_CLICK",target:Q,id:A,closeOnSelect:_})}})}return{highlightedValue:b,open:l,setOpen(P){i.hasTag("open")!==P&&n({type:P?"OPEN":"CLOSE"})},setHighlightedValue(P){n({type:"HIGHLIGHTED.SET",value:P})},setParent(P){n({type:"PARENT.SET",value:P,id:P.prop("id")})},setChild(P){n({type:"CHILD.SET",value:P,id:P.prop("id")})},reposition(P={}){n({type:"POSITIONING.SET",options:P})},addItemListener(P){const _=a.getById(P.id);if(!_)return;const T=()=>P.onSelect?.();return _.addEventListener(a2,T),()=>_.removeEventListener(a2,T)},getContextTriggerProps(){return e.element({...Lo.contextTrigger.attrs,dir:s("dir"),id:kG(a),"data-state":l?"open":"closed",onPointerDown(P){if(P.pointerType==="mouse")return;const _=su(P);n({type:"CONTEXT_MENU_START",point:_})},onPointerCancel(P){P.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerMove(P){P.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerUp(P){P.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onContextMenu(P){const _=su(P);n({type:"CONTEXT_MENU",point:_}),P.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(P){const _=P.getTriggerProps();return Ae(k({value:_.id}),_)},getTriggerProps(){return e.button({...c?Lo.triggerItem.attrs:Lo.trigger.attrs,"data-placement":r.get("currentPlacement"),type:"button",dir:s("dir"),id:VC(a),"data-uid":s("id"),"aria-haspopup":p?"menu":"dialog","aria-controls":_0(a),"aria-expanded":l||void 0,"data-state":l?"open":"closed",onPointerMove(P){if(P.pointerType!=="mouse"||Mw(P.currentTarget)||!c)return;const T=su(P);n({type:"TRIGGER_POINTERMOVE",target:P.currentTarget,point:T})},onPointerLeave(P){if(Mw(P.currentTarget)||P.pointerType!=="mouse"||!c)return;const _=su(P);n({type:"TRIGGER_POINTERLEAVE",target:P.currentTarget,point:_})},onPointerDown(P){Mw(P.currentTarget)||lU(P)||P.preventDefault()},onClick(P){P.defaultPrevented||Mw(P.currentTarget)||n({type:"TRIGGER_CLICK",target:P.currentTarget})},onBlur(){n({type:"TRIGGER_BLUR"})},onFocus(){n({type:"TRIGGER_FOCUS"})},onKeyDown(P){if(P.defaultPrevented)return;const _={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},Enter(){n({type:"ARROW_DOWN",src:"enter"})},Space(){n({type:"ARROW_DOWN",src:"space"})}},T=_C(P,{orientation:"vertical",dir:s("dir")}),R=_[T];R&&(P.preventDefault(),R(P))}})},getIndicatorProps(){return e.element({...Lo.indicator.attrs,dir:s("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return e.element({...Lo.positioner.attrs,dir:s("dir"),id:PG(a),style:O.floating})},getArrowProps(){return e.element({id:Zve(a),...Lo.arrow.attrs,dir:s("dir"),style:O.arrow})},getArrowTipProps(){return e.element({...Lo.arrowTip.attrs,dir:s("dir"),style:O.arrowTip})},getContentProps(){return e.element({...Lo.content.attrs,id:_0(a),"aria-label":s("aria-label"),hidden:!l,"data-state":l?"open":"closed",role:p?"menu":"dialog",tabIndex:0,dir:s("dir"),"aria-activedescendant":o("highlightedId")||void 0,"aria-labelledby":VC(a),"data-placement":m,onPointerEnter(P){P.pointerType==="mouse"&&n({type:"MENU_POINTERENTER"})},onKeyDown(P){if(P.defaultPrevented||!ys(P.currentTarget,ti(P)))return;const _=ti(P);if(!(_?.closest("[role=menu]")===P.currentTarget||_===P.currentTarget))return;if(P.key==="Tab"&&!Hhe(P)){P.preventDefault();return}const R={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},ArrowLeft(){n({type:"ARROW_LEFT"})},ArrowRight(){n({type:"ARROW_RIGHT"})},Enter(){n({type:"ENTER"})},Space(M){u?n({type:"TYPEAHEAD",key:M.key}):R.Enter?.(M)},Home(){n({type:"HOME"})},End(){n({type:"END"})}},$=_C(P,{dir:s("dir")}),A=R[$];if(A){A(P),P.stopPropagation(),P.preventDefault();return}s("typeahead")&&jhe(P)&&(Ahe(P)||CN(_)||(n({type:"TYPEAHEAD",key:P.key}),P.preventDefault()))}})},getSeparatorProps(){return e.element({...Lo.separator.attrs,role:"separator",dir:s("dir"),"aria-orientation":"horizontal"})},getItemState:x,getItemProps:k,getOptionItemState:w,getOptionItemProps(P){const{type:_,disabled:T,closeOnSelect:R}=P,$=S(P),A=w(P);return{...k($),...e.element({"data-type":_,...Lo.item.attrs,dir:s("dir"),"data-value":$.value,role:`menuitem${_}`,"aria-checked":!!A.checked,"data-state":A.checked?"checked":"unchecked",onClick(M){if(T||OF(M)||Xj(M))return;const Q=M.currentTarget;n({type:"ITEM_CLICK",target:Q,option:$,closeOnSelect:R})}})}},getItemIndicatorProps(P){const _=w(fF(P)),T=_.checked?"checked":"unchecked";return e.element({...Lo.itemIndicator.attrs,dir:s("dir"),"data-disabled":st(_.disabled),"data-highlighted":st(_.highlighted),"data-state":ll(P,"checked")?T:void 0,hidden:ll(P,"checked")?!_.checked:void 0})},getItemTextProps(P){const _=w(fF(P)),T=_.checked?"checked":"unchecked";return e.element({...Lo.itemText.attrs,dir:s("dir"),"data-disabled":st(_.disabled),"data-highlighted":st(_.highlighted),"data-state":ll(P,"checked")?T:void 0})},getItemGroupLabelProps(P){return e.element({...Lo.itemGroupLabel.attrs,id:c6(a,P.htmlFor),dir:s("dir")})},getItemGroupProps(P){return e.element({id:Yve(a,P.id),...Lo.itemGroup.attrs,dir:s("dir"),"aria-labelledby":c6(a,P.id),role:"group"})}}}var{not:va,and:Wp,or:aye}=Cl(),lye={props({props:t}){return{closeOnSelect:!0,typeahead:!0,composite:!0,loopFocus:!1,navigate(e){IN(e.node)},...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning}}},initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"idle"},context({bindable:t,prop:e}){return{suspendPointer:t(()=>({defaultValue:!1})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(r){e("onHighlightChange")?.({highlightedValue:r})}})),lastHighlightedValue:t(()=>({defaultValue:null})),currentPlacement:t(()=>({defaultValue:void 0})),intentPolygon:t(()=>({defaultValue:null})),anchorPoint:t(()=>({defaultValue:null,hash(r){return`x: ${r?.x}, y: ${r?.y}`}})),isSubmenu:t(()=>({defaultValue:!1}))}},refs(){return{parent:null,children:{},typeaheadState:{...lb.defaultOptions},positioningOverride:{}}},computed:{isRtl:({prop:t})=>t("dir")==="rtl",isTypingAhead:({refs:t})=>t.get("typeaheadState").keysSoFar!=="",highlightedId:({context:t,scope:e,refs:r})=>uye(r.get("children"),t.get("highlightedValue"),e)},watch({track:t,action:e,context:r,prop:n}){t([()=>r.get("isSubmenu")],()=>{e(["setSubmenuPlacement"])}),t([()=>r.hash("anchorPoint")],()=>{r.get("anchorPoint")&&e(["reposition"])}),t([()=>n("open")],()=>{e(["toggleVisibility"])})},on:{"PARENT.SET":{actions:["setParentMenu"]},"CHILD.SET":{actions:["setChildMenu"]},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"HIGHLIGHTED.RESTORE":{actions:["restoreHighlightedItem"]},"HIGHLIGHTED.SET":{actions:["setHighlightedItem"]}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_FOCUS:{guard:va("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],effects:["waitForLongPress"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"LONG_PRESS.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},BLUR:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"DELAY.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},closing:{tags:["open"],effects:["trackPointerMove","trackInteractOutside","waitForCloseDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]},MENU_POINTERENTER:{target:"open",actions:["clearIntentPolygon"]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]}],"DELAY.CLOSE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem","invokeOnClose"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer","clearAnchorPoint"],on:{"CONTROLLED.OPEN":[{guard:aye("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:["highlightFirstItem"]},{guard:"isArrowUpEvent",target:"open",actions:["highlightLastItem"]},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:{target:"idle"},ARROW_DOWN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Wp(va("isTriggerItem"),"isOpenControlled"),actions:["invokeOnClose"]},{guard:va("isTriggerItem"),target:"closed",actions:["invokeOnClose"]}],CONTEXT_MENU:{actions:["setAnchorPoint","focusMenu"]},ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Wp("isSubmenu","isOpenControlled"),actions:["invokeOnClose"]},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},ENTER:[{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},{actions:["clickHighlightedItem"]}],ITEM_POINTERMOVE:[{guard:va("isPointerSuspended"),actions:["setHighlightedItem","focusMenu"]},{actions:["setLastHighlightedItem"]}],ITEM_POINTERLEAVE:{guard:Wp(va("isPointerSuspended"),va("isTriggerItem")),actions:["clearHighlightedItem"]},ITEM_CLICK:[{guard:Wp(va("isTriggerItemHighlighted"),va("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Wp(va("isTriggerItemHighlighted"),va("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Wp(va("isTriggerItemHighlighted"),va("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:["setHighlightedItem"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",actions:["setIntentPolygon"]},TRIGGER_POINTERLEAVE:{target:"closing"},ITEM_POINTERDOWN:{actions:["setHighlightedItem"]},TYPEAHEAD:{actions:["highlightMatchedItem"]},FOCUS_MENU:{actions:["focusMenu"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{closeOnSelect:({prop:t,event:e})=>!!(e?.closeOnSelect??t("closeOnSelect")),isTriggerItem:({event:t})=>iye(t.target),isTriggerItemHighlighted:({event:t,scope:e,computed:r})=>!!(t.target??e.getById(r("highlightedId")))?.hasAttribute("aria-controls"),isSubmenu:({context:t})=>t.get("isSubmenu"),isPointerSuspended:({context:t})=>t.get("suspendPointer"),isHighlightedItemEditable:({scope:t,computed:e})=>CN(t.getById(e("highlightedId"))),isOpenControlled:({prop:t})=>t("open")!==void 0,isArrowLeftEvent:({event:t})=>t.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:({event:t})=>t.previousEvent?.type==="ARROW_UP",isArrowDownEvent:({event:t})=>t.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:({event:t})=>t.previousEvent?.type==="OPEN_AUTOFOCUS"},effects:{waitForOpenDelay({send:t}){const e=setTimeout(()=>{t({type:"DELAY.OPEN"})},100);return()=>clearTimeout(e)},waitForCloseDelay({send:t}){const e=setTimeout(()=>{t({type:"DELAY.CLOSE"})},300);return()=>clearTimeout(e)},waitForLongPress({send:t}){const e=setTimeout(()=>{t({type:"LONG_PRESS.OPEN"})},700);return()=>clearTimeout(e)},trackPositioning({context:t,prop:e,scope:r,refs:n}){if(OR(r))return;const i={...e("positioning"),...n.get("positioningOverride")};t.set("currentPlacement",i.placement);const o=()=>u6(r);return ra(Nw(r),o,{...i,defer:!0,onComplete(s){t.set("currentPlacement",s.placement)}})},trackInteractOutside({refs:t,scope:e,prop:r,context:n,send:i}){const o=()=>fd(e);let s=!0;return tp(o,{type:"menu",defer:!0,exclude:[Nw(e)],onInteractOutside:r("onInteractOutside"),onRequestDismiss:r("onRequestDismiss"),onFocusOutside(a){r("onFocusOutside")?.(a);const l=ti(a.detail.originalEvent);if(ys(OR(e),l)){a.preventDefault();return}},onEscapeKeyDown(a){r("onEscapeKeyDown")?.(a),n.get("isSubmenu")&&a.preventDefault(),d6({parent:t.get("parent")})},onPointerDownOutside(a){r("onPointerDownOutside")?.(a);const l=ti(a.detail.originalEvent);if(ys(OR(e),l)&&a.detail.contextmenu){a.preventDefault();return}s=!a.detail.focusable},onDismiss(){i({type:"CLOSE",src:"interact-outside",restoreFocus:s})}})},trackPointerMove({context:t,scope:e,send:r,refs:n,flush:i}){const o=n.get("parent");i(()=>{o.context.set("suspendPointer",!0)});const s=e.getDoc();return hr(s,"pointermove",a=>{cye(t.get("intentPolygon"),{x:a.clientX,y:a.clientY})||(r({type:"POINTER_MOVED_AWAY_FROM_SUBMENU"}),o.context.set("suspendPointer",!1))})},scrollToHighlightedItem({event:t,scope:e,computed:r}){const n=()=>{if(t.current().type.startsWith("ITEM_POINTER"))return;const o=e.getById(r("highlightedId")),s=fd(e);EC(o,{rootEl:s,block:"nearest"})};return wt(()=>n()),TP(()=>fd(e),{defer:!0,attributes:["aria-activedescendant"],callback:n})}},actions:{setAnchorPoint({context:t,event:e}){t.set("anchorPoint",r=>Ks(r,e.point)?r:e.point)},setSubmenuPlacement({context:t,computed:e,refs:r}){if(!t.get("isSubmenu"))return;const n=e("isRtl")?"left-start":"right-start";r.set("positioningOverride",{placement:n,gutter:0})},reposition({context:t,scope:e,prop:r,event:n,refs:i}){const o=()=>u6(e),s=t.get("anchorPoint"),a=s?()=>({width:0,height:0,...s}):void 0,l={...r("positioning"),...i.get("positioningOverride")};ra(Nw(e),o,{...l,defer:!0,getAnchorRect:a,...n.options??{},listeners:!1,onComplete(c){t.set("currentPlacement",c.placement)}})},setOptionState({event:t}){if(!t.option)return;const{checked:e,onCheckedChange:r,type:n}=t.option;n==="radio"?r?.(!0):n==="checkbox"&&r?.(!e)},clickHighlightedItem({scope:t,computed:e,prop:r,context:n}){const i=t.getById(e("highlightedId"));if(!i||i.dataset.disabled)return;const o=n.get("highlightedValue");tU(i)?r("navigate")?.({value:o,node:i,href:i.href}):queueMicrotask(()=>i.click())},setIntentPolygon({context:t,scope:e,event:r}){const n=fd(e),i=t.get("currentPlacement");if(!n||!i)return;const o=n.getBoundingClientRect(),s=yme(o,i);if(!s)return;const l=sge(i)==="right"?-5:5;t.set("intentPolygon",[{...r.point,x:r.point.x+l},...s])},clearIntentPolygon({context:t}){t.set("intentPolygon",null)},clearAnchorPoint({context:t}){t.set("anchorPoint",null)},resumePointer({refs:t,flush:e}){const r=t.get("parent");r&&e(()=>{r.context.set("suspendPointer",!1)})},setHighlightedItem({context:t,event:e}){const r=e.value||Qh(e.target);t.set("highlightedValue",r)},clearHighlightedItem({context:t}){t.set("highlightedValue",null)},focusMenu({scope:t}){wt(()=>{const e=fd(t);ob({root:e,enabled:!ys(e,t.getActiveElement()),filter(n){return!n.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem({context:t,scope:e}){(fd(e)?queueMicrotask:wt)(()=>{const n=Jve(e);n&&t.set("highlightedValue",Qh(n))})},highlightLastItem({context:t,scope:e}){(fd(e)?queueMicrotask:wt)(()=>{const n=eye(e);n&&t.set("highlightedValue",Qh(n))})},highlightNextItem({context:t,scope:e,event:r,prop:n}){const i=tye(e,{loop:r.loop,value:t.get("highlightedValue"),loopFocus:n("loopFocus")});t.set("highlightedValue",Qh(i))},highlightPrevItem({context:t,scope:e,event:r,prop:n}){const i=rye(e,{loop:r.loop,value:t.get("highlightedValue"),loopFocus:n("loopFocus")});t.set("highlightedValue",Qh(i))},invokeOnSelect({context:t,prop:e,scope:r}){const n=t.get("highlightedValue");if(n==null)return;const i=Kve(r,n);oye(i,n),e("onSelect")?.({value:n})},focusTrigger({scope:t,context:e,event:r}){e.get("isSubmenu")||e.get("anchorPoint")||r.restoreFocus===!1||queueMicrotask(()=>Nw(t)?.focus({preventScroll:!0}))},highlightMatchedItem({scope:t,context:e,event:r,refs:n}){const i=nye(t,{key:r.key,value:e.get("highlightedValue"),typeaheadState:n.get("typeaheadState")});i&&e.set("highlightedValue",Qh(i))},setParentMenu({refs:t,event:e,context:r}){t.set("parent",e.value),r.set("isSubmenu",!0)},setChildMenu({refs:t,event:e}){const r=t.get("children");r[e.id]=e.value,t.set("children",r)},closeRootMenu({refs:t}){d6({parent:t.get("parent")})},openSubmenu({refs:t,scope:e,computed:r}){const i=e.getById(r("highlightedId"))?.getAttribute("data-uid"),o=t.get("children");(i?o[i]:null)?.send({type:"OPEN_AUTOFOCUS"})},focusParentMenu({refs:t}){t.get("parent")?.send({type:"FOCUS_MENU"})},setLastHighlightedItem({context:t,event:e}){t.set("lastHighlightedValue",Qh(e.target))},restoreHighlightedItem({context:t}){t.get("lastHighlightedValue")&&(t.set("highlightedValue",t.get("lastHighlightedValue")),t.set("lastHighlightedValue",null))},restoreParentHighlightedItem({refs:t}){t.get("parent")?.send({type:"HIGHLIGHTED.RESTORE"})},invokeOnOpen({prop:t}){t("onOpenChange")?.({open:!0})},invokeOnClose({prop:t}){t("onOpenChange")?.({open:!1})},toggleVisibility({prop:t,event:e,send:r}){r({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};function d6(t){let e=t.parent;for(;e&&e.context.get("isSubmenu");)e=e.refs.get("parent");e?.send({type:"CLOSE"})}function cye(t,e){return t?bme(t,e):!1}function uye(t,e,r){const n=Object.keys(t).length>0;if(!e)return null;if(!n)return hb(r,e);for(const i in t){const o=t[i],s=VC(o.scope);if(s===e)return s}return hb(r,e)}xt()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","onSelect","open","positioning","typeahead"]);xt()(["closeOnSelect","disabled","value","valueText"]);xt()(["htmlFor"]);xt()(["id"]);xt()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]);const dye=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,dir:n,getRootNode:r,...t},o=Ps(lye,i);return{api:sye(o,oa),service:o}},[_G,TG]=Cn({name:"MenuMachineContext",hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[EG,hye]=Cn({name:"MenuMachineContext",hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),fye=t=>{const[e,r]=Cc(t),[n,i]=Nn()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","onSelect","open","positioning","typeahead"]),o=Ji(),s=TG(),{api:a,service:l}=dye(n),c=Fa(Ae({present:a.open},e));SG(()=>{s&&o&&(o.setChild(l),a.setParent(s))});const u=E.useCallback(()=>o?.getTriggerItemProps(a),[a,o]);return h.jsx(EG,{value:u,children:h.jsx(_G,{value:l,children:h.jsx(oG,{value:a,children:h.jsx(kl,{value:c,...i})})})})},pye=t=>{const e=Ji(),r=TG(),[n,{value:i,children:o}]=Cc(t),{api:s,service:a}=i,l=Fa(Ae({present:s.open},n));SG(()=>{r&&e&&(e.setChild(a),s.setParent(r))});const c=E.useCallback(()=>e?.getTriggerItemProps(s),[s,e]);return h.jsx(EG,{value:c,children:h.jsx(_G,{value:a,children:h.jsx(oG,{value:s,children:h.jsx(kl,{value:l,children:o})})})})},RG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getSeparatorProps(),t);return h.jsx(Ue.hr,{...n,ref:e})});RG.displayName="MenuSeparator";const IG=E.forwardRef((t,e)=>{const r=Ji(),n=sa(),i=Ae({...r.getTriggerProps(),"aria-controls":n.unmounted?void 0:r.getTriggerProps()["aria-controls"]},t);return h.jsx(Ue.button,{...i,ref:e})});IG.displayName="MenuTrigger";const jG=E.forwardRef((t,e)=>{const r=hye(),n=Ae(r?.()??{},t);return h.jsx(FP,{value:{value:n["data-value"]},children:h.jsx(Ue.div,{...n,ref:e})})});jG.displayName="MenuTriggerItem";let xR=new Map,l2=!1;try{l2=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let FC=!1;try{FC=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const $G={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class gye{format(e){let r="";if(!l2&&this.options.signDisplay!=null?r=vye(this.numberFormatter,this.options.signDisplay,e):r=this.numberFormatter.format(e),this.options.style==="unit"&&!FC){var n;let{unit:i,unitDisplay:o="short",locale:s}=this.resolvedOptions();if(!i)return r;let a=(n=$G[i])===null||n===void 0?void 0:n[o];r+=a[s]||a.default}return r}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,r){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,r);if(r<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} – ${this.format(r)}`}formatRangeToParts(e,r){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,r);if(r<e)throw new RangeError("End date must be >= start date");let n=this.numberFormatter.formatToParts(e),i=this.numberFormatter.formatToParts(r);return[...n.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!l2&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!FC&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,r={}){this.numberFormatter=mye(e,r),this.options=r}}function mye(t,e={}){let{numberingSystem:r}=e;if(r&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${r}`),e.style==="unit"&&!FC){var n;let{unit:s,unitDisplay:a="short"}=e;if(!s)throw new Error('unit option must be provided with style: "unit"');if(!(!((n=$G[s])===null||n===void 0)&&n[a]))throw new Error(`Unsupported unit ${s} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let i=t+(e?Object.entries(e).sort((s,a)=>s[0]<a[0]?-1:1).join():"");if(xR.has(i))return xR.get(i);let o=new Intl.NumberFormat(t,e);return xR.set(i,o),o}function vye(t,e,r){if(e==="auto")return t.format(r);if(e==="never")return t.format(Math.abs(r));{let n=!1;if(e==="always"?n=r>0||Object.is(r,0):e==="exceptZero"&&(Object.is(r,-0)||Object.is(r,0)?r=Math.abs(r):n=r>0),n){let i=t.format(-r),o=t.format(r),s=i.replace(o,"").replace(/\u200e|\u061C/,"");return[...s].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(o,"!!!").replace(s,"+").replace("!!!",o)}else return t.format(r)}}const yye=new RegExp("^.*\\(.*\\).*$"),bye=["latn","arab","hanidec","deva","beng","fullwide"];class AG{parse(e){return wR(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,r,n){return wR(this.locale,this.options,e).isValidPartialNumber(e,r,n)}getNumberingSystem(e){return wR(this.locale,this.options,e).options.numberingSystem}constructor(e,r={}){this.locale=e,this.options=r}}const h6=new Map;function wR(t,e,r){let n=f6(t,e);if(!t.includes("-nu-")&&!n.isValidPartialNumber(r)){for(let i of bye)if(i!==n.options.numberingSystem){let o=f6(t+(t.includes("-u-")?"-nu-":"-u-nu-")+i,e);if(o.isValidPartialNumber(r))return o}}return n}function f6(t,e){let r=t+(e?Object.entries(e).sort((i,o)=>i[0]<o[0]?-1:1).join():""),n=h6.get(r);return n||(n=new Oye(t,e),h6.set(r,n)),n}class Oye{parse(e){let r=this.sanitize(e);if(this.symbols.group&&(r=Up(r,this.symbols.group,"")),this.symbols.decimal&&(r=r.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(r=r.replace(this.symbols.minusSign,"-")),r=r.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let s=r.indexOf("-");r=r.replace("-",""),r=r.replace("+","");let a=r.indexOf(".");a===-1&&(a=r.length),r=r.replace(".",""),a-2===0?r=`0.${r}`:a-2===-1?r=`0.0${r}`:a-2===-2?r="0.00":r=`${r.slice(0,a-2)}.${r.slice(a-2)}`,s>-1&&(r=`-${r}`)}let n=r?+r:NaN;if(isNaN(n))return NaN;if(this.options.style==="percent"){var i,o;let s={...this.options,style:"decimal",minimumFractionDigits:Math.min(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)+2,20),maximumFractionDigits:Math.min(((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)+2,20)};return new AG(this.locale,s).parse(new gye(this.locale,s).format(n))}return this.options.currencySign==="accounting"&&yye.test(e)&&(n=-1*n),n}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=Up(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=Up(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=Up(e," ",this.symbols.group),e=Up(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,r=-1/0,n=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&r<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Up(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,r={}){this.locale=e,r.roundingIncrement!==1&&r.roundingIncrement!=null&&(r.maximumFractionDigits==null&&r.minimumFractionDigits==null?(r.maximumFractionDigits=0,r.minimumFractionDigits=0):r.maximumFractionDigits==null?r.maximumFractionDigits=r.minimumFractionDigits:r.minimumFractionDigits==null&&(r.minimumFractionDigits=r.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,r),this.options=this.formatter.resolvedOptions(),this.symbols=wye(e,this.formatter,this.options,r);var n,i;this.options.style==="percent"&&(((n=this.options.minimumFractionDigits)!==null&&n!==void 0?n:0)>18||((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const p6=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),xye=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function wye(t,e,r,n){var i,o,s,a;let l=new Intl.NumberFormat(t,{...r,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),p=xye.map(M=>l.formatToParts(M));var m;let v=(m=(i=c.find(M=>M.type==="minusSign"))===null||i===void 0?void 0:i.value)!==null&&m!==void 0?m:"-",b=(o=u.find(M=>M.type==="plusSign"))===null||o===void 0?void 0:o.value;!b&&(n?.signDisplay==="exceptZero"||n?.signDisplay==="always")&&(b="+");let x=(s=new Intl.NumberFormat(t,{...r,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(M=>M.type==="decimal"))===null||s===void 0?void 0:s.value,S=(a=c.find(M=>M.type==="group"))===null||a===void 0?void 0:a.value,w=c.filter(M=>!p6.has(M.type)).map(M=>g6(M.value)),k=p.flatMap(M=>M.filter(Q=>!p6.has(Q.type)).map(Q=>g6(Q.value))),P=[...new Set([...w,...k])].sort((M,Q)=>Q.length-M.length),_=P.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${P.join("|")}|[\\p{White_Space}]`,"gu"),T=[...new Intl.NumberFormat(r.locale,{useGrouping:!1}).format(9876543210)].reverse(),R=new Map(T.map((M,Q)=>[M,Q])),$=new RegExp(`[${T.join("")}]`,"g");return{minusSign:v,plusSign:b,decimal:x,group:S,literals:_,numeral:$,index:M=>String(R.get(M))}}function Up(t,e,r){return t.replaceAll?t.replaceAll(e,r):t.split(e).join(r)}function g6(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var NG=Ct("numberInput").parts("root","label","input","control","valueText","incrementTrigger","decrementTrigger","scrubber");NG.build();var Sye=t=>t.ids?.input??`number-input:${t.id}:input`,Cye=t=>t.ids?.incrementTrigger??`number-input:${t.id}:inc`,kye=t=>t.ids?.decrementTrigger??`number-input:${t.id}:dec`,MG=t=>`number-input:${t.id}:cursor`,Dw=t=>t.getById(Sye(t)),Pye=t=>t.getById(Cye(t)),_ye=t=>t.getById(kye(t)),DG=t=>t.getDoc().getElementById(MG(t)),Tye=(t,e)=>{let r=null;return e==="increment"&&(r=Pye(t)),e==="decrement"&&(r=_ye(t)),r},Eye=(t,e)=>{if(!Wm())return jye(t,e),()=>{DG(t)?.remove()}},Rye=t=>{const e=t.getDoc(),r=e.documentElement,n=e.body;return n.style.pointerEvents="none",r.style.userSelect="none",r.style.cursor="ew-resize",()=>{n.style.pointerEvents="",r.style.userSelect="",r.style.cursor="",r.style.length||r.removeAttribute("style"),n.style.length||n.removeAttribute("style")}},Iye=(t,e)=>{const{point:r,isRtl:n,event:i}=e,o=t.getWin(),s=cR(i.movementX,o.devicePixelRatio),a=cR(i.movementY,o.devicePixelRatio);let l=s>0?"increment":s<0?"decrement":null;n&&l==="increment"&&(l="decrement"),n&&l==="decrement"&&(l="increment");const c={x:r.x+s,y:r.y+a},u=o.innerWidth,p=cR(7.5,o.devicePixelRatio);return c.x=Wde(c.x+p,u)-p,{hint:l,point:c}},jye=(t,e)=>{const r=t.getDoc(),n=r.createElement("div");n.className="scrubber--cursor",n.id=MG(t),Object.assign(n.style,{width:"15px",height:"15px",position:"fixed",pointerEvents:"none",left:"0px",top:"0px",zIndex:K9,transform:e?`translate3d(${e.x}px, ${e.y}px, 0px)`:void 0,willChange:"transform"}),n.innerHTML=`
|
|
8
|
+
`+j.stack}return{value:d,source:f,stack:I,digest:null}}function wE(d,f,y){return{value:d,source:null,stack:y??null,digest:f??null}}function SE(d,f){try{console.error(f.value)}catch(y){setTimeout(function(){throw y})}}var Pce=typeof WeakMap=="function"?WeakMap:Map;function HV(d,f,y){y=zc(-1,y),y.tag=3,y.payload={element:null};var C=f.value;return y.callback=function(){sw||(sw=!0,LE=C),SE(d,f)},y}function GV(d,f,y){y=zc(-1,y),y.tag=3;var C=d.type.getDerivedStateFromError;if(typeof C=="function"){var I=f.value;y.payload=function(){return C(I)},y.callback=function(){SE(d,f)}}var j=d.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(y.callback=function(){SE(d,f),typeof C!="function"&&(td===null?td=new Set([this]):td.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})}),y}function XV(d,f,y){var C=d.pingCache;if(C===null){C=d.pingCache=new Pce;var I=new Set;C.set(f,I)}else I=C.get(f),I===void 0&&(I=new Set,C.set(f,I));I.has(y)||(I.add(y),d=Fce.bind(null,d,f,y),f.then(d,d))}function ZV(d){do{var f;if((f=d.tag===13)&&(f=d.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return d;d=d.return}while(d!==null);return null}function YV(d,f,y,C,I){return(d.mode&1)===0?(d===f?d.flags|=65536:(d.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(f=zc(-1,1),f.tag=2,Ju(y,f,1))),y.lanes|=1),d):(d.flags|=65536,d.lanes=I,d)}var _ce=P.ReactCurrentOwner,Ko=!1;function Mo(d,f,y,C){f.child=d===null?vV(f,null,y,C):Ap(f,d.child,y,C)}function KV(d,f,y,C,I){y=y.render;var j=f.ref;return Mp(f,I),C=pE(d,f,y,C,j,I),y=gE(),d!==null&&!Ko?(f.updateQueue=d.updateQueue,f.flags&=-2053,d.lanes&=~I,qc(d,f,I)):(Ln&&y&&YT(f),f.flags|=1,Mo(d,f,C,I),f.child)}function JV(d,f,y,C,I){if(d===null){var j=y.type;return typeof j=="function"&&!WE(j)&&j.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(f.tag=15,f.type=j,e4(d,f,j,C,I)):(d=hw(y.type,null,C,f,f.mode,I),d.ref=f.ref,d.return=f,f.child=d)}if(j=d.child,(d.lanes&I)===0){var L=j.memoizedProps;if(y=y.compare,y=y!==null?y:Gv,y(L,C)&&d.ref===f.ref)return qc(d,f,I)}return f.flags|=1,d=od(j,C),d.ref=f.ref,d.return=f,f.child=d}function e4(d,f,y,C,I){if(d!==null){var j=d.memoizedProps;if(Gv(j,C)&&d.ref===f.ref)if(Ko=!1,f.pendingProps=C=j,(d.lanes&I)!==0)(d.flags&131072)!==0&&(Ko=!0);else return f.lanes=d.lanes,qc(d,f,I)}return CE(d,f,y,C,I)}function t4(d,f,y){var C=f.pendingProps,I=C.children,j=d!==null?d.memoizedState:null;if(C.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null,transitions:null},cn(Fp,Ns),Ns|=y;else{if((y&1073741824)===0)return d=j!==null?j.baseLanes|y:y,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:d,cachePool:null,transitions:null},f.updateQueue=null,cn(Fp,Ns),Ns|=d,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=j!==null?j.baseLanes:y,cn(Fp,Ns),Ns|=C}else j!==null?(C=j.baseLanes|y,f.memoizedState=null):C=y,cn(Fp,Ns),Ns|=C;return Mo(d,f,I,y),f.child}function r4(d,f){var y=f.ref;(d===null&&y!==null||d!==null&&d.ref!==y)&&(f.flags|=512,f.flags|=2097152)}function CE(d,f,y,C,I){var j=Yo(y)?Eh:xo.current;return j=Rp(f,j),Mp(f,I),y=pE(d,f,y,C,j,I),C=gE(),d!==null&&!Ko?(f.updateQueue=d.updateQueue,f.flags&=-2053,d.lanes&=~I,qc(d,f,I)):(Ln&&C&&YT(f),f.flags|=1,Mo(d,f,y,I),f.child)}function n4(d,f,y,C,I){if(Yo(y)){var j=!0;Dx(f)}else j=!1;if(Mp(f,I),f.stateNode===null)tw(d,f),WV(f,y,C),xE(f,y,C,I),C=!0;else if(d===null){var L=f.stateNode,K=f.memoizedProps;L.props=K;var le=L.context,xe=y.contextType;typeof xe=="object"&&xe!==null?xe=fa(xe):(xe=Yo(y)?Eh:xo.current,xe=Rp(f,xe));var $e=y.getDerivedStateFromProps,Ne=typeof $e=="function"||typeof L.getSnapshotBeforeUpdate=="function";Ne||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(K!==C||le!==xe)&&UV(f,L,C,xe),Ku=!1;var je=f.memoizedState;L.state=je,Ux(f,C,L,I),le=f.memoizedState,K!==C||je!==le||Zo.current||Ku?(typeof $e=="function"&&(OE(f,y,$e,C),le=f.memoizedState),(K=Ku||qV(f,y,K,C,je,le,xe))?(Ne||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(f.flags|=4194308)):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=C,f.memoizedState=le),L.props=C,L.state=le,L.context=xe,C=K):(typeof L.componentDidMount=="function"&&(f.flags|=4194308),C=!1)}else{L=f.stateNode,bV(d,f),K=f.memoizedProps,xe=f.type===f.elementType?K:Ka(f.type,K),L.props=xe,Ne=f.pendingProps,je=L.context,le=y.contextType,typeof le=="object"&&le!==null?le=fa(le):(le=Yo(y)?Eh:xo.current,le=Rp(f,le));var nt=y.getDerivedStateFromProps;($e=typeof nt=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(K!==Ne||je!==le)&&UV(f,L,C,le),Ku=!1,je=f.memoizedState,L.state=je,Ux(f,C,L,I);var ct=f.memoizedState;K!==Ne||je!==ct||Zo.current||Ku?(typeof nt=="function"&&(OE(f,y,nt,C),ct=f.memoizedState),(xe=Ku||qV(f,y,xe,C,je,ct,le)||!1)?($e||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(C,ct,le),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(C,ct,le)),typeof L.componentDidUpdate=="function"&&(f.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof L.componentDidUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=1024),f.memoizedProps=C,f.memoizedState=ct),L.props=C,L.state=ct,L.context=le,C=xe):(typeof L.componentDidUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||K===d.memoizedProps&&je===d.memoizedState||(f.flags|=1024),C=!1)}return kE(d,f,y,C,j,I)}function kE(d,f,y,C,I,j){r4(d,f);var L=(f.flags&128)!==0;if(!C&&!L)return I&&lV(f,y,!1),qc(d,f,j);C=f.stateNode,_ce.current=f;var K=L&&typeof y.getDerivedStateFromError!="function"?null:C.render();return f.flags|=1,d!==null&&L?(f.child=Ap(f,d.child,null,j),f.child=Ap(f,null,K,j)):Mo(d,f,K,j),f.memoizedState=C.state,I&&lV(f,y,!0),f.child}function i4(d){var f=d.stateNode;f.pendingContext?sV(d,f.pendingContext,f.pendingContext!==f.context):f.context&&sV(d,f.context,!1),lE(d,f.containerInfo)}function o4(d,f,y,C,I){return $p(),tE(I),f.flags|=256,Mo(d,f,y,C),f.child}var PE={dehydrated:null,treeContext:null,retryLane:0};function _E(d){return{baseLanes:d,cachePool:null,transitions:null}}function s4(d,f,y){var C=f.pendingProps,I=Jn.current,j=!1,L=(f.flags&128)!==0,K;if((K=L)||(K=d!==null&&d.memoizedState===null?!1:(I&2)!==0),K?(j=!0,f.flags&=-129):(d===null||d.memoizedState!==null)&&(I|=1),cn(Jn,I&1),d===null)return eE(f),d=f.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?((f.mode&1)===0?f.lanes=1:d.data==="$!"?f.lanes=8:f.lanes=1073741824,null):(L=C.children,d=C.fallback,j?(C=f.mode,j=f.child,L={mode:"hidden",children:L},(C&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=L):j=fw(L,C,0,null),d=Vh(d,C,y,null),j.return=f,d.return=f,j.sibling=d,f.child=j,f.child.memoizedState=_E(y),f.memoizedState=PE,d):TE(f,L));if(I=d.memoizedState,I!==null&&(K=I.dehydrated,K!==null))return Tce(d,f,L,C,K,I,y);if(j){j=C.fallback,L=f.mode,I=d.child,K=I.sibling;var le={mode:"hidden",children:C.children};return(L&1)===0&&f.child!==I?(C=f.child,C.childLanes=0,C.pendingProps=le,f.deletions=null):(C=od(I,le),C.subtreeFlags=I.subtreeFlags&14680064),K!==null?j=od(K,j):(j=Vh(j,L,y,null),j.flags|=2),j.return=f,C.return=f,C.sibling=j,f.child=C,C=j,j=f.child,L=d.child.memoizedState,L=L===null?_E(y):{baseLanes:L.baseLanes|y,cachePool:null,transitions:L.transitions},j.memoizedState=L,j.childLanes=d.childLanes&~y,f.memoizedState=PE,C}return j=d.child,d=j.sibling,C=od(j,{mode:"visible",children:C.children}),(f.mode&1)===0&&(C.lanes=y),C.return=f,C.sibling=null,d!==null&&(y=f.deletions,y===null?(f.deletions=[d],f.flags|=16):y.push(d)),f.child=C,f.memoizedState=null,C}function TE(d,f){return f=fw({mode:"visible",children:f},d.mode,0,null),f.return=d,d.child=f}function ew(d,f,y,C){return C!==null&&tE(C),Ap(f,d.child,null,y),d=TE(f,f.pendingProps.children),d.flags|=2,f.memoizedState=null,d}function Tce(d,f,y,C,I,j,L){if(y)return f.flags&256?(f.flags&=-257,C=wE(Error(r(422))),ew(d,f,L,C)):f.memoizedState!==null?(f.child=d.child,f.flags|=128,null):(j=C.fallback,I=f.mode,C=fw({mode:"visible",children:C.children},I,0,null),j=Vh(j,I,L,null),j.flags|=2,C.return=f,j.return=f,C.sibling=j,f.child=C,(f.mode&1)!==0&&Ap(f,d.child,null,L),f.child.memoizedState=_E(L),f.memoizedState=PE,j);if((f.mode&1)===0)return ew(d,f,L,null);if(I.data==="$!"){if(C=I.nextSibling&&I.nextSibling.dataset,C)var K=C.dgst;return C=K,j=Error(r(419)),C=wE(j,C,void 0),ew(d,f,L,C)}if(K=(L&d.childLanes)!==0,Ko||K){if(C=Bi,C!==null){switch(L&-L){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=(I&(C.suspendedLanes|L))!==0?0:I,I!==0&&I!==j.retryLane&&(j.retryLane=I,Bc(d,I),tl(C,d,I,-1))}return qE(),C=wE(Error(r(421))),ew(d,f,L,C)}return I.data==="$?"?(f.flags|=128,f.child=d.child,f=Qce.bind(null,d),I._reactRetry=f,null):(d=j.treeContext,As=Gu(I.nextSibling),$s=f,Ln=!0,Ya=null,d!==null&&(da[ha++]=Fc,da[ha++]=Qc,da[ha++]=Rh,Fc=d.id,Qc=d.overflow,Rh=f),f=TE(f,C.children),f.flags|=4096,f)}function a4(d,f,y){d.lanes|=f;var C=d.alternate;C!==null&&(C.lanes|=f),oE(d.return,f,y)}function EE(d,f,y,C,I){var j=d.memoizedState;j===null?d.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:C,tail:y,tailMode:I}:(j.isBackwards=f,j.rendering=null,j.renderingStartTime=0,j.last=C,j.tail=y,j.tailMode=I)}function l4(d,f,y){var C=f.pendingProps,I=C.revealOrder,j=C.tail;if(Mo(d,f,C.children,y),C=Jn.current,(C&2)!==0)C=C&1|2,f.flags|=128;else{if(d!==null&&(d.flags&128)!==0)e:for(d=f.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&a4(d,y,f);else if(d.tag===19)a4(d,y,f);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===f)break e;for(;d.sibling===null;){if(d.return===null||d.return===f)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}C&=1}if(cn(Jn,C),(f.mode&1)===0)f.memoizedState=null;else switch(I){case"forwards":for(y=f.child,I=null;y!==null;)d=y.alternate,d!==null&&Hx(d)===null&&(I=y),y=y.sibling;y=I,y===null?(I=f.child,f.child=null):(I=y.sibling,y.sibling=null),EE(f,!1,I,y,j);break;case"backwards":for(y=null,I=f.child,f.child=null;I!==null;){if(d=I.alternate,d!==null&&Hx(d)===null){f.child=I;break}d=I.sibling,I.sibling=y,y=I,I=d}EE(f,!0,y,null,j);break;case"together":EE(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function tw(d,f){(f.mode&1)===0&&d!==null&&(d.alternate=null,f.alternate=null,f.flags|=2)}function qc(d,f,y){if(d!==null&&(f.dependencies=d.dependencies),Nh|=f.lanes,(y&f.childLanes)===0)return null;if(d!==null&&f.child!==d.child)throw Error(r(153));if(f.child!==null){for(d=f.child,y=od(d,d.pendingProps),f.child=y,y.return=f;d.sibling!==null;)d=d.sibling,y=y.sibling=od(d,d.pendingProps),y.return=f;y.sibling=null}return f.child}function Ece(d,f,y){switch(f.tag){case 3:i4(f),$p();break;case 5:wV(f);break;case 1:Yo(f.type)&&Dx(f);break;case 4:lE(f,f.stateNode.containerInfo);break;case 10:var C=f.type._context,I=f.memoizedProps.value;cn(zx,C._currentValue),C._currentValue=I;break;case 13:if(C=f.memoizedState,C!==null)return C.dehydrated!==null?(cn(Jn,Jn.current&1),f.flags|=128,null):(y&f.child.childLanes)!==0?s4(d,f,y):(cn(Jn,Jn.current&1),d=qc(d,f,y),d!==null?d.sibling:null);cn(Jn,Jn.current&1);break;case 19:if(C=(y&f.childLanes)!==0,(d.flags&128)!==0){if(C)return l4(d,f,y);f.flags|=128}if(I=f.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),cn(Jn,Jn.current),C)break;return null;case 22:case 23:return f.lanes=0,t4(d,f,y)}return qc(d,f,y)}var c4,RE,u4,d4;c4=function(d,f){for(var y=f.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===f)break;for(;y.sibling===null;){if(y.return===null||y.return===f)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},RE=function(){},u4=function(d,f,y,C){var I=d.memoizedProps;if(I!==C){d=f.stateNode,$h(Ml.current);var j=null;switch(y){case"input":I=Re(d,I),C=Re(d,C),j=[];break;case"select":I=X({},I,{value:void 0}),C=X({},C,{value:void 0}),j=[];break;case"textarea":I=Fr(d,I),C=Fr(d,C),j=[];break;default:typeof I.onClick!="function"&&typeof C.onClick=="function"&&(d.onclick=Ax)}Nc(y,C);var L;y=null;for(xe in I)if(!C.hasOwnProperty(xe)&&I.hasOwnProperty(xe)&&I[xe]!=null)if(xe==="style"){var K=I[xe];for(L in K)K.hasOwnProperty(L)&&(y||(y={}),y[L]="")}else xe!=="dangerouslySetInnerHTML"&&xe!=="children"&&xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&xe!=="autoFocus"&&(i.hasOwnProperty(xe)?j||(j=[]):(j=j||[]).push(xe,null));for(xe in C){var le=C[xe];if(K=I?.[xe],C.hasOwnProperty(xe)&&le!==K&&(le!=null||K!=null))if(xe==="style")if(K){for(L in K)!K.hasOwnProperty(L)||le&&le.hasOwnProperty(L)||(y||(y={}),y[L]="");for(L in le)le.hasOwnProperty(L)&&K[L]!==le[L]&&(y||(y={}),y[L]=le[L])}else y||(j||(j=[]),j.push(xe,y)),y=le;else xe==="dangerouslySetInnerHTML"?(le=le?le.__html:void 0,K=K?K.__html:void 0,le!=null&&K!==le&&(j=j||[]).push(xe,le)):xe==="children"?typeof le!="string"&&typeof le!="number"||(j=j||[]).push(xe,""+le):xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&(i.hasOwnProperty(xe)?(le!=null&&xe==="onScroll"&&Pn("scroll",d),j||K===le||(j=[])):(j=j||[]).push(xe,le))}y&&(j=j||[]).push("style",y);var xe=j;(f.updateQueue=xe)&&(f.flags|=4)}},d4=function(d,f,y,C){y!==C&&(f.flags|=4)};function cy(d,f){if(!Ln)switch(d.tailMode){case"hidden":f=d.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?d.tail=null:y.sibling=null;break;case"collapsed":y=d.tail;for(var C=null;y!==null;)y.alternate!==null&&(C=y),y=y.sibling;C===null?f||d.tail===null?d.tail=null:d.tail.sibling=null:C.sibling=null}}function So(d){var f=d.alternate!==null&&d.alternate.child===d.child,y=0,C=0;if(f)for(var I=d.child;I!==null;)y|=I.lanes|I.childLanes,C|=I.subtreeFlags&14680064,C|=I.flags&14680064,I.return=d,I=I.sibling;else for(I=d.child;I!==null;)y|=I.lanes|I.childLanes,C|=I.subtreeFlags,C|=I.flags,I.return=d,I=I.sibling;return d.subtreeFlags|=C,d.childLanes=y,f}function Rce(d,f,y){var C=f.pendingProps;switch(KT(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return So(f),null;case 1:return Yo(f.type)&&Mx(),So(f),null;case 3:return C=f.stateNode,Dp(),_n(Zo),_n(xo),dE(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(d===null||d.child===null)&&(Qx(f)?f.flags|=4:d===null||d.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Ya!==null&&(QE(Ya),Ya=null))),RE(d,f),So(f),null;case 5:cE(f);var I=$h(iy.current);if(y=f.type,d!==null&&f.stateNode!=null)u4(d,f,y,C,I),d.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!C){if(f.stateNode===null)throw Error(r(166));return So(f),null}if(d=$h(Ml.current),Qx(f)){C=f.stateNode,y=f.type;var j=f.memoizedProps;switch(C[Nl]=f,C[Jv]=j,d=(f.mode&1)!==0,y){case"dialog":Pn("cancel",C),Pn("close",C);break;case"iframe":case"object":case"embed":Pn("load",C);break;case"video":case"audio":for(I=0;I<Zv.length;I++)Pn(Zv[I],C);break;case"source":Pn("error",C);break;case"img":case"image":case"link":Pn("error",C),Pn("load",C);break;case"details":Pn("toggle",C);break;case"input":Ve(C,j),Pn("invalid",C);break;case"select":C._wrapperState={wasMultiple:!!j.multiple},Pn("invalid",C);break;case"textarea":Xt(C,j),Pn("invalid",C)}Nc(y,j),I=null;for(var L in j)if(j.hasOwnProperty(L)){var K=j[L];L==="children"?typeof K=="string"?C.textContent!==K&&(j.suppressHydrationWarning!==!0&&$x(C.textContent,K,d),I=["children",K]):typeof K=="number"&&C.textContent!==""+K&&(j.suppressHydrationWarning!==!0&&$x(C.textContent,K,d),I=["children",""+K]):i.hasOwnProperty(L)&&K!=null&&L==="onScroll"&&Pn("scroll",C)}switch(y){case"input":te(C),$r(C,j,!0);break;case"textarea":te(C),pi(C);break;case"select":case"option":break;default:typeof j.onClick=="function"&&(C.onclick=Ax)}C=I,f.updateQueue=C,C!==null&&(f.flags|=4)}else{L=I.nodeType===9?I:I.ownerDocument,d==="http://www.w3.org/1999/xhtml"&&(d=ni(y)),d==="http://www.w3.org/1999/xhtml"?y==="script"?(d=L.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild)):typeof C.is=="string"?d=L.createElement(y,{is:C.is}):(d=L.createElement(y),y==="select"&&(L=d,C.multiple?L.multiple=!0:C.size&&(L.size=C.size))):d=L.createElementNS(d,y),d[Nl]=f,d[Jv]=C,c4(d,f,!1,!1),f.stateNode=d;e:{switch(L=Ei(y,C),y){case"dialog":Pn("cancel",d),Pn("close",d),I=C;break;case"iframe":case"object":case"embed":Pn("load",d),I=C;break;case"video":case"audio":for(I=0;I<Zv.length;I++)Pn(Zv[I],d);I=C;break;case"source":Pn("error",d),I=C;break;case"img":case"image":case"link":Pn("error",d),Pn("load",d),I=C;break;case"details":Pn("toggle",d),I=C;break;case"input":Ve(d,C),I=Re(d,C),Pn("invalid",d);break;case"option":I=C;break;case"select":d._wrapperState={wasMultiple:!!C.multiple},I=X({},C,{value:void 0}),Pn("invalid",d);break;case"textarea":Xt(d,C),I=Fr(d,C),Pn("invalid",d);break;default:I=C}Nc(y,I),K=I;for(j in K)if(K.hasOwnProperty(j)){var le=K[j];j==="style"?Vu(d,le):j==="dangerouslySetInnerHTML"?(le=le?le.__html:void 0,le!=null&&Kn(d,le)):j==="children"?typeof le=="string"?(y!=="textarea"||le!=="")&&no(d,le):typeof le=="number"&&no(d,""+le):j!=="suppressContentEditableWarning"&&j!=="suppressHydrationWarning"&&j!=="autoFocus"&&(i.hasOwnProperty(j)?le!=null&&j==="onScroll"&&Pn("scroll",d):le!=null&&k(d,j,le,L))}switch(y){case"input":te(d),$r(d,C,!1);break;case"textarea":te(d),pi(d);break;case"option":C.value!=null&&d.setAttribute("value",""+G(C.value));break;case"select":d.multiple=!!C.multiple,j=C.value,j!=null?ur(d,!!C.multiple,j,!1):C.defaultValue!=null&&ur(d,!!C.multiple,C.defaultValue,!0);break;default:typeof I.onClick=="function"&&(d.onclick=Ax)}switch(y){case"button":case"input":case"select":case"textarea":C=!!C.autoFocus;break e;case"img":C=!0;break e;default:C=!1}}C&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return So(f),null;case 6:if(d&&f.stateNode!=null)d4(d,f,d.memoizedProps,C);else{if(typeof C!="string"&&f.stateNode===null)throw Error(r(166));if(y=$h(iy.current),$h(Ml.current),Qx(f)){if(C=f.stateNode,y=f.memoizedProps,C[Nl]=f,(j=C.nodeValue!==y)&&(d=$s,d!==null))switch(d.tag){case 3:$x(C.nodeValue,y,(d.mode&1)!==0);break;case 5:d.memoizedProps.suppressHydrationWarning!==!0&&$x(C.nodeValue,y,(d.mode&1)!==0)}j&&(f.flags|=4)}else C=(y.nodeType===9?y:y.ownerDocument).createTextNode(C),C[Nl]=f,f.stateNode=C}return So(f),null;case 13:if(_n(Jn),C=f.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(Ln&&As!==null&&(f.mode&1)!==0&&(f.flags&128)===0)pV(),$p(),f.flags|=98560,j=!1;else if(j=Qx(f),C!==null&&C.dehydrated!==null){if(d===null){if(!j)throw Error(r(318));if(j=f.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(r(317));j[Nl]=f}else $p(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;So(f),j=!1}else Ya!==null&&(QE(Ya),Ya=null),j=!0;if(!j)return f.flags&65536?f:null}return(f.flags&128)!==0?(f.lanes=y,f):(C=C!==null,C!==(d!==null&&d.memoizedState!==null)&&C&&(f.child.flags|=8192,(f.mode&1)!==0&&(d===null||(Jn.current&1)!==0?Ii===0&&(Ii=3):qE())),f.updateQueue!==null&&(f.flags|=4),So(f),null);case 4:return Dp(),RE(d,f),d===null&&Yv(f.stateNode.containerInfo),So(f),null;case 10:return iE(f.type._context),So(f),null;case 17:return Yo(f.type)&&Mx(),So(f),null;case 19:if(_n(Jn),j=f.memoizedState,j===null)return So(f),null;if(C=(f.flags&128)!==0,L=j.rendering,L===null)if(C)cy(j,!1);else{if(Ii!==0||d!==null&&(d.flags&128)!==0)for(d=f.child;d!==null;){if(L=Hx(d),L!==null){for(f.flags|=128,cy(j,!1),C=L.updateQueue,C!==null&&(f.updateQueue=C,f.flags|=4),f.subtreeFlags=0,C=y,y=f.child;y!==null;)j=y,d=C,j.flags&=14680066,L=j.alternate,L===null?(j.childLanes=0,j.lanes=d,j.child=null,j.subtreeFlags=0,j.memoizedProps=null,j.memoizedState=null,j.updateQueue=null,j.dependencies=null,j.stateNode=null):(j.childLanes=L.childLanes,j.lanes=L.lanes,j.child=L.child,j.subtreeFlags=0,j.deletions=null,j.memoizedProps=L.memoizedProps,j.memoizedState=L.memoizedState,j.updateQueue=L.updateQueue,j.type=L.type,d=L.dependencies,j.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),y=y.sibling;return cn(Jn,Jn.current&1|2),f.child}d=d.sibling}j.tail!==null&&Wt()>Qp&&(f.flags|=128,C=!0,cy(j,!1),f.lanes=4194304)}else{if(!C)if(d=Hx(L),d!==null){if(f.flags|=128,C=!0,y=d.updateQueue,y!==null&&(f.updateQueue=y,f.flags|=4),cy(j,!0),j.tail===null&&j.tailMode==="hidden"&&!L.alternate&&!Ln)return So(f),null}else 2*Wt()-j.renderingStartTime>Qp&&y!==1073741824&&(f.flags|=128,C=!0,cy(j,!1),f.lanes=4194304);j.isBackwards?(L.sibling=f.child,f.child=L):(y=j.last,y!==null?y.sibling=L:f.child=L,j.last=L)}return j.tail!==null?(f=j.tail,j.rendering=f,j.tail=f.sibling,j.renderingStartTime=Wt(),f.sibling=null,y=Jn.current,cn(Jn,C?y&1|2:y&1),f):(So(f),null);case 22:case 23:return zE(),C=f.memoizedState!==null,d!==null&&d.memoizedState!==null!==C&&(f.flags|=8192),C&&(f.mode&1)!==0?(Ns&1073741824)!==0&&(So(f),f.subtreeFlags&6&&(f.flags|=8192)):So(f),null;case 24:return null;case 25:return null}throw Error(r(156,f.tag))}function Ice(d,f){switch(KT(f),f.tag){case 1:return Yo(f.type)&&Mx(),d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 3:return Dp(),_n(Zo),_n(xo),dE(),d=f.flags,(d&65536)!==0&&(d&128)===0?(f.flags=d&-65537|128,f):null;case 5:return cE(f),null;case 13:if(_n(Jn),d=f.memoizedState,d!==null&&d.dehydrated!==null){if(f.alternate===null)throw Error(r(340));$p()}return d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 19:return _n(Jn),null;case 4:return Dp(),null;case 10:return iE(f.type._context),null;case 22:case 23:return zE(),null;case 24:return null;default:return null}}var rw=!1,Co=!1,jce=typeof WeakSet=="function"?WeakSet:Set,at=null;function Vp(d,f){var y=d.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(C){ii(d,f,C)}else y.current=null}function IE(d,f,y){try{y()}catch(C){ii(d,f,C)}}var h4=!1;function $ce(d,f){if(zT=wx,d=q5(),NT(d)){if("selectionStart"in d)var y={start:d.selectionStart,end:d.selectionEnd};else e:{y=(y=d.ownerDocument)&&y.defaultView||window;var C=y.getSelection&&y.getSelection();if(C&&C.rangeCount!==0){y=C.anchorNode;var I=C.anchorOffset,j=C.focusNode;C=C.focusOffset;try{y.nodeType,j.nodeType}catch{y=null;break e}var L=0,K=-1,le=-1,xe=0,$e=0,Ne=d,je=null;t:for(;;){for(var nt;Ne!==y||I!==0&&Ne.nodeType!==3||(K=L+I),Ne!==j||C!==0&&Ne.nodeType!==3||(le=L+C),Ne.nodeType===3&&(L+=Ne.nodeValue.length),(nt=Ne.firstChild)!==null;)je=Ne,Ne=nt;for(;;){if(Ne===d)break t;if(je===y&&++xe===I&&(K=L),je===j&&++$e===C&&(le=L),(nt=Ne.nextSibling)!==null)break;Ne=je,je=Ne.parentNode}Ne=nt}y=K===-1||le===-1?null:{start:K,end:le}}else y=null}y=y||{start:0,end:0}}else y=null;for(qT={focusedElem:d,selectionRange:y},wx=!1,at=f;at!==null;)if(f=at,d=f.child,(f.subtreeFlags&1028)!==0&&d!==null)d.return=f,at=d;else for(;at!==null;){f=at;try{var ct=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(ct!==null){var ht=ct.memoizedProps,ai=ct.memoizedState,me=f.stateNode,ce=me.getSnapshotBeforeUpdate(f.elementType===f.type?ht:Ka(f.type,ht),ai);me.__reactInternalSnapshotBeforeUpdate=ce}break;case 3:var ve=f.stateNode.containerInfo;ve.nodeType===1?ve.textContent="":ve.nodeType===9&&ve.documentElement&&ve.removeChild(ve.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Fe){ii(f,f.return,Fe)}if(d=f.sibling,d!==null){d.return=f.return,at=d;break}at=f.return}return ct=h4,h4=!1,ct}function uy(d,f,y){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var I=C=C.next;do{if((I.tag&d)===d){var j=I.destroy;I.destroy=void 0,j!==void 0&&IE(f,y,j)}I=I.next}while(I!==C)}}function nw(d,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&d)===d){var C=y.create;y.destroy=C()}y=y.next}while(y!==f)}}function jE(d){var f=d.ref;if(f!==null){var y=d.stateNode;switch(d.tag){case 5:d=y;break;default:d=y}typeof f=="function"?f(d):f.current=d}}function f4(d){var f=d.alternate;f!==null&&(d.alternate=null,f4(f)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(f=d.stateNode,f!==null&&(delete f[Nl],delete f[Jv],delete f[GT],delete f[gce],delete f[mce])),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function p4(d){return d.tag===5||d.tag===3||d.tag===4}function g4(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||p4(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function $E(d,f,y){var C=d.tag;if(C===5||C===6)d=d.stateNode,f?y.nodeType===8?y.parentNode.insertBefore(d,f):y.insertBefore(d,f):(y.nodeType===8?(f=y.parentNode,f.insertBefore(d,y)):(f=y,f.appendChild(d)),y=y._reactRootContainer,y!=null||f.onclick!==null||(f.onclick=Ax));else if(C!==4&&(d=d.child,d!==null))for($E(d,f,y),d=d.sibling;d!==null;)$E(d,f,y),d=d.sibling}function AE(d,f,y){var C=d.tag;if(C===5||C===6)d=d.stateNode,f?y.insertBefore(d,f):y.appendChild(d);else if(C!==4&&(d=d.child,d!==null))for(AE(d,f,y),d=d.sibling;d!==null;)AE(d,f,y),d=d.sibling}var io=null,Ja=!1;function ed(d,f,y){for(y=y.child;y!==null;)m4(d,f,y),y=y.sibling}function m4(d,f,y){if(vi&&typeof vi.onCommitFiberUnmount=="function")try{vi.onCommitFiberUnmount(ua,y)}catch{}switch(y.tag){case 5:Co||Vp(y,f);case 6:var C=io,I=Ja;io=null,ed(d,f,y),io=C,Ja=I,io!==null&&(Ja?(d=io,y=y.stateNode,d.nodeType===8?d.parentNode.removeChild(y):d.removeChild(y)):io.removeChild(y.stateNode));break;case 18:io!==null&&(Ja?(d=io,y=y.stateNode,d.nodeType===8?HT(d.parentNode,y):d.nodeType===1&&HT(d,y),Bv(d)):HT(io,y.stateNode));break;case 4:C=io,I=Ja,io=y.stateNode.containerInfo,Ja=!0,ed(d,f,y),io=C,Ja=I;break;case 0:case 11:case 14:case 15:if(!Co&&(C=y.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){I=C=C.next;do{var j=I,L=j.destroy;j=j.tag,L!==void 0&&((j&2)!==0||(j&4)!==0)&&IE(y,f,L),I=I.next}while(I!==C)}ed(d,f,y);break;case 1:if(!Co&&(Vp(y,f),C=y.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=y.memoizedProps,C.state=y.memoizedState,C.componentWillUnmount()}catch(K){ii(y,f,K)}ed(d,f,y);break;case 21:ed(d,f,y);break;case 22:y.mode&1?(Co=(C=Co)||y.memoizedState!==null,ed(d,f,y),Co=C):ed(d,f,y);break;default:ed(d,f,y)}}function v4(d){var f=d.updateQueue;if(f!==null){d.updateQueue=null;var y=d.stateNode;y===null&&(y=d.stateNode=new jce),f.forEach(function(C){var I=Bce.bind(null,d,C);y.has(C)||(y.add(C),C.then(I,I))})}}function el(d,f){var y=f.deletions;if(y!==null)for(var C=0;C<y.length;C++){var I=y[C];try{var j=d,L=f,K=L;e:for(;K!==null;){switch(K.tag){case 5:io=K.stateNode,Ja=!1;break e;case 3:io=K.stateNode.containerInfo,Ja=!0;break e;case 4:io=K.stateNode.containerInfo,Ja=!0;break e}K=K.return}if(io===null)throw Error(r(160));m4(j,L,I),io=null,Ja=!1;var le=I.alternate;le!==null&&(le.return=null),I.return=null}catch(xe){ii(I,f,xe)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)y4(f,d),f=f.sibling}function y4(d,f){var y=d.alternate,C=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:if(el(f,d),Ll(d),C&4){try{uy(3,d,d.return),nw(3,d)}catch(ht){ii(d,d.return,ht)}try{uy(5,d,d.return)}catch(ht){ii(d,d.return,ht)}}break;case 1:el(f,d),Ll(d),C&512&&y!==null&&Vp(y,y.return);break;case 5:if(el(f,d),Ll(d),C&512&&y!==null&&Vp(y,y.return),d.flags&32){var I=d.stateNode;try{no(I,"")}catch(ht){ii(d,d.return,ht)}}if(C&4&&(I=d.stateNode,I!=null)){var j=d.memoizedProps,L=y!==null?y.memoizedProps:j,K=d.type,le=d.updateQueue;if(d.updateQueue=null,le!==null)try{K==="input"&&j.type==="radio"&&j.name!=null&&We(I,j),Ei(K,L);var xe=Ei(K,j);for(L=0;L<le.length;L+=2){var $e=le[L],Ne=le[L+1];$e==="style"?Vu(I,Ne):$e==="dangerouslySetInnerHTML"?Kn(I,Ne):$e==="children"?no(I,Ne):k(I,$e,Ne,xe)}switch(K){case"input":Gt(I,j);break;case"textarea":Ti(I,j);break;case"select":var je=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!j.multiple;var nt=j.value;nt!=null?ur(I,!!j.multiple,nt,!1):je!==!!j.multiple&&(j.defaultValue!=null?ur(I,!!j.multiple,j.defaultValue,!0):ur(I,!!j.multiple,j.multiple?[]:"",!1))}I[Jv]=j}catch(ht){ii(d,d.return,ht)}}break;case 6:if(el(f,d),Ll(d),C&4){if(d.stateNode===null)throw Error(r(162));I=d.stateNode,j=d.memoizedProps;try{I.nodeValue=j}catch(ht){ii(d,d.return,ht)}}break;case 3:if(el(f,d),Ll(d),C&4&&y!==null&&y.memoizedState.isDehydrated)try{Bv(f.containerInfo)}catch(ht){ii(d,d.return,ht)}break;case 4:el(f,d),Ll(d);break;case 13:el(f,d),Ll(d),I=d.child,I.flags&8192&&(j=I.memoizedState!==null,I.stateNode.isHidden=j,!j||I.alternate!==null&&I.alternate.memoizedState!==null||(DE=Wt())),C&4&&v4(d);break;case 22:if($e=y!==null&&y.memoizedState!==null,d.mode&1?(Co=(xe=Co)||$e,el(f,d),Co=xe):el(f,d),Ll(d),C&8192){if(xe=d.memoizedState!==null,(d.stateNode.isHidden=xe)&&!$e&&(d.mode&1)!==0)for(at=d,$e=d.child;$e!==null;){for(Ne=at=$e;at!==null;){switch(je=at,nt=je.child,je.tag){case 0:case 11:case 14:case 15:uy(4,je,je.return);break;case 1:Vp(je,je.return);var ct=je.stateNode;if(typeof ct.componentWillUnmount=="function"){C=je,y=je.return;try{f=C,ct.props=f.memoizedProps,ct.state=f.memoizedState,ct.componentWillUnmount()}catch(ht){ii(C,y,ht)}}break;case 5:Vp(je,je.return);break;case 22:if(je.memoizedState!==null){x4(Ne);continue}}nt!==null?(nt.return=je,at=nt):x4(Ne)}$e=$e.sibling}e:for($e=null,Ne=d;;){if(Ne.tag===5){if($e===null){$e=Ne;try{I=Ne.stateNode,xe?(j=I.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none"):(K=Ne.stateNode,le=Ne.memoizedProps.style,L=le!=null&&le.hasOwnProperty("display")?le.display:null,K.style.display=Ha("display",L))}catch(ht){ii(d,d.return,ht)}}}else if(Ne.tag===6){if($e===null)try{Ne.stateNode.nodeValue=xe?"":Ne.memoizedProps}catch(ht){ii(d,d.return,ht)}}else if((Ne.tag!==22&&Ne.tag!==23||Ne.memoizedState===null||Ne===d)&&Ne.child!==null){Ne.child.return=Ne,Ne=Ne.child;continue}if(Ne===d)break e;for(;Ne.sibling===null;){if(Ne.return===null||Ne.return===d)break e;$e===Ne&&($e=null),Ne=Ne.return}$e===Ne&&($e=null),Ne.sibling.return=Ne.return,Ne=Ne.sibling}}break;case 19:el(f,d),Ll(d),C&4&&v4(d);break;case 21:break;default:el(f,d),Ll(d)}}function Ll(d){var f=d.flags;if(f&2){try{e:{for(var y=d.return;y!==null;){if(p4(y)){var C=y;break e}y=y.return}throw Error(r(160))}switch(C.tag){case 5:var I=C.stateNode;C.flags&32&&(no(I,""),C.flags&=-33);var j=g4(d);AE(d,j,I);break;case 3:case 4:var L=C.stateNode.containerInfo,K=g4(d);$E(d,K,L);break;default:throw Error(r(161))}}catch(le){ii(d,d.return,le)}d.flags&=-3}f&4096&&(d.flags&=-4097)}function Ace(d,f,y){at=d,b4(d)}function b4(d,f,y){for(var C=(d.mode&1)!==0;at!==null;){var I=at,j=I.child;if(I.tag===22&&C){var L=I.memoizedState!==null||rw;if(!L){var K=I.alternate,le=K!==null&&K.memoizedState!==null||Co;K=rw;var xe=Co;if(rw=L,(Co=le)&&!xe)for(at=I;at!==null;)L=at,le=L.child,L.tag===22&&L.memoizedState!==null?w4(I):le!==null?(le.return=L,at=le):w4(I);for(;j!==null;)at=j,b4(j),j=j.sibling;at=I,rw=K,Co=xe}O4(d)}else(I.subtreeFlags&8772)!==0&&j!==null?(j.return=I,at=j):O4(d)}}function O4(d){for(;at!==null;){var f=at;if((f.flags&8772)!==0){var y=f.alternate;try{if((f.flags&8772)!==0)switch(f.tag){case 0:case 11:case 15:Co||nw(5,f);break;case 1:var C=f.stateNode;if(f.flags&4&&!Co)if(y===null)C.componentDidMount();else{var I=f.elementType===f.type?y.memoizedProps:Ka(f.type,y.memoizedProps);C.componentDidUpdate(I,y.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var j=f.updateQueue;j!==null&&xV(f,j,C);break;case 3:var L=f.updateQueue;if(L!==null){if(y=null,f.child!==null)switch(f.child.tag){case 5:y=f.child.stateNode;break;case 1:y=f.child.stateNode}xV(f,L,y)}break;case 5:var K=f.stateNode;if(y===null&&f.flags&4){y=K;var le=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":le.autoFocus&&y.focus();break;case"img":le.src&&(y.src=le.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var xe=f.alternate;if(xe!==null){var $e=xe.memoizedState;if($e!==null){var Ne=$e.dehydrated;Ne!==null&&Bv(Ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Co||f.flags&512&&jE(f)}catch(je){ii(f,f.return,je)}}if(f===d){at=null;break}if(y=f.sibling,y!==null){y.return=f.return,at=y;break}at=f.return}}function x4(d){for(;at!==null;){var f=at;if(f===d){at=null;break}var y=f.sibling;if(y!==null){y.return=f.return,at=y;break}at=f.return}}function w4(d){for(;at!==null;){var f=at;try{switch(f.tag){case 0:case 11:case 15:var y=f.return;try{nw(4,f)}catch(le){ii(f,y,le)}break;case 1:var C=f.stateNode;if(typeof C.componentDidMount=="function"){var I=f.return;try{C.componentDidMount()}catch(le){ii(f,I,le)}}var j=f.return;try{jE(f)}catch(le){ii(f,j,le)}break;case 5:var L=f.return;try{jE(f)}catch(le){ii(f,L,le)}}}catch(le){ii(f,f.return,le)}if(f===d){at=null;break}var K=f.sibling;if(K!==null){K.return=f.return,at=K;break}at=f.return}}var Nce=Math.ceil,iw=P.ReactCurrentDispatcher,NE=P.ReactCurrentOwner,ga=P.ReactCurrentBatchConfig,br=0,Bi=null,yi=null,oo=0,Ns=0,Fp=Xu(0),Ii=0,dy=null,Nh=0,ow=0,ME=0,hy=null,Jo=null,DE=0,Qp=1/0,Wc=null,sw=!1,LE=null,td=null,aw=!1,rd=null,lw=0,fy=0,VE=null,cw=-1,uw=0;function Do(){return(br&6)!==0?Wt():cw!==-1?cw:cw=Wt()}function nd(d){return(d.mode&1)===0?1:(br&2)!==0&&oo!==0?oo&-oo:yce.transition!==null?(uw===0&&(uw=g5()),uw):(d=Br,d!==0||(d=window.event,d=d===void 0?16:C5(d.type)),d)}function tl(d,f,y,C){if(50<fy)throw fy=0,VE=null,Error(r(185));Dv(d,y,C),((br&2)===0||d!==Bi)&&(d===Bi&&((br&2)===0&&(ow|=y),Ii===4&&id(d,oo)),es(d,C),y===1&&br===0&&(f.mode&1)===0&&(Qp=Wt()+500,Lx&&Yu()))}function es(d,f){var y=d.callbackNode;yle(d,f);var C=Al(d,d===Bi?oo:0);if(C===0)y!==null&&Cr(y),d.callbackNode=null,d.callbackPriority=0;else if(f=C&-C,d.callbackPriority!==f){if(y!=null&&Cr(y),f===1)d.tag===0?vce(C4.bind(null,d)):cV(C4.bind(null,d)),fce(function(){(br&6)===0&&Yu()}),y=null;else{switch(m5(C)){case 1:y=mi;break;case 4:y=ca;break;case 16:y=Ho;break;case 536870912:y=Is;break;default:y=Ho}y=j4(y,S4.bind(null,d))}d.callbackPriority=f,d.callbackNode=y}}function S4(d,f){if(cw=-1,uw=0,(br&6)!==0)throw Error(r(327));var y=d.callbackNode;if(Bp()&&d.callbackNode!==y)return null;var C=Al(d,d===Bi?oo:0);if(C===0)return null;if((C&30)!==0||(C&d.expiredLanes)!==0||f)f=dw(d,C);else{f=C;var I=br;br|=2;var j=P4();(Bi!==d||oo!==f)&&(Wc=null,Qp=Wt()+500,Dh(d,f));do try{Lce();break}catch(K){k4(d,K)}while(!0);nE(),iw.current=j,br=I,yi!==null?f=0:(Bi=null,oo=0,f=Ii)}if(f!==0){if(f===2&&(I=bT(d),I!==0&&(C=I,f=FE(d,I))),f===1)throw y=dy,Dh(d,0),id(d,C),es(d,Wt()),y;if(f===6)id(d,C);else{if(I=d.current.alternate,(C&30)===0&&!Mce(I)&&(f=dw(d,C),f===2&&(j=bT(d),j!==0&&(C=j,f=FE(d,j))),f===1))throw y=dy,Dh(d,0),id(d,C),es(d,Wt()),y;switch(d.finishedWork=I,d.finishedLanes=C,f){case 0:case 1:throw Error(r(345));case 2:Lh(d,Jo,Wc);break;case 3:if(id(d,C),(C&130023424)===C&&(f=DE+500-Wt(),10<f)){if(Al(d,0)!==0)break;if(I=d.suspendedLanes,(I&C)!==C){Do(),d.pingedLanes|=d.suspendedLanes&I;break}d.timeoutHandle=UT(Lh.bind(null,d,Jo,Wc),f);break}Lh(d,Jo,Wc);break;case 4:if(id(d,C),(C&4194240)===C)break;for(f=d.eventTimes,I=-1;0<C;){var L=31-Xo(C);j=1<<L,L=f[L],L>I&&(I=L),C&=~j}if(C=I,C=Wt()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*Nce(C/1960))-C,10<C){d.timeoutHandle=UT(Lh.bind(null,d,Jo,Wc),C);break}Lh(d,Jo,Wc);break;case 5:Lh(d,Jo,Wc);break;default:throw Error(r(329))}}}return es(d,Wt()),d.callbackNode===y?S4.bind(null,d):null}function FE(d,f){var y=hy;return d.current.memoizedState.isDehydrated&&(Dh(d,f).flags|=256),d=dw(d,f),d!==2&&(f=Jo,Jo=y,f!==null&&QE(f)),d}function QE(d){Jo===null?Jo=d:Jo.push.apply(Jo,d)}function Mce(d){for(var f=d;;){if(f.flags&16384){var y=f.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var C=0;C<y.length;C++){var I=y[C],j=I.getSnapshot;I=I.value;try{if(!Za(j(),I))return!1}catch{return!1}}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===d)break;for(;f.sibling===null;){if(f.return===null||f.return===d)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function id(d,f){for(f&=~ME,f&=~ow,d.suspendedLanes|=f,d.pingedLanes&=~f,d=d.expirationTimes;0<f;){var y=31-Xo(f),C=1<<y;d[y]=-1,f&=~C}}function C4(d){if((br&6)!==0)throw Error(r(327));Bp();var f=Al(d,0);if((f&1)===0)return es(d,Wt()),null;var y=dw(d,f);if(d.tag!==0&&y===2){var C=bT(d);C!==0&&(f=C,y=FE(d,C))}if(y===1)throw y=dy,Dh(d,0),id(d,f),es(d,Wt()),y;if(y===6)throw Error(r(345));return d.finishedWork=d.current.alternate,d.finishedLanes=f,Lh(d,Jo,Wc),es(d,Wt()),null}function BE(d,f){var y=br;br|=1;try{return d(f)}finally{br=y,br===0&&(Qp=Wt()+500,Lx&&Yu())}}function Mh(d){rd!==null&&rd.tag===0&&(br&6)===0&&Bp();var f=br;br|=1;var y=ga.transition,C=Br;try{if(ga.transition=null,Br=1,d)return d()}finally{Br=C,ga.transition=y,br=f,(br&6)===0&&Yu()}}function zE(){Ns=Fp.current,_n(Fp)}function Dh(d,f){d.finishedWork=null,d.finishedLanes=0;var y=d.timeoutHandle;if(y!==-1&&(d.timeoutHandle=-1,hce(y)),yi!==null)for(y=yi.return;y!==null;){var C=y;switch(KT(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&Mx();break;case 3:Dp(),_n(Zo),_n(xo),dE();break;case 5:cE(C);break;case 4:Dp();break;case 13:_n(Jn);break;case 19:_n(Jn);break;case 10:iE(C.type._context);break;case 22:case 23:zE()}y=y.return}if(Bi=d,yi=d=od(d.current,null),oo=Ns=f,Ii=0,dy=null,ME=ow=Nh=0,Jo=hy=null,jh!==null){for(f=0;f<jh.length;f++)if(y=jh[f],C=y.interleaved,C!==null){y.interleaved=null;var I=C.next,j=y.pending;if(j!==null){var L=j.next;j.next=I,C.next=L}y.pending=C}jh=null}return d}function k4(d,f){do{var y=yi;try{if(nE(),Gx.current=Kx,Xx){for(var C=ei.memoizedState;C!==null;){var I=C.queue;I!==null&&(I.pending=null),C=C.next}Xx=!1}if(Ah=0,Qi=Ri=ei=null,oy=!1,sy=0,NE.current=null,y===null||y.return===null){Ii=1,dy=f,yi=null;break}e:{var j=d,L=y.return,K=y,le=f;if(f=oo,K.flags|=32768,le!==null&&typeof le=="object"&&typeof le.then=="function"){var xe=le,$e=K,Ne=$e.tag;if(($e.mode&1)===0&&(Ne===0||Ne===11||Ne===15)){var je=$e.alternate;je?($e.updateQueue=je.updateQueue,$e.memoizedState=je.memoizedState,$e.lanes=je.lanes):($e.updateQueue=null,$e.memoizedState=null)}var nt=ZV(L);if(nt!==null){nt.flags&=-257,YV(nt,L,K,j,f),nt.mode&1&&XV(j,xe,f),f=nt,le=xe;var ct=f.updateQueue;if(ct===null){var ht=new Set;ht.add(le),f.updateQueue=ht}else ct.add(le);break e}else{if((f&1)===0){XV(j,xe,f),qE();break e}le=Error(r(426))}}else if(Ln&&K.mode&1){var ai=ZV(L);if(ai!==null){(ai.flags&65536)===0&&(ai.flags|=256),YV(ai,L,K,j,f),tE(Lp(le,K));break e}}j=le=Lp(le,K),Ii!==4&&(Ii=2),hy===null?hy=[j]:hy.push(j),j=L;do{switch(j.tag){case 3:j.flags|=65536,f&=-f,j.lanes|=f;var me=HV(j,le,f);OV(j,me);break e;case 1:K=le;var ce=j.type,ve=j.stateNode;if((j.flags&128)===0&&(typeof ce.getDerivedStateFromError=="function"||ve!==null&&typeof ve.componentDidCatch=="function"&&(td===null||!td.has(ve)))){j.flags|=65536,f&=-f,j.lanes|=f;var Fe=GV(j,K,f);OV(j,Fe);break e}}j=j.return}while(j!==null)}T4(y)}catch(pt){f=pt,yi===y&&y!==null&&(yi=y=y.return);continue}break}while(!0)}function P4(){var d=iw.current;return iw.current=Kx,d===null?Kx:d}function qE(){(Ii===0||Ii===3||Ii===2)&&(Ii=4),Bi===null||(Nh&268435455)===0&&(ow&268435455)===0||id(Bi,oo)}function dw(d,f){var y=br;br|=2;var C=P4();(Bi!==d||oo!==f)&&(Wc=null,Dh(d,f));do try{Dce();break}catch(I){k4(d,I)}while(!0);if(nE(),br=y,iw.current=C,yi!==null)throw Error(r(261));return Bi=null,oo=0,Ii}function Dce(){for(;yi!==null;)_4(yi)}function Lce(){for(;yi!==null&&!yt();)_4(yi)}function _4(d){var f=I4(d.alternate,d,Ns);d.memoizedProps=d.pendingProps,f===null?T4(d):yi=f,NE.current=null}function T4(d){var f=d;do{var y=f.alternate;if(d=f.return,(f.flags&32768)===0){if(y=Rce(y,f,Ns),y!==null){yi=y;return}}else{if(y=Ice(y,f),y!==null){y.flags&=32767,yi=y;return}if(d!==null)d.flags|=32768,d.subtreeFlags=0,d.deletions=null;else{Ii=6,yi=null;return}}if(f=f.sibling,f!==null){yi=f;return}yi=f=d}while(f!==null);Ii===0&&(Ii=5)}function Lh(d,f,y){var C=Br,I=ga.transition;try{ga.transition=null,Br=1,Vce(d,f,y,C)}finally{ga.transition=I,Br=C}return null}function Vce(d,f,y,C){do Bp();while(rd!==null);if((br&6)!==0)throw Error(r(327));y=d.finishedWork;var I=d.finishedLanes;if(y===null)return null;if(d.finishedWork=null,d.finishedLanes=0,y===d.current)throw Error(r(177));d.callbackNode=null,d.callbackPriority=0;var j=y.lanes|y.childLanes;if(ble(d,j),d===Bi&&(yi=Bi=null,oo=0),(y.subtreeFlags&2064)===0&&(y.flags&2064)===0||aw||(aw=!0,j4(Ho,function(){return Bp(),null})),j=(y.flags&15990)!==0,(y.subtreeFlags&15990)!==0||j){j=ga.transition,ga.transition=null;var L=Br;Br=1;var K=br;br|=4,NE.current=null,$ce(d,y),y4(y,d),oce(qT),wx=!!zT,qT=zT=null,d.current=y,Ace(y),Ut(),br=K,Br=L,ga.transition=j}else d.current=y;if(aw&&(aw=!1,rd=d,lw=I),j=d.pendingLanes,j===0&&(td=null),Ph(y.stateNode),es(d,Wt()),f!==null)for(C=d.onRecoverableError,y=0;y<f.length;y++)I=f[y],C(I.value,{componentStack:I.stack,digest:I.digest});if(sw)throw sw=!1,d=LE,LE=null,d;return(lw&1)!==0&&d.tag!==0&&Bp(),j=d.pendingLanes,(j&1)!==0?d===VE?fy++:(fy=0,VE=d):fy=0,Yu(),null}function Bp(){if(rd!==null){var d=m5(lw),f=ga.transition,y=Br;try{if(ga.transition=null,Br=16>d?16:d,rd===null)var C=!1;else{if(d=rd,rd=null,lw=0,(br&6)!==0)throw Error(r(331));var I=br;for(br|=4,at=d.current;at!==null;){var j=at,L=j.child;if((at.flags&16)!==0){var K=j.deletions;if(K!==null){for(var le=0;le<K.length;le++){var xe=K[le];for(at=xe;at!==null;){var $e=at;switch($e.tag){case 0:case 11:case 15:uy(8,$e,j)}var Ne=$e.child;if(Ne!==null)Ne.return=$e,at=Ne;else for(;at!==null;){$e=at;var je=$e.sibling,nt=$e.return;if(f4($e),$e===xe){at=null;break}if(je!==null){je.return=nt,at=je;break}at=nt}}}var ct=j.alternate;if(ct!==null){var ht=ct.child;if(ht!==null){ct.child=null;do{var ai=ht.sibling;ht.sibling=null,ht=ai}while(ht!==null)}}at=j}}if((j.subtreeFlags&2064)!==0&&L!==null)L.return=j,at=L;else e:for(;at!==null;){if(j=at,(j.flags&2048)!==0)switch(j.tag){case 0:case 11:case 15:uy(9,j,j.return)}var me=j.sibling;if(me!==null){me.return=j.return,at=me;break e}at=j.return}}var ce=d.current;for(at=ce;at!==null;){L=at;var ve=L.child;if((L.subtreeFlags&2064)!==0&&ve!==null)ve.return=L,at=ve;else e:for(L=ce;at!==null;){if(K=at,(K.flags&2048)!==0)try{switch(K.tag){case 0:case 11:case 15:nw(9,K)}}catch(pt){ii(K,K.return,pt)}if(K===L){at=null;break e}var Fe=K.sibling;if(Fe!==null){Fe.return=K.return,at=Fe;break e}at=K.return}}if(br=I,Yu(),vi&&typeof vi.onPostCommitFiberRoot=="function")try{vi.onPostCommitFiberRoot(ua,d)}catch{}C=!0}return C}finally{Br=y,ga.transition=f}}return!1}function E4(d,f,y){f=Lp(y,f),f=HV(d,f,1),d=Ju(d,f,1),f=Do(),d!==null&&(Dv(d,1,f),es(d,f))}function ii(d,f,y){if(d.tag===3)E4(d,d,y);else for(;f!==null;){if(f.tag===3){E4(f,d,y);break}else if(f.tag===1){var C=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(td===null||!td.has(C))){d=Lp(y,d),d=GV(f,d,1),f=Ju(f,d,1),d=Do(),f!==null&&(Dv(f,1,d),es(f,d));break}}f=f.return}}function Fce(d,f,y){var C=d.pingCache;C!==null&&C.delete(f),f=Do(),d.pingedLanes|=d.suspendedLanes&y,Bi===d&&(oo&y)===y&&(Ii===4||Ii===3&&(oo&130023424)===oo&&500>Wt()-DE?Dh(d,0):ME|=y),es(d,f)}function R4(d,f){f===0&&((d.mode&1)===0?f=1:(f=_h,_h<<=1,(_h&130023424)===0&&(_h=4194304)));var y=Do();d=Bc(d,f),d!==null&&(Dv(d,f,y),es(d,y))}function Qce(d){var f=d.memoizedState,y=0;f!==null&&(y=f.retryLane),R4(d,y)}function Bce(d,f){var y=0;switch(d.tag){case 13:var C=d.stateNode,I=d.memoizedState;I!==null&&(y=I.retryLane);break;case 19:C=d.stateNode;break;default:throw Error(r(314))}C!==null&&C.delete(f),R4(d,y)}var I4;I4=function(d,f,y){if(d!==null)if(d.memoizedProps!==f.pendingProps||Zo.current)Ko=!0;else{if((d.lanes&y)===0&&(f.flags&128)===0)return Ko=!1,Ece(d,f,y);Ko=(d.flags&131072)!==0}else Ko=!1,Ln&&(f.flags&1048576)!==0&&uV(f,Fx,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;tw(d,f),d=f.pendingProps;var I=Rp(f,xo.current);Mp(f,y),I=pE(null,f,C,d,I,y);var j=gE();return f.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Yo(C)?(j=!0,Dx(f)):j=!1,f.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,aE(f),I.updater=Jx,f.stateNode=I,I._reactInternals=f,xE(f,C,d,y),f=kE(null,f,C,!0,j,y)):(f.tag=0,Ln&&j&&YT(f),Mo(null,f,I,y),f=f.child),f;case 16:C=f.elementType;e:{switch(tw(d,f),d=f.pendingProps,I=C._init,C=I(C._payload),f.type=C,I=f.tag=qce(C),d=Ka(C,d),I){case 0:f=CE(null,f,C,d,y);break e;case 1:f=n4(null,f,C,d,y);break e;case 11:f=KV(null,f,C,d,y);break e;case 14:f=JV(null,f,C,Ka(C.type,d),y);break e}throw Error(r(306,C,""))}return f;case 0:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),CE(d,f,C,I,y);case 1:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),n4(d,f,C,I,y);case 3:e:{if(i4(f),d===null)throw Error(r(387));C=f.pendingProps,j=f.memoizedState,I=j.element,bV(d,f),Ux(f,C,null,y);var L=f.memoizedState;if(C=L.element,j.isDehydrated)if(j={element:C,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},f.updateQueue.baseState=j,f.memoizedState=j,f.flags&256){I=Lp(Error(r(423)),f),f=o4(d,f,C,y,I);break e}else if(C!==I){I=Lp(Error(r(424)),f),f=o4(d,f,C,y,I);break e}else for(As=Gu(f.stateNode.containerInfo.firstChild),$s=f,Ln=!0,Ya=null,y=vV(f,null,C,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if($p(),C===I){f=qc(d,f,y);break e}Mo(d,f,C,y)}f=f.child}return f;case 5:return wV(f),d===null&&eE(f),C=f.type,I=f.pendingProps,j=d!==null?d.memoizedProps:null,L=I.children,WT(C,I)?L=null:j!==null&&WT(C,j)&&(f.flags|=32),r4(d,f),Mo(d,f,L,y),f.child;case 6:return d===null&&eE(f),null;case 13:return s4(d,f,y);case 4:return lE(f,f.stateNode.containerInfo),C=f.pendingProps,d===null?f.child=Ap(f,null,C,y):Mo(d,f,C,y),f.child;case 11:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),KV(d,f,C,I,y);case 7:return Mo(d,f,f.pendingProps,y),f.child;case 8:return Mo(d,f,f.pendingProps.children,y),f.child;case 12:return Mo(d,f,f.pendingProps.children,y),f.child;case 10:e:{if(C=f.type._context,I=f.pendingProps,j=f.memoizedProps,L=I.value,cn(zx,C._currentValue),C._currentValue=L,j!==null)if(Za(j.value,L)){if(j.children===I.children&&!Zo.current){f=qc(d,f,y);break e}}else for(j=f.child,j!==null&&(j.return=f);j!==null;){var K=j.dependencies;if(K!==null){L=j.child;for(var le=K.firstContext;le!==null;){if(le.context===C){if(j.tag===1){le=zc(-1,y&-y),le.tag=2;var xe=j.updateQueue;if(xe!==null){xe=xe.shared;var $e=xe.pending;$e===null?le.next=le:(le.next=$e.next,$e.next=le),xe.pending=le}}j.lanes|=y,le=j.alternate,le!==null&&(le.lanes|=y),oE(j.return,y,f),K.lanes|=y;break}le=le.next}}else if(j.tag===10)L=j.type===f.type?null:j.child;else if(j.tag===18){if(L=j.return,L===null)throw Error(r(341));L.lanes|=y,K=L.alternate,K!==null&&(K.lanes|=y),oE(L,y,f),L=j.sibling}else L=j.child;if(L!==null)L.return=j;else for(L=j;L!==null;){if(L===f){L=null;break}if(j=L.sibling,j!==null){j.return=L.return,L=j;break}L=L.return}j=L}Mo(d,f,I.children,y),f=f.child}return f;case 9:return I=f.type,C=f.pendingProps.children,Mp(f,y),I=fa(I),C=C(I),f.flags|=1,Mo(d,f,C,y),f.child;case 14:return C=f.type,I=Ka(C,f.pendingProps),I=Ka(C.type,I),JV(d,f,C,I,y);case 15:return e4(d,f,f.type,f.pendingProps,y);case 17:return C=f.type,I=f.pendingProps,I=f.elementType===C?I:Ka(C,I),tw(d,f),f.tag=1,Yo(C)?(d=!0,Dx(f)):d=!1,Mp(f,y),WV(f,C,I),xE(f,C,I,y),kE(null,f,C,!0,d,y);case 19:return l4(d,f,y);case 22:return t4(d,f,y)}throw Error(r(156,f.tag))};function j4(d,f){return kt(d,f)}function zce(d,f,y,C){this.tag=d,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ma(d,f,y,C){return new zce(d,f,y,C)}function WE(d){return d=d.prototype,!(!d||!d.isReactComponent)}function qce(d){if(typeof d=="function")return WE(d)?1:0;if(d!=null){if(d=d.$$typeof,d===V)return 11;if(d===B)return 14}return 2}function od(d,f){var y=d.alternate;return y===null?(y=ma(d.tag,f,d.key,d.mode),y.elementType=d.elementType,y.type=d.type,y.stateNode=d.stateNode,y.alternate=d,d.alternate=y):(y.pendingProps=f,y.type=d.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=d.flags&14680064,y.childLanes=d.childLanes,y.lanes=d.lanes,y.child=d.child,y.memoizedProps=d.memoizedProps,y.memoizedState=d.memoizedState,y.updateQueue=d.updateQueue,f=d.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=d.sibling,y.index=d.index,y.ref=d.ref,y}function hw(d,f,y,C,I,j){var L=2;if(C=d,typeof d=="function")WE(d)&&(L=1);else if(typeof d=="string")L=5;else e:switch(d){case R:return Vh(y.children,I,j,f);case $:L=8,I|=8;break;case A:return d=ma(12,y,f,I|2),d.elementType=A,d.lanes=j,d;case q:return d=ma(13,y,f,I),d.elementType=q,d.lanes=j,d;case N:return d=ma(19,y,f,I),d.elementType=N,d.lanes=j,d;case he:return fw(y,I,j,f);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case M:L=10;break e;case Q:L=9;break e;case V:L=11;break e;case B:L=14;break e;case re:L=16,C=null;break e}throw Error(r(130,d==null?d:typeof d,""))}return f=ma(L,y,f,I),f.elementType=d,f.type=C,f.lanes=j,f}function Vh(d,f,y,C){return d=ma(7,d,C,f),d.lanes=y,d}function fw(d,f,y,C){return d=ma(22,d,C,f),d.elementType=he,d.lanes=y,d.stateNode={isHidden:!1},d}function UE(d,f,y){return d=ma(6,d,null,f),d.lanes=y,d}function HE(d,f,y){return f=ma(4,d.children!==null?d.children:[],d.key,f),f.lanes=y,f.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},f}function Wce(d,f,y,C,I){this.tag=f,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=OT(0),this.expirationTimes=OT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=OT(0),this.identifierPrefix=C,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function GE(d,f,y,C,I,j,L,K,le){return d=new Wce(d,f,y,K,le),f===1?(f=1,j===!0&&(f|=8)):f=0,j=ma(3,null,null,f),d.current=j,j.stateNode=d,j.memoizedState={element:C,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},aE(j),d}function Uce(d,f,y){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:C==null?null:""+C,children:d,containerInfo:f,implementation:y}}function $4(d){if(!d)return Zu;d=d._reactInternals;e:{if(Tt(d)!==d||d.tag!==1)throw Error(r(170));var f=d;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Yo(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(r(171))}if(d.tag===1){var y=d.type;if(Yo(y))return aV(d,y,f)}return f}function A4(d,f,y,C,I,j,L,K,le){return d=GE(y,C,!0,d,I,j,L,K,le),d.context=$4(null),y=d.current,C=Do(),I=nd(y),j=zc(C,I),j.callback=f??null,Ju(y,j,I),d.current.lanes=I,Dv(d,I,C),es(d,C),d}function pw(d,f,y,C){var I=f.current,j=Do(),L=nd(I);return y=$4(y),f.context===null?f.context=y:f.pendingContext=y,f=zc(j,L),f.payload={element:d},C=C===void 0?null:C,C!==null&&(f.callback=C),d=Ju(I,f,L),d!==null&&(tl(d,I,L,j),Wx(d,I,L)),L}function gw(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return d.child.stateNode;default:return d.child.stateNode}}function N4(d,f){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var y=d.retryLane;d.retryLane=y!==0&&y<f?y:f}}function XE(d,f){N4(d,f),(d=d.alternate)&&N4(d,f)}function Hce(){return null}var M4=typeof reportError=="function"?reportError:function(d){console.error(d)};function ZE(d){this._internalRoot=d}mw.prototype.render=ZE.prototype.render=function(d){var f=this._internalRoot;if(f===null)throw Error(r(409));pw(d,f,null,null)},mw.prototype.unmount=ZE.prototype.unmount=function(){var d=this._internalRoot;if(d!==null){this._internalRoot=null;var f=d.containerInfo;Mh(function(){pw(null,d,null,null)}),f[Lc]=null}};function mw(d){this._internalRoot=d}mw.prototype.unstable_scheduleHydration=function(d){if(d){var f=b5();d={blockedOn:null,target:d,priority:f};for(var y=0;y<Wu.length&&f!==0&&f<Wu[y].priority;y++);Wu.splice(y,0,d),y===0&&w5(d)}};function YE(d){return!(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)}function vw(d){return!(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11&&(d.nodeType!==8||d.nodeValue!==" react-mount-point-unstable "))}function D4(){}function Gce(d,f,y,C,I){if(I){if(typeof C=="function"){var j=C;C=function(){var xe=gw(L);j.call(xe)}}var L=A4(f,C,d,0,null,!1,!1,"",D4);return d._reactRootContainer=L,d[Lc]=L.current,Yv(d.nodeType===8?d.parentNode:d),Mh(),L}for(;I=d.lastChild;)d.removeChild(I);if(typeof C=="function"){var K=C;C=function(){var xe=gw(le);K.call(xe)}}var le=GE(d,0,!1,null,null,!1,!1,"",D4);return d._reactRootContainer=le,d[Lc]=le.current,Yv(d.nodeType===8?d.parentNode:d),Mh(function(){pw(f,le,y,C)}),le}function yw(d,f,y,C,I){var j=y._reactRootContainer;if(j){var L=j;if(typeof I=="function"){var K=I;I=function(){var le=gw(L);K.call(le)}}pw(f,L,d,I)}else L=Gce(y,f,d,I,C);return gw(L)}v5=function(d){switch(d.tag){case 3:var f=d.stateNode;if(f.current.memoizedState.isDehydrated){var y=Qu(f.pendingLanes);y!==0&&(xT(f,y|1),es(f,Wt()),(br&6)===0&&(Qp=Wt()+500,Yu()))}break;case 13:Mh(function(){var C=Bc(d,1);if(C!==null){var I=Do();tl(C,d,1,I)}}),XE(d,1)}},wT=function(d){if(d.tag===13){var f=Bc(d,134217728);if(f!==null){var y=Do();tl(f,d,134217728,y)}XE(d,134217728)}},y5=function(d){if(d.tag===13){var f=nd(d),y=Bc(d,f);if(y!==null){var C=Do();tl(y,d,f,C)}XE(d,f)}},b5=function(){return Br},O5=function(d,f){var y=Br;try{return Br=d,f()}finally{Br=y}},Ch=function(d,f,y){switch(f){case"input":if(Gt(d,y),f=y.name,y.type==="radio"&&f!=null){for(y=d;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<y.length;f++){var C=y[f];if(C!==d&&C.form===d.form){var I=Nx(C);if(!I)throw Error(r(90));oe(C),Gt(C,I)}}}break;case"textarea":Ti(d,y);break;case"select":f=y.value,f!=null&&ur(d,!!y.multiple,f,!1)}},be=BE,Ce=Mh;var Xce={usingClientEntryPoint:!1,Events:[ey,Tp,Nx,Xa,fe,BE]},py={findFiberByHostInstance:Th,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zce={bundleType:py.bundleType,version:py.version,rendererPackageName:py.rendererPackageName,rendererConfig:py.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(d){return d=Yt(d),d===null?null:d.stateNode},findFiberByHostInstance:py.findFiberByHostInstance||Hce,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 bw=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bw.isDisabled&&bw.supportsFiber)try{ua=bw.inject(Zce),vi=bw}catch{}}return ts.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xce,ts.createPortal=function(d,f){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!YE(f))throw Error(r(200));return Uce(d,f,null,y)},ts.createRoot=function(d,f){if(!YE(d))throw Error(r(299));var y=!1,C="",I=M4;return f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(I=f.onRecoverableError)),f=GE(d,1,!1,null,null,y,!1,C,I),d[Lc]=f.current,Yv(d.nodeType===8?d.parentNode:d),new ZE(f)},ts.findDOMNode=function(d){if(d==null)return null;if(d.nodeType===1)return d;var f=d._reactInternals;if(f===void 0)throw typeof d.render=="function"?Error(r(188)):(d=Object.keys(d).join(","),Error(r(268,d)));return d=Yt(f),d=d===null?null:d.stateNode,d},ts.flushSync=function(d){return Mh(d)},ts.hydrate=function(d,f,y){if(!vw(f))throw Error(r(200));return yw(null,d,f,!0,y)},ts.hydrateRoot=function(d,f,y){if(!YE(d))throw Error(r(405));var C=y!=null&&y.hydratedSources||null,I=!1,j="",L=M4;if(y!=null&&(y.unstable_strictMode===!0&&(I=!0),y.identifierPrefix!==void 0&&(j=y.identifierPrefix),y.onRecoverableError!==void 0&&(L=y.onRecoverableError)),f=A4(f,null,d,1,y??null,I,!1,j,L),d[Lc]=f.current,Yv(d),C)for(d=0;d<C.length;d++)y=C[d],I=y._getVersion,I=I(y._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[y,I]:f.mutableSourceEagerHydrationData.push(y,I);return new mw(f)},ts.render=function(d,f,y){if(!vw(f))throw Error(r(200));return yw(null,d,f,!1,y)},ts.unmountComponentAtNode=function(d){if(!vw(d))throw Error(r(40));return d._reactRootContainer?(Mh(function(){yw(null,null,d,!1,function(){d._reactRootContainer=null,d[Lc]=null})}),!0):!1},ts.unstable_batchedUpdates=BE,ts.unstable_renderSubtreeIntoContainer=function(d,f,y,C){if(!vw(y))throw Error(r(200));if(d==null||d._reactInternals===void 0)throw Error(r(38));return yw(d,f,y,!1,C)},ts.version="18.3.1-next-f1338f8080-20240426",ts}var U4;function k9(){if(U4)return eR.exports;U4=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),eR.exports=iue(),eR.exports}var H4;function oue(){if(H4)return Ow;H4=1;var t=k9();return Ow.createRoot=t.createRoot,Ow.hydrateRoot=t.hydrateRoot,Ow}var sue=oue();const aue={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"a606396",MODE:"production",PACKAGE_VERSION:"2.1.0-alpha.7",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},Vg=t=>{const e=aue[t];return window.__env__?.[t]||e};function P9(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var lue=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,cue=P9(function(t){return lue.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function uue(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function due(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var hue=function(){function t(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(due(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=uue(i);try{o.insertRule(n,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){var i;return(i=n.parentNode)==null?void 0:i.removeChild(n)}),this.tags=[],this.ctr=0},t}(),ko="-ms-",PC="-moz-",Er="-webkit-",_9="comm",fN="rule",pN="decl",fue="@import",T9="@keyframes",pue="@layer",gue=Math.abs,vP=String.fromCharCode,mue=Object.assign;function vue(t,e){return fo(t,0)^45?(((e<<2^fo(t,0))<<2^fo(t,1))<<2^fo(t,2))<<2^fo(t,3):0}function E9(t){return t.trim()}function yue(t,e){return(t=e.exec(t))?t[0]:t}function Rr(t,e,r){return t.replace(e,r)}function Wj(t,e){return t.indexOf(e)}function fo(t,e){return t.charCodeAt(e)|0}function eb(t,e,r){return t.slice(e,r)}function Gl(t){return t.length}function gN(t){return t.length}function xw(t,e){return e.push(t),t}function bue(t,e){return t.map(e).join("")}var yP=1,am=1,R9=0,Os=0,Ci=0,zm="";function bP(t,e,r,n,i,o,s){return{value:t,root:e,parent:r,type:n,props:i,children:o,line:yP,column:am,length:s,return:""}}function my(t,e){return mue(bP("",null,null,"",null,null,0),t,{length:-t.length},e)}function Oue(){return Ci}function xue(){return Ci=Os>0?fo(zm,--Os):0,am--,Ci===10&&(am=1,yP--),Ci}function Ys(){return Ci=Os<R9?fo(zm,Os++):0,am++,Ci===10&&(am=1,yP++),Ci}function lc(){return fo(zm,Os)}function IS(){return Os}function xO(t,e){return eb(zm,t,e)}function tb(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function I9(t){return yP=am=1,R9=Gl(zm=t),Os=0,[]}function j9(t){return zm="",t}function jS(t){return E9(xO(Os-1,Uj(t===91?t+2:t===40?t+1:t)))}function wue(t){for(;(Ci=lc())&&Ci<33;)Ys();return tb(t)>2||tb(Ci)>3?"":" "}function Sue(t,e){for(;--e&&Ys()&&!(Ci<48||Ci>102||Ci>57&&Ci<65||Ci>70&&Ci<97););return xO(t,IS()+(e<6&&lc()==32&&Ys()==32))}function Uj(t){for(;Ys();)switch(Ci){case t:return Os;case 34:case 39:t!==34&&t!==39&&Uj(Ci);break;case 40:t===41&&Uj(t);break;case 92:Ys();break}return Os}function Cue(t,e){for(;Ys()&&t+Ci!==57;)if(t+Ci===84&&lc()===47)break;return"/*"+xO(e,Os-1)+"*"+vP(t===47?t:Ys())}function kue(t){for(;!tb(lc());)Ys();return xO(t,Os)}function Pue(t){return j9($S("",null,null,null,[""],t=I9(t),0,[0],t))}function $S(t,e,r,n,i,o,s,a,l){for(var c=0,u=0,p=s,m=0,v=0,b=0,O=1,x=1,S=1,w=0,k="",P=i,_=o,T=n,R=k;x;)switch(b=w,w=Ys()){case 40:if(b!=108&&fo(R,p-1)==58){Wj(R+=Rr(jS(w),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:R+=jS(w);break;case 9:case 10:case 13:case 32:R+=wue(b);break;case 92:R+=Sue(IS()-1,7);continue;case 47:switch(lc()){case 42:case 47:xw(_ue(Cue(Ys(),IS()),e,r),l);break;default:R+="/"}break;case 123*O:a[c++]=Gl(R)*S;case 125*O:case 59:case 0:switch(w){case 0:case 125:x=0;case 59+u:S==-1&&(R=Rr(R,/\f/g,"")),v>0&&Gl(R)-p&&xw(v>32?X4(R+";",n,r,p-1):X4(Rr(R," ","")+";",n,r,p-2),l);break;case 59:R+=";";default:if(xw(T=G4(R,e,r,c,u,i,a,k,P=[],_=[],p),o),w===123)if(u===0)$S(R,e,T,T,P,o,p,a,_);else switch(m===99&&fo(R,3)===110?100:m){case 100:case 108:case 109:case 115:$S(t,T,T,n&&xw(G4(t,T,T,0,0,i,a,k,i,P=[],p),_),i,_,p,a,n?P:_);break;default:$S(R,T,T,T,[""],_,0,a,_)}}c=u=v=0,O=S=1,k=R="",p=s;break;case 58:p=1+Gl(R),v=b;default:if(O<1){if(w==123)--O;else if(w==125&&O++==0&&xue()==125)continue}switch(R+=vP(w),w*O){case 38:S=u>0?1:(R+="\f",-1);break;case 44:a[c++]=(Gl(R)-1)*S,S=1;break;case 64:lc()===45&&(R+=jS(Ys())),m=lc(),u=p=Gl(k=R+=kue(IS())),w++;break;case 45:b===45&&Gl(R)==2&&(O=0)}}return o}function G4(t,e,r,n,i,o,s,a,l,c,u){for(var p=i-1,m=i===0?o:[""],v=gN(m),b=0,O=0,x=0;b<n;++b)for(var S=0,w=eb(t,p+1,p=gue(O=s[b])),k=t;S<v;++S)(k=E9(O>0?m[S]+" "+w:Rr(w,/&\f/g,m[S])))&&(l[x++]=k);return bP(t,e,r,i===0?fN:a,l,c,u)}function _ue(t,e,r){return bP(t,e,r,_9,vP(Oue()),eb(t,2,-2),0)}function X4(t,e,r,n){return bP(t,e,r,pN,eb(t,0,n),eb(t,n+1,-1),n)}function Fg(t,e){for(var r="",n=gN(t),i=0;i<n;i++)r+=e(t[i],i,t,e)||"";return r}function Tue(t,e,r,n){switch(t.type){case pue:if(t.children.length)break;case fue:case pN:return t.return=t.return||t.value;case _9:return"";case T9:return t.return=t.value+"{"+Fg(t.children,n)+"}";case fN:t.value=t.props.join(",")}return Gl(r=Fg(t.children,n))?t.return=t.value+"{"+r+"}":""}function Eue(t){var e=gN(t);return function(r,n,i,o){for(var s="",a=0;a<e;a++)s+=t[a](r,n,i,o)||"";return s}}function Rue(t){return function(e){e.root||(e=e.return)&&t(e)}}var Iue=function(e,r,n){for(var i=0,o=0;i=o,o=lc(),i===38&&o===12&&(r[n]=1),!tb(o);)Ys();return xO(e,Os)},jue=function(e,r){var n=-1,i=44;do switch(tb(i)){case 0:i===38&&lc()===12&&(r[n]=1),e[n]+=Iue(Os-1,r,n);break;case 2:e[n]+=jS(i);break;case 4:if(i===44){e[++n]=lc()===58?"&\f":"",r[n]=e[n].length;break}default:e[n]+=vP(i)}while(i=Ys());return e},$ue=function(e,r){return j9(jue(I9(e),r))},Z4=new WeakMap,Aue=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var r=e.value,n=e.parent,i=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&r.charCodeAt(0)!==58&&!Z4.get(n))&&!i){Z4.set(e,!0);for(var o=[],s=$ue(r,o),a=n.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},Nue=function(e){if(e.type==="decl"){var r=e.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(e.return="",e.value="")}};function $9(t,e){switch(vue(t,e)){case 5103:return Er+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Er+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Er+t+PC+t+ko+t+t;case 6828:case 4268:return Er+t+ko+t+t;case 6165:return Er+t+ko+"flex-"+t+t;case 5187:return Er+t+Rr(t,/(\w+).+(:[^]+)/,Er+"box-$1$2"+ko+"flex-$1$2")+t;case 5443:return Er+t+ko+"flex-item-"+Rr(t,/flex-|-self/,"")+t;case 4675:return Er+t+ko+"flex-line-pack"+Rr(t,/align-content|flex-|-self/,"")+t;case 5548:return Er+t+ko+Rr(t,"shrink","negative")+t;case 5292:return Er+t+ko+Rr(t,"basis","preferred-size")+t;case 6060:return Er+"box-"+Rr(t,"-grow","")+Er+t+ko+Rr(t,"grow","positive")+t;case 4554:return Er+Rr(t,/([^-])(transform)/g,"$1"+Er+"$2")+t;case 6187:return Rr(Rr(Rr(t,/(zoom-|grab)/,Er+"$1"),/(image-set)/,Er+"$1"),t,"")+t;case 5495:case 3959:return Rr(t,/(image-set\([^]*)/,Er+"$1$`$1");case 4968:return Rr(Rr(t,/(.+:)(flex-)?(.*)/,Er+"box-pack:$3"+ko+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Er+t+t;case 4095:case 3583:case 4068:case 2532:return Rr(t,/(.+)-inline(.+)/,Er+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Gl(t)-1-e>6)switch(fo(t,e+1)){case 109:if(fo(t,e+4)!==45)break;case 102:return Rr(t,/(.+:)(.+)-([^]+)/,"$1"+Er+"$2-$3$1"+PC+(fo(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Wj(t,"stretch")?$9(Rr(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(fo(t,e+1)!==115)break;case 6444:switch(fo(t,Gl(t)-3-(~Wj(t,"!important")&&10))){case 107:return Rr(t,":",":"+Er)+t;case 101:return Rr(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Er+(fo(t,14)===45?"inline-":"")+"box$3$1"+Er+"$2$3$1"+ko+"$2box$3")+t}break;case 5936:switch(fo(t,e+11)){case 114:return Er+t+ko+Rr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Er+t+ko+Rr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Er+t+ko+Rr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Er+t+ko+t+t}return t}var Mue=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case pN:e.return=$9(e.value,e.length);break;case T9:return Fg([my(e,{value:Rr(e.value,"@","@"+Er)})],i);case fN:if(e.length)return bue(e.props,function(o){switch(yue(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Fg([my(e,{props:[Rr(o,/:(read-\w+)/,":"+PC+"$1")]})],i);case"::placeholder":return Fg([my(e,{props:[Rr(o,/:(plac\w+)/,":"+Er+"input-$1")]}),my(e,{props:[Rr(o,/:(plac\w+)/,":"+PC+"$1")]}),my(e,{props:[Rr(o,/:(plac\w+)/,ko+"input-$1")]})],i)}return""})}},Due=[Mue],Lue=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(O){var x=O.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(O),O.setAttribute("data-s",""))})}var i=e.stylisPlugins||Due,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(O){for(var x=O.getAttribute("data-emotion").split(" "),S=1;S<x.length;S++)o[x[S]]=!0;a.push(O)});var l,c=[Aue,Nue];{var u,p=[Tue,Rue(function(O){u.insert(O)})],m=Eue(c.concat(i,p)),v=function(x){return Fg(Pue(x),m)};l=function(x,S,w,k){u=w,v(x?x+"{"+S.styles+"}":S.styles),k&&(b.inserted[S.name]=!0)}}var b={key:r,sheet:new hue({key:r,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return b.sheet.hydrate(a),b};function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},$t.apply(null,arguments)}var nR={exports:{}},Nr={};var Y4;function Vue(){if(Y4)return Nr;Y4=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,p=t?Symbol.for("react.suspense"):60113,m=t?Symbol.for("react.suspense_list"):60120,v=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,O=t?Symbol.for("react.block"):60121,x=t?Symbol.for("react.fundamental"):60117,S=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function k(_){if(typeof _=="object"&&_!==null){var T=_.$$typeof;switch(T){case e:switch(_=_.type,_){case l:case c:case n:case o:case i:case p:return _;default:switch(_=_&&_.$$typeof,_){case a:case u:case b:case v:case s:return _;default:return T}}case r:return T}}}function P(_){return k(_)===c}return Nr.AsyncMode=l,Nr.ConcurrentMode=c,Nr.ContextConsumer=a,Nr.ContextProvider=s,Nr.Element=e,Nr.ForwardRef=u,Nr.Fragment=n,Nr.Lazy=b,Nr.Memo=v,Nr.Portal=r,Nr.Profiler=o,Nr.StrictMode=i,Nr.Suspense=p,Nr.isAsyncMode=function(_){return P(_)||k(_)===l},Nr.isConcurrentMode=P,Nr.isContextConsumer=function(_){return k(_)===a},Nr.isContextProvider=function(_){return k(_)===s},Nr.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===e},Nr.isForwardRef=function(_){return k(_)===u},Nr.isFragment=function(_){return k(_)===n},Nr.isLazy=function(_){return k(_)===b},Nr.isMemo=function(_){return k(_)===v},Nr.isPortal=function(_){return k(_)===r},Nr.isProfiler=function(_){return k(_)===o},Nr.isStrictMode=function(_){return k(_)===i},Nr.isSuspense=function(_){return k(_)===p},Nr.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===n||_===c||_===o||_===i||_===p||_===m||typeof _=="object"&&_!==null&&(_.$$typeof===b||_.$$typeof===v||_.$$typeof===s||_.$$typeof===a||_.$$typeof===u||_.$$typeof===x||_.$$typeof===S||_.$$typeof===w||_.$$typeof===O)},Nr.typeOf=k,Nr}var K4;function Fue(){return K4||(K4=1,nR.exports=Vue()),nR.exports}var iR,J4;function Que(){if(J4)return iR;J4=1;var t=Fue(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[t.ForwardRef]=n,o[t.Memo]=i;function s(b){return t.isMemo(b)?i:o[b.$$typeof]||e}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function v(b,O,x){if(typeof O!="string"){if(m){var S=p(O);S&&S!==m&&v(b,S,x)}var w=l(O);c&&(w=w.concat(c(O)));for(var k=s(b),P=s(O),_=0;_<w.length;++_){var T=w[_];if(!r[T]&&!(x&&x[T])&&!(P&&P[T])&&!(k&&k[T])){var R=u(O,T);try{a(b,T,R)}catch{}}}}return b}return iR=v,iR}Que();var Bue=!0;function A9(t,e,r){var n="";return r.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(n+=i+" ")}),n}var mN=function(e,r,n){var i=e.key+"-"+r.name;(n===!1||Bue===!1)&&e.registered[i]===void 0&&(e.registered[i]=r.styles)},vN=function(e,r,n){mN(e,r,n);var i=e.key+"-"+r.name;if(e.inserted[r.name]===void 0){var o=r;do e.insert(r===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function zue(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var que={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Wue=/[A-Z]|^ms/g,Uue=/_EMO_([^_]+?)_([^]*?)_EMO_/g,N9=function(e){return e.charCodeAt(1)===45},eF=function(e){return e!=null&&typeof e!="boolean"},oR=P9(function(t){return N9(t)?t:t.replace(Wue,"-$&").toLowerCase()}),tF=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(Uue,function(n,i,o){return Xl={name:i,styles:o,next:Xl},i})}return que[e]!==1&&!N9(e)&&typeof r=="number"&&r!==0?r+"px":r};function rb(t,e,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return Xl={name:i.name,styles:i.styles,next:Xl},i.name;var o=r;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)Xl={name:s.name,styles:s.styles,next:Xl},s=s.next;var a=o.styles+";";return a}return Hue(t,e,r)}case"function":{if(t!==void 0){var l=Xl,c=r(t);return Xl=l,rb(t,e,c)}break}}var u=r;if(e==null)return u;var p=e[u];return p!==void 0?p:u}function Hue(t,e,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=rb(t,e,r[i])+";";else for(var o in r){var s=r[o];if(typeof s!="object"){var a=s;e!=null&&e[a]!==void 0?n+=o+"{"+e[a]+"}":eF(a)&&(n+=oR(o)+":"+tF(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var l=0;l<s.length;l++)eF(s[l])&&(n+=oR(o)+":"+tF(o,s[l])+";");else{var c=rb(t,e,s);switch(o){case"animation":case"animationName":{n+=oR(o)+":"+c+";";break}default:n+=o+"{"+c+"}"}}}return n}var rF=/label:\s*([^\s;{]+)\s*(;|$)/g,Xl;function yN(t,e,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var n=!0,i="";Xl=void 0;var o=t[0];if(o==null||o.raw===void 0)n=!1,i+=rb(r,e,o);else{var s=o;i+=s[0]}for(var a=1;a<t.length;a++)if(i+=rb(r,e,t[a]),n){var l=o;i+=l[a]}rF.lastIndex=0;for(var c="",u;(u=rF.exec(i))!==null;)c+="-"+u[1];var p=zue(i)+c;return{name:p,styles:i,next:Xl}}var Gue=function(e){return e()},M9=qj.useInsertionEffect?qj.useInsertionEffect:!1,D9=M9||Gue,nF=M9||E.useLayoutEffect,L9=E.createContext(typeof HTMLElement<"u"?Lue({key:"css"}):null);L9.Provider;var bN=function(e){return E.forwardRef(function(r,n){var i=E.useContext(L9);return e(r,i,n)})},ON=E.createContext({}),xN={}.hasOwnProperty,Hj="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Xue=function(e,r){var n={};for(var i in r)xN.call(r,i)&&(n[i]=r[i]);return n[Hj]=e,n},Zue=function(e){var r=e.cache,n=e.serialized,i=e.isStringTag;return mN(r,n,i),D9(function(){return vN(r,n,i)}),null},Yue=bN(function(t,e,r){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var i=t[Hj],o=[n],s="";typeof t.className=="string"?s=A9(e.registered,o,t.className):t.className!=null&&(s=t.className+" ");var a=yN(o,void 0,E.useContext(ON));s+=e.key+"-"+a.name;var l={};for(var c in t)xN.call(t,c)&&c!=="css"&&c!==Hj&&(l[c]=t[c]);return l.className=s,r&&(l.ref=r),E.createElement(E.Fragment,null,E.createElement(Zue,{cache:e,serialized:a,isStringTag:typeof i=="string"}),E.createElement(i,l))}),Kue=Yue,iF=function(e,r){var n=arguments;if(r==null||!xN.call(r,"css"))return E.createElement.apply(void 0,n);var i=n.length,o=new Array(i);o[0]=Kue,o[1]=Xue(e,r);for(var s=2;s<i;s++)o[s]=n[s];return E.createElement.apply(null,o)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(iF||(iF={}));var oF=bN(function(t,e){var r=t.styles,n=yN([r],void 0,E.useContext(ON)),i=E.useRef();return nF(function(){var o=e.key+"-global",s=new e.sheet.constructor({key:o,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),a=!1,l=document.querySelector('style[data-emotion="'+o+" "+n.name+'"]');return e.sheet.tags.length&&(s.before=e.sheet.tags[0]),l!==null&&(a=!0,l.setAttribute("data-emotion",o),s.hydrate([l])),i.current=[s,a],function(){s.flush()}},[e]),nF(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(n.next!==void 0&&vN(e,n.next,!0),s.tags.length){var l=s.tags[s.tags.length-1].nextElementSibling;s.before=l,s.flush()}e.insert("",n,s,!1)},[e,n.name]),null});function Jue(...t){return function(...r){t.forEach(n=>n?.(...r))}}const ede=(...t)=>t.map(e=>e?.trim?.()).filter(Boolean).join(" "),tde=/^on[A-Z]/;function nb(...t){let e={};for(let r of t){for(let n in e){if(tde.test(n)&&typeof e[n]=="function"&&typeof r[n]=="function"){e[n]=Jue(e[n],r[n]);continue}if(n==="className"||n==="class"){e[n]=ede(e[n],r[n]);continue}if(n==="style"){e[n]=Object.assign({},e[n]??{},r[n]??{});continue}e[n]=r[n]!==void 0?r[n]:e[n]}for(let n in r)e[n]===void 0&&(e[n]=r[n])}return e}function sF(t,e){if(t!=null){if(typeof t=="function")return t(e);try{t.current=e}catch{throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}}}function rde(...t){const e=t.filter(n=>n!=null),r=new Map;return n=>(e.forEach(i=>{const o=sF(i,n);o&&r.set(i,o)}),()=>{e.forEach(i=>{const o=r.get(i);o&&typeof o=="function"?o():sF(i,null)}),r.clear()})}function wO(t){const e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}const Io=(...t)=>t.filter(Boolean).map(e=>e.trim()).join(" ");function nde(t){return t.default||t}const ds=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),Aa=t=>typeof t=="string",wN=t=>typeof t=="function";function ide(t){const e=E.version;return!Aa(e)||e.startsWith("18.")?t?.ref:t?.props?.ref}const SN=(...t)=>{const e=t.reduce((r,n)=>(n?.forEach(i=>r.add(i)),r),new Set([]));return Array.from(e)};function ode(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function Qg(t={}){const{name:e,strict:r=!0,hookName:n="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=t,a=E.createContext(s);a.displayName=e;function l(){const c=E.useContext(a);if(!c&&r){const u=new Error(o??ode(n,i));throw u.name="ContextError",Error.captureStackTrace?.(u,l),u}return c}return[a.Provider,l,a]}const[sde,OP]=Qg({name:"ChakraContext",strict:!0,providerName:"<ChakraProvider />"});function aF(t){const{value:e,children:r}=t;return h.jsxs(sde,{value:e,children:[!e._config.disableLayers&&h.jsx(oF,{styles:e.layers.atRule}),h.jsx(oF,{styles:e._global}),r]})}const ade=(t,e)=>{const r={},n={},i=Object.keys(t);for(const o of i)e(o)?n[o]=t[o]:r[o]=t[o];return[n,r]},Bg=(t,e)=>{const r=wN(e)?e:n=>e.includes(n);return ade(t,r)},lde=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function cde(t){return typeof t=="string"&&lde.has(t)}function ude(t,e,r){const{css:n,isValidProperty:i}=OP(),{children:o,...s}=t,a=E.useMemo(()=>{const[m,v]=Bg(s,w=>r(w,e.variantKeys)),[b,O]=Bg(v,e.variantKeys),[x,S]=Bg(O,i);return{forwardedProps:m,variantProps:b,styleProps:x,elementProps:S}},[e.variantKeys,r,s,i]),{css:l,...c}=a.styleProps,u=E.useMemo(()=>{const m={...a.variantProps};return e.variantKeys.includes("colorPalette")||(m.colorPalette=s.colorPalette),e.variantKeys.includes("orientation")||(m.orientation=s.orientation),e(m)},[e,a.variantProps,s.colorPalette,s.orientation]);return{styles:E.useMemo(()=>n(u,...dde(l),c),[n,u,l,c]),props:{...a.forwardedProps,...a.elementProps,children:o}}}const dde=t=>(Array.isArray(t)?t:[t]).filter(Boolean).flat(),hde=nde(cue),fde=hde,pde=t=>t!=="theme",gde=(t,e,r)=>{let n;if(e){const i=e.shouldForwardProp;n=t.__emotion_forwardProp&&i?o=>t.__emotion_forwardProp(o)&&i(o):i}return typeof n!="function"&&r&&(n=t.__emotion_forwardProp),n};let mde=typeof document<"u";const lF=({cache:t,serialized:e,isStringTag:r})=>{mN(t,e,r);const n=D9(()=>vN(t,e,r));if(!mde&&n!==void 0){let i=e.name,o=e.next;for(;o!==void 0;)i=Io(i,o.name),o=o.next;return h.jsx("style",{"data-emotion":Io(t.key,i),dangerouslySetInnerHTML:{__html:n},nonce:t.sheet.nonce})}return null},cF={path:["d"],text:["x","y"],circle:["cx","cy","r"],rect:["width","height","x","y","rx","ry"],ellipse:["cx","cy","rx","ry"],g:["transform"],stop:["offset","stopOpacity"]},vde=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),yde=(t,e={},r={})=>{if(vde(cF,t)){r.forwardProps||(r.forwardProps=[]);const c=cF[t];r.forwardProps=SN([...r.forwardProps,...c])}const n=t.__emotion_real===t,i=n&&t.__emotion_base||t;let o,s;r!==void 0&&(o=r.label,s=r.target);let a=[];const l=bN((c,u,p)=>{const{cva:m,isValidProperty:v}=OP(),b=e.__cva__?e:m(e),O=Ode(t.__emotion_cva,b),x=B=>(re,he)=>B.includes(re)?!0:!he?.includes(re)&&!v(re);!r.shouldForwardProp&&r.forwardProps&&(r.shouldForwardProp=x(r.forwardProps));const S=(B,re)=>{const he=typeof t=="string"&&t.charCodeAt(0)>96?fde:pde,ne=!re?.includes(B)&&!v(B);return he(B)&&ne},w=gde(t,r,n)||S,k=E.useMemo(()=>Object.assign({},r.defaultProps,wO(c)),[c]),{props:P,styles:_}=ude(k,O,w);let T="",R=[_],$=P;if(P.theme==null){$={};for(let B in P)$[B]=P[B];$.theme=E.useContext(ON)}typeof P.className=="string"?T=A9(u.registered,R,P.className):P.className!=null&&(T=Io(T,P.className));const A=yN(a.concat(R),u.registered,$);A.styles&&(T=Io(T,`${u.key}-${A.name}`)),s!==void 0&&(T=Io(T,s));const M=!w("as");let Q=M&&P.as||i,V={};for(let B in P)if(!(M&&B==="as")){if(cde(B)){const re=B.replace("html","").toLowerCase();V[re]=P[B];continue}w(B)&&(V[B]=P[B])}let q=T.trim();q?V.className=q:Reflect.deleteProperty(V,"className"),V.ref=p;const N=r.forwardAsChild||r.forwardProps?.includes("asChild");if(P.asChild&&!N){const B=E.isValidElement(P.children)?E.Children.only(P.children):E.Children.toArray(P.children).find(E.isValidElement);if(!B)throw new Error("[chakra-ui > factory] No valid child found");Q=B.type,V.children=null,Reflect.deleteProperty(V,"asChild"),V=nb(V,B.props),V.ref=rde(p,ide(B))}return V.as&&N?(V.as=void 0,h.jsxs(E.Fragment,{children:[h.jsx(lF,{cache:u,serialized:A,isStringTag:typeof Q=="string"}),h.jsx(Q,{asChild:!0,...V,children:h.jsx(P.as,{children:V.children})})]})):h.jsxs(E.Fragment,{children:[h.jsx(lF,{cache:u,serialized:A,isStringTag:typeof Q=="string"}),h.jsx(Q,{...V})]})});return l.displayName=o!==void 0?o:`chakra(${typeof i=="string"?i:i.displayName||i.name||"Component"})`,l.__emotion_real=l,l.__emotion_base=i,l.__emotion_forwardProp=r.shouldForwardProp,l.__emotion_cva=e,Object.defineProperty(l,"toString",{value(){return`.${s}`}}),l},sR=yde.bind(),aR=new Map,bde=new Proxy(sR,{apply(t,e,r){return sR(...r)},get(t,e){return aR.has(e)||aR.set(e,sR(e)),aR.get(e)}}),_r=bde,Ode=(t,e)=>t&&!e?t:!t&&e?e:t.merge(e),z=_r("div");z.displayName="Box";const V9=Object.freeze({}),F9=Object.freeze({});function xP(t){const{key:e,recipe:r}=t,n=OP();return E.useMemo(()=>{const i=r||(e!=null?n.getRecipe(e):{});return n.cva(structuredClone(i))},[e,r,n])}const xde=t=>t.charAt(0).toUpperCase()+t.slice(1);function Sl(t){const{key:e,recipe:r}=t,n=xde(e||r.className||"Component"),[i,o]=Qg({strict:!1,name:`${n}PropsContext`,providerName:`${n}PropsContext`});function s(c){const{unstyled:u,...p}=c,m=xP({key:e,recipe:p.recipe||r}),[v,b]=E.useMemo(()=>m.splitVariantProps(p),[m,p]);return{styles:u?V9:m(v),className:m.className,props:b}}const a=(c,u)=>{const p=_r(c,{},u),m=E.forwardRef((v,b)=>{const O=o(),x=E.useMemo(()=>nb(O,v),[v,O]),{styles:S,className:w,props:k}=s(x);return h.jsx(p,{...k,ref:b,css:[S,x.css],className:Io(w,x.className)})});return m.displayName=c.displayName||c.name,m};function l(){return i}return{withContext:a,PropsProvider:i,withPropsProvider:l,usePropsContext:o,useRecipeResult:s}}var wde=Object.defineProperty,Q9=t=>{throw TypeError(t)},Sde=(t,e,r)=>e in t?wde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ad=(t,e,r)=>Sde(t,typeof e!="symbol"?e+"":e,r),Cde=(t,e,r)=>e.has(t)||Q9("Cannot "+r),uF=(t,e,r)=>(Cde(t,e,"read from private field"),e.get(t)),kde=(t,e,r)=>e.has(t)?Q9("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r);function AS(t){return t==null?[]:Array.isArray(t)?t:[t]}var zg=t=>t[0],wP=t=>t[t.length-1],Pde=(t,e)=>t.indexOf(e)!==-1,ff=(t,...e)=>t.concat(e),wf=(t,...e)=>t.filter(r=>!e.includes(r)),Og=t=>Array.from(new Set(t)),lR=(t,e)=>{const r=new Set(e);return t.filter(n=>!r.has(n))},lm=(t,e)=>Pde(t,e)?wf(t,e):ff(t,e);function B9(t,e,r={}){const{step:n=1,loop:i=!0}=r,o=e+n,s=t.length,a=s-1;return e===-1?n>0?0:a:o<0?i?a:0:o>=s?i?0:e>s?s:e:o}function _de(t,e,r={}){return t[B9(t,e,r)]}function Tde(t,e,r={}){const{step:n=1,loop:i=!0}=r;return B9(t,e,{step:-n,loop:i})}function Ede(t,e,r={}){return t[Tde(t,e,r)]}function dF(t,e){return t.reduce(([r,n],i)=>(e(i)?r.push(i):n.push(i),[r,n]),[[],[]])}var hF=t=>t?.constructor.name==="Array",Rde=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Ks(t[r],e[r]))return!1;return!0},Ks=(t,e)=>{if(Object.is(t,e))return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(typeof t?.isEqual=="function"&&typeof e?.isEqual=="function")return t.isEqual(e);if(typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();if(hF(t)&&hF(e))return Rde(Array.from(t),Array.from(e));if(typeof t!="object"||typeof e!="object")return!1;const r=Object.keys(e??Object.create(null)),n=r.length;for(let i=0;i<n;i++)if(!Reflect.has(t,r[i]))return!1;for(let i=0;i<n;i++){const o=r[i];if(!Ks(t[o],e[o]))return!1}return!0},s0=t=>Array.isArray(t),Ide=t=>t===!0||t===!1,z9=t=>t!=null&&typeof t=="object",pf=t=>z9(t)&&!s0(t),NS=t=>typeof t=="string",kd=t=>typeof t=="function",jde=t=>t==null,ll=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),$de=t=>Object.prototype.toString.call(t),q9=Function.prototype.toString,Ade=q9.call(Object),Nde=t=>{if(!z9(t)||$de(t)!="[object Object]"||Lde(t))return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const r=ll(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&q9.call(r)==Ade},Mde=t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&"props"in t,Dde=t=>typeof t=="object"&&t!==null&&"__v_isVNode"in t,Lde=t=>Mde(t)||Dde(t),ww=(t,...e)=>(typeof t=="function"?t(...e):t)??void 0,fF=t=>t,Vde=t=>t(),Fde=()=>{},ib=(...t)=>(...e)=>{t.forEach(function(r){r?.(...e)})},W9=(()=>{let t=0;return()=>(t++,t.toString(36))})();function Kc(t,e,...r){if(t in e){const i=e[t];return kd(i)?i(...r):i}const n=new Error(`No matching key: ${JSON.stringify(t)} in ${JSON.stringify(Object.keys(e))}`);throw Error.captureStackTrace?.(n,Kc),n}var U9=(t,e)=>{try{return t()}catch(r){return r instanceof Error&&Error.captureStackTrace?.(r,U9),e?.()}},{floor:H9,abs:pF,round:SP,min:Qde,max:Bde,pow:zde,sign:qde}=Math,Gj=t=>Number.isNaN(t),uh=t=>Gj(t)?0:t,G9=(t,e)=>(t%e+e)%e,Wde=(t,e)=>(t%e+e)%e,Ude=(t,e)=>uh(t)>=e,Hde=(t,e)=>uh(t)<=e,Gde=(t,e,r)=>{const n=uh(t),i=e==null||n>=e,o=r==null||n<=r;return i&&o},Xde=(t,e,r)=>SP((uh(t)-e)/r)*r+e,Eo=(t,e,r)=>Qde(Bde(uh(t),e),r),Zde=(t,e,r)=>(uh(t)-e)/(r-e),Yde=(t,e,r,n)=>Eo(Xde(t*(r-e)+e,e,n),e,r),gF=(t,e)=>{let r=t,n=e.toString(),i=n.indexOf("."),o=i>=0?n.length-i:0;if(o>0){let s=zde(10,o);r=SP(r*s)/s}return r},cR=(t,e)=>typeof e=="number"?H9(t*e+.5)/e:SP(t),mF=(t,e,r,n)=>{const i=e!=null?Number(e):0,o=Number(r),s=(t-i)%n;let a=pF(s)*2>=n?t+qde(s)*(n-pF(s)):t-s;if(a=gF(a,n),!Gj(i)&&a<i)a=i;else if(!Gj(o)&&a>o){const l=H9((o-i)/n),c=i+l*n;a=l<=0||c<i?o:c}return gF(a,n)},On=(t,e=0,r=10)=>{const n=Math.pow(r,e);return SP(t*n)/n},vF=t=>{if(!Number.isFinite(t))return 0;let e=1,r=0;for(;Math.round(t*e)/e!==t;)e*=10,r+=1;return r},X9=(t,e,r)=>{let n=e==="+"?t+r:t-r;if(t%1!==0||r%1!==0){const i=10**Math.max(vF(t),vF(r));t=Math.round(t*i),r=Math.round(r*i),n=e==="+"?t+r:t-r,n/=i}return n},Kde=(t,e)=>X9(uh(t),"+",e),Jde=(t,e)=>X9(uh(t),"-",e),ba=t=>typeof t=="number"?`${t}px`:t;function qm(t){if(!Nde(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(n=>typeof n=="string"),r={};for(const n of e){const i=t[n];i!==void 0&&(r[n]=qm(i))}return r}function ehe(t,e=Object.is){let r={...t};const n=new Set,i=u=>(n.add(u),()=>n.delete(u)),o=()=>{n.forEach(u=>u())};return{subscribe:i,get:u=>r[u],set:(u,p)=>{e(r[u],p)||(r[u]=p,o())},update:u=>{let p=!1;for(const m in u){const v=u[m];v!==void 0&&!e(r[m],v)&&(r[m]=v,p=!0)}p&&o()},snapshot:()=>({...r})}}var Sw=()=>performance.now(),MS,the=class{constructor(t){this.onTick=t,ad(this,"frameId",null),ad(this,"pausedAtMs",null),ad(this,"context"),ad(this,"cancelFrame",()=>{this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null)}),ad(this,"setStartMs",e=>{this.context.startMs=e}),ad(this,"start",()=>{if(this.frameId!==null)return;const e=Sw();this.pausedAtMs!==null?(this.context.startMs+=e-this.pausedAtMs,this.pausedAtMs=null):this.context.startMs=e,this.frameId=requestAnimationFrame(uF(this,MS))}),ad(this,"pause",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=Sw())}),ad(this,"stop",()=>{this.frameId!==null&&(this.cancelFrame(),this.pausedAtMs=null)}),kde(this,MS,e=>{if(this.context.now=e,this.context.deltaMs=e-this.context.startMs,this.onTick(this.context)===!1){this.stop();return}this.frameId=requestAnimationFrame(uF(this,MS))}),this.context={now:0,startMs:Sw(),deltaMs:0}}get elapsedMs(){return this.pausedAtMs!==null?this.pausedAtMs-this.context.startMs:Sw()-this.context.startMs}};MS=new WeakMap;function uR(t,e){const r=new the(({deltaMs:n})=>{if(n>=e)return t(),!1});return r.start(),()=>r.stop()}function cm(...t){t.length===1?t[0]:t[1],t.length===2&&t[0]}function Z9(t,e){if(t==null)throw new Error(e())}function Y9(t,e,r){let n=[];for(const i of e)t[i]==null&&n.push(i);if(n.length>0)throw new Error(`[zag-js${r?` > ${r}`:""}] missing required props: ${n.join(", ")}`)}function rhe(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function Cn(t={}){const{name:e,strict:r=!0,hookName:n="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=t,a=E.createContext(s);a.displayName=e;function l(){const c=E.useContext(a);if(!c&&r){const u=new Error(o??rhe(n,i));throw u.name="ContextError",Error.captureStackTrace?.(u,l),u}return c}return[a.Provider,l,a]}const[Zrt,Cs]=Cn({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}});function nhe(t){if(!t)return;const e=t.selectionStart??0,r=t.selectionEnd??0;Math.abs(r-e)===0&&e===0&&t.setSelectionRange(t.value.length,t.value.length)}var yF=t=>Math.max(0,Math.min(1,t)),ihe=(t,e)=>t.map((r,n)=>t[(Math.max(e,0)+n)%t.length]),dR=(...t)=>e=>t.reduce((r,n)=>n(r),e),xg=()=>{},CP=t=>typeof t=="object"&&t!==null,K9=2147483647,st=t=>t?"":void 0,J9=t=>t?"true":void 0,ohe=1,she=9,ahe=11,Yi=t=>CP(t)&&t.nodeType===ohe&&typeof t.nodeName=="string",kP=t=>CP(t)&&t.nodeType===she,lhe=t=>CP(t)&&t===t.window,eU=t=>Yi(t)?t.localName||"":"#document";function che(t){return["html","body","#document"].includes(eU(t))}var uhe=t=>CP(t)&&t.nodeType!==void 0,jf=t=>uhe(t)&&t.nodeType===ahe&&"host"in t,dhe=t=>Yi(t)&&t.localName==="input",tU=t=>!!t?.matches("a[href]"),hhe=t=>Yi(t)?t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0:!1;function Pd(t){if(!t)return!1;const e=t.getRootNode();return qg(e)===t}var fhe=/(textarea|select)/;function CN(t){if(t==null||!Yi(t))return!1;try{return dhe(t)&&t.selectionStart!=null||fhe.test(t.localName)||t.isContentEditable||t.getAttribute("contenteditable")==="true"||t.getAttribute("contenteditable")===""}catch{return!1}}function ys(t,e){if(!t||!e||!Yi(t)||!Yi(e))return!1;const r=e.getRootNode?.();if(t===e||t.contains(e))return!0;if(r&&jf(r)){let n=e;for(;n;){if(t===n)return!0;n=n.parentNode||n.host}}return!1}function ks(t){return kP(t)?t:lhe(t)?t.document:t?.ownerDocument??document}function phe(t){return ks(t).documentElement}function hi(t){return jf(t)?hi(t.host):kP(t)?t.defaultView??window:Yi(t)?t.ownerDocument?.defaultView??window:window}function qg(t){let e=t.activeElement;for(;e?.shadowRoot;){const r=e.shadowRoot.activeElement;if(!r||r===e)break;e=r}return e}function ghe(t){if(eU(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jf(t)&&t.host||phe(t);return jf(e)?e.host:e}function kN(t){let e;try{if(e=t.getRootNode({composed:!0}),kP(e)||jf(e))return e}catch{}return t.ownerDocument??document}var hR=new WeakMap;function $f(t){return hR.has(t)||hR.set(t,hi(t).getComputedStyle(t)),hR.get(t)}var PN=new Set(["menu","listbox","dialog","grid","tree","region"]),mhe=t=>PN.has(t),rU=t=>t.getAttribute("aria-controls")?.split(" ")||[];function nU(t,e){const r=new Set,n=kN(t),i=o=>{const s=o.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const l=rU(a);for(const c of l){if(!c||r.has(c))continue;r.add(c);const u=n.getElementById(c);if(u){const p=u.getAttribute("role"),m=u.getAttribute("aria-modal")==="true";if(p&&mhe(p)&&!m&&(u===e||u.contains(e)||i(u)))return!0}}}return!1};return i(t)}function iU(t,e){const r=kN(t),n=new Set,i=o=>{const s=o.querySelectorAll("[aria-controls]");for(const a of s){if(a.getAttribute("aria-expanded")!=="true")continue;const l=rU(a);for(const c of l){if(!c||n.has(c))continue;n.add(c);const u=r.getElementById(c);if(u){const p=u.getAttribute("role"),m=u.getAttribute("aria-modal")==="true";p&&PN.has(p)&&!m&&(e(u),i(u))}}}};i(t)}function vhe(t){const e=new Set;return iU(t,r=>{t.contains(r)||e.add(r)}),Array.from(e)}function yhe(t){const e=t.getAttribute("role");return!!(e&&PN.has(e))}function bhe(t){return t.hasAttribute("aria-controls")&&t.getAttribute("aria-expanded")==="true"}function Ohe(t){return bhe(t)?!0:!!t.querySelector?.('[aria-controls][aria-expanded="true"]')}function xhe(t){if(!t.id)return!1;const e=kN(t),r=CSS.escape(t.id),n=`[aria-controls~="${r}"][aria-expanded="true"], [aria-controls="${r}"][aria-expanded="true"]`;return!!(e.querySelector(n)&&yhe(t))}var PP=()=>typeof document<"u";function whe(){return navigator.userAgentData?.platform??navigator.platform}function She(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:r})=>`${e}/${r}`).join(" "):navigator.userAgent}var _N=t=>PP()&&t.test(whe()),oU=t=>PP()&&t.test(She()),Che=t=>PP()&&t.test(navigator.vendor),bF=()=>PP()&&!!navigator.maxTouchPoints,khe=()=>_N(/^iPhone/i),Phe=()=>_N(/^iPad/i)||SO()&&navigator.maxTouchPoints>1,_P=()=>khe()||Phe(),_he=()=>SO()||_P(),SO=()=>_N(/^Mac/i),Wm=()=>_he()&&Che(/apple/i),The=()=>oU(/Firefox/i),Ehe=()=>oU(/Android/i);function Rhe(t){return t.composedPath?.()??t.nativeEvent?.composedPath?.()}function ti(t){return Rhe(t)?.[0]??t.target}function Xj(t){const e=t.currentTarget;if(!e||!e.matches("a[href], button[type='submit'], input[type='submit']"))return!1;const n=t.button===1,i=Ihe(t);return n||i}function OF(t){const e=t.currentTarget;if(!e)return!1;const r=e.localName;return t.altKey?r==="a"||r==="button"&&e.type==="submit"||r==="input"&&e.type==="submit":!1}function sU(t){return Dhe(t).isComposing||t.keyCode===229}function Ihe(t){return SO()?t.metaKey:t.ctrlKey}function jhe(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey}function $he(t){return t.pointerType===""&&t.isTrusted?!0:Ehe()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}var aU=t=>t.button===0,lU=t=>t.button===2||SO()&&t.ctrlKey&&t.button===0,Ahe=t=>t.ctrlKey||t.altKey||t.metaKey,Nhe=t=>"touches"in t&&t.touches.length>0,Mhe={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},xF={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function _C(t,e={}){const{dir:r="ltr",orientation:n="horizontal"}=e;let i=t.key;return i=Mhe[i]??i,r==="rtl"&&n==="horizontal"&&i in xF&&(i=xF[i]),i}function Dhe(t){return t.nativeEvent??t}function su(t,e="client"){const r=Nhe(t)?t.touches[0]||t.changedTouches[0]:t;return{x:r[`${e}X`],y:r[`${e}Y`]}}var hr=(t,e,r,n)=>{const i=typeof t=="function"?t():t;return i?.addEventListener(e,r,n),()=>{i?.removeEventListener(e,r,n)}};function cU(t,e){const{type:r="HTMLInputElement",property:n="value"}=e,i=hi(t)[r].prototype;return Object.getOwnPropertyDescriptor(i,n)??{}}function Lhe(t){if(t.localName==="input")return"HTMLInputElement";if(t.localName==="textarea")return"HTMLTextAreaElement";if(t.localName==="select")return"HTMLSelectElement"}function CO(t,e,r="value"){if(!t)return;const n=Lhe(t);n&&cU(t,{type:n,property:r}).set?.call(t,e),t.setAttribute(r,e)}function TN(t,e){if(!t)return;cU(t,{type:"HTMLInputElement",property:"checked"}).set?.call(t,e),e?t.setAttribute("checked",""):t.removeAttribute("checked")}function Vhe(t,e){const{value:r,bubbles:n=!0}=e;if(!t)return;const i=hi(t);t instanceof i.HTMLInputElement&&(CO(t,`${r}`),t.dispatchEvent(new i.Event("input",{bubbles:n})))}function uU(t,e){const{checked:r,bubbles:n=!0}=e;if(!t)return;const i=hi(t);t instanceof i.HTMLInputElement&&(TN(t,r),t.dispatchEvent(new i.Event("click",{bubbles:n})))}function Fhe(t){return Qhe(t)?t.form:t.closest("form")}function Qhe(t){return t.matches("textarea, input, select, button")}function Bhe(t,e){if(!t)return;const r=Fhe(t),n=i=>{i.defaultPrevented||e()};return r?.addEventListener("reset",n,{passive:!0}),()=>r?.removeEventListener("reset",n)}function zhe(t,e){const r=t?.closest("fieldset");if(!r)return;e(r.disabled);const n=hi(r),i=new n.MutationObserver(()=>e(r.disabled));return i.observe(r,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function kO(t,e){if(!t)return;const{onFieldsetDisabledChange:r,onFormReset:n}=e,i=[Bhe(t,n),zhe(t,r)];return()=>i.forEach(o=>o?.())}var dU=t=>Yi(t)&&t.tagName==="IFRAME",qhe=t=>!Number.isNaN(parseInt(t.getAttribute("tabindex")||"0",10)),Whe=t=>parseInt(t.getAttribute("tabindex")||"0",10)<0,EN="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",RN=(t,e=!1)=>{if(!t)return[];const r=Array.from(t.querySelectorAll(EN));(e==!0||e=="if-empty"&&r.length===0)&&Yi(t)&&Ld(t)&&r.unshift(t);const i=r.filter(Ld);return i.forEach((o,s)=>{if(dU(o)&&o.contentDocument){const a=o.contentDocument.body;i.splice(s,1,...RN(a))}}),i};function Ld(t){return!t||t.closest("[inert]")?!1:t.matches(EN)&&hhe(t)}function Um(t,e){if(!t)return[];const r=Array.from(t.querySelectorAll(EN)),n=r.filter(md);return e&&md(t)&&n.unshift(t),n.forEach((i,o)=>{if(dU(i)&&i.contentDocument){const s=i.contentDocument.body,a=Um(s);n.splice(o,1,...a)}}),!n.length&&e?r:n}function md(t){return t!=null&&t.tabIndex>0?!0:Ld(t)&&!Whe(t)}function hU(t,e){const r=Um(t,e),n=r[0]||null,i=r[r.length-1]||null;return[n,i]}function Uhe(t,e){const r=Um(t),n=t?.ownerDocument||document,i=e??qg(n);if(!i)return null;const o=r.indexOf(i);return r[o+1]||null}function vy(t){return t.tabIndex<0&&(/^(audio|video|details)$/.test(t.localName)||CN(t))&&!qhe(t)?0:t.tabIndex}function ob(t){const{root:e,getInitialEl:r,filter:n,enabled:i=!0}=t;if(!i)return;let o=null;if(o||(o=typeof r=="function"?r():r),o||(o=e?.querySelector("[data-autofocus],[autofocus]")),!o){const s=Um(e);o=n?s.filter(n)[0]:s[0]}return o||e||void 0}function Hhe(t){const e=t.currentTarget;if(!e)return!1;const[r,n]=hU(e);return!(Pd(r)&&t.shiftKey||Pd(n)&&!t.shiftKey||!r&&!n)}function PO(t){const e=new Set;function r(n){const i=globalThis.requestAnimationFrame(n);e.add(()=>globalThis.cancelAnimationFrame(i))}return r(()=>r(t)),function(){e.forEach(i=>i())}}function wt(t){let e;const r=globalThis.requestAnimationFrame(()=>{e=t()});return()=>{globalThis.cancelAnimationFrame(r),e?.()}}function Ghe(t,e,r){const n=wt(()=>{t.removeEventListener(e,i,!0),r()}),i=()=>{n(),r()};return t.addEventListener(e,i,{once:!0,capture:!0}),n}function Xhe(t,e){if(!t)return;const{attributes:r,callback:n}=e,i=t.ownerDocument.defaultView||window,o=new i.MutationObserver(s=>{for(const a of s)a.type==="attributes"&&a.attributeName&&r.includes(a.attributeName)&&n(a)});return o.observe(t,{attributes:!0,attributeFilter:r}),()=>o.disconnect()}function TP(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=typeof t=="function"?t():t;i.push(Xhe(o,e))})),()=>{i.forEach(o=>o?.())}}function Zhe(t,e){const{callback:r}=e;if(!t)return;const n=t.ownerDocument.defaultView||window,i=new n.MutationObserver(r);return i.observe(t,{childList:!0,subtree:!0}),()=>i.disconnect()}function Yhe(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=typeof t=="function"?t():t;i.push(Zhe(o,e))})),()=>{i.forEach(o=>o?.())}}function IN(t){const e=()=>{const r=hi(t);t.dispatchEvent(new r.MouseEvent("click"))};The()?Ghe(t,"keyup",e):queueMicrotask(e)}function TC(t){const e=ghe(t);return che(e)?ks(e).body:Yi(e)&&jN(e)?e:TC(e)}function fU(t,e=[]){const r=TC(t),n=r===t.ownerDocument.body,i=hi(r);return n?e.concat(i,i.visualViewport||[],jN(r)?r:[]):e.concat(r,fU(r,[]))}var Khe=/auto|scroll|overlay|hidden|clip/,Jhe=new Set(["inline","contents"]);function jN(t){const e=hi(t),{overflow:r,overflowX:n,overflowY:i,display:o}=e.getComputedStyle(t);return Khe.test(r+i+n)&&!Jhe.has(o)}function efe(t){return t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth}function EC(t,e){const{rootEl:r,...n}=e||{};!t||!r||!jN(r)||!efe(r)||t.scrollIntoView(n)}function pU(t,e){const{left:r,top:n,width:i,height:o}=e.getBoundingClientRect(),s={x:t.x-r,y:t.y-n},a={x:yF(s.x/i),y:yF(s.y/o)};function l(c={}){const{dir:u="ltr",orientation:p="horizontal",inverted:m}=c,v=typeof m=="object"?m.x:m,b=typeof m=="object"?m.y:m;return p==="horizontal"?u==="rtl"||v?1-a.x:a.x:b?1-a.y:a.y}return{offset:s,percent:a,getPercentValue:l}}function tfe(t,e){const r=t.body,n="pointerLockElement"in t||"mozPointerLockElement"in t,i=()=>!!t.pointerLockElement;function o(){}function s(l){i(),console.error("PointerLock error occurred:",l),t.exitPointerLock()}if(!n)return;try{r.requestPointerLock()}catch{}const a=[hr(t,"pointerlockchange",o,!1),hr(t,"pointerlockerror",s,!1)];return()=>{a.forEach(l=>l()),t.exitPointerLock()}}var wg="default",Zj="",DS=new WeakMap;function rfe(t={}){const{target:e,doc:r}=t,n=r??document,i=n.documentElement;return _P()?(wg==="default"&&(Zj=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),wg="disabled"):e&&(DS.set(e,e.style.userSelect),e.style.userSelect="none"),()=>nfe({target:e,doc:n})}function nfe(t={}){const{target:e,doc:r}=t,i=(r??document).documentElement;if(_P()){if(wg!=="disabled")return;wg="restoring",setTimeout(()=>{PO(()=>{wg==="restoring"&&(i.style.webkitUserSelect==="none"&&(i.style.webkitUserSelect=Zj||""),Zj="",wg="default")})},300)}else if(e&&DS.has(e)){const o=DS.get(e);e.style.userSelect==="none"&&(e.style.userSelect=o??""),e.getAttribute("style")===""&&e.removeAttribute("style"),DS.delete(e)}}function gU(t={}){const{defer:e,target:r,...n}=t,i=e?wt:s=>s(),o=[];return o.push(i(()=>{const s=typeof r=="function"?r():r;o.push(rfe({...n,target:s}))})),()=>{o.forEach(s=>s?.())}}function mU(t,e){const{onPointerMove:r,onPointerUp:n}=e,i=a=>{const l=su(a),c=Math.sqrt(l.x**2+l.y**2),u=a.pointerType==="touch"?10:5;if(!(c<u)){if(a.pointerType==="mouse"&&a.button===0){o(a);return}r({point:l,event:a})}},o=a=>{const l=su(a);n({point:l,event:a})},s=[hr(t,"pointermove",i,!1),hr(t,"pointerup",o,!1),hr(t,"pointercancel",o,!1),hr(t,"contextmenu",o,!1),gU({doc:t})];return()=>{s.forEach(a=>a())}}function vU(t){const{pointerNode:e,keyboardNode:r=e,onPress:n,onPressStart:i,onPressEnd:o,isValidKey:s=w=>w.key==="Enter"}=t;if(!e)return xg;const a=hi(e);let l=xg,c=xg,u=xg;const p=w=>({point:su(w),event:w});function m(w){i?.(p(w))}function v(w){o?.(p(w))}const O=hr(e,"pointerdown",w=>{c();const P=hr(a,"pointerup",T=>{const R=ti(T);ys(e,R)?n?.(p(T)):o?.(p(T))},{passive:!n,once:!0}),_=hr(a,"pointercancel",v,{passive:!o,once:!0});c=dR(P,_),Pd(r)&&w.pointerType==="mouse"&&w.preventDefault(),m(w)},{passive:!i}),x=hr(r,"focus",S);l=dR(O,x);function S(){const w=T=>{if(!s(T))return;const R=A=>{if(!s(A))return;const M=new a.PointerEvent("pointerup"),Q=p(M);n?.(Q),o?.(Q)};c(),c=hr(r,"keyup",R);const $=new a.PointerEvent("pointerdown");m($)},k=()=>{const T=new a.PointerEvent("pointercancel");v(T)},P=hr(r,"keydown",w),_=hr(r,"blur",k);u=dR(P,_)}return()=>{l(),c(),u()}}function ife(t,e={}){const{triggerElement:r,onFocus:n,onFocusEnter:i}=e,o=t?.ownerDocument||document,s=o.body;function a(l){if(l.key!=="Tab")return;let c=null;const[u,p]=hU(t,!0),m=Uhe(s,r),v=!u&&!p;l.shiftKey&&Pd(m)?(i?.(),c=p):l.shiftKey&&(Pd(u)||v)?c=r:!l.shiftKey&&Pd(r)?(i?.(),c=u):!l.shiftKey&&(Pd(p)||v)&&(c=m),c&&(l.preventDefault(),typeof n=="function"?n(c):c.focus())}return hr(o,"keydown",a,!0)}function ofe(t,e){const{defer:r,triggerElement:n,...i}=e,o=r?wt:a=>a(),s=[];return s.push(o(()=>{const a=typeof t=="function"?t():t,l=typeof n=="function"?n():n;s.push(ife(a,{triggerElement:l,...i}))})),()=>{s.forEach(a=>a?.())}}function sb(t,e){return Array.from(t?.querySelectorAll(e)??[])}function Hm(t,e){return t?.querySelector(e)??null}var $N=t=>t.id;function yU(t,e,r=$N){return t.find(n=>r(n)===e)}function AN(t,e,r=$N){const n=yU(t,e,r);return n?t.indexOf(n):-1}function bU(t,e,r=!0){let n=AN(t,e);return n=r?(n+1)%t.length:Math.min(n+1,t.length-1),t[n]}function OU(t,e,r=!0){let n=AN(t,e);return n===-1?r?t[t.length-1]:null:(n=r?(n-1+t.length)%t.length:Math.max(0,n-1),t[n])}function sfe(t,e){const{onEntry:r,measure:n,box:i="border-box"}=e,o=(Array.isArray(t)?t:[t]).filter(Yi),s=hi(o[0]),a=c=>{const u=o.map(p=>n(p));r({rects:u,entries:c})};a([]);const l=new s.ResizeObserver(a);return o.forEach(c=>l.observe(c,{box:i})),()=>l.disconnect()}var afe=t=>t.split("").map(e=>{const r=e.charCodeAt(0);return r>0&&r<128?e:r>=128&&r<=255?`/x${r.toString(16)}`.replace("/","\\"):""}).join("").trim(),lfe=t=>afe(t.dataset?.valuetext??t.textContent??""),cfe=(t,e)=>t.trim().toLowerCase().startsWith(e.toLowerCase());function ufe(t,e,r,n=$N){const i=r?AN(t,r,n):-1;let o=r?ihe(t,i):t;return e.length===1&&(o=o.filter(a=>n(a)!==r)),o.find(a=>cfe(lfe(a),e))}function dfe(t,e,r){const n=t.getAttribute(e),i=n!=null;return t.setAttribute(e,r),()=>{i?t.setAttribute(e,n):t.removeAttribute(e)}}function ab(t,e){if(!t)return xg;const r=Object.keys(e).reduce((n,i)=>(n[i]=t.style.getPropertyValue(i),n),{});return Object.assign(t.style,e),()=>{Object.assign(t.style,r),t.style.length===0&&t.removeAttribute("style")}}function hfe(t,e,r){if(!t)return xg;const n=t.style.getPropertyValue(e);return t.style.setProperty(e,r),()=>{t.style.setProperty(e,n),t.style.length===0&&t.removeAttribute("style")}}function ffe(t,e){const{state:r,activeId:n,key:i,timeout:o=350,itemToId:s}=e,a=r.keysSoFar+i,c=a.length>1&&Array.from(a).every(b=>b===a[0])?a[0]:a;let u=t.slice();const p=ufe(u,c,n,s);function m(){clearTimeout(r.timer),r.timer=-1}function v(b){r.keysSoFar=b,m(),b!==""&&(r.timer=+setTimeout(()=>{v(""),m()},o))}return v(a),p}var lb=Object.assign(ffe,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:pfe});function pfe(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey}var xU={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function gfe(t,e,r){const{signal:n}=e;return[new Promise((s,a)=>{const l=setTimeout(()=>{a(new Error(`Timeout of ${r}ms exceeded`))},r);n.addEventListener("abort",()=>{clearTimeout(l),a(new Error("Promise aborted"))}),t.then(c=>{n.aborted||(clearTimeout(l),s(c))}).catch(c=>{n.aborted||(clearTimeout(l),a(c))})}),()=>e.abort()]}function mfe(t,e){const{timeout:r,rootNode:n}=e,i=hi(n),o=ks(n),s=new i.AbortController;return gfe(new Promise(a=>{const l=t();if(l){a(l);return}const c=new i.MutationObserver(()=>{const u=t();u&&u.isConnected&&(c.disconnect(),a(u))});c.observe(o.body,{childList:!0,subtree:!0})}),s,r)}var vfe=(...t)=>t.map(e=>e?.trim?.()).filter(Boolean).join(" "),yfe=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,wF=t=>{const e={};let r;for(;r=yfe.exec(t);)e[r[1]]=r[2];return e},bfe=(t,e)=>{if(NS(t)){if(NS(e))return`${t};${e}`;t=wF(t)}else NS(e)&&(e=wF(e));return Object.assign({},t??{},e??{})};function Ae(...t){let e={};for(let r of t){if(!r)continue;for(let i in e){if(i.startsWith("on")&&typeof e[i]=="function"&&typeof r[i]=="function"){e[i]=ib(r[i],e[i]);continue}if(i==="className"||i==="class"){e[i]=vfe(e[i],r[i]);continue}if(i==="style"){e[i]=bfe(e[i],r[i]);continue}e[i]=r[i]!==void 0?r[i]:e[i]}for(let i in r)e[i]===void 0&&(e[i]=r[i]);const n=Object.getOwnPropertySymbols(r);for(let i of n)e[i]=r[i]}return e}function SF(t,e,r){let n=[],i;return o=>{const s=t(o);return(s.length!==n.length||s.some((l,c)=>!Ks(n[c],l)))&&(n=s,i=e(s,o)),i}}function Cl(){return{and:(...t)=>function(r){return t.every(n=>r.guard(n))},or:(...t)=>function(r){return t.some(n=>r.guard(n))},not:t=>function(r){return!r.guard(t)}}}function NN(){return{guards:Cl(),createMachine:t=>t,choose:t=>function({choose:r}){return r(t)?.actions}}}var lg=(t=>(t.NotStarted="Not Started",t.Started="Started",t.Stopped="Stopped",t))(lg||{}),fR="__init__";function Ofe(t){const e=()=>t.getRootNode?.()??document,r=()=>ks(e());return{...t,getRootNode:e,getDoc:r,getWin:()=>r().defaultView??window,getActiveElement:()=>qg(e()),isActiveElement:Pd,getById:s=>e().getElementById(s)}}function Eu(...t){return e=>{const r=[];for(const n of t)if(typeof n=="function"){const i=n(e);typeof i=="function"&&r.push(i)}else n&&(n.current=e);if(r.length)return()=>{for(const n of r)n()}}}function xfe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const pR=t=>{const e=E.memo(E.forwardRef((r,n)=>{const{asChild:i,children:o,...s}=r;if(!i)return E.createElement(t,{...s,ref:n},o);if(!E.isValidElement(o))return null;const a=E.Children.only(o),l=xfe(a);return E.cloneElement(a,{...Ae(s,a.props),ref:n?Eu(n,l):l})}));return e.displayName=t.displayName||t.name,e},wfe=()=>{const t=new Map;return new Proxy(pR,{apply(e,r,n){return pR(n[0])},get(e,r){const n=r;return t.has(n)||t.set(n,pR(n)),t.get(n)}})},Ue=wfe(),[Yrt,Va]=Cn({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),{withContext:Sfe}=Sl({key:"heading"}),Cfe=Sfe("h2"),Nn=()=>(t,e)=>e.reduce((r,n)=>{const[i,o]=r,s=n;return o[s]!==void 0&&(i[s]=o[s]),delete o[s],[i,o]},[{},{...t}]),Cc=t=>Nn()(t,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function kfe(t){return new Proxy({},{get(e,r){return r==="style"?n=>t({style:n}).style:t}})}var xt=()=>t=>Array.from(new Set(t));function Pfe(t,e){const{state:r,send:n,context:i}=t,o=r.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:o,setNode(s){s&&n({type:"NODE.SET",node:s})},unmount(){n({type:"UNMOUNT"})}}}var _fe={props({props:t}){return{...t,present:!!t.present}},initialState({prop:t}){return t("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:t}){return{unmountAnimationName:t(()=>({defaultValue:null})),prevAnimationName:t(()=>({defaultValue:null})),present:t(()=>({defaultValue:!1})),initial:t(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:t,prop:e,send:r}){t([()=>e("present")],()=>{r({type:"PRESENCE.CHANGED"})})},on:{"NODE.SET":{actions:["setupNode"]},"PRESENCE.CHANGED":{actions:["setInitial","syncPresence"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:t})=>{t.get("initial")||queueMicrotask(()=>{t.set("initial",!0)})},clearInitial:({context:t})=>{t.set("initial",!1)},invokeOnExitComplete:({prop:t})=>{t("onExitComplete")?.()},setupNode:({refs:t,event:e})=>{t.get("node")!==e.node&&(t.set("node",e.node),t.set("styles",$f(e.node)))},cleanupNode:({refs:t})=>{t.set("node",null),t.set("styles",null)},syncPresence:({context:t,refs:e,send:r,prop:n})=>{const i=n("present");if(i)return r({type:"MOUNT",src:"presence.changed"});const o=e.get("node");if(!i&&o?.ownerDocument.visibilityState==="hidden")return r({type:"UNMOUNT",src:"visibilitychange"});wt(()=>{const s=Cw(e.get("styles"));t.set("unmountAnimationName",s),s==="none"||s===t.get("prevAnimationName")||e.get("styles")?.display==="none"||e.get("styles")?.animationDuration==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:t,refs:e})=>{wt(()=>{t.set("prevAnimationName",Cw(e.get("styles")))})},clearPrevAnimationName:({context:t})=>{t.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:t,refs:e,send:r,prop:n})=>{const i=e.get("node");if(!i)return;const o=l=>{(l.composedPath?.()?.[0]??l.target)===i&&t.set("prevAnimationName",Cw(e.get("styles")))},s=l=>{const c=Cw(e.get("styles"));ti(l)===i&&c===t.get("unmountAnimationName")&&!n("present")&&r({type:"UNMOUNT",src:"animationend"})};i.addEventListener("animationstart",o),i.addEventListener("animationcancel",s),i.addEventListener("animationend",s);const a=ab(i,{animationFillMode:"forwards"});return()=>{i.removeEventListener("animationstart",o),i.removeEventListener("animationcancel",s),i.removeEventListener("animationend",s),PO(()=>a())}}}}};function Cw(t){return t?.animationName||"none"}xt()(["onExitComplete","present","immediate"]);var ep=k9();const wU=ch(ep),Tfe=mP({__proto__:null,default:wU},[ep]);var SU=typeof globalThis.document<"u"?E.useLayoutEffect:E.useEffect;function RC(t){const e=t().value??t().defaultValue,r=t().isEqual??Object.is,[n]=E.useState(e),[i,o]=E.useState(n),s=t().value!==void 0,a=E.useRef(i);a.current=s?t().value:i;const l=E.useRef(a.current);SU(()=>{l.current=a.current},[i,t().value]);const c=p=>{const m=l.current,v=kd(p)?p(m):p;t().debug&&console.log(`[bindable > ${t().debug}] setValue`,{next:v,prev:m}),s||o(v),r(v,m)||t().onChange?.(v,m)};function u(){return s?t().value:i}return{initial:n,ref:a,get:u,set(p){(t().sync?ep.flushSync:Vde)(()=>c(p))},invoke(p,m){t().onChange?.(p,m)},hash(p){return t().hash?.(p)??String(p)}}}RC.cleanup=t=>{E.useEffect(()=>t,[])};RC.ref=t=>{const e=E.useRef(t);return{get:()=>e.current,set:r=>{e.current=r}}};function Efe(t){const e=E.useRef(t);return{get(r){return e.current[r]},set(r,n){e.current[r]=n}}}var Rfe=(t,e)=>{const r=E.useRef(!1),n=E.useRef(!1);E.useEffect(()=>{if(r.current&&n.current)return e();n.current=!0},[...(t??[]).map(i=>typeof i=="function"?i():i)]),E.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[])};function Ps(t,e={}){const r=E.useMemo(()=>{const{id:Q,ids:V,getRootNode:q}=e;return Ofe({id:Q,ids:V,getRootNode:q})},[e]),n=(...Q)=>{t.debug&&console.log(...Q)},i=t.props?.({props:qm(e),scope:r})??e,o=Ife(i),s=t.context?.({prop:o,bindable:RC,scope:r,flush:CF,getContext(){return l},getComputed(){return _},getRefs(){return O},getEvent(){return v()}}),a=CU(s),l={get(Q){return a.current?.[Q].ref.current},set(Q,V){a.current?.[Q].set(V)},initial(Q){return a.current?.[Q].initial},hash(Q){const V=a.current?.[Q].get();return a.current?.[Q].hash(V)}},c=E.useRef(new Map),u=E.useRef(null),p=E.useRef(null),m=E.useRef({type:""}),v=()=>({...m.current,current(){return m.current},previous(){return p.current}}),b=()=>({...T,matches(...Q){return Q.includes(T.ref.current)},hasTag(Q){return!!t.states[T.ref.current]?.tags?.includes(Q)}}),O=Efe(t.refs?.({prop:o,context:l})??{}),x=()=>({state:b(),context:l,event:v(),prop:o,send:M,action:S,guard:w,track:Rfe,refs:O,computed:_,flush:CF,scope:r,choose:P}),S=Q=>{const V=kd(Q)?Q(x()):Q;if(!V)return;const q=V.map(N=>{const B=t.implementations?.actions?.[N];return B||cm(`[zag-js] No implementation found for action "${JSON.stringify(N)}"`),B});for(const N of q)N?.(x())},w=Q=>kd(Q)?Q(x()):t.implementations?.guards?.[Q](x()),k=Q=>{const V=kd(Q)?Q(x()):Q;if(!V)return;const q=V.map(B=>{const re=t.implementations?.effects?.[B];return re||cm(`[zag-js] No implementation found for effect "${JSON.stringify(B)}"`),re}),N=[];for(const B of q){const re=B?.(x());re&&N.push(re)}return()=>N.forEach(B=>B?.())},P=Q=>AS(Q).find(V=>{let q=!V.guard;return NS(V.guard)?q=!!w(V.guard):kd(V.guard)&&(q=V.guard(x())),q}),_=Q=>{Z9(t.computed,()=>"[zag-js] No computed object found on machine");const V=t.computed[Q];return V({context:l,event:v(),prop:o,refs:O,scope:r,computed:_})},T=RC(()=>({defaultValue:t.initialState({prop:o}),onChange(Q,V){V&&(c.current.get(V)?.(),c.current.delete(V)),V&&S(t.states[V]?.exit),S(u.current?.actions);const q=k(t.states[Q]?.effects);if(q&&c.current.set(Q,q),V===fR){S(t.entry);const N=k(t.effects);N&&c.current.set(fR,N)}S(t.states[Q]?.entry)}})),R=E.useRef(void 0),$=E.useRef(lg.NotStarted);SU(()=>{queueMicrotask(()=>{const q=$.current===lg.Started;$.current=lg.Started,n(q?"rehydrating...":"initializing...");const N=R.current??T.initial;T.invoke(N,q?T.get():fR)});const Q=c.current,V=T.ref.current;return()=>{n("unmounting..."),R.current=V,$.current=lg.Stopped,Q.forEach(q=>q?.()),c.current=new Map,u.current=null,queueMicrotask(()=>{S(t.exit)})}},[]);const A=()=>"ref"in T?T.ref.current:T.get(),M=Q=>{queueMicrotask(()=>{if($.current!==lg.Started)return;p.current=m.current,m.current=Q;let V=A();const q=t.states[V].on?.[Q.type]??t.on?.[Q.type],N=P(q);if(!N)return;u.current=N;const B=N.target??V;n("transition",Q.type,N.target||V,`(${N.actions})`);const re=B!==V;re?ep.flushSync(()=>T.set(B)):N.reenter&&!re?T.invoke(V,V):S(N.actions??[])})};return t.watch?.(x()),{state:b(),send:M,context:l,prop:o,scope:r,refs:O,computed:_,event:v(),getStatus:()=>$.current}}function CU(t){const e=E.useRef(t);return e.current=t,e}function Ife(t){const e=CU(t);return function(n){return e.current[n]}}function CF(t){queueMicrotask(()=>{ep.flushSync(()=>t())})}var oa=kfe(t=>t);function kU(t,e={}){const{sync:r=!1}=e,n=jfe(t);return E.useCallback((...i)=>r?queueMicrotask(()=>n.current?.(...i)):n.current?.(...i),[r,n])}function jfe(t){const e=E.useRef(t);return e.current=t,e}const Fa=(t={})=>{const{lazyMount:e,unmountOnExit:r,present:n,skipAnimationOnMount:i=!1,...o}=t,s=E.useRef(!1),a={...o,present:n,onExitComplete:kU(t.onExitComplete)},l=Ps(_fe,a),c=Pfe(l);c.present&&(s.current=!0);const u=!c.present&&!s.current&&e||r&&!c.present&&s.current,p=()=>({"data-state":c.skip&&i?void 0:n?"open":"closed",hidden:!c.present});return{ref:c.setNode,getPresenceProps:p,present:c.present,unmounted:u}},[kl,sa]=Cn({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),kw=_r("span"),{withContext:$fe}=Sl({key:"text"}),Y=$fe("p");function kF(t,e=[]){const r=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return E.useInsertionEffect(()=>{r.current=t}),E.useCallback((...n)=>r.current?.(...n),e)}function MN(t={}){const e=kF(t.onOpen),r=kF(t.onClose),[n,i]=E.useState(t.defaultOpen||!1),o=t.open!==void 0?t.open:n,s=t.open!==void 0,a=E.useCallback(()=>{s||i(!1),r?.()},[s,r]),l=E.useCallback(()=>{s||i(!0),e?.()},[s,e]),c=E.useCallback(()=>{o?a():l()},[o,l,a]);return{open:o,onOpen:l,onClose:a,onToggle:c,setOpen:i}}const[PU,EP]=Cn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"<AccordionProvider />"}),[Afe]=Cn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItemProvider />"}),Nfe=t=>Nn()(t,["collapsedHeight","collapsedWidth","defaultOpen","disabled","id","ids","lazyMount","onExitComplete","onOpenChange","open","unmountOnExit"]);var Ct=(t,e=[])=>({parts:(...r)=>{if(Mfe(e))return Ct(t,r);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...r)=>Ct(t,[...e,...r]),omit:(...r)=>Ct(t,e.filter(n=>!r.includes(n))),rename:r=>Ct(r,e),keys:()=>e,build:()=>[...new Set(e)].reduce((r,n)=>Object.assign(r,{[n]:{selector:[`&[data-scope="${zp(t)}"][data-part="${zp(n)}"]`,`& [data-scope="${zp(t)}"][data-part="${zp(n)}"]`].join(", "),attrs:{"data-scope":zp(t),"data-part":zp(n)}}}),{})}),zp=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Mfe=t=>t.length===0,_U=Ct("collapsible").parts("root","trigger","content","indicator"),Pw=_U.build(),Dfe=t=>t.ids?.root??`collapsible:${t.id}`,Yj=t=>t.ids?.content??`collapsible:${t.id}:content`,Lfe=t=>t.ids?.trigger??`collapsible:${t.id}:trigger`,yy=t=>t.getById(Yj(t));function Vfe(t,e){const{state:r,send:n,context:i,scope:o,prop:s}=t,a=r.matches("open")||r.matches("closing"),l=r.matches("open"),c=r.matches("closed"),{width:u,height:p}=i.get("size"),m=!!s("disabled"),v=s("collapsedHeight"),b=s("collapsedWidth"),O=v!=null,x=b!=null,S=O||x,w=!i.get("initial")&&l,k="ltr";return{disabled:m,visible:a,open:l,measureSize(){n({type:"size.measure"})},setOpen(P){r.matches("open")!==P&&n({type:P?"open":"close"})},getRootProps(){return e.element({...Pw.root.attrs,"data-state":l?"open":"closed",dir:k,id:Dfe(o)})},getContentProps(){return e.element({...Pw.content.attrs,id:Yj(o),"data-collapsible":"","data-state":w?void 0:l?"open":"closed","data-disabled":st(m),"data-has-collapsed-size":st(S),hidden:!a&&!S,style:{"--height":ba(p),"--width":ba(u),"--collapsed-height":ba(v),"--collapsed-width":ba(b),...c&&O&&{overflow:"hidden",minHeight:ba(v),maxHeight:ba(v)},...c&&x&&{overflow:"hidden",minWidth:ba(b),maxWidth:ba(b)}}})},getTriggerProps(){return e.element({...Pw.trigger.attrs,id:Lfe(o),dir:k,type:"button","data-state":l?"open":"closed","data-disabled":st(m),"aria-controls":Yj(o),"aria-expanded":a||!1,onClick(P){P.defaultPrevented||m||n({type:l?"close":"open"})}})},getIndicatorProps(){return e.element({...Pw.indicator.attrs,dir:k,"data-state":l?"open":"closed","data-disabled":st(m)})}}}var Ffe={initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({bindable:t}){return{size:t(()=>({defaultValue:{height:0,width:0},sync:!0})),initial:t(()=>({defaultValue:!1}))}},refs(){return{cleanup:void 0,stylesRef:void 0}},watch({track:t,prop:e,action:r}){t([()=>e("open")],()=>{r(["setInitial","computeSize","toggleVisibility"])})},exit:["clearInitial","cleanupNode"],states:{closed:{effects:["trackTabbableElements"],on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","computeSize","invokeOnOpen"]}]}},closing:{effects:["trackExitAnimation"],on:{"controlled.close":{target:"closed"},"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","invokeOnOpen"]}],close:[{guard:"isOpenControlled",actions:["invokeOnExitComplete"]},{target:"closed",actions:["setInitial","computeSize","invokeOnExitComplete"]}],"animation.end":{target:"closed",actions:["invokeOnExitComplete","clearInitial"]}}},open:{effects:["trackEnterAnimation"],on:{"controlled.close":{target:"closing"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closing",actions:["setInitial","computeSize","invokeOnClose"]}],"size.measure":{actions:["measureSize"]},"animation.end":{actions:["clearInitial"]}}}},implementations:{guards:{isOpenControlled:({prop:t})=>t("open")!=null},effects:{trackEnterAnimation:({send:t,scope:e})=>{let r;const n=wt(()=>{const i=yy(e);if(!i)return;const o=$f(i).animationName;if(!o||o==="none"){t({type:"animation.end"});return}const a=l=>{ti(l)===i&&t({type:"animation.end"})};i.addEventListener("animationend",a),r=()=>{i.removeEventListener("animationend",a)}});return()=>{n(),r?.()}},trackExitAnimation:({send:t,scope:e})=>{let r;const n=wt(()=>{const i=yy(e);if(!i)return;const o=$f(i).animationName;if(!o||o==="none"){t({type:"animation.end"});return}const a=c=>{ti(c)===i&&t({type:"animation.end"})};i.addEventListener("animationend",a);const l=ab(i,{animationFillMode:"forwards"});r=()=>{i.removeEventListener("animationend",a),PO(()=>l())}});return()=>{n(),r?.()}},trackTabbableElements:({scope:t,prop:e})=>{if(!e("collapsedHeight")&&!e("collapsedWidth"))return;const r=yy(t);if(!r)return;const n=()=>{const a=Um(r).map(l=>dfe(l,"inert",""));return()=>{a.forEach(l=>l())}};let i=n();const o=Yhe(r,{callback(){i(),i=n()}});return()=>{i(),o()}}},actions:{setInitial:({context:t,flush:e})=>{e(()=>{t.set("initial",!0)})},clearInitial:({context:t})=>{t.set("initial",!1)},cleanupNode:({refs:t})=>{t.set("stylesRef",null)},measureSize:({context:t,scope:e})=>{const r=yy(e);if(!r)return;const{height:n,width:i}=r.getBoundingClientRect();t.set("size",{height:n,width:i})},computeSize:({refs:t,scope:e,context:r})=>{t.get("cleanup")?.();const n=wt(()=>{const i=yy(e);if(!i)return;const o=i.hidden;i.style.animationName="none",i.style.animationDuration="0s",i.hidden=!1;const s=i.getBoundingClientRect();r.set("size",{height:s.height,width:s.width}),r.get("initial")&&(i.style.animationName="",i.style.animationDuration=""),i.hidden=o});t.set("cleanup",n)},invokeOnOpen:({prop:t})=>{t("onOpenChange")?.({open:!0})},invokeOnClose:({prop:t})=>{t("onOpenChange")?.({open:!1})},invokeOnExitComplete:({prop:t})=>{t("onExitComplete")?.()},toggleVisibility:({prop:t,send:e})=>{e({type:t("open")?"controlled.open":"controlled.close"})}}}};xt()(["dir","disabled","getRootNode","id","ids","collapsedHeight","collapsedWidth","onExitComplete","onOpenChange","defaultOpen","open"]);const Qfe=(t={})=>{const{lazyMount:e,unmountOnExit:r,...n}=t,i=E.useId(),o=E.useRef(!1),{dir:s}=Va(),{getRootNode:a}=Cs(),l={id:i,dir:s,getRootNode:a,...n},c=Ps(Ffe,l),u=Vfe(c,oa);u.visible&&(o.current=!0);const p=!u.visible&&!o.current&&e||r&&!u.visible&&o.current;return{...u,isUnmounted:p}},[Bfe,TU]=Cn({name:"CollapsibleContext",hookName:"useCollapsibleContext",providerName:"<CollapsibleProvider />"}),EU=E.forwardRef((t,e)=>{const[r,n]=Nfe(t),i=Qfe(r),o=Ae(i.getRootProps(),n);return h.jsx(Bfe,{value:i,children:h.jsx(Ue.div,{...o,ref:e})})});EU.displayName="CollapsibleRoot";var zfe=Object.defineProperty,qfe=(t,e,r)=>e in t?zfe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,DN=(t,e,r)=>qfe(t,e+"",r),Wfe=(t,e)=>{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0},LN=class{toHexInt(){return this.toFormat("rgba").toHexInt()}getChannelValue(t){if(t in this)return this[t];throw new Error("Unsupported color channel: "+t)}getChannelValuePercent(t,e){const r=e??this.getChannelValue(t),{minValue:n,maxValue:i}=this.getChannelRange(t);return Zde(r,n,i)}getChannelPercentValue(t,e){const{minValue:r,maxValue:n,step:i}=this.getChannelRange(t),o=Yde(e,r,n,i);return mF(o,r,n,i)}withChannelValue(t,e){const{minValue:r,maxValue:n}=this.getChannelRange(t);if(t in this){let i=this.clone();return i[t]=Eo(e,r,n),i}throw new Error("Unsupported color channel: "+t)}getColorAxes(t){let{xChannel:e,yChannel:r}=t,n=e||this.getChannels().find(s=>s!==r),i=r||this.getChannels().find(s=>s!==n),o=this.getChannels().find(s=>s!==n&&s!==i);return{xChannel:n,yChannel:i,zChannel:o}}incrementChannel(t,e){const{minValue:r,maxValue:n,step:i}=this.getChannelRange(t),o=mF(Eo(this.getChannelValue(t)+e,r,n),r,n,i);return this.withChannelValue(t,o)}decrementChannel(t,e){return this.incrementChannel(t,-e)}isEqual(t){return Wfe(this.toJSON(),t.toJSON())&&this.getChannelValue("alpha")===t.getChannelValue("alpha")}},Ufe=/^#[\da-f]+$/i,Hfe=/^rgba?\((.*)\)$/,Gfe=/[^#]/gi,RU=class LS extends LN{constructor(e,r,n,i){super(),this.red=e,this.green=r,this.blue=n,this.alpha=i}static parse(e){let r=[];if(Ufe.test(e)&&[4,5,7,9].includes(e.length)){const i=(e.length<6?e.replace(Gfe,"$&$&"):e).slice(1).split("");for(;i.length>0;)r.push(parseInt(i.splice(0,2).join(""),16));r[3]=r[3]!==void 0?r[3]/255:void 0}const n=e.match(Hfe);return n?.[1]&&(r=n[1].split(",").map(i=>Number(i.trim())).map((i,o)=>Eo(i,0,o<3?255:1))),r.length<3?void 0:new LS(r[0],r[1],r[2],r[3]??1)}toString(e){switch(e){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(this.alpha*255).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"hsb":return this.toHSB().toString("hsb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"rgba":return this;case"hsba":return this.toHSB();case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const e=this.red/255,r=this.green/255,n=this.blue/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a=o===0?0:s/o;let l=0;if(s!==0){switch(o){case e:l=(r-n)/s+(r<n?6:0);break;case r:l=(n-e)/s+2;break;case n:l=(e-r)/s+4;break}l/=6}return new QN(On(l*360,2),On(a*100,2),On(o*100,2),On(this.alpha,2))}toHSL(){const e=this.red/255,r=this.green/255,n=this.blue/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=(o+i)/2,a=o-i;let l=-1,c=-1;if(a===0)l=c=0;else{switch(c=a/(s<.5?o+i:2-o-i),o){case e:l=(r-n)/a+(r<n?6:0);break;case r:l=(n-e)/a+2;break;case n:l=(e-r)/a+4;break}l/=6}return new FN(On(l*360,2),On(c*100,2),On(s*100,2),On(this.alpha,2))}clone(){return new LS(this.red,this.green,this.blue,this.alpha)}getChannelFormatOptions(e){switch(e){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,r){let n=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return new Intl.NumberFormat(r,n).format(i)}getChannelRange(e){switch(e){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{r:this.red,g:this.green,b:this.blue,a:this.alpha}}getFormat(){return"rgba"}getChannels(){return LS.colorChannels}};DN(RU,"colorChannels",["red","green","blue"]);var VN=RU,Xfe=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,IU=class VS extends LN{constructor(e,r,n,i){super(),this.hue=e,this.saturation=r,this.lightness=n,this.alpha=i}static parse(e){let r;if(r=e.match(Xfe)){const[n,i,o,s]=(r[1]??r[2]).split(",").map(a=>Number(a.trim().replace("%","")));return new VS(G9(n,360),Eo(i,0,100),Eo(o,0,100),Eo(s??1,0,1))}}toString(e){switch(e){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${On(this.saturation,2)}%, ${On(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${On(this.saturation,2)}%, ${On(this.lightness,2)}%, ${this.alpha})`;case"hsb":return this.toHSB().toString("hsb");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsla":return this;case"hsba":return this.toHSB();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+e)}}toHSB(){let e=this.saturation/100,r=this.lightness/100,n=r+e*Math.min(r,1-r);return e=n===0?0:2*(1-r/n),new QN(On(this.hue,2),On(e*100,2),On(n*100,2),On(this.alpha,2))}toRGB(){let e=this.hue,r=this.saturation/100,n=this.lightness/100,i=r*Math.min(n,1-n),o=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return new VN(Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255),On(this.alpha,2))}clone(){return new VS(this.hue,this.saturation,this.lightness,this.alpha)}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,r){let n=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return(e==="saturation"||e==="lightness")&&(i/=100),new Intl.NumberFormat(r,n).format(i)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{h:this.hue,s:this.saturation,l:this.lightness,a:this.alpha}}getFormat(){return"hsla"}getChannels(){return VS.colorChannels}};DN(IU,"colorChannels",["hue","saturation","lightness"]);var FN=IU,Zfe=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,jU=class FS extends LN{constructor(e,r,n,i){super(),this.hue=e,this.saturation=r,this.brightness=n,this.alpha=i}static parse(e){let r;if(r=e.match(Zfe)){const[n,i,o,s]=(r[1]??r[2]).split(",").map(a=>Number(a.trim().replace("%","")));return new FS(G9(n,360),Eo(i,0,100),Eo(o,0,100),Eo(s??1,0,1))}}toString(e){switch(e){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${On(this.saturation,2)}%, ${On(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${On(this.saturation,2)}%, ${On(this.brightness,2)}%, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsba":return this;case"hsla":return this.toHSL();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+e)}}toHSL(){let e=this.saturation/100,r=this.brightness/100,n=r*(1-e/2);return e=n===0||n===1?0:(r-n)/Math.min(n,1-n),new FN(On(this.hue,2),On(e*100,2),On(n*100,2),On(this.alpha,2))}toRGB(){let e=this.hue,r=this.saturation/100,n=this.brightness/100,i=(o,s=(o+e/60)%6)=>n-r*n*Math.max(Math.min(s,4-s,1),0);return new VN(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),On(this.alpha,2))}clone(){return new FS(this.hue,this.saturation,this.brightness,this.alpha)}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,r){let n=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return(e==="saturation"||e==="brightness")&&(i/=100),new Intl.NumberFormat(r,n).format(i)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{h:this.hue,s:this.saturation,b:this.brightness,a:this.alpha}}getFormat(){return"hsba"}getChannels(){return FS.colorChannels}};DN(jU,"colorChannels",["hue","saturation","brightness"]);var QN=jU,Yfe="aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32",Kfe=t=>{const e=new Map,r=t.split(",");for(let n=0;n<r.length;n++){const[i,o]=r[n].split(":");e.set(i,`#${o}`),i.includes("gray")&&e.set(i.replace("gray","grey"),`#${o}`)}return e},PF=Kfe(Yfe),IC=t=>{if(PF.has(t))return IC(PF.get(t));const e=VN.parse(t)||QN.parse(t)||FN.parse(t);if(!e){const r=new Error("Invalid color value: "+t);throw Error.captureStackTrace?.(r,IC),r}return e};const Jfe=["top","right","bottom","left"],Wd=Math.min,Hs=Math.max,jC=Math.round,_w=Math.floor,cc=t=>({x:t,y:t}),epe={left:"right",right:"left",bottom:"top",top:"bottom"},tpe={start:"end",end:"start"};function Kj(t,e,r){return Hs(t,Wd(e,r))}function vu(t,e){return typeof t=="function"?t(e):t}function yu(t){return t.split("-")[0]}function Gm(t){return t.split("-")[1]}function BN(t){return t==="x"?"y":"x"}function zN(t){return t==="y"?"height":"width"}const rpe=new Set(["top","bottom"]);function tc(t){return rpe.has(yu(t))?"y":"x"}function qN(t){return BN(tc(t))}function npe(t,e,r){r===void 0&&(r=!1);const n=Gm(t),i=qN(t),o=zN(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=$C(s)),[s,$C(s)]}function ipe(t){const e=$C(t);return[Jj(t),e,Jj(e)]}function Jj(t){return t.replace(/start|end/g,e=>tpe[e])}const _F=["left","right"],TF=["right","left"],ope=["top","bottom"],spe=["bottom","top"];function ape(t,e,r){switch(t){case"top":case"bottom":return r?e?TF:_F:e?_F:TF;case"left":case"right":return e?ope:spe;default:return[]}}function lpe(t,e,r,n){const i=Gm(t);let o=ape(yu(t),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Jj)))),o}function $C(t){return t.replace(/left|right|bottom|top/g,e=>epe[e])}function cpe(t){return{top:0,right:0,bottom:0,left:0,...t}}function $U(t){return typeof t!="number"?cpe(t):{top:t,right:t,bottom:t,left:t}}function AC(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function EF(t,e,r){let{reference:n,floating:i}=t;const o=tc(e),s=qN(e),a=zN(s),l=yu(e),c=o==="y",u=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2,m=n[a]/2-i[a]/2;let v;switch(l){case"top":v={x:u,y:n.y-i.height};break;case"bottom":v={x:u,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:p};break;case"left":v={x:n.x-i.width,y:p};break;default:v={x:n.x,y:n.y}}switch(Gm(e)){case"start":v[s]-=m*(r&&c?-1:1);break;case"end":v[s]+=m*(r&&c?-1:1);break}return v}const upe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:p}=EF(c,n,l),m=n,v={},b=0;for(let O=0;O<a.length;O++){const{name:x,fn:S}=a[O],{x:w,y:k,data:P,reset:_}=await S({x:u,y:p,initialPlacement:n,placement:m,strategy:i,middlewareData:v,rects:c,platform:s,elements:{reference:t,floating:e}});u=w??u,p=k??p,v={...v,[x]:{...v[x],...P}},_&&b<=50&&(b++,typeof _=="object"&&(_.placement&&(m=_.placement),_.rects&&(c=_.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:p}=EF(c,m,l)),O=-1)}return{x:u,y:p,placement:m,strategy:i,middlewareData:v}};async function cb(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=vu(e,t),b=$U(v),x=a[m?p==="floating"?"reference":"floating":p],S=AC(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(x)))==null||r?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=p==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),P=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},_=AC(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:k,strategy:l}):w);return{top:(S.top-_.top+b.top)/P.y,bottom:(_.bottom-S.bottom+b.bottom)/P.y,left:(S.left-_.left+b.left)/P.x,right:(_.right-S.right+b.right)/P.x}}const dpe=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=vu(t,e)||{};if(c==null)return{};const p=$U(u),m={x:r,y:n},v=qN(i),b=zN(v),O=await s.getDimensions(c),x=v==="y",S=x?"top":"left",w=x?"bottom":"right",k=x?"clientHeight":"clientWidth",P=o.reference[b]+o.reference[v]-m[v]-o.floating[b],_=m[v]-o.reference[v],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let R=T?T[k]:0;(!R||!await(s.isElement==null?void 0:s.isElement(T)))&&(R=a.floating[k]||o.floating[b]);const $=P/2-_/2,A=R/2-O[b]/2-1,M=Wd(p[S],A),Q=Wd(p[w],A),V=M,q=R-O[b]-Q,N=R/2-O[b]/2+$,B=Kj(V,N,q),re=!l.arrow&&Gm(i)!=null&&N!==B&&o.reference[b]/2-(N<V?M:Q)-O[b]/2<0,he=re?N<V?N-V:N-q:0;return{[v]:m[v]+he,data:{[v]:B,centerOffset:N-B-he,...re&&{alignmentOffset:he}},reset:re}}}),hpe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:O=!0,...x}=vu(t,e);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const S=yu(i),w=tc(a),k=yu(a)===a,P=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=m||(k||!O?[$C(a)]:ipe(a)),T=b!=="none";!m&&T&&_.push(...lpe(a,O,b,P));const R=[a,..._],$=await cb(e,x),A=[];let M=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&A.push($[S]),p){const N=npe(i,s,P);A.push($[N[0]],$[N[1]])}if(M=[...M,{placement:i,overflows:A}],!A.every(N=>N<=0)){var Q,V;const N=(((Q=o.flip)==null?void 0:Q.index)||0)+1,B=R[N];if(B&&(!(p==="alignment"?w!==tc(B):!1)||M.every(ne=>tc(ne.placement)===w?ne.overflows[0]>0:!0)))return{data:{index:N,overflows:M},reset:{placement:B}};let re=(V=M.filter(he=>he.overflows[0]<=0).sort((he,ne)=>he.overflows[1]-ne.overflows[1])[0])==null?void 0:V.placement;if(!re)switch(v){case"bestFit":{var q;const he=(q=M.filter(ne=>{if(T){const se=tc(ne.placement);return se===w||se==="y"}return!0}).map(ne=>[ne.placement,ne.overflows.filter(se=>se>0).reduce((se,X)=>se+X,0)]).sort((ne,se)=>ne[1]-se[1])[0])==null?void 0:q[0];he&&(re=he);break}case"initialPlacement":re=a;break}if(i!==re)return{reset:{placement:re}}}return{}}}};function RF(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function IF(t){return Jfe.some(e=>t[e]>=0)}const fpe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=vu(t,e);switch(n){case"referenceHidden":{const o=await cb(e,{...i,elementContext:"reference"}),s=RF(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:IF(s)}}}case"escaped":{const o=await cb(e,{...i,altBoundary:!0}),s=RF(o,r.floating);return{data:{escapedOffsets:s,escaped:IF(s)}}}default:return{}}}}},AU=new Set(["left","top"]);async function ppe(t,e){const{placement:r,platform:n,elements:i}=t,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=yu(r),a=Gm(r),l=tc(r)==="y",c=AU.has(s)?-1:1,u=o&&l?-1:1,p=vu(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof b=="number"&&(v=a==="end"?b*-1:b),l?{x:v*u,y:m*c}:{x:m*c,y:v*u}}const gpe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await ppe(e,t);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},mpe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:S,y:w}=x;return{x:S,y:w}}},...l}=vu(t,e),c={x:r,y:n},u=await cb(e,l),p=tc(yu(i)),m=BN(p);let v=c[m],b=c[p];if(o){const x=m==="y"?"top":"left",S=m==="y"?"bottom":"right",w=v+u[x],k=v-u[S];v=Kj(w,v,k)}if(s){const x=p==="y"?"top":"left",S=p==="y"?"bottom":"right",w=b+u[x],k=b-u[S];b=Kj(w,b,k)}const O=a.fn({...e,[m]:v,[p]:b});return{...O,data:{x:O.x-r,y:O.y-n,enabled:{[m]:o,[p]:s}}}}}},vpe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=vu(t,e),u={x:r,y:n},p=tc(i),m=BN(p);let v=u[m],b=u[p];const O=vu(a,e),x=typeof O=="number"?{mainAxis:O,crossAxis:0}:{mainAxis:0,crossAxis:0,...O};if(l){const k=m==="y"?"height":"width",P=o.reference[m]-o.floating[k]+x.mainAxis,_=o.reference[m]+o.reference[k]-x.mainAxis;v<P?v=P:v>_&&(v=_)}if(c){var S,w;const k=m==="y"?"width":"height",P=AU.has(yu(i)),_=o.reference[p]-o.floating[k]+(P&&((S=s.offset)==null?void 0:S[p])||0)+(P?0:x.crossAxis),T=o.reference[p]+o.reference[k]+(P?0:((w=s.offset)==null?void 0:w[p])||0)-(P?x.crossAxis:0);b<_?b=_:b>T&&(b=T)}return{[m]:v,[p]:b}}}},ype=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=vu(t,e),u=await cb(e,c),p=yu(i),m=Gm(i),v=tc(i)==="y",{width:b,height:O}=o.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(S=p,x=m==="end"?"top":"bottom");const w=O-u.top-u.bottom,k=b-u.left-u.right,P=Wd(O-u[x],w),_=Wd(b-u[S],k),T=!e.middlewareData.shift;let R=P,$=_;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&($=k),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(R=w),T&&!m){const M=Hs(u.left,0),Q=Hs(u.right,0),V=Hs(u.top,0),q=Hs(u.bottom,0);v?$=b-2*(M!==0||Q!==0?M+Q:Hs(u.left,u.right)):R=O-2*(V!==0||q!==0?V+q:Hs(u.top,u.bottom))}await l({...e,availableWidth:$,availableHeight:R});const A=await s.getDimensions(a.floating);return b!==A.width||O!==A.height?{reset:{rects:!0}}:{}}}};function RP(){return typeof window<"u"}function Xm(t){return NU(t)?(t.nodeName||"").toLowerCase():"#document"}function Js(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function kc(t){var e;return(e=(NU(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function NU(t){return RP()?t instanceof Node||t instanceof Js(t).Node:!1}function pl(t){return RP()?t instanceof Element||t instanceof Js(t).Element:!1}function mc(t){return RP()?t instanceof HTMLElement||t instanceof Js(t).HTMLElement:!1}function jF(t){return!RP()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Js(t).ShadowRoot}const bpe=new Set(["inline","contents"]);function _O(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=gl(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!bpe.has(i)}const Ope=new Set(["table","td","th"]);function xpe(t){return Ope.has(Xm(t))}const wpe=[":popover-open",":modal"];function IP(t){return wpe.some(e=>{try{return t.matches(e)}catch{return!1}})}const Spe=["transform","translate","scale","rotate","perspective"],Cpe=["transform","translate","scale","rotate","perspective","filter"],kpe=["paint","layout","strict","content"];function WN(t){const e=UN(),r=pl(t)?gl(t):t;return Spe.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||Cpe.some(n=>(r.willChange||"").includes(n))||kpe.some(n=>(r.contain||"").includes(n))}function Ppe(t){let e=Ud(t);for(;mc(e)&&!um(e);){if(WN(e))return e;if(IP(e))return null;e=Ud(e)}return null}function UN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _pe=new Set(["html","body","#document"]);function um(t){return _pe.has(Xm(t))}function gl(t){return Js(t).getComputedStyle(t)}function jP(t){return pl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ud(t){if(Xm(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jF(t)&&t.host||kc(t);return jF(e)?e.host:e}function MU(t){const e=Ud(t);return um(e)?t.ownerDocument?t.ownerDocument.body:t.body:mc(e)&&_O(e)?e:MU(e)}function ub(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=MU(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),s=Js(i);if(o){const a=e2(s);return e.concat(s,s.visualViewport||[],_O(i)?i:[],a&&r?ub(a):[])}return e.concat(i,ub(i,[],r))}function e2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function DU(t){const e=gl(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=mc(t),o=i?t.offsetWidth:r,s=i?t.offsetHeight:n,a=jC(r)!==o||jC(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function HN(t){return pl(t)?t:t.contextElement}function Wg(t){const e=HN(t);if(!mc(e))return cc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:o}=DU(e);let s=(o?jC(r.width):r.width)/n,a=(o?jC(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Tpe=cc(0);function LU(t){const e=Js(t);return!UN()||!e.visualViewport?Tpe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Epe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Js(t)?!1:e}function Af(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),o=HN(t);let s=cc(1);e&&(n?pl(n)&&(s=Wg(n)):s=Wg(t));const a=Epe(o,r,n)?LU(o):cc(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,p=i.height/s.y;if(o){const m=Js(o),v=n&&pl(n)?Js(n):n;let b=m,O=e2(b);for(;O&&n&&v!==b;){const x=Wg(O),S=O.getBoundingClientRect(),w=gl(O),k=S.left+(O.clientLeft+parseFloat(w.paddingLeft))*x.x,P=S.top+(O.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,p*=x.y,l+=k,c+=P,b=Js(O),O=e2(b)}}return AC({width:u,height:p,x:l,y:c})}function $P(t,e){const r=jP(t).scrollLeft;return e?e.left+r:Af(kc(t)).left+r}function VU(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-$P(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function Rpe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const o=i==="fixed",s=kc(n),a=e?IP(e.floating):!1;if(n===s||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=cc(1);const u=cc(0),p=mc(n);if((p||!p&&!o)&&((Xm(n)!=="body"||_O(s))&&(l=jP(n)),mc(n))){const v=Af(n);c=Wg(n),u.x=v.x+n.clientLeft,u.y=v.y+n.clientTop}const m=s&&!p&&!o?VU(s,l):cc(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:r.y*c.y-l.scrollTop*c.y+u.y+m.y}}function Ipe(t){return Array.from(t.getClientRects())}function jpe(t){const e=kc(t),r=jP(t),n=t.ownerDocument.body,i=Hs(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Hs(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+$P(t);const a=-r.scrollTop;return gl(n).direction==="rtl"&&(s+=Hs(e.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:a}}const $F=25;function $pe(t,e){const r=Js(t),n=kc(t),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const u=UN();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=$P(n);if(c<=0){const u=n.ownerDocument,p=u.body,m=getComputedStyle(p),v=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-v);b<=$F&&(o-=b)}else c<=$F&&(o+=c);return{width:o,height:s,x:a,y:l}}const Ape=new Set(["absolute","fixed"]);function Npe(t,e){const r=Af(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,o=mc(t)?Wg(t):cc(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=n*o.y;return{width:s,height:a,x:l,y:c}}function AF(t,e,r){let n;if(e==="viewport")n=$pe(t,r);else if(e==="document")n=jpe(kc(t));else if(pl(e))n=Npe(e,r);else{const i=LU(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return AC(n)}function FU(t,e){const r=Ud(t);return r===e||!pl(r)||um(r)?!1:gl(r).position==="fixed"||FU(r,e)}function Mpe(t,e){const r=e.get(t);if(r)return r;let n=ub(t,[],!1).filter(a=>pl(a)&&Xm(a)!=="body"),i=null;const o=gl(t).position==="fixed";let s=o?Ud(t):t;for(;pl(s)&&!um(s);){const a=gl(s),l=WN(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&Ape.has(i.position)||_O(s)&&!l&&FU(t,s))?n=n.filter(u=>u!==s):i=a,s=Ud(s)}return e.set(t,n),n}function Dpe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const s=[...r==="clippingAncestors"?IP(e)?[]:Mpe(e,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,u)=>{const p=AF(e,u,i);return c.top=Hs(p.top,c.top),c.right=Wd(p.right,c.right),c.bottom=Wd(p.bottom,c.bottom),c.left=Hs(p.left,c.left),c},AF(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Lpe(t){const{width:e,height:r}=DU(t);return{width:e,height:r}}function Vpe(t,e,r){const n=mc(e),i=kc(e),o=r==="fixed",s=Af(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=cc(0);function c(){l.x=$P(i)}if(n||!n&&!o)if((Xm(e)!=="body"||_O(i))&&(a=jP(e)),n){const v=Af(e,!0,o,e);l.x=v.x+e.clientLeft,l.y=v.y+e.clientTop}else i&&c();o&&!n&&i&&c();const u=i&&!n&&!o?VU(i,a):cc(0),p=s.left+a.scrollLeft-l.x-u.x,m=s.top+a.scrollTop-l.y-u.y;return{x:p,y:m,width:s.width,height:s.height}}function gR(t){return gl(t).position==="static"}function NF(t,e){if(!mc(t)||gl(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return kc(t)===r&&(r=r.ownerDocument.body),r}function QU(t,e){const r=Js(t);if(IP(t))return r;if(!mc(t)){let i=Ud(t);for(;i&&!um(i);){if(pl(i)&&!gR(i))return i;i=Ud(i)}return r}let n=NF(t,e);for(;n&&xpe(n)&&gR(n);)n=NF(n,e);return n&&um(n)&&gR(n)&&!WN(n)?r:n||Ppe(t)||r}const Fpe=async function(t){const e=this.getOffsetParent||QU,r=this.getDimensions,n=await r(t.floating);return{reference:Vpe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Qpe(t){return gl(t).direction==="rtl"}const Bpe={convertOffsetParentRelativeRectToViewportRelativeRect:Rpe,getDocumentElement:kc,getClippingRect:Dpe,getOffsetParent:QU,getElementRects:Fpe,getClientRects:Ipe,getDimensions:Lpe,getScale:Wg,isElement:pl,isRTL:Qpe};function BU(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function zpe(t,e){let r=null,n;const i=kc(t);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:p,width:m,height:v}=c;if(a||e(),!m||!v)return;const b=_w(p),O=_w(i.clientWidth-(u+m)),x=_w(i.clientHeight-(p+v)),S=_w(u),k={rootMargin:-b+"px "+-O+"px "+-x+"px "+-S+"px",threshold:Hs(0,Wd(1,l))||1};let P=!0;function _(T){const R=T[0].intersectionRatio;if(R!==l){if(!P)return s();R?s(!1,R):n=setTimeout(()=>{s(!1,1e-7)},1e3)}R===1&&!BU(c,t.getBoundingClientRect())&&s(),P=!1}try{r=new IntersectionObserver(_,{...k,root:i.ownerDocument})}catch{r=new IntersectionObserver(_,k)}r.observe(t)}return s(!0),o}function qpe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=HN(t),u=i||o?[...c?ub(c):[],...ub(e)]:[];u.forEach(S=>{i&&S.addEventListener("scroll",r,{passive:!0}),o&&S.addEventListener("resize",r)});const p=c&&a?zpe(c,r):null;let m=-1,v=null;s&&(v=new ResizeObserver(S=>{let[w]=S;w&&w.target===c&&v&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=v)==null||k.observe(e)})),r()}),c&&!l&&v.observe(c),v.observe(e));let b,O=l?Af(t):null;l&&x();function x(){const S=Af(t);O&&!BU(O,S)&&r(),O=S,b=requestAnimationFrame(x)}return r(),()=>{var S;u.forEach(w=>{i&&w.removeEventListener("scroll",r),o&&w.removeEventListener("resize",r)}),p?.(),(S=v)==null||S.disconnect(),v=null,l&&cancelAnimationFrame(b)}}const Wpe=gpe,Upe=mpe,Hpe=hpe,Gpe=ype,Xpe=fpe,Zpe=dpe,Ype=vpe,Kpe=(t,e,r)=>{const n=new Map,i={platform:Bpe,...r},o={...i.platform,_c:n};return upe(t,e,{...i,platform:o})};function MF(t=0,e=0,r=0,n=0){if(typeof DOMRect=="function")return new DOMRect(t,e,r,n);const i={x:t,y:e,width:r,height:n,top:e,right:t+r,bottom:e+n,left:t};return{...i,toJSON:()=>i}}function Jpe(t){if(!t)return MF();const{x:e,y:r,width:n,height:i}=t;return MF(e,r,n,i)}function ege(t,e){return{contextElement:Yi(t)?t:void 0,getBoundingClientRect:()=>{const r=t,n=e?.(r);return n||!r?Jpe(n):r.getBoundingClientRect()}}}var by=t=>({variable:t,reference:`var(${t})`}),Jc={arrowSize:by("--arrow-size"),arrowSizeHalf:by("--arrow-size-half"),arrowBg:by("--arrow-background"),transformOrigin:by("--transform-origin"),arrowOffset:by("--arrow-offset")},tge=t=>t==="top"||t==="bottom"?"y":"x";function rge(t,e){return{name:"transformOrigin",fn(r){const{elements:n,middlewareData:i,placement:o,rects:s,y:a}=r,l=o.split("-")[0],c=tge(l),u=i.arrow?.x||0,p=i.arrow?.y||0,m=e?.clientWidth||0,v=e?.clientHeight||0,b=u+m/2,O=p+v/2,x=Math.abs(i.shift?.y||0),S=s.reference.height/2,w=v/2,k=t.offset?.mainAxis??t.gutter,P=typeof k=="number"?k+w:k??w,_=x>P,T={top:`${b}px calc(100% + ${P}px)`,bottom:`${b}px ${-P}px`,left:`calc(100% + ${P}px) ${O}px`,right:`${-P}px ${O}px`}[l],R=`${b}px ${s.reference.y+S-a}px`,$=!!t.overlap&&c==="y"&&_;return n.floating.style.setProperty(Jc.transformOrigin.variable,$?R:T),{data:{transformOrigin:$?R:T}}}}}var nge={name:"rects",fn({rects:t}){return{data:t}}},ige=t=>{if(t)return{name:"shiftArrow",fn({placement:e,middlewareData:r}){if(!r.arrow)return{};const{x:n,y:i}=r.arrow,o=e.split("-")[0];return Object.assign(t.style,{left:n!=null?`${n}px`:"",top:i!=null?`${i}px`:"",[o]:`calc(100% + ${Jc.arrowOffset.reference})`}),{}}}};function oge(t){const[e,r]=t.split("-");return{side:e,align:r,hasAlign:r!=null}}function sge(t){return t.split("-")[0]}var age={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function DF(t,e){const r=t.devicePixelRatio||1;return Math.round(e*r)/r}function GN(t){return typeof t=="function"?t():t==="clipping-ancestors"?"clippingAncestors":t}function lge(t,e,r){const n=t||e.createElement("div");return Zpe({element:n,padding:r.arrowPadding})}function cge(t,e){if(!jde(e.offset??e.gutter))return Wpe(({placement:r})=>{const n=(t?.clientHeight||0)/2,i=e.offset?.mainAxis??e.gutter,o=typeof i=="number"?i+n:i??n,{hasAlign:s}=oge(r),a=s?void 0:e.shift,l=e.offset?.crossAxis??a;return qm({crossAxis:l,mainAxis:o,alignmentAxis:e.shift})})}function uge(t){if(!t.flip)return;const e=GN(t.boundary);return Hpe({...e?{boundary:e}:void 0,padding:t.overflowPadding,fallbackPlacements:t.flip===!0?void 0:t.flip})}function dge(t){if(!t.slide&&!t.overlap)return;const e=GN(t.boundary);return Upe({...e?{boundary:e}:void 0,mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding,limiter:Ype()})}function hge(t){return Gpe({padding:t.overflowPadding,apply({elements:e,rects:r,availableHeight:n,availableWidth:i}){const o=e.floating,s=Math.round(r.reference.width),a=Math.round(r.reference.height);i=Math.floor(i),n=Math.floor(n),o.style.setProperty("--reference-width",`${s}px`),o.style.setProperty("--reference-height",`${a}px`),o.style.setProperty("--available-width",`${i}px`),o.style.setProperty("--available-height",`${n}px`)}})}function fge(t){if(t.hideWhenDetached)return Xpe({strategy:"referenceHidden",boundary:GN(t.boundary)??"clippingAncestors"})}function pge(t){return t?t===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:t:{}}function gge(t,e,r={}){const n=ege(t,r.getAnchorRect);if(!e||!n)return;const i=Object.assign({},age,r),o=e.querySelector("[data-part=arrow]"),s=[cge(o,i),uge(i),dge(i),lge(o,e.ownerDocument,i),ige(o),rge({gutter:i.gutter,offset:i.offset,overlap:i.overlap},o),hge(i),fge(i),nge],{placement:a,strategy:l,onComplete:c,onPositioned:u}=i,p=async()=>{if(!n||!e)return;const O=await Kpe(n,e,{placement:a,middleware:s,strategy:l});c?.(O),u?.({placed:!0});const x=hi(e),S=DF(x,O.x),w=DF(x,O.y);e.style.setProperty("--x",`${S}px`),e.style.setProperty("--y",`${w}px`),i.hideWhenDetached&&(O.middlewareData.hide?.referenceHidden?(e.style.setProperty("visibility","hidden"),e.style.setProperty("pointer-events","none")):(e.style.removeProperty("visibility"),e.style.removeProperty("pointer-events")));const k=e.firstElementChild;if(k){const P=$f(k);e.style.setProperty("--z-index",P.zIndex)}},m=async()=>{r.updatePosition?(await r.updatePosition({updatePosition:p,floatingElement:e}),u?.({placed:!0})):await p()},v=pge(i.listeners),b=i.listeners?qpe(n,e,m,v):Fde;return m(),()=>{b?.(),u?.({placed:!1})}}function ra(t,e,r={}){const{defer:n,...i}=r,o=n?wt:a=>a(),s=[];return s.push(o(()=>{const a=typeof t=="function"?t():t,l=typeof e=="function"?e():e;s.push(gge(a,l,i))})),()=>{s.forEach(a=>a?.())}}var mge={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function AP(t={}){const{placement:e,sameWidth:r,fitViewport:n,strategy:i="absolute"}=t;return{arrow:{position:"absolute",width:Jc.arrowSize.reference,height:Jc.arrowSize.reference,[Jc.arrowSizeHalf.variable]:`calc(${Jc.arrowSize.reference} / 2)`,[Jc.arrowOffset.variable]:`calc(${Jc.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:e?mge[e.split("-")[0]]:void 0,background:Jc.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:r?void 0:"max-content",width:r?"var(--reference-width)":void 0,maxWidth:n?"var(--available-width)":void 0,maxHeight:n?"var(--available-height)":void 0,pointerEvents:e?void 0:"none",top:"0px",left:"0px",transform:e?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function vge(t){const e={each(r){for(let n=0;n<t.frames?.length;n+=1){const i=t.frames[n];i&&r(i)}},addEventListener(r,n,i){return e.each(o=>{try{o.document.addEventListener(r,n,i)}catch{}}),()=>{try{e.removeEventListener(r,n,i)}catch{}}},removeEventListener(r,n,i){e.each(o=>{try{o.document.removeEventListener(r,n,i)}catch{}})}};return e}function yge(t){const e=t.frameElement!=null?t.parent:null;return{addEventListener:(r,n,i)=>{try{e?.addEventListener(r,n,i)}catch{}return()=>{try{e?.removeEventListener(r,n,i)}catch{}}},removeEventListener:(r,n,i)=>{try{e?.removeEventListener(r,n,i)}catch{}}}}var LF="pointerdown.outside",VF="focus.outside";function bge(t){for(const e of t)if(Yi(e)&&Ld(e))return!0;return!1}var zU=t=>"clientY"in t;function Oge(t,e){if(!zU(e)||!t)return!1;const r=t.getBoundingClientRect();return r.width===0||r.height===0?!1:r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}function xge(t,e){return t.y<=e.y&&e.y<=t.y+t.height&&t.x<=e.x&&e.x<=t.x+t.width}function FF(t,e){if(!e||!zU(t))return!1;const r=e.scrollHeight>e.clientHeight,n=r&&t.clientX>e.offsetLeft+e.clientWidth,i=e.scrollWidth>e.clientWidth,o=i&&t.clientY>e.offsetTop+e.clientHeight,s={x:e.offsetLeft,y:e.offsetTop,width:e.clientWidth+(r?16:0),height:e.clientHeight+(i?16:0)},a={x:t.clientX,y:t.clientY};return xge(s,a)?n||o:!1}function wge(t,e){const{exclude:r,onFocusOutside:n,onPointerDownOutside:i,onInteractOutside:o,defer:s,followControlledElements:a=!0}=e;if(!t)return;const l=ks(t),c=hi(t),u=vge(c),p=yge(c);function m(k,P){if(!Yi(P)||!P.isConnected||ys(t,P)||Oge(t,k)||a&&nU(t,P))return!1;const _=l.querySelector(`[aria-controls="${t.id}"]`);if(_){const R=TC(_);if(FF(k,R))return!1}const T=TC(t);return FF(k,T)?!1:!r?.(P)}const v=new Set,b=jf(t?.getRootNode());function O(k){function P(_){const T=s&&!bF()?wt:A=>A(),R=_??k,$=R?.composedPath?.()??[R?.target];T(()=>{const A=b?$[0]:ti(k);if(!(!t||!m(k,A))){if(i||o){const M=ib(i,o);t.addEventListener(LF,M,{once:!0})}QF(t,LF,{bubbles:!1,cancelable:!0,detail:{originalEvent:R,contextmenu:lU(R),focusable:bge($),target:A}})}})}k.pointerType==="touch"?(v.forEach(_=>_()),v.add(hr(l,"click",P,{once:!0})),v.add(p.addEventListener("click",P,{once:!0})),v.add(u.addEventListener("click",P,{once:!0}))):P()}const x=new Set,S=setTimeout(()=>{x.add(hr(l,"pointerdown",O,!0)),x.add(p.addEventListener("pointerdown",O,!0)),x.add(u.addEventListener("pointerdown",O,!0))},0);function w(k){(s?wt:_=>_())(()=>{const _=ti(k);if(!(!t||!m(k,_))){if(n||o){const T=ib(n,o);t.addEventListener(VF,T,{once:!0})}QF(t,VF,{bubbles:!1,cancelable:!0,detail:{originalEvent:k,contextmenu:!1,focusable:Ld(_),target:_}})}})}return bF()||(x.add(hr(l,"focusin",w,!0)),x.add(p.addEventListener("focusin",w,!0)),x.add(u.addEventListener("focusin",w,!0))),()=>{clearTimeout(S),v.forEach(k=>k()),x.forEach(k=>k())}}function Sge(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=typeof t=="function"?t():t;i.push(wge(o,e))})),()=>{i.forEach(o=>o?.())}}function QF(t,e,r){const n=t.ownerDocument.defaultView||window,i=new n.CustomEvent(e,r);return t.dispatchEvent(i)}function Cge(t,e){const r=n=>{n.key==="Escape"&&(n.isComposing||e?.(n))};return hr(ks(t),"keydown",r,{capture:!0})}var BF="layer:request-dismiss",as={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(t=>t.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(t){const e=this.indexOf(t),r=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return e<r},isTopMost(t){return this.layers[this.count()-1]?.node===t},getNestedLayers(t){return Array.from(this.layers).slice(this.indexOf(t)+1)},getLayersByType(t){return this.layers.filter(e=>e.type===t)},getNestedLayersByType(t,e){const r=this.indexOf(t);return r===-1?[]:this.layers.slice(r+1).filter(n=>n.type===e)},getParentLayerOfType(t,e){const r=this.indexOf(t);if(!(r<=0))return this.layers.slice(0,r).reverse().find(n=>n.type===e)},countNestedLayersOfType(t,e){return this.getNestedLayersByType(t,e).length},isInNestedLayer(t,e){return this.getNestedLayers(t).some(r=>ys(r.node,e))},isInBranch(t){return Array.from(this.branches).some(e=>ys(e,t))},add(t){this.layers.push(t),this.syncLayers()},addBranch(t){this.branches.push(t)},remove(t){const e=this.indexOf(t);e<0||(e<this.count()-1&&this.getNestedLayers(t).forEach(n=>as.dismiss(n.node,t)),this.layers.splice(e,1),this.syncLayers())},removeBranch(t){const e=this.branches.indexOf(t);e>=0&&this.branches.splice(e,1)},syncLayers(){this.layers.forEach((t,e)=>{t.node.style.setProperty("--layer-index",`${e}`),t.node.removeAttribute("data-nested"),t.node.removeAttribute("data-has-nested"),this.getParentLayerOfType(t.node,t.type)&&t.node.setAttribute("data-nested",t.type);const n=this.countNestedLayersOfType(t.node,t.type);n>0&&t.node.setAttribute("data-has-nested",t.type),t.node.style.setProperty("--nested-layer-count",`${n}`)})},indexOf(t){return this.layers.findIndex(e=>e.node===t)},dismiss(t,e){const r=this.indexOf(t);if(r===-1)return;const n=this.layers[r];Pge(t,BF,i=>{n.requestDismiss?.(i),i.defaultPrevented||n?.dismiss()}),kge(t,BF,{originalLayer:t,targetLayer:e,originalIndex:r,targetIndex:e?this.indexOf(e):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function kge(t,e,r){const n=t.ownerDocument.defaultView||window,i=new n.CustomEvent(e,{cancelable:!0,bubbles:!0,detail:r});return t.dispatchEvent(i)}function Pge(t,e,r){t.addEventListener(e,r,{once:!0})}var zF;function qF(){as.layers.forEach(({node:t})=>{t.style.pointerEvents=as.isBelowPointerBlockingLayer(t)?"none":"auto"})}function _ge(t){t.style.pointerEvents=""}function Tge(t,e){const r=ks(t),n=[];return as.hasPointerBlockingLayer()&&!r.body.hasAttribute("data-inert")&&(zF=document.body.style.pointerEvents,queueMicrotask(()=>{r.body.style.pointerEvents="none",r.body.setAttribute("data-inert","")})),e?.forEach(i=>{const[o,s]=mfe(()=>{const a=i();return Yi(a)?a:null},{timeout:1e3});o.then(a=>n.push(ab(a,{pointerEvents:"auto"}))),n.push(s)}),()=>{as.hasPointerBlockingLayer()||(queueMicrotask(()=>{r.body.style.pointerEvents=zF,r.body.removeAttribute("data-inert"),r.body.style.length===0&&r.body.removeAttribute("style")}),n.forEach(i=>i()))}}function Ege(t,e){const{warnOnMissingNode:r=!0}=e;if(r&&!t){cm("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!t)return;const{onDismiss:n,onRequestDismiss:i,pointerBlocking:o,exclude:s,debug:a,type:l="dialog"}=e,c={dismiss:n,node:t,type:l,pointerBlocking:o,requestDismiss:i};as.add(c),qF();function u(O){const x=ti(O.detail.originalEvent);as.isBelowPointerBlockingLayer(t)||as.isInBranch(x)||(e.onPointerDownOutside?.(O),e.onInteractOutside?.(O),!O.defaultPrevented&&(a&&console.log("onPointerDownOutside:",O.detail.originalEvent),n?.()))}function p(O){const x=ti(O.detail.originalEvent);as.isInBranch(x)||(e.onFocusOutside?.(O),e.onInteractOutside?.(O),!O.defaultPrevented&&(a&&console.log("onFocusOutside:",O.detail.originalEvent),n?.()))}function m(O){as.isTopMost(t)&&(e.onEscapeKeyDown?.(O),!O.defaultPrevented&&n&&(O.preventDefault(),n()))}function v(O){if(!t)return!1;const x=typeof s=="function"?s():s,S=Array.isArray(x)?x:[x],w=e.persistentElements?.map(k=>k()).filter(Yi);return w&&S.push(...w),S.some(k=>ys(k,O))||as.isInNestedLayer(t,O)}const b=[o?Tge(t,e.persistentElements):void 0,Cge(t,m),Sge(t,{exclude:v,onFocusOutside:p,onPointerDownOutside:u,defer:e.defer})];return()=>{as.remove(t),qF(),_ge(t),b.forEach(O=>O?.())}}function tp(t,e){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=kd(t)?t():t;i.push(Ege(o,e))})),()=>{i.forEach(o=>o?.())}}function Rge(t,e={}){const{defer:r}=e,n=r?wt:o=>o(),i=[];return i.push(n(()=>{const o=kd(t)?t():t;if(!o){cm("[@zag-js/dismissable] branch node is `null` or `undefined`");return}as.addBranch(o),i.push(()=>{as.removeBranch(o)})})),()=>{i.forEach(o=>o?.())}}var qU=Ct("color-picker",["root","label","control","trigger","positioner","content","area","areaThumb","valueText","areaBackground","channelSlider","channelSliderLabel","channelSliderTrack","channelSliderThumb","channelSliderValueText","channelInput","transparencyGrid","swatchGroup","swatchTrigger","swatchIndicator","swatch","eyeDropperTrigger","formatTrigger","formatSelect"]);qU.build();var Ige=t=>t.ids?.hiddenInput??`color-picker:${t.id}:hidden-input`,jge=t=>t.ids?.control??`color-picker:${t.id}:control`,$ge=t=>t.ids?.trigger??`color-picker:${t.id}:trigger`,Age=t=>t.ids?.content??`color-picker:${t.id}:content`,Nge=t=>t.ids?.positioner??`color-picker:${t.id}:positioner`,Mge=t=>t.ids?.formatSelect??`color-picker:${t.id}:format-select`,Dge=t=>t.ids?.area??`color-picker:${t.id}:area`,Lge=t=>t.ids?.areaThumb??`color-picker:${t.id}:area-thumb`,Vge=(t,e)=>t.ids?.channelSliderTrack?.(e)??`color-picker:${t.id}:slider-track:${e}`,Fge=(t,e)=>t.ids?.channelSliderThumb?.(e)??`color-picker:${t.id}:slider-thumb:${e}`,QS=t=>t.getById(Age(t)),Qge=t=>t.getById(Lge(t)),Bge=(t,e)=>t.getById(Fge(t,e)),zge=t=>t.getById(Mge(t)),WF=t=>t.getById(Ige(t)),qge=t=>t.getById(Dge(t)),Wge=(t,e,r)=>{const n=qge(t);if(!n)return;const{getPercentValue:i}=pU(e,n);return{x:i({dir:r,orientation:"horizontal"}),y:i({orientation:"vertical"})}},Uge=t=>t.getById(jge(t)),mR=t=>t.getById($ge(t)),Hge=t=>t.getById(Nge(t)),Gge=(t,e)=>t.getById(Vge(t,e)),Xge=(t,e,r,n)=>{const i=Gge(t,r);if(!i)return;const{getPercentValue:o}=pU(e,i);return{x:o({dir:n,orientation:"horizontal"}),y:o({orientation:"vertical"})}},Zge=t=>[...sb(QS(t),"input[data-channel]"),...sb(Uge(t),"input[data-channel]")];function Yge(t,e){if(e==null)return"";if(e==="hex")return t.toString("hex");if(e==="css")return t.toString("css");if(e in t)return t.getChannelValue(e).toString();const r=t.getFormat()==="hsla";switch(e){case"hue":return r?t.toFormat("hsla").getChannelValue("hue").toString():t.toFormat("hsba").getChannelValue("hue").toString();case"saturation":return r?t.toFormat("hsla").getChannelValue("saturation").toString():t.toFormat("hsba").getChannelValue("saturation").toString();case"lightness":return t.toFormat("hsla").getChannelValue("lightness").toString();case"brightness":return t.toFormat("hsba").getChannelValue("brightness").toString();case"red":case"green":case"blue":return t.toFormat("rgba").getChannelValue(e).toString();default:return t.getChannelValue(e).toString()}}var UF=t=>IC(t),Kge=/^[0-9a-fA-F]{3,8}$/;function Jge(t){return Kge.test(t)}function eme(t){return t.startsWith("#")?t:Jge(t)?`#${t}`:t}var{and:tme}=Cl();tme("isOpenControlled","closeOnSelect");function HF(t,e,r){const n=Zge(t);wt(()=>{n.forEach(i=>{const o=i.dataset.channel;CO(i,Yge(r||e,o))})})}function rme(t,e){const r=zge(t);r&&wt(()=>CO(r,e))}xt()(["closeOnSelect","dir","disabled","format","defaultFormat","getRootNode","id","ids","initialFocusEl","inline","name","positioning","onFocusOutside","onFormatChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","onValueChangeEnd","defaultOpen","open","positioning","required","readOnly","value","defaultValue","invalid","openAutoFocus"]);xt()(["xChannel","yChannel"]);xt()(["channel","orientation"]);xt()(["value","disabled"]);xt()(["value","respectAlpha"]);xt()(["size"]);const[Zm,XN]=Cn({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:"<RenderStrategyPropsProvider />"}),Ym=t=>Nn()(t,["lazyMount","unmountOnExit"]),[nme,ZN]=Cn({name:"AccordionItemPropsContext",hookName:"useAccordionItemPropsContext",providerName:"<AccordionItemPropsProvider />"}),WU=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["value","disabled"]),i=EP(),o=XN(),s=Ae(i.getItemProps(r),n),a=i.getItemState(r),l=i.getItemContentProps(r);return h.jsx(nme,{value:r,children:h.jsx(Afe,{value:a,children:h.jsx(EU,{ref:e,open:a.expanded,ids:{content:l.id},...o,...s})})})});WU.displayName="AccordionItem";const UU=E.forwardRef((t,e)=>{const r=TU();if(r.isUnmounted)return null;const n=Ae(r.getContentProps(),t);return h.jsx(Ue.div,{...n,ref:e})});UU.displayName="CollapsibleContent";const ime=Nn(),HU=E.forwardRef((t,e)=>{const r=EP(),n=ZN(),i=r.getItemContentProps(n),[,o]=ime(i,["hidden","data-state"]),s=Ae(o,t);return h.jsx(UU,{ref:e,...s})});HU.displayName="AccordionItemContent";const GU=E.forwardRef((t,e)=>{const r=EP(),n=ZN(),i=Ae(r.getItemIndicatorProps(n),t);return h.jsx(Ue.div,{...i,ref:e})});GU.displayName="AccordionItemIndicator";const XU=E.forwardRef((t,e)=>{const r=EP(),n=ZN(),i=TU(),o=r.getItemTriggerProps(n),s=Ae({...o,"aria-controls":i.isUnmounted?void 0:o["aria-controls"]},t);return h.jsx(Ue.button,{...s,ref:e})});XU.displayName="AccordionItemTrigger";var ZU=Ct("accordion").parts("root","item","itemTrigger","itemContent","itemIndicator"),Oy=ZU.build(),NC=t=>t.ids?.root??`accordion:${t.id}`,ome=(t,e)=>t.ids?.item?.(e)??`accordion:${t.id}:item:${e}`,GF=(t,e)=>t.ids?.itemContent?.(e)??`accordion:${t.id}:content:${e}`,MC=(t,e)=>t.ids?.itemTrigger?.(e)??`accordion:${t.id}:trigger:${e}`,sme=t=>t.getById(NC(t)),NP=t=>{const r=`[aria-controls][data-ownedby='${CSS.escape(NC(t))}']:not([disabled])`;return sb(sme(t),r)},ame=t=>zg(NP(t)),lme=t=>wP(NP(t)),cme=(t,e)=>bU(NP(t),MC(t,e)),ume=(t,e)=>OU(NP(t),MC(t,e));function dme(t,e){const{send:r,context:n,prop:i,scope:o,computed:s}=t,a=n.get("focusedValue"),l=n.get("value"),c=i("multiple");function u(m){let v=m;!c&&v.length>1&&(v=[v[0]]),r({type:"VALUE.SET",value:v})}function p(m){return{expanded:l.includes(m.value),focused:a===m.value,disabled:!!(m.disabled??i("disabled"))}}return{focusedValue:a,value:l,setValue:u,getItemState:p,getRootProps(){return e.element({...Oy.root.attrs,dir:i("dir"),id:NC(o),"data-orientation":i("orientation")})},getItemProps(m){const v=p(m);return e.element({...Oy.item.attrs,dir:i("dir"),id:ome(o,m.value),"data-state":v.expanded?"open":"closed","data-focus":st(v.focused),"data-disabled":st(v.disabled),"data-orientation":i("orientation")})},getItemContentProps(m){const v=p(m);return e.element({...Oy.itemContent.attrs,dir:i("dir"),role:"region",id:GF(o,m.value),"aria-labelledby":MC(o,m.value),hidden:!v.expanded,"data-state":v.expanded?"open":"closed","data-disabled":st(v.disabled),"data-focus":st(v.focused),"data-orientation":i("orientation")})},getItemIndicatorProps(m){const v=p(m);return e.element({...Oy.itemIndicator.attrs,dir:i("dir"),"aria-hidden":!0,"data-state":v.expanded?"open":"closed","data-disabled":st(v.disabled),"data-focus":st(v.focused),"data-orientation":i("orientation")})},getItemTriggerProps(m){const{value:v}=m,b=p(m);return e.button({...Oy.itemTrigger.attrs,type:"button",dir:i("dir"),id:MC(o,v),"aria-controls":GF(o,v),"aria-expanded":b.expanded,disabled:b.disabled,"data-orientation":i("orientation"),"aria-disabled":b.disabled,"data-state":b.expanded?"open":"closed","data-ownedby":NC(o),onFocus(){b.disabled||r({type:"TRIGGER.FOCUS",value:v})},onBlur(){b.disabled||r({type:"TRIGGER.BLUR"})},onClick(O){b.disabled||(Wm()&&O.currentTarget.focus(),r({type:"TRIGGER.CLICK",value:v}))},onKeyDown(O){if(O.defaultPrevented||b.disabled)return;const x={ArrowDown(){s("isHorizontal")||r({type:"GOTO.NEXT",value:v})},ArrowUp(){s("isHorizontal")||r({type:"GOTO.PREV",value:v})},ArrowRight(){s("isHorizontal")&&r({type:"GOTO.NEXT",value:v})},ArrowLeft(){s("isHorizontal")&&r({type:"GOTO.PREV",value:v})},Home(){r({type:"GOTO.FIRST",value:v})},End(){r({type:"GOTO.LAST",value:v})}},S=_C(O,{dir:i("dir"),orientation:i("orientation")}),w=x[S];w&&(w(O),O.preventDefault())}})}}}var{and:hme,not:fme}=Cl(),pme={props({props:t}){return{collapsible:!1,multiple:!1,orientation:"vertical",defaultValue:[],...t}},initialState(){return"idle"},context({prop:t,bindable:e}){return{focusedValue:e(()=>({defaultValue:null,sync:!0,onChange(r){t("onFocusChange")?.({value:r})}})),value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(r){t("onValueChange")?.({value:r})}}))}},computed:{isHorizontal:({prop:t})=>t("orientation")==="horizontal"},on:{"VALUE.SET":{actions:["setValue"]}},states:{idle:{on:{"TRIGGER.FOCUS":{target:"focused",actions:["setFocusedValue"]}}},focused:{on:{"GOTO.NEXT":{actions:["focusNextTrigger"]},"GOTO.PREV":{actions:["focusPrevTrigger"]},"TRIGGER.CLICK":[{guard:hme("isExpanded","canToggle"),actions:["collapse"]},{guard:fme("isExpanded"),actions:["expand"]}],"GOTO.FIRST":{actions:["focusFirstTrigger"]},"GOTO.LAST":{actions:["focusLastTrigger"]},"TRIGGER.BLUR":{target:"idle",actions:["clearFocusedValue"]}}}},implementations:{guards:{canToggle:({prop:t})=>!!t("collapsible")||!!t("multiple"),isExpanded:({context:t,event:e})=>t.get("value").includes(e.value)},actions:{collapse({context:t,prop:e,event:r}){const n=e("multiple")?wf(t.get("value"),r.value):[];t.set("value",n)},expand({context:t,prop:e,event:r}){const n=e("multiple")?ff(t.get("value"),r.value):[r.value];t.set("value",n)},focusFirstTrigger({scope:t}){ame(t)?.focus()},focusLastTrigger({scope:t}){lme(t)?.focus()},focusNextTrigger({context:t,scope:e}){const r=t.get("focusedValue");if(!r)return;cme(e,r)?.focus()},focusPrevTrigger({context:t,scope:e}){const r=t.get("focusedValue");if(!r)return;ume(e,r)?.focus()},setFocusedValue({context:t,event:e}){t.set("focusedValue",e.value)},clearFocusedValue({context:t}){t.set("focusedValue",null)},setValue({context:t,event:e}){t.set("value",e.value)},coarseValue({context:t,prop:e}){!e("multiple")&&t.get("value").length>1&&(cm("The value of accordion should be a single value when multiple is false."),t.set("value",[t.get("value")[0]]))}}}};xt()(["collapsible","dir","disabled","getRootNode","id","ids","multiple","onFocusChange","onValueChange","orientation","value","defaultValue"]);xt()(["value","disabled"]);const gme=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,dir:n,getRootNode:r,...t},o=Ps(pme,i);return dme(o,oa)},YU=E.forwardRef((t,e)=>{const[r,n]=Ym(t),[i,o]=Nn()(n,["collapsible","defaultValue","disabled","id","ids","multiple","onFocusChange","onValueChange","orientation","value"]),s=gme(i),a=Ae(s.getRootProps(),o);return h.jsx(PU,{value:s,children:h.jsx(Zm,{value:r,children:h.jsx(Ue.div,{...a,ref:e})})})});YU.displayName="AccordionRoot";const KU=E.forwardRef((t,e)=>{const[r,n]=Ym(t),[{value:i},o]=Nn()(n,["value"]),s=Ae(i.getRootProps(),o);return h.jsx(PU,{value:i,children:h.jsx(Zm,{value:r,children:h.jsx(Ue.div,{...s,ref:e})})})});KU.displayName="AccordionRootProvider";var a0=(t,e)=>({x:t,y:e});function mme(t){const{x:e,y:r,width:n,height:i}=t,o=e+n/2,s=r+i/2;return{x:e,y:r,width:n,height:i,minX:e,minY:r,maxX:e+n,maxY:r+i,midX:o,midY:s,center:a0(o,s)}}function vme(t){const e=a0(t.minX,t.minY),r=a0(t.maxX,t.minY),n=a0(t.maxX,t.maxY),i=a0(t.minX,t.maxY);return{top:e,right:r,bottom:n,left:i}}function yme(t,e){const r=mme(t),{top:n,right:i,left:o,bottom:s}=vme(r),[a]=e.split("-");return{top:[o,n,i,s],right:[n,i,s,o],bottom:[n,o,s,i],left:[i,n,o,s]}[a]}function bme(t,e){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>n!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(i=!i)}return i}var JU=Ct("avatar").parts("root","image","fallback");JU.build();xt()(["dir","id","ids","onStatusChange","getRootNode"]);var qp=new WeakMap,Tw=new WeakMap,Ew={},vR=0,eH=t=>t&&(t.host||eH(t.parentNode)),Ome=(t,e)=>e.map(r=>{if(t.contains(r))return r;const n=eH(r);return n&&t.contains(n)?n:(console.error("[zag-js > ariaHidden] target",r,"in not contained inside",t,". Doing nothing"),null)}).filter(r=>!!r),xme=new Set(["script","output","status","next-route-announcer"]),wme=t=>xme.has(t.localName)||t.role==="status"||t.hasAttribute("aria-live")?!0:t.matches("[data-live-announcer]"),Sme=(t,e)=>{const{parentNode:r,markerName:n,controlAttribute:i,followControlledElements:o=!0}=e,s=Ome(r,Array.isArray(t)?t:[t]);Ew[n]||(Ew[n]=new WeakMap);const a=Ew[n],l=[],c=new Set,u=new Set(s),p=v=>{!v||c.has(v)||(c.add(v),p(v.parentNode))};s.forEach(v=>{p(v),o&&Yi(v)&&iU(v,b=>{p(b)})});const m=v=>{!v||u.has(v)||Array.prototype.forEach.call(v.children,b=>{if(c.has(b))m(b);else try{if(wme(b))return;const x=b.getAttribute(i)==="true",S=(qp.get(b)||0)+1,w=(a.get(b)||0)+1;qp.set(b,S),a.set(b,w),l.push(b),S===1&&x&&Tw.set(b,!0),w===1&&b.setAttribute(n,""),x||b.setAttribute(i,"true")}catch(O){console.error("[zag-js > ariaHidden] cannot operate on ",b,O)}})};return m(r),c.clear(),vR++,()=>{l.forEach(v=>{const b=qp.get(v)-1,O=a.get(v)-1;qp.set(v,b),a.set(v,O),b||(Tw.has(v)||v.removeAttribute(i),Tw.delete(v)),O||v.removeAttribute(n)}),vR--,vR||(qp=new WeakMap,qp=new WeakMap,Tw=new WeakMap,Ew={})}},Cme=t=>(Array.isArray(t)?t[0]:t).ownerDocument.body,kme=(t,e=Cme(t),r="data-aria-hidden",n=!0)=>{if(e)return Sme(t,{parentNode:e,markerName:r,controlAttribute:"aria-hidden",followControlledElements:n})},Pme=t=>{const e=requestAnimationFrame(()=>t());return()=>cancelAnimationFrame(e)};function YN(t,e={}){const{defer:r=!0}=e,n=r?Pme:o=>o(),i=[];return i.push(n(()=>{const s=(typeof t=="function"?t():t).filter(Boolean);s.length!==0&&i.push(kme(s))})),()=>{i.forEach(o=>o?.())}}var _me=Object.defineProperty,Tme=(t,e,r)=>e in t?_me(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Vn=(t,e,r)=>Tme(t,typeof e!="symbol"?e+"":e,r),XF={activateTrap(t,e){if(t.length>0){const n=t[t.length-1];n!==e&&n.pause()}const r=t.indexOf(e);r===-1||t.splice(r,1),t.push(e)},deactivateTrap(t,e){const r=t.indexOf(e);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}},Eme=[],Rme=class{constructor(t,e){Vn(this,"trapStack"),Vn(this,"config"),Vn(this,"doc"),Vn(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Vn(this,"portalContainers",new Set),Vn(this,"listenerCleanups",[]),Vn(this,"handleFocus",n=>{const i=ti(n),o=this.findContainerIndex(i,n)>=0;if(o||kP(i))o&&(this.state.mostRecentlyFocusedNode=i);else{n.stopImmediatePropagation();let s,a=!0;if(this.state.mostRecentlyFocusedNode)if(vy(this.state.mostRecentlyFocusedNode)>0){const l=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:c}=this.state.containerGroups[l];if(c.length>0){const u=c.findIndex(p=>p===this.state.mostRecentlyFocusedNode);u>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?u+1<c.length&&(s=c[u+1],a=!1):u-1>=0&&(s=c[u-1],a=!1))}}else this.state.containerGroups.some(l=>l.tabbableNodes.some(c=>vy(c)>0))||(a=!1);else a=!1;a&&(s=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),s?this.tryFocus(s):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Vn(this,"handlePointerDown",n=>{const i=ti(n);if(!(this.findContainerIndex(i,n)>=0)){if(wy(this.config.clickOutsideDeactivates,n)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}wy(this.config.allowOutsideClick,n)||n.preventDefault()}}),Vn(this,"handleClick",n=>{const i=ti(n);this.findContainerIndex(i,n)>=0||wy(this.config.clickOutsideDeactivates,n)||wy(this.config.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())}),Vn(this,"handleTabKey",n=>{if(this.config.isKeyForward(n)||this.config.isKeyBackward(n)){this.state.recentNavEvent=n;const i=this.config.isKeyBackward(n),o=this.findNextNavNode({event:n,isBackward:i});if(!o)return;xy(n)&&n.preventDefault(),this.tryFocus(o)}}),Vn(this,"handleEscapeKey",n=>{Ime(n)&&wy(this.config.escapeDeactivates,n)!==!1&&(n.preventDefault(),this.deactivate())}),Vn(this,"_mutationObserver"),Vn(this,"setupMutationObserver",()=>{const n=this.doc.defaultView||window;this._mutationObserver=new n.MutationObserver(i=>{i.some(a=>Array.from(a.removedNodes).some(c=>c===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode()),i.some(a=>a.type==="attributes"&&(a.attributeName==="aria-controls"||a.attributeName==="aria-expanded")?!0:a.type==="childList"&&a.addedNodes.length>0?Array.from(a.addedNodes).some(l=>{if(l.nodeType!==Node.ELEMENT_NODE)return!1;const c=l;return Ohe(c)?!0:c.id&&!this.state.containers.some(u=>u.contains(c))?xhe(c):!1}):!1)&&this.state.active&&!this.state.paused&&(this.updateTabbableNodes(),this.updatePortalContainers())})}),Vn(this,"updateObservedNodes",()=>{this._mutationObserver?.disconnect(),this.state.active&&!this.state.paused&&(this.state.containers.map(n=>{this._mutationObserver?.observe(n,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}),this.portalContainers.forEach(n=>{this.observePortalContainer(n)}))}),Vn(this,"getInitialFocusNode",()=>{let n=this.getNodeForOption("initialFocus",{hasFallback:!0});if(n===!1)return!1;if(n===void 0||n&&!Ld(n)){const i=qg(this.doc);if(i&&this.findContainerIndex(i)>=0)n=i;else{const o=this.state.tabbableGroups[0];n=o&&o.firstTabbableNode||this.getNodeForOption("fallbackFocus")}}else n===null&&(n=this.getNodeForOption("fallbackFocus"));if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n.isConnected||(n=this.getNodeForOption("fallbackFocus")),n}),Vn(this,"tryFocus",n=>{if(n!==!1&&n!==qg(this.doc)){if(!n||!n.focus){this.tryFocus(this.getInitialFocusNode());return}n.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=n,jme(n)&&n.select()}}),Vn(this,"deactivate",n=>{if(!this.state.active)return this;const i={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...n};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),XF.deactivateTrap(this.trapStack,this),this.portalContainers.clear();const o=this.getOption(i,"onDeactivate"),s=this.getOption(i,"onPostDeactivate"),a=this.getOption(i,"checkCanReturnFocus"),l=this.getOption(i,"returnFocus","returnFocusOnDeactivate");o?.();const c=()=>{ZF(()=>{if(l){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(u)}s?.()})};if(l&&a){const u=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return a(u).then(c,c),this}return c(),this}),Vn(this,"pause",n=>{if(this.state.paused||!this.state.active)return this;const i=this.getOption(n,"onPause"),o=this.getOption(n,"onPostPause");return this.state.paused=!0,i?.(),this.removeListeners(),this.updateObservedNodes(),o?.(),this}),Vn(this,"unpause",n=>{if(!this.state.paused||!this.state.active)return this;const i=this.getOption(n,"onUnpause"),o=this.getOption(n,"onPostUnpause");return this.state.paused=!1,i?.(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),o?.(),this}),Vn(this,"updateContainerElements",n=>(this.state.containers=Array.isArray(n)?n.filter(Boolean):[n].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Vn(this,"getReturnFocusNode",n=>{const i=this.getNodeForOption("setReturnFocus",{params:[n]});return i||(i===!1?!1:n)}),Vn(this,"getOption",(n,i,o)=>n&&n[i]!==void 0?n[i]:this.config[o||i]),Vn(this,"getNodeForOption",(n,{hasFallback:i=!1,params:o=[]}={})=>{let s=this.config[n];if(typeof s=="function"&&(s=s(...o)),s===!0&&(s=void 0),!s){if(s===void 0||s===!1)return s;throw new Error(`\`${n}\` was specified but was not a node, or did not return a node`)}let a=s;if(typeof s=="string"){try{a=this.doc.querySelector(s)}catch(l){throw new Error(`\`${n}\` appears to be an invalid selector; error="${l.message}"`)}if(!a&&!i)throw new Error(`\`${n}\` as selector refers to no known node`)}return a}),Vn(this,"findNextNavNode",n=>{const{event:i,isBackward:o=!1}=n,s=n.target||ti(i);this.updateTabbableNodes();let a=null;if(this.state.tabbableGroups.length>0){const l=this.findContainerIndex(s,i),c=l>=0?this.state.containerGroups[l]:void 0;if(l<0)o?a=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:a=this.state.tabbableGroups[0].firstTabbableNode;else if(o){let u=this.state.tabbableGroups.findIndex(({firstTabbableNode:p})=>s===p);if(u<0&&(c?.container===s||Ld(s)&&!md(s)&&!c?.nextTabbableNode(s,!1))&&(u=l),u>=0){const p=u===0?this.state.tabbableGroups.length-1:u-1,m=this.state.tabbableGroups[p];a=vy(s)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else xy(i)||(a=c?.nextTabbableNode(s,!1))}else{let u=this.state.tabbableGroups.findIndex(({lastTabbableNode:p})=>s===p);if(u<0&&(c?.container===s||Ld(s)&&!md(s)&&!c?.nextTabbableNode(s))&&(u=l),u>=0){const p=u===this.state.tabbableGroups.length-1?0:u+1,m=this.state.tabbableGroups[p];a=vy(s)>=0?m.firstTabbableNode:m.firstDomTabbableNode}else xy(i)||(a=c?.nextTabbableNode(s))}}else a=this.getNodeForOption("fallbackFocus");return a}),this.trapStack=e.trapStack||Eme;const r={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,followControlledElements:!0,isKeyForward(n){return xy(n)&&!n.shiftKey},isKeyBackward(n){return xy(n)&&n.shiftKey},...e};this.doc=r.document||ks(Array.isArray(t)?t[0]:t),this.config=r,this.updateContainerElements(t),this.setupMutationObserver()}addPortalContainer(t){const e=t.parentElement;e&&!this.portalContainers.has(e)&&(this.portalContainers.add(e),this.state.active&&!this.state.paused&&this.observePortalContainer(e))}observePortalContainer(t){this._mutationObserver?.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-controls","aria-expanded"]})}updatePortalContainers(){this.config.followControlledElements&&this.state.containers.forEach(t=>{vhe(t).forEach(r=>{this.addPortalContainer(r)})})}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(t,e){const r=typeof e?.composedPath=="function"?e.composedPath():void 0;return this.state.containerGroups.findIndex(({container:n,tabbableNodes:i})=>n.contains(t)||r?.includes(n)||i.find(o=>o===t)||this.isControlledElement(n,t))}isControlledElement(t,e){return this.config.followControlledElements?nU(t,e):!1}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(t=>{const e=Um(t),r=RN(t),n=e.length>0?e[0]:void 0,i=e.length>0?e[e.length-1]:void 0,o=r.find(c=>md(c)),s=r.slice().reverse().find(c=>md(c)),a=!!e.find(c=>vy(c)>0);function l(c,u=!0){const p=e.indexOf(c);return p<0?u?r.slice(r.indexOf(c)+1).find(m=>md(m)):r.slice(0,r.indexOf(c)).reverse().find(m=>md(m)):e[p+(u?1:-1)]}return{container:t,tabbableNodes:e,focusableNodes:r,posTabIndexesFound:a,firstTabbableNode:n,lastTabbableNode:i,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:l}}),this.state.tabbableGroups=this.state.containerGroups.filter(t=>t.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(t=>t.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return XF.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?ZF(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(hr(this.doc,"focusin",this.handleFocus,!0),hr(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),hr(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),hr(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),hr(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),hr(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(t=>t()),this.listenerCleanups=[],this}activate(t){if(this.state.active)return this;const e=this.getOption(t,"onActivate"),r=this.getOption(t,"onPostActivate"),n=this.getOption(t,"checkCanFocusTrap");n||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=qg(this.doc),e?.();const i=()=>{n&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),r?.()};return n?(n(this.state.containers.concat()).then(i,i),this):(i(),this)}},xy=t=>t.key==="Tab",wy=(t,...e)=>typeof t=="function"?t(...e):t,Ime=t=>!t.isComposing&&t.key==="Escape",ZF=t=>setTimeout(t,0),jme=t=>t.localName==="input"&&"select"in t&&typeof t.select=="function";function tH(t,e={}){let r;const n=wt(()=>{const i=typeof t=="function"?t():t;if(i){r=new Rme(i,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:i,...e,document:ks(i)});try{r.activate()}catch{}}});return function(){r?.deactivate(),n()}}var yR="data-scroll-lock";function $me(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function rH(t){const e=t??document,r=e.defaultView??window,{documentElement:n,body:i}=e;if(i.hasAttribute(yR))return;const s=r.innerWidth-n.clientWidth;i.setAttribute(yR,"");const a=()=>hfe(n,"--scrollbar-width",`${s}px`),l=$me(n),c=()=>ab(i,{overflow:"hidden",[l]:`${s}px`}),u=()=>{const{scrollX:m,scrollY:v,visualViewport:b}=r,O=b?.offsetLeft??0,x=b?.offsetTop??0,S=ab(i,{position:"fixed",overflow:"hidden",top:`${-(v-Math.floor(x))}px`,left:`${-(m-Math.floor(O))}px`,right:"0",[l]:`${s}px`});return()=>{S?.(),r.scrollTo({left:m,top:v,behavior:"instant"})}},p=[a(),_P()?u():c()];return()=>{p.forEach(m=>m?.()),i.removeAttribute(yR)}}const[nH,MP]=Cn({name:"CheckboxContext",hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),iH=E.forwardRef((t,e)=>{const r=MP(),n=Ae(r.getControlProps(),t);return h.jsx(Ue.div,{...n,ref:e})});iH.displayName="CheckboxControl";function Ame(t){return!(t.metaKey||!SO()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}var Nme=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Mme(t,e,r){const n=r?ti(r):null,i=hi(n);return t=t||n instanceof i.HTMLInputElement&&!Nme.has(n?.type)||n instanceof i.HTMLTextAreaElement||n instanceof i.HTMLElement&&n.isContentEditable,!(t&&e==="keyboard"&&r instanceof i.KeyboardEvent&&!Reflect.has(Dme,r.key))}var rp=null,t2=new Set,DC=new Map,Nf=!1,r2=!1,Dme={Tab:!0,Escape:!0};function DP(t,e){for(let r of t2)r(t,e)}function LC(t){Nf=!0,Ame(t)&&(rp="keyboard",DP("keyboard",t))}function wa(t){rp="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(Nf=!0,DP("pointer",t))}function oH(t){$he(t)&&(Nf=!0,rp="virtual")}function sH(t){const e=ti(t);e===hi(e)||e===ks(e)||(!Nf&&!r2&&(rp="virtual",DP("virtual",t)),Nf=!1,r2=!1)}function aH(){Nf=!1,r2=!0}function Lme(t){if(typeof window>"u"||DC.get(hi(t)))return;const e=hi(t),r=ks(t);let n=e.HTMLElement.prototype.focus;function i(){rp="virtual",DP("virtual",null),Nf=!0,n.apply(this,arguments)}try{Object.defineProperty(e.HTMLElement.prototype,"focus",{configurable:!0,value:i})}catch{}r.addEventListener("keydown",LC,!0),r.addEventListener("keyup",LC,!0),r.addEventListener("click",oH,!0),e.addEventListener("focus",sH,!0),e.addEventListener("blur",aH,!1),typeof e.PointerEvent<"u"?(r.addEventListener("pointerdown",wa,!0),r.addEventListener("pointermove",wa,!0),r.addEventListener("pointerup",wa,!0)):(r.addEventListener("mousedown",wa,!0),r.addEventListener("mousemove",wa,!0),r.addEventListener("mouseup",wa,!0)),e.addEventListener("beforeunload",()=>{Vme(t)},{once:!0}),DC.set(e,{focus:n})}var Vme=(t,e)=>{const r=hi(t),n=ks(t),i=DC.get(r);if(i){try{Object.defineProperty(r.HTMLElement.prototype,"focus",{configurable:!0,value:i.focus})}catch{}n.removeEventListener("keydown",LC,!0),n.removeEventListener("keyup",LC,!0),n.removeEventListener("click",oH,!0),r.removeEventListener("focus",sH,!0),r.removeEventListener("blur",aH,!1),typeof r.PointerEvent<"u"?(n.removeEventListener("pointerdown",wa,!0),n.removeEventListener("pointermove",wa,!0),n.removeEventListener("pointerup",wa,!0)):(n.removeEventListener("mousedown",wa,!0),n.removeEventListener("mousemove",wa,!0),n.removeEventListener("mouseup",wa,!0)),DC.delete(r)}};function db(){return rp==="keyboard"}function KN(t={}){const{isTextInput:e,autoFocus:r,onChange:n,root:i}=t;Lme(i),n?.({isFocusVisible:r||db(),modality:rp});const o=(s,a)=>{Mme(!!e,s,a)&&n?.({isFocusVisible:db(),modality:s})};return t2.add(o),()=>{t2.delete(o)}}var lH=Ct("checkbox").parts("root","label","control","indicator"),Rw=lH.build(),cH=t=>t.ids?.root??`checkbox:${t.id}`,YF=t=>t.ids?.label??`checkbox:${t.id}:label`,Fme=t=>t.ids?.control??`checkbox:${t.id}:control`,n2=t=>t.ids?.hiddenInput??`checkbox:${t.id}:input`,Qme=t=>t.getById(cH(t)),l0=t=>t.getById(n2(t));function Bme(t,e){const{send:r,context:n,prop:i,computed:o,scope:s}=t,a=!!i("disabled"),l=!!i("readOnly"),c=!!i("required"),u=!!i("invalid"),p=!a&&n.get("focused"),m=!a&&n.get("focusVisible"),v=o("checked"),b=o("indeterminate"),O={"data-active":st(n.get("active")),"data-focus":st(p),"data-focus-visible":st(m),"data-readonly":st(l),"data-hover":st(n.get("hovered")),"data-disabled":st(a),"data-state":b?"indeterminate":v?"checked":"unchecked","data-invalid":st(u),"data-required":st(c)};return{checked:v,disabled:a,indeterminate:b,focused:p,checkedState:v,setChecked(x){r({type:"CHECKED.SET",checked:x,isTrusted:!1})},toggleChecked(){r({type:"CHECKED.TOGGLE",checked:v,isTrusted:!1})},getRootProps(){return e.label({...Rw.root.attrs,...O,dir:i("dir"),id:cH(s),htmlFor:n2(s),onPointerMove(){a||r({type:"CONTEXT.SET",context:{hovered:!0}})},onPointerLeave(){a||r({type:"CONTEXT.SET",context:{hovered:!1}})},onClick(x){ti(x)===l0(s)&&x.stopPropagation()}})},getLabelProps(){return e.element({...Rw.label.attrs,...O,dir:i("dir"),id:YF(s)})},getControlProps(){return e.element({...Rw.control.attrs,...O,dir:i("dir"),id:Fme(s),"aria-hidden":!0})},getIndicatorProps(){return e.element({...Rw.indicator.attrs,...O,dir:i("dir"),hidden:!b&&!v})},getHiddenInputProps(){return e.input({id:n2(s),type:"checkbox",required:i("required"),defaultChecked:v,disabled:a,"aria-labelledby":YF(s),"aria-invalid":u,name:i("name"),form:i("form"),value:i("value"),style:xU,onFocus(){const x=db();r({type:"CONTEXT.SET",context:{focused:!0,focusVisible:x}})},onBlur(){r({type:"CONTEXT.SET",context:{focused:!1,focusVisible:!1}})},onClick(x){if(l){x.preventDefault();return}const S=x.currentTarget.checked;r({type:"CHECKED.SET",checked:S,isTrusted:!0})}})}}}var{not:KF}=Cl(),zme={props({props:t}){return{value:"on",...t,defaultChecked:!!t.defaultChecked}},initialState(){return"ready"},context({prop:t,bindable:e}){return{checked:e(()=>({defaultValue:t("defaultChecked"),value:t("checked"),onChange(r){t("onCheckedChange")?.({checked:r})}})),fieldsetDisabled:e(()=>({defaultValue:!1})),focusVisible:e(()=>({defaultValue:!1})),active:e(()=>({defaultValue:!1})),focused:e(()=>({defaultValue:!1})),hovered:e(()=>({defaultValue:!1}))}},watch({track:t,context:e,prop:r,action:n}){t([()=>r("disabled")],()=>{n(["removeFocusIfNeeded"])}),t([()=>e.get("checked")],()=>{n(["syncInputElement"])})},effects:["trackFormControlState","trackPressEvent","trackFocusVisible"],on:{"CHECKED.TOGGLE":[{guard:KF("isTrusted"),actions:["toggleChecked","dispatchChangeEvent"]},{actions:["toggleChecked"]}],"CHECKED.SET":[{guard:KF("isTrusted"),actions:["setChecked","dispatchChangeEvent"]},{actions:["setChecked"]}],"CONTEXT.SET":{actions:["setContext"]}},computed:{indeterminate:({context:t})=>BS(t.get("checked")),checked:({context:t})=>qme(t.get("checked")),disabled:({context:t,prop:e})=>!!e("disabled")||t.get("fieldsetDisabled")},states:{ready:{}},implementations:{guards:{isTrusted:({event:t})=>!!t.isTrusted},effects:{trackPressEvent({context:t,computed:e,scope:r}){if(!e("disabled"))return vU({pointerNode:Qme(r),keyboardNode:l0(r),isValidKey:n=>n.key===" ",onPress:()=>t.set("active",!1),onPressStart:()=>t.set("active",!0),onPressEnd:()=>t.set("active",!1)})},trackFocusVisible({computed:t,scope:e}){if(!t("disabled"))return KN({root:e.getRootNode?.()})},trackFormControlState({context:t,scope:e}){return kO(l0(e),{onFieldsetDisabledChange(r){t.set("fieldsetDisabled",r)},onFormReset(){t.set("checked",t.initial("checked"))}})}},actions:{setContext({context:t,event:e}){for(const r in e.context)t.set(r,e.context[r])},syncInputElement({context:t,computed:e,scope:r}){const n=l0(r);n&&(TN(n,e("checked")),n.indeterminate=BS(t.get("checked")))},removeFocusIfNeeded({context:t,prop:e}){e("disabled")&&t.get("focused")&&(t.set("focused",!1),t.set("focusVisible",!1))},setChecked({context:t,event:e}){t.set("checked",e.checked)},toggleChecked({context:t,computed:e}){const r=BS(e("checked"))?!0:!e("checked");t.set("checked",r)},dispatchChangeEvent({computed:t,scope:e}){queueMicrotask(()=>{const r=l0(e);uU(r,{checked:t("checked")})})}}}};function BS(t){return t==="indeterminate"}function qme(t){return BS(t)?!1:!!t}xt()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);const uH=lH.extendWith("group");function Wme(t){const{value:e,onChange:r,defaultValue:n}=t,[i,o]=E.useState(n),s=e!==void 0,a=s?e:i,l=E.useCallback(c=>(s||o(c),r?.(c)),[s,r]);return[a,l]}function Ume(t={}){const{defaultValue:e,value:r,onValueChange:n,disabled:i,readOnly:o,name:s,invalid:a}=t,l=!(i||o),c=kU(n,{sync:!0}),[u,p]=Wme({value:r,defaultValue:e||[],onChange:c}),m=S=>u.some(w=>String(w)===String(S)),v=S=>{m(S)?O(S):b(S)},b=S=>{l&&(m(S)||p(u.concat(S)))},O=S=>{l&&p(u.filter(w=>String(w)!==String(S)))};return{isChecked:m,value:u,name:s,disabled:!!i,readOnly:!!o,invalid:!!a,setValue:p,addValue:b,toggleValue:v,getItemProps:S=>({checked:S.value!=null?m(S.value):void 0,onCheckedChange(){S.value!=null&&v(S.value)},name:s,disabled:i,readOnly:o,invalid:a})}}const[Hme,Gme]=Cn({name:"CheckboxGroupContext",hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),dH=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["defaultValue","value","onValueChange","disabled","invalid","readOnly","name"]),i=Ume(r);return h.jsx(Hme,{value:i,children:h.jsx(Ue.div,{ref:e,role:"group",...n,...uH.build().group.attrs})})});dH.displayName="CheckboxGroup";const[Krt,dh]=Cn({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1}),hH=E.forwardRef((t,e)=>{const r=MP(),n=Ae(r.getHiddenInputProps(),t),i=dh();return h.jsx(Ue.input,{"aria-describedby":i?.ariaDescribedby,...n,ref:e})});hH.displayName="CheckboxHiddenInput";const fH=E.forwardRef((t,e)=>{const r=MP(),n=Ae(r.getLabelProps(),t);return h.jsx(Ue.span,{...n,ref:e})});fH.displayName="CheckboxLabel";const Xme=(t={})=>{const e=Gme(),r=dh(),n=E.useMemo(()=>Ae(t,e?.getItemProps({value:t.value})??{}),[t,e]),i=E.useId(),{getRootNode:o}=Cs(),{dir:s}=Va(),a={id:i,ids:{label:r?.ids.label,hiddenInput:r?.ids.control},dir:s,disabled:r?.disabled,readOnly:r?.readOnly,invalid:r?.invalid,required:r?.required,getRootNode:o,...n},l=Ps(zme,a);return Bme(l,oa)},pH=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["checked","defaultChecked","disabled","form","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]),i=Xme(r),o=Ae(i.getRootProps(),n);return h.jsx(nH,{value:i,children:h.jsx(Ue.label,{...o,ref:e})})});pH.displayName="CheckboxRoot";const gH=E.forwardRef((t,e)=>{const[{value:r},n]=Nn()(t,["value"]),i=Ae(r.getRootProps(),n);return h.jsx(nH,{value:r,children:h.jsx(Ue.label,{...i,ref:e})})});gH.displayName="CheckboxRootProvider";var mH=Ct("clipboard").parts("root","control","trigger","indicator","input","label");mH.build();xt()(["getRootNode","id","ids","value","defaultValue","timeout","onStatusChange","onValueChange"]);xt()(["copied"]);const Zme=qU.extendWith("view");var Yme=Object.defineProperty,Kme=(t,e,r)=>e in t?Yme(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Me=(t,e,r)=>Kme(t,typeof e!="symbol"?e+"":e,r),zS={itemToValue(t){return typeof t=="string"?t:pf(t)&&ll(t,"value")?t.value:""},itemToString(t){return typeof t=="string"?t:pf(t)&&ll(t,"label")?t.label:zS.itemToValue(t)},isItemDisabled(t){return pf(t)&&ll(t,"disabled")?!!t.disabled:!1}},LP=class vH{constructor(e){this.options=e,Me(this,"items"),Me(this,"indexMap",null),Me(this,"copy",r=>new vH({...this.options,items:r??[...this.items]})),Me(this,"isEqual",r=>Ks(this.items,r.items)),Me(this,"setItems",r=>this.copy(r)),Me(this,"getValues",(r=this.items)=>{const n=[];for(const i of r){const o=this.getItemValue(i);o!=null&&n.push(o)}return n}),Me(this,"find",r=>{if(r==null)return null;const n=this.indexOf(r);return n!==-1?this.at(n):null}),Me(this,"findMany",r=>{const n=[];for(const i of r){const o=this.find(i);o!=null&&n.push(o)}return n}),Me(this,"at",r=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[r]??null;let n=0;const i=this.group();for(const[,o]of i)for(const s of o){if(n===r)return s;n++}return null}),Me(this,"sortFn",(r,n)=>{const i=this.indexOf(r),o=this.indexOf(n);return(i??0)-(o??0)}),Me(this,"sort",r=>[...r].sort(this.sortFn.bind(this))),Me(this,"getItemValue",r=>r==null?null:this.options.itemToValue?.(r)??zS.itemToValue(r)),Me(this,"getItemDisabled",r=>r==null?!1:this.options.isItemDisabled?.(r)??zS.isItemDisabled(r)),Me(this,"stringifyItem",r=>r==null?null:this.options.itemToString?.(r)??zS.itemToString(r)),Me(this,"stringify",r=>r==null?null:this.stringifyItem(this.find(r))),Me(this,"stringifyItems",(r,n=", ")=>{const i=[];for(const o of r){const s=this.stringifyItem(o);s!=null&&i.push(s)}return i.join(n)}),Me(this,"stringifyMany",(r,n)=>this.stringifyItems(this.findMany(r),n)),Me(this,"has",r=>this.indexOf(r)!==-1),Me(this,"hasItem",r=>r==null?!1:this.has(this.getItemValue(r))),Me(this,"group",()=>{const{groupBy:r,groupSort:n}=this.options;if(!r)return[["",[...this.items]]];const i=new Map;this.items.forEach((s,a)=>{const l=r(s,a);i.has(l)||i.set(l,[]),i.get(l).push(s)});let o=Array.from(i.entries());return n&&o.sort(([s],[a])=>{if(typeof n=="function")return n(s,a);if(Array.isArray(n)){const l=n.indexOf(s),c=n.indexOf(a);return l===-1?1:c===-1?-1:l-c}return n==="asc"?s.localeCompare(a):n==="desc"?a.localeCompare(s):0}),o}),Me(this,"getNextValue",(r,n=1,i=!1)=>{let o=this.indexOf(r);if(o===-1)return null;for(o=i?Math.min(o+n,this.size-1):o+n;o<=this.size&&this.getItemDisabled(this.at(o));)o++;return this.getItemValue(this.at(o))}),Me(this,"getPreviousValue",(r,n=1,i=!1)=>{let o=this.indexOf(r);if(o===-1)return null;for(o=i?Math.max(o-n,0):o-n;o>=0&&this.getItemDisabled(this.at(o));)o--;return this.getItemValue(this.at(o))}),Me(this,"indexOf",r=>{if(r==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(n=>this.getItemValue(n)===r);if(!this.indexMap){this.indexMap=new Map;let n=0;const i=this.group();for(const[,o]of i)for(const s of o){const a=this.getItemValue(s);a!=null&&this.indexMap.set(a,n),n++}}return this.indexMap.get(r)??-1}),Me(this,"getByText",(r,n)=>{const i=n!=null?this.indexOf(n):-1,o=r.length===1;for(let s=0;s<this.items.length;s++){const a=this.items[(i+s+1)%this.items.length];if(!(o&&this.getItemValue(a)===n)&&!this.getItemDisabled(a)&&Jme(this.stringifyItem(a),r))return a}}),Me(this,"search",(r,n)=>{const{state:i,currentValue:o,timeout:s=350}=n,a=i.keysSoFar+r,c=a.length>1&&Array.from(a).every(b=>b===a[0])?a[0]:a,u=this.getByText(c,o),p=this.getItemValue(u);function m(){clearTimeout(i.timer),i.timer=-1}function v(b){i.keysSoFar=b,m(),b!==""&&(i.timer=+setTimeout(()=>{v(""),m()},s))}return v(a),p}),Me(this,"update",(r,n)=>{let i=this.indexOf(r);return i===-1?this:this.copy([...this.items.slice(0,i),n,...this.items.slice(i+1)])}),Me(this,"upsert",(r,n,i="append")=>{let o=this.indexOf(r);return o===-1?(i==="append"?this.append:this.prepend)(n):this.copy([...this.items.slice(0,o),n,...this.items.slice(o+1)])}),Me(this,"insert",(r,...n)=>this.copy(Sy(this.items,r,...n))),Me(this,"insertBefore",(r,...n)=>{let i=this.indexOf(r);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(Sy(this.items,i,...n))}),Me(this,"insertAfter",(r,...n)=>{let i=this.indexOf(r);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(Sy(this.items,i+1,...n))}),Me(this,"prepend",(...r)=>this.copy(Sy(this.items,0,...r))),Me(this,"append",(...r)=>this.copy(Sy(this.items,this.items.length,...r))),Me(this,"filter",r=>{const n=this.items.filter((i,o)=>r(this.stringifyItem(i),o,i));return this.copy(n)}),Me(this,"remove",(...r)=>{const n=r.map(i=>typeof i=="string"?i:this.getItemValue(i));return this.copy(this.items.filter(i=>{const o=this.getItemValue(i);return o==null?!1:!n.includes(o)}))}),Me(this,"move",(r,n)=>{const i=this.indexOf(r);return i===-1?this:this.copy(Iw(this.items,[i],n))}),Me(this,"moveBefore",(r,...n)=>{let i=this.items.findIndex(s=>this.getItemValue(s)===r);if(i===-1)return this;let o=n.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(Iw(this.items,o,i))}),Me(this,"moveAfter",(r,...n)=>{let i=this.items.findIndex(s=>this.getItemValue(s)===r);if(i===-1)return this;let o=n.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(Iw(this.items,o,i+1))}),Me(this,"reorder",(r,n)=>this.copy(Iw(this.items,[r],n))),Me(this,"compareValue",(r,n)=>{const i=this.indexOf(r),o=this.indexOf(n);return i<o?-1:i>o?1:0}),Me(this,"range",(r,n)=>{let i=[],o=r;for(;o!=null;){if(this.find(o)&&i.push(o),o===n)return i;o=this.getNextValue(o)}return[]}),Me(this,"getValueRange",(r,n)=>r&&n?this.compareValue(r,n)<=0?this.range(r,n):this.range(n,r):[]),Me(this,"toString",()=>{let r="";for(const n of this.items){const i=this.getItemValue(n),o=this.stringifyItem(n),s=this.getItemDisabled(n),a=[i,o,s].filter(Boolean).join(":");r+=a+","}return r}),Me(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...e.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},Jme=(t,e)=>!!t?.toLowerCase().startsWith(e.toLowerCase());function Sy(t,e,...r){return[...t.slice(0,e),...r,...t.slice(e)]}function Iw(t,e,r){e=[...e].sort((i,o)=>i-o);const n=e.map(i=>t[i]);for(let i=e.length-1;i>=0;i--)t=[...t.slice(0,e[i]),...t.slice(e[i]+1)];return r=Math.max(0,r-e.filter(i=>i<r).length),[...t.slice(0,r),...n,...t.slice(r)]}function yH(t,e,r){for(let n=0;n<e.length;n++)t=r.getChildren(t,e.slice(n+1))[e[n]];return t}function eve(t){const e=tve(t),r=[],n=new Set;for(const i of e){const o=i.join();n.has(o)||(n.add(o),r.push(i))}return r}function bH(t,e){for(let r=0;r<Math.min(t.length,e.length);r++){if(t[r]<e[r])return-1;if(t[r]>e[r])return 1}return t.length-e.length}function tve(t){return t.sort(bH)}function rve(t,e){let r;return Us(t,{...e,onEnter:(n,i)=>{if(e.predicate(n,i))return r=n,"stop"}}),r}function nve(t,e){const r=[];return Us(t,{onEnter:(n,i)=>{e.predicate(n,i)&&r.push(n)},getChildren:e.getChildren}),r}function JF(t,e){let r;return Us(t,{onEnter:(n,i)=>{if(e.predicate(n,i))return r=[...i],"stop"},getChildren:e.getChildren}),r}function ive(t,e){let r=e.initialResult;return Us(t,{...e,onEnter:(n,i)=>{r=e.nextResult(r,n,i)}}),r}function ove(t,e){return ive(t,{...e,initialResult:[],nextResult:(r,n,i)=>(r.push(...e.transform(n,i)),r)})}function sve(t,e){const{predicate:r,create:n,getChildren:i}=e,o=(s,a)=>{const l=i(s,a),c=[];l.forEach((v,b)=>{const O=[...a,b],x=o(v,O);x&&c.push(x)});const u=a.length===0,p=r(s,a),m=c.length>0;return u||p||m?n(s,c,a):null};return o(t,[])||n(t,[],[])}function ave(t,e){const r=[];let n=0;const i=new Map,o=new Map;return Us(t,{getChildren:e.getChildren,onEnter:(s,a)=>{i.has(s)||i.set(s,n++);const l=e.getChildren(s,a);l.forEach(v=>{o.has(v)||o.set(v,s),i.has(v)||i.set(v,n++)});const c=l.length>0?l.map(v=>i.get(v)):void 0,u=o.get(s),p=u?i.get(u):void 0,m=i.get(s);r.push({...s,_children:c,_parent:p,_index:m})}}),r}function lve(t,e){return{type:"insert",index:t,nodes:e}}function cve(t){return{type:"remove",indexes:t}}function JN(){return{type:"replace"}}function OH(t){return[t.slice(0,-1),t[t.length-1]]}function xH(t,e,r=new Map){const[n,i]=OH(t);for(let s=n.length-1;s>=0;s--){const a=n.slice(0,s).join();switch(r.get(a)?.type){case"remove":continue}r.set(a,JN())}const o=r.get(n.join());switch(o?.type){case"remove":r.set(n.join(),{type:"removeThenInsert",removeIndexes:o.indexes,insertIndex:i,insertNodes:e});break;default:r.set(n.join(),lve(i,e))}return r}function wH(t){const e=new Map,r=new Map;for(const n of t){const i=n.slice(0,-1).join(),o=r.get(i)??[];o.push(n[n.length-1]),r.set(i,o.sort((s,a)=>s-a))}for(const n of t)for(let i=n.length-2;i>=0;i--){const o=n.slice(0,i).join();e.has(o)||e.set(o,JN())}for(const[n,i]of r)e.set(n,cve(i));return e}function uve(t,e){const r=new Map,[n,i]=OH(t);for(let o=n.length-1;o>=0;o--){const s=n.slice(0,o).join();r.set(s,JN())}return r.set(n.join(),{type:"removeThenInsert",removeIndexes:[i],insertIndex:i,insertNodes:[e]}),r}function VP(t,e,r){return dve(t,{...r,getChildren:(n,i)=>{const o=i.join();switch(e.get(o)?.type){case"replace":case"remove":case"removeThenInsert":case"insert":return r.getChildren(n,i);default:return[]}},transform:(n,i,o)=>{const s=o.join(),a=e.get(s);switch(a?.type){case"remove":return r.create(n,i.filter((u,p)=>!a.indexes.includes(p)),o);case"removeThenInsert":const l=i.filter((u,p)=>!a.removeIndexes.includes(p)),c=a.removeIndexes.reduce((u,p)=>p<u?u-1:u,a.insertIndex);return r.create(n,e6(l,c,0,...a.insertNodes),o);case"insert":return r.create(n,e6(i,a.index,0,...a.nodes),o);case"replace":return r.create(n,i,o);default:return n}}})}function e6(t,e,r,...n){return[...t.slice(0,e),...n,...t.slice(e+r)]}function dve(t,e){const r={};return Us(t,{...e,onLeave:(n,i)=>{const o=[0,...i],s=o.join(),a=e.transform(n,r[s]??[],i),l=o.slice(0,-1).join(),c=r[l]??[];c.push(a),r[l]=c}}),r[""][0]}function hve(t,e){const{nodes:r,at:n}=e;if(n.length===0)throw new Error("Can't insert nodes at the root");const i=xH(n,r);return VP(t,i,e)}function fve(t,e){if(e.at.length===0)return e.node;const r=uve(e.at,e.node);return VP(t,r,e)}function pve(t,e){if(e.indexPaths.length===0)return t;for(const n of e.indexPaths)if(n.length===0)throw new Error("Can't remove the root node");const r=wH(e.indexPaths);return VP(t,r,e)}function gve(t,e){if(e.indexPaths.length===0)return t;for(const o of e.indexPaths)if(o.length===0)throw new Error("Can't move the root node");if(e.to.length===0)throw new Error("Can't move nodes to the root");const r=eve(e.indexPaths),n=r.map(o=>yH(t,o,e)),i=xH(e.to,n,wH(r));return VP(t,i,e)}function Us(t,e){const{onEnter:r,onLeave:n,getChildren:i}=e;let o=[],s=[{node:t}];const a=e.reuseIndexPath?()=>o:()=>o.slice();for(;s.length>0;){let l=s[s.length-1];if(l.state===void 0){const u=r?.(l.node,a());if(u==="stop")return;l.state=u==="skip"?-1:0}const c=l.children||i(l.node,a());if(l.children||(l.children=c),l.state!==-1){if(l.state<c.length){let p=l.state;o.push(p),s.push({node:c[p]}),l.state=p+1;continue}if(n?.(l.node,a())==="stop")return}o.pop(),s.pop()}}var SH=class CH{constructor(e){this.options=e,Me(this,"rootNode"),Me(this,"isEqual",r=>Ks(this.rootNode,r.rootNode)),Me(this,"getNodeChildren",r=>this.options.nodeToChildren?.(r)??cg.nodeToChildren(r)??[]),Me(this,"resolveIndexPath",r=>typeof r=="string"?this.getIndexPath(r):r),Me(this,"resolveNode",r=>{const n=this.resolveIndexPath(r);return n?this.at(n):void 0}),Me(this,"getNodeChildrenCount",r=>this.options.nodeToChildrenCount?.(r)??cg.nodeToChildrenCount(r)),Me(this,"getNodeValue",r=>this.options.nodeToValue?.(r)??cg.nodeToValue(r)),Me(this,"getNodeDisabled",r=>this.options.isNodeDisabled?.(r)??cg.isNodeDisabled(r)),Me(this,"stringify",r=>{const n=this.findNode(r);return n?this.stringifyNode(n):null}),Me(this,"stringifyNode",r=>this.options.nodeToString?.(r)??cg.nodeToString(r)),Me(this,"getFirstNode",(r=this.rootNode)=>{let n;return Us(r,{getChildren:this.getNodeChildren,onEnter:(i,o)=>{if(!n&&o.length>0&&!this.getNodeDisabled(i))return n=i,"stop"}}),n}),Me(this,"getLastNode",(r=this.rootNode,n={})=>{let i;return Us(r,{getChildren:this.getNodeChildren,onEnter:(o,s)=>{if(!this.isSameNode(o,r)){if(n.skip?.({value:this.getNodeValue(o),node:o,indexPath:s}))return"skip";s.length>0&&!this.getNodeDisabled(o)&&(i=o)}}}),i}),Me(this,"at",r=>yH(this.rootNode,r,{getChildren:this.getNodeChildren})),Me(this,"findNode",(r,n=this.rootNode)=>rve(n,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===r})),Me(this,"findNodes",(r,n=this.rootNode)=>{const i=new Set(r.filter(o=>o!=null));return nve(n,{getChildren:this.getNodeChildren,predicate:o=>i.has(this.getNodeValue(o))})}),Me(this,"sort",r=>r.reduce((n,i)=>{const o=this.getIndexPath(i);return o&&n.push({value:i,indexPath:o}),n},[]).sort((n,i)=>bH(n.indexPath,i.indexPath)).map(({value:n})=>n)),Me(this,"getIndexPath",r=>JF(this.rootNode,{getChildren:this.getNodeChildren,predicate:n=>this.getNodeValue(n)===r})),Me(this,"getValue",r=>{const n=this.at(r);return n?this.getNodeValue(n):void 0}),Me(this,"getValuePath",r=>{if(!r)return[];const n=[];let i=[...r];for(;i.length>0;){const o=this.at(i);o&&n.unshift(this.getNodeValue(o)),i.pop()}return n}),Me(this,"getDepth",r=>JF(this.rootNode,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===r})?.length??0),Me(this,"isSameNode",(r,n)=>this.getNodeValue(r)===this.getNodeValue(n)),Me(this,"isRootNode",r=>this.isSameNode(r,this.rootNode)),Me(this,"contains",(r,n)=>!r||!n?!1:n.slice(0,r.length).every((i,o)=>r[o]===n[o])),Me(this,"getNextNode",(r,n={})=>{let i=!1,o;return Us(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{if(this.isRootNode(s))return;const l=this.getNodeValue(s);if(n.skip?.({value:l,node:s,indexPath:a}))return l===r&&(i=!0),"skip";if(i&&!this.getNodeDisabled(s))return o=s,"stop";l===r&&(i=!0)}}),o}),Me(this,"getPreviousNode",(r,n={})=>{let i,o=!1;return Us(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{if(this.isRootNode(s))return;const l=this.getNodeValue(s);if(n.skip?.({value:l,node:s,indexPath:a}))return"skip";if(l===r)return o=!0,"stop";this.getNodeDisabled(s)||(i=s)}}),o?i:void 0}),Me(this,"getParentNodes",r=>{const n=this.resolveIndexPath(r)?.slice();if(!n)return[];const i=[];for(;n.length>0;){n.pop();const o=this.at(n);o&&!this.isRootNode(o)&&i.unshift(o)}return i}),Me(this,"getDescendantNodes",(r,n)=>{const i=this.resolveNode(r);if(!i)return[];const o=[];return Us(i,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{a.length!==0&&(!n?.withBranch&&this.isBranchNode(s)||o.push(s))}}),o}),Me(this,"getDescendantValues",(r,n)=>this.getDescendantNodes(r,n).map(o=>this.getNodeValue(o))),Me(this,"getParentIndexPath",r=>r.slice(0,-1)),Me(this,"getParentNode",r=>{const n=this.resolveIndexPath(r);return n?this.at(this.getParentIndexPath(n)):void 0}),Me(this,"visit",r=>{const{skip:n,...i}=r;Us(this.rootNode,{...i,getChildren:this.getNodeChildren,onEnter:(o,s)=>{if(!this.isRootNode(o))return n?.({value:this.getNodeValue(o),node:o,indexPath:s})?"skip":i.onEnter?.(o,s)}})}),Me(this,"getPreviousSibling",r=>{const n=this.getParentNode(r);if(!n)return;const i=this.getNodeChildren(n);let o=r[r.length-1];for(;--o>=0;){const s=i[o];if(!this.getNodeDisabled(s))return s}}),Me(this,"getNextSibling",r=>{const n=this.getParentNode(r);if(!n)return;const i=this.getNodeChildren(n);let o=r[r.length-1];for(;++o<i.length;){const s=i[o];if(!this.getNodeDisabled(s))return s}}),Me(this,"getSiblingNodes",r=>{const n=this.getParentNode(r);return n?this.getNodeChildren(n):[]}),Me(this,"getValues",(r=this.rootNode)=>ove(r,{getChildren:this.getNodeChildren,transform:i=>[this.getNodeValue(i)]}).slice(1)),Me(this,"isValidDepth",(r,n)=>n==null?!0:typeof n=="function"?n(r.length):r.length===n),Me(this,"isBranchNode",r=>this.getNodeChildren(r).length>0||this.getNodeChildrenCount(r)!=null),Me(this,"getBranchValues",(r=this.rootNode,n={})=>{let i=[];return Us(r,{getChildren:this.getNodeChildren,onEnter:(o,s)=>{if(s.length===0)return;const a=this.getNodeValue(o);if(n.skip?.({value:a,node:o,indexPath:s}))return"skip";this.isBranchNode(o)&&this.isValidDepth(s,n.depth)&&i.push(this.getNodeValue(o))}}),i}),Me(this,"flatten",(r=this.rootNode)=>ave(r,{getChildren:this.getNodeChildren})),Me(this,"_create",(r,n)=>this.getNodeChildren(r).length>0||n.length>0?{...r,children:n}:{...r}),Me(this,"_insert",(r,n,i)=>this.copy(hve(r,{at:n,nodes:i,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"copy",r=>new CH({...this.options,rootNode:r})),Me(this,"_replace",(r,n,i)=>this.copy(fve(r,{at:n,node:i,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"_move",(r,n,i)=>this.copy(gve(r,{indexPaths:n,to:i,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"_remove",(r,n)=>this.copy(pve(r,{indexPaths:n,getChildren:this.getNodeChildren,create:this._create}))),Me(this,"replace",(r,n)=>this._replace(this.rootNode,r,n)),Me(this,"remove",r=>this._remove(this.rootNode,r)),Me(this,"insertBefore",(r,n)=>this.getParentNode(r)?this._insert(this.rootNode,r,n):void 0),Me(this,"insertAfter",(r,n)=>{if(!this.getParentNode(r))return;const o=[...r.slice(0,-1),r[r.length-1]+1];return this._insert(this.rootNode,o,n)}),Me(this,"move",(r,n)=>this._move(this.rootNode,r,n)),Me(this,"filter",r=>{const n=sve(this.rootNode,{predicate:r,getChildren:this.getNodeChildren,create:this._create});return this.copy(n)}),Me(this,"toJSON",()=>this.getValues(this.rootNode)),this.rootNode=e.rootNode}},cg={nodeToValue(t){return typeof t=="string"?t:pf(t)&&ll(t,"value")?t.value:""},nodeToString(t){return typeof t=="string"?t:pf(t)&&ll(t,"label")?t.label:cg.nodeToValue(t)},isNodeDisabled(t){return pf(t)&&ll(t,"disabled")?!!t.disabled:!1},nodeToChildren(t){return t.children},nodeToChildrenCount(t){if(pf(t)&&ll(t,"childrenCount"))return t.childrenCount}},kH=Ct("combobox").parts("root","clearTrigger","content","control","input","item","itemGroup","itemGroupLabel","itemIndicator","itemText","label","list","positioner","trigger");kH.build();var PH=t=>new LP(t);PH.empty=()=>new LP({items:[]});var mve=t=>t.ids?.control??`combobox:${t.id}:control`,vve=t=>t.ids?.input??`combobox:${t.id}:input`,yve=t=>t.ids?.content??`combobox:${t.id}:content`,bve=t=>t.ids?.positioner??`combobox:${t.id}:popper`,Ove=t=>t.ids?.trigger??`combobox:${t.id}:toggle-btn`,xve=t=>t.ids?.clearTrigger??`combobox:${t.id}:clear-btn`,hd=t=>t.getById(yve(t)),ug=t=>t.getById(vve(t)),t6=t=>t.getById(bve(t)),r6=t=>t.getById(mve(t)),c0=t=>t.getById(Ove(t)),n6=t=>t.getById(xve(t)),Cy=(t,e)=>{if(e==null)return null;const r=`[role=option][data-value="${CSS.escape(e)}"]`;return Hm(hd(t),r)},i6=t=>{const e=ug(t);t.isActiveElement(e)||e?.focus({preventScroll:!0})},wve=t=>{const e=c0(t);t.isActiveElement(e)||e?.focus({preventScroll:!0})},{guards:Sve,createMachine:Cve,choose:kve}=NN(),{and:qi,not:Ms}=Sve;Cve({props({props:t}){return{loopFocus:!0,openOnClick:!1,defaultValue:[],closeOnSelect:!t.multiple,allowCustomValue:!1,alwaysSubmitOnEnter:!1,inputBehavior:"none",selectionBehavior:t.multiple?"clear":"replace",openOnKeyPress:!0,openOnChange:!0,composite:!0,navigate({node:e}){IN(e)},collection:PH.empty(),...t,positioning:{placement:"bottom",sameWidth:!0,...t.positioning},translations:{triggerLabel:"Toggle suggestions",clearTriggerLabel:"Clear value",...t.translations}}},initialState({prop:t}){return t("open")||t("defaultOpen")?"suggesting":"idle"},context({prop:t,bindable:e,getContext:r,getEvent:n}){return{currentPlacement:e(()=>({defaultValue:void 0})),value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),isEqual:Ks,hash(i){return i.join(",")},onChange(i){const o=r(),s=o.get("selectedItems"),a=t("collection"),l=i.map(c=>s.find(p=>a.getItemValue(p)===c)||a.find(c));o.set("selectedItems",l),t("onValueChange")?.({value:i,items:l})}})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(i){const o=t("collection").find(i);t("onHighlightChange")?.({highlightedValue:i,highlightedItem:o})}})),inputValue:e(()=>{let i=t("inputValue")||t("defaultInputValue")||"";const o=t("defaultValue")||t("value")||[];if(!i.trim()&&!t("multiple")){const s=t("collection").stringifyMany(o);i=Kc(t("selectionBehavior"),{preserve:i||s,replace:s,clear:""})}return{defaultValue:i,value:t("inputValue"),onChange(s){const a=n(),l=(a.previousEvent||a).src;t("onInputValueChange")?.({inputValue:s,reason:l})}}}),highlightedItem:e(()=>{const i=t("highlightedValue");return{defaultValue:t("collection").find(i)}}),selectedItems:e(()=>{const i=t("value")||t("defaultValue")||[];return{defaultValue:t("collection").findMany(i)}})}},computed:{isInputValueEmpty:({context:t})=>t.get("inputValue").length===0,isInteractive:({prop:t})=>!(t("readOnly")||t("disabled")),autoComplete:({prop:t})=>t("inputBehavior")==="autocomplete",autoHighlight:({prop:t})=>t("inputBehavior")==="autohighlight",hasSelectedItems:({context:t})=>t.get("value").length>0,valueAsString:({context:t,prop:e})=>e("collection").stringifyItems(t.get("selectedItems")),isCustomValue:({context:t,computed:e})=>t.get("inputValue")!==e("valueAsString")},watch({context:t,prop:e,track:r,action:n,send:i}){r([()=>t.hash("value")],()=>{n(["syncSelectedItems"])}),r([()=>t.get("inputValue")],()=>{n(["syncInputValue"])}),r([()=>t.get("highlightedValue")],()=>{n(["syncHighlightedItem","autofillInputValue"])}),r([()=>e("open")],()=>{n(["toggleVisibility"])}),r([()=>e("collection").toString()],()=>{i({type:"CHILDREN_CHANGE"})})},on:{"SELECTED_ITEMS.SYNC":{actions:["syncSelectedItems"]},"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedValue"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedValue"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setValue"]},"INPUT_VALUE.SET":{actions:["setInputValue"]},"POSITIONING.SET":{actions:["reposition"]}},entry:kve([{guard:"autoFocus",actions:["setInitialFocus"]}]),states:{idle:{tags:["idle","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":{target:"interacting"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{target:"focused",actions:["clearInputValue","clearSelectedItems","setInitialFocus"]}}},focused:{tags:["focused","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":[{guard:"isChangeEvent",target:"suggesting"},{target:"interacting"}],"INPUT.CHANGE":[{guard:qi("isOpenControlled","openOnChange"),actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{guard:"openOnChange",target:"suggesting",actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{actions:["setInputValue"]}],"LAYER.INTERACT_OUTSIDE":{target:"idle"},"INPUT.ESCAPE":{guard:qi("isCustomValue",Ms("allowCustomValue")),actions:["revertInputValue"]},"INPUT.BLUR":{target:"idle"},"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_DOWN":[{guard:qi("isOpenControlled","autoComplete"),actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"isOpenControlled",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_UP":[{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems"]}}},interacting:{tags:["open","focused"],entry:["setInitialFocus"],effects:["scrollToHighlightedItem","trackDismissableLayer","trackPlacement","hideOtherElements"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]},{actions:["scrollToHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"]},"INPUT.END":{actions:["highlightLastItem"]},"INPUT.ARROW_DOWN":[{guard:qi("autoComplete","isLastItemHighlighted"),actions:["clearHighlightedValue","scrollContentToTop"]},{actions:["highlightNextItem"]}],"INPUT.ARROW_UP":[{guard:qi("autoComplete","isFirstItemHighlighted"),actions:["clearHighlightedValue"]},{actions:["highlightPrevItem"]}],"INPUT.ENTER":[{guard:qi("isOpenControlled","isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":[{guard:"autoComplete",target:"suggesting",actions:["setInputValue"]},{target:"suggesting",actions:["clearHighlightedValue","setInputValue"]}],"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.CLICK":[{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],"LAYER.ESCAPE":[{guard:qi("isOpenControlled","autoComplete"),actions:["syncInputValue","invokeOnClose"]},{guard:"autoComplete",target:"focused",actions:["syncInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"LAYER.INTERACT_OUTSIDE":[{guard:qi("isOpenControlled","isCustomValue",Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}},suggesting:{tags:["open","focused"],effects:["trackDismissableLayer","scrollToHighlightedItem","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"autoHighlight",actions:["highlightFirstItem"]},{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]}],"INPUT.ARROW_DOWN":{target:"interacting",actions:["highlightNextItem"]},"INPUT.ARROW_UP":{target:"interacting",actions:["highlightPrevItem"]},"INPUT.HOME":{target:"interacting",actions:["highlightFirstItem"]},"INPUT.END":{target:"interacting",actions:["highlightLastItem"]},"INPUT.ENTER":[{guard:qi("isOpenControlled","isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("hasHighlightedItem"),Ms("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":{actions:["setInputValue"]},"LAYER.ESCAPE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.POINTER_MOVE":{target:"interacting",actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"LAYER.INTERACT_OUTSIDE":[{guard:qi("isOpenControlled","isCustomValue",Ms("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:qi("isCustomValue",Ms("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.CLICK":[{guard:qi("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}}},implementations:{guards:{isInputValueEmpty:({computed:t})=>t("isInputValueEmpty"),autoComplete:({computed:t,prop:e})=>t("autoComplete")&&!e("multiple"),autoHighlight:({computed:t})=>t("autoHighlight"),isFirstItemHighlighted:({prop:t,context:e})=>t("collection").firstValue===e.get("highlightedValue"),isLastItemHighlighted:({prop:t,context:e})=>t("collection").lastValue===e.get("highlightedValue"),isCustomValue:({computed:t})=>t("isCustomValue"),allowCustomValue:({prop:t})=>!!t("allowCustomValue"),hasHighlightedItem:({context:t})=>t.get("highlightedValue")!=null,closeOnSelect:({prop:t})=>!!t("closeOnSelect"),isOpenControlled:({prop:t})=>t("open")!=null,openOnChange:({prop:t,context:e})=>{const r=t("openOnChange");return Ide(r)?r:!!r?.({inputValue:e.get("inputValue")})},restoreFocus:({event:t})=>t.restoreFocus==null?!0:!!t.restoreFocus,isChangeEvent:({event:t})=>t.previousEvent?.type==="INPUT.CHANGE",autoFocus:({prop:t})=>!!t("autoFocus"),isHighlightedItemRemoved:({prop:t,context:e})=>!t("collection").has(e.get("highlightedValue"))},effects:{trackDismissableLayer({send:t,prop:e,scope:r}){return e("disableLayer")?void 0:tp(()=>hd(r),{type:"listbox",defer:!0,exclude:()=>[ug(r),c0(r),n6(r)],onFocusOutside:e("onFocusOutside"),onPointerDownOutside:e("onPointerDownOutside"),onInteractOutside:e("onInteractOutside"),onEscapeKeyDown(i){i.preventDefault(),i.stopPropagation(),t({type:"LAYER.ESCAPE",src:"escape-key"})},onDismiss(){t({type:"LAYER.INTERACT_OUTSIDE",src:"interact-outside",restoreFocus:!1})}})},hideOtherElements({scope:t}){return YN([ug(t),hd(t),c0(t),n6(t)])},trackPlacement({context:t,prop:e,scope:r}){const n=()=>r6(r)||c0(r),i=()=>t6(r);return t.set("currentPlacement",e("positioning").placement),ra(n,i,{...e("positioning"),defer:!0,onComplete(o){t.set("currentPlacement",o.placement)}})},scrollToHighlightedItem({context:t,prop:e,scope:r,event:n}){const i=ug(r);let o=[];const s=c=>{const u=n.current().type.includes("POINTER"),p=t.get("highlightedValue");if(u||!p)return;const m=hd(r),v=e("scrollToIndexFn");if(v){const x=e("collection").indexOf(p);v({index:x,immediate:c,getElement:()=>Cy(r,p)});return}const b=Cy(r,p),O=wt(()=>{EC(b,{rootEl:m,block:"nearest"})});o.push(O)},a=wt(()=>s(!0));o.push(a);const l=TP(i,{attributes:["aria-activedescendant"],callback:()=>s(!1)});return o.push(l),()=>{o.forEach(c=>c())}}},actions:{reposition({context:t,prop:e,scope:r,event:n}){ra(()=>r6(r),()=>t6(r),{...e("positioning"),...n.options,defer:!0,listeners:!1,onComplete(s){t.set("currentPlacement",s.placement)}})},setHighlightedValue({context:t,event:e}){e.value!=null&&t.set("highlightedValue",e.value)},clearHighlightedValue({context:t}){t.set("highlightedValue",null)},selectHighlightedItem(t){const{context:e,prop:r}=t,n=r("collection"),i=e.get("highlightedValue");if(!i||!n.has(i))return;const o=r("multiple")?lm(e.get("value"),i):[i];r("onSelect")?.({value:o,itemValue:i}),e.set("value",o);const s=Kc(r("selectionBehavior"),{preserve:e.get("inputValue"),replace:n.stringifyMany(o),clear:""});e.set("inputValue",s)},scrollToHighlightedItem({context:t,prop:e,scope:r}){PO(()=>{const n=t.get("highlightedValue");if(n==null)return;const i=Cy(r,n),o=hd(r),s=e("scrollToIndexFn");if(s){const a=e("collection").indexOf(n);s({index:a,immediate:!0,getElement:()=>Cy(r,n)});return}EC(i,{rootEl:o,block:"nearest"})})},selectItem(t){const{context:e,event:r,flush:n,prop:i}=t;r.value!=null&&n(()=>{const o=i("multiple")?lm(e.get("value"),r.value):[r.value];i("onSelect")?.({value:o,itemValue:r.value}),e.set("value",o);const s=Kc(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(o),clear:""});e.set("inputValue",s)})},clearItem(t){const{context:e,event:r,flush:n,prop:i}=t;r.value!=null&&n(()=>{const o=wf(e.get("value"),r.value);e.set("value",o);const s=Kc(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(o),clear:""});e.set("inputValue",s)})},setInitialFocus({scope:t}){wt(()=>{i6(t)})},setFinalFocus({scope:t}){wt(()=>{c0(t)?.dataset.focusable==null?i6(t):wve(t)})},syncInputValue({context:t,scope:e,event:r}){const n=ug(e);n&&(n.value=t.get("inputValue"),queueMicrotask(()=>{r.current().type!=="INPUT.CHANGE"&&nhe(n)}))},setInputValue({context:t,event:e}){t.set("inputValue",e.value)},clearInputValue({context:t}){t.set("inputValue","")},revertInputValue({context:t,prop:e,computed:r}){const n=e("selectionBehavior"),i=Kc(n,{replace:r("hasSelectedItems")?r("valueAsString"):"",preserve:t.get("inputValue"),clear:""});t.set("inputValue",i)},setValue(t){const{context:e,flush:r,event:n,prop:i}=t;r(()=>{e.set("value",n.value);const o=Kc(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(n.value),clear:""});e.set("inputValue",o)})},clearSelectedItems(t){const{context:e,flush:r,prop:n}=t;r(()=>{e.set("value",[]);const i=Kc(n("selectionBehavior"),{preserve:e.get("inputValue"),replace:n("collection").stringifyMany([]),clear:""});e.set("inputValue",i)})},scrollContentToTop({prop:t,scope:e}){const r=t("scrollToIndexFn");if(r){const n=t("collection").firstValue;r({index:0,immediate:!0,getElement:()=>Cy(e,n)})}else{const n=hd(e);if(!n)return;n.scrollTop=0}},invokeOnOpen({prop:t,event:e}){const r=o6(e);t("onOpenChange")?.({open:!0,reason:r})},invokeOnClose({prop:t,event:e}){const r=o6(e);t("onOpenChange")?.({open:!1,reason:r})},highlightFirstItem({context:t,prop:e,scope:r}){(hd(r)?queueMicrotask:wt)(()=>{const i=e("collection").firstValue;i&&t.set("highlightedValue",i)})},highlightFirstItemIfNeeded({computed:t,action:e}){t("autoHighlight")&&e(["highlightFirstItem"])},highlightLastItem({context:t,prop:e,scope:r}){(hd(r)?queueMicrotask:wt)(()=>{const i=e("collection").lastValue;i&&t.set("highlightedValue",i)})},highlightNextItem({context:t,prop:e}){let r=null;const n=t.get("highlightedValue"),i=e("collection");n?(r=i.getNextValue(n),!r&&e("loopFocus")&&(r=i.firstValue)):r=i.firstValue,r&&t.set("highlightedValue",r)},highlightPrevItem({context:t,prop:e}){let r=null;const n=t.get("highlightedValue"),i=e("collection");n?(r=i.getPreviousValue(n),!r&&e("loopFocus")&&(r=i.lastValue)):r=i.lastValue,r&&t.set("highlightedValue",r)},highlightFirstSelectedItem({context:t,prop:e}){wt(()=>{const[r]=e("collection").sort(t.get("value"));r&&t.set("highlightedValue",r)})},highlightFirstOrSelectedItem({context:t,prop:e,computed:r}){wt(()=>{let n=null;r("hasSelectedItems")?n=e("collection").sort(t.get("value"))[0]:n=e("collection").firstValue,n&&t.set("highlightedValue",n)})},highlightLastOrSelectedItem({context:t,prop:e,computed:r}){wt(()=>{const n=e("collection");let i=null;r("hasSelectedItems")?i=n.sort(t.get("value"))[0]:i=n.lastValue,i&&t.set("highlightedValue",i)})},autofillInputValue({context:t,computed:e,prop:r,event:n,scope:i}){const o=ug(i),s=r("collection");if(!e("autoComplete")||!o||!n.keypress)return;const a=s.stringify(t.get("highlightedValue"));wt(()=>{o.value=a||t.get("inputValue")})},syncSelectedItems(t){queueMicrotask(()=>{const{context:e,prop:r}=t,n=r("collection"),i=e.get("value"),o=i.map(a=>e.get("selectedItems").find(c=>n.getItemValue(c)===a)||n.find(a));e.set("selectedItems",o);const s=Kc(r("selectionBehavior"),{preserve:e.get("inputValue"),replace:n.stringifyMany(i),clear:""});e.set("inputValue",s)})},syncHighlightedItem({context:t,prop:e}){const r=e("collection").find(t.get("highlightedValue"));t.set("highlightedItem",r)},toggleVisibility({event:t,send:e,prop:r}){e({type:r("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}}});function o6(t){return(t.previousEvent||t).src}xt()(["allowCustomValue","autoFocus","closeOnSelect","collection","composite","defaultHighlightedValue","defaultInputValue","defaultOpen","defaultValue","dir","disabled","disableLayer","form","getRootNode","highlightedValue","id","ids","inputBehavior","inputValue","invalid","loopFocus","multiple","name","navigate","onFocusOutside","onHighlightChange","onInputValueChange","onInteractOutside","onOpenChange","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","openOnChange","openOnClick","openOnKeyPress","placeholder","positioning","readOnly","required","scrollToIndexFn","selectionBehavior","translations","value","alwaysSubmitOnEnter"]);xt()(["htmlFor"]);xt()(["id"]);xt()(["item","persistFocus"]);const Pve=kH.extendWith("empty"),[_H,hh]=Cn({name:"DialogContext",hookName:"useDialogContext",providerName:"<DialogProvider />"}),TH=E.forwardRef((t,e)=>{const r=hh(),n=XN(),i=Fa({...n,present:r.open}),o=Ae(r.getBackdropProps(),i.getPresenceProps(),t);return i.unmounted?null:h.jsx(Ue.div,{...o,ref:Eu(i.ref,e)})});TH.displayName="DialogBackdrop";const EH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getCloseTriggerProps(),t);return h.jsx(Ue.button,{...n,ref:e})});EH.displayName="DialogCloseTrigger";const RH=E.forwardRef((t,e)=>{const r=hh(),n=sa(),i=Ae(r.getContentProps(),n.getPresenceProps(),t);return n.unmounted?null:h.jsx(Ue.div,{...i,ref:Eu(n.ref,e)})});RH.displayName="DialogContent";const IH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getDescriptionProps(),t);return h.jsx(Ue.div,{...n,ref:e})});IH.displayName="DialogDescription";const jH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getPositionerProps(),t);return sa().unmounted?null:h.jsx(Ue.div,{...n,ref:e})});jH.displayName="DialogPositioner";var eM=Ct("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),Fh=eM.build(),$H=t=>t.ids?.positioner??`dialog:${t.id}:positioner`,AH=t=>t.ids?.backdrop??`dialog:${t.id}:backdrop`,i2=t=>t.ids?.content??`dialog:${t.id}:content`,NH=t=>t.ids?.trigger??`dialog:${t.id}:trigger`,o2=t=>t.ids?.title??`dialog:${t.id}:title`,s2=t=>t.ids?.description??`dialog:${t.id}:description`,MH=t=>t.ids?.closeTrigger??`dialog:${t.id}:close`,jw=t=>t.getById(i2(t)),_ve=t=>t.getById($H(t)),Tve=t=>t.getById(AH(t)),Eve=t=>t.getById(NH(t)),Rve=t=>t.getById(o2(t)),Ive=t=>t.getById(s2(t)),jve=t=>t.getById(MH(t));function $ve(t,e){const{state:r,send:n,context:i,prop:o,scope:s}=t,a=o("aria-label"),l=r.matches("open");return{open:l,setOpen(c){r.matches("open")!==c&&n({type:c?"OPEN":"CLOSE"})},getTriggerProps(){return e.button({...Fh.trigger.attrs,dir:o("dir"),id:NH(s),"aria-haspopup":"dialog",type:"button","aria-expanded":l,"data-state":l?"open":"closed","aria-controls":i2(s),onClick(c){c.defaultPrevented||n({type:"TOGGLE"})}})},getBackdropProps(){return e.element({...Fh.backdrop.attrs,dir:o("dir"),hidden:!l,id:AH(s),"data-state":l?"open":"closed"})},getPositionerProps(){return e.element({...Fh.positioner.attrs,dir:o("dir"),id:$H(s),style:{pointerEvents:l?void 0:"none"}})},getContentProps(){const c=i.get("rendered");return e.element({...Fh.content.attrs,dir:o("dir"),role:o("role"),hidden:!l,id:i2(s),tabIndex:-1,"data-state":l?"open":"closed","aria-modal":!0,"aria-label":a||void 0,"aria-labelledby":a||!c.title?void 0:o2(s),"aria-describedby":c.description?s2(s):void 0})},getTitleProps(){return e.element({...Fh.title.attrs,dir:o("dir"),id:o2(s)})},getDescriptionProps(){return e.element({...Fh.description.attrs,dir:o("dir"),id:s2(s)})},getCloseTriggerProps(){return e.button({...Fh.closeTrigger.attrs,dir:o("dir"),id:MH(s),type:"button",onClick(c){c.defaultPrevented||(c.stopPropagation(),n({type:"CLOSE"}))}})}}}var Ave={props({props:t,scope:e}){const r=t.role==="alertdialog",n=r?()=>jve(e):void 0,i=typeof t.modal=="boolean"?t.modal:!0;return{role:"dialog",modal:i,trapFocus:i,preventScroll:i,closeOnInteractOutside:!r,closeOnEscape:!0,restoreFocus:!0,initialFocusEl:n,...t}},initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({bindable:t}){return{rendered:t(()=>({defaultValue:{title:!0,description:!0}}))}},watch({track:t,action:e,prop:r}){t([()=>r("open")],()=>{e(["toggleVisibility"])})},states:{open:{entry:["checkRenderedElements","syncZIndex"],effects:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}},implementations:{guards:{isOpenControlled:({prop:t})=>t("open")!=null},effects:{trackDismissableElement({scope:t,send:e,prop:r}){return tp(()=>jw(t),{type:"dialog",defer:!0,pointerBlocking:r("modal"),exclude:[Eve(t)],onInteractOutside(i){r("onInteractOutside")?.(i),r("closeOnInteractOutside")||i.preventDefault()},persistentElements:r("persistentElements"),onFocusOutside:r("onFocusOutside"),onPointerDownOutside:r("onPointerDownOutside"),onRequestDismiss:r("onRequestDismiss"),onEscapeKeyDown(i){r("onEscapeKeyDown")?.(i),r("closeOnEscape")||i.preventDefault()},onDismiss(){e({type:"CLOSE",src:"interact-outside"})}})},preventScroll({scope:t,prop:e}){if(e("preventScroll"))return rH(t.getDoc())},trapFocus({scope:t,prop:e}){return e("trapFocus")?tH(()=>jw(t),{preventScroll:!0,returnFocusOnDeactivate:!!e("restoreFocus"),initialFocus:e("initialFocusEl"),setReturnFocus:n=>e("finalFocusEl")?.()??n}):void 0},hideContentBelow({scope:t,prop:e}){return e("modal")?YN(()=>[jw(t)],{defer:!0}):void 0}},actions:{checkRenderedElements({context:t,scope:e}){wt(()=>{t.set("rendered",{title:!!Rve(e),description:!!Ive(e)})})},syncZIndex({scope:t}){wt(()=>{const e=jw(t);if(!e)return;const r=$f(e);[_ve(t),Tve(t)].forEach(i=>{i?.style.setProperty("--z-index",r.zIndex),i?.style.setProperty("--layer-index",r.getPropertyValue("--layer-index"))})})},invokeOnClose({prop:t}){t("onOpenChange")?.({open:!1})},invokeOnOpen({prop:t}){t("onOpenChange")?.({open:!0})},toggleVisibility({prop:t,send:e,event:r}){e({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}}};xt()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const Nve=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,getRootNode:r,dir:n,...t},o=Ps(Ave,i);return $ve(o,oa)},Mve=t=>{const[e,{children:r,...n}]=Cc(t),[i]=Ym(e),o=Nve(n),s=Fa(Ae({present:o.open},e));return h.jsx(_H,{value:o,children:h.jsx(Zm,{value:i,children:h.jsx(kl,{value:s,children:r})})})},Dve=t=>{const[e,{value:r,children:n}]=Cc(t),[i]=Ym(e),o=Fa(Ae({present:r.open},e));return h.jsx(_H,{value:r,children:h.jsx(Zm,{value:i,children:h.jsx(kl,{value:o,children:n})})})},DH=E.forwardRef((t,e)=>{const r=hh(),n=Ae(r.getTitleProps(),t);return h.jsx(Ue.h2,{...n,ref:e})});DH.displayName="DialogTitle";const LH=E.forwardRef((t,e)=>{const r=hh(),n=sa(),i=Ae({...r.getTriggerProps(),"aria-controls":n.unmounted?void 0:r.getTriggerProps()["aria-controls"]},t);return h.jsx(Ue.button,{...i,ref:e})});LH.displayName="DialogTrigger";var VH=Ct("editable").parts("root","area","label","preview","input","editTrigger","submitTrigger","cancelTrigger","control");VH.build();xt()(["activationMode","autoResize","dir","disabled","finalFocusEl","form","getRootNode","id","ids","invalid","maxLength","name","onEditChange","onFocusOutside","onInteractOutside","onPointerDownOutside","onValueChange","onValueCommit","onValueRevert","placeholder","readOnly","required","selectOnFocus","edit","defaultEdit","submitMode","translations","defaultValue","value"]);const FH=E.forwardRef((t,e)=>{const r=dh(),n=Ae(r?.getInputProps(),t);return h.jsx(Ue.input,{...n,ref:e})});FH.displayName="FieldInput";const QH=Ct("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator");QH.build();const BH=E.forwardRef((t,e)=>{const r=dh(),n=Ae(r?.getSelectProps(),t);return h.jsx(Ue.select,{...n,ref:e})});BH.displayName="FieldSelect";var Lve=t=>{if(!t)return;const e=$f(t),r=hi(t),n=ks(t),i=()=>{requestAnimationFrame(()=>{t.style.height="auto";let c;e.boxSizing==="content-box"?c=t.scrollHeight-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):c=t.scrollHeight+parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),e.maxHeight!=="none"&&c>parseFloat(e.maxHeight)?(e.overflowY==="hidden"&&(t.style.overflowY="scroll"),c=parseFloat(e.maxHeight)):e.overflowY!=="hidden"&&(t.style.overflowY="hidden"),t.style.height=`${c}px`})};t.addEventListener("input",i),t.form?.addEventListener("reset",i);const o=Object.getPrototypeOf(t),s=Object.getOwnPropertyDescriptor(o,"value");Object.defineProperty(t,"value",{...s,set(){s?.set?.apply(this,arguments),i()}});const a=new r.ResizeObserver(()=>{requestAnimationFrame(()=>i())});a.observe(t);const l=new r.MutationObserver(()=>i());return l.observe(t,{attributes:!0,attributeFilter:["rows","placeholder"]}),n.fonts?.addEventListener("loadingdone",i),()=>{t.removeEventListener("input",i),t.form?.removeEventListener("reset",i),n.fonts?.removeEventListener("loadingdone",i),a.disconnect(),l.disconnect()}};const zH=E.forwardRef((t,e)=>{const{autoresize:r,...n}=t,i=E.useRef(null),o=dh(),s=Ae(o?.getTextareaProps(),{style:{resize:r?"none":void 0}},n);return E.useEffect(()=>{if(r)return Lve(i.current)},[r]),h.jsx(Ue.textarea,{...s,ref:Eu(e,i)})});zH.displayName="FieldTextarea";const qH=Ct("fieldset").parts("root","errorText","helperText","legend");qH.build();var WH=Ct("file-upload").parts("root","dropzone","item","itemDeleteTrigger","itemGroup","itemName","itemPreview","itemPreviewImage","itemSizeText","label","trigger","clearTrigger");WH.build();xt()(["accept","acceptedFiles","allowDrop","capture","defaultAcceptedFiles","dir","directory","disabled","getRootNode","id","ids","invalid","locale","maxFiles","maxFileSize","minFileSize","name","onFileAccept","onFileChange","onFileReject","preventDocumentDrop","required","transformFiles","translations","validate"]);xt()(["file","type"]);const[UH,TO]=Cn({name:"HoverCardContext",hookName:"useHoverCardContext",providerName:"<HoverCardProvider />"}),HH=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getArrowProps(),t);return h.jsx(Ue.div,{...n,ref:e})});HH.displayName="HoverCardArrow";const GH=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getArrowTipProps(),t);return h.jsx(Ue.div,{...n,ref:e})});GH.displayName="HoverCardArrowTip";const XH=E.forwardRef((t,e)=>{const r=TO(),n=sa(),i=Ae(r.getContentProps(),n.getPresenceProps(),t);return n.unmounted?null:h.jsx(Ue.div,{...i,ref:Eu(n.ref,e)})});XH.displayName="HoverCardContent";const ZH=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getPositionerProps(),t);return sa().unmounted?null:h.jsx(Ue.div,{...n,ref:e})});ZH.displayName="HoverCardPositioner";var YH=Ct("hoverCard").parts("arrow","arrowTip","trigger","positioner","content"),ky=YH.build(),KH=t=>t.ids?.trigger??`hover-card:${t.id}:trigger`,JH=t=>t.ids?.content??`hover-card:${t.id}:content`,eG=t=>t.ids?.positioner??`hover-card:${t.id}:popper`,Vve=t=>t.ids?.arrow??`hover-card:${t.id}:arrow`,bR=t=>t.getById(KH(t)),Fve=t=>t.getById(JH(t)),s6=t=>t.getById(eG(t));function Qve(t,e){const{state:r,send:n,prop:i,context:o,scope:s}=t,a=r.hasTag("open"),l=AP({...i("positioning"),placement:o.get("currentPlacement")});return{open:a,setOpen(c){r.hasTag("open")!==c&&(i("disabled")||n({type:c?"OPEN":"CLOSE"}))},reposition(c={}){n({type:"POSITIONING.SET",options:c})},getArrowProps(){return e.element({id:Vve(s),...ky.arrow.attrs,dir:i("dir"),style:l.arrow})},getArrowTipProps(){return e.element({...ky.arrowTip.attrs,dir:i("dir"),style:l.arrowTip})},getTriggerProps(){return e.element({...ky.trigger.attrs,dir:i("dir"),"data-placement":o.get("currentPlacement"),id:KH(s),"data-state":a?"open":"closed",onPointerEnter(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_ENTER",src:"trigger"}))},onPointerLeave(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_LEAVE",src:"trigger"}))},onFocus(){i("disabled")||n({type:"TRIGGER_FOCUS"})},onBlur(){i("disabled")||n({type:"TRIGGER_BLUR"})}})},getPositionerProps(){return e.element({id:eG(s),...ky.positioner.attrs,dir:i("dir"),style:l.floating})},getContentProps(){return e.element({...ky.content.attrs,dir:i("dir"),id:JH(s),hidden:!a,tabIndex:-1,"data-state":a?"open":"closed","data-placement":o.get("currentPlacement"),onPointerEnter(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_ENTER",src:"content"}))},onPointerLeave(c){c.pointerType!=="touch"&&(i("disabled")||n({type:"POINTER_LEAVE",src:"content"}))}})}}}var{not:$w,and:a6}=Cl(),Bve={props({props:t}){return{disabled:!1,openDelay:600,closeDelay:300,...t,positioning:{placement:"bottom",...t.positioning}}},initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({prop:t,bindable:e}){return{open:e(()=>({defaultValue:t("defaultOpen"),value:t("open"),onChange(r){t("onOpenChange")?.({open:r})}})),currentPlacement:e(()=>({defaultValue:void 0})),isPointer:e(()=>({defaultValue:!1}))}},watch({track:t,context:e,action:r,prop:n,send:i}){t([()=>n("disabled")],()=>{n("disabled")&&i({type:"CLOSE",src:"disabled.change"})}),t([()=>e.get("open")],()=>{r(["toggleVisibility"])})},states:{closed:{tags:["closed"],entry:["clearIsPointer"],on:{"CONTROLLED.OPEN":{target:"open"},POINTER_ENTER:{target:"opening",actions:["setIsPointer"]},TRIGGER_FOCUS:{target:"opening"},OPEN:{target:"opening"}}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{OPEN_DELAY:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},POINTER_LEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:a6("isOpenControlled",$w("isPointer")),actions:["invokeOnClose","toggleVisibility"]},{guard:$w("isPointer"),target:"closed",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}]}},open:{tags:["open"],effects:["trackDismissableElement","trackPositioning"],on:{"CONTROLLED.CLOSE":{target:"closed"},POINTER_ENTER:{actions:["setIsPointer"]},POINTER_LEAVE:{target:"closing"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:a6("isOpenControlled",$w("isPointer")),actions:["invokeOnClose"]},{guard:$w("isPointer"),target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:["reposition"]}}},closing:{tags:["open"],effects:["trackPositioning","waitForCloseDelay"],on:{CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"CONTROLLED.CLOSE":{target:"closed"},"CONTROLLED.OPEN":{target:"open"},POINTER_ENTER:{target:"open",actions:["setIsPointer"]}}}},implementations:{guards:{isPointer:({context:t})=>!!t.get("isPointer"),isOpenControlled:({prop:t})=>t("open")!=null},effects:{waitForOpenDelay({send:t,prop:e}){const r=setTimeout(()=>{t({type:"OPEN_DELAY"})},e("openDelay"));return()=>clearTimeout(r)},waitForCloseDelay({send:t,prop:e}){const r=setTimeout(()=>{t({type:"CLOSE_DELAY"})},e("closeDelay"));return()=>clearTimeout(r)},trackPositioning({context:t,prop:e,scope:r}){t.get("currentPlacement")||t.set("currentPlacement",e("positioning").placement);const n=()=>s6(r);return ra(bR(r),n,{...e("positioning"),defer:!0,onComplete(i){t.set("currentPlacement",i.placement)}})},trackDismissableElement({send:t,scope:e,prop:r}){return tp(()=>Fve(e),{type:"popover",defer:!0,exclude:[bR(e)],onDismiss(){t({type:"CLOSE",src:"interact-outside"})},onInteractOutside:r("onInteractOutside"),onPointerDownOutside:r("onPointerDownOutside"),onFocusOutside(i){i.preventDefault(),r("onFocusOutside")?.(i)}})}},actions:{invokeOnClose({prop:t}){t("onOpenChange")?.({open:!1})},invokeOnOpen({prop:t}){t("onOpenChange")?.({open:!0})},setIsPointer({context:t}){t.set("isPointer",!0)},clearIsPointer({context:t}){t.set("isPointer",!1)},reposition({context:t,prop:e,scope:r,event:n}){const i=()=>s6(r);ra(bR(r),i,{...e("positioning"),...n.options,defer:!0,listeners:!1,onComplete(o){t.set("currentPlacement",o.placement)}})},toggleVisibility({prop:t,event:e,send:r}){queueMicrotask(()=>{r({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})})}}}};xt()(["closeDelay","dir","getRootNode","id","ids","disabled","onOpenChange","defaultOpen","open","openDelay","positioning","onInteractOutside","onPointerDownOutside","onFocusOutside"]);const zve=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,dir:n,getRootNode:r,...t},o=Ps(Bve,i);return Qve(o,oa)},qve=t=>{const[e,{children:r,...n}]=Cc(t),i=zve(n),o=Fa(Ae({present:i.open},e));return h.jsx(UH,{value:i,children:h.jsx(kl,{value:o,children:r})})},Wve=t=>{const[e,{value:r,children:n}]=Cc(t),i=Fa(Ae({present:r.open},e));return h.jsx(UH,{value:r,children:h.jsx(kl,{value:i,children:n})})},tG=E.forwardRef((t,e)=>{const r=TO(),n=Ae(r.getTriggerProps(),t);return h.jsx(Ue.button,{...n,ref:e})});tG.displayName="HoverCardTrigger";var rG=Ct("tree-view").parts("branch","branchContent","branchControl","branchIndentGuide","branchIndicator","branchText","branchTrigger","item","itemIndicator","itemText","label","nodeCheckbox","nodeRenameInput","root","tree");rG.build();var nG=t=>new SH(t);nG.empty=()=>new SH({rootNode:{children:[]}});var Uve=(t,e)=>t.ids?.node?.(e)??`tree:${t.id}:node:${e}`,Vl=(t,e)=>{e!=null&&t.getById(Uve(t,e))?.focus()},Hve=(t,e)=>`tree:${t.id}:rename-input:${e}`,l6=(t,e)=>t.getById(Hve(t,e));function Gve(t,e,r){const n=t.getDescendantValues(e),i=n.every(o=>r.includes(o));return Og(i?wf(r,...n):ff(r,...n))}function Aw(t,e){const{context:r,prop:n,refs:i}=t;if(!n("loadChildren")){r.set("expandedValue",O=>Og(ff(O,...e)));return}const o=r.get("loadingStatus"),[s,a]=dF(e,O=>o[O]==="loaded");if(s.length>0&&r.set("expandedValue",O=>Og(ff(O,...s))),a.length===0)return;const l=n("collection"),[c,u]=dF(a,O=>{const x=l.findNode(O);return l.getNodeChildren(x).length>0});if(c.length>0&&r.set("expandedValue",O=>Og(ff(O,...c))),u.length===0)return;r.set("loadingStatus",O=>({...O,...u.reduce((x,S)=>({...x,[S]:"loading"}),{})}));const p=u.map(O=>{const x=l.getIndexPath(O),S=l.getValuePath(x),w=l.findNode(O);return{id:O,indexPath:x,valuePath:S,node:w}}),m=i.get("pendingAborts"),v=n("loadChildren");Z9(v,()=>"[zag-js/tree-view] `loadChildren` is required for async expansion");const b=p.map(({id:O,indexPath:x,valuePath:S,node:w})=>{const k=m.get(O);k&&(k.abort(),m.delete(O));const P=new AbortController;return m.set(O,P),v({valuePath:S,indexPath:x,node:w,signal:P.signal})});Promise.allSettled(b).then(O=>{const x=[],S=[],w=r.get("loadingStatus");let k=n("collection");O.forEach((P,_)=>{const{id:T,indexPath:R,node:$,valuePath:A}=p[_];P.status==="fulfilled"?(w[T]="loaded",x.push(T),k=k.replace(R,{...$,children:P.value})):(m.delete(T),Reflect.deleteProperty(w,T),S.push({node:$,error:P.reason,indexPath:R,valuePath:A}))}),r.set("loadingStatus",w),x.length&&(r.set("expandedValue",P=>Og(ff(P,...x))),n("onLoadChildrenComplete")?.({collection:k})),S.length&&n("onLoadChildrenError")?.({nodes:S})})}function ld(t){const{prop:e,context:r}=t;return function({indexPath:i}){return e("collection").getValuePath(i).slice(0,-1).some(s=>!r.get("expandedValue").includes(s))}}var{and:Fl}=Cl();Fl("isMultipleSelection","moveFocus"),Fl("isShiftKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection"),Fl("isBranchFocused","isBranchExpanded"),Fl("isShiftKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection"),Fl("isCtrlKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection"),Fl("isCtrlKey","isMultipleSelection"),Fl("isShiftKey","isMultipleSelection");xt()(["ids","collection","dir","expandedValue","expandOnClick","defaultFocusedValue","focusedValue","getRootNode","id","onExpandedChange","onFocusChange","onSelectionChange","checkedValue","selectedValue","selectionMode","typeahead","defaultExpandedValue","defaultSelectedValue","defaultCheckedValue","onCheckedChange","onLoadChildrenComplete","onLoadChildrenError","loadChildren","canRename","onRenameStart","onBeforeRename","onRenameComplete"]);xt()(["node","indexPath"]);var iG=Ct("listbox").parts("label","input","item","itemText","itemIndicator","itemGroup","itemGroupLabel","content","root","valueText");iG.build();xt()(["collection","defaultHighlightedValue","defaultValue","dir","disabled","deselectable","disallowSelectAll","getRootNode","highlightedValue","id","ids","loopFocus","onHighlightChange","onSelect","onValueChange","orientation","scrollToIndexFn","selectionMode","selectOnHighlight","typeahead","value"]);xt()(["item","highlightOnHover"]);xt()(["id"]);xt()(["htmlFor"]);const Xve=iG.extendWith("empty"),[oG,Ji]=Cn({name:"MenuContext",hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),sG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getArrowProps(),t);return h.jsx(Ue.div,{...n,ref:e})});sG.displayName="MenuArrow";const aG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getArrowTipProps(),t);return h.jsx(Ue.div,{...n,ref:e})});aG.displayName="MenuArrowTip";const[tM]=Cn({name:"MenuItemContext",hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[FP,lG]=Cn({name:"MenuItemPropsContext",hookName:"useMenuItemPropsContext",providerName:"<MenuItemPropsProvider />"}),cG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),i={...r,type:"checkbox"},o=Ji(),s=Ae(o.getOptionItemProps(i),n),a=o.getOptionItemState(i);return h.jsx(FP,{value:i,children:h.jsx(tM,{value:a,children:h.jsx(Ue.div,{...s,ref:e})})})});cG.displayName="MenuCheckboxItem";const uG=E.forwardRef((t,e)=>{const r=Ji(),n=sa(),i=Ae(r.getContentProps(),n.getPresenceProps(),t);return n.unmounted?null:h.jsx(Ue.div,{...i,ref:Eu(n.ref,e)})});uG.displayName="MenuContent";const dG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getContextTriggerProps(),t);return h.jsx(Ue.button,{...n,ref:e})});dG.displayName="MenuContextTrigger";const hG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getIndicatorProps(),t);return h.jsx(Ue.div,{...n,ref:e})});hG.displayName="MenuIndicator";const fG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["closeOnSelect","disabled","value","valueText","onSelect"]),i=Ji(),o=Ae(i.getItemProps(r),n),s=i.getItemState(r);return E.useEffect(()=>i.addItemListener({id:s.id,onSelect:r.onSelect}),[s.id,r.onSelect]),h.jsx(FP,{value:r,children:h.jsx(tM,{value:s,children:h.jsx(Ue.div,{...o,ref:e})})})});fG.displayName="MenuItem";const[pG,gG]=Cn({name:"MenuItemGroupContext",hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),mG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["id"]),i=Ji(),s={id:E.useId(),...r},a=Ae(i.getItemGroupProps(s),n);return h.jsx(pG,{value:s,children:h.jsx(Ue.div,{...a,ref:e})})});mG.displayName="MenuItemGroup";const vG=E.forwardRef((t,e)=>{const r=Ji(),n=gG(),i=Ae(r.getItemGroupLabelProps({htmlFor:n.id}),t);return h.jsx(Ue.div,{...i,ref:e})});vG.displayName="MenuItemGroupLabel";const yG=E.forwardRef((t,e)=>{const r=Ji(),n=lG(),i=Ae(r.getItemIndicatorProps(n),t);return h.jsx(Ue.div,{...i,ref:e})});yG.displayName="MenuItemIndicator";const bG=E.forwardRef((t,e)=>{const r=Ji(),n=lG(),i=Ae(r.getItemTextProps(n),t);return h.jsx(Ue.div,{...i,ref:e})});bG.displayName="MenuItemText";const OG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getPositionerProps(),t);return sa().unmounted?null:h.jsx(Ue.div,{...n,ref:e})});OG.displayName="MenuPositioner";const xG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["closeOnSelect","disabled","value","valueText"]),i=Ji(),o=gG(),s={...r,checked:o.value===r.value,type:"radio",onCheckedChange:()=>o.onValueChange?.({value:r.value})},a=Ae(i.getOptionItemProps(s),n),l=i.getOptionItemState(s);return h.jsx(FP,{value:s,children:h.jsx(tM,{value:l,children:h.jsx(Ue.div,{...a,ref:e})})})});xG.displayName="MenuRadioItem";const wG=E.forwardRef((t,e)=>{const[r,n]=Nn()(t,["id","onValueChange","value"]),i=Ji(),s={id:E.useId(),...r},a=Ae(i.getItemGroupProps({id:s.id}),n);return h.jsx(pG,{value:s,children:h.jsx(Ue.div,{...a,ref:e})})});wG.displayName="MenuRadioItemGroup";const SG=t=>{const e=E.useRef(t),r=E.useRef(!1);E.useEffect(()=>{e.current=t}),E.useEffect(()=>{r.current!==!0&&(r.current=!0,e.current())},[])};var CG=Ct("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem"),Lo=CG.build(),VC=t=>t.ids?.trigger??`menu:${t.id}:trigger`,kG=t=>t.ids?.contextTrigger??`menu:${t.id}:ctx-trigger`,_0=t=>t.ids?.content??`menu:${t.id}:content`,Zve=t=>t.ids?.arrow??`menu:${t.id}:arrow`,PG=t=>t.ids?.positioner??`menu:${t.id}:popper`,Yve=(t,e)=>t.ids?.group?.(e)??`menu:${t.id}:group:${e}`,hb=(t,e)=>`${t.id}/${e}`,Qh=t=>t?.dataset.value??null,c6=(t,e)=>t.ids?.groupLabel?.(e)??`menu:${t.id}:group-label:${e}`,fd=t=>t.getById(_0(t)),u6=t=>t.getById(PG(t)),Nw=t=>t.getById(VC(t)),Kve=(t,e)=>e?t.getById(hb(t,e)):null,OR=t=>t.getById(kG(t)),EO=t=>{const r=`[role^="menuitem"][data-ownedby=${CSS.escape(_0(t))}]:not([data-disabled])`;return sb(fd(t),r)},Jve=t=>zg(EO(t)),eye=t=>wP(EO(t)),rM=(t,e)=>e?t.id===e||t.dataset.value===e:!1,tye=(t,e)=>{const r=EO(t),n=r.findIndex(i=>rM(i,e.value));return _de(r,n,{loop:e.loop??e.loopFocus})},rye=(t,e)=>{const r=EO(t),n=r.findIndex(i=>rM(i,e.value));return Ede(r,n,{loop:e.loop??e.loopFocus})},nye=(t,e)=>{const r=EO(t),n=r.find(i=>rM(i,e.value));return lb(r,{state:e.typeaheadState,key:e.key,activeId:n?.id??null})},Mw=t=>Yi(t)&&(t.dataset.disabled===""||t.hasAttribute("disabled")),iye=t=>!!t?.getAttribute("role")?.startsWith("menuitem")&&!!t?.hasAttribute("aria-controls"),a2="menu:select";function oye(t,e){if(!t)return;const r=hi(t),n=new r.CustomEvent(a2,{detail:{value:e}});t.dispatchEvent(n)}function sye(t,e){const{context:r,send:n,state:i,computed:o,prop:s,scope:a}=t,l=i.hasTag("open"),c=r.get("isSubmenu"),u=o("isTypingAhead"),p=s("composite"),m=r.get("currentPlacement"),v=r.get("anchorPoint"),b=r.get("highlightedValue"),O=AP({...s("positioning"),placement:v?"bottom":m});function x(P){return{id:hb(a,P.value),disabled:!!P.disabled,highlighted:b===P.value}}function S(P){const _=P.valueText??P.value;return{...P,id:P.value,valueText:_}}function w(P){return{...x(S(P)),checked:!!P.checked}}function k(P){const{closeOnSelect:_,valueText:T,value:R}=P,$=x(P),A=hb(a,R);return e.element({...Lo.item.attrs,id:A,role:"menuitem","aria-disabled":J9($.disabled),"data-disabled":st($.disabled),"data-ownedby":_0(a),"data-highlighted":st($.highlighted),"data-value":R,"data-valuetext":T,onDragStart(M){M.currentTarget.matches("a[href]")&&M.preventDefault()},onPointerMove(M){if($.disabled||M.pointerType!=="mouse")return;const Q=M.currentTarget;$.highlighted||n({type:"ITEM_POINTERMOVE",id:A,target:Q,closeOnSelect:_})},onPointerLeave(M){if($.disabled||M.pointerType!=="mouse"||!t.event.previous()?.type.includes("POINTER"))return;const V=M.currentTarget;n({type:"ITEM_POINTERLEAVE",id:A,target:V,closeOnSelect:_})},onPointerDown(M){if($.disabled)return;const Q=M.currentTarget;n({type:"ITEM_POINTERDOWN",target:Q,id:A,closeOnSelect:_})},onClick(M){if(OF(M)||Xj(M)||$.disabled)return;const Q=M.currentTarget;n({type:"ITEM_CLICK",target:Q,id:A,closeOnSelect:_})}})}return{highlightedValue:b,open:l,setOpen(P){i.hasTag("open")!==P&&n({type:P?"OPEN":"CLOSE"})},setHighlightedValue(P){n({type:"HIGHLIGHTED.SET",value:P})},setParent(P){n({type:"PARENT.SET",value:P,id:P.prop("id")})},setChild(P){n({type:"CHILD.SET",value:P,id:P.prop("id")})},reposition(P={}){n({type:"POSITIONING.SET",options:P})},addItemListener(P){const _=a.getById(P.id);if(!_)return;const T=()=>P.onSelect?.();return _.addEventListener(a2,T),()=>_.removeEventListener(a2,T)},getContextTriggerProps(){return e.element({...Lo.contextTrigger.attrs,dir:s("dir"),id:kG(a),"data-state":l?"open":"closed",onPointerDown(P){if(P.pointerType==="mouse")return;const _=su(P);n({type:"CONTEXT_MENU_START",point:_})},onPointerCancel(P){P.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerMove(P){P.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onPointerUp(P){P.pointerType!=="mouse"&&n({type:"CONTEXT_MENU_CANCEL"})},onContextMenu(P){const _=su(P);n({type:"CONTEXT_MENU",point:_}),P.preventDefault()},style:{WebkitTouchCallout:"none",WebkitUserSelect:"none",userSelect:"none"}})},getTriggerItemProps(P){const _=P.getTriggerProps();return Ae(k({value:_.id}),_)},getTriggerProps(){return e.button({...c?Lo.triggerItem.attrs:Lo.trigger.attrs,"data-placement":r.get("currentPlacement"),type:"button",dir:s("dir"),id:VC(a),"data-uid":s("id"),"aria-haspopup":p?"menu":"dialog","aria-controls":_0(a),"aria-expanded":l||void 0,"data-state":l?"open":"closed",onPointerMove(P){if(P.pointerType!=="mouse"||Mw(P.currentTarget)||!c)return;const T=su(P);n({type:"TRIGGER_POINTERMOVE",target:P.currentTarget,point:T})},onPointerLeave(P){if(Mw(P.currentTarget)||P.pointerType!=="mouse"||!c)return;const _=su(P);n({type:"TRIGGER_POINTERLEAVE",target:P.currentTarget,point:_})},onPointerDown(P){Mw(P.currentTarget)||lU(P)||P.preventDefault()},onClick(P){P.defaultPrevented||Mw(P.currentTarget)||n({type:"TRIGGER_CLICK",target:P.currentTarget})},onBlur(){n({type:"TRIGGER_BLUR"})},onFocus(){n({type:"TRIGGER_FOCUS"})},onKeyDown(P){if(P.defaultPrevented)return;const _={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},Enter(){n({type:"ARROW_DOWN",src:"enter"})},Space(){n({type:"ARROW_DOWN",src:"space"})}},T=_C(P,{orientation:"vertical",dir:s("dir")}),R=_[T];R&&(P.preventDefault(),R(P))}})},getIndicatorProps(){return e.element({...Lo.indicator.attrs,dir:s("dir"),"data-state":l?"open":"closed"})},getPositionerProps(){return e.element({...Lo.positioner.attrs,dir:s("dir"),id:PG(a),style:O.floating})},getArrowProps(){return e.element({id:Zve(a),...Lo.arrow.attrs,dir:s("dir"),style:O.arrow})},getArrowTipProps(){return e.element({...Lo.arrowTip.attrs,dir:s("dir"),style:O.arrowTip})},getContentProps(){return e.element({...Lo.content.attrs,id:_0(a),"aria-label":s("aria-label"),hidden:!l,"data-state":l?"open":"closed",role:p?"menu":"dialog",tabIndex:0,dir:s("dir"),"aria-activedescendant":o("highlightedId")||void 0,"aria-labelledby":VC(a),"data-placement":m,onPointerEnter(P){P.pointerType==="mouse"&&n({type:"MENU_POINTERENTER"})},onKeyDown(P){if(P.defaultPrevented||!ys(P.currentTarget,ti(P)))return;const _=ti(P);if(!(_?.closest("[role=menu]")===P.currentTarget||_===P.currentTarget))return;if(P.key==="Tab"&&!Hhe(P)){P.preventDefault();return}const R={ArrowDown(){n({type:"ARROW_DOWN"})},ArrowUp(){n({type:"ARROW_UP"})},ArrowLeft(){n({type:"ARROW_LEFT"})},ArrowRight(){n({type:"ARROW_RIGHT"})},Enter(){n({type:"ENTER"})},Space(M){u?n({type:"TYPEAHEAD",key:M.key}):R.Enter?.(M)},Home(){n({type:"HOME"})},End(){n({type:"END"})}},$=_C(P,{dir:s("dir")}),A=R[$];if(A){A(P),P.stopPropagation(),P.preventDefault();return}s("typeahead")&&jhe(P)&&(Ahe(P)||CN(_)||(n({type:"TYPEAHEAD",key:P.key}),P.preventDefault()))}})},getSeparatorProps(){return e.element({...Lo.separator.attrs,role:"separator",dir:s("dir"),"aria-orientation":"horizontal"})},getItemState:x,getItemProps:k,getOptionItemState:w,getOptionItemProps(P){const{type:_,disabled:T,closeOnSelect:R}=P,$=S(P),A=w(P);return{...k($),...e.element({"data-type":_,...Lo.item.attrs,dir:s("dir"),"data-value":$.value,role:`menuitem${_}`,"aria-checked":!!A.checked,"data-state":A.checked?"checked":"unchecked",onClick(M){if(T||OF(M)||Xj(M))return;const Q=M.currentTarget;n({type:"ITEM_CLICK",target:Q,option:$,closeOnSelect:R})}})}},getItemIndicatorProps(P){const _=w(fF(P)),T=_.checked?"checked":"unchecked";return e.element({...Lo.itemIndicator.attrs,dir:s("dir"),"data-disabled":st(_.disabled),"data-highlighted":st(_.highlighted),"data-state":ll(P,"checked")?T:void 0,hidden:ll(P,"checked")?!_.checked:void 0})},getItemTextProps(P){const _=w(fF(P)),T=_.checked?"checked":"unchecked";return e.element({...Lo.itemText.attrs,dir:s("dir"),"data-disabled":st(_.disabled),"data-highlighted":st(_.highlighted),"data-state":ll(P,"checked")?T:void 0})},getItemGroupLabelProps(P){return e.element({...Lo.itemGroupLabel.attrs,id:c6(a,P.htmlFor),dir:s("dir")})},getItemGroupProps(P){return e.element({id:Yve(a,P.id),...Lo.itemGroup.attrs,dir:s("dir"),"aria-labelledby":c6(a,P.id),role:"group"})}}}var{not:va,and:Wp,or:aye}=Cl(),lye={props({props:t}){return{closeOnSelect:!0,typeahead:!0,composite:!0,loopFocus:!1,navigate(e){IN(e.node)},...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning}}},initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"idle"},context({bindable:t,prop:e}){return{suspendPointer:t(()=>({defaultValue:!1})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(r){e("onHighlightChange")?.({highlightedValue:r})}})),lastHighlightedValue:t(()=>({defaultValue:null})),currentPlacement:t(()=>({defaultValue:void 0})),intentPolygon:t(()=>({defaultValue:null})),anchorPoint:t(()=>({defaultValue:null,hash(r){return`x: ${r?.x}, y: ${r?.y}`}})),isSubmenu:t(()=>({defaultValue:!1}))}},refs(){return{parent:null,children:{},typeaheadState:{...lb.defaultOptions},positioningOverride:{}}},computed:{isRtl:({prop:t})=>t("dir")==="rtl",isTypingAhead:({refs:t})=>t.get("typeaheadState").keysSoFar!=="",highlightedId:({context:t,scope:e,refs:r})=>uye(r.get("children"),t.get("highlightedValue"),e)},watch({track:t,action:e,context:r,prop:n}){t([()=>r.get("isSubmenu")],()=>{e(["setSubmenuPlacement"])}),t([()=>r.hash("anchorPoint")],()=>{r.get("anchorPoint")&&e(["reposition"])}),t([()=>n("open")],()=>{e(["toggleVisibility"])})},on:{"PARENT.SET":{actions:["setParentMenu"]},"CHILD.SET":{actions:["setChildMenu"]},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"HIGHLIGHTED.RESTORE":{actions:["restoreHighlightedItem"]},"HIGHLIGHTED.SET":{actions:["setHighlightedItem"]}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_FOCUS:{guard:va("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],effects:["waitForLongPress"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"LONG_PRESS.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},opening:{tags:["closed"],effects:["waitForOpenDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed"},BLUR:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"DELAY.OPEN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}},closing:{tags:["open"],effects:["trackPointerMove","trackInteractOutside","waitForCloseDelay"],on:{"CONTROLLED.OPEN":{target:"open"},"CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]},MENU_POINTERENTER:{target:"open",actions:["clearIntentPolygon"]},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem"]}],"DELAY.CLOSE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHighlightedItem","invokeOnClose"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","resumePointer","clearAnchorPoint"],on:{"CONTROLLED.OPEN":[{guard:aye("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:["highlightFirstItem"]},{guard:"isArrowUpEvent",target:"open",actions:["highlightLastItem"]},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:["setAnchorPoint"]},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:{target:"idle"},ARROW_DOWN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],effects:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Wp(va("isTriggerItem"),"isOpenControlled"),actions:["invokeOnClose"]},{guard:va("isTriggerItem"),target:"closed",actions:["invokeOnClose"]}],CONTEXT_MENU:{actions:["setAnchorPoint","focusMenu"]},ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Wp("isSubmenu","isOpenControlled"),actions:["invokeOnClose"]},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},ENTER:[{guard:"isTriggerItemHighlighted",actions:["openSubmenu"]},{actions:["clickHighlightedItem"]}],ITEM_POINTERMOVE:[{guard:va("isPointerSuspended"),actions:["setHighlightedItem","focusMenu"]},{actions:["setLastHighlightedItem"]}],ITEM_POINTERLEAVE:{guard:Wp(va("isPointerSuspended"),va("isTriggerItem")),actions:["clearHighlightedItem"]},ITEM_CLICK:[{guard:Wp(va("isTriggerItemHighlighted"),va("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Wp(va("isTriggerItemHighlighted"),va("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Wp(va("isTriggerItemHighlighted"),va("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:["setHighlightedItem"]}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",actions:["setIntentPolygon"]},TRIGGER_POINTERLEAVE:{target:"closing"},ITEM_POINTERDOWN:{actions:["setHighlightedItem"]},TYPEAHEAD:{actions:["highlightMatchedItem"]},FOCUS_MENU:{actions:["focusMenu"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{closeOnSelect:({prop:t,event:e})=>!!(e?.closeOnSelect??t("closeOnSelect")),isTriggerItem:({event:t})=>iye(t.target),isTriggerItemHighlighted:({event:t,scope:e,computed:r})=>!!(t.target??e.getById(r("highlightedId")))?.hasAttribute("aria-controls"),isSubmenu:({context:t})=>t.get("isSubmenu"),isPointerSuspended:({context:t})=>t.get("suspendPointer"),isHighlightedItemEditable:({scope:t,computed:e})=>CN(t.getById(e("highlightedId"))),isOpenControlled:({prop:t})=>t("open")!==void 0,isArrowLeftEvent:({event:t})=>t.previousEvent?.type==="ARROW_LEFT",isArrowUpEvent:({event:t})=>t.previousEvent?.type==="ARROW_UP",isArrowDownEvent:({event:t})=>t.previousEvent?.type==="ARROW_DOWN",isOpenAutoFocusEvent:({event:t})=>t.previousEvent?.type==="OPEN_AUTOFOCUS"},effects:{waitForOpenDelay({send:t}){const e=setTimeout(()=>{t({type:"DELAY.OPEN"})},100);return()=>clearTimeout(e)},waitForCloseDelay({send:t}){const e=setTimeout(()=>{t({type:"DELAY.CLOSE"})},300);return()=>clearTimeout(e)},waitForLongPress({send:t}){const e=setTimeout(()=>{t({type:"LONG_PRESS.OPEN"})},700);return()=>clearTimeout(e)},trackPositioning({context:t,prop:e,scope:r,refs:n}){if(OR(r))return;const i={...e("positioning"),...n.get("positioningOverride")};t.set("currentPlacement",i.placement);const o=()=>u6(r);return ra(Nw(r),o,{...i,defer:!0,onComplete(s){t.set("currentPlacement",s.placement)}})},trackInteractOutside({refs:t,scope:e,prop:r,context:n,send:i}){const o=()=>fd(e);let s=!0;return tp(o,{type:"menu",defer:!0,exclude:[Nw(e)],onInteractOutside:r("onInteractOutside"),onRequestDismiss:r("onRequestDismiss"),onFocusOutside(a){r("onFocusOutside")?.(a);const l=ti(a.detail.originalEvent);if(ys(OR(e),l)){a.preventDefault();return}},onEscapeKeyDown(a){r("onEscapeKeyDown")?.(a),n.get("isSubmenu")&&a.preventDefault(),d6({parent:t.get("parent")})},onPointerDownOutside(a){r("onPointerDownOutside")?.(a);const l=ti(a.detail.originalEvent);if(ys(OR(e),l)&&a.detail.contextmenu){a.preventDefault();return}s=!a.detail.focusable},onDismiss(){i({type:"CLOSE",src:"interact-outside",restoreFocus:s})}})},trackPointerMove({context:t,scope:e,send:r,refs:n,flush:i}){const o=n.get("parent");i(()=>{o.context.set("suspendPointer",!0)});const s=e.getDoc();return hr(s,"pointermove",a=>{cye(t.get("intentPolygon"),{x:a.clientX,y:a.clientY})||(r({type:"POINTER_MOVED_AWAY_FROM_SUBMENU"}),o.context.set("suspendPointer",!1))})},scrollToHighlightedItem({event:t,scope:e,computed:r}){const n=()=>{if(t.current().type.startsWith("ITEM_POINTER"))return;const o=e.getById(r("highlightedId")),s=fd(e);EC(o,{rootEl:s,block:"nearest"})};return wt(()=>n()),TP(()=>fd(e),{defer:!0,attributes:["aria-activedescendant"],callback:n})}},actions:{setAnchorPoint({context:t,event:e}){t.set("anchorPoint",r=>Ks(r,e.point)?r:e.point)},setSubmenuPlacement({context:t,computed:e,refs:r}){if(!t.get("isSubmenu"))return;const n=e("isRtl")?"left-start":"right-start";r.set("positioningOverride",{placement:n,gutter:0})},reposition({context:t,scope:e,prop:r,event:n,refs:i}){const o=()=>u6(e),s=t.get("anchorPoint"),a=s?()=>({width:0,height:0,...s}):void 0,l={...r("positioning"),...i.get("positioningOverride")};ra(Nw(e),o,{...l,defer:!0,getAnchorRect:a,...n.options??{},listeners:!1,onComplete(c){t.set("currentPlacement",c.placement)}})},setOptionState({event:t}){if(!t.option)return;const{checked:e,onCheckedChange:r,type:n}=t.option;n==="radio"?r?.(!0):n==="checkbox"&&r?.(!e)},clickHighlightedItem({scope:t,computed:e,prop:r,context:n}){const i=t.getById(e("highlightedId"));if(!i||i.dataset.disabled)return;const o=n.get("highlightedValue");tU(i)?r("navigate")?.({value:o,node:i,href:i.href}):queueMicrotask(()=>i.click())},setIntentPolygon({context:t,scope:e,event:r}){const n=fd(e),i=t.get("currentPlacement");if(!n||!i)return;const o=n.getBoundingClientRect(),s=yme(o,i);if(!s)return;const l=sge(i)==="right"?-5:5;t.set("intentPolygon",[{...r.point,x:r.point.x+l},...s])},clearIntentPolygon({context:t}){t.set("intentPolygon",null)},clearAnchorPoint({context:t}){t.set("anchorPoint",null)},resumePointer({refs:t,flush:e}){const r=t.get("parent");r&&e(()=>{r.context.set("suspendPointer",!1)})},setHighlightedItem({context:t,event:e}){const r=e.value||Qh(e.target);t.set("highlightedValue",r)},clearHighlightedItem({context:t}){t.set("highlightedValue",null)},focusMenu({scope:t}){wt(()=>{const e=fd(t);ob({root:e,enabled:!ys(e,t.getActiveElement()),filter(n){return!n.role?.startsWith("menuitem")}})?.focus({preventScroll:!0})})},highlightFirstItem({context:t,scope:e}){(fd(e)?queueMicrotask:wt)(()=>{const n=Jve(e);n&&t.set("highlightedValue",Qh(n))})},highlightLastItem({context:t,scope:e}){(fd(e)?queueMicrotask:wt)(()=>{const n=eye(e);n&&t.set("highlightedValue",Qh(n))})},highlightNextItem({context:t,scope:e,event:r,prop:n}){const i=tye(e,{loop:r.loop,value:t.get("highlightedValue"),loopFocus:n("loopFocus")});t.set("highlightedValue",Qh(i))},highlightPrevItem({context:t,scope:e,event:r,prop:n}){const i=rye(e,{loop:r.loop,value:t.get("highlightedValue"),loopFocus:n("loopFocus")});t.set("highlightedValue",Qh(i))},invokeOnSelect({context:t,prop:e,scope:r}){const n=t.get("highlightedValue");if(n==null)return;const i=Kve(r,n);oye(i,n),e("onSelect")?.({value:n})},focusTrigger({scope:t,context:e,event:r}){e.get("isSubmenu")||e.get("anchorPoint")||r.restoreFocus===!1||queueMicrotask(()=>Nw(t)?.focus({preventScroll:!0}))},highlightMatchedItem({scope:t,context:e,event:r,refs:n}){const i=nye(t,{key:r.key,value:e.get("highlightedValue"),typeaheadState:n.get("typeaheadState")});i&&e.set("highlightedValue",Qh(i))},setParentMenu({refs:t,event:e,context:r}){t.set("parent",e.value),r.set("isSubmenu",!0)},setChildMenu({refs:t,event:e}){const r=t.get("children");r[e.id]=e.value,t.set("children",r)},closeRootMenu({refs:t}){d6({parent:t.get("parent")})},openSubmenu({refs:t,scope:e,computed:r}){const i=e.getById(r("highlightedId"))?.getAttribute("data-uid"),o=t.get("children");(i?o[i]:null)?.send({type:"OPEN_AUTOFOCUS"})},focusParentMenu({refs:t}){t.get("parent")?.send({type:"FOCUS_MENU"})},setLastHighlightedItem({context:t,event:e}){t.set("lastHighlightedValue",Qh(e.target))},restoreHighlightedItem({context:t}){t.get("lastHighlightedValue")&&(t.set("highlightedValue",t.get("lastHighlightedValue")),t.set("lastHighlightedValue",null))},restoreParentHighlightedItem({refs:t}){t.get("parent")?.send({type:"HIGHLIGHTED.RESTORE"})},invokeOnOpen({prop:t}){t("onOpenChange")?.({open:!0})},invokeOnClose({prop:t}){t("onOpenChange")?.({open:!1})},toggleVisibility({prop:t,event:e,send:r}){r({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}};function d6(t){let e=t.parent;for(;e&&e.context.get("isSubmenu");)e=e.refs.get("parent");e?.send({type:"CLOSE"})}function cye(t,e){return t?bme(t,e):!1}function uye(t,e,r){const n=Object.keys(t).length>0;if(!e)return null;if(!n)return hb(r,e);for(const i in t){const o=t[i],s=VC(o.scope);if(s===e)return s}return hb(r,e)}xt()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","onSelect","open","positioning","typeahead"]);xt()(["closeOnSelect","disabled","value","valueText"]);xt()(["htmlFor"]);xt()(["id"]);xt()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]);const dye=t=>{const e=E.useId(),{getRootNode:r}=Cs(),{dir:n}=Va(),i={id:e,dir:n,getRootNode:r,...t},o=Ps(lye,i);return{api:sye(o,oa),service:o}},[_G,TG]=Cn({name:"MenuMachineContext",hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[EG,hye]=Cn({name:"MenuMachineContext",hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),fye=t=>{const[e,r]=Cc(t),[n,i]=Nn()(r,["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onRequestDismiss","onSelect","open","positioning","typeahead"]),o=Ji(),s=TG(),{api:a,service:l}=dye(n),c=Fa(Ae({present:a.open},e));SG(()=>{s&&o&&(o.setChild(l),a.setParent(s))});const u=E.useCallback(()=>o?.getTriggerItemProps(a),[a,o]);return h.jsx(EG,{value:u,children:h.jsx(_G,{value:l,children:h.jsx(oG,{value:a,children:h.jsx(kl,{value:c,...i})})})})},pye=t=>{const e=Ji(),r=TG(),[n,{value:i,children:o}]=Cc(t),{api:s,service:a}=i,l=Fa(Ae({present:s.open},n));SG(()=>{r&&e&&(e.setChild(a),s.setParent(r))});const c=E.useCallback(()=>e?.getTriggerItemProps(s),[s,e]);return h.jsx(EG,{value:c,children:h.jsx(_G,{value:a,children:h.jsx(oG,{value:s,children:h.jsx(kl,{value:l,children:o})})})})},RG=E.forwardRef((t,e)=>{const r=Ji(),n=Ae(r.getSeparatorProps(),t);return h.jsx(Ue.hr,{...n,ref:e})});RG.displayName="MenuSeparator";const IG=E.forwardRef((t,e)=>{const r=Ji(),n=sa(),i=Ae({...r.getTriggerProps(),"aria-controls":n.unmounted?void 0:r.getTriggerProps()["aria-controls"]},t);return h.jsx(Ue.button,{...i,ref:e})});IG.displayName="MenuTrigger";const jG=E.forwardRef((t,e)=>{const r=hye(),n=Ae(r?.()??{},t);return h.jsx(FP,{value:{value:n["data-value"]},children:h.jsx(Ue.div,{...n,ref:e})})});jG.displayName="MenuTriggerItem";let xR=new Map,l2=!1;try{l2=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let FC=!1;try{FC=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const $G={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class gye{format(e){let r="";if(!l2&&this.options.signDisplay!=null?r=vye(this.numberFormatter,this.options.signDisplay,e):r=this.numberFormatter.format(e),this.options.style==="unit"&&!FC){var n;let{unit:i,unitDisplay:o="short",locale:s}=this.resolvedOptions();if(!i)return r;let a=(n=$G[i])===null||n===void 0?void 0:n[o];r+=a[s]||a.default}return r}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,r){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,r);if(r<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} – ${this.format(r)}`}formatRangeToParts(e,r){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,r);if(r<e)throw new RangeError("End date must be >= start date");let n=this.numberFormatter.formatToParts(e),i=this.numberFormatter.formatToParts(r);return[...n.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!l2&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!FC&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,r={}){this.numberFormatter=mye(e,r),this.options=r}}function mye(t,e={}){let{numberingSystem:r}=e;if(r&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${r}`),e.style==="unit"&&!FC){var n;let{unit:s,unitDisplay:a="short"}=e;if(!s)throw new Error('unit option must be provided with style: "unit"');if(!(!((n=$G[s])===null||n===void 0)&&n[a]))throw new Error(`Unsupported unit ${s} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let i=t+(e?Object.entries(e).sort((s,a)=>s[0]<a[0]?-1:1).join():"");if(xR.has(i))return xR.get(i);let o=new Intl.NumberFormat(t,e);return xR.set(i,o),o}function vye(t,e,r){if(e==="auto")return t.format(r);if(e==="never")return t.format(Math.abs(r));{let n=!1;if(e==="always"?n=r>0||Object.is(r,0):e==="exceptZero"&&(Object.is(r,-0)||Object.is(r,0)?r=Math.abs(r):n=r>0),n){let i=t.format(-r),o=t.format(r),s=i.replace(o,"").replace(/\u200e|\u061C/,"");return[...s].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(o,"!!!").replace(s,"+").replace("!!!",o)}else return t.format(r)}}const yye=new RegExp("^.*\\(.*\\).*$"),bye=["latn","arab","hanidec","deva","beng","fullwide"];class AG{parse(e){return wR(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,r,n){return wR(this.locale,this.options,e).isValidPartialNumber(e,r,n)}getNumberingSystem(e){return wR(this.locale,this.options,e).options.numberingSystem}constructor(e,r={}){this.locale=e,this.options=r}}const h6=new Map;function wR(t,e,r){let n=f6(t,e);if(!t.includes("-nu-")&&!n.isValidPartialNumber(r)){for(let i of bye)if(i!==n.options.numberingSystem){let o=f6(t+(t.includes("-u-")?"-nu-":"-u-nu-")+i,e);if(o.isValidPartialNumber(r))return o}}return n}function f6(t,e){let r=t+(e?Object.entries(e).sort((i,o)=>i[0]<o[0]?-1:1).join():""),n=h6.get(r);return n||(n=new Oye(t,e),h6.set(r,n)),n}class Oye{parse(e){let r=this.sanitize(e);if(this.symbols.group&&(r=Up(r,this.symbols.group,"")),this.symbols.decimal&&(r=r.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(r=r.replace(this.symbols.minusSign,"-")),r=r.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let s=r.indexOf("-");r=r.replace("-",""),r=r.replace("+","");let a=r.indexOf(".");a===-1&&(a=r.length),r=r.replace(".",""),a-2===0?r=`0.${r}`:a-2===-1?r=`0.0${r}`:a-2===-2?r="0.00":r=`${r.slice(0,a-2)}.${r.slice(a-2)}`,s>-1&&(r=`-${r}`)}let n=r?+r:NaN;if(isNaN(n))return NaN;if(this.options.style==="percent"){var i,o;let s={...this.options,style:"decimal",minimumFractionDigits:Math.min(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)+2,20),maximumFractionDigits:Math.min(((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)+2,20)};return new AG(this.locale,s).parse(new gye(this.locale,s).format(n))}return this.options.currencySign==="accounting"&&yye.test(e)&&(n=-1*n),n}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=Up(e,".",this.symbols.group))),this.symbols.group==="’"&&e.includes("'")&&(e=Up(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=Up(e," ",this.symbols.group),e=Up(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,r=-1/0,n=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&r<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&n>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Up(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,r={}){this.locale=e,r.roundingIncrement!==1&&r.roundingIncrement!=null&&(r.maximumFractionDigits==null&&r.minimumFractionDigits==null?(r.maximumFractionDigits=0,r.minimumFractionDigits=0):r.maximumFractionDigits==null?r.maximumFractionDigits=r.minimumFractionDigits:r.minimumFractionDigits==null&&(r.minimumFractionDigits=r.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,r),this.options=this.formatter.resolvedOptions(),this.symbols=wye(e,this.formatter,this.options,r);var n,i;this.options.style==="percent"&&(((n=this.options.minimumFractionDigits)!==null&&n!==void 0?n:0)>18||((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const p6=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),xye=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function wye(t,e,r,n){var i,o,s,a;let l=new Intl.NumberFormat(t,{...r,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),p=xye.map(M=>l.formatToParts(M));var m;let v=(m=(i=c.find(M=>M.type==="minusSign"))===null||i===void 0?void 0:i.value)!==null&&m!==void 0?m:"-",b=(o=u.find(M=>M.type==="plusSign"))===null||o===void 0?void 0:o.value;!b&&(n?.signDisplay==="exceptZero"||n?.signDisplay==="always")&&(b="+");let x=(s=new Intl.NumberFormat(t,{...r,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(M=>M.type==="decimal"))===null||s===void 0?void 0:s.value,S=(a=c.find(M=>M.type==="group"))===null||a===void 0?void 0:a.value,w=c.filter(M=>!p6.has(M.type)).map(M=>g6(M.value)),k=p.flatMap(M=>M.filter(Q=>!p6.has(Q.type)).map(Q=>g6(Q.value))),P=[...new Set([...w,...k])].sort((M,Q)=>Q.length-M.length),_=P.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${P.join("|")}|[\\p{White_Space}]`,"gu"),T=[...new Intl.NumberFormat(r.locale,{useGrouping:!1}).format(9876543210)].reverse(),R=new Map(T.map((M,Q)=>[M,Q])),$=new RegExp(`[${T.join("")}]`,"g");return{minusSign:v,plusSign:b,decimal:x,group:S,literals:_,numeral:$,index:M=>String(R.get(M))}}function Up(t,e,r){return t.replaceAll?t.replaceAll(e,r):t.split(e).join(r)}function g6(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var NG=Ct("numberInput").parts("root","label","input","control","valueText","incrementTrigger","decrementTrigger","scrubber");NG.build();var Sye=t=>t.ids?.input??`number-input:${t.id}:input`,Cye=t=>t.ids?.incrementTrigger??`number-input:${t.id}:inc`,kye=t=>t.ids?.decrementTrigger??`number-input:${t.id}:dec`,MG=t=>`number-input:${t.id}:cursor`,Dw=t=>t.getById(Sye(t)),Pye=t=>t.getById(Cye(t)),_ye=t=>t.getById(kye(t)),DG=t=>t.getDoc().getElementById(MG(t)),Tye=(t,e)=>{let r=null;return e==="increment"&&(r=Pye(t)),e==="decrement"&&(r=_ye(t)),r},Eye=(t,e)=>{if(!Wm())return jye(t,e),()=>{DG(t)?.remove()}},Rye=t=>{const e=t.getDoc(),r=e.documentElement,n=e.body;return n.style.pointerEvents="none",r.style.userSelect="none",r.style.cursor="ew-resize",()=>{n.style.pointerEvents="",r.style.userSelect="",r.style.cursor="",r.style.length||r.removeAttribute("style"),n.style.length||n.removeAttribute("style")}},Iye=(t,e)=>{const{point:r,isRtl:n,event:i}=e,o=t.getWin(),s=cR(i.movementX,o.devicePixelRatio),a=cR(i.movementY,o.devicePixelRatio);let l=s>0?"increment":s<0?"decrement":null;n&&l==="increment"&&(l="decrement"),n&&l==="decrement"&&(l="increment");const c={x:r.x+s,y:r.y+a},u=o.innerWidth,p=cR(7.5,o.devicePixelRatio);return c.x=Wde(c.x+p,u)-p,{hint:l,point:c}},jye=(t,e)=>{const r=t.getDoc(),n=r.createElement("div");n.className="scrubber--cursor",n.id=MG(t),Object.assign(n.style,{width:"15px",height:"15px",position:"fixed",pointerEvents:"none",left:"0px",top:"0px",zIndex:K9,transform:e?`translate3d(${e.x}px, ${e.y}px, 0px)`:void 0,willChange:"transform"}),n.innerHTML=`
|
|
9
9
|
<svg width="46" height="15" style="left: -15.5px; position: absolute; top: 0; filter: drop-shadow(rgba(0, 0, 0, 0.4) 0px 1px 1.1px);">
|
|
10
10
|
<g transform="translate(2 3)">
|
|
11
11
|
<path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z" style="stroke-width: 2px; stroke: white;"></path>
|
|
@@ -72,7 +72,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
72
72
|
`),w=oRe(x.slice(0,S)),k=w["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(P=x.slice(S),P){if(_=OJ(t,P),Object.keys(_).length>1||"data"in _||"incremental"in _||"errors"in _||"payload"in _)if(LEe(_)){if(T={},"payload"in _){if(Object.keys(_).length===1&&_.payload===null)return[2];T=pe({},_.payload)}"errors"in _&&(T=pe(pe({},T),{extensions:pe(pe({},"extensions"in T?T.extensions:null),($={},$[g_]=_.errors,$))})),e(T)}else e(_);else if(Object.keys(_).length===1&&"hasNext"in _&&!_.hasNext)return[2]}O=a.indexOf(s)}return[3,1];case 3:return[2]}})})}function oRe(t){var e={};return t.split(`
|
|
73
73
|
`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),o=r.slice(n+1).trim();e[i]=o}}),e}function OJ(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};vJ(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function sRe(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function aRe(t){return function(e){return e.text().then(function(r){return OJ(e,r)}).then(function(r){return!Array.isArray(r)&&!T3.call(r,"data")&&!T3.call(r,"errors")&&vJ(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var e$=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=Bo(54,e,i.message);throw n.parseError=i,n}return r},lRe={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},cRe={accept:"*/*","content-type":"application/json"},uRe={method:"POST"},dRe={http:lRe,headers:cRe,options:uRe},hRe=function(t,e){return e(t)};function fRe(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},o={};r.forEach(function(p){i=pe(pe(pe({},i),p.options),{headers:pe(pe({},i.headers),p.headers)}),p.credentials&&(i.credentials=p.credentials),o=pe(pe({},o),p.http)}),i.headers&&(i.headers=pRe(i.headers,o.preserveHeaderCase));var s=t.operationName,a=t.extensions,l=t.variables,c=t.query,u={operationName:s,variables:l};return o.includeExtensions&&(u.extensions=a),o.includeQuery&&(u.query=e(c,vf)),{options:i,body:u}}function pRe(t,e){if(!e){var r={};return Object.keys(Object(t)).forEach(function(o){r[o.toLowerCase()]=t[o]}),r}var n={};Object.keys(Object(t)).forEach(function(o){n[o.toLowerCase()]={originalName:o,value:t[o]}});var i={};return Object.keys(n).forEach(function(o){i[n[o].originalName]=n[o].value}),i}var gRe=function(t){if(!t&&typeof fetch>"u")throw Bo(51)},mRe=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function vRe(t,e){var r=[],n=function(p,m){r.push("".concat(p,"=").concat(encodeURIComponent(m)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=e$(e.variables,"Variables map")}catch(p){return{parseError:p}}n("variables",i)}if(e.extensions){var o=void 0;try{o=e$(e.extensions,"Extensions map")}catch(p){return{parseError:p}}n("extensions",o)}var s="",a=t,l=t.indexOf("#");l!==-1&&(s=t.substr(l),a=t.substr(0,l));var c=a.indexOf("?")===-1?"?":"&",u=a+c+r.join("&")+s;return{newURI:u}}var E3=ol(function(){return fetch}),xJ=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,o=i===void 0?hRe:i,s=t.includeExtensions,a=t.preserveHeaderCase,l=t.useGETForQueries,c=t.includeUnusedVariables,u=c===void 0?!1:c,p=fc(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&gRe(n||E3);var m={http:{includeExtensions:s,preserveHeaderCase:a},options:p.fetchOptions,credentials:p.credentials,headers:p.headers};return new $u(function(v){var b=mRe(v,r),O=v.getContext(),x={};if(O.clientAwareness){var S=O.clientAwareness,w=S.name,k=S.version;w&&(x["apollographql-client-name"]=w),k&&(x["apollographql-client-version"]=k)}var P=pe(pe({},x),O.headers),_={http:O.http,options:O.fetchOptions,credentials:O.credentials,headers:P};if(xb(["client"],v.query)){globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&Je.warn(52);var T=uJ(v.query);if(!T)return nI(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));v.query=T}var R=fRe(v,o,dRe,m,_),$=R.options,A=R.body;A.variables&&!u&&(A.variables=BEe(A.variables,v.query));var M;!$.signal&&typeof AbortController<"u"&&(M=new AbortController,$.signal=M.signal);var Q=function(se){return se.kind==="OperationDefinition"&&se.operation==="mutation"},V=function(se){return se.kind==="OperationDefinition"&&se.operation==="subscription"},q=V(YO(v.query)),N=xb(["defer"],v.query);if(l&&!v.query.definitions.some(Q)&&($.method="GET"),N||q){$.headers=$.headers||{};var B="multipart/mixed;";q&&N&&globalThis.__DEV__!==!1&&Je.warn(53),q?B+="boundary=graphql;subscriptionSpec=1.0,application/json":N&&(B+="deferSpec=20220824,application/json"),$.headers.accept=B}if($.method==="GET"){var re=vRe(b,A),he=re.newURI,ne=re.parseError;if(ne)return nI(ne);b=he}else try{$.body=e$(A,"Payload")}catch(se){return nI(se)}return new Wr(function(se){var X=n||ol(function(){return fetch})||E3,D=se.next.bind(se);return X(b,$).then(function(H){var J;v.setContext({response:H});var F=(J=H.headers)===null||J===void 0?void 0:J.get("content-type");return F!==null&&/^multipart\/mixed/i.test(F)?iRe(H,D):aRe(v)(H).then(D)}).then(function(){M=void 0,se.complete()}).catch(function(H){M=void 0,sRe(H,se)}),function(){M&&M.abort()}})})},yRe=function(t){Tl(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,xJ(r).request)||this;return n.options=r,n}return e}($u);const{toString:R3,hasOwnProperty:bRe}=Object.prototype,I3=Function.prototype.toString,t$=new Map;function bn(t,e){try{return r$(t,e)}finally{t$.clear()}}function r$(t,e){if(t===e)return!0;const r=R3.call(t),n=R3.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if($3(t,e))return!0;const i=j3(t),o=j3(e),s=i.length;if(s!==o.length)return!1;for(let a=0;a<s;++a)if(!bRe.call(e,i[a]))return!1;for(let a=0;a<s;++a){const l=i[a];if(!r$(t[l],e[l]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if($3(t,e))return!0;const i=t.entries(),o=r==="[object Map]";for(;;){const s=i.next();if(s.done)break;const[a,l]=s.value;if(!e.has(a)||o&&!r$(l,e.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=I3.call(t);return i!==I3.call(e)?!1:!wRe(i,xRe)}}return!1}function j3(t){return Object.keys(t).filter(ORe,t)}function ORe(t){return this[t]!==void 0}const xRe="{ [native code] }";function wRe(t,e){const r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function $3(t,e){let r=t$.get(t);if(r){if(r.has(e))return!0}else t$.set(t,r=new Set);return r.add(e),!1}function wJ(t,e,r,n){var i=e.data,o=fc(e,["data"]),s=r.data,a=fc(r,["data"]);return bn(o,a)&&rC(YO(t).selectionSet,i,s,{fragmentMap:mv(yv(t)),variables:n})}function rC(t,e,r,n){if(e===r)return!0;var i=new Set;return t.selections.every(function(o){if(i.has(o)||(i.add(o),!ZO(o,n.variables))||A3(o))return!0;if(Zd(o)){var s=Su(o),a=e&&e[s],l=r&&r[s],c=o.selectionSet;if(!c)return bn(a,l);var u=Array.isArray(a),p=Array.isArray(l);if(u!==p)return!1;if(u&&p){var m=a.length;if(l.length!==m)return!1;for(var v=0;v<m;++v)if(!rC(c,a[v],l[v],n))return!1;return!0}return rC(c,a,l,n)}else{var b=u_(o,n.fragmentMap);if(b)return A3(b)?!0:rC(b.selectionSet,e,r,n)}})}function A3(t){return!!t.directives&&t.directives.some(SRe)}function SRe(t){return t.name.value==="nonreactive"}var SJ=cp?WeakMap:Map,CJ=WM?WeakSet:Set,nD=new bv,N3=!1;function kJ(){N3||(N3=!0,globalThis.__DEV__!==!1&&Je.warn(64))}function PJ(t,e,r){return nD.withValue(!0,function(){var n=g0(t,e,r,!1);return Object.isFrozen(t)&&tk(n),n})}function CRe(t,e){if(e.has(t))return e.get(t);var r=Array.isArray(t)?[]:Object.create(null);return e.set(t,r),r}function g0(t,e,r,n,i){var o,s=r.knownChanged,a=CRe(t,r.mutableTargets);if(Array.isArray(t)){for(var l=0,c=Array.from(t.entries());l<c.length;l++){var u=c[l],p=u[0],m=u[1];if(m===null){a[p]=null;continue}var v=g0(m,e,r,n,globalThis.__DEV__!==!1?"".concat(i||"","[").concat(p,"]"):void 0);s.has(v)&&s.add(a),a[p]=v}return s.has(a)?a:t}for(var b=0,O=e.selections;b<O.length;b++){var x=O[b],S=void 0;if(n&&s.add(a),x.kind===et.FIELD){var w=Su(x),k=x.selectionSet;if(S=a[w]||t[w],S===void 0)continue;if(k&&S!==null){var v=g0(t[w],k,r,n,globalThis.__DEV__!==!1?"".concat(i||"",".").concat(w):void 0);s.has(v)&&(S=v)}globalThis.__DEV__===!1&&(a[w]=S),globalThis.__DEV__!==!1&&(n&&w!=="__typename"&&!(!((o=Object.getOwnPropertyDescriptor(a,w))===null||o===void 0)&&o.value)?Object.defineProperty(a,w,kRe(w,S,i||"",r.operationName,r.operationType)):(delete a[w],a[w]=S))}if(x.kind===et.INLINE_FRAGMENT&&(!x.typeCondition||r.cache.fragmentMatches(x,t.__typename))&&(S=g0(t,x.selectionSet,r,n,i)),x.kind===et.FRAGMENT_SPREAD){var P=x.name.value,_=r.fragmentMap[P]||(r.fragmentMap[P]=r.cache.lookupFragment(P));Je(_,59,P);var T=yTe(x);T!=="mask"&&(S=g0(t,_.selectionSet,r,T==="migrate",i))}s.has(S)&&s.add(a)}return"__typename"in t&&!("__typename"in a)&&(a.__typename=t.__typename),Object.keys(a).length!==Object.keys(t).length&&s.add(a),s.has(a)?a:t}function kRe(t,e,r,n,i){var o=function(){return nD.getValue()||(globalThis.__DEV__!==!1&&Je.warn(60,n?"".concat(i," '").concat(n,"'"):"anonymous ".concat(i),"".concat(r,".").concat(t).replace(/^\./,"")),o=function(){return e}),e};return{get:function(){return o()},set:function(s){o=function(){return s}},enumerable:!0,configurable:!0}}function _J(t,e,r,n){if(!r.fragmentMatches)return globalThis.__DEV__!==!1&&kJ(),t;var i=e.definitions.filter(function(s){return s.kind===et.FRAGMENT_DEFINITION});typeof n>"u"&&(Je(i.length===1,61,i.length),n=i[0].name.value);var o=i.find(function(s){return s.name.value===n});return Je(!!o,62,n),t==null||bn(t,{})?t:PJ(t,o.selectionSet,{operationType:"fragment",operationName:o.name.value,fragmentMap:mv(yv(e)),cache:r,mutableTargets:new SJ,knownChanged:new CJ})}function PRe(t,e,r){var n;if(!r.fragmentMatches)return globalThis.__DEV__!==!1&&kJ(),t;var i=zf(e);return Je(i,63),t==null?t:PJ(t,i.selectionSet,{operationType:i.operation,operationName:(n=i.name)===null||n===void 0?void 0:n.value,fragmentMap:mv(yv(e)),cache:r,mutableTargets:new SJ,knownChanged:new CJ})}var TJ=function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=Sb(CTe,{max:wu["cache.fragmentQueryDocuments"]||1e3,cache:JC})}return t.prototype.lookupFragment=function(e){return null},t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){var n=this;return r===void 0&&(r=!!e.optimistic),globalThis.__DEV__!==!1&&li(e,"canonizeResults","cache.readQuery"),_o("canonizeResults",function(){return n.read(pe(pe({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))})},t.prototype.watchFragment=function(e){var r=this,n=e.fragment,i=e.fragmentName,o=e.from,s=e.optimistic,a=s===void 0?!0:s,l=fc(e,["fragment","fragmentName","from","optimistic"]),c=this.getFragmentDoc(n,i),u=typeof o>"u"||typeof o=="string"?o:this.identify(o),p=!!e[Symbol.for("apollo.dataMasking")];if(globalThis.__DEV__!==!1){var m=i||XK(n).name.value;u||globalThis.__DEV__!==!1&&Je.warn(1,m)}var v=pe(pe({},l),{returnPartialData:!0,id:u,query:c,optimistic:a}),b;return new Wr(function(O){return r.watch(pe(pe({},v),{immediate:!0,callback:function(x){var S=p?_J(x.result,n,r,i):x.result;if(!(b&&wJ(c,{data:b.result},{data:S},e.variables))){var w={data:S,complete:!!x.complete};x.missing&&(w.missing=p_(x.missing.map(function(k){return k.missing}))),b=pe(pe({},x),{result:S}),O.next(w)}}}))})},t.prototype.readFragment=function(e,r){var n=this;return r===void 0&&(r=!!e.optimistic),globalThis.__DEV__!==!1&&li(e,"canonizeResults","cache.readFragment"),_o("canonizeResults",function(){return n.read(pe(pe({},e),{query:n.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))})},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=fc(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,o=e.fragmentName,s=fc(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(s,{query:this.getFragmentDoc(i,o),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return globalThis.__DEV__!==!1&&li(e,"canonizeResults","cache.updateQuery"),this.batch({update:function(n){var i=_o("canonizeResults",function(){return n.readQuery(e)}),o=r(i);return o==null?i:(n.writeQuery(pe(pe({},e),{data:o})),o)}})},t.prototype.updateFragment=function(e,r){return globalThis.__DEV__!==!1&&li(e,"canonizeResults","cache.updateFragment"),this.batch({update:function(n){var i=_o("canonizeResults",function(){return n.readFragment(e)}),o=r(i);return o==null?i:(n.writeFragment(pe(pe({},e),{data:o})),o)}})},t}();globalThis.__DEV__!==!1&&(TJ.prototype.getMemoryInternals=MTe);var EJ=function(t){Tl(e,t);function e(r,n,i,o){var s,a=t.call(this,r)||this;if(a.message=r,a.path=n,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var l=a.path.length-1;l>=0;--l)a.missing=(s={},s[a.path[l]]=a.missing,s)}else a.missing=a.path;return a.__proto__=e.prototype,a}return e}(Error),Ui=Object.prototype.hasOwnProperty;function Dy(t){return t==null}function RJ(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=Dy(n)?Dy(i)?void 0:{_id:i}:{id:n}),Dy(n)&&!Dy(i)&&(n=i),!Dy(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var IJ={dataIdFromObject:RJ,addTypename:!0,resultCaching:!0,canonizeResults:!1};function _Re(t){return xm(IJ,t)}function jJ(t){var e=t.canonizeResults;return e===void 0?IJ.canonizeResults:e}function TRe(t,e){return Dr(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var $J=/^[_a-z][_0-9a-z]*/i;function Jd(t){var e=t.match($J);return e?e[0]:t}function n$(t,e,r){return oi(e)?si(e)?e.every(function(n){return n$(t,n,r)}):t.selections.every(function(n){if(Zd(n)&&ZO(n,r)){var i=Su(n);return Ui.call(e,i)&&(!n.selectionSet||n$(n.selectionSet,e[i],r))}return!0}):!1}function Rg(t){return oi(t)&&!Dr(t)&&!si(t)}function ERe(){return new Kd}function AJ(t,e){var r=mv(yv(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var nC=Object.create(null),iI=function(){return nC},M3=Object.create(null),Cb=function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,o){return tk(Dr(i)?n.get(i.__ref,o):i&&i[o])},this.canRead=function(i){return Dr(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,o){if(typeof i=="string")return Ug(i);if(Dr(i))return i;var s=n.policies.identify(i)[0];if(s){var a=Ug(s);return o&&n.merge(s,i),a}}}return t.prototype.toObject=function(){return pe({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),Ui.call(this.data,e)){var n=this.data[e];if(n&&Ui.call(n,r))return n[r]}if(r==="__typename"&&Ui.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof gd)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),Ui.call(this.data,e))return this.data[e];if(this instanceof gd)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;Dr(e)&&(e=e.__ref),Dr(r)&&(r=r.__ref);var o=typeof e=="string"?this.lookup(i=e):e,s=typeof r=="string"?this.lookup(i=r):r;if(s){Je(typeof i=="string",2);var a=new Kd(IRe).merge(o,s);if(this.data[i]=a,a!==o&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);o||(l.__exists=1),Object.keys(s).forEach(function(c){if(!o||o[c]!==a[c]){l[c]=1;var u=Jd(c);u!==c&&!n.policies.hasKeyArgs(a.__typename,u)&&(l[u]=1),a[c]===void 0&&!(n instanceof gd)&&delete a[c]}}),l.__typename&&!(o&&o.__typename)&&this.policies.rootTypenamesById[i]===a.__typename&&delete l.__typename,Object.keys(l).forEach(function(c){return n.group.dirty(i,c)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var o=Object.create(null),s=!1,a=!0,l={DELETE:nC,INVALIDATE:M3,isReference:Dr,toReference:this.toReference,canRead:this.canRead,readField:function(c,u){return n.policies.readField(typeof c=="string"?{fieldName:c,from:u||Ug(e)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var u=Jd(c),p=i[c];if(p!==void 0){var m=typeof r=="function"?r:r[c]||r[u];if(m){var v=m===iI?nC:m(tk(p),pe(pe({},l),{fieldName:u,storeFieldName:c,storage:n.getStorage(e,c)}));if(v===M3)n.group.dirty(e,c);else if(v===nC&&(v=void 0),v!==p&&(o[c]=v,s=!0,p=v,globalThis.__DEV__!==!1)){var b=function(_){if(n.lookup(_.__ref)===void 0)return globalThis.__DEV__!==!1&&Je.warn(3,_),!0};if(Dr(v))b(v);else if(Array.isArray(v))for(var O=!1,x=void 0,S=0,w=v;S<w.length;S++){var k=w[S];if(Dr(k)){if(O=!0,b(k))break}else if(typeof k=="object"&&k){var P=n.policies.identify(k)[0];P&&(x=k)}if(O&&x!==void 0){globalThis.__DEV__!==!1&&Je.warn(4,x);break}}}}p!==void 0&&(a=!1)}}),s)return this.merge(e,o),a&&(this instanceof gd?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,o=this.lookup(e);if(o){var s=this.getFieldValue(o,"__typename"),a=r&&n?this.policies.getStoreFieldName({typename:s,fieldName:r,args:n}):r;return this.modify(e,a?(i={},i[a]=iI,i):iI)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(Ui.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof gd&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){Ui.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(o){e&&Ui.call(e,o)||r.delete(o)}),e){var n=e.__META,i=fc(e,["__META"]);Object.keys(i).forEach(function(o){r.merge(o,i[o])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof gd?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(s){Ui.call(n,s)&&(Object.keys(e.findChildRefIds(s)).forEach(r.add,r),delete n[s])});var i=Object.keys(n);if(i.length){for(var o=this;o instanceof gd;)o=o.parent;i.forEach(function(s){return o.delete(s)})}return i},t.prototype.findChildRefIds=function(e){if(!Ui.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(o){Dr(o)&&(r[o.__ref]=!0),oi(o)&&Object.keys(o).forEach(function(s){var a=o[s];oi(a)&&i.add(a)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),NJ=function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?sJ():null,this.keyMaker=new gv(cp)},t.prototype.depend=function(e,r){if(this.d){this.d(oI(e,r));var n=Jd(r);n!==r&&this.d(oI(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(oI(e,r),r==="__exists"?"forget":"setDirty")},t}();function oI(t,e){return e+"#"+t}function D3(t,e){N0(t)&&t.group.depend(e,"__exists")}(function(t){var e=function(r){Tl(n,r);function n(i){var o=i.policies,s=i.resultCaching,a=s===void 0?!0:s,l=i.seed,c=r.call(this,o,new NJ(a))||this;return c.stump=new RRe(c),c.storageTrie=new gv(cp),l&&c.replace(l),c}return n.prototype.addLayer=function(i,o){return this.stump.addLayer(i,o)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(t);t.Root=e})(Cb||(Cb={}));var gd=function(t){Tl(e,t);function e(r,n,i,o){var s=t.call(this,n.policies,o)||this;return s.id=r,s.parent=n,s.replay=i,s.group=o,i(s),s}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(o){var s=n.data[o],a=i.lookup(o);a?s?s!==a&&Object.keys(s).forEach(function(l){bn(s[l],a[l])||n.group.dirty(o,l)}):(n.group.dirty(o,"__exists"),Object.keys(a).forEach(function(l){n.group.dirty(o,l)})):n.delete(o)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return pe(pe({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return Ui.call(this.data,r)?pe(pe({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e}(Cb),RRe=function(t){Tl(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new NJ(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(r,n){return this.parent.merge(r,n)},e}(gd);function IRe(t,e,r){var n=t[r],i=e[r];return bn(n,i)?n:i}function N0(t){return!!(t instanceof Cb&&t.group.caching)}function jRe(t){return oi(t)?si(t)?t.slice(0):pe({__proto__:Object.getPrototypeOf(t)},t):t}var L3=function(){function t(){this.known=new(WM?WeakSet:Set),this.pool=new gv(cp),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return oi(e)&&this.known.has(e)},t.prototype.pass=function(e){if(oi(e)){var r=jRe(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(oi(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var o=e.map(this.admit,this),s=this.pool.lookupArray(o);return s.array||(this.known.add(s.array=o),globalThis.__DEV__!==!1&&Object.freeze(o)),s.array}case null:case Object.prototype:{if(this.known.has(e))return e;var a=Object.getPrototypeOf(e),l=[a],c=this.sortedKeys(e);l.push(c.json);var u=l.length;c.sorted.forEach(function(v){l.push(r.admit(e[v]))});var s=this.pool.lookupArray(l);if(!s.object){var p=s.object=Object.create(a);this.known.add(p),c.sorted.forEach(function(v,b){p[v]=l[u+b]}),globalThis.__DEV__!==!1&&Object.freeze(p)}return s.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t}();function V3(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var $Re=function(){function t(e){var r=this;this.knownResults=new(cp?WeakMap:Map),this.config=xm(e,{addTypename:e.addTypename!==!1,canonizeResults:jJ(e)}),this.canon=e.canon||new L3,this.executeSelectionSet=Sb(function(n){var i,o=n.context.canonizeResults,s=V3(n);s[3]=!o;var a=(i=r.executeSelectionSet).peek.apply(i,s);return a?o?pe(pe({},a),{result:r.canon.admit(a.result)}):a:(D3(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||wu["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:V3,makeCacheKey:function(n,i,o,s){if(N0(o.store))return o.store.makeCacheKey(n,Dr(i)?i.__ref:i,o.varString,s)}}),this.executeSubSelectedArray=Sb(function(n){return D3(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||wu["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,o=n.array,s=n.context;if(N0(s.store))return s.store.makeCacheKey(i,o,s.varString)}})}return t.prototype.resetCanon=function(){this.canon=new L3},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,o=i===void 0?"ROOT_QUERY":i,s=e.variables,a=e.returnPartialData,l=a===void 0?!0:a,c=e.canonizeResults,u=c===void 0?this.config.canonizeResults:c,p=this.config.cache.policies;s=pe(pe({},HM(GK(n))),s);var m=Ug(o),v=this.executeSelectionSet({selectionSet:YO(n).selectionSet,objectOrReference:m,enclosingRef:m,context:pe({store:r,query:n,policies:p,variables:s,varString:Qd(s),canonizeResults:u},AJ(n,this.config.fragments))}),b;if(v.missing&&(b=[new EJ(ARe(v.missing),v.missing,n,s)],!l))throw b[0];return{result:v.result,complete:!b,missing:b}},t.prototype.isFresh=function(e,r,n,i){if(N0(i.store)&&this.knownResults.get(e)===n){var o=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(o&&e===o.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,o=e.enclosingRef,s=e.context;if(Dr(i)&&!s.policies.rootTypenamesById[i.__ref]&&!s.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var a=s.variables,l=s.policies,c=s.store,u=c.getFieldValue(i,"__typename"),p=[],m,v=new Kd;this.config.addTypename&&typeof u=="string"&&!l.rootIdsByTypename[u]&&p.push({__typename:u});function b(k,P){var _;return k.missing&&(m=v.merge(m,(_={},_[P]=k.missing,_))),k.result}var O=new Set(n.selections);O.forEach(function(k){var P,_;if(ZO(k,a))if(Zd(k)){var T=l.readField({fieldName:k.name.value,field:k,variables:s.variables,from:i},s),R=Su(k);T===void 0?KM.added(k)||(m=v.merge(m,(P={},P[R]="Can't find field '".concat(k.name.value,"' on ").concat(Dr(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),P))):si(T)?T.length>0&&(T=b(r.executeSubSelectedArray({field:k,array:T,enclosingRef:o,context:s}),R)):k.selectionSet?T!=null&&(T=b(r.executeSelectionSet({selectionSet:k.selectionSet,objectOrReference:T,enclosingRef:Dr(T)?T:o,context:s}),R)):s.canonizeResults&&(T=r.canon.pass(T)),T!==void 0&&p.push((_={},_[R]=T,_))}else{var $=u_(k,s.lookupFragment);if(!$&&k.kind===et.FRAGMENT_SPREAD)throw Bo(10,k.name.value);$&&l.fragmentMatches($,u)&&$.selectionSet.selections.forEach(O.add,O)}});var x=p_(p),S={result:x,missing:m},w=s.canonizeResults?this.canon.admit(S):tk(S);return w.result&&this.knownResults.set(w.result,n),w},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,o=e.enclosingRef,s=e.context,a,l=new Kd;function c(u,p){var m;return u.missing&&(a=l.merge(a,(m={},m[p]=u.missing,m))),u.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map(function(u,p){return u===null?null:si(u)?c(r.executeSubSelectedArray({field:n,array:u,enclosingRef:o,context:s}),p):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:u,enclosingRef:Dr(u)?u:o,context:s}),p):(globalThis.__DEV__!==!1&&NRe(s.store,n,u),u)}),{result:s.canonizeResults?this.canon.admit(i):i,missing:a}},t}();function ARe(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function NRe(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){oi(i)&&(Je(!Dr(i),11,TRe(t,i),e.name.value),Object.values(i).forEach(n.add,n))})}}var iD=new bv,F3=new WeakMap;function M0(t){var e=F3.get(t);return e||F3.set(t,e={vars:new Set,dep:sJ()}),e}function Q3(t){M0(t).vars.forEach(function(e){return e.forgetCache(t)})}function MRe(t){M0(t).vars.forEach(function(e){return e.attachCache(t)})}function DRe(t){var e=new Set,r=new Set,n=function(o){if(arguments.length>0){if(t!==o){t=o,e.forEach(function(l){M0(l).dep.dirty(n),LRe(l)});var s=Array.from(r);r.clear(),s.forEach(function(l){return l(t)})}}else{var a=iD.getValue();a&&(i(a),M0(a).dep(n))}return t};n.onNextChange=function(o){return r.add(o),function(){r.delete(o)}};var i=n.attachCache=function(o){return e.add(o),M0(o).vars.add(n),n};return n.forgetCache=function(o){return e.delete(o)},n}function LRe(t){t.broadcastWatches&&t.broadcastWatches()}var B3=Object.create(null);function oD(t){var e=JSON.stringify(t);return B3[e]||(B3[e]=Object.create(null))}function z3(t){var e=oD(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(s,a){return n.readField(a,s)},o=n.keyObject=sD(t,function(s){var a=Gg(n.storeObject,s,i);return a===void 0&&r!==n.storeObject&&Ui.call(r,s[0])&&(a=Gg(r,s,DJ)),Je(a!==void 0,5,s.join("."),r),a});return"".concat(n.typename,":").concat(JSON.stringify(o))})}function q3(t){var e=oD(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,o=n.variables,s=n.fieldName,a=sD(t,function(c){var u=c[0],p=u.charAt(0);if(p==="@"){if(i&&yc(i.directives)){var m=u.slice(1),v=i.directives.find(function(S){return S.name.value===m}),b=v&&d_(v,o);return b&&Gg(b,c.slice(1))}return}if(p==="$"){var O=u.slice(1);if(o&&Ui.call(o,O)){var x=c.slice(0);return x[0]=O,Gg(o,x)}return}if(r)return Gg(r,c)}),l=JSON.stringify(a);return(r||l!=="{}")&&(s+=":"+l),s})}function sD(t,e){var r=new Kd;return MJ(t).reduce(function(n,i){var o,s=e(i);if(s!==void 0){for(var a=i.length-1;a>=0;--a)s=(o={},o[i[a]]=s,o);n=r.merge(n,s)}return n},Object.create(null))}function MJ(t){var e=oD(t);if(!e.paths){var r=e.paths=[],n=[];t.forEach(function(i,o){si(i)?(MJ(i).forEach(function(s){return r.push(n.concat(s))}),n.length=0):(n.push(i),si(t[o+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function DJ(t,e){return t[e]}function Gg(t,e,r){return r=r||DJ,LJ(e.reduce(function n(i,o){return si(i)?i.map(function(s){return n(s,o)}):i&&r(i,o)},t))}function LJ(t){return oi(t)?si(t)?t.map(LJ):sD(Object.keys(t).sort(),function(e){return Gg(t,e)}):t}function i$(t){return t.args!==void 0?t.args:t.field?d_(t.field,t.variables):null}var VRe=function(){},W3=function(t,e){return e.fieldName},U3=function(t,e,r){var n=r.mergeObjects;return n(t,e)},H3=function(t,e){return e},FRe=function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=pe({dataIdFromObject:RJ},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,o=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(o===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];var s=r&&r.storeObject||e,a=pe(pe({},r),{typename:o,storeObject:s,readField:r&&r.readField||function(){var p=aD(arguments,s);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),l,c=o&&this.getTypePolicy(o),u=c&&c.keyFn||this.config.dataIdFromObject;return nD.withValue(!0,function(){for(;u;){var p=u(pe(pe({},e),s),a);if(si(p))u=z3(p);else{l=p;break}}}),l=l?String(l):void 0,a.keyObject?[l,a.keyObject]:[l]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],o=i.queryType,s=i.mutationType,a=i.subscriptionType,l=fc(i,["queryType","mutationType","subscriptionType"]);o&&r.setRootTypename("Query",n),s&&r.setRootTypename("Mutation",n),a&&r.setRootTypename("Subscription",n),Ui.call(r.toBeAdded,n)?r.toBeAdded[n].push(l):r.toBeAdded[n]=[l]})},t.prototype.updateTypePolicy=function(e,r,n){var i=this.getTypePolicy(e),o=r.keyFields,s=r.fields;function a(l,c){l.merge=typeof c=="function"?c:c===!0?U3:c===!1?H3:l.merge}a(i,r.merge),i.keyFn=o===!1?VRe:si(o)?z3(o):typeof o=="function"?o:i.keyFn,s&&Object.keys(s).forEach(function(l){var c=n[l];(!c||c?.typename!==e)&&(c=n[l]={typename:e});var u=s[l];if(typeof u=="function")c.read=u;else{var p=u.keyArgs,m=u.read,v=u.merge;c.keyFn=p===!1?W3:si(p)?q3(p):typeof p=="function"?p:c.keyFn,typeof m=="function"&&(c.read=m),a(c,v)}c.read&&c.merge&&(c.keyFn=c.keyFn||W3)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(Je(!i||i===e,6,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var o=i.match($J);(!o||o[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!Ui.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(s,a){if(s.test(e)){var l=r.supertypeMap.get(a);l&&l.forEach(function(c){return i.add(c)})}})),i&&i.size&&i.forEach(function(s){var a=r.getTypePolicy(s),l=a.fields,c=fc(a,["fields"]);Object.assign(n,c),Object.assign(n.fields,l)})}var o=this.toBeAdded[e];return o&&o.length&&o.splice(0).forEach(function(s){r.updateTypePolicy(e,s,r.typePolicies[e].fields)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r){if(e)return this.getTypePolicy(e).fields[r]},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var o=this;if(!e.typeCondition)return!0;if(!r)return!1;var s=e.typeCondition.name.value;if(r===s)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(s))for(var a=this.getSupertypeSet(r,!0),l=[a],c=function(b){var O=o.getSupertypeSet(b,!1);O&&O.size&&l.indexOf(O)<0&&l.push(O)},u=!!(n&&this.fuzzySubtypes.size),p=!1,m=0;m<l.length;++m){var v=l[m];if(v.has(s))return a.has(s)||(p&&globalThis.__DEV__!==!1&&Je.warn(7,r,s),a.add(s)),!0;v.forEach(c),u&&m===l.length-1&&n$(e.selectionSet,n,i)&&(u=!1,p=!0,this.fuzzySubtypes.forEach(function(b,O){var x=r.match(b);x&&x[0]===r&&c(O)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n),o,s=i&&i.keyFn;if(s&&r)for(var a={typename:r,fieldName:n,field:e.field||null,variables:e.variables},l=i$(e);s;){var c=s(l,a);if(si(c))s=q3(c);else{o=c||n;break}}return o===void 0&&(o=e.field?JTe(e.field,e.variables):HK(n,i$(e))),o===!1?n:n===Jd(o)?o:n+":"+o},t.prototype.readField=function(e,r){var n=e.from;if(n){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var o=r.store.getFieldValue(n,"__typename");o&&(e.typename=o)}var s=this.getStoreFieldName(e),a=Jd(s),l=r.store.getFieldValue(n,s),c=this.getFieldPolicy(e.typename,a),u=c&&c.read;if(u){var p=G3(this,n,e,r,r.store.getStorage(Dr(n)?n.__ref:n,s));return iD.withValue(this.cache,u,[l,p])}return l}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r),o=i&&i.merge;return!o&&n&&(i=this.getTypePolicy(n),o=i&&i.merge),o},t.prototype.runMergeFunction=function(e,r,n,i,o){var s=n.field,a=n.typename,l=n.merge;return l===U3?VJ(i.store)(e,r):l===H3?r:(i.overwrite&&(e=void 0),l(e,r,G3(this,void 0,{typename:a,fieldName:s.name.value,field:s,variables:i.variables},i,o||Object.create(null))))},t}();function G3(t,e,r,n,i){var o=t.getStoreFieldName(r),s=Jd(o),a=r.variables||n.variables,l=n.store,c=l.toReference,u=l.canRead;return{args:i$(r),field:r.field||null,fieldName:s,storeFieldName:o,variables:a,isReference:Dr,toReference:c,storage:i,cache:t.cache,canRead:u,readField:function(){return t.readField(aD(arguments,e,a),n)},mergeObjects:VJ(n.store)}}function aD(t,e,r){var n=t[0],i=t[1],o=t.length,s;return typeof n=="string"?s={fieldName:n,from:o>1?i:e}:(s=pe({},n),Ui.call(s,"from")||(s.from=e)),globalThis.__DEV__!==!1&&s.from===void 0&&globalThis.__DEV__!==!1&&Je.warn(8,_K(Array.from(t))),s.variables===void 0&&(s.variables=r),s}function VJ(t){return function(r,n){if(si(r)||si(n))throw Bo(9);if(oi(r)&&oi(n)){var i=t.getFieldValue(r,"__typename"),o=t.getFieldValue(n,"__typename"),s=i&&o&&i!==o;if(s)return n;if(Dr(r)&&Rg(n))return t.merge(r.__ref,n),r;if(Rg(r)&&Dr(n))return t.merge(r,n.__ref),n;if(Rg(r)&&Rg(n))return pe(pe({},r),n)}return n}}function sI(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:pe(pe({},t),{clientOnly:e,deferred:r})),i}var QRe=function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,o=r.result,s=r.dataId,a=r.variables,l=r.overwrite,c=zf(i),u=ERe();a=pe(pe({},HM(c)),a);var p=pe(pe({store:e,written:Object.create(null),merge:function(v,b){return u.merge(v,b)},variables:a,varString:Qd(a)},AJ(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),m=this.processSelectionSet({result:o||Object.create(null),dataId:s,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:p});if(!Dr(m))throw Bo(12,o);return p.incomingById.forEach(function(v,b){var O=v.storeObject,x=v.mergeTree,S=v.fieldNodeSet,w=Ug(b);if(x&&x.map.size){var k=n.applyMerges(x,w,O,p);if(Dr(k))return;O=k}if(globalThis.__DEV__!==!1&&!p.overwrite){var P=Object.create(null);S.forEach(function(R){R.selectionSet&&(P[R.name.value]=!0)});var _=function(R){return P[Jd(R)]===!0},T=function(R){var $=x&&x.map.get(R);return!!($&&$.info&&$.info.merge)};Object.keys(O).forEach(function(R){_(R)&&!T(R)&&BRe(w,O,R,p.store)})}e.merge(b,O)}),e.retain(m.__ref),m},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,o=e.selectionSet,s=e.context,a=e.mergeTree,l=this.cache.policies,c=Object.create(null),u=n&&l.rootTypenamesById[n]||H2(i,o,s.fragmentMap)||n&&s.store.get(n,"__typename");typeof u=="string"&&(c.__typename=u);var p=function(){var k=aD(arguments,c,s.variables);if(Dr(k.from)){var P=s.incomingById.get(k.from.__ref);if(P){var _=l.readField(pe(pe({},k),{from:P.storeObject}),s);if(_!==void 0)return _}}return l.readField(k,s)},m=new Set;this.flattenFields(o,i,s,u).forEach(function(k,P){var _,T=Su(P),R=i[T];if(m.add(P),R!==void 0){var $=l.getStoreFieldName({typename:u,fieldName:P.name.value,field:P,variables:k.variables}),A=X3(a,$),M=r.processFieldValue(R,P,P.selectionSet?sI(k,!1,!1):k,A),Q=void 0;P.selectionSet&&(Dr(M)||Rg(M))&&(Q=p("__typename",M));var V=l.getMergeFunction(u,P.name.value,Q);V?A.info={field:P,typename:u,merge:V}:Z3(a,$),c=k.merge(c,(_={},_[$]=M,_))}else globalThis.__DEV__!==!1&&!k.clientOnly&&!k.deferred&&!KM.added(P)&&!l.getReadFunction(u,P.name.value)&&globalThis.__DEV__!==!1&&Je.error(13,Su(P),i)});try{var v=l.identify(i,{typename:u,selectionSet:o,fragmentMap:s.fragmentMap,storeObject:c,readField:p}),b=v[0],O=v[1];n=n||b,O&&(c=s.merge(c,O))}catch(k){if(!n)throw k}if(typeof n=="string"){var x=Ug(n),S=s.written[n]||(s.written[n]=[]);if(S.indexOf(o)>=0||(S.push(o),this.reader&&this.reader.isFresh(i,x,o,s)))return x;var w=s.incomingById.get(n);return w?(w.storeObject=s.merge(w.storeObject,c),w.mergeTree=o$(w.mergeTree,a),m.forEach(function(k){return w.fieldNodeSet.add(k)})):s.incomingById.set(n,{storeObject:c,mergeTree:rk(a)?void 0:a,fieldNodeSet:m}),x}return c},t.prototype.processFieldValue=function(e,r,n,i){var o=this;return!r.selectionSet||e===null?globalThis.__DEV__!==!1?pJ(e):e:si(e)?e.map(function(s,a){var l=o.processFieldValue(s,r,n,X3(i,a));return Z3(i,a),l}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=H2(r,e,n.fragmentMap));var o=new Map,s=this.cache.policies,a=new gv(!1);return function l(c,u){var p=a.lookup(c,u.clientOnly,u.deferred);p.visited||(p.visited=!0,c.selections.forEach(function(m){if(ZO(m,n.variables)){var v=u.clientOnly,b=u.deferred;if(!(v&&b)&&yc(m.directives)&&m.directives.forEach(function(S){var w=S.name.value;if(w==="client"&&(v=!0),w==="defer"){var k=d_(S,n.variables);(!k||k.if!==!1)&&(b=!0)}}),Zd(m)){var O=o.get(m);O&&(v=v&&O.clientOnly,b=b&&O.deferred),o.set(m,sI(n,v,b))}else{var x=u_(m,n.lookupFragment);if(!x&&m.kind===et.FRAGMENT_SPREAD)throw Bo(14,m.name.value);x&&s.fragmentMatches(x,i,r,n.variables)&&l(x.selectionSet,sI(n,v,b))}}}))}(e,n),o},t.prototype.applyMerges=function(e,r,n,i,o){var s,a=this;if(e.map.size&&!Dr(n)){var l=!si(n)&&(Dr(r)||Rg(r))?r:void 0,c=n;l&&!o&&(o=[Dr(l)?l.__ref:l]);var u,p=function(m,v){return si(m)?typeof v=="number"?m[v]:void 0:i.store.getFieldValue(m,String(v))};e.map.forEach(function(m,v){var b=p(l,v),O=p(c,v);if(O!==void 0){o&&o.push(v);var x=a.applyMerges(m,b,O,i,o);x!==O&&(u=u||new Map,u.set(v,x)),o&&Je(o.pop()===v)}}),u&&(n=si(c)?c.slice(0):pe({},c),u.forEach(function(m,v){n[v]=m}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,o&&(s=i.store).getStorage.apply(s,o)):n},t}(),FJ=[];function X3(t,e){var r=t.map;return r.has(e)||r.set(e,FJ.pop()||{map:new Map}),r.get(e)}function o$(t,e){if(t===e||!e||rk(e))return t;if(!t||rk(t))return e;var r=t.info&&e.info?pe(pe({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,o={info:r,map:i};if(n){var s=new Set(e.map.keys());t.map.forEach(function(a,l){o.map.set(l,o$(a,e.map.get(l))),s.delete(l)}),s.forEach(function(a){o.map.set(a,o$(e.map.get(a),t.map.get(a)))})}return o}function rk(t){return!t||!(t.info||t.map.size)}function Z3(t,e){var r=t.map,n=r.get(e);n&&rk(n)&&(FJ.push(n),r.delete(e))}var Y3=new Set;function BRe(t,e,r,n){var i=function(p){var m=n.getFieldValue(p,r);return typeof m=="object"&&m},o=i(t);if(o){var s=i(e);if(s&&!Dr(o)&&!bn(o,s)&&!Object.keys(o).every(function(p){return n.getFieldValue(s,p)!==void 0})){var a=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),l=Jd(r),c="".concat(a,".").concat(l);if(!Y3.has(c)){Y3.add(c);var u=[];!si(o)&&!si(s)&&[o,s].forEach(function(p){var m=n.getFieldValue(p,"__typename");typeof m=="string"&&!u.includes(m)&&u.push(m)}),globalThis.__DEV__!==!1&&Je.warn(15,l,a,u.length?"either ensure all objects of type "+u.join(" and ")+" have an ID or a custom merge function, or ":"",c,pe({},o),pe({},s))}}}}var QJ=function(t){Tl(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new aJ(KM),n.assumeImmutableResults=!0,n.makeVar=DRe,n.txCount=0,globalThis.__DEV__!==!1&&(li(r,"addTypename","InMemoryCache","Please remove the `addTypename` option when initializing `InMemoryCache`."),li(r,"canonizeResults","InMemoryCache","Please remove the `canonizeResults` option when initializing `InMemoryCache`.")),n.config=_Re(r),n.addTypename=!!n.config.addTypename,n.policies=new FRe({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new Cb.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,o=this.config.fragments;this.addTypenameTransform.resetCache(),o?.resetCaches(),this.storeWriter=new QRe(this,this.storeReader=new $Re({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:jJ(this.config),canon:r?void 0:i&&i.canon,fragments:o}),o),this.maybeBroadcastWatch=Sb(function(s,a){return n.broadcastWatch(s,a)},{max:this.config.resultCacheMaxSize||wu["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(s){var a=s.optimistic?n.optimisticData:n.data;if(N0(a)){var l=s.optimistic,c=s.id,u=s.variables;return a.makeCacheKey(s.query,s.callback,Qd({optimistic:l,id:c,variables:u}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(s){return s.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){globalThis.__DEV__!==!1&&li(r,"canonizeResults","cache.read");var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(pe(pe({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(o){if(o instanceof EJ)return null;throw o}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(Ui.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return globalThis.__DEV__!==!1&&li(r,"canonizeResults","cache.diff"),this.storeReader.diffQueryAgainstStore(pe(pe({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||MRe(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&Q3(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){globalThis.__DEV__!==!1&&li(r||{},"resetResultIdentities","cache.gc","First ensure all usages of `canonizeResults` are removed, then remove this option."),Qd.reset(),vf.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(Dr(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&Je.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(Ui.call(r,"id"))return!1;r=pe(pe({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),Qd.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Q3(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,o=r.optimistic,s=o===void 0?!0:o,a=r.removeOptimistic,l=r.onWatchUpdated,c,u=function(m){var v=n,b=v.data,O=v.optimisticData;++n.txCount,m&&(n.data=n.optimisticData=m);try{return c=i(n)}finally{--n.txCount,n.data=b,n.optimisticData=O}},p=new Set;return l&&!this.txCount&&this.broadcastWatches(pe(pe({},r),{onWatchUpdated:function(m){return p.add(m),!1}})),typeof s=="string"?this.optimisticData=this.optimisticData.addLayer(s,u):s===!1?u(this.data):u(),typeof a=="string"&&(this.optimisticData=this.optimisticData.removeLayer(a)),l&&p.size?(this.broadcastWatches(pe(pe({},r),{onWatchUpdated:function(m,v){var b=l.call(this,m,v);return b!==!1&&p.delete(m),b}})),p.size&&p.forEach(function(m){return n.maybeBroadcastWatch.dirty(m)})):this.broadcastWatches(r),c},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},e.prototype.fragmentMatches=function(r,n){return this.policies.fragmentMatches(r,n)},e.prototype.lookupFragment=function(r){var n;return((n=this.config.fragments)===null||n===void 0?void 0:n.lookup(r))||null},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},e.prototype.broadcastWatch=function(r,n){var i=this,o=r.lastDiff,s=_o("canonizeResults",function(){return i.diff(r)});n&&(r.optimistic&&typeof n.optimistic=="string"&&(s.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,s,o)===!1)||(!o||!bn(o.result,s.result))&&r.callback(r.lastDiff=s,o)},e}(TJ);globalThis.__DEV__!==!1&&(QJ.prototype.getMemoryInternals=NTe);var Mr;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(Mr||(Mr={}));function Ig(t){return t?t<7:!1}var K3=Object.assign,zRe=Object.hasOwnProperty,iC=function(t){Tl(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,o=r.options,s=this,a=e.inactiveOnCreation.getValue();s=t.call(this,function(S){s._getOrCreateQuery();try{var w=S._subscription._observer;w&&!w.error&&(w.error=qRe)}catch{}var k=!s.observers.size;s.observers.add(S);var P=s.last;return P&&P.error?S.error&&S.error(P.error):P&&P.result&&S.next&&S.next(s.maskResult(P.result)),k&&s.reobserve().catch(function(){}),function(){s.observers.delete(S)&&!s.observers.size&&s.tearDownQuery()}})||this,s.observers=new Set,s.subscriptions=new Set,s.dirty=!1,s._getOrCreateQuery=function(){return a&&(n.queries.set(s.queryId,i),a=!1),s.queryManager.getOrCreateQuery(s.queryId)},s.queryInfo=i,s.queryManager=n,s.waitForOwnResult=aI(o.fetchPolicy),s.isTornDown=!1,s.subscribeToMore=s.subscribeToMore.bind(s),s.maskResult=s.maskResult.bind(s);var l=n.defaultOptions.watchQuery,c=l===void 0?{}:l,u=c.fetchPolicy,p=u===void 0?"cache-first":u,m=o.fetchPolicy,v=m===void 0?p:m,b=o.initialFetchPolicy,O=b===void 0?v==="standby"?p:v:b;s.options=pe(pe({},o),{initialFetchPolicy:O,fetchPolicy:v}),s.queryId=i.queryId||n.generateQueryId();var x=zf(s.query);return s.queryName=x&&x.name&&x.name.value,s}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return globalThis.__DEV__!==!1&&lf("observableQuery.result",function(){globalThis.__DEV__!==!1&&Je.warn(23)}),new Promise(function(n,i){var o={next:function(a){n(a),r.observers.delete(o),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){s.unsubscribe()},0)},error:i},s=r.subscribe(o)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentFullResult=function(r){var n=this;r===void 0&&(r=!0);var i=_o("getLastResult",function(){return n.getLastResult(!0)}),o=this.queryInfo.networkStatus||i&&i.networkStatus||Mr.ready,s=pe(pe({},i),{loading:Ig(o),networkStatus:o}),a=this.options.fetchPolicy,l=a===void 0?"cache-first":a;if(!(aI(l)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var c=this.queryInfo.getDiff();(c.complete||this.options.returnPartialData)&&(s.data=c.result),bn(s.data,{})&&(s.data=void 0),c.complete?(delete s.partial,c.complete&&s.networkStatus===Mr.loading&&(l==="cache-first"||l==="cache-only")&&(s.networkStatus=Mr.ready,s.loading=!1)):s.partial=!0,s.networkStatus===Mr.ready&&(s.error||s.errors)&&(s.networkStatus=Mr.error),globalThis.__DEV__!==!1&&!c.complete&&!this.options.partialRefetch&&!s.loading&&!s.data&&!s.error&&BJ(c.missing)}return r&&this.updateLastResult(s),s},e.prototype.getCurrentResult=function(r){return r===void 0&&(r=!0),this.maskResult(this.getCurrentFullResult(r))},e.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),o=this.queryManager.dataMasking,s=o?i.nonReactiveQuery:this.query,a=o||i.hasNonreactiveDirective?!wJ(s,this.last.result,r,this.variables):!bn(this.last.result,r);return a||n&&!bn(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||bn(i.variables,this.variables)))return i[r]},e.prototype.getLastResult=function(r){return globalThis.__DEV__!==!1&&lf("getLastResult",function(){globalThis.__DEV__!==!1&&Je.warn(24)}),this.getLast("result",r)},e.prototype.getLastError=function(r){return globalThis.__DEV__!==!1&&lf("getLastError",function(){globalThis.__DEV__!==!1&&Je.warn(25)}),this.getLast("error",r)},e.prototype.resetLastResults=function(){globalThis.__DEV__!==!1&&lf("resetLastResults",function(){globalThis.__DEV__!==!1&&Je.warn(26)}),delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&Je.warn(27),this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var n,i={pollInterval:0},o=this.options.fetchPolicy;if(o==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&zRe.call(r,"variables")){var s=GK(this.query),a=s.variableDefinitions;(!a||!a.some(function(l){return l.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&Je.warn(28,r,((n=s.name)===null||n===void 0?void 0:n.value)||s)}return r&&!bn(this.options.variables,r)&&(i.variables=this.options.variables=pe(pe({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,Mr.refetch)},e.prototype.fetchMore=function(r){var n=this,i=pe(pe({},r.query?r:pe(pe(pe(pe({},this.options),{query:this.options.query}),r),{variables:pe(pe({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var o=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var s=this.queryInfo,a=s.networkStatus;s.networkStatus=Mr.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,c=r?.updateQuery,u=this.options.fetchPolicy!=="no-cache";return u||Je(c,29),this.queryManager.fetchQuery(o,i,Mr.fetchMore).then(function(p){if(n.queryManager.removeQuery(o),s.networkStatus===Mr.fetchMore&&(s.networkStatus=a),u)n.queryManager.cache.batch({update:function(b){var O=r.updateQuery;O?b.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(x){return O(x,{fetchMoreResult:p.data,variables:i.variables})}):b.writeQuery({query:i.query,variables:i.variables,data:p.data})},onWatchUpdated:function(b){l.add(b.query)}});else{var m=n.getLast("result"),v=c(m.data,{fetchMoreResult:p.data,variables:i.variables});n.reportResult(pe(pe({},m),{networkStatus:a,loading:Ig(a),data:v}),n.variables)}return n.maskResult(p)}).finally(function(){u&&!l.has(n.query)&&n.reobserveCacheFirst()})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(o){var s=r.updateQuery;s&&n.updateQuery(function(a,l){return s(a,pe({subscriptionData:o},l))})},error:function(o){if(r.onError){r.onError(o);return}globalThis.__DEV__!==!1&&Je.error(30,o)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return globalThis.__DEV__!==!1&&(li(r,"canonizeResults","setOptions"),lf("setOptions",function(){globalThis.__DEV__!==!1&&Je.warn(31)})),this.reobserve(r)},e.prototype.silentSetOptions=function(r){var n=xm(this.options,r||{});K3(this.options,n)},e.prototype.setVariables=function(r){var n=this;return bn(this.variables,r)?this.observers.size?_o("observableQuery.result",function(){return n.result()}):Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},Mr.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),o=i.result,s=i.complete,a=r(o,{variables:this.variables,complete:!!s,previousData:o});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,o=i===void 0?"cache-first":i,s=n.initialFetchPolicy,a=s===void 0?o:s;o==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(o,{reason:r,options:n,observable:this,initialFetchPolicy:a}):r==="variables-changed"?n.fetchPolicy=a:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n,i){var o=this._getOrCreateQuery();return o.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(o,r,n,i)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,o=n.options.pollInterval;if(!o||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===o)){Je(o,32);var s=i||(this.pollingInfo={});s.interval=o;var a=function(){var c,u;r.pollingInfo&&(!Ig(r.queryInfo.networkStatus)&&!(!((u=(c=r.options).skipPollAttempt)===null||u===void 0)&&u.call(c))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Mr.poll).then(l,l):l())},l=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(a,c.interval))};l()}}},e.prototype.updateLastResult=function(r,n){var i=this;n===void 0&&(n=this.variables);var o=_o("getLastError",function(){return i.getLastError()});return o&&this.last&&!bn(n,this.last.variables)&&(o=void 0),this.last=pe({result:this.queryManager.assumeImmutableResults?r:pJ(r),variables:n},o?{error:o}:null)},e.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var o=n===Mr.refetch||n===Mr.fetchMore||n===Mr.poll,s=this.options.variables,a=this.options.fetchPolicy,l=xm(this.options,r||{}),c=o?l:K3(this.options,l),u=this.transformDocument(c.query);this.lastQuery=u,o||(this.updatePolling(),r&&r.variables&&!bn(r.variables,s)&&c.fetchPolicy!=="standby"&&(c.fetchPolicy===a||typeof c.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=Mr.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=aI(c.fetchPolicy));var p=function(){i.concast===b&&(i.waitForOwnResult=!1)},m=c.variables&&pe({},c.variables),v=this.fetch(c,n,u),b=v.concast,O=v.fromLink,x={next:function(S){bn(i.variables,m)&&(p(),i.reportResult(S,m))},error:function(S){bn(i.variables,m)&&(bJ(S)||(S=new rf({networkError:S})),p(),i.reportError(S,m))}};return!o&&(O||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=b,this.observer=x),b.addObserver(x),b},e.prototype.reobserve=function(r,n){return jEe(this.reobserveAsConcast(r,n).promise.then(this.maskResult))},e.prototype.resubscribeAfterError=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=this.last;_o("resetLastResults",function(){return r.resetLastResults()});var s=this.subscribe.apply(this,n);return this.last=o,s},e.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this,o=_o("getLastError",function(){return i.getLastError()}),s=this.isDifferentFromLastResult(r,n);(o||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(o||s)&&A0(this.observers,"next",this.maskResult(r))},e.prototype.reportError=function(r,n){var i=this,o=pe(pe({},_o("getLastResult",function(){return i.getLastResult()})),{error:r,errors:r.graphQLErrors,networkStatus:Mr.error,loading:!1});this.updateLastResult(o,n),A0(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(r){return this.queryManager.transform(r)},e.prototype.maskResult=function(r){return r&&"data"in r?pe(pe({},r),{data:this.queryManager.maskOperation({document:this.query,data:r.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):r},e.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},e.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},e.prototype.scheduleNotify=function(){var r=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},e.prototype.notify=function(){if(this.cancelNotifyTimeout(),this.dirty&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!Ig(this.queryInfo.networkStatus))){var r=this.queryInfo.getDiff();r.fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()}this.dirty=!1},e.prototype.reobserveCacheFirst=function(){var r=this.options,n=r.fetchPolicy,i=r.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(o,s){return this.nextFetchPolicy=i,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(o,s):n}}):this.reobserve()},e.inactiveOnCreation=new bv,e}(Wr);gJ(iC);function qRe(t){globalThis.__DEV__!==!1&&Je.error(33,t.message,t.stack)}function BJ(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&Je.debug(34,t)}function aI(t){return t==="network-only"||t==="no-cache"||t==="standby"}var jg=new(cp?WeakMap:Map);function lI(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return jg.set(t,(jg.get(t)+1)%1e15),r.apply(this,arguments)})}var cI=function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.document=null,this.lastRequestId=1,this.stopped=!1,this.observableQuery=null;var n=this.cache=e.cache;jg.has(n)||(jg.set(n,0),lI(n,"evict"),lI(n,"modify"),lI(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||Mr.loading;return this.variables&&this.networkStatus!==Mr.loading&&!bn(this.variables,e.variables)&&(r=Mr.setVariables),bn(e.variables,this.variables)||(this.lastDiff=void 0,this.cancel()),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this,r=this.getDiffOptions();if(this.lastDiff&&bn(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=_o("canonizeResults",function(){return e.cache.diff(r)});return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&_o("getLastError",function(){var o;return(o=r.observableQuery)===null||o===void 0?void 0:o.getLastError()})||(this.updateLastDiff(e),bn(i&&i.result,e&&e.result)||(n=this.observableQuery)===null||n===void 0||n.scheduleNotify())},t.prototype.setObservableQuery=function(e){e!==this.observableQuery&&(this.observableQuery=e,e&&(e.queryInfo=this))},t.prototype.stop=function(){var e;if(!this.stopped){this.stopped=!0,(e=this.observableQuery)===null||e===void 0||e.resetNotifications(),this.cancel();var r=this.observableQuery;r&&r.stopPolling()}},t.prototype.cancel=function(){var e;(e=this.cancelWatch)===null||e===void 0||e.call(this),this.cancelWatch=void 0},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=pe(pe({},this.getDiffOptions(e)),{watcher:this,callback:function(o){return r.setDiff(o)}});(!this.lastWatch||!bn(i,this.lastWatch))&&(this.cancel(),this.cancelWatch=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===jg.get(this.cache)&&bn(r,n.variables)&&bn(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var o=this,s,a=new Kd,l=yc(e.errors)?e.errors.slice(0):[];if((s=this.observableQuery)===null||s===void 0||s.resetNotifications(),"incremental"in e&&yc(e.incremental)){var c=mJ(this.getDiff().result,e);e.data=c}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=a.merge(u.result,e.data)}this.graphQLErrors=l,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(s$(e,n.errorPolicy)?this.cache.performTransaction(function(p){if(o.shouldWrite(e,n.variables))p.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),o.lastWrite={result:e,variables:n.variables,dmCount:jg.get(o.cache)};else if(o.lastDiff&&o.lastDiff.diff.complete){e.data=o.lastDiff.diff.result;return}var m=o.getDiffOptions(n.variables),v=_o("canonizeResults",function(){return p.diff(m)});!o.stopped&&bn(o.variables,n.variables)&&o.updateWatch(n.variables),o.updateLastDiff(v,m),v.complete&&(e.data=v.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Mr.ready},t.prototype.markError=function(e){var r;return this.networkStatus=Mr.error,this.lastWrite=void 0,(r=this.observableQuery)===null||r===void 0||r.resetNotifications(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t}();function s$(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!tC(t);return!n&&r&&t.data&&(n=!0),n}var WRe=Object.prototype.hasOwnProperty,J3=Object.create(null),URe=function(){function t(e){var r=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new BK(wu["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new gv(!1),this.noCacheWarningsByQueryId=new Set;var n=new aJ(function(o){return r.cache.transformDocument(o)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking;var i=e.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(Bo(35))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return vd(this,arguments,void 0,function(r){var n,i,o,s,a,l,c,u=r.mutation,p=r.variables,m=r.optimisticResponse,v=r.updateQueries,b=r.refetchQueries,O=b===void 0?[]:b,x=r.awaitRefetchQueries,S=x===void 0?!1:x,w=r.update,k=r.onQueryUpdated,P=r.fetchPolicy,_=P===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":P,T=r.errorPolicy,R=T===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.errorPolicy)||"none":T,$=r.keepRootFields,A=r.context;return yd(this,function(M){switch(M.label){case 0:return Je(u,36),Je(_==="network-only"||_==="no-cache",37),n=this.generateMutationId(),u=this.cache.transformForLink(this.transform(u)),i=this.getDocumentInfo(u).hasClientExports,p=this.getVariables(u,p),i?[4,this.localState.addExportedVariables(u,p,A)]:[3,2];case 1:p=M.sent(),M.label=2;case 2:return o=this.mutationStore&&(this.mutationStore[n]={mutation:u,variables:p,loading:!0,error:null}),s=m&&this.markMutationOptimistic(m,{mutationId:n,document:u,variables:p,fetchPolicy:_,errorPolicy:R,context:A,updateQueries:v,update:w,keepRootFields:$}),this.broadcastQueries(),a=this,[2,new Promise(function(Q,V){return tI(a.getObservableFromLink(u,pe(pe({},A),{optimisticResponse:s?m:void 0}),p,{},!1),function(q){if(tC(q)&&R==="none")throw new rf({graphQLErrors:Y2(q)});o&&(o.loading=!1,o.error=null);var N=pe({},q);return typeof O=="function"&&(O=O(N)),R==="ignore"&&tC(N)&&delete N.errors,a.markMutationResult({mutationId:n,result:N,document:u,variables:p,fetchPolicy:_,errorPolicy:R,context:A,update:w,updateQueries:v,awaitRefetchQueries:S,refetchQueries:O,removeOptimistic:s?n:void 0,onQueryUpdated:k,keepRootFields:$})}).subscribe({next:function(q){a.broadcastQueries(),(!("hasNext"in q)||q.hasNext===!1)&&Q(pe(pe({},q),{data:a.maskOperation({document:u,data:q.data,fetchPolicy:_,id:n})}))},error:function(q){o&&(o.loading=!1,o.error=q),s&&a.cache.removeOptimistic(n),a.broadcastQueries(),V(q instanceof rf?q:new rf({networkError:q}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,o=[],s=e.fetchPolicy==="no-cache";if(!s&&s$(i,e.errorPolicy)){if(Hg(i)||o.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Hg(i)&&yc(i.incremental)){var a=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;a.result&&(l=mJ(a.result,i)),typeof l<"u"&&(i.data=l,o.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var c=e.updateQueries;c&&this.queries.forEach(function(p,m){var v=p.observableQuery,b=v&&v.queryName;if(!(!b||!WRe.call(c,b))){var O=c[b],x=n.queries.get(m),S=x.document,w=x.variables,k=r.diff({query:S,variables:w,returnPartialData:!0,optimistic:!1}),P=k.result,_=k.complete;if(_&&P){var T=O(P,{mutationResult:i,queryName:S&&p0(S)||void 0,queryVariables:w});T&&o.push({result:T,dataId:"ROOT_QUERY",query:S,variables:w})}}})}if(o.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var u=[];if(this.refetchQueries({updateCache:function(p){s||o.forEach(function(O){return p.write(O)});var m=e.update,v=!DEe(i)||Hg(i)&&!i.hasNext;if(m){if(!s){var b=p.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});b.complete&&(i=pe(pe({},i),{data:b.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}v&&m(p,i,{context:e.context,variables:e.variables})}!s&&!e.keepRootFields&&v&&p.modify({id:"ROOT_MUTATION",fields:function(O,x){var S=x.fieldName,w=x.DELETE;return S==="__typename"?O:w}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(p){return u.push(p)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(u).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables,{IGNORE:J3}):e;return i===J3?!1:(this.cache.recordOptimisticTransaction(function(o){try{n.markMutationResult(pe(pe({},r),{result:{data:i}}),o)}catch(s){globalThis.__DEV__!==!1&&Je.error(s)}},r.mutationId),!0)},t.prototype.fetchQuery=function(e,r,n){return this.fetchConcastWithInfo(this.getOrCreateQuery(e),r,n).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var r=this.transformCache;if(!r.has(e)){var n={hasClientExports:gTe(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:xb(["nonreactive"],e),nonReactiveQuery:xEe(e),clientQuery:this.localState.clientQuery(e),serverQuery:cJ([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),defaultVars:HM(zf(e)),asQuery:pe(pe({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?pe(pe({},i),{operation:"query"}):i})})};r.set(e,n)}return r.get(e)},t.prototype.getVariables=function(e,r){return pe(pe({},this.getDocumentInfo(e).defaultVars),r)},t.prototype.watchQuery=function(e){var r=this.transform(e.query);e=pe(pe({},e),{variables:this.getVariables(r,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var n=new cI(this),i=new iC({queryManager:this,queryInfo:n,options:e});return i.lastQuery=r,iC.inactiveOnCreation.getValue()||this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,r){var n=this;r===void 0&&(r=this.generateQueryId()),Je(e.query,38),Je(e.query.kind==="Document",39),Je(!e.returnPartialData,40),Je(!e.pollInterval,41);var i=this.transform(e.query);return this.fetchQuery(r,pe(pe({},e),{query:i})).then(function(o){return o&&pe(pe({},o),{data:n.maskOperation({document:i,data:o.data,fetchPolicy:e.fetchPolicy,id:r})})}).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(Bo(42)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=Mr.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,o=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(a){if(typeof a=="string")i.set(a,a),o.set(a,!1);else if(zTe(a)){var l=vf(r.transform(a));i.set(l,p0(a)),o.set(l,!1)}else oi(a)&&a.query&&s.add(a)}),this.queries.forEach(function(a,l){var c=a.observableQuery,u=a.document;if(c){if(e==="all"){n.set(l,c);return}var p=c.queryName,m=c.options.fetchPolicy;if(m==="standby"||e==="active"&&!c.hasObservers())return;(e==="active"||p&&o.has(p)||u&&o.has(vf(u)))&&(n.set(l,c),p&&o.set(p,!0),u&&o.set(vf(u),!0))}}),s.size&&s.forEach(function(a){var l=V2("legacyOneTimeQuery"),c=r.getOrCreateQuery(l).init({document:a.query,variables:a.variables}),u=new iC({queryManager:r,queryInfo:c,options:pe(pe({},a),{fetchPolicy:"network-only"})});Je(u.queryId===l),c.setObservableQuery(u),n.set(l,u)}),globalThis.__DEV__!==!1&&o.size&&o.forEach(function(a,l){if(!a){var c=i.get(l);c?globalThis.__DEV__!==!1&&Je.warn(43,c):globalThis.__DEV__!==!1&&Je.warn(44)}}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,o){var s=i.options.fetchPolicy;_o("resetLastResults",function(){return i.resetLastResults()}),(e||s!=="standby"&&s!=="cache-only")&&n.push(i.refetch()),(r.queries.get(o)||i.queryInfo).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.variables,o=e.fetchPolicy,s=e.errorPolicy,a=s===void 0?"none":s,l=e.context,c=l===void 0?{}:l,u=e.extensions,p=u===void 0?{}:u;n=this.transform(n),i=this.getVariables(n,i);var m=function(b){return r.getObservableFromLink(n,c,b,p).map(function(O){o!=="no-cache"&&(s$(O,a)&&r.cache.write({query:n,result:O.data,dataId:"ROOT_SUBSCRIPTION",variables:b}),r.broadcastQueries());var x=tC(O),S=yJ(O);if(x||S){var w={};if(x&&(w.graphQLErrors=O.errors),S&&(w.protocolErrors=O.extensions[g_]),a==="none"||S)throw new rf(w)}return a==="ignore"&&delete O.errors,O})};if(this.getDocumentInfo(n).hasClientExports){var v=this.localState.addExportedVariables(n,i,c).then(m);return new Wr(function(b){var O=null;return v.then(function(x){return O=x.subscribe(b)},b.error),function(){return O&&O.unsubscribe()}})}return m(i)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){var r;this.fetchCancelFns.delete(e),this.queries.has(e)&&((r=this.queries.get(e))===null||r===void 0||r.stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){var r;return(r=e.observableQuery)===null||r===void 0?void 0:r.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i,o){var s=this,a;o===void 0&&(o=(a=r?.queryDeduplication)!==null&&a!==void 0?a:this.queryDeduplication);var l,c=this.getDocumentInfo(e),u=c.serverQuery,p=c.clientQuery;if(u){var m=this,v=m.inFlightLinkObservables,b=m.link,O={query:u,variables:n,operationName:p0(u)||void 0,context:this.prepareContext(pe(pe({},r),{forceFetch:!o})),extensions:i};if(r=O.context,o){var x=vf(u),S=Qd(n),w=v.lookup(x,S);if(l=w.observable,!l){var k=new gg([J2(b,O)]);l=w.observable=k,k.beforeNext(function P(_,T){_==="next"&&"hasNext"in T&&T.hasNext?k.beforeNext(P):v.remove(x,S)})}}else l=new gg([J2(b,O)])}else l=new gg([Wr.of({data:{}})]),r=this.prepareContext(r);return p&&(l=tI(l,function(P){return s.localState.runResolvers({document:p,remoteResult:P,context:r,variables:n})})),l},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),o=this.cache.transformForLink(n.query);return tI(this.getObservableFromLink(o,n.context,n.variables),function(s){var a=Y2(s),l=a.length>0,c=n.errorPolicy;if(i>=e.lastRequestId){if(l&&c==="none")throw e.markError(new rf({graphQLErrors:a}));e.markResult(s,o,n,r),e.markReady()}var u={data:s.data,loading:!1,networkStatus:Mr.ready};return l&&c==="none"&&(u.data=void 0),l&&c!=="ignore"&&(u.errors=a,u.networkStatus=Mr.error),u},function(s){var a=bJ(s)?s:new rf({networkError:s});throw i>=e.lastRequestId&&e.markError(a),a})},t.prototype.fetchConcastWithInfo=function(e,r,n,i){var o=this;n===void 0&&(n=Mr.loading),i===void 0&&(i=r.query);var s=this.getVariables(i,r.variables),a=this.defaultOptions.watchQuery,l=r.fetchPolicy,c=l===void 0?a&&a.fetchPolicy||"cache-first":l,u=r.errorPolicy,p=u===void 0?a&&a.errorPolicy||"none":u,m=r.returnPartialData,v=m===void 0?!1:m,b=r.notifyOnNetworkStatusChange,O=b===void 0?!1:b,x=r.context,S=x===void 0?{}:x,w=Object.assign({},r,{query:i,variables:s,fetchPolicy:c,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:O,context:S}),k=function($){w.variables=$;var A=o.fetchQueryByPolicy(e,w,n);return w.fetchPolicy!=="standby"&&A.sources.length>0&&e.observableQuery&&e.observableQuery.applyNextFetchPolicy("after-fetch",r),A},P=function(){return o.fetchCancelFns.delete(e.queryId)};this.fetchCancelFns.set(e.queryId,function($){P(),setTimeout(function(){return _.cancel($)})});var _,T;if(this.getDocumentInfo(w.query).hasClientExports)_=new gg(this.localState.addExportedVariables(w.query,w.variables,w.context).then(k).then(function($){return $.sources})),T=!0;else{var R=k(w.variables);T=R.fromLink,_=new gg(R.sources)}return _.promise.then(P,P),{concast:_,fromLink:T}},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,o=e.optimistic,s=o===void 0?!1:o,a=e.removeOptimistic,l=a===void 0?s?V2("refetchQueries"):void 0:a,c=e.onQueryUpdated,u=new Map;i&&this.getObservableQueries(i).forEach(function(m,v){u.set(v,{oq:m,lastDiff:(r.queries.get(v)||m.queryInfo).getDiff()})});var p=new Map;return n&&this.cache.batch({update:n,optimistic:s&&l||!1,removeOptimistic:l,onWatchUpdated:function(m,v,b){var O=m.watcher instanceof cI&&m.watcher.observableQuery;if(O){if(c){u.delete(O.queryId);var x=c(O,v,b);return x===!0&&(x=O.refetch()),x!==!1&&p.set(O,x),x}c!==null&&u.set(O.queryId,{oq:O,lastDiff:b,diff:v})}}}),u.size&&u.forEach(function(m,v){var b=m.oq,O=m.lastDiff,x=m.diff,S;c&&(x||(x=_o("canonizeResults",function(){return r.cache.diff(b.queryInfo.getDiffOptions())})),S=c(b,x,O)),(!c||S===!0)&&(S=b.refetch()),S!==!1&&p.set(b,S),v.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(v)}),l&&this.cache.removeOptimistic(l),p},t.prototype.maskOperation=function(e){var r,n,i,o=e.document,s=e.data;if(globalThis.__DEV__!==!1){var a=e.fetchPolicy,l=e.id,c=(r=zf(o))===null||r===void 0?void 0:r.operation,u=((n=c?.[0])!==null&&n!==void 0?n:"o")+l;this.dataMasking&&a==="no-cache"&&!kTe(o)&&!this.noCacheWarningsByQueryId.has(u)&&(this.noCacheWarningsByQueryId.add(u),globalThis.__DEV__!==!1&&Je.warn(45,(i=p0(o))!==null&&i!==void 0?i:"Unnamed ".concat(c??"operation")))}return this.dataMasking?PRe(s,o,this.cache):s},t.prototype.maskFragment=function(e){var r=e.data,n=e.fragment,i=e.fragmentName;return this.dataMasking?_J(r,n,this.cache,i):r},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,o=r.query,s=r.variables,a=r.fetchPolicy,l=r.refetchWritePolicy,c=r.errorPolicy,u=r.returnPartialData,p=r.context,m=r.notifyOnNetworkStatusChange,v=e.networkStatus;e.init({document:o,variables:s,networkStatus:n});var b=function(){return e.getDiff()},O=function(P,_){_===void 0&&(_=e.networkStatus||Mr.loading);var T=P.result;globalThis.__DEV__!==!1&&!u&&!bn(T,{})&&BJ(P.missing);var R=function($){return Wr.of(pe({data:$,loading:Ig(_),networkStatus:_},P.complete?null:{partial:!0}))};return T&&i.getDocumentInfo(o).hasForcedResolvers?i.localState.runResolvers({document:o,remoteResult:{data:T},context:p,variables:s,onlyRunForcedResolvers:!0}).then(function($){return R($.data||void 0)}):c==="none"&&_===Mr.refetch&&Array.isArray(P.missing)?R(void 0):R(T)},x=a==="no-cache"?0:n===Mr.refetch&&l!=="merge"?1:2,S=function(){return i.getResultsFromLink(e,x,{query:o,variables:s,context:p,fetchPolicy:a,errorPolicy:c})},w=m&&typeof v=="number"&&v!==n&&Ig(n);switch(a){default:case"cache-first":{var k=b();return k.complete?{fromLink:!1,sources:[O(k,e.markReady())]}:u||w?{fromLink:!0,sources:[O(k),S()]}:{fromLink:!0,sources:[S()]}}case"cache-and-network":{var k=b();return k.complete||u||w?{fromLink:!0,sources:[O(k),S()]}:{fromLink:!0,sources:[S()]}}case"cache-only":return{fromLink:!1,sources:[O(b(),e.markReady())]};case"network-only":return w?{fromLink:!0,sources:[O(b()),S()]}:{fromLink:!0,sources:[S()]};case"no-cache":return w?{fromLink:!0,sources:[O(e.getDiff()),S()]}:{fromLink:!0,sources:[S()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getOrCreateQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new cI(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return pe(pe(pe({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},t}(),HRe=function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,o=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),o&&this.setFragmentMatcher(o)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=O3(r.resolvers,n)}):this.resolvers=O3(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){return vd(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,o=r.context,s=r.variables,a=r.onlyRunForcedResolvers,l=a===void 0?!1:a;return yd(this,function(c){return n?[2,this.resolveDocument(n,i.data,o,s,this.fragmentMatcher,l).then(function(u){return pe(pe({},i),{data:u.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return xb(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return uJ(e)},t.prototype.prepareContext=function(e){var r=this.cache;return pe(pe({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e){return vd(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),yd(this,function(o){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(s){return pe(pe({},n),s.exportedVariables)})]:[2,pe({},n)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return vl(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return l_}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:OEe(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r){return vd(this,arguments,void 0,function(n,i,o,s,a,l){var c,u,p,m,v,b,O,x,S,w,k;return o===void 0&&(o={}),s===void 0&&(s={}),a===void 0&&(a=function(){return!0}),l===void 0&&(l=!1),yd(this,function(P){return c=YO(n),u=yv(n),p=mv(u),m=this.collectSelectionsToResolve(c,p),v=c.operation,b=v?v.charAt(0).toUpperCase()+v.slice(1):"Query",O=this,x=O.cache,S=O.client,w={fragmentMap:p,context:pe(pe({},o),{cache:x,client:S}),variables:s,fragmentMatcher:a,defaultOperationType:b,exportedVariables:{},selectionsToResolve:m,onlyRunForcedResolvers:l},k=!1,[2,this.resolveSelectionSet(c.selectionSet,k,i,w).then(function(_){return{result:_,exportedVariables:w.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return vd(this,void 0,void 0,function(){var o,s,a,l,c,u=this;return yd(this,function(p){return o=i.fragmentMap,s=i.context,a=i.variables,l=[n],c=function(m){return vd(u,void 0,void 0,function(){var v,b;return yd(this,function(O){return!r&&!i.selectionsToResolve.has(m)?[2]:ZO(m,a)?Zd(m)?[2,this.resolveField(m,r,n,i).then(function(x){var S;typeof x<"u"&&l.push((S={},S[Su(m)]=x,S))})]:(tEe(m)?v=m:(v=o[m.name.value],Je(v,21,m.name.value)),v&&v.typeCondition&&(b=v.typeCondition.name.value,i.fragmentMatcher(n,b,s))?[2,this.resolveSelectionSet(v.selectionSet,r,n,i).then(function(x){l.push(x)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(c)).then(function(){return p_(l)})]})})},t.prototype.resolveField=function(e,r,n,i){return vd(this,void 0,void 0,function(){var o,s,a,l,c,u,p,m,v,b=this;return yd(this,function(O){return n?(o=i.variables,s=e.name.value,a=Su(e),l=s!==a,c=n[a]||n[s],u=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(p=n.__typename||i.defaultOperationType,m=this.resolvers&&this.resolvers[p],m&&(v=m[l?s:a],v&&(u=Promise.resolve(iD.withValue(this.cache,v,[n,d_(e,o),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,u.then(function(x){var S,w;if(x===void 0&&(x=c),e.directives&&e.directives.forEach(function(P){P.name.value==="export"&&P.arguments&&P.arguments.forEach(function(_){_.name.value==="as"&&_.value.kind==="StringValue"&&(i.exportedVariables[_.value.value]=x)})}),!e.selectionSet||x==null)return x;var k=(w=(S=e.directives)===null||S===void 0?void 0:S.some(function(P){return P.name.value==="client"}))!==null&&w!==void 0?w:!1;if(Array.isArray(x))return b.resolveSubSelectedArray(e,r||k,x,i);if(e.selectionSet)return b.resolveSelectionSet(e.selectionSet,r||k,x,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var o=this;return Promise.all(n.map(function(s){if(s===null)return null;if(Array.isArray(s))return o.resolveSubSelectedArray(e,r,s,i);if(e.selectionSet)return o.resolveSelectionSet(e.selectionSet,r,s,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(s){return!Array.isArray(s)},i=this.selectionsToResolveCache;function o(s){if(!i.has(s)){var a=new Set;i.set(s,a),vl(s,{Directive:function(l,c,u,p,m){l.name.value==="client"&&m.forEach(function(v){n(v)&&u3(v)&&a.add(v)})},FragmentSpread:function(l,c,u,p,m){var v=r[l.name.value];Je(v,22,l.name.value);var b=o(v);b.size>0&&(m.forEach(function(O){n(O)&&u3(O)&&a.add(O)}),a.add(l),b.forEach(function(O){a.add(O)}))}})}return i.get(s)}return o(e)},t}(),eB=!1,zJ=function(){function t(e){var r=this,n,i,o;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw Bo(16);var s=e.uri,a=e.credentials,l=e.headers,c=e.cache,u=e.documentTransform,p=e.ssrMode,m=p===void 0?!1:p,v=e.ssrForceFetchDelay,b=v===void 0?0:v,O=e.connectToDevTools,x=e.queryDeduplication,S=x===void 0?!0:x,w=e.defaultOptions,k=e.defaultContext,P=e.assumeImmutableResults,_=P===void 0?c.assumeImmutableResults:P,T=e.resolvers,R=e.typeDefs,$=e.fragmentMatcher,A=e.clientAwareness,M=e.name,Q=e.version,V=e.devtools,q=e.dataMasking;globalThis.__DEV__!==!1&&(li(e,"connectToDevTools","ApolloClient","Please use `devtools.enabled` instead."),li(e,"uri","ApolloClient","Please initialize an instance of `HttpLink` with `uri` instead."),li(e,"credentials","ApolloClient","Please initialize an instance of `HttpLink` with `credentials` instead."),li(e,"headers","ApolloClient","Please initialize an instance of `HttpLink` with `headers` instead."),li(e,"name","ApolloClient","Please use the `clientAwareness.name` option instead."),li(e,"version","ApolloClient","Please use the `clientAwareness.version` option instead."),li(e,"typeDefs","ApolloClient"),e.link||globalThis.__DEV__!==!1&&Je.warn(17));var N=e.link;N||(N=s?new yRe({uri:s,credentials:a,headers:l}):$u.empty()),this.link=N,this.cache=c,this.disableNetworkFetches=m||b>0,this.queryDeduplication=S,this.defaultOptions=w||Object.create(null),this.typeDefs=R,this.devtoolsConfig=pe(pe({},V),{enabled:(n=V?.enabled)!==null&&n!==void 0?n:O}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),b&&setTimeout(function(){return r.disableNetworkFetches=!1},b),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=VM,this.localState=new HRe({cache:c,client:this,resolvers:T,fragmentMatcher:$}),this.queryManager=new URe({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:k,documentTransform:u,queryDeduplication:S,ssrMode:m,dataMasking:!!q,clientAwareness:{name:(i=A?.name)!==null&&i!==void 0?i:M,version:(o=A?.version)!==null&&o!==void 0?o:Q},localState:this.localState,assumeImmutableResults:_,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return Object.defineProperty(t.prototype,"prioritizeCacheValues",{get:function(){return this.disableNetworkFetches},set:function(e){this.disableNetworkFetches=e},enumerable:!1,configurable:!0}),t.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,r=Symbol.for("apollo.devtools");(e[r]=e[r]||[]).push(this),e.__APOLLO_CLIENT__=this,!eB&&globalThis.__DEV__!==!1&&(eB=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var n=window.navigator,i=n&&n.userAgent,o=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?o="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(o="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),o&&globalThis.__DEV__!==!1&&Je.log("Download the Apollo DevTools for a better development experience: %s",o)}},1e4))}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=rI(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=pe(pe({},e),{fetchPolicy:"cache-first"})),globalThis.__DEV__!==!1&&(li(e,"canonizeResults","client.watchQuery"),li(e,"partialRefetch","client.watchQuery")),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=rI(this.defaultOptions.query,e)),Je(e.fetchPolicy!=="cache-and-network",18),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=pe(pe({},e),{fetchPolicy:"cache-first"})),globalThis.__DEV__!==!1&&(li(e,"canonizeResults","client.query"),li(e,"notifyOnNetworkStatusChange","client.query","This option does not affect `client.query` and can be safely removed."),e.fetchPolicy==="standby"&&globalThis.__DEV__!==!1&&Je.warn(19)),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=rI(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){var r=this,n=this.queryManager.generateQueryId();return this.queryManager.startGraphQLSubscription(e).map(function(i){return pe(pe({},i),{data:r.queryManager.maskOperation({document:e.query,data:i.data,fetchPolicy:e.fetchPolicy,id:n})})})},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.watchFragment=function(e){var r;return this.cache.watchFragment(pe(pe({},e),(r={},r[Symbol.for("apollo.dataMasking")]=this.queryManager.dataMasking,r)))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return J2(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(s,a){n.push(a),i.push(s)});var o=Promise.all(i);return o.queries=n,o.results=i,o.catch(function(s){globalThis.__DEV__!==!1&&Je.debug(20,s)}),o},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),t}();globalThis.__DEV__!==!1&&(zJ.prototype.getMemoryInternals=ATe);var oC=new Map,a$=new Map,qJ=!0,nk=!1;function WJ(t){return t.replace(/[\s,]+/g," ").trim()}function GRe(t){return WJ(t.source.body.substring(t.start,t.end))}function XRe(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,o=GRe(n.loc),s=a$.get(i);s&&!s.has(o)?qJ&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
74
74
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
75
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||a$.set(i,s=new Set),s.add(o),e.has(o)||(e.add(o),r.push(n))}else r.push(n)}),pe(pe({},t),{definitions:r})}function ZRe(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var o=n[i];o&&typeof o=="object"&&e.add(o)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function YRe(t){var e=WJ(t);if(!oC.has(e)){var r=LK(t,{experimentalFragmentVariables:nk,allowLegacyFragmentVariables:nk});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");oC.set(e,ZRe(XRe(r)))}return oC.get(e)}function Se(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,o){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[o+1]}),YRe(n)}function KRe(){oC.clear(),a$.clear()}function JRe(){qJ=!1}function eIe(){nk=!0}function tIe(){nk=!1}var Ly={gql:Se,resetCaches:KRe,disableFragmentWarnings:JRe,enableExperimentalFragmentVariables:eIe,disableExperimentalFragmentVariables:tIe};(function(t){t.gql=Ly.gql,t.resetCaches=Ly.resetCaches,t.disableFragmentWarnings=Ly.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Ly.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Ly.disableExperimentalFragmentVariables})(Se||(Se={}));Se.default=Se;var uI={exports:{}},tB;function rIe(){return tB||(tB=1,function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,OO())}(uI)),uI.exports}var Bd=rIe();const nIe=ch(Bd),iIe=mP({__proto__:null,default:nIe},[Bd]);var rB=UM?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function oIe(){Je("createContext"in iIe,69);var t=Bd.createContext[rB];return t||(Object.defineProperty(Bd.createContext,rB,{value:t=Bd.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var sIe=function(t){var e=t.client,r=t.children,n=oIe(),i=Bd.useContext(n),o=Bd.useMemo(function(){return pe(pe({},i),{client:e||i.client})},[i,e]);return Je(o.client,71),Bd.createElement(n.Provider,{value:o},r)};function aIe(t){return new $u(function(e,r){var n=fc(e,[]);return new Wr(function(i){var o,s=!1;return Promise.resolve(n).then(function(a){return t(a,e.getContext())}).then(e.setContext).then(function(){s||(o=r(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){s=!0,o&&o.unsubscribe()}})})}function UJ(t){return new $u(function(e,r){return new Wr(function(n){var i,o,s;try{i=r(e).subscribe({next:function(a){if(a.errors?s=t({graphQLErrors:a.errors,response:a,operation:e,forward:r}):yJ(a)&&(s=t({protocolErrors:a.extensions[g_],response:a,operation:e,forward:r})),s){o=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(a)},error:function(a){if(s=t({operation:e,networkError:a,graphQLErrors:a&&a.result&&a.result.errors||void 0,forward:r}),s){o=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(a)},complete:function(){s||n.complete.bind(n)()}})}catch(a){t({networkError:a,operation:e,forward:r}),n.error(a)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}})})}(function(t){Tl(e,t);function e(r){var n=t.call(this)||this;return n.link=UJ(r),n}return e.prototype.request=function(r,n){return this.link.request(r,n)},e})($u);const lIe={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"dc294e7",MODE:"production",PACKAGE_VERSION:"2.1.0-alpha.6",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},cIe=t=>{const e=window.__env__?.[t],r=lIe[t];return e||r},m_="/",lD="sandbox",eh="login",HJ="logout",v_="signup",GJ="username",XJ="github",ZJ="google",uIe="get-mcp-token",YJ="completed",dIe="confirm",Td="app",Ed=":organizationId",Rd=":projectName",KJ="-/settings",JJ="-/users",hIe="-/api-keys",eee="-/mcp",y_=":branchName",kb="-/changes",ik="-/migrations",tee="-/endpoints",b_=":revisionIdOrTag",ok=":tableId",ree=":rowId",zo="draft",th="head";var rn=(t=>(t.Organization="organization",t.Project="project",t.Branch="branch",t.Revision="revision",t.Table="table",t.Row="row",t.Changes="changes",t.Migrations="migrations",t.Endpoints="endpoints",t.ProjectSettings="projectSettings",t.ProjectUsers="projectUsers",t.ProjectApiKeys="projectApiKeys",t.ProjectMcp="projectMcp",t))(rn||{});const Mi=({hideSidebar:t,sidebar:e,title:r,actions:n,children:i})=>h.jsxs(ee,{minHeight:"100vh",children:[!t&&h.jsxs(ee,{borderRight:"1px solid",borderRightColor:"newGray.100",flexDirection:"column",justifyContent:e?"space-between":"flex-end",padding:"16px",width:"288px",minWidth:"288px",flexShrink:0,height:"100vh",top:0,position:"sticky",children:[e,h.jsx(z,{alignSelf:"center",mt:"1rem",children:h.jsx(Ki,{to:`/${HJ}`,style:{color:"#A0AEC0",textDecoration:"none"},children:"Logout"})})]}),h.jsxs(ee,{alignItems:"center",flex:1,flexDirection:"column",width:"100%",children:[(r||n)&&h.jsxs(ee,{alignItems:"center",backgroundColor:"white",borderBottom:"1px solid",borderBottomColor:"gray.50",justifyContent:"space-between",maxWidth:"900px",padding:"8px",width:"100%",position:"sticky",zIndex:1,top:0,children:[r,n]}),h.jsx(ee,{flex:1,flexDirection:"column",maxWidth:"900px",padding:"1rem 1rem 0rem 1rem",width:"100%",children:i})]})]});var nee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},nB=qe.createContext&&qe.createContext(nee),fIe=["attr","size","title"];function pIe(t,e){if(t==null)return{};var r=gIe(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function gIe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function sk(){return sk=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sk.apply(this,arguments)}function iB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ak(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iB(Object(r),!0).forEach(function(n){mIe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mIe(t,e,r){return e=vIe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vIe(t){var e=yIe(t,"string");return typeof e=="symbol"?e:e+""}function yIe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iee(t){return t&&t.map((e,r)=>qe.createElement(e.tag,ak({key:r},e.attr),iee(e.child)))}function Ke(t){return e=>qe.createElement(bIe,sk({attr:ak({},t.attr)},e),iee(t.child))}function bIe(t){var e=r=>{var{attr:n,size:i,title:o}=t,s=pIe(t,fIe),a=i||r.size||"1em",l;return r.className&&(l=r.className),t.className&&(l=(l?l+" ":"")+t.className),qe.createElement("svg",sk({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:l,style:ak(ak({color:t.color||r.color},r.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&qe.createElement("title",null,o),t.children)};return nB!==void 0?qe.createElement(nB.Consumer,null,r=>e(r)):e(nee)}function cD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"},child:[]}]})(t)}function oee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"},child:[]}]})(t)}function uD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"},child:[]}]})(t)}function OIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"},child:[]}]})(t)}function see(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"},child:[]}]})(t)}function xIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"},child:[]}]})(t)}function dD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"},child:[]}]})(t)}function Ov(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"},child:[]}]})(t)}function hD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128Z"},child:[]}]})(t)}function aee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"},child:[]}]})(t)}function lee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm0,184A80,80,0,1,1,181.34,68.37a8,8,0,0,1-10.67,11.92A64,64,0,1,0,191.5,136H128a8,8,0,0,1,0-16h72a8,8,0,0,1,8,8A80.09,80.09,0,0,1,128,208Z"},child:[]}]})(t)}function wIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM148.24,92.24,112.49,128l35.75,35.76a6,6,0,1,1-8.48,8.48l-40-40a6,6,0,0,1,0-8.48l40-40a6,6,0,0,1,8.48,8.48Z"},child:[]}]})(t)}function O_(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"},child:[]}]})(t)}function Xg(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"},child:[]}]})(t)}function Zg(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"},child:[]}]})(t)}function SIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,26C75.29,26,34,49.72,34,80v96c0,30.28,41.29,54,94,54s94-23.72,94-54V80C222,49.72,180.71,26,128,26Zm0,12c44.45,0,82,19.23,82,42s-37.55,42-82,42S46,102.77,46,80,83.55,38,128,38Zm82,138c0,22.77-37.55,42-82,42s-82-19.23-82-42V154.79C62,171.16,92.37,182,128,182s66-10.84,82-27.21Zm0-48c0,22.77-37.55,42-82,42s-82-19.23-82-42V106.79C62,123.16,92.37,134,128,134s66-10.84,82-27.21Z"},child:[]}]})(t)}function CIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"},child:[]}]})(t)}function kIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z"},child:[]}]})(t)}function cee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"},child:[]}]})(t)}function l$(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236.24,67.76a6,6,0,0,0-8.48,0L192,103.51,152.49,64l35.75-35.76a6,6,0,0,0-8.48-8.48L144,55.51,116.24,27.76a6,6,0,1,0-8.48,8.48L115.51,44,61.13,98.38a38,38,0,0,0,0,53.75l17.13,17.12-50.5,50.51a6,6,0,1,0,8.48,8.48l50.51-50.5,17.13,17.13a38,38,0,0,0,53.74,0L212,140.49l7.76,7.75a6,6,0,0,0,8.48-8.48L200.49,112l35.75-35.76A6,6,0,0,0,236.24,67.76ZM149.13,186.38a26,26,0,0,1-36.77,0L69.62,143.64a26,26,0,0,1,0-36.77L124,52.49,203.51,132Z"},child:[]}]})(t)}function lk(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"},child:[]}]})(t)}function PIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M200,50H134V16a6,6,0,0,0-12,0V50H56A30,30,0,0,0,26,80V192a30,30,0,0,0,30,30H200a30,30,0,0,0,30-30V80A30,30,0,0,0,200,50Zm18,142a18,18,0,0,1-18,18H56a18,18,0,0,1-18-18V80A18,18,0,0,1,56,62H200a18,18,0,0,1,18,18ZM74,108a10,10,0,1,1,10,10A10,10,0,0,1,74,108Zm88,0a10,10,0,1,1,10,10A10,10,0,0,1,162,108Zm2,30H92a26,26,0,0,0,0,52h72a26,26,0,0,0,0-52Zm-22,12v28H114V150ZM78,164a14,14,0,0,1,14-14h10v28H92A14,14,0,0,1,78,164Zm86,14H154V150h10a14,14,0,0,1,0,28Z"},child:[]}]})(t)}function _Ie(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236.24,179.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L217.52,190H200.94a70.16,70.16,0,0,1-57-29.31l-41.71-58.4A58.11,58.11,0,0,0,55.06,78H32a6,6,0,0,1,0-12H55.06a70.16,70.16,0,0,1,57,29.31l41.71,58.4A58.11,58.11,0,0,0,200.94,178h16.58l-13.76-13.76a6,6,0,0,1,8.48-8.48Zm-92.06-74.41a5.91,5.91,0,0,0,3.48,1.12,6,6,0,0,0,4.89-2.51l1.19-1.67A58.11,58.11,0,0,1,200.94,78h16.58L203.76,91.76a6,6,0,1,0,8.48,8.48l24-24a6,6,0,0,0,0-8.48l-24-24a6,6,0,0,0-8.48,8.48L217.52,66H200.94a70.16,70.16,0,0,0-57,29.31L142.78,97A6,6,0,0,0,144.18,105.35Zm-32.36,45.3a6,6,0,0,0-8.37,1.39l-1.19,1.67A58.11,58.11,0,0,1,55.06,178H32a6,6,0,0,0,0,12H55.06a70.16,70.16,0,0,0,57-29.31l1.19-1.67A6,6,0,0,0,111.82,150.65Z"},child:[]}]})(t)}function uee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"},child:[]}]})(t)}function dee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"},child:[]}]})(t)}function hee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M112.6,158.43a58,58,0,1,0-57.2,0A93.83,93.83,0,0,0,5.21,196.72a6,6,0,0,0,10.05,6.56,82,82,0,0,1,137.48,0,6,6,0,0,0,10-6.56A93.83,93.83,0,0,0,112.6,158.43ZM38,108a46,46,0,1,1,46,46A46.06,46.06,0,0,1,38,108Zm211,97a6,6,0,0,1-8.3-1.74A81.8,81.8,0,0,0,172,166a6,6,0,0,1,0-12,46,46,0,1,0-17.08-88.73,6,6,0,1,1-4.46-11.14,58,58,0,0,1,50.14,104.3,93.83,93.83,0,0,1,50.19,38.29A6,6,0,0,1,249,205Z"},child:[]}]})(t)}function TIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"},child:[]}]})(t)}function EIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"},child:[]}]})(t)}function RIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"},child:[]}]})(t)}function fee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM208,208V48H48V208H208Z"},child:[]}]})(t)}function fD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"},child:[]}]})(t)}function IIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z"},child:[]}]})(t)}function Yg(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"},child:[]}]})(t)}function x_(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"},child:[]}]})(t)}function pee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"},child:[]}]})(t)}function gee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"},child:[]}]})(t)}function mee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"},child:[]}]})(t)}function w_(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"},child:[]}]})(t)}function jIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"},child:[]}]})(t)}function KO(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"},child:[]}]})(t)}function $Ie(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM164,96v48a4,4,0,0,1-8,0V105.66L98.83,162.83a4,4,0,0,1-5.66-5.66L150.34,100H112a4,4,0,0,1,0-8h48A4,4,0,0,1,164,96Z"},child:[]}]})(t)}function vee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M35.89,128C52,136.23,52,155.64,52,172c0,24.8,1.35,40,28,40a4,4,0,0,1,0,8c-36,0-36-26.61-36-48,0-24.8-1.35-40-28-40a4,4,0,0,1,0-8c26.65,0,28-15.2,28-40,0-21.39,0-48,36-48a4,4,0,0,1,0,8C53.35,44,52,59.2,52,84,52,100.36,52,119.77,35.89,128ZM240,124c-26.65,0-28-15.2-28-40,0-21.39,0-48-36-48a4,4,0,0,0,0,8c26.65,0,28,15.2,28,40,0,16.36,0,35.77,16.11,44C204,136.23,204,155.64,204,172c0,24.8-1.35,40-28,40a4,4,0,0,0,0,8c36,0,36-26.61,36-48,0-24.8,1.35-40,28-40a4,4,0,0,0,0-8Z"},child:[]}]})(t)}function AIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"},child:[]}]})(t)}function NIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"},child:[]}]})(t)}function MIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z"},child:[]}]})(t)}function DIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M146.83,141.17a4,4,0,0,0-5.66,0L120,162.34,93.66,136l21.17-21.17a4,4,0,0,0-5.66-5.66L88,130.34,66.83,109.17a4,4,0,0,0-5.66,5.66L70.34,124,44.2,150.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L58.06,203.6l8.2,8.2a28,28,0,0,0,39.6,0L132,185.66l9.17,9.17a4,4,0,0,0,5.66-5.66L125.66,168l21.17-21.17A4,4,0,0,0,146.83,141.17Zm-46.63,65a20,20,0,0,1-28.28,0L49.86,184.08a20,20,0,0,1,0-28.28L76,129.66,126.34,180Zm134.63-185a4,4,0,0,0-5.66,0L197.94,52.4l-8.2-8.2a28,28,0,0,0-39.6,0L124,70.34l-9.17-9.17a4,4,0,0,0-5.66,5.66l80,80a4,4,0,0,0,5.66-5.66L185.66,132l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,31.23-31.23A4,4,0,0,0,234.83,21.17ZM212,86.06a19.86,19.86,0,0,1-5.86,14.14L180,126.34,129.66,76,155.8,49.86a20,20,0,0,1,28.28,0l22.06,22.06A19.85,19.85,0,0,1,212,86.06Z"},child:[]}]})(t)}function LIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,109.17l-80-80A4,4,0,0,0,148,32V76.09c-54,2.44-120.43,53.55-127.94,119a7.87,7.87,0,0,0,4.58,8.16,8,8,0,0,0,3.41.77,7.9,7.9,0,0,0,5.79-2.55h0c11.53-12.27,53.29-51.73,114.16-53.4V192a4,4,0,0,0,6.83,2.83l80-80A4,4,0,0,0,234.83,109.17ZM156,182.33V144a4,4,0,0,0-4-4c-27.39,0-54.08,7.17-79.34,21.3A189.91,189.91,0,0,0,28,196l2.92,2.74L28,196c3.36-29.21,19.55-57.48,45.6-79.57C97.53,96.11,126.83,84,152,84a4,4,0,0,0,4-4V41.66L226.34,112Z"},child:[]}]})(t)}function VIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52ZM36,108H84v40H36Zm56,0H220v40H92ZM220,60v40H36V60ZM36,192V156H84v40H40A4,4,0,0,1,36,192Zm180,4H92V156H220v36A4,4,0,0,1,216,196Z"},child:[]}]})(t)}function FIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M176,148h32a12,12,0,0,0,12-12V104a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H84V76H96a12,12,0,0,0,12-12V32A12,12,0,0,0,96,20H64A12,12,0,0,0,52,32V64A12,12,0,0,0,64,76H76V192a20,20,0,0,0,20,20h68v12a12,12,0,0,0,12,12h32a12,12,0,0,0,12-12V192a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H96a12,12,0,0,1-12-12V124h80v12A12,12,0,0,0,176,148ZM60,64V32a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4V64a4,4,0,0,1-4,4H64A4,4,0,0,1,60,64ZM172,192a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Zm0-88a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Z"},child:[]}]})(t)}function QIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,136v64a12,12,0,0,1-12,12H32a12,12,0,0,1-12-12V136a12,12,0,0,1,12-12H80a4,4,0,0,1,0,8H32a4,4,0,0,0-4,4v64a4,4,0,0,0,4,4H224a4,4,0,0,0,4-4V136a4,4,0,0,0-4-4H176a4,4,0,0,1,0-8h48A12,12,0,0,1,236,136ZM82.83,74.83,124,33.66V128a4,4,0,0,0,8,0V33.66l41.17,41.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66ZM196,168a8,8,0,1,0-8,8A8,8,0,0,0,196,168Z"},child:[]}]})(t)}function pD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"},child:[]}]})(t)}const ea=({height:t="2.5rem",title:e,onClick:r,disabled:n,isSelected:i,isLoading:o,icon:s,dataTestId:a})=>h.jsx(It,{"data-testid":a,_hover:{color:"gray.400",backgroundColor:"white"},_disabled:i?{backgroundColor:"gray.50",cursor:"not-allowed"}:void 0,alignSelf:"flex-start",color:"gray.300",fontWeight:"500",fontSize:16,height:t,disabled:n||i,loading:o,variant:"ghost",onClick:r,children:h.jsxs(ee,{alignItems:"center",gap:"0.5rem",children:[s&&h.jsx(z,{fontSize:"sm",children:s}),h.jsx(Y,{children:e})]})}),S_=t=>h.jsx(ea,{...t,icon:h.jsx(dD,{})}),JO=({height:t="2.5rem",loading:e,isDisabled:r,onClick:n,title:i,dataTestId:o})=>h.jsxs(It,{"data-testid":o,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:t,loading:e,disabled:r,variant:"ghost",onClick:n,width:"48px",children:[h.jsx(lu,{size:"sm",mr:i?8:0,children:h.jsx(uD,{})}),i]}),C_=({height:t="2.5rem",onClick:e,disabled:r,dataTestId:n})=>h.jsx(It,{"data-testid":n,disabled:r,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:t,variant:"ghost",onClick:e,width:"48px",children:h.jsx(lu,{size:"md",children:h.jsx(KO,{})})}),yee=({dataTestId:t,...e})=>h.jsx(Ir,{"data-testid":t,_hover:{backgroundColor:"gray.100"},color:"gray.400",variant:"ghost",size:"lg",width:"40px",height:"40px",...e,children:h.jsx(see,{})}),BIe=({dataTestId:t,...e})=>h.jsx(Ir,{"data-testid":t,_hover:{backgroundColor:"gray.50"},color:"gray.400",variant:"ghost",size:"sm",...e,children:h.jsx(x_,{})}),hu=({value:t,placeholder:e,autoFocus:r,onChange:n,onBlur:i,onEnter:o,width:s,height:a,type:l,dataTestId:c,autoComplete:u})=>{const p=I6e();return h.jsx(hs,{autoComplete:u,"data-testid":c,borderColor:"gray.100",padding:"0 9px",placeholder:e,ref:r?p:void 0,value:t,variant:"outline",onChange:n,onBlur:i,width:s,height:a,type:l,onKeyDown:o?m=>{m.key==="Enter"&&o()}:void 0})},Ur=LX({placement:"top",pauseOnPageIdle:!0,duration:1500}),sC=LX({placement:"bottom",pauseOnPageIdle:!0,duration:1500}),oB=t=>h.jsxs(PSe,{width:{md:"sm"},children:[t.type==="loading"?h.jsx(ri,{size:"sm",color:"blue.solid"}):h.jsx(jSe,{}),h.jsxs(WP,{gap:"1",flex:"1",maxWidth:"100%",children:[t.title&&h.jsx(TSe,{children:t.title}),t.description&&h.jsx(ESe,{color:"gray.500",children:t.description})]}),t.action&&h.jsx(RSe,{children:t.action.label}),t.closable&&h.jsx(_Se,{})]}),sB=()=>h.jsxs(Lt,{children:[h.jsx(mQ,{toaster:Ur,insetInline:{mdDown:"4"},children:t=>h.jsx(oB,{...t})}),h.jsx(mQ,{toaster:sC,insetInline:{mdDown:"4"},children:t=>h.jsx(oB,{...t})})]}),Di=E.forwardRef(function(e,r){const{showArrow:n,children:i,disabled:o,portalled:s=!0,content:a,contentProps:l,portalRef:c,...u}=e;return o?i:h.jsxs($Se,{...u,children:[h.jsx(ASe,{asChild:!0,children:i}),h.jsx(Lt,{disabled:!s,container:c,children:h.jsx(NSe,{children:h.jsxs(MSe,{ref:r,...l,children:[n&&h.jsx(DSe,{children:h.jsx(tY,{})}),a]})})})]})}),bee=1024;let zIe=0,Pa=class{constructor(e,r){this.from=e,this.to=r}};class Dt{constructor(e={}){this.id=zIe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Li.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}Dt.closedBy=new Dt({deserialize:t=>t.split(" ")});Dt.openedBy=new Dt({deserialize:t=>t.split(" ")});Dt.group=new Dt({deserialize:t=>t.split(" ")});Dt.isolate=new Dt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Dt.contextHash=new Dt({perNode:!0});Dt.lookAhead=new Dt({perNode:!0});Dt.mounted=new Dt({perNode:!0});class Pb{constructor(e,r,n){this.tree=e,this.overlay=r,this.parser=n}static get(e){return e&&e.props&&e.props[Dt.mounted.id]}}const qIe=Object.create(null);class Li{constructor(e,r,n,i=0){this.name=e,this.props=r,this.id=n,this.flags=i}static define(e){let r=e.props&&e.props.length?Object.create(null):qIe,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Li(e.name||"",r,e.id,n);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let r=this.prop(Dt.group);return r?r.indexOf(e)>-1:!1}return this.id==e}static match(e){let r=Object.create(null);for(let n in e)for(let i of n.split(" "))r[i]=e[n];return n=>{for(let i=n.prop(Dt.group),o=-1;o<(i?i.length:0);o++){let s=r[o<0?n.name:i[o]];if(s)return s}}}}Li.none=new Li("",Object.create(null),0,8);class ex{constructor(e){this.types=e;for(let r=0;r<e.length;r++)if(e[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let r=[];for(let n of this.types){let i=null;for(let o of e){let s=o(n);s&&(i||(i=Object.assign({},n.props)),i[s[0].id]=s[1])}r.push(i?new Li(n.name,i,n.id,n.flags):n)}return new ex(r)}}const Yw=new WeakMap,aB=new WeakMap;var xn;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(xn||(xn={}));class Lr{constructor(e,r,n,i,o){if(this.type=e,this.children=r,this.positions=n,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=Pb.get(this);if(e&&!e.overlay)return e.tree.toString();let r="";for(let n of this.children){let i=n.toString();i&&(r&&(r+=","),r+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(e=0){return new ck(this.topNode,e)}cursorAt(e,r=0,n=0){let i=Yw.get(this)||this.topNode,o=new ck(i);return o.moveTo(e,r),Yw.set(this,o._tree),o}get topNode(){return new jo(this,0,0,null)}resolve(e,r=0){let n=_b(Yw.get(this)||this.topNode,e,r,!1);return Yw.set(this,n),n}resolveInner(e,r=0){let n=_b(aB.get(this)||this.topNode,e,r,!0);return aB.set(this,n),n}resolveStack(e,r=0){return HIe(this,e,r)}iterate(e){let{enter:r,leave:n,from:i=0,to:o=this.length}=e,s=e.mode||0,a=(s&xn.IncludeAnonymous)>0;for(let l=this.cursor(s|xn.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let r in this.props)e.push([+r,this.props[r]]);return e}balance(e={}){return this.children.length<=8?this:vD(Li.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new Lr(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new Lr(Li.none,r,n,i)))}static build(e){return GIe(e)}}Lr.empty=new Lr(Li.none,[],[],0);class gD{constructor(e,r){this.buffer=e,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new gD(this.buffer,this.index)}}class rh{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Li.none}toString(){let e=[];for(let r=0;r<this.buffer.length;)e.push(this.childString(r)),r=this.buffer[r+3];return e.join(",")}childString(e){let r=this.buffer[e],n=this.buffer[e+3],i=this.set.types[r],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,n==e)return o;let s=[];for(;e<n;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,r,n,i,o){let{buffer:s}=this,a=-1;for(let l=e;l!=r&&!(Oee(o,i,s[l+1],s[l+2])&&(a=l,n>0));l=s[l+3]);return a}slice(e,r,n){let i=this.buffer,o=new Uint16Array(r-e),s=0;for(let a=e,l=0;a<r;){o[l++]=i[a++],o[l++]=i[a++]-n;let c=o[l++]=i[a++]-n;o[l++]=i[a++]-e,s=Math.max(s,c)}return new rh(o,s,this.set)}}function Oee(t,e,r,n){switch(t){case-2:return r<e;case-1:return n>=e&&r<e;case 0:return r<e&&n>e;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function _b(t,e,r,n){for(var i;t.from==t.to||(r<1?t.from>=e:t.from>e)||(r>-1?t.to<=e:t.to<e);){let s=!n&&t instanceof jo&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=n?0:xn.IgnoreOverlays;if(n)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof jo&&s.index<0&&((i=a.enter(e,r,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,r,o);if(!s)return t;t=s}}let xee=class{cursor(e=0){return new ck(this,e)}getChild(e,r=null,n=null){let i=lB(this,e,r,n);return i.length?i[0]:null}getChildren(e,r=null,n=null){return lB(this,e,r,n)}resolve(e,r=0){return _b(this,e,r,!1)}resolveInner(e,r=0){return _b(this,e,r,!0)}matchContext(e){return c$(this.parent,e)}enterUnfinishedNodesBefore(e){let r=this.childBefore(e),n=this;for(;r;){let i=r.lastChild;if(!i||i.to!=r.to)break;i.type.isError&&i.from==i.to?(n=r,r=i.prevSibling):r=i}return n}get node(){return this}get next(){return this.parent}};class jo extends xee{constructor(e,r,n,i){super(),this._tree=e,this.from=r,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,r,n,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=r>0?a.length:-1;e!=c;e+=r){let u=a[e],p=l[e]+s.from;if(Oee(i,n,p,p+u.length)){if(u instanceof rh){if(o&xn.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,r,n-p,i);if(m>-1)return new nc(new WIe(s,u,e,p),null,m)}else if(o&xn.IncludeAnonymous||!u.type.isAnonymous||mD(u)){let m;if(!(o&xn.IgnoreMounts)&&(m=Pb.get(u))&&!m.overlay)return new jo(m.tree,p,e,s);let v=new jo(u,p,e,s);return o&xn.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(r<0?u.children.length-1:0,r,n,i)}}}if(o&xn.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+r:e=r<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,r,n=0){let i;if(!(n&xn.IgnoreOverlays)&&(i=Pb.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((r>0?s<=o:s<o)&&(r<0?a>=o:a>o))return new jo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,r,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function lB(t,e,r,n){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(r!=null){for(let s=!1;!s;)if(s=i.type.is(r),!i.nextSibling())return o}for(;;){if(n!=null&&i.type.is(n))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return n==null?o:[]}}function c$(t,e,r=e.length-1){for(let n=t;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[r]&&e[r]!=n.name)return!1;r--}}return!0}class WIe{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class nc extends xee{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,r,n){super(),this.context=e,this._parent=r,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,r,n){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.context.start,n);return o<0?null:new nc(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,r,n=0){if(n&xn.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],r>0?1:-1,e-this.context.start,r);return o<0?null:new nc(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,r=e.buffer[this.index+3];return r<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new nc(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new nc(this.context,this._parent,e.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],r=[],{buffer:n}=this.context,i=this.index+4,o=n.buffer[this.index+3];if(o>i){let s=n.buffer[this.index+1];e.push(n.slice(i,o,s)),r.push(0)}return new Lr(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function wee(t){if(!t.length)return null;let e=0,r=t[0];for(let o=1;o<t.length;o++){let s=t[o];(s.from>r.from||s.to<r.to)&&(r=s,e=o)}let n=r instanceof jo&&r.index<0?null:r.parent,i=t.slice();return n?i[e]=n:i.splice(e,1),new UIe(i,r)}class UIe{constructor(e,r){this.heads=e,this.node=r}get next(){return wee(this.heads)}}function HIe(t,e,r){let n=t.resolveInner(e,r),i=null;for(let o=n instanceof jo?n:n.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[n])).push(s.resolve(e,r)),o=s}else{let s=Pb.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new jo(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[n])).push(_b(a,e,r,!1))}}return i?wee(i):n}class ck{get name(){return this.type.name}constructor(e,r=0){if(this.mode=r,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof jo)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,r){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=r||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof jo?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,r,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,r,n,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.buffer.start,n);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,r,n=this.mode){return this.buffer?n&xn.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:r}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(r.findChild(i,this.index,-1,0,4))}else{let i=r.buffer[this.index+3];if(i<(n<0?r.buffer.length:r.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let r,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:r,parent:n}=i)}else({index:r,_parent:n}=this._tree);for(;n;{index:r,_parent:n}=n)if(r>-1)for(let o=r+e,s=e<0?-1:n._tree.children.length;o!=s;o+=e){let a=n._tree.children[o];if(this.mode&xn.IncludeAnonymous||a instanceof rh||!a.type.isAnonymous||mD(a))return!1}return!0}move(e,r){if(r&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,r=0){for(;(this.from==this.to||(r<1?this.from>=e:this.from>e)||(r>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,r););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,r=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;r=s,n=o+1;break e}i=this.stack[--o]}for(let i=n;i<this.stack.length;i++)r=new nc(this.buffer,r,this.stack[i]);return this.bufferNode=new nc(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,r){for(let n=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&r&&r(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return c$(this.node.parent,e);let{buffer:r}=this.buffer,{types:n}=r.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return c$(this._tree,e,i);let s=n[r.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function mD(t){return t.children.some(e=>e instanceof rh||!e.type.isAnonymous||mD(e))}function GIe(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=bee,reused:o=[],minRepeatType:s=n.types.length}=t,a=Array.isArray(r)?new gD(r,r.length):r,l=n.types,c=0,u=0;function p(_,T,R,$,A,M){let{id:Q,start:V,end:q,size:N}=a,B=u,re=c;for(;N<0;)if(a.next(),N==-1){let D=o[Q];R.push(D),$.push(V-_);return}else if(N==-3){c=Q;return}else if(N==-4){u=Q;return}else throw new RangeError(`Unrecognized record size: ${N}`);let he=l[Q],ne,se,X=V-_;if(q-V<=i&&(se=x(a.pos-T,A))){let D=new Uint16Array(se.size-se.skip),H=a.pos-se.size,J=D.length;for(;a.pos>H;)J=S(se.start,D,J);ne=new rh(D,q-se.start,n),X=se.start-_}else{let D=a.pos-N;a.next();let H=[],J=[],F=Q>=s?Q:-1,W=0,ae=q;for(;a.pos>D;)F>=0&&a.id==F&&a.size>=0?(a.end<=ae-i&&(b(H,J,V,W,a.end,ae,F,B,re),W=H.length,ae=a.end),a.next()):M>2500?m(V,D,H,J):p(V,D,H,J,F,M+1);if(F>=0&&W>0&&W<H.length&&b(H,J,V,W,V,ae,F,B,re),H.reverse(),J.reverse(),F>-1&&W>0){let we=v(he,re);ne=vD(he,H,J,0,H.length,0,q-V,we,we)}else ne=O(he,H,J,q-V,B-q,re)}R.push(ne),$.push(X)}function m(_,T,R,$){let A=[],M=0,Q=-1;for(;a.pos>T;){let{id:V,start:q,end:N,size:B}=a;if(B>4)a.next();else{if(Q>-1&&q<Q)break;Q<0&&(Q=N-i),A.push(V,q,N),M++,a.next()}}if(M){let V=new Uint16Array(M*4),q=A[A.length-2];for(let N=A.length-3,B=0;N>=0;N-=3)V[B++]=A[N],V[B++]=A[N+1]-q,V[B++]=A[N+2]-q,V[B++]=B;R.push(new rh(V,A[2]-q,n)),$.push(q-_)}}function v(_,T){return(R,$,A)=>{let M=0,Q=R.length-1,V,q;if(Q>=0&&(V=R[Q])instanceof Lr){if(!Q&&V.type==_&&V.length==A)return V;(q=V.prop(Dt.lookAhead))&&(M=$[Q]+V.length+q)}return O(_,R,$,A,M,T)}}function b(_,T,R,$,A,M,Q,V,q){let N=[],B=[];for(;_.length>$;)N.push(_.pop()),B.push(T.pop()+R-A);_.push(O(n.types[Q],N,B,M-A,V-M,q)),T.push(A-R)}function O(_,T,R,$,A,M,Q){if(M){let V=[Dt.contextHash,M];Q=Q?[V].concat(Q):[V]}if(A>25){let V=[Dt.lookAhead,A];Q=Q?[V].concat(Q):[V]}return new Lr(_,T,R,$,Q)}function x(_,T){let R=a.fork(),$=0,A=0,M=0,Q=R.end-i,V={size:0,start:0,skip:0};e:for(let q=R.pos-_;R.pos>q;){let N=R.size;if(R.id==T&&N>=0){V.size=$,V.start=A,V.skip=M,M+=4,$+=4,R.next();continue}let B=R.pos-N;if(N<0||B<q||R.start<Q)break;let re=R.id>=s?4:0,he=R.start;for(R.next();R.pos>B;){if(R.size<0)if(R.size==-3)re+=4;else break e;else R.id>=s&&(re+=4);R.next()}A=he,$+=N,M+=re}return(T<0||$==_)&&(V.size=$,V.start=A,V.skip=M),V.size>4?V:void 0}function S(_,T,R){let{id:$,start:A,end:M,size:Q}=a;if(a.next(),Q>=0&&$<s){let V=R;if(Q>4){let q=a.pos-(Q-4);for(;a.pos>q;)R=S(_,T,R)}T[--R]=V,T[--R]=M-_,T[--R]=A-_,T[--R]=$}else Q==-3?c=$:Q==-4&&(u=$);return R}let w=[],k=[];for(;a.pos>0;)p(t.start||0,t.bufferStart||0,w,k,-1,0);let P=(e=t.length)!==null&&e!==void 0?e:w.length?k[0]+w[0].length:0;return new Lr(l[t.topID],w.reverse(),k.reverse(),P)}const cB=new WeakMap;function aC(t,e){if(!t.isAnonymous||e instanceof rh||e.type!=t)return 1;let r=cB.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof Lr)){r=1;break}r+=aC(t,n)}cB.set(e,r)}return r}function vD(t,e,r,n,i,o,s,a,l){let c=0;for(let b=n;b<i;b++)c+=aC(t,e[b]);let u=Math.ceil(c*1.5/8),p=[],m=[];function v(b,O,x,S,w){for(let k=x;k<S;){let P=k,_=O[k],T=aC(t,b[k]);for(k++;k<S;k++){let R=aC(t,b[k]);if(T+R>=u)break;T+=R}if(k==P+1){if(T>u){let R=b[P];v(R.children,R.positions,0,R.children.length,O[P]+w);continue}p.push(b[P])}else{let R=O[k-1]+b[k-1].length-_;p.push(vD(t,b,O,P,k,_,R,null,l))}m.push(_+w-o)}}return v(e,r,n,i,0),(a||l)(p,m,s)}class See{constructor(){this.map=new WeakMap}setBuffer(e,r,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(r,n)}getBuffer(e,r){let n=this.map.get(e);return n&&n.get(r)}set(e,r){e instanceof nc?this.setBuffer(e.context.buffer,e.index,r):e instanceof jo&&this.map.set(e.tree,r)}get(e){return e instanceof nc?this.getBuffer(e.context.buffer,e.index):e instanceof jo?this.map.get(e.tree):void 0}cursorSet(e,r){e.buffer?this.setBuffer(e.buffer.buffer,e.index,r):this.map.set(e.tree,r)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class fu{constructor(e,r,n,i,o=!1,s=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,r=[],n=!1){let i=[new fu(0,e.length,e,0,!1,n)];for(let o of r)o.to>e.length&&i.push(o);return i}static applyChanges(e,r,n=128){if(!r.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<r.length?r[a]:null,p=u?u.fromA:1e9;if(p-l>=n)for(;s&&s.from<p;){let m=s;if(l>=m.from||p<=m.to||c){let v=Math.max(m.from,l)-c,b=Math.min(m.to,p)-c;m=v>=b?null:new fu(v,b,m.tree,m.offset+c,a>0,!!u)}if(m&&i.push(m),s.to>p)break;s=o<e.length?e[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class yD{startParse(e,r,n){return typeof e=="string"&&(e=new XIe(e)),n=n?n.length?n.map(i=>new Pa(i.from,i.to)):[new Pa(0,0)]:[new Pa(0,e.length)],this.createParse(e,r||[],n)}parse(e,r,n){let i=this.startParse(e,r,n);for(;;){let o=i.advance();if(o)return o}}}class XIe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,r){return this.string.slice(e,r)}}function Cee(t){return(e,r,n,i)=>new YIe(e,t,r,n,i)}class uB{constructor(e,r,n,i,o){this.parser=e,this.parse=r,this.overlay=n,this.target=i,this.from=o}}function dB(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class ZIe{constructor(e,r,n,i,o,s,a){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const u$=new Dt({perNode:!0});class YIe{constructor(e,r,n,i,o){this.nest=r,this.input=n,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Lr(n.type,n.children,n.positions,n.length,n.propValues.concat([[u$,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],r=e.parse.advance();if(r){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Dt.mounted.id]=new Pb(r,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<e&&(e=Math.min(e,this.inner[r].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(e)}startInner(){let e=new eje(this.fragments),r=null,n=null,i=new ck(new jo(this.baseTree,this.ranges[0].from,0,null),xn.IncludeAnonymous|xn.IgnoreMounts);e:for(let o,s;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(r){let c=r.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let p=u.from+c.pos,m=u.to+c.pos;p>=i.from&&m<=i.to&&!r.ranges.some(v=>v.from<m&&v.to>p)&&r.ranges.push({from:p,to:m})}}a=!1}else if(n&&(s=KIe(n.ranges,i.from,i.to)))a=s!=2;else if(!i.type.isAnonymous&&(o=this.nest(i,this.input))&&(i.from<i.to||!o.overlay)){i.tree||JIe(i);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")r=new ZIe(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,r);else{let u=pB(this.ranges,o.overlay||(i.from<i.to?[new Pa(i.from,i.to)]:[]));u.length&&dB(u),(u.length||!o.overlay)&&this.inner.push(new uB(o.parser,u.length?o.parser.startParse(this.input,gB(c,u),u):o.parser.startParse(""),o.overlay?o.overlay.map(p=>new Pa(p.from-i.from,p.to-i.from)):null,i.tree,u.length?u[0].from:i.from)),o.overlay?u.length&&(n={ranges:u,depth:0,prev:n}):a=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new Pa(i.from,i.to)),l.from<l.to)){let c=r.ranges.length-1;c>=0&&r.ranges[c].to==l.from?r.ranges[c]={from:r.ranges[c].from,to:l.to}:r.ranges.push(l)}if(a&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let c=pB(this.ranges,r.ranges);c.length&&(dB(c),this.inner.splice(r.index,0,new uB(r.parser,r.parser.startParse(this.input,gB(r.mounts,c),c),r.ranges.map(u=>new Pa(u.from-r.start,u.to-r.start)),r.target,c[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function KIe(t,e,r){for(let n of t){if(n.from>=r)break;if(n.to>e)return n.from<=e&&n.to>=r?2:1}return 0}function hB(t,e,r,n,i,o){if(e<r){let s=t.buffer[e+1];n.push(t.slice(e,r,s)),i.push(s-o)}}function JIe(t){let{node:e}=t,r=[],n=e.context.buffer;do r.push(t.index),t.parent();while(!t.tree);let i=t.tree,o=i.children.indexOf(n),s=i.children[o],a=s.buffer,l=[o];function c(u,p,m,v,b,O){let x=r[O],S=[],w=[];hB(s,u,x,S,w,v);let k=a[x+1],P=a[x+2];l.push(S.length);let _=O?c(x+4,a[x+3],s.set.types[a[x]],k,P-k,O-1):e.toTree();return S.push(_),w.push(k-v),hB(s,a[x+3],p,S,w,v),new Lr(m,S,w,b)}i.children[o]=c(0,a.length,Li.none,0,s.length,r.length-1);for(let u of l){let p=t.tree.children[u],m=t.tree.positions[u];t.yield(new jo(p,m+t.from,u,t._tree))}}class fB{constructor(e,r){this.offset=r,this.done=!1,this.cursor=e.cursor(xn.IncludeAnonymous|xn.IgnoreMounts)}moveTo(e){let{cursor:r}=this,n=e-this.offset;for(;!this.done&&r.from<n;)r.to>=e&&r.enter(n,1,xn.IgnoreOverlays|xn.ExcludeBuffers)||r.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==e.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Lr)r=r.children[0];else break}return!1}}let eje=class{constructor(e){var r;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(r=n.tree.prop(u$))!==null&&r!==void 0?r:n.to,this.inner=new fB(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(e=r.tree.prop(u$))!==null&&e!==void 0?e:r.to,this.inner=new fB(r.tree,-r.offset)}}findMounts(e,r){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(n=o.tree)===null||n===void 0?void 0:n.prop(Dt.mounted);if(s&&s.parser==r)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=o.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:o.from-l.offset,mount:s})}}}return i}};function pB(t,e){let r=null,n=e;for(let i=1,o=0;i<t.length;i++){let s=t[i-1].to,a=t[i].from;for(;o<n.length;o++){let l=n[o];if(l.from>=a)break;l.to<=s||(r||(n=r=e.slice()),l.from<s?(r[o]=new Pa(l.from,s),l.to>a&&r.splice(o+1,0,new Pa(a,l.to))):l.to>a?r[o--]=new Pa(a,l.to):r.splice(o--,1))}}return n}function tje(t,e,r,n){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,p=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let m=Math.max(l,r),v=Math.min(u,p,n);m<v&&c.push(new Pa(m,v))}if(l=Math.min(u,p),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),p==l&&(a?(a=!1,o++):a=!0)}return c}function gB(t,e){let r=[];for(let{pos:n,mount:i,frag:o}of t){let s=n+(i.overlay?i.overlay[0].from:0),a=s+i.tree.length,l=Math.max(o.from,s),c=Math.min(o.to,a);if(i.overlay){let u=i.overlay.map(m=>new Pa(m.from+n,m.to+n)),p=tje(e,u,l,c);for(let m=0,v=l;;m++){let b=m==p.length,O=b?c:p[m].from;if(O>v&&r.push(new fu(v,O,i.tree,-s,o.from>=v||o.openStart,o.to<=O||o.openEnd)),b)break;v=p[m].to}}else r.push(new fu(l,c,i.tree,-s,o.from>=s||o.openStart,o.to<=a||o.openEnd))}return r}let rje=0;class Gs{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=rje++}toString(){let{name:e}=this;for(let r of this.modified)r.name&&(e=`${r.name}(${e})`);return e}static define(e,r){let n=typeof e=="string"?e:"?";if(e instanceof Gs&&(r=e),r?.base)throw new Error("Can not derive from a modified tag");let i=new Gs(n,[],null,[]);if(i.set.push(i),r)for(let o of r.set)i.set.push(o);return i}static defineModifier(e){let r=new uk(e);return n=>n.modified.indexOf(r)>-1?n:uk.get(n.base||n,n.modified.concat(r).sort((i,o)=>i.id-o.id))}}let nje=0;class uk{constructor(e){this.name=e,this.instances=[],this.id=nje++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(a=>a.base==e&&ije(r,a.modified));if(n)return n;let i=[],o=new Gs(e.name,i,e,r);for(let a of r)a.instances.push(o);let s=oje(r);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(uk.get(a,l));return o}}function ije(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function oje(t){let e=[[]];for(let r=0;r<t.length;r++)for(let n=0,i=e.length;n<i;n++)e.push(e[n].concat(t[r]));return e.sort((r,n)=>n.length-r.length)}function up(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let i of r.split(" "))if(i){let o=[],s=2,a=i;for(let p=0;;){if(a=="..."&&p>0&&p+3==i.length){s=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!m)throw new RangeError("Invalid path: "+i);if(o.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==i.length)break;let v=i[p++];if(p==i.length&&v=="!"){s=0;break}if(v!="/")throw new RangeError("Invalid path: "+i);a=i.slice(p)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new dk(n,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return kee.add(e)}const kee=new Dt;class dk{constructor(e,r,n,i){this.tags=e,this.mode=r,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}dk.empty=new dk([],2,null);function Pee(t,e){let r=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))r[o.tag.id]=o.class;else for(let s of o.tag)r[s.id]=o.class;let{scope:n,all:i=null}=e||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=r[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:n}}function sje(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function aje(t,e,r,n=0,i=t.length){let o=new lje(n,Array.isArray(e)?e:[e],r);o.highlightRange(t.cursor(),n,i,"",o.highlighters),o.flush(i)}class lje{constructor(e,r,n){this.at=e,this.highlighters=r,this.span=n,this.class=""}startSpan(e,r){r!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=r)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,r,n,i,o){let{type:s,from:a,to:l}=e;if(a>=n||l<=r)return;s.isTop&&(o=this.highlighters.filter(v=>!v.scope||v.scope(s)));let c=i,u=cje(e)||dk.empty,p=sje(o,u.tags);if(p&&(c&&(c+=" "),c+=p,u.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(r,a),c),u.opaque)return;let m=e.tree&&e.tree.prop(Dt.mounted);if(m&&m.overlay){let v=e.node.enter(m.overlay[0].from+a,1),b=this.highlighters.filter(x=>!x.scope||x.scope(m.tree.type)),O=e.firstChild();for(let x=0,S=a;;x++){let w=x<m.overlay.length?m.overlay[x]:null,k=w?w.from+a:l,P=Math.max(r,S),_=Math.min(n,k);if(P<_&&O)for(;e.from<_&&(this.highlightRange(e,P,_,i,o),this.startSpan(Math.min(_,e.to),c),!(e.to>=k||!e.nextSibling())););if(!w||k>n)break;S=w.to+a,S>r&&(this.highlightRange(v.cursor(),Math.max(r,w.from+a),Math.min(n,S),"",b),this.startSpan(Math.min(n,S),c))}O&&e.parent()}else if(e.firstChild()){m&&(i="");do if(!(e.to<=r)){if(e.from>=n)break;this.highlightRange(e,r,n,i,o),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function cje(t){let e=t.type.prop(kee);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Xe=Gs.define,Kw=Xe(),Od=Xe(),mB=Xe(Od),vB=Xe(Od),xd=Xe(),Jw=Xe(xd),dI=Xe(xd),Ul=Xe(),Wh=Xe(Ul),Bl=Xe(),zl=Xe(),d$=Xe(),Vy=Xe(d$),e1=Xe(),g={comment:Kw,lineComment:Xe(Kw),blockComment:Xe(Kw),docComment:Xe(Kw),name:Od,variableName:Xe(Od),typeName:mB,tagName:Xe(mB),propertyName:vB,attributeName:Xe(vB),className:Xe(Od),labelName:Xe(Od),namespace:Xe(Od),macroName:Xe(Od),literal:xd,string:Jw,docString:Xe(Jw),character:Xe(Jw),attributeValue:Xe(Jw),number:dI,integer:Xe(dI),float:Xe(dI),bool:Xe(xd),regexp:Xe(xd),escape:Xe(xd),color:Xe(xd),url:Xe(xd),keyword:Bl,self:Xe(Bl),null:Xe(Bl),atom:Xe(Bl),unit:Xe(Bl),modifier:Xe(Bl),operatorKeyword:Xe(Bl),controlKeyword:Xe(Bl),definitionKeyword:Xe(Bl),moduleKeyword:Xe(Bl),operator:zl,derefOperator:Xe(zl),arithmeticOperator:Xe(zl),logicOperator:Xe(zl),bitwiseOperator:Xe(zl),compareOperator:Xe(zl),updateOperator:Xe(zl),definitionOperator:Xe(zl),typeOperator:Xe(zl),controlOperator:Xe(zl),punctuation:d$,separator:Xe(d$),bracket:Vy,angleBracket:Xe(Vy),squareBracket:Xe(Vy),paren:Xe(Vy),brace:Xe(Vy),content:Ul,heading:Wh,heading1:Xe(Wh),heading2:Xe(Wh),heading3:Xe(Wh),heading4:Xe(Wh),heading5:Xe(Wh),heading6:Xe(Wh),contentSeparator:Xe(Ul),list:Xe(Ul),quote:Xe(Ul),emphasis:Xe(Ul),strong:Xe(Ul),link:Xe(Ul),monospace:Xe(Ul),strikethrough:Xe(Ul),inserted:Xe(),deleted:Xe(),changed:Xe(),invalid:Xe(),meta:e1,documentMeta:Xe(e1),annotation:Xe(e1),processingInstruction:Xe(e1),definition:Gs.defineModifier("definition"),constant:Gs.defineModifier("constant"),function:Gs.defineModifier("function"),standard:Gs.defineModifier("standard"),local:Gs.defineModifier("local"),special:Gs.defineModifier("special")};for(let t in g){let e=g[t];e instanceof Gs&&(e.name=t)}Pee([{tag:g.link,class:"tok-link"},{tag:g.heading,class:"tok-heading"},{tag:g.emphasis,class:"tok-emphasis"},{tag:g.strong,class:"tok-strong"},{tag:g.keyword,class:"tok-keyword"},{tag:g.atom,class:"tok-atom"},{tag:g.bool,class:"tok-bool"},{tag:g.url,class:"tok-url"},{tag:g.labelName,class:"tok-labelName"},{tag:g.inserted,class:"tok-inserted"},{tag:g.deleted,class:"tok-deleted"},{tag:g.literal,class:"tok-literal"},{tag:g.string,class:"tok-string"},{tag:g.number,class:"tok-number"},{tag:[g.regexp,g.escape,g.special(g.string)],class:"tok-string2"},{tag:g.variableName,class:"tok-variableName"},{tag:g.local(g.variableName),class:"tok-variableName tok-local"},{tag:g.definition(g.variableName),class:"tok-variableName tok-definition"},{tag:g.special(g.variableName),class:"tok-variableName2"},{tag:g.definition(g.propertyName),class:"tok-propertyName tok-definition"},{tag:g.typeName,class:"tok-typeName"},{tag:g.namespace,class:"tok-namespace"},{tag:g.className,class:"tok-className"},{tag:g.macroName,class:"tok-macroName"},{tag:g.propertyName,class:"tok-propertyName"},{tag:g.operator,class:"tok-operator"},{tag:g.comment,class:"tok-comment"},{tag:g.meta,class:"tok-meta"},{tag:g.invalid,class:"tok-invalid"},{tag:g.punctuation,class:"tok-punctuation"}]);let h$=[],_ee=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,r=0;e<t.length;e++)(e%2?_ee:h$).push(r=r+t[e])})();function uje(t){if(t<768)return!1;for(let e=0,r=h$.length;;){let n=e+r>>1;if(t<h$[n])r=n;else if(t>=_ee[n])e=n+1;else return!0;if(e==r)return!1}}function yB(t){return t>=127462&&t<=127487}const bB=8205;function dje(t,e,r=!0,n=!0){return(r?Tee:hje)(t,e,n)}function Tee(t,e,r){if(e==t.length)return e;e&&Eee(t.charCodeAt(e))&&Ree(t.charCodeAt(e-1))&&e--;let n=hI(t,e);for(e+=OB(n);e<t.length;){let i=hI(t,e);if(n==bB||i==bB||r&&uje(i))e+=OB(i),n=i;else if(yB(i)){let o=0,s=e-2;for(;s>=0&&yB(hI(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function hje(t,e,r){for(;e>0;){let n=Tee(t,e-2,r);if(n<e)return n;e--}return 0}function hI(t,e){let r=t.charCodeAt(e);if(!Ree(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return Eee(n)?(r-55296<<10)+(n-56320)+65536:r}function Eee(t){return t>=56320&&t<57344}function Ree(t){return t>=55296&&t<56320}function OB(t){return t<65536?1:2}class mr{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,r,n){[e,r]=wm(this,e,r);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(r,this.length,i,1),Kl.from(i,this.length-(r-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,r=this.length){[e,r]=wm(this,e,r);let n=[];return this.decompose(e,r,n,0),Kl.from(n,r-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let r=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new D0(this),o=new D0(e);for(let s=r,a=r;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=n)return!0}}iter(e=1){return new D0(this,e)}iterRange(e,r=this.length){return new Iee(this,e,r)}iterLines(e,r){let n;if(e==null)n=this.iter();else{r==null&&(r=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new jee(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?mr.empty:e.length<=32?new ui(e):Kl.from(ui.split(e,[]))}}class ui extends mr{constructor(e,r=fje(e)){super(),this.text=e,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(e,r,n,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((r?n:a)>=e)return new pje(i,a,n,s);i=a+1,n++}}decompose(e,r,n,i){let o=e<=0&&r>=this.length?this:new ui(xB(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),a=lC(o.text,s.text.slice(),0,o.length);if(a.length<=32)n.push(new ui(a,s.length+o.length));else{let l=a.length>>1;n.push(new ui(a.slice(0,l)),new ui(a.slice(l)))}}else n.push(o)}replace(e,r,n){if(!(n instanceof ui))return super.replace(e,r,n);[e,r]=wm(this,e,r);let i=lC(this.text,lC(n.text,xB(this.text,0,e)),r),o=this.length+n.length-(r-e);return i.length<=32?new ui(i,o):Kl.from(ui.split(i,[]),o)}sliceString(e,r=this.length,n=`
|
|
75
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||a$.set(i,s=new Set),s.add(o),e.has(o)||(e.add(o),r.push(n))}else r.push(n)}),pe(pe({},t),{definitions:r})}function ZRe(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var o=n[i];o&&typeof o=="object"&&e.add(o)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function YRe(t){var e=WJ(t);if(!oC.has(e)){var r=LK(t,{experimentalFragmentVariables:nk,allowLegacyFragmentVariables:nk});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");oC.set(e,ZRe(XRe(r)))}return oC.get(e)}function Se(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,o){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[o+1]}),YRe(n)}function KRe(){oC.clear(),a$.clear()}function JRe(){qJ=!1}function eIe(){nk=!0}function tIe(){nk=!1}var Ly={gql:Se,resetCaches:KRe,disableFragmentWarnings:JRe,enableExperimentalFragmentVariables:eIe,disableExperimentalFragmentVariables:tIe};(function(t){t.gql=Ly.gql,t.resetCaches=Ly.resetCaches,t.disableFragmentWarnings=Ly.disableFragmentWarnings,t.enableExperimentalFragmentVariables=Ly.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=Ly.disableExperimentalFragmentVariables})(Se||(Se={}));Se.default=Se;var uI={exports:{}},tB;function rIe(){return tB||(tB=1,function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,OO())}(uI)),uI.exports}var Bd=rIe();const nIe=ch(Bd),iIe=mP({__proto__:null,default:nIe},[Bd]);var rB=UM?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function oIe(){Je("createContext"in iIe,69);var t=Bd.createContext[rB];return t||(Object.defineProperty(Bd.createContext,rB,{value:t=Bd.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var sIe=function(t){var e=t.client,r=t.children,n=oIe(),i=Bd.useContext(n),o=Bd.useMemo(function(){return pe(pe({},i),{client:e||i.client})},[i,e]);return Je(o.client,71),Bd.createElement(n.Provider,{value:o},r)};function aIe(t){return new $u(function(e,r){var n=fc(e,[]);return new Wr(function(i){var o,s=!1;return Promise.resolve(n).then(function(a){return t(a,e.getContext())}).then(e.setContext).then(function(){s||(o=r(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){s=!0,o&&o.unsubscribe()}})})}function UJ(t){return new $u(function(e,r){return new Wr(function(n){var i,o,s;try{i=r(e).subscribe({next:function(a){if(a.errors?s=t({graphQLErrors:a.errors,response:a,operation:e,forward:r}):yJ(a)&&(s=t({protocolErrors:a.extensions[g_],response:a,operation:e,forward:r})),s){o=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(a)},error:function(a){if(s=t({operation:e,networkError:a,graphQLErrors:a&&a.result&&a.result.errors||void 0,forward:r}),s){o=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(a)},complete:function(){s||n.complete.bind(n)()}})}catch(a){t({networkError:a,operation:e,forward:r}),n.error(a)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}})})}(function(t){Tl(e,t);function e(r){var n=t.call(this)||this;return n.link=UJ(r),n}return e.prototype.request=function(r,n){return this.link.request(r,n)},e})($u);const lIe={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"a606396",MODE:"production",PACKAGE_VERSION:"2.1.0-alpha.7",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1},cIe=t=>{const e=window.__env__?.[t],r=lIe[t];return e||r},m_="/",lD="sandbox",eh="login",HJ="logout",v_="signup",GJ="username",XJ="github",ZJ="google",uIe="get-mcp-token",YJ="completed",dIe="confirm",Td="app",Ed=":organizationId",Rd=":projectName",KJ="-/settings",JJ="-/users",hIe="-/api-keys",eee="-/mcp",y_=":branchName",kb="-/changes",ik="-/migrations",tee="-/endpoints",b_=":revisionIdOrTag",ok=":tableId",ree=":rowId",zo="draft",th="head";var rn=(t=>(t.Organization="organization",t.Project="project",t.Branch="branch",t.Revision="revision",t.Table="table",t.Row="row",t.Changes="changes",t.Migrations="migrations",t.Endpoints="endpoints",t.ProjectSettings="projectSettings",t.ProjectUsers="projectUsers",t.ProjectApiKeys="projectApiKeys",t.ProjectMcp="projectMcp",t))(rn||{});const Mi=({hideSidebar:t,sidebar:e,title:r,actions:n,children:i})=>h.jsxs(ee,{minHeight:"100vh",children:[!t&&h.jsxs(ee,{borderRight:"1px solid",borderRightColor:"newGray.100",flexDirection:"column",justifyContent:e?"space-between":"flex-end",padding:"16px",width:"288px",minWidth:"288px",flexShrink:0,height:"100vh",top:0,position:"sticky",children:[e,h.jsx(z,{alignSelf:"center",mt:"1rem",children:h.jsx(Ki,{to:`/${HJ}`,style:{color:"#A0AEC0",textDecoration:"none"},children:"Logout"})})]}),h.jsxs(ee,{alignItems:"center",flex:1,flexDirection:"column",width:"100%",children:[(r||n)&&h.jsxs(ee,{alignItems:"center",backgroundColor:"white",borderBottom:"1px solid",borderBottomColor:"gray.50",justifyContent:"space-between",maxWidth:"900px",padding:"8px",width:"100%",position:"sticky",zIndex:1,top:0,children:[r,n]}),h.jsx(ee,{flex:1,flexDirection:"column",maxWidth:"900px",padding:"1rem 1rem 0rem 1rem",width:"100%",children:i})]})]});var nee={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},nB=qe.createContext&&qe.createContext(nee),fIe=["attr","size","title"];function pIe(t,e){if(t==null)return{};var r=gIe(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function gIe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function sk(){return sk=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sk.apply(this,arguments)}function iB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ak(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iB(Object(r),!0).forEach(function(n){mIe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mIe(t,e,r){return e=vIe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vIe(t){var e=yIe(t,"string");return typeof e=="symbol"?e:e+""}function yIe(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iee(t){return t&&t.map((e,r)=>qe.createElement(e.tag,ak({key:r},e.attr),iee(e.child)))}function Ke(t){return e=>qe.createElement(bIe,sk({attr:ak({},t.attr)},e),iee(t.child))}function bIe(t){var e=r=>{var{attr:n,size:i,title:o}=t,s=pIe(t,fIe),a=i||r.size||"1em",l;return r.className&&(l=r.className),t.className&&(l=(l?l+" ":"")+t.className),qe.createElement("svg",sk({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,s,{className:l,style:ak(ak({color:t.color||r.color},r.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&qe.createElement("title",null,o),t.children)};return nB!==void 0?qe.createElement(nB.Consumer,null,r=>e(r)):e(nee)}function cD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"},child:[]}]})(t)}function oee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"},child:[]}]})(t)}function uD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"},child:[]}]})(t)}function OIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z"},child:[]}]})(t)}function see(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"},child:[]}]})(t)}function xIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"},child:[]}]})(t)}function dD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"},child:[]}]})(t)}function Ov(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"},child:[]}]})(t)}function hD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M156,128a28,28,0,1,1-28-28A28,28,0,0,1,156,128Z"},child:[]}]})(t)}function aee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z"},child:[]}]})(t)}function lee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm0,184A80,80,0,1,1,181.34,68.37a8,8,0,0,1-10.67,11.92A64,64,0,1,0,191.5,136H128a8,8,0,0,1,0-16h72a8,8,0,0,1,8,8A80.09,80.09,0,0,1,128,208Z"},child:[]}]})(t)}function wIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM148.24,92.24,112.49,128l35.75,35.76a6,6,0,1,1-8.48,8.48l-40-40a6,6,0,0,1,0-8.48l40-40a6,6,0,0,1,8.48,8.48Z"},child:[]}]})(t)}function O_(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"},child:[]}]})(t)}function Xg(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"},child:[]}]})(t)}function Zg(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"},child:[]}]})(t)}function SIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,26C75.29,26,34,49.72,34,80v96c0,30.28,41.29,54,94,54s94-23.72,94-54V80C222,49.72,180.71,26,128,26Zm0,12c44.45,0,82,19.23,82,42s-37.55,42-82,42S46,102.77,46,80,83.55,38,128,38Zm82,138c0,22.77-37.55,42-82,42s-82-19.23-82-42V154.79C62,171.16,92.37,182,128,182s66-10.84,82-27.21Zm0-48c0,22.77-37.55,42-82,42s-82-19.23-82-42V106.79C62,123.16,92.37,134,128,134s66-10.84,82-27.21Z"},child:[]}]})(t)}function CIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Zm-34-82a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,136Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,168Z"},child:[]}]})(t)}function kIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,82a46,46,0,1,0,46,46A46.06,46.06,0,0,0,128,82Zm0,80a34,34,0,1,1,34-34A34,34,0,0,1,128,162ZM214,130.84c.06-1.89.06-3.79,0-5.68L229.33,106a6,6,0,0,0,1.11-5.29A105.34,105.34,0,0,0,219.76,74.9a6,6,0,0,0-4.53-3l-24.45-2.71q-1.93-2.07-4-4l-2.72-24.46a6,6,0,0,0-3-4.53,105.65,105.65,0,0,0-25.77-10.66A6,6,0,0,0,150,26.68l-19.2,15.37c-1.89-.06-3.79-.06-5.68,0L106,26.67a6,6,0,0,0-5.29-1.11A105.34,105.34,0,0,0,74.9,36.24a6,6,0,0,0-3,4.53L69.23,65.22q-2.07,1.94-4,4L40.76,72a6,6,0,0,0-4.53,3,105.65,105.65,0,0,0-10.66,25.77A6,6,0,0,0,26.68,106l15.37,19.2c-.06,1.89-.06,3.79,0,5.68L26.67,150.05a6,6,0,0,0-1.11,5.29A105.34,105.34,0,0,0,36.24,181.1a6,6,0,0,0,4.53,3l24.45,2.71q1.94,2.07,4,4L72,215.24a6,6,0,0,0,3,4.53,105.65,105.65,0,0,0,25.77,10.66,6,6,0,0,0,5.29-1.11L125.16,214c1.89.06,3.79.06,5.68,0l19.21,15.38a6,6,0,0,0,3.75,1.31,6.2,6.2,0,0,0,1.54-.2,105.34,105.34,0,0,0,25.76-10.68,6,6,0,0,0,3-4.53l2.71-24.45q2.07-1.93,4-4l24.46-2.72a6,6,0,0,0,4.53-3,105.49,105.49,0,0,0,10.66-25.77,6,6,0,0,0-1.11-5.29Zm-3.1,41.63-23.64,2.63a6,6,0,0,0-3.82,2,75.14,75.14,0,0,1-6.31,6.31,6,6,0,0,0-2,3.82l-2.63,23.63A94.28,94.28,0,0,1,155.14,218l-18.57-14.86a6,6,0,0,0-3.75-1.31h-.36a78.07,78.07,0,0,1-8.92,0,6,6,0,0,0-4.11,1.3L100.87,218a94.13,94.13,0,0,1-17.34-7.17L80.9,187.21a6,6,0,0,0-2-3.82,75.14,75.14,0,0,1-6.31-6.31,6,6,0,0,0-3.82-2l-23.63-2.63A94.28,94.28,0,0,1,38,155.14l14.86-18.57a6,6,0,0,0,1.3-4.11,78.07,78.07,0,0,1,0-8.92,6,6,0,0,0-1.3-4.11L38,100.87a94.13,94.13,0,0,1,7.17-17.34L68.79,80.9a6,6,0,0,0,3.82-2,75.14,75.14,0,0,1,6.31-6.31,6,6,0,0,0,2-3.82l2.63-23.63A94.28,94.28,0,0,1,100.86,38l18.57,14.86a6,6,0,0,0,4.11,1.3,78.07,78.07,0,0,1,8.92,0,6,6,0,0,0,4.11-1.3L155.13,38a94.13,94.13,0,0,1,17.34,7.17l2.63,23.64a6,6,0,0,0,2,3.82,75.14,75.14,0,0,1,6.31,6.31,6,6,0,0,0,3.82,2l23.63,2.63A94.28,94.28,0,0,1,218,100.86l-14.86,18.57a6,6,0,0,0-1.3,4.11,78.07,78.07,0,0,1,0,8.92,6,6,0,0,0,1.3,4.11L218,155.13A94.13,94.13,0,0,1,210.85,172.47Z"},child:[]}]})(t)}function cee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"},child:[]}]})(t)}function l$(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236.24,67.76a6,6,0,0,0-8.48,0L192,103.51,152.49,64l35.75-35.76a6,6,0,0,0-8.48-8.48L144,55.51,116.24,27.76a6,6,0,1,0-8.48,8.48L115.51,44,61.13,98.38a38,38,0,0,0,0,53.75l17.13,17.12-50.5,50.51a6,6,0,1,0,8.48,8.48l50.51-50.5,17.13,17.13a38,38,0,0,0,53.74,0L212,140.49l7.76,7.75a6,6,0,0,0,8.48-8.48L200.49,112l35.75-35.76A6,6,0,0,0,236.24,67.76ZM149.13,186.38a26,26,0,0,1-36.77,0L69.62,143.64a26,26,0,0,1,0-36.77L124,52.49,203.51,132Z"},child:[]}]})(t)}function lk(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"},child:[]}]})(t)}function PIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M200,50H134V16a6,6,0,0,0-12,0V50H56A30,30,0,0,0,26,80V192a30,30,0,0,0,30,30H200a30,30,0,0,0,30-30V80A30,30,0,0,0,200,50Zm18,142a18,18,0,0,1-18,18H56a18,18,0,0,1-18-18V80A18,18,0,0,1,56,62H200a18,18,0,0,1,18,18ZM74,108a10,10,0,1,1,10,10A10,10,0,0,1,74,108Zm88,0a10,10,0,1,1,10,10A10,10,0,0,1,162,108Zm2,30H92a26,26,0,0,0,0,52h72a26,26,0,0,0,0-52Zm-22,12v28H114V150ZM78,164a14,14,0,0,1,14-14h10v28H92A14,14,0,0,1,78,164Zm86,14H154V150h10a14,14,0,0,1,0,28Z"},child:[]}]})(t)}function _Ie(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236.24,179.76a6,6,0,0,1,0,8.48l-24,24a6,6,0,0,1-8.48-8.48L217.52,190H200.94a70.16,70.16,0,0,1-57-29.31l-41.71-58.4A58.11,58.11,0,0,0,55.06,78H32a6,6,0,0,1,0-12H55.06a70.16,70.16,0,0,1,57,29.31l41.71,58.4A58.11,58.11,0,0,0,200.94,178h16.58l-13.76-13.76a6,6,0,0,1,8.48-8.48Zm-92.06-74.41a5.91,5.91,0,0,0,3.48,1.12,6,6,0,0,0,4.89-2.51l1.19-1.67A58.11,58.11,0,0,1,200.94,78h16.58L203.76,91.76a6,6,0,1,0,8.48,8.48l24-24a6,6,0,0,0,0-8.48l-24-24a6,6,0,0,0-8.48,8.48L217.52,66H200.94a70.16,70.16,0,0,0-57,29.31L142.78,97A6,6,0,0,0,144.18,105.35Zm-32.36,45.3a6,6,0,0,0-8.37,1.39l-1.19,1.67A58.11,58.11,0,0,1,55.06,178H32a6,6,0,0,0,0,12H55.06a70.16,70.16,0,0,0,57-29.31l1.19-1.67A6,6,0,0,0,111.82,150.65Z"},child:[]}]})(t)}function uee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"},child:[]}]})(t)}function dee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"},child:[]}]})(t)}function hee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M112.6,158.43a58,58,0,1,0-57.2,0A93.83,93.83,0,0,0,5.21,196.72a6,6,0,0,0,10.05,6.56,82,82,0,0,1,137.48,0,6,6,0,0,0,10-6.56A93.83,93.83,0,0,0,112.6,158.43ZM38,108a46,46,0,1,1,46,46A46.06,46.06,0,0,1,38,108Zm211,97a6,6,0,0,1-8.3-1.74A81.8,81.8,0,0,0,172,166a6,6,0,0,1,0-12,46,46,0,1,0-17.08-88.73,6,6,0,1,1-4.46-11.14,58,58,0,0,1,50.14,104.3,93.83,93.83,0,0,1,50.19,38.29A6,6,0,0,1,249,205Z"},child:[]}]})(t)}function TIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"},child:[]}]})(t)}function EIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Zm-96-88v64a8,8,0,0,1-16,0V132.94l-4.42,2.22a8,8,0,0,1-7.16-14.32l16-8A8,8,0,0,1,112,120Zm59.16,30.45L152,176h16a8,8,0,0,1,0,16H136a8,8,0,0,1-6.4-12.8l28.78-38.37A8,8,0,1,0,145.07,132a8,8,0,1,1-13.85-8A24,24,0,0,1,176,136,23.76,23.76,0,0,1,171.16,150.45Z"},child:[]}]})(t)}function RIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"},child:[]}]})(t)}function fee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34ZM224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48ZM208,208V48H48V208H208Z"},child:[]}]})(t)}function fD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"},child:[]}]})(t)}function IIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M53.92,34.62A8,8,0,1,0,42.08,45.38L61.32,66.55C25,88.84,9.38,123.2,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208a127.11,127.11,0,0,0,52.07-10.83l22,24.21a8,8,0,1,0,11.84-10.76Zm47.33,75.84,41.67,45.85a32,32,0,0,1-41.67-45.85ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.16,133.16,0,0,1,25,128c4.69-8.79,19.66-33.39,47.35-49.38l18,19.75a48,48,0,0,0,63.66,70l14.73,16.2A112,112,0,0,1,128,192Zm6-95.43a8,8,0,0,1,3-15.72,48.16,48.16,0,0,1,38.77,42.64,8,8,0,0,1-7.22,8.71,6.39,6.39,0,0,1-.75,0,8,8,0,0,1-8-7.26A32.09,32.09,0,0,0,134,96.57Zm113.28,34.69c-.42.94-10.55,23.37-33.36,43.8a8,8,0,1,1-10.67-11.92A132.77,132.77,0,0,0,231.05,128a133.15,133.15,0,0,0-23.12-30.77C185.67,75.19,158.78,64,128,64a118.37,118.37,0,0,0-19.36,1.57A8,8,0,1,1,106,49.79,134,134,0,0,1,128,48c34.88,0,66.57,13.26,91.66,38.35,18.83,18.83,27.3,37.62,27.65,38.41A8,8,0,0,1,247.31,131.26Z"},child:[]}]})(t)}function Yg(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"},child:[]}]})(t)}function x_(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"},child:[]}]})(t)}function pee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"},child:[]}]})(t)}function gee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"},child:[]}]})(t)}function mee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"},child:[]}]})(t)}function w_(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"},child:[]}]})(t)}function jIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"},child:[]}]})(t)}function KO(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"},child:[]}]})(t)}function $Ie(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M208,36H48A12,12,0,0,0,36,48V208a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V48A12,12,0,0,0,208,36Zm4,172a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM164,96v48a4,4,0,0,1-8,0V105.66L98.83,162.83a4,4,0,0,1-5.66-5.66L150.34,100H112a4,4,0,0,1,0-8h48A4,4,0,0,1,164,96Z"},child:[]}]})(t)}function vee(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M35.89,128C52,136.23,52,155.64,52,172c0,24.8,1.35,40,28,40a4,4,0,0,1,0,8c-36,0-36-26.61-36-48,0-24.8-1.35-40-28-40a4,4,0,0,1,0-8c26.65,0,28-15.2,28-40,0-21.39,0-48,36-48a4,4,0,0,1,0,8C53.35,44,52,59.2,52,84,52,100.36,52,119.77,35.89,128ZM240,124c-26.65,0-28-15.2-28-40,0-21.39,0-48-36-48a4,4,0,0,0,0,8c26.65,0,28,15.2,28,40,0,16.36,0,35.77,16.11,44C204,136.23,204,155.64,204,172c0,24.8-1.35,40-28,40a4,4,0,0,0,0,8c36,0,36-26.61,36-48,0-24.8,1.35-40,28-40a4,4,0,0,0,0-8Z"},child:[]}]})(t)}function AIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"},child:[]}]})(t)}function NIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z"},child:[]}]})(t)}function MIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z"},child:[]}]})(t)}function DIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M146.83,141.17a4,4,0,0,0-5.66,0L120,162.34,93.66,136l21.17-21.17a4,4,0,0,0-5.66-5.66L88,130.34,66.83,109.17a4,4,0,0,0-5.66,5.66L70.34,124,44.2,150.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L58.06,203.6l8.2,8.2a28,28,0,0,0,39.6,0L132,185.66l9.17,9.17a4,4,0,0,0,5.66-5.66L125.66,168l21.17-21.17A4,4,0,0,0,146.83,141.17Zm-46.63,65a20,20,0,0,1-28.28,0L49.86,184.08a20,20,0,0,1,0-28.28L76,129.66,126.34,180Zm134.63-185a4,4,0,0,0-5.66,0L197.94,52.4l-8.2-8.2a28,28,0,0,0-39.6,0L124,70.34l-9.17-9.17a4,4,0,0,0-5.66,5.66l80,80a4,4,0,0,0,5.66-5.66L185.66,132l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,31.23-31.23A4,4,0,0,0,234.83,21.17ZM212,86.06a19.86,19.86,0,0,1-5.86,14.14L180,126.34,129.66,76,155.8,49.86a20,20,0,0,1,28.28,0l22.06,22.06A19.85,19.85,0,0,1,212,86.06Z"},child:[]}]})(t)}function LIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M234.83,109.17l-80-80A4,4,0,0,0,148,32V76.09c-54,2.44-120.43,53.55-127.94,119a7.87,7.87,0,0,0,4.58,8.16,8,8,0,0,0,3.41.77,7.9,7.9,0,0,0,5.79-2.55h0c11.53-12.27,53.29-51.73,114.16-53.4V192a4,4,0,0,0,6.83,2.83l80-80A4,4,0,0,0,234.83,109.17ZM156,182.33V144a4,4,0,0,0-4-4c-27.39,0-54.08,7.17-79.34,21.3A189.91,189.91,0,0,0,28,196l2.92,2.74L28,196c3.36-29.21,19.55-57.48,45.6-79.57C97.53,96.11,126.83,84,152,84a4,4,0,0,0,4-4V41.66L226.34,112Z"},child:[]}]})(t)}function VIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52ZM36,108H84v40H36Zm56,0H220v40H92ZM220,60v40H36V60ZM36,192V156H84v40H40A4,4,0,0,1,36,192Zm180,4H92V156H220v36A4,4,0,0,1,216,196Z"},child:[]}]})(t)}function FIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M176,148h32a12,12,0,0,0,12-12V104a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H84V76H96a12,12,0,0,0,12-12V32A12,12,0,0,0,96,20H64A12,12,0,0,0,52,32V64A12,12,0,0,0,64,76H76V192a20,20,0,0,0,20,20h68v12a12,12,0,0,0,12,12h32a12,12,0,0,0,12-12V192a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H96a12,12,0,0,1-12-12V124h80v12A12,12,0,0,0,176,148ZM60,64V32a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4V64a4,4,0,0,1-4,4H64A4,4,0,0,1,60,64ZM172,192a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Zm0-88a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Z"},child:[]}]})(t)}function QIe(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M236,136v64a12,12,0,0,1-12,12H32a12,12,0,0,1-12-12V136a12,12,0,0,1,12-12H80a4,4,0,0,1,0,8H32a4,4,0,0,0-4,4v64a4,4,0,0,0,4,4H224a4,4,0,0,0,4-4V136a4,4,0,0,0-4-4H176a4,4,0,0,1,0-8h48A12,12,0,0,1,236,136ZM82.83,74.83,124,33.66V128a4,4,0,0,0,8,0V33.66l41.17,41.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66ZM196,168a8,8,0,1,0-8,8A8,8,0,0,0,196,168Z"},child:[]}]})(t)}function pD(t){return Ke({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"},child:[]}]})(t)}const ea=({height:t="2.5rem",title:e,onClick:r,disabled:n,isSelected:i,isLoading:o,icon:s,dataTestId:a})=>h.jsx(It,{"data-testid":a,_hover:{color:"gray.400",backgroundColor:"white"},_disabled:i?{backgroundColor:"gray.50",cursor:"not-allowed"}:void 0,alignSelf:"flex-start",color:"gray.300",fontWeight:"500",fontSize:16,height:t,disabled:n||i,loading:o,variant:"ghost",onClick:r,children:h.jsxs(ee,{alignItems:"center",gap:"0.5rem",children:[s&&h.jsx(z,{fontSize:"sm",children:s}),h.jsx(Y,{children:e})]})}),S_=t=>h.jsx(ea,{...t,icon:h.jsx(dD,{})}),JO=({height:t="2.5rem",loading:e,isDisabled:r,onClick:n,title:i,dataTestId:o})=>h.jsxs(It,{"data-testid":o,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:t,loading:e,disabled:r,variant:"ghost",onClick:n,width:"48px",children:[h.jsx(lu,{size:"sm",mr:i?8:0,children:h.jsx(uD,{})}),i]}),C_=({height:t="2.5rem",onClick:e,disabled:r,dataTestId:n})=>h.jsx(It,{"data-testid":n,disabled:r,_hover:{backgroundColor:"gray.50"},alignSelf:"flex-start",color:"gray.400",height:t,variant:"ghost",onClick:e,width:"48px",children:h.jsx(lu,{size:"md",children:h.jsx(KO,{})})}),yee=({dataTestId:t,...e})=>h.jsx(Ir,{"data-testid":t,_hover:{backgroundColor:"gray.100"},color:"gray.400",variant:"ghost",size:"lg",width:"40px",height:"40px",...e,children:h.jsx(see,{})}),BIe=({dataTestId:t,...e})=>h.jsx(Ir,{"data-testid":t,_hover:{backgroundColor:"gray.50"},color:"gray.400",variant:"ghost",size:"sm",...e,children:h.jsx(x_,{})}),hu=({value:t,placeholder:e,autoFocus:r,onChange:n,onBlur:i,onEnter:o,width:s,height:a,type:l,dataTestId:c,autoComplete:u})=>{const p=I6e();return h.jsx(hs,{autoComplete:u,"data-testid":c,borderColor:"gray.100",padding:"0 9px",placeholder:e,ref:r?p:void 0,value:t,variant:"outline",onChange:n,onBlur:i,width:s,height:a,type:l,onKeyDown:o?m=>{m.key==="Enter"&&o()}:void 0})},Ur=LX({placement:"top",pauseOnPageIdle:!0,duration:1500}),sC=LX({placement:"bottom",pauseOnPageIdle:!0,duration:1500}),oB=t=>h.jsxs(PSe,{width:{md:"sm"},children:[t.type==="loading"?h.jsx(ri,{size:"sm",color:"blue.solid"}):h.jsx(jSe,{}),h.jsxs(WP,{gap:"1",flex:"1",maxWidth:"100%",children:[t.title&&h.jsx(TSe,{children:t.title}),t.description&&h.jsx(ESe,{color:"gray.500",children:t.description})]}),t.action&&h.jsx(RSe,{children:t.action.label}),t.closable&&h.jsx(_Se,{})]}),sB=()=>h.jsxs(Lt,{children:[h.jsx(mQ,{toaster:Ur,insetInline:{mdDown:"4"},children:t=>h.jsx(oB,{...t})}),h.jsx(mQ,{toaster:sC,insetInline:{mdDown:"4"},children:t=>h.jsx(oB,{...t})})]}),Di=E.forwardRef(function(e,r){const{showArrow:n,children:i,disabled:o,portalled:s=!0,content:a,contentProps:l,portalRef:c,...u}=e;return o?i:h.jsxs($Se,{...u,children:[h.jsx(ASe,{asChild:!0,children:i}),h.jsx(Lt,{disabled:!s,container:c,children:h.jsx(NSe,{children:h.jsxs(MSe,{ref:r,...l,children:[n&&h.jsx(DSe,{children:h.jsx(tY,{})}),a]})})})]})}),bee=1024;let zIe=0,Pa=class{constructor(e,r){this.from=e,this.to=r}};class Dt{constructor(e={}){this.id=zIe++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Li.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}Dt.closedBy=new Dt({deserialize:t=>t.split(" ")});Dt.openedBy=new Dt({deserialize:t=>t.split(" ")});Dt.group=new Dt({deserialize:t=>t.split(" ")});Dt.isolate=new Dt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Dt.contextHash=new Dt({perNode:!0});Dt.lookAhead=new Dt({perNode:!0});Dt.mounted=new Dt({perNode:!0});class Pb{constructor(e,r,n){this.tree=e,this.overlay=r,this.parser=n}static get(e){return e&&e.props&&e.props[Dt.mounted.id]}}const qIe=Object.create(null);class Li{constructor(e,r,n,i=0){this.name=e,this.props=r,this.id=n,this.flags=i}static define(e){let r=e.props&&e.props.length?Object.create(null):qIe,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Li(e.name||"",r,e.id,n);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let r=this.prop(Dt.group);return r?r.indexOf(e)>-1:!1}return this.id==e}static match(e){let r=Object.create(null);for(let n in e)for(let i of n.split(" "))r[i]=e[n];return n=>{for(let i=n.prop(Dt.group),o=-1;o<(i?i.length:0);o++){let s=r[o<0?n.name:i[o]];if(s)return s}}}}Li.none=new Li("",Object.create(null),0,8);class ex{constructor(e){this.types=e;for(let r=0;r<e.length;r++)if(e[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let r=[];for(let n of this.types){let i=null;for(let o of e){let s=o(n);s&&(i||(i=Object.assign({},n.props)),i[s[0].id]=s[1])}r.push(i?new Li(n.name,i,n.id,n.flags):n)}return new ex(r)}}const Yw=new WeakMap,aB=new WeakMap;var xn;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(xn||(xn={}));class Lr{constructor(e,r,n,i,o){if(this.type=e,this.children=r,this.positions=n,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=Pb.get(this);if(e&&!e.overlay)return e.tree.toString();let r="";for(let n of this.children){let i=n.toString();i&&(r&&(r+=","),r+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(e=0){return new ck(this.topNode,e)}cursorAt(e,r=0,n=0){let i=Yw.get(this)||this.topNode,o=new ck(i);return o.moveTo(e,r),Yw.set(this,o._tree),o}get topNode(){return new jo(this,0,0,null)}resolve(e,r=0){let n=_b(Yw.get(this)||this.topNode,e,r,!1);return Yw.set(this,n),n}resolveInner(e,r=0){let n=_b(aB.get(this)||this.topNode,e,r,!0);return aB.set(this,n),n}resolveStack(e,r=0){return HIe(this,e,r)}iterate(e){let{enter:r,leave:n,from:i=0,to:o=this.length}=e,s=e.mode||0,a=(s&xn.IncludeAnonymous)>0;for(let l=this.cursor(s|xn.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&n&&(a||!l.type.isAnonymous)&&n(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let r in this.props)e.push([+r,this.props[r]]);return e}balance(e={}){return this.children.length<=8?this:vD(Li.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new Lr(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new Lr(Li.none,r,n,i)))}static build(e){return GIe(e)}}Lr.empty=new Lr(Li.none,[],[],0);class gD{constructor(e,r){this.buffer=e,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new gD(this.buffer,this.index)}}class rh{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return Li.none}toString(){let e=[];for(let r=0;r<this.buffer.length;)e.push(this.childString(r)),r=this.buffer[r+3];return e.join(",")}childString(e){let r=this.buffer[e],n=this.buffer[e+3],i=this.set.types[r],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,n==e)return o;let s=[];for(;e<n;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,r,n,i,o){let{buffer:s}=this,a=-1;for(let l=e;l!=r&&!(Oee(o,i,s[l+1],s[l+2])&&(a=l,n>0));l=s[l+3]);return a}slice(e,r,n){let i=this.buffer,o=new Uint16Array(r-e),s=0;for(let a=e,l=0;a<r;){o[l++]=i[a++],o[l++]=i[a++]-n;let c=o[l++]=i[a++]-n;o[l++]=i[a++]-e,s=Math.max(s,c)}return new rh(o,s,this.set)}}function Oee(t,e,r,n){switch(t){case-2:return r<e;case-1:return n>=e&&r<e;case 0:return r<e&&n>e;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function _b(t,e,r,n){for(var i;t.from==t.to||(r<1?t.from>=e:t.from>e)||(r>-1?t.to<=e:t.to<e);){let s=!n&&t instanceof jo&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=n?0:xn.IgnoreOverlays;if(n)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof jo&&s.index<0&&((i=a.enter(e,r,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,r,o);if(!s)return t;t=s}}let xee=class{cursor(e=0){return new ck(this,e)}getChild(e,r=null,n=null){let i=lB(this,e,r,n);return i.length?i[0]:null}getChildren(e,r=null,n=null){return lB(this,e,r,n)}resolve(e,r=0){return _b(this,e,r,!1)}resolveInner(e,r=0){return _b(this,e,r,!0)}matchContext(e){return c$(this.parent,e)}enterUnfinishedNodesBefore(e){let r=this.childBefore(e),n=this;for(;r;){let i=r.lastChild;if(!i||i.to!=r.to)break;i.type.isError&&i.from==i.to?(n=r,r=i.prevSibling):r=i}return n}get node(){return this}get next(){return this.parent}};class jo extends xee{constructor(e,r,n,i){super(),this._tree=e,this.from=r,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,r,n,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=r>0?a.length:-1;e!=c;e+=r){let u=a[e],p=l[e]+s.from;if(Oee(i,n,p,p+u.length)){if(u instanceof rh){if(o&xn.ExcludeBuffers)continue;let m=u.findChild(0,u.buffer.length,r,n-p,i);if(m>-1)return new nc(new WIe(s,u,e,p),null,m)}else if(o&xn.IncludeAnonymous||!u.type.isAnonymous||mD(u)){let m;if(!(o&xn.IgnoreMounts)&&(m=Pb.get(u))&&!m.overlay)return new jo(m.tree,p,e,s);let v=new jo(u,p,e,s);return o&xn.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(r<0?u.children.length-1:0,r,n,i)}}}if(o&xn.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+r:e=r<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,r,n=0){let i;if(!(n&xn.IgnoreOverlays)&&(i=Pb.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((r>0?s<=o:s<o)&&(r<0?a>=o:a>o))return new jo(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,r,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function lB(t,e,r,n){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(r!=null){for(let s=!1;!s;)if(s=i.type.is(r),!i.nextSibling())return o}for(;;){if(n!=null&&i.type.is(n))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return n==null?o:[]}}function c$(t,e,r=e.length-1){for(let n=t;r>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[r]&&e[r]!=n.name)return!1;r--}}return!0}class WIe{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class nc extends xee{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,r,n){super(),this.context=e,this._parent=r,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,r,n){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.context.start,n);return o<0?null:new nc(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,r,n=0){if(n&xn.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],r>0?1:-1,e-this.context.start,r);return o<0?null:new nc(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,r=e.buffer[this.index+3];return r<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new nc(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new nc(this.context,this._parent,e.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],r=[],{buffer:n}=this.context,i=this.index+4,o=n.buffer[this.index+3];if(o>i){let s=n.buffer[this.index+1];e.push(n.slice(i,o,s)),r.push(0)}return new Lr(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function wee(t){if(!t.length)return null;let e=0,r=t[0];for(let o=1;o<t.length;o++){let s=t[o];(s.from>r.from||s.to<r.to)&&(r=s,e=o)}let n=r instanceof jo&&r.index<0?null:r.parent,i=t.slice();return n?i[e]=n:i.splice(e,1),new UIe(i,r)}class UIe{constructor(e,r){this.heads=e,this.node=r}get next(){return wee(this.heads)}}function HIe(t,e,r){let n=t.resolveInner(e,r),i=null;for(let o=n instanceof jo?n:n.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[n])).push(s.resolve(e,r)),o=s}else{let s=Pb.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new jo(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[n])).push(_b(a,e,r,!1))}}return i?wee(i):n}class ck{get name(){return this.type.name}constructor(e,r=0){if(this.mode=r,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof jo)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,r){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=r||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return e?e instanceof jo?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,r,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,r,n,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,r-this.buffer.start,n);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,r,n=this.mode){return this.buffer?n&xn.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:r}=this.buffer,n=this.stack.length-1;if(e<0){let i=n<0?0:this.stack[n]+4;if(this.index!=i)return this.yieldBuf(r.findChild(i,this.index,-1,0,4))}else{let i=r.buffer[this.index+3];if(i<(n<0?r.buffer.length:r.buffer[this.stack[n]+3]))return this.yieldBuf(i)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let r,n,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:r,parent:n}=i)}else({index:r,_parent:n}=this._tree);for(;n;{index:r,_parent:n}=n)if(r>-1)for(let o=r+e,s=e<0?-1:n._tree.children.length;o!=s;o+=e){let a=n._tree.children[o];if(this.mode&xn.IncludeAnonymous||a instanceof rh||!a.type.isAnonymous||mD(a))return!1}return!0}move(e,r){if(r&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,r=0){for(;(this.from==this.to||(r<1?this.from>=e:this.from>e)||(r>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,r););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,r=null,n=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;r=s,n=o+1;break e}i=this.stack[--o]}for(let i=n;i<this.stack.length;i++)r=new nc(this.buffer,r,this.stack[i]);return this.bufferNode=new nc(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,r){for(let n=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&r&&r(this),i=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return c$(this.node.parent,e);let{buffer:r}=this.buffer,{types:n}=r.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return c$(this._tree,e,i);let s=n[r.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function mD(t){return t.children.some(e=>e instanceof rh||!e.type.isAnonymous||mD(e))}function GIe(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=bee,reused:o=[],minRepeatType:s=n.types.length}=t,a=Array.isArray(r)?new gD(r,r.length):r,l=n.types,c=0,u=0;function p(_,T,R,$,A,M){let{id:Q,start:V,end:q,size:N}=a,B=u,re=c;for(;N<0;)if(a.next(),N==-1){let D=o[Q];R.push(D),$.push(V-_);return}else if(N==-3){c=Q;return}else if(N==-4){u=Q;return}else throw new RangeError(`Unrecognized record size: ${N}`);let he=l[Q],ne,se,X=V-_;if(q-V<=i&&(se=x(a.pos-T,A))){let D=new Uint16Array(se.size-se.skip),H=a.pos-se.size,J=D.length;for(;a.pos>H;)J=S(se.start,D,J);ne=new rh(D,q-se.start,n),X=se.start-_}else{let D=a.pos-N;a.next();let H=[],J=[],F=Q>=s?Q:-1,W=0,ae=q;for(;a.pos>D;)F>=0&&a.id==F&&a.size>=0?(a.end<=ae-i&&(b(H,J,V,W,a.end,ae,F,B,re),W=H.length,ae=a.end),a.next()):M>2500?m(V,D,H,J):p(V,D,H,J,F,M+1);if(F>=0&&W>0&&W<H.length&&b(H,J,V,W,V,ae,F,B,re),H.reverse(),J.reverse(),F>-1&&W>0){let we=v(he,re);ne=vD(he,H,J,0,H.length,0,q-V,we,we)}else ne=O(he,H,J,q-V,B-q,re)}R.push(ne),$.push(X)}function m(_,T,R,$){let A=[],M=0,Q=-1;for(;a.pos>T;){let{id:V,start:q,end:N,size:B}=a;if(B>4)a.next();else{if(Q>-1&&q<Q)break;Q<0&&(Q=N-i),A.push(V,q,N),M++,a.next()}}if(M){let V=new Uint16Array(M*4),q=A[A.length-2];for(let N=A.length-3,B=0;N>=0;N-=3)V[B++]=A[N],V[B++]=A[N+1]-q,V[B++]=A[N+2]-q,V[B++]=B;R.push(new rh(V,A[2]-q,n)),$.push(q-_)}}function v(_,T){return(R,$,A)=>{let M=0,Q=R.length-1,V,q;if(Q>=0&&(V=R[Q])instanceof Lr){if(!Q&&V.type==_&&V.length==A)return V;(q=V.prop(Dt.lookAhead))&&(M=$[Q]+V.length+q)}return O(_,R,$,A,M,T)}}function b(_,T,R,$,A,M,Q,V,q){let N=[],B=[];for(;_.length>$;)N.push(_.pop()),B.push(T.pop()+R-A);_.push(O(n.types[Q],N,B,M-A,V-M,q)),T.push(A-R)}function O(_,T,R,$,A,M,Q){if(M){let V=[Dt.contextHash,M];Q=Q?[V].concat(Q):[V]}if(A>25){let V=[Dt.lookAhead,A];Q=Q?[V].concat(Q):[V]}return new Lr(_,T,R,$,Q)}function x(_,T){let R=a.fork(),$=0,A=0,M=0,Q=R.end-i,V={size:0,start:0,skip:0};e:for(let q=R.pos-_;R.pos>q;){let N=R.size;if(R.id==T&&N>=0){V.size=$,V.start=A,V.skip=M,M+=4,$+=4,R.next();continue}let B=R.pos-N;if(N<0||B<q||R.start<Q)break;let re=R.id>=s?4:0,he=R.start;for(R.next();R.pos>B;){if(R.size<0)if(R.size==-3)re+=4;else break e;else R.id>=s&&(re+=4);R.next()}A=he,$+=N,M+=re}return(T<0||$==_)&&(V.size=$,V.start=A,V.skip=M),V.size>4?V:void 0}function S(_,T,R){let{id:$,start:A,end:M,size:Q}=a;if(a.next(),Q>=0&&$<s){let V=R;if(Q>4){let q=a.pos-(Q-4);for(;a.pos>q;)R=S(_,T,R)}T[--R]=V,T[--R]=M-_,T[--R]=A-_,T[--R]=$}else Q==-3?c=$:Q==-4&&(u=$);return R}let w=[],k=[];for(;a.pos>0;)p(t.start||0,t.bufferStart||0,w,k,-1,0);let P=(e=t.length)!==null&&e!==void 0?e:w.length?k[0]+w[0].length:0;return new Lr(l[t.topID],w.reverse(),k.reverse(),P)}const cB=new WeakMap;function aC(t,e){if(!t.isAnonymous||e instanceof rh||e.type!=t)return 1;let r=cB.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof Lr)){r=1;break}r+=aC(t,n)}cB.set(e,r)}return r}function vD(t,e,r,n,i,o,s,a,l){let c=0;for(let b=n;b<i;b++)c+=aC(t,e[b]);let u=Math.ceil(c*1.5/8),p=[],m=[];function v(b,O,x,S,w){for(let k=x;k<S;){let P=k,_=O[k],T=aC(t,b[k]);for(k++;k<S;k++){let R=aC(t,b[k]);if(T+R>=u)break;T+=R}if(k==P+1){if(T>u){let R=b[P];v(R.children,R.positions,0,R.children.length,O[P]+w);continue}p.push(b[P])}else{let R=O[k-1]+b[k-1].length-_;p.push(vD(t,b,O,P,k,_,R,null,l))}m.push(_+w-o)}}return v(e,r,n,i,0),(a||l)(p,m,s)}class See{constructor(){this.map=new WeakMap}setBuffer(e,r,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(r,n)}getBuffer(e,r){let n=this.map.get(e);return n&&n.get(r)}set(e,r){e instanceof nc?this.setBuffer(e.context.buffer,e.index,r):e instanceof jo&&this.map.set(e.tree,r)}get(e){return e instanceof nc?this.getBuffer(e.context.buffer,e.index):e instanceof jo?this.map.get(e.tree):void 0}cursorSet(e,r){e.buffer?this.setBuffer(e.buffer.buffer,e.index,r):this.map.set(e.tree,r)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class fu{constructor(e,r,n,i,o=!1,s=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,r=[],n=!1){let i=[new fu(0,e.length,e,0,!1,n)];for(let o of r)o.to>e.length&&i.push(o);return i}static applyChanges(e,r,n=128){if(!r.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<r.length?r[a]:null,p=u?u.fromA:1e9;if(p-l>=n)for(;s&&s.from<p;){let m=s;if(l>=m.from||p<=m.to||c){let v=Math.max(m.from,l)-c,b=Math.min(m.to,p)-c;m=v>=b?null:new fu(v,b,m.tree,m.offset+c,a>0,!!u)}if(m&&i.push(m),s.to>p)break;s=o<e.length?e[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class yD{startParse(e,r,n){return typeof e=="string"&&(e=new XIe(e)),n=n?n.length?n.map(i=>new Pa(i.from,i.to)):[new Pa(0,0)]:[new Pa(0,e.length)],this.createParse(e,r||[],n)}parse(e,r,n){let i=this.startParse(e,r,n);for(;;){let o=i.advance();if(o)return o}}}class XIe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,r){return this.string.slice(e,r)}}function Cee(t){return(e,r,n,i)=>new YIe(e,t,r,n,i)}class uB{constructor(e,r,n,i,o){this.parser=e,this.parse=r,this.overlay=n,this.target=i,this.from=o}}function dB(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class ZIe{constructor(e,r,n,i,o,s,a){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const u$=new Dt({perNode:!0});class YIe{constructor(e,r,n,i,o){this.nest=r,this.input=n,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new Lr(n.type,n.children,n.positions,n.length,n.propValues.concat([[u$,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],r=e.parse.advance();if(r){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Dt.mounted.id]=new Pb(r,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<e&&(e=Math.min(e,this.inner[r].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(e)}startInner(){let e=new eje(this.fragments),r=null,n=null,i=new ck(new jo(this.baseTree,this.ranges[0].from,0,null),xn.IncludeAnonymous|xn.IgnoreMounts);e:for(let o,s;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(r){let c=r.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let p=u.from+c.pos,m=u.to+c.pos;p>=i.from&&m<=i.to&&!r.ranges.some(v=>v.from<m&&v.to>p)&&r.ranges.push({from:p,to:m})}}a=!1}else if(n&&(s=KIe(n.ranges,i.from,i.to)))a=s!=2;else if(!i.type.isAnonymous&&(o=this.nest(i,this.input))&&(i.from<i.to||!o.overlay)){i.tree||JIe(i);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")r=new ZIe(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,r);else{let u=pB(this.ranges,o.overlay||(i.from<i.to?[new Pa(i.from,i.to)]:[]));u.length&&dB(u),(u.length||!o.overlay)&&this.inner.push(new uB(o.parser,u.length?o.parser.startParse(this.input,gB(c,u),u):o.parser.startParse(""),o.overlay?o.overlay.map(p=>new Pa(p.from-i.from,p.to-i.from)):null,i.tree,u.length?u[0].from:i.from)),o.overlay?u.length&&(n={ranges:u,depth:0,prev:n}):a=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new Pa(i.from,i.to)),l.from<l.to)){let c=r.ranges.length-1;c>=0&&r.ranges[c].to==l.from?r.ranges[c]={from:r.ranges[c].from,to:l.to}:r.ranges.push(l)}if(a&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let c=pB(this.ranges,r.ranges);c.length&&(dB(c),this.inner.splice(r.index,0,new uB(r.parser,r.parser.startParse(this.input,gB(r.mounts,c),c),r.ranges.map(u=>new Pa(u.from-r.start,u.to-r.start)),r.target,c[0].from))),r=r.prev}n&&!--n.depth&&(n=n.prev)}}}}function KIe(t,e,r){for(let n of t){if(n.from>=r)break;if(n.to>e)return n.from<=e&&n.to>=r?2:1}return 0}function hB(t,e,r,n,i,o){if(e<r){let s=t.buffer[e+1];n.push(t.slice(e,r,s)),i.push(s-o)}}function JIe(t){let{node:e}=t,r=[],n=e.context.buffer;do r.push(t.index),t.parent();while(!t.tree);let i=t.tree,o=i.children.indexOf(n),s=i.children[o],a=s.buffer,l=[o];function c(u,p,m,v,b,O){let x=r[O],S=[],w=[];hB(s,u,x,S,w,v);let k=a[x+1],P=a[x+2];l.push(S.length);let _=O?c(x+4,a[x+3],s.set.types[a[x]],k,P-k,O-1):e.toTree();return S.push(_),w.push(k-v),hB(s,a[x+3],p,S,w,v),new Lr(m,S,w,b)}i.children[o]=c(0,a.length,Li.none,0,s.length,r.length-1);for(let u of l){let p=t.tree.children[u],m=t.tree.positions[u];t.yield(new jo(p,m+t.from,u,t._tree))}}class fB{constructor(e,r){this.offset=r,this.done=!1,this.cursor=e.cursor(xn.IncludeAnonymous|xn.IgnoreMounts)}moveTo(e){let{cursor:r}=this,n=e-this.offset;for(;!this.done&&r.from<n;)r.to>=e&&r.enter(n,1,xn.IgnoreOverlays|xn.ExcludeBuffers)||r.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==e.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Lr)r=r.children[0];else break}return!1}}let eje=class{constructor(e){var r;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(r=n.tree.prop(u$))!==null&&r!==void 0?r:n.to,this.inner=new fB(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(e=r.tree.prop(u$))!==null&&e!==void 0?e:r.to,this.inner=new fB(r.tree,-r.offset)}}findMounts(e,r){var n;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(n=o.tree)===null||n===void 0?void 0:n.prop(Dt.mounted);if(s&&s.parser==r)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=o.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:o.from-l.offset,mount:s})}}}return i}};function pB(t,e){let r=null,n=e;for(let i=1,o=0;i<t.length;i++){let s=t[i-1].to,a=t[i].from;for(;o<n.length;o++){let l=n[o];if(l.from>=a)break;l.to<=s||(r||(n=r=e.slice()),l.from<s?(r[o]=new Pa(l.from,s),l.to>a&&r.splice(o+1,0,new Pa(a,l.to))):l.to>a?r[o--]=new Pa(a,l.to):r.splice(o--,1))}}return n}function tje(t,e,r,n){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,p=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let m=Math.max(l,r),v=Math.min(u,p,n);m<v&&c.push(new Pa(m,v))}if(l=Math.min(u,p),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),p==l&&(a?(a=!1,o++):a=!0)}return c}function gB(t,e){let r=[];for(let{pos:n,mount:i,frag:o}of t){let s=n+(i.overlay?i.overlay[0].from:0),a=s+i.tree.length,l=Math.max(o.from,s),c=Math.min(o.to,a);if(i.overlay){let u=i.overlay.map(m=>new Pa(m.from+n,m.to+n)),p=tje(e,u,l,c);for(let m=0,v=l;;m++){let b=m==p.length,O=b?c:p[m].from;if(O>v&&r.push(new fu(v,O,i.tree,-s,o.from>=v||o.openStart,o.to<=O||o.openEnd)),b)break;v=p[m].to}}else r.push(new fu(l,c,i.tree,-s,o.from>=s||o.openStart,o.to<=a||o.openEnd))}return r}let rje=0;class Gs{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=rje++}toString(){let{name:e}=this;for(let r of this.modified)r.name&&(e=`${r.name}(${e})`);return e}static define(e,r){let n=typeof e=="string"?e:"?";if(e instanceof Gs&&(r=e),r?.base)throw new Error("Can not derive from a modified tag");let i=new Gs(n,[],null,[]);if(i.set.push(i),r)for(let o of r.set)i.set.push(o);return i}static defineModifier(e){let r=new uk(e);return n=>n.modified.indexOf(r)>-1?n:uk.get(n.base||n,n.modified.concat(r).sort((i,o)=>i.id-o.id))}}let nje=0;class uk{constructor(e){this.name=e,this.instances=[],this.id=nje++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(a=>a.base==e&&ije(r,a.modified));if(n)return n;let i=[],o=new Gs(e.name,i,e,r);for(let a of r)a.instances.push(o);let s=oje(r);for(let a of e.set)if(!a.modified.length)for(let l of s)i.push(uk.get(a,l));return o}}function ije(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function oje(t){let e=[[]];for(let r=0;r<t.length;r++)for(let n=0,i=e.length;n<i;n++)e.push(e[n].concat(t[r]));return e.sort((r,n)=>n.length-r.length)}function up(t){let e=Object.create(null);for(let r in t){let n=t[r];Array.isArray(n)||(n=[n]);for(let i of r.split(" "))if(i){let o=[],s=2,a=i;for(let p=0;;){if(a=="..."&&p>0&&p+3==i.length){s=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!m)throw new RangeError("Invalid path: "+i);if(o.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==i.length)break;let v=i[p++];if(p==i.length&&v=="!"){s=0;break}if(v!="/")throw new RangeError("Invalid path: "+i);a=i.slice(p)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new dk(n,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return kee.add(e)}const kee=new Dt;class dk{constructor(e,r,n,i){this.tags=e,this.mode=r,this.context=n,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}dk.empty=new dk([],2,null);function Pee(t,e){let r=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))r[o.tag.id]=o.class;else for(let s of o.tag)r[s.id]=o.class;let{scope:n,all:i=null}=e||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=r[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:n}}function sje(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function aje(t,e,r,n=0,i=t.length){let o=new lje(n,Array.isArray(e)?e:[e],r);o.highlightRange(t.cursor(),n,i,"",o.highlighters),o.flush(i)}class lje{constructor(e,r,n){this.at=e,this.highlighters=r,this.span=n,this.class=""}startSpan(e,r){r!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=r)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,r,n,i,o){let{type:s,from:a,to:l}=e;if(a>=n||l<=r)return;s.isTop&&(o=this.highlighters.filter(v=>!v.scope||v.scope(s)));let c=i,u=cje(e)||dk.empty,p=sje(o,u.tags);if(p&&(c&&(c+=" "),c+=p,u.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(r,a),c),u.opaque)return;let m=e.tree&&e.tree.prop(Dt.mounted);if(m&&m.overlay){let v=e.node.enter(m.overlay[0].from+a,1),b=this.highlighters.filter(x=>!x.scope||x.scope(m.tree.type)),O=e.firstChild();for(let x=0,S=a;;x++){let w=x<m.overlay.length?m.overlay[x]:null,k=w?w.from+a:l,P=Math.max(r,S),_=Math.min(n,k);if(P<_&&O)for(;e.from<_&&(this.highlightRange(e,P,_,i,o),this.startSpan(Math.min(_,e.to),c),!(e.to>=k||!e.nextSibling())););if(!w||k>n)break;S=w.to+a,S>r&&(this.highlightRange(v.cursor(),Math.max(r,w.from+a),Math.min(n,S),"",b),this.startSpan(Math.min(n,S),c))}O&&e.parent()}else if(e.firstChild()){m&&(i="");do if(!(e.to<=r)){if(e.from>=n)break;this.highlightRange(e,r,n,i,o),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function cje(t){let e=t.type.prop(kee);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Xe=Gs.define,Kw=Xe(),Od=Xe(),mB=Xe(Od),vB=Xe(Od),xd=Xe(),Jw=Xe(xd),dI=Xe(xd),Ul=Xe(),Wh=Xe(Ul),Bl=Xe(),zl=Xe(),d$=Xe(),Vy=Xe(d$),e1=Xe(),g={comment:Kw,lineComment:Xe(Kw),blockComment:Xe(Kw),docComment:Xe(Kw),name:Od,variableName:Xe(Od),typeName:mB,tagName:Xe(mB),propertyName:vB,attributeName:Xe(vB),className:Xe(Od),labelName:Xe(Od),namespace:Xe(Od),macroName:Xe(Od),literal:xd,string:Jw,docString:Xe(Jw),character:Xe(Jw),attributeValue:Xe(Jw),number:dI,integer:Xe(dI),float:Xe(dI),bool:Xe(xd),regexp:Xe(xd),escape:Xe(xd),color:Xe(xd),url:Xe(xd),keyword:Bl,self:Xe(Bl),null:Xe(Bl),atom:Xe(Bl),unit:Xe(Bl),modifier:Xe(Bl),operatorKeyword:Xe(Bl),controlKeyword:Xe(Bl),definitionKeyword:Xe(Bl),moduleKeyword:Xe(Bl),operator:zl,derefOperator:Xe(zl),arithmeticOperator:Xe(zl),logicOperator:Xe(zl),bitwiseOperator:Xe(zl),compareOperator:Xe(zl),updateOperator:Xe(zl),definitionOperator:Xe(zl),typeOperator:Xe(zl),controlOperator:Xe(zl),punctuation:d$,separator:Xe(d$),bracket:Vy,angleBracket:Xe(Vy),squareBracket:Xe(Vy),paren:Xe(Vy),brace:Xe(Vy),content:Ul,heading:Wh,heading1:Xe(Wh),heading2:Xe(Wh),heading3:Xe(Wh),heading4:Xe(Wh),heading5:Xe(Wh),heading6:Xe(Wh),contentSeparator:Xe(Ul),list:Xe(Ul),quote:Xe(Ul),emphasis:Xe(Ul),strong:Xe(Ul),link:Xe(Ul),monospace:Xe(Ul),strikethrough:Xe(Ul),inserted:Xe(),deleted:Xe(),changed:Xe(),invalid:Xe(),meta:e1,documentMeta:Xe(e1),annotation:Xe(e1),processingInstruction:Xe(e1),definition:Gs.defineModifier("definition"),constant:Gs.defineModifier("constant"),function:Gs.defineModifier("function"),standard:Gs.defineModifier("standard"),local:Gs.defineModifier("local"),special:Gs.defineModifier("special")};for(let t in g){let e=g[t];e instanceof Gs&&(e.name=t)}Pee([{tag:g.link,class:"tok-link"},{tag:g.heading,class:"tok-heading"},{tag:g.emphasis,class:"tok-emphasis"},{tag:g.strong,class:"tok-strong"},{tag:g.keyword,class:"tok-keyword"},{tag:g.atom,class:"tok-atom"},{tag:g.bool,class:"tok-bool"},{tag:g.url,class:"tok-url"},{tag:g.labelName,class:"tok-labelName"},{tag:g.inserted,class:"tok-inserted"},{tag:g.deleted,class:"tok-deleted"},{tag:g.literal,class:"tok-literal"},{tag:g.string,class:"tok-string"},{tag:g.number,class:"tok-number"},{tag:[g.regexp,g.escape,g.special(g.string)],class:"tok-string2"},{tag:g.variableName,class:"tok-variableName"},{tag:g.local(g.variableName),class:"tok-variableName tok-local"},{tag:g.definition(g.variableName),class:"tok-variableName tok-definition"},{tag:g.special(g.variableName),class:"tok-variableName2"},{tag:g.definition(g.propertyName),class:"tok-propertyName tok-definition"},{tag:g.typeName,class:"tok-typeName"},{tag:g.namespace,class:"tok-namespace"},{tag:g.className,class:"tok-className"},{tag:g.macroName,class:"tok-macroName"},{tag:g.propertyName,class:"tok-propertyName"},{tag:g.operator,class:"tok-operator"},{tag:g.comment,class:"tok-comment"},{tag:g.meta,class:"tok-meta"},{tag:g.invalid,class:"tok-invalid"},{tag:g.punctuation,class:"tok-punctuation"}]);let h$=[],_ee=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,r=0;e<t.length;e++)(e%2?_ee:h$).push(r=r+t[e])})();function uje(t){if(t<768)return!1;for(let e=0,r=h$.length;;){let n=e+r>>1;if(t<h$[n])r=n;else if(t>=_ee[n])e=n+1;else return!0;if(e==r)return!1}}function yB(t){return t>=127462&&t<=127487}const bB=8205;function dje(t,e,r=!0,n=!0){return(r?Tee:hje)(t,e,n)}function Tee(t,e,r){if(e==t.length)return e;e&&Eee(t.charCodeAt(e))&&Ree(t.charCodeAt(e-1))&&e--;let n=hI(t,e);for(e+=OB(n);e<t.length;){let i=hI(t,e);if(n==bB||i==bB||r&&uje(i))e+=OB(i),n=i;else if(yB(i)){let o=0,s=e-2;for(;s>=0&&yB(hI(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function hje(t,e,r){for(;e>0;){let n=Tee(t,e-2,r);if(n<e)return n;e--}return 0}function hI(t,e){let r=t.charCodeAt(e);if(!Ree(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return Eee(n)?(r-55296<<10)+(n-56320)+65536:r}function Eee(t){return t>=56320&&t<57344}function Ree(t){return t>=55296&&t<56320}function OB(t){return t<65536?1:2}class mr{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,r,n){[e,r]=wm(this,e,r);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(r,this.length,i,1),Kl.from(i,this.length-(r-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,r=this.length){[e,r]=wm(this,e,r);let n=[];return this.decompose(e,r,n,0),Kl.from(n,r-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let r=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new D0(this),o=new D0(e);for(let s=r,a=r;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=n)return!0}}iter(e=1){return new D0(this,e)}iterRange(e,r=this.length){return new Iee(this,e,r)}iterLines(e,r){let n;if(e==null)n=this.iter();else{r==null&&(r=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,r==this.lines+1?this.length:r<=1?0:this.line(r-1).to))}return new jee(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?mr.empty:e.length<=32?new ui(e):Kl.from(ui.split(e,[]))}}class ui extends mr{constructor(e,r=fje(e)){super(),this.text=e,this.length=r}get lines(){return this.text.length}get children(){return null}lineInner(e,r,n,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((r?n:a)>=e)return new pje(i,a,n,s);i=a+1,n++}}decompose(e,r,n,i){let o=e<=0&&r>=this.length?this:new ui(xB(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let s=n.pop(),a=lC(o.text,s.text.slice(),0,o.length);if(a.length<=32)n.push(new ui(a,s.length+o.length));else{let l=a.length>>1;n.push(new ui(a.slice(0,l)),new ui(a.slice(l)))}}else n.push(o)}replace(e,r,n){if(!(n instanceof ui))return super.replace(e,r,n);[e,r]=wm(this,e,r);let i=lC(this.text,lC(n.text,xB(this.text,0,e)),r),o=this.length+n.length-(r-e);return i.length<=32?new ui(i,o):Kl.from(ui.split(i,[]),o)}sliceString(e,r=this.length,n=`
|
|
76
76
|
`){[e,r]=wm(this,e,r);let i="";for(let o=0,s=0;o<=r&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>e&&s&&(i+=n),e<l&&r>o&&(i+=a.slice(Math.max(0,e-o),r-o)),o=l+1}return i}flatten(e){for(let r of this.text)e.push(r)}scanIdentical(){return 0}static split(e,r){let n=[],i=-1;for(let o of e)n.push(o),i+=o.length+1,n.length==32&&(r.push(new ui(n,i)),n=[],i=-1);return i>-1&&r.push(new ui(n,i)),r}}class Kl extends mr{constructor(e,r){super(),this.children=e,this.length=r,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,r,n,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=n+s.lines-1;if((r?l:a)>=e)return s.lineInner(e,r,n,i);i=a+1,n=l+1}}decompose(e,r,n,i){for(let o=0,s=0;s<=r&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(e<=l&&r>=s){let c=i&((s<=e?1:0)|(l>=r?2:0));s>=e&&l<=r&&!c?n.push(a):a.decompose(e-s,r-s,n,c)}s=l+1}}replace(e,r,n){if([e,r]=wm(this,e,r),n.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(e>=o&&r<=a){let l=s.replace(e-o,r-o,n),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Kl(u,this.length-(r-e)+n.length)}return super.replace(o,a,l)}o=a+1}return super.replace(e,r,n)}sliceString(e,r=this.length,n=`
|
|
77
77
|
`){[e,r]=wm(this,e,r);let i="";for(let o=0,s=0;o<this.children.length&&s<=r;o++){let a=this.children[o],l=s+a.length;s>e&&o&&(i+=n),e<l&&r>s&&(i+=a.sliceString(e-s,r-s,n)),s=l+1}return i}flatten(e){for(let r of this.children)r.flatten(e)}scanIdentical(e,r){if(!(e instanceof Kl))return 0;let n=0,[i,o,s,a]=r>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=r,o+=r){if(i==s||o==a)return n;let l=this.children[i],c=e.children[o];if(l!=c)return n+l.scanIdentical(c,r);n+=l.length+1}}static from(e,r=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let v of e)n+=v.lines;if(n<32){let v=[];for(let b of e)b.flatten(v);return new ui(v,r)}let i=Math.max(32,n>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function p(v){let b;if(v.lines>o&&v instanceof Kl)for(let O of v.children)p(O);else v.lines>s&&(l>s||!l)?(m(),a.push(v)):v instanceof ui&&l&&(b=u[u.length-1])instanceof ui&&v.lines+b.lines<=32?(l+=v.lines,c+=v.length+1,u[u.length-1]=new ui(b.text.concat(v.text),b.length+1+v.length)):(l+v.lines>i&&m(),l+=v.lines,c+=v.length+1,u.push(v))}function m(){l!=0&&(a.push(u.length==1?u[0]:Kl.from(u,c)),c=-1,l=u.length=0)}for(let v of e)p(v);return m(),a.length==1?a[0]:new Kl(a,r)}}mr.empty=new ui([""],0);function fje(t){let e=-1;for(let r of t)e+=r.length+1;return e}function lC(t,e,r=0,n=1e9){for(let i=0,o=0,s=!0;o<t.length&&i<=n;o++){let a=t[o],l=i+a.length;l>=r&&(l>n&&(a=a.slice(0,n-i)),i<r&&(a=a.slice(r-i)),s?(e[e.length-1]+=a,s=!1):e.push(a)),i=l+1}return e}function xB(t,e,r){return lC(t,[""],e,r)}class D0{constructor(e,r=1){this.dir=r,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[r>0?1:(e instanceof ui?e.text.length:e.children.length)<<1]}nextInner(e,r){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],o=this.offsets[n],s=o>>1,a=i instanceof ui?i.text.length:i.children.length;if(s==(r>0?a:0)){if(n==0)return this.done=!0,this.value="",this;r>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(r>0?0:1)){if(this.offsets[n]+=r,e==0)return this.lineBreak=!0,this.value=`
|
|
78
78
|
`,this;e--}else if(i instanceof ui){let l=i.text[s+(r<0?-1:0)];if(this.offsets[n]+=r,l.length>Math.max(0,e))return this.value=e==0?l:r>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[s+(r<0?-1:0)];e>l.length?(e-=l.length,this.offsets[n]+=r):(r<0&&this.offsets[n]--,this.nodes.push(l),this.offsets.push(r>0?1:(l instanceof ui?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Iee{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new D0(e,r>n?-1:1),this.pos=r>n?e.length:0,this.from=Math.min(r,n),this.to=Math.max(r,n)}nextInner(e,r){if(r<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,r<0?this.pos-this.to:this.from-this.pos);let n=r<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*r,this.value=i.length<=n?i:r<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class jee{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:r,lineBreak:n,value:i}=this.inner.next(e);return r&&this.afterBreak?(this.value="",this.afterBreak=!1):r?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(mr.prototype[Symbol.iterator]=function(){return this.iter()},D0.prototype[Symbol.iterator]=Iee.prototype[Symbol.iterator]=jee.prototype[Symbol.iterator]=function(){return this});let pje=class{constructor(e,r,n,i){this.from=e,this.to=r,this.number=n,this.text=i}get length(){return this.to-this.from}};function wm(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function yo(t,e,r=!0,n=!0){return dje(t,e,r,n)}function gje(t){return t>=56320&&t<57344}function mje(t){return t>=55296&&t<56320}function ls(t,e){let r=t.charCodeAt(e);if(!mje(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return gje(n)?(r-55296<<10)+(n-56320)+65536:r}function bD(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Jl(t){return t<65536?1:2}const f$=/\r\n?|\n/;var vo=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(vo||(vo={}));class pc{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;r<this.sections.length;r+=2)e+=this.sections[r];return e}get newLength(){let e=0;for(let r=0;r<this.sections.length;r+=2){let n=this.sections[r+1];e+=n<0?this.sections[r]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let r=0,n=0,i=0;r<this.sections.length;){let o=this.sections[r++],s=this.sections[r++];s<0?(e(n,i,o),i+=o):i+=s,n+=o}}iterChangedRanges(e,r=!1){p$(this,e,r)}get invertedDesc(){let e=[];for(let r=0;r<this.sections.length;){let n=this.sections[r++],i=this.sections[r++];i<0?e.push(n,i):e.push(i,n)}return new pc(e)}composeDesc(e){return this.empty?e:e.empty?this:$ee(this,e)}mapDesc(e,r=!1){return e.empty?this:g$(this,e,r)}mapPos(e,r=-1,n=vo.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=i+a;if(l<0){if(c>e)return o+(e-i);o+=a}else{if(n!=vo.Simple&&c>=e&&(n==vo.TrackDel&&i<e&&c>e||n==vo.TrackBefore&&i<e||n==vo.TrackAfter&&c>e))return null;if(c>e||c==e&&r<0&&!a)return e==i||r<0?o:o+l;o+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,r=e){for(let n=0,i=0;n<this.sections.length&&i<=r;){let o=this.sections[n++],s=this.sections[n++],a=i+o;if(s>=0&&i<=r&&a>=e)return i<e&&a>r?"cover":!0;i=a}return!1}toString(){let e="";for(let r=0;r<this.sections.length;){let n=this.sections[r++],i=this.sections[r++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(r=>typeof r!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new pc(e)}static create(e){return new pc(e)}}class $i extends pc{constructor(e,r){super(e),this.inserted=r}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return p$(this,(r,n,i,o,s)=>e=e.replace(i,i+(n-r),s),!1),e}mapDesc(e,r=!1){return g$(this,e,r,!0)}invert(e){let r=this.sections.slice(),n=[];for(let i=0,o=0;i<r.length;i+=2){let s=r[i],a=r[i+1];if(a>=0){r[i]=a,r[i+1]=s;let l=i>>1;for(;n.length<l;)n.push(mr.empty);n.push(s?e.slice(o,o+s):mr.empty)}o+=s}return new $i(r,n)}compose(e){return this.empty?e:e.empty?this:$ee(this,e,!0)}map(e,r=!1){return e.empty?this:g$(this,e,r,!0)}iterChanges(e,r=!1){p$(this,e,r)}get desc(){return pc.create(this.sections)}filter(e){let r=[],n=[],i=[],o=new Tb(this);e:for(let s=0,a=0;;){let l=s==e.length?1e9:e[s++];for(;a<l||a==l&&o.len==0;){if(o.done)break e;let u=Math.min(o.len,l-a);Po(i,u,-1);let p=o.ins==-1?-1:o.off==0?o.ins:0;Po(r,u,p),p>0&&Id(n,r,o.text),o.forward(u),a+=u}let c=e[s++];for(;a<c;){if(o.done)break e;let u=Math.min(o.len,c-a);Po(r,u,-1),Po(i,u,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(u),a+=u}}return{changes:new $i(r,n),filtered:pc.create(i)}}toJSON(){let e=[];for(let r=0;r<this.sections.length;r+=2){let n=this.sections[r],i=this.sections[r+1];i<0?e.push(n):i==0?e.push([n]):e.push([n].concat(this.inserted[r>>1].toJSON()))}return e}static of(e,r,n){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;s<r&&Po(i,r-s,-1);let p=new $i(i,o);a=a?a.compose(p.map(a)):p,i=[],o=[],s=0}function c(u){if(Array.isArray(u))for(let p of u)c(p);else if(u instanceof $i){if(u.length!=r)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${r})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:p,to:m=p,insert:v}=u;if(p>m||p<0||m>r)throw new RangeError(`Invalid change range ${p} to ${m} (in doc of length ${r})`);let b=v?typeof v=="string"?mr.of(v.split(n||f$)):v:mr.empty,O=b.length;if(p==m&&O==0)return;p<s&&l(),p>s&&Po(i,p-s,-1),Po(i,m-p,O),Id(o,i,b),s=m}}return c(e),l(!a),a}static empty(e){return new $i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let r=[],n=[];for(let i=0;i<e.length;i++){let o=e[i];if(typeof o=="number")r.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)r.push(o[0],0);else{for(;n.length<i;)n.push(mr.empty);n[i]=mr.of(o.slice(1)),r.push(o[0],n[i].length)}}}return new $i(r,n)}static createSet(e,r){return new $i(e,r)}}function Po(t,e,r,n=!1){if(e==0&&r<=0)return;let i=t.length-2;i>=0&&r<=0&&r==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=r:n?(t[i]+=e,t[i+1]+=r):t.push(e,r)}function Id(t,e,r){if(r.length==0)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(r);else{for(;t.length<n;)t.push(mr.empty);t.push(r)}}function p$(t,e,r){let n=t.inserted;for(let i=0,o=0,s=0;s<t.sections.length;){let a=t.sections[s++],l=t.sections[s++];if(l<0)i+=a,o+=a;else{let c=i,u=o,p=mr.empty;for(;c+=a,u+=l,l&&n&&(p=p.append(n[s-2>>1])),!(r||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(i,c,o,u,p),i=c,o=u}}}function g$(t,e,r,n=!1){let i=[],o=n?[]:null,s=new Tb(t),a=new Tb(e);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);Po(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!r))){let c=a.len;for(Po(i,a.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=u&&(Po(i,0,s.ins),o&&Id(o,i,s.text),l=s.i),s.forward(u),c-=u}a.next()}else if(s.ins>=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let p=Math.min(u,a.len);c+=p,u-=p,a.forward(p)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;Po(i,c,l<s.i?s.ins:0),o&&l<s.i&&Id(o,i,s.text),l=s.i,s.forward(s.len-u)}else{if(s.done&&a.done)return o?$i.createSet(i,o):pc.create(i);throw new Error("Mismatched change set lengths")}}}function $ee(t,e,r=!1){let n=[],i=r?[]:null,o=new Tb(t),s=new Tb(e);for(let a=!1;;){if(o.done&&s.done)return i?$i.createSet(n,i):pc.create(n);if(o.ins==0)Po(n,o.len,0,a),o.next();else if(s.len==0&&!s.done)Po(n,0,s.ins,a),i&&Id(i,n,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,s.len),c=n.length;if(o.ins==-1){let u=s.ins==-1?-1:s.off?0:s.ins;Po(n,l,u,a),i&&u&&Id(i,n,s.text)}else s.ins==-1?(Po(n,o.off?0:o.len,l,a),i&&Id(i,n,o.textBit(l))):(Po(n,o.off?0:o.len,s.off?0:s.ins,a),i&&!s.off&&Id(i,n,s.text));a=(o.ins>l||s.ins>=0&&s.len>l)&&(a||n.length>c),o.forward2(l),s.forward(l)}}}}class Tb{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,r=this.i-2>>1;return r>=e.length?mr.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?mr.empty:r[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class yf{constructor(e,r,n){this.from=e,this.to=r,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,r=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,r):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new yf(n,i,this.flags)}extend(e,r=e){if(e<=this.anchor&&r>=this.anchor)return Pe.range(e,r);let n=Math.abs(e-this.anchor)>Math.abs(r-this.anchor)?e:r;return Pe.range(this.anchor,n)}eq(e,r=!1){return this.anchor==e.anchor&&this.head==e.head&&(!r||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Pe.range(e.anchor,e.head)}static create(e,r,n){return new yf(e,r,n)}}class Pe{constructor(e,r){this.ranges=e,this.mainIndex=r}map(e,r=-1){return e.empty?this:Pe.create(this.ranges.map(n=>n.map(e,r)),this.mainIndex)}eq(e,r=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],r))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Pe([this.main],0)}addRange(e,r=!0){return Pe.create([e].concat(this.ranges),r?0:this.mainIndex+1)}replaceRange(e,r=this.mainIndex){let n=this.ranges.slice();return n[r]=e,Pe.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Pe(e.ranges.map(r=>yf.fromJSON(r)),e.main)}static single(e,r=e){return new Pe([Pe.range(e,r)],0)}static create(e,r=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let o=e[i];if(o.empty?o.from<=n:o.from<n)return Pe.normalized(e.slice(),r);n=o.to}return new Pe(e,r)}static cursor(e,r=0,n,i){return yf.create(e,e,(r==0?0:r<0?8:16)|(n==null?7:Math.min(6,n))|(i??16777215)<<6)}static range(e,r,n,i){let o=(n??16777215)<<6|(i==null?7:Math.min(6,i));return r<e?yf.create(r,e,48|o):yf.create(e,r,(r>e?8:0)|o)}static normalized(e,r=0){let n=e[r];e.sort((i,o)=>i.from-o.from),r=e.indexOf(n);for(let i=1;i<e.length;i++){let o=e[i],s=e[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let a=s.from,l=Math.max(o.to,s.to);i<=r&&r--,e.splice(--i,2,o.anchor>o.head?Pe.range(l,a):Pe.range(a,l))}}return new Pe(e,r)}}function Aee(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let OD=0;class it{constructor(e,r,n,i,o){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=OD++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new it(e.combine||(r=>r),e.compareInput||((r,n)=>r===n),e.compare||(e.combine?(r,n)=>r===n:xD),!!e.static,e.enables)}of(e){return new cC([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new cC(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new cC(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function xD(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class cC{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=OD++}dynamicSlot(e){var r;let n=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let p of this.dependencies)p=="doc"?l=!0:p=="selection"?c=!0:(((r=e[p.id])!==null&&r!==void 0?r:1)&1)==0&&u.push(e[p.id]);return{create(p){return p.values[s]=n(p),1},update(p,m){if(l&&m.docChanged||c&&(m.docChanged||m.selection)||m$(p,u)){let v=n(p);if(a?!wB(v,p.values[s],i):!i(v,p.values[s]))return p.values[s]=v,1}return 0},reconfigure:(p,m)=>{let v,b=m.config.address[o];if(b!=null){let O=fk(m,b);if(this.dependencies.every(x=>x instanceof it?m.facet(x)===p.facet(x):x instanceof ro?m.field(x,!1)==p.field(x,!1):!0)||(a?wB(v=n(p),O,i):i(v=n(p),O)))return p.values[s]=O,0}else v=n(p);return p.values[s]=v,1}}}}function wB(t,e,r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!r(t[n],e[n]))return!1;return!0}function m$(t,e){let r=!1;for(let n of e)L0(t,n)&1&&(r=!0);return r}function vje(t,e,r){let n=r.map(l=>t[l.id]),i=r.map(l=>l.type),o=n.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let u=0;u<n.length;u++){let p=fk(l,n[u]);if(i[u]==2)for(let m of p)c.push(m);else c.push(p)}return e.combine(c)}return{create(l){for(let c of n)L0(l,c);return l.values[s]=a(l),1},update(l,c){if(!m$(l,o))return 0;let u=a(l);return e.compare(u,l.values[s])?0:(l.values[s]=u,1)},reconfigure(l,c){let u=m$(l,n),p=c.config.facets[e.id],m=c.facet(e);if(p&&!u&&xD(r,p))return l.values[s]=m,0;let v=a(l);return e.compare(v,m)?(l.values[s]=m,0):(l.values[s]=v,1)}}}const t1=it.define({static:!0});class ro{constructor(e,r,n,i,o){this.id=e,this.createF=r,this.updateF=n,this.compareF=i,this.spec=o,this.provides=void 0}static define(e){let r=new ro(OD++,e.create,e.update,e.compare||((n,i)=>n===i),e);return e.provide&&(r.provides=e.provide(r)),r}create(e){let r=e.facet(t1).find(n=>n.field==this);return(r?.create||this.createF)(e)}slot(e){let r=e[this.id]>>1;return{create:n=>(n.values[r]=this.create(n),1),update:(n,i)=>{let o=n.values[r],s=this.updateF(o,i);return this.compareF(o,s)?0:(n.values[r]=s,1)},reconfigure:(n,i)=>{let o=n.facet(t1),s=i.facet(t1),a;return(a=o.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(n.values[r]=a.create(n),1):i.config.address[this.id]!=null?(n.values[r]=i.field(this),0):(n.values[r]=this.create(n),1)}}}init(e){return[this,t1.of({field:this,create:e})]}get extension(){return this}}const cf={lowest:4,low:3,default:2,high:1,highest:0};function Fy(t){return e=>new Nee(e,t)}const Au={highest:Fy(cf.highest),high:Fy(cf.high),default:Fy(cf.default),low:Fy(cf.low),lowest:Fy(cf.lowest)};class Nee{constructor(e,r){this.inner=e,this.prec=r}}class k_{of(e){return new v$(this,e)}reconfigure(e){return k_.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class v${constructor(e,r){this.compartment=e,this.inner=r}}class hk{constructor(e,r,n,i,o,s){for(this.base=e,this.compartments=r,this.dynamicSlots=n,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let r=this.address[e.id];return r==null?e.default:this.staticValues[r>>1]}static resolve(e,r,n){let i=[],o=Object.create(null),s=new Map;for(let m of yje(e,r,s))m instanceof ro?i.push(m):(o[m.facet.id]||(o[m.facet.id]=[])).push(m);let a=Object.create(null),l=[],c=[];for(let m of i)a[m.id]=c.length<<1,c.push(v=>m.slot(v));let u=n?.config.facets;for(let m in o){let v=o[m],b=v[0].facet,O=u&&u[m]||[];if(v.every(x=>x.type==0))if(a[b.id]=l.length<<1|1,xD(O,v))l.push(n.facet(b));else{let x=b.combine(v.map(S=>S.value));l.push(n&&b.compare(x,n.facet(b))?n.facet(b):x)}else{for(let x of v)x.type==0?(a[x.id]=l.length<<1|1,l.push(x.value)):(a[x.id]=c.length<<1,c.push(S=>x.dynamicSlot(S)));a[b.id]=c.length<<1,c.push(x=>vje(x,b,v))}}let p=c.map(m=>m(a));return new hk(e,s,p,a,l,o)}}function yje(t,e,r){let n=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=n[l].indexOf(s);c>-1&&n[l].splice(c,1),s instanceof v$&&r.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof v$){if(r.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;r.set(s.compartment,c),o(c,a)}else if(s instanceof Nee)o(s.inner,s.prec);else if(s instanceof ro)n[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof cC)n[a].push(s),s.facet.extensions&&o(s.facet.extensions,cf.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(t,cf.default),n.reduce((s,a)=>s.concat(a))}function L0(t,e){if(e&1)return 2;let r=e>>1,n=t.status[r];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[r]=4;let i=t.computeSlot(t,t.config.dynamicSlots[r]);return t.status[r]=2|i}function fk(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Mee=it.define(),y$=it.define({combine:t=>t.some(e=>e),static:!0}),Dee=it.define({combine:t=>t.length?t[0]:void 0,static:!0}),Lee=it.define(),Vee=it.define(),Fee=it.define(),Qee=it.define({combine:t=>t.length?t[0]:!1});class Tc{constructor(e,r){this.type=e,this.value=r}static define(){return new bje}}class bje{of(e){return new Tc(this,e)}}class Oje{constructor(e){this.map=e}of(e){return new Bt(this,e)}}class Bt{constructor(e,r){this.type=e,this.value=r}map(e){let r=this.type.map(this.value,e);return r===void 0?void 0:r==this.value?this:new Bt(this.type,r)}is(e){return this.type==e}static define(e={}){return new Oje(e.map||(r=>r))}static mapEffects(e,r){if(!e.length)return e;let n=[];for(let i of e){let o=i.map(r);o&&n.push(o)}return n}}Bt.reconfigure=Bt.define();Bt.appendConfig=Bt.define();class ki{constructor(e,r,n,i,o,s){this.startState=e,this.changes=r,this.selection=n,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,n&&Aee(n,r.newLength),o.some(a=>a.type==ki.time)||(this.annotations=o.concat(ki.time.of(Date.now())))}static create(e,r,n,i,o,s){return new ki(e,r,n,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let r of this.annotations)if(r.type==e)return r.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let r=this.annotation(ki.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}}ki.time=Tc.define();ki.userEvent=Tc.define();ki.addToHistory=Tc.define();ki.remote=Tc.define();function xje(t,e){let r=[];for(let n=0,i=0;;){let o,s;if(n<t.length&&(i==e.length||e[i]>=t[n]))o=t[n++],s=t[n++];else if(i<e.length)o=e[i++],s=e[i++];else return r;!r.length||r[r.length-1]<o?r.push(o,s):r[r.length-1]<s&&(r[r.length-1]=s)}}function Bee(t,e,r){var n;let i,o,s;return r?(i=e.changes,o=$i.empty(e.changes.length),s=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(i)),{changes:s,selection:e.selection?e.selection.map(o):(n=t.selection)===null||n===void 0?void 0:n.map(i),effects:Bt.mapEffects(t.effects,i).concat(Bt.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function b$(t,e,r){let n=e.selection,i=Kg(e.annotations);return e.userEvent&&(i=i.concat(ki.userEvent.of(e.userEvent))),{changes:e.changes instanceof $i?e.changes:$i.of(e.changes||[],r,t.facet(Dee)),selection:n&&(n instanceof Pe?n:Pe.single(n.anchor,n.head)),effects:Kg(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function zee(t,e,r){let n=b$(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(r=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(r=!1);let s=!!e[o].sequential;n=Bee(n,b$(t,e[o],s?n.changes.newLength:t.doc.length),s)}let i=ki.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return Sje(r?wje(i):i)}function wje(t){let e=t.startState,r=!0;for(let i of e.facet(Lee)){let o=i(t);if(o===!1){r=!1;break}Array.isArray(o)&&(r=r===!0?o:xje(r,o))}if(r!==!0){let i,o;if(r===!1)o=t.changes.invertedDesc,i=$i.empty(e.doc.length);else{let s=t.changes.filter(r);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}t=ki.create(e,i,t.selection&&t.selection.map(o),Bt.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let n=e.facet(Vee);for(let i=n.length-1;i>=0;i--){let o=n[i](t);o instanceof ki?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof ki?t=o[0]:t=zee(e,Kg(o),!1)}return t}function Sje(t){let e=t.startState,r=e.facet(Fee),n=t;for(let i=r.length-1;i>=0;i--){let o=r[i](t);o&&Object.keys(o).length&&(n=Bee(n,b$(e,o,t.changes.newLength),!0))}return n==t?t:ki.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const Cje=[];function Kg(t){return t==null?Cje:Array.isArray(t)?t:[t]}var Wn=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Wn||(Wn={}));const kje=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let O$;try{O$=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Pje(t){if(O$)return O$.test(t);for(let e=0;e<t.length;e++){let r=t[e];if(/\w/.test(r)||r>""&&(r.toUpperCase()!=r.toLowerCase()||kje.test(r)))return!0}return!1}function _je(t){return e=>{if(!/\S/.test(e))return Wn.Space;if(Pje(e))return Wn.Word;for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>-1)return Wn.Word;return Wn.Other}}class lr{constructor(e,r,n,i,o,s){this.config=e,this.doc=r,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)L0(this,a<<1);this.computeSlot=null}field(e,r=!0){let n=this.config.address[e.id];if(n==null){if(r)throw new RangeError("Field is not present in this state");return}return L0(this,n),fk(this,n)}update(...e){return zee(this,e,!0)}applyTransaction(e){let r=this.config,{base:n,compartments:i}=r;for(let a of e.effects)a.is(k_.reconfigure)?(r&&(i=new Map,r.compartments.forEach((l,c)=>i.set(c,l)),r=null),i.set(a.value.compartment,a.value.extension)):a.is(Bt.reconfigure)?(r=null,n=a.value):a.is(Bt.appendConfig)&&(r=null,n=Kg(n).concat(a.value));let o;r?o=e.startState.values.slice():(r=hk.resolve(n,i,this),o=new lr(r,this.doc,this.selection,r.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(y$)?e.newSelection:e.newSelection.asSingle();new lr(r,e.newDoc,s,o,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:e},range:Pe.cursor(r.from+e.length)}))}changeByRange(e){let r=this.selection,n=e(r.ranges[0]),i=this.changes(n.changes),o=[n.range],s=Kg(n.effects);for(let a=1;a<r.ranges.length;a++){let l=e(r.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let m=0;m<a;m++)o[m]=o[m].map(u);let p=i.mapDesc(c,!0);o.push(l.range.map(p)),i=i.compose(u),s=Bt.mapEffects(s,u).concat(Bt.mapEffects(Kg(l.effects),p))}return{changes:i,selection:Pe.create(o,r.mainIndex),effects:s}}changes(e=[]){return e instanceof $i?e:$i.of(e,this.doc.length,this.facet(lr.lineSeparator))}toText(e){return mr.of(e.split(this.facet(lr.lineSeparator)||f$))}sliceDoc(e=0,r=this.doc.length){return this.doc.sliceString(e,r,this.lineBreak)}facet(e){let r=this.config.address[e.id];return r==null?e.default:(L0(this,r),fk(this,r))}toJSON(e){let r={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof ro&&this.config.address[i.id]!=null&&(r[n]=i.spec.toJSON(this.field(e[n]),this))}return r}static fromJSON(e,r={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let o in n)if(Object.prototype.hasOwnProperty.call(e,o)){let s=n[o],a=e[o];i.push(s.init(l=>s.spec.fromJSON(a,l)))}}return lr.create({doc:e.doc,selection:Pe.fromJSON(e.selection),extensions:r.extensions?i.concat([r.extensions]):i})}static create(e={}){let r=hk.resolve(e.extensions||[],new Map),n=e.doc instanceof mr?e.doc:mr.of((e.doc||"").split(r.staticFacet(lr.lineSeparator)||f$)),i=e.selection?e.selection instanceof Pe?e.selection:Pe.single(e.selection.anchor,e.selection.head):Pe.single(0);return Aee(i,n.length),r.staticFacet(y$)||(i=i.asSingle()),new lr(r,n,i,r.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(lr.tabSize)}get lineBreak(){return this.facet(lr.lineSeparator)||`
|
|
@@ -1242,7 +1242,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s
|
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
1244
|
${YQe}
|
|
1245
|
-
`,sBe=(t,e,r,n)=>t();function aBe(t,e=sBe){return{getProject(r,n){return e(i=>t.request(KQe,r,{...n,...i}),"getProject","query",r)},createEndpoint(r,n){return e(i=>t.request(JQe,r,{...n,...i}),"createEndpoint","mutation",r)},deleteEndpoint(r,n){return e(i=>t.request(e3e,r,{...n,...i}),"deleteEndpoint","mutation",r)},findForeignKey(r,n){return e(i=>t.request(t3e,r,{...n,...i}),"findForeignKey","query",r)},GetRevisionChanges(r,n){return e(i=>t.request(r3e,r,{...n,...i}),"GetRevisionChanges","query",r)},GetTableChanges(r,n){return e(i=>t.request(n3e,r,{...n,...i}),"GetTableChanges","query",r)},confirmEmailCode(r,n){return e(i=>t.request(i3e,r,{...n,...i}),"confirmEmailCode","mutation",r)},GetProjectEndpoints(r,n){return e(i=>t.request(o3e,r,{...n,...i}),"GetProjectEndpoints","query",r)},loginGithub(r,n){return e(i=>t.request(s3e,r,{...n,...i}),"loginGithub","mutation",r)},loginGoogle(r,n){return e(i=>t.request(a3e,r,{...n,...i}),"loginGoogle","mutation",r)},login(r,n){return e(i=>t.request(l3e,r,{...n,...i}),"login","mutation",r)},getMigrations(r,n){return e(i=>t.request(c3e,r,{...n,...i}),"getMigrations","query",r)},updateProject(r,n){return e(i=>t.request(u3e,r,{...n,...i}),"updateProject","mutation",r)},signUp(r,n){return e(i=>t.request(d3e,r,{...n,...i}),"signUp","mutation",r)},setUsername(r,n){return e(i=>t.request(h3e,r,{...n,...i}),"setUsername","mutation",r)},GetUsersProject(r,n){return e(i=>t.request(f3e,r,{...n,...i}),"GetUsersProject","query",r)},SearchUsers(r,n){return e(i=>t.request(p3e,r,{...n,...i}),"SearchUsers","query",r)},AddUserToProject(r,n){return e(i=>t.request(g3e,r,{...n,...i}),"AddUserToProject","mutation",r)},RemoveUserFromProject(r,n){return e(i=>t.request(m3e,r,{...n,...i}),"RemoveUserFromProject","mutation",r)},UpdateUserProjectRole(r,n){return e(i=>t.request(v3e,r,{...n,...i}),"UpdateUserProjectRole","mutation",r)},CreateUser(r,n){return e(i=>t.request(y3e,r,{...n,...i}),"CreateUser","mutation",r)},configuration(r,n){return e(i=>t.request(b3e,r,{...n,...i}),"configuration","query",r)},getMe(r,n){return e(i=>t.request(O3e,r,{...n,...i}),"getMe","query",r)},CreateBranchByRevisionIdMst(r,n){return e(i=>t.request(x3e,r,{...n,...i}),"CreateBranchByRevisionIdMst","mutation",r)},CreateEndpointMst(r,n){return e(i=>t.request(w3e,r,{...n,...i}),"CreateEndpointMst","mutation",r)},CreateProjectMst(r,n){return e(i=>t.request(S3e,r,{...n,...i}),"CreateProjectMst","mutation",r)},CreateRevisionMst(r,n){return e(i=>t.request(C3e,r,{...n,...i}),"CreateRevisionMst","mutation",r)},CreateRowMst(r,n){return e(i=>t.request(k3e,r,{...n,...i}),"CreateRowMst","mutation",r)},CreateTableMst(r,n){return e(i=>t.request(P3e,r,{...n,...i}),"CreateTableMst","mutation",r)},DeleteEndpointMst(r,n){return e(i=>t.request(_3e,r,{...n,...i}),"DeleteEndpointMst","mutation",r)},DeleteProjectMst(r,n){return e(i=>t.request(T3e,r,{...n,...i}),"DeleteProjectMst","mutation",r)},DeleteRowMst(r,n){return e(i=>t.request(E3e,r,{...n,...i}),"DeleteRowMst","mutation",r)},DeleteTableMst(r,n){return e(i=>t.request(R3e,r,{...n,...i}),"DeleteTableMst","mutation",r)},RenameRowMst(r,n){return e(i=>t.request(I3e,r,{...n,...i}),"RenameRowMst","mutation",r)},RenameTableMst(r,n){return e(i=>t.request(j3e,r,{...n,...i}),"RenameTableMst","mutation",r)},RevertChangesMst(r,n){return e(i=>t.request($3e,r,{...n,...i}),"RevertChangesMst","mutation",r)},UpdateRowMst(r,n){return e(i=>t.request(A3e,r,{...n,...i}),"UpdateRowMst","mutation",r)},UpdateTableMst(r,n){return e(i=>t.request(N3e,r,{...n,...i}),"UpdateTableMst","mutation",r)},BranchMst(r,n){return e(i=>t.request(M3e,r,{...n,...i}),"BranchMst","query",r)},BranchesMst(r,n){return e(i=>t.request(D3e,r,{...n,...i}),"BranchesMst","query",r)},GetRowCountForeignKeysTo(r,n){return e(i=>t.request(L3e,r,{...n,...i}),"GetRowCountForeignKeysTo","query",r)},meProjectsMst(r,n){return e(i=>t.request(V3e,r,{...n,...i}),"meProjectsMst","query",r)},ProjectMst(r,n){return e(i=>t.request(F3e,r,{...n,...i}),"ProjectMst","query",r)},ProjectsMst(r,n){return e(i=>t.request(Q3e,r,{...n,...i}),"ProjectsMst","query",r)},RevisionMst(r,n){return e(i=>t.request(B3e,r,{...n,...i}),"RevisionMst","query",r)},RevisionsMst(r,n){return e(i=>t.request(z3e,r,{...n,...i}),"RevisionsMst","query",r)},RowForeignKeysBy(r,n){return e(i=>t.request(q3e,r,{...n,...i}),"RowForeignKeysBy","query",r)},RowMst(r,n){return e(i=>t.request(W3e,r,{...n,...i}),"RowMst","query",r)},RowsMst(r,n){return e(i=>t.request(U3e,r,{...n,...i}),"RowsMst","query",r)},TableForeignKeysBy(r,n){return e(i=>t.request(H3e,r,{...n,...i}),"TableForeignKeysBy","query",r)},TableMst(r,n){return e(i=>t.request(G3e,r,{...n,...i}),"TableMst","query",r)},TablesMst(r,n){return e(i=>t.request(X3e,r,{...n,...i}),"TablesMst","query",r)},findBranches(r,n){return e(i=>t.request(Z3e,r,{...n,...i}),"findBranches","query",r)},findRevisions(r,n){return e(i=>t.request(Y3e,r,{...n,...i}),"findRevisions","query",r)},GetRowChanges(r,n){return e(i=>t.request(K3e,r,{...n,...i}),"GetRowChanges","query",r)},GetTableChangesForFilter(r,n){return e(i=>t.request(J3e,r,{...n,...i}),"GetTableChangesForFilter","query",r)},RowListRows(r,n){return e(i=>t.request(eBe,r,{...n,...i}),"RowListRows","query",r)},RemoveRows(r,n){return e(i=>t.request(tBe,r,{...n,...i}),"RemoveRows","mutation",r)},PatchRowInline(r,n){return e(i=>t.request(rBe,r,{...n,...i}),"PatchRowInline","mutation",r)},GetTableViews(r,n){return e(i=>t.request(nBe,r,{...n,...i}),"GetTableViews","query",r)},UpdateTableViews(r,n){return e(i=>t.request(iBe,r,{...n,...i}),"UpdateTableViews","mutation",r)},searchRows(r,n){return e(i=>t.request(oBe,r,{...n,...i}),"searchRows","query",r)}}}const lBe={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"dc294e7",MODE:"production",PACKAGE_VERSION:"2.1.0-alpha.6",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1};class Lk{constructor(){}get(e){const r=window.__env__?.[e],n=lBe[e];return r||n}}Ee.register(Lk,()=>new Lk,{scope:"singleton"});class Da{constructor(e){this.environmentService=e;const r=this.environmentService.get("REACT_APP_GRAPHQL_SERVER_URL");if(!r)throw new Error("Invalid REACT_APP_GRAPHQL_SERVER_URL");this.graphQLClient=new AQe(r,{responseMiddleware:n=>{const i=n.response?.errors[0].message;return i&&Ur.info({duration:3e3,description:i}),n}}),this.client=aBe(this.graphQLClient)}graphQLClient;client;setToken(e){this.graphQLClient.setHeaders(e?{Authorization:`Bearer ${e}`}:{})}}Ee.register(Da,()=>{const t=Ee.get(Lk);return new Da(t)},{scope:"singleton"});const xr=Ee.get(Da).client,YI="token";class $o{constructor(e,r,n){this.storage=e,this.apiService=r,this.permissionContext=n,Be(this),this.init()}isLoaded=!1;user=null;token=null;async setToken(e){this.token=e,this.apiService.setToken(this.token),this.token&&await this.fetchMe()}async init(){await this.setToken(this.loadToken()),this.signToToken(),this.setIsChecked(!0)}loadToken(){return this.storage.getItem(YI)}async fetchMe(){try{const e=await this.apiService.client.getMe();this.user=e.me,this.permissionContext.setUserRole(e.me.role??null)}catch(e){console.error(e),vt(()=>{this.token=null,this.permissionContext.setUserRole(null)})}}setIsChecked(e){this.isLoaded=e}signToToken(){Iu(()=>this.token,e=>{e?this.storage.setItem(YI,e):this.storage.removeItem(YI)})}logout(){this.token=null,this.user=null,this.apiService.setToken(null),this.permissionContext.setUserRole(null)}}Ee.register($o,()=>{const t=Ee.get(Da),e=Ee.get(xs);return new $o(localStorage,t,e)},{scope:"singleton"});class Vk{constructor(e,r){this.authService=e,this.environmentService=r}async add({revisionId:e,tableId:r,rowId:n,fileId:i,file:o}){const s=`${this.environmentService.get("REACT_APP_SWAGGER_SERVER_URL")}/revision/${e}/tables/${r}/rows/${n}/upload/${i}`,a=await this.upload(s,o);if(!a.ok)throw new Error(a.statusText);return a.json()}async upload(e,r){const n=new FormData;return n.append("file",r,r.name),fetch(e,{method:"POST",headers:{Authorization:`Bearer ${this.authService.token}`},body:n})}}Ee.register(Vk,()=>{const t=Ee.get($o),e=Ee.get(Lk);return new Vk(t,e)},{scope:"singleton"});const cBe=20,aA=(t,e,r=0)=>{if(r>cBe||typeof t!="object"||t===null)return;if(Array.isArray(t)){for(const i of t){const o=aA(i,e,r+1);if(o)return o}return}const n=t;if(n.fileId===e)return n;for(const i of Object.values(n)){const o=aA(i,e,r+1);if(o)return o}},uBe=({revisionId:t,tableId:e,rowId:r,onError:n})=>({upload:E.useCallback(async(o,s,a)=>{const l=Ee.get(Vk),c=wn();Ur.loading({id:c,title:"Uploading..."});try{const u=await l.add({revisionId:t,tableId:e,rowId:r,fileId:o,file:s});if(Ur.update(c,{type:"info",title:"Successfully uploaded!",duration:1500}),u.row?.data){const p=aA(u.row.data,o);p&&a.updateBaseValue(p)}return!0}catch(u){return Ur.update(c,{type:"error",title:"Upload failed",duration:3e3}),n?.(u instanceof Error?u:new Error("Upload failed")),!1}},[t,e,r,n])}),Zn=(t,...e)=>{const r=E.useRef(null),[n,i]=E.useState(e),o=E.useMemo(()=>n.length!==e.length||n.some((s,a)=>s!==e[a])?(i(e),e):n,[e,n]);return r.current||(r.current=Ee.get(t)),E.useEffect(()=>{const s=r.current;return s?.init?.(...o),()=>{s?.dispose?.()}},[o]),r.current};function jl(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Yf(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const yie=6048e5,dBe=864e5;let hBe={};function X_(){return hBe}function Ub(t,e){const r=X_(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=jl(t),o=i.getDay(),s=(o<n?7:0)+o-n;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Fk(t){return Ub(t,{weekStartsOn:1})}function bie(t){const e=jl(t),r=e.getFullYear(),n=Yf(t,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const i=Fk(n),o=Yf(t,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const s=Fk(o);return e.getTime()>=i.getTime()?r+1:e.getTime()>=s.getTime()?r:r-1}function Hq(t){const e=jl(t);return e.setHours(0,0,0,0),e}function Gq(t){const e=jl(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function fBe(t,e){const r=Hq(t),n=Hq(e),i=+r-Gq(r),o=+n-Gq(n);return Math.round((i-o)/dBe)}function pBe(t){const e=bie(t),r=Yf(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),Fk(r)}function gBe(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function mBe(t){if(!gBe(t)&&typeof t!="number")return!1;const e=jl(t);return!isNaN(Number(e))}function vBe(t){const e=jl(t),r=Yf(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}const yBe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bBe=(t,e,r)=>{let n;const i=yBe[t];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function KI(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const OBe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xBe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wBe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},SBe={date:KI({formats:OBe,defaultWidth:"full"}),time:KI({formats:xBe,defaultWidth:"full"}),dateTime:KI({formats:wBe,defaultWidth:"full"})},CBe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kBe=(t,e,r,n)=>CBe[t];function Hy(t){return(e,r)=>{const n=r?.context?String(r.context):"standalone";let i;if(n==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,a=r?.width?String(r.width):s;i=t.formattingValues[a]||t.formattingValues[s]}else{const s=t.defaultWidth,a=r?.width?String(r.width):t.defaultWidth;i=t.values[a]||t.values[s]}const o=t.argumentCallback?t.argumentCallback(e):e;return i[o]}}const PBe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_Be={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TBe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},EBe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RBe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},IBe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jBe=(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},$Be={ordinalNumber:jBe,era:Hy({values:PBe,defaultWidth:"wide"}),quarter:Hy({values:_Be,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Hy({values:TBe,defaultWidth:"wide"}),day:Hy({values:EBe,defaultWidth:"wide"}),dayPeriod:Hy({values:RBe,defaultWidth:"wide",formattingValues:IBe,defaultFormattingWidth:"wide"})};function Gy(t){return(e,r={})=>{const n=r.width,i=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;const s=o[0],a=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?NBe(a,p=>p.test(s)):ABe(a,p=>p.test(s));let c;c=t.valueCallback?t.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;const u=e.slice(s.length);return{value:c,rest:u}}}function ABe(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function NBe(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return r}function MBe(t){return(e,r={})=>{const n=e.match(t.matchPattern);if(!n)return null;const i=n[0],o=e.match(t.parsePattern);if(!o)return null;let s=t.valueCallback?t.valueCallback(o[0]):o[0];s=r.valueCallback?r.valueCallback(s):s;const a=e.slice(i.length);return{value:s,rest:a}}}const DBe=/^(\d+)(th|st|nd|rd)?/i,LBe=/\d+/i,VBe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},FBe={any:[/^b/i,/^(a|c)/i]},QBe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BBe={any:[/1/i,/2/i,/3/i,/4/i]},zBe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qBe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},WBe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},UBe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},HBe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},GBe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},XBe={ordinalNumber:MBe({matchPattern:DBe,parsePattern:LBe,valueCallback:t=>parseInt(t,10)}),era:Gy({matchPatterns:VBe,defaultMatchWidth:"wide",parsePatterns:FBe,defaultParseWidth:"any"}),quarter:Gy({matchPatterns:QBe,defaultMatchWidth:"wide",parsePatterns:BBe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Gy({matchPatterns:zBe,defaultMatchWidth:"wide",parsePatterns:qBe,defaultParseWidth:"any"}),day:Gy({matchPatterns:WBe,defaultMatchWidth:"wide",parsePatterns:UBe,defaultParseWidth:"any"}),dayPeriod:Gy({matchPatterns:HBe,defaultMatchWidth:"any",parsePatterns:GBe,defaultParseWidth:"any"})},ZBe={code:"en-US",formatDistance:bBe,formatLong:SBe,formatRelative:kBe,localize:$Be,match:XBe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function YBe(t){const e=jl(t);return fBe(e,vBe(e))+1}function KBe(t){const e=jl(t),r=+Fk(e)-+pBe(e);return Math.round(r/yie)+1}function Oie(t,e){const r=jl(t),n=r.getFullYear(),i=X_(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=Yf(t,0);s.setFullYear(n+1,0,o),s.setHours(0,0,0,0);const a=Ub(s,e),l=Yf(t,0);l.setFullYear(n,0,o),l.setHours(0,0,0,0);const c=Ub(l,e);return r.getTime()>=a.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function JBe(t,e){const r=X_(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Oie(t,e),o=Yf(t,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),Ub(o,e)}function eze(t,e){const r=jl(t),n=+Ub(r,e)-+JBe(r,e);return Math.round(n/yie)+1}function qr(t,e){const r=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return r+n}const ud={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return qr(e==="yy"?n%100:n,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):qr(r+1,2)},d(t,e){return qr(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return qr(t.getHours()%12||12,e.length)},H(t,e){return qr(t.getHours(),e.length)},m(t,e){return qr(t.getMinutes(),e.length)},s(t,e){return qr(t.getSeconds(),e.length)},S(t,e){const r=e.length,n=t.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return qr(i,e.length)}},og={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xq={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const n=t.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return ud.y(t,e)},Y:function(t,e,r,n){const i=Oie(t,n),o=i>0?i:1-i;if(e==="YY"){const s=o%100;return qr(s,2)}return e==="Yo"?r.ordinalNumber(o,{unit:"year"}):qr(o,e.length)},R:function(t,e){const r=bie(t);return qr(r,e.length)},u:function(t,e){const r=t.getFullYear();return qr(r,e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return qr(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return qr(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return ud.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return qr(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const i=eze(t,n);return e==="wo"?r.ordinalNumber(i,{unit:"week"}):qr(i,e.length)},I:function(t,e,r){const n=KBe(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):qr(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):ud.d(t,e)},D:function(t,e,r){const n=YBe(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):qr(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const i=t.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return qr(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const i=t.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return qr(o,e.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return qr(i,e.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let i;switch(n===12?i=og.noon:n===0?i=og.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let i;switch(n>=17?i=og.evening:n>=12?i=og.afternoon:n>=4?i=og.morning:i=og.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ud.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):ud.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):qr(n,e.length)},k:function(t,e,r){let n=t.getHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):qr(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):ud.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):ud.s(t,e)},S:function(t,e){return ud.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return Yq(n);case"XXXX":case"XX":return of(n);case"XXXXX":case"XXX":default:return of(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return Yq(n);case"xxxx":case"xx":return of(n);case"xxxxx":case"xxx":default:return of(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Zq(n,":");case"OOOO":default:return"GMT"+of(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Zq(n,":");case"zzzz":default:return"GMT"+of(n,":")}},t:function(t,e,r){const n=Math.trunc(t.getTime()/1e3);return qr(n,e.length)},T:function(t,e,r){const n=t.getTime();return qr(n,e.length)}};function Zq(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+e+qr(o,2)}function Yq(t,e){return t%60===0?(t>0?"-":"+")+qr(Math.abs(t)/60,2):of(t,e)}function of(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=qr(Math.trunc(n/60),2),o=qr(n%60,2);return r+i+e+o}const Kq=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},xie=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},tze=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Kq(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Kq(n,e)).replace("{{time}}",xie(i,e))},rze={p:xie,P:tze},nze=/^D+$/,ize=/^Y+$/,oze=["D","DD","YY","YYYY"];function sze(t){return nze.test(t)}function aze(t){return ize.test(t)}function lze(t,e,r){const n=cze(t,e,r);if(console.warn(n),oze.includes(t))throw new RangeError(n)}function cze(t,e,r){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const uze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dze=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hze=/^'([^]*?)'?$/,fze=/''/g,pze=/[a-zA-Z]/;function wie(t,e,r){const n=X_(),i=r?.locale??n.locale??ZBe,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=jl(t);if(!mBe(a))throw new RangeError("Invalid time value");let l=e.match(dze).map(u=>{const p=u[0];if(p==="p"||p==="P"){const m=rze[p];return m(u,i.formatLong)}return u}).join("").match(uze).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const p=u[0];if(p==="'")return{isToken:!1,value:gze(u)};if(Xq[p])return{isToken:!0,value:u};if(p.match(pze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:u}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(u=>{if(!u.isToken)return u.value;const p=u.value;(!r?.useAdditionalWeekYearTokens&&aze(p)||!r?.useAdditionalDayOfYearTokens&&sze(p))&&lze(p,e,String(t));const m=Xq[p[0]];return m(a,p,i.localize,c)}).join("")}function gze(t){const e=t.match(hze);return e?e[1].replace(fze,"'"):t}function OL(t,e="dd.MM.yyyy, HH:mm",r){if(!t)return"";const n=new Date(t);return isNaN(n.getTime())?(console.warn("Invalid date:",t),""):wie(n,e,{locale:r})}const Im=()=>globalThis.location.origin,Hb=t=>navigator.clipboard.writeText(t);class Qk extends Error{constructor(){super("Aborted"),this.name="AbortError"}}class Hr{constructor(e,r){this.fetchFunction=e,this.options=r,Be(this)}_data=null;_error=null;_isLoading=!1;_isLoaded=!1;_abortController=null;static of(e,r){return new Hr(e,r)}get data(){return this._data}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get error(){return this._error}get errorMessage(){return this._error?.response.errors?.[0].message}abort(){this._abortController?.abort(),this._abortController=null}async fetch(...e){this.abort(),this._abortController=new AbortController;const r=this._abortController.signal;this.options?.skipResetting||this.reset();try{this.setIsLoading(!0);const n=await this.fetchFunction(...e);return r.aborted?{isRight:!1,error:new Qk}:(this.setData(n),{isRight:!0,data:n})}catch(n){return r.aborted?{isRight:!1,error:new Qk}:(console.error(n),this.setError(n),{isRight:!1,error:n})}finally{this.setIsLoading(!1),this.setIsLoaded(!0)}}reset(){this.setIsLoading(!1),this.setData(null),this.setError(null)}setData(e){this._data=e}setIsLoading(e){this._isLoading=e}setIsLoaded(e){this._isLoaded=e}setError(e){this._error=e}}function Sie(t){return!t.isRight&&t.error instanceof Qk}class xL{values;constructor(e){this.values=e,Be(this,{},{autoBind:!0})}setValue(e,r){this.values[e]=r}get isValid(){return Object.values(this.values).every(e=>!!e)}}function mze(t,e="Invariant failed"){if(t==null)throw new Error(e)}const Z_=t=>{if(t&&t.startsWith("/")&&!t.startsWith("//"))return t},Cie=t=>{if(!t)return null;try{const r=JSON.parse(t)?.redirect;return typeof r=="string"?r:null}catch{return null}},kie=t=>{if(t)return JSON.stringify({redirect:t})},q0=()=>{const t=new URLSearchParams(window.location.search);return Z_(t.get("redirect"))},vze=t=>{const e=Z_(t);return!e||e==="/"?"":`?redirect=${encodeURIComponent(e)}`};class Kf{constructor(e){this.apiService=e,Be(this),this.init()}isLoaded=!1;error=null;data=null;get availableSignUp(){return this.availableEmailSignUp||this.availableGoogleOauth||this.availableGithubOauth}get availableEmailSignUp(){return this.data?.availableEmailSignUp}get availableGoogleOauth(){return!!this.data?.google.available}get googleOauthClientId(){if(!this.data?.google.clientId)throw new Error("Invalid Google client id");return this.data?.google.clientId}get availableGithubOauth(){return!!this.data?.github.available}get githubOauthClientId(){if(!this.data?.github.clientId)throw new Error("Invalid Github client id");return this.data?.github.clientId}async init(){await this.request()}async request(){try{const e=await this.apiService.client.configuration();this.setData(e.configuration)}catch(e){this.setError(e),console.error(e)}finally{this.setIsLoaded(!0)}}setData(e){this.data=e}setError(e){this.error=e}setIsLoaded(e){this.isLoaded=e}}Ee.register(Kf,()=>{const t=Ee.get(Da);return new Kf(t)},{scope:"singleton"});class Bk{constructor(e,r){this.authService=e,this.configurationService=r,Be(this)}get isLoaded(){return this.authService.isLoaded&&this.configurationService.isLoaded}}Ee.register(Bk,()=>{const t=Ee.get($o),e=Ee.get(Kf);return new Bk(t,e)},{scope:"singleton"});var Jq={},yze="warn";function bze(){return yze}var Ai;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(Ai||(Ai={}));var lA=function(t,e){return lA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},lA(t,e)};function Mn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");lA(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var vs=function(){return vs=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},vs.apply(this,arguments)};function Oze(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function W0(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wL(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function fp(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(wL(arguments[e]));return t}function Pie(t){return Vr(t).type}function e7(t,e){Vr(t).applyPatches(Lie(e))}function _ie(t,e){e===void 0&&(e=!0);var r=Vr(t);return e?r.snapshot:r.type.getSnapshot(r,!1)}function xze(t){return Vr(t).root.storedValue}function wze(t){return Vr(t).path}function Sze(t){return Vr(t).identifier}function mS(t,e){e===void 0&&(e=!0);try{var r=t();if(r==null)return;if(Un(r))return e?Cze(r)?r:void 0:r;throw ft("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof eoe)return;throw n}}function Cze(t){return Vr(t).observableIsAlive}var Tie=function(){function t(e,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:po.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(t.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var r=this.isAlive;this._state=e;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(t.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return this._hookSubscribers||(this._hookSubscribers=new Qie),this._hookSubscribers.register(e,r)}}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(t.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){this._parent=e,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(t.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||(this.pathAtom=qC("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?_f(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==po.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDetaching",{get:function(){return this.state===po.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=qC("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===po.CREATED){if(this.parent){if(this.parent.state!==po.FINALIZED)return;this.fireHook(Ai.afterAttach)}this.state=po.FINALIZED,e&&e()}}}),Object.defineProperty(t.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=po.DEAD}}),Object.defineProperty(t.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(Ai.beforeDestroy)}}),t}(),Gb=function(t){Mn(e,t);function e(r,n,i,o,s){var a=t.call(this,r,n,i,o)||this;try{a.storedValue=r.createNewInstance(s)}catch(l){throw a.state=po.DEAD,l}return a.state=po.CREATED,a.finalizeCreation(),a}return Object.defineProperty(e.prototype,"root",{get:function(){if(!this.parent)throw ft("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,o=this.subpath!==n;!i&&!o||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return this.type.name+"@"+r+(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===po.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),e}(Tie);Gb.prototype.die=rr(Gb.prototype.die);var kze=1,Pze={onError:function(t){throw t}},ws=function(t){Mn(e,t);function e(r,n,i,o,s){var a=t.call(this,r,n,i,o)||this;if(Object.defineProperty(a,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++kze}),Object.defineProperty(a,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(a,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(a,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a._snapshotComputed=Xr(function(){return a.getSnapshot()}),a.unbox=a.unbox.bind(a),a._initialSnapshot=s,a.identifierAttribute=r.identifierAttribute,n||(a.identifierCache=new Dze),a._childNodes=r.initializeChildNodes(a,a._initialSnapshot),a.identifier=null,a.unnormalizedIdentifier=null,a.identifierAttribute&&a._initialSnapshot){var l=a._initialSnapshot[a.identifierAttribute];if(l===void 0){var c=a._childNodes[a.identifierAttribute];c&&(l=c.value)}if(typeof l!="string"&&typeof l!="number")throw ft("Instance identifier '"+a.identifierAttribute+"' for type '"+a.type.name+"' must be a string or a number");a.identifier=dx(l),a.unnormalizedIdentifier=l}return n?n.root.identifierCache.addNodeToCache(a):a.identifierCache.addNodeToCache(a),a}return Object.defineProperty(e.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(e.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===0&&this.createObservableInstance(r)}}),Object.defineProperty(e.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,o,s;r===void 0&&(r=!0),this._observableInstanceState=1;for(var a=[],l=this.parent;l&&l._observableInstanceState===0;)a.unshift(l),l=l.parent;try{for(var c=W0(a),u=c.next();!u.done;u=c.next()){var p=u.value;p.createObservableInstanceIfNeeded(!1)}}catch(O){n={error:O}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var m=this.type;try{this.storedValue=m.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,m.finalizeNewInstance(this,this.storedValue)}catch(O){throw this.state=po.DEAD,O}finally{this._isRunningAction=!1}if(this._observableInstanceState=2,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Am,this.state=po.CREATED,r){this.fireHook(Ai.afterCreate),this.finalizeCreation();try{for(var v=W0(a.reverse()),b=v.next();!b.done;b=v.next()){var p=b.value;p.fireHook(Ai.afterCreate),p.finalizeCreation()}}catch(O){o={error:O}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(o)throw o.error}}}}}),Object.defineProperty(e.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(Ai.beforeDetach);var r=this.state;this.state=po.DETACHING;var n=this.root,i=n.environment,o=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=o}finally{this.state=r}}}}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,o=n!==this.subpath;!i&&!o||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(Ai.afterAttach)):o&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(vt?vt(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===2?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(e.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(e.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(e.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=bze();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw ft(i);case"warn":Xze(i)}}}}),Object.defineProperty(e.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&_f(r.subpath)||"",o=r.actionContext||Iie();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var s="";if(o&&o.name!=null){var a=o&&o.context&&wze(o.context)||n;s=a+"."+o.name+"()"}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '"+this.type.name+"', Path upon death: '"+n+"', Subpath: '"+i+"', Action: '"+s+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree."}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Am),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):Mie(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(e.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw ft("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(e.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+r+n+(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var o=W0(r.getChildren()),s=o.next();!s.done;s=o.next()){var a=s.value;a.finalizeCreation()}}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}r.fireInternalHook(Ai.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw ft("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(e.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=Xb(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var o=n8e(i.path),s=Fze(r,o.slice(0,-1));s.applyPatchLocally(o[o.length-1],i)})}),this._applySnapshot=Xb(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Pf(this.storedValue,"$treenode",this),Pf(this.storedValue,"toJSON",Vze)}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===po.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==0&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit("dispose"),this._internalEventsClear("dispose"))}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister("snapshot",r)}}),Object.defineProperty(e.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit("snapshot",r)}}),Object.defineProperty(e.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister("patch",r)}}),Object.defineProperty(e.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers("patch")){var i=Uze({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),o=wL(Kze(i),2),s=o[0],a=o[1];this._internalEventsEmit("patch",s,a)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(e.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas("dispose",r)}}),Object.defineProperty(e.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister("dispose",r,!0);return}throw ft("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(e.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas("dispose",r))throw ft("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister("dispose",r)}}),Object.defineProperty(e.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(e.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var o={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){i.removeMiddleware(o)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(e.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=Iu(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},Pze);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(e.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(e.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new Qie),this._internalEvents.register(r,n,i)}}),Object.defineProperty(e.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];this._internalEvents&&(n=this._internalEvents).emit.apply(n,fp([r],i))}}),Object.defineProperty(e.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(e.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),e}(Tie);ws.prototype.createObservableInstance=rr(ws.prototype.createObservableInstance);ws.prototype.detach=rr(ws.prototype.detach);ws.prototype.die=rr(ws.prototype.die);var Eie,yr;(function(t){t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=4]="Boolean",t[t.Date=8]="Date",t[t.Literal=16]="Literal",t[t.Array=32]="Array",t[t.Map=64]="Map",t[t.Object=128]="Object",t[t.Frozen=256]="Frozen",t[t.Optional=512]="Optional",t[t.Reference=1024]="Reference",t[t.Identifier=2048]="Identifier",t[t.Late=4096]="Late",t[t.Refinement=8192]="Refinement",t[t.Union=16384]="Union",t[t.Null=32768]="Null",t[t.Undefined=65536]="Undefined",t[t.Integer=131072]="Integer",t[t.Custom=262144]="Custom",t[t.SnapshotProcessor=524288]="SnapshotProcessor",t[t.Lazy=1048576]="Lazy",t[t.Finite=2097152]="Finite",t[t.Float=4194304]="Float"})(yr||(yr={}));var Rie="cannotDetermine",_ze=Symbol("$type"),_u=function(){function t(e){Object.defineProperty(this,Eie,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return gu(this,e),this.instantiate(null,"",r,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){throw ft("unimplemented method")}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(t.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=Nie(e);if(n){var i=Pie(e);return this.isAssignableFrom(i)?Ss():Rs(r,e)}return this.isValidSnapshot(e,r)}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:"",type:this}]).length===0}}),Object.defineProperty(t.prototype,"Type",{get:function(){throw ft("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TypeWithoutSTN",{get:function(){throw ft("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){throw ft("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){throw ft("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),t}();Eie=_ze;_u.prototype.create=rr(_u.prototype.create);var jm=function(t){Mn(e,t);function e(r){var n=t.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),t.prototype.create.call(this,r,n)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===dx(n[r.identifierAttribute])}}),Object.defineProperty(e.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Un(n)&&Vr(n)===r?!0:r.type===this&&Vie(n)&&!Un(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=this.tryToReconcileNode(r,n);if(s)return r.setParent(i,o),r;if(r.die(),Un(n)&&this.isAssignableFrom(Pie(n))){var a=Vr(n);return a.setParent(i,o),a}return this.instantiate(i,o,void 0,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(_u);jm.prototype.create=rr(jm.prototype.create);var pp=function(t){Mn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var s=this.instantiate(i,o,void 0,n);return r.die(),s}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(_u);function ah(t){return typeof t=="object"&&t&&t.isType===!0}var Tze=1,U0;function Iie(){return U0}function jie(){return Tze++}function cA(t,e){var r=Vr(t.context);t.type==="action"&&r.assertAlive({actionContext:t});var n=r._isRunningAction;r._isRunningAction=!0;var i=U0;U0=t;try{return Rze(r,t,e)}finally{U0=i,r._isRunningAction=n}}function $ie(t){if(t)return t.type==="action"?t:t.parentActionEvent}function Xb(t,e,r){var n=function(){var i=jie(),o=U0,s=$ie(o);return cA({type:"action",name:e,id:i,args:Bie(arguments),context:t,tree:xze(t),rootId:o?o.rootId:i,parentId:o?o.id:0,allParentIds:o?fp(o.allParentIds,[o.id]):[],parentEvent:o,parentActionEvent:s},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var Eze=function(){function t(e,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=e;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e){var r=e[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),t}();function Rze(t,e,r){var n=new Eze(t,r);if(n.isEmpty)return rr(r).apply(null,e.args);var i=null;function o(s){var a=n.getNextMiddleware(),l=a&&a.handler;if(!l)return rr(r).apply(null,s.args);if(!a.includeHooks&&Ai[s.name])return o(s);function c(p,m){i=o(p),m&&(i=m(i))}function u(p){i=p}return l(s,c,u),i}return o(e)}function Ize(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: "+e+">"}}function Aie(t){return typeof t=="function"?"<function"+(t.name?" "+t.name:"")+">":Un(t)?"<"+t+">":"`"+Ize(t)+"`"}function jze(t){return t.length<280?t:t.substring(0,272)+"......"+t.substring(t.length-8)}function $ze(t){var e=t.value,r=t.context[t.context.length-1].type,n=t.context.map(function(a){var l=a.path;return l}).filter(function(a){return a.length>0}).join("/"),i=n.length>0?'at path "/'+n+'" ':"",o=Un(e)?"value of type "+Vr(e).type.name+":":Zb(e)?"value":"snapshot",s=r&&Un(e)&&r.is(Vr(e).snapshot);return""+i+o+" "+Aie(e)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(t.message?" ("+t.message+")":"")+(r?b8e(r)||Zb(e)?".":", expected an instance of `"+r.name+"` or a snapshot like `"+r.describe()+"` instead."+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function SL(t,e,r){return t.concat([{path:e,type:r}])}function Ss(){return $m}function Rs(t,e,r){return[{context:t,value:e,message:r}]}function Y_(t){return t.reduce(function(e,r){return e.concat(r)},[])}function gu(t,e){Zze()&&Aze(t,e)}function Aze(t,e){var r=t.validate(e,[{path:"",type:t}]);if(r.length>0)throw ft(Nze(t,e,r))}function Nze(t,e,r){if(r.length!==0)return"Error while converting "+jze(Aie(e))+" to `"+t.name+`\`:
|
|
1245
|
+
`,sBe=(t,e,r,n)=>t();function aBe(t,e=sBe){return{getProject(r,n){return e(i=>t.request(KQe,r,{...n,...i}),"getProject","query",r)},createEndpoint(r,n){return e(i=>t.request(JQe,r,{...n,...i}),"createEndpoint","mutation",r)},deleteEndpoint(r,n){return e(i=>t.request(e3e,r,{...n,...i}),"deleteEndpoint","mutation",r)},findForeignKey(r,n){return e(i=>t.request(t3e,r,{...n,...i}),"findForeignKey","query",r)},GetRevisionChanges(r,n){return e(i=>t.request(r3e,r,{...n,...i}),"GetRevisionChanges","query",r)},GetTableChanges(r,n){return e(i=>t.request(n3e,r,{...n,...i}),"GetTableChanges","query",r)},confirmEmailCode(r,n){return e(i=>t.request(i3e,r,{...n,...i}),"confirmEmailCode","mutation",r)},GetProjectEndpoints(r,n){return e(i=>t.request(o3e,r,{...n,...i}),"GetProjectEndpoints","query",r)},loginGithub(r,n){return e(i=>t.request(s3e,r,{...n,...i}),"loginGithub","mutation",r)},loginGoogle(r,n){return e(i=>t.request(a3e,r,{...n,...i}),"loginGoogle","mutation",r)},login(r,n){return e(i=>t.request(l3e,r,{...n,...i}),"login","mutation",r)},getMigrations(r,n){return e(i=>t.request(c3e,r,{...n,...i}),"getMigrations","query",r)},updateProject(r,n){return e(i=>t.request(u3e,r,{...n,...i}),"updateProject","mutation",r)},signUp(r,n){return e(i=>t.request(d3e,r,{...n,...i}),"signUp","mutation",r)},setUsername(r,n){return e(i=>t.request(h3e,r,{...n,...i}),"setUsername","mutation",r)},GetUsersProject(r,n){return e(i=>t.request(f3e,r,{...n,...i}),"GetUsersProject","query",r)},SearchUsers(r,n){return e(i=>t.request(p3e,r,{...n,...i}),"SearchUsers","query",r)},AddUserToProject(r,n){return e(i=>t.request(g3e,r,{...n,...i}),"AddUserToProject","mutation",r)},RemoveUserFromProject(r,n){return e(i=>t.request(m3e,r,{...n,...i}),"RemoveUserFromProject","mutation",r)},UpdateUserProjectRole(r,n){return e(i=>t.request(v3e,r,{...n,...i}),"UpdateUserProjectRole","mutation",r)},CreateUser(r,n){return e(i=>t.request(y3e,r,{...n,...i}),"CreateUser","mutation",r)},configuration(r,n){return e(i=>t.request(b3e,r,{...n,...i}),"configuration","query",r)},getMe(r,n){return e(i=>t.request(O3e,r,{...n,...i}),"getMe","query",r)},CreateBranchByRevisionIdMst(r,n){return e(i=>t.request(x3e,r,{...n,...i}),"CreateBranchByRevisionIdMst","mutation",r)},CreateEndpointMst(r,n){return e(i=>t.request(w3e,r,{...n,...i}),"CreateEndpointMst","mutation",r)},CreateProjectMst(r,n){return e(i=>t.request(S3e,r,{...n,...i}),"CreateProjectMst","mutation",r)},CreateRevisionMst(r,n){return e(i=>t.request(C3e,r,{...n,...i}),"CreateRevisionMst","mutation",r)},CreateRowMst(r,n){return e(i=>t.request(k3e,r,{...n,...i}),"CreateRowMst","mutation",r)},CreateTableMst(r,n){return e(i=>t.request(P3e,r,{...n,...i}),"CreateTableMst","mutation",r)},DeleteEndpointMst(r,n){return e(i=>t.request(_3e,r,{...n,...i}),"DeleteEndpointMst","mutation",r)},DeleteProjectMst(r,n){return e(i=>t.request(T3e,r,{...n,...i}),"DeleteProjectMst","mutation",r)},DeleteRowMst(r,n){return e(i=>t.request(E3e,r,{...n,...i}),"DeleteRowMst","mutation",r)},DeleteTableMst(r,n){return e(i=>t.request(R3e,r,{...n,...i}),"DeleteTableMst","mutation",r)},RenameRowMst(r,n){return e(i=>t.request(I3e,r,{...n,...i}),"RenameRowMst","mutation",r)},RenameTableMst(r,n){return e(i=>t.request(j3e,r,{...n,...i}),"RenameTableMst","mutation",r)},RevertChangesMst(r,n){return e(i=>t.request($3e,r,{...n,...i}),"RevertChangesMst","mutation",r)},UpdateRowMst(r,n){return e(i=>t.request(A3e,r,{...n,...i}),"UpdateRowMst","mutation",r)},UpdateTableMst(r,n){return e(i=>t.request(N3e,r,{...n,...i}),"UpdateTableMst","mutation",r)},BranchMst(r,n){return e(i=>t.request(M3e,r,{...n,...i}),"BranchMst","query",r)},BranchesMst(r,n){return e(i=>t.request(D3e,r,{...n,...i}),"BranchesMst","query",r)},GetRowCountForeignKeysTo(r,n){return e(i=>t.request(L3e,r,{...n,...i}),"GetRowCountForeignKeysTo","query",r)},meProjectsMst(r,n){return e(i=>t.request(V3e,r,{...n,...i}),"meProjectsMst","query",r)},ProjectMst(r,n){return e(i=>t.request(F3e,r,{...n,...i}),"ProjectMst","query",r)},ProjectsMst(r,n){return e(i=>t.request(Q3e,r,{...n,...i}),"ProjectsMst","query",r)},RevisionMst(r,n){return e(i=>t.request(B3e,r,{...n,...i}),"RevisionMst","query",r)},RevisionsMst(r,n){return e(i=>t.request(z3e,r,{...n,...i}),"RevisionsMst","query",r)},RowForeignKeysBy(r,n){return e(i=>t.request(q3e,r,{...n,...i}),"RowForeignKeysBy","query",r)},RowMst(r,n){return e(i=>t.request(W3e,r,{...n,...i}),"RowMst","query",r)},RowsMst(r,n){return e(i=>t.request(U3e,r,{...n,...i}),"RowsMst","query",r)},TableForeignKeysBy(r,n){return e(i=>t.request(H3e,r,{...n,...i}),"TableForeignKeysBy","query",r)},TableMst(r,n){return e(i=>t.request(G3e,r,{...n,...i}),"TableMst","query",r)},TablesMst(r,n){return e(i=>t.request(X3e,r,{...n,...i}),"TablesMst","query",r)},findBranches(r,n){return e(i=>t.request(Z3e,r,{...n,...i}),"findBranches","query",r)},findRevisions(r,n){return e(i=>t.request(Y3e,r,{...n,...i}),"findRevisions","query",r)},GetRowChanges(r,n){return e(i=>t.request(K3e,r,{...n,...i}),"GetRowChanges","query",r)},GetTableChangesForFilter(r,n){return e(i=>t.request(J3e,r,{...n,...i}),"GetTableChangesForFilter","query",r)},RowListRows(r,n){return e(i=>t.request(eBe,r,{...n,...i}),"RowListRows","query",r)},RemoveRows(r,n){return e(i=>t.request(tBe,r,{...n,...i}),"RemoveRows","mutation",r)},PatchRowInline(r,n){return e(i=>t.request(rBe,r,{...n,...i}),"PatchRowInline","mutation",r)},GetTableViews(r,n){return e(i=>t.request(nBe,r,{...n,...i}),"GetTableViews","query",r)},UpdateTableViews(r,n){return e(i=>t.request(iBe,r,{...n,...i}),"UpdateTableViews","mutation",r)},searchRows(r,n){return e(i=>t.request(oBe,r,{...n,...i}),"searchRows","query",r)}}}const lBe={BASE_URL:"/",DEV:!1,GIT_BRANCH_NAME:"HEAD",GIT_COMMIT_HASH:"a606396",MODE:"production",PACKAGE_VERSION:"2.1.0-alpha.7",PROD:!0,REACT_APP_ENDPOINT_HOST:"",REACT_APP_ENDPOINT_PORT:"",REACT_APP_ENDPOINT_SERVER_URL:"/endpoint",REACT_APP_GRAPHQL_SERVER_URL:"/graphql",REACT_APP_SWAGGER_SERVER_URL:"/api",SSR:!1};class Lk{constructor(){}get(e){const r=window.__env__?.[e],n=lBe[e];return r||n}}Ee.register(Lk,()=>new Lk,{scope:"singleton"});class Da{constructor(e){this.environmentService=e;const r=this.environmentService.get("REACT_APP_GRAPHQL_SERVER_URL");if(!r)throw new Error("Invalid REACT_APP_GRAPHQL_SERVER_URL");this.graphQLClient=new AQe(r,{responseMiddleware:n=>{const i=n.response?.errors[0].message;return i&&Ur.info({duration:3e3,description:i}),n}}),this.client=aBe(this.graphQLClient)}graphQLClient;client;setToken(e){this.graphQLClient.setHeaders(e?{Authorization:`Bearer ${e}`}:{})}}Ee.register(Da,()=>{const t=Ee.get(Lk);return new Da(t)},{scope:"singleton"});const xr=Ee.get(Da).client,YI="token";class $o{constructor(e,r,n){this.storage=e,this.apiService=r,this.permissionContext=n,Be(this),this.init()}isLoaded=!1;user=null;token=null;async setToken(e){this.token=e,this.apiService.setToken(this.token),this.token&&await this.fetchMe()}async init(){await this.setToken(this.loadToken()),this.signToToken(),this.setIsChecked(!0)}loadToken(){return this.storage.getItem(YI)}async fetchMe(){try{const e=await this.apiService.client.getMe();this.user=e.me,this.permissionContext.setUserRole(e.me.role??null)}catch(e){console.error(e),vt(()=>{this.token=null,this.permissionContext.setUserRole(null)})}}setIsChecked(e){this.isLoaded=e}signToToken(){Iu(()=>this.token,e=>{e?this.storage.setItem(YI,e):this.storage.removeItem(YI)})}logout(){this.token=null,this.user=null,this.apiService.setToken(null),this.permissionContext.setUserRole(null)}}Ee.register($o,()=>{const t=Ee.get(Da),e=Ee.get(xs);return new $o(localStorage,t,e)},{scope:"singleton"});class Vk{constructor(e,r){this.authService=e,this.environmentService=r}async add({revisionId:e,tableId:r,rowId:n,fileId:i,file:o}){const s=`${this.environmentService.get("REACT_APP_SWAGGER_SERVER_URL")}/revision/${e}/tables/${r}/rows/${n}/upload/${i}`,a=await this.upload(s,o);if(!a.ok)throw new Error(a.statusText);return a.json()}async upload(e,r){const n=new FormData;return n.append("file",r,r.name),fetch(e,{method:"POST",headers:{Authorization:`Bearer ${this.authService.token}`},body:n})}}Ee.register(Vk,()=>{const t=Ee.get($o),e=Ee.get(Lk);return new Vk(t,e)},{scope:"singleton"});const cBe=20,aA=(t,e,r=0)=>{if(r>cBe||typeof t!="object"||t===null)return;if(Array.isArray(t)){for(const i of t){const o=aA(i,e,r+1);if(o)return o}return}const n=t;if(n.fileId===e)return n;for(const i of Object.values(n)){const o=aA(i,e,r+1);if(o)return o}},uBe=({revisionId:t,tableId:e,rowId:r,onError:n})=>({upload:E.useCallback(async(o,s,a)=>{const l=Ee.get(Vk),c=wn();Ur.loading({id:c,title:"Uploading..."});try{const u=await l.add({revisionId:t,tableId:e,rowId:r,fileId:o,file:s});if(Ur.update(c,{type:"info",title:"Successfully uploaded!",duration:1500}),u.row?.data){const p=aA(u.row.data,o);p&&a.updateBaseValue(p)}return!0}catch(u){return Ur.update(c,{type:"error",title:"Upload failed",duration:3e3}),n?.(u instanceof Error?u:new Error("Upload failed")),!1}},[t,e,r,n])}),Zn=(t,...e)=>{const r=E.useRef(null),[n,i]=E.useState(e),o=E.useMemo(()=>n.length!==e.length||n.some((s,a)=>s!==e[a])?(i(e),e):n,[e,n]);return r.current||(r.current=Ee.get(t)),E.useEffect(()=>{const s=r.current;return s?.init?.(...o),()=>{s?.dispose?.()}},[o]),r.current};function jl(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Yf(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const yie=6048e5,dBe=864e5;let hBe={};function X_(){return hBe}function Ub(t,e){const r=X_(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,i=jl(t),o=i.getDay(),s=(o<n?7:0)+o-n;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Fk(t){return Ub(t,{weekStartsOn:1})}function bie(t){const e=jl(t),r=e.getFullYear(),n=Yf(t,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const i=Fk(n),o=Yf(t,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const s=Fk(o);return e.getTime()>=i.getTime()?r+1:e.getTime()>=s.getTime()?r:r-1}function Hq(t){const e=jl(t);return e.setHours(0,0,0,0),e}function Gq(t){const e=jl(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function fBe(t,e){const r=Hq(t),n=Hq(e),i=+r-Gq(r),o=+n-Gq(n);return Math.round((i-o)/dBe)}function pBe(t){const e=bie(t),r=Yf(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),Fk(r)}function gBe(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function mBe(t){if(!gBe(t)&&typeof t!="number")return!1;const e=jl(t);return!isNaN(Number(e))}function vBe(t){const e=jl(t),r=Yf(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}const yBe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bBe=(t,e,r)=>{let n;const i=yBe[t];return typeof i=="string"?n=i:e===1?n=i.one:n=i.other.replace("{{count}}",e.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function KI(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const OBe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xBe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wBe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},SBe={date:KI({formats:OBe,defaultWidth:"full"}),time:KI({formats:xBe,defaultWidth:"full"}),dateTime:KI({formats:wBe,defaultWidth:"full"})},CBe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kBe=(t,e,r,n)=>CBe[t];function Hy(t){return(e,r)=>{const n=r?.context?String(r.context):"standalone";let i;if(n==="formatting"&&t.formattingValues){const s=t.defaultFormattingWidth||t.defaultWidth,a=r?.width?String(r.width):s;i=t.formattingValues[a]||t.formattingValues[s]}else{const s=t.defaultWidth,a=r?.width?String(r.width):t.defaultWidth;i=t.values[a]||t.values[s]}const o=t.argumentCallback?t.argumentCallback(e):e;return i[o]}}const PBe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_Be={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},TBe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},EBe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},RBe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},IBe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jBe=(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},$Be={ordinalNumber:jBe,era:Hy({values:PBe,defaultWidth:"wide"}),quarter:Hy({values:_Be,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Hy({values:TBe,defaultWidth:"wide"}),day:Hy({values:EBe,defaultWidth:"wide"}),dayPeriod:Hy({values:RBe,defaultWidth:"wide",formattingValues:IBe,defaultFormattingWidth:"wide"})};function Gy(t){return(e,r={})=>{const n=r.width,i=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;const s=o[0],a=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?NBe(a,p=>p.test(s)):ABe(a,p=>p.test(s));let c;c=t.valueCallback?t.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;const u=e.slice(s.length);return{value:c,rest:u}}}function ABe(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function NBe(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return r}function MBe(t){return(e,r={})=>{const n=e.match(t.matchPattern);if(!n)return null;const i=n[0],o=e.match(t.parsePattern);if(!o)return null;let s=t.valueCallback?t.valueCallback(o[0]):o[0];s=r.valueCallback?r.valueCallback(s):s;const a=e.slice(i.length);return{value:s,rest:a}}}const DBe=/^(\d+)(th|st|nd|rd)?/i,LBe=/\d+/i,VBe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},FBe={any:[/^b/i,/^(a|c)/i]},QBe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BBe={any:[/1/i,/2/i,/3/i,/4/i]},zBe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qBe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},WBe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},UBe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},HBe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},GBe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},XBe={ordinalNumber:MBe({matchPattern:DBe,parsePattern:LBe,valueCallback:t=>parseInt(t,10)}),era:Gy({matchPatterns:VBe,defaultMatchWidth:"wide",parsePatterns:FBe,defaultParseWidth:"any"}),quarter:Gy({matchPatterns:QBe,defaultMatchWidth:"wide",parsePatterns:BBe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Gy({matchPatterns:zBe,defaultMatchWidth:"wide",parsePatterns:qBe,defaultParseWidth:"any"}),day:Gy({matchPatterns:WBe,defaultMatchWidth:"wide",parsePatterns:UBe,defaultParseWidth:"any"}),dayPeriod:Gy({matchPatterns:HBe,defaultMatchWidth:"any",parsePatterns:GBe,defaultParseWidth:"any"})},ZBe={code:"en-US",formatDistance:bBe,formatLong:SBe,formatRelative:kBe,localize:$Be,match:XBe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function YBe(t){const e=jl(t);return fBe(e,vBe(e))+1}function KBe(t){const e=jl(t),r=+Fk(e)-+pBe(e);return Math.round(r/yie)+1}function Oie(t,e){const r=jl(t),n=r.getFullYear(),i=X_(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=Yf(t,0);s.setFullYear(n+1,0,o),s.setHours(0,0,0,0);const a=Ub(s,e),l=Yf(t,0);l.setFullYear(n,0,o),l.setHours(0,0,0,0);const c=Ub(l,e);return r.getTime()>=a.getTime()?n+1:r.getTime()>=c.getTime()?n:n-1}function JBe(t,e){const r=X_(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Oie(t,e),o=Yf(t,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),Ub(o,e)}function eze(t,e){const r=jl(t),n=+Ub(r,e)-+JBe(r,e);return Math.round(n/yie)+1}function qr(t,e){const r=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return r+n}const ud={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return qr(e==="yy"?n%100:n,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):qr(r+1,2)},d(t,e){return qr(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return qr(t.getHours()%12||12,e.length)},H(t,e){return qr(t.getHours(),e.length)},m(t,e){return qr(t.getMinutes(),e.length)},s(t,e){return qr(t.getSeconds(),e.length)},S(t,e){const r=e.length,n=t.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return qr(i,e.length)}},og={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xq={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const n=t.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return ud.y(t,e)},Y:function(t,e,r,n){const i=Oie(t,n),o=i>0?i:1-i;if(e==="YY"){const s=o%100;return qr(s,2)}return e==="Yo"?r.ordinalNumber(o,{unit:"year"}):qr(o,e.length)},R:function(t,e){const r=bie(t);return qr(r,e.length)},u:function(t,e){const r=t.getFullYear();return qr(r,e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return qr(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return qr(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return ud.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return qr(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const i=eze(t,n);return e==="wo"?r.ordinalNumber(i,{unit:"week"}):qr(i,e.length)},I:function(t,e,r){const n=KBe(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):qr(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):ud.d(t,e)},D:function(t,e,r){const n=YBe(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):qr(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const i=t.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return qr(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const i=t.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return qr(o,e.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),i=n===0?7:n;switch(e){case"i":return String(i);case"ii":return qr(i,e.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let i;switch(n===12?i=og.noon:n===0?i=og.midnight:i=n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let i;switch(n>=17?i=og.evening:n>=12?i=og.afternoon:n>=4?i=og.morning:i=og.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ud.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):ud.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):qr(n,e.length)},k:function(t,e,r){let n=t.getHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):qr(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):ud.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):ud.s(t,e)},S:function(t,e){return ud.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return Yq(n);case"XXXX":case"XX":return of(n);case"XXXXX":case"XXX":default:return of(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return Yq(n);case"xxxx":case"xx":return of(n);case"xxxxx":case"xxx":default:return of(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Zq(n,":");case"OOOO":default:return"GMT"+of(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Zq(n,":");case"zzzz":default:return"GMT"+of(n,":")}},t:function(t,e,r){const n=Math.trunc(t.getTime()/1e3);return qr(n,e.length)},T:function(t,e,r){const n=t.getTime();return qr(n,e.length)}};function Zq(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+e+qr(o,2)}function Yq(t,e){return t%60===0?(t>0?"-":"+")+qr(Math.abs(t)/60,2):of(t,e)}function of(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),i=qr(Math.trunc(n/60),2),o=qr(n%60,2);return r+i+e+o}const Kq=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},xie=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},tze=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return Kq(t,e);let o;switch(n){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",Kq(n,e)).replace("{{time}}",xie(i,e))},rze={p:xie,P:tze},nze=/^D+$/,ize=/^Y+$/,oze=["D","DD","YY","YYYY"];function sze(t){return nze.test(t)}function aze(t){return ize.test(t)}function lze(t,e,r){const n=cze(t,e,r);if(console.warn(n),oze.includes(t))throw new RangeError(n)}function cze(t,e,r){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const uze=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dze=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,hze=/^'([^]*?)'?$/,fze=/''/g,pze=/[a-zA-Z]/;function wie(t,e,r){const n=X_(),i=r?.locale??n.locale??ZBe,o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=jl(t);if(!mBe(a))throw new RangeError("Invalid time value");let l=e.match(dze).map(u=>{const p=u[0];if(p==="p"||p==="P"){const m=rze[p];return m(u,i.formatLong)}return u}).join("").match(uze).map(u=>{if(u==="''")return{isToken:!1,value:"'"};const p=u[0];if(p==="'")return{isToken:!1,value:gze(u)};if(Xq[p])return{isToken:!0,value:u};if(p.match(pze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:u}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(u=>{if(!u.isToken)return u.value;const p=u.value;(!r?.useAdditionalWeekYearTokens&&aze(p)||!r?.useAdditionalDayOfYearTokens&&sze(p))&&lze(p,e,String(t));const m=Xq[p[0]];return m(a,p,i.localize,c)}).join("")}function gze(t){const e=t.match(hze);return e?e[1].replace(fze,"'"):t}function OL(t,e="dd.MM.yyyy, HH:mm",r){if(!t)return"";const n=new Date(t);return isNaN(n.getTime())?(console.warn("Invalid date:",t),""):wie(n,e,{locale:r})}const Im=()=>globalThis.location.origin,Hb=t=>navigator.clipboard.writeText(t);class Qk extends Error{constructor(){super("Aborted"),this.name="AbortError"}}class Hr{constructor(e,r){this.fetchFunction=e,this.options=r,Be(this)}_data=null;_error=null;_isLoading=!1;_isLoaded=!1;_abortController=null;static of(e,r){return new Hr(e,r)}get data(){return this._data}get isLoading(){return this._isLoading}get isLoaded(){return this._isLoaded}get error(){return this._error}get errorMessage(){return this._error?.response.errors?.[0].message}abort(){this._abortController?.abort(),this._abortController=null}async fetch(...e){this.abort(),this._abortController=new AbortController;const r=this._abortController.signal;this.options?.skipResetting||this.reset();try{this.setIsLoading(!0);const n=await this.fetchFunction(...e);return r.aborted?{isRight:!1,error:new Qk}:(this.setData(n),{isRight:!0,data:n})}catch(n){return r.aborted?{isRight:!1,error:new Qk}:(console.error(n),this.setError(n),{isRight:!1,error:n})}finally{this.setIsLoading(!1),this.setIsLoaded(!0)}}reset(){this.setIsLoading(!1),this.setData(null),this.setError(null)}setData(e){this._data=e}setIsLoading(e){this._isLoading=e}setIsLoaded(e){this._isLoaded=e}setError(e){this._error=e}}function Sie(t){return!t.isRight&&t.error instanceof Qk}class xL{values;constructor(e){this.values=e,Be(this,{},{autoBind:!0})}setValue(e,r){this.values[e]=r}get isValid(){return Object.values(this.values).every(e=>!!e)}}function mze(t,e="Invariant failed"){if(t==null)throw new Error(e)}const Z_=t=>{if(t&&t.startsWith("/")&&!t.startsWith("//"))return t},Cie=t=>{if(!t)return null;try{const r=JSON.parse(t)?.redirect;return typeof r=="string"?r:null}catch{return null}},kie=t=>{if(t)return JSON.stringify({redirect:t})},q0=()=>{const t=new URLSearchParams(window.location.search);return Z_(t.get("redirect"))},vze=t=>{const e=Z_(t);return!e||e==="/"?"":`?redirect=${encodeURIComponent(e)}`};class Kf{constructor(e){this.apiService=e,Be(this),this.init()}isLoaded=!1;error=null;data=null;get availableSignUp(){return this.availableEmailSignUp||this.availableGoogleOauth||this.availableGithubOauth}get availableEmailSignUp(){return this.data?.availableEmailSignUp}get availableGoogleOauth(){return!!this.data?.google.available}get googleOauthClientId(){if(!this.data?.google.clientId)throw new Error("Invalid Google client id");return this.data?.google.clientId}get availableGithubOauth(){return!!this.data?.github.available}get githubOauthClientId(){if(!this.data?.github.clientId)throw new Error("Invalid Github client id");return this.data?.github.clientId}async init(){await this.request()}async request(){try{const e=await this.apiService.client.configuration();this.setData(e.configuration)}catch(e){this.setError(e),console.error(e)}finally{this.setIsLoaded(!0)}}setData(e){this.data=e}setError(e){this.error=e}setIsLoaded(e){this.isLoaded=e}}Ee.register(Kf,()=>{const t=Ee.get(Da);return new Kf(t)},{scope:"singleton"});class Bk{constructor(e,r){this.authService=e,this.configurationService=r,Be(this)}get isLoaded(){return this.authService.isLoaded&&this.configurationService.isLoaded}}Ee.register(Bk,()=>{const t=Ee.get($o),e=Ee.get(Kf);return new Bk(t,e)},{scope:"singleton"});var Jq={},yze="warn";function bze(){return yze}var Ai;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(Ai||(Ai={}));var lA=function(t,e){return lA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},lA(t,e)};function Mn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");lA(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var vs=function(){return vs=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},vs.apply(this,arguments)};function Oze(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function W0(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wL(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function fp(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(wL(arguments[e]));return t}function Pie(t){return Vr(t).type}function e7(t,e){Vr(t).applyPatches(Lie(e))}function _ie(t,e){e===void 0&&(e=!0);var r=Vr(t);return e?r.snapshot:r.type.getSnapshot(r,!1)}function xze(t){return Vr(t).root.storedValue}function wze(t){return Vr(t).path}function Sze(t){return Vr(t).identifier}function mS(t,e){e===void 0&&(e=!0);try{var r=t();if(r==null)return;if(Un(r))return e?Cze(r)?r:void 0:r;throw ft("The reference to be checked is not one of node, null or undefined")}catch(n){if(n instanceof eoe)return;throw n}}function Cze(t){return Vr(t).observableIsAlive}var Tie=function(){function t(e,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:po.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(t.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var r=this.isAlive;this._state=e;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(t.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return this._hookSubscribers||(this._hookSubscribers=new Qie),this._hookSubscribers.register(e,r)}}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(t.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){this._parent=e,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(t.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||(this.pathAtom=qC("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?_f(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==po.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDetaching",{get:function(){return this.state===po.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=qC("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===po.CREATED){if(this.parent){if(this.parent.state!==po.FINALIZED)return;this.fireHook(Ai.afterAttach)}this.state=po.FINALIZED,e&&e()}}}),Object.defineProperty(t.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=po.DEAD}}),Object.defineProperty(t.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(Ai.beforeDestroy)}}),t}(),Gb=function(t){Mn(e,t);function e(r,n,i,o,s){var a=t.call(this,r,n,i,o)||this;try{a.storedValue=r.createNewInstance(s)}catch(l){throw a.state=po.DEAD,l}return a.state=po.CREATED,a.finalizeCreation(),a}return Object.defineProperty(e.prototype,"root",{get:function(){if(!this.parent)throw ft("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,o=this.subpath!==n;!i&&!o||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return this.type.name+"@"+r+(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===po.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),e}(Tie);Gb.prototype.die=rr(Gb.prototype.die);var kze=1,Pze={onError:function(t){throw t}},ws=function(t){Mn(e,t);function e(r,n,i,o,s){var a=t.call(this,r,n,i,o)||this;if(Object.defineProperty(a,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++kze}),Object.defineProperty(a,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(a,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(a,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(a,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a._snapshotComputed=Xr(function(){return a.getSnapshot()}),a.unbox=a.unbox.bind(a),a._initialSnapshot=s,a.identifierAttribute=r.identifierAttribute,n||(a.identifierCache=new Dze),a._childNodes=r.initializeChildNodes(a,a._initialSnapshot),a.identifier=null,a.unnormalizedIdentifier=null,a.identifierAttribute&&a._initialSnapshot){var l=a._initialSnapshot[a.identifierAttribute];if(l===void 0){var c=a._childNodes[a.identifierAttribute];c&&(l=c.value)}if(typeof l!="string"&&typeof l!="number")throw ft("Instance identifier '"+a.identifierAttribute+"' for type '"+a.type.name+"' must be a string or a number");a.identifier=dx(l),a.unnormalizedIdentifier=l}return n?n.root.identifierCache.addNodeToCache(a):a.identifierCache.addNodeToCache(a),a}return Object.defineProperty(e.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(e.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===0&&this.createObservableInstance(r)}}),Object.defineProperty(e.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,o,s;r===void 0&&(r=!0),this._observableInstanceState=1;for(var a=[],l=this.parent;l&&l._observableInstanceState===0;)a.unshift(l),l=l.parent;try{for(var c=W0(a),u=c.next();!u.done;u=c.next()){var p=u.value;p.createObservableInstanceIfNeeded(!1)}}catch(O){n={error:O}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var m=this.type;try{this.storedValue=m.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,m.finalizeNewInstance(this,this.storedValue)}catch(O){throw this.state=po.DEAD,O}finally{this._isRunningAction=!1}if(this._observableInstanceState=2,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Am,this.state=po.CREATED,r){this.fireHook(Ai.afterCreate),this.finalizeCreation();try{for(var v=W0(a.reverse()),b=v.next();!b.done;b=v.next()){var p=b.value;p.fireHook(Ai.afterCreate),p.finalizeCreation()}}catch(O){o={error:O}}finally{try{b&&!b.done&&(s=v.return)&&s.call(v)}finally{if(o)throw o.error}}}}}),Object.defineProperty(e.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(Ai.beforeDetach);var r=this.state;this.state=po.DETACHING;var n=this.root,i=n.environment,o=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=o}finally{this.state=r}}}}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,o=n!==this.subpath;!i&&!o||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(Ai.afterAttach)):o&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(vt?vt(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===2?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(e.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(e.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(e.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=bze();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw ft(i);case"warn":Xze(i)}}}}),Object.defineProperty(e.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&_f(r.subpath)||"",o=r.actionContext||Iie();o&&o.type!=="action"&&o.parentActionEvent&&(o=o.parentActionEvent);var s="";if(o&&o.name!=null){var a=o&&o.context&&wze(o.context)||n;s=a+"."+o.name+"()"}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '"+this.type.name+"', Path upon death: '"+n+"', Subpath: '"+i+"', Action: '"+s+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree."}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Am),this._autoUnbox=!1;try{return this._observableInstanceState===2?this.type.getChildren(this):Mie(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(e.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw ft("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(e.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+r+n+(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var o=W0(r.getChildren()),s=o.next();!s.done;s=o.next()){var a=s.value;a.finalizeCreation()}}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}r.fireInternalHook(Ai.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw ft("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(e.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=Xb(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var o=n8e(i.path),s=Fze(r,o.slice(0,-1));s.applyPatchLocally(o[o.length-1],i)})}),this._applySnapshot=Xb(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Pf(this.storedValue,"$treenode",this),Pf(this.storedValue,"toJSON",Vze)}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===po.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==0&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit("dispose"),this._internalEventsClear("dispose"))}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister("snapshot",r)}}),Object.defineProperty(e.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit("snapshot",r)}}),Object.defineProperty(e.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister("patch",r)}}),Object.defineProperty(e.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers("patch")){var i=Uze({},r,{path:n.path.substr(this.path.length)+"/"+r.path}),o=wL(Kze(i),2),s=o[0],a=o[1];this._internalEventsEmit("patch",s,a)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(e.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas("dispose",r)}}),Object.defineProperty(e.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister("dispose",r,!0);return}throw ft("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(e.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas("dispose",r))throw ft("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister("dispose",r)}}),Object.defineProperty(e.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(e.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var o={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(o):this.middlewares=[o],function(){i.removeMiddleware(o)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(e.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=Iu(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},Pze);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(e.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(e.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new Qie),this._internalEvents.register(r,n,i)}}),Object.defineProperty(e.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];this._internalEvents&&(n=this._internalEvents).emit.apply(n,fp([r],i))}}),Object.defineProperty(e.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(e.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),e}(Tie);ws.prototype.createObservableInstance=rr(ws.prototype.createObservableInstance);ws.prototype.detach=rr(ws.prototype.detach);ws.prototype.die=rr(ws.prototype.die);var Eie,yr;(function(t){t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=4]="Boolean",t[t.Date=8]="Date",t[t.Literal=16]="Literal",t[t.Array=32]="Array",t[t.Map=64]="Map",t[t.Object=128]="Object",t[t.Frozen=256]="Frozen",t[t.Optional=512]="Optional",t[t.Reference=1024]="Reference",t[t.Identifier=2048]="Identifier",t[t.Late=4096]="Late",t[t.Refinement=8192]="Refinement",t[t.Union=16384]="Union",t[t.Null=32768]="Null",t[t.Undefined=65536]="Undefined",t[t.Integer=131072]="Integer",t[t.Custom=262144]="Custom",t[t.SnapshotProcessor=524288]="SnapshotProcessor",t[t.Lazy=1048576]="Lazy",t[t.Finite=2097152]="Finite",t[t.Float=4194304]="Float"})(yr||(yr={}));var Rie="cannotDetermine",_ze=Symbol("$type"),_u=function(){function t(e){Object.defineProperty(this,Eie,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return gu(this,e),this.instantiate(null,"",r,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){throw ft("unimplemented method")}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(t.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=Nie(e);if(n){var i=Pie(e);return this.isAssignableFrom(i)?Ss():Rs(r,e)}return this.isValidSnapshot(e,r)}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:"",type:this}]).length===0}}),Object.defineProperty(t.prototype,"Type",{get:function(){throw ft("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TypeWithoutSTN",{get:function(){throw ft("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){throw ft("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){throw ft("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),t}();Eie=_ze;_u.prototype.create=rr(_u.prototype.create);var jm=function(t){Mn(e,t);function e(r){var n=t.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),t.prototype.create.call(this,r,n)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===dx(n[r.identifierAttribute])}}),Object.defineProperty(e.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Un(n)&&Vr(n)===r?!0:r.type===this&&Vie(n)&&!Un(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=this.tryToReconcileNode(r,n);if(s)return r.setParent(i,o),r;if(r.die(),Un(n)&&this.isAssignableFrom(Pie(n))){var a=Vr(n);return a.setParent(i,o),a}return this.instantiate(i,o,void 0,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(_u);jm.prototype.create=rr(jm.prototype.create);var pp=function(t){Mn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var s=this.instantiate(i,o,void 0,n);return r.die(),s}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(_u);function ah(t){return typeof t=="object"&&t&&t.isType===!0}var Tze=1,U0;function Iie(){return U0}function jie(){return Tze++}function cA(t,e){var r=Vr(t.context);t.type==="action"&&r.assertAlive({actionContext:t});var n=r._isRunningAction;r._isRunningAction=!0;var i=U0;U0=t;try{return Rze(r,t,e)}finally{U0=i,r._isRunningAction=n}}function $ie(t){if(t)return t.type==="action"?t:t.parentActionEvent}function Xb(t,e,r){var n=function(){var i=jie(),o=U0,s=$ie(o);return cA({type:"action",name:e,id:i,args:Bie(arguments),context:t,tree:xze(t),rootId:o?o.rootId:i,parentId:o?o.id:0,allParentIds:o?fp(o.allParentIds,[o.id]):[],parentEvent:o,parentActionEvent:s},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var Eze=function(){function t(e,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=e;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e){var r=e[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),t}();function Rze(t,e,r){var n=new Eze(t,r);if(n.isEmpty)return rr(r).apply(null,e.args);var i=null;function o(s){var a=n.getNextMiddleware(),l=a&&a.handler;if(!l)return rr(r).apply(null,s.args);if(!a.includeHooks&&Ai[s.name])return o(s);function c(p,m){i=o(p),m&&(i=m(i))}function u(p){i=p}return l(s,c,u),i}return o(e)}function Ize(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: "+e+">"}}function Aie(t){return typeof t=="function"?"<function"+(t.name?" "+t.name:"")+">":Un(t)?"<"+t+">":"`"+Ize(t)+"`"}function jze(t){return t.length<280?t:t.substring(0,272)+"......"+t.substring(t.length-8)}function $ze(t){var e=t.value,r=t.context[t.context.length-1].type,n=t.context.map(function(a){var l=a.path;return l}).filter(function(a){return a.length>0}).join("/"),i=n.length>0?'at path "/'+n+'" ':"",o=Un(e)?"value of type "+Vr(e).type.name+":":Zb(e)?"value":"snapshot",s=r&&Un(e)&&r.is(Vr(e).snapshot);return""+i+o+" "+Aie(e)+" is not assignable "+(r?"to type: `"+r.name+"`":"")+(t.message?" ("+t.message+")":"")+(r?b8e(r)||Zb(e)?".":", expected an instance of `"+r.name+"` or a snapshot like `"+r.describe()+"` instead."+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function SL(t,e,r){return t.concat([{path:e,type:r}])}function Ss(){return $m}function Rs(t,e,r){return[{context:t,value:e,message:r}]}function Y_(t){return t.reduce(function(e,r){return e.concat(r)},[])}function gu(t,e){Zze()&&Aze(t,e)}function Aze(t,e){var r=t.validate(e,[{path:"",type:t}]);if(r.length>0)throw ft(Nze(t,e,r))}function Nze(t,e,r){if(r.length!==0)return"Error while converting "+jze(Aie(e))+" to `"+t.name+`\`:
|
|
1246
1246
|
|
|
1247
1247
|
`+r.map($ze).join(`
|
|
1248
1248
|
`)}var Mze=0,Dze=function(){function t(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:Mze++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:jt.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:jt.map()})}return Object.defineProperty(t.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,r===void 0?1:r+1)}}),Object.defineProperty(t.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e)||0;return this.cacheId+"-"+r}}),Object.defineProperty(t.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){if(r===void 0&&(r=!0),e.identifierAttribute){var n=e.identifier;this.cache.has(n)||this.cache.set(n,jt.array([],K_));var i=this.cache.get(n);if(i.indexOf(e)!==-1)throw ft("Already registered");i.push(e),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(t.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this;qY(e.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(t.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var r=e.identifier,n=this.cache.get(r);n&&(n.remove(e),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(t.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this,n=new t,i=e.path+"/";return fke(this.cache).forEach(function(o){for(var s=wL(o,2),a=s[0],l=s[1],c=!1,u=l.length-1;u>=0;u--){var p=l[u];(p===e||p.path.indexOf(i)===0)&&(n.addNodeToCache(p,!1),l.splice(u,1),l.length||r.cache.delete(a),c=!0)}c&&r.updateLastCacheModificationPerId(a)}),n}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);return n?n.some(function(i){return e.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(t.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(o){return e.isAssignableFrom(o.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw ft("Cannot resolve a reference to type '"+e.name+"' with id: '"+r+"' unambigously, there are multiple candidates: "+i.map(function(o){return o.path}).join(", "))}}}),t}();function CL(t,e,r,n,i){var o=Nie(i);if(o){if(o.parent)throw ft("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+(e?e.path:"")+"/"+r+"', but it lives already at '"+o.path+"'");return e&&o.setParent(e,r),o}return new ws(t,e,r,n,i)}function yh(t,e,r,n,i){return new Gb(t,e,r,n,i)}function Lze(t){return t instanceof Gb||t instanceof ws}var po;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CREATED=1]="CREATED",t[t.FINALIZED=2]="FINALIZED",t[t.DETACHING=3]="DETACHING",t[t.DEAD=4]="DEAD"})(po||(po={}));function Un(t){return!!(t&&t.$treenode)}function Vr(t){if(!Un(t))throw ft("Value "+t+" is no MST Node");return t.$treenode}function Nie(t){return t&&t.$treenode||null}function Vze(){return Vr(this).snapshot}function Fze(t,e,r){r===void 0&&(r=!0);var n=t;try{for(var i=0;i<e.length;i++){var o=e[i];if(o===".."){if(n=n.parent,n)continue}else{if(o===".")continue;if(n){if(n instanceof Gb){var s=n.value;Un(s)&&(n=Vr(s))}if(n instanceof ws){var a=n.getChildType(o);if(a&&(n=n.getChildNode(o),n))continue}}}throw ft("Could not resolve '"+o+"' in path '"+(t7(e.slice(0,i))||"/")+"' while resolving '"+t7(e)+"'")}}catch(l){if(!r)return;throw l}return n}function Mie(t){if(!t)return $m;var e=Object.keys(t);if(!e.length)return $m;var r=new Array(e.length);return e.forEach(function(n,i){r[i]=t[n]}),r}var Qze=Object.toString(),$m=Object.freeze([]),Am=Object.freeze({}),K_=VCe().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(K_);function ft(t){return t===void 0&&(t="Illegal state"),new Error("[mobx-state-tree] "+t)}function Bze(t){return t}var zze=Number.isInteger;function qze(t){return Number(t)===t&&t%1!==0}function Wze(t){return Number.isFinite(t)}function Die(t){return Array.isArray(t)||Qa(t)}function Lie(t){return t?Die(t)?t:[t]:$m}function Uze(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++){var i=e[n];for(var o in i)t[o]=i[o]}return t}function Mg(t){var e;if(t===null||typeof t!="object")return!1;var r=Object.getPrototypeOf(t);return r==null?!0:((e=r.constructor)===null||e===void 0?void 0:e.toString())===Qze}function Vie(t){return t!==null&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof RegExp)}function Zb(t,e){return e===void 0&&(e=!0),t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e&&t instanceof Date}function Fie(t){return typeof t!="function"}function Hze(t,e,r){Es(t)?UY(t,e,r):Object.defineProperty(t,e,r)}function Pf(t,e,r){Hze(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}var Gze=function(){function t(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(t.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(e):this.handlers.push(e),function(){n.unregister(e)}}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.handlers.indexOf(e);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,fp(e))})}}),t}(),Qie=function(){function t(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(t.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.eventHandlers&&this.eventHandlers[e];return!!r&&r.hasSubscribers}}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[e];return i||(i=this.eventHandlers[e]=new Gze),i.register(r,n)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];return!!n&&n.has(r)}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];n&&n.unregister(r)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.eventHandlers&&this.eventHandlers[e];o&&(r=o).emit.apply(r,fp(n))}}),t}();function Bie(t){for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}function JI(t,e){return t.indexOf(e)===0}function Xze(t){console.warn(new Error("[mobx-state-tree] "+t))}function Zze(){return typeof process<"u"&&Jq&&Jq.ENABLE_TYPE_CHECK==="true"}function ej(t){typeof queueMicrotask=="function"?queueMicrotask(t):typeof setImmediate=="function"?setImmediate(t):setTimeout(t,1)}function Ws(t){return Yze(t.name,t)}function Yze(t,e){var r=function(){var i=jie(),o=Iie();if(!o)throw ft("a mst flow must always have a parent context");var s=$ie(o);if(!s)throw ft("a mst flow must always have a parent action context");var a={name:t,id:i,tree:o.tree,context:o.context,parentId:o.id,allParentIds:fp(o.allParentIds,[o.id]),rootId:o.rootId,parentEvent:o,parentActionEvent:s},l=arguments;function c(u,p,m){return u.$mst_middleware=r.$mst_middleware,cA(vs(vs({},a),{type:p,args:[m]}),u)}return new Promise(function(u,p){var m,v=function(){m=e.apply(null,arguments),b(void 0)};v.$mst_middleware=r.$mst_middleware,cA(vs(vs({},a),{type:"flow_spawn",args:Bie(l)}),v);function b(S){var w;try{var k=c(function(P){w=m.next(P)},"flow_resume",S);k instanceof Error&&(w=m.throw(k))}catch(P){ej(function(){c(function(_){p(P)},"flow_throw",P)});return}x(w)}function O(S){var w;try{c(function(k){w=m.throw(k)},"flow_resume_error",S)}catch(k){ej(function(){c(function(P){p(k)},"flow_throw",k)});return}x(w)}function x(S){if(S.done){ej(function(){c(function(w){u(w)},"flow_return",S.value)});return}if(!S.value||typeof S.value.then!="function")throw ft("Only promises can be yielded to `async`, got: "+S);return S.value.then(b,O)}})};return r._isFlowAction=!0,r}function Kze(t){if(!("oldValue"in t))throw ft("Patches without `oldValue` field cannot be inversed");return[Jze(t),e8e(t)]}function Jze(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}function e8e(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}function t8e(t){return typeof t=="number"}function _f(t){return t8e(t)===!0?""+t:t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function r8e(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function t7(t){if(t.length===0)return"";var e=function(r){return r.map(_f).join("/")};return t[0]==="."||t[0]===".."?e(t):"/"+e(t)}function n8e(t){var e=t.split("/").map(r8e),r=t===""||t==="."||t===".."||JI(t,"/")||JI(t,"./")||JI(t,"../");if(!r)throw ft("a json path must be either rooted, empty or relative, but got '"+t+"'");return e[0]===""&&e.shift(),e}var tj=Symbol("$preProcessorFailed"),i8e=function(t){Mn(e,t);function e(r,n,i){var o=t.call(this,i||r.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|yr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor("+this._subtype.describe()+")"}}),Object.defineProperty(e.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(e.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return tj}}}),Object.defineProperty(e.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(e.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;o8e(r.type,this,"create"),r instanceof ws&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},k8e(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=Un(o)?o:this.preProcessSnapshot(o),a=this._subtype.instantiate(r,n,i,s);return this._fixNode(a),a}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=this._subtype.reconcile(r,Un(n)?n:this.preProcessSnapshot(n),i,o);return s!==r&&this._fixNode(s),s}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===tj?Rs(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=ah(r)?this._subtype:Un(r)?_ie(r,!1):this.preProcessSnapshotSafe(r);return n===tj?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof jm))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),e}(_u);function o8e(t,e){for(var r,n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];try{for(var s=W0(i),a=s.next();!a.done;a=s.next()){var l=a.value;t[l]=e[l].bind(e)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}function s8e(t,e,r){return new i8e(t,e,r)}var r7="Map.put can only be used to store complex values that have an identifier type attribute";function zie(t,e){var r,n,i=t.getSubTypes();if(i===Rie)return!1;if(i){var o=Lie(i);try{for(var s=W0(o),a=s.next();!a.done;a=s.next()){var l=a.value;if(!zie(l,e))return!1}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}return t instanceof Yb&&e.push(t),!0}var Cd;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO"})(Cd||(Cd={}));var a8e=function(t){Mn(e,t);function e(r,n){return t.call(this,r,jt.ref.enhancer,n)||this}return Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.get.call(this,""+r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.has.call(this,""+r)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.delete.call(this,""+r)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return t.prototype.set.call(this,""+r,n)}}),Object.defineProperty(e.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw ft("Map.put cannot be used to set empty values");if(Un(r)){var n=Vr(r);if(n.identifier===null)throw ft(r7);return this.set(n.identifier,r),r}else if(Vie(r)){var i=Vr(this),o=i.type;if(o.identifierMode!==Cd.YES)throw ft(r7);var s=o.mapIdentifierAttribute,a=r[s];if(!kL(a)){var l=this.put(o.getChildType().create(r,i.environment));return this.put(_ie(l))}var c=dx(a);return this.set(c,r),this.get(c)}else throw ft("Map.put can only be used to store complex values")}}),e}(i_),zk=function(t){Mn(e,t);function e(r,n,i){i===void 0&&(i=[]);var o=t.call(this,r)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Cd.UNKNOWN}),Object.defineProperty(o,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Map}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o._determineIdentifierMode(),o.hookInitializers=i,o}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._determineIdentifierMode(),CL(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Cd.UNKNOWN){var r=[];if(zie(this._subType,r)){var n=r.reduce(function(i,o){if(!o.identifierAttribute)return i;if(i&&i!==o.identifierAttribute)throw ft("The objects in a map should all have the same identifier attribute, expected '"+i+"', but child of type '"+o.name+"' declared attribute '"+o.identifierAttribute+"' as identifier");return o.identifierAttribute},void 0);n?(this.identifierMode=Cd.YES,this.mapIdentifierAttribute=n):this.identifierMode=Cd.NO}}}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,o={};return Object.keys(n).forEach(function(s){o[s]=i.instantiate(r,s,void 0,n[s])}),o}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new a8e(r,this.name)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){BY(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(o){var s=o(n);Object.keys(s).forEach(function(a){var l=s[a],c=Xb(n,a,l);Pf(n,a,c)})}),PM(n,this.willChange),n_(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return qY(r.storedValue)}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw ft("Not a child "+n);return i}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Vr(r.object),i=r.name;n.assertWritable({subpath:i});var o=n.type,s=o._subType;switch(r.type){case"update":{var a=r.newValue,l=r.object.get(i);if(a===l)return null;gu(s,a),r.newValue=s.reconcile(n.getChildNode(i),r.newValue,n,i),o.processIdentifier(i,r.newValue)}break;case"add":gu(s,r.newValue),r.newValue=s.instantiate(n,i,void 0,r.newValue),o.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(e.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Cd.YES&&n instanceof ws){var i=n.identifier;if(i!==r)throw ft("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+i+"', but expected: '"+r+"'")}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Vr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:_f(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:_f(r.name),value:r.newValue.snapshot,oldValue:void 0},n);case"delete":var i=r.oldValue.snapshot;return r.oldValue.die(),void n.emitPatch({op:"remove",path:_f(r.name),oldValue:i},n)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=r.storedValue;switch(i.op){case"add":case"replace":o.set(n,i.value);break;case"remove":o.delete(n);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){gu(this,n);var i=r.storedValue,o={};if(Array.from(i.keys()).forEach(function(a){o[a]=!1}),n)for(var s in n)i.set(s,n[s]),o[""+s]=!0;Object.keys(o).forEach(function(a){o[a]===!1&&i.delete(a)})}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return Mg(r)?Y_(Object.keys(r).map(function(o){return i._subType.validate(r[o],SL(n,o,i._subType))})):Rs(n,r,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Am}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),e}(jm);zk.prototype.applySnapshot=rr(zk.prototype.applySnapshot);function l8e(t){return new zk("Map<string, "+t.name+">",t)}var qk=function(t){Mn(e,t);function e(r,n,i){i===void 0&&(i=[]);var o=t.call(this,r)||this;return Object.defineProperty(o,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Array}),Object.defineProperty(o,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),o.hookInitializers=i,o}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return CL(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,o={};return n.forEach(function(s,a){var l=""+a;o[l]=i.instantiate(r,l,void 0,s)}),o}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=vs(vs({},K_),{name:this.name});return jt.array(Mie(r),n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ml(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(o){var s=o(n);Object.keys(s).forEach(function(a){var l=s[a],c=Xb(n,a,l);Pf(n,a,c)})}),PM(n,this.willChange),n_(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw ft("Not a child: "+n)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Vr(r.object);n.assertWritable({subpath:""+r.index});var i=n.type._subType,o=n.getChildren();switch(r.type){case"update":{if(r.newValue===r.object[r.index])return null;var s=n7(n,i,[o[r.index]],[r.newValue],[r.index]);if(!s)return null;r.newValue=s[0]}break;case"splice":{var a=r.index,l=r.removedCount,c=r.added,u=n7(n,i,o.slice(a,a+l),c,c.map(function(m,v){return a+v}));if(!u)return null;r.added=u;for(var p=a+l;p<o.length;p++)o[p].setParent(n,""+(p+c.length-l))}break}return r}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Vr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:n.getChildNode(""+(r.index+i)).snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=r.storedValue,s=n==="-"?o.length:Number(n);switch(i.op){case"replace":o[s]=i.value;break;case"add":o.splice(s,0,i.value);break;case"remove":o.splice(s,1);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){gu(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return Die(r)?Y_(r.map(function(o,s){return i._subType.validate(o,SL(n,""+s,i._subType))})):Rs(n,r,"Value is not an array")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return $m}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),e}(jm);qk.prototype.applySnapshot=rr(qk.prototype.applySnapshot);function c8e(t){return new qk(t.name+"[]",t)}function n7(t,e,r,n,i){for(var o=!0,s=0;;s++){var a=s<=n.length-1,l=r[s],c=a?n[s]:void 0,u=""+i[s];if(Lze(c)&&(c=c.storedValue),!l&&!a)break;if(!a)o=!1,r.splice(s,1),l instanceof ws&&l.createObservableInstanceIfNeeded(),l.die(),s--;else if(l)if(i7(l,c))r[s]=rj(e,t,u,c,l);else{for(var m=void 0,v=s;v<r.length;v++)if(i7(r[v],c)){m=r.splice(v,1)[0];break}o=!1;var p=rj(e,t,u,c,m);r.splice(s,0,p)}else{if(Un(c)&&Vr(c).parent===t)throw ft("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '"+t.path+"/"+u+"', but it lives already at '"+Vr(c).path+"'");o=!1;var p=rj(e,t,u,c);r.splice(s,0,p)}}return o?null:r}function rj(t,e,r,n,i){gu(t,n);function o(){if(Un(n)){var a=Vr(n);if(a.assertAlive(Am),a.parent!==null&&a.parent===e)return a.setParent(e,r),a}return i?t.reconcile(i,n,e,r):t.instantiate(e,r,void 0,n)}var s=o();return i&&i!==s&&(i instanceof ws&&i.createObservableInstanceIfNeeded(),i.die()),s}function i7(t,e){if(!t.isAlive)return!1;if(Un(e)){var r=Vr(e);return r.isAlive&&r===t}if(t.snapshot===e)return!0;if(!(t instanceof ws))return!1;var n=t.getReconciliationType();return t.identifier!==null&&t.identifierAttribute&&Mg(e)&&n.is(e)&&n.isMatchingSnapshotId(t,e)}var o7="preProcessSnapshot",s7="postProcessSnapshot";function u8e(){return Vr(this).toString()}var a7={name:"AnonymousModel",properties:{},initializers:$m};function d8e(t){var e=Object.keys(t),r=new Set;return e.forEach(function(n){if(r.has(n))throw ft(n+" is declared twice in the model. Model should not contain the same keys");r.add(n)}),e.reduce(function(n,i){if(i in Ai)throw ft("Hook '"+i+"' was defined as property. Hooks should be defined as part of the actions");var o=Object.getOwnPropertyDescriptor(t,i);if("get"in o)throw ft("Getters are not supported as properties. Please use views instead");var s=o.value;if(s==null)throw ft("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(Zb(s))n[i]=Tf(y8e(s),s);else if(s instanceof zk)n[i]=Tf(s,{});else if(s instanceof qk)n[i]=Tf(s,[]);else if(!ah(s))throw ft("Invalid type definition for property '"+i+"', cannot infer a type from a value like '"+s+"' ("+typeof s+")");return n},vs({},t))}var Yb=function(t){Mn(e,t);function e(r){var n=t.call(this,r.name||a7.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=n.preProcessor;return o?n.cloneAndEnhance({preProcessor:function(s){return o(i(s))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var o=n.postProcessor;return o?n.cloneAndEnhance({postProcessor:function(s){return i(o(s))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,a7,r),n.properties=d8e(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(e.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&yr.Identifier){if(r)throw ft("Cannot define property '"+n+"' as object identifier, property '"+r+"' is already defined as identifier property");r=n}}),r}}),Object.defineProperty(e.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new e({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(e.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){return n.instantiateActions(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Mg(n))throw ft("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===o7)throw ft("Cannot define action '"+o7+"', it should be defined using 'type.preProcessSnapshot(fn)' instead");if(i===s7)throw ft("Cannot define action '"+s7+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var o=n[i],s=r[i];if(i in Ai&&s){var a=o;o=function(){s.apply(null,arguments),a.apply(null,arguments)}}var l=o.$mst_middleware,c=o.bind(n);c._isFlowAction=o._isFlowAction||!1,c.$mst_middleware=l;var u=Xb(r,i,c);n[i]=u,Pf(r,i,u)})}}),Object.defineProperty(e.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw ft("You passed an "+typeof r+" to volatile state as an argument, when function is expected");var i=function(o){return n.instantiateVolatileState(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Mg(n))throw ft("volatile state initializer should return a plain object containing state");WY(r,n)}}),Object.defineProperty(e.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){var s=r(o),a=s.actions,l=s.views,c=s.state,u=Oze(s,["actions","views","state"]);for(var p in u)throw ft("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+p+"'");return c&&n.instantiateVolatileState(o,c),l&&n.instantiateViews(o,l),a&&n.instantiateActions(o,a),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(o){return n.instantiateViews(o,r(o)),o};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!Mg(n))throw ft("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var o,s=Object.getOwnPropertyDescriptor(n,i);if("get"in s)UY(r,i,s),uv(r,(o={},o[i]=Xr,o));else if(typeof s.value=="function")Pf(r,i,s.value);else throw ft("A view member should either be a function or getter based property")})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=Un(o)?o:this.applySnapshotPreProcessor(o);return CL(this,r,n,i,s)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,o={};return i.forAllProps(function(s,a){o[s]=a.instantiate(r,s,void 0,n[s])}),o}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=vs(vs({},K_),{name:this.name});return jt.object(r,Am,n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Pf(n,"toString",u8e),this.forAllProps(function(i){BY(n,i,r.unbox)}),this.initializers.reduce(function(i,o){return o(i)},n),PM(n,this.willChange),n_(n,this.didChange)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Vr(n.object),o=n.name;i.assertWritable({subpath:o});var s=i.type.properties[o];return s&&(gu(s,n.newValue),n.newValue=s.reconcile(i.getChildNode(o),n.newValue,i,o)),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Vr(n.object),o=i.type.properties[n.name];if(o){var s=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:_f(n.name),value:n.newValue.snapshot,oldValue:s},i)}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(o){i.push(n.getChildNode(r,o))}),i}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw ft("Not a value property: "+n);var o=ml(r.storedValue,n),s=(i=o.raw)===null||i===void 0?void 0:i.call(o);if(!s)throw ft("Node not available for property "+n);return s}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var o={};return this.forAllProps(function(s,a){try{var l=Vf(r.storedValue,s);l.reportObserved()}catch{throw ft(s+" property is declared twice")}o[s]=i.getChildNode(r,s).snapshot}),n?this.applySnapshotPostProcessor(o):o}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw ft("object does not support operation "+i.op);r.storedValue[n]=i.value}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){gu(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(o){r.storedValue[o]=i[o]})}}),Object.defineProperty(e.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,o=this.applySnapshotPreProcessor(r);return Mg(o)?Y_(this.propertyNames.map(function(s){return i.properties[s].validate(o[s],SL(n,s,i.properties[s]))})):Rs(n,o,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Am}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),e}(jm);Yb.prototype.applySnapshot=rr(Yb.prototype.applySnapshot);function h8e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():"AnonymousModel",n=t.shift()||{};return new Yb({name:r,properties:n})}function f8e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string",n=r?t[0]:"AnonymousModel";return r&&t.shift(),t.reduce(function(i,o){return i.cloneAndEnhance({name:i.name+"_"+o.name,properties:o.properties,initializers:o.initializers,preProcessor:function(s){return o.applySnapshotPreProcessor(i.applySnapshotPreProcessor(s))},postProcessor:function(s){return o.applySnapshotPostProcessor(i.applySnapshotPostProcessor(s))}})}).named(n)}function p8e(t){return ah(t)&&(t.flags&yr.Object)>0}var Mu=function(t){Mn(e,t);function e(r,n,i,o){o===void 0&&(o=Bze);var s=t.call(this,r)||this;return Object.defineProperty(s,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(s,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:o}),s.flags=n,s}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return yh(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(Zb(r)&&this.checker(r))return Ss();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Rs(n,r,"Value is not a "+i)}}),e}(pp),qie=new Mu("string",yr.String,function(t){return typeof t=="string"}),Wie=new Mu("number",yr.Number,function(t){return typeof t=="number"}),g8e=new Mu("integer",yr.Integer,function(t){return zze(t)}),m8e=new Mu("float",yr.Float,function(t){return qze(t)}),v8e=new Mu("finite",yr.Finite,function(t){return Wze(t)}),Uie=new Mu("boolean",yr.Boolean,function(t){return typeof t=="boolean"}),Hie=new Mu("null",yr.Null,function(t){return t===null}),Gie=new Mu("undefined",yr.Undefined,function(t){return t===void 0}),Xie=new Mu("Date",yr.Date,function(t){return typeof t=="number"||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});Xie.getSnapshot=function(t){return t.storedValue.getTime()};var Zie=Xie;function y8e(t){switch(typeof t){case"string":return qie;case"number":return Wie;case"boolean":return Uie;case"object":if(t instanceof Date)return Zie}throw ft("Cannot determine primitive type from value "+t)}function b8e(t){return ah(t)&&(t.flags&(yr.String|yr.Number|yr.Integer|yr.Boolean|yr.Date))>0}var O8e=function(t){Mn(e,t);function e(r){var n=t.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Literal}),n.value=r,n}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return yh(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Zb(r)&&r===this.value?Ss():Rs(n,r,"Value is not a literal "+JSON.stringify(this.value))}}),e}(pp);function Yie(t){return new O8e(t)}var x8e=function(t){Mn(e,t);function e(r,n,i,o){var s=t.call(this,r)||this;return Object.defineProperty(s,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(s,"_message",{enumerable:!0,configurable:!0,writable:!0,value:o}),s}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|yr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.instantiate(r,n,i,o)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var o=Un(r)?Vr(r).snapshot:r;return this._predicate(o)?Ss():Rs(n,r,this._message(r))}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.reconcile(r,n,i,o)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(_u);function w8e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():ah(t[0])?t[0].name:null,n=t[0],i=t[1],o=t[2]?t[2]:function(s){return"Value does not respect the refinement predicate"};return new x8e(r,n,i,o)}function S8e(t,e){var r=typeof t=="string"?e:t,n=J_.apply(void 0,fp(r.map(function(i){return Yie(""+i)})));return typeof t=="string"&&(n.name=t),n}var C8e=function(t){Mn(e,t);function e(r,n,i){var o=t.call(this,r)||this;return Object.defineProperty(o,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=vs({eager:!0,dispatcher:void 0},i),o._dispatcher=i.dispatcher,i.eager||(o._eager=!1),o}return Object.defineProperty(e.prototype,"flags",{get:function(){var r=yr.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=this.determineType(o,void 0);if(!s)throw ft("No matching type for union "+this.describe());return s.instantiate(r,n,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=this.determineType(n,r.getReconciliationType());if(!s)throw ft("No matching type for union "+this.describe());return s.reconcile(r,n,i,o)}}),Object.defineProperty(e.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],o=0,s=0;s<this._types.length;s++){var a=this._types[s],l=a.validate(r,n);if(l.length===0){if(this._eager)return Ss();o++}else i.push(l)}return o===1?Ss():Rs(n,r,"No type is applicable for the union").concat(Y_(i))}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),e}(_u);function J_(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=ah(t)?void 0:t,i=ah(t)?fp([t],e):e,o="("+i.map(function(s){return s.name}).join(" | ")+")";return new C8e(o,i,n)}function k8e(t){return(t.flags&yr.Union)>0}var P8e=function(t){Mn(e,t);function e(r,n,i){var o=t.call(this,r.name)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),o}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|yr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(this.optionalValues.indexOf(o)>=0){var s=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,s)}return this._subtype.instantiate(r,n,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,o)}}),Object.defineProperty(e.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&gu(this,r),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Ss():this._subtype.validate(r,n)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(_u);function _8e(t,e){if(typeof e!="function"&&Un(e))throw ft("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Tf(t,e,r){return _8e(t,e),new P8e(t,e,r||T8e)}var T8e=[void 0],E8e=Tf(Gie,void 0),R8e=Tf(Hie,null);function Kie(t){return J_(t,E8e)}function I8e(t){return J_(t,R8e)}var j8e=function(t){Mn(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(e.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|yr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw ft("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.getSubType(!0).instantiate(r,n,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.getSubType(!0).reconcile(r,n,i,o)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):Ss()}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||Rie}}),e}(_u);function $8e(t,e){var r=typeof t=="string"?t:"late("+t.toString()+")",n=typeof t=="string"?e:t;return new j8e(r,n)}function A8e(t,e){return new N8e(t,e)}var N8e=function(t){Mn(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:jt.array()}),wQ(function(){return i.pendingNodeList.length>0&&i.pendingNodeList.some(function(o){return o.isAlive&&i.options.shouldLoadPredicate(o.parent?o.parent.value:null)})},function(){i.options.loadType().then(rr(function(o){i.loadedType=o,i.pendingNodeList.forEach(function(s){s.parent&&i.loadedType&&s.parent.applyPatches([{op:"replace",path:"/"+s.subpath,value:s.snapshot}])})}))}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy "+this.name+">"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,o);var a=yh(this,r,n,i,o);return this.pendingNodeList.push(a),wQ(function(){return!a.isAlive},function(){return s.pendingNodeList.splice(s.pendingNodeList.indexOf(a),1)}),a}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):Fie(r)?Ss():Rs(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return this.loadedType?(r.die(),this.loadedType.instantiate(i,o,i.environment,n)):t.prototype.reconcile.call(this,r,n,i,o)}}),e}(pp),Jie=function(t){Mn(e,t);function e(r){var n=t.call(this,r?"frozen("+r.name+")":"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Frozen}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){return yh(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Fie(r)?this.subType?this.subType.validate(r,n):Ss():Rs(n,r,"Value is not serializable and cannot be frozen")}}),e}(pp),l7=new Jie;function M8e(t){return arguments.length===0?l7:ah(t)?new Jie(t):Tf(l7,t)}function D8e(t){switch(t){case Ai.beforeDestroy:return"destroy";case Ai.beforeDetach:return"detach";default:return}}var L8e=function(){function t(e,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),kL(e))this.identifier=e;else if(Un(e)){var n=Vr(e);if(!n.identifierAttribute)throw ft("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw ft("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw ft("Can only store references to tree nodes or identifiers, got: '"+e+"'")}return Object.defineProperty(t.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=dx(this.identifier),n=e.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var o=this.targetType,s=n.identifierCache.resolve(o,r);if(!s)throw new eoe("[mobx-state-tree] Failed to resolve reference '"+this.identifier+"' to type '"+this.targetType.name+"' (from node: "+e.path+")");this.resolvedReference={node:s,lastCacheModification:i}}}}),Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),t}(),eoe=function(t){Mn(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return e}(Error),toe=function(t){Mn(e,t);function e(r,n){var i=t.call(this,"reference("+r.name+")")||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Reference}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return kL(r)?Ss():Rs(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(e.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=n.parent;if(!(!s||!s.isAlive)){var a=s.storedValue;a&&this.onInvalidated({cause:r,parent:a,invalidTarget:o?o.storedValue:void 0,invalidId:i,replaceRef:function(l){e7(n.root.storedValue,{op:"replace",value:l,path:n.path})},removeRef:function(){p8e(s.type)?this.replaceRef(void 0):e7(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(e.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,o=this.getValue(r);if(o){var s=Vr(o),a=function(u,p){var m=D8e(p);m&&i.fireInvalidated(m,r,n,s)},l=s.registerHook(Ai.beforeDetach,a),c=s.registerHook(Ai.beforeDestroy,a);return function(){l(),c()}}}}),Object.defineProperty(e.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var o=this;if(this.onInvalidated){var s;r.registerHook(Ai.beforeDestroy,function(){s&&s()});var a=function(l){s&&s();var c=r.parent,u=c&&c.storedValue;if(c&&c.isAlive&&u){var p=void 0;i?p=!!i.get(n,u):p=r.root.identifierCache.has(o.targetType,dx(n)),p?s=o.addTargetNodeWatcher(r,n):l||o.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===po.FINALIZED?a(!0):(r.isRoot||r.root.registerHook(Ai.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(Ai.afterAttach,function(){a(!1)}))}}}),e}(pp),V8e=function(t){Mn(e,t);function e(r,n){return t.call(this,r,n)||this}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=Un(o)?Sze(o):o,a=new L8e(o,this.targetType),l=yh(this,r,n,i,a);return a.node=l,this.watchTargetNodeForInvalidations(l,s,void 0),l}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r.isDetaching&&r.type===this){var s=Un(n),a=r.storedValue;if(!s&&a.identifier===n||s&&a.resolvedValue===n)return r.setParent(i,o),r}var l=this.instantiate(i,o,void 0,n);return r.die(),l}}),e}(toe),F8e=function(t){Mn(e,t);function e(r,n,i){var o=t.call(this,r,i)||this;return Object.defineProperty(o,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=Un(o)?this.options.set(o,r?r.storedValue:null):o,a=yh(this,r,n,i,s);return this.watchTargetNodeForInvalidations(a,s,this.options),a}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=Un(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===s)return r.setParent(i,o),r;var a=this.instantiate(i,o,void 0,s);return r.die(),a}}),e}(toe);function roe(t,e){var r=e||void 0,n=e?e.onInvalidated:void 0;return r&&(r.get||r.set)?new F8e(t,{get:r.get,set:r.set},n):new V8e(t,n)}function Q8e(t,e){var r=roe(t,vs(vs({},e),{onInvalidated:function(n){e&&e.onInvalidated&&e.onInvalidated(n),n.removeRef()}}));return e&&e.acceptsUndefined===!1?r:Kie(r)}var noe=function(t){Mn(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Identifier}),i}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(!r||!(r.type instanceof Yb))throw ft("Identifier types can only be instantiated as direct child of a model type");return yh(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){if(r.storedValue!==n)throw ft("Tried to change identifier from '"+r.storedValue+"' to '"+n+"'. Changing identifiers is not allowed.");return r.setParent(i,o),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Rs(n,r,"Value is not a valid "+this.describe()+", expected a "+this.validType):Ss()}}),e}(pp),B8e=function(t){Mn(e,t);function e(){var r=t.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Identifier}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),e}(noe),z8e=function(t){Mn(e,t);function e(){return t.call(this,"identifierNumber","number")||this}return Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),e}(noe),q8e=new B8e,W8e=new z8e;function dx(t){return""+t}function kL(t){return typeof t=="string"||typeof t=="number"}function U8e(t){return new H8e(t)}var H8e=function(t){Mn(e,t);function e(r){var n=t.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:yr.Custom}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return Ss();var i=this.options.getValidationMessage(r);return i?Rs(n,r,"Invalid value for type '"+this.name+"': "+i):Ss()}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=this.options.isTargetType(o)?o:this.options.fromSnapshot(o,r&&r.root.environment);return yh(this,r,n,i,s)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,o){var s=!this.options.isTargetType(n);if(!r.isDetaching){var a=r.type===this&&(s?n===r.snapshot:n===r.storedValue);if(a)return r.setParent(i,o),r}var l=s?this.options.fromSnapshot(n,i.root.environment):n,c=this.instantiate(i,o,void 0,l);return r.die(),c}}),e}(pp),ye={enumeration:S8e,model:h8e,compose:f8e,custom:U8e,reference:roe,safeReference:Q8e,union:J_,optional:Tf,literal:Yie,maybe:Kie,maybeNull:I8e,refinement:w8e,string:qie,boolean:Uie,number:Wie,integer:g8e,float:m8e,finite:v8e,Date:Zie,map:l8e,array:c8e,frozen:M8e,identifier:q8e,identifierNumber:W8e,late:$8e,lazy:A8e,undefined:Gie,null:Hie,snapshotProcessor:s8e};const gp=(t,e)=>ye.model(t,{totalCount:0,hasNextPage:!1,countLoaded:0,edges:ye.array(ye.model({cursor:ye.string,node:ye.reference(e)}))}).views(r=>({get startCursor(){return r.edges[0]?.cursor||null},get endCursor(){return r.edges[r.edges.length-1]?.cursor||null},get availableNextPage(){return r.hasNextPage||r.countLoaded===0}})).actions(r=>({reset(){r.totalCount=0,r.countLoaded=0,r.hasNextPage=!1,r.edges=[]},onLoad(n){r.countLoaded+=1,r.totalCount=n.totalCount,r.hasNextPage=n.hasNextPage,r.edges.push(...n.edges)},removeEdge(n){const i=r.edges.find(o=>o.cursor===n);i&&(r.totalCount-=1,r.edges.remove(i))},replaceNode(n,i){const o=r.edges.find(s=>s.cursor===n);o&&(o.node=i)}})),G8e=gp("OrganizationProjectsConnection",ye.late(()=>Kb)),PL=ye.model("OrganizationModel",{id:ye.identifier,projectsConnection:ye.optional(G8e,{})}),X8e=gp("ProjectBranchesConnection",ye.late(()=>Jb)),Kb=ye.model("ProjectModel",{id:ye.identifier,organization:ye.reference(ye.late(()=>PL)),name:ye.string,isPublic:ye.boolean,createdAt:ye.late(()=>lh),rootBranch:ye.reference(ye.late(()=>Jb)),branchesConnection:ye.optional(X8e,{})}).actions(t=>({update(e){for(const[r,n]of Object.entries(e))t[r]=n}})),Jb=ye.model("BranchModel",{id:ye.identifier,name:ye.string,createdAt:ye.late(()=>lh),touched:ye.boolean,start:ye.reference(ye.late(()=>Ef)),head:ye.reference(ye.late(()=>Ef)),draft:ye.reference(ye.late(()=>Ef)),parentBranch:ye.maybe(ye.model({branchName:ye.string,fromRevisionId:ye.string}))}).actions(t=>({updateTouched(e){t.touched=e}})),Z8e=gp("RevisionTablesConnection",ye.late(()=>eO)),Ef=ye.model("RevisionModel",{id:ye.identifier,createdAt:ye.late(()=>lh),comment:"",parent:ye.maybe(ye.reference(ye.late(()=>Ef))),isThereParent:ye.optional(ye.boolean,!1),child:ye.maybe(ye.reference(ye.late(()=>Ef))),isThereChild:ye.optional(ye.boolean,!1),childBranches:ye.array(ye.model({branchName:ye.string,revisionStartId:ye.string})),endpoints:ye.array(ye.reference(ye.late(()=>ioe))),tablesConnection:ye.optional(Z8e,{})}).actions(t=>({addEndpoint(e){t.endpoints.push(e)},removeEndpoint(e){const r=t.endpoints.find(n=>n.id===e);r&&t.endpoints.remove(r)},update(e){e.comment&&(t.comment=e.comment),e.parent&&(t.parent=e.parent),e.child&&(t.child=e.child),e.childBranches&&(t.childBranches=e.childBranches),e.endpoints&&(t.endpoints=[],t.endpoints.push(...e.endpoints))}})).views(t=>({getParentsDetails(e){const r=[];if(!t.isThereParent)return{isAllLoaded:!0,loadedSequence:r};let n=mS(()=>t.parent);if(!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n);for(let i=1;i<e;i++){if(!n.isThereParent)return{isAllLoaded:!0,loadedSequence:r};if(n=mS(()=>n.parent),!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n)}return{isAllLoaded:!0,loadedSequence:r}},getChildrenDetails(e){const r=[];if(!t.isThereChild)return{isAllLoaded:!0,loadedSequence:r};let n=mS(()=>t.child);if(!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n);for(let i=1;i<e;i++){if(!n.isThereChild)return{isAllLoaded:!0,loadedSequence:r};if(n=mS(()=>n.child),!n)return{isAllLoaded:!1,loadedSequence:r};r.push(n)}return{isAllLoaded:!0,loadedSequence:r}}})),ioe=ye.model("EndpointModel",{id:ye.identifier,createdAt:ye.late(()=>lh),type:ye.enumeration("EndpointType",["GRAPHQL","REST_API"])}),Y8e=gp("TableRowsConnection",ye.late(()=>tO)),K8e=gp("foreignKeysByConnection",ye.late(()=>eO)),eO=ye.model("TableModel",{createdId:ye.string,id:ye.string,versionId:ye.identifier,count:ye.integer,readonly:ye.boolean,createdAt:ye.late(()=>lh),updatedAt:ye.late(()=>lh),schema:ye.frozen({}),rowsConnection:ye.optional(Y8e,{}),foreignKeysByConnection:ye.optional(K8e,{})}).actions(t=>({update(e){for(const[r,n]of Object.entries(e))t[r]=n}})),c7=gp("RowForeignKeysByConnection",ye.late(()=>tO)),tO=ye.model("RowModel",{createdId:ye.string,id:ye.string,versionId:ye.identifier,createdAt:ye.late(()=>lh),updatedAt:ye.late(()=>lh),readonly:ye.boolean,data:ye.frozen({}),rowForeignKeysByConnection:ye.map(ye.optional(c7,{}))}).actions(t=>({update(e){for(const[r,n]of Object.entries(e))t[r]=n},getOrCreateRowForeignKeysByConnection(e){return t.rowForeignKeysByConnection.has(e)||t.rowForeignKeysByConnection.set(e,c7.create()),t.rowForeignKeysByConnection.get(e)}})),lh=ye.custom({name:"ISODate",fromSnapshot(t){return new Date(t)},toSnapshot(t){return t.toISOString()},isTargetType(t){return t instanceof Date},getValidationMessage(t){return typeof t=="string"&&!isNaN(Date.parse(t))?"":`'${t}' is not a valid ISO date string`}});ye.frozen();ye.model({startCursor:ye.maybeNull(ye.string),endCursor:ye.maybeNull(ye.string),hasNextPage:!1,hasPreviousPage:!1});const nj=ye.model("RowForeignKeysByModel",{id:ye.identifier,countForeignKeysBy:ye.optional(ye.integer,0)}).actions(t=>({update(e){for(const[r,n]of Object.entries(e))t[r]=n}})),Wl=t=>JSON.stringify(t),J8e=gp("MeProjectsConnection",ye.late(()=>Kb)),ooe=ye.model({id:ye.identifier,meProjectsConnection:ye.optional(J8e,{}),organization:ye.map(ye.late(()=>PL)),project:ye.map(ye.late(()=>Kb)),projectByVariables:ye.map(ye.reference(ye.late(()=>Kb))),branch:ye.map(ye.late(()=>Jb)),branchByVariables:ye.map(ye.reference(ye.late(()=>Jb))),revision:ye.map(ye.late(()=>Ef)),endpoint:ye.map(ye.late(()=>ioe)),table:ye.map(ye.late(()=>eO)),tableByVariables:ye.map(ye.reference(ye.late(()=>eO))),row:ye.map(ye.late(()=>tO)),rowByVariables:ye.map(ye.reference(ye.late(()=>tO))),rowForeignKeysBy:ye.map(ye.late(()=>nj)),rowForeignKeysByByVariables:ye.map(ye.reference(ye.late(()=>nj)))}).views(t=>({getOrganization(e){return Xr(()=>t.organization.get(e)).get()},getProject(e){return Xr(()=>t.project.get(e)).get()},getProjectByVariables({organizationId:e,projectName:r}){return Xr(()=>t.projectByVariables.get(Wl({organizationId:e,projectName:r}))).get()},getBranch(e){return Xr(()=>t.branch.get(e)).get()},getBranchByVariables({organizationId:e,projectName:r,branchName:n}){return Xr(()=>t.branchByVariables.get(Wl({organizationId:e,projectName:r,branchName:n}))).get()},getRevision(e){return Xr(()=>t.revision.get(e)).get()},getEndpoint(e){return Xr(()=>t.endpoint.get(e)).get()},getTable(e){return Xr(()=>t.table.get(e)).get()},getTableByVariables({revisionId:e,tableId:r}){return Xr(()=>t.tableByVariables.get(Wl({revisionId:e,tableId:r}))).get()},getRow(e){return Xr(()=>t.row.get(e)).get()},getRowByVariables({revisionId:e,tableId:r,rowId:n}){return Xr(()=>t.rowByVariables.get(Wl({revisionId:e,tableId:r,rowId:n}))).get()},getRowForeignKeysByVariables({revisionId:e,tableId:r,rowId:n}){return Xr(()=>t.rowForeignKeysByByVariables.get(Wl({revisionId:e,tableId:r,rowId:n}))).get()}})).actions(t=>({addOrganization(e){const r=t.organization.get(e.id);return r||t.organization.put(e)},addProject(e){const r=t.project.get(e.id);return r||t.project.put(e)},addProjectByVariables({organizationId:e,projectName:r},n){t.projectByVariables.set(Wl({organizationId:e,projectName:r}),n)},addOrUpdateBranch(e){const r=t.branch.get(e.id);return r?(r.touched=e.touched,r.start=e.start,r.head=e.head,r.draft=e.draft,r):t.branch.put(e)},addBranchByVariables({organizationId:e,projectName:r,branchName:n},i){t.branchByVariables.set(Wl({organizationId:e,projectName:r,branchName:n}),i)},addOrUpdateRevision(e){const r=t.revision.get(e.id);return r?(r.update(e),r):t.revision.put(e)},addEndpoint(e){const r=t.endpoint.get(e.id);return r||t.endpoint.put(e)},addOrTable(e){const r=t.table.get(e.versionId);return r?(r.readonly=e.readonly,r.createdAt=e.createdAt,r.id=e.id,e.count&&(r.count=e.count),e.schema&&(r.schema=e.schema),r):t.table.put(e)},addTableByVariables({revisionId:e,tableId:r},n){t.tableByVariables.set(Wl({revisionId:e,tableId:r}),n)},addRow(e){const r=t.row.get(e.versionId);return r?(r.update(e),r):t.row.put(e)},addRowByVariables({revisionId:e,tableId:r,rowId:n},i){t.rowByVariables.set(Wl({revisionId:e,tableId:r,rowId:n}),i)},createRowForeignKeysByByVariables({revisionId:e,tableId:r,rowId:n}){const i=nj.create({id:wn(),countForeignKeysBy:0});return t.rowForeignKeysBy.put(i),t.rowForeignKeysByByVariables.set(Wl({revisionId:e,tableId:r,rowId:n}),i.id),i}})),eqe=t=>({id:t.id,createdAt:t.createdAt,type:t.type}),tqe=t=>({id:t.id,createdAt:t.createdAt,comment:t.comment,parent:t.parent?.id,isThereParent:!!t.parent?.id,child:t.child?.id,isThereChild:!!t.child?.id,childBranches:t.childBranches.map(e=>({branchName:e.branch.name,revisionStartId:e.revision.id})),endpoints:t.endpoints.map(e=>e.id)}),H0=(t,e)=>(e.endpoints.map(r=>t.addEndpoint(eqe(r))),t.addOrUpdateRevision(tqe(e))),rqe=(t,e)=>({id:t.id,name:t.name,touched:t.touched,createdAt:t.createdAt,start:t.start.id,head:t.head.id,draft:t.draft.id,parentBranch:e}),hx=(t,e)=>{H0(t,e.start),H0(t,e.head),H0(t,{...e.draft,childBranches:[]});const r=e.parent,n=r?{branchName:r.branch.name,fromRevisionId:r.revision.id}:void 0,i=rqe(e,n);return t.addOrUpdateBranch(i)},soe=t=>({id:t.id,organization:t.organizationId,name:t.name,createdAt:t.createdAt,isPublic:t.isPublic,rootBranch:t.rootBranch.id}),aoe=(t,e)=>(t.addOrganization({id:e.organizationId}),hx(t,e.rootBranch),t.addProject(soe(e))),loe=t=>({startCursor:t.endCursor||null,endCursor:t.endCursor||null,hasPreviousPage:t.hasPreviousPage,hasNextPage:t.hasNextPage}),coe=t=>({totalCount:t.totalCount,pageInfo:loe(t.pageInfo),edges:t.edges.map(({cursor:e,node:r})=>({cursor:e,node:r.id}))}),eT=t=>({totalCount:t.totalCount,pageInfo:loe(t.pageInfo),edges:t.edges.map(({cursor:e,node:r})=>({cursor:e,node:r.versionId}))}),nqe=Ee.get(Da);function iqe(t){return function*(r){const n=yield nqe.client.meProjectsMst({data:r}),i=coe(n.meProjects);n.meProjects.edges.forEach(({node:o})=>{t.cache.addProjectByVariables({organizationId:o.organizationId,projectName:o.name},o.id),aoe(t.cache,o)}),r.after||t.cache.meProjectsConnection.reset(),t.cache.meProjectsConnection.onLoad({edges:i.edges,hasNextPage:i.pageInfo.hasNextPage,totalCount:i.totalCount})}}const tT=Se`
|
|
@@ -1708,5 +1708,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1708
1708
|
}
|
|
1709
1709
|
${Du}
|
|
1710
1710
|
${Iv}
|
|
1711
|
-
`,Ret=async t=>{const e=await ln.mutate({mutation:Eet,variables:t});if(!e.data)throw e.errors;return e.data};class Uae{constructor(e,r){this.rootStore=e,this.projectPageModel=r}get branch(){return this.projectPageModel.branchOrThrow}get table(){return this.projectPageModel.tableOrThrow}get row(){return this.projectPageModel.rowOrThrow}addVersionedTableToCache(e){return this.addTableToCache(e)}addTableToCache(e){const r=this.rootStore.cache.addOrTable(fx(e));return this.rootStore.cache.addTableByVariables({revisionId:this.branch.draft.id,tableId:this.table.id},r.versionId),r}addVersionedRowToCache(e){return this.addRowToCache(e)}addRowToCache(e){const r=this.rootStore.cache.addRow(_L(e));return this.rootStore.cache.addRowByVariables({revisionId:this.branch.draft.id,tableId:this.table.id,rowId:r.id},r.versionId),r}updateTablesConnection(e){const r=this.branch.draft,n=r.tablesConnection.edges.find(i=>i.node.id===e.id);n&&r.tablesConnection.replaceNode(n.cursor,e)}updateRowsConnection(e,r){const n=e.rowsConnection.edges.find(i=>i.node.id===r.id);n&&e.rowsConnection.replaceNode(n.cursor,r)}}class Iet extends Uae{constructor(e,r,n){super(e,r),this.store=n}async execute(){let e=!1,r=!1;if(this.row.id!==this.store.name.value&&(await this.renameRowRequest(),e=!0,r=!0),this.store.root.touched){const{wasCreatedNewVersionTable:n,wasCreatedNewVersionRow:i}=await this.updateRowProcess();e=e||n||i}return this.branch.touched||this.branch.updateTouched(!0),r&&this.branch.draft.tablesConnection.reset(),e&&this.projectPageModel.revalidateLoaders(),!0}async updateRowProcess(){const{table:e,previousVersionTableId:r,row:n,previousVersionRowId:i}=await this.updateRowRequest(this.store.root.getPlainValue()),o=e.versionId!==r;o&&this.updateTablesConnection(e);const s=n.versionId!==i;return s&&this.updateRowsConnection(e,n),{wasCreatedNewVersionTable:o,wasCreatedNewVersionRow:s}}async renameRowRequest(){const e=await Tet({data:{revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.row.id,nextRowId:this.store.name.getPlainValue()}});return{table:this.addVersionedTableToCache(e.renameRow.table),previousVersionTableId:e.renameRow.previousVersionTableId,row:this.addVersionedRowToCache(e.renameRow.row),previousVersionRowId:e.renameRow.previousVersionRowId}}async updateRowRequest(e){const r=await Ret({data:{revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.store.name.getPlainValue(),data:e}});return{table:this.addVersionedTableToCache(r.updateRow.table),previousVersionTableId:r.updateRow.previousVersionTableId,row:this.addVersionedRowToCache(r.updateRow.row),previousVersionRowId:r.updateRow.previousVersionRowId}}}class jet extends Uae{constructor(e,r,n,i){super(e,r),this.fileService=n,this.store=i}async execute(e,r){let n=!1;const{wasCreatedNewVersionTable:i,wasCreatedNewVersionRow:o}=await this.uploadFileProcess(e,r);return n=n||i||o,this.branch.touched||this.branch.updateTouched(!0),n&&this.projectPageModel.revalidateLoaders(),!0}async uploadFileProcess(e,r){const{table:n,previousVersionTableId:i,row:o,previousVersionRowId:s}=await this.uploadFileRequest(e,r),a=n.versionId!==i;a&&this.updateTablesConnection(n);const l=o.versionId!==s;return l&&this.updateRowsConnection(n,o),{wasCreatedNewVersionTable:a,wasCreatedNewVersionRow:l}}async uploadFileRequest(e,r){const n=await this.fileService.add({revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.store.name.getPlainValue(),fileId:e,file:r}),i=await this.rootStore.queryTable({data:{revisionId:this.branch.draft.id,tableId:this.table.id}}),o=await this.rootStore.queryRow({revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.row.id});if(!i||!o)throw new Error("Table or row not found");return{table:i,previousVersionTableId:n.previousVersionTableId,row:o,previousVersionRowId:n.previousVersionRowId}}}var on=(t=>(t.List="List",t.CreatingRow="CreatingRow",t.ConnectingForeignKeyRow="ConnectingForeignKeyRow",t.UpdatingRow="UpdatingRow",t))(on||{});class Fj{constructor(e,r,n,i){this.rootStore=e,this.projectPageModel=r,this.customTable=n,this.state=i,Be(this,{},{autoBind:!0})}id=wn();get table(){return this.customTable||this.projectPageModel.tableOrThrow}get schema(){return this.table.schema}get isEditableRevision(){return this.projectPageModel.isEditableRevision}get revisionId(){return this.projectPageModel.revisionOrThrow.id}get currentForeignKeyPath(){return this.state.type==="ConnectingForeignKeyRow"?dO(this.state.foreignKeyNode):""}get branch(){return this.projectPageModel.branchOrThrow}async createRow(e,r){try{return await new Pet(this.rootStore,this.projectPageModel,this.branch,this.table).execute(e,r)}catch(n){return console.error(n),null}}async updateRow(e){try{return await new Iet(this.rootStore,this.projectPageModel,e).execute()}catch(r){return console.error(r),!1}}async uploadFile(e,r,n){try{const i=Ee.get(Vk);return await new jet(this.rootStore,this.projectPageModel,i,e).execute(r,n)}catch(i){return console.error(i),!1}}toList(){this.state={type:"List",isSelectingForeignKey:this.state.isSelectingForeignKey}}toConnectingForeignKeyRow(e,r){if(this.state.type==="CreatingRow"||this.state.type==="UpdatingRow")this.state={type:"ConnectingForeignKeyRow",previousType:this.state.type,isSelectingForeignKey:this.state.isSelectingForeignKey,store:this.state.store,foreignKeyNode:e,isCreating:r};else throw new Error("Invalid state")}toCloneRow(e){const r=this.rootStore.cache.getRow(e);if(!r)throw new Error(`Not found row.versionId ${e}`);const n=`${this.table.id.toLowerCase()}-${wn(9).toLowerCase()}`,i=mu(this.schema),o=new rN(i,ac(i),n,null,this.projectPageModel);o.root.updateBaseValue(r.data),Dm(o.root,s=>{if(s.$ref){const a=GL[s.$ref];if(a){const l=ac(mu(a));s.updateBaseValue(l.getPlainValue())}}}),this.state={type:"CreatingRow",isSelectingForeignKey:this.state.isSelectingForeignKey,store:o}}toCreatingRow(){const e=`${this.table.id.toLowerCase()}-${wn(9).toLowerCase()}`,r=mu(this.schema),n=this.state.type==="ConnectingForeignKeyRow"?this.state.store:new rN(r,ac(r),e);this.state={type:"CreatingRow",isSelectingForeignKey:this.state.isSelectingForeignKey,store:n}}toUpdatingTableFromConnectingForeignKeyRow(){if(this.state.type!=="ConnectingForeignKeyRow")throw new Error("Invalid state");const e=this.state.store;this.state={type:"UpdatingRow",isSelectingForeignKey:this.state.isSelectingForeignKey,store:e}}init(){}dispose(){}updateStore(e){this.state.type==="UpdatingRow"&&(this.state.store=e)}}class $et{constructor(e,r,n){this.rootStore=e,this.projectPageModel=r,this.stack=[new Fj(this.rootStore,this.projectPageModel,null,{type:on.List,isSelectingForeignKey:!1})],n&&(this.stack=[new Fj(this.rootStore,this.projectPageModel,null,{type:on.UpdatingRow,isSelectingForeignKey:!1,store:this.createStore()})]),Be(this,{},{autoBind:!0})}stack;disposers=[];async selectForeignKey(e,r,n){if(!r.foreignKey)throw new Error("Invalid foreign key");const i=await this.getFetchedTableWithRows(r.foreignKey);e.toConnectingForeignKeyRow(r,n),vt(()=>{const o=new Fj(this.rootStore,this.projectPageModel,i,{type:on.List,isSelectingForeignKey:!0});this.stack.push(o),n&&o.toCreatingRow()})}cancelSelectingForeignKey(e){const r=this.stack.findIndex(n=>n===e);r!==-1&&this.stack.splice(r+1),e.state.type===on.ConnectingForeignKeyRow&&(e.state.previousType===on.CreatingRow?e.toCreatingRow():e.state.previousType===on.UpdatingRow&&e.toUpdatingTableFromConnectingForeignKeyRow())}onSelectedForeignKey(e,r){const n=this.stack.findIndex(o=>o===e),i=this.stack[n-1];i.state.type===on.ConnectingForeignKeyRow&&(i.state.foreignKeyNode.setValue(r),i.state.previousType===on.CreatingRow?i.toCreatingRow():i.state.previousType===on.UpdatingRow&&i.toUpdatingTableFromConnectingForeignKeyRow()),this.stack.splice(n)}updateStore(){this.stack[0].updateStore(this.createStore())}init(){this.disposers.push(Iu(()=>this.projectPageModel.row,()=>{this.updateStore()}))}dispose(){this.disposers.length=0}async getFetchedTableWithRows(e){const r={revisionId:this.projectPageModel.revisionOrThrow.id,tableId:e},n=this.rootStore.cache.getTableByVariables(r)||await Ht.queryTable({data:r});if(!n)throw new Error(`Not found table ${e}`);return n.rowsConnection.countLoaded||await Ht.queryRows({revisionId:this.projectPageModel.revisionOrThrow.id,tableId:n.id,first:50}),n}createStore(){const e=this.projectPageModel.tableOrThrow.schema,r=Tne(e)?mu(e):new Pse;return new rN(r,ac(r),this.projectPageModel.rowOrThrow.id,this.projectPageModel.rowOrThrow,this.projectPageModel)}}const Aet=t=>{const e=Lu(),[r]=E.useState(()=>new $et(Ht,e,t));return E.useEffect(()=>(r.init(),()=>r.dispose()),[r]),r},Hae=E.createContext(null),yT=()=>{const t=E.useContext(Hae);if(!t)throw new Error("Invalid RowStackModelContext");return t},Net=({row:t,onSelect:e})=>{const r=E.useCallback(()=>{e?.(t.id)},[e,t.id]);return h.jsxs(ee,{_hover:{backgroundColor:"gray.50"},alignItems:"center",gap:"4px",paddingLeft:"1rem",minHeight:"2.5rem",width:"100%",children:[h.jsx(ee,{minWidth:"150px",children:h.jsx(Y,{textDecoration:"underline",cursor:"pointer",onClick:r,children:t.id})}),h.jsx(ee,{alignItems:"center",justifyContent:"space-between",minHeight:"40px",width:"100%",minWidth:0,children:h.jsx(Y,{ml:"16px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:"gray.400",children:t.data})})]},t.versionId)},Met=({tableId:t,connection:e})=>{const r=Ba(),n=vp(),i=E.useCallback(o=>{r(n.make({...n.getCurrentOptions(),tableId:t,rowId:o}),{state:{isBackToRow:!0}})},[n,r,t]);return h.jsxs(ee,{flexDirection:"column",width:"100%",children:[h.jsxs(ee,{minHeight:"40px",width:"100%",gap:"4px",children:[h.jsx(Y,{children:t}),h.jsxs(Y,{color:"gray.300",children:["(",e.totalCount,")"]})]}),h.jsx(Sh,{useWindowScroll:!0,totalCount:e.totalCount,defaultItemHeight:40,increaseViewportBy:40*100,itemContent:o=>{const{node:s}=e.edges[o];if(s)return h.jsx(Net,{row:{id:s.id,versionId:s.versionId,data:JSON.stringify(s.data,null,2).replaceAll("\\n","")},onSelect:i})}})]})},Det=({row:t})=>{const e=E.useMemo(()=>[...t.rowForeignKeysByConnection.keys()].map(n=>({tableId:n,connection:t.rowForeignKeysByConnection.get(n)})).filter(n=>n.connection.totalCount),[t]);return h.jsx(ee,{flexDirection:"column",width:"100%",gap:"40px",children:e.map(({tableId:r,connection:n})=>h.jsx(Met,{tableId:r,connection:n},r))})},Let=_e(({store:t})=>h.jsx(ee,{height:"40px",paddingBottom:"4px",alignItems:"flex-end",backgroundColor:"white",width:"100%",position:"sticky",bottom:0,justifyContent:"space-between",children:h.jsx(Y,{color:"gray",opacity:"0.4",children:t.isComplexStructure&&t.overNode&&dO(t.overNode)})})),Gae=_e(({store:t,isEdit:e})=>h.jsxs(ee,{alignItems:"flex-start",flexDirection:"column",gap:"1rem",className:QA.Root,flex:1,minHeight:"100vh","date-testid":"row-data-card",children:[t.viewMode===di.Tree&&h.jsxs(h.Fragment,{children:[h.jsx(z,{flexGrow:1,width:"100%",children:h.jsx(yet,{store:t.node,isEdit:e})}),h.jsx(Let,{store:t})]}),t.viewMode===di.Json&&h.jsx(Q_,{schema:t.schemaStore.getPlainSchema(),readonly:!e,data:Kk(t.root),onChange:t.updateValue}),t.viewMode===di.RefBy&&t.originRow&&h.jsx(Det,{row:t.originRow})]})),Vet=_e(({store:t,onSelectForeignKey:e})=>{sse(()=>{t.scrollPosition&&(window.scrollTo(0,t.scrollPosition),t.setScrollPosition(null))});const r=E.useCallback(async(n,i)=>{t.setScrollPosition(window.scrollY),await e(n,i)},[e,t]);return h.jsx(e5.Provider,{value:{onSelectForeignKey:r,onOverNode:t.setOverNode,mode:fO.Creating},children:h.jsx(Gae,{store:t,rootName:"<id>",isEdit:!0})})}),Xae=({onExpandAll:t,onCollapseAll:e,onCopyJson:r,showTreeActions:n})=>h.jsxs(Hn,{children:[h.jsx(to,{asChild:!0,children:h.jsx(Ir,{"aria-label":"Row actions","data-testid":"row-actions-menu",variant:"ghost",size:"sm",height:"2.5rem",color:"gray.400",_hover:{backgroundColor:"gray.50"},_focus:{outline:"none",boxShadow:"none"},_focusVisible:{outline:"none",boxShadow:"none"},children:h.jsx(VZe,{})})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minWidth:"160px",children:[n&&h.jsxs(h.Fragment,{children:[h.jsxs(Kt,{value:"expand",cursor:"pointer",onClick:t,children:[h.jsx(MZe,{style:{marginRight:"8px"}}),"Expand All"]}),h.jsxs(Kt,{value:"collapse",cursor:"pointer",onClick:e,children:[h.jsx(NZe,{style:{marginRight:"8px"}}),"Collapse All"]}),h.jsx(go,{})]}),h.jsxs(Kt,{value:"copy",cursor:"pointer",onClick:r,children:[h.jsx(DZe,{style:{marginRight:"8px"}}),"Copy JSON"]})]})})})]}),Zae=_e(({value:t,setValue:e,readonly:r,dataTestId:n})=>{const[i,o]=E.useState(t),[s,a]=E.useState(!1);E.useEffect(()=>{o(t)},[t]);const l=E.useCallback(m=>{o(m)},[]),c=E.useCallback(()=>{a(!1),e(i)},[i,e]),u=E.useCallback(()=>{a(!0)},[]),p=i?"":'"';return h.jsx(z,{borderRadius:"4px",bgColor:s?"newGray.100":void 0,_hover:{bgColor:r?void 0:"newGray.100"},pl:"4px",pr:"4px",minHeight:"24px",minWidth:"15px",cursor:r?"text":void 0,children:r?`${p}${i}${p}`:h.jsx(If,{dataTestId:n,prefix:p,postfix:p,initValue:i,onChange:l,onFocus:u,onBlur:c})})}),hP=({showBreadcrumbs:t,tableTitle:e,rowIdInput:r,actions:n,actionsMenu:i,switcher:o,search:s})=>h.jsxs(ee,{alignItems:"center",backgroundColor:"white",justifyContent:"space-between",width:"100%",position:"sticky",zIndex:1,top:0,padding:"8px",children:[h.jsxs(ee,{alignItems:"center",gap:"8px",children:[t&&h.jsx(HL,{}),e&&h.jsx(Y,{fontWeight:"500",fontSize:"14px",color:"gray.700",children:e}),t&&r&&h.jsx(Y,{color:"gray",fontWeight:"600",fontSize:"16px",children:"/"}),r,n]}),h.jsxs(ee,{alignItems:"center",gap:"8px",children:[s,i,o]})]}),d5=({tableId:t})=>h.jsx(ee,{width:"100%",borderStyle:"solid",borderTopWidth:1,borderColor:"gray.100",justifyContent:"center",color:"gray.400",fontWeight:"300",pt:"0.5rem",pb:"0.5rem",children:h.jsxs(z,{backgroundColor:"gray.50",pl:"5px",pr:"5px",borderRadius:"5px",children:['Select or create a row in "',t,'" to be referenced by the above row']})}),Fet=_e(()=>{const t=Ba(),e=vp(),{root:r,item:n}=yT(),[i,o]=E.useState(!1),a=r.stack.indexOf(n)===0&&!n.state.isSelectingForeignKey,l=E.useCallback(async(P,_)=>{await r.selectForeignKey(n,P,_)},[n,r]),c=E.useCallback(P=>{n.state.type===on.CreatingRow&&n.state.store.name.setValue(P)},[n]),u=E.useCallback(async()=>{if(n.state.type!==on.CreatingRow)return;const P=n.state.store;o(!0);try{const _=await n.createRow(P.name.getPlainValue(),P.root.getPlainValue());_&&(n.state.isSelectingForeignKey?r.onSelectedForeignKey(n,P.name.getPlainValue()):t(e.make({revisionIdOrTag:zo,rowId:_.id})))}catch{Ur.error({title:"Create failed"})}finally{o(!1)}},[n,e,t,r]),p=E.useCallback(async()=>{if(n.state.type!==on.CreatingRow)return;const P=JSON.stringify(n.state.store.root.getPlainValue(),null,2);await navigator.clipboard.writeText(P),Ur.info({title:"Copied to clipboard"})},[n]);if(n.state.type!==on.CreatingRow)return null;const m=n.state.store,v=m.viewMode||di.Tree,b=h.jsxs(ee,{gap:"4px",children:[h.jsx(C_,{dataTestId:"close-create-row-button",onClick:n.toList}),h.jsx(JO,{dataTestId:"approve-create-row-button",loading:i,onClick:u,isDisabled:!m.root.isValid})]}),O=h.jsx(dT,{availableRefByMode:!1,mode:v,onChange:m.setViewMode}),x=h.jsx(Zae,{value:m.name.value,setValue:c,dataTestId:"row-id-input"}),S=v===di.Tree,w=S&&m.node.hasCollapsibleContent,k=S?h.jsx(Xae,{showTreeActions:w,onExpandAll:()=>m.node.expandAllContent(),onCollapseAll:()=>m.node.collapseAllContent(),onCopyJson:p}):null;return h.jsxs(ee,{flexDirection:"column",flex:1,children:[n.state.isSelectingForeignKey&&h.jsx(d5,{tableId:n.table.id}),h.jsx(hP,{showBreadcrumbs:a,rowIdInput:x,actions:b,actionsMenu:k,switcher:O}),h.jsx(ee,{flexDirection:"column",paddingTop:"60px",children:h.jsx(Vet,{store:m,onSelectForeignKey:l})})]})}),Dg=40,Qj=200,Qet=t=>{const[e,r]=E.useState(!1),n=E.useRef(0),i=E.useRef(0),o=E.useRef(null),s=E.useRef(t);s.current=t;const a=E.useCallback(l=>{l.preventDefault(),l.stopPropagation(),n.current=l.clientX,i.current=s.current.idColumnWidth,r(!0)},[]);return E.useEffect(()=>{if(!e)return;const l=u=>{o.current===null&&(o.current=requestAnimationFrame(()=>{const p=u.clientX-n.current,m=Math.max(Dg,i.current+p);s.current.setIdColumnWidth(m),o.current=null}))},c=()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null),r(!1)};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.body.style.userSelect="",document.body.style.cursor="",o.current!==null&&cancelAnimationFrame(o.current)}},[e]),{isResizing:e,handleMouseDown:a}};var Ye=(t=>(t.String="string",t.Number="number",t.Boolean="boolean",t.ForeignKey="foreignKey",t.File="file",t.DateTime="dateTime",t))(Ye||{}),fr=(t=>(t.Id="id",t.CreatedAt="createdAt",t.UpdatedAt="updatedAt",t.PublishedAt="publishedAt",t.VersionId="versionId",t.CreatedId="createdId",t))(fr||{});const Yae=new Set(["id","createdAt","updatedAt"]),h5=[{id:fr.Id,name:"id",fieldType:Ye.String,schemaRef:Ft.RowId},{id:fr.CreatedAt,name:"createdAt",fieldType:Ye.DateTime,schemaRef:Ft.RowCreatedAt},{id:fr.UpdatedAt,name:"updatedAt",fieldType:Ye.DateTime,schemaRef:Ft.RowUpdatedAt},{id:fr.PublishedAt,name:"publishedAt",fieldType:Ye.DateTime,schemaRef:Ft.RowPublishedAt},{id:fr.VersionId,name:"versionId",fieldType:Ye.String,schemaRef:Ft.RowVersionId},{id:fr.CreatedId,name:"createdId",fieldType:Ye.String,schemaRef:Ft.RowCreatedId}],Bet=new Map(h5.map(t=>[t.schemaRef,t])),zet=new Map(h5.map(t=>[t.id,t]));function Kae(t){return Bet.get(t)}function Jae(t){return zet.get(t)}const qet=[fr.CreatedAt,fr.UpdatedAt,fr.PublishedAt,fr.VersionId,fr.CreatedId];var en=(t=>(t.Equals="equals",t.NotEquals="not_equals",t.Contains="contains",t.NotContains="not_contains",t.StartsWith="starts_with",t.EndsWith="ends_with",t.IsEmpty="is_empty",t.IsNotEmpty="is_not_empty",t.Gt="gt",t.Gte="gte",t.Lt="lt",t.Lte="lte",t.IsTrue="is_true",t.IsFalse="is_false",t))(en||{});const ele={[Ye.String]:[{operator:"equals",label:"equals",requiresValue:!0},{operator:"not_equals",label:"not equals",requiresValue:!0},{operator:"contains",label:"contains",requiresValue:!0},{operator:"not_contains",label:"not contains",requiresValue:!0},{operator:"starts_with",label:"starts with",requiresValue:!0},{operator:"ends_with",label:"ends with",requiresValue:!0},{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.Number]:[{operator:"equals",label:"=",requiresValue:!0},{operator:"not_equals",label:"!=",requiresValue:!0},{operator:"gt",label:">",requiresValue:!0},{operator:"gte",label:">=",requiresValue:!0},{operator:"lt",label:"<",requiresValue:!0},{operator:"lte",label:"<=",requiresValue:!0},{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.Boolean]:[{operator:"is_true",label:"is true",requiresValue:!1},{operator:"is_false",label:"is false",requiresValue:!1}],[Ye.ForeignKey]:[{operator:"equals",label:"equals",requiresValue:!0},{operator:"not_equals",label:"not equals",requiresValue:!0},{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.File]:[{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.DateTime]:[{operator:"equals",label:"is",requiresValue:!0},{operator:"not_equals",label:"is not",requiresValue:!0},{operator:"lt",label:"before",requiresValue:!0},{operator:"gt",label:"after",requiresValue:!0},{operator:"lte",label:"on or before",requiresValue:!0},{operator:"gte",label:"on or after",requiresValue:!0}]};function tle(t){switch(t.type){case ke.String:return"foreignKey"in t&&t.foreignKey?Ye.ForeignKey:Ye.String;case ke.Number:return Ye.Number;case ke.Boolean:return Ye.Boolean;case ke.Object:return t.$ref===Ft.File?Ye.File:null;default:return null}}function fP(t){switch(t){case Ye.String:case Ye.ForeignKey:return"contains";case Ye.Number:return"equals";case Ye.Boolean:return"is_true";case Ye.File:return"is_not_empty";case Ye.DateTime:return"gt"}}function Wet(t,e){return ele[e].find(r=>r.operator===t)}function Lg(t,e){return Wet(t,e)?.requiresValue??!0}function rle(){return`filter_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function u9(t){return{id:rle(),field:t.name,fieldPath:t.path,fieldType:t.fieldType,operator:fP(t.fieldType),value:t.fieldType===Ye.Boolean?!0:"",isSystemField:t.isSystemField,systemFieldId:t.systemFieldId}}function ag(t="and"){return{id:rle(),logic:t,conditions:[],groups:[]}}const qd=t=>{switch(t){case Ye.String:return"Aa";case Ye.Number:return"#";case Ye.Boolean:return"?";case Ye.ForeignKey:return"->";case Ye.File:return h.jsx(Yg,{size:14});case Ye.DateTime:return h.jsx(EIe,{size:14});default:return t}},yO=E.memo(({nodeId:t,name:e,fieldType:r,valuePrefix:n,onClick:i})=>{const o=()=>i(t);return h.jsx(Kt,{value:n?`${n}-${t}`:t,onClick:o,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[r&&h.jsx(z,{as:"span",fontSize:"xs",fontWeight:"medium",color:"gray.400",fontFamily:"mono",minWidth:"20px",children:qd(r)}),h.jsx(Y,{truncate:!0,children:e||"(unnamed)"})]})},t)}),Uet=E.memo(({field:t,availableChildren:e,isSelfVisible:r,valuePrefix:n,onSelect:i})=>h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(sv,{children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[t.fieldType&&h.jsx(z,{as:"span",fontSize:"xs",fontWeight:"medium",color:"gray.400",fontFamily:"mono",minWidth:"20px",children:qd(t.fieldType)}),h.jsx(Y,{truncate:!0,flex:1,children:t.name}),h.jsx(Lm,{})]})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",maxH:"300px",overflowY:"auto",children:[!r&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"File column"}),h.jsx(yO,{nodeId:t.nodeId,name:t.name,fieldType:t.fieldType,valuePrefix:n,onClick:i})]}),e.length>0&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Properties"}),e.map(o=>h.jsx(yO,{nodeId:o.nodeId,name:o.name,fieldType:o.fieldType,valuePrefix:n,onClick:i},o.nodeId))]})]})})})]})),nle=E.memo(({fields:t,valuePrefix:e,onSelect:r,getAvailableFileChildren:n,isColumnVisible:i})=>h.jsx(h.Fragment,{children:t.map(o=>o.isFileObject&&o.children?h.jsx(Uet,{field:o,availableChildren:n(o),isSelfVisible:i(o.nodeId),valuePrefix:e,onSelect:r},o.nodeId):h.jsx(yO,{nodeId:o.nodeId,name:o.name,fieldType:o.fieldType,valuePrefix:e,onClick:r},o.nodeId))})),Het=_e(({availableFields:t,availableSystemFields:e,hasHiddenColumns:r,onAddColumn:n,onAddAll:i,getAvailableFileChildren:o,isColumnVisible:s})=>r?h.jsx(z,{as:"th",backgroundColor:"white",position:"sticky",right:0,zIndex:1,width:"40px",children:h.jsx(z,{height:"30px",borderBottomWidth:"1px",borderColor:"gray.100",display:"flex",alignItems:"center",children:h.jsxs(Hn,{positioning:{placement:"bottom-start"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(to,{asChild:!0,children:h.jsx(Ir,{focusRing:"none","aria-label":"Add column",size:"xs",variant:"ghost",color:"gray.400",_hover:{bg:"gray.100",color:"gray.600"},children:h.jsx(mee,{})})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"200px",maxH:"340px",overflowY:"auto",children:[h.jsxs(Kt,{value:"add-all",onClick:i,children:[h.jsx(gee,{}),h.jsx(Y,{children:"Add all columns"})]}),t.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(go,{}),h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Data fields"}),h.jsx(nle,{fields:t,onSelect:n,getAvailableFileChildren:o,isColumnVisible:s})]})]}),e.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(go,{}),h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"System fields"}),e.map(a=>h.jsx(yO,{nodeId:a.nodeId,name:a.name,fieldType:a.fieldType,onClick:n},a.nodeId))]})]})]})})})]})})}):h.jsx(z,{as:"th",backgroundColor:"white",position:"sticky",right:0,zIndex:1,width:"40px",children:h.jsx(z,{height:"30px",borderBottomWidth:"1px",borderColor:"gray.100"})})),Get=()=>{const t=E.useRef(null),[e,r]=E.useState(!1);E.useEffect(()=>()=>r(!1),[]);const n=E.useCallback(()=>{const s=t.current;if(!s)return;const a=s.scrollWidth>s.clientWidth;r(a)},[]),i=E.useCallback(()=>{r(!1)},[]),o=E.useCallback(()=>{r(!1)},[]);return{ref:t,isOpen:e,onMouseEnter:n,onMouseLeave:i,onClose:o}},Xet=(t,e)=>{const[r,n]=E.useState(!1),i=E.useRef(0),o=E.useRef(0),s=E.useRef(null),a=E.useRef(t),l=E.useRef(e);a.current=t,l.current=e;const c=E.useCallback(u=>{u.preventDefault(),u.stopPropagation();const p=l.current.getColumnWidth(a.current);i.current=u.clientX,o.current=p,n(!0)},[]);return E.useEffect(()=>{if(!r)return;const u=m=>{s.current===null&&(s.current=requestAnimationFrame(()=>{const v=m.clientX-i.current,b=Math.max(Dg,o.current+v);l.current.setColumnWidth(a.current,b),s.current=null}))},p=()=>{s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),n(!1)};return document.addEventListener("mousemove",u),document.addEventListener("mouseup",p),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p),document.body.style.userSelect="",document.body.style.cursor="",s.current!==null&&cancelAnimationFrame(s.current)}},[r]),{isResizing:r,handleMouseDown:c}},ile=({selectedOperator:t,fieldType:e,onSelect:r})=>{const n=ele[e],i=n.find(o=>o.operator===t);return h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"80px",children:[h.jsx(Y,{fontSize:"sm",color:"newGray.700",truncate:!0,children:i?.label||t}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsx(Xn,{minW:"150px",children:n.map(o=>h.jsx(Kt,{value:o.operator,onClick:()=>r(o.operator),bg:t===o.operator?"newGray.100":void 0,children:h.jsx(Y,{children:o.label})},o.operator))})})]})};function Zet(t){if(!t)return"";try{const e=new Date(t);if(isNaN(e.getTime()))return"";const r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),o=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0");return`${r}-${n}-${i}T${o}:${s}`}catch{return""}}function Yet(t){if(!t)return"";try{const e=new Date(t);return isNaN(e.getTime())?"":e.toISOString()}catch{return""}}const ole=({value:t,fieldType:e,disabled:r,error:n,onChange:i})=>{const o=E.useCallback(u=>{i(u.target.value)},[i]),s=E.useCallback(u=>{const p=u.target.value===""?"":Number(u.target.value);i(p)},[i]),a=E.useCallback(u=>{i(u.checked)},[i]),l=E.useCallback(u=>{const p=Yet(u.target.value);i(p)},[i]),c=E.useMemo(()=>Zet(String(t??"")),[t]);if(r)return null;switch(e){case Ye.Boolean:return h.jsxs(fM,{checked:!!t,onCheckedChange:a,size:"sm",children:[h.jsx(gM,{}),h.jsx(pM,{children:h.jsx(XP,{})})]});case Ye.Number:return h.jsx(hs,{type:"number",value:typeof t=="number"?t:"",onChange:s,size:"sm",width:"100px",placeholder:"Value",borderColor:n?"red.500":void 0,_focus:{borderColor:n?"red.500":void 0}});case Ye.DateTime:return h.jsx(hs,{type:"datetime-local",value:c,onChange:l,size:"sm",width:"200px",borderColor:n?"red.500":void 0,_focus:{borderColor:n?"red.500":void 0}});case Ye.String:case Ye.ForeignKey:default:return h.jsx(hs,{type:"text",value:String(t??""),onChange:o,size:"sm",width:"150px",placeholder:"Value",borderColor:n?"red.500":void 0,_focus:{borderColor:n?"red.500":void 0}})}},sle=_e(({field:t,filterModel:e,isOpen:r,onClose:n,anchorRef:i})=>{const[o,s]=E.useState(()=>fP(t.fieldType)),[a,l]=E.useState(""),[c,u]=E.useState(!1),p=Lg(o,t.fieldType),m=E.useCallback(w=>{s(w),u(!1)},[]),v=E.useCallback(w=>{l(w),u(!1)},[]),b=E.useCallback(()=>{s(fP(t.fieldType)),l(""),u(!1)},[t.fieldType]),O=E.useCallback(()=>{b(),n()},[b,n]),x=E.useCallback(()=>{if(!e.addQuickFilter(t,o,a)){u(!0);return}b(),n()},[e,t,o,a,b,n]),S=E.useCallback(()=>i.current?.getBoundingClientRect()??null,[i]);return h.jsx(qo,{open:r,onOpenChange:({open:w})=>{w||O()},lazyMount:!0,unmountOnExit:!0,autoFocus:!0,positioning:{placement:"bottom-start",getAnchorRect:S},children:h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsxs(Oo,{p:3,minW:"280px",boxShadow:"lg",children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,mb:3,children:[h.jsx(z,{color:"gray.400",children:h.jsx(Vm,{size:14})}),h.jsxs(Y,{fontSize:"sm",fontWeight:"medium",color:"gray.600",children:["Filter by ",t.name]})]}),h.jsxs(z,{display:"flex",alignItems:"center",gap:2,mb:3,children:[h.jsx(ile,{selectedOperator:o,fieldType:t.fieldType,onSelect:m}),p&&h.jsx(ole,{value:a,fieldType:t.fieldType,error:c,onChange:v})]}),h.jsxs(z,{display:"flex",justifyContent:"flex-end",gap:2,children:[h.jsx(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:O,children:"Cancel"}),h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",onClick:x,children:"Add"})]})]})})})})}),ale=({isResizing:t,onMouseDown:e})=>h.jsx(z,{role:"group",position:"absolute",right:"-4px",top:0,bottom:0,width:"8px",cursor:"col-resize",zIndex:10,onMouseDown:e,children:h.jsx(z,{position:"absolute",left:"3px",top:0,bottom:0,width:"2px",bg:t?"blue.500":"transparent",_groupHover:{bg:"blue.500"},transition:"background 0.1s",pointerEvents:"none"})}),d9=({label:t,valuePrefix:e,availableFields:r,availableSystemFields:n,onSelect:i,getAvailableFileChildren:o,isColumnVisible:s})=>h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsxs(sv,{children:[h.jsx(Y,{flex:1,children:t}),h.jsx(Lm,{})]}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{maxH:"300px",minW:"200px",overflowY:"auto",children:[r.length>0&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Data fields"}),h.jsx(nle,{fields:r,valuePrefix:e,onSelect:i,getAvailableFileChildren:o,isColumnVisible:s})]}),n.length>0&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"System fields"}),n.map(a=>h.jsx(yO,{nodeId:a.nodeId,name:a.name,fieldType:a.fieldType,valuePrefix:e,onClick:i},a.nodeId))]})]})})})]}),lle=_e(({columnId:t,sortModel:e})=>{const r=e.getSortDirection(t),n=e.getSortIndex(t),i=e.sortCount>1;return r?h.jsxs(ee,{alignItems:"center",gap:"1px",color:"blue.500",fontSize:"xs",flexShrink:0,children:[r==="asc"?h.jsx(Nse,{size:12}):h.jsx(Ase,{size:12}),i&&h.jsx(z,{as:"span",fontSize:"10px",fontWeight:"medium",lineHeight:1,children:n})]}):null}),cle=_e(({columnId:t,sortModel:e})=>{const r=e.isSorted(t),n=e.getSortDirection(t),i=E.useCallback(s=>{e.setSortAndApply(t,s)},[e,t]),o=E.useCallback(()=>{e.removeSortAndApply(t)},[e,t]);return h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsxs(sv,{children:[h.jsx(Y,{flex:1,children:"Sort"}),h.jsx(Lm,{})]}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"160px",children:[h.jsxs(Kt,{value:"sort-asc",onClick:()=>i("asc"),color:n==="asc"?"blue.600":void 0,children:[h.jsx($Ze,{}),h.jsx(Y,{children:"Sort A → Z"})]}),h.jsxs(Kt,{value:"sort-desc",onClick:()=>i("desc"),color:n==="desc"?"blue.600":void 0,children:[h.jsx(RZe,{}),h.jsx(Y,{children:"Sort Z → A"})]}),r&&h.jsxs(h.Fragment,{children:[h.jsx(go,{}),h.jsxs(Kt,{value:"remove-sort",onClick:o,children:[h.jsx(fT,{}),h.jsx(Y,{children:"Remove sort"})]})]})]})})})]})}),Ket=_e(({column:t,columnsModel:e,sortModel:r,filterModel:n})=>{const{ref:i,isOpen:o,onMouseEnter:s,onMouseLeave:a,onClose:l}=Get(),c=E.useRef(null),[u,p]=E.useState(!1),m=e.getColumnWidth(t.id),{isResizing:v,handleMouseDown:b}=Xet(t.id,e),O=e.availableFieldsToAdd,x=e.availableSystemFieldsToAdd,S=O.length>0||x.length>0,w=e.canRemoveColumn,k=e.canHideAll,P=e.canMoveLeft(t.id),_=e.canMoveRight(t.id),T=e.canMoveToStart(t.id),R=e.canMoveToEnd(t.id),$=n?.getFilterableFieldForColumn(t.name,t.isSystemField,t.systemFieldId),A=!!$,M=E.useCallback(()=>{e.removeColumn(t.id)},[e,t.id]),Q=E.useCallback(se=>{e.insertColumnBefore(t.id,se)},[e,t.id]),V=E.useCallback(se=>{e.insertColumnAfter(t.id,se)},[e,t.id]),q=E.useCallback(()=>{e.moveColumnLeft(t.id)},[e,t.id]),N=E.useCallback(()=>{e.moveColumnRight(t.id)},[e,t.id]),B=E.useCallback(()=>{e.moveColumnToStart(t.id)},[e,t.id]),re=E.useCallback(()=>{e.moveColumnToEnd(t.id)},[e,t.id]),he=E.useCallback(()=>{p(!0)},[]),ne=E.useCallback(()=>{p(!1)},[]);return h.jsxs(z,{ref:c,as:"th",textAlign:"start",width:`${m}px`,maxWidth:`${m}px`,minWidth:`${m}px`,backgroundColor:"white",position:"relative",children:[h.jsxs(Hn,{positioning:{placement:"bottom-end"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(to,{asChild:!0,children:h.jsxs(ee,{alignItems:"center",height:"30px",borderBottomWidth:"1px",borderColor:"gray.100",pl:"16px",pr:"8px",gap:"4px",cursor:"pointer",transition:"background 0.15s",_hover:{bg:"gray.50"},onMouseEnter:s,onMouseLeave:a,onClick:l,children:[t.fieldType&&h.jsx(z,{as:"span",fontSize:"xs",fontWeight:"medium",color:"gray.300",fontFamily:"mono",flexShrink:0,mr:1,children:qd(t.fieldType)}),h.jsx(Di,{content:t.title,open:o,positioning:{placement:"top"},children:h.jsx(Y,{ref:i,flex:1,minWidth:0,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:"gray.400",fontSize:"sm",children:t.title})}),r&&!t.isFileObject&&h.jsx(lle,{columnId:t.id,sortModel:r})]})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",children:[r&&!t.isFileObject&&h.jsxs(h.Fragment,{children:[h.jsx(cle,{columnId:t.id,sortModel:r}),h.jsx(go,{})]}),A&&h.jsxs(h.Fragment,{children:[h.jsxs(Kt,{value:"add-filter",onClick:he,children:[h.jsx(Vm,{}),h.jsx(Y,{children:"Add filter"})]}),h.jsx(go,{})]}),(P||_)&&h.jsxs(h.Fragment,{children:[h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsxs(sv,{children:[h.jsx(Y,{flex:1,children:"Move column"}),h.jsx(Lm,{})]}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"160px",children:[P&&h.jsxs(Kt,{value:"move-left",onClick:q,children:[h.jsx(AZe,{}),h.jsx(Y,{children:"Move left"})]}),T&&h.jsxs(Kt,{value:"move-to-start",onClick:B,children:[h.jsx(IZe,{}),h.jsx(Y,{children:"Move to start"})]}),_&&h.jsxs(Kt,{value:"move-right",onClick:N,children:[h.jsx(Lm,{}),h.jsx(Y,{children:"Move right"})]}),R&&h.jsxs(Kt,{value:"move-to-end",onClick:re,children:[h.jsx(jZe,{}),h.jsx(Y,{children:"Move to end"})]})]})})})]}),h.jsx(go,{})]}),S&&h.jsxs(h.Fragment,{children:[h.jsx(d9,{label:"Insert before",valuePrefix:"before",availableFields:O,availableSystemFields:x,onSelect:Q,getAvailableFileChildren:e.getAvailableFileChildren,isColumnVisible:e.isColumnVisible}),h.jsx(d9,{label:"Insert after",valuePrefix:"after",availableFields:O,availableSystemFields:x,onSelect:V,getAvailableFileChildren:e.getAvailableFileChildren,isColumnVisible:e.isColumnVisible}),h.jsx(go,{})]}),h.jsxs(Kt,{value:"hide",disabled:!w,onClick:M,children:[h.jsx(IIe,{}),h.jsx(Y,{children:"Hide column"})]}),h.jsxs(Kt,{value:"hide-all",disabled:!k,onClick:e.hideAll,children:[h.jsx(gee,{}),h.jsx(Y,{children:"Hide all columns"})]})]})})})]}),h.jsx(ale,{isResizing:v,onMouseDown:b}),n&&$&&h.jsx(sle,{field:$,filterModel:n,isOpen:u,onClose:ne,anchorRef:c})]})}),Jet=_e(({width:t,left:e,isResizing:r,onResizeMouseDown:n,sortModel:i,filterModel:o})=>{const s=E.useRef(null),[a,l]=E.useState(!1),c=o?.systemFields.find(v=>v.systemFieldId===fr.Id)||o?.availableFields.find(v=>v.systemFieldId===fr.Id),u=!!c,p=E.useCallback(()=>{l(!0)},[]),m=E.useCallback(()=>{l(!1)},[]);return h.jsxs(z,{ref:s,as:"th",backgroundColor:"white",position:"sticky",left:e,zIndex:1,width:`${t}px`,maxWidth:`${t}px`,minWidth:`${t}px`,textAlign:"start",transition:"left 0.15s",children:[h.jsxs(Hn,{positioning:{placement:"bottom-end"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(to,{asChild:!0,children:h.jsxs(ee,{alignItems:"center",height:"30px",borderBottomWidth:"1px",borderColor:"gray.100",pl:"8px",pr:"8px",gap:"4px",cursor:"pointer",transition:"background 0.15s",_hover:{bg:"gray.50"},children:[h.jsx(z,{as:zZe,fontSize:"xs",color:"gray.300",flexShrink:0}),h.jsx(Y,{flex:1,color:"gray.400",fontSize:"sm",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:"id"}),i&&h.jsx(lle,{columnId:fr.Id,sortModel:i})]})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",children:[i&&h.jsxs(h.Fragment,{children:[h.jsx(cle,{columnId:fr.Id,sortModel:i}),h.jsx(go,{})]}),u&&h.jsxs(Kt,{value:"add-filter",onClick:p,children:[h.jsx(Vm,{}),h.jsx(Y,{children:"Add filter"})]})]})})})]}),h.jsx(ale,{isResizing:r,onMouseDown:n}),o&&c&&h.jsx(sle,{field:c,filterModel:o,isOpen:a,onClose:m,anchorRef:s})]})}),Dd="40px",pP=E.createContext(null),h9=_e(({columnsModel:t})=>{const e=t.columns,n=E.useContext(pP)?.model,i=n?.showSelectionColumn??!1,o=n?.sortModel,s=n?.filterModel,a=t.idColumnWidth,{isResizing:l,handleMouseDown:c}=Qet(t);return h.jsxs(z,{as:"tr",height:"40px",children:[h.jsx(z,{as:"th",backgroundColor:"white",position:"sticky",left:0,zIndex:1,width:i?Dd:"0px",maxWidth:i?Dd:"0px",minWidth:i?Dd:"0px",overflow:"hidden",transition:"width 0.15s, min-width 0.15s, max-width 0.15s",children:h.jsx(z,{height:"30px",borderBottomWidth:"1px",borderColor:"gray.100"})}),h.jsx(Jet,{width:a,left:i?Dd:0,isResizing:l,onResizeMouseDown:c,sortModel:o,filterModel:s}),e.map(u=>h.jsx(Ket,{column:u,columnsModel:t,sortModel:o,filterModel:s},u.id)),h.jsx(Het,{availableFields:t.availableFieldsToAdd,availableSystemFields:t.availableSystemFieldsToAdd,hasHiddenColumns:t.hasHiddenColumns,onAddColumn:t.addColumn,onAddAll:t.addAll,getAvailableFileChildren:t.getAvailableFileChildren,isColumnVisible:t.isColumnVisible})]})}),f9=_e(({model:t,onCreate:e})=>{if(t.showNotFound){const r=t.emptyStateType==="filters"?Vm:qA;return h.jsxs(qn,{flex:1,justifyContent:"center",gap:"12px",color:"gray.400",children:[h.jsx(z,{as:r,boxSize:"48px"}),h.jsx(Y,{fontSize:"md",children:"No rows found"}),h.jsx(Y,{fontSize:"sm",children:t.emptyStateHint})]})}return t.showEmpty?h.jsxs(qn,{flex:1,justifyContent:"center",gap:"12px",color:"gray.400",children:[h.jsx(z,{as:BZe,boxSize:"48px"}),h.jsx(Y,{fontSize:"md",children:"No rows yet"}),e?h.jsx(na,{fontSize:"sm",color:"gray.500",_hover:{color:"gray.600"},onClick:e,cursor:"pointer",children:"Create your first row to get started"}):h.jsx(Y,{fontSize:"sm",children:"Create your first row to get started"})]}):null}),ett=({isOpen:t,count:e,onConfirm:r,onCancel:n})=>h.jsx(np,{open:t,onOpenChange:i=>!i.open&&n(),children:h.jsxs(Lt,{children:[h.jsx(nv,{}),h.jsx(ip,{children:h.jsxs(op,{children:[h.jsx(ov,{children:h.jsxs(UP,{children:["Delete ",e===1?"row":"rows"]})}),h.jsxs(iv,{display:"flex",flexDirection:"column",gap:3,children:[h.jsxs(Y,{children:["Are you sure you want to delete ",e," ",e===1?"row":"rows","?"]}),h.jsx(Y,{color:"fg.muted",fontSize:"sm",children:"Tip: Commit your changes first to preserve them in revision history."})]}),h.jsxs(HP,{children:[h.jsx(It,{variant:"outline",onClick:n,children:"Cancel"}),h.jsx(It,{colorPalette:"red",onClick:r,children:"Delete"})]})]})})]})}),ttt=_e(({model:t})=>{const{selection:e,isDeleting:r,allRowIds:n}=t,i=e.selectedCount,o=e.deleteCount,s=e.isAllSelected(n),a=E.useCallback(()=>{e.selectAll(n)},[e,n]),l=E.useCallback(()=>{e.openDeleteConfirmation()},[e]),c=E.useCallback(async()=>{const m=e.rowIdsToDelete,v=m.length,b=e.isSelectionMode;e.closeDeleteConfirmation(),await t.deleteRows(m)?(Ur.info({description:`${v} ${v===1?"row":"rows"} deleted`}),b&&e.exitSelectionMode()):Ur.error({description:"Failed to delete rows"})},[t,e]),u=E.useCallback(()=>{e.closeDeleteConfirmation()},[e]),p=E.useCallback(()=>{e.exitSelectionMode()},[e]);return h.jsxs(h.Fragment,{children:[h.jsx(b1e,{open:e.isSelectionMode,children:h.jsx(Lt,{children:h.jsx(O1e,{zIndex:"modal",children:h.jsxs(x1e,{children:[h.jsxs(S1e,{children:[i," selected"]}),h.jsx(w1e,{}),!s&&h.jsxs(It,{variant:"outline",size:"sm",onClick:a,children:[h.jsx(fee,{}),"Select all"]}),h.jsxs(It,{variant:"outline",size:"sm",onClick:l,loading:r,disabled:r||i===0,children:[h.jsx(w_,{}),"Delete"]}),h.jsx(C1e,{asChild:!0,children:h.jsx(It,{variant:"ghost",size:"sm",onClick:p,children:h.jsx(KO,{})})})]})})})}),h.jsx(ett,{isOpen:e.isConfirmDeleteOpen,count:o,onConfirm:c,onCancel:u})]})}),rtt=({style:t,...e})=>h.jsx("table",{...e,style:{...t,width:"max-content",minWidth:"100%",tableLayout:"fixed"}}),ntt=_e(({value:t,onSave:e,onCancel:r})=>{const[n,i]=E.useState(!0),o=E.useRef(null),s=E.useRef(null),a=E.useCallback(()=>{const u=o.current?.getBoundingClientRect();return u&&u.width>0&&(s.current=u),s.current},[]);E.useEffect(()=>{i(!0)},[]);const l=E.useCallback(u=>{i(!1),u!==t?e(u):r()},[t,e,r]),c=E.useCallback(()=>{i(!1),r()},[r]);return h.jsxs(h.Fragment,{children:[h.jsx(z,{ref:o,width:"100%",height:"100%",display:"flex",alignItems:"center",children:String(t)}),h.jsx(qo,{lazyMount:!0,unmountOnExit:!0,open:n,onOpenChange:({open:u})=>{u||c()},autoFocus:!0,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:a},children:h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsxs(Oo,{width:"80px",p:1,children:[h.jsx(dP,{onClick:()=>l(!0),children:"true"}),h.jsx(dP,{onClick:()=>l(!1),children:"false"})]})})})})]})}),itt=(t,e,r)=>{if(!t||!e)return;const n=t.firstChild;if(!n||n.nodeType!==Node.TEXT_NODE)return;if(document.caretRangeFromPoint){const c=document.caretRangeFromPoint(r,t.getBoundingClientRect().top+10);if(c?.startContainer===n)return c.startOffset}const i=document;if(i.caretPositionFromPoint){const c=i.caretPositionFromPoint(r,t.getBoundingClientRect().top+10);if(c?.offsetNode===n)return c.offset}const o=t.getBoundingClientRect(),s=r-o.left,l=t.scrollWidth/e.length;return Math.max(0,Math.min(e.length,Math.round(s/l)))},ott=t=>{if(!t)return;const e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}},stt={display:{cursor:"cell",_hover:{bg:"gray.50"}},focused:{cursor:"cell",outline:"2px solid",outlineColor:"blue.400",outlineOffset:"-2px",bg:"blue.50"},editing:{cursor:"text",outline:"2px solid",outlineColor:"blue.500",outlineOffset:"-2px",bg:"white",zIndex:1e3},saving:{cursor:"wait",opacity:.7,bg:"gray.50"},error:{cursor:"cell",outline:"2px solid",outlineColor:"red.400",outlineOffset:"-2px",bg:"red.50"},readonly:{cursor:"default",color:"gray.500"}},att=_e(({children:t,state:e,displayValue:r,tooltip:n,onFocus:i,onDoubleClick:o})=>{const s=E.useRef(null),a=E.useRef(null),l=E.useCallback(()=>{e!=="editing"&&e!=="saving"&&i?.()},[e,i]),c=E.useCallback(m=>{m.detail===2&&e!=="saving"&&e!=="readonly"&&m.preventDefault()},[e]),u=E.useCallback(m=>{if(m.preventDefault(),e!=="saving"&&e!=="readonly"){const v=itt(a.current,r,m.clientX),b=ott(s.current);o?.(v,b)}},[e,o,r]);return h.jsx(z,{ref:s,as:"td",minHeight:"40px",height:"40px",borderRightWidth:"1px",borderColor:"gray.100",overflow:"hidden",maxWidth:"0",pl:"8px",pr:"8px",position:"relative",onClick:l,onMouseDown:c,onDoubleClick:u,tabIndex:e==="focused"||e==="editing"?0:-1,...stt[e],children:h.jsxs(z,{display:"flex",alignItems:"center",height:"100%",width:"100%",minWidth:0,children:[e==="editing"?t:h.jsx(Di,{content:n,disabled:!n,children:h.jsx(Y,{ref:a,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:e==="readonly"?"gray.500":"black",fontWeight:"300",flex:1,minWidth:0,children:t})}),e==="saving"&&h.jsx(z,{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",children:h.jsx(ri,{size:"xs",color:"blue.500"})})]})})}),ltt=_e(({store:t,isReadonly:e,onUpload:r})=>{const n=t.value.status?.getPlainValue()??"",i=t.value.fileId?.getPlainValue()??"",o=t.value.url?.getPlainValue()??"",s=t.value.mimeType?.getPlainValue()??"",a=t.value.width?.getPlainValue()??0,l=t.value.height?.getPlainValue()??0,c=s.startsWith("image/"),u=!!o,p=!e&&(n==="ready"||n==="uploaded"),m=E.useCallback(()=>{o&&window.open(o,"_blank","noopener,noreferrer")},[o]),v=E.useCallback(O=>{const x=O.target.files?.[0];x&&(r?.(i,x,t),O.target.value="")},[i,r,t]),b=`file-cell-${i}`;return!u&&!p?e?null:h.jsx(Di,{openDelay:50,closeDelay:50,positioning:{placement:"right"},content:"Save row first to upload file",children:h.jsx(z,{display:"flex",alignItems:"center",color:"gray.400",cursor:"default",children:h.jsx(Yg,{})})}):h.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"center",gap:1,role:"group",width:"100%",children:[u&&h.jsx(h.Fragment,{children:c?h.jsxs(QZ,{lazyMount:!0,unmountOnExit:!0,openDelay:350,closeDelay:100,positioning:{gutter:16},children:[h.jsx(BZ,{children:h.jsx(Ir,{"aria-label":"Preview file",size:"xs",variant:"ghost",color:"gray.500",_hover:{color:"gray.700",bg:"gray.100"},onClick:m,children:h.jsx(Yg,{})})}),h.jsx(Lt,{children:h.jsx(zZ,{children:h.jsxs(qZ,{children:[h.jsx(WZ,{children:h.jsx(dM,{})}),h.jsx(UZ,{aspectRatio:a>0&&l>0?a/l:1,width:"300px",src:o})]})})})]}):h.jsx(Ir,{"aria-label":"Open file",size:"xs",variant:"ghost",color:"gray.500",_hover:{color:"gray.700",bg:"gray.100"},onClick:m,children:h.jsx(Yg,{})})}),p&&h.jsxs(z,{opacity:0,_groupHover:{opacity:1},transition:"opacity 0.15s",children:[h.jsx("input",{type:"file",onChange:v,id:b,style:{display:"none"}}),h.jsx("label",{htmlFor:b,children:h.jsx(Ir,{as:"span","aria-label":"Upload file",size:"xs",variant:"ghost",color:u?"gray.400":"gray.500",_hover:{color:"gray.700",bg:"gray.100"},cursor:"pointer",children:h.jsx(jIe,{})})})]})]})}),ctt=_e(({value:t,revisionId:e,foreignTableId:r,rowId:n,onSave:i,onCancel:o})=>{const[s,a]=E.useState(!0),l=E.useRef(null),c=E.useRef(null),u=E.useCallback(()=>{const v=l.current?.getBoundingClientRect();return v&&v.width>0&&(c.current=v),c.current},[]);E.useEffect(()=>{a(!0)},[]);const p=E.useCallback(v=>{a(!1),v!==t?i(v):o()},[t,i,o]),m=E.useCallback(()=>{a(!1),o()},[o]);return h.jsxs(h.Fragment,{children:[h.jsx(z,{ref:l,width:"100%",height:"100%",display:"flex",alignItems:"center",children:t||h.jsx(z,{color:"gray.400",children:"Select..."})}),h.jsx(qo,{lazyMount:!0,unmountOnExit:!0,open:s,onOpenChange:({open:v})=>{v||m()},autoFocus:!1,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:u},children:h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{width:"320px",p:0,children:h.jsx(Mse,{revisionId:e,tableId:r,onChange:p,onClose:m,disableFooterActions:!0,rowLinkPath:n})})})})})]})}),p9=_e(({value:t,type:e,fileName:r,onClick:n})=>{const i=()=>{switch(e){case"file":return h.jsxs(z,{display:"flex",alignItems:"center",gap:1,color:"gray.600",children:[h.jsx(Yg,{}),h.jsx(Y,{truncate:!0,children:r||"File"})]});case"object":return"{...}";case"array":return"[...]";case"readonly":return h.jsx(Y,{truncate:!0,color:"gray.500",children:t});default:return t}},o=e!=="readonly"&&n;return h.jsx(z,{width:"100%",height:"100%",display:"flex",alignItems:"center",cursor:o?"pointer":"default",onClick:o?n:void 0,color:"gray.500",_hover:o?{color:"gray.700",textDecoration:"underline"}:void 0,children:i()})}),utt=t=>{const e=E.useRef(null),[r,n]=E.useState(t?{top:t.top,left:t.left,width:t.width}:null);return E.useLayoutEffect(()=>{const i=()=>{if(e.current){const o=e.current.closest("td");if(o){const s=o.getBoundingClientRect();n({top:s.top,left:s.left,width:s.width})}}};return t||i(),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[t]),{anchorRef:e,position:r}},dtt=3,f5=20,P0=40,g9=24,ule=(P0-f5)/2,htt=dtt*f5+ule*2,ftt=t=>{if(t===""||t==="-"||t===".")return!0;const e=Number(t);return!Number.isNaN(e)||t==="-."||t.endsWith(".")},m9=_e(({value:t,onSave:e,onCancel:r,onCommitAndMove:n,clickOffset:i,type:o="string",defaultValue:s=0,initialPosition:a,readOnly:l=!1})=>{const[c,u]=E.useState(t),p=E.useRef(!1),m=E.useRef(null),{anchorRef:v,position:b}=utt(a),O=E.useRef(!1);E.useLayoutEffect(()=>{if(m.current&&b&&!O.current&&(O.current=!0,m.current.focus(),!l)){const T=i!==void 0?Math.min(i,t.length):t.length;m.current.setSelectionRange(T,T)}},[i,t.length,b,l]);const x=E.useRef(!1);E.useLayoutEffect(()=>{if(m.current&&!x.current){x.current=!0,m.current.style.height=`${P0}px`;const T=m.current.scrollHeight;if(T>P0){const R=Math.min(T,htt);m.current.style.height=`${R}px`}}},[b]);const S=E.useCallback(T=>{const R=T.target.value;o==="number"&&!ftt(R)||u(R)},[o]),w=E.useCallback(()=>{if(!p.current)if(p.current=!0,o==="number"){const T=Number.parseFloat(c),R=Number.parseFloat(t);Number.isNaN(T)||c===""?s!==R?e(s):r():T!==R?e(T):r()}else{let T=c;for(;T.endsWith(`
|
|
1712
|
-
`);)T=T.slice(0,-1);T===t?r():e(T)}},[c,t,e,r,o,s]),k=E.useCallback(T=>{if(T.key==="Escape"){T.preventDefault(),p.current=!0,u(t),r();return}l||(T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),w(),n?.("down")),T.key==="Tab"&&(T.preventDefault(),w(),n?.(T.shiftKey?"prev":"next")))},[w,n,r,t,l]),P=E.useCallback(T=>{if(!T.relatedTarget?.closest("[data-close-button]")){if(l){r();return}w()}},[w,l,r]),_=l?"gray.400":"blue.500";return h.jsxs(h.Fragment,{children:[h.jsx("span",{ref:v,style:{position:"absolute",top:0,left:0}}),b&&h.jsx(Lt,{children:h.jsxs(z,{position:"fixed",top:`${b.top-(l?g9:0)}px`,left:`${b.left}px`,zIndex:9999,children:[l&&h.jsxs(z,{height:`${g9}px`,bg:"gray.100",px:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"gray.600",borderTopRadius:"4px",border:"1px solid",borderColor:"gray.300",borderBottom:"none",children:[h.jsx("span",{children:"View only"}),h.jsx(Ir,{"aria-label":"Close",size:"2xs",variant:"ghost",color:"gray.500",_hover:{color:"gray.700",bg:"gray.200"},onClick:r,minW:"16px",h:"16px","data-close-button":!0,children:h.jsx(KO,{})})]}),h.jsx(yM,{ref:m,value:c,onChange:S,onKeyDown:k,onBlur:P,readOnly:l,width:`${b.width}px`,minWidth:`${b.width}px`,height:`${P0}px`,minHeight:`${P0}px`,bg:"white",borderRadius:l?"0 0 4px 4px":"0",border:l?"1px solid":"none",borderColor:l?"gray.300":void 0,borderTop:l?"none":void 0,outline:l?"none":"2px solid",outlineColor:l?void 0:_,outlineOffset:l?void 0:"-2px",px:"8px",py:`${ule}px`,m:0,fontFamily:"inherit",fontSize:"16px",fontWeight:"300",lineHeight:`${f5}px`,resize:"both",overflow:"auto",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",cursor:l?"default":void 0,_focus:{outline:l?"none":"2px solid",outlineColor:l?void 0:_,outlineOffset:l?void 0:"-2px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}})]})})]})}),ptt=_e(({cellVM:t,fieldName:e,revisionId:r,onNavigateToRow:n,onFileUpload:i})=>{const o=E.useCallback(()=>{t.focus()},[t]),s=E.useCallback((p,m)=>{t.enterEditMode(p,m)},[t]),a=E.useCallback(async p=>{await t.save(e,p)},[t,e]),l=E.useCallback(()=>{t.cancelEdit()},[t]),c=E.useCallback(p=>{t.commitAndMove(p)},[t]),u=()=>{const{fieldType:p,isReadonly:m,isEditing:v,supportsViewMode:b,displayValue:O,foreignKey:x,stringValue:S,numberDefault:w,booleanValue:k,store:P,clickOffset:_,cellPosition:T}=t;if(p==="file"&&P instanceof hO)return h.jsx(ltt,{store:P,isReadonly:t.isRevisionReadonly,onUpload:i});if(p==="object"||p==="array")return h.jsx(p9,{value:O,type:p,onClick:n});if(v){if(p==="foreignKey"&&x)return h.jsx(ctt,{value:S,revisionId:r,foreignTableId:x,rowId:t.rowId,onSave:R=>a(R),onCancel:l});if(p==="string")return h.jsx(m9,{value:S,onSave:R=>a(R),onCancel:l,onCommitAndMove:m?void 0:c,clickOffset:_,initialPosition:T,readOnly:m});if(p==="number")return h.jsx(m9,{value:S,defaultValue:w,onSave:R=>a(R),onCancel:l,onCommitAndMove:m?void 0:c,clickOffset:_,initialPosition:T,type:"number",readOnly:m});if(p==="boolean")return h.jsx(ntt,{value:k,onSave:R=>a(R),onCancel:l})}return m&&!b?h.jsx(p9,{value:O,type:"readonly"}):O};return h.jsx(att,{state:t.cellState,displayValue:t.displayValue,tooltip:t.sizeTooltip,onFocus:o,onDoubleClick:s,children:u()})}),gtt=/^[\d.-]$/;_e(({value:t,defaultValue:e,onSave:r,onCancel:n,onCommitAndMove:i,autoFocus:o=!0})=>{const[s,a]=E.useState(String(t)),l=E.useRef(!1),c=E.useCallback(v=>{a(v)},[]),u=E.useCallback(()=>{if(l.current)return;l.current=!0;const v=Number.parseFloat(s);Number.isNaN(v)?r(e):v!==t?r(v):n()},[s,t,e,r,n]),p=E.useCallback(()=>{u(),i?.("down")},[u,i]),m=E.useCallback(()=>{l.current=!0,a(String(t)),n()},[t,n]);return h.jsx(z,{width:"100%",minWidth:0,children:h.jsx(If,{initValue:s,onChange:c,onBlur:u,onEnter:p,onEscape:m,restrict:gtt,autoFocus:o})})});const mtt=({value:t,fieldType:e})=>{const r=vtt(t,e),i=e===Ye.DateTime&&t!==null&&t!=="",o=h.jsx(z,{as:"td",minHeight:"40px",height:"40px",borderRightWidth:"1px",borderColor:"gray.100",overflow:"hidden",maxWidth:"0",pl:"8px",pr:"8px",position:"relative",cursor:"default",color:"gray.500",children:h.jsx(z,{display:"flex",alignItems:"center",height:"100%",width:"100%",minWidth:0,children:h.jsx(Y,{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",fontWeight:"300",flex:1,minWidth:0,children:r})})});return i?h.jsx(Di,{content:t,positioning:{placement:"top"},children:o}):o};function vtt(t,e){return t===null||t===""?"—":e===Ye.DateTime?OL(t):t}const dle=_e(({row:t,columnsModel:e,revisionId:r,onFileUpload:n})=>{const i=Ba(),o=E.useCallback(()=>{i(t.id)},[i,t.id]);return h.jsx(h.Fragment,{children:e.columns.map(s=>{if(s.isSystemColumn&&s.systemFieldId){const l=t.getSystemFieldValue(s.systemFieldId);return h.jsx(mtt,{value:l,fieldType:s.fieldType},s.id)}const a=t.getCellViewModel(s.id);return a?h.jsx(ptt,{cellVM:a,fieldName:s.name,revisionId:r,onNavigateToRow:o,onFileUpload:n},s.id):null})})}),ytt="_Row_5zyqz_1",btt="_Actions_5zyqz_1",nN={Row:ytt,Actions:btt},Ott=_e(({row:t,columnsModel:e,revisionId:r,tableId:n,onCopy:i,selection:o,showSelectionColumn:s})=>{const{open:a,setOpen:l}=MN(),c=E.useCallback(()=>{i?.(t.versionId)},[i,t.versionId]),u=E.useCallback(()=>{o?.requestSingleDelete(t.id)},[o,t.id]),p=E.useCallback(()=>{o?.enterSelectionMode(t.id)},[o,t.id]),m=E.useCallback(()=>{o?.toggle(t.id)},[o,t.id]),{upload:v}=uBe({revisionId:r,tableId:n,rowId:t.id}),b=o?.isSelected(t.id)??!1;return h.jsxs(z,{height:"40px",as:"tr",_hover:{"& td":{bg:"gray.50"}},bg:"white",className:`${nN.Row} group`,"data-testid":`row-${t.id}`,position:t.isRowEditing?"relative":void 0,zIndex:t.isRowEditing?100:void 0,children:[h.jsx(z,{as:"td",position:"sticky",left:0,zIndex:1,backgroundColor:"white",width:s?Dd:"0px",minWidth:s?Dd:"0px",maxWidth:s?Dd:"0px",pl:s?"8px":"0px",overflow:"hidden",transition:"width 0.15s, min-width 0.15s, max-width 0.15s, padding 0.15s",children:h.jsx(ee,{alignItems:"center",height:"100%",children:h.jsxs(z1e,{checked:b,onCheckedChange:m,children:[h.jsx(U1e,{}),h.jsx(W1e,{})]})})}),h.jsxs(z,{as:"td",position:"sticky",left:s?Dd:0,zIndex:1,backgroundColor:"white",maxWidth:"0",pl:"8px",pr:"24px",transition:"left 0.15s",children:[h.jsxs(ee,{alignItems:"center",children:[h.jsx(Y,{textDecoration:"underline",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:h.jsx(Ki,{to:`${t.id}`,"data-testid":`row-${t.id}-link`,children:t.id})}),t.showModifiedIndicator&&h.jsx(Y,{color:"gray.400",children:"*"})]}),h.jsx(z,{position:"absolute",right:0,top:0,bottom:0,width:"1px",bg:"gray.100"})]}),h.jsx(dle,{row:t,columnsModel:e,revisionId:r,onFileUpload:v}),h.jsx(z,{as:"td",width:"100%"}),t.showMenu&&h.jsx(z,{className:a?void 0:nN.Actions,as:"td",position:"sticky",right:0,zIndex:1,backgroundColor:"white",width:"40px",children:h.jsx(ee,{justifyContent:"flex-end",children:h.jsxs(Hn,{positioning:{placement:"bottom-start"},open:a,onOpenChange:O=>{l(O.open)},children:[h.jsx(to,{children:h.jsx(z,{paddingRight:"2px",children:h.jsx(yee,{dataTestId:`row-list-menu-${t.id}`})})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{children:[t.canDeleteRow&&h.jsxs(Kt,{color:"gray.600",value:"select","data-testid":`select-row-${t.id}`,onClick:p,children:[h.jsx(fee,{}),h.jsx(z,{flex:"1",children:"Select"})]}),t.canCreateRow&&h.jsxs(Kt,{color:"gray.600",value:"copy","data-testid":`copy-row-${t.id}`,onClick:c,children:[h.jsx(fD,{}),h.jsx(z,{flex:"1",children:"Duplicate"})]}),t.canDeleteRow&&h.jsxs(Kt,{color:"gray.600",value:"delete","data-testid":`remove-row-${t.id}`,onClick:u,children:[h.jsx(w_,{}),h.jsx(z,{flex:1,children:"Delete"})]})]})})})]})})})]})}),xtt=_e(({row:t,columnsModel:e,revisionId:r,onSelect:n})=>{const i=E.useCallback(()=>{n?.(t.id)},[n,t.id]);return h.jsxs(z,{height:"40px",as:"tr",_hover:{"& td":{bg:"gray.50"}},className:nN.Row,"data-testid":`row-${t.id}`,children:[h.jsxs(z,{as:"td",position:"sticky",left:0,backgroundColor:"white",width:"200px",minWidth:"200px",maxWidth:"200px",children:[h.jsxs(ee,{alignItems:"center",children:[h.jsx(Y,{textDecoration:"underline",cursor:"pointer",onClick:i,"data-testid":`row-${t.id}-select`,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:t.id}),t.showModifiedIndicator&&h.jsx(Y,{color:"gray.400",children:"*"})]}),h.jsx(z,{position:"absolute",right:0,top:0,bottom:0,width:"1px",bg:"gray.100"})]}),h.jsx(dle,{row:t,columnsModel:e,revisionId:r}),h.jsx(z,{as:"td",width:"100%"}),h.jsx(z,{as:"td"})]})}),wtt=_e(({"data-index":t})=>{const e=E.useContext(pP);if(!e)return null;const{model:r,revisionId:n,tableId:i,isRowPickerMode:o,onSelect:s,onCopy:a}=e,{items:l,columnsModel:c,selection:u,showSelectionColumn:p}=r,m=l[t];return m?o?h.jsx(xtt,{row:m,columnsModel:c,revisionId:n,onSelect:s}):h.jsx(Ott,{row:m,columnsModel:c,revisionId:n,tableId:i,onCopy:a,selection:u,showSelectionColumn:p}):null}),Stt=t=>{const e=t.getAttribute("contenteditable")==="true";return(t.tagName==="INPUT"||t.tagName==="TEXTAREA")&&!e},Ctt=(t,e)=>{switch(t.key){case"Escape":t.preventDefault(),e.cancelEdit();break;case"Tab":t.preventDefault(),t.shiftKey?e.commitAndMoveLeft():e.commitAndMoveRight();break}},ktt=(t,e)=>{switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault(),e.moveFocus(t.key.replace("Arrow","").toLowerCase());break;case"Tab":t.preventDefault(),t.shiftKey?e.moveFocusToPrev():e.moveFocusToNext();break;case"Enter":case"F2":t.preventDefault(),e.enterEditMode();break;case"Escape":t.preventDefault(),e.clearFocus();break;case"Delete":case"Backspace":break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&e.enterEditMode()}},Ptt=({inlineEditModel:t,enabled:e=!0})=>{const r=E.useCallback(n=>{!e||!t.hasFocus||Stt(n.target)||(t.isEditing?Ctt(n,t):ktt(n,t))},[e,t]);E.useEffect(()=>{if(e)return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,r])},_tt={Table:rtt,TableRow:wtt},Ttt=_e(({model:t,revisionId:e,tableId:r,isRevisionReadonly:n=!1,onSelect:i,onCopy:o,onCreate:s})=>{const a=!!i,{items:l,columnsModel:c,inlineEdit:u,showHeader:p}=t;Ptt({inlineEditModel:u,enabled:!a});const m=E.useMemo(()=>({model:t,revisionId:e,tableId:r,isRevisionReadonly:n,isRowPickerMode:a,onSelect:i,onCopy:o}),[t,e,r,n,a,i,o]),v=E.useMemo(()=>p?()=>h.jsx(h9,{columnsModel:c}):void 0,[p,c]),b=E.useCallback(()=>t.isLoadingMore?h.jsx(z,{display:"flex",justifyContent:"center",alignItems:"center",py:"16px",children:h.jsx(ri,{size:"sm",color:"gray.400"})}):null,[t.isLoadingMore]),O=E.useMemo(()=>({..._tt,Footer:b}),[b]);return t.showLoading?h.jsx(z,{display:"flex",flexDirection:"column",height:"100%",children:h.jsx(z,{display:"flex",flex:1,justifyContent:"center",alignItems:"center",children:h.jsx(ri,{size:"lg",color:"gray.400"})})}):t.showError?h.jsx(z,{display:"flex",justifyContent:"center",alignItems:"center",height:"200px",children:h.jsx(Y,{color:"red.500",children:"Error loading rows"})}):t.showEmpty?h.jsx(z,{display:"flex",flexDirection:"column",height:"100%",children:h.jsx(f9,{model:t,onCreate:s})}):t.showNotFound?h.jsx(pP.Provider,{value:m,children:h.jsxs(z,{display:"flex",flexDirection:"column",height:"100%",children:[h.jsx(z,{overflowX:"auto",children:h.jsx("table",{style:{width:"max-content",minWidth:"100%",tableLayout:"fixed",borderCollapse:"collapse"},children:h.jsx(z,{as:"thead",position:"sticky",top:0,zIndex:2,bg:"white",children:h.jsx(h9,{columnsModel:c})})})}),h.jsx(f9,{model:t,onCreate:s})]})}):t.showList?h.jsxs(pP.Provider,{value:m,children:[h.jsx($9e,{style:{height:"100%"},totalCount:l.length,defaultItemHeight:40,increaseViewportBy:40*100,endReached:t.hasNextPage?t.tryToFetchNextPage:void 0,data:l,components:O,fixedHeaderContent:v}),h.jsx(ttt,{model:t})]}):null}),Ett=400,Rtt=32,v9=280,Bj="0.2s",Itt=_e(({value:t,onChange:e,onClear:r})=>{const[n,i]=E.useState(!1),o=E.useRef(null),s=E.useRef(null),a=t.length>0,l=E.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null)},[]),c=E.useCallback(x=>{e(x.target.value)},[e]),u=E.useCallback(()=>{l(),i(!0)},[l]),p=E.useCallback(()=>{l(),t||(s.current=setTimeout(()=>{i(!1)},Ett))},[l,t]),m=E.useCallback(()=>{l()},[l]),v=E.useCallback(x=>{x.key==="Escape"&&!t&&(l(),i(!1),o.current?.blur())},[l,t]),b=E.useCallback(()=>{r(),o.current?.focus()},[r]);E.useEffect(()=>{n&&o.current&&requestAnimationFrame(()=>{o.current?.focus()})},[n]),E.useEffect(()=>()=>l(),[l]);const O=a?`Search: "${t}"`:"Search rows";return h.jsxs(z,{position:"relative",display:"inline-flex",alignItems:"center",width:n?`${v9}px`:`${Rtt}px`,height:"32px",transition:`width ${Bj} ease-in-out`,children:[h.jsx(Di,{content:O,positioning:{placement:"top"},disabled:n,children:h.jsx(z,{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",opacity:n?0:1,pointerEvents:n?"none":"auto",transition:`opacity ${Bj} ease-in-out`,children:h.jsx(Ir,{"aria-label":"Search rows",size:"sm",variant:"ghost",colorPalette:"gray",color:"gray.300",onClick:u,children:h.jsx(qA,{})})})}),h.jsxs(z,{position:"absolute",left:0,top:0,display:"flex",alignItems:"center",width:`${v9}px`,height:"32px",opacity:n?1:0,pointerEvents:n?"auto":"none",transition:`opacity ${Bj} ease-in-out`,children:[h.jsx(z,{color:"gray.400",pl:"10px",flexShrink:0,children:h.jsx(qA,{size:14})}),h.jsx(hs,{ref:o,variant:"flushed",value:t,onChange:c,onFocus:m,onBlur:p,onKeyDown:v,_placeholder:{color:"gray.400"},placeholder:"Search...",size:"sm",pl:"8px",pr:a?"28px":"8px",tabIndex:n?0:-1}),a&&h.jsx(MZ,{position:"absolute",right:"0",color:"gray.400",size:"xs",onClick:b,onMouseDown:x=>x.preventDefault()})]})]})}),jtt=_e(({selectedField:t,dataFields:e,systemFields:r,onSelect:n})=>{const i=e.length>0,o=r.length>0;return h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"100px",children:[t&&h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",children:qd(t.fieldType)}),h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.700",truncate:!0,maxWidth:"120px",children:t?.name||"Select field"}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",maxH:"300px",overflow:"auto",children:[i&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Data fields"}),e.map(s=>h.jsx(Kt,{value:s.nodeId,onClick:()=>n(s),bg:t?.nodeId===s.nodeId?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",width:"24px",textAlign:"center",children:qd(s.fieldType)}),h.jsx(Y,{truncate:!0,children:s.name||"(unnamed)"})]})},s.nodeId))]}),o&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"System fields"}),r.map(s=>h.jsx(Kt,{value:s.nodeId,onClick:()=>n(s),bg:t?.nodeId===s.nodeId?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",width:"24px",textAlign:"center",children:qd(s.fieldType)}),h.jsx(Y,{truncate:!0,children:s.name||"(unnamed)"})]})},s.nodeId))]})]})})]})}),$tt=_e(({filterModel:t,condition:e})=>{const r=t.allFields.find(c=>c.name===e.field),n=Lg(e.operator,e.fieldType),i=t.getErrorForCondition(e.id),o=c=>{t.updateCondition(e.id,{field:c.name,fieldPath:c.path,fieldType:c.fieldType,isSystemField:c.isSystemField,systemFieldId:c.systemFieldId})},s=c=>{t.updateCondition(e.id,{operator:c})},a=c=>{t.updateCondition(e.id,{value:c})},l=()=>t.removeCondition(e.id);return h.jsxs(z,{children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,py:1,children:[h.jsx(jtt,{selectedField:r,dataFields:t.availableFields,systemFields:t.systemFields,onSelect:o}),h.jsx(ile,{selectedOperator:e.operator,fieldType:e.fieldType,onSelect:s}),n&&h.jsx(ole,{value:e.value,fieldType:e.fieldType,error:!!i,onChange:a}),h.jsx(Ir,{"aria-label":"Remove filter",size:"xs",variant:"ghost",color:"newGray.400",_hover:{bg:"newGray.100",color:"newGray.600"},onClick:l,children:h.jsx(fT,{})})]}),i&&h.jsx(Y,{fontSize:"xs",color:"red.500",ml:2,children:i})]})}),y9=({logic:t,onChange:e})=>h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"inline-flex",alignItems:"center",gap:1,px:2,py:.5,borderRadius:"md",bg:"newGray.100",color:"newGray.700",fontWeight:"medium",fontSize:"sm",_hover:{bg:"newGray.200"},cursor:"pointer",children:[t==="and"?"All":"Any",h.jsx(yx,{size:12})]})}),h.jsx(Gn,{children:h.jsxs(Xn,{minW:"100px",children:[h.jsx(Kt,{value:"and",onClick:()=>e("and"),children:h.jsx(Y,{children:"All (AND)"})}),h.jsx(Kt,{value:"or",onClick:()=>e("or"),children:h.jsx(Y,{children:"Any (OR)"})})]})})]}),hle=_e(({filterModel:t,group:e,isRoot:r=!1})=>{const n=l=>{t.setGroupLogic(e.id,l)},i=()=>t.addCondition(e.id),o=()=>t.addGroup(e.id),s=()=>t.removeGroup(e.id),a=e.conditions.length>0||e.groups.length>0;return h.jsxs(z,{borderWidth:r?0:1,borderColor:"newGray.100",borderRadius:"md",p:r?0:3,bg:r?"transparent":"newGray.25",position:"relative",children:[!r&&h.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2,children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"Match"}),h.jsx(y9,{logic:e.logic,onChange:n}),h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"of the following"})]}),h.jsxs(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:s,children:[h.jsx(fT,{}),"Remove group"]})]}),r&&a&&h.jsxs(z,{display:"flex",alignItems:"center",gap:2,mb:2,children:[h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"Where"}),h.jsx(y9,{logic:e.logic,onChange:n}),h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"of the following are true"})]}),e.conditions.map(l=>h.jsx($tt,{filterModel:t,condition:l},l.id)),e.groups.map(l=>h.jsx(z,{mt:2,children:h.jsx(hle,{filterModel:t,group:l})},l.id)),h.jsxs(z,{display:"flex",gap:2,mt:2,children:[h.jsxs(It,{size:"xs",variant:"ghost",onClick:i,disabled:t.availableFields.length===0,children:[h.jsx(zA,{}),"Add condition"]}),r&&h.jsxs(It,{size:"xs",variant:"ghost",onClick:o,disabled:t.availableFields.length===0,children:[h.jsx(zA,{}),"Add group"]})]})]})}),Att=_e(({filterModel:t,anchorRef:e})=>{const r=E.useRef(null),n=E.useCallback(()=>{const l=e.current?.getBoundingClientRect();return l&&l.width>0&&(r.current=l),r.current},[e]),i=()=>{t.apply()&&t.closeFilterBar()},o=({open:l})=>{l?t.openFilterBar():t.closeFilterBar()},s=t.hasAppliedFilters||t.hasPendingChanges,a=t.hasPendingChanges?"orange":"gray";return h.jsxs(qo,{open:t.isFilterBarOpen,onOpenChange:o,lazyMount:!0,unmountOnExit:!0,autoFocus:!1,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:n},children:[h.jsx(Di,{content:t.tooltipContent,positioning:{placement:"top"},disabled:t.isFilterBarOpen,children:h.jsxs(z,{position:"relative",display:"inline-flex",children:[h.jsx(Pl,{asChild:!0,children:h.jsx(Ir,{"aria-label":"Toggle filters",size:"sm",variant:t.isFilterBarOpen?"subtle":"ghost",colorPalette:"gray",color:t.hasAppliedFilters?void 0:"gray.300",children:h.jsx(Vm,{})})}),s&&h.jsx(au,{position:"absolute",top:"-1",right:"-1",colorPalette:a,variant:"solid",size:"xs",borderRadius:"full",minWidth:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",children:t.filterCount})]})}),h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{width:e.current?.offsetWidth?`${e.current.offsetWidth}px`:"auto",p:0,borderRadius:"md",boxShadow:"lg",children:h.jsxs(z,{borderWidth:1,borderColor:"newGray.100",borderRadius:"md",p:3,bg:"white",children:[h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(z,{color:"newGray.400",children:h.jsx(Vm,{size:14})}),h.jsx(z,{as:"span",fontWeight:"medium",fontSize:"sm",color:"newGray.600",children:"Filters"}),t.filterCount>0&&h.jsx(au,{colorPalette:"gray",size:"sm",variant:"subtle",children:t.filterCount}),t.hasPendingChanges&&h.jsx(au,{colorPalette:"orange",size:"sm",variant:"subtle",children:"unsaved"})]}),h.jsxs(z,{display:"flex",gap:2,children:[t.hasFilters&&h.jsx(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:t.reset,children:"Clear all"}),h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",onClick:i,disabled:!t.hasPendingChanges,children:"Apply"})]})]}),h.jsx(hle,{filterModel:t,group:t.rootGroup,isRoot:!0})]})})})})]})}),zj=[{value:"asc",label:"A → Z",icon:Nse},{value:"desc",label:"Z → A",icon:Ase}],Ntt=_e(({selectedDirection:t,onSelect:e})=>{const r=zj.find(i=>i.value===t)||zj[0],n=r.icon;return h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"80px",children:[h.jsx(z,{color:"blue.500",children:h.jsx(n,{size:14})}),h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.700",children:r.label}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsx(Xn,{minW:"120px",children:zj.map(i=>{const o=i.icon;return h.jsx(Kt,{value:i.value,onClick:()=>e(i.value),bg:t===i.value?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(z,{color:"blue.500",children:h.jsx(o,{size:14})}),h.jsx(Y,{children:i.label})]})},i.value)})})})]})}),Mtt=_e(({selectedField:t,availableFields:e,onSelect:r})=>h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"100px",children:[t&&h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",children:qd(t.fieldType)}),h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.700",truncate:!0,maxWidth:"120px",children:t?.name||"Select field"}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsx(Xn,{minW:"180px",maxH:"300px",overflow:"auto",children:e.map(n=>h.jsx(Kt,{value:n.nodeId,onClick:()=>r(n),bg:t?.nodeId===n.nodeId?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",width:"24px",textAlign:"center",children:qd(n.fieldType)}),h.jsx(Y,{truncate:!0,children:n.name||"(unnamed)"})]})},n.nodeId))})})]})),Dtt=_e(({sort:t,index:e,availableFields:r,onFieldChange:n,onDirectionChange:i,onRemove:o})=>{const s=r.find(u=>u.nodeId===t.id),a=u=>{u.nodeId!==t.id&&n(t.id,u.nodeId)},l=u=>{i(t.id,u)},c=()=>o(t.id);return h.jsxs(z,{display:"flex",alignItems:"center",gap:2,py:1,children:[h.jsxs(Y,{fontSize:"xs",color:"gray.400",fontWeight:"medium",minW:"16px",children:[e+1,"."]}),h.jsx(Mtt,{selectedField:s,availableFields:r,onSelect:a}),h.jsx(Ntt,{selectedDirection:t.direction,onSelect:l}),h.jsx(Ir,{"aria-label":"Remove sort",size:"xs",variant:"ghost",color:"newGray.400",_hover:{bg:"newGray.100",color:"newGray.600"},onClick:c,children:h.jsx(fT,{})})]})}),Ltt=_e(({sortModel:t,anchorRef:e})=>{const r=E.useRef(null),n=E.useCallback(()=>{const v=e.current?.getBoundingClientRect();return v&&v.width>0&&(r.current=v),r.current},[e]),i=()=>{t.apply(),t.close()},o=()=>{t.reset(),t.close()},s=({open:v})=>{v?t.open():t.close()},a=E.useCallback(()=>{const v=t.fieldsNotInSort;v.length>0&&t.addSort(v[0].nodeId)},[t]),l=E.useCallback((v,b)=>{t.replaceField(v,b)},[t]),c=E.useCallback((v,b)=>{t.setSort(v,b)},[t]),u=E.useCallback(v=>{t.removeSort(v)},[t]),p=t.hasAppliedSorts||t.hasPendingChanges,m=t.hasPendingChanges?"orange":"gray";return h.jsxs(qo,{open:t.isOpen,onOpenChange:s,lazyMount:!0,unmountOnExit:!0,autoFocus:!1,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:n},children:[h.jsx(Di,{content:t.tooltipContent,positioning:{placement:"top"},disabled:t.isOpen,children:h.jsxs(z,{position:"relative",display:"inline-flex",children:[h.jsx(Pl,{asChild:!0,children:h.jsx(Ir,{"aria-label":"Toggle sorting",size:"sm",variant:t.isOpen?"subtle":"ghost",colorPalette:"gray",color:t.hasAppliedSorts?void 0:"gray.300",children:h.jsx(kW,{})})}),p&&h.jsx(au,{position:"absolute",top:"-1",right:"-1",colorPalette:m,variant:"solid",size:"xs",borderRadius:"full",minWidth:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",children:t.sortCount})]})}),h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{width:e.current?.offsetWidth?`${e.current.offsetWidth}px`:"auto",minW:"350px",p:0,borderRadius:"md",boxShadow:"lg",children:h.jsxs(z,{borderWidth:1,borderColor:"newGray.100",borderRadius:"md",p:3,bg:"white",children:[h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(z,{color:"newGray.400",children:h.jsx(kW,{size:14})}),h.jsx(z,{as:"span",fontWeight:"medium",fontSize:"sm",color:"newGray.600",children:"Sort"}),t.sortCount>0&&h.jsx(au,{colorPalette:"gray",size:"sm",variant:"subtle",children:t.sortCount}),t.hasPendingChanges&&h.jsx(au,{colorPalette:"orange",size:"sm",variant:"subtle",children:"unsaved"})]}),h.jsxs(z,{display:"flex",gap:2,children:[t.hasSorts&&h.jsx(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:o,children:"Clear all"}),h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",onClick:i,disabled:!t.hasPendingChanges,children:"Apply"})]})]}),h.jsx(z,{children:t.sorts.map((v,b)=>h.jsx(Dtt,{sort:v,index:b,availableFields:t.availableFields,onFieldChange:l,onDirectionChange:c,onRemove:u},v.id))}),t.canAddSort&&h.jsxs(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:a,mt:t.hasSorts?1:0,children:[h.jsx(zA,{size:14}),h.jsx(Y,{ml:1,children:"Add sort"})]}),!t.hasSorts&&!t.canAddSort&&h.jsx(Y,{fontSize:"sm",color:"gray.400",textAlign:"center",py:2,children:"No sortable fields available"})]})})})})]})});class Vtt{_state="loading";_items=[];_hasNextPage=!1;_endCursor=null;_totalCount=0;_isInitialLoad=!0;constructor(){Be(this,{},{autoBind:!0})}get state(){return this._state}get items(){return this._items}get hasNextPage(){return this._hasNextPage}get endCursor(){return this._endCursor}get totalCount(){return this._totalCount}get isInitialLoad(){return this._isInitialLoad}get showLoading(){return this._state==="loading"&&this._isInitialLoad}get showEmpty(){return this._state==="empty"}get showNotFound(){return this._state==="notFound"}get showList(){return this._state==="list"}get showError(){return this._state==="error"}setLoading(){this._state="loading"}setError(){this._isInitialLoad=!1,this._state="error"}setItems(e,r){this._isInitialLoad=!1,this._items=e,this._hasNextPage=r.hasNextPage,this._endCursor=r.endCursor,this._totalCount=r.totalCount,e.length>0?this._state="list":r.isSearching?this._state="notFound":this._state="empty"}appendItems(e,r){this._items=[...this._items,...e],this._hasNextPage=r.hasNextPage,this._endCursor=r.endCursor}removeItem(e){const r=this._items.length;this._items=this._items.filter(i=>!e(i));const n=r-this._items.length;this._totalCount=Math.max(0,this._totalCount-n)}updateStateAfterRemove(e){this._items.length===0&&(this._state=e?"notFound":"empty")}reset(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._isInitialLoad=!1,this._state="loading"}resetToLoading(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._totalCount=0,this._isInitialLoad=!0,this._state="loading"}}class Ftt{constructor(e,r){this.debounceMs=e,this.onSearch=r,Be(this,{},{autoBind:!0})}_query="";_timeout=null;get query(){return this._query}get isSearching(){return this._query.length>0}setQuery(e){this._query=e,this.scheduleSearch()}clear(){this._query="",this.cancelScheduled(),this.onSearch()}reset(){this._query="",this.cancelScheduled()}dispose(){this.cancelScheduled()}scheduleSearch(){this.cancelScheduled(),this._timeout=setTimeout(()=>{this.onSearch()},this.debounceMs)}cancelScheduled(){this._timeout&&(clearTimeout(this._timeout),this._timeout=null)}}const p5=(t,e,r)=>t.type===ke.Object?Qtt(t,e,r):t.type===ke.Array?ztt(t,e,r):Wtt(t,e,r),Qtt=(t,e,r)=>{const n=Btt(t,e,r);return new hO(t,e,n)},Btt=(t,e,r)=>Object.entries(r).reduce((n,[i,o])=>{const s=t.getProperty(i);if(s===void 0||o===void 0)throw new Error("Invalid item");return n[i]=p5(s,e,o),n},{}),ztt=(t,e,r)=>{const n=qtt(t,e,r);return new sP(t,e,n)},qtt=(t,e,r)=>r.map(n=>p5(t.items,e,n)),Wtt=(t,e,r)=>{if(t.type===ke.String)return new iu(t,e,r);if(t.type===ke.Number)return new tu(t,e,r);if(t.type===ke.Boolean)return new hf(t,e,r);throw new Error("this type is not allowed")};function fle(t,e,r){const n=[];for(const[i,o]of Object.entries(ase.properties)){const s=[...r,i],a=`${e}.${i}`,l=`${t}:${i}`;let c=null;"type"in o&&(o.type===ke.String?c=Ye.String:o.type===ke.Number&&(c=Ye.Number)),n.push({nodeId:l,name:a,path:s,fieldType:c})}return n}function Utt(t){const e=[],r=new Set;return iN(t,[],e,r),{fields:e,usedSystemFieldIds:r}}function iN(t,e,r,n){if(t.type===ke.Object&&!t.name){const l=Object.values(t.properties);for(const c of l)iN(c,e,r,n);return}const o=(t.$ref?Kae(t.$ref):void 0)?.id;o&&n.add(o);const s=t.name?[...e,t.name]:e,a=tle(t);if(t.type===ke.String||t.type===ke.Number||t.type===ke.Boolean){const l=s.length>1?s.join("."):t.name;r.push({nodeId:t.nodeId,name:l,path:s,fieldType:a,schemaStore:t,isSystemField:o!==void 0,systemFieldId:o})}else if(t.type===ke.Object)if(t.$ref){const l=s.length>1?s.join("."):t.name,c=t.$ref===Ft.File,u={nodeId:t.nodeId,name:l,path:s,fieldType:a,schemaStore:t,isSystemField:o!==void 0,systemFieldId:o,isFileObject:c};c&&(u.children=Htt(t.nodeId,l,s)),r.push(u)}else{const l=Object.values(t.properties);for(const c of l)iN(c,s,r,n)}}function Htt(t,e,r){return fle(t,e,r).map(n=>({...n,isFileNestedField:!0,parentFieldName:e}))}const Gtt=t=>t.type===ke.Number||t.type===ke.Boolean?120:t.type===ke.String?200:t.$ref===Ft.File?80:120,Xtt=[/^title$/i,/^name$/i,/^label$/i,/^description$/i,/^text$/i,/^content$/i,/^summary$/i,/^body$/i,/^message$/i,/^subject$/i,/^caption$/i,/^headline$/i],Ztt=t=>Xtt.some(e=>e.test(t)),oN=(t,e,r,n)=>{if(!r)if(t.type===ke.Object){if(t.$ref===Ft.File){n.push({nodeId:t.nodeId,priority:1,depth:e,schema:t});return}if(t.$ref)return;Object.values(t.properties).forEach(i=>{oN(i,e+1,!1,n)})}else t.type===ke.Array?oN(t.items,e+1,!0,n):t.type===ke.String?t.foreignKey?n.push({nodeId:t.nodeId,priority:4,depth:e,schema:t}):Ztt(t.name)?n.push({nodeId:t.nodeId,priority:2,depth:e,schema:t}):n.push({nodeId:t.nodeId,priority:3,depth:e,schema:t}):(t.type===ke.Number||t.type===ke.Boolean)&&n.push({nodeId:t.nodeId,priority:3,depth:e,schema:t})},Ytt=(t,e=3)=>{const r=[];oN(t,0,!1,r),r.sort((o,s)=>o.priority!==s.priority?o.priority-s.priority:o.depth-s.depth);const n=[];let i=0;for(const o of r){if(n.length>=e)break;if(o.priority===1){if(i>=1)continue;i++}n.push(o.schema)}return n},b9={[Ye.File]:1,[Ye.String]:2,[Ye.Number]:3,[Ye.Boolean]:4,[Ye.ForeignKey]:5,[Ye.DateTime]:6};function Ktt(t){return[...t].sort((e,r)=>{const n=e.path.length-r.path.length;if(n!==0)return n;const i=e.fieldType!==null?b9[e.fieldType]:5,o=r.fieldType!==null?b9[r.fieldType]:5,s=i-o;return s!==0?s:e.name.localeCompare(r.name)})}function Jtt(t){if(t===0)return"0 B";const e=["B","KB","MB","GB","TB"],r=1024,n=Math.floor(Math.log(t)/Math.log(r));return`${(t/Math.pow(r,n)).toFixed(n===0?0:1)} ${e[n]}`}class ert{constructor(e,r,n,i,o){this._rowId=e,this._columnId=r,this._store=n,this._inlineEditModel=i,this._isRevisionReadonly=o,Be(this,{},{autoBind:!0})}get rowId(){return this._rowId}get columnId(){return this._columnId}get store(){return this._store}get isRevisionReadonly(){return this._isRevisionReadonly}get fieldType(){return this._store instanceof iu?this._store.foreignKey?"foreignKey":"string":this._store instanceof tu?"number":this._store instanceof hf?"boolean":this._store instanceof hO?this._store.$ref===Ft.File?"file":"object":this._store instanceof sP?"array":"string"}get isReadonly(){return!!(this._isRevisionReadonly||this._store instanceof iu&&this._store.readOnly||this._store instanceof tu&&this._store.readOnly||this._store instanceof hf&&this._store.readOnly||this.fieldType==="file"||this.fieldType==="object"||this.fieldType==="array")}get supportsViewMode(){return this._isRevisionReadonly?this.fieldType==="string"||this.fieldType==="number":!1}get isFileSizeField(){return this._columnId.endsWith(":size")}get sizeTooltip(){if(this.isFileSizeField&&this._store instanceof tu){const e=this._store.value;return e===null?void 0:`${e.toLocaleString()} bytes`}}get rawValue(){return this._store instanceof tu?this._store.value:this._store instanceof iu?this._store.value:this._store instanceof hf?this._store.getPlainValue():null}get displayValue(){if(this._store instanceof iu)return this._store.value;if(this._store instanceof tu){const e=this._store.value;return e===null?"":this.isFileSizeField?Jtt(e):String(e)}return this._store instanceof hf?String(this._store.getPlainValue()):this._store instanceof hO?"{...}":this._store instanceof sP?"[...]":""}get isFocused(){return this._inlineEditModel.isFocused(this._rowId,this._columnId)}get isEditing(){return this._inlineEditModel.isCellEditing(this._rowId,this._columnId)}get isSaving(){return this._inlineEditModel.isSaving(this._rowId,this._columnId)}get error(){return this._inlineEditModel.getError(this._rowId,this._columnId)}get cellState(){return this.isReadonly&&!this.supportsViewMode?"readonly":this.error?"error":this.isSaving?"saving":this.isEditing?"editing":this.isFocused?"focused":"display"}get foreignKey(){if(this._store instanceof iu)return this._store.foreignKey}get numberDefault(){return this._store instanceof tu?this._store.schema.default??0:0}get stringValue(){return this._store instanceof iu?this._store.value:this._store instanceof tu?String(this._store.value??this.numberDefault):""}get booleanValue(){return this._store instanceof hf?this._store.getPlainValue():!1}get clickOffset(){return this._inlineEditModel.clickOffset}get cellPosition(){return this._inlineEditModel.cellPosition}focus(){this._inlineEditModel.focusCell(this._rowId,this._columnId)}enterEditMode(e,r){this.isReadonly&&!this.supportsViewMode||(this._inlineEditModel.focusCell(this._rowId,this._columnId),this._inlineEditModel.enterEditMode(e,r))}async save(e,r){return this._inlineEditModel.exitEditMode(!0),this._inlineEditModel.saveCell(this._rowId,this._columnId,e,r)}cancelEdit(){this._inlineEditModel.exitEditMode(!1)}commitAndMove(e){switch(e){case"down":this._inlineEditModel.commitAndMoveDown();break;case"next":this._inlineEditModel.commitAndMoveRight();break;case"prev":this._inlineEditModel.commitAndMoveLeft();break}}}class trt{constructor(e){this.params=e,Be(this,{_cellViewModels:!1},{autoBind:!0})}_cellViewModels=new Map;getCellViewModel(e){const r=this.params.cellsMap.get(e);if(!r)return;let n=this._cellViewModels.get(e);return n||(n=new ert(this.id,e,r,this.params.inlineEditModel,!this.params.isEdit),this._cellViewModels.set(e,n)),n}getSystemFieldValue(e){switch(e){case fr.Id:return this.params.item.id;case fr.CreatedAt:return this.params.item.createdAt;case fr.UpdatedAt:return this.params.item.updatedAt;case fr.PublishedAt:return this.params.item.publishedAt;case fr.VersionId:return this.params.item.versionId;case fr.CreatedId:return this.params.item.createdId;default:return null}}get id(){return this.params.item.id}get versionId(){return this.params.item.versionId}get readonly(){return this.params.item.readonly}get cellsMap(){return this.params.cellsMap}get isEdit(){return this.params.isEdit}get canCreateRow(){return this.params.isEdit&&this.params.permissionContext.canCreateRow}get canDeleteRow(){return this.params.isEdit&&this.params.permissionContext.canDeleteRow}get showMenu(){return this.canCreateRow||this.canDeleteRow}get showModifiedIndicator(){return!this.readonly&&this.params.isEdit}get isRowEditing(){return this.params.inlineEditModel.isRowEditing(this.id)}async delete(){return this.params.onDelete(this.id)}}const rrt=3;function nrt(){return qet.map(t=>{const e=Jae(t);return{nodeId:t,name:e.name,path:[],fieldType:e.fieldType,isSystemField:!0,systemFieldId:t,isSystemColumn:!0}})}const irt=nrt();class ort{_visibleColumnIds=[];_visibleColumnIdsSet=new Set;_availableFields=[];_availableFieldsMap=new Map;_availableSystemFields=[];_schemaStore=null;_rowCache=new Map;_columnCache=new Map;_columnWidths=jt.map();_idColumnWidth=Qj;_onColumnsChange=null;constructor(){Be(this,{_rowCache:!1,_columnCache:!1,_visibleColumnIdsSet:!1,_columnWidths:!1,_availableFieldsMap:!1},{autoBind:!0})}get columns(){return this._visibleColumnIds.map(e=>this._availableFieldsMap.get(e)).filter(e=>!!e).map(e=>this.getOrCreateColumn(e))}getOrCreateColumn(e){const r=this._columnCache.get(e.nodeId);if(r)return r;const n={id:e.nodeId,name:e.name,title:e.name,fieldType:e.fieldType,isSystemField:e.isSystemField,systemFieldId:e.systemFieldId,isSystemColumn:e.isSystemColumn,isFileObject:e.isFileObject};return this._columnCache.set(e.nodeId,n),n}get showHeader(){return this._availableFields.length>0}get availableFieldsToAdd(){const e=this._visibleColumnIdsSet,r=this._availableFields.filter(n=>{if(n.isFileObject&&n.children){const i=!e.has(n.nodeId),o=n.children.some(s=>!e.has(s.nodeId));return i||o}return!e.has(n.nodeId)});return Ktt(r)}get availableSystemFieldsToAdd(){return this._availableSystemFields.filter(e=>!this._visibleColumnIdsSet.has(e.nodeId))}get hasHiddenColumns(){return this.availableFieldsToAdd.length>0||this.availableSystemFieldsToAdd.length>0}getAvailableFileChildren(e){return e.children?e.children.filter(r=>!this._visibleColumnIdsSet.has(r.nodeId)):[]}isFileFieldFullyVisible(e){if(!e.isFileObject)return this._visibleColumnIdsSet.has(e.nodeId);const r=this._visibleColumnIdsSet.has(e.nodeId),n=e.children?.every(i=>this._visibleColumnIdsSet.has(i.nodeId))??!0;return r&&n}get canRemoveColumn(){return this._visibleColumnIds.length>0}get visibleColumnIds(){return this._visibleColumnIds}setOnColumnsChange(e){this._onColumnsChange=e}notifyColumnsChange(){this._onColumnsChange&&this._onColumnsChange()}get allAvailableFields(){return this._availableFields}get sortableFields(){const e=Jae(fr.Id),r={nodeId:fr.Id,name:e.name,path:[],fieldType:e.fieldType,isSystemField:!0,systemFieldId:fr.Id},n=[];for(const o of this._availableFields)if(o.isFileObject&&o.children)for(const s of o.children)s.fieldType!==null&&n.push({nodeId:s.nodeId,name:s.name,path:s.path,fieldType:s.fieldType,isSystemField:s.isSystemField,systemFieldId:s.systemFieldId});else o.fieldType!==null&&n.push({nodeId:o.nodeId,name:o.name,path:o.path,fieldType:o.fieldType,isSystemField:o.isSystemField,systemFieldId:o.systemFieldId});const i=this._availableSystemFields.filter(o=>o.fieldType!==null).map(o=>({nodeId:o.nodeId,name:o.name,path:o.path,fieldType:o.fieldType,isSystemField:o.isSystemField,systemFieldId:o.systemFieldId}));return[r,...n,...i]}isColumnVisible(e){return this._visibleColumnIdsSet.has(e)}getColumnByNodeId(e){const r=this._availableFields.find(n=>n.nodeId===e);if(r)return this.getOrCreateColumn(r)}init(e,r){this._schemaStore=mu(e),this._rowCache.clear(),this._columnCache.clear(),this._columnWidths.clear(),this._availableFieldsMap.clear(),this._idColumnWidth=Qj;const{fields:n,usedSystemFieldIds:i}=Utt(this._schemaStore);this._availableFields=n;for(const o of this._availableFields)if(this._availableFieldsMap.set(o.nodeId,o),o.children)for(const s of o.children)this._availableFieldsMap.set(s.nodeId,s);this._availableSystemFields=irt.filter(o=>!o.systemFieldId||!i.has(o.systemFieldId));for(const o of this._availableSystemFields)this._availableFieldsMap.set(o.nodeId,o);if(r?.showAllColumns)this._visibleColumnIds=this._availableFields.map(o=>o.nodeId);else{const o=Ytt(this._schemaStore,rrt);this._visibleColumnIds=o.map(s=>s.nodeId)}this._visibleColumnIdsSet=new Set(this._visibleColumnIds)}addColumn(e){this._visibleColumnIdsSet.has(e)||(this._visibleColumnIds.push(e),this._visibleColumnIdsSet.add(e),this.notifyColumnsChange())}insertColumnBefore(e,r){if(this._visibleColumnIdsSet.has(r))return;const n=this._visibleColumnIds.indexOf(e);n!==-1&&(this._visibleColumnIds.splice(n,0,r),this._visibleColumnIdsSet.add(r),this.notifyColumnsChange())}insertColumnAfter(e,r){if(this._visibleColumnIdsSet.has(r))return;const n=this._visibleColumnIds.indexOf(e);n!==-1&&(this._visibleColumnIds.splice(n+1,0,r),this._visibleColumnIdsSet.add(r),this.notifyColumnsChange())}removeColumn(e){this.canRemoveColumn&&(this._visibleColumnIds=this._visibleColumnIds.filter(r=>r!==e),this._visibleColumnIdsSet.delete(e),this.notifyColumnsChange())}addAll(){this._visibleColumnIds=this._availableFields.map(e=>e.nodeId),this._visibleColumnIdsSet=new Set(this._visibleColumnIds),this.notifyColumnsChange()}hideAll(){this._visibleColumnIds=[],this._visibleColumnIdsSet.clear(),this.notifyColumnsChange()}get canHideAll(){return this._visibleColumnIds.length>0}reorderColumns(e,r){const n=[...this._visibleColumnIds],[i]=n.splice(e,1);n.splice(r,0,i),this._visibleColumnIds=n,this.notifyColumnsChange()}getColumnIndex(e){return this._visibleColumnIds.indexOf(e)}canMoveLeft(e){return this.getColumnIndex(e)>0}canMoveRight(e){const r=this.getColumnIndex(e);return r>=0&&r<this._visibleColumnIds.length-1}canMoveToStart(e){return this.getColumnIndex(e)>1}canMoveToEnd(e){const r=this.getColumnIndex(e);return r>=0&&r<this._visibleColumnIds.length-2}moveColumnLeft(e){const r=this.getColumnIndex(e);r>0&&this.reorderColumns(r,r-1)}moveColumnRight(e){const r=this.getColumnIndex(e);r>=0&&r<this._visibleColumnIds.length-1&&this.reorderColumns(r,r+1)}moveColumnToStart(e){const r=this.getColumnIndex(e);r>0&&this.reorderColumns(r,0)}moveColumnToEnd(e){const r=this.getColumnIndex(e);r>=0&&r<this._visibleColumnIds.length-1&&this.reorderColumns(r,this._visibleColumnIds.length-1)}setColumnWidth(e,r){const n=Math.max(Dg,r);this._columnWidths.set(e,n),this.notifyColumnsChange()}get idColumnWidth(){return this._idColumnWidth}setIdColumnWidth(e){this._idColumnWidth=Math.max(Dg,e),this.notifyColumnsChange()}getColumnWidth(e){const r=this._columnWidths.get(e);if(r!==void 0)return r;const n=this._availableFieldsMap.get(e);return n?.schemaStore?Gtt(n.schemaStore):200}createRowViewModels(e,r){const n=this._schemaStore;if(!n)return[];const i=new Set(e.map(o=>o.id));return this.cleanupStaleCache(i),e.map(o=>{const s=this.getOrCreateCachedRowData(n,o);return new trt({item:o,cellsMap:s.cells,isEdit:r.isEdit,permissionContext:r.permissionContext,inlineEditModel:r.inlineEditModel,onDelete:r.onDelete})})}getVisibleCells(e){return this._visibleColumnIds.map(r=>e.get(r)).filter(r=>r!==void 0)}cleanupStaleCache(e){for(const r of this._rowCache.keys())e.has(r)||this._rowCache.delete(r)}getOrCreateCachedRowData(e,r){const n=this._rowCache.get(r.id);if(n&&n.versionId===r.versionId)return n;const i=p5(e,r.id,r.data??{}),o=new Map;Dm(i,a=>{if(o.set(a.schema.nodeId,a),a.type===ke.Object&&a.$ref===Ft.File)for(const[l,c]of Object.entries(a.value)){const u=`${a.schema.nodeId}:${l}`;o.set(u,c)}});const s={versionId:r.versionId,rootValue:i,cells:o};return this._rowCache.set(r.id,s),s}restoreFromView(e){if(!e||!e.columns)return;const r=e.columns.map(i=>this.fieldToColumnId(i.field)).filter(i=>this._availableFieldsMap.has(i));this._visibleColumnIds=r,this._visibleColumnIdsSet=new Set(r),this._columnWidths.clear();for(const i of e.columns)if(i.width!=null){const o=this.fieldToColumnId(i.field);this._availableFieldsMap.has(o)&&this._columnWidths.set(o,Math.max(Dg,i.width))}const n=e.columns.find(i=>i.field==="id");n?.width!=null&&(this._idColumnWidth=Math.max(Dg,n.width))}serializeToViewColumns(){const e=[],r={field:"id"};this._idColumnWidth!==Qj&&(r.width=this._idColumnWidth),e.push(r);for(const n of this._visibleColumnIds)if(this._availableFieldsMap.get(n)){const o=this._columnWidths.get(n),s={field:this.columnIdToField(n)};o!==void 0&&(s.width=o),e.push(s)}return e}fieldToColumnId(e){if(!e.startsWith("data."))return e;const r=e.slice(5);for(const[n,i]of this._availableFieldsMap.entries())if(i.name===r)return n;return e}columnIdToField(e){const r=this._availableFieldsMap.get(e);return r?r.systemFieldId&&Yae.has(r.systemFieldId)?r.systemFieldId:`data.${r.name}`:e}}function srt(t){const e=[],r=new Set;return sN(t,[],e,r),e.sort((n,i)=>{const o=n.path.length-i.path.length;if(o!==0)return o;const s={[Ye.String]:1,[Ye.Boolean]:2,[Ye.Number]:3,[Ye.ForeignKey]:4,[Ye.DateTime]:5},a=(s[n.fieldType]??6)-(s[i.fieldType]??6);return a!==0?a:n.name.localeCompare(i.name)}),{dataFields:e,usedSystemFieldIds:r}}function sN(t,e,r,n){if(t.type===ke.Object&&!t.name){const a=Object.values(t.properties);for(const l of a)sN(l,e,r,n);return}const i=t.$ref?Kae(t.$ref):void 0;if(i){n.add(i.id);const a=t.name?[...e,t.name]:e,l=a.length>1?a.join("."):t.name;r.push({nodeId:t.nodeId,name:l,path:a,fieldType:i.fieldType,schemaStore:t,isSystemField:!0,systemFieldId:i.id});return}const o=t.name?[...e,t.name]:e;if(t.type===ke.Object&&t.$ref===Ft.File){const a=o.length>1?o.join("."):t.name;art(t.nodeId,a,o,r);return}const s=tle(t);if(s!==null){const a=o.length>1?o.join("."):t.name;r.push({nodeId:t.nodeId,name:a,path:o,fieldType:s,schemaStore:t})}if(t.type===ke.Object&&!t.$ref){const a=Object.values(t.properties);for(const l of a)sN(l,o,r,n)}}function art(t,e,r,n){for(const i of fle(t,e,r))i.fieldType!==null&&n.push({nodeId:i.nodeId,name:i.name,path:i.path,fieldType:i.fieldType})}function lrt(t){return ple(t)}const crt={[fr.Id]:"id",[fr.CreatedAt]:"createdAt",[fr.UpdatedAt]:"updatedAt",[fr.PublishedAt]:"publishedAt",[fr.VersionId]:"versionId",[fr.CreatedId]:"createdId"};function ple(t){const e=[];for(const r of t.conditions){const n=urt(r);n&&e.push(n)}for(const r of t.groups){const n=ple(r);n&&e.push(n)}if(e.length!==0)return e.length===1?e[0]:t.logic==="and"?{AND:e}:{OR:e}}function urt(t){const{fieldPath:e,fieldType:r,operator:n,value:i,isSystemField:o,systemFieldId:s}=t;if(o&&s)return drt(s,r,n,i);switch(n){case en.Equals:return ns(e,{equals:gP(i,r)});case en.NotEquals:return{NOT:[ns(e,{equals:gP(i,r)})]};case en.Contains:return ns(e,{string_contains:String(i)});case en.NotContains:return{NOT:[ns(e,{string_contains:String(i)})]};case en.StartsWith:return ns(e,{string_starts_with:String(i)});case en.EndsWith:return ns(e,{string_ends_with:String(i)});case en.IsEmpty:return ns(e,{equals:""});case en.IsNotEmpty:return{NOT:[ns(e,{equals:""})]};case en.Gt:return ns(e,{gt:r===Ye.Number?Number(i):String(i)});case en.Gte:return ns(e,{gte:r===Ye.Number?Number(i):String(i)});case en.Lt:return ns(e,{lt:r===Ye.Number?Number(i):String(i)});case en.Lte:return ns(e,{lte:r===Ye.Number?Number(i):String(i)});case en.IsTrue:return ns(e,{equals:!0});case en.IsFalse:return ns(e,{equals:!1});default:return}}function drt(t,e,r,n){const i=crt[t];if(!i)return;const o=hrt(e,r,n);if(o)return{[i]:o}}function hrt(t,e,r){switch(e){case en.Equals:return{equals:gP(r,t)};case en.NotEquals:return{not:gP(r,t)};case en.Contains:return{contains:String(r)};case en.NotContains:return{not:{contains:String(r)}};case en.StartsWith:return{startsWith:String(r)};case en.EndsWith:return{endsWith:String(r)};case en.IsEmpty:return{equals:""};case en.IsNotEmpty:return{not:""};case en.Gt:return{gt:t===Ye.Number?Number(r):String(r)};case en.Gte:return{gte:t===Ye.Number?Number(r):String(r)};case en.Lt:return{lt:t===Ye.Number?Number(r):String(r)};case en.Lte:return{lte:t===Ye.Number?Number(r):String(r)};default:return}}function ns(t,e){return{data:{path:t,...e}}}function gP(t,e){if(t===null)return null;switch(e){case Ye.Number:return Number(t);case Ye.Boolean:return!!t;default:return String(t)}}class frt{_rootGroup=ag("and");_availableFields=[];_systemFields=[];_isFilterBarOpen=!1;_onFilterChange=null;_appliedFilterSnapshot="";_appliedGroup=null;_hasPendingChanges=!1;_showValidationErrors=!1;_validationErrors=jt.map();constructor(){Be(this,{},{autoBind:!0})}get rootGroup(){return this._rootGroup}get availableFields(){return this._availableFields}get systemFields(){return this._systemFields}get allFields(){return[...this._availableFields,...this._systemFields]}getFilterableFieldForColumn(e,r,n){return r&&n?this._systemFields.find(i=>i.systemFieldId===n)||this._availableFields.find(i=>i.systemFieldId===n):this._availableFields.find(i=>i.name===e)}get isFilterBarOpen(){return this._isFilterBarOpen}get filterCount(){return this.countFilters(this._rootGroup)}get hasFilters(){return this.filterCount>0}get hasPendingChanges(){return this._hasPendingChanges}get hasAppliedFilters(){return this._appliedGroup?this._appliedGroup.conditions.length>0||this._appliedGroup.groups.length>0:!1}get tooltipContent(){return this.hasAppliedFilters?`Filters: ${this.filterCount} active`:"Filter"}get showValidationErrors(){return this._showValidationErrors}getErrorForCondition(e){if(this._showValidationErrors)return this._validationErrors.get(e)}setOnFilterChange(e){this._onFilterChange=e}init(e){const r=mu(e),{dataFields:n,usedSystemFieldIds:i}=srt(r);this._availableFields=n,this._systemFields=h5.filter(o=>!i.has(o.id)).map(o=>({nodeId:o.id,name:o.name,path:[],fieldType:o.fieldType,isSystemField:!0,systemFieldId:o.id})),this._rootGroup=ag("and"),this._isFilterBarOpen=!1,this._appliedFilterSnapshot=this.getEmptySnapshot(),this._appliedGroup=null,this._hasPendingChanges=!1,this._showValidationErrors=!1,this._validationErrors.clear()}dispose(){this._availableFields=[],this._rootGroup=ag("and"),this._isFilterBarOpen=!1,this._appliedFilterSnapshot="",this._appliedGroup=null,this._hasPendingChanges=!1}reset(){this._rootGroup=ag("and"),this._isFilterBarOpen=!1,this._hasPendingChanges=!1,this._appliedFilterSnapshot=this.getEmptySnapshot(),this._appliedGroup=null,this._showValidationErrors=!1,this._validationErrors.clear(),this.notifyFilterChange()}apply(){return this._validationErrors.clear(),this.validateGroup(this._rootGroup,this._validationErrors),this._validationErrors.size>0?(this._showValidationErrors=!0,!1):(this._showValidationErrors=!1,this._appliedFilterSnapshot=this.getCurrentSnapshot(),this._appliedGroup=JSON.parse(this._appliedFilterSnapshot),this._hasPendingChanges=!1,this.notifyFilterChange(),!0)}getConditionError(e){const r=new Map;return this.validateGroup(this._rootGroup,r),r.get(e)}validateGroup(e,r){for(const n of e.conditions){const i=this.validateCondition(n);i&&r.set(n.id,i)}for(const n of e.groups)this.validateGroup(n,r)}validateCondition(e){if(Lg(e.operator,e.fieldType)){if(e.value===""||e.value===null||e.value===void 0)return"Value is required";if(e.fieldType===Ye.Number&&isNaN(Number(e.value)))return"Invalid number"}return null}openFilterBar(){this._isFilterBarOpen=!0}closeFilterBar(){this._isFilterBarOpen=!1}toggleFilterBar(){this._isFilterBarOpen=!this._isFilterBarOpen}addCondition(e,r){const n=r??this._availableFields[0];if(!n)return;const i=u9(n),o=this.findGroup(this._rootGroup,e);o&&(o.conditions.push(i),this.markAsPending())}addQuickFilter(e,r,n){if(Lg(r,e.fieldType)&&(n===""||n===null))return!1;this.addCondition(this._rootGroup.id,e);const i=this._rootGroup.conditions,o=i[i.length-1];return o&&this.updateCondition(o.id,{operator:r,value:Lg(r,e.fieldType)?n:null}),this.apply(),!0}updateCondition(e,r){const n=this.findConditionWithParent(this._rootGroup,e);if(!n)return;const{condition:i}=n,o=i.fieldType;Object.assign(i,r),r.fieldType&&r.fieldType!==o&&(i.operator=fP(r.fieldType),i.value=this.getDefaultValue(r.fieldType)),r.operator&&!Lg(r.operator,i.fieldType)&&(i.value=null),this.markAsPending()}getDefaultValue(e){switch(e){case Ye.Boolean:return!0;case Ye.Number:return 0;default:return""}}removeCondition(e){this.removeConditionFromGroup(this._rootGroup,e)&&this.markAsPending()}addGroup(e){const r=this.findGroup(this._rootGroup,e);if(!r)return;const n=ag("and");this._availableFields.length>0&&n.conditions.push(u9(this._availableFields[0])),r.groups.push(n),this.markAsPending()}removeGroup(e){if(e===this._rootGroup.id)return;this.removeGroupFromParent(this._rootGroup,e)&&this.markAsPending()}setGroupLogic(e,r){const n=this.findGroup(this._rootGroup,e);n&&(n.logic=r,this.markAsPending())}toGraphQLWhere(){if(this._appliedGroup)return lrt(this._appliedGroup)}countFilters(e){let r=e.conditions.length;for(const n of e.groups)r+=this.countFilters(n);return r}findGroup(e,r){if(e.id===r)return e;for(const n of e.groups){const i=this.findGroup(n,r);if(i)return i}return null}findConditionWithParent(e,r){const n=e.conditions.find(i=>i.id===r);if(n)return{condition:n,parent:e};for(const i of e.groups){const o=this.findConditionWithParent(i,r);if(o)return o}return null}removeConditionFromGroup(e,r){const n=e.conditions.findIndex(i=>i.id===r);if(n!==-1)return e.conditions.splice(n,1),!0;for(const i of e.groups)if(this.removeConditionFromGroup(i,r))return!0;return!1}removeGroupFromParent(e,r){const n=e.groups.findIndex(i=>i.id===r);if(n!==-1)return e.groups.splice(n,1),!0;for(const i of e.groups)if(this.removeGroupFromParent(i,r))return!0;return!1}markAsPending(){const e=this.getCurrentSnapshot();this._hasPendingChanges=e!==this._appliedFilterSnapshot}getCurrentSnapshot(){return JSON.stringify(this._rootGroup)}getEmptySnapshot(){return JSON.stringify(ag("and"))}notifyFilterChange(){this._onFilterChange&&this._onFilterChange()}}const prt=1e3,o0=(t,e)=>`${t}:${e}`,O9=t=>"getPlainValue"in t&&"updateBaseValue"in t;class grt{_savingCells=jt.map();_savingTimers=new Map;_errorCells=jt.map();patchRowRequest=Hr.of(xr.PatchRowInline);isSaving(e,r){return this._savingCells.get(o0(e,r))===!0}getError(e,r){return this._errorCells.get(o0(e,r))}hasError(e,r){return this._errorCells.has(o0(e,r))}clearError(e,r){this._errorCells.delete(o0(e,r))}dispose(){this._savingCells.clear(),this._errorCells.clear();for(const e of this._savingTimers.values())clearTimeout(e);this._savingTimers.clear()}async save(e,r,n,i,o,s,a){const l=o0(r,n),c=this.applyOptimisticUpdate(s,o);this.startSavingIndicator(l),this._errorCells.delete(l);try{const u=await this.callApi(e,r,i,o);return u.isRight?(vt(()=>{this._errorCells.delete(l),a?.()}),!0):(u.error instanceof Qk||this.handleError(l,s,c,"Failed to save"),!1)}catch(u){const p=u instanceof Error?u.message:"Unknown error";return this.handleError(l,s,c,p),!1}finally{this.stopSavingIndicator(l)}}applyOptimisticUpdate(e,r){if(!e||!O9(e))return;const n=e.getPlainValue();return e.updateBaseValue(r),n}rollbackOptimisticUpdate(e,r){!e||!O9(e)||r===void 0||e.updateBaseValue(r)}startSavingIndicator(e){const r=this._savingTimers.get(e);r&&clearTimeout(r);const n=setTimeout(()=>{vt(()=>{this._savingCells.set(e,!0)})},prt);this._savingTimers.set(e,n)}stopSavingIndicator(e){const r=this._savingTimers.get(e);r&&(clearTimeout(r),this._savingTimers.delete(e)),vt(()=>{this._savingCells.delete(e)})}async callApi(e,r,n,i){return this.patchRowRequest.fetch({data:{revisionId:e.revisionId,tableId:e.tableId,rowId:r,patches:[{op:hie.Replace,path:n,value:i}]}})}handleError(e,r,n,i){vt(()=>{this.rollbackOptimisticUpdate(r,n),this._errorCells.set(e,i)})}}class mrt{_focusedCell=null;_editingCell=null;_clickOffset=void 0;_cellPosition=void 0;_context=null;_saveService=new grt;constructor(){Be(this,{},{autoBind:!0})}init(e){this._context=e}dispose(){this._focusedCell=null,this._editingCell=null,this._saveService.dispose(),this._context=null}get focusedCell(){return this._focusedCell}get editingCell(){return this._editingCell}get isEditing(){return this._editingCell!==null}get clickOffset(){return this._clickOffset}get cellPosition(){return this._cellPosition}get hasFocus(){return this._focusedCell!==null}get canChangeFocus(){return this._editingCell===null}isFocused(e,r){return this._focusedCell?.rowId===e&&this._focusedCell?.field===r}isCellEditing(e,r){return this._editingCell?.rowId===e&&this._editingCell?.field===r}isRowEditing(e){return this._editingCell?.rowId===e}isSaving(e,r){return this._saveService.isSaving(e,r)}getError(e,r){return this._saveService.getError(e,r)}hasError(e,r){return this._saveService.hasError(e,r)}clearError(e,r){this._saveService.clearError(e,r)}focusCell(e,r){this.canChangeFocus&&(this._focusedCell={rowId:e,field:r})}clearFocus(){this.canChangeFocus&&(this._focusedCell=null)}moveFocus(e){if(!this._focusedCell||!this._context||!this.canChangeFocus)return;const{newRowIndex:r,newFieldIndex:n}=this.calculateNewPosition(e);if(r===-1||n===-1)return;const i=this._context.getVisibleFields(),o=this._context.getVisibleRowIds();this._focusedCell={rowId:o[r],field:i[n]}}moveFocusToNext(){if(!this._focusedCell||!this._context)return;const e=this._context.getVisibleFields(),r=this._context.getVisibleRowIds(),n=e.indexOf(this._focusedCell.field),i=r.indexOf(this._focusedCell.rowId);if(n===-1||i===-1)return;let o=n+1,s=i;o>=e.length&&(o=0,s=i+1),s>=r.length&&(s=r.length-1,o=e.length-1),this._focusedCell={rowId:r[s],field:e[o]}}moveFocusToPrev(){if(!this._focusedCell||!this._context)return;const e=this._context.getVisibleFields(),r=this._context.getVisibleRowIds(),n=e.indexOf(this._focusedCell.field),i=r.indexOf(this._focusedCell.rowId);if(n===-1||i===-1)return;let o=n-1,s=i;o<0&&(o=e.length-1,s=i-1),s<0&&(s=0,o=0),this._focusedCell={rowId:r[s],field:e[o]}}enterEditMode(e,r){!this._focusedCell||!this._context||(this._editingCell={...this._focusedCell},this._clickOffset=e,this._cellPosition=r)}exitEditMode(e=!0){!e&&this._focusedCell&&this._saveService.clearError(this._focusedCell.rowId,this._focusedCell.field),this._editingCell=null,this._clickOffset=void 0,this._cellPosition=void 0}commitAndMoveDown(){this.exitEditMode(!0),this.moveFocus("down")}commitAndMoveRight(){this.exitEditMode(!0),this.moveFocusToNext()}commitAndMoveLeft(){this.exitEditMode(!0),this.moveFocusToPrev()}cancelEdit(){this.exitEditMode(!1)}async saveCell(e,r,n,i){if(!this._context)return!1;const o=this._context.getCellStore(e,r),s=this._context;return this._saveService.save({revisionId:s.revisionId,tableId:s.tableId},e,r,n,i,o,()=>s.onCellUpdated?.(e,r,i))}calculateNewPosition(e){if(!this._focusedCell||!this._context)return{newRowIndex:-1,newFieldIndex:-1};const r=this._context.getVisibleFields(),n=this._context.getVisibleRowIds(),i=r.indexOf(this._focusedCell.field),o=n.indexOf(this._focusedCell.rowId);if(i===-1||o===-1)return{newRowIndex:-1,newFieldIndex:-1};let s=i,a=o;switch(e){case"left":s=Math.max(0,i-1);break;case"right":s=Math.min(r.length-1,i+1);break;case"up":a=Math.max(0,o-1);break;case"down":a=Math.min(n.length-1,o+1);break}return{newRowIndex:a,newFieldIndex:s}}}class vrt{_selectedRowIds=jt.map();_isSelectionMode=!1;_isConfirmDeleteOpen=!1;_pendingDeleteRowId=null;constructor(){Be(this,{},{autoBind:!0})}get isConfirmDeleteOpen(){return this._isConfirmDeleteOpen}get deleteCount(){return this._pendingDeleteRowId?1:this._selectedRowIds.size}get rowIdsToDelete(){return this._pendingDeleteRowId?[this._pendingDeleteRowId]:Array.from(this._selectedRowIds.keys())}requestSingleDelete(e){this._pendingDeleteRowId=e,this._isConfirmDeleteOpen=!0}openDeleteConfirmation(){this._isConfirmDeleteOpen=!0}closeDeleteConfirmation(){this._isConfirmDeleteOpen=!1,this._pendingDeleteRowId=null}get isSelectionMode(){return this._isSelectionMode}get selectedRowIds(){return Array.from(this._selectedRowIds.keys())}get selectedCount(){return this._selectedRowIds.size}get hasSelection(){return this._selectedRowIds.size>0}enterSelectionMode(e){this._isSelectionMode=!0,e&&this._selectedRowIds.set(e,!0)}exitSelectionMode(){this._isSelectionMode=!1,this._selectedRowIds.clear()}isSelected(e){return this._selectedRowIds.get(e)===!0}toggle(e){this._selectedRowIds.has(e)?this._selectedRowIds.delete(e):this._selectedRowIds.set(e,!0)}select(e){this._selectedRowIds.set(e,!0)}deselect(e){this._selectedRowIds.delete(e)}selectAll(e){for(const r of e)this._selectedRowIds.set(r,!0)}deselectAll(){this._selectedRowIds.clear()}toggleAll(e){e.every(n=>this._selectedRowIds.has(n))?this.deselectAll():this.selectAll(e)}isAllSelected(e){return e.length===0?!1:e.every(r=>this._selectedRowIds.has(r))}isSomeSelected(e){if(e.length===0)return!1;const r=e.filter(n=>this._selectedRowIds.has(n)).length;return r>0&&r<e.length}removeDeletedRows(e){for(const r of e)this._selectedRowIds.delete(r)}}class yrt{_sorts=[];_availableFields=[];_onSortChange=null;_isOpen=!1;_appliedSortSnapshot="[]";_appliedSorts=[];_hasPendingChanges=!1;constructor(){Be(this,{},{autoBind:!0})}get sorts(){return this._sorts}get sortCount(){return this._sorts.length}get hasSorts(){return this._sorts.length>0}get availableFields(){return this._availableFields}get isOpen(){return this._isOpen}get hasPendingChanges(){return this._hasPendingChanges}get hasAppliedSorts(){return this._appliedSorts.length>0}get tooltipContent(){return this.hasAppliedSorts?`Sort: ${this.sortCount} active`:"Sort"}setOnSortChange(e){this._onSortChange=e}init(e){this._availableFields=this.sortFieldsByPriority(e),this._sorts=[],this._isOpen=!1,this._appliedSortSnapshot="[]",this._appliedSorts=[],this._hasPendingChanges=!1}sortFieldsByPriority(e){const r={[Ye.String]:1,[Ye.Boolean]:2,[Ye.Number]:3,[Ye.ForeignKey]:4,[Ye.File]:5,[Ye.DateTime]:6};return[...e].sort((n,i)=>{const o=n.path.length-i.path.length;if(o!==0)return o;const s=r[n.fieldType]-r[i.fieldType];return s!==0?s:n.name.localeCompare(i.name)})}dispose(){this._availableFields=[],this._sorts=[],this._isOpen=!1,this._appliedSortSnapshot="[]",this._appliedSorts=[],this._hasPendingChanges=!1}open(){this._isOpen=!0}close(){this._isOpen=!1}toggle(){this._isOpen=!this._isOpen}getSortForField(e){return this._sorts.find(r=>r.id===e)}getSortIndex(e){const r=this._sorts.findIndex(n=>n.id===e);return r>=0?r+1:void 0}isSorted(e){return this._sorts.some(r=>r.id===e)}getSortDirection(e){return this.getSortForField(e)?.direction}setSort(e,r){const n=this._availableFields.find(o=>o.nodeId===e);if(!n)return;const i=this._sorts.findIndex(o=>o.id===e);i>=0?this._sorts[i].direction=r:this._sorts.push({id:e,field:n.name,fieldPath:n.path,fieldType:n.fieldType,direction:r,isSystemField:n.isSystemField,systemFieldId:n.systemFieldId}),this.markAsPending()}removeSort(e){const r=this._sorts.findIndex(n=>n.id===e);r>=0&&(this._sorts.splice(r,1),this.markAsPending())}replaceField(e,r){const n=this._availableFields.find(s=>s.nodeId===r);if(!n)return;const i=this._sorts.findIndex(s=>s.id===e);if(i<0)return;this._sorts.some(s=>s.id===r)?this._sorts.splice(i,1):this._sorts[i]={id:r,field:n.name,fieldPath:n.path,fieldType:n.fieldType,direction:this._sorts[i].direction,isSystemField:n.isSystemField,systemFieldId:n.systemFieldId},this.markAsPending()}addSort(e){this.isSorted(e)||this.setSort(e,"asc")}setSortAndApply(e,r){this.setSort(e,r),this.apply()}removeSortAndApply(e){this.removeSort(e),this.apply()}get fieldsNotInSort(){const e=new Set(this._sorts.map(r=>r.id));return this._availableFields.filter(r=>!e.has(r.nodeId))}get canAddSort(){return this.fieldsNotInSort.length>0}clearAll(){this._sorts.length>0&&(this._sorts=[],this.markAsPending())}apply(){this._appliedSortSnapshot=JSON.stringify(this._sorts),this._appliedSorts=JSON.parse(this._appliedSortSnapshot),this._hasPendingChanges=!1,this.notifySortChange()}reset(){this._sorts=[],this._appliedSortSnapshot="[]",this._appliedSorts=[],this._hasPendingChanges=!1,this.notifySortChange()}toGraphQLOrderBy(){if(this._appliedSorts.length!==0)return this._appliedSorts.map(e=>e.isSystemField&&e.systemFieldId?this.buildSystemFieldOrderBy(e):{field:nf.Data,path:this.buildSortPath(e),direction:e.direction==="asc"?wd.Asc:wd.Desc,type:this.mapFieldTypeToOrderDataType(e.fieldType)})}buildSystemFieldOrderBy(e){const r=e.direction==="asc"?wd.Asc:wd.Desc;switch(e.systemFieldId){case fr.Id:return{field:nf.Id,direction:r};case fr.CreatedAt:return{field:nf.CreatedAt,direction:r};case fr.UpdatedAt:return{field:nf.UpdatedAt,direction:r};case fr.PublishedAt:return{field:nf.PublishedAt,direction:r};default:return{field:nf.Data,path:e.field,direction:r,type:this.mapFieldTypeToOrderDataType(e.fieldType)}}}buildSortPath(e){const r=e.fieldPath.length>0?e.fieldPath.join("."):e.field;return e.fieldType===Ye.File?r?`${r}.fileName`:"fileName":r}mapFieldTypeToOrderDataType(e){switch(e){case Ye.String:case Ye.ForeignKey:case Ye.File:case Ye.DateTime:return xC.Text;case Ye.Number:return xC.Float;case Ye.Boolean:return xC.Boolean}}markAsPending(){const e=JSON.stringify(this._sorts);this._hasPendingChanges=e!==this._appliedSortSnapshot}notifySortChange(){this._onSortChange&&this._onSortChange()}restoreFromView(e){if(!e||!e.sorts||e.sorts.length===0)return;const r=[];for(const n of e.sorts){const i=this.findFieldByViewField(n.field);i&&r.push({id:i.nodeId,field:i.name,fieldPath:i.path,fieldType:i.fieldType,direction:n.direction,isSystemField:i.isSystemField,systemFieldId:i.systemFieldId})}r.length>0&&(this._sorts=r,this._appliedSortSnapshot=JSON.stringify(this._sorts),this._appliedSorts=JSON.parse(this._appliedSortSnapshot),this._hasPendingChanges=!1)}serializeToViewSorts(){return this._appliedSorts.map(e=>({field:this.sortConfigToViewField(e),direction:e.direction==="asc"?wd.Asc:wd.Desc}))}findFieldByViewField(e){if(!e.startsWith("data."))return this._availableFields.find(n=>n.isSystemField&&n.systemFieldId===e);const r=e.slice(5);return this._availableFields.find(n=>n.name===r)}sortConfigToViewField(e){return e.isSystemField&&e.systemFieldId&&Yae.has(e.systemFieldId)?e.systemFieldId:`data.${e.field}`}}const brt=_e(({model:t})=>{if(!t.isVisible)return null;const e={variant:"subtle",size:"sm",cursor:"pointer",display:"flex",alignItems:"center",gap:1,_hover:{opacity:.8}},r={p:0,borderRadius:"md",boxShadow:"lg",maxWidth:"280px"};return h.jsxs(qo,{open:t.isOpen,onOpenChange:n=>t.setOpen(n.open),lazyMount:!0,unmountOnExit:!0,children:[h.jsx(Di,{content:t.tooltipText,positioning:{placement:"top"},disabled:t.isOpen,children:h.jsx(Pl,{asChild:!0,children:h.jsxs(au,{colorPalette:t.badgeColor,...e,children:[h.jsx(z,{as:"span",width:"6px",height:"6px",borderRadius:"full",bg:t.dotColor}),t.badgeText]})})}),h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{...r,children:h.jsxs(z,{borderWidth:1,borderColor:"newGray.100",borderRadius:"md",p:3,bg:"white",children:[h.jsxs(z,{display:"flex",alignItems:"flex-start",gap:2,mb:3,children:[h.jsx(z,{color:"newGray.400",mt:"2px",children:h.jsx(LZe,{size:16})}),h.jsxs(z,{children:[h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.600",children:t.title}),h.jsx(Y,{fontSize:"xs",color:"newGray.500",mt:1,children:t.description})]})]}),h.jsxs(z,{display:"flex",gap:2,justifyContent:"flex-end",children:[h.jsxs(It,{size:"xs",variant:"ghost",colorPalette:"gray",focusRing:"none",onClick:t.revert,disabled:t.isRevertDisabled,children:[h.jsx(FZe,{size:14}),t.revertButtonText]}),t.showSaveButton&&h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",focusRing:"none",onClick:t.save,disabled:t.isSaveDisabled,children:t.isSaving?h.jsx(ri,{size:"xs"}):h.jsxs(h.Fragment,{children:[h.jsx(QZe,{size:14}),"Save"]})})]})]})})})})]})});class Ort{constructor(e){this.rowListModel=e,Be(this,{},{autoBind:!0})}_isOpen=!1;get isVisible(){return this.rowListModel.hasPendingViewChanges}get isOpen(){return this._isOpen}get isDraft(){return this.rowListModel.isDraftRevision}get isSaving(){return this.rowListModel.isSavingViews}get tooltipText(){return this.isDraft?"Unsaved view changes":"Local view changes"}get badgeText(){return this.isDraft?"unsaved":"local"}get badgeColor(){return this.isDraft?"orange":"gray"}get dotColor(){return this.isDraft?"orange.500":"newGray.400"}get title(){return this.isDraft?"Unsaved view settings":"Local view changes"}get description(){return this.isDraft?"Column order, widths, and sort settings will be saved to the Default view and shared with everyone.":"View settings can only be saved in draft revisions. These changes are temporary and will be lost when you leave."}get revertButtonText(){return this.isDraft?"Revert":"Reset"}get isRevertDisabled(){return this.isDraft&&this.isSaving}get isSaveDisabled(){return this.isSaving}get showSaveButton(){return this.isDraft}setOpen(e){this._isOpen=e}async save(){const e=await this.rowListModel.saveViewSettings();return e&&(this._isOpen=!1),e}revert(){this.rowListModel.revertViewSettings(),this._isOpen=!1}}const x9=50;class aN{constructor(e,r){this.projectContext=e,this.permissionContext=r,this.search=new Ftt(300,this.handleSearch),this.viewSettingsBadge=new Ort(this),Be(this,{},{autoBind:!0}),this.filterModel.setOnFilterChange(this.handleFilterChange),this.sortModel.setOnSortChange(this.handleSortChange),this.columnsModel.setOnColumnsChange(this.handleColumnsChange)}search;columnsModel=new ort;filterModel=new frt;sortModel=new yrt;listState=new Vtt;selection=new vrt;inlineEdit=new mrt;viewSettingsBadge;_tableId="";_baseTotalCount=0;_isDeleting=!1;_isRefetching=!1;_isLoadingMore=!1;_viewsData=null;_savedViewsSnapshot=null;_hasPendingViewChanges=!1;_isSavingViews=!1;getRowsRequest=Hr.of(xr.RowListRows,{skipResetting:!0});deleteRowRequest=Hr.of(xr.DeleteRowMst);removeRowsRequest=Hr.of(xr.RemoveRows);getViewsRequest=Hr.of(xr.GetTableViews);updateViewsRequest=Hr.of(xr.UpdateTableViews);get showLoading(){return this.listState.showLoading}get showEmpty(){return this.listState.showEmpty}get showNotFound(){return this.listState.showNotFound}get showList(){return this.listState.showList}get showError(){return this.listState.showError}get items(){return this.listState.items}get columns(){return this.columnsModel.columns}get showHeader(){return this.columnsModel.showHeader}get hasNextPage(){return this.listState.hasNextPage}get searchQuery(){return this.search.query}get isSearching(){return this.search.isSearching}get isFiltering(){return this.filterModel.hasAppliedFilters}get canFilter(){return this.filterModel.availableFields.length>0}get canSort(){return this.sortModel.availableFields.length>0}get isSearchingOrFiltering(){return this.isSearching||this.isFiltering}get hasActiveSearch(){return this.searchQuery.trim().length>0}get emptyStateType(){const e=this.hasActiveSearch,r=this.filterModel.hasAppliedFilters;return e&&r?"both":r?"filters":"search"}get emptyStateHint(){switch(this.emptyStateType){case"both":return"Try a different search term or adjust filters";case"filters":return"Try adjusting your filters";case"search":return"Try a different search term"}}get isLoading(){return this.getRowsRequest.isLoading}get rowCountText(){return this.isSearchingOrFiltering?`${this.listState.totalCount} of ${this._baseTotalCount} rows`:`${this.listState.totalCount} rows`}get isEdit(){return this.projectContext.isDraftRevision}get canCreateRow(){return this.isEdit&&this.permissionContext.canCreateRow}get canDeleteRow(){return this.isEdit&&this.permissionContext.canDeleteRow}get showSelectionColumn(){return this.canDeleteRow&&this.selection.isSelectionMode}get isDeleting(){return this._isDeleting}get isRefetching(){return this._isRefetching}get isLoadingMore(){return this._isLoadingMore}get hasPendingViewChanges(){return this._hasPendingViewChanges}get isSavingViews(){return this._isSavingViews}get isDraftRevision(){return this.projectContext.isDraftRevision}get allRowIds(){return this.items.map(e=>e.id)}get revisionId(){return this.projectContext.revision.id}init(e,r,n){this._tableId=e,this._baseTotalCount=0,this._viewsData=null,this._savedViewsSnapshot=null,this._hasPendingViewChanges=!1,this._isSavingViews=!1,this.search.reset(),this.selection.exitSelectionMode(),this.listState.resetToLoading(),this.columnsModel.init(r,n),this.filterModel.init(r),this.sortModel.init(this.columnsModel.sortableFields),this.inlineEdit.init({revisionId:this.revisionId,tableId:this._tableId,getVisibleFields:this.getVisibleFields,getVisibleRowIds:this.getVisibleRowIds,getCellStore:this.getCellStore,isCellReadonly:this.isCellReadonly}),this.loadViewsAndData()}async loadViewsAndData(){await this.loadViews(),await this.loadInitial()}async loadViews(){try{const e=await this.getViewsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId}}),r=e.isRight?e.data.table?.views:null;r&&vt(()=>{this._viewsData=r,this.applyViewSettings()})}catch(e){console.error("Failed to load views:",e)}}applyViewSettings(){this.restoreViewFromSaved(),this._savedViewsSnapshot=this.getCurrentViewSnapshot(),this._hasPendingViewChanges=!1}restoreViewFromSaved(){const e=this._viewsData;if(!e)return;const r=e.views.find(n=>n.id===e.defaultViewId);r&&(this.columnsModel.restoreFromView(r),this.sortModel.restoreFromView(r))}markViewsAsChanged(){if(!this._savedViewsSnapshot){this._hasPendingViewChanges=!0;return}const e=this.getCurrentViewSnapshot();this._hasPendingViewChanges=e!==this._savedViewsSnapshot}getCurrentViewSnapshot(){const e=this.columnsModel.serializeToViewColumns(),r=this.sortModel.serializeToViewSorts();return JSON.stringify({columns:e,sorts:r})}async saveViewSettings(){if(!this.projectContext.isDraftRevision)return!1;this._isSavingViews=!0,this.ensureViewsData();const e=this._viewsData;if(!e)return this._isSavingViews=!1,!1;const r=this.buildDefaultView(),n=this.buildUpdatedViews(r);try{const i=await this.updateViewsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,viewsData:{version:e.version,defaultViewId:e.defaultViewId,views:n}}});return i.isRight?(vt(()=>{this._viewsData=i.data.updateTableViews,this._savedViewsSnapshot=this.getCurrentViewSnapshot(),this._hasPendingViewChanges=!1}),!0):(Ur.error({description:"Failed to save view settings"}),!1)}catch(i){return console.error("Failed to save views:",i),Ur.error({description:"Failed to save view settings"}),!1}finally{vt(()=>{this._isSavingViews=!1})}}revertViewSettings(){this.restoreViewFromSaved(),this._savedViewsSnapshot=this.getCurrentViewSnapshot(),this._hasPendingViewChanges=!1}ensureViewsData(){this._viewsData||(this._viewsData={version:1,defaultViewId:"default",views:[]})}buildDefaultView(){const e=this.columnsModel.serializeToViewColumns(),r=this.sortModel.serializeToViewSorts();return{id:"default",name:"Default",...e.length>0&&{columns:e},...r.length>0&&{sorts:r}}}buildUpdatedViews(e){const r=this._viewsData?.views??[],n=r.findIndex(o=>o.id==="default"),i=o=>({id:o.id,name:o.name,...o.description&&{description:o.description},...o.filters&&{filters:o.filters},...o.search&&{search:o.search},...o.columns&&{columns:o.columns},...o.sorts&&{sorts:o.sorts.map(s=>({field:s.field,direction:s.direction}))}});return n>=0?r.map((o,s)=>s===n?e:i(o)):[...r.map(i),e]}getVisibleFields=()=>this.columnsModel.columns.map(e=>e.id);getVisibleRowIds=()=>this.items.map(e=>e.id);getCellStore=(e,r)=>this.items.find(i=>i.id===e)?.cellsMap.get(r);isCellReadonly=(e,r)=>{if(!this.isEdit)return!0;const n=this.getCellStore(e,r);return n?"readOnly"in n&&n.readOnly===!0:!0};dispose(){this.search.dispose(),this.selection.exitSelectionMode(),this.filterModel.dispose(),this.sortModel.dispose(),this.inlineEdit.dispose(),this.getRowsRequest.abort()}setSearchQuery(e){this.search.setQuery(e)}clearSearch(){this.search.clear()}async tryToFetchNextPage(){if(!(!this.listState.hasNextPage||this._isLoadingMore||!this.listState.endCursor)){this._isLoadingMore=!0;try{const e=await this.getRowsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,first:x9,after:this.listState.endCursor,where:this.buildWhereClause(),orderBy:this.sortModel.toGraphQLOrderBy()}});vt(()=>{if(e.isRight){const r=e.data.rows.edges.map(i=>i.node),n=this.columnsModel.createRowViewModels(r,{isEdit:this.isEdit,permissionContext:this.permissionContext,inlineEditModel:this.inlineEdit,onDelete:this.deleteRow});this.listState.appendItems(n,{hasNextPage:e.data.rows.pageInfo.hasNextPage,endCursor:e.data.rows.pageInfo.endCursor??null})}else console.error("Failed to fetch next page")})}finally{vt(()=>{this._isLoadingMore=!1})}}}async deleteRow(e){try{return(await this.deleteRowRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,rowId:e}})).isRight?(vt(()=>{this.listState.removeItem(n=>n.id===e),this._baseTotalCount=Math.max(0,this._baseTotalCount-1),this.listState.updateStateAfterRemove(this.isSearchingOrFiltering)}),!0):!1}catch(r){return console.error(r),!1}}async deleteRows(e){if(e.length===0)return!0;try{return vt(()=>{this._isDeleting=!0}),(await this.removeRowsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,rowIds:e}})).isRight?(vt(()=>{for(const n of e)this.listState.removeItem(i=>i.id===n);this._baseTotalCount=Math.max(0,this._baseTotalCount-e.length),this.listState.updateStateAfterRemove(this.isSearchingOrFiltering),this.selection.removeDeletedRows(e)}),!0):!1}catch(r){return console.error(r),!1}finally{vt(()=>{this._isDeleting=!1})}}handleSearch=()=>{this.reload()};handleFilterChange=()=>{this.reload()};handleSortChange=()=>{this.reload(),this.markViewsAsChanged()};handleColumnsChange=()=>{this.markViewsAsChanged()};async reload(){this._isRefetching=!0;try{await this.loadInitial()}finally{vt(()=>{this._isRefetching=!1})}}async loadInitial(){const e=await this.getRowsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,first:x9,where:this.buildWhereClause(),orderBy:this.sortModel.toGraphQLOrderBy()}});if(!e.isRight){if(Sie(e))return;vt(()=>{this.listState.setError()});return}vt(()=>{const r=e.data.rows.edges.map(i=>i.node),n=this.columnsModel.createRowViewModels(r,{isEdit:this.isEdit,permissionContext:this.permissionContext,inlineEditModel:this.inlineEdit,onDelete:this.deleteRow});this.listState.setItems(n,{hasNextPage:e.data.rows.pageInfo.hasNextPage,endCursor:e.data.rows.pageInfo.endCursor??null,totalCount:e.data.rows.totalCount,isSearching:this.isSearchingOrFiltering}),!this.isSearchingOrFiltering&&this._baseTotalCount===0&&(this._baseTotalCount=e.data.rows.totalCount)})}buildWhereClause(){const e=[];this.search.query&&e.push({OR:[{id:{contains:this.search.query}},{data:{path:[],search:this.search.query,searchType:bL.Plain,searchIn:yL.Values}}]});const r=this.filterModel.toGraphQLWhere();if(r&&e.push(r),e.length!==0)return e.length===1?e[0]:{AND:e}}}Ee.register(aN,()=>{const t=Ee.get(Yn),e=Ee.get(xs);return new aN(t,e)},{scope:"request"});const xrt=_e(()=>{const{root:t,item:e}=yT(),r=E.useRef(null),n=e.table.id,i=e.schema,o=Zn(aN,n,i),a=t.stack.indexOf(e)===0&&!e.state.isSelectingForeignKey,l=e.state.isSelectingForeignKey,c=E.useCallback(m=>{t.onSelectedForeignKey(e,m)},[e,t]);if(e.state.type!==on.List)return null;const u=o.canCreateRow?h.jsx(Di,{content:"New row",openDelay:300,children:h.jsx(Ir,{"aria-label":"New row",size:"xs",variant:"ghost",onClick:e.toCreatingRow,"data-testid":"create-row-button",color:"gray.500",_hover:{bg:"gray.100"},children:h.jsx(mee,{})})}):null,p=o.showEmpty?null:h.jsxs(ee,{alignItems:"center",gap:2,children:[h.jsx(Itt,{value:o.searchQuery,onChange:o.setSearchQuery,onClear:o.clearSearch}),o.canFilter&&h.jsx(Att,{filterModel:o.filterModel,anchorRef:r}),o.canSort&&h.jsx(Ltt,{sortModel:o.sortModel,anchorRef:r})]});return h.jsxs(ee,{flexDirection:"column",flex:1,children:[a&&h.jsx(hP,{showBreadcrumbs:!0,actions:u,search:p}),l&&h.jsxs(h.Fragment,{children:[h.jsx(d5,{tableId:e.table.id}),h.jsx(hP,{tableTitle:e.table.id,actions:u,search:p})]}),h.jsx(z,{ref:r,paddingX:"8px"}),h.jsx(z,{flex:1,position:"relative",marginTop:"16px",children:h.jsx(Ttt,{model:o,revisionId:e.revisionId,tableId:n,isRevisionReadonly:!e.isEditableRevision,onSelect:l?c:void 0,onCopy:e.toCloneRow,onCreate:o.canCreateRow?e.toCreatingRow:void 0})}),!o.showEmpty&&!o.showLoading&&h.jsxs(ee,{alignItems:"center",justifyContent:"space-between",paddingX:"12px",paddingY:"8px",marginTop:"4px",borderTop:"1px solid",borderColor:"gray.100",children:[h.jsxs(ee,{alignItems:"center",gap:"8px",children:[h.jsx(Y,{fontSize:"sm",color:"gray.500",children:o.rowCountText}),o.isRefetching&&h.jsx(ri,{size:"xs",color:"gray.400"})]}),h.jsx(brt,{model:o.viewSettingsBadge})]})]})}),wrt=_e(({store:t,isEdit:e,onSelectForeignKey:r,onUploadFile:n})=>{sse(()=>{t.scrollPosition&&(window.scrollTo(0,t.scrollPosition),t.setScrollPosition(null))});const i=E.useCallback(async(o,s)=>{t.setScrollPosition(window.scrollY),await r(o,s)},[r,t]);return h.jsx(e5.Provider,{value:{onUploadFile:n,onSelectForeignKey:i,onOverNode:t.setOverNode,mode:e?fO.Updating:fO.Reading},children:h.jsx(Gae,{store:t,rootName:"<id>",isEdit:e})})}),Srt=_e(()=>{const t=Ba(),e=vp(),r=Ee.get(xs),{root:n,item:i}=yT(),[o,s]=E.useState(!1),a=i.isEditableRevision&&r.canUpdateRow,c=n.stack.indexOf(i)===0&&!i.state.isSelectingForeignKey,u=E.useCallback(async($,A)=>{await n.selectForeignKey(i,$,A)},[i,n]),p=E.useCallback($=>{i.state.type===on.UpdatingRow&&i.state.store.name.setValue($)},[i]),m=E.useCallback(async()=>{if(i.state.type!==on.UpdatingRow)return;const $=i.state.store;s(!0);try{await i.updateRow($)&&($.save(),$.syncReadOnlyStores(),t(e.make({revisionIdOrTag:zo,rowId:$.name.getPlainValue()})))}catch{Ur.error({title:"Update failed"})}finally{s(!1)}},[i,e,t]),v=E.useCallback(()=>{i.state.type===on.UpdatingRow&&i.state.store.reset()},[i]),b=E.useCallback(async()=>{if(i.state.type!==on.UpdatingRow)return;const $=JSON.stringify(i.state.store.root.getPlainValue(),null,2);await navigator.clipboard.writeText($),Ur.info({title:"Copied to clipboard"})},[i]),O=E.useCallback(async($,A)=>{if(i.state.type!==on.UpdatingRow)return;const M=i.state.store,Q=wn();Ur.loading({id:Q,title:"Uploading..."});try{await i.uploadFile(M,$,A)?(Ur.update(Q,{type:"info",title:"Successfully uploaded!",duration:1500}),M.syncReadOnlyStores(),t(e.make({revisionIdOrTag:zo,rowId:M.name.getPlainValue()}))):Ur.update(Q,{type:"error",title:"Upload failed",duration:3e3})}catch{Ur.update(Q,{type:"error",title:"Upload failed",duration:3e3})}},[i,e,t]);if(i.state.type!==on.UpdatingRow)return null;const x=i.state.store,S=x.viewMode||di.Tree,w=x.touched?h.jsxs(ee,{gap:"4px",children:[h.jsx(JO,{dataTestId:"row-editor-approve-button",isDisabled:!x.isValid,loading:o,onClick:m}),h.jsx(Sse,{dataTestId:"row-editor-revert-button",onClick:v})]}):null,k=h.jsx(dT,{availableRefByMode:x.areThereForeignKeysBy,mode:S,onChange:x.setViewMode}),P=h.jsx(Zae,{value:x.name.value,setValue:p,readonly:!a,dataTestId:"row-id-input"}),_=S===di.Tree,T=_&&x.node.hasCollapsibleContent,R=_?h.jsx(Xae,{showTreeActions:T,onExpandAll:()=>x.node.expandAllContent(),onCollapseAll:()=>x.node.collapseAllContent(),onCopyJson:b}):null;return h.jsxs(ee,{flexDirection:"column",flex:1,children:[i.state.isSelectingForeignKey&&h.jsx(d5,{tableId:i.table.id}),h.jsx(hP,{showBreadcrumbs:c,rowIdInput:P,actions:w,actionsMenu:R,switcher:k}),h.jsx(ee,{flexDirection:"column",paddingTop:"60px",children:h.jsx(wrt,{isEdit:a,store:x,onSelectForeignKey:u,onUploadFile:O})})]})}),Crt=({previousType:t,tableId:e,rowId:r,foreignKeyPath:n,onCancel:i})=>{const o=E.useMemo(()=>t===on.UpdatingRow?"updating":t===on.CreatingRow?"creating":"",[t]);return h.jsx(h.Fragment,{children:h.jsx(z,{width:"100%",borderStyle:"solid",borderLeftWidth:2,borderColor:"gray.200",pl:"1rem",mb:"1rem",children:h.jsxs(ee,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",color:"gray.400",fontWeight:"300",children:[h.jsx(Y,{textDecoration:"underline",cursor:"pointer",onClick:i,children:"Back"}),h.jsxs(Y,{children:["- ",o,' "',e," - ",r,'":']}),h.jsx(Y,{children:n})]})})})},krt=_e(()=>{const{root:t,item:e}=yT(),r=E.useCallback(()=>{t.cancelSelectingForeignKey(e)},[e,t]);return e.state.type===on.ConnectingForeignKeyRow?h.jsx(Crt,{previousType:e.state.previousType,foreignKeyPath:e.currentForeignKeyPath,onCancel:r,tableId:e.table.id,rowId:e.state.store.name.getPlainValue()}):e.state.type===on.List?h.jsx(xrt,{}):e.state.type===on.CreatingRow?h.jsx(Fet,{}):e.state.type===on.UpdatingRow?h.jsx(Srt,{}):null}),gle=_e(({startWithUpdating:t})=>{const e=Aet(t);return h.jsx(h.Fragment,{children:e.stack.map(r=>h.jsx(Hae.Provider,{value:{root:e,item:r},children:h.jsx(krt,{})},r.id))})}),Prt=_e(()=>{const t=bZe();return t.isValidSchema?h.jsx(gle,{startWithUpdating:!0}):h.jsx(vZe,{data:t.row.data})}),_rt=()=>h.jsx(Mi,{hideSidebar:!0,children:h.jsxs(ee,{alignItems:"center",flexDirection:"column",justifyContent:"center",flex:1,gap:"8px",children:[h.jsx(Y,{color:"gray.400",children:"Check your email to confirm your account"}),h.jsx(Ki,{to:`/${eh}`,children:h.jsx(na,{color:"gray.400",alignSelf:"center",children:"Log in"})})]})}),Trt=()=>null;class lN{constructor(e,r){this.apiService=e,this.authService=r,Be(this)}isLoading=!1;async login(e){e?await this.loginRequest(e):console.error("Invalid code")}dispose(){}init(){}async loginRequest(e){this.setIsLoading(!0);try{const r=await this.apiService.client.loginGoogle({data:{code:e,redirectUrl:ise()}});return await this.authService.setToken(r.loginGoogle.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(e){this.isLoading=e}}Ee.register(lN,()=>{const t=Ee.get(Da),e=Ee.get($o);return new lN(t,e)},{scope:"request"});const Ert=async({request:t})=>{const r=new URL(t.url).searchParams,n=r.get("code"),i=r.get("state"),o=Z_(Cie(i));if(!n)throw new Error("Invalid code");return await Ee.get(lN).login(n),mm(o||"/")};class cN{constructor(e,r,n){this.routerService=e,this.apiService=r,this.configurationService=n,Be(this)}isLoading=!1;form=new xL({email:"",username:"",password:""});get disableSubmitButton(){return!this.form.isValid}get availableEmailSignUp(){return this.configurationService.availableEmailSignUp}get availableOauth(){return this.configurationService.availableGoogleOauth}get availableGoogleOauth(){return this.configurationService.availableGoogleOauth}get availableGithubOauth(){return this.configurationService.availableGithubOauth}toGoogleOauth(){ose(this.configurationService.googleOauthClientId,q0())}toGithubOauth(){nse(this.configurationService.githubOauthClientId,q0())}async submit(){await this.signUp()&&await this.routerService.navigate(`/${v_}/${YJ}`)}dispose(){}init(){}async signUp(){this.setIsLoading(!0);try{return await this.apiService.client.signUp({data:this.form.values}),!0}finally{this.setIsLoading(!1)}}setIsLoading(e){this.isLoading=e}}Ee.register(cN,()=>{const t=Ee.get(Sc),e=Ee.get(Da),r=Ee.get(Kf);return new cN(t,e,r)},{scope:"request"});const Rrt=_e(()=>{const t=Zn(cN),[e]=LM(),r=E.useMemo(()=>{const c=e.get("redirect");return c?`/${eh}?redirect=${encodeURIComponent(c)}`:`/${eh}`},[e]),n=E.useCallback(c=>{t.form.setValue("username",c.currentTarget.value)},[t.form]),i=E.useCallback(c=>{t.form.setValue("email",c.currentTarget.value)},[t.form]),o=E.useCallback(c=>{t.form.setValue("password",c.currentTarget.value)},[t.form]),s=E.useCallback(async()=>{await t.submit()},[t]),a=E.useCallback(()=>{t.toGithubOauth()},[t]),l=E.useCallback(()=>{t.toGoogleOauth()},[t]);return h.jsxs(Mi,{hideSidebar:!0,children:[h.jsxs(ee,{width:"100%",gap:"8px",justifyContent:"flex-end",children:[h.jsx(Y,{color:"gray.300",children:"Already have an account?"}),h.jsx(Ki,{to:r,children:h.jsx(na,{color:"gray.300",alignSelf:"center",children:"Log in"})})]}),h.jsx(ee,{alignItems:"center",justifyContent:"center",flex:1,children:h.jsxs(ee,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[t.availableOauth&&h.jsxs(h.Fragment,{children:[h.jsxs(ee,{flexDirection:"column",gap:"2px",children:[t.availableGithubOauth&&h.jsx(ea,{icon:h.jsx(aee,{}),onClick:a,title:"Continue with Github"}),t.availableGoogleOauth&&h.jsx(ea,{icon:h.jsx(lee,{}),onClick:l,title:"Continue with Google"})]}),t.availableEmailSignUp&&h.jsxs(ee,{width:"100%",alignItems:"center",gap:"16px",children:[h.jsx(z,{backgroundColor:"gray.100",flex:1,height:"1px"}),h.jsx(Y,{color:"gray.300",fontSize:"12px",children:"OR"}),h.jsx(z,{backgroundColor:"gray.100",flex:1,height:"1px"})]})]}),t.availableEmailSignUp&&h.jsxs(h.Fragment,{children:[h.jsx(hu,{dataTestId:"signup-username-input",autoFocus:!0,height:"40px",placeholder:"enter your username",autoComplete:"new-password",value:t.form.values.username,onChange:n}),h.jsx(hu,{dataTestId:"signup-email-input",height:"40px",placeholder:"enter your email",type:"email",autoComplete:"new-password",value:t.form.values.email,onChange:i}),h.jsx(hu,{dataTestId:"signup-password-input",height:"40px",placeholder:"create a password",type:"password",autoComplete:"new-password",value:t.form.values.password,onChange:o,onEnter:s}),h.jsx(z,{visibility:t.disableSubmitButton?"hidden":"visible",children:h.jsx(ea,{onClick:s,disabled:t.disableSubmitButton,isLoading:t.isLoading,title:"Sign up"})})]})]})})]})}),Irt=()=>h.jsx(gle,{});class uN{constructor(e,r,n){this.authService=e,this.apiService=r,this.routerService=n,Be(this)}isLoading=!1;form=new xL({username:""});get disableSubmitButton(){return!this.form.isValid}async submit(){await this.request()&&(await this.authService.fetchMe(),await this.routerService.navigate(m_))}dispose(){}init(){}async request(){this.setIsLoading(!0);try{return await this.apiService.client.setUsername({data:{username:this.form.values.username}}),!0}catch(e){console.error(e)}finally{this.setIsLoading(!1)}}setIsLoading(e){this.isLoading=e}}Ee.register(uN,()=>{const t=Ee.get($o),e=Ee.get(Da),r=Ee.get(Sc);return new uN(t,e,r)},{scope:"request"});const jrt=_e(()=>{const t=Zn(uN),e=E.useCallback(n=>{t.form.setValue("username",n.currentTarget.value)},[t.form]),r=E.useCallback(async()=>{await t.submit()},[t]);return h.jsx(Mi,{hideSidebar:!0,children:h.jsx(ee,{alignItems:"center",justifyContent:"center",flex:1,children:h.jsxs(ee,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[h.jsx(hu,{dataTestId:"login-emailOrUsername-input",autoFocus:!0,height:"40px",placeholder:"set username",value:t.form.values.username,onChange:e,onEnter:r}),h.jsx(z,{visibility:t.disableSubmitButton?"hidden":"visible",children:h.jsx(ea,{onClick:r,isLoading:t.isLoading,title:"Set username"})})]})})})}),$rt=()=>{const t=DM(),e=E.useMemo(()=>(console.error(t),"Unexpected error"),[t]);return h.jsxs(ee,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",height:"100%",children:[h.jsx(pD,{color:"gray"}),h.jsx(Y,{color:"gray.400",children:e})]})},Art=()=>{const t=DM(),e=E.useMemo(()=>t instanceof moe?`Not found table "${t.message}" in this revision`:t instanceof goe?`Not found row "${t.message}" in this revision`:(console.error(t),"Unexpected error"),[t]);return h.jsxs(ee,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",children:[h.jsx(pD,{color:"gray"}),h.jsx(Y,{color:"gray.400",children:e})]})};function Bs(){return(Bs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}var Nrt=function(){};function mle(t,e){return Math.random()*(e-t+1)+t}function w9(t,e){return Math.floor(mle(t,e))}var Mrt=E.forwardRef(function(t,e){var r=t.progress,n=t.height,i=n===void 0?2:n,o=t.className,s=o===void 0?"":o,a=t.color,l=a===void 0?"red":a,c=t.background,u=c===void 0?"transparent":c,p=t.onLoaderFinished,m=t.transitionTime,v=m===void 0?300:m,b=t.loaderSpeed,O=b===void 0?500:b,x=t.waitingTime,S=x===void 0?1e3:x,w=t.shadow,k=w===void 0||w,P=t.containerStyle,_=P===void 0?{}:P,T=t.style,R=T===void 0?{}:T,$=t.shadowStyle,A=$===void 0?{}:$,M=t.containerClassName,Q=M===void 0?"":M,V=E.useRef(!1),q=E.useState(0),N=q[0],B=q[1],re=E.useRef({active:!1,refreshRate:1e3}),he=E.useState(!1),ne=he[0],se=he[1],X=E.useState({active:!1,value:20}),D=X[0],H=X[1],J={position:"fixed",top:0,left:0,height:i,background:u,zIndex:99999999999,width:"100%"},F={boxShadow:"0 0 10px "+l+", 0 0 10px "+l,width:"5%",opacity:1,position:"absolute",height:"100%",transition:"all "+O+"ms ease",transform:"rotate(3deg) translate(0px, -4px)",left:"-10rem"},W=E.useState({height:"100%",background:l,transition:"all "+O+"ms ease",width:"0%"}),ae=W[0],we=W[1],G=E.useState(F),ue=G[0],Te=G[1];E.useEffect(function(){return V.current=!0,function(){V.current=!1}},[]),E.useImperativeHandle(e,function(){return{continuousStart:function(Ve,We){if(We===void 0&&(We=1e3),!D.active)if(ne)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var Gt=Ve||w9(10,20);re.current={active:!0,refreshRate:We},B(Gt),Re(Gt)}},staticStart:function(Ve){if(!re.current.active)if(ne)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var We=Ve||w9(30,50);H({active:!0,value:We}),B(We),Re(We)}},complete:function(){ne?console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!"):(B(100),Re(100))}}}),E.useEffect(function(){we(Bs({},ae,{background:l})),Te(Bs({},ue,{boxShadow:"0 0 10px "+l+", 0 0 5px "+l}))},[l]),E.useEffect(function(){if(e){if(e&&r!==void 0)return void console.warn(`react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar! Please use only props or only ref methods! Ref methods will override props if "ref" property is available.`);Re(N),se(!1)}else r&&Re(r),se(!0)},[r]);var te,oe,Oe,Re=function Ve(We){We>=100?(we(Bs({},ae,{width:"100%"})),k&&Te(Bs({},ue,{left:We-10+"%"})),setTimeout(function(){V.current&&(we(Bs({},ae,{opacity:0,width:"100%",transition:"all "+v+"ms ease-out",color:l})),setTimeout(function(){V.current&&(re.current.active&&(re.current=Bs({},re.current,{active:!1}),B(0),Ve(0)),D.active&&(H(Bs({},D,{active:!1})),B(0),Ve(0)),p&&p(),B(0),Ve(0))},v))},S)):(we(function(Gt){return Bs({},Gt,{width:We+"%",opacity:1,transition:We>0?"all "+O+"ms ease":""})}),k&&Te(Bs({},ue,{left:We-5.5+"%",transition:We>0?"all "+O+"ms ease":""})))};return te=function(){var Ve=mle(Math.min(10,(100-N)/5),Math.min(20,(100-N)/3));N+Ve<95&&(B(N+Ve),Re(N+Ve))},oe=re.current.active?re.current.refreshRate:null,Oe=E.useRef(Nrt),E.useEffect(function(){Oe.current=te}),E.useEffect(function(){},[void 0]),E.useEffect(function(){if(oe!==null&&oe!==!1){var Ve=setInterval(function(){return Oe.current()},oe);return function(){return clearInterval(Ve)}}},[oe]),E.createElement("div",{className:Q,style:Bs({},J,_)},E.createElement("div",{className:s,style:Bs({},ae,R)},k?E.createElement("div",{style:Bs({},ue,A)}):null))});const Drt=(t=300)=>{const e=E.useRef(null),r=JPe();return E.useEffect(()=>{const n=e.current;let i=NaN,o=!1;return r.state==="loading"&&(i=setTimeout(()=>{o=!0,n?.continuousStart()},t)),()=>{o&&n?.complete(),clearTimeout(i)}},[t,r.state]),e},Lrt=()=>{const t=Drt(150);return h.jsxs(h.Fragment,{children:[h.jsx(Mrt,{ref:t,color:"#1fa3ff",height:1,waitingTime:500}),h.jsx(vm,{})]})},Vrt=()=>[{index:!0,element:h.jsx(fZe,{})}],Frt=()=>({path:kb,id:rn.Changes,element:h.jsx(cUe,{}),children:[{index:!0,element:h.jsx(rUe,{})},{path:"rows",element:h.jsx(CUe,{})}]}),Qrt=()=>({path:ik,element:h.jsx(vGe,{}),id:rn.Migrations}),Brt=()=>({path:ok,loader:s7e,id:rn.Table,children:[{index:!0,element:h.jsx(Irt,{})},{path:ree,loader:i7e,id:rn.Row,element:h.jsx(Prt,{})}]}),zrt={path:Ed,element:h.jsx(vm,{}),loader:uA(G0,Jqe),id:rn.Organization,children:[{path:Rd,element:h.jsx(vm,{}),loader:uA(G0,e7e),id:rn.Project,children:[{path:KJ,element:h.jsx(vHe,{}),id:rn.ProjectSettings},{path:tee,element:h.jsx(uHe,{}),id:rn.Endpoints},{path:eee,element:h.jsx(hHe,{}),id:rn.ProjectMcp},{path:JJ,element:h.jsx(SHe,{}),id:rn.ProjectUsers},{path:hIe,element:h.jsx("div",{children:"Project API Keys Page"}),id:rn.ProjectApiKeys},{path:y_,loader:Xqe,id:rn.Branch,children:[{path:b_,loader:t7e,id:rn.Revision,errorElement:h.jsx(Art,{}),children:[{element:h.jsx(MHe,{}),children:[...Vrt(),Brt()]},{element:h.jsx(NHe,{showTitle:!1}),children:[Frt(),Qrt()]}]}]}]}]},qrt=[{path:`${lD}/*`,element:h.jsx(hWe,{})},{path:"/",element:h.jsx(Lrt,{}),errorElement:h.jsx($rt,{}),children:[{index:!0,element:h.jsx(cGe,{}),loader:uA(G0,Kqe)},{path:GJ,element:h.jsx(jrt,{})},{path:uIe,element:h.jsx(fHe,{}),loader:G0},{path:eh,loader:Zqe,children:[{index:!0,element:h.jsx(zHe,{})},{path:ZJ,loader:Ert,element:h.jsx(Trt,{})},{path:XJ,loader:VHe,element:h.jsx(LHe,{})}]},{path:HJ,element:h.jsx(qHe,{}),loader:G0},{path:v_,loader:Yqe,children:[{index:!0,element:h.jsx(Rrt,{})},{path:YJ,element:h.jsx(_rt,{})},{path:dIe,element:h.jsx(DHe,{})}]},{path:Td,children:[zrt]}]}];class Sc{constructor(e){this.bootstrapService=e,this.init()}_router=null;get router(){if(!this._router)throw new Error("Router not found");return this._router}navigate(...e){return this.router.navigate(...e)}init(){Iu(()=>this.bootstrapService.isLoaded,e=>{e&&(this._router=h_e(qrt))})}}Ee.register(Sc,()=>{const t=Ee.get(Bk);return new Sc(t)},{scope:"singleton"});class dN{constructor(e,r){this.bootstrapService=e,this.routerService=r,Be(this)}get isLoaded(){return this.bootstrapService.isLoaded}get router(){return this.routerService.router}async init(){}dispose(){}}Ee.register(dN,()=>{const t=Ee.get(Bk),e=Ee.get(Sc);return new dN(t,e)},{scope:"request"});const Wrt=({children:t})=>h.jsx(sIe,{client:ln,children:t}),S9=kZ(RZ,{theme:{tokens:{colors:{gray:{50:{value:"#F7FAFC"},100:{value:"#EDF2F7"},200:{value:"#E2E8F0"},300:{value:"#CBD5E0"},400:{value:"#A0AEC0"},500:{value:"#718096"},600:{value:"#4A5568"},700:{value:"#2D3748"},800:{value:"#1A202C"},900:{value:"#171923"}},newGray:{50:{value:"#F7FAFC"},100:{value:"#F5F5F5"},200:{value:"#E5E5E5"},300:{value:"#D4D4D4"},400:{value:"#A3A3A3"},500:{value:"#737373"},600:{value:"#525252"},700:{value:"#2D3748"},800:{value:"#1A202C"},900:{value:"#171717"}}}}}}),Urt=_e(()=>{const t=Zn(dN);return!t.isLoaded||!t.router?h.jsxs(aF,{value:S9,children:[h.jsx(qP,{w:"100%",h:"100%",children:h.jsx(ri,{})}),h.jsx(sB,{})]}):h.jsx(Wrt,{children:h.jsxs(aF,{value:S9,children:[h.jsx(x_e,{router:t.router}),h.jsx(sB,{})]})})}),C9=document.getElementById("root");C9&&sue.createRoot(C9).render(h.jsx(E.StrictMode,{children:h.jsx(Urt,{})}));const Hrt=`ver: ${Vg("PACKAGE_VERSION")} - ${Vg("GIT_BRANCH_NAME")}:${Vg("GIT_COMMIT_HASH")}`;console.info(Hrt)});export default Grt();
|
|
1711
|
+
`,Ret=async t=>{const e=await ln.mutate({mutation:Eet,variables:t});if(!e.data)throw e.errors;return e.data};class Uae{constructor(e,r){this.rootStore=e,this.projectPageModel=r}get branch(){return this.projectPageModel.branchOrThrow}get table(){return this.projectPageModel.tableOrThrow}get row(){return this.projectPageModel.rowOrThrow}addVersionedTableToCache(e){return this.addTableToCache(e)}addTableToCache(e){const r=this.rootStore.cache.addOrTable(fx(e));return this.rootStore.cache.addTableByVariables({revisionId:this.branch.draft.id,tableId:this.table.id},r.versionId),r}addVersionedRowToCache(e){return this.addRowToCache(e)}addRowToCache(e){const r=this.rootStore.cache.addRow(_L(e));return this.rootStore.cache.addRowByVariables({revisionId:this.branch.draft.id,tableId:this.table.id,rowId:r.id},r.versionId),r}updateTablesConnection(e){const r=this.branch.draft,n=r.tablesConnection.edges.find(i=>i.node.id===e.id);n&&r.tablesConnection.replaceNode(n.cursor,e)}updateRowsConnection(e,r){const n=e.rowsConnection.edges.find(i=>i.node.id===r.id);n&&e.rowsConnection.replaceNode(n.cursor,r)}}class Iet extends Uae{constructor(e,r,n){super(e,r),this.store=n}async execute(){let e=!1,r=!1;if(this.row.id!==this.store.name.value&&(await this.renameRowRequest(),e=!0,r=!0),this.store.root.touched){const{wasCreatedNewVersionTable:n,wasCreatedNewVersionRow:i}=await this.updateRowProcess();e=e||n||i}return this.branch.touched||this.branch.updateTouched(!0),r&&this.branch.draft.tablesConnection.reset(),e&&this.projectPageModel.revalidateLoaders(),!0}async updateRowProcess(){const{table:e,previousVersionTableId:r,row:n,previousVersionRowId:i}=await this.updateRowRequest(this.store.root.getPlainValue()),o=e.versionId!==r;o&&this.updateTablesConnection(e);const s=n.versionId!==i;return s&&this.updateRowsConnection(e,n),{wasCreatedNewVersionTable:o,wasCreatedNewVersionRow:s}}async renameRowRequest(){const e=await Tet({data:{revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.row.id,nextRowId:this.store.name.getPlainValue()}});return{table:this.addVersionedTableToCache(e.renameRow.table),previousVersionTableId:e.renameRow.previousVersionTableId,row:this.addVersionedRowToCache(e.renameRow.row),previousVersionRowId:e.renameRow.previousVersionRowId}}async updateRowRequest(e){const r=await Ret({data:{revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.store.name.getPlainValue(),data:e}});return{table:this.addVersionedTableToCache(r.updateRow.table),previousVersionTableId:r.updateRow.previousVersionTableId,row:this.addVersionedRowToCache(r.updateRow.row),previousVersionRowId:r.updateRow.previousVersionRowId}}}class jet extends Uae{constructor(e,r,n,i){super(e,r),this.fileService=n,this.store=i}async execute(e,r){let n=!1;const{wasCreatedNewVersionTable:i,wasCreatedNewVersionRow:o}=await this.uploadFileProcess(e,r);return n=n||i||o,this.branch.touched||this.branch.updateTouched(!0),n&&this.projectPageModel.revalidateLoaders(),!0}async uploadFileProcess(e,r){const{table:n,previousVersionTableId:i,row:o,previousVersionRowId:s}=await this.uploadFileRequest(e,r),a=n.versionId!==i;a&&this.updateTablesConnection(n);const l=o.versionId!==s;return l&&this.updateRowsConnection(n,o),{wasCreatedNewVersionTable:a,wasCreatedNewVersionRow:l}}async uploadFileRequest(e,r){const n=await this.fileService.add({revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.store.name.getPlainValue(),fileId:e,file:r}),i=await this.rootStore.queryTable({data:{revisionId:this.branch.draft.id,tableId:this.table.id}}),o=await this.rootStore.queryRow({revisionId:this.branch.draft.id,tableId:this.table.id,rowId:this.row.id});if(!i||!o)throw new Error("Table or row not found");return{table:i,previousVersionTableId:n.previousVersionTableId,row:o,previousVersionRowId:n.previousVersionRowId}}}var on=(t=>(t.List="List",t.CreatingRow="CreatingRow",t.ConnectingForeignKeyRow="ConnectingForeignKeyRow",t.UpdatingRow="UpdatingRow",t))(on||{});class Fj{constructor(e,r,n,i){this.rootStore=e,this.projectPageModel=r,this.customTable=n,this.state=i,Be(this,{},{autoBind:!0})}id=wn();get table(){return this.customTable||this.projectPageModel.tableOrThrow}get schema(){return this.table.schema}get isEditableRevision(){return this.projectPageModel.isEditableRevision}get revisionId(){return this.projectPageModel.revisionOrThrow.id}get currentForeignKeyPath(){return this.state.type==="ConnectingForeignKeyRow"?dO(this.state.foreignKeyNode):""}get branch(){return this.projectPageModel.branchOrThrow}async createRow(e,r){try{return await new Pet(this.rootStore,this.projectPageModel,this.branch,this.table).execute(e,r)}catch(n){return console.error(n),null}}async updateRow(e){try{return await new Iet(this.rootStore,this.projectPageModel,e).execute()}catch(r){return console.error(r),!1}}async uploadFile(e,r,n){try{const i=Ee.get(Vk);return await new jet(this.rootStore,this.projectPageModel,i,e).execute(r,n)}catch(i){return console.error(i),!1}}toList(){this.state={type:"List",isSelectingForeignKey:this.state.isSelectingForeignKey}}toConnectingForeignKeyRow(e,r){if(this.state.type==="CreatingRow"||this.state.type==="UpdatingRow")this.state={type:"ConnectingForeignKeyRow",previousType:this.state.type,isSelectingForeignKey:this.state.isSelectingForeignKey,store:this.state.store,foreignKeyNode:e,isCreating:r};else throw new Error("Invalid state")}toCloneRow(e){const r=this.rootStore.cache.getRow(e);if(!r)throw new Error(`Not found row.versionId ${e}`);const n=`${this.table.id.toLowerCase()}-${wn(9).toLowerCase()}`,i=mu(this.schema),o=new rN(i,ac(i),n,null,this.projectPageModel);o.root.updateBaseValue(r.data),Dm(o.root,s=>{if(s.$ref){const a=GL[s.$ref];if(a){const l=ac(mu(a));s.updateBaseValue(l.getPlainValue())}}}),this.state={type:"CreatingRow",isSelectingForeignKey:this.state.isSelectingForeignKey,store:o}}toCreatingRow(){const e=`${this.table.id.toLowerCase()}-${wn(9).toLowerCase()}`,r=mu(this.schema),n=this.state.type==="ConnectingForeignKeyRow"?this.state.store:new rN(r,ac(r),e);this.state={type:"CreatingRow",isSelectingForeignKey:this.state.isSelectingForeignKey,store:n}}toUpdatingTableFromConnectingForeignKeyRow(){if(this.state.type!=="ConnectingForeignKeyRow")throw new Error("Invalid state");const e=this.state.store;this.state={type:"UpdatingRow",isSelectingForeignKey:this.state.isSelectingForeignKey,store:e}}init(){}dispose(){}updateStore(e){this.state.type==="UpdatingRow"&&(this.state.store=e)}}class $et{constructor(e,r,n){this.rootStore=e,this.projectPageModel=r,this.stack=[new Fj(this.rootStore,this.projectPageModel,null,{type:on.List,isSelectingForeignKey:!1})],n&&(this.stack=[new Fj(this.rootStore,this.projectPageModel,null,{type:on.UpdatingRow,isSelectingForeignKey:!1,store:this.createStore()})]),Be(this,{},{autoBind:!0})}stack;disposers=[];async selectForeignKey(e,r,n){if(!r.foreignKey)throw new Error("Invalid foreign key");const i=await this.getFetchedTableWithRows(r.foreignKey);e.toConnectingForeignKeyRow(r,n),vt(()=>{const o=new Fj(this.rootStore,this.projectPageModel,i,{type:on.List,isSelectingForeignKey:!0});this.stack.push(o),n&&o.toCreatingRow()})}cancelSelectingForeignKey(e){const r=this.stack.findIndex(n=>n===e);r!==-1&&this.stack.splice(r+1),e.state.type===on.ConnectingForeignKeyRow&&(e.state.previousType===on.CreatingRow?e.toCreatingRow():e.state.previousType===on.UpdatingRow&&e.toUpdatingTableFromConnectingForeignKeyRow())}onSelectedForeignKey(e,r){const n=this.stack.findIndex(o=>o===e),i=this.stack[n-1];i.state.type===on.ConnectingForeignKeyRow&&(i.state.foreignKeyNode.setValue(r),i.state.previousType===on.CreatingRow?i.toCreatingRow():i.state.previousType===on.UpdatingRow&&i.toUpdatingTableFromConnectingForeignKeyRow()),this.stack.splice(n)}updateStore(){this.stack[0].updateStore(this.createStore())}init(){this.disposers.push(Iu(()=>this.projectPageModel.row,()=>{this.updateStore()}))}dispose(){this.disposers.length=0}async getFetchedTableWithRows(e){const r={revisionId:this.projectPageModel.revisionOrThrow.id,tableId:e},n=this.rootStore.cache.getTableByVariables(r)||await Ht.queryTable({data:r});if(!n)throw new Error(`Not found table ${e}`);return n.rowsConnection.countLoaded||await Ht.queryRows({revisionId:this.projectPageModel.revisionOrThrow.id,tableId:n.id,first:50}),n}createStore(){const e=this.projectPageModel.tableOrThrow.schema,r=Tne(e)?mu(e):new Pse;return new rN(r,ac(r),this.projectPageModel.rowOrThrow.id,this.projectPageModel.rowOrThrow,this.projectPageModel)}}const Aet=t=>{const e=Lu(),[r]=E.useState(()=>new $et(Ht,e,t));return E.useEffect(()=>(r.init(),()=>r.dispose()),[r]),r},Hae=E.createContext(null),yT=()=>{const t=E.useContext(Hae);if(!t)throw new Error("Invalid RowStackModelContext");return t},Net=({row:t,onSelect:e})=>{const r=E.useCallback(()=>{e?.(t.id)},[e,t.id]);return h.jsxs(ee,{_hover:{backgroundColor:"gray.50"},alignItems:"center",gap:"4px",paddingLeft:"1rem",minHeight:"2.5rem",width:"100%",children:[h.jsx(ee,{minWidth:"150px",children:h.jsx(Y,{textDecoration:"underline",cursor:"pointer",onClick:r,children:t.id})}),h.jsx(ee,{alignItems:"center",justifyContent:"space-between",minHeight:"40px",width:"100%",minWidth:0,children:h.jsx(Y,{ml:"16px",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:"gray.400",children:t.data})})]},t.versionId)},Met=({tableId:t,connection:e})=>{const r=Ba(),n=vp(),i=E.useCallback(o=>{r(n.make({...n.getCurrentOptions(),tableId:t,rowId:o}),{state:{isBackToRow:!0}})},[n,r,t]);return h.jsxs(ee,{flexDirection:"column",width:"100%",children:[h.jsxs(ee,{minHeight:"40px",width:"100%",gap:"4px",children:[h.jsx(Y,{children:t}),h.jsxs(Y,{color:"gray.300",children:["(",e.totalCount,")"]})]}),h.jsx(Sh,{useWindowScroll:!0,totalCount:e.totalCount,defaultItemHeight:40,increaseViewportBy:40*100,itemContent:o=>{const{node:s}=e.edges[o];if(s)return h.jsx(Net,{row:{id:s.id,versionId:s.versionId,data:JSON.stringify(s.data,null,2).replaceAll("\\n","")},onSelect:i})}})]})},Det=({row:t})=>{const e=E.useMemo(()=>[...t.rowForeignKeysByConnection.keys()].map(n=>({tableId:n,connection:t.rowForeignKeysByConnection.get(n)})).filter(n=>n.connection.totalCount),[t]);return h.jsx(ee,{flexDirection:"column",width:"100%",gap:"40px",children:e.map(({tableId:r,connection:n})=>h.jsx(Met,{tableId:r,connection:n},r))})},Let=_e(({store:t})=>h.jsx(ee,{height:"40px",paddingBottom:"4px",alignItems:"flex-end",backgroundColor:"white",width:"100%",position:"sticky",bottom:0,justifyContent:"space-between",children:h.jsx(Y,{color:"gray",opacity:"0.4",children:t.isComplexStructure&&t.overNode&&dO(t.overNode)})})),Gae=_e(({store:t,isEdit:e})=>h.jsxs(ee,{alignItems:"flex-start",flexDirection:"column",gap:"1rem",className:QA.Root,flex:1,minHeight:"100vh","date-testid":"row-data-card",children:[t.viewMode===di.Tree&&h.jsxs(h.Fragment,{children:[h.jsx(z,{flexGrow:1,width:"100%",children:h.jsx(yet,{store:t.node,isEdit:e})}),h.jsx(Let,{store:t})]}),t.viewMode===di.Json&&h.jsx(Q_,{schema:t.schemaStore.getPlainSchema(),readonly:!e,data:Kk(t.root),onChange:t.updateValue}),t.viewMode===di.RefBy&&t.originRow&&h.jsx(Det,{row:t.originRow})]})),Vet=_e(({store:t,onSelectForeignKey:e})=>{sse(()=>{t.scrollPosition&&(window.scrollTo(0,t.scrollPosition),t.setScrollPosition(null))});const r=E.useCallback(async(n,i)=>{t.setScrollPosition(window.scrollY),await e(n,i)},[e,t]);return h.jsx(e5.Provider,{value:{onSelectForeignKey:r,onOverNode:t.setOverNode,mode:fO.Creating},children:h.jsx(Gae,{store:t,rootName:"<id>",isEdit:!0})})}),Xae=({onExpandAll:t,onCollapseAll:e,onCopyJson:r,showTreeActions:n})=>h.jsxs(Hn,{children:[h.jsx(to,{asChild:!0,children:h.jsx(Ir,{"aria-label":"Row actions","data-testid":"row-actions-menu",variant:"ghost",size:"sm",height:"2.5rem",color:"gray.400",_hover:{backgroundColor:"gray.50"},_focus:{outline:"none",boxShadow:"none"},_focusVisible:{outline:"none",boxShadow:"none"},children:h.jsx(VZe,{})})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minWidth:"160px",children:[n&&h.jsxs(h.Fragment,{children:[h.jsxs(Kt,{value:"expand",cursor:"pointer",onClick:t,children:[h.jsx(MZe,{style:{marginRight:"8px"}}),"Expand All"]}),h.jsxs(Kt,{value:"collapse",cursor:"pointer",onClick:e,children:[h.jsx(NZe,{style:{marginRight:"8px"}}),"Collapse All"]}),h.jsx(go,{})]}),h.jsxs(Kt,{value:"copy",cursor:"pointer",onClick:r,children:[h.jsx(DZe,{style:{marginRight:"8px"}}),"Copy JSON"]})]})})})]}),Zae=_e(({value:t,setValue:e,readonly:r,dataTestId:n})=>{const[i,o]=E.useState(t),[s,a]=E.useState(!1);E.useEffect(()=>{o(t)},[t]);const l=E.useCallback(m=>{o(m)},[]),c=E.useCallback(()=>{a(!1),e(i)},[i,e]),u=E.useCallback(()=>{a(!0)},[]),p=i?"":'"';return h.jsx(z,{borderRadius:"4px",bgColor:s?"newGray.100":void 0,_hover:{bgColor:r?void 0:"newGray.100"},pl:"4px",pr:"4px",minHeight:"24px",minWidth:"15px",cursor:r?"text":void 0,children:r?`${p}${i}${p}`:h.jsx(If,{dataTestId:n,prefix:p,postfix:p,initValue:i,onChange:l,onFocus:u,onBlur:c})})}),hP=({showBreadcrumbs:t,tableTitle:e,rowIdInput:r,actions:n,actionsMenu:i,switcher:o,search:s})=>h.jsxs(ee,{alignItems:"center",backgroundColor:"white",justifyContent:"space-between",width:"100%",position:"sticky",zIndex:1,top:0,padding:"8px",children:[h.jsxs(ee,{alignItems:"center",gap:"8px",children:[t&&h.jsx(HL,{}),e&&h.jsx(Y,{fontWeight:"500",fontSize:"14px",color:"gray.700",children:e}),t&&r&&h.jsx(Y,{color:"gray",fontWeight:"600",fontSize:"16px",children:"/"}),r,n]}),h.jsxs(ee,{alignItems:"center",gap:"8px",children:[s,i,o]})]}),d5=({tableId:t})=>h.jsx(ee,{width:"100%",borderStyle:"solid",borderTopWidth:1,borderColor:"gray.100",justifyContent:"center",color:"gray.400",fontWeight:"300",pt:"0.5rem",pb:"0.5rem",children:h.jsxs(z,{backgroundColor:"gray.50",pl:"5px",pr:"5px",borderRadius:"5px",children:['Select or create a row in "',t,'" to be referenced by the above row']})}),Fet=_e(()=>{const t=Ba(),e=vp(),{root:r,item:n}=yT(),[i,o]=E.useState(!1),a=r.stack.indexOf(n)===0&&!n.state.isSelectingForeignKey,l=E.useCallback(async(P,_)=>{await r.selectForeignKey(n,P,_)},[n,r]),c=E.useCallback(P=>{n.state.type===on.CreatingRow&&n.state.store.name.setValue(P)},[n]),u=E.useCallback(async()=>{if(n.state.type!==on.CreatingRow)return;const P=n.state.store;o(!0);try{const _=await n.createRow(P.name.getPlainValue(),P.root.getPlainValue());_&&(n.state.isSelectingForeignKey?r.onSelectedForeignKey(n,P.name.getPlainValue()):t(e.make({revisionIdOrTag:zo,rowId:_.id})))}catch{Ur.error({title:"Create failed"})}finally{o(!1)}},[n,e,t,r]),p=E.useCallback(async()=>{if(n.state.type!==on.CreatingRow)return;const P=JSON.stringify(n.state.store.root.getPlainValue(),null,2);await navigator.clipboard.writeText(P),Ur.info({title:"Copied to clipboard"})},[n]);if(n.state.type!==on.CreatingRow)return null;const m=n.state.store,v=m.viewMode||di.Tree,b=h.jsxs(ee,{gap:"4px",children:[h.jsx(C_,{dataTestId:"close-create-row-button",onClick:n.toList}),h.jsx(JO,{dataTestId:"approve-create-row-button",loading:i,onClick:u,isDisabled:!m.root.isValid})]}),O=h.jsx(dT,{availableRefByMode:!1,mode:v,onChange:m.setViewMode}),x=h.jsx(Zae,{value:m.name.value,setValue:c,dataTestId:"row-id-input"}),S=v===di.Tree,w=S&&m.node.hasCollapsibleContent,k=S?h.jsx(Xae,{showTreeActions:w,onExpandAll:()=>m.node.expandAllContent(),onCollapseAll:()=>m.node.collapseAllContent(),onCopyJson:p}):null;return h.jsxs(ee,{flexDirection:"column",flex:1,children:[n.state.isSelectingForeignKey&&h.jsx(d5,{tableId:n.table.id}),h.jsx(hP,{showBreadcrumbs:a,rowIdInput:x,actions:b,actionsMenu:k,switcher:O}),h.jsx(ee,{flexDirection:"column",paddingTop:"60px",children:h.jsx(Vet,{store:m,onSelectForeignKey:l})})]})}),Dg=40,Qj=200,Qet=t=>{const[e,r]=E.useState(!1),n=E.useRef(0),i=E.useRef(0),o=E.useRef(null),s=E.useRef(t);s.current=t;const a=E.useCallback(l=>{l.preventDefault(),l.stopPropagation(),n.current=l.clientX,i.current=s.current.idColumnWidth,r(!0)},[]);return E.useEffect(()=>{if(!e)return;const l=u=>{o.current===null&&(o.current=requestAnimationFrame(()=>{const p=u.clientX-n.current,m=Math.max(Dg,i.current+p);s.current.setIdColumnWidth(m),o.current=null}))},c=()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null),r(!1)};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.body.style.userSelect="",document.body.style.cursor="",o.current!==null&&cancelAnimationFrame(o.current)}},[e]),{isResizing:e,handleMouseDown:a}};var Ye=(t=>(t.String="string",t.Number="number",t.Boolean="boolean",t.ForeignKey="foreignKey",t.File="file",t.DateTime="dateTime",t))(Ye||{}),fr=(t=>(t.Id="id",t.CreatedAt="createdAt",t.UpdatedAt="updatedAt",t.PublishedAt="publishedAt",t.VersionId="versionId",t.CreatedId="createdId",t))(fr||{});const Yae=new Set(["id","createdAt","updatedAt"]),h5=[{id:fr.Id,name:"id",fieldType:Ye.String,schemaRef:Ft.RowId},{id:fr.CreatedAt,name:"createdAt",fieldType:Ye.DateTime,schemaRef:Ft.RowCreatedAt},{id:fr.UpdatedAt,name:"updatedAt",fieldType:Ye.DateTime,schemaRef:Ft.RowUpdatedAt},{id:fr.PublishedAt,name:"publishedAt",fieldType:Ye.DateTime,schemaRef:Ft.RowPublishedAt},{id:fr.VersionId,name:"versionId",fieldType:Ye.String,schemaRef:Ft.RowVersionId},{id:fr.CreatedId,name:"createdId",fieldType:Ye.String,schemaRef:Ft.RowCreatedId}],Bet=new Map(h5.map(t=>[t.schemaRef,t])),zet=new Map(h5.map(t=>[t.id,t]));function Kae(t){return Bet.get(t)}function Jae(t){return zet.get(t)}const qet=[fr.CreatedAt,fr.UpdatedAt,fr.PublishedAt,fr.VersionId,fr.CreatedId];var en=(t=>(t.Equals="equals",t.NotEquals="not_equals",t.Contains="contains",t.NotContains="not_contains",t.StartsWith="starts_with",t.EndsWith="ends_with",t.IsEmpty="is_empty",t.IsNotEmpty="is_not_empty",t.Gt="gt",t.Gte="gte",t.Lt="lt",t.Lte="lte",t.IsTrue="is_true",t.IsFalse="is_false",t))(en||{});const ele={[Ye.String]:[{operator:"equals",label:"equals",requiresValue:!0},{operator:"not_equals",label:"not equals",requiresValue:!0},{operator:"contains",label:"contains",requiresValue:!0},{operator:"not_contains",label:"not contains",requiresValue:!0},{operator:"starts_with",label:"starts with",requiresValue:!0},{operator:"ends_with",label:"ends with",requiresValue:!0},{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.Number]:[{operator:"equals",label:"=",requiresValue:!0},{operator:"not_equals",label:"!=",requiresValue:!0},{operator:"gt",label:">",requiresValue:!0},{operator:"gte",label:">=",requiresValue:!0},{operator:"lt",label:"<",requiresValue:!0},{operator:"lte",label:"<=",requiresValue:!0},{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.Boolean]:[{operator:"is_true",label:"is true",requiresValue:!1},{operator:"is_false",label:"is false",requiresValue:!1}],[Ye.ForeignKey]:[{operator:"equals",label:"equals",requiresValue:!0},{operator:"not_equals",label:"not equals",requiresValue:!0},{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.File]:[{operator:"is_empty",label:"is empty",requiresValue:!1},{operator:"is_not_empty",label:"is not empty",requiresValue:!1}],[Ye.DateTime]:[{operator:"equals",label:"is",requiresValue:!0},{operator:"not_equals",label:"is not",requiresValue:!0},{operator:"lt",label:"before",requiresValue:!0},{operator:"gt",label:"after",requiresValue:!0},{operator:"lte",label:"on or before",requiresValue:!0},{operator:"gte",label:"on or after",requiresValue:!0}]};function tle(t){switch(t.type){case ke.String:return"foreignKey"in t&&t.foreignKey?Ye.ForeignKey:Ye.String;case ke.Number:return Ye.Number;case ke.Boolean:return Ye.Boolean;case ke.Object:return t.$ref===Ft.File?Ye.File:null;default:return null}}function fP(t){switch(t){case Ye.String:case Ye.ForeignKey:return"contains";case Ye.Number:return"equals";case Ye.Boolean:return"is_true";case Ye.File:return"is_not_empty";case Ye.DateTime:return"gt"}}function Wet(t,e){return ele[e].find(r=>r.operator===t)}function Lg(t,e){return Wet(t,e)?.requiresValue??!0}function rle(){return`filter_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function u9(t){return{id:rle(),field:t.name,fieldPath:t.path,fieldType:t.fieldType,operator:fP(t.fieldType),value:t.fieldType===Ye.Boolean?!0:"",isSystemField:t.isSystemField,systemFieldId:t.systemFieldId}}function ag(t="and"){return{id:rle(),logic:t,conditions:[],groups:[]}}const qd=t=>{switch(t){case Ye.String:return"Aa";case Ye.Number:return"#";case Ye.Boolean:return"?";case Ye.ForeignKey:return"->";case Ye.File:return h.jsx(Yg,{size:14});case Ye.DateTime:return h.jsx(EIe,{size:14});default:return t}},yO=E.memo(({nodeId:t,name:e,fieldType:r,valuePrefix:n,onClick:i})=>{const o=()=>i(t);return h.jsx(Kt,{value:n?`${n}-${t}`:t,onClick:o,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[r&&h.jsx(z,{as:"span",fontSize:"xs",fontWeight:"medium",color:"gray.400",fontFamily:"mono",minWidth:"20px",children:qd(r)}),h.jsx(Y,{truncate:!0,children:e||"(unnamed)"})]})},t)}),Uet=E.memo(({field:t,availableChildren:e,isSelfVisible:r,valuePrefix:n,onSelect:i})=>h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(sv,{children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[t.fieldType&&h.jsx(z,{as:"span",fontSize:"xs",fontWeight:"medium",color:"gray.400",fontFamily:"mono",minWidth:"20px",children:qd(t.fieldType)}),h.jsx(Y,{truncate:!0,flex:1,children:t.name}),h.jsx(Lm,{})]})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",maxH:"300px",overflowY:"auto",children:[!r&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"File column"}),h.jsx(yO,{nodeId:t.nodeId,name:t.name,fieldType:t.fieldType,valuePrefix:n,onClick:i})]}),e.length>0&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Properties"}),e.map(o=>h.jsx(yO,{nodeId:o.nodeId,name:o.name,fieldType:o.fieldType,valuePrefix:n,onClick:i},o.nodeId))]})]})})})]})),nle=E.memo(({fields:t,valuePrefix:e,onSelect:r,getAvailableFileChildren:n,isColumnVisible:i})=>h.jsx(h.Fragment,{children:t.map(o=>o.isFileObject&&o.children?h.jsx(Uet,{field:o,availableChildren:n(o),isSelfVisible:i(o.nodeId),valuePrefix:e,onSelect:r},o.nodeId):h.jsx(yO,{nodeId:o.nodeId,name:o.name,fieldType:o.fieldType,valuePrefix:e,onClick:r},o.nodeId))})),Het=_e(({availableFields:t,availableSystemFields:e,hasHiddenColumns:r,onAddColumn:n,onAddAll:i,getAvailableFileChildren:o,isColumnVisible:s})=>r?h.jsx(z,{as:"th",backgroundColor:"white",position:"sticky",right:0,zIndex:1,width:"40px",children:h.jsx(z,{height:"30px",borderBottomWidth:"1px",borderColor:"gray.100",display:"flex",alignItems:"center",children:h.jsxs(Hn,{positioning:{placement:"bottom-start"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(to,{asChild:!0,children:h.jsx(Ir,{focusRing:"none","aria-label":"Add column",size:"xs",variant:"ghost",color:"gray.400",_hover:{bg:"gray.100",color:"gray.600"},children:h.jsx(mee,{})})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"200px",maxH:"340px",overflowY:"auto",children:[h.jsxs(Kt,{value:"add-all",onClick:i,children:[h.jsx(gee,{}),h.jsx(Y,{children:"Add all columns"})]}),t.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(go,{}),h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Data fields"}),h.jsx(nle,{fields:t,onSelect:n,getAvailableFileChildren:o,isColumnVisible:s})]})]}),e.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(go,{}),h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"System fields"}),e.map(a=>h.jsx(yO,{nodeId:a.nodeId,name:a.name,fieldType:a.fieldType,onClick:n},a.nodeId))]})]})]})})})]})})}):h.jsx(z,{as:"th",backgroundColor:"white",position:"sticky",right:0,zIndex:1,width:"40px",children:h.jsx(z,{height:"30px",borderBottomWidth:"1px",borderColor:"gray.100"})})),Get=()=>{const t=E.useRef(null),[e,r]=E.useState(!1);E.useEffect(()=>()=>r(!1),[]);const n=E.useCallback(()=>{const s=t.current;if(!s)return;const a=s.scrollWidth>s.clientWidth;r(a)},[]),i=E.useCallback(()=>{r(!1)},[]),o=E.useCallback(()=>{r(!1)},[]);return{ref:t,isOpen:e,onMouseEnter:n,onMouseLeave:i,onClose:o}},Xet=(t,e)=>{const[r,n]=E.useState(!1),i=E.useRef(0),o=E.useRef(0),s=E.useRef(null),a=E.useRef(t),l=E.useRef(e);a.current=t,l.current=e;const c=E.useCallback(u=>{u.preventDefault(),u.stopPropagation();const p=l.current.getColumnWidth(a.current);i.current=u.clientX,o.current=p,n(!0)},[]);return E.useEffect(()=>{if(!r)return;const u=m=>{s.current===null&&(s.current=requestAnimationFrame(()=>{const v=m.clientX-i.current,b=Math.max(Dg,o.current+v);l.current.setColumnWidth(a.current,b),s.current=null}))},p=()=>{s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),n(!1)};return document.addEventListener("mousemove",u),document.addEventListener("mouseup",p),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p),document.body.style.userSelect="",document.body.style.cursor="",s.current!==null&&cancelAnimationFrame(s.current)}},[r]),{isResizing:r,handleMouseDown:c}},ile=({selectedOperator:t,fieldType:e,onSelect:r})=>{const n=ele[e],i=n.find(o=>o.operator===t);return h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"80px",children:[h.jsx(Y,{fontSize:"sm",color:"newGray.700",truncate:!0,children:i?.label||t}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsx(Xn,{minW:"150px",children:n.map(o=>h.jsx(Kt,{value:o.operator,onClick:()=>r(o.operator),bg:t===o.operator?"newGray.100":void 0,children:h.jsx(Y,{children:o.label})},o.operator))})})]})};function Zet(t){if(!t)return"";try{const e=new Date(t);if(isNaN(e.getTime()))return"";const r=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),o=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0");return`${r}-${n}-${i}T${o}:${s}`}catch{return""}}function Yet(t){if(!t)return"";try{const e=new Date(t);return isNaN(e.getTime())?"":e.toISOString()}catch{return""}}const ole=({value:t,fieldType:e,disabled:r,error:n,onChange:i})=>{const o=E.useCallback(u=>{i(u.target.value)},[i]),s=E.useCallback(u=>{const p=u.target.value===""?"":Number(u.target.value);i(p)},[i]),a=E.useCallback(u=>{i(u.checked)},[i]),l=E.useCallback(u=>{const p=Yet(u.target.value);i(p)},[i]),c=E.useMemo(()=>Zet(String(t??"")),[t]);if(r)return null;switch(e){case Ye.Boolean:return h.jsxs(fM,{checked:!!t,onCheckedChange:a,size:"sm",children:[h.jsx(gM,{}),h.jsx(pM,{children:h.jsx(XP,{})})]});case Ye.Number:return h.jsx(hs,{type:"number",value:typeof t=="number"?t:"",onChange:s,size:"sm",width:"100px",placeholder:"Value",borderColor:n?"red.500":void 0,_focus:{borderColor:n?"red.500":void 0}});case Ye.DateTime:return h.jsx(hs,{type:"datetime-local",value:c,onChange:l,size:"sm",width:"200px",borderColor:n?"red.500":void 0,_focus:{borderColor:n?"red.500":void 0}});case Ye.String:case Ye.ForeignKey:default:return h.jsx(hs,{type:"text",value:String(t??""),onChange:o,size:"sm",width:"150px",placeholder:"Value",borderColor:n?"red.500":void 0,_focus:{borderColor:n?"red.500":void 0}})}},sle=_e(({field:t,filterModel:e,isOpen:r,onClose:n,anchorRef:i})=>{const[o,s]=E.useState(()=>fP(t.fieldType)),[a,l]=E.useState(""),[c,u]=E.useState(!1),p=Lg(o,t.fieldType),m=E.useCallback(w=>{s(w),u(!1)},[]),v=E.useCallback(w=>{l(w),u(!1)},[]),b=E.useCallback(()=>{s(fP(t.fieldType)),l(""),u(!1)},[t.fieldType]),O=E.useCallback(()=>{b(),n()},[b,n]),x=E.useCallback(()=>{if(!e.addQuickFilter(t,o,a)){u(!0);return}b(),n()},[e,t,o,a,b,n]),S=E.useCallback(()=>i.current?.getBoundingClientRect()??null,[i]);return h.jsx(qo,{open:r,onOpenChange:({open:w})=>{w||O()},lazyMount:!0,unmountOnExit:!0,autoFocus:!0,positioning:{placement:"bottom-start",getAnchorRect:S},children:h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsxs(Oo,{p:3,minW:"280px",boxShadow:"lg",children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,mb:3,children:[h.jsx(z,{color:"gray.400",children:h.jsx(Vm,{size:14})}),h.jsxs(Y,{fontSize:"sm",fontWeight:"medium",color:"gray.600",children:["Filter by ",t.name]})]}),h.jsxs(z,{display:"flex",alignItems:"center",gap:2,mb:3,children:[h.jsx(ile,{selectedOperator:o,fieldType:t.fieldType,onSelect:m}),p&&h.jsx(ole,{value:a,fieldType:t.fieldType,error:c,onChange:v})]}),h.jsxs(z,{display:"flex",justifyContent:"flex-end",gap:2,children:[h.jsx(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:O,children:"Cancel"}),h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",onClick:x,children:"Add"})]})]})})})})}),ale=({isResizing:t,onMouseDown:e})=>h.jsx(z,{role:"group",position:"absolute",right:"-4px",top:0,bottom:0,width:"8px",cursor:"col-resize",zIndex:10,onMouseDown:e,children:h.jsx(z,{position:"absolute",left:"3px",top:0,bottom:0,width:"2px",bg:t?"blue.500":"transparent",_groupHover:{bg:"blue.500"},transition:"background 0.1s",pointerEvents:"none"})}),d9=({label:t,valuePrefix:e,availableFields:r,availableSystemFields:n,onSelect:i,getAvailableFileChildren:o,isColumnVisible:s})=>h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsxs(sv,{children:[h.jsx(Y,{flex:1,children:t}),h.jsx(Lm,{})]}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{maxH:"300px",minW:"200px",overflowY:"auto",children:[r.length>0&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Data fields"}),h.jsx(nle,{fields:r,valuePrefix:e,onSelect:i,getAvailableFileChildren:o,isColumnVisible:s})]}),n.length>0&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"System fields"}),n.map(a=>h.jsx(yO,{nodeId:a.nodeId,name:a.name,fieldType:a.fieldType,valuePrefix:e,onClick:i},a.nodeId))]})]})})})]}),lle=_e(({columnId:t,sortModel:e})=>{const r=e.getSortDirection(t),n=e.getSortIndex(t),i=e.sortCount>1;return r?h.jsxs(ee,{alignItems:"center",gap:"1px",color:"blue.500",fontSize:"xs",flexShrink:0,children:[r==="asc"?h.jsx(Nse,{size:12}):h.jsx(Ase,{size:12}),i&&h.jsx(z,{as:"span",fontSize:"10px",fontWeight:"medium",lineHeight:1,children:n})]}):null}),cle=_e(({columnId:t,sortModel:e})=>{const r=e.isSorted(t),n=e.getSortDirection(t),i=E.useCallback(s=>{e.setSortAndApply(t,s)},[e,t]),o=E.useCallback(()=>{e.removeSortAndApply(t)},[e,t]);return h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsxs(sv,{children:[h.jsx(Y,{flex:1,children:"Sort"}),h.jsx(Lm,{})]}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"160px",children:[h.jsxs(Kt,{value:"sort-asc",onClick:()=>i("asc"),color:n==="asc"?"blue.600":void 0,children:[h.jsx($Ze,{}),h.jsx(Y,{children:"Sort A → Z"})]}),h.jsxs(Kt,{value:"sort-desc",onClick:()=>i("desc"),color:n==="desc"?"blue.600":void 0,children:[h.jsx(RZe,{}),h.jsx(Y,{children:"Sort Z → A"})]}),r&&h.jsxs(h.Fragment,{children:[h.jsx(go,{}),h.jsxs(Kt,{value:"remove-sort",onClick:o,children:[h.jsx(fT,{}),h.jsx(Y,{children:"Remove sort"})]})]})]})})})]})}),Ket=_e(({column:t,columnsModel:e,sortModel:r,filterModel:n})=>{const{ref:i,isOpen:o,onMouseEnter:s,onMouseLeave:a,onClose:l}=Get(),c=E.useRef(null),[u,p]=E.useState(!1),m=e.getColumnWidth(t.id),{isResizing:v,handleMouseDown:b}=Xet(t.id,e),O=e.availableFieldsToAdd,x=e.availableSystemFieldsToAdd,S=O.length>0||x.length>0,w=e.canRemoveColumn,k=e.canHideAll,P=e.canMoveLeft(t.id),_=e.canMoveRight(t.id),T=e.canMoveToStart(t.id),R=e.canMoveToEnd(t.id),$=n?.getFilterableFieldForColumn(t.name,t.isSystemField,t.systemFieldId),A=!!$,M=E.useCallback(()=>{e.removeColumn(t.id)},[e,t.id]),Q=E.useCallback(se=>{e.insertColumnBefore(t.id,se)},[e,t.id]),V=E.useCallback(se=>{e.insertColumnAfter(t.id,se)},[e,t.id]),q=E.useCallback(()=>{e.moveColumnLeft(t.id)},[e,t.id]),N=E.useCallback(()=>{e.moveColumnRight(t.id)},[e,t.id]),B=E.useCallback(()=>{e.moveColumnToStart(t.id)},[e,t.id]),re=E.useCallback(()=>{e.moveColumnToEnd(t.id)},[e,t.id]),he=E.useCallback(()=>{p(!0)},[]),ne=E.useCallback(()=>{p(!1)},[]);return h.jsxs(z,{ref:c,as:"th",textAlign:"start",width:`${m}px`,maxWidth:`${m}px`,minWidth:`${m}px`,backgroundColor:"white",position:"relative","data-testid":`column-header-${t.name}`,children:[h.jsxs(Hn,{positioning:{placement:"bottom-end"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(to,{asChild:!0,children:h.jsxs(ee,{alignItems:"center",height:"30px",borderBottomWidth:"1px",borderColor:"gray.100",pl:"16px",pr:"8px",gap:"4px",cursor:"pointer",transition:"background 0.15s",_hover:{bg:"gray.50"},onMouseEnter:s,onMouseLeave:a,onClick:l,children:[t.fieldType&&h.jsx(z,{as:"span",fontSize:"xs",fontWeight:"medium",color:"gray.300",fontFamily:"mono",flexShrink:0,mr:1,children:qd(t.fieldType)}),h.jsx(Di,{content:t.title,open:o,positioning:{placement:"top"},children:h.jsx(Y,{ref:i,flex:1,minWidth:0,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:"gray.400",fontSize:"sm",children:t.title})}),r&&!t.isFileObject&&h.jsx(lle,{columnId:t.id,sortModel:r})]})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",children:[r&&!t.isFileObject&&h.jsxs(h.Fragment,{children:[h.jsx(cle,{columnId:t.id,sortModel:r}),h.jsx(go,{})]}),A&&h.jsxs(h.Fragment,{children:[h.jsxs(Kt,{value:"add-filter",onClick:he,children:[h.jsx(Vm,{}),h.jsx(Y,{children:"Add filter"})]}),h.jsx(go,{})]}),(P||_)&&h.jsxs(h.Fragment,{children:[h.jsxs(Hn,{positioning:{placement:"right-start",gutter:2},lazyMount:!0,unmountOnExit:!0,children:[h.jsxs(sv,{children:[h.jsx(Y,{flex:1,children:"Move column"}),h.jsx(Lm,{})]}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"160px",children:[P&&h.jsxs(Kt,{value:"move-left",onClick:q,children:[h.jsx(AZe,{}),h.jsx(Y,{children:"Move left"})]}),T&&h.jsxs(Kt,{value:"move-to-start",onClick:B,children:[h.jsx(IZe,{}),h.jsx(Y,{children:"Move to start"})]}),_&&h.jsxs(Kt,{value:"move-right",onClick:N,children:[h.jsx(Lm,{}),h.jsx(Y,{children:"Move right"})]}),R&&h.jsxs(Kt,{value:"move-to-end",onClick:re,children:[h.jsx(jZe,{}),h.jsx(Y,{children:"Move to end"})]})]})})})]}),h.jsx(go,{})]}),S&&h.jsxs(h.Fragment,{children:[h.jsx(d9,{label:"Insert before",valuePrefix:"before",availableFields:O,availableSystemFields:x,onSelect:Q,getAvailableFileChildren:e.getAvailableFileChildren,isColumnVisible:e.isColumnVisible}),h.jsx(d9,{label:"Insert after",valuePrefix:"after",availableFields:O,availableSystemFields:x,onSelect:V,getAvailableFileChildren:e.getAvailableFileChildren,isColumnVisible:e.isColumnVisible}),h.jsx(go,{})]}),h.jsxs(Kt,{value:"hide",disabled:!w,onClick:M,children:[h.jsx(IIe,{}),h.jsx(Y,{children:"Hide column"})]}),h.jsxs(Kt,{value:"hide-all",disabled:!k,onClick:e.hideAll,children:[h.jsx(gee,{}),h.jsx(Y,{children:"Hide all columns"})]})]})})})]}),h.jsx(ale,{isResizing:v,onMouseDown:b}),n&&$&&h.jsx(sle,{field:$,filterModel:n,isOpen:u,onClose:ne,anchorRef:c})]})}),Jet=_e(({width:t,left:e,isResizing:r,onResizeMouseDown:n,sortModel:i,filterModel:o})=>{const s=E.useRef(null),[a,l]=E.useState(!1),c=o?.systemFields.find(v=>v.systemFieldId===fr.Id)||o?.availableFields.find(v=>v.systemFieldId===fr.Id),u=!!c,p=E.useCallback(()=>{l(!0)},[]),m=E.useCallback(()=>{l(!1)},[]);return h.jsxs(z,{ref:s,as:"th",backgroundColor:"white",position:"sticky",left:e,zIndex:1,width:`${t}px`,maxWidth:`${t}px`,minWidth:`${t}px`,textAlign:"start",transition:"left 0.15s",children:[h.jsxs(Hn,{positioning:{placement:"bottom-end"},lazyMount:!0,unmountOnExit:!0,children:[h.jsx(to,{asChild:!0,children:h.jsxs(ee,{alignItems:"center",height:"30px",borderBottomWidth:"1px",borderColor:"gray.100",pl:"8px",pr:"8px",gap:"4px",cursor:"pointer",transition:"background 0.15s",_hover:{bg:"gray.50"},children:[h.jsx(z,{as:zZe,fontSize:"xs",color:"gray.300",flexShrink:0}),h.jsx(Y,{flex:1,color:"gray.400",fontSize:"sm",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:"id"}),i&&h.jsx(lle,{columnId:fr.Id,sortModel:i})]})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",children:[i&&h.jsxs(h.Fragment,{children:[h.jsx(cle,{columnId:fr.Id,sortModel:i}),h.jsx(go,{})]}),u&&h.jsxs(Kt,{value:"add-filter",onClick:p,children:[h.jsx(Vm,{}),h.jsx(Y,{children:"Add filter"})]})]})})})]}),h.jsx(ale,{isResizing:r,onMouseDown:n}),o&&c&&h.jsx(sle,{field:c,filterModel:o,isOpen:a,onClose:m,anchorRef:s})]})}),Dd="40px",pP=E.createContext(null),h9=_e(({columnsModel:t})=>{const e=t.columns,n=E.useContext(pP)?.model,i=n?.showSelectionColumn??!1,o=n?.sortModel,s=n?.filterModel,a=t.idColumnWidth,{isResizing:l,handleMouseDown:c}=Qet(t);return h.jsxs(z,{as:"tr",height:"40px",children:[h.jsx(z,{as:"th",backgroundColor:"white",position:"sticky",left:0,zIndex:1,width:i?Dd:"0px",maxWidth:i?Dd:"0px",minWidth:i?Dd:"0px",overflow:"hidden",transition:"width 0.15s, min-width 0.15s, max-width 0.15s",children:h.jsx(z,{height:"30px",borderBottomWidth:"1px",borderColor:"gray.100"})}),h.jsx(Jet,{width:a,left:i?Dd:0,isResizing:l,onResizeMouseDown:c,sortModel:o,filterModel:s}),e.map(u=>h.jsx(Ket,{column:u,columnsModel:t,sortModel:o,filterModel:s},u.id)),h.jsx(Het,{availableFields:t.availableFieldsToAdd,availableSystemFields:t.availableSystemFieldsToAdd,hasHiddenColumns:t.hasHiddenColumns,onAddColumn:t.addColumn,onAddAll:t.addAll,getAvailableFileChildren:t.getAvailableFileChildren,isColumnVisible:t.isColumnVisible})]})}),f9=_e(({model:t,onCreate:e})=>{if(t.showNotFound){const r=t.emptyStateType==="filters"?Vm:qA;return h.jsxs(qn,{flex:1,justifyContent:"center",gap:"12px",color:"gray.400",children:[h.jsx(z,{as:r,boxSize:"48px"}),h.jsx(Y,{fontSize:"md",children:"No rows found"}),h.jsx(Y,{fontSize:"sm",children:t.emptyStateHint})]})}return t.showEmpty?h.jsxs(qn,{flex:1,justifyContent:"center",gap:"12px",color:"gray.400",children:[h.jsx(z,{as:BZe,boxSize:"48px"}),h.jsx(Y,{fontSize:"md",children:"No rows yet"}),e?h.jsx(na,{fontSize:"sm",color:"gray.500",_hover:{color:"gray.600"},onClick:e,cursor:"pointer",children:"Create your first row to get started"}):h.jsx(Y,{fontSize:"sm",children:"Create your first row to get started"})]}):null}),ett=({isOpen:t,count:e,onConfirm:r,onCancel:n})=>h.jsx(np,{open:t,onOpenChange:i=>!i.open&&n(),children:h.jsxs(Lt,{children:[h.jsx(nv,{}),h.jsx(ip,{children:h.jsxs(op,{children:[h.jsx(ov,{children:h.jsxs(UP,{children:["Delete ",e===1?"row":"rows"]})}),h.jsxs(iv,{display:"flex",flexDirection:"column",gap:3,children:[h.jsxs(Y,{children:["Are you sure you want to delete ",e," ",e===1?"row":"rows","?"]}),h.jsx(Y,{color:"fg.muted",fontSize:"sm",children:"Tip: Commit your changes first to preserve them in revision history."})]}),h.jsxs(HP,{children:[h.jsx(It,{variant:"outline",onClick:n,children:"Cancel"}),h.jsx(It,{colorPalette:"red",onClick:r,children:"Delete"})]})]})})]})}),ttt=_e(({model:t})=>{const{selection:e,isDeleting:r,allRowIds:n}=t,i=e.selectedCount,o=e.deleteCount,s=e.isAllSelected(n),a=E.useCallback(()=>{e.selectAll(n)},[e,n]),l=E.useCallback(()=>{e.openDeleteConfirmation()},[e]),c=E.useCallback(async()=>{const m=e.rowIdsToDelete,v=m.length,b=e.isSelectionMode;e.closeDeleteConfirmation(),await t.deleteRows(m)?(Ur.info({description:`${v} ${v===1?"row":"rows"} deleted`}),b&&e.exitSelectionMode()):Ur.error({description:"Failed to delete rows"})},[t,e]),u=E.useCallback(()=>{e.closeDeleteConfirmation()},[e]),p=E.useCallback(()=>{e.exitSelectionMode()},[e]);return h.jsxs(h.Fragment,{children:[h.jsx(b1e,{open:e.isSelectionMode,children:h.jsx(Lt,{children:h.jsx(O1e,{zIndex:"modal",children:h.jsxs(x1e,{children:[h.jsxs(S1e,{children:[i," selected"]}),h.jsx(w1e,{}),!s&&h.jsxs(It,{variant:"outline",size:"sm",onClick:a,children:[h.jsx(fee,{}),"Select all"]}),h.jsxs(It,{variant:"outline",size:"sm",onClick:l,loading:r,disabled:r||i===0,children:[h.jsx(w_,{}),"Delete"]}),h.jsx(C1e,{asChild:!0,children:h.jsx(It,{variant:"ghost",size:"sm",onClick:p,children:h.jsx(KO,{})})})]})})})}),h.jsx(ett,{isOpen:e.isConfirmDeleteOpen,count:o,onConfirm:c,onCancel:u})]})}),rtt=({style:t,...e})=>h.jsx("table",{...e,style:{...t,width:"max-content",minWidth:"100%",tableLayout:"fixed"}}),ntt=_e(({value:t,onSave:e,onCancel:r})=>{const[n,i]=E.useState(!0),o=E.useRef(null),s=E.useRef(null),a=E.useCallback(()=>{const u=o.current?.getBoundingClientRect();return u&&u.width>0&&(s.current=u),s.current},[]);E.useEffect(()=>{i(!0)},[]);const l=E.useCallback(u=>{i(!1),u!==t?e(u):r()},[t,e,r]),c=E.useCallback(()=>{i(!1),r()},[r]);return h.jsxs(h.Fragment,{children:[h.jsx(z,{ref:o,width:"100%",height:"100%",display:"flex",alignItems:"center",children:String(t)}),h.jsx(qo,{lazyMount:!0,unmountOnExit:!0,open:n,onOpenChange:({open:u})=>{u||c()},autoFocus:!0,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:a},children:h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsxs(Oo,{width:"80px",p:1,children:[h.jsx(dP,{onClick:()=>l(!0),children:"true"}),h.jsx(dP,{onClick:()=>l(!1),children:"false"})]})})})})]})}),itt=(t,e,r)=>{if(!t||!e)return;const n=t.firstChild;if(!n||n.nodeType!==Node.TEXT_NODE)return;if(document.caretRangeFromPoint){const c=document.caretRangeFromPoint(r,t.getBoundingClientRect().top+10);if(c?.startContainer===n)return c.startOffset}const i=document;if(i.caretPositionFromPoint){const c=i.caretPositionFromPoint(r,t.getBoundingClientRect().top+10);if(c?.offsetNode===n)return c.offset}const o=t.getBoundingClientRect(),s=r-o.left,l=t.scrollWidth/e.length;return Math.max(0,Math.min(e.length,Math.round(s/l)))},ott=t=>{if(!t)return;const e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}},stt={display:{cursor:"cell",_hover:{bg:"gray.50"}},focused:{cursor:"cell",outline:"2px solid",outlineColor:"blue.400",outlineOffset:"-2px",bg:"blue.50"},editing:{cursor:"text",outline:"2px solid",outlineColor:"blue.500",outlineOffset:"-2px",bg:"white",zIndex:1e3},saving:{cursor:"wait",opacity:.7,bg:"gray.50"},error:{cursor:"cell",outline:"2px solid",outlineColor:"red.400",outlineOffset:"-2px",bg:"red.50"},readonly:{cursor:"default",color:"gray.500"}},att=_e(({children:t,state:e,displayValue:r,tooltip:n,rowId:i,fieldName:o,onFocus:s,onDoubleClick:a})=>{const l=E.useRef(null),c=E.useRef(null),u=E.useCallback(()=>{e!=="editing"&&e!=="saving"&&s?.()},[e,s]),p=E.useCallback(O=>{O.detail===2&&e!=="saving"&&e!=="readonly"&&O.preventDefault()},[e]),m=E.useCallback(O=>{if(O.preventDefault(),e!=="saving"&&e!=="readonly"){const x=itt(c.current,r,O.clientX),S=ott(l.current);a?.(x,S)}},[e,a,r]),v=i&&o?`cell-${i}-${o}`:void 0;return h.jsx(z,{ref:l,as:"td",minHeight:"40px",height:"40px",borderRightWidth:"1px",borderColor:"gray.100",overflow:"hidden",maxWidth:"0",pl:"8px",pr:"8px",position:"relative",onClick:u,onMouseDown:p,onDoubleClick:m,tabIndex:e==="focused"||e==="editing"?0:-1,"data-testid":v,...stt[e],children:h.jsxs(z,{display:"flex",alignItems:"center",height:"100%",width:"100%",minWidth:0,children:[e==="editing"?t:h.jsx(Di,{content:n,disabled:!n,children:h.jsx(Y,{ref:c,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",color:e==="readonly"?"gray.500":"black",fontWeight:"300",flex:1,minWidth:0,children:t})}),e==="saving"&&h.jsx(z,{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",children:h.jsx(ri,{size:"xs",color:"blue.500"})})]})})}),ltt=_e(({store:t,isReadonly:e,onUpload:r})=>{const n=t.value.status?.getPlainValue()??"",i=t.value.fileId?.getPlainValue()??"",o=t.value.url?.getPlainValue()??"",s=t.value.mimeType?.getPlainValue()??"",a=t.value.width?.getPlainValue()??0,l=t.value.height?.getPlainValue()??0,c=s.startsWith("image/"),u=!!o,p=!e&&(n==="ready"||n==="uploaded"),m=E.useCallback(()=>{o&&window.open(o,"_blank","noopener,noreferrer")},[o]),v=E.useCallback(O=>{const x=O.target.files?.[0];x&&(r?.(i,x,t),O.target.value="")},[i,r,t]),b=`file-cell-${i}`;return!u&&!p?e?null:h.jsx(Di,{openDelay:50,closeDelay:50,positioning:{placement:"right"},content:"Save row first to upload file",children:h.jsx(z,{display:"flex",alignItems:"center",color:"gray.400",cursor:"default",children:h.jsx(Yg,{})})}):h.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"center",gap:1,role:"group",width:"100%",children:[u&&h.jsx(h.Fragment,{children:c?h.jsxs(QZ,{lazyMount:!0,unmountOnExit:!0,openDelay:350,closeDelay:100,positioning:{gutter:16},children:[h.jsx(BZ,{children:h.jsx(Ir,{"aria-label":"Preview file",size:"xs",variant:"ghost",color:"gray.500",_hover:{color:"gray.700",bg:"gray.100"},onClick:m,children:h.jsx(Yg,{})})}),h.jsx(Lt,{children:h.jsx(zZ,{children:h.jsxs(qZ,{children:[h.jsx(WZ,{children:h.jsx(dM,{})}),h.jsx(UZ,{aspectRatio:a>0&&l>0?a/l:1,width:"300px",src:o})]})})})]}):h.jsx(Ir,{"aria-label":"Open file",size:"xs",variant:"ghost",color:"gray.500",_hover:{color:"gray.700",bg:"gray.100"},onClick:m,children:h.jsx(Yg,{})})}),p&&h.jsxs(z,{opacity:0,_groupHover:{opacity:1},transition:"opacity 0.15s",children:[h.jsx("input",{type:"file",onChange:v,id:b,style:{display:"none"}}),h.jsx("label",{htmlFor:b,children:h.jsx(Ir,{as:"span","aria-label":"Upload file",size:"xs",variant:"ghost",color:u?"gray.400":"gray.500",_hover:{color:"gray.700",bg:"gray.100"},cursor:"pointer",children:h.jsx(jIe,{})})})]})]})}),ctt=_e(({value:t,revisionId:e,foreignTableId:r,rowId:n,onSave:i,onCancel:o})=>{const[s,a]=E.useState(!0),l=E.useRef(null),c=E.useRef(null),u=E.useCallback(()=>{const v=l.current?.getBoundingClientRect();return v&&v.width>0&&(c.current=v),c.current},[]);E.useEffect(()=>{a(!0)},[]);const p=E.useCallback(v=>{a(!1),v!==t?i(v):o()},[t,i,o]),m=E.useCallback(()=>{a(!1),o()},[o]);return h.jsxs(h.Fragment,{children:[h.jsx(z,{ref:l,width:"100%",height:"100%",display:"flex",alignItems:"center",children:t||h.jsx(z,{color:"gray.400",children:"Select..."})}),h.jsx(qo,{lazyMount:!0,unmountOnExit:!0,open:s,onOpenChange:({open:v})=>{v||m()},autoFocus:!1,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:u},children:h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{width:"320px",p:0,children:h.jsx(Mse,{revisionId:e,tableId:r,onChange:p,onClose:m,disableFooterActions:!0,rowLinkPath:n})})})})})]})}),p9=_e(({value:t,type:e,fileName:r,onClick:n})=>{const i=()=>{switch(e){case"file":return h.jsxs(z,{display:"flex",alignItems:"center",gap:1,color:"gray.600",children:[h.jsx(Yg,{}),h.jsx(Y,{truncate:!0,children:r||"File"})]});case"object":return"{...}";case"array":return"[...]";case"readonly":return h.jsx(Y,{truncate:!0,color:"gray.500",children:t});default:return t}},o=e!=="readonly"&&n;return h.jsx(z,{width:"100%",height:"100%",display:"flex",alignItems:"center",cursor:o?"pointer":"default",onClick:o?n:void 0,color:"gray.500",_hover:o?{color:"gray.700",textDecoration:"underline"}:void 0,children:i()})}),utt=t=>{const e=E.useRef(null),[r,n]=E.useState(t?{top:t.top,left:t.left,width:t.width}:null);return E.useLayoutEffect(()=>{const i=()=>{if(e.current){const o=e.current.closest("td");if(o){const s=o.getBoundingClientRect();n({top:s.top,left:s.left,width:s.width})}}};return t||i(),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[t]),{anchorRef:e,position:r}},dtt=3,f5=20,P0=40,g9=24,ule=(P0-f5)/2,htt=dtt*f5+ule*2,ftt=t=>{if(t===""||t==="-"||t===".")return!0;const e=Number(t);return!Number.isNaN(e)||t==="-."||t.endsWith(".")},m9=_e(({value:t,onSave:e,onCancel:r,onCommitAndMove:n,clickOffset:i,type:o="string",defaultValue:s=0,initialPosition:a,readOnly:l=!1})=>{const[c,u]=E.useState(t),p=E.useRef(!1),m=E.useRef(null),{anchorRef:v,position:b}=utt(a),O=E.useRef(!1);E.useLayoutEffect(()=>{if(m.current&&b&&!O.current&&(O.current=!0,m.current.focus(),!l)){const T=i!==void 0?Math.min(i,t.length):t.length;m.current.setSelectionRange(T,T)}},[i,t.length,b,l]);const x=E.useRef(!1);E.useLayoutEffect(()=>{if(m.current&&!x.current){x.current=!0,m.current.style.height=`${P0}px`;const T=m.current.scrollHeight;if(T>P0){const R=Math.min(T,htt);m.current.style.height=`${R}px`}}},[b]);const S=E.useCallback(T=>{const R=T.target.value;o==="number"&&!ftt(R)||u(R)},[o]),w=E.useCallback(()=>{if(!p.current)if(p.current=!0,o==="number"){const T=Number.parseFloat(c),R=Number.parseFloat(t);Number.isNaN(T)||c===""?s!==R?e(s):r():T!==R?e(T):r()}else{let T=c;for(;T.endsWith(`
|
|
1712
|
+
`);)T=T.slice(0,-1);T===t?r():e(T)}},[c,t,e,r,o,s]),k=E.useCallback(T=>{if(T.key==="Escape"){T.preventDefault(),p.current=!0,u(t),r();return}l||(T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),w(),n?.("down")),T.key==="Tab"&&(T.preventDefault(),w(),n?.(T.shiftKey?"prev":"next")))},[w,n,r,t,l]),P=E.useCallback(T=>{if(!T.relatedTarget?.closest("[data-close-button]")){if(l){r();return}w()}},[w,l,r]),_=l?"gray.400":"blue.500";return h.jsxs(h.Fragment,{children:[h.jsx("span",{ref:v,style:{position:"absolute",top:0,left:0}}),b&&h.jsx(Lt,{children:h.jsxs(z,{position:"fixed",top:`${b.top-(l?g9:0)}px`,left:`${b.left}px`,zIndex:9999,children:[l&&h.jsxs(z,{height:`${g9}px`,bg:"gray.100",px:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"12px",color:"gray.600",borderTopRadius:"4px",border:"1px solid",borderColor:"gray.300",borderBottom:"none",children:[h.jsx("span",{children:"View only"}),h.jsx(Ir,{"aria-label":"Close",size:"2xs",variant:"ghost",color:"gray.500",_hover:{color:"gray.700",bg:"gray.200"},onClick:r,minW:"16px",h:"16px","data-close-button":!0,children:h.jsx(KO,{})})]}),h.jsx(yM,{ref:m,value:c,onChange:S,onKeyDown:k,onBlur:P,readOnly:l,width:`${b.width}px`,minWidth:`${b.width}px`,height:`${P0}px`,minHeight:`${P0}px`,bg:"white",borderRadius:l?"0 0 4px 4px":"0",border:l?"1px solid":"none",borderColor:l?"gray.300":void 0,borderTop:l?"none":void 0,outline:l?"none":"2px solid",outlineColor:l?void 0:_,outlineOffset:l?void 0:"-2px",px:"8px",py:`${ule}px`,m:0,fontFamily:"inherit",fontSize:"16px",fontWeight:"300",lineHeight:`${f5}px`,resize:"both",overflow:"auto",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",cursor:l?"default":void 0,_focus:{outline:l?"none":"2px solid",outlineColor:l?void 0:_,outlineOffset:l?void 0:"-2px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}})]})})]})}),ptt=_e(({cellVM:t,fieldName:e,revisionId:r,onNavigateToRow:n,onFileUpload:i})=>{const o=E.useCallback(()=>{t.focus()},[t]),s=E.useCallback((p,m)=>{t.enterEditMode(p,m)},[t]),a=E.useCallback(async p=>{await t.save(e,p)},[t,e]),l=E.useCallback(()=>{t.cancelEdit()},[t]),c=E.useCallback(p=>{t.commitAndMove(p)},[t]),u=()=>{const{fieldType:p,isReadonly:m,isEditing:v,supportsViewMode:b,displayValue:O,foreignKey:x,stringValue:S,numberDefault:w,booleanValue:k,store:P,clickOffset:_,cellPosition:T}=t;if(p==="file"&&P instanceof hO)return h.jsx(ltt,{store:P,isReadonly:t.isRevisionReadonly,onUpload:i});if(p==="object"||p==="array")return h.jsx(p9,{value:O,type:p,onClick:n});if(v){if(p==="foreignKey"&&x)return h.jsx(ctt,{value:S,revisionId:r,foreignTableId:x,rowId:t.rowId,onSave:R=>a(R),onCancel:l});if(p==="string")return h.jsx(m9,{value:S,onSave:R=>a(R),onCancel:l,onCommitAndMove:m?void 0:c,clickOffset:_,initialPosition:T,readOnly:m});if(p==="number")return h.jsx(m9,{value:S,defaultValue:w,onSave:R=>a(R),onCancel:l,onCommitAndMove:m?void 0:c,clickOffset:_,initialPosition:T,type:"number",readOnly:m});if(p==="boolean")return h.jsx(ntt,{value:k,onSave:R=>a(R),onCancel:l})}return m&&!b?h.jsx(p9,{value:O,type:"readonly"}):O};return h.jsx(att,{state:t.cellState,displayValue:t.displayValue,tooltip:t.sizeTooltip,rowId:t.rowId,fieldName:e,onFocus:o,onDoubleClick:s,children:u()})}),gtt=/^[\d.-]$/;_e(({value:t,defaultValue:e,onSave:r,onCancel:n,onCommitAndMove:i,autoFocus:o=!0})=>{const[s,a]=E.useState(String(t)),l=E.useRef(!1),c=E.useCallback(v=>{a(v)},[]),u=E.useCallback(()=>{if(l.current)return;l.current=!0;const v=Number.parseFloat(s);Number.isNaN(v)?r(e):v!==t?r(v):n()},[s,t,e,r,n]),p=E.useCallback(()=>{u(),i?.("down")},[u,i]),m=E.useCallback(()=>{l.current=!0,a(String(t)),n()},[t,n]);return h.jsx(z,{width:"100%",minWidth:0,children:h.jsx(If,{initValue:s,onChange:c,onBlur:u,onEnter:p,onEscape:m,restrict:gtt,autoFocus:o})})});const mtt=({value:t,fieldType:e,rowId:r,fieldName:n})=>{const i=vtt(t,e),s=e===Ye.DateTime&&t!==null&&t!=="",a=r&&n?`cell-${r}-${n}`:void 0,l=h.jsx(z,{as:"td",minHeight:"40px",height:"40px",borderRightWidth:"1px",borderColor:"gray.100",overflow:"hidden",maxWidth:"0",pl:"8px",pr:"8px",position:"relative",cursor:"default",color:"gray.500","data-testid":a,children:h.jsx(z,{display:"flex",alignItems:"center",height:"100%",width:"100%",minWidth:0,children:h.jsx(Y,{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",fontWeight:"300",flex:1,minWidth:0,children:i})})});return s?h.jsx(Di,{content:t,positioning:{placement:"top"},children:l}):l};function vtt(t,e){return t===null||t===""?"—":e===Ye.DateTime?OL(t):t}const dle=_e(({row:t,columnsModel:e,revisionId:r,onFileUpload:n})=>{const i=Ba(),o=E.useCallback(()=>{i(t.id)},[i,t.id]);return h.jsx(h.Fragment,{children:e.columns.map(s=>{if(s.isSystemColumn&&s.systemFieldId){const l=t.getSystemFieldValue(s.systemFieldId);return h.jsx(mtt,{value:l,fieldType:s.fieldType,rowId:t.id,fieldName:s.name},s.id)}const a=t.getCellViewModel(s.id);return a?h.jsx(ptt,{cellVM:a,fieldName:s.name,revisionId:r,onNavigateToRow:o,onFileUpload:n},s.id):null})})}),ytt="_Row_5zyqz_1",btt="_Actions_5zyqz_1",nN={Row:ytt,Actions:btt},Ott=_e(({row:t,columnsModel:e,revisionId:r,tableId:n,onCopy:i,selection:o,showSelectionColumn:s})=>{const{open:a,setOpen:l}=MN(),c=E.useCallback(()=>{i?.(t.versionId)},[i,t.versionId]),u=E.useCallback(()=>{o?.requestSingleDelete(t.id)},[o,t.id]),p=E.useCallback(()=>{o?.enterSelectionMode(t.id)},[o,t.id]),m=E.useCallback(()=>{o?.toggle(t.id)},[o,t.id]),{upload:v}=uBe({revisionId:r,tableId:n,rowId:t.id}),b=o?.isSelected(t.id)??!1;return h.jsxs(z,{height:"40px",as:"tr",_hover:{"& td":{bg:"gray.50"}},bg:"white",className:`${nN.Row} group`,"data-testid":`row-${t.id}`,position:t.isRowEditing?"relative":void 0,zIndex:t.isRowEditing?100:void 0,children:[h.jsx(z,{as:"td",position:"sticky",left:0,zIndex:1,backgroundColor:"white",width:s?Dd:"0px",minWidth:s?Dd:"0px",maxWidth:s?Dd:"0px",pl:s?"8px":"0px",overflow:"hidden",transition:"width 0.15s, min-width 0.15s, max-width 0.15s, padding 0.15s",children:h.jsx(ee,{alignItems:"center",height:"100%",children:h.jsxs(z1e,{checked:b,onCheckedChange:m,children:[h.jsx(U1e,{}),h.jsx(W1e,{})]})})}),h.jsxs(z,{as:"td",position:"sticky",left:s?Dd:0,zIndex:1,backgroundColor:"white",maxWidth:"0",pl:"8px",pr:"24px",transition:"left 0.15s",children:[h.jsxs(ee,{alignItems:"center",children:[h.jsx(Y,{textDecoration:"underline",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:h.jsx(Ki,{to:`${t.id}`,"data-testid":`row-${t.id}-link`,children:t.id})}),t.showModifiedIndicator&&h.jsx(Y,{color:"gray.400",children:"*"})]}),h.jsx(z,{position:"absolute",right:0,top:0,bottom:0,width:"1px",bg:"gray.100"})]}),h.jsx(dle,{row:t,columnsModel:e,revisionId:r,onFileUpload:v}),h.jsx(z,{as:"td",width:"100%"}),t.showMenu&&h.jsx(z,{className:a?void 0:nN.Actions,as:"td",position:"sticky",right:0,zIndex:1,backgroundColor:"white",width:"40px",children:h.jsx(ee,{justifyContent:"flex-end",children:h.jsxs(Hn,{positioning:{placement:"bottom-start"},open:a,onOpenChange:O=>{l(O.open)},children:[h.jsx(to,{children:h.jsx(z,{paddingRight:"2px",children:h.jsx(yee,{dataTestId:`row-list-menu-${t.id}`})})}),h.jsx(Lt,{children:h.jsx(Gn,{children:h.jsxs(Xn,{children:[t.canDeleteRow&&h.jsxs(Kt,{color:"gray.600",value:"select","data-testid":`select-row-${t.id}`,onClick:p,children:[h.jsx(fee,{}),h.jsx(z,{flex:"1",children:"Select"})]}),t.canCreateRow&&h.jsxs(Kt,{color:"gray.600",value:"copy","data-testid":`copy-row-${t.id}`,onClick:c,children:[h.jsx(fD,{}),h.jsx(z,{flex:"1",children:"Duplicate"})]}),t.canDeleteRow&&h.jsxs(Kt,{color:"gray.600",value:"delete","data-testid":`remove-row-${t.id}`,onClick:u,children:[h.jsx(w_,{}),h.jsx(z,{flex:1,children:"Delete"})]})]})})})]})})})]})}),xtt=_e(({row:t,columnsModel:e,revisionId:r,onSelect:n})=>{const i=E.useCallback(()=>{n?.(t.id)},[n,t.id]);return h.jsxs(z,{height:"40px",as:"tr",_hover:{"& td":{bg:"gray.50"}},className:nN.Row,"data-testid":`row-${t.id}`,children:[h.jsxs(z,{as:"td",position:"sticky",left:0,backgroundColor:"white",width:"200px",minWidth:"200px",maxWidth:"200px",children:[h.jsxs(ee,{alignItems:"center",children:[h.jsx(Y,{textDecoration:"underline",cursor:"pointer",onClick:i,"data-testid":`row-${t.id}-select`,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:t.id}),t.showModifiedIndicator&&h.jsx(Y,{color:"gray.400",children:"*"})]}),h.jsx(z,{position:"absolute",right:0,top:0,bottom:0,width:"1px",bg:"gray.100"})]}),h.jsx(dle,{row:t,columnsModel:e,revisionId:r}),h.jsx(z,{as:"td",width:"100%"}),h.jsx(z,{as:"td"})]})}),wtt=_e(({"data-index":t})=>{const e=E.useContext(pP);if(!e)return null;const{model:r,revisionId:n,tableId:i,isRowPickerMode:o,onSelect:s,onCopy:a}=e,{items:l,columnsModel:c,selection:u,showSelectionColumn:p}=r,m=l[t];return m?o?h.jsx(xtt,{row:m,columnsModel:c,revisionId:n,onSelect:s}):h.jsx(Ott,{row:m,columnsModel:c,revisionId:n,tableId:i,onCopy:a,selection:u,showSelectionColumn:p}):null}),Stt=t=>{const e=t.getAttribute("contenteditable")==="true";return(t.tagName==="INPUT"||t.tagName==="TEXTAREA")&&!e},Ctt=(t,e)=>{switch(t.key){case"Escape":t.preventDefault(),e.cancelEdit();break;case"Tab":t.preventDefault(),t.shiftKey?e.commitAndMoveLeft():e.commitAndMoveRight();break}},ktt=(t,e)=>{switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault(),e.moveFocus(t.key.replace("Arrow","").toLowerCase());break;case"Tab":t.preventDefault(),t.shiftKey?e.moveFocusToPrev():e.moveFocusToNext();break;case"Enter":case"F2":t.preventDefault(),e.enterEditMode();break;case"Escape":t.preventDefault(),e.clearFocus();break;case"Delete":case"Backspace":break;default:t.key.length===1&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&e.enterEditMode()}},Ptt=({inlineEditModel:t,enabled:e=!0})=>{const r=E.useCallback(n=>{!e||!t.hasFocus||Stt(n.target)||(t.isEditing?Ctt(n,t):ktt(n,t))},[e,t]);E.useEffect(()=>{if(e)return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,r])},_tt={Table:rtt,TableRow:wtt},Ttt=_e(({model:t,revisionId:e,tableId:r,isRevisionReadonly:n=!1,onSelect:i,onCopy:o,onCreate:s})=>{const a=!!i,{items:l,columnsModel:c,inlineEdit:u,showHeader:p}=t;Ptt({inlineEditModel:u,enabled:!a});const m=E.useMemo(()=>({model:t,revisionId:e,tableId:r,isRevisionReadonly:n,isRowPickerMode:a,onSelect:i,onCopy:o}),[t,e,r,n,a,i,o]),v=E.useMemo(()=>p?()=>h.jsx(h9,{columnsModel:c}):void 0,[p,c]),b=E.useCallback(()=>t.isLoadingMore?h.jsx(z,{display:"flex",justifyContent:"center",alignItems:"center",py:"16px",children:h.jsx(ri,{size:"sm",color:"gray.400"})}):null,[t.isLoadingMore]),O=E.useMemo(()=>({..._tt,Footer:b}),[b]);return t.showLoading?h.jsx(z,{display:"flex",flexDirection:"column",height:"100%",children:h.jsx(z,{display:"flex",flex:1,justifyContent:"center",alignItems:"center",children:h.jsx(ri,{size:"lg",color:"gray.400"})})}):t.showError?h.jsx(z,{display:"flex",justifyContent:"center",alignItems:"center",height:"200px",children:h.jsx(Y,{color:"red.500",children:"Error loading rows"})}):t.showEmpty?h.jsx(z,{display:"flex",flexDirection:"column",height:"100%",children:h.jsx(f9,{model:t,onCreate:s})}):t.showNotFound?h.jsx(pP.Provider,{value:m,children:h.jsxs(z,{display:"flex",flexDirection:"column",height:"100%",children:[h.jsx(z,{overflowX:"auto",children:h.jsx("table",{style:{width:"max-content",minWidth:"100%",tableLayout:"fixed",borderCollapse:"collapse"},children:h.jsx(z,{as:"thead",position:"sticky",top:0,zIndex:2,bg:"white",children:h.jsx(h9,{columnsModel:c})})})}),h.jsx(f9,{model:t,onCreate:s})]})}):t.showList?h.jsxs(pP.Provider,{value:m,children:[h.jsx($9e,{style:{height:"100%"},totalCount:l.length,defaultItemHeight:40,increaseViewportBy:40*100,endReached:t.hasNextPage?t.tryToFetchNextPage:void 0,data:l,components:O,fixedHeaderContent:v}),h.jsx(ttt,{model:t})]}):null}),Ett=400,Rtt=32,v9=280,Bj="0.2s",Itt=_e(({value:t,onChange:e,onClear:r})=>{const[n,i]=E.useState(!1),o=E.useRef(null),s=E.useRef(null),a=t.length>0,l=E.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null)},[]),c=E.useCallback(x=>{e(x.target.value)},[e]),u=E.useCallback(()=>{l(),i(!0)},[l]),p=E.useCallback(()=>{l(),t||(s.current=setTimeout(()=>{i(!1)},Ett))},[l,t]),m=E.useCallback(()=>{l()},[l]),v=E.useCallback(x=>{x.key==="Escape"&&!t&&(l(),i(!1),o.current?.blur())},[l,t]),b=E.useCallback(()=>{r(),o.current?.focus()},[r]);E.useEffect(()=>{n&&o.current&&requestAnimationFrame(()=>{o.current?.focus()})},[n]),E.useEffect(()=>()=>l(),[l]);const O=a?`Search: "${t}"`:"Search rows";return h.jsxs(z,{position:"relative",display:"inline-flex",alignItems:"center",width:n?`${v9}px`:`${Rtt}px`,height:"32px",transition:`width ${Bj} ease-in-out`,children:[h.jsx(Di,{content:O,positioning:{placement:"top"},disabled:n,children:h.jsx(z,{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",opacity:n?0:1,pointerEvents:n?"none":"auto",transition:`opacity ${Bj} ease-in-out`,children:h.jsx(Ir,{"aria-label":"Search rows",size:"sm",variant:"ghost",colorPalette:"gray",color:"gray.300",onClick:u,children:h.jsx(qA,{})})})}),h.jsxs(z,{position:"absolute",left:0,top:0,display:"flex",alignItems:"center",width:`${v9}px`,height:"32px",opacity:n?1:0,pointerEvents:n?"auto":"none",transition:`opacity ${Bj} ease-in-out`,children:[h.jsx(z,{color:"gray.400",pl:"10px",flexShrink:0,children:h.jsx(qA,{size:14})}),h.jsx(hs,{ref:o,variant:"flushed",value:t,onChange:c,onFocus:m,onBlur:p,onKeyDown:v,_placeholder:{color:"gray.400"},placeholder:"Search...",size:"sm",pl:"8px",pr:a?"28px":"8px",tabIndex:n?0:-1}),a&&h.jsx(MZ,{position:"absolute",right:"0",color:"gray.400",size:"xs",onClick:b,onMouseDown:x=>x.preventDefault()})]})]})}),jtt=_e(({selectedField:t,dataFields:e,systemFields:r,onSelect:n})=>{const i=e.length>0,o=r.length>0;return h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"100px",children:[t&&h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",children:qd(t.fieldType)}),h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.700",truncate:!0,maxWidth:"120px",children:t?.name||"Select field"}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsxs(Xn,{minW:"180px",maxH:"300px",overflow:"auto",children:[i&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"Data fields"}),e.map(s=>h.jsx(Kt,{value:s.nodeId,onClick:()=>n(s),bg:t?.nodeId===s.nodeId?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",width:"24px",textAlign:"center",children:qd(s.fieldType)}),h.jsx(Y,{truncate:!0,children:s.name||"(unnamed)"})]})},s.nodeId))]}),o&&h.jsxs(bu,{children:[h.jsx(Hd,{fontWeight:"medium",color:"gray.500",fontSize:"xs",children:"System fields"}),r.map(s=>h.jsx(Kt,{value:s.nodeId,onClick:()=>n(s),bg:t?.nodeId===s.nodeId?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",width:"24px",textAlign:"center",children:qd(s.fieldType)}),h.jsx(Y,{truncate:!0,children:s.name||"(unnamed)"})]})},s.nodeId))]})]})})]})}),$tt=_e(({filterModel:t,condition:e,testId:r})=>{const n=t.allFields.find(u=>u.name===e.field),i=Lg(e.operator,e.fieldType),o=t.getErrorForCondition(e.id),s=u=>{t.updateCondition(e.id,{field:u.name,fieldPath:u.path,fieldType:u.fieldType,isSystemField:u.isSystemField,systemFieldId:u.systemFieldId})},a=u=>{t.updateCondition(e.id,{operator:u})},l=u=>{t.updateCondition(e.id,{value:u})},c=()=>t.removeCondition(e.id);return h.jsxs(z,{"data-testid":r,children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,py:1,children:[h.jsx(jtt,{selectedField:n,dataFields:t.availableFields,systemFields:t.systemFields,onSelect:s}),h.jsx(ile,{selectedOperator:e.operator,fieldType:e.fieldType,onSelect:a}),i&&h.jsx(ole,{value:e.value,fieldType:e.fieldType,error:!!o,onChange:l}),h.jsx(Ir,{"aria-label":"Remove filter",size:"xs",variant:"ghost",color:"newGray.400",_hover:{bg:"newGray.100",color:"newGray.600"},onClick:c,children:h.jsx(fT,{})})]}),o&&h.jsx(Y,{fontSize:"xs",color:"red.500",ml:2,children:o})]})}),y9=({logic:t,onChange:e})=>h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"inline-flex",alignItems:"center",gap:1,px:2,py:.5,borderRadius:"md",bg:"newGray.100",color:"newGray.700",fontWeight:"medium",fontSize:"sm",_hover:{bg:"newGray.200"},cursor:"pointer",children:[t==="and"?"All":"Any",h.jsx(yx,{size:12})]})}),h.jsx(Gn,{children:h.jsxs(Xn,{minW:"100px",children:[h.jsx(Kt,{value:"and",onClick:()=>e("and"),children:h.jsx(Y,{children:"All (AND)"})}),h.jsx(Kt,{value:"or",onClick:()=>e("or"),children:h.jsx(Y,{children:"Any (OR)"})})]})})]}),hle=_e(({filterModel:t,group:e,isRoot:r=!1})=>{const n=l=>{t.setGroupLogic(e.id,l)},i=()=>t.addCondition(e.id),o=()=>t.addGroup(e.id),s=()=>t.removeGroup(e.id),a=e.conditions.length>0||e.groups.length>0;return h.jsxs(z,{borderWidth:r?0:1,borderColor:"newGray.100",borderRadius:"md",p:r?0:3,bg:r?"transparent":"newGray.25",position:"relative",children:[!r&&h.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2,children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"Match"}),h.jsx(y9,{logic:e.logic,onChange:n}),h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"of the following"})]}),h.jsxs(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:s,children:[h.jsx(fT,{}),"Remove group"]})]}),r&&a&&h.jsxs(z,{display:"flex",alignItems:"center",gap:2,mb:2,children:[h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"Where"}),h.jsx(y9,{logic:e.logic,onChange:n}),h.jsx(Y,{fontSize:"sm",color:"newGray.500",children:"of the following are true"})]}),e.conditions.map((l,c)=>h.jsx($tt,{filterModel:t,condition:l,testId:r?`filter-condition-${c}`:void 0},l.id)),e.groups.map(l=>h.jsx(z,{mt:2,children:h.jsx(hle,{filterModel:t,group:l})},l.id)),h.jsxs(z,{display:"flex",gap:2,mt:2,children:[h.jsxs(It,{size:"xs",variant:"ghost",onClick:i,disabled:t.availableFields.length===0,"data-testid":r?"filter-add-condition":void 0,children:[h.jsx(zA,{}),"Add condition"]}),r&&h.jsxs(It,{size:"xs",variant:"ghost",onClick:o,disabled:t.availableFields.length===0,"data-testid":"filter-add-group",children:[h.jsx(zA,{}),"Add group"]})]})]})}),Att=_e(({filterModel:t,anchorRef:e})=>{const r=E.useRef(null),n=E.useCallback(()=>{const l=e.current?.getBoundingClientRect();return l&&l.width>0&&(r.current=l),r.current},[e]),i=()=>{t.apply()&&t.closeFilterBar()},o=({open:l})=>{l?t.openFilterBar():t.closeFilterBar()},s=t.hasAppliedFilters||t.hasPendingChanges,a=t.hasPendingChanges?"orange":"gray";return h.jsxs(qo,{open:t.isFilterBarOpen,onOpenChange:o,lazyMount:!0,unmountOnExit:!0,autoFocus:!1,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:n},children:[h.jsx(Di,{content:t.tooltipContent,positioning:{placement:"top"},disabled:t.isFilterBarOpen,children:h.jsxs(z,{position:"relative",display:"inline-flex",children:[h.jsx(Pl,{asChild:!0,children:h.jsx(Ir,{"aria-label":"Toggle filters",size:"sm",variant:t.isFilterBarOpen?"subtle":"ghost",colorPalette:"gray",color:t.hasAppliedFilters?void 0:"gray.300","data-testid":"filter-button",children:h.jsx(Vm,{})})}),s&&h.jsx(au,{position:"absolute",top:"-1",right:"-1",colorPalette:a,variant:"solid",size:"xs",borderRadius:"full",minWidth:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px","data-testid":"filter-badge","data-badge-color":a,children:t.filterCount})]})}),h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{width:e.current?.offsetWidth?`${e.current.offsetWidth}px`:"auto",p:0,borderRadius:"md",boxShadow:"lg",children:h.jsxs(z,{borderWidth:1,borderColor:"newGray.100",borderRadius:"md",p:3,bg:"white",children:[h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(z,{color:"newGray.400",children:h.jsx(Vm,{size:14})}),h.jsx(z,{as:"span",fontWeight:"medium",fontSize:"sm",color:"newGray.600",children:"Filters"}),t.filterCount>0&&h.jsx(au,{colorPalette:"gray",size:"sm",variant:"subtle",children:t.filterCount}),t.hasPendingChanges&&h.jsx(au,{colorPalette:"orange",size:"sm",variant:"subtle",children:"unsaved"})]}),h.jsxs(z,{display:"flex",gap:2,children:[t.hasFilters&&h.jsx(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:t.reset,"data-testid":"filter-clear-all",children:"Clear all"}),h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",onClick:i,disabled:!t.hasPendingChanges,"data-testid":"filter-apply",children:"Apply"})]})]}),h.jsx(hle,{filterModel:t,group:t.rootGroup,isRoot:!0})]})})})})]})}),zj=[{value:"asc",label:"A → Z",icon:Nse},{value:"desc",label:"Z → A",icon:Ase}],Ntt=_e(({selectedDirection:t,onSelect:e})=>{const r=zj.find(i=>i.value===t)||zj[0],n=r.icon;return h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"80px",children:[h.jsx(z,{color:"blue.500",children:h.jsx(n,{size:14})}),h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.700",children:r.label}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsx(Xn,{minW:"120px",children:zj.map(i=>{const o=i.icon;return h.jsx(Kt,{value:i.value,onClick:()=>e(i.value),bg:t===i.value?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(z,{color:"blue.500",children:h.jsx(o,{size:14})}),h.jsx(Y,{children:i.label})]})},i.value)})})})]})}),Mtt=_e(({selectedField:t,availableFields:e,onSelect:r})=>h.jsxs(Hn,{positioning:{placement:"bottom-start"},children:[h.jsx(to,{asChild:!0,children:h.jsxs(z,{as:"button",display:"flex",alignItems:"center",gap:1,px:2,py:1,borderRadius:"md",bg:"newGray.100",_hover:{bg:"newGray.200"},cursor:"pointer",minWidth:"100px",children:[t&&h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",children:qd(t.fieldType)}),h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.700",truncate:!0,maxWidth:"120px",children:t?.name||"Select field"}),h.jsx(z,{color:"newGray.400",children:h.jsx(yx,{size:14})})]})}),h.jsx(Gn,{children:h.jsx(Xn,{minW:"180px",maxH:"300px",overflow:"auto",children:e.map(n=>h.jsx(Kt,{value:n.nodeId,onClick:()=>r(n),bg:t?.nodeId===n.nodeId?"newGray.100":void 0,children:h.jsxs(z,{display:"flex",alignItems:"center",gap:2,width:"100%",children:[h.jsx(z,{fontSize:"xs",fontFamily:"mono",color:"newGray.400",width:"24px",textAlign:"center",children:qd(n.fieldType)}),h.jsx(Y,{truncate:!0,children:n.name||"(unnamed)"})]})},n.nodeId))})})]})),Dtt=_e(({sort:t,index:e,availableFields:r,onFieldChange:n,onDirectionChange:i,onRemove:o})=>{const s=r.find(u=>u.nodeId===t.id),a=u=>{u.nodeId!==t.id&&n(t.id,u.nodeId)},l=u=>{i(t.id,u)},c=()=>o(t.id);return h.jsxs(z,{display:"flex",alignItems:"center",gap:2,py:1,"data-testid":`sort-condition-${e}`,children:[h.jsxs(Y,{fontSize:"xs",color:"gray.400",fontWeight:"medium",minW:"16px",children:[e+1,"."]}),h.jsx(Mtt,{selectedField:s,availableFields:r,onSelect:a}),h.jsx(Ntt,{selectedDirection:t.direction,onSelect:l}),h.jsx(Ir,{"aria-label":"Remove sort",size:"xs",variant:"ghost",color:"newGray.400",_hover:{bg:"newGray.100",color:"newGray.600"},onClick:c,children:h.jsx(fT,{})})]})}),Ltt=_e(({sortModel:t,anchorRef:e})=>{const r=E.useRef(null),n=E.useCallback(()=>{const v=e.current?.getBoundingClientRect();return v&&v.width>0&&(r.current=v),r.current},[e]),i=()=>{t.apply(),t.close()},o=()=>{t.reset(),t.close()},s=({open:v})=>{v?t.open():t.close()},a=E.useCallback(()=>{const v=t.fieldsNotInSort;v.length>0&&t.addSort(v[0].nodeId)},[t]),l=E.useCallback((v,b)=>{t.replaceField(v,b)},[t]),c=E.useCallback((v,b)=>{t.setSort(v,b)},[t]),u=E.useCallback(v=>{t.removeSort(v)},[t]),p=t.hasAppliedSorts||t.hasPendingChanges,m=t.hasPendingChanges?"orange":"gray";return h.jsxs(qo,{open:t.isOpen,onOpenChange:s,lazyMount:!0,unmountOnExit:!0,autoFocus:!1,closeOnInteractOutside:!0,modal:!1,positioning:{placement:"bottom-start",getAnchorRect:n},children:[h.jsx(Di,{content:t.tooltipContent,positioning:{placement:"top"},disabled:t.isOpen,children:h.jsxs(z,{position:"relative",display:"inline-flex",children:[h.jsx(Pl,{asChild:!0,children:h.jsx(Ir,{"aria-label":"Toggle sorting",size:"sm",variant:t.isOpen?"subtle":"ghost",colorPalette:"gray",color:t.hasAppliedSorts?void 0:"gray.300","data-testid":"sort-button",children:h.jsx(kW,{})})}),p&&h.jsx(au,{position:"absolute",top:"-1",right:"-1",colorPalette:m,variant:"solid",size:"xs",borderRadius:"full",minWidth:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px","data-testid":"sort-badge","data-badge-color":m,children:t.sortCount})]})}),h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{width:e.current?.offsetWidth?`${e.current.offsetWidth}px`:"auto",minW:"350px",p:0,borderRadius:"md",boxShadow:"lg",children:h.jsxs(z,{borderWidth:1,borderColor:"newGray.100",borderRadius:"md",p:3,bg:"white",children:[h.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[h.jsxs(z,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(z,{color:"newGray.400",children:h.jsx(kW,{size:14})}),h.jsx(z,{as:"span",fontWeight:"medium",fontSize:"sm",color:"newGray.600",children:"Sort"}),t.sortCount>0&&h.jsx(au,{colorPalette:"gray",size:"sm",variant:"subtle",children:t.sortCount}),t.hasPendingChanges&&h.jsx(au,{colorPalette:"orange",size:"sm",variant:"subtle",children:"unsaved"})]}),h.jsxs(z,{display:"flex",gap:2,children:[t.hasSorts&&h.jsx(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:o,"data-testid":"sort-clear-all",children:"Clear all"}),h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",onClick:i,disabled:!t.hasPendingChanges,"data-testid":"sort-apply",children:"Apply"})]})]}),h.jsx(z,{children:t.sorts.map((v,b)=>h.jsx(Dtt,{sort:v,index:b,availableFields:t.availableFields,onFieldChange:l,onDirectionChange:c,onRemove:u},v.id))}),t.canAddSort&&h.jsxs(It,{size:"xs",variant:"ghost",colorPalette:"gray",onClick:a,mt:t.hasSorts?1:0,"data-testid":"sort-add",children:[h.jsx(zA,{size:14}),h.jsx(Y,{ml:1,children:"Add sort"})]}),!t.hasSorts&&!t.canAddSort&&h.jsx(Y,{fontSize:"sm",color:"gray.400",textAlign:"center",py:2,children:"No sortable fields available"})]})})})})]})});class Vtt{_state="loading";_items=[];_hasNextPage=!1;_endCursor=null;_totalCount=0;_isInitialLoad=!0;constructor(){Be(this,{},{autoBind:!0})}get state(){return this._state}get items(){return this._items}get hasNextPage(){return this._hasNextPage}get endCursor(){return this._endCursor}get totalCount(){return this._totalCount}get isInitialLoad(){return this._isInitialLoad}get showLoading(){return this._state==="loading"&&this._isInitialLoad}get showEmpty(){return this._state==="empty"}get showNotFound(){return this._state==="notFound"}get showList(){return this._state==="list"}get showError(){return this._state==="error"}setLoading(){this._state="loading"}setError(){this._isInitialLoad=!1,this._state="error"}setItems(e,r){this._isInitialLoad=!1,this._items=e,this._hasNextPage=r.hasNextPage,this._endCursor=r.endCursor,this._totalCount=r.totalCount,e.length>0?this._state="list":r.isSearching?this._state="notFound":this._state="empty"}appendItems(e,r){this._items=[...this._items,...e],this._hasNextPage=r.hasNextPage,this._endCursor=r.endCursor}removeItem(e){const r=this._items.length;this._items=this._items.filter(i=>!e(i));const n=r-this._items.length;this._totalCount=Math.max(0,this._totalCount-n)}updateStateAfterRemove(e){this._items.length===0&&(this._state=e?"notFound":"empty")}reset(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._isInitialLoad=!1,this._state="loading"}resetToLoading(){this._items=[],this._hasNextPage=!1,this._endCursor=null,this._totalCount=0,this._isInitialLoad=!0,this._state="loading"}}class Ftt{constructor(e,r){this.debounceMs=e,this.onSearch=r,Be(this,{},{autoBind:!0})}_query="";_timeout=null;get query(){return this._query}get isSearching(){return this._query.length>0}setQuery(e){this._query=e,this.scheduleSearch()}clear(){this._query="",this.cancelScheduled(),this.onSearch()}reset(){this._query="",this.cancelScheduled()}dispose(){this.cancelScheduled()}scheduleSearch(){this.cancelScheduled(),this._timeout=setTimeout(()=>{this.onSearch()},this.debounceMs)}cancelScheduled(){this._timeout&&(clearTimeout(this._timeout),this._timeout=null)}}const p5=(t,e,r)=>t.type===ke.Object?Qtt(t,e,r):t.type===ke.Array?ztt(t,e,r):Wtt(t,e,r),Qtt=(t,e,r)=>{const n=Btt(t,e,r);return new hO(t,e,n)},Btt=(t,e,r)=>Object.entries(r).reduce((n,[i,o])=>{const s=t.getProperty(i);if(s===void 0||o===void 0)throw new Error("Invalid item");return n[i]=p5(s,e,o),n},{}),ztt=(t,e,r)=>{const n=qtt(t,e,r);return new sP(t,e,n)},qtt=(t,e,r)=>r.map(n=>p5(t.items,e,n)),Wtt=(t,e,r)=>{if(t.type===ke.String)return new iu(t,e,r);if(t.type===ke.Number)return new tu(t,e,r);if(t.type===ke.Boolean)return new hf(t,e,r);throw new Error("this type is not allowed")};function fle(t,e,r){const n=[];for(const[i,o]of Object.entries(ase.properties)){const s=[...r,i],a=`${e}.${i}`,l=`${t}:${i}`;let c=null;"type"in o&&(o.type===ke.String?c=Ye.String:o.type===ke.Number&&(c=Ye.Number)),n.push({nodeId:l,name:a,path:s,fieldType:c})}return n}function Utt(t){const e=[],r=new Set;return iN(t,[],e,r),{fields:e,usedSystemFieldIds:r}}function iN(t,e,r,n){if(t.type===ke.Object&&!t.name){const l=Object.values(t.properties);for(const c of l)iN(c,e,r,n);return}const o=(t.$ref?Kae(t.$ref):void 0)?.id;o&&n.add(o);const s=t.name?[...e,t.name]:e,a=tle(t);if(t.type===ke.String||t.type===ke.Number||t.type===ke.Boolean){const l=s.length>1?s.join("."):t.name;r.push({nodeId:t.nodeId,name:l,path:s,fieldType:a,schemaStore:t,isSystemField:o!==void 0,systemFieldId:o})}else if(t.type===ke.Object)if(t.$ref){const l=s.length>1?s.join("."):t.name,c=t.$ref===Ft.File,u={nodeId:t.nodeId,name:l,path:s,fieldType:a,schemaStore:t,isSystemField:o!==void 0,systemFieldId:o,isFileObject:c};c&&(u.children=Htt(t.nodeId,l,s)),r.push(u)}else{const l=Object.values(t.properties);for(const c of l)iN(c,s,r,n)}}function Htt(t,e,r){return fle(t,e,r).map(n=>({...n,isFileNestedField:!0,parentFieldName:e}))}const Gtt=t=>t.type===ke.Number||t.type===ke.Boolean?120:t.type===ke.String?200:t.$ref===Ft.File?80:120,Xtt=[/^title$/i,/^name$/i,/^label$/i,/^description$/i,/^text$/i,/^content$/i,/^summary$/i,/^body$/i,/^message$/i,/^subject$/i,/^caption$/i,/^headline$/i],Ztt=t=>Xtt.some(e=>e.test(t)),oN=(t,e,r,n)=>{if(!r)if(t.type===ke.Object){if(t.$ref===Ft.File){n.push({nodeId:t.nodeId,priority:1,depth:e,schema:t});return}if(t.$ref)return;Object.values(t.properties).forEach(i=>{oN(i,e+1,!1,n)})}else t.type===ke.Array?oN(t.items,e+1,!0,n):t.type===ke.String?t.foreignKey?n.push({nodeId:t.nodeId,priority:4,depth:e,schema:t}):Ztt(t.name)?n.push({nodeId:t.nodeId,priority:2,depth:e,schema:t}):n.push({nodeId:t.nodeId,priority:3,depth:e,schema:t}):(t.type===ke.Number||t.type===ke.Boolean)&&n.push({nodeId:t.nodeId,priority:3,depth:e,schema:t})},Ytt=(t,e=3)=>{const r=[];oN(t,0,!1,r),r.sort((o,s)=>o.priority!==s.priority?o.priority-s.priority:o.depth-s.depth);const n=[];let i=0;for(const o of r){if(n.length>=e)break;if(o.priority===1){if(i>=1)continue;i++}n.push(o.schema)}return n},b9={[Ye.File]:1,[Ye.String]:2,[Ye.Number]:3,[Ye.Boolean]:4,[Ye.ForeignKey]:5,[Ye.DateTime]:6};function Ktt(t){return[...t].sort((e,r)=>{const n=e.path.length-r.path.length;if(n!==0)return n;const i=e.fieldType!==null?b9[e.fieldType]:5,o=r.fieldType!==null?b9[r.fieldType]:5,s=i-o;return s!==0?s:e.name.localeCompare(r.name)})}function Jtt(t){if(t===0)return"0 B";const e=["B","KB","MB","GB","TB"],r=1024,n=Math.floor(Math.log(t)/Math.log(r));return`${(t/Math.pow(r,n)).toFixed(n===0?0:1)} ${e[n]}`}class ert{constructor(e,r,n,i,o){this._rowId=e,this._columnId=r,this._store=n,this._inlineEditModel=i,this._isRevisionReadonly=o,Be(this,{},{autoBind:!0})}get rowId(){return this._rowId}get columnId(){return this._columnId}get store(){return this._store}get isRevisionReadonly(){return this._isRevisionReadonly}get fieldType(){return this._store instanceof iu?this._store.foreignKey?"foreignKey":"string":this._store instanceof tu?"number":this._store instanceof hf?"boolean":this._store instanceof hO?this._store.$ref===Ft.File?"file":"object":this._store instanceof sP?"array":"string"}get isReadonly(){return!!(this._isRevisionReadonly||this._store instanceof iu&&this._store.readOnly||this._store instanceof tu&&this._store.readOnly||this._store instanceof hf&&this._store.readOnly||this.fieldType==="file"||this.fieldType==="object"||this.fieldType==="array")}get supportsViewMode(){return this._isRevisionReadonly?this.fieldType==="string"||this.fieldType==="number":!1}get isFileSizeField(){return this._columnId.endsWith(":size")}get sizeTooltip(){if(this.isFileSizeField&&this._store instanceof tu){const e=this._store.value;return e===null?void 0:`${e.toLocaleString()} bytes`}}get rawValue(){return this._store instanceof tu?this._store.value:this._store instanceof iu?this._store.value:this._store instanceof hf?this._store.getPlainValue():null}get displayValue(){if(this._store instanceof iu)return this._store.value;if(this._store instanceof tu){const e=this._store.value;return e===null?"":this.isFileSizeField?Jtt(e):String(e)}return this._store instanceof hf?String(this._store.getPlainValue()):this._store instanceof hO?"{...}":this._store instanceof sP?"[...]":""}get isFocused(){return this._inlineEditModel.isFocused(this._rowId,this._columnId)}get isEditing(){return this._inlineEditModel.isCellEditing(this._rowId,this._columnId)}get isSaving(){return this._inlineEditModel.isSaving(this._rowId,this._columnId)}get error(){return this._inlineEditModel.getError(this._rowId,this._columnId)}get cellState(){return this.isReadonly&&!this.supportsViewMode?"readonly":this.error?"error":this.isSaving?"saving":this.isEditing?"editing":this.isFocused?"focused":"display"}get foreignKey(){if(this._store instanceof iu)return this._store.foreignKey}get numberDefault(){return this._store instanceof tu?this._store.schema.default??0:0}get stringValue(){return this._store instanceof iu?this._store.value:this._store instanceof tu?String(this._store.value??this.numberDefault):""}get booleanValue(){return this._store instanceof hf?this._store.getPlainValue():!1}get clickOffset(){return this._inlineEditModel.clickOffset}get cellPosition(){return this._inlineEditModel.cellPosition}focus(){this._inlineEditModel.focusCell(this._rowId,this._columnId)}enterEditMode(e,r){this.isReadonly&&!this.supportsViewMode||(this._inlineEditModel.focusCell(this._rowId,this._columnId),this._inlineEditModel.enterEditMode(e,r))}async save(e,r){return this._inlineEditModel.exitEditMode(!0),this._inlineEditModel.saveCell(this._rowId,this._columnId,e,r)}cancelEdit(){this._inlineEditModel.exitEditMode(!1)}commitAndMove(e){switch(e){case"down":this._inlineEditModel.commitAndMoveDown();break;case"next":this._inlineEditModel.commitAndMoveRight();break;case"prev":this._inlineEditModel.commitAndMoveLeft();break}}}class trt{constructor(e){this.params=e,Be(this,{_cellViewModels:!1},{autoBind:!0})}_cellViewModels=new Map;getCellViewModel(e){const r=this.params.cellsMap.get(e);if(!r)return;let n=this._cellViewModels.get(e);return n||(n=new ert(this.id,e,r,this.params.inlineEditModel,!this.params.isEdit),this._cellViewModels.set(e,n)),n}getSystemFieldValue(e){switch(e){case fr.Id:return this.params.item.id;case fr.CreatedAt:return this.params.item.createdAt;case fr.UpdatedAt:return this.params.item.updatedAt;case fr.PublishedAt:return this.params.item.publishedAt;case fr.VersionId:return this.params.item.versionId;case fr.CreatedId:return this.params.item.createdId;default:return null}}get id(){return this.params.item.id}get versionId(){return this.params.item.versionId}get readonly(){return this.params.item.readonly}get cellsMap(){return this.params.cellsMap}get isEdit(){return this.params.isEdit}get canCreateRow(){return this.params.isEdit&&this.params.permissionContext.canCreateRow}get canDeleteRow(){return this.params.isEdit&&this.params.permissionContext.canDeleteRow}get showMenu(){return this.canCreateRow||this.canDeleteRow}get showModifiedIndicator(){return!this.readonly&&this.params.isEdit}get isRowEditing(){return this.params.inlineEditModel.isRowEditing(this.id)}async delete(){return this.params.onDelete(this.id)}}const rrt=3;function nrt(){return qet.map(t=>{const e=Jae(t);return{nodeId:t,name:e.name,path:[],fieldType:e.fieldType,isSystemField:!0,systemFieldId:t,isSystemColumn:!0}})}const irt=nrt();class ort{_visibleColumnIds=[];_availableFields=[];_availableFieldsMap=new Map;_availableSystemFields=[];_schemaStore=null;_rowCache=new Map;_columnCache=new Map;_columnWidths=jt.map();_idColumnWidth=Qj;_onColumnsChange=null;constructor(){Be(this,{_rowCache:!1,_columnCache:!1,_columnWidths:!1,_availableFieldsMap:!1},{autoBind:!0})}get _visibleColumnIdsSet(){return new Set(this._visibleColumnIds)}get columns(){return this._visibleColumnIds.map(e=>this._availableFieldsMap.get(e)).filter(e=>!!e).map(e=>this.getOrCreateColumn(e))}getOrCreateColumn(e){const r=this._columnCache.get(e.nodeId);if(r)return r;const n={id:e.nodeId,name:e.name,title:e.name,fieldType:e.fieldType,isSystemField:e.isSystemField,systemFieldId:e.systemFieldId,isSystemColumn:e.isSystemColumn,isFileObject:e.isFileObject};return this._columnCache.set(e.nodeId,n),n}get showHeader(){return this._availableFields.length>0}get availableFieldsToAdd(){const e=this._availableFields.filter(r=>{if(r.isFileObject&&r.children){const n=!this._visibleColumnIdsSet.has(r.nodeId),i=r.children.some(o=>!this._visibleColumnIdsSet.has(o.nodeId));return n||i}return!this._visibleColumnIdsSet.has(r.nodeId)});return Ktt(e)}get availableSystemFieldsToAdd(){return this._availableSystemFields.filter(e=>!this._visibleColumnIdsSet.has(e.nodeId))}get hasHiddenColumns(){return this.availableFieldsToAdd.length>0||this.availableSystemFieldsToAdd.length>0}getAvailableFileChildren(e){return e.children?e.children.filter(r=>!this._visibleColumnIdsSet.has(r.nodeId)):[]}isFileFieldFullyVisible(e){if(!e.isFileObject)return this._visibleColumnIdsSet.has(e.nodeId);const r=this._visibleColumnIdsSet.has(e.nodeId),n=e.children?.every(i=>this._visibleColumnIdsSet.has(i.nodeId))??!0;return r&&n}get canRemoveColumn(){return this._visibleColumnIds.length>0}get visibleColumnIds(){return this._visibleColumnIds}setOnColumnsChange(e){this._onColumnsChange=e}notifyColumnsChange(){this._onColumnsChange&&this._onColumnsChange()}get allAvailableFields(){return this._availableFields}get sortableFields(){const e=Jae(fr.Id),r={nodeId:fr.Id,name:e.name,path:[],fieldType:e.fieldType,isSystemField:!0,systemFieldId:fr.Id},n=[];for(const o of this._availableFields)if(o.isFileObject&&o.children)for(const s of o.children)s.fieldType!==null&&n.push({nodeId:s.nodeId,name:s.name,path:s.path,fieldType:s.fieldType,isSystemField:s.isSystemField,systemFieldId:s.systemFieldId});else o.fieldType!==null&&n.push({nodeId:o.nodeId,name:o.name,path:o.path,fieldType:o.fieldType,isSystemField:o.isSystemField,systemFieldId:o.systemFieldId});const i=this._availableSystemFields.filter(o=>o.fieldType!==null).map(o=>({nodeId:o.nodeId,name:o.name,path:o.path,fieldType:o.fieldType,isSystemField:o.isSystemField,systemFieldId:o.systemFieldId}));return[r,...n,...i]}isColumnVisible(e){return this._visibleColumnIdsSet.has(e)}getColumnByNodeId(e){const r=this._availableFields.find(n=>n.nodeId===e);if(r)return this.getOrCreateColumn(r)}init(e,r){this._schemaStore=mu(e),this._rowCache.clear(),this._columnCache.clear(),this._columnWidths.clear(),this._availableFieldsMap.clear(),this._idColumnWidth=Qj;const{fields:n,usedSystemFieldIds:i}=Utt(this._schemaStore);this._availableFields=n;for(const o of this._availableFields)if(this._availableFieldsMap.set(o.nodeId,o),o.children)for(const s of o.children)this._availableFieldsMap.set(s.nodeId,s);this._availableSystemFields=irt.filter(o=>!o.systemFieldId||!i.has(o.systemFieldId));for(const o of this._availableSystemFields)this._availableFieldsMap.set(o.nodeId,o);if(r?.showAllColumns)this._visibleColumnIds=this._availableFields.map(o=>o.nodeId);else{const o=Ytt(this._schemaStore,rrt);this._visibleColumnIds=o.map(s=>s.nodeId)}}addColumn(e){this._visibleColumnIdsSet.has(e)||(this._visibleColumnIds.push(e),this.notifyColumnsChange())}insertColumnBefore(e,r){if(this._visibleColumnIdsSet.has(r))return;const n=this._visibleColumnIds.indexOf(e);n!==-1&&(this._visibleColumnIds.splice(n,0,r),this.notifyColumnsChange())}insertColumnAfter(e,r){if(this._visibleColumnIdsSet.has(r))return;const n=this._visibleColumnIds.indexOf(e);n!==-1&&(this._visibleColumnIds.splice(n+1,0,r),this.notifyColumnsChange())}removeColumn(e){this.canRemoveColumn&&(this._visibleColumnIds=this._visibleColumnIds.filter(r=>r!==e),this.notifyColumnsChange())}addAll(){this._visibleColumnIds=this._availableFields.map(e=>e.nodeId),this.notifyColumnsChange()}hideAll(){this._visibleColumnIds=[],this.notifyColumnsChange()}get canHideAll(){return this._visibleColumnIds.length>0}reorderColumns(e,r){const n=[...this._visibleColumnIds],[i]=n.splice(e,1);n.splice(r,0,i),this._visibleColumnIds=n,this.notifyColumnsChange()}getColumnIndex(e){return this._visibleColumnIds.indexOf(e)}canMoveLeft(e){return this.getColumnIndex(e)>0}canMoveRight(e){const r=this.getColumnIndex(e);return r>=0&&r<this._visibleColumnIds.length-1}canMoveToStart(e){return this.getColumnIndex(e)>1}canMoveToEnd(e){const r=this.getColumnIndex(e);return r>=0&&r<this._visibleColumnIds.length-2}moveColumnLeft(e){const r=this.getColumnIndex(e);r>0&&this.reorderColumns(r,r-1)}moveColumnRight(e){const r=this.getColumnIndex(e);r>=0&&r<this._visibleColumnIds.length-1&&this.reorderColumns(r,r+1)}moveColumnToStart(e){const r=this.getColumnIndex(e);r>0&&this.reorderColumns(r,0)}moveColumnToEnd(e){const r=this.getColumnIndex(e);r>=0&&r<this._visibleColumnIds.length-1&&this.reorderColumns(r,this._visibleColumnIds.length-1)}setColumnWidth(e,r){const n=Math.max(Dg,r);this._columnWidths.set(e,n),this.notifyColumnsChange()}get idColumnWidth(){return this._idColumnWidth}setIdColumnWidth(e){this._idColumnWidth=Math.max(Dg,e),this.notifyColumnsChange()}getColumnWidth(e){const r=this._columnWidths.get(e);if(r!==void 0)return r;const n=this._availableFieldsMap.get(e);return n?.schemaStore?Gtt(n.schemaStore):200}createRowViewModels(e,r){const n=this._schemaStore;if(!n)return[];const i=new Set(e.map(o=>o.id));return this.cleanupStaleCache(i),e.map(o=>{const s=this.getOrCreateCachedRowData(n,o);return new trt({item:o,cellsMap:s.cells,isEdit:r.isEdit,permissionContext:r.permissionContext,inlineEditModel:r.inlineEditModel,onDelete:r.onDelete})})}getVisibleCells(e){return this._visibleColumnIds.map(r=>e.get(r)).filter(r=>r!==void 0)}cleanupStaleCache(e){for(const r of this._rowCache.keys())e.has(r)||this._rowCache.delete(r)}getOrCreateCachedRowData(e,r){const n=this._rowCache.get(r.id);if(n&&n.versionId===r.versionId)return n;const i=p5(e,r.id,r.data??{}),o=new Map;Dm(i,a=>{if(o.set(a.schema.nodeId,a),a.type===ke.Object&&a.$ref===Ft.File)for(const[l,c]of Object.entries(a.value)){const u=`${a.schema.nodeId}:${l}`;o.set(u,c)}});const s={versionId:r.versionId,rootValue:i,cells:o};return this._rowCache.set(r.id,s),s}restoreFromView(e){if(!e||!e.columns)return;const r=e.columns.map(i=>this.fieldToColumnId(i.field)).filter(i=>this._availableFieldsMap.has(i));this._visibleColumnIds=r,this._columnWidths.clear();for(const i of e.columns)if(i.width!=null){const o=this.fieldToColumnId(i.field);this._availableFieldsMap.has(o)&&this._columnWidths.set(o,Math.max(Dg,i.width))}const n=e.columns.find(i=>i.field==="id");n?.width!=null&&(this._idColumnWidth=Math.max(Dg,n.width))}serializeToViewColumns(){const e=[],r={field:"id"};this._idColumnWidth!==Qj&&(r.width=this._idColumnWidth),e.push(r);for(const n of this._visibleColumnIds)if(this._availableFieldsMap.get(n)){const o=this._columnWidths.get(n),s={field:this.columnIdToField(n)};o!==void 0&&(s.width=o),e.push(s)}return e}fieldToColumnId(e){if(!e.startsWith("data."))return e;const r=e.slice(5);for(const[n,i]of this._availableFieldsMap.entries())if(i.name===r)return n;return e}columnIdToField(e){const r=this._availableFieldsMap.get(e);return r?r.systemFieldId&&Yae.has(r.systemFieldId)?r.systemFieldId:`data.${r.name}`:e}}function srt(t){const e=[],r=new Set;return sN(t,[],e,r),e.sort((n,i)=>{const o=n.path.length-i.path.length;if(o!==0)return o;const s={[Ye.String]:1,[Ye.Boolean]:2,[Ye.Number]:3,[Ye.ForeignKey]:4,[Ye.DateTime]:5},a=(s[n.fieldType]??6)-(s[i.fieldType]??6);return a!==0?a:n.name.localeCompare(i.name)}),{dataFields:e,usedSystemFieldIds:r}}function sN(t,e,r,n){if(t.type===ke.Object&&!t.name){const a=Object.values(t.properties);for(const l of a)sN(l,e,r,n);return}const i=t.$ref?Kae(t.$ref):void 0;if(i){n.add(i.id);const a=t.name?[...e,t.name]:e,l=a.length>1?a.join("."):t.name;r.push({nodeId:t.nodeId,name:l,path:a,fieldType:i.fieldType,schemaStore:t,isSystemField:!0,systemFieldId:i.id});return}const o=t.name?[...e,t.name]:e;if(t.type===ke.Object&&t.$ref===Ft.File){const a=o.length>1?o.join("."):t.name;art(t.nodeId,a,o,r);return}const s=tle(t);if(s!==null){const a=o.length>1?o.join("."):t.name;r.push({nodeId:t.nodeId,name:a,path:o,fieldType:s,schemaStore:t})}if(t.type===ke.Object&&!t.$ref){const a=Object.values(t.properties);for(const l of a)sN(l,o,r,n)}}function art(t,e,r,n){for(const i of fle(t,e,r))i.fieldType!==null&&n.push({nodeId:i.nodeId,name:i.name,path:i.path,fieldType:i.fieldType})}function lrt(t){return ple(t)}const crt={[fr.Id]:"id",[fr.CreatedAt]:"createdAt",[fr.UpdatedAt]:"updatedAt",[fr.PublishedAt]:"publishedAt",[fr.VersionId]:"versionId",[fr.CreatedId]:"createdId"};function ple(t){const e=[];for(const r of t.conditions){const n=urt(r);n&&e.push(n)}for(const r of t.groups){const n=ple(r);n&&e.push(n)}if(e.length!==0)return e.length===1?e[0]:t.logic==="and"?{AND:e}:{OR:e}}function urt(t){const{fieldPath:e,fieldType:r,operator:n,value:i,isSystemField:o,systemFieldId:s}=t;if(o&&s)return drt(s,r,n,i);switch(n){case en.Equals:return ns(e,{equals:gP(i,r)});case en.NotEquals:return{NOT:[ns(e,{equals:gP(i,r)})]};case en.Contains:return ns(e,{string_contains:String(i)});case en.NotContains:return{NOT:[ns(e,{string_contains:String(i)})]};case en.StartsWith:return ns(e,{string_starts_with:String(i)});case en.EndsWith:return ns(e,{string_ends_with:String(i)});case en.IsEmpty:return ns(e,{equals:""});case en.IsNotEmpty:return{NOT:[ns(e,{equals:""})]};case en.Gt:return ns(e,{gt:r===Ye.Number?Number(i):String(i)});case en.Gte:return ns(e,{gte:r===Ye.Number?Number(i):String(i)});case en.Lt:return ns(e,{lt:r===Ye.Number?Number(i):String(i)});case en.Lte:return ns(e,{lte:r===Ye.Number?Number(i):String(i)});case en.IsTrue:return ns(e,{equals:!0});case en.IsFalse:return ns(e,{equals:!1});default:return}}function drt(t,e,r,n){const i=crt[t];if(!i)return;const o=hrt(e,r,n);if(o)return{[i]:o}}function hrt(t,e,r){switch(e){case en.Equals:return{equals:gP(r,t)};case en.NotEquals:return{not:gP(r,t)};case en.Contains:return{contains:String(r)};case en.NotContains:return{not:{contains:String(r)}};case en.StartsWith:return{startsWith:String(r)};case en.EndsWith:return{endsWith:String(r)};case en.IsEmpty:return{equals:""};case en.IsNotEmpty:return{not:""};case en.Gt:return{gt:t===Ye.Number?Number(r):String(r)};case en.Gte:return{gte:t===Ye.Number?Number(r):String(r)};case en.Lt:return{lt:t===Ye.Number?Number(r):String(r)};case en.Lte:return{lte:t===Ye.Number?Number(r):String(r)};default:return}}function ns(t,e){return{data:{path:t,...e}}}function gP(t,e){if(t===null)return null;switch(e){case Ye.Number:return Number(t);case Ye.Boolean:return!!t;default:return String(t)}}class frt{_rootGroup=ag("and");_availableFields=[];_systemFields=[];_isFilterBarOpen=!1;_onFilterChange=null;_appliedFilterSnapshot="";_appliedGroup=null;_hasPendingChanges=!1;_showValidationErrors=!1;_validationErrors=jt.map();constructor(){Be(this,{},{autoBind:!0})}get rootGroup(){return this._rootGroup}get availableFields(){return this._availableFields}get systemFields(){return this._systemFields}get allFields(){return[...this._availableFields,...this._systemFields]}getFilterableFieldForColumn(e,r,n){return r&&n?this._systemFields.find(i=>i.systemFieldId===n)||this._availableFields.find(i=>i.systemFieldId===n):this._availableFields.find(i=>i.name===e)}get isFilterBarOpen(){return this._isFilterBarOpen}get filterCount(){return this.countFilters(this._rootGroup)}get hasFilters(){return this.filterCount>0}get hasPendingChanges(){return this._hasPendingChanges}get hasAppliedFilters(){return this._appliedGroup?this._appliedGroup.conditions.length>0||this._appliedGroup.groups.length>0:!1}get tooltipContent(){return this.hasAppliedFilters?`Filters: ${this.filterCount} active`:"Filter"}get showValidationErrors(){return this._showValidationErrors}getErrorForCondition(e){if(this._showValidationErrors)return this._validationErrors.get(e)}setOnFilterChange(e){this._onFilterChange=e}init(e){const r=mu(e),{dataFields:n,usedSystemFieldIds:i}=srt(r);this._availableFields=n,this._systemFields=h5.filter(o=>!i.has(o.id)).map(o=>({nodeId:o.id,name:o.name,path:[],fieldType:o.fieldType,isSystemField:!0,systemFieldId:o.id})),this._rootGroup=ag("and"),this._isFilterBarOpen=!1,this._appliedFilterSnapshot=this.getEmptySnapshot(),this._appliedGroup=null,this._hasPendingChanges=!1,this._showValidationErrors=!1,this._validationErrors.clear()}dispose(){this._availableFields=[],this._rootGroup=ag("and"),this._isFilterBarOpen=!1,this._appliedFilterSnapshot="",this._appliedGroup=null,this._hasPendingChanges=!1}reset(){this._rootGroup=ag("and"),this._isFilterBarOpen=!1,this._hasPendingChanges=!1,this._appliedFilterSnapshot=this.getEmptySnapshot(),this._appliedGroup=null,this._showValidationErrors=!1,this._validationErrors.clear(),this.notifyFilterChange()}apply(){return this._validationErrors.clear(),this.validateGroup(this._rootGroup,this._validationErrors),this._validationErrors.size>0?(this._showValidationErrors=!0,!1):(this._showValidationErrors=!1,this._appliedFilterSnapshot=this.getCurrentSnapshot(),this._appliedGroup=JSON.parse(this._appliedFilterSnapshot),this._hasPendingChanges=!1,this.notifyFilterChange(),!0)}getConditionError(e){const r=new Map;return this.validateGroup(this._rootGroup,r),r.get(e)}validateGroup(e,r){for(const n of e.conditions){const i=this.validateCondition(n);i&&r.set(n.id,i)}for(const n of e.groups)this.validateGroup(n,r)}validateCondition(e){if(Lg(e.operator,e.fieldType)){if(e.value===""||e.value===null||e.value===void 0)return"Value is required";if(e.fieldType===Ye.Number&&isNaN(Number(e.value)))return"Invalid number"}return null}openFilterBar(){this._isFilterBarOpen=!0}closeFilterBar(){this._isFilterBarOpen=!1}toggleFilterBar(){this._isFilterBarOpen=!this._isFilterBarOpen}addCondition(e,r){const n=r??this._availableFields[0];if(!n)return;const i=u9(n),o=this.findGroup(this._rootGroup,e);o&&(o.conditions.push(i),this.markAsPending())}addQuickFilter(e,r,n){if(Lg(r,e.fieldType)&&(n===""||n===null))return!1;this.addCondition(this._rootGroup.id,e);const i=this._rootGroup.conditions,o=i[i.length-1];return o&&this.updateCondition(o.id,{operator:r,value:Lg(r,e.fieldType)?n:null}),this.apply(),!0}updateCondition(e,r){const n=this.findConditionWithParent(this._rootGroup,e);if(!n)return;const{condition:i}=n,o=i.fieldType;Object.assign(i,r),r.fieldType&&r.fieldType!==o&&(i.operator=fP(r.fieldType),i.value=this.getDefaultValue(r.fieldType)),r.operator&&!Lg(r.operator,i.fieldType)&&(i.value=null),this.markAsPending()}getDefaultValue(e){switch(e){case Ye.Boolean:return!0;case Ye.Number:return 0;default:return""}}removeCondition(e){this.removeConditionFromGroup(this._rootGroup,e)&&this.markAsPending()}addGroup(e){const r=this.findGroup(this._rootGroup,e);if(!r)return;const n=ag("and");this._availableFields.length>0&&n.conditions.push(u9(this._availableFields[0])),r.groups.push(n),this.markAsPending()}removeGroup(e){if(e===this._rootGroup.id)return;this.removeGroupFromParent(this._rootGroup,e)&&this.markAsPending()}setGroupLogic(e,r){const n=this.findGroup(this._rootGroup,e);n&&(n.logic=r,this.markAsPending())}toGraphQLWhere(){if(this._appliedGroup)return lrt(this._appliedGroup)}countFilters(e){let r=e.conditions.length;for(const n of e.groups)r+=this.countFilters(n);return r}findGroup(e,r){if(e.id===r)return e;for(const n of e.groups){const i=this.findGroup(n,r);if(i)return i}return null}findConditionWithParent(e,r){const n=e.conditions.find(i=>i.id===r);if(n)return{condition:n,parent:e};for(const i of e.groups){const o=this.findConditionWithParent(i,r);if(o)return o}return null}removeConditionFromGroup(e,r){const n=e.conditions.findIndex(i=>i.id===r);if(n!==-1)return e.conditions.splice(n,1),!0;for(const i of e.groups)if(this.removeConditionFromGroup(i,r))return!0;return!1}removeGroupFromParent(e,r){const n=e.groups.findIndex(i=>i.id===r);if(n!==-1)return e.groups.splice(n,1),!0;for(const i of e.groups)if(this.removeGroupFromParent(i,r))return!0;return!1}markAsPending(){const e=this.getCurrentSnapshot();this._hasPendingChanges=e!==this._appliedFilterSnapshot}getCurrentSnapshot(){return JSON.stringify(this._rootGroup)}getEmptySnapshot(){return JSON.stringify(ag("and"))}notifyFilterChange(){this._onFilterChange&&this._onFilterChange()}}const prt=1e3,o0=(t,e)=>`${t}:${e}`,O9=t=>"getPlainValue"in t&&"updateBaseValue"in t;class grt{_savingCells=jt.map();_savingTimers=new Map;_errorCells=jt.map();patchRowRequest=Hr.of(xr.PatchRowInline);isSaving(e,r){return this._savingCells.get(o0(e,r))===!0}getError(e,r){return this._errorCells.get(o0(e,r))}hasError(e,r){return this._errorCells.has(o0(e,r))}clearError(e,r){this._errorCells.delete(o0(e,r))}dispose(){this._savingCells.clear(),this._errorCells.clear();for(const e of this._savingTimers.values())clearTimeout(e);this._savingTimers.clear()}async save(e,r,n,i,o,s,a){const l=o0(r,n),c=this.applyOptimisticUpdate(s,o);this.startSavingIndicator(l),this._errorCells.delete(l);try{const u=await this.callApi(e,r,i,o);return u.isRight?(vt(()=>{this._errorCells.delete(l),a?.()}),!0):(u.error instanceof Qk||this.handleError(l,s,c,"Failed to save"),!1)}catch(u){const p=u instanceof Error?u.message:"Unknown error";return this.handleError(l,s,c,p),!1}finally{this.stopSavingIndicator(l)}}applyOptimisticUpdate(e,r){if(!e||!O9(e))return;const n=e.getPlainValue();return e.updateBaseValue(r),n}rollbackOptimisticUpdate(e,r){!e||!O9(e)||r===void 0||e.updateBaseValue(r)}startSavingIndicator(e){const r=this._savingTimers.get(e);r&&clearTimeout(r);const n=setTimeout(()=>{vt(()=>{this._savingCells.set(e,!0)})},prt);this._savingTimers.set(e,n)}stopSavingIndicator(e){const r=this._savingTimers.get(e);r&&(clearTimeout(r),this._savingTimers.delete(e)),vt(()=>{this._savingCells.delete(e)})}async callApi(e,r,n,i){return this.patchRowRequest.fetch({data:{revisionId:e.revisionId,tableId:e.tableId,rowId:r,patches:[{op:hie.Replace,path:n,value:i}]}})}handleError(e,r,n,i){vt(()=>{this.rollbackOptimisticUpdate(r,n),this._errorCells.set(e,i)})}}class mrt{_focusedCell=null;_editingCell=null;_clickOffset=void 0;_cellPosition=void 0;_context=null;_saveService=new grt;constructor(){Be(this,{},{autoBind:!0})}init(e){this._context=e}dispose(){this._focusedCell=null,this._editingCell=null,this._saveService.dispose(),this._context=null}get focusedCell(){return this._focusedCell}get editingCell(){return this._editingCell}get isEditing(){return this._editingCell!==null}get clickOffset(){return this._clickOffset}get cellPosition(){return this._cellPosition}get hasFocus(){return this._focusedCell!==null}get canChangeFocus(){return this._editingCell===null}isFocused(e,r){return this._focusedCell?.rowId===e&&this._focusedCell?.field===r}isCellEditing(e,r){return this._editingCell?.rowId===e&&this._editingCell?.field===r}isRowEditing(e){return this._editingCell?.rowId===e}isSaving(e,r){return this._saveService.isSaving(e,r)}getError(e,r){return this._saveService.getError(e,r)}hasError(e,r){return this._saveService.hasError(e,r)}clearError(e,r){this._saveService.clearError(e,r)}focusCell(e,r){this.canChangeFocus&&(this._focusedCell={rowId:e,field:r})}clearFocus(){this.canChangeFocus&&(this._focusedCell=null)}moveFocus(e){if(!this._focusedCell||!this._context||!this.canChangeFocus)return;const{newRowIndex:r,newFieldIndex:n}=this.calculateNewPosition(e);if(r===-1||n===-1)return;const i=this._context.getVisibleFields(),o=this._context.getVisibleRowIds();this._focusedCell={rowId:o[r],field:i[n]}}moveFocusToNext(){if(!this._focusedCell||!this._context)return;const e=this._context.getVisibleFields(),r=this._context.getVisibleRowIds(),n=e.indexOf(this._focusedCell.field),i=r.indexOf(this._focusedCell.rowId);if(n===-1||i===-1)return;let o=n+1,s=i;o>=e.length&&(o=0,s=i+1),s>=r.length&&(s=r.length-1,o=e.length-1),this._focusedCell={rowId:r[s],field:e[o]}}moveFocusToPrev(){if(!this._focusedCell||!this._context)return;const e=this._context.getVisibleFields(),r=this._context.getVisibleRowIds(),n=e.indexOf(this._focusedCell.field),i=r.indexOf(this._focusedCell.rowId);if(n===-1||i===-1)return;let o=n-1,s=i;o<0&&(o=e.length-1,s=i-1),s<0&&(s=0,o=0),this._focusedCell={rowId:r[s],field:e[o]}}enterEditMode(e,r){!this._focusedCell||!this._context||(this._editingCell={...this._focusedCell},this._clickOffset=e,this._cellPosition=r)}exitEditMode(e=!0){!e&&this._focusedCell&&this._saveService.clearError(this._focusedCell.rowId,this._focusedCell.field),this._editingCell=null,this._clickOffset=void 0,this._cellPosition=void 0}commitAndMoveDown(){this.exitEditMode(!0),this.moveFocus("down")}commitAndMoveRight(){this.exitEditMode(!0),this.moveFocusToNext()}commitAndMoveLeft(){this.exitEditMode(!0),this.moveFocusToPrev()}cancelEdit(){this.exitEditMode(!1)}async saveCell(e,r,n,i){if(!this._context)return!1;const o=this._context.getCellStore(e,r),s=this._context;return this._saveService.save({revisionId:s.revisionId,tableId:s.tableId},e,r,n,i,o,()=>s.onCellUpdated?.(e,r,i))}calculateNewPosition(e){if(!this._focusedCell||!this._context)return{newRowIndex:-1,newFieldIndex:-1};const r=this._context.getVisibleFields(),n=this._context.getVisibleRowIds(),i=r.indexOf(this._focusedCell.field),o=n.indexOf(this._focusedCell.rowId);if(i===-1||o===-1)return{newRowIndex:-1,newFieldIndex:-1};let s=i,a=o;switch(e){case"left":s=Math.max(0,i-1);break;case"right":s=Math.min(r.length-1,i+1);break;case"up":a=Math.max(0,o-1);break;case"down":a=Math.min(n.length-1,o+1);break}return{newRowIndex:a,newFieldIndex:s}}}class vrt{_selectedRowIds=jt.map();_isSelectionMode=!1;_isConfirmDeleteOpen=!1;_pendingDeleteRowId=null;constructor(){Be(this,{},{autoBind:!0})}get isConfirmDeleteOpen(){return this._isConfirmDeleteOpen}get deleteCount(){return this._pendingDeleteRowId?1:this._selectedRowIds.size}get rowIdsToDelete(){return this._pendingDeleteRowId?[this._pendingDeleteRowId]:Array.from(this._selectedRowIds.keys())}requestSingleDelete(e){this._pendingDeleteRowId=e,this._isConfirmDeleteOpen=!0}openDeleteConfirmation(){this._isConfirmDeleteOpen=!0}closeDeleteConfirmation(){this._isConfirmDeleteOpen=!1,this._pendingDeleteRowId=null}get isSelectionMode(){return this._isSelectionMode}get selectedRowIds(){return Array.from(this._selectedRowIds.keys())}get selectedCount(){return this._selectedRowIds.size}get hasSelection(){return this._selectedRowIds.size>0}enterSelectionMode(e){this._isSelectionMode=!0,e&&this._selectedRowIds.set(e,!0)}exitSelectionMode(){this._isSelectionMode=!1,this._selectedRowIds.clear()}isSelected(e){return this._selectedRowIds.get(e)===!0}toggle(e){this._selectedRowIds.has(e)?this._selectedRowIds.delete(e):this._selectedRowIds.set(e,!0)}select(e){this._selectedRowIds.set(e,!0)}deselect(e){this._selectedRowIds.delete(e)}selectAll(e){for(const r of e)this._selectedRowIds.set(r,!0)}deselectAll(){this._selectedRowIds.clear()}toggleAll(e){e.every(n=>this._selectedRowIds.has(n))?this.deselectAll():this.selectAll(e)}isAllSelected(e){return e.length===0?!1:e.every(r=>this._selectedRowIds.has(r))}isSomeSelected(e){if(e.length===0)return!1;const r=e.filter(n=>this._selectedRowIds.has(n)).length;return r>0&&r<e.length}removeDeletedRows(e){for(const r of e)this._selectedRowIds.delete(r)}}class yrt{_sorts=[];_availableFields=[];_onSortChange=null;_isOpen=!1;_appliedSortSnapshot="[]";_appliedSorts=[];_hasPendingChanges=!1;constructor(){Be(this,{},{autoBind:!0})}get sorts(){return this._sorts}get sortCount(){return this._sorts.length}get hasSorts(){return this._sorts.length>0}get availableFields(){return this._availableFields}get isOpen(){return this._isOpen}get hasPendingChanges(){return this._hasPendingChanges}get hasAppliedSorts(){return this._appliedSorts.length>0}get tooltipContent(){return this.hasAppliedSorts?`Sort: ${this.sortCount} active`:"Sort"}setOnSortChange(e){this._onSortChange=e}init(e){this._availableFields=this.sortFieldsByPriority(e),this._sorts=[],this._isOpen=!1,this._appliedSortSnapshot="[]",this._appliedSorts=[],this._hasPendingChanges=!1}sortFieldsByPriority(e){const r={[Ye.String]:1,[Ye.Boolean]:2,[Ye.Number]:3,[Ye.ForeignKey]:4,[Ye.File]:5,[Ye.DateTime]:6};return[...e].sort((n,i)=>{const o=n.path.length-i.path.length;if(o!==0)return o;const s=r[n.fieldType]-r[i.fieldType];return s!==0?s:n.name.localeCompare(i.name)})}dispose(){this._availableFields=[],this._sorts=[],this._isOpen=!1,this._appliedSortSnapshot="[]",this._appliedSorts=[],this._hasPendingChanges=!1}open(){this._isOpen=!0}close(){this._isOpen=!1}toggle(){this._isOpen=!this._isOpen}getSortForField(e){return this._sorts.find(r=>r.id===e)}getSortIndex(e){const r=this._sorts.findIndex(n=>n.id===e);return r>=0?r+1:void 0}isSorted(e){return this._sorts.some(r=>r.id===e)}getSortDirection(e){return this.getSortForField(e)?.direction}setSort(e,r){const n=this._availableFields.find(o=>o.nodeId===e);if(!n)return;const i=this._sorts.findIndex(o=>o.id===e);i>=0?this._sorts[i].direction=r:this._sorts.push({id:e,field:n.name,fieldPath:n.path,fieldType:n.fieldType,direction:r,isSystemField:n.isSystemField,systemFieldId:n.systemFieldId}),this.markAsPending()}removeSort(e){const r=this._sorts.findIndex(n=>n.id===e);r>=0&&(this._sorts.splice(r,1),this.markAsPending())}replaceField(e,r){const n=this._availableFields.find(s=>s.nodeId===r);if(!n)return;const i=this._sorts.findIndex(s=>s.id===e);if(i<0)return;this._sorts.some(s=>s.id===r)?this._sorts.splice(i,1):this._sorts[i]={id:r,field:n.name,fieldPath:n.path,fieldType:n.fieldType,direction:this._sorts[i].direction,isSystemField:n.isSystemField,systemFieldId:n.systemFieldId},this.markAsPending()}addSort(e){this.isSorted(e)||this.setSort(e,"asc")}setSortAndApply(e,r){this.setSort(e,r),this.apply()}removeSortAndApply(e){this.removeSort(e),this.apply()}get fieldsNotInSort(){const e=new Set(this._sorts.map(r=>r.id));return this._availableFields.filter(r=>!e.has(r.nodeId))}get canAddSort(){return this.fieldsNotInSort.length>0}clearAll(){this._sorts.length>0&&(this._sorts=[],this.markAsPending())}apply(){this._appliedSortSnapshot=JSON.stringify(this._sorts),this._appliedSorts=JSON.parse(this._appliedSortSnapshot),this._hasPendingChanges=!1,this.notifySortChange()}reset(){this._sorts=[],this._appliedSortSnapshot="[]",this._appliedSorts=[],this._hasPendingChanges=!1,this.notifySortChange()}toGraphQLOrderBy(){if(this._appliedSorts.length!==0)return this._appliedSorts.map(e=>e.isSystemField&&e.systemFieldId?this.buildSystemFieldOrderBy(e):{field:nf.Data,path:this.buildSortPath(e),direction:e.direction==="asc"?wd.Asc:wd.Desc,type:this.mapFieldTypeToOrderDataType(e.fieldType)})}buildSystemFieldOrderBy(e){const r=e.direction==="asc"?wd.Asc:wd.Desc;switch(e.systemFieldId){case fr.Id:return{field:nf.Id,direction:r};case fr.CreatedAt:return{field:nf.CreatedAt,direction:r};case fr.UpdatedAt:return{field:nf.UpdatedAt,direction:r};case fr.PublishedAt:return{field:nf.PublishedAt,direction:r};default:return{field:nf.Data,path:e.field,direction:r,type:this.mapFieldTypeToOrderDataType(e.fieldType)}}}buildSortPath(e){const r=e.fieldPath.length>0?e.fieldPath.join("."):e.field;return e.fieldType===Ye.File?r?`${r}.fileName`:"fileName":r}mapFieldTypeToOrderDataType(e){switch(e){case Ye.String:case Ye.ForeignKey:case Ye.File:case Ye.DateTime:return xC.Text;case Ye.Number:return xC.Float;case Ye.Boolean:return xC.Boolean}}markAsPending(){const e=JSON.stringify(this._sorts);this._hasPendingChanges=e!==this._appliedSortSnapshot}notifySortChange(){this._onSortChange&&this._onSortChange()}restoreFromView(e){if(!e||!e.sorts||e.sorts.length===0)return;const r=[];for(const n of e.sorts){const i=this.findFieldByViewField(n.field);i&&r.push({id:i.nodeId,field:i.name,fieldPath:i.path,fieldType:i.fieldType,direction:n.direction,isSystemField:i.isSystemField,systemFieldId:i.systemFieldId})}r.length>0&&(this._sorts=r,this._appliedSortSnapshot=JSON.stringify(this._sorts),this._appliedSorts=JSON.parse(this._appliedSortSnapshot),this._hasPendingChanges=!1)}serializeToViewSorts(){return this._appliedSorts.map(e=>({field:this.sortConfigToViewField(e),direction:e.direction==="asc"?wd.Asc:wd.Desc}))}findFieldByViewField(e){if(!e.startsWith("data."))return this._availableFields.find(n=>n.isSystemField&&n.systemFieldId===e);const r=e.slice(5);return this._availableFields.find(n=>n.name===r)}sortConfigToViewField(e){return e.isSystemField&&e.systemFieldId&&Yae.has(e.systemFieldId)?e.systemFieldId:`data.${e.field}`}}const brt=_e(({model:t})=>{if(!t.isVisible)return null;const e={variant:"subtle",size:"sm",cursor:"pointer",display:"flex",alignItems:"center",gap:1,_hover:{opacity:.8}},r={p:0,borderRadius:"md",boxShadow:"lg",maxWidth:"280px"};return h.jsxs(qo,{open:t.isOpen,onOpenChange:n=>t.setOpen(n.open),lazyMount:!0,unmountOnExit:!0,children:[h.jsx(Di,{content:t.tooltipText,positioning:{placement:"top"},disabled:t.isOpen,children:h.jsx(Pl,{asChild:!0,children:h.jsxs(au,{colorPalette:t.badgeColor,...e,"data-testid":"view-settings-badge","data-badge-color":t.badgeColor,children:[h.jsx(z,{as:"span",width:"6px",height:"6px",borderRadius:"full",bg:t.dotColor}),t.badgeText]})})}),h.jsx(Lt,{children:h.jsx(Wo,{children:h.jsx(Oo,{...r,children:h.jsxs(z,{borderWidth:1,borderColor:"newGray.100",borderRadius:"md",p:3,bg:"white",children:[h.jsxs(z,{display:"flex",alignItems:"flex-start",gap:2,mb:3,children:[h.jsx(z,{color:"newGray.400",mt:"2px",children:h.jsx(LZe,{size:16})}),h.jsxs(z,{children:[h.jsx(Y,{fontSize:"sm",fontWeight:"medium",color:"newGray.600",children:t.title}),h.jsx(Y,{fontSize:"xs",color:"newGray.500",mt:1,children:t.description})]})]}),h.jsxs(z,{display:"flex",gap:2,justifyContent:"flex-end",children:[h.jsxs(It,{size:"xs",variant:"ghost",colorPalette:"gray",focusRing:"none",onClick:t.revert,disabled:t.isRevertDisabled,"data-testid":"view-settings-revert",children:[h.jsx(FZe,{size:14}),t.revertButtonText]}),t.showSaveButton&&h.jsx(It,{size:"xs",variant:"subtle",colorPalette:"gray",focusRing:"none",onClick:t.save,disabled:t.isSaveDisabled,"data-testid":"view-settings-save",children:t.isSaving?h.jsx(ri,{size:"xs"}):h.jsxs(h.Fragment,{children:[h.jsx(QZe,{size:14}),"Save"]})})]})]})})})})]})});class Ort{constructor(e){this.rowListModel=e,Be(this,{},{autoBind:!0})}_isOpen=!1;get isVisible(){return this.rowListModel.hasPendingViewChanges}get isOpen(){return this._isOpen}get isDraft(){return this.rowListModel.isDraftRevision}get isSaving(){return this.rowListModel.isSavingViews}get tooltipText(){return this.isDraft?"Unsaved view changes":"Local view changes"}get badgeText(){return this.isDraft?"unsaved":"local"}get badgeColor(){return this.isDraft?"orange":"gray"}get dotColor(){return this.isDraft?"orange.500":"newGray.400"}get title(){return this.isDraft?"Unsaved view settings":"Local view changes"}get description(){return this.isDraft?"Column order, widths, and sort settings will be saved to the Default view and shared with everyone.":"View settings can only be saved in draft revisions. These changes are temporary and will be lost when you leave."}get revertButtonText(){return this.isDraft?"Revert":"Reset"}get isRevertDisabled(){return this.isDraft&&this.isSaving}get isSaveDisabled(){return this.isSaving}get showSaveButton(){return this.isDraft}setOpen(e){this._isOpen=e}async save(){const e=await this.rowListModel.saveViewSettings();return e&&(this._isOpen=!1),e}revert(){this.rowListModel.revertViewSettings(),this._isOpen=!1}}const x9=50;class aN{constructor(e,r){this.projectContext=e,this.permissionContext=r,this.search=new Ftt(300,this.handleSearch),this.viewSettingsBadge=new Ort(this),Be(this,{},{autoBind:!0}),this.filterModel.setOnFilterChange(this.handleFilterChange),this.sortModel.setOnSortChange(this.handleSortChange),this.columnsModel.setOnColumnsChange(this.handleColumnsChange)}search;columnsModel=new ort;filterModel=new frt;sortModel=new yrt;listState=new Vtt;selection=new vrt;inlineEdit=new mrt;viewSettingsBadge;_tableId="";_baseTotalCount=0;_isDeleting=!1;_isRefetching=!1;_isLoadingMore=!1;_viewsData=null;_savedViewsSnapshot=null;_hasPendingViewChanges=!1;_isSavingViews=!1;getRowsRequest=Hr.of(xr.RowListRows,{skipResetting:!0});deleteRowRequest=Hr.of(xr.DeleteRowMst);removeRowsRequest=Hr.of(xr.RemoveRows);getViewsRequest=Hr.of(xr.GetTableViews);updateViewsRequest=Hr.of(xr.UpdateTableViews);get showLoading(){return this.listState.showLoading}get showEmpty(){return this.listState.showEmpty}get showNotFound(){return this.listState.showNotFound}get showList(){return this.listState.showList}get showError(){return this.listState.showError}get items(){return this.listState.items}get columns(){return this.columnsModel.columns}get showHeader(){return this.columnsModel.showHeader}get hasNextPage(){return this.listState.hasNextPage}get searchQuery(){return this.search.query}get isSearching(){return this.search.isSearching}get isFiltering(){return this.filterModel.hasAppliedFilters}get canFilter(){return this.filterModel.availableFields.length>0}get canSort(){return this.sortModel.availableFields.length>0}get isSearchingOrFiltering(){return this.isSearching||this.isFiltering}get hasActiveSearch(){return this.searchQuery.trim().length>0}get emptyStateType(){const e=this.hasActiveSearch,r=this.filterModel.hasAppliedFilters;return e&&r?"both":r?"filters":"search"}get emptyStateHint(){switch(this.emptyStateType){case"both":return"Try a different search term or adjust filters";case"filters":return"Try adjusting your filters";case"search":return"Try a different search term"}}get isLoading(){return this.getRowsRequest.isLoading}get rowCountText(){return this.isSearchingOrFiltering?`${this.listState.totalCount} of ${this._baseTotalCount} rows`:`${this.listState.totalCount} rows`}get isEdit(){return this.projectContext.isDraftRevision}get canCreateRow(){return this.isEdit&&this.permissionContext.canCreateRow}get canDeleteRow(){return this.isEdit&&this.permissionContext.canDeleteRow}get showSelectionColumn(){return this.canDeleteRow&&this.selection.isSelectionMode}get isDeleting(){return this._isDeleting}get isRefetching(){return this._isRefetching}get isLoadingMore(){return this._isLoadingMore}get hasPendingViewChanges(){return this._hasPendingViewChanges}get isSavingViews(){return this._isSavingViews}get isDraftRevision(){return this.projectContext.isDraftRevision}get allRowIds(){return this.items.map(e=>e.id)}get revisionId(){return this.projectContext.revision.id}init(e,r,n){this._tableId=e,this._baseTotalCount=0,this._viewsData=null,this._savedViewsSnapshot=null,this._hasPendingViewChanges=!1,this._isSavingViews=!1,this.search.reset(),this.selection.exitSelectionMode(),this.listState.resetToLoading(),this.columnsModel.init(r,n),this.filterModel.init(r),this.sortModel.init(this.columnsModel.sortableFields),this.inlineEdit.init({revisionId:this.revisionId,tableId:this._tableId,getVisibleFields:this.getVisibleFields,getVisibleRowIds:this.getVisibleRowIds,getCellStore:this.getCellStore,isCellReadonly:this.isCellReadonly}),this.loadViewsAndData()}async loadViewsAndData(){await this.loadViews(),await this.loadInitial()}async loadViews(){try{const e=await this.getViewsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId}}),r=e.isRight?e.data.table?.views:null;r&&vt(()=>{this._viewsData=r,this.applyViewSettings()})}catch(e){console.error("Failed to load views:",e)}}applyViewSettings(){this.restoreViewFromSaved(),this._savedViewsSnapshot=this.getCurrentViewSnapshot(),this._hasPendingViewChanges=!1}restoreViewFromSaved(){const e=this._viewsData;if(!e)return;const r=e.views.find(n=>n.id===e.defaultViewId);r&&(this.columnsModel.restoreFromView(r),this.sortModel.restoreFromView(r))}markViewsAsChanged(){if(!this._savedViewsSnapshot){this._hasPendingViewChanges=!0;return}const e=this.getCurrentViewSnapshot();this._hasPendingViewChanges=e!==this._savedViewsSnapshot}getCurrentViewSnapshot(){const e=this.columnsModel.serializeToViewColumns(),r=this.sortModel.serializeToViewSorts();return JSON.stringify({columns:e,sorts:r})}async saveViewSettings(){if(!this.projectContext.isDraftRevision)return!1;this._isSavingViews=!0,this.ensureViewsData();const e=this._viewsData;if(!e)return this._isSavingViews=!1,!1;const r=this.buildDefaultView(),n=this.buildUpdatedViews(r);try{const i=await this.updateViewsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,viewsData:{version:e.version,defaultViewId:e.defaultViewId,views:n}}});return i.isRight?(vt(()=>{this._viewsData=i.data.updateTableViews,this._savedViewsSnapshot=this.getCurrentViewSnapshot(),this._hasPendingViewChanges=!1}),!0):(Ur.error({description:"Failed to save view settings"}),!1)}catch(i){return console.error("Failed to save views:",i),Ur.error({description:"Failed to save view settings"}),!1}finally{vt(()=>{this._isSavingViews=!1})}}revertViewSettings(){this.restoreViewFromSaved(),this._savedViewsSnapshot=this.getCurrentViewSnapshot(),this._hasPendingViewChanges=!1}ensureViewsData(){this._viewsData||(this._viewsData={version:1,defaultViewId:"default",views:[]})}buildDefaultView(){const e=this.columnsModel.serializeToViewColumns(),r=this.sortModel.serializeToViewSorts();return{id:"default",name:"Default",...e.length>0&&{columns:e},...r.length>0&&{sorts:r}}}buildUpdatedViews(e){const r=this._viewsData?.views??[],n=r.findIndex(o=>o.id==="default"),i=o=>({id:o.id,name:o.name,...o.description&&{description:o.description},...o.filters&&{filters:o.filters},...o.search&&{search:o.search},...o.columns&&{columns:o.columns},...o.sorts&&{sorts:o.sorts.map(s=>({field:s.field,direction:s.direction}))}});return n>=0?r.map((o,s)=>s===n?e:i(o)):[...r.map(i),e]}getVisibleFields=()=>this.columnsModel.columns.map(e=>e.id);getVisibleRowIds=()=>this.items.map(e=>e.id);getCellStore=(e,r)=>this.items.find(i=>i.id===e)?.cellsMap.get(r);isCellReadonly=(e,r)=>{if(!this.isEdit)return!0;const n=this.getCellStore(e,r);return n?"readOnly"in n&&n.readOnly===!0:!0};dispose(){this.search.dispose(),this.selection.exitSelectionMode(),this.filterModel.dispose(),this.sortModel.dispose(),this.inlineEdit.dispose(),this.getRowsRequest.abort()}setSearchQuery(e){this.search.setQuery(e)}clearSearch(){this.search.clear()}async tryToFetchNextPage(){if(!(!this.listState.hasNextPage||this._isLoadingMore||!this.listState.endCursor)){this._isLoadingMore=!0;try{const e=await this.getRowsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,first:x9,after:this.listState.endCursor,where:this.buildWhereClause(),orderBy:this.sortModel.toGraphQLOrderBy()}});vt(()=>{if(e.isRight){const r=e.data.rows.edges.map(i=>i.node),n=this.columnsModel.createRowViewModels(r,{isEdit:this.isEdit,permissionContext:this.permissionContext,inlineEditModel:this.inlineEdit,onDelete:this.deleteRow});this.listState.appendItems(n,{hasNextPage:e.data.rows.pageInfo.hasNextPage,endCursor:e.data.rows.pageInfo.endCursor??null})}else console.error("Failed to fetch next page")})}finally{vt(()=>{this._isLoadingMore=!1})}}}async deleteRow(e){try{return(await this.deleteRowRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,rowId:e}})).isRight?(vt(()=>{this.listState.removeItem(n=>n.id===e),this._baseTotalCount=Math.max(0,this._baseTotalCount-1),this.listState.updateStateAfterRemove(this.isSearchingOrFiltering)}),!0):!1}catch(r){return console.error(r),!1}}async deleteRows(e){if(e.length===0)return!0;try{return vt(()=>{this._isDeleting=!0}),(await this.removeRowsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,rowIds:e}})).isRight?(vt(()=>{for(const n of e)this.listState.removeItem(i=>i.id===n);this._baseTotalCount=Math.max(0,this._baseTotalCount-e.length),this.listState.updateStateAfterRemove(this.isSearchingOrFiltering),this.selection.removeDeletedRows(e)}),!0):!1}catch(r){return console.error(r),!1}finally{vt(()=>{this._isDeleting=!1})}}handleSearch=()=>{this.reload()};handleFilterChange=()=>{this.reload()};handleSortChange=()=>{this.reload(),this.markViewsAsChanged()};handleColumnsChange=()=>{this.markViewsAsChanged()};async reload(){this._isRefetching=!0;try{await this.loadInitial()}finally{vt(()=>{this._isRefetching=!1})}}async loadInitial(){const e=await this.getRowsRequest.fetch({data:{revisionId:this.revisionId,tableId:this._tableId,first:x9,where:this.buildWhereClause(),orderBy:this.sortModel.toGraphQLOrderBy()}});if(!e.isRight){if(Sie(e))return;vt(()=>{this.listState.setError()});return}vt(()=>{const r=e.data.rows.edges.map(i=>i.node),n=this.columnsModel.createRowViewModels(r,{isEdit:this.isEdit,permissionContext:this.permissionContext,inlineEditModel:this.inlineEdit,onDelete:this.deleteRow});this.listState.setItems(n,{hasNextPage:e.data.rows.pageInfo.hasNextPage,endCursor:e.data.rows.pageInfo.endCursor??null,totalCount:e.data.rows.totalCount,isSearching:this.isSearchingOrFiltering}),!this.isSearchingOrFiltering&&this._baseTotalCount===0&&(this._baseTotalCount=e.data.rows.totalCount)})}buildWhereClause(){const e=[];this.search.query&&e.push({OR:[{id:{contains:this.search.query}},{data:{path:[],search:this.search.query,searchType:bL.Plain,searchIn:yL.Values}}]});const r=this.filterModel.toGraphQLWhere();if(r&&e.push(r),e.length!==0)return e.length===1?e[0]:{AND:e}}}Ee.register(aN,()=>{const t=Ee.get(Yn),e=Ee.get(xs);return new aN(t,e)},{scope:"request"});const xrt=_e(()=>{const{root:t,item:e}=yT(),r=E.useRef(null),n=e.table.id,i=e.schema,o=Zn(aN,n,i),a=t.stack.indexOf(e)===0&&!e.state.isSelectingForeignKey,l=e.state.isSelectingForeignKey,c=E.useCallback(m=>{t.onSelectedForeignKey(e,m)},[e,t]);if(e.state.type!==on.List)return null;const u=o.canCreateRow?h.jsx(Di,{content:"New row",openDelay:300,children:h.jsx(Ir,{"aria-label":"New row",size:"xs",variant:"ghost",onClick:e.toCreatingRow,"data-testid":"create-row-button",color:"gray.500",_hover:{bg:"gray.100"},children:h.jsx(mee,{})})}):null,p=o.showEmpty?null:h.jsxs(ee,{alignItems:"center",gap:2,children:[h.jsx(Itt,{value:o.searchQuery,onChange:o.setSearchQuery,onClear:o.clearSearch}),o.canFilter&&h.jsx(Att,{filterModel:o.filterModel,anchorRef:r}),o.canSort&&h.jsx(Ltt,{sortModel:o.sortModel,anchorRef:r})]});return h.jsxs(ee,{flexDirection:"column",flex:1,children:[a&&h.jsx(hP,{showBreadcrumbs:!0,actions:u,search:p}),l&&h.jsxs(h.Fragment,{children:[h.jsx(d5,{tableId:e.table.id}),h.jsx(hP,{tableTitle:e.table.id,actions:u,search:p})]}),h.jsx(z,{ref:r,paddingX:"8px"}),h.jsx(z,{flex:1,position:"relative",marginTop:"16px",children:h.jsx(Ttt,{model:o,revisionId:e.revisionId,tableId:n,isRevisionReadonly:!e.isEditableRevision,onSelect:l?c:void 0,onCopy:e.toCloneRow,onCreate:o.canCreateRow?e.toCreatingRow:void 0})}),!o.showEmpty&&!o.showLoading&&h.jsxs(ee,{alignItems:"center",justifyContent:"space-between",paddingX:"12px",paddingY:"8px",marginTop:"4px",borderTop:"1px solid",borderColor:"gray.100",children:[h.jsxs(ee,{alignItems:"center",gap:"8px",children:[h.jsx(Y,{fontSize:"sm",color:"gray.500",children:o.rowCountText}),o.isRefetching&&h.jsx(ri,{size:"xs",color:"gray.400"})]}),h.jsx(brt,{model:o.viewSettingsBadge})]})]})}),wrt=_e(({store:t,isEdit:e,onSelectForeignKey:r,onUploadFile:n})=>{sse(()=>{t.scrollPosition&&(window.scrollTo(0,t.scrollPosition),t.setScrollPosition(null))});const i=E.useCallback(async(o,s)=>{t.setScrollPosition(window.scrollY),await r(o,s)},[r,t]);return h.jsx(e5.Provider,{value:{onUploadFile:n,onSelectForeignKey:i,onOverNode:t.setOverNode,mode:e?fO.Updating:fO.Reading},children:h.jsx(Gae,{store:t,rootName:"<id>",isEdit:e})})}),Srt=_e(()=>{const t=Ba(),e=vp(),r=Ee.get(xs),{root:n,item:i}=yT(),[o,s]=E.useState(!1),a=i.isEditableRevision&&r.canUpdateRow,c=n.stack.indexOf(i)===0&&!i.state.isSelectingForeignKey,u=E.useCallback(async($,A)=>{await n.selectForeignKey(i,$,A)},[i,n]),p=E.useCallback($=>{i.state.type===on.UpdatingRow&&i.state.store.name.setValue($)},[i]),m=E.useCallback(async()=>{if(i.state.type!==on.UpdatingRow)return;const $=i.state.store;s(!0);try{await i.updateRow($)&&($.save(),$.syncReadOnlyStores(),t(e.make({revisionIdOrTag:zo,rowId:$.name.getPlainValue()})))}catch{Ur.error({title:"Update failed"})}finally{s(!1)}},[i,e,t]),v=E.useCallback(()=>{i.state.type===on.UpdatingRow&&i.state.store.reset()},[i]),b=E.useCallback(async()=>{if(i.state.type!==on.UpdatingRow)return;const $=JSON.stringify(i.state.store.root.getPlainValue(),null,2);await navigator.clipboard.writeText($),Ur.info({title:"Copied to clipboard"})},[i]),O=E.useCallback(async($,A)=>{if(i.state.type!==on.UpdatingRow)return;const M=i.state.store,Q=wn();Ur.loading({id:Q,title:"Uploading..."});try{await i.uploadFile(M,$,A)?(Ur.update(Q,{type:"info",title:"Successfully uploaded!",duration:1500}),M.syncReadOnlyStores(),t(e.make({revisionIdOrTag:zo,rowId:M.name.getPlainValue()}))):Ur.update(Q,{type:"error",title:"Upload failed",duration:3e3})}catch{Ur.update(Q,{type:"error",title:"Upload failed",duration:3e3})}},[i,e,t]);if(i.state.type!==on.UpdatingRow)return null;const x=i.state.store,S=x.viewMode||di.Tree,w=x.touched?h.jsxs(ee,{gap:"4px",children:[h.jsx(JO,{dataTestId:"row-editor-approve-button",isDisabled:!x.isValid,loading:o,onClick:m}),h.jsx(Sse,{dataTestId:"row-editor-revert-button",onClick:v})]}):null,k=h.jsx(dT,{availableRefByMode:x.areThereForeignKeysBy,mode:S,onChange:x.setViewMode}),P=h.jsx(Zae,{value:x.name.value,setValue:p,readonly:!a,dataTestId:"row-id-input"}),_=S===di.Tree,T=_&&x.node.hasCollapsibleContent,R=_?h.jsx(Xae,{showTreeActions:T,onExpandAll:()=>x.node.expandAllContent(),onCollapseAll:()=>x.node.collapseAllContent(),onCopyJson:b}):null;return h.jsxs(ee,{flexDirection:"column",flex:1,children:[i.state.isSelectingForeignKey&&h.jsx(d5,{tableId:i.table.id}),h.jsx(hP,{showBreadcrumbs:c,rowIdInput:P,actions:w,actionsMenu:R,switcher:k}),h.jsx(ee,{flexDirection:"column",paddingTop:"60px",children:h.jsx(wrt,{isEdit:a,store:x,onSelectForeignKey:u,onUploadFile:O})})]})}),Crt=({previousType:t,tableId:e,rowId:r,foreignKeyPath:n,onCancel:i})=>{const o=E.useMemo(()=>t===on.UpdatingRow?"updating":t===on.CreatingRow?"creating":"",[t]);return h.jsx(h.Fragment,{children:h.jsx(z,{width:"100%",borderStyle:"solid",borderLeftWidth:2,borderColor:"gray.200",pl:"1rem",mb:"1rem",children:h.jsxs(ee,{gap:"4px",alignItems:"center",height:"30px",mt:"2px",mb:"2px",color:"gray.400",fontWeight:"300",children:[h.jsx(Y,{textDecoration:"underline",cursor:"pointer",onClick:i,children:"Back"}),h.jsxs(Y,{children:["- ",o,' "',e," - ",r,'":']}),h.jsx(Y,{children:n})]})})})},krt=_e(()=>{const{root:t,item:e}=yT(),r=E.useCallback(()=>{t.cancelSelectingForeignKey(e)},[e,t]);return e.state.type===on.ConnectingForeignKeyRow?h.jsx(Crt,{previousType:e.state.previousType,foreignKeyPath:e.currentForeignKeyPath,onCancel:r,tableId:e.table.id,rowId:e.state.store.name.getPlainValue()}):e.state.type===on.List?h.jsx(xrt,{}):e.state.type===on.CreatingRow?h.jsx(Fet,{}):e.state.type===on.UpdatingRow?h.jsx(Srt,{}):null}),gle=_e(({startWithUpdating:t})=>{const e=Aet(t);return h.jsx(h.Fragment,{children:e.stack.map(r=>h.jsx(Hae.Provider,{value:{root:e,item:r},children:h.jsx(krt,{})},r.id))})}),Prt=_e(()=>{const t=bZe();return t.isValidSchema?h.jsx(gle,{startWithUpdating:!0}):h.jsx(vZe,{data:t.row.data})}),_rt=()=>h.jsx(Mi,{hideSidebar:!0,children:h.jsxs(ee,{alignItems:"center",flexDirection:"column",justifyContent:"center",flex:1,gap:"8px",children:[h.jsx(Y,{color:"gray.400",children:"Check your email to confirm your account"}),h.jsx(Ki,{to:`/${eh}`,children:h.jsx(na,{color:"gray.400",alignSelf:"center",children:"Log in"})})]})}),Trt=()=>null;class lN{constructor(e,r){this.apiService=e,this.authService=r,Be(this)}isLoading=!1;async login(e){e?await this.loginRequest(e):console.error("Invalid code")}dispose(){}init(){}async loginRequest(e){this.setIsLoading(!0);try{const r=await this.apiService.client.loginGoogle({data:{code:e,redirectUrl:ise()}});return await this.authService.setToken(r.loginGoogle.accessToken),!0}catch(r){console.error(r)}finally{this.setIsLoading(!1)}}setIsLoading(e){this.isLoading=e}}Ee.register(lN,()=>{const t=Ee.get(Da),e=Ee.get($o);return new lN(t,e)},{scope:"request"});const Ert=async({request:t})=>{const r=new URL(t.url).searchParams,n=r.get("code"),i=r.get("state"),o=Z_(Cie(i));if(!n)throw new Error("Invalid code");return await Ee.get(lN).login(n),mm(o||"/")};class cN{constructor(e,r,n){this.routerService=e,this.apiService=r,this.configurationService=n,Be(this)}isLoading=!1;form=new xL({email:"",username:"",password:""});get disableSubmitButton(){return!this.form.isValid}get availableEmailSignUp(){return this.configurationService.availableEmailSignUp}get availableOauth(){return this.configurationService.availableGoogleOauth}get availableGoogleOauth(){return this.configurationService.availableGoogleOauth}get availableGithubOauth(){return this.configurationService.availableGithubOauth}toGoogleOauth(){ose(this.configurationService.googleOauthClientId,q0())}toGithubOauth(){nse(this.configurationService.githubOauthClientId,q0())}async submit(){await this.signUp()&&await this.routerService.navigate(`/${v_}/${YJ}`)}dispose(){}init(){}async signUp(){this.setIsLoading(!0);try{return await this.apiService.client.signUp({data:this.form.values}),!0}finally{this.setIsLoading(!1)}}setIsLoading(e){this.isLoading=e}}Ee.register(cN,()=>{const t=Ee.get(Sc),e=Ee.get(Da),r=Ee.get(Kf);return new cN(t,e,r)},{scope:"request"});const Rrt=_e(()=>{const t=Zn(cN),[e]=LM(),r=E.useMemo(()=>{const c=e.get("redirect");return c?`/${eh}?redirect=${encodeURIComponent(c)}`:`/${eh}`},[e]),n=E.useCallback(c=>{t.form.setValue("username",c.currentTarget.value)},[t.form]),i=E.useCallback(c=>{t.form.setValue("email",c.currentTarget.value)},[t.form]),o=E.useCallback(c=>{t.form.setValue("password",c.currentTarget.value)},[t.form]),s=E.useCallback(async()=>{await t.submit()},[t]),a=E.useCallback(()=>{t.toGithubOauth()},[t]),l=E.useCallback(()=>{t.toGoogleOauth()},[t]);return h.jsxs(Mi,{hideSidebar:!0,children:[h.jsxs(ee,{width:"100%",gap:"8px",justifyContent:"flex-end",children:[h.jsx(Y,{color:"gray.300",children:"Already have an account?"}),h.jsx(Ki,{to:r,children:h.jsx(na,{color:"gray.300",alignSelf:"center",children:"Log in"})})]}),h.jsx(ee,{alignItems:"center",justifyContent:"center",flex:1,children:h.jsxs(ee,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[t.availableOauth&&h.jsxs(h.Fragment,{children:[h.jsxs(ee,{flexDirection:"column",gap:"2px",children:[t.availableGithubOauth&&h.jsx(ea,{icon:h.jsx(aee,{}),onClick:a,title:"Continue with Github"}),t.availableGoogleOauth&&h.jsx(ea,{icon:h.jsx(lee,{}),onClick:l,title:"Continue with Google"})]}),t.availableEmailSignUp&&h.jsxs(ee,{width:"100%",alignItems:"center",gap:"16px",children:[h.jsx(z,{backgroundColor:"gray.100",flex:1,height:"1px"}),h.jsx(Y,{color:"gray.300",fontSize:"12px",children:"OR"}),h.jsx(z,{backgroundColor:"gray.100",flex:1,height:"1px"})]})]}),t.availableEmailSignUp&&h.jsxs(h.Fragment,{children:[h.jsx(hu,{dataTestId:"signup-username-input",autoFocus:!0,height:"40px",placeholder:"enter your username",autoComplete:"new-password",value:t.form.values.username,onChange:n}),h.jsx(hu,{dataTestId:"signup-email-input",height:"40px",placeholder:"enter your email",type:"email",autoComplete:"new-password",value:t.form.values.email,onChange:i}),h.jsx(hu,{dataTestId:"signup-password-input",height:"40px",placeholder:"create a password",type:"password",autoComplete:"new-password",value:t.form.values.password,onChange:o,onEnter:s}),h.jsx(z,{visibility:t.disableSubmitButton?"hidden":"visible",children:h.jsx(ea,{onClick:s,disabled:t.disableSubmitButton,isLoading:t.isLoading,title:"Sign up"})})]})]})})]})}),Irt=()=>h.jsx(gle,{});class uN{constructor(e,r,n){this.authService=e,this.apiService=r,this.routerService=n,Be(this)}isLoading=!1;form=new xL({username:""});get disableSubmitButton(){return!this.form.isValid}async submit(){await this.request()&&(await this.authService.fetchMe(),await this.routerService.navigate(m_))}dispose(){}init(){}async request(){this.setIsLoading(!0);try{return await this.apiService.client.setUsername({data:{username:this.form.values.username}}),!0}catch(e){console.error(e)}finally{this.setIsLoading(!1)}}setIsLoading(e){this.isLoading=e}}Ee.register(uN,()=>{const t=Ee.get($o),e=Ee.get(Da),r=Ee.get(Sc);return new uN(t,e,r)},{scope:"request"});const jrt=_e(()=>{const t=Zn(uN),e=E.useCallback(n=>{t.form.setValue("username",n.currentTarget.value)},[t.form]),r=E.useCallback(async()=>{await t.submit()},[t]);return h.jsx(Mi,{hideSidebar:!0,children:h.jsx(ee,{alignItems:"center",justifyContent:"center",flex:1,children:h.jsxs(ee,{flexDirection:"column",width:"16rem",gap:"1rem",alignItems:"center",children:[h.jsx(hu,{dataTestId:"login-emailOrUsername-input",autoFocus:!0,height:"40px",placeholder:"set username",value:t.form.values.username,onChange:e,onEnter:r}),h.jsx(z,{visibility:t.disableSubmitButton?"hidden":"visible",children:h.jsx(ea,{onClick:r,isLoading:t.isLoading,title:"Set username"})})]})})})}),$rt=()=>{const t=DM(),e=E.useMemo(()=>(console.error(t),"Unexpected error"),[t]);return h.jsxs(ee,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",height:"100%",children:[h.jsx(pD,{color:"gray"}),h.jsx(Y,{color:"gray.400",children:e})]})},Art=()=>{const t=DM(),e=E.useMemo(()=>t instanceof moe?`Not found table "${t.message}" in this revision`:t instanceof goe?`Not found row "${t.message}" in this revision`:(console.error(t),"Unexpected error"),[t]);return h.jsxs(ee,{alignItems:"center",flex:1,gap:"1rem",justifyContent:"center",width:"100%",children:[h.jsx(pD,{color:"gray"}),h.jsx(Y,{color:"gray.400",children:e})]})};function Bs(){return(Bs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}var Nrt=function(){};function mle(t,e){return Math.random()*(e-t+1)+t}function w9(t,e){return Math.floor(mle(t,e))}var Mrt=E.forwardRef(function(t,e){var r=t.progress,n=t.height,i=n===void 0?2:n,o=t.className,s=o===void 0?"":o,a=t.color,l=a===void 0?"red":a,c=t.background,u=c===void 0?"transparent":c,p=t.onLoaderFinished,m=t.transitionTime,v=m===void 0?300:m,b=t.loaderSpeed,O=b===void 0?500:b,x=t.waitingTime,S=x===void 0?1e3:x,w=t.shadow,k=w===void 0||w,P=t.containerStyle,_=P===void 0?{}:P,T=t.style,R=T===void 0?{}:T,$=t.shadowStyle,A=$===void 0?{}:$,M=t.containerClassName,Q=M===void 0?"":M,V=E.useRef(!1),q=E.useState(0),N=q[0],B=q[1],re=E.useRef({active:!1,refreshRate:1e3}),he=E.useState(!1),ne=he[0],se=he[1],X=E.useState({active:!1,value:20}),D=X[0],H=X[1],J={position:"fixed",top:0,left:0,height:i,background:u,zIndex:99999999999,width:"100%"},F={boxShadow:"0 0 10px "+l+", 0 0 10px "+l,width:"5%",opacity:1,position:"absolute",height:"100%",transition:"all "+O+"ms ease",transform:"rotate(3deg) translate(0px, -4px)",left:"-10rem"},W=E.useState({height:"100%",background:l,transition:"all "+O+"ms ease",width:"0%"}),ae=W[0],we=W[1],G=E.useState(F),ue=G[0],Te=G[1];E.useEffect(function(){return V.current=!0,function(){V.current=!1}},[]),E.useImperativeHandle(e,function(){return{continuousStart:function(Ve,We){if(We===void 0&&(We=1e3),!D.active)if(ne)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var Gt=Ve||w9(10,20);re.current={active:!0,refreshRate:We},B(Gt),Re(Gt)}},staticStart:function(Ve){if(!re.current.active)if(ne)console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!");else{var We=Ve||w9(30,50);H({active:!0,value:We}),B(We),Re(We)}},complete:function(){ne?console.warn("react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar!"):(B(100),Re(100))}}}),E.useEffect(function(){we(Bs({},ae,{background:l})),Te(Bs({},ue,{boxShadow:"0 0 10px "+l+", 0 0 5px "+l}))},[l]),E.useEffect(function(){if(e){if(e&&r!==void 0)return void console.warn(`react-top-loading-bar: You can't use both controlling by props and ref methods to control the bar! Please use only props or only ref methods! Ref methods will override props if "ref" property is available.`);Re(N),se(!1)}else r&&Re(r),se(!0)},[r]);var te,oe,Oe,Re=function Ve(We){We>=100?(we(Bs({},ae,{width:"100%"})),k&&Te(Bs({},ue,{left:We-10+"%"})),setTimeout(function(){V.current&&(we(Bs({},ae,{opacity:0,width:"100%",transition:"all "+v+"ms ease-out",color:l})),setTimeout(function(){V.current&&(re.current.active&&(re.current=Bs({},re.current,{active:!1}),B(0),Ve(0)),D.active&&(H(Bs({},D,{active:!1})),B(0),Ve(0)),p&&p(),B(0),Ve(0))},v))},S)):(we(function(Gt){return Bs({},Gt,{width:We+"%",opacity:1,transition:We>0?"all "+O+"ms ease":""})}),k&&Te(Bs({},ue,{left:We-5.5+"%",transition:We>0?"all "+O+"ms ease":""})))};return te=function(){var Ve=mle(Math.min(10,(100-N)/5),Math.min(20,(100-N)/3));N+Ve<95&&(B(N+Ve),Re(N+Ve))},oe=re.current.active?re.current.refreshRate:null,Oe=E.useRef(Nrt),E.useEffect(function(){Oe.current=te}),E.useEffect(function(){},[void 0]),E.useEffect(function(){if(oe!==null&&oe!==!1){var Ve=setInterval(function(){return Oe.current()},oe);return function(){return clearInterval(Ve)}}},[oe]),E.createElement("div",{className:Q,style:Bs({},J,_)},E.createElement("div",{className:s,style:Bs({},ae,R)},k?E.createElement("div",{style:Bs({},ue,A)}):null))});const Drt=(t=300)=>{const e=E.useRef(null),r=JPe();return E.useEffect(()=>{const n=e.current;let i=NaN,o=!1;return r.state==="loading"&&(i=setTimeout(()=>{o=!0,n?.continuousStart()},t)),()=>{o&&n?.complete(),clearTimeout(i)}},[t,r.state]),e},Lrt=()=>{const t=Drt(150);return h.jsxs(h.Fragment,{children:[h.jsx(Mrt,{ref:t,color:"#1fa3ff",height:1,waitingTime:500}),h.jsx(vm,{})]})},Vrt=()=>[{index:!0,element:h.jsx(fZe,{})}],Frt=()=>({path:kb,id:rn.Changes,element:h.jsx(cUe,{}),children:[{index:!0,element:h.jsx(rUe,{})},{path:"rows",element:h.jsx(CUe,{})}]}),Qrt=()=>({path:ik,element:h.jsx(vGe,{}),id:rn.Migrations}),Brt=()=>({path:ok,loader:s7e,id:rn.Table,children:[{index:!0,element:h.jsx(Irt,{})},{path:ree,loader:i7e,id:rn.Row,element:h.jsx(Prt,{})}]}),zrt={path:Ed,element:h.jsx(vm,{}),loader:uA(G0,Jqe),id:rn.Organization,children:[{path:Rd,element:h.jsx(vm,{}),loader:uA(G0,e7e),id:rn.Project,children:[{path:KJ,element:h.jsx(vHe,{}),id:rn.ProjectSettings},{path:tee,element:h.jsx(uHe,{}),id:rn.Endpoints},{path:eee,element:h.jsx(hHe,{}),id:rn.ProjectMcp},{path:JJ,element:h.jsx(SHe,{}),id:rn.ProjectUsers},{path:hIe,element:h.jsx("div",{children:"Project API Keys Page"}),id:rn.ProjectApiKeys},{path:y_,loader:Xqe,id:rn.Branch,children:[{path:b_,loader:t7e,id:rn.Revision,errorElement:h.jsx(Art,{}),children:[{element:h.jsx(MHe,{}),children:[...Vrt(),Brt()]},{element:h.jsx(NHe,{showTitle:!1}),children:[Frt(),Qrt()]}]}]}]}]},qrt=[{path:`${lD}/*`,element:h.jsx(hWe,{})},{path:"/",element:h.jsx(Lrt,{}),errorElement:h.jsx($rt,{}),children:[{index:!0,element:h.jsx(cGe,{}),loader:uA(G0,Kqe)},{path:GJ,element:h.jsx(jrt,{})},{path:uIe,element:h.jsx(fHe,{}),loader:G0},{path:eh,loader:Zqe,children:[{index:!0,element:h.jsx(zHe,{})},{path:ZJ,loader:Ert,element:h.jsx(Trt,{})},{path:XJ,loader:VHe,element:h.jsx(LHe,{})}]},{path:HJ,element:h.jsx(qHe,{}),loader:G0},{path:v_,loader:Yqe,children:[{index:!0,element:h.jsx(Rrt,{})},{path:YJ,element:h.jsx(_rt,{})},{path:dIe,element:h.jsx(DHe,{})}]},{path:Td,children:[zrt]}]}];class Sc{constructor(e){this.bootstrapService=e,this.init()}_router=null;get router(){if(!this._router)throw new Error("Router not found");return this._router}navigate(...e){return this.router.navigate(...e)}init(){Iu(()=>this.bootstrapService.isLoaded,e=>{e&&(this._router=h_e(qrt))})}}Ee.register(Sc,()=>{const t=Ee.get(Bk);return new Sc(t)},{scope:"singleton"});class dN{constructor(e,r){this.bootstrapService=e,this.routerService=r,Be(this)}get isLoaded(){return this.bootstrapService.isLoaded}get router(){return this.routerService.router}async init(){}dispose(){}}Ee.register(dN,()=>{const t=Ee.get(Bk),e=Ee.get(Sc);return new dN(t,e)},{scope:"request"});const Wrt=({children:t})=>h.jsx(sIe,{client:ln,children:t}),S9=kZ(RZ,{theme:{tokens:{colors:{gray:{50:{value:"#F7FAFC"},100:{value:"#EDF2F7"},200:{value:"#E2E8F0"},300:{value:"#CBD5E0"},400:{value:"#A0AEC0"},500:{value:"#718096"},600:{value:"#4A5568"},700:{value:"#2D3748"},800:{value:"#1A202C"},900:{value:"#171923"}},newGray:{50:{value:"#F7FAFC"},100:{value:"#F5F5F5"},200:{value:"#E5E5E5"},300:{value:"#D4D4D4"},400:{value:"#A3A3A3"},500:{value:"#737373"},600:{value:"#525252"},700:{value:"#2D3748"},800:{value:"#1A202C"},900:{value:"#171717"}}}}}}),Urt=_e(()=>{const t=Zn(dN);return!t.isLoaded||!t.router?h.jsxs(aF,{value:S9,children:[h.jsx(qP,{w:"100%",h:"100%",children:h.jsx(ri,{})}),h.jsx(sB,{})]}):h.jsx(Wrt,{children:h.jsxs(aF,{value:S9,children:[h.jsx(x_e,{router:t.router}),h.jsx(sB,{})]})})}),C9=document.getElementById("root");C9&&sue.createRoot(C9).render(h.jsx(E.StrictMode,{children:h.jsx(Urt,{})}));const Hrt=`ver: ${Vg("PACKAGE_VERSION")} - ${Vg("GIT_BRANCH_NAME")}:${Vg("GIT_COMMIT_HASH")}`;console.info(Hrt)});export default Grt();
|