convex-cms 0.0.16-alpha.0 → 0.0.16

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.
@@ -7,7 +7,7 @@ function qO(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
7
7
  Error generating stack: `+f.message+`
8
8
  `+f.stack}}var pe=Object.prototype.hasOwnProperty,Le=e.unstable_scheduleCallback,Ye=e.unstable_cancelCallback,Oe=e.unstable_shouldYield,dt=e.unstable_requestPaint,ct=e.unstable_now,Mn=e.unstable_getCurrentPriorityLevel,Qe=e.unstable_ImmediatePriority,bt=e.unstable_UserBlockingPriority,pt=e.unstable_NormalPriority,Vn=e.unstable_LowPriority,or=e.unstable_IdlePriority,Hr=e.log,zn=e.unstable_setDisableYieldValue,Pn=null,qt=null;function en(s){if(typeof Hr=="function"&&zn(s),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Pn,s)}catch{}}var $t=Math.clz32?Math.clz32:xe,us=Math.log,Yr=Math.LN2;function xe(s){return s>>>=0,s===0?32:31-(us(s)/Yr|0)|0}var ke=256,we=262144,Ne=4194304;function Ve(s){var a=s&42;if(a!==0)return a;switch(s&-s){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function De(s,a,c){var f=s.pendingLanes;if(f===0)return 0;var x=0,b=s.suspendedLanes,k=s.pingedLanes;s=s.warmLanes;var P=f&134217727;return P!==0?(f=P&~b,f!==0?x=Ve(f):(k&=P,k!==0?x=Ve(k):c||(c=P&~s,c!==0&&(x=Ve(c))))):(P=f&~b,P!==0?x=Ve(P):k!==0?x=Ve(k):c||(c=f&~s,c!==0&&(x=Ve(c)))),x===0?0:a!==0&&a!==x&&(a&b)===0&&(b=x&-x,c=a&-a,b>=c||b===32&&(c&4194048)!==0)?a:x}function wt(s,a){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&a)===0}function bn(s,a){switch(s){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32: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 a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tn(){var s=Ne;return Ne<<=1,(Ne&62914560)===0&&(Ne=4194304),s}function Gt(s){for(var a=[],c=0;31>c;c++)a.push(s);return a}function Ot(s,a){s.pendingLanes|=a,a!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Rn(s,a,c,f,x,b){var k=s.pendingLanes;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=c,s.entangledLanes&=c,s.errorRecoveryDisabledLanes&=c,s.shellSuspendCounter=0;var P=s.entanglements,q=s.expirationTimes,se=s.hiddenUpdates;for(c=k&~c;0<c;){var ce=31-$t(c),he=1<<ce;P[ce]=0,q[ce]=-1;var oe=se[ce];if(oe!==null)for(se[ce]=null,ce=0;ce<oe.length;ce++){var ie=oe[ce];ie!==null&&(ie.lane&=-536870913)}c&=~he}f!==0&&Hn(s,f,0),b!==0&&x===0&&s.tag!==0&&(s.suspendedLanes|=b&~(k&~a))}function Hn(s,a,c){s.pendingLanes|=a,s.suspendedLanes&=~a;var f=31-$t(a);s.entangledLanes|=a,s.entanglements[f]=s.entanglements[f]|1073741824|c&261930}function wn(s,a){var c=s.entangledLanes|=a;for(s=s.entanglements;c;){var f=31-$t(c),x=1<<f;x&a|s[f]&a&&(s[f]|=a),c&=~x}}function Q(s,a){var c=a&-a;return c=(c&42)!==0?1:je(c),(c&(s.suspendedLanes|a))!==0?0:c}function je(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Ue(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function gt(){var s=$.p;return s!==0?s:(s=window.event,s===void 0?32:f1(s.type))}function Ke(s,a){var c=$.p;try{return $.p=s,a()}finally{$.p=c}}var Yn=Math.random().toString(36).slice(2),Zt="__reactFiber$"+Yn,Wn="__reactProps$"+Yn,ni="__reactContainer$"+Yn,_m="__reactEvents$"+Yn,AR="__reactListeners$"+Yn,OR="__reactHandles$"+Yn,Tb="__reactResources$"+Yn,Yl="__reactMarker$"+Yn;function Em(s){delete s[Zt],delete s[Wn],delete s[_m],delete s[AR],delete s[OR]}function ri(s){var a=s[Zt];if(a)return a;for(var c=s.parentNode;c;){if(a=c[ni]||c[Zt]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(s=QS(s);s!==null;){if(c=s[Zt])return c;s=QS(s)}return a}s=c,c=s.parentNode}return null}function si(s){if(s=s[Zt]||s[ni]){var a=s.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return s}return null}function Wl(s){var a=s.tag;if(a===5||a===26||a===27||a===6)return s.stateNode;throw Error(r(33))}function ai(s){var a=s[Tb];return a||(a=s[Tb]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Sn(s){s[Yl]=!0}var Mb=new Set,Rb={};function io(s,a){oi(s,a),oi(s+"Capture",a)}function oi(s,a){for(Rb[s]=a,s=0;s<a.length;s++)Mb.add(a[s])}var DR=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ab={},Ob={};function zR(s){return pe.call(Ob,s)?!0:pe.call(Ab,s)?!1:DR.test(s)?Ob[s]=!0:(Ab[s]=!0,!1)}function od(s,a,c){if(zR(a))if(c===null)s.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":s.removeAttribute(a);return;case"boolean":var f=a.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){s.removeAttribute(a);return}}s.setAttribute(a,""+c)}}function id(s,a,c){if(c===null)s.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(a);return}s.setAttribute(a,""+c)}}function Ds(s,a,c,f){if(f===null)s.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttributeNS(a,c,""+f)}}function Nr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Db(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function PR(s,a,c){var f=Object.getOwnPropertyDescriptor(s.constructor.prototype,a);if(!s.hasOwnProperty(a)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var x=f.get,b=f.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return x.call(this)},set:function(k){c=""+k,b.call(this,k)}}),Object.defineProperty(s,a,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(k){c=""+k},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function Tm(s){if(!s._valueTracker){var a=Db(s)?"checked":"value";s._valueTracker=PR(s,a,""+s[a])}}function zb(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var c=a.getValue(),f="";return s&&(f=Db(s)?s.checked?"true":"false":s.value),s=f,s!==c?(a.setValue(s),!0):!1}function ld(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var LR=/[\n"\\]/g;function kr(s){return s.replace(LR,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Mm(s,a,c,f,x,b,k,P){s.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?s.type=k:s.removeAttribute("type"),a!=null?k==="number"?(a===0&&s.value===""||s.value!=a)&&(s.value=""+Nr(a)):s.value!==""+Nr(a)&&(s.value=""+Nr(a)):k!=="submit"&&k!=="reset"||s.removeAttribute("value"),a!=null?Rm(s,k,Nr(a)):c!=null?Rm(s,k,Nr(c)):f!=null&&s.removeAttribute("value"),x==null&&b!=null&&(s.defaultChecked=!!b),x!=null&&(s.checked=x&&typeof x!="function"&&typeof x!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.name=""+Nr(P):s.removeAttribute("name")}function Pb(s,a,c,f,x,b,k,P){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(s.type=b),a!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||a!=null)){Tm(s);return}c=c!=null?""+Nr(c):"",a=a!=null?""+Nr(a):c,P||a===s.value||(s.value=a),s.defaultValue=a}f=f??x,f=typeof f!="function"&&typeof f!="symbol"&&!!f,s.checked=P?s.checked:!!f,s.defaultChecked=!!f,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.name=k),Tm(s)}function Rm(s,a,c){a==="number"&&ld(s.ownerDocument)===s||s.defaultValue===""+c||(s.defaultValue=""+c)}function ii(s,a,c,f){if(s=s.options,a){a={};for(var x=0;x<c.length;x++)a["$"+c[x]]=!0;for(c=0;c<s.length;c++)x=a.hasOwnProperty("$"+s[c].value),s[c].selected!==x&&(s[c].selected=x),x&&f&&(s[c].defaultSelected=!0)}else{for(c=""+Nr(c),a=null,x=0;x<s.length;x++){if(s[x].value===c){s[x].selected=!0,f&&(s[x].defaultSelected=!0);return}a!==null||s[x].disabled||(a=s[x])}a!==null&&(a.selected=!0)}}function Lb(s,a,c){if(a!=null&&(a=""+Nr(a),a!==s.value&&(s.value=a),c==null)){s.defaultValue!==a&&(s.defaultValue=a);return}s.defaultValue=c!=null?""+Nr(c):""}function Ib(s,a,c,f){if(a==null){if(f!=null){if(c!=null)throw Error(r(92));if(ae(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),a=c}c=Nr(a),s.defaultValue=c,f=s.textContent,f===c&&f!==""&&f!==null&&(s.value=f),Tm(s)}function li(s,a){if(a){var c=s.firstChild;if(c&&c===s.lastChild&&c.nodeType===3){c.nodeValue=a;return}}s.textContent=a}var IR=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function $b(s,a,c){var f=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?s.setProperty(a,""):a==="float"?s.cssFloat="":s[a]="":f?s.setProperty(a,c):typeof c!="number"||c===0||IR.has(a)?a==="float"?s.cssFloat=c:s[a]=(""+c).trim():s[a]=c+"px"}function Fb(s,a,c){if(a!=null&&typeof a!="object")throw Error(r(62));if(s=s.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||a!=null&&a.hasOwnProperty(f)||(f.indexOf("--")===0?s.setProperty(f,""):f==="float"?s.cssFloat="":s[f]="");for(var x in a)f=a[x],a.hasOwnProperty(x)&&c[x]!==f&&$b(s,x,f)}else for(var b in a)a.hasOwnProperty(b)&&$b(s,b,a[b])}function Am(s){if(s.indexOf("-")===-1)return!1;switch(s){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 $R=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),FR=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function cd(s){return FR.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function zs(){}var Om=null;function Dm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var ci=null,ui=null;function Bb(s){var a=si(s);if(a&&(s=a.stateNode)){var c=s[Wn]||null;e:switch(s=a.stateNode,a.type){case"input":if(Mm(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=s;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+kr(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var f=c[a];if(f!==s&&f.form===s.form){var x=f[Wn]||null;if(!x)throw Error(r(90));Mm(f,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(a=0;a<c.length;a++)f=c[a],f.form===s.form&&zb(f)}break e;case"textarea":Lb(s,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&ii(s,!!c.multiple,a,!1)}}}var zm=!1;function Ub(s,a,c){if(zm)return s(a,c);zm=!0;try{var f=s(a);return f}finally{if(zm=!1,(ci!==null||ui!==null)&&(Qd(),ci&&(a=ci,s=ui,ui=ci=null,Bb(a),s)))for(a=0;a<s.length;a++)Bb(s[a])}}function Gl(s,a){var c=s.stateNode;if(c===null)return null;var f=c[Wn]||null;if(f===null)return null;c=f[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(s=s.type,f=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!f;break e;default:s=!1}if(s)return null;if(c&&typeof c!="function")throw Error(r(231,a,typeof c));return c}var Ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pm=!1;if(Ps)try{var Zl={};Object.defineProperty(Zl,"passive",{get:function(){Pm=!0}}),window.addEventListener("test",Zl,Zl),window.removeEventListener("test",Zl,Zl)}catch{Pm=!1}var ga=null,Lm=null,ud=null;function qb(){if(ud)return ud;var s,a=Lm,c=a.length,f,x="value"in ga?ga.value:ga.textContent,b=x.length;for(s=0;s<c&&a[s]===x[s];s++);var k=c-s;for(f=1;f<=k&&a[c-f]===x[b-f];f++);return ud=x.slice(s,1<f?1-f:void 0)}function dd(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function fd(){return!0}function Vb(){return!1}function Gn(s){function a(c,f,x,b,k){this._reactName=c,this._targetInst=x,this.type=f,this.nativeEvent=b,this.target=k,this.currentTarget=null;for(var P in s)s.hasOwnProperty(P)&&(c=s[P],this[P]=c?c(b):b[P]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?fd:Vb,this.isPropagationStopped=Vb,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=fd)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=fd)},persist:function(){},isPersistent:fd}),a}var lo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hd=Gn(lo),Ql=g({},lo,{view:0,detail:0}),BR=Gn(Ql),Im,$m,Kl,md=g({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bm,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Kl&&(Kl&&s.type==="mousemove"?(Im=s.screenX-Kl.screenX,$m=s.screenY-Kl.screenY):$m=Im=0,Kl=s),Im)},movementY:function(s){return"movementY"in s?s.movementY:$m}}),Hb=Gn(md),UR=g({},md,{dataTransfer:0}),qR=Gn(UR),VR=g({},Ql,{relatedTarget:0}),Fm=Gn(VR),HR=g({},lo,{animationName:0,elapsedTime:0,pseudoElement:0}),YR=Gn(HR),WR=g({},lo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),GR=Gn(WR),ZR=g({},lo,{data:0}),Yb=Gn(ZR),QR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},KR={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"},XR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function JR(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=XR[s])?!!a[s]:!1}function Bm(){return JR}var eA=g({},Ql,{key:function(s){if(s.key){var a=QR[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=dd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?KR[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bm,charCode:function(s){return s.type==="keypress"?dd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?dd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),tA=Gn(eA),nA=g({},md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wb=Gn(nA),rA=g({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bm}),sA=Gn(rA),aA=g({},lo,{propertyName:0,elapsedTime:0,pseudoElement:0}),oA=Gn(aA),iA=g({},md,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),lA=Gn(iA),cA=g({},lo,{newState:0,oldState:0}),uA=Gn(cA),dA=[9,13,27,32],Um=Ps&&"CompositionEvent"in window,Xl=null;Ps&&"documentMode"in document&&(Xl=document.documentMode);var fA=Ps&&"TextEvent"in window&&!Xl,Gb=Ps&&(!Um||Xl&&8<Xl&&11>=Xl),Zb=" ",Qb=!1;function Kb(s,a){switch(s){case"keyup":return dA.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var di=!1;function hA(s,a){switch(s){case"compositionend":return Xb(a);case"keypress":return a.which!==32?null:(Qb=!0,Zb);case"textInput":return s=a.data,s===Zb&&Qb?null:s;default:return null}}function mA(s,a){if(di)return s==="compositionend"||!Um&&Kb(s,a)?(s=qb(),ud=Lm=ga=null,di=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Gb&&a.locale!=="ko"?null:a.data;default:return null}}var pA={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 Jb(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!pA[s.type]:a==="textarea"}function e0(s,a,c,f){ci?ui?ui.push(f):ui=[f]:ci=f,a=rf(a,"onChange"),0<a.length&&(c=new hd("onChange","change",null,c,f),s.push({event:c,listeners:a}))}var Jl=null,ec=null;function gA(s){PS(s,0)}function pd(s){var a=Wl(s);if(zb(a))return s}function t0(s,a){if(s==="change")return a}var n0=!1;if(Ps){var qm;if(Ps){var Vm="oninput"in document;if(!Vm){var r0=document.createElement("div");r0.setAttribute("oninput","return;"),Vm=typeof r0.oninput=="function"}qm=Vm}else qm=!1;n0=qm&&(!document.documentMode||9<document.documentMode)}function s0(){Jl&&(Jl.detachEvent("onpropertychange",a0),ec=Jl=null)}function a0(s){if(s.propertyName==="value"&&pd(ec)){var a=[];e0(a,ec,s,Dm(s)),Ub(gA,a)}}function vA(s,a,c){s==="focusin"?(s0(),Jl=a,ec=c,Jl.attachEvent("onpropertychange",a0)):s==="focusout"&&s0()}function xA(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return pd(ec)}function yA(s,a){if(s==="click")return pd(a)}function bA(s,a){if(s==="input"||s==="change")return pd(a)}function wA(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var ir=typeof Object.is=="function"?Object.is:wA;function tc(s,a){if(ir(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var c=Object.keys(s),f=Object.keys(a);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var x=c[f];if(!pe.call(a,x)||!ir(s[x],a[x]))return!1}return!0}function o0(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function i0(s,a){var c=o0(s);s=0;for(var f;c;){if(c.nodeType===3){if(f=s+c.textContent.length,s<=a&&f>=a)return{node:c,offset:a-s};s=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=o0(c)}}function l0(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?l0(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function c0(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var a=ld(s.document);a instanceof s.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)s=a.contentWindow;else break;a=ld(s.document)}return a}function Hm(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}var SA=Ps&&"documentMode"in document&&11>=document.documentMode,fi=null,Ym=null,nc=null,Wm=!1;function u0(s,a,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Wm||fi==null||fi!==ld(f)||(f=fi,"selectionStart"in f&&Hm(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),nc&&tc(nc,f)||(nc=f,f=rf(Ym,"onSelect"),0<f.length&&(a=new hd("onSelect","select",null,a,c),s.push({event:a,listeners:f}),a.target=fi)))}function co(s,a){var c={};return c[s.toLowerCase()]=a.toLowerCase(),c["Webkit"+s]="webkit"+a,c["Moz"+s]="moz"+a,c}var hi={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionrun:co("Transition","TransitionRun"),transitionstart:co("Transition","TransitionStart"),transitioncancel:co("Transition","TransitionCancel"),transitionend:co("Transition","TransitionEnd")},Gm={},d0={};Ps&&(d0=document.createElement("div").style,"AnimationEvent"in window||(delete hi.animationend.animation,delete hi.animationiteration.animation,delete hi.animationstart.animation),"TransitionEvent"in window||delete hi.transitionend.transition);function uo(s){if(Gm[s])return Gm[s];if(!hi[s])return s;var a=hi[s],c;for(c in a)if(a.hasOwnProperty(c)&&c in d0)return Gm[s]=a[c];return s}var f0=uo("animationend"),h0=uo("animationiteration"),m0=uo("animationstart"),jA=uo("transitionrun"),CA=uo("transitionstart"),NA=uo("transitioncancel"),p0=uo("transitionend"),g0=new Map,Zm="abort auxClick beforeToggle 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(" ");Zm.push("scrollEnd");function Wr(s,a){g0.set(s,a),io(a,[s])}var gd=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},_r=[],mi=0,Qm=0;function vd(){for(var s=mi,a=Qm=mi=0;a<s;){var c=_r[a];_r[a++]=null;var f=_r[a];_r[a++]=null;var x=_r[a];_r[a++]=null;var b=_r[a];if(_r[a++]=null,f!==null&&x!==null){var k=f.pending;k===null?x.next=x:(x.next=k.next,k.next=x),f.pending=x}b!==0&&v0(c,x,b)}}function xd(s,a,c,f){_r[mi++]=s,_r[mi++]=a,_r[mi++]=c,_r[mi++]=f,Qm|=f,s.lanes|=f,s=s.alternate,s!==null&&(s.lanes|=f)}function Km(s,a,c,f){return xd(s,a,c,f),yd(s)}function fo(s,a){return xd(s,null,null,a),yd(s)}function v0(s,a,c){s.lanes|=c;var f=s.alternate;f!==null&&(f.lanes|=c);for(var x=!1,b=s.return;b!==null;)b.childLanes|=c,f=b.alternate,f!==null&&(f.childLanes|=c),b.tag===22&&(s=b.stateNode,s===null||s._visibility&1||(x=!0)),s=b,b=b.return;return s.tag===3?(b=s.stateNode,x&&a!==null&&(x=31-$t(c),s=b.hiddenUpdates,f=s[x],f===null?s[x]=[a]:f.push(a),a.lane=c|536870912),b):null}function yd(s){if(50<Cc)throw Cc=0,og=null,Error(r(185));for(var a=s.return;a!==null;)s=a,a=s.return;return s.tag===3?s.stateNode:null}var pi={};function kA(s,a,c,f){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lr(s,a,c,f){return new kA(s,a,c,f)}function Xm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ls(s,a){var c=s.alternate;return c===null?(c=lr(s.tag,a,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=a,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&65011712,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,a=s.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c.refCleanup=s.refCleanup,c}function x0(s,a){s.flags&=65011714;var c=s.alternate;return c===null?(s.childLanes=0,s.lanes=a,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,a=c.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),s}function bd(s,a,c,f,x,b){var k=0;if(f=s,typeof s=="function")Xm(s)&&(k=1);else if(typeof s=="string")k=RO(s,c,ne.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case D:return s=lr(31,c,a,x),s.elementType=D,s.lanes=b,s;case j:return ho(c.children,x,b,a);case N:k=8,x|=24;break;case C:return s=lr(12,c,a,x|2),s.elementType=C,s.lanes=b,s;case A:return s=lr(13,c,a,x),s.elementType=A,s.lanes=b,s;case R:return s=lr(19,c,a,x),s.elementType=R,s.lanes=b,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case E:k=10;break e;case _:k=9;break e;case M:k=11;break e;case T:k=14;break e;case O:k=16,f=null;break e}k=29,c=Error(r(130,s===null?"null":typeof s,"")),f=null}return a=lr(k,c,a,x),a.elementType=s,a.type=f,a.lanes=b,a}function ho(s,a,c,f){return s=lr(7,s,f,a),s.lanes=c,s}function Jm(s,a,c){return s=lr(6,s,null,a),s.lanes=c,s}function y0(s){var a=lr(18,null,null,0);return a.stateNode=s,a}function ep(s,a,c){return a=lr(4,s.children!==null?s.children:[],s.key,a),a.lanes=c,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}var b0=new WeakMap;function Er(s,a){if(typeof s=="object"&&s!==null){var c=b0.get(s);return c!==void 0?c:(a={value:s,source:a,stack:yt(a)},b0.set(s,a),a)}return{value:s,source:a,stack:yt(a)}}var gi=[],vi=0,wd=null,rc=0,Tr=[],Mr=0,va=null,ds=1,fs="";function Is(s,a){gi[vi++]=rc,gi[vi++]=wd,wd=s,rc=a}function w0(s,a,c){Tr[Mr++]=ds,Tr[Mr++]=fs,Tr[Mr++]=va,va=s;var f=ds;s=fs;var x=32-$t(f)-1;f&=~(1<<x),c+=1;var b=32-$t(a)+x;if(30<b){var k=x-x%5;b=(f&(1<<k)-1).toString(32),f>>=k,x-=k,ds=1<<32-$t(a)+x|c<<x|f,fs=b+s}else ds=1<<b|c<<x|f,fs=s}function tp(s){s.return!==null&&(Is(s,1),w0(s,1,0))}function np(s){for(;s===wd;)wd=gi[--vi],gi[vi]=null,rc=gi[--vi],gi[vi]=null;for(;s===va;)va=Tr[--Mr],Tr[Mr]=null,fs=Tr[--Mr],Tr[Mr]=null,ds=Tr[--Mr],Tr[Mr]=null}function S0(s,a){Tr[Mr++]=ds,Tr[Mr++]=fs,Tr[Mr++]=va,ds=a.id,fs=a.overflow,va=s}var kn=null,Dt=null,ut=!1,xa=null,Rr=!1,rp=Error(r(519));function ya(s){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sc(Er(a,s)),rp}function j0(s){var a=s.stateNode,c=s.type,f=s.memoizedProps;switch(a[Zt]=s,a[Wn]=f,c){case"dialog":at("cancel",a),at("close",a);break;case"iframe":case"object":case"embed":at("load",a);break;case"video":case"audio":for(c=0;c<kc.length;c++)at(kc[c],a);break;case"source":at("error",a);break;case"img":case"image":case"link":at("error",a),at("load",a);break;case"details":at("toggle",a);break;case"input":at("invalid",a),Pb(a,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":at("invalid",a);break;case"textarea":at("invalid",a),Ib(a,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||f.suppressHydrationWarning===!0||FS(a.textContent,c)?(f.popover!=null&&(at("beforetoggle",a),at("toggle",a)),f.onScroll!=null&&at("scroll",a),f.onScrollEnd!=null&&at("scrollend",a),f.onClick!=null&&(a.onclick=zs),a=!0):a=!1,a||ya(s,!0)}function C0(s){for(kn=s.return;kn;)switch(kn.tag){case 5:case 31:case 13:Rr=!1;return;case 27:case 3:Rr=!0;return;default:kn=kn.return}}function xi(s){if(s!==kn)return!1;if(!ut)return C0(s),ut=!0,!1;var a=s.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=s.type,c=!(c!=="form"&&c!=="button")||wg(s.type,s.memoizedProps)),c=!c),c&&Dt&&ya(s),C0(s),a===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Dt=ZS(s)}else if(a===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Dt=ZS(s)}else a===27?(a=Dt,Oa(s.type)?(s=kg,kg=null,Dt=s):Dt=a):Dt=kn?Or(s.stateNode.nextSibling):null;return!0}function mo(){Dt=kn=null,ut=!1}function sp(){var s=xa;return s!==null&&(Xn===null?Xn=s:Xn.push.apply(Xn,s),xa=null),s}function sc(s){xa===null?xa=[s]:xa.push(s)}var ap=I(null),po=null,$s=null;function ba(s,a,c){K(ap,a._currentValue),a._currentValue=c}function Fs(s){s._currentValue=ap.current,F(ap)}function op(s,a,c){for(;s!==null;){var f=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,f!==null&&(f.childLanes|=a)):f!==null&&(f.childLanes&a)!==a&&(f.childLanes|=a),s===c)break;s=s.return}}function ip(s,a,c,f){var x=s.child;for(x!==null&&(x.return=s);x!==null;){var b=x.dependencies;if(b!==null){var k=x.child;b=b.firstContext;e:for(;b!==null;){var P=b;b=x;for(var q=0;q<a.length;q++)if(P.context===a[q]){b.lanes|=c,P=b.alternate,P!==null&&(P.lanes|=c),op(b.return,c,s),f||(k=null);break e}b=P.next}}else if(x.tag===18){if(k=x.return,k===null)throw Error(r(341));k.lanes|=c,b=k.alternate,b!==null&&(b.lanes|=c),op(k,c,s),k=null}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===s){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}}function yi(s,a,c,f){s=null;for(var x=a,b=!1;x!==null;){if(!b){if((x.flags&524288)!==0)b=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var k=x.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var P=x.type;ir(x.pendingProps.value,k.value)||(s!==null?s.push(P):s=[P])}}else if(x===te.current){if(k=x.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(s!==null?s.push(Rc):s=[Rc])}x=x.return}s!==null&&ip(a,s,c,f),a.flags|=262144}function Sd(s){for(s=s.firstContext;s!==null;){if(!ir(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function go(s){po=s,$s=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function _n(s){return N0(po,s)}function jd(s,a){return po===null&&go(s),N0(s,a)}function N0(s,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},$s===null){if(s===null)throw Error(r(308));$s=a,s.dependencies={lanes:0,firstContext:a},s.flags|=524288}else $s=$s.next=a;return c}var _A=typeof AbortController<"u"?AbortController:function(){var s=[],a=this.signal={aborted:!1,addEventListener:function(c,f){s.push(f)}};this.abort=function(){a.aborted=!0,s.forEach(function(c){return c()})}},EA=e.unstable_scheduleCallback,TA=e.unstable_NormalPriority,nn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function lp(){return{controller:new _A,data:new Map,refCount:0}}function ac(s){s.refCount--,s.refCount===0&&EA(TA,function(){s.controller.abort()})}var oc=null,cp=0,bi=0,wi=null;function MA(s,a){if(oc===null){var c=oc=[];cp=0,bi=fg(),wi={status:"pending",value:void 0,then:function(f){c.push(f)}}}return cp++,a.then(k0,k0),a}function k0(){if(--cp===0&&oc!==null){wi!==null&&(wi.status="fulfilled");var s=oc;oc=null,bi=0,wi=null;for(var a=0;a<s.length;a++)(0,s[a])()}}function RA(s,a){var c=[],f={status:"pending",value:null,reason:null,then:function(x){c.push(x)}};return s.then(function(){f.status="fulfilled",f.value=a;for(var x=0;x<c.length;x++)(0,c[x])(a)},function(x){for(f.status="rejected",f.reason=x,x=0;x<c.length;x++)(0,c[x])(void 0)}),f}var _0=L.S;L.S=function(s,a){uS=ct(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&MA(s,a),_0!==null&&_0(s,a)};var vo=I(null);function up(){var s=vo.current;return s!==null?s:Rt.pooledCache}function Cd(s,a){a===null?K(vo,vo.current):K(vo,a.pool)}function E0(){var s=up();return s===null?null:{parent:nn._currentValue,pool:s}}var Si=Error(r(460)),dp=Error(r(474)),Nd=Error(r(542)),kd={then:function(){}};function T0(s){return s=s.status,s==="fulfilled"||s==="rejected"}function M0(s,a,c){switch(c=s[c],c===void 0?s.push(a):c!==a&&(a.then(zs,zs),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,A0(s),s;default:if(typeof a.status=="string")a.then(zs,zs);else{if(s=Rt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=a,s.status="pending",s.then(function(f){if(a.status==="pending"){var x=a;x.status="fulfilled",x.value=f}},function(f){if(a.status==="pending"){var x=a;x.status="rejected",x.reason=f}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw s=a.reason,A0(s),s}throw yo=a,Si}}function xo(s){try{var a=s._init;return a(s._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(yo=c,Si):c}}var yo=null;function R0(){if(yo===null)throw Error(r(459));var s=yo;return yo=null,s}function A0(s){if(s===Si||s===Nd)throw Error(r(483))}var ji=null,ic=0;function _d(s){var a=ic;return ic+=1,ji===null&&(ji=[]),M0(ji,s,a)}function lc(s,a){a=a.props.ref,s.ref=a!==void 0?a:null}function Ed(s,a){throw a.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(a),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s)))}function O0(s){function a(J,Z){if(s){var re=J.deletions;re===null?(J.deletions=[Z],J.flags|=16):re.push(Z)}}function c(J,Z){if(!s)return null;for(;Z!==null;)a(J,Z),Z=Z.sibling;return null}function f(J){for(var Z=new Map;J!==null;)J.key!==null?Z.set(J.key,J):Z.set(J.index,J),J=J.sibling;return Z}function x(J,Z){return J=Ls(J,Z),J.index=0,J.sibling=null,J}function b(J,Z,re){return J.index=re,s?(re=J.alternate,re!==null?(re=re.index,re<Z?(J.flags|=67108866,Z):re):(J.flags|=67108866,Z)):(J.flags|=1048576,Z)}function k(J){return s&&J.alternate===null&&(J.flags|=67108866),J}function P(J,Z,re,de){return Z===null||Z.tag!==6?(Z=Jm(re,J.mode,de),Z.return=J,Z):(Z=x(Z,re),Z.return=J,Z)}function q(J,Z,re,de){var Ie=re.type;return Ie===j?ce(J,Z,re.props.children,de,re.key):Z!==null&&(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===O&&xo(Ie)===Z.type)?(Z=x(Z,re.props),lc(Z,re),Z.return=J,Z):(Z=bd(re.type,re.key,re.props,null,J.mode,de),lc(Z,re),Z.return=J,Z)}function se(J,Z,re,de){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==re.containerInfo||Z.stateNode.implementation!==re.implementation?(Z=ep(re,J.mode,de),Z.return=J,Z):(Z=x(Z,re.children||[]),Z.return=J,Z)}function ce(J,Z,re,de,Ie){return Z===null||Z.tag!==7?(Z=ho(re,J.mode,de,Ie),Z.return=J,Z):(Z=x(Z,re),Z.return=J,Z)}function he(J,Z,re){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Jm(""+Z,J.mode,re),Z.return=J,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return re=bd(Z.type,Z.key,Z.props,null,J.mode,re),lc(re,Z),re.return=J,re;case S:return Z=ep(Z,J.mode,re),Z.return=J,Z;case O:return Z=xo(Z),he(J,Z,re)}if(ae(Z)||V(Z))return Z=ho(Z,J.mode,re,null),Z.return=J,Z;if(typeof Z.then=="function")return he(J,_d(Z),re);if(Z.$$typeof===E)return he(J,jd(J,Z),re);Ed(J,Z)}return null}function oe(J,Z,re,de){var Ie=Z!==null?Z.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ie!==null?null:P(J,Z,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return re.key===Ie?q(J,Z,re,de):null;case S:return re.key===Ie?se(J,Z,re,de):null;case O:return re=xo(re),oe(J,Z,re,de)}if(ae(re)||V(re))return Ie!==null?null:ce(J,Z,re,de,null);if(typeof re.then=="function")return oe(J,Z,_d(re),de);if(re.$$typeof===E)return oe(J,Z,jd(J,re),de);Ed(J,re)}return null}function ie(J,Z,re,de,Ie){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return J=J.get(re)||null,P(Z,J,""+de,Ie);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case w:return J=J.get(de.key===null?re:de.key)||null,q(Z,J,de,Ie);case S:return J=J.get(de.key===null?re:de.key)||null,se(Z,J,de,Ie);case O:return de=xo(de),ie(J,Z,re,de,Ie)}if(ae(de)||V(de))return J=J.get(re)||null,ce(Z,J,de,Ie,null);if(typeof de.then=="function")return ie(J,Z,re,_d(de),Ie);if(de.$$typeof===E)return ie(J,Z,re,jd(Z,de),Ie);Ed(Z,de)}return null}function Ee(J,Z,re,de){for(var Ie=null,ft=null,Ae=Z,Xe=Z=0,lt=null;Ae!==null&&Xe<re.length;Xe++){Ae.index>Xe?(lt=Ae,Ae=null):lt=Ae.sibling;var ht=oe(J,Ae,re[Xe],de);if(ht===null){Ae===null&&(Ae=lt);break}s&&Ae&&ht.alternate===null&&a(J,Ae),Z=b(ht,Z,Xe),ft===null?Ie=ht:ft.sibling=ht,ft=ht,Ae=lt}if(Xe===re.length)return c(J,Ae),ut&&Is(J,Xe),Ie;if(Ae===null){for(;Xe<re.length;Xe++)Ae=he(J,re[Xe],de),Ae!==null&&(Z=b(Ae,Z,Xe),ft===null?Ie=Ae:ft.sibling=Ae,ft=Ae);return ut&&Is(J,Xe),Ie}for(Ae=f(Ae);Xe<re.length;Xe++)lt=ie(Ae,J,Xe,re[Xe],de),lt!==null&&(s&&lt.alternate!==null&&Ae.delete(lt.key===null?Xe:lt.key),Z=b(lt,Z,Xe),ft===null?Ie=lt:ft.sibling=lt,ft=lt);return s&&Ae.forEach(function(Ia){return a(J,Ia)}),ut&&Is(J,Xe),Ie}function qe(J,Z,re,de){if(re==null)throw Error(r(151));for(var Ie=null,ft=null,Ae=Z,Xe=Z=0,lt=null,ht=re.next();Ae!==null&&!ht.done;Xe++,ht=re.next()){Ae.index>Xe?(lt=Ae,Ae=null):lt=Ae.sibling;var Ia=oe(J,Ae,ht.value,de);if(Ia===null){Ae===null&&(Ae=lt);break}s&&Ae&&Ia.alternate===null&&a(J,Ae),Z=b(Ia,Z,Xe),ft===null?Ie=Ia:ft.sibling=Ia,ft=Ia,Ae=lt}if(ht.done)return c(J,Ae),ut&&Is(J,Xe),Ie;if(Ae===null){for(;!ht.done;Xe++,ht=re.next())ht=he(J,ht.value,de),ht!==null&&(Z=b(ht,Z,Xe),ft===null?Ie=ht:ft.sibling=ht,ft=ht);return ut&&Is(J,Xe),Ie}for(Ae=f(Ae);!ht.done;Xe++,ht=re.next())ht=ie(Ae,J,Xe,ht.value,de),ht!==null&&(s&&ht.alternate!==null&&Ae.delete(ht.key===null?Xe:ht.key),Z=b(ht,Z,Xe),ft===null?Ie=ht:ft.sibling=ht,ft=ht);return s&&Ae.forEach(function(UO){return a(J,UO)}),ut&&Is(J,Xe),Ie}function Et(J,Z,re,de){if(typeof re=="object"&&re!==null&&re.type===j&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case w:e:{for(var Ie=re.key;Z!==null;){if(Z.key===Ie){if(Ie=re.type,Ie===j){if(Z.tag===7){c(J,Z.sibling),de=x(Z,re.props.children),de.return=J,J=de;break e}}else if(Z.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===O&&xo(Ie)===Z.type){c(J,Z.sibling),de=x(Z,re.props),lc(de,re),de.return=J,J=de;break e}c(J,Z);break}else a(J,Z);Z=Z.sibling}re.type===j?(de=ho(re.props.children,J.mode,de,re.key),de.return=J,J=de):(de=bd(re.type,re.key,re.props,null,J.mode,de),lc(de,re),de.return=J,J=de)}return k(J);case S:e:{for(Ie=re.key;Z!==null;){if(Z.key===Ie)if(Z.tag===4&&Z.stateNode.containerInfo===re.containerInfo&&Z.stateNode.implementation===re.implementation){c(J,Z.sibling),de=x(Z,re.children||[]),de.return=J,J=de;break e}else{c(J,Z);break}else a(J,Z);Z=Z.sibling}de=ep(re,J.mode,de),de.return=J,J=de}return k(J);case O:return re=xo(re),Et(J,Z,re,de)}if(ae(re))return Ee(J,Z,re,de);if(V(re)){if(Ie=V(re),typeof Ie!="function")throw Error(r(150));return re=Ie.call(re),qe(J,Z,re,de)}if(typeof re.then=="function")return Et(J,Z,_d(re),de);if(re.$$typeof===E)return Et(J,Z,jd(J,re),de);Ed(J,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Z!==null&&Z.tag===6?(c(J,Z.sibling),de=x(Z,re),de.return=J,J=de):(c(J,Z),de=Jm(re,J.mode,de),de.return=J,J=de),k(J)):c(J,Z)}return function(J,Z,re,de){try{ic=0;var Ie=Et(J,Z,re,de);return ji=null,Ie}catch(Ae){if(Ae===Si||Ae===Nd)throw Ae;var ft=lr(29,Ae,null,J.mode);return ft.lanes=de,ft.return=J,ft}}}var bo=O0(!0),D0=O0(!1),wa=!1;function fp(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hp(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Sa(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ja(s,a,c){var f=s.updateQueue;if(f===null)return null;if(f=f.shared,(vt&2)!==0){var x=f.pending;return x===null?a.next=a:(a.next=x.next,x.next=a),f.pending=a,a=yd(s),v0(s,null,c),a}return xd(s,f,a,c),yd(s)}function cc(s,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var f=a.lanes;f&=s.pendingLanes,c|=f,a.lanes=c,wn(s,c)}}function mp(s,a){var c=s.updateQueue,f=s.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var x=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var k={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?x=b=k:b=b.next=k,c=c.next}while(c!==null);b===null?x=b=a:b=b.next=a}else x=b=a;c={baseState:f.baseState,firstBaseUpdate:x,lastBaseUpdate:b,shared:f.shared,callbacks:f.callbacks},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=a:s.next=a,c.lastBaseUpdate=a}var pp=!1;function uc(){if(pp){var s=wi;if(s!==null)throw s}}function dc(s,a,c,f){pp=!1;var x=s.updateQueue;wa=!1;var b=x.firstBaseUpdate,k=x.lastBaseUpdate,P=x.shared.pending;if(P!==null){x.shared.pending=null;var q=P,se=q.next;q.next=null,k===null?b=se:k.next=se,k=q;var ce=s.alternate;ce!==null&&(ce=ce.updateQueue,P=ce.lastBaseUpdate,P!==k&&(P===null?ce.firstBaseUpdate=se:P.next=se,ce.lastBaseUpdate=q))}if(b!==null){var he=x.baseState;k=0,ce=se=q=null,P=b;do{var oe=P.lane&-536870913,ie=oe!==P.lane;if(ie?(it&oe)===oe:(f&oe)===oe){oe!==0&&oe===bi&&(pp=!0),ce!==null&&(ce=ce.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ee=s,qe=P;oe=a;var Et=c;switch(qe.tag){case 1:if(Ee=qe.payload,typeof Ee=="function"){he=Ee.call(Et,he,oe);break e}he=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=qe.payload,oe=typeof Ee=="function"?Ee.call(Et,he,oe):Ee,oe==null)break e;he=g({},he,oe);break e;case 2:wa=!0}}oe=P.callback,oe!==null&&(s.flags|=64,ie&&(s.flags|=8192),ie=x.callbacks,ie===null?x.callbacks=[oe]:ie.push(oe))}else ie={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ce===null?(se=ce=ie,q=he):ce=ce.next=ie,k|=oe;if(P=P.next,P===null){if(P=x.shared.pending,P===null)break;ie=P,P=ie.next,ie.next=null,x.lastBaseUpdate=ie,x.shared.pending=null}}while(!0);ce===null&&(q=he),x.baseState=q,x.firstBaseUpdate=se,x.lastBaseUpdate=ce,b===null&&(x.shared.lanes=0),Ea|=k,s.lanes=k,s.memoizedState=he}}function z0(s,a){if(typeof s!="function")throw Error(r(191,s));s.call(a)}function P0(s,a){var c=s.callbacks;if(c!==null)for(s.callbacks=null,s=0;s<c.length;s++)z0(c[s],a)}var Ci=I(null),Td=I(0);function L0(s,a){s=Zs,K(Td,s),K(Ci,a),Zs=s|a.baseLanes}function gp(){K(Td,Zs),K(Ci,Ci.current)}function vp(){Zs=Td.current,F(Ci),F(Td)}var cr=I(null),Ar=null;function Ca(s){var a=s.alternate;K(Qt,Qt.current&1),K(cr,s),Ar===null&&(a===null||Ci.current!==null||a.memoizedState!==null)&&(Ar=s)}function xp(s){K(Qt,Qt.current),K(cr,s),Ar===null&&(Ar=s)}function I0(s){s.tag===22?(K(Qt,Qt.current),K(cr,s),Ar===null&&(Ar=s)):Na()}function Na(){K(Qt,Qt.current),K(cr,cr.current)}function ur(s){F(cr),Ar===s&&(Ar=null),F(Qt)}var Qt=I(0);function Md(s){for(var a=s;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Cg(c)||Ng(c)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Bs=0,Ze=null,kt=null,rn=null,Rd=!1,Ni=!1,wo=!1,Ad=0,fc=0,ki=null,AA=0;function Vt(){throw Error(r(321))}function yp(s,a){if(a===null)return!1;for(var c=0;c<a.length&&c<s.length;c++)if(!ir(s[c],a[c]))return!1;return!0}function bp(s,a,c,f,x,b){return Bs=b,Ze=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,L.H=s===null||s.memoizedState===null?ww:zp,wo=!1,b=c(f,x),wo=!1,Ni&&(b=F0(a,c,f,x)),$0(s),b}function $0(s){L.H=pc;var a=kt!==null&&kt.next!==null;if(Bs=0,rn=kt=Ze=null,Rd=!1,fc=0,ki=null,a)throw Error(r(300));s===null||sn||(s=s.dependencies,s!==null&&Sd(s)&&(sn=!0))}function F0(s,a,c,f){Ze=s;var x=0;do{if(Ni&&(ki=null),fc=0,Ni=!1,25<=x)throw Error(r(301));if(x+=1,rn=kt=null,s.updateQueue!=null){var b=s.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}L.H=Sw,b=a(c,f)}while(Ni);return b}function OA(){var s=L.H,a=s.useState()[0];return a=typeof a.then=="function"?hc(a):a,s=s.useState()[0],(kt!==null?kt.memoizedState:null)!==s&&(Ze.flags|=1024),a}function wp(){var s=Ad!==0;return Ad=0,s}function Sp(s,a,c){a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~c}function jp(s){if(Rd){for(s=s.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}Rd=!1}Bs=0,rn=kt=Ze=null,Ni=!1,fc=Ad=0,ki=null}function Ln(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ze.memoizedState=rn=s:rn=rn.next=s,rn}function Kt(){if(kt===null){var s=Ze.alternate;s=s!==null?s.memoizedState:null}else s=kt.next;var a=rn===null?Ze.memoizedState:rn.next;if(a!==null)rn=a,kt=s;else{if(s===null)throw Ze.alternate===null?Error(r(467)):Error(r(310));kt=s,s={memoizedState:kt.memoizedState,baseState:kt.baseState,baseQueue:kt.baseQueue,queue:kt.queue,next:null},rn===null?Ze.memoizedState=rn=s:rn=rn.next=s}return rn}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hc(s){var a=fc;return fc+=1,ki===null&&(ki=[]),s=M0(ki,s,a),a=Ze,(rn===null?a.memoizedState:rn.next)===null&&(a=a.alternate,L.H=a===null||a.memoizedState===null?ww:zp),s}function Dd(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return hc(s);if(s.$$typeof===E)return _n(s)}throw Error(r(438,String(s)))}function Cp(s){var a=null,c=Ze.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var f=Ze.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(a={data:f.data.map(function(x){return x.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=Od(),Ze.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(s),f=0;f<s;f++)c[f]=z;return a.index++,c}function Us(s,a){return typeof a=="function"?a(s):a}function zd(s){var a=Kt();return Np(a,kt,s)}function Np(s,a,c){var f=s.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var x=s.baseQueue,b=f.pending;if(b!==null){if(x!==null){var k=x.next;x.next=b.next,b.next=k}a.baseQueue=x=b,f.pending=null}if(b=s.baseState,x===null)s.memoizedState=b;else{a=x.next;var P=k=null,q=null,se=a,ce=!1;do{var he=se.lane&-536870913;if(he!==se.lane?(it&he)===he:(Bs&he)===he){var oe=se.revertLane;if(oe===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),he===bi&&(ce=!0);else if((Bs&oe)===oe){se=se.next,oe===bi&&(ce=!0);continue}else he={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},q===null?(P=q=he,k=b):q=q.next=he,Ze.lanes|=oe,Ea|=oe;he=se.action,wo&&c(b,he),b=se.hasEagerState?se.eagerState:c(b,he)}else oe={lane:he,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},q===null?(P=q=oe,k=b):q=q.next=oe,Ze.lanes|=he,Ea|=he;se=se.next}while(se!==null&&se!==a);if(q===null?k=b:q.next=P,!ir(b,s.memoizedState)&&(sn=!0,ce&&(c=wi,c!==null)))throw c;s.memoizedState=b,s.baseState=k,s.baseQueue=q,f.lastRenderedState=b}return x===null&&(f.lanes=0),[s.memoizedState,f.dispatch]}function kp(s){var a=Kt(),c=a.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=s;var f=c.dispatch,x=c.pending,b=a.memoizedState;if(x!==null){c.pending=null;var k=x=x.next;do b=s(b,k.action),k=k.next;while(k!==x);ir(b,a.memoizedState)||(sn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),c.lastRenderedState=b}return[b,f]}function B0(s,a,c){var f=Ze,x=Kt(),b=ut;if(b){if(c===void 0)throw Error(r(407));c=c()}else c=a();var k=!ir((kt||x).memoizedState,c);if(k&&(x.memoizedState=c,sn=!0),x=x.queue,Tp(V0.bind(null,f,x,s),[s]),x.getSnapshot!==a||k||rn!==null&&rn.memoizedState.tag&1){if(f.flags|=2048,_i(9,{destroy:void 0},q0.bind(null,f,x,c,a),null),Rt===null)throw Error(r(349));b||(Bs&127)!==0||U0(f,a,c)}return c}function U0(s,a,c){s.flags|=16384,s={getSnapshot:a,value:c},a=Ze.updateQueue,a===null?(a=Od(),Ze.updateQueue=a,a.stores=[s]):(c=a.stores,c===null?a.stores=[s]:c.push(s))}function q0(s,a,c,f){a.value=c,a.getSnapshot=f,H0(a)&&Y0(s)}function V0(s,a,c){return c(function(){H0(a)&&Y0(s)})}function H0(s){var a=s.getSnapshot;s=s.value;try{var c=a();return!ir(s,c)}catch{return!0}}function Y0(s){var a=fo(s,2);a!==null&&Jn(a,s,2)}function _p(s){var a=Ln();if(typeof s=="function"){var c=s;if(s=c(),wo){en(!0);try{c()}finally{en(!1)}}}return a.memoizedState=a.baseState=s,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:s},a}function W0(s,a,c,f){return s.baseState=c,Np(s,kt,typeof f=="function"?f:Us)}function DA(s,a,c,f,x){if(Id(s))throw Error(r(485));if(s=a.action,s!==null){var b={payload:x,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){b.listeners.push(k)}};L.T!==null?c(!0):b.isTransition=!1,f(b),c=a.pending,c===null?(b.next=a.pending=b,G0(a,b)):(b.next=c.next,a.pending=c.next=b)}}function G0(s,a){var c=a.action,f=a.payload,x=s.state;if(a.isTransition){var b=L.T,k={};L.T=k;try{var P=c(x,f),q=L.S;q!==null&&q(k,P),Z0(s,a,P)}catch(se){Ep(s,a,se)}finally{b!==null&&k.types!==null&&(b.types=k.types),L.T=b}}else try{b=c(x,f),Z0(s,a,b)}catch(se){Ep(s,a,se)}}function Z0(s,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){Q0(s,a,f)},function(f){return Ep(s,a,f)}):Q0(s,a,c)}function Q0(s,a,c){a.status="fulfilled",a.value=c,K0(a),s.state=c,a=s.pending,a!==null&&(c=a.next,c===a?s.pending=null:(c=c.next,a.next=c,G0(s,c)))}function Ep(s,a,c){var f=s.pending;if(s.pending=null,f!==null){f=f.next;do a.status="rejected",a.reason=c,K0(a),a=a.next;while(a!==f)}s.action=null}function K0(s){s=s.listeners;for(var a=0;a<s.length;a++)(0,s[a])()}function X0(s,a){return a}function J0(s,a){if(ut){var c=Rt.formState;if(c!==null){e:{var f=Ze;if(ut){if(Dt){t:{for(var x=Dt,b=Rr;x.nodeType!==8;){if(!b){x=null;break t}if(x=Or(x.nextSibling),x===null){x=null;break t}}b=x.data,x=b==="F!"||b==="F"?x:null}if(x){Dt=Or(x.nextSibling),f=x.data==="F!";break e}}ya(f)}f=!1}f&&(a=c[0])}}return c=Ln(),c.memoizedState=c.baseState=a,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:X0,lastRenderedState:a},c.queue=f,c=xw.bind(null,Ze,f),f.dispatch=c,f=_p(!1),b=Dp.bind(null,Ze,!1,f.queue),f=Ln(),x={state:a,dispatch:null,action:s,pending:null},f.queue=x,c=DA.bind(null,Ze,x,b,c),x.dispatch=c,f.memoizedState=s,[a,c,!1]}function ew(s){var a=Kt();return tw(a,kt,s)}function tw(s,a,c){if(a=Np(s,a,X0)[0],s=zd(Us)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var f=hc(a)}catch(k){throw k===Si?Nd:k}else f=a;a=Kt();var x=a.queue,b=x.dispatch;return c!==a.memoizedState&&(Ze.flags|=2048,_i(9,{destroy:void 0},zA.bind(null,x,c),null)),[f,b,s]}function zA(s,a){s.action=a}function nw(s){var a=Kt(),c=kt;if(c!==null)return tw(a,c,s);Kt(),a=a.memoizedState,c=Kt();var f=c.queue.dispatch;return c.memoizedState=s,[a,f,!1]}function _i(s,a,c,f){return s={tag:s,create:c,deps:f,inst:a,next:null},a=Ze.updateQueue,a===null&&(a=Od(),Ze.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=s.next=s:(f=c.next,c.next=s,s.next=f,a.lastEffect=s),s}function rw(){return Kt().memoizedState}function Pd(s,a,c,f){var x=Ln();Ze.flags|=s,x.memoizedState=_i(1|a,{destroy:void 0},c,f===void 0?null:f)}function Ld(s,a,c,f){var x=Kt();f=f===void 0?null:f;var b=x.memoizedState.inst;kt!==null&&f!==null&&yp(f,kt.memoizedState.deps)?x.memoizedState=_i(a,b,c,f):(Ze.flags|=s,x.memoizedState=_i(1|a,b,c,f))}function sw(s,a){Pd(8390656,8,s,a)}function Tp(s,a){Ld(2048,8,s,a)}function PA(s){Ze.flags|=4;var a=Ze.updateQueue;if(a===null)a=Od(),Ze.updateQueue=a,a.events=[s];else{var c=a.events;c===null?a.events=[s]:c.push(s)}}function aw(s){var a=Kt().memoizedState;return PA({ref:a,nextImpl:s}),function(){if((vt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function ow(s,a){return Ld(4,2,s,a)}function iw(s,a){return Ld(4,4,s,a)}function lw(s,a){if(typeof a=="function"){s=s();var c=a(s);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function cw(s,a,c){c=c!=null?c.concat([s]):null,Ld(4,4,lw.bind(null,a,s),c)}function Mp(){}function uw(s,a){var c=Kt();a=a===void 0?null:a;var f=c.memoizedState;return a!==null&&yp(a,f[1])?f[0]:(c.memoizedState=[s,a],s)}function dw(s,a){var c=Kt();a=a===void 0?null:a;var f=c.memoizedState;if(a!==null&&yp(a,f[1]))return f[0];if(f=s(),wo){en(!0);try{s()}finally{en(!1)}}return c.memoizedState=[f,a],f}function Rp(s,a,c){return c===void 0||(Bs&1073741824)!==0&&(it&261930)===0?s.memoizedState=a:(s.memoizedState=c,s=fS(),Ze.lanes|=s,Ea|=s,c)}function fw(s,a,c,f){return ir(c,a)?c:Ci.current!==null?(s=Rp(s,c,f),ir(s,a)||(sn=!0),s):(Bs&42)===0||(Bs&1073741824)!==0&&(it&261930)===0?(sn=!0,s.memoizedState=c):(s=fS(),Ze.lanes|=s,Ea|=s,a)}function hw(s,a,c,f,x){var b=$.p;$.p=b!==0&&8>b?b:8;var k=L.T,P={};L.T=P,Dp(s,!1,a,c);try{var q=x(),se=L.S;if(se!==null&&se(P,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var ce=RA(q,f);mc(s,a,ce,hr(s))}else mc(s,a,f,hr(s))}catch(he){mc(s,a,{then:function(){},status:"rejected",reason:he},hr())}finally{$.p=b,k!==null&&P.types!==null&&(k.types=P.types),L.T=k}}function LA(){}function Ap(s,a,c,f){if(s.tag!==5)throw Error(r(476));var x=mw(s).queue;hw(s,x,a,U,c===null?LA:function(){return pw(s),c(f)})}function mw(s){var a=s.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:U},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Us,lastRenderedState:c},next:null},s.memoizedState=a,s=s.alternate,s!==null&&(s.memoizedState=a),a}function pw(s){var a=mw(s);a.next===null&&(a=s.alternate.memoizedState),mc(s,a.next.queue,{},hr())}function Op(){return _n(Rc)}function gw(){return Kt().memoizedState}function vw(){return Kt().memoizedState}function IA(s){for(var a=s.return;a!==null;){switch(a.tag){case 24:case 3:var c=hr();s=Sa(c);var f=ja(a,s,c);f!==null&&(Jn(f,a,c),cc(f,a,c)),a={cache:lp()},s.payload=a;return}a=a.return}}function $A(s,a,c){var f=hr();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Id(s)?yw(a,c):(c=Km(s,a,c,f),c!==null&&(Jn(c,s,f),bw(c,a,f)))}function xw(s,a,c){var f=hr();mc(s,a,c,f)}function mc(s,a,c,f){var x={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Id(s))yw(a,x);else{var b=s.alternate;if(s.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var k=a.lastRenderedState,P=b(k,c);if(x.hasEagerState=!0,x.eagerState=P,ir(P,k))return xd(s,a,x,0),Rt===null&&vd(),!1}catch{}if(c=Km(s,a,x,f),c!==null)return Jn(c,s,f),bw(c,a,f),!0}return!1}function Dp(s,a,c,f){if(f={lane:2,revertLane:fg(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Id(s)){if(a)throw Error(r(479))}else a=Km(s,c,f,2),a!==null&&Jn(a,s,2)}function Id(s){var a=s.alternate;return s===Ze||a!==null&&a===Ze}function yw(s,a){Ni=Rd=!0;var c=s.pending;c===null?a.next=a:(a.next=c.next,c.next=a),s.pending=a}function bw(s,a,c){if((c&4194048)!==0){var f=a.lanes;f&=s.pendingLanes,c|=f,a.lanes=c,wn(s,c)}}var pc={readContext:_n,use:Dd,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useLayoutEffect:Vt,useInsertionEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useSyncExternalStore:Vt,useId:Vt,useHostTransitionStatus:Vt,useFormState:Vt,useActionState:Vt,useOptimistic:Vt,useMemoCache:Vt,useCacheRefresh:Vt};pc.useEffectEvent=Vt;var ww={readContext:_n,use:Dd,useCallback:function(s,a){return Ln().memoizedState=[s,a===void 0?null:a],s},useContext:_n,useEffect:sw,useImperativeHandle:function(s,a,c){c=c!=null?c.concat([s]):null,Pd(4194308,4,lw.bind(null,a,s),c)},useLayoutEffect:function(s,a){return Pd(4194308,4,s,a)},useInsertionEffect:function(s,a){Pd(4,2,s,a)},useMemo:function(s,a){var c=Ln();a=a===void 0?null:a;var f=s();if(wo){en(!0);try{s()}finally{en(!1)}}return c.memoizedState=[f,a],f},useReducer:function(s,a,c){var f=Ln();if(c!==void 0){var x=c(a);if(wo){en(!0);try{c(a)}finally{en(!1)}}}else x=a;return f.memoizedState=f.baseState=x,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:x},f.queue=s,s=s.dispatch=$A.bind(null,Ze,s),[f.memoizedState,s]},useRef:function(s){var a=Ln();return s={current:s},a.memoizedState=s},useState:function(s){s=_p(s);var a=s.queue,c=xw.bind(null,Ze,a);return a.dispatch=c,[s.memoizedState,c]},useDebugValue:Mp,useDeferredValue:function(s,a){var c=Ln();return Rp(c,s,a)},useTransition:function(){var s=_p(!1);return s=hw.bind(null,Ze,s.queue,!0,!1),Ln().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,a,c){var f=Ze,x=Ln();if(ut){if(c===void 0)throw Error(r(407));c=c()}else{if(c=a(),Rt===null)throw Error(r(349));(it&127)!==0||U0(f,a,c)}x.memoizedState=c;var b={value:c,getSnapshot:a};return x.queue=b,sw(V0.bind(null,f,b,s),[s]),f.flags|=2048,_i(9,{destroy:void 0},q0.bind(null,f,b,c,a),null),c},useId:function(){var s=Ln(),a=Rt.identifierPrefix;if(ut){var c=fs,f=ds;c=(f&~(1<<32-$t(f)-1)).toString(32)+c,a="_"+a+"R_"+c,c=Ad++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=AA++,a="_"+a+"r_"+c.toString(32)+"_";return s.memoizedState=a},useHostTransitionStatus:Op,useFormState:J0,useActionState:J0,useOptimistic:function(s){var a=Ln();a.memoizedState=a.baseState=s;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=Dp.bind(null,Ze,!0,c),c.dispatch=a,[s,a]},useMemoCache:Cp,useCacheRefresh:function(){return Ln().memoizedState=IA.bind(null,Ze)},useEffectEvent:function(s){var a=Ln(),c={impl:s};return a.memoizedState=c,function(){if((vt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},zp={readContext:_n,use:Dd,useCallback:uw,useContext:_n,useEffect:Tp,useImperativeHandle:cw,useInsertionEffect:ow,useLayoutEffect:iw,useMemo:dw,useReducer:zd,useRef:rw,useState:function(){return zd(Us)},useDebugValue:Mp,useDeferredValue:function(s,a){var c=Kt();return fw(c,kt.memoizedState,s,a)},useTransition:function(){var s=zd(Us)[0],a=Kt().memoizedState;return[typeof s=="boolean"?s:hc(s),a]},useSyncExternalStore:B0,useId:gw,useHostTransitionStatus:Op,useFormState:ew,useActionState:ew,useOptimistic:function(s,a){var c=Kt();return W0(c,kt,s,a)},useMemoCache:Cp,useCacheRefresh:vw};zp.useEffectEvent=aw;var Sw={readContext:_n,use:Dd,useCallback:uw,useContext:_n,useEffect:Tp,useImperativeHandle:cw,useInsertionEffect:ow,useLayoutEffect:iw,useMemo:dw,useReducer:kp,useRef:rw,useState:function(){return kp(Us)},useDebugValue:Mp,useDeferredValue:function(s,a){var c=Kt();return kt===null?Rp(c,s,a):fw(c,kt.memoizedState,s,a)},useTransition:function(){var s=kp(Us)[0],a=Kt().memoizedState;return[typeof s=="boolean"?s:hc(s),a]},useSyncExternalStore:B0,useId:gw,useHostTransitionStatus:Op,useFormState:nw,useActionState:nw,useOptimistic:function(s,a){var c=Kt();return kt!==null?W0(c,kt,s,a):(c.baseState=s,[s,c.queue.dispatch])},useMemoCache:Cp,useCacheRefresh:vw};Sw.useEffectEvent=aw;function Pp(s,a,c,f){a=s.memoizedState,c=c(f,a),c=c==null?a:g({},a,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var Lp={enqueueSetState:function(s,a,c){s=s._reactInternals;var f=hr(),x=Sa(f);x.payload=a,c!=null&&(x.callback=c),a=ja(s,x,f),a!==null&&(Jn(a,s,f),cc(a,s,f))},enqueueReplaceState:function(s,a,c){s=s._reactInternals;var f=hr(),x=Sa(f);x.tag=1,x.payload=a,c!=null&&(x.callback=c),a=ja(s,x,f),a!==null&&(Jn(a,s,f),cc(a,s,f))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var c=hr(),f=Sa(c);f.tag=2,a!=null&&(f.callback=a),a=ja(s,f,c),a!==null&&(Jn(a,s,c),cc(a,s,c))}};function jw(s,a,c,f,x,b,k){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(f,b,k):a.prototype&&a.prototype.isPureReactComponent?!tc(c,f)||!tc(x,b):!0}function Cw(s,a,c,f){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,f),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,f),a.state!==s&&Lp.enqueueReplaceState(a,a.state,null)}function So(s,a){var c=a;if("ref"in a){c={};for(var f in a)f!=="ref"&&(c[f]=a[f])}if(s=s.defaultProps){c===a&&(c=g({},c));for(var x in s)c[x]===void 0&&(c[x]=s[x])}return c}function Nw(s){gd(s)}function kw(s){console.error(s)}function _w(s){gd(s)}function $d(s,a){try{var c=s.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(f){setTimeout(function(){throw f})}}function Ew(s,a,c){try{var f=s.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Ip(s,a,c){return c=Sa(c),c.tag=3,c.payload={element:null},c.callback=function(){$d(s,a)},c}function Tw(s){return s=Sa(s),s.tag=3,s}function Mw(s,a,c,f){var x=c.type.getDerivedStateFromError;if(typeof x=="function"){var b=f.value;s.payload=function(){return x(b)},s.callback=function(){Ew(a,c,f)}}var k=c.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(s.callback=function(){Ew(a,c,f),typeof x!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var P=f.stack;this.componentDidCatch(f.value,{componentStack:P!==null?P:""})})}function FA(s,a,c,f,x){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(a=c.alternate,a!==null&&yi(a,c,x,!0),c=cr.current,c!==null){switch(c.tag){case 31:case 13:return Ar===null?Kd():c.alternate===null&&Ht===0&&(Ht=3),c.flags&=-257,c.flags|=65536,c.lanes=x,f===kd?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([f]):a.add(f),cg(s,f,x)),!1;case 22:return c.flags|=65536,f===kd?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([f]):c.add(f)),cg(s,f,x)),!1}throw Error(r(435,c.tag))}return cg(s,f,x),Kd(),!1}if(ut)return a=cr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=x,f!==rp&&(s=Error(r(422),{cause:f}),sc(Er(s,c)))):(f!==rp&&(a=Error(r(423),{cause:f}),sc(Er(a,c))),s=s.current.alternate,s.flags|=65536,x&=-x,s.lanes|=x,f=Er(f,c),x=Ip(s.stateNode,f,x),mp(s,x),Ht!==4&&(Ht=2)),!1;var b=Error(r(520),{cause:f});if(b=Er(b,c),jc===null?jc=[b]:jc.push(b),Ht!==4&&(Ht=2),a===null)return!0;f=Er(f,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,s=x&-x,c.lanes|=s,s=Ip(c.stateNode,f,s),mp(c,s),!1;case 1:if(a=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ta===null||!Ta.has(b))))return c.flags|=65536,x&=-x,c.lanes|=x,x=Tw(x),Mw(x,s,c,f),mp(c,x),!1}c=c.return}while(c!==null);return!1}var $p=Error(r(461)),sn=!1;function En(s,a,c,f){a.child=s===null?D0(a,null,c,f):bo(a,s.child,c,f)}function Rw(s,a,c,f,x){c=c.render;var b=a.ref;if("ref"in f){var k={};for(var P in f)P!=="ref"&&(k[P]=f[P])}else k=f;return go(a),f=bp(s,a,c,k,b,x),P=wp(),s!==null&&!sn?(Sp(s,a,x),qs(s,a,x)):(ut&&P&&tp(a),a.flags|=1,En(s,a,f,x),a.child)}function Aw(s,a,c,f,x){if(s===null){var b=c.type;return typeof b=="function"&&!Xm(b)&&b.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=b,Ow(s,a,b,f,x)):(s=bd(c.type,null,f,a,a.mode,x),s.ref=a.ref,s.return=a,a.child=s)}if(b=s.child,!Wp(s,x)){var k=b.memoizedProps;if(c=c.compare,c=c!==null?c:tc,c(k,f)&&s.ref===a.ref)return qs(s,a,x)}return a.flags|=1,s=Ls(b,f),s.ref=a.ref,s.return=a,a.child=s}function Ow(s,a,c,f,x){if(s!==null){var b=s.memoizedProps;if(tc(b,f)&&s.ref===a.ref)if(sn=!1,a.pendingProps=f=b,Wp(s,x))(s.flags&131072)!==0&&(sn=!0);else return a.lanes=s.lanes,qs(s,a,x)}return Fp(s,a,c,f,x)}function Dw(s,a,c,f){var x=f.children,b=s!==null?s.memoizedState:null;if(s===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((a.flags&128)!==0){if(b=b!==null?b.baseLanes|c:c,s!==null){for(f=a.child=s.child,x=0;f!==null;)x=x|f.lanes|f.childLanes,f=f.sibling;f=x&~b}else f=0,a.child=null;return zw(s,a,b,c,f)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},s!==null&&Cd(a,b!==null?b.cachePool:null),b!==null?L0(a,b):gp(),I0(a);else return f=a.lanes=536870912,zw(s,a,b!==null?b.baseLanes|c:c,c,f)}else b!==null?(Cd(a,b.cachePool),L0(a,b),Na(),a.memoizedState=null):(s!==null&&Cd(a,null),gp(),Na());return En(s,a,x,c),a.child}function gc(s,a){return s!==null&&s.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function zw(s,a,c,f,x){var b=up();return b=b===null?null:{parent:nn._currentValue,pool:b},a.memoizedState={baseLanes:c,cachePool:b},s!==null&&Cd(a,null),gp(),I0(a),s!==null&&yi(s,a,f,!0),a.childLanes=x,null}function Fd(s,a){return a=Ud({mode:a.mode,children:a.children},s.mode),a.ref=s.ref,s.child=a,a.return=s,a}function Pw(s,a,c){return bo(a,s.child,null,c),s=Fd(a,a.pendingProps),s.flags|=2,ur(a),a.memoizedState=null,s}function BA(s,a,c){var f=a.pendingProps,x=(a.flags&128)!==0;if(a.flags&=-129,s===null){if(ut){if(f.mode==="hidden")return s=Fd(a,f),a.lanes=536870912,gc(null,s);if(xp(a),(s=Dt)?(s=GS(s,Rr),s=s!==null&&s.data==="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:va!==null?{id:ds,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=y0(s),c.return=a,a.child=c,kn=a,Dt=null)):s=null,s===null)throw ya(a);return a.lanes=536870912,null}return Fd(a,f)}var b=s.memoizedState;if(b!==null){var k=b.dehydrated;if(xp(a),x)if(a.flags&256)a.flags&=-257,a=Pw(s,a,c);else if(a.memoizedState!==null)a.child=s.child,a.flags|=128,a=null;else throw Error(r(558));else if(sn||yi(s,a,c,!1),x=(c&s.childLanes)!==0,sn||x){if(f=Rt,f!==null&&(k=Q(f,c),k!==0&&k!==b.retryLane))throw b.retryLane=k,fo(s,k),Jn(f,s,k),$p;Kd(),a=Pw(s,a,c)}else s=b.treeContext,Dt=Or(k.nextSibling),kn=a,ut=!0,xa=null,Rr=!1,s!==null&&S0(a,s),a=Fd(a,f),a.flags|=4096;return a}return s=Ls(s.child,{mode:f.mode,children:f.children}),s.ref=a.ref,a.child=s,s.return=a,s}function Bd(s,a){var c=a.ref;if(c===null)s!==null&&s.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(s===null||s.ref!==c)&&(a.flags|=4194816)}}function Fp(s,a,c,f,x){return go(a),c=bp(s,a,c,f,void 0,x),f=wp(),s!==null&&!sn?(Sp(s,a,x),qs(s,a,x)):(ut&&f&&tp(a),a.flags|=1,En(s,a,c,x),a.child)}function Lw(s,a,c,f,x,b){return go(a),a.updateQueue=null,c=F0(a,f,c,x),$0(s),f=wp(),s!==null&&!sn?(Sp(s,a,b),qs(s,a,b)):(ut&&f&&tp(a),a.flags|=1,En(s,a,c,b),a.child)}function Iw(s,a,c,f,x){if(go(a),a.stateNode===null){var b=pi,k=c.contextType;typeof k=="object"&&k!==null&&(b=_n(k)),b=new c(f,b),a.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Lp,a.stateNode=b,b._reactInternals=a,b=a.stateNode,b.props=f,b.state=a.memoizedState,b.refs={},fp(a),k=c.contextType,b.context=typeof k=="object"&&k!==null?_n(k):pi,b.state=a.memoizedState,k=c.getDerivedStateFromProps,typeof k=="function"&&(Pp(a,c,k,f),b.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(k=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),k!==b.state&&Lp.enqueueReplaceState(b,b.state,null),dc(a,f,b,x),uc(),b.state=a.memoizedState),typeof b.componentDidMount=="function"&&(a.flags|=4194308),f=!0}else if(s===null){b=a.stateNode;var P=a.memoizedProps,q=So(c,P);b.props=q;var se=b.context,ce=c.contextType;k=pi,typeof ce=="object"&&ce!==null&&(k=_n(ce));var he=c.getDerivedStateFromProps;ce=typeof he=="function"||typeof b.getSnapshotBeforeUpdate=="function",P=a.pendingProps!==P,ce||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(P||se!==k)&&Cw(a,b,f,k),wa=!1;var oe=a.memoizedState;b.state=oe,dc(a,f,b,x),uc(),se=a.memoizedState,P||oe!==se||wa?(typeof he=="function"&&(Pp(a,c,he,f),se=a.memoizedState),(q=wa||jw(a,c,q,f,oe,se,k))?(ce||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(a.flags|=4194308)):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=f,a.memoizedState=se),b.props=f,b.state=se,b.context=k,f=q):(typeof b.componentDidMount=="function"&&(a.flags|=4194308),f=!1)}else{b=a.stateNode,hp(s,a),k=a.memoizedProps,ce=So(c,k),b.props=ce,he=a.pendingProps,oe=b.context,se=c.contextType,q=pi,typeof se=="object"&&se!==null&&(q=_n(se)),P=c.getDerivedStateFromProps,(se=typeof P=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(k!==he||oe!==q)&&Cw(a,b,f,q),wa=!1,oe=a.memoizedState,b.state=oe,dc(a,f,b,x),uc();var ie=a.memoizedState;k!==he||oe!==ie||wa||s!==null&&s.dependencies!==null&&Sd(s.dependencies)?(typeof P=="function"&&(Pp(a,c,P,f),ie=a.memoizedState),(ce=wa||jw(a,c,ce,f,oe,ie,q)||s!==null&&s.dependencies!==null&&Sd(s.dependencies))?(se||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(f,ie,q),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(f,ie,q)),typeof b.componentDidUpdate=="function"&&(a.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof b.componentDidUpdate!="function"||k===s.memoizedProps&&oe===s.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&oe===s.memoizedState||(a.flags|=1024),a.memoizedProps=f,a.memoizedState=ie),b.props=f,b.state=ie,b.context=q,f=ce):(typeof b.componentDidUpdate!="function"||k===s.memoizedProps&&oe===s.memoizedState||(a.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&oe===s.memoizedState||(a.flags|=1024),f=!1)}return b=f,Bd(s,a),f=(a.flags&128)!==0,b||f?(b=a.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:b.render(),a.flags|=1,s!==null&&f?(a.child=bo(a,s.child,null,x),a.child=bo(a,null,c,x)):En(s,a,c,x),a.memoizedState=b.state,s=a.child):s=qs(s,a,x),s}function $w(s,a,c,f){return mo(),a.flags|=256,En(s,a,c,f),a.child}var Bp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Up(s){return{baseLanes:s,cachePool:E0()}}function qp(s,a,c){return s=s!==null?s.childLanes&~c:0,a&&(s|=fr),s}function Fw(s,a,c){var f=a.pendingProps,x=!1,b=(a.flags&128)!==0,k;if((k=b)||(k=s!==null&&s.memoizedState===null?!1:(Qt.current&2)!==0),k&&(x=!0,a.flags&=-129),k=(a.flags&32)!==0,a.flags&=-33,s===null){if(ut){if(x?Ca(a):Na(),(s=Dt)?(s=GS(s,Rr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(a.memoizedState={dehydrated:s,treeContext:va!==null?{id:ds,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},c=y0(s),c.return=a,a.child=c,kn=a,Dt=null)):s=null,s===null)throw ya(a);return Ng(s)?a.lanes=32:a.lanes=536870912,null}var P=f.children;return f=f.fallback,x?(Na(),x=a.mode,P=Ud({mode:"hidden",children:P},x),f=ho(f,x,c,null),P.return=a,f.return=a,P.sibling=f,a.child=P,f=a.child,f.memoizedState=Up(c),f.childLanes=qp(s,k,c),a.memoizedState=Bp,gc(null,f)):(Ca(a),Vp(a,P))}var q=s.memoizedState;if(q!==null&&(P=q.dehydrated,P!==null)){if(b)a.flags&256?(Ca(a),a.flags&=-257,a=Hp(s,a,c)):a.memoizedState!==null?(Na(),a.child=s.child,a.flags|=128,a=null):(Na(),P=f.fallback,x=a.mode,f=Ud({mode:"visible",children:f.children},x),P=ho(P,x,c,null),P.flags|=2,f.return=a,P.return=a,f.sibling=P,a.child=f,bo(a,s.child,null,c),f=a.child,f.memoizedState=Up(c),f.childLanes=qp(s,k,c),a.memoizedState=Bp,a=gc(null,f));else if(Ca(a),Ng(P)){if(k=P.nextSibling&&P.nextSibling.dataset,k)var se=k.dgst;k=se,f=Error(r(419)),f.stack="",f.digest=k,sc({value:f,source:null,stack:null}),a=Hp(s,a,c)}else if(sn||yi(s,a,c,!1),k=(c&s.childLanes)!==0,sn||k){if(k=Rt,k!==null&&(f=Q(k,c),f!==0&&f!==q.retryLane))throw q.retryLane=f,fo(s,f),Jn(k,s,f),$p;Cg(P)||Kd(),a=Hp(s,a,c)}else Cg(P)?(a.flags|=192,a.child=s.child,a=null):(s=q.treeContext,Dt=Or(P.nextSibling),kn=a,ut=!0,xa=null,Rr=!1,s!==null&&S0(a,s),a=Vp(a,f.children),a.flags|=4096);return a}return x?(Na(),P=f.fallback,x=a.mode,q=s.child,se=q.sibling,f=Ls(q,{mode:"hidden",children:f.children}),f.subtreeFlags=q.subtreeFlags&65011712,se!==null?P=Ls(se,P):(P=ho(P,x,c,null),P.flags|=2),P.return=a,f.return=a,f.sibling=P,a.child=f,gc(null,f),f=a.child,P=s.child.memoizedState,P===null?P=Up(c):(x=P.cachePool,x!==null?(q=nn._currentValue,x=x.parent!==q?{parent:q,pool:q}:x):x=E0(),P={baseLanes:P.baseLanes|c,cachePool:x}),f.memoizedState=P,f.childLanes=qp(s,k,c),a.memoizedState=Bp,gc(s.child,f)):(Ca(a),c=s.child,s=c.sibling,c=Ls(c,{mode:"visible",children:f.children}),c.return=a,c.sibling=null,s!==null&&(k=a.deletions,k===null?(a.deletions=[s],a.flags|=16):k.push(s)),a.child=c,a.memoizedState=null,c)}function Vp(s,a){return a=Ud({mode:"visible",children:a},s.mode),a.return=s,s.child=a}function Ud(s,a){return s=lr(22,s,null,a),s.lanes=0,s}function Hp(s,a,c){return bo(a,s.child,null,c),s=Vp(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function Bw(s,a,c){s.lanes|=a;var f=s.alternate;f!==null&&(f.lanes|=a),op(s.return,a,c)}function Yp(s,a,c,f,x,b){var k=s.memoizedState;k===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:x,treeForkCount:b}:(k.isBackwards=a,k.rendering=null,k.renderingStartTime=0,k.last=f,k.tail=c,k.tailMode=x,k.treeForkCount=b)}function Uw(s,a,c){var f=a.pendingProps,x=f.revealOrder,b=f.tail;f=f.children;var k=Qt.current,P=(k&2)!==0;if(P?(k=k&1|2,a.flags|=128):k&=1,K(Qt,k),En(s,a,f,c),f=ut?rc:0,!P&&s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Bw(s,c,a);else if(s.tag===19)Bw(s,c,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(x){case"forwards":for(c=a.child,x=null;c!==null;)s=c.alternate,s!==null&&Md(s)===null&&(x=c),c=c.sibling;c=x,c===null?(x=a.child,a.child=null):(x=c.sibling,c.sibling=null),Yp(a,!1,x,c,b,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,x=a.child,a.child=null;x!==null;){if(s=x.alternate,s!==null&&Md(s)===null){a.child=x;break}s=x.sibling,x.sibling=c,c=x,x=s}Yp(a,!0,c,null,b,f);break;case"together":Yp(a,!1,null,null,void 0,f);break;default:a.memoizedState=null}return a.child}function qs(s,a,c){if(s!==null&&(a.dependencies=s.dependencies),Ea|=a.lanes,(c&a.childLanes)===0)if(s!==null){if(yi(s,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(s!==null&&a.child!==s.child)throw Error(r(153));if(a.child!==null){for(s=a.child,c=Ls(s,s.pendingProps),a.child=c,c.return=a;s.sibling!==null;)s=s.sibling,c=c.sibling=Ls(s,s.pendingProps),c.return=a;c.sibling=null}return a.child}function Wp(s,a){return(s.lanes&a)!==0?!0:(s=s.dependencies,!!(s!==null&&Sd(s)))}function UA(s,a,c){switch(a.tag){case 3:ye(a,a.stateNode.containerInfo),ba(a,nn,s.memoizedState.cache),mo();break;case 27:case 5:_e(a);break;case 4:ye(a,a.stateNode.containerInfo);break;case 10:ba(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,xp(a),null;break;case 13:var f=a.memoizedState;if(f!==null)return f.dehydrated!==null?(Ca(a),a.flags|=128,null):(c&a.child.childLanes)!==0?Fw(s,a,c):(Ca(a),s=qs(s,a,c),s!==null?s.sibling:null);Ca(a);break;case 19:var x=(s.flags&128)!==0;if(f=(c&a.childLanes)!==0,f||(yi(s,a,c,!1),f=(c&a.childLanes)!==0),x){if(f)return Uw(s,a,c);a.flags|=128}if(x=a.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),K(Qt,Qt.current),f)break;return null;case 22:return a.lanes=0,Dw(s,a,c,a.pendingProps);case 24:ba(a,nn,s.memoizedState.cache)}return qs(s,a,c)}function qw(s,a,c){if(s!==null)if(s.memoizedProps!==a.pendingProps)sn=!0;else{if(!Wp(s,c)&&(a.flags&128)===0)return sn=!1,UA(s,a,c);sn=(s.flags&131072)!==0}else sn=!1,ut&&(a.flags&1048576)!==0&&w0(a,rc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var f=a.pendingProps;if(s=xo(a.elementType),a.type=s,typeof s=="function")Xm(s)?(f=So(s,f),a.tag=1,a=Iw(null,a,s,f,c)):(a.tag=0,a=Fp(null,a,s,f,c));else{if(s!=null){var x=s.$$typeof;if(x===M){a.tag=11,a=Rw(null,a,s,f,c);break e}else if(x===T){a.tag=14,a=Aw(null,a,s,f,c);break e}}throw a=G(s)||s,Error(r(306,a,""))}}return a;case 0:return Fp(s,a,a.type,a.pendingProps,c);case 1:return f=a.type,x=So(f,a.pendingProps),Iw(s,a,f,x,c);case 3:e:{if(ye(a,a.stateNode.containerInfo),s===null)throw Error(r(387));f=a.pendingProps;var b=a.memoizedState;x=b.element,hp(s,a),dc(a,f,null,c);var k=a.memoizedState;if(f=k.cache,ba(a,nn,f),f!==b.cache&&ip(a,[nn],c,!0),uc(),f=k.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:k.cache},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){a=$w(s,a,f,c);break e}else if(f!==x){x=Er(Error(r(424)),a),sc(x),a=$w(s,a,f,c);break e}else for(s=a.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Dt=Or(s.firstChild),kn=a,ut=!0,xa=null,Rr=!0,c=D0(a,null,f,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(mo(),f===x){a=qs(s,a,c);break e}En(s,a,f,c)}a=a.child}return a;case 26:return Bd(s,a),s===null?(c=e1(a.type,null,a.pendingProps,null))?a.memoizedState=c:ut||(c=a.type,s=a.pendingProps,f=sf(ue.current).createElement(c),f[Zt]=a,f[Wn]=s,Tn(f,c,s),Sn(f),a.stateNode=f):a.memoizedState=e1(a.type,s.memoizedProps,a.pendingProps,s.memoizedState),null;case 27:return _e(a),s===null&&ut&&(f=a.stateNode=KS(a.type,a.pendingProps,ue.current),kn=a,Rr=!0,x=Dt,Oa(a.type)?(kg=x,Dt=Or(f.firstChild)):Dt=x),En(s,a,a.pendingProps.children,c),Bd(s,a),s===null&&(a.flags|=4194304),a.child;case 5:return s===null&&ut&&((x=f=Dt)&&(f=xO(f,a.type,a.pendingProps,Rr),f!==null?(a.stateNode=f,kn=a,Dt=Or(f.firstChild),Rr=!1,x=!0):x=!1),x||ya(a)),_e(a),x=a.type,b=a.pendingProps,k=s!==null?s.memoizedProps:null,f=b.children,wg(x,b)?f=null:k!==null&&wg(x,k)&&(a.flags|=32),a.memoizedState!==null&&(x=bp(s,a,OA,null,null,c),Rc._currentValue=x),Bd(s,a),En(s,a,f,c),a.child;case 6:return s===null&&ut&&((s=c=Dt)&&(c=yO(c,a.pendingProps,Rr),c!==null?(a.stateNode=c,kn=a,Dt=null,s=!0):s=!1),s||ya(a)),null;case 13:return Fw(s,a,c);case 4:return ye(a,a.stateNode.containerInfo),f=a.pendingProps,s===null?a.child=bo(a,null,f,c):En(s,a,f,c),a.child;case 11:return Rw(s,a,a.type,a.pendingProps,c);case 7:return En(s,a,a.pendingProps,c),a.child;case 8:return En(s,a,a.pendingProps.children,c),a.child;case 12:return En(s,a,a.pendingProps.children,c),a.child;case 10:return f=a.pendingProps,ba(a,a.type,f.value),En(s,a,f.children,c),a.child;case 9:return x=a.type._context,f=a.pendingProps.children,go(a),x=_n(x),f=f(x),a.flags|=1,En(s,a,f,c),a.child;case 14:return Aw(s,a,a.type,a.pendingProps,c);case 15:return Ow(s,a,a.type,a.pendingProps,c);case 19:return Uw(s,a,c);case 31:return BA(s,a,c);case 22:return Dw(s,a,c,a.pendingProps);case 24:return go(a),f=_n(nn),s===null?(x=up(),x===null&&(x=Rt,b=lp(),x.pooledCache=b,b.refCount++,b!==null&&(x.pooledCacheLanes|=c),x=b),a.memoizedState={parent:f,cache:x},fp(a),ba(a,nn,x)):((s.lanes&c)!==0&&(hp(s,a),dc(a,null,null,c),uc()),x=s.memoizedState,b=a.memoizedState,x.parent!==f?(x={parent:f,cache:f},a.memoizedState=x,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=x),ba(a,nn,f)):(f=b.cache,ba(a,nn,f),f!==x.cache&&ip(a,[nn],c,!0))),En(s,a,a.pendingProps.children,c),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function Vs(s){s.flags|=4}function Gp(s,a,c,f,x){if((a=(s.mode&32)!==0)&&(a=!1),a){if(s.flags|=16777216,(x&335544128)===x)if(s.stateNode.complete)s.flags|=8192;else if(gS())s.flags|=8192;else throw yo=kd,dp}else s.flags&=-16777217}function Vw(s,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!a1(a))if(gS())s.flags|=8192;else throw yo=kd,dp}function qd(s,a){a!==null&&(s.flags|=4),s.flags&16384&&(a=s.tag!==22?tn():536870912,s.lanes|=a,Ri|=a)}function vc(s,a){if(!ut)switch(s.tailMode){case"hidden":a=s.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s.tail=null:c.sibling=null;break;case"collapsed":c=s.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:f.sibling=null}}function zt(s){var a=s.alternate!==null&&s.alternate.child===s.child,c=0,f=0;if(a)for(var x=s.child;x!==null;)c|=x.lanes|x.childLanes,f|=x.subtreeFlags&65011712,f|=x.flags&65011712,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)c|=x.lanes|x.childLanes,f|=x.subtreeFlags,f|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=f,s.childLanes=c,a}function qA(s,a,c){var f=a.pendingProps;switch(np(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(a),null;case 1:return zt(a),null;case 3:return c=a.stateNode,f=null,s!==null&&(f=s.memoizedState.cache),a.memoizedState.cache!==f&&(a.flags|=2048),Fs(nn),Ce(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(s===null||s.child===null)&&(xi(a)?Vs(a):s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,sp())),zt(a),null;case 26:var x=a.type,b=a.memoizedState;return s===null?(Vs(a),b!==null?(zt(a),Vw(a,b)):(zt(a),Gp(a,x,null,f,c))):b?b!==s.memoizedState?(Vs(a),zt(a),Vw(a,b)):(zt(a),a.flags&=-16777217):(s=s.memoizedProps,s!==f&&Vs(a),zt(a),Gp(a,x,s,f,c)),null;case 27:if(Re(a),c=ue.current,x=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==f&&Vs(a);else{if(!f){if(a.stateNode===null)throw Error(r(166));return zt(a),null}s=ne.current,xi(a)?j0(a):(s=KS(x,f,c),a.stateNode=s,Vs(a))}return zt(a),null;case 5:if(Re(a),x=a.type,s!==null&&a.stateNode!=null)s.memoizedProps!==f&&Vs(a);else{if(!f){if(a.stateNode===null)throw Error(r(166));return zt(a),null}if(b=ne.current,xi(a))j0(a);else{var k=sf(ue.current);switch(b){case 1:b=k.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:b=k.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":b=k.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":b=k.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":b=k.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof f.is=="string"?k.createElement("select",{is:f.is}):k.createElement("select"),f.multiple?b.multiple=!0:f.size&&(b.size=f.size);break;default:b=typeof f.is=="string"?k.createElement(x,{is:f.is}):k.createElement(x)}}b[Zt]=a,b[Wn]=f;e:for(k=a.child;k!==null;){if(k.tag===5||k.tag===6)b.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===a)break e;for(;k.sibling===null;){if(k.return===null||k.return===a)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}a.stateNode=b;e:switch(Tn(b,x,f),x){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Vs(a)}}return zt(a),Gp(a,a.type,s===null?null:s.memoizedProps,a.pendingProps,c),null;case 6:if(s&&a.stateNode!=null)s.memoizedProps!==f&&Vs(a);else{if(typeof f!="string"&&a.stateNode===null)throw Error(r(166));if(s=ue.current,xi(a)){if(s=a.stateNode,c=a.memoizedProps,f=null,x=kn,x!==null)switch(x.tag){case 27:case 5:f=x.memoizedProps}s[Zt]=a,s=!!(s.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||FS(s.nodeValue,c)),s||ya(a,!0)}else s=sf(s).createTextNode(f),s[Zt]=a,a.stateNode=s}return zt(a),null;case 31:if(c=a.memoizedState,s===null||s.memoizedState!==null){if(f=xi(a),c!==null){if(s===null){if(!f)throw Error(r(318));if(s=a.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Zt]=a}else mo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;zt(a),s=!1}else c=sp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=c),s=!0;if(!s)return a.flags&256?(ur(a),a):(ur(a),null);if((a.flags&128)!==0)throw Error(r(558))}return zt(a),null;case 13:if(f=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(x=xi(a),f!==null&&f.dehydrated!==null){if(s===null){if(!x)throw Error(r(318));if(x=a.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[Zt]=a}else mo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;zt(a),x=!1}else x=sp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=x),x=!0;if(!x)return a.flags&256?(ur(a),a):(ur(a),null)}return ur(a),(a.flags&128)!==0?(a.lanes=c,a):(c=f!==null,s=s!==null&&s.memoizedState!==null,c&&(f=a.child,x=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(x=f.alternate.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==x&&(f.flags|=2048)),c!==s&&c&&(a.child.flags|=8192),qd(a,a.updateQueue),zt(a),null);case 4:return Ce(),s===null&&gg(a.stateNode.containerInfo),zt(a),null;case 10:return Fs(a.type),zt(a),null;case 19:if(F(Qt),f=a.memoizedState,f===null)return zt(a),null;if(x=(a.flags&128)!==0,b=f.rendering,b===null)if(x)vc(f,!1);else{if(Ht!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(b=Md(s),b!==null){for(a.flags|=128,vc(f,!1),s=b.updateQueue,a.updateQueue=s,qd(a,s),a.subtreeFlags=0,s=c,c=a.child;c!==null;)x0(c,s),c=c.sibling;return K(Qt,Qt.current&1|2),ut&&Is(a,f.treeForkCount),a.child}s=s.sibling}f.tail!==null&&ct()>Gd&&(a.flags|=128,x=!0,vc(f,!1),a.lanes=4194304)}else{if(!x)if(s=Md(b),s!==null){if(a.flags|=128,x=!0,s=s.updateQueue,a.updateQueue=s,qd(a,s),vc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!b.alternate&&!ut)return zt(a),null}else 2*ct()-f.renderingStartTime>Gd&&c!==536870912&&(a.flags|=128,x=!0,vc(f,!1),a.lanes=4194304);f.isBackwards?(b.sibling=a.child,a.child=b):(s=f.last,s!==null?s.sibling=b:a.child=b,f.last=b)}return f.tail!==null?(s=f.tail,f.rendering=s,f.tail=s.sibling,f.renderingStartTime=ct(),s.sibling=null,c=Qt.current,K(Qt,x?c&1|2:c&1),ut&&Is(a,f.treeForkCount),s):(zt(a),null);case 22:case 23:return ur(a),vp(),f=a.memoizedState!==null,s!==null?s.memoizedState!==null!==f&&(a.flags|=8192):f&&(a.flags|=8192),f?(c&536870912)!==0&&(a.flags&128)===0&&(zt(a),a.subtreeFlags&6&&(a.flags|=8192)):zt(a),c=a.updateQueue,c!==null&&qd(a,c.retryQueue),c=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==c&&(a.flags|=2048),s!==null&&F(vo),null;case 24:return c=null,s!==null&&(c=s.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Fs(nn),zt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function VA(s,a){switch(np(a),a.tag){case 1:return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return Fs(nn),Ce(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 26:case 27:case 5:return Re(a),null;case 31:if(a.memoizedState!==null){if(ur(a),a.alternate===null)throw Error(r(340));mo()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 13:if(ur(a),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(r(340));mo()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return F(Qt),null;case 4:return Ce(),null;case 10:return Fs(a.type),null;case 22:case 23:return ur(a),vp(),s!==null&&F(vo),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 24:return Fs(nn),null;case 25:return null;default:return null}}function Hw(s,a){switch(np(a),a.tag){case 3:Fs(nn),Ce();break;case 26:case 27:case 5:Re(a);break;case 4:Ce();break;case 31:a.memoizedState!==null&&ur(a);break;case 13:ur(a);break;case 19:F(Qt);break;case 10:Fs(a.type);break;case 22:case 23:ur(a),vp(),s!==null&&F(vo);break;case 24:Fs(nn)}}function xc(s,a){try{var c=a.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var x=f.next;c=x;do{if((c.tag&s)===s){f=void 0;var b=c.create,k=c.inst;f=b(),k.destroy=f}c=c.next}while(c!==x)}}catch(P){jt(a,a.return,P)}}function ka(s,a,c){try{var f=a.updateQueue,x=f!==null?f.lastEffect:null;if(x!==null){var b=x.next;f=b;do{if((f.tag&s)===s){var k=f.inst,P=k.destroy;if(P!==void 0){k.destroy=void 0,x=a;var q=c,se=P;try{se()}catch(ce){jt(x,q,ce)}}}f=f.next}while(f!==b)}}catch(ce){jt(a,a.return,ce)}}function Yw(s){var a=s.updateQueue;if(a!==null){var c=s.stateNode;try{P0(a,c)}catch(f){jt(s,s.return,f)}}}function Ww(s,a,c){c.props=So(s.type,s.memoizedProps),c.state=s.memoizedState;try{c.componentWillUnmount()}catch(f){jt(s,a,f)}}function yc(s,a){try{var c=s.ref;if(c!==null){switch(s.tag){case 26:case 27:case 5:var f=s.stateNode;break;case 30:f=s.stateNode;break;default:f=s.stateNode}typeof c=="function"?s.refCleanup=c(f):c.current=f}}catch(x){jt(s,a,x)}}function hs(s,a){var c=s.ref,f=s.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(x){jt(s,a,x)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(x){jt(s,a,x)}else c.current=null}function Gw(s){var a=s.type,c=s.memoizedProps,f=s.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(x){jt(s,s.return,x)}}function Zp(s,a,c){try{var f=s.stateNode;fO(f,s.type,c,a),f[Wn]=a}catch(x){jt(s,s.return,x)}}function Zw(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Oa(s.type)||s.tag===4}function Qp(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Zw(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Oa(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Kp(s,a,c){var f=s.tag;if(f===5||f===6)s=s.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(s,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(s),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=zs));else if(f!==4&&(f===27&&Oa(s.type)&&(c=s.stateNode,a=null),s=s.child,s!==null))for(Kp(s,a,c),s=s.sibling;s!==null;)Kp(s,a,c),s=s.sibling}function Vd(s,a,c){var f=s.tag;if(f===5||f===6)s=s.stateNode,a?c.insertBefore(s,a):c.appendChild(s);else if(f!==4&&(f===27&&Oa(s.type)&&(c=s.stateNode),s=s.child,s!==null))for(Vd(s,a,c),s=s.sibling;s!==null;)Vd(s,a,c),s=s.sibling}function Qw(s){var a=s.stateNode,c=s.memoizedProps;try{for(var f=s.type,x=a.attributes;x.length;)a.removeAttributeNode(x[0]);Tn(a,f,c),a[Zt]=s,a[Wn]=c}catch(b){jt(s,s.return,b)}}var Hs=!1,an=!1,Xp=!1,Kw=typeof WeakSet=="function"?WeakSet:Set,jn=null;function HA(s,a){if(s=s.containerInfo,yg=ff,s=c0(s),Hm(s)){if("selectionStart"in s)var c={start:s.selectionStart,end:s.selectionEnd};else e:{c=(c=s.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var x=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{c.nodeType,b.nodeType}catch{c=null;break e}var k=0,P=-1,q=-1,se=0,ce=0,he=s,oe=null;t:for(;;){for(var ie;he!==c||x!==0&&he.nodeType!==3||(P=k+x),he!==b||f!==0&&he.nodeType!==3||(q=k+f),he.nodeType===3&&(k+=he.nodeValue.length),(ie=he.firstChild)!==null;)oe=he,he=ie;for(;;){if(he===s)break t;if(oe===c&&++se===x&&(P=k),oe===b&&++ce===f&&(q=k),(ie=he.nextSibling)!==null)break;he=oe,oe=he.parentNode}he=ie}c=P===-1||q===-1?null:{start:P,end:q}}else c=null}c=c||{start:0,end:0}}else c=null;for(bg={focusedElem:s,selectionRange:c},ff=!1,jn=a;jn!==null;)if(a=jn,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,jn=s;else for(;jn!==null;){switch(a=jn,b=a.alternate,s=a.flags,a.tag){case 0:if((s&4)!==0&&(s=a.updateQueue,s=s!==null?s.events:null,s!==null))for(c=0;c<s.length;c++)x=s[c],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&b!==null){s=void 0,c=a,x=b.memoizedProps,b=b.memoizedState,f=c.stateNode;try{var Ee=So(c.type,x);s=f.getSnapshotBeforeUpdate(Ee,b),f.__reactInternalSnapshotBeforeUpdate=s}catch(qe){jt(c,c.return,qe)}}break;case 3:if((s&1024)!==0){if(s=a.stateNode.containerInfo,c=s.nodeType,c===9)jg(s);else if(c===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":jg(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=a.sibling,s!==null){s.return=a.return,jn=s;break}jn=a.return}}function Xw(s,a,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:Ws(s,c),f&4&&xc(5,c);break;case 1:if(Ws(s,c),f&4)if(s=c.stateNode,a===null)try{s.componentDidMount()}catch(k){jt(c,c.return,k)}else{var x=So(c.type,a.memoizedProps);a=a.memoizedState;try{s.componentDidUpdate(x,a,s.__reactInternalSnapshotBeforeUpdate)}catch(k){jt(c,c.return,k)}}f&64&&Yw(c),f&512&&yc(c,c.return);break;case 3:if(Ws(s,c),f&64&&(s=c.updateQueue,s!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{P0(s,a)}catch(k){jt(c,c.return,k)}}break;case 27:a===null&&f&4&&Qw(c);case 26:case 5:Ws(s,c),a===null&&f&4&&Gw(c),f&512&&yc(c,c.return);break;case 12:Ws(s,c);break;case 31:Ws(s,c),f&4&&tS(s,c);break;case 13:Ws(s,c),f&4&&nS(s,c),f&64&&(s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(c=eO.bind(null,c),bO(s,c))));break;case 22:if(f=c.memoizedState!==null||Hs,!f){a=a!==null&&a.memoizedState!==null||an,x=Hs;var b=an;Hs=f,(an=a)&&!b?Gs(s,c,(c.subtreeFlags&8772)!==0):Ws(s,c),Hs=x,an=b}break;case 30:break;default:Ws(s,c)}}function Jw(s){var a=s.alternate;a!==null&&(s.alternate=null,Jw(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&Em(a)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Pt=null,Zn=!1;function Ys(s,a,c){for(c=c.child;c!==null;)eS(s,a,c),c=c.sibling}function eS(s,a,c){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(Pn,c)}catch{}switch(c.tag){case 26:an||hs(c,a),Ys(s,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:an||hs(c,a);var f=Pt,x=Zn;Oa(c.type)&&(Pt=c.stateNode,Zn=!1),Ys(s,a,c),Ec(c.stateNode),Pt=f,Zn=x;break;case 5:an||hs(c,a);case 6:if(f=Pt,x=Zn,Pt=null,Ys(s,a,c),Pt=f,Zn=x,Pt!==null)if(Zn)try{(Pt.nodeType===9?Pt.body:Pt.nodeName==="HTML"?Pt.ownerDocument.body:Pt).removeChild(c.stateNode)}catch(b){jt(c,a,b)}else try{Pt.removeChild(c.stateNode)}catch(b){jt(c,a,b)}break;case 18:Pt!==null&&(Zn?(s=Pt,YS(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,c.stateNode),$i(s)):YS(Pt,c.stateNode));break;case 4:f=Pt,x=Zn,Pt=c.stateNode.containerInfo,Zn=!0,Ys(s,a,c),Pt=f,Zn=x;break;case 0:case 11:case 14:case 15:ka(2,c,a),an||ka(4,c,a),Ys(s,a,c);break;case 1:an||(hs(c,a),f=c.stateNode,typeof f.componentWillUnmount=="function"&&Ww(c,a,f)),Ys(s,a,c);break;case 21:Ys(s,a,c);break;case 22:an=(f=an)||c.memoizedState!==null,Ys(s,a,c),an=f;break;default:Ys(s,a,c)}}function tS(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{$i(s)}catch(c){jt(a,a.return,c)}}}function nS(s,a){if(a.memoizedState===null&&(s=a.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{$i(s)}catch(c){jt(a,a.return,c)}}function YA(s){switch(s.tag){case 31:case 13:case 19:var a=s.stateNode;return a===null&&(a=s.stateNode=new Kw),a;case 22:return s=s.stateNode,a=s._retryCache,a===null&&(a=s._retryCache=new Kw),a;default:throw Error(r(435,s.tag))}}function Hd(s,a){var c=YA(s);a.forEach(function(f){if(!c.has(f)){c.add(f);var x=tO.bind(null,s,f);f.then(x,x)}})}function Qn(s,a){var c=a.deletions;if(c!==null)for(var f=0;f<c.length;f++){var x=c[f],b=s,k=a,P=k;e:for(;P!==null;){switch(P.tag){case 27:if(Oa(P.type)){Pt=P.stateNode,Zn=!1;break e}break;case 5:Pt=P.stateNode,Zn=!1;break e;case 3:case 4:Pt=P.stateNode.containerInfo,Zn=!0;break e}P=P.return}if(Pt===null)throw Error(r(160));eS(b,k,x),Pt=null,Zn=!1,b=x.alternate,b!==null&&(b.return=null),x.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)rS(a,s),a=a.sibling}var Gr=null;function rS(s,a){var c=s.alternate,f=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Qn(a,s),Kn(s),f&4&&(ka(3,s,s.return),xc(3,s),ka(5,s,s.return));break;case 1:Qn(a,s),Kn(s),f&512&&(an||c===null||hs(c,c.return)),f&64&&Hs&&(s=s.updateQueue,s!==null&&(f=s.callbacks,f!==null&&(c=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var x=Gr;if(Qn(a,s),Kn(s),f&512&&(an||c===null||hs(c,c.return)),f&4){var b=c!==null?c.memoizedState:null;if(f=s.memoizedState,c===null)if(f===null)if(s.stateNode===null){e:{f=s.type,c=s.memoizedProps,x=x.ownerDocument||x;t:switch(f){case"title":b=x.getElementsByTagName("title")[0],(!b||b[Yl]||b[Zt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=x.createElement(f),x.head.insertBefore(b,x.querySelector("head > title"))),Tn(b,f,c),b[Zt]=s,Sn(b),f=b;break e;case"link":var k=r1("link","href",x).get(f+(c.href||""));if(k){for(var P=0;P<k.length;P++)if(b=k[P],b.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&b.getAttribute("rel")===(c.rel==null?null:c.rel)&&b.getAttribute("title")===(c.title==null?null:c.title)&&b.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){k.splice(P,1);break t}}b=x.createElement(f),Tn(b,f,c),x.head.appendChild(b);break;case"meta":if(k=r1("meta","content",x).get(f+(c.content||""))){for(P=0;P<k.length;P++)if(b=k[P],b.getAttribute("content")===(c.content==null?null:""+c.content)&&b.getAttribute("name")===(c.name==null?null:c.name)&&b.getAttribute("property")===(c.property==null?null:c.property)&&b.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&b.getAttribute("charset")===(c.charSet==null?null:c.charSet)){k.splice(P,1);break t}}b=x.createElement(f),Tn(b,f,c),x.head.appendChild(b);break;default:throw Error(r(468,f))}b[Zt]=s,Sn(b),f=b}s.stateNode=f}else s1(x,s.type,s.stateNode);else s.stateNode=n1(x,f,s.memoizedProps);else b!==f?(b===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):b.count--,f===null?s1(x,s.type,s.stateNode):n1(x,f,s.memoizedProps)):f===null&&s.stateNode!==null&&Zp(s,s.memoizedProps,c.memoizedProps)}break;case 27:Qn(a,s),Kn(s),f&512&&(an||c===null||hs(c,c.return)),c!==null&&f&4&&Zp(s,s.memoizedProps,c.memoizedProps);break;case 5:if(Qn(a,s),Kn(s),f&512&&(an||c===null||hs(c,c.return)),s.flags&32){x=s.stateNode;try{li(x,"")}catch(Ee){jt(s,s.return,Ee)}}f&4&&s.stateNode!=null&&(x=s.memoizedProps,Zp(s,x,c!==null?c.memoizedProps:x)),f&1024&&(Xp=!0);break;case 6:if(Qn(a,s),Kn(s),f&4){if(s.stateNode===null)throw Error(r(162));f=s.memoizedProps,c=s.stateNode;try{c.nodeValue=f}catch(Ee){jt(s,s.return,Ee)}}break;case 3:if(lf=null,x=Gr,Gr=af(a.containerInfo),Qn(a,s),Gr=x,Kn(s),f&4&&c!==null&&c.memoizedState.isDehydrated)try{$i(a.containerInfo)}catch(Ee){jt(s,s.return,Ee)}Xp&&(Xp=!1,sS(s));break;case 4:f=Gr,Gr=af(s.stateNode.containerInfo),Qn(a,s),Kn(s),Gr=f;break;case 12:Qn(a,s),Kn(s);break;case 31:Qn(a,s),Kn(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,Hd(s,f)));break;case 13:Qn(a,s),Kn(s),s.child.flags&8192&&s.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Wd=ct()),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,Hd(s,f)));break;case 22:x=s.memoizedState!==null;var q=c!==null&&c.memoizedState!==null,se=Hs,ce=an;if(Hs=se||x,an=ce||q,Qn(a,s),an=ce,Hs=se,Kn(s),f&8192)e:for(a=s.stateNode,a._visibility=x?a._visibility&-2:a._visibility|1,x&&(c===null||q||Hs||an||jo(s)),c=null,a=s;;){if(a.tag===5||a.tag===26){if(c===null){q=c=a;try{if(b=q.stateNode,x)k=b.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{P=q.stateNode;var he=q.memoizedProps.style,oe=he!=null&&he.hasOwnProperty("display")?he.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ee){jt(q,q.return,Ee)}}}else if(a.tag===6){if(c===null){q=a;try{q.stateNode.nodeValue=x?"":q.memoizedProps}catch(Ee){jt(q,q.return,Ee)}}}else if(a.tag===18){if(c===null){q=a;try{var ie=q.stateNode;x?WS(ie,!0):WS(q.stateNode,!1)}catch(Ee){jt(q,q.return,Ee)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===s)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;c===a&&(c=null),a=a.return}c===a&&(c=null),a.sibling.return=a.return,a=a.sibling}f&4&&(f=s.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,Hd(s,c))));break;case 19:Qn(a,s),Kn(s),f&4&&(f=s.updateQueue,f!==null&&(s.updateQueue=null,Hd(s,f)));break;case 30:break;case 21:break;default:Qn(a,s),Kn(s)}}function Kn(s){var a=s.flags;if(a&2){try{for(var c,f=s.return;f!==null;){if(Zw(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var x=c.stateNode,b=Qp(s);Vd(s,b,x);break;case 5:var k=c.stateNode;c.flags&32&&(li(k,""),c.flags&=-33);var P=Qp(s);Vd(s,P,k);break;case 3:case 4:var q=c.stateNode.containerInfo,se=Qp(s);Kp(s,se,q);break;default:throw Error(r(161))}}catch(ce){jt(s,s.return,ce)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function sS(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var a=s;sS(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),s=s.sibling}}function Ws(s,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Xw(s,a.alternate,a),a=a.sibling}function jo(s){for(s=s.child;s!==null;){var a=s;switch(a.tag){case 0:case 11:case 14:case 15:ka(4,a,a.return),jo(a);break;case 1:hs(a,a.return);var c=a.stateNode;typeof c.componentWillUnmount=="function"&&Ww(a,a.return,c),jo(a);break;case 27:Ec(a.stateNode);case 26:case 5:hs(a,a.return),jo(a);break;case 22:a.memoizedState===null&&jo(a);break;case 30:jo(a);break;default:jo(a)}s=s.sibling}}function Gs(s,a,c){for(c=c&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var f=a.alternate,x=s,b=a,k=b.flags;switch(b.tag){case 0:case 11:case 15:Gs(x,b,c),xc(4,b);break;case 1:if(Gs(x,b,c),f=b,x=f.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(se){jt(f,f.return,se)}if(f=b,x=f.updateQueue,x!==null){var P=f.stateNode;try{var q=x.shared.hiddenCallbacks;if(q!==null)for(x.shared.hiddenCallbacks=null,x=0;x<q.length;x++)z0(q[x],P)}catch(se){jt(f,f.return,se)}}c&&k&64&&Yw(b),yc(b,b.return);break;case 27:Qw(b);case 26:case 5:Gs(x,b,c),c&&f===null&&k&4&&Gw(b),yc(b,b.return);break;case 12:Gs(x,b,c);break;case 31:Gs(x,b,c),c&&k&4&&tS(x,b);break;case 13:Gs(x,b,c),c&&k&4&&nS(x,b);break;case 22:b.memoizedState===null&&Gs(x,b,c),yc(b,b.return);break;case 30:break;default:Gs(x,b,c)}a=a.sibling}}function Jp(s,a){var c=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),s=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(s=a.memoizedState.cachePool.pool),s!==c&&(s!=null&&s.refCount++,c!=null&&ac(c))}function eg(s,a){s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&ac(s))}function Zr(s,a,c,f){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)aS(s,a,c,f),a=a.sibling}function aS(s,a,c,f){var x=a.flags;switch(a.tag){case 0:case 11:case 15:Zr(s,a,c,f),x&2048&&xc(9,a);break;case 1:Zr(s,a,c,f);break;case 3:Zr(s,a,c,f),x&2048&&(s=null,a.alternate!==null&&(s=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==s&&(a.refCount++,s!=null&&ac(s)));break;case 12:if(x&2048){Zr(s,a,c,f),s=a.stateNode;try{var b=a.memoizedProps,k=b.id,P=b.onPostCommit;typeof P=="function"&&P(k,a.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(q){jt(a,a.return,q)}}else Zr(s,a,c,f);break;case 31:Zr(s,a,c,f);break;case 13:Zr(s,a,c,f);break;case 23:break;case 22:b=a.stateNode,k=a.alternate,a.memoizedState!==null?b._visibility&2?Zr(s,a,c,f):bc(s,a):b._visibility&2?Zr(s,a,c,f):(b._visibility|=2,Ei(s,a,c,f,(a.subtreeFlags&10256)!==0||!1)),x&2048&&Jp(k,a);break;case 24:Zr(s,a,c,f),x&2048&&eg(a.alternate,a);break;default:Zr(s,a,c,f)}}function Ei(s,a,c,f,x){for(x=x&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var b=s,k=a,P=c,q=f,se=k.flags;switch(k.tag){case 0:case 11:case 15:Ei(b,k,P,q,x),xc(8,k);break;case 23:break;case 22:var ce=k.stateNode;k.memoizedState!==null?ce._visibility&2?Ei(b,k,P,q,x):bc(b,k):(ce._visibility|=2,Ei(b,k,P,q,x)),x&&se&2048&&Jp(k.alternate,k);break;case 24:Ei(b,k,P,q,x),x&&se&2048&&eg(k.alternate,k);break;default:Ei(b,k,P,q,x)}a=a.sibling}}function bc(s,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=s,f=a,x=f.flags;switch(f.tag){case 22:bc(c,f),x&2048&&Jp(f.alternate,f);break;case 24:bc(c,f),x&2048&&eg(f.alternate,f);break;default:bc(c,f)}a=a.sibling}}var wc=8192;function Ti(s,a,c){if(s.subtreeFlags&wc)for(s=s.child;s!==null;)oS(s,a,c),s=s.sibling}function oS(s,a,c){switch(s.tag){case 26:Ti(s,a,c),s.flags&wc&&s.memoizedState!==null&&AO(c,Gr,s.memoizedState,s.memoizedProps);break;case 5:Ti(s,a,c);break;case 3:case 4:var f=Gr;Gr=af(s.stateNode.containerInfo),Ti(s,a,c),Gr=f;break;case 22:s.memoizedState===null&&(f=s.alternate,f!==null&&f.memoizedState!==null?(f=wc,wc=16777216,Ti(s,a,c),wc=f):Ti(s,a,c));break;default:Ti(s,a,c)}}function iS(s){var a=s.alternate;if(a!==null&&(s=a.child,s!==null)){a.child=null;do a=s.sibling,s.sibling=null,s=a;while(s!==null)}}function Sc(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];jn=f,cS(f,s)}iS(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)lS(s),s=s.sibling}function lS(s){switch(s.tag){case 0:case 11:case 15:Sc(s),s.flags&2048&&ka(9,s,s.return);break;case 3:Sc(s);break;case 12:Sc(s);break;case 22:var a=s.stateNode;s.memoizedState!==null&&a._visibility&2&&(s.return===null||s.return.tag!==13)?(a._visibility&=-3,Yd(s)):Sc(s);break;default:Sc(s)}}function Yd(s){var a=s.deletions;if((s.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var f=a[c];jn=f,cS(f,s)}iS(s)}for(s=s.child;s!==null;){switch(a=s,a.tag){case 0:case 11:case 15:ka(8,a,a.return),Yd(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,Yd(a));break;default:Yd(a)}s=s.sibling}}function cS(s,a){for(;jn!==null;){var c=jn;switch(c.tag){case 0:case 11:case 15:ka(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:ac(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,jn=f;else e:for(c=s;jn!==null;){f=jn;var x=f.sibling,b=f.return;if(Jw(f),f===c){jn=null;break e}if(x!==null){x.return=b,jn=x;break e}jn=b}}}var WA={getCacheForType:function(s){var a=_n(nn),c=a.data.get(s);return c===void 0&&(c=s(),a.data.set(s,c)),c},cacheSignal:function(){return _n(nn).controller.signal}},GA=typeof WeakMap=="function"?WeakMap:Map,vt=0,Rt=null,st=null,it=0,St=0,dr=null,_a=!1,Mi=!1,tg=!1,Zs=0,Ht=0,Ea=0,Co=0,ng=0,fr=0,Ri=0,jc=null,Xn=null,rg=!1,Wd=0,uS=0,Gd=1/0,Zd=null,Ta=null,fn=0,Ma=null,Ai=null,Qs=0,sg=0,ag=null,dS=null,Cc=0,og=null;function hr(){return(vt&2)!==0&&it!==0?it&-it:L.T!==null?fg():gt()}function fS(){if(fr===0)if((it&536870912)===0||ut){var s=we;we<<=1,(we&3932160)===0&&(we=262144),fr=s}else fr=536870912;return s=cr.current,s!==null&&(s.flags|=32),fr}function Jn(s,a,c){(s===Rt&&(St===2||St===9)||s.cancelPendingCommit!==null)&&(Oi(s,0),Ra(s,it,fr,!1)),Ot(s,c),((vt&2)===0||s!==Rt)&&(s===Rt&&((vt&2)===0&&(Co|=c),Ht===4&&Ra(s,it,fr,!1)),ms(s))}function hS(s,a,c){if((vt&6)!==0)throw Error(r(327));var f=!c&&(a&127)===0&&(a&s.expiredLanes)===0||wt(s,a),x=f?KA(s,a):lg(s,a,!0),b=f;do{if(x===0){Mi&&!f&&Ra(s,a,0,!1);break}else{if(c=s.current.alternate,b&&!ZA(c)){x=lg(s,a,!1),b=!1;continue}if(x===2){if(b=a,s.errorRecoveryDisabledLanes&b)var k=0;else k=s.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){a=k;e:{var P=s;x=jc;var q=P.current.memoizedState.isDehydrated;if(q&&(Oi(P,k).flags|=256),k=lg(P,k,!1),k!==2){if(tg&&!q){P.errorRecoveryDisabledLanes|=b,Co|=b,x=4;break e}b=Xn,Xn=x,b!==null&&(Xn===null?Xn=b:Xn.push.apply(Xn,b))}x=k}if(b=!1,x!==2)continue}}if(x===1){Oi(s,0),Ra(s,a,0,!0);break}e:{switch(f=s,b=x,b){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Ra(f,a,fr,!_a);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(x=Wd+300-ct(),10<x)){if(Ra(f,a,fr,!_a),De(f,0,!0)!==0)break e;Qs=a,f.timeoutHandle=VS(mS.bind(null,f,c,Xn,Zd,rg,a,fr,Co,Ri,_a,b,"Throttled",-0,0),x);break e}mS(f,c,Xn,Zd,rg,a,fr,Co,Ri,_a,b,null,-0,0)}}break}while(!0);ms(s)}function mS(s,a,c,f,x,b,k,P,q,se,ce,he,oe,ie){if(s.timeoutHandle=-1,he=a.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zs},oS(a,b,he);var Ee=(b&62914560)===b?Wd-ct():(b&4194048)===b?uS-ct():0;if(Ee=OO(he,Ee),Ee!==null){Qs=b,s.cancelPendingCommit=Ee(SS.bind(null,s,a,b,c,f,x,k,P,q,ce,he,null,oe,ie)),Ra(s,b,k,!se);return}}SS(s,a,b,c,f,x,k,P,q)}function ZA(s){for(var a=s;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var x=c[f],b=x.getSnapshot;x=x.value;try{if(!ir(b(),x))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ra(s,a,c,f){a&=~ng,a&=~Co,s.suspendedLanes|=a,s.pingedLanes&=~a,f&&(s.warmLanes|=a),f=s.expirationTimes;for(var x=a;0<x;){var b=31-$t(x),k=1<<b;f[b]=-1,x&=~k}c!==0&&Hn(s,c,a)}function Qd(){return(vt&6)===0?(Nc(0),!1):!0}function ig(){if(st!==null){if(St===0)var s=st.return;else s=st,$s=po=null,jp(s),ji=null,ic=0,s=st;for(;s!==null;)Hw(s.alternate,s),s=s.return;st=null}}function Oi(s,a){var c=s.timeoutHandle;c!==-1&&(s.timeoutHandle=-1,pO(c)),c=s.cancelPendingCommit,c!==null&&(s.cancelPendingCommit=null,c()),Qs=0,ig(),Rt=s,st=c=Ls(s.current,null),it=a,St=0,dr=null,_a=!1,Mi=wt(s,a),tg=!1,Ri=fr=ng=Co=Ea=Ht=0,Xn=jc=null,rg=!1,(a&8)!==0&&(a|=a&32);var f=s.entangledLanes;if(f!==0)for(s=s.entanglements,f&=a;0<f;){var x=31-$t(f),b=1<<x;a|=s[x],f&=~b}return Zs=a,vd(),c}function pS(s,a){Ze=null,L.H=pc,a===Si||a===Nd?(a=R0(),St=3):a===dp?(a=R0(),St=4):St=a===$p?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,dr=a,st===null&&(Ht=1,$d(s,Er(a,s.current)))}function gS(){var s=cr.current;return s===null?!0:(it&4194048)===it?Ar===null:(it&62914560)===it||(it&536870912)!==0?s===Ar:!1}function vS(){var s=L.H;return L.H=pc,s===null?pc:s}function xS(){var s=L.A;return L.A=WA,s}function Kd(){Ht=4,_a||(it&4194048)!==it&&cr.current!==null||(Mi=!0),(Ea&134217727)===0&&(Co&134217727)===0||Rt===null||Ra(Rt,it,fr,!1)}function lg(s,a,c){var f=vt;vt|=2;var x=vS(),b=xS();(Rt!==s||it!==a)&&(Zd=null,Oi(s,a)),a=!1;var k=Ht;e:do try{if(St!==0&&st!==null){var P=st,q=dr;switch(St){case 8:ig(),k=6;break e;case 3:case 2:case 9:case 6:cr.current===null&&(a=!0);var se=St;if(St=0,dr=null,Di(s,P,q,se),c&&Mi){k=0;break e}break;default:se=St,St=0,dr=null,Di(s,P,q,se)}}QA(),k=Ht;break}catch(ce){pS(s,ce)}while(!0);return a&&s.shellSuspendCounter++,$s=po=null,vt=f,L.H=x,L.A=b,st===null&&(Rt=null,it=0,vd()),k}function QA(){for(;st!==null;)yS(st)}function KA(s,a){var c=vt;vt|=2;var f=vS(),x=xS();Rt!==s||it!==a?(Zd=null,Gd=ct()+500,Oi(s,a)):Mi=wt(s,a);e:do try{if(St!==0&&st!==null){a=st;var b=dr;t:switch(St){case 1:St=0,dr=null,Di(s,a,b,1);break;case 2:case 9:if(T0(b)){St=0,dr=null,bS(a);break}a=function(){St!==2&&St!==9||Rt!==s||(St=7),ms(s)},b.then(a,a);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:T0(b)?(St=0,dr=null,bS(a)):(St=0,dr=null,Di(s,a,b,7));break;case 5:var k=null;switch(st.tag){case 26:k=st.memoizedState;case 5:case 27:var P=st;if(k?a1(k):P.stateNode.complete){St=0,dr=null;var q=P.sibling;if(q!==null)st=q;else{var se=P.return;se!==null?(st=se,Xd(se)):st=null}break t}}St=0,dr=null,Di(s,a,b,5);break;case 6:St=0,dr=null,Di(s,a,b,6);break;case 8:ig(),Ht=6;break e;default:throw Error(r(462))}}XA();break}catch(ce){pS(s,ce)}while(!0);return $s=po=null,L.H=f,L.A=x,vt=c,st!==null?0:(Rt=null,it=0,vd(),Ht)}function XA(){for(;st!==null&&!Oe();)yS(st)}function yS(s){var a=qw(s.alternate,s,Zs);s.memoizedProps=s.pendingProps,a===null?Xd(s):st=a}function bS(s){var a=s,c=a.alternate;switch(a.tag){case 15:case 0:a=Lw(c,a,a.pendingProps,a.type,void 0,it);break;case 11:a=Lw(c,a,a.pendingProps,a.type.render,a.ref,it);break;case 5:jp(a);default:Hw(c,a),a=st=x0(a,Zs),a=qw(c,a,Zs)}s.memoizedProps=s.pendingProps,a===null?Xd(s):st=a}function Di(s,a,c,f){$s=po=null,jp(a),ji=null,ic=0;var x=a.return;try{if(FA(s,x,a,c,it)){Ht=1,$d(s,Er(c,s.current)),st=null;return}}catch(b){if(x!==null)throw st=x,b;Ht=1,$d(s,Er(c,s.current)),st=null;return}a.flags&32768?(ut||f===1?s=!0:Mi||(it&536870912)!==0?s=!1:(_a=s=!0,(f===2||f===9||f===3||f===6)&&(f=cr.current,f!==null&&f.tag===13&&(f.flags|=16384))),wS(a,s)):Xd(a)}function Xd(s){var a=s;do{if((a.flags&32768)!==0){wS(a,_a);return}s=a.return;var c=qA(a.alternate,a,Zs);if(c!==null){st=c;return}if(a=a.sibling,a!==null){st=a;return}st=a=s}while(a!==null);Ht===0&&(Ht=5)}function wS(s,a){do{var c=VA(s.alternate,s);if(c!==null){c.flags&=32767,st=c;return}if(c=s.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(s=s.sibling,s!==null)){st=s;return}st=s=c}while(s!==null);Ht=6,st=null}function SS(s,a,c,f,x,b,k,P,q){s.cancelPendingCommit=null;do Jd();while(fn!==0);if((vt&6)!==0)throw Error(r(327));if(a!==null){if(a===s.current)throw Error(r(177));if(b=a.lanes|a.childLanes,b|=Qm,Rn(s,c,b,k,P,q),s===Rt&&(st=Rt=null,it=0),Ai=a,Ma=s,Qs=c,sg=b,ag=x,dS=f,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,nO(pt,function(){return _S(),null})):(s.callbackNode=null,s.callbackPriority=0),f=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||f){f=L.T,L.T=null,x=$.p,$.p=2,k=vt,vt|=4;try{HA(s,a,c)}finally{vt=k,$.p=x,L.T=f}}fn=1,jS(),CS(),NS()}}function jS(){if(fn===1){fn=0;var s=Ma,a=Ai,c=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||c){c=L.T,L.T=null;var f=$.p;$.p=2;var x=vt;vt|=4;try{rS(a,s);var b=bg,k=c0(s.containerInfo),P=b.focusedElem,q=b.selectionRange;if(k!==P&&P&&P.ownerDocument&&l0(P.ownerDocument.documentElement,P)){if(q!==null&&Hm(P)){var se=q.start,ce=q.end;if(ce===void 0&&(ce=se),"selectionStart"in P)P.selectionStart=se,P.selectionEnd=Math.min(ce,P.value.length);else{var he=P.ownerDocument||document,oe=he&&he.defaultView||window;if(oe.getSelection){var ie=oe.getSelection(),Ee=P.textContent.length,qe=Math.min(q.start,Ee),Et=q.end===void 0?qe:Math.min(q.end,Ee);!ie.extend&&qe>Et&&(k=Et,Et=qe,qe=k);var J=i0(P,qe),Z=i0(P,Et);if(J&&Z&&(ie.rangeCount!==1||ie.anchorNode!==J.node||ie.anchorOffset!==J.offset||ie.focusNode!==Z.node||ie.focusOffset!==Z.offset)){var re=he.createRange();re.setStart(J.node,J.offset),ie.removeAllRanges(),qe>Et?(ie.addRange(re),ie.extend(Z.node,Z.offset)):(re.setEnd(Z.node,Z.offset),ie.addRange(re))}}}}for(he=[],ie=P;ie=ie.parentNode;)ie.nodeType===1&&he.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<he.length;P++){var de=he[P];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}ff=!!yg,bg=yg=null}finally{vt=x,$.p=f,L.T=c}}s.current=a,fn=2}}function CS(){if(fn===2){fn=0;var s=Ma,a=Ai,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=L.T,L.T=null;var f=$.p;$.p=2;var x=vt;vt|=4;try{Xw(s,a.alternate,a)}finally{vt=x,$.p=f,L.T=c}}fn=3}}function NS(){if(fn===4||fn===3){fn=0,dt();var s=Ma,a=Ai,c=Qs,f=dS;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?fn=5:(fn=0,Ai=Ma=null,kS(s,s.pendingLanes));var x=s.pendingLanes;if(x===0&&(Ta=null),Ue(c),a=a.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(Pn,a,void 0,(a.current.flags&128)===128)}catch{}if(f!==null){a=L.T,x=$.p,$.p=2,L.T=null;try{for(var b=s.onRecoverableError,k=0;k<f.length;k++){var P=f[k];b(P.value,{componentStack:P.stack})}}finally{L.T=a,$.p=x}}(Qs&3)!==0&&Jd(),ms(s),x=s.pendingLanes,(c&261930)!==0&&(x&42)!==0?s===og?Cc++:(Cc=0,og=s):Cc=0,Nc(0)}}function kS(s,a){(s.pooledCacheLanes&=a)===0&&(a=s.pooledCache,a!=null&&(s.pooledCache=null,ac(a)))}function Jd(){return jS(),CS(),NS(),_S()}function _S(){if(fn!==5)return!1;var s=Ma,a=sg;sg=0;var c=Ue(Qs),f=L.T,x=$.p;try{$.p=32>c?32:c,L.T=null,c=ag,ag=null;var b=Ma,k=Qs;if(fn=0,Ai=Ma=null,Qs=0,(vt&6)!==0)throw Error(r(331));var P=vt;if(vt|=4,lS(b.current),aS(b,b.current,k,c),vt=P,Nc(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(Pn,b)}catch{}return!0}finally{$.p=x,L.T=f,kS(s,a)}}function ES(s,a,c){a=Er(c,a),a=Ip(s.stateNode,a,2),s=ja(s,a,2),s!==null&&(Ot(s,2),ms(s))}function jt(s,a,c){if(s.tag===3)ES(s,s,c);else for(;a!==null;){if(a.tag===3){ES(a,s,c);break}else if(a.tag===1){var f=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ta===null||!Ta.has(f))){s=Er(c,s),c=Tw(2),f=ja(a,c,2),f!==null&&(Mw(c,f,a,s),Ot(f,2),ms(f));break}}a=a.return}}function cg(s,a,c){var f=s.pingCache;if(f===null){f=s.pingCache=new GA;var x=new Set;f.set(a,x)}else x=f.get(a),x===void 0&&(x=new Set,f.set(a,x));x.has(c)||(tg=!0,x.add(c),s=JA.bind(null,s,a,c),a.then(s,s))}function JA(s,a,c){var f=s.pingCache;f!==null&&f.delete(a),s.pingedLanes|=s.suspendedLanes&c,s.warmLanes&=~c,Rt===s&&(it&c)===c&&(Ht===4||Ht===3&&(it&62914560)===it&&300>ct()-Wd?(vt&2)===0&&Oi(s,0):ng|=c,Ri===it&&(Ri=0)),ms(s)}function TS(s,a){a===0&&(a=tn()),s=fo(s,a),s!==null&&(Ot(s,a),ms(s))}function eO(s){var a=s.memoizedState,c=0;a!==null&&(c=a.retryLane),TS(s,c)}function tO(s,a){var c=0;switch(s.tag){case 31:case 13:var f=s.stateNode,x=s.memoizedState;x!==null&&(c=x.retryLane);break;case 19:f=s.stateNode;break;case 22:f=s.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(a),TS(s,c)}function nO(s,a){return Le(s,a)}var ef=null,zi=null,ug=!1,tf=!1,dg=!1,Aa=0;function ms(s){s!==zi&&s.next===null&&(zi===null?ef=zi=s:zi=zi.next=s),tf=!0,ug||(ug=!0,sO())}function Nc(s,a){if(!dg&&tf){dg=!0;do for(var c=!1,f=ef;f!==null;){if(s!==0){var x=f.pendingLanes;if(x===0)var b=0;else{var k=f.suspendedLanes,P=f.pingedLanes;b=(1<<31-$t(42|s)+1)-1,b&=x&~(k&~P),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(c=!0,OS(f,b))}else b=it,b=De(f,f===Rt?b:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(b&3)===0||wt(f,b)||(c=!0,OS(f,b));f=f.next}while(c);dg=!1}}function rO(){MS()}function MS(){tf=ug=!1;var s=0;Aa!==0&&mO()&&(s=Aa);for(var a=ct(),c=null,f=ef;f!==null;){var x=f.next,b=RS(f,a);b===0?(f.next=null,c===null?ef=x:c.next=x,x===null&&(zi=c)):(c=f,(s!==0||(b&3)!==0)&&(tf=!0)),f=x}fn!==0&&fn!==5||Nc(s),Aa!==0&&(Aa=0)}function RS(s,a){for(var c=s.suspendedLanes,f=s.pingedLanes,x=s.expirationTimes,b=s.pendingLanes&-62914561;0<b;){var k=31-$t(b),P=1<<k,q=x[k];q===-1?((P&c)===0||(P&f)!==0)&&(x[k]=bn(P,a)):q<=a&&(s.expiredLanes|=P),b&=~P}if(a=Rt,c=it,c=De(s,s===a?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f=s.callbackNode,c===0||s===a&&(St===2||St===9)||s.cancelPendingCommit!==null)return f!==null&&f!==null&&Ye(f),s.callbackNode=null,s.callbackPriority=0;if((c&3)===0||wt(s,c)){if(a=c&-c,a===s.callbackPriority)return a;switch(f!==null&&Ye(f),Ue(c)){case 2:case 8:c=bt;break;case 32:c=pt;break;case 268435456:c=or;break;default:c=pt}return f=AS.bind(null,s),c=Le(c,f),s.callbackPriority=a,s.callbackNode=c,a}return f!==null&&f!==null&&Ye(f),s.callbackPriority=2,s.callbackNode=null,2}function AS(s,a){if(fn!==0&&fn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var c=s.callbackNode;if(Jd()&&s.callbackNode!==c)return null;var f=it;return f=De(s,s===Rt?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),f===0?null:(hS(s,f,a),RS(s,ct()),s.callbackNode!=null&&s.callbackNode===c?AS.bind(null,s):null)}function OS(s,a){if(Jd())return null;hS(s,a,!0)}function sO(){gO(function(){(vt&6)!==0?Le(Qe,rO):MS()})}function fg(){if(Aa===0){var s=bi;s===0&&(s=ke,ke<<=1,(ke&261888)===0&&(ke=256)),Aa=s}return Aa}function DS(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:cd(""+s)}function zS(s,a){var c=a.ownerDocument.createElement("input");return c.name=a.name,c.value=a.value,s.id&&c.setAttribute("form",s.id),a.parentNode.insertBefore(c,a),s=new FormData(s),c.parentNode.removeChild(c),s}function aO(s,a,c,f,x){if(a==="submit"&&c&&c.stateNode===x){var b=DS((x[Wn]||null).action),k=f.submitter;k&&(a=(a=k[Wn]||null)?DS(a.formAction):k.getAttribute("formAction"),a!==null&&(b=a,k=null));var P=new hd("action","action",null,f,x);s.push({event:P,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Aa!==0){var q=k?zS(x,k):new FormData(x);Ap(c,{pending:!0,data:q,method:x.method,action:b},null,q)}}else typeof b=="function"&&(P.preventDefault(),q=k?zS(x,k):new FormData(x),Ap(c,{pending:!0,data:q,method:x.method,action:b},b,q))},currentTarget:x}]})}}for(var hg=0;hg<Zm.length;hg++){var mg=Zm[hg],oO=mg.toLowerCase(),iO=mg[0].toUpperCase()+mg.slice(1);Wr(oO,"on"+iO)}Wr(f0,"onAnimationEnd"),Wr(h0,"onAnimationIteration"),Wr(m0,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(jA,"onTransitionRun"),Wr(CA,"onTransitionStart"),Wr(NA,"onTransitionCancel"),Wr(p0,"onTransitionEnd"),oi("onMouseEnter",["mouseout","mouseover"]),oi("onMouseLeave",["mouseout","mouseover"]),oi("onPointerEnter",["pointerout","pointerover"]),oi("onPointerLeave",["pointerout","pointerover"]),io("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),io("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),io("onBeforeInput",["compositionend","keypress","textInput","paste"]),io("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),io("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),io("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kc="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(" "),lO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kc));function PS(s,a){a=(a&4)!==0;for(var c=0;c<s.length;c++){var f=s[c],x=f.event;f=f.listeners;e:{var b=void 0;if(a)for(var k=f.length-1;0<=k;k--){var P=f[k],q=P.instance,se=P.currentTarget;if(P=P.listener,q!==b&&x.isPropagationStopped())break e;b=P,x.currentTarget=se;try{b(x)}catch(ce){gd(ce)}x.currentTarget=null,b=q}else for(k=0;k<f.length;k++){if(P=f[k],q=P.instance,se=P.currentTarget,P=P.listener,q!==b&&x.isPropagationStopped())break e;b=P,x.currentTarget=se;try{b(x)}catch(ce){gd(ce)}x.currentTarget=null,b=q}}}}function at(s,a){var c=a[_m];c===void 0&&(c=a[_m]=new Set);var f=s+"__bubble";c.has(f)||(LS(a,s,2,!1),c.add(f))}function pg(s,a,c){var f=0;a&&(f|=4),LS(c,s,f,a)}var nf="_reactListening"+Math.random().toString(36).slice(2);function gg(s){if(!s[nf]){s[nf]=!0,Mb.forEach(function(c){c!=="selectionchange"&&(lO.has(c)||pg(c,!1,s),pg(c,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[nf]||(a[nf]=!0,pg("selectionchange",!1,a))}}function LS(s,a,c,f){switch(f1(a)){case 2:var x=PO;break;case 8:x=LO;break;default:x=Rg}c=x.bind(null,a,c,s),x=void 0,!Pm||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(x=!0),f?x!==void 0?s.addEventListener(a,c,{capture:!0,passive:x}):s.addEventListener(a,c,!0):x!==void 0?s.addEventListener(a,c,{passive:x}):s.addEventListener(a,c,!1)}function vg(s,a,c,f,x){var b=f;if((a&1)===0&&(a&2)===0&&f!==null)e:for(;;){if(f===null)return;var k=f.tag;if(k===3||k===4){var P=f.stateNode.containerInfo;if(P===x)break;if(k===4)for(k=f.return;k!==null;){var q=k.tag;if((q===3||q===4)&&k.stateNode.containerInfo===x)return;k=k.return}for(;P!==null;){if(k=ri(P),k===null)return;if(q=k.tag,q===5||q===6||q===26||q===27){f=b=k;continue e}P=P.parentNode}}f=f.return}Ub(function(){var se=b,ce=Dm(c),he=[];e:{var oe=g0.get(s);if(oe!==void 0){var ie=hd,Ee=s;switch(s){case"keypress":if(dd(c)===0)break e;case"keydown":case"keyup":ie=tA;break;case"focusin":Ee="focus",ie=Fm;break;case"focusout":Ee="blur",ie=Fm;break;case"beforeblur":case"afterblur":ie=Fm;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Hb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=qR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=sA;break;case f0:case h0:case m0:ie=YR;break;case p0:ie=oA;break;case"scroll":case"scrollend":ie=BR;break;case"wheel":ie=lA;break;case"copy":case"cut":case"paste":ie=GR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Wb;break;case"toggle":case"beforetoggle":ie=uA}var qe=(a&4)!==0,Et=!qe&&(s==="scroll"||s==="scrollend"),J=qe?oe!==null?oe+"Capture":null:oe;qe=[];for(var Z=se,re;Z!==null;){var de=Z;if(re=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||re===null||J===null||(de=Gl(Z,J),de!=null&&qe.push(_c(Z,de,re))),Et)break;Z=Z.return}0<qe.length&&(oe=new ie(oe,Ee,null,c,ce),he.push({event:oe,listeners:qe}))}}if((a&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",ie=s==="mouseout"||s==="pointerout",oe&&c!==Om&&(Ee=c.relatedTarget||c.fromElement)&&(ri(Ee)||Ee[ni]))break e;if((ie||oe)&&(oe=ce.window===ce?ce:(oe=ce.ownerDocument)?oe.defaultView||oe.parentWindow:window,ie?(Ee=c.relatedTarget||c.toElement,ie=se,Ee=Ee?ri(Ee):null,Ee!==null&&(Et=l(Ee),qe=Ee.tag,Ee!==Et||qe!==5&&qe!==27&&qe!==6)&&(Ee=null)):(ie=null,Ee=se),ie!==Ee)){if(qe=Hb,de="onMouseLeave",J="onMouseEnter",Z="mouse",(s==="pointerout"||s==="pointerover")&&(qe=Wb,de="onPointerLeave",J="onPointerEnter",Z="pointer"),Et=ie==null?oe:Wl(ie),re=Ee==null?oe:Wl(Ee),oe=new qe(de,Z+"leave",ie,c,ce),oe.target=Et,oe.relatedTarget=re,de=null,ri(ce)===se&&(qe=new qe(J,Z+"enter",Ee,c,ce),qe.target=re,qe.relatedTarget=Et,de=qe),Et=de,ie&&Ee)t:{for(qe=cO,J=ie,Z=Ee,re=0,de=J;de;de=qe(de))re++;de=0;for(var Ie=Z;Ie;Ie=qe(Ie))de++;for(;0<re-de;)J=qe(J),re--;for(;0<de-re;)Z=qe(Z),de--;for(;re--;){if(J===Z||Z!==null&&J===Z.alternate){qe=J;break t}J=qe(J),Z=qe(Z)}qe=null}else qe=null;ie!==null&&IS(he,oe,ie,qe,!1),Ee!==null&&Et!==null&&IS(he,Et,Ee,qe,!0)}}e:{if(oe=se?Wl(se):window,ie=oe.nodeName&&oe.nodeName.toLowerCase(),ie==="select"||ie==="input"&&oe.type==="file")var ft=t0;else if(Jb(oe))if(n0)ft=bA;else{ft=xA;var Ae=vA}else ie=oe.nodeName,!ie||ie.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?se&&Am(se.elementType)&&(ft=t0):ft=yA;if(ft&&(ft=ft(s,se))){e0(he,ft,c,ce);break e}Ae&&Ae(s,oe,se),s==="focusout"&&se&&oe.type==="number"&&se.memoizedProps.value!=null&&Rm(oe,"number",oe.value)}switch(Ae=se?Wl(se):window,s){case"focusin":(Jb(Ae)||Ae.contentEditable==="true")&&(fi=Ae,Ym=se,nc=null);break;case"focusout":nc=Ym=fi=null;break;case"mousedown":Wm=!0;break;case"contextmenu":case"mouseup":case"dragend":Wm=!1,u0(he,c,ce);break;case"selectionchange":if(SA)break;case"keydown":case"keyup":u0(he,c,ce)}var Xe;if(Um)e:{switch(s){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else di?Kb(s,c)&&(lt="onCompositionEnd"):s==="keydown"&&c.keyCode===229&&(lt="onCompositionStart");lt&&(Gb&&c.locale!=="ko"&&(di||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&di&&(Xe=qb()):(ga=ce,Lm="value"in ga?ga.value:ga.textContent,di=!0)),Ae=rf(se,lt),0<Ae.length&&(lt=new Yb(lt,s,null,c,ce),he.push({event:lt,listeners:Ae}),Xe?lt.data=Xe:(Xe=Xb(c),Xe!==null&&(lt.data=Xe)))),(Xe=fA?hA(s,c):mA(s,c))&&(lt=rf(se,"onBeforeInput"),0<lt.length&&(Ae=new Yb("onBeforeInput","beforeinput",null,c,ce),he.push({event:Ae,listeners:lt}),Ae.data=Xe)),aO(he,s,se,c,ce)}PS(he,a)})}function _c(s,a,c){return{instance:s,listener:a,currentTarget:c}}function rf(s,a){for(var c=a+"Capture",f=[];s!==null;){var x=s,b=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||b===null||(x=Gl(s,c),x!=null&&f.unshift(_c(s,x,b)),x=Gl(s,a),x!=null&&f.push(_c(s,x,b))),s.tag===3)return f;s=s.return}return[]}function cO(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function IS(s,a,c,f,x){for(var b=a._reactName,k=[];c!==null&&c!==f;){var P=c,q=P.alternate,se=P.stateNode;if(P=P.tag,q!==null&&q===f)break;P!==5&&P!==26&&P!==27||se===null||(q=se,x?(se=Gl(c,b),se!=null&&k.unshift(_c(c,se,q))):x||(se=Gl(c,b),se!=null&&k.push(_c(c,se,q)))),c=c.return}k.length!==0&&s.push({event:a,listeners:k})}var uO=/\r\n?/g,dO=/\u0000|\uFFFD/g;function $S(s){return(typeof s=="string"?s:""+s).replace(uO,`
9
9
  `).replace(dO,"")}function FS(s,a){return a=$S(a),$S(s)===a}function _t(s,a,c,f,x,b){switch(c){case"children":typeof f=="string"?a==="body"||a==="textarea"&&f===""||li(s,f):(typeof f=="number"||typeof f=="bigint")&&a!=="body"&&li(s,""+f);break;case"className":id(s,"class",f);break;case"tabIndex":id(s,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":id(s,c,f);break;case"style":Fb(s,f,b);break;case"data":if(a!=="object"){id(s,"data",f);break}case"src":case"href":if(f===""&&(a!=="a"||c!=="href")){s.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){s.removeAttribute(c);break}f=cd(""+f),s.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){s.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(c==="formAction"?(a!=="input"&&_t(s,a,"name",x.name,x,null),_t(s,a,"formEncType",x.formEncType,x,null),_t(s,a,"formMethod",x.formMethod,x,null),_t(s,a,"formTarget",x.formTarget,x,null)):(_t(s,a,"encType",x.encType,x,null),_t(s,a,"method",x.method,x,null),_t(s,a,"target",x.target,x,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){s.removeAttribute(c);break}f=cd(""+f),s.setAttribute(c,f);break;case"onClick":f!=null&&(s.onclick=zs);break;case"onScroll":f!=null&&at("scroll",s);break;case"onScrollEnd":f!=null&&at("scrollend",s);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=c}}break;case"multiple":s.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":s.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){s.removeAttribute("xlink:href");break}c=cd(""+f),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(c,""+f):s.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(c,""):s.removeAttribute(c);break;case"capture":case"download":f===!0?s.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?s.setAttribute(c,f):s.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?s.setAttribute(c,f):s.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?s.removeAttribute(c):s.setAttribute(c,f);break;case"popover":at("beforetoggle",s),at("toggle",s),od(s,"popover",f);break;case"xlinkActuate":Ds(s,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Ds(s,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Ds(s,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Ds(s,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Ds(s,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Ds(s,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Ds(s,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Ds(s,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Ds(s,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":od(s,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=$R.get(c)||c,od(s,c,f))}}function xg(s,a,c,f,x,b){switch(c){case"style":Fb(s,f,b);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=c}}break;case"children":typeof f=="string"?li(s,f):(typeof f=="number"||typeof f=="bigint")&&li(s,""+f);break;case"onScroll":f!=null&&at("scroll",s);break;case"onScrollEnd":f!=null&&at("scrollend",s);break;case"onClick":f!=null&&(s.onclick=zs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rb.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(x=c.endsWith("Capture"),a=c.slice(2,x?c.length-7:void 0),b=s[Wn]||null,b=b!=null?b[c]:null,typeof b=="function"&&s.removeEventListener(a,b,x),typeof f=="function")){typeof b!="function"&&b!==null&&(c in s?s[c]=null:s.hasAttribute(c)&&s.removeAttribute(c)),s.addEventListener(a,f,x);break e}c in s?s[c]=f:f===!0?s.setAttribute(c,""):od(s,c,f)}}}function Tn(s,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",s),at("load",s);var f=!1,x=!1,b;for(b in c)if(c.hasOwnProperty(b)){var k=c[b];if(k!=null)switch(b){case"src":f=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:_t(s,a,b,k,c,null)}}x&&_t(s,a,"srcSet",c.srcSet,c,null),f&&_t(s,a,"src",c.src,c,null);return;case"input":at("invalid",s);var P=b=k=x=null,q=null,se=null;for(f in c)if(c.hasOwnProperty(f)){var ce=c[f];if(ce!=null)switch(f){case"name":x=ce;break;case"type":k=ce;break;case"checked":q=ce;break;case"defaultChecked":se=ce;break;case"value":b=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,a));break;default:_t(s,a,f,ce,c,null)}}Pb(s,b,P,q,se,k,x,!1);return;case"select":at("invalid",s),f=k=b=null;for(x in c)if(c.hasOwnProperty(x)&&(P=c[x],P!=null))switch(x){case"value":b=P;break;case"defaultValue":k=P;break;case"multiple":f=P;default:_t(s,a,x,P,c,null)}a=b,c=k,s.multiple=!!f,a!=null?ii(s,!!f,a,!1):c!=null&&ii(s,!!f,c,!0);return;case"textarea":at("invalid",s),b=x=f=null;for(k in c)if(c.hasOwnProperty(k)&&(P=c[k],P!=null))switch(k){case"value":f=P;break;case"defaultValue":x=P;break;case"children":b=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:_t(s,a,k,P,c,null)}Ib(s,f,x,b);return;case"option":for(q in c)c.hasOwnProperty(q)&&(f=c[q],f!=null)&&(q==="selected"?s.selected=f&&typeof f!="function"&&typeof f!="symbol":_t(s,a,q,f,c,null));return;case"dialog":at("beforetoggle",s),at("toggle",s),at("cancel",s),at("close",s);break;case"iframe":case"object":at("load",s);break;case"video":case"audio":for(f=0;f<kc.length;f++)at(kc[f],s);break;case"image":at("error",s),at("load",s);break;case"details":at("toggle",s);break;case"embed":case"source":case"link":at("error",s),at("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in c)if(c.hasOwnProperty(se)&&(f=c[se],f!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:_t(s,a,se,f,c,null)}return;default:if(Am(a)){for(ce in c)c.hasOwnProperty(ce)&&(f=c[ce],f!==void 0&&xg(s,a,ce,f,c,void 0));return}}for(P in c)c.hasOwnProperty(P)&&(f=c[P],f!=null&&_t(s,a,P,f,c,null))}function fO(s,a,c,f){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,b=null,k=null,P=null,q=null,se=null,ce=null;for(ie in c){var he=c[ie];if(c.hasOwnProperty(ie)&&he!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":q=he;default:f.hasOwnProperty(ie)||_t(s,a,ie,null,f,he)}}for(var oe in f){var ie=f[oe];if(he=c[oe],f.hasOwnProperty(oe)&&(ie!=null||he!=null))switch(oe){case"type":b=ie;break;case"name":x=ie;break;case"checked":se=ie;break;case"defaultChecked":ce=ie;break;case"value":k=ie;break;case"defaultValue":P=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,a));break;default:ie!==he&&_t(s,a,oe,ie,f,he)}}Mm(s,k,P,q,se,ce,b,x);return;case"select":ie=k=P=oe=null;for(b in c)if(q=c[b],c.hasOwnProperty(b)&&q!=null)switch(b){case"value":break;case"multiple":ie=q;default:f.hasOwnProperty(b)||_t(s,a,b,null,f,q)}for(x in f)if(b=f[x],q=c[x],f.hasOwnProperty(x)&&(b!=null||q!=null))switch(x){case"value":oe=b;break;case"defaultValue":P=b;break;case"multiple":k=b;default:b!==q&&_t(s,a,x,b,f,q)}a=P,c=k,f=ie,oe!=null?ii(s,!!c,oe,!1):!!f!=!!c&&(a!=null?ii(s,!!c,a,!0):ii(s,!!c,c?[]:"",!1));return;case"textarea":ie=oe=null;for(P in c)if(x=c[P],c.hasOwnProperty(P)&&x!=null&&!f.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:_t(s,a,P,null,f,x)}for(k in f)if(x=f[k],b=c[k],f.hasOwnProperty(k)&&(x!=null||b!=null))switch(k){case"value":oe=x;break;case"defaultValue":ie=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==b&&_t(s,a,k,x,f,b)}Lb(s,oe,ie);return;case"option":for(var Ee in c)oe=c[Ee],c.hasOwnProperty(Ee)&&oe!=null&&!f.hasOwnProperty(Ee)&&(Ee==="selected"?s.selected=!1:_t(s,a,Ee,null,f,oe));for(q in f)oe=f[q],ie=c[q],f.hasOwnProperty(q)&&oe!==ie&&(oe!=null||ie!=null)&&(q==="selected"?s.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":_t(s,a,q,oe,f,ie));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var qe in c)oe=c[qe],c.hasOwnProperty(qe)&&oe!=null&&!f.hasOwnProperty(qe)&&_t(s,a,qe,null,f,oe);for(se in f)if(oe=f[se],ie=c[se],f.hasOwnProperty(se)&&oe!==ie&&(oe!=null||ie!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,a));break;default:_t(s,a,se,oe,f,ie)}return;default:if(Am(a)){for(var Et in c)oe=c[Et],c.hasOwnProperty(Et)&&oe!==void 0&&!f.hasOwnProperty(Et)&&xg(s,a,Et,void 0,f,oe);for(ce in f)oe=f[ce],ie=c[ce],!f.hasOwnProperty(ce)||oe===ie||oe===void 0&&ie===void 0||xg(s,a,ce,oe,f,ie);return}}for(var J in c)oe=c[J],c.hasOwnProperty(J)&&oe!=null&&!f.hasOwnProperty(J)&&_t(s,a,J,null,f,oe);for(he in f)oe=f[he],ie=c[he],!f.hasOwnProperty(he)||oe===ie||oe==null&&ie==null||_t(s,a,he,oe,f,ie)}function BS(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hO(){if(typeof performance.getEntriesByType=="function"){for(var s=0,a=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var x=c[f],b=x.transferSize,k=x.initiatorType,P=x.duration;if(b&&P&&BS(k)){for(k=0,P=x.responseEnd,f+=1;f<c.length;f++){var q=c[f],se=q.startTime;if(se>P)break;var ce=q.transferSize,he=q.initiatorType;ce&&BS(he)&&(q=q.responseEnd,k+=ce*(q<P?1:(P-se)/(q-se)))}if(--f,a+=8*(b+k)/(x.duration/1e3),s++,10<s)break}}if(0<s)return a/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var yg=null,bg=null;function sf(s){return s.nodeType===9?s:s.ownerDocument}function US(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qS(s,a){if(s===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&a==="foreignObject"?0:s}function wg(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Sg=null;function mO(){var s=window.event;return s&&s.type==="popstate"?s===Sg?!1:(Sg=s,!0):(Sg=null,!1)}var VS=typeof setTimeout=="function"?setTimeout:void 0,pO=typeof clearTimeout=="function"?clearTimeout:void 0,HS=typeof Promise=="function"?Promise:void 0,gO=typeof queueMicrotask=="function"?queueMicrotask:typeof HS<"u"?function(s){return HS.resolve(null).then(s).catch(vO)}:VS;function vO(s){setTimeout(function(){throw s})}function Oa(s){return s==="head"}function YS(s,a){var c=a,f=0;do{var x=c.nextSibling;if(s.removeChild(c),x&&x.nodeType===8)if(c=x.data,c==="/$"||c==="/&"){if(f===0){s.removeChild(x),$i(a);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")Ec(s.ownerDocument.documentElement);else if(c==="head"){c=s.ownerDocument.head,Ec(c);for(var b=c.firstChild;b;){var k=b.nextSibling,P=b.nodeName;b[Yl]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&b.rel.toLowerCase()==="stylesheet"||c.removeChild(b),b=k}}else c==="body"&&Ec(s.ownerDocument.body);c=x}while(c);$i(a)}function WS(s,a){var c=s;s=0;do{var f=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(s===0)break;s--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||s++;c=f}while(c)}function jg(s){var a=s.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":jg(c),Em(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}s.removeChild(c)}}function xO(s,a,c,f){for(;s.nodeType===1;){var x=c;if(s.nodeName.toLowerCase()!==a.toLowerCase()){if(!f&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(f){if(!s[Yl])switch(a){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(b=s.getAttribute("rel"),b==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(b!==x.rel||s.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||s.getAttribute("title")!==(x.title==null?null:x.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(b=s.getAttribute("src"),(b!==(x.src==null?null:x.src)||s.getAttribute("type")!==(x.type==null?null:x.type)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&b&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(a==="input"&&s.type==="hidden"){var b=x.name==null?null:""+x.name;if(x.type==="hidden"&&s.getAttribute("name")===b)return s}else return s;if(s=Or(s.nextSibling),s===null)break}return null}function yO(s,a,c){if(a==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Or(s.nextSibling),s===null))return null;return s}function GS(s,a){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!a||(s=Or(s.nextSibling),s===null))return null;return s}function Cg(s){return s.data==="$?"||s.data==="$~"}function Ng(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function bO(s,a){var c=s.ownerDocument;if(s.data==="$~")s._reactRetry=a;else if(s.data!=="$?"||c.readyState!=="loading")a();else{var f=function(){a(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),s._reactRetry=f}}function Or(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return s}var kg=null;function ZS(s){s=s.nextSibling;for(var a=0;s;){if(s.nodeType===8){var c=s.data;if(c==="/$"||c==="/&"){if(a===0)return Or(s.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}s=s.nextSibling}return null}function QS(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var c=s.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return s;a--}else c!=="/$"&&c!=="/&"||a++}s=s.previousSibling}return null}function KS(s,a,c){switch(a=sf(c),s){case"html":if(s=a.documentElement,!s)throw Error(r(452));return s;case"head":if(s=a.head,!s)throw Error(r(453));return s;case"body":if(s=a.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Ec(s){for(var a=s.attributes;a.length;)s.removeAttributeNode(a[0]);Em(s)}var Dr=new Map,XS=new Set;function af(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ks=$.d;$.d={f:wO,r:SO,D:jO,C:CO,L:NO,m:kO,X:EO,S:_O,M:TO};function wO(){var s=Ks.f(),a=Qd();return s||a}function SO(s){var a=si(s);a!==null&&a.tag===5&&a.type==="form"?pw(a):Ks.r(s)}var Pi=typeof document>"u"?null:document;function JS(s,a,c){var f=Pi;if(f&&typeof a=="string"&&a){var x=kr(a);x='link[rel="'+s+'"][href="'+x+'"]',typeof c=="string"&&(x+='[crossorigin="'+c+'"]'),XS.has(x)||(XS.add(x),s={rel:s,crossOrigin:c,href:a},f.querySelector(x)===null&&(a=f.createElement("link"),Tn(a,"link",s),Sn(a),f.head.appendChild(a)))}}function jO(s){Ks.D(s),JS("dns-prefetch",s,null)}function CO(s,a){Ks.C(s,a),JS("preconnect",s,a)}function NO(s,a,c){Ks.L(s,a,c);var f=Pi;if(f&&s&&a){var x='link[rel="preload"][as="'+kr(a)+'"]';a==="image"&&c&&c.imageSrcSet?(x+='[imagesrcset="'+kr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(x+='[imagesizes="'+kr(c.imageSizes)+'"]')):x+='[href="'+kr(s)+'"]';var b=x;switch(a){case"style":b=Li(s);break;case"script":b=Ii(s)}Dr.has(b)||(s=g({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:s,as:a},c),Dr.set(b,s),f.querySelector(x)!==null||a==="style"&&f.querySelector(Tc(b))||a==="script"&&f.querySelector(Mc(b))||(a=f.createElement("link"),Tn(a,"link",s),Sn(a),f.head.appendChild(a)))}}function kO(s,a){Ks.m(s,a);var c=Pi;if(c&&s){var f=a&&typeof a.as=="string"?a.as:"script",x='link[rel="modulepreload"][as="'+kr(f)+'"][href="'+kr(s)+'"]',b=x;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Ii(s)}if(!Dr.has(b)&&(s=g({rel:"modulepreload",href:s},a),Dr.set(b,s),c.querySelector(x)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Mc(b)))return}f=c.createElement("link"),Tn(f,"link",s),Sn(f),c.head.appendChild(f)}}}function _O(s,a,c){Ks.S(s,a,c);var f=Pi;if(f&&s){var x=ai(f).hoistableStyles,b=Li(s);a=a||"default";var k=x.get(b);if(!k){var P={loading:0,preload:null};if(k=f.querySelector(Tc(b)))P.loading=5;else{s=g({rel:"stylesheet",href:s,"data-precedence":a},c),(c=Dr.get(b))&&_g(s,c);var q=k=f.createElement("link");Sn(q),Tn(q,"link",s),q._p=new Promise(function(se,ce){q.onload=se,q.onerror=ce}),q.addEventListener("load",function(){P.loading|=1}),q.addEventListener("error",function(){P.loading|=2}),P.loading|=4,of(k,a,f)}k={type:"stylesheet",instance:k,count:1,state:P},x.set(b,k)}}}function EO(s,a){Ks.X(s,a);var c=Pi;if(c&&s){var f=ai(c).hoistableScripts,x=Ii(s),b=f.get(x);b||(b=c.querySelector(Mc(x)),b||(s=g({src:s,async:!0},a),(a=Dr.get(x))&&Eg(s,a),b=c.createElement("script"),Sn(b),Tn(b,"link",s),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(x,b))}}function TO(s,a){Ks.M(s,a);var c=Pi;if(c&&s){var f=ai(c).hoistableScripts,x=Ii(s),b=f.get(x);b||(b=c.querySelector(Mc(x)),b||(s=g({src:s,async:!0,type:"module"},a),(a=Dr.get(x))&&Eg(s,a),b=c.createElement("script"),Sn(b),Tn(b,"link",s),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(x,b))}}function e1(s,a,c,f){var x=(x=ue.current)?af(x):null;if(!x)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(a=Li(c.href),c=ai(x).hoistableStyles,f=c.get(a),f||(f={type:"style",instance:null,count:0,state:null},c.set(a,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){s=Li(c.href);var b=ai(x).hoistableStyles,k=b.get(s);if(k||(x=x.ownerDocument||x,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(s,k),(b=x.querySelector(Tc(s)))&&!b._p&&(k.instance=b,k.state.loading=5),Dr.has(s)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Dr.set(s,c),b||MO(x,s,c,k.state))),a&&f===null)throw Error(r(528,""));return k}if(a&&f!==null)throw Error(r(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ii(c),c=ai(x).hoistableScripts,f=c.get(a),f||(f={type:"script",instance:null,count:0,state:null},c.set(a,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Li(s){return'href="'+kr(s)+'"'}function Tc(s){return'link[rel="stylesheet"]['+s+"]"}function t1(s){return g({},s,{"data-precedence":s.precedence,precedence:null})}function MO(s,a,c,f){s.querySelector('link[rel="preload"][as="style"]['+a+"]")?f.loading=1:(a=s.createElement("link"),f.preload=a,a.addEventListener("load",function(){return f.loading|=1}),a.addEventListener("error",function(){return f.loading|=2}),Tn(a,"link",c),Sn(a),s.head.appendChild(a))}function Ii(s){return'[src="'+kr(s)+'"]'}function Mc(s){return"script[async]"+s}function n1(s,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var f=s.querySelector('style[data-href~="'+kr(c.href)+'"]');if(f)return a.instance=f,Sn(f),f;var x=g({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(s.ownerDocument||s).createElement("style"),Sn(f),Tn(f,"style",x),of(f,c.precedence,s),a.instance=f;case"stylesheet":x=Li(c.href);var b=s.querySelector(Tc(x));if(b)return a.state.loading|=4,a.instance=b,Sn(b),b;f=t1(c),(x=Dr.get(x))&&_g(f,x),b=(s.ownerDocument||s).createElement("link"),Sn(b);var k=b;return k._p=new Promise(function(P,q){k.onload=P,k.onerror=q}),Tn(b,"link",f),a.state.loading|=4,of(b,c.precedence,s),a.instance=b;case"script":return b=Ii(c.src),(x=s.querySelector(Mc(b)))?(a.instance=x,Sn(x),x):(f=c,(x=Dr.get(b))&&(f=g({},c),Eg(f,x)),s=s.ownerDocument||s,x=s.createElement("script"),Sn(x),Tn(x,"link",f),s.head.appendChild(x),a.instance=x);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(f=a.instance,a.state.loading|=4,of(f,c.precedence,s));return a.instance}function of(s,a,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=f.length?f[f.length-1]:null,b=x,k=0;k<f.length;k++){var P=f[k];if(P.dataset.precedence===a)b=P;else if(b!==x)break}b?b.parentNode.insertBefore(s,b.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(s,a.firstChild))}function _g(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.title==null&&(s.title=a.title)}function Eg(s,a){s.crossOrigin==null&&(s.crossOrigin=a.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=a.referrerPolicy),s.integrity==null&&(s.integrity=a.integrity)}var lf=null;function r1(s,a,c){if(lf===null){var f=new Map,x=lf=new Map;x.set(c,f)}else x=lf,f=x.get(c),f||(f=new Map,x.set(c,f));if(f.has(s))return f;for(f.set(s,null),c=c.getElementsByTagName(s),x=0;x<c.length;x++){var b=c[x];if(!(b[Yl]||b[Zt]||s==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var k=b.getAttribute(a)||"";k=s+k;var P=f.get(k);P?P.push(b):f.set(k,[b])}}return f}function s1(s,a,c){s=s.ownerDocument||s,s.head.insertBefore(c,a==="title"?s.querySelector("head > title"):null)}function RO(s,a,c){if(c===1||a.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(s=a.disabled,typeof a.precedence=="string"&&s==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function a1(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function AO(s,a,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var x=Li(f.href),b=a.querySelector(Tc(x));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(s.count++,s=cf.bind(s),a.then(s,s)),c.state.loading|=4,c.instance=b,Sn(b);return}b=a.ownerDocument||a,f=t1(f),(x=Dr.get(x))&&_g(f,x),b=b.createElement("link"),Sn(b);var k=b;k._p=new Promise(function(P,q){k.onload=P,k.onerror=q}),Tn(b,"link",f),c.instance=b}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(s.count++,c=cf.bind(s),a.addEventListener("load",c),a.addEventListener("error",c))}}var Tg=0;function OO(s,a){return s.stylesheets&&s.count===0&&df(s,s.stylesheets),0<s.count||0<s.imgCount?function(c){var f=setTimeout(function(){if(s.stylesheets&&df(s,s.stylesheets),s.unsuspend){var b=s.unsuspend;s.unsuspend=null,b()}},6e4+a);0<s.imgBytes&&Tg===0&&(Tg=62500*hO());var x=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&df(s,s.stylesheets),s.unsuspend)){var b=s.unsuspend;s.unsuspend=null,b()}},(s.imgBytes>Tg?50:800)+a);return s.unsuspend=c,function(){s.unsuspend=null,clearTimeout(f),clearTimeout(x)}}:null}function cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)df(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var uf=null;function df(s,a){s.stylesheets=null,s.unsuspend!==null&&(s.count++,uf=new Map,a.forEach(DO,s),uf=null,cf.call(s))}function DO(s,a){if(!(a.state.loading&4)){var c=uf.get(s);if(c)var f=c.get(null);else{c=new Map,uf.set(s,c);for(var x=s.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<x.length;b++){var k=x[b];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(c.set(k.dataset.precedence,k),f=k)}f&&c.set(null,f)}x=a.instance,k=x.getAttribute("data-precedence"),b=c.get(k)||f,b===f&&c.set(null,x),c.set(k,x),this.count++,f=cf.bind(this),x.addEventListener("load",f),x.addEventListener("error",f),b?b.parentNode.insertBefore(x,b.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(x,s.firstChild)),a.state.loading|=4}}var Rc={$$typeof:E,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function zO(s,a,c,f,x,b,k,P,q){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gt(0),this.hiddenUpdates=Gt(null),this.identifierPrefix=f,this.onUncaughtError=x,this.onCaughtError=b,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function o1(s,a,c,f,x,b,k,P,q,se,ce,he){return s=new zO(s,a,c,k,q,se,ce,he,P),a=1,b===!0&&(a|=24),b=lr(3,null,null,a),s.current=b,b.stateNode=s,a=lp(),a.refCount++,s.pooledCache=a,a.refCount++,b.memoizedState={element:f,isDehydrated:c,cache:a},fp(b),s}function i1(s){return s?(s=pi,s):pi}function l1(s,a,c,f,x,b){x=i1(x),f.context===null?f.context=x:f.pendingContext=x,f=Sa(a),f.payload={element:c},b=b===void 0?null:b,b!==null&&(f.callback=b),c=ja(s,f,a),c!==null&&(Jn(c,s,a),cc(c,s,a))}function c1(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<a?c:a}}function Mg(s,a){c1(s,a),(s=s.alternate)&&c1(s,a)}function u1(s){if(s.tag===13||s.tag===31){var a=fo(s,67108864);a!==null&&Jn(a,s,67108864),Mg(s,67108864)}}function d1(s){if(s.tag===13||s.tag===31){var a=hr();a=je(a);var c=fo(s,a);c!==null&&Jn(c,s,a),Mg(s,a)}}var ff=!0;function PO(s,a,c,f){var x=L.T;L.T=null;var b=$.p;try{$.p=2,Rg(s,a,c,f)}finally{$.p=b,L.T=x}}function LO(s,a,c,f){var x=L.T;L.T=null;var b=$.p;try{$.p=8,Rg(s,a,c,f)}finally{$.p=b,L.T=x}}function Rg(s,a,c,f){if(ff){var x=Ag(f);if(x===null)vg(s,a,f,hf,c),h1(s,f);else if($O(x,s,a,c,f))f.stopPropagation();else if(h1(s,f),a&4&&-1<IO.indexOf(s)){for(;x!==null;){var b=si(x);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var k=Ve(b.pendingLanes);if(k!==0){var P=b;for(P.pendingLanes|=2,P.entangledLanes|=2;k;){var q=1<<31-$t(k);P.entanglements[1]|=q,k&=~q}ms(b),(vt&6)===0&&(Gd=ct()+500,Nc(0))}}break;case 31:case 13:P=fo(b,2),P!==null&&Jn(P,b,2),Qd(),Mg(b,2)}if(b=Ag(f),b===null&&vg(s,a,f,hf,c),b===x)break;x=b}x!==null&&f.stopPropagation()}else vg(s,a,f,null,c)}}function Ag(s){return s=Dm(s),Og(s)}var hf=null;function Og(s){if(hf=null,s=ri(s),s!==null){var a=l(s);if(a===null)s=null;else{var c=a.tag;if(c===13){if(s=u(a),s!==null)return s;s=null}else if(c===31){if(s=d(a),s!==null)return s;s=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null)}}return hf=s,null}function f1(s){switch(s){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Mn()){case Qe:return 2;case bt:return 8;case pt:case Vn:return 32;case or:return 268435456;default:return 32}default:return 32}}var Dg=!1,Da=null,za=null,Pa=null,Ac=new Map,Oc=new Map,La=[],IO="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".split(" ");function h1(s,a){switch(s){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Pa=null;break;case"pointerover":case"pointerout":Ac.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oc.delete(a.pointerId)}}function Dc(s,a,c,f,x,b){return s===null||s.nativeEvent!==b?(s={blockedOn:a,domEventName:c,eventSystemFlags:f,nativeEvent:b,targetContainers:[x]},a!==null&&(a=si(a),a!==null&&u1(a)),s):(s.eventSystemFlags|=f,a=s.targetContainers,x!==null&&a.indexOf(x)===-1&&a.push(x),s)}function $O(s,a,c,f,x){switch(a){case"focusin":return Da=Dc(Da,s,a,c,f,x),!0;case"dragenter":return za=Dc(za,s,a,c,f,x),!0;case"mouseover":return Pa=Dc(Pa,s,a,c,f,x),!0;case"pointerover":var b=x.pointerId;return Ac.set(b,Dc(Ac.get(b)||null,s,a,c,f,x)),!0;case"gotpointercapture":return b=x.pointerId,Oc.set(b,Dc(Oc.get(b)||null,s,a,c,f,x)),!0}return!1}function m1(s){var a=ri(s.target);if(a!==null){var c=l(a);if(c!==null){if(a=c.tag,a===13){if(a=u(c),a!==null){s.blockedOn=a,Ke(s.priority,function(){d1(c)});return}}else if(a===31){if(a=d(c),a!==null){s.blockedOn=a,Ke(s.priority,function(){d1(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){s.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}s.blockedOn=null}function mf(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var c=Ag(s.nativeEvent);if(c===null){c=s.nativeEvent;var f=new c.constructor(c.type,c);Om=f,c.target.dispatchEvent(f),Om=null}else return a=si(c),a!==null&&u1(a),s.blockedOn=c,!1;a.shift()}return!0}function p1(s,a,c){mf(s)&&c.delete(a)}function FO(){Dg=!1,Da!==null&&mf(Da)&&(Da=null),za!==null&&mf(za)&&(za=null),Pa!==null&&mf(Pa)&&(Pa=null),Ac.forEach(p1),Oc.forEach(p1)}function pf(s,a){s.blockedOn===a&&(s.blockedOn=null,Dg||(Dg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,FO)))}var gf=null;function g1(s){gf!==s&&(gf=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gf===s&&(gf=null);for(var a=0;a<s.length;a+=3){var c=s[a],f=s[a+1],x=s[a+2];if(typeof f!="function"){if(Og(f||c)===null)continue;break}var b=si(c);b!==null&&(s.splice(a,3),a-=3,Ap(b,{pending:!0,data:x,method:c.method,action:f},f,x))}}))}function $i(s){function a(q){return pf(q,s)}Da!==null&&pf(Da,s),za!==null&&pf(za,s),Pa!==null&&pf(Pa,s),Ac.forEach(a),Oc.forEach(a);for(var c=0;c<La.length;c++){var f=La[c];f.blockedOn===s&&(f.blockedOn=null)}for(;0<La.length&&(c=La[0],c.blockedOn===null);)m1(c),c.blockedOn===null&&La.shift();if(c=(s.ownerDocument||s).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var x=c[f],b=c[f+1],k=x[Wn]||null;if(typeof b=="function")k||g1(c);else if(k){var P=null;if(b&&b.hasAttribute("formAction")){if(x=b,k=b[Wn]||null)P=k.formAction;else if(Og(x)!==null)continue}else P=k.action;typeof P=="function"?c[f+1]=P:(c.splice(f,3),f-=3),g1(c)}}}function v1(){function s(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(k){return x=k})},focusReset:"manual",scroll:"manual"})}function a(){x!==null&&(x(),x=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,x=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),x!==null&&(x(),x=null)}}}function zg(s){this._internalRoot=s}vf.prototype.render=zg.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(r(409));var c=a.current,f=hr();l1(c,f,s,a,null,null)},vf.prototype.unmount=zg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;l1(s.current,2,null,s,null,null),Qd(),a[ni]=null}};function vf(s){this._internalRoot=s}vf.prototype.unstable_scheduleHydration=function(s){if(s){var a=gt();s={blockedOn:null,target:s,priority:a};for(var c=0;c<La.length&&a!==0&&a<La[c].priority;c++);La.splice(c,0,s),c===0&&m1(s)}};var x1=t.version;if(x1!=="19.2.4")throw Error(r(527,x1,"19.2.4"));$.findDOMNode=function(s){var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=m(a),s=s!==null?v(s):null,s=s===null?null:s.stateNode,s};var BO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xf.isDisabled&&xf.supportsFiber)try{Pn=xf.inject(BO),qt=xf}catch{}}return Pc.createRoot=function(s,a){if(!o(s))throw Error(r(299));var c=!1,f="",x=Nw,b=kw,k=_w;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(x=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(k=a.onRecoverableError)),a=o1(s,1,!1,null,null,c,f,null,x,b,k,v1),s[ni]=a.current,gg(s),new zg(a)},Pc.hydrateRoot=function(s,a,c){if(!o(s))throw Error(r(299));var f=!1,x="",b=Nw,k=kw,P=_w,q=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(x=c.identifierPrefix),c.onUncaughtError!==void 0&&(b=c.onUncaughtError),c.onCaughtError!==void 0&&(k=c.onCaughtError),c.onRecoverableError!==void 0&&(P=c.onRecoverableError),c.formState!==void 0&&(q=c.formState)),a=o1(s,1,!0,a,c??null,f,x,q,b,k,P,v1),a.context=i1(null),c=a.current,f=hr(),f=je(f),x=Sa(f),x.callback=null,ja(c,x,f),c=f,a.current.lanes=c,Ot(a,c),ms(a),s[ni]=a.current,gg(s),new vf(a)},Pc.version="19.2.4",Pc}var E1;function KO(){if(E1)return Ig.exports;E1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ig.exports=QO(),Ig.exports}var XO=KO(),vs=[],Pr=[],JO=Uint8Array,Ug="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Fi=0,eD=Ug.length;Fi<eD;++Fi)vs[Fi]=Ug[Fi],Pr[Ug.charCodeAt(Fi)]=Fi;Pr[45]=62;Pr[95]=63;function tD(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function nD(e,t,n){return(t+n)*3/4-n}function cu(e){var t,n=tD(e),r=n[0],o=n[1],l=new JO(nD(e,r,o)),u=0,d=o>0?r-4:r,h;for(h=0;h<d;h+=4)t=Pr[e.charCodeAt(h)]<<18|Pr[e.charCodeAt(h+1)]<<12|Pr[e.charCodeAt(h+2)]<<6|Pr[e.charCodeAt(h+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=t&255;return o===2&&(t=Pr[e.charCodeAt(h)]<<2|Pr[e.charCodeAt(h+1)]>>4,l[u++]=t&255),o===1&&(t=Pr[e.charCodeAt(h)]<<10|Pr[e.charCodeAt(h+1)]<<4|Pr[e.charCodeAt(h+2)]>>2,l[u++]=t>>8&255,l[u++]=t&255),l}function rD(e){return vs[e>>18&63]+vs[e>>12&63]+vs[e>>6&63]+vs[e&63]}function sD(e,t,n){for(var r,o=[],l=t;l<n;l+=3)r=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),o.push(rD(r));return o.join("")}function uu(e){for(var t,n=e.length,r=n%3,o=[],l=16383,u=0,d=n-r;u<d;u+=l)o.push(sD(e,u,u+l>d?d:u+l));return r===1?(t=e[n-1],o.push(vs[t>>2]+vs[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(vs[t>>10]+vs[t>>4&63]+vs[t<<2&63]+"=")),o.join("")}function na(e){if(e===void 0)return{};if(!yN(e))throw new Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function aD(e){if(typeof e>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof e!="string")throw new Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw new Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function yN(e){const t=typeof e=="object",n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name==="Object";return t&&r}const bN=!0,dl=BigInt("-9223372036854775808"),Ox=BigInt("9223372036854775807"),Zv=BigInt("0"),oD=BigInt("8"),iD=BigInt("256");function wN(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function lD(e){e<Zv&&(e-=dl+dl);let t=e.toString(16);t.length%2===1&&(t="0"+t);const n=new Uint8Array(new ArrayBuffer(8));let r=0;for(const o of t.match(/.{2}/g).reverse())n.set([parseInt(o,16)],r++),e>>=oD;return uu(n)}function cD(e){const t=cu(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=Zv,r=Zv;for(const o of t)n+=BigInt(o)*iD**r,r++;return n>Ox&&(n+=dl+dl),n}function uD(e){if(e<dl||Ox<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),uu(new Uint8Array(t))}function dD(e){const t=cu(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}const fD=DataView.prototype.setBigInt64?uD:lD,hD=DataView.prototype.getBigInt64?dD:cD,T1=1024;function SN(e){if(e.length>T1)throw new Error(`Field name ${e} exceeds maximum field name length ${T1}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||n>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function fl(e){if(e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(Array.isArray(e))return e.map(r=>fl(r));if(typeof e!="object")throw new Error(`Unexpected type of ${e}`);const t=Object.entries(e);if(t.length===1){const r=t[0][0];if(r==="$bytes"){if(typeof e.$bytes!="string")throw new Error(`Malformed $bytes field on ${e}`);return cu(e.$bytes).buffer}if(r==="$integer"){if(typeof e.$integer!="string")throw new Error(`Malformed $integer field on ${e}`);return hD(e.$integer)}if(r==="$float"){if(typeof e.$float!="string")throw new Error(`Malformed $float field on ${e}`);const o=cu(e.$float);if(o.byteLength!==8)throw new Error(`Received ${o.byteLength} bytes, expected 8 for $float`);const u=new DataView(o.buffer).getFloat64(0,bN);if(!wN(u))throw new Error(`Float ${u} should be encoded as a number`);return u}if(r==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(r==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const n={};for(const[r,o]of Object.entries(e))SN(r),n[r]=fl(o);return n}const M1=16384;function ru(e){const t=JSON.stringify(e,(n,r)=>r===void 0?"undefined":typeof r=="bigint"?`${r.toString()}n`:r);if(t.length>M1){const n="[...truncated]";let r=M1-n.length;const o=t.codePointAt(r-1);return o!==void 0&&o>65535&&(r-=1),t.substring(0,r)+n}return t}function Qv(e,t,n,r){if(e===void 0){const u=n&&` (present at path ${n} in original object ${ru(t)})`;throw new Error(`undefined is not a valid Convex value${u}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<dl||Ox<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:fD(e)}}if(typeof e=="number")if(wN(e)){const u=new ArrayBuffer(8);return new DataView(u).setFloat64(0,e,bN),{$float:uu(new Uint8Array(u))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:uu(new Uint8Array(e))};if(Array.isArray(e))return e.map((u,d)=>Qv(u,t,n+`[${d}]`));if(e instanceof Set)throw new Error(qg(n,"Set",[...e],t));if(e instanceof Map)throw new Error(qg(n,"Map",[...e],t));if(!yN(e)){const u=e?.constructor?.name,d=u?`${u} `:"";throw new Error(qg(n,d,e,t))}const o={},l=Object.entries(e);l.sort(([u,d],[h,m])=>u===h?0:u<h?-1:1);for(const[u,d]of l)d!==void 0&&(SN(u),o[u]=Qv(d,t,n+`.${u}`));return o}function qg(e,t,n,r){return e?`${t}${ru(n)} is not a supported Convex type (present at path ${e} in original object ${ru(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${ru(n)} is not a supported Convex type.`}function ks(e){return Qv(e,e,"")}var mD=Object.defineProperty,pD=(e,t,n)=>t in e?mD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vg=(e,t,n)=>pD(e,typeof t!="symbol"?t+"":t,n),R1,A1;const gD=Symbol.for("ConvexError");class Kv extends(A1=Error,R1=gD,A1){constructor(t){super(typeof t=="string"?t:ru(t)),Vg(this,"name","ConvexError"),Vg(this,"data"),Vg(this,R1,!0),this.data=t}}const jN=()=>Array.from({length:4},()=>0);jN();jN();const O1="1.31.6";var vD=Object.defineProperty,xD=(e,t,n)=>t in e?vD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D1=(e,t,n)=>xD(e,typeof t!="symbol"?t+"":t,n);const yD="color:rgb(0, 145, 255)";function CN(e){switch(e){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class NN{constructor(t){D1(this,"_onLogLineFuncs"),D1(this,"_verbose"),this._onLogLineFuncs={},this._verbose=t.verbose}addLogLineListener(t){let n=Math.random().toString(36).substring(2,15);for(let r=0;r<10&&this._onLogLineFuncs[n]!==void 0;r++)n=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[n]=t,()=>{delete this._onLogLineFuncs[n]}}logVerbose(...t){if(this._verbose)for(const n of Object.values(this._onLogLineFuncs))n("debug",`${new Date().toISOString()}`,...t)}log(...t){for(const n of Object.values(this._onLogLineFuncs))n("info",...t)}warn(...t){for(const n of Object.values(this._onLogLineFuncs))n("warn",...t)}error(...t){for(const n of Object.values(this._onLogLineFuncs))n("error",...t)}}function kN(e){const t=new NN(e);return t.addLogLineListener((n,...r)=>{switch(n){case"debug":console.debug(...r);break;case"info":console.log(...r);break;case"warn":console.warn(...r);break;case"error":console.error(...r);break;default:console.log(...r)}}),t}function _N(e){return new NN(e)}function Kf(e,t,n,r,o){const l=CN(n);if(typeof o=="object"&&(o=`ConvexError ${JSON.stringify(o.errorData,null,2)}`),t==="info"){const u=o.match(/^\[.*?\] /);if(u===null){e.error(`[CONVEX ${l}(${r})] Could not parse console.log`);return}const d=o.slice(1,u[0].length-2),h=o.slice(u[0].length);e.log(`%c[CONVEX ${l}(${r})] [${d}]`,yD,h)}else e.error(`[CONVEX ${l}(${r})] ${o}`)}function bD(e,t){const n=`[CONVEX FATAL ERROR] ${t}`;return e.error(n),new Error(n)}function Ji(e,t,n){return`[CONVEX ${CN(e)}(${t})] ${n.errorMessage}
10
- Called by client`}function Xv(e,t){return t.data=e.errorData,t}function Lo(e){const t=e.split(":");let n,r;return t.length===1?(n=t[0],r="default"):(n=t.slice(0,t.length-1).join(":"),r=t[t.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${r}`}function Oo(e,t){return JSON.stringify({udfPath:Lo(e),args:ks(t)})}function z1(e,t,n){const{initialNumItems:r,id:o}=n;return JSON.stringify({type:"paginated",udfPath:Lo(e),args:ks(t),options:ks({initialNumItems:r,id:o})})}var wD=Object.defineProperty,SD=(e,t,n)=>t in e?wD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ps=(e,t,n)=>SD(e,typeof t!="symbol"?t+"":t,n);class jD{constructor(){ps(this,"nextQueryId"),ps(this,"querySetVersion"),ps(this,"querySet"),ps(this,"queryIdToToken"),ps(this,"identityVersion"),ps(this,"auth"),ps(this,"outstandingQueriesOlderThanRestart"),ps(this,"outstandingAuthOlderThanRestart"),ps(this,"paused"),ps(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,n,r,o){const l=Lo(t),u=Oo(l,n),d=this.querySet.get(u);if(d!==void 0)return d.numSubscribers+=1,{queryToken:u,modification:null,unsubscribe:()=>this.removeSubscriber(u)};{const h=this.nextQueryId++,m={id:h,canonicalizedUdfPath:l,args:n,numSubscribers:1,journal:r,componentPath:o};this.querySet.set(u,m),this.queryIdToToken.set(h,u);const v=this.querySetVersion,g=this.querySetVersion+1,y={type:"Add",queryId:h,udfPath:l,args:[ks(n)],journal:r,componentPath:o};return this.paused?this.pendingQuerySetModifications.set(h,y):this.querySetVersion=g,{queryToken:u,modification:{type:"ModifyQuerySet",baseVersion:v,newVersion:g,modifications:[y]},unsubscribe:()=>this.removeSubscriber(u)}}}transition(t){for(const n of t.modifications)switch(n.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);const r=n.journal;if(r!==void 0){const o=this.queryIdToToken.get(n.queryId);o!==void 0&&(this.querySet.get(o).journal=r)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);break}default:throw new Error(`Invalid modification ${n.type}`)}}queryId(t,n){const r=Lo(t),o=Oo(r,n),l=this.querySet.get(o);return l!==void 0?l.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};const n=this.identityVersion;return this.paused||(this.identityVersion=n+1),{type:"Authenticate",baseVersion:n,...this.auth}}setAdminAuth(t,n){const r={tokenType:"Admin",value:t,impersonating:n};this.auth=r;const o=this.identityVersion;return this.paused||(this.identityVersion=o+1),{type:"Authenticate",baseVersion:o,...r}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).canonicalizedUdfPath:null}queryArgs(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(t){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const n=[];for(const l of this.querySet.values()){const u={type:"Add",queryId:l.id,udfPath:l.canonicalizedUdfPath,args:[ks(l.args)],journal:l.journal,componentPath:l.componentPath};n.push(u),t.has(l.id)||this.outstandingQueriesOlderThanRestart.add(l.id)}this.querySetVersion=1;const r={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:n};if(!this.auth)return this.identityVersion=0,[r,void 0];this.outstandingAuthOlderThanRestart=!0;const o={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[r,o]}pause(){this.paused=!0}resume(){const t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,n=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,n]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){const n=this.querySet.get(t);if(n.numSubscribers>1)return n.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(n.id),this.outstandingQueriesOlderThanRestart.delete(n.id);const r=this.querySetVersion,o=this.querySetVersion+1,l={type:"Remove",queryId:n.id};return this.paused?this.pendingQuerySetModifications.has(n.id)?this.pendingQuerySetModifications.delete(n.id):this.pendingQuerySetModifications.set(n.id,l):this.querySetVersion=o,{type:"ModifyQuerySet",baseVersion:r,newVersion:o,modifications:[l]}}}}var CD=Object.defineProperty,ND=(e,t,n)=>t in e?CD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yf=(e,t,n)=>ND(e,typeof t!="symbol"?t+"":t,n);class kD{constructor(t,n){this.logger=t,this.markConnectionStateDirty=n,yf(this,"inflightRequests"),yf(this,"requestsOlderThanRestart"),yf(this,"inflightMutationsCount",0),yf(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,n){const r=new Promise(o=>{const l=n?"Requested":"NotSent";this.inflightRequests.set(t.requestId,{message:t,status:{status:l,requestedAt:new Date,onResult:o}}),t.type==="Mutation"?this.inflightMutationsCount++:t.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),r}onResponse(t){const n=this.inflightRequests.get(t.requestId);if(n===void 0||n.status.status==="Completed")return null;const r=n.message.type==="Mutation"?"mutation":"action",o=n.message.udfPath;for(const h of t.logLines)Kf(this.logger,"info",r,o,h);const l=n.status;let u,d;if(t.success)u={success:!0,logLines:t.logLines,value:fl(t.result)},d=()=>l.onResult(u);else{const h=t.result,{errorData:m}=t;Kf(this.logger,"error",r,o,h),u={success:!1,errorMessage:h,errorData:m!==void 0?fl(m):void 0,logLines:t.logLines},d=()=>l.onResult(u)}return t.type==="ActionResponse"||!t.success?(d(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),n.message.type==="Action"?this.inflightActionsCount--:n.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:u}):(n.status={status:"Completed",result:u,ts:t.ts,onResolve:d},null)}removeCompleted(t){const n=new Map;for(const[r,o]of this.inflightRequests.entries()){const l=o.status;l.status==="Completed"&&l.ts.lessThanOrEqual(t)&&(l.onResolve(),n.set(r,l.result),o.message.type==="Mutation"?this.inflightMutationsCount--:o.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(r),this.requestsOlderThanRestart.delete(r))}return n.size>0&&this.markConnectionStateDirty(),n}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const t=[];for(const[n,r]of this.inflightRequests){if(r.status.status==="NotSent"){r.status.status="Requested",t.push(r.message);continue}if(r.message.type==="Mutation")t.push(r.message);else if(r.message.type==="Action"){if(this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n),this.inflightActionsCount--,r.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");r.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){const t=[];for(const[,n]of this.inflightRequests)if(n.status.status==="NotSent"){n.status.status="Requested",t.push(n.message);continue}return t}hasIncompleteRequests(){for(const t of this.inflightRequests.values())if(t.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let t=Date.now();for(const n of this.inflightRequests.values())n.status.status!=="Completed"&&n.status.requestedAt.getTime()<t&&(t=n.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const du=Symbol.for("functionName"),_D=Symbol.for("toReferencePath");function ED(e){return e[_D]??null}function TD(e){return e.startsWith("function://")}function MD(e){let t;if(typeof e=="string")TD(e)?t={functionHandle:e}:t={name:e};else if(e[du])t={name:e[du]};else{const n=ED(e);if(!n)throw new Error(`${e} is not a functionReference`);t={reference:n}}return t}function tr(e){const t=MD(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;const n=e[du];if(!n)throw new Error(`${e} is not a functionReference`);return n}function EN(e){return{[du]:e}}function TN(e=[]){const t={get(n,r){if(typeof r=="string"){const o=[...e,r];return TN(o)}else if(r===du){if(e.length<2){const u=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${u}\``)}const o=e.slice(0,-1).join("/"),l=e[e.length-1];return l==="default"?o:o+":"+l}else return r===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}TN();var RD=Object.defineProperty,AD=(e,t,n)=>t in e?RD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xf=(e,t,n)=>AD(e,typeof t!="symbol"?t+"":t,n);class fu{constructor(t){Xf(this,"queryResults"),Xf(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...n){const r=na(n[0]),o=tr(t),l=this.queryResults.get(Oo(o,r));if(l!==void 0)return fu.queryValue(l.result)}getAllQueries(t){const n=[],r=tr(t);for(const o of this.queryResults.values())o.udfPath===Lo(r)&&n.push({args:o.args,value:fu.queryValue(o.result)});return n}setQuery(t,n,r){const o=na(n),l=tr(t),u=Oo(l,o);let d;r===void 0?d=void 0:d={success:!0,value:r,logLines:[]};const h={udfPath:l,args:o,result:d};this.queryResults.set(u,h),this.modifiedQueries.push(u)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}}class OD{constructor(){Xf(this,"queryResults"),Xf(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,n){this.optimisticUpdates=this.optimisticUpdates.filter(u=>!n.has(u.mutationId));const r=this.queryResults;this.queryResults=new Map(t);const o=new fu(this.queryResults);for(const u of this.optimisticUpdates)u.update(o);const l=[];for(const[u,d]of this.queryResults){const h=r.get(u);(h===void 0||h.result!==d.result)&&l.push(u)}return l}applyOptimisticUpdate(t,n){this.optimisticUpdates.push({update:t,mutationId:n});const r=new fu(this.queryResults);return t(r),r.modifiedQueries}rawQueryResult(t){const n=this.queryResults.get(t);if(n!==void 0)return n.result}queryResult(t){const n=this.queryResults.get(t);if(n===void 0)return;const r=n.result;if(r!==void 0){if(r.success)return r.value;throw r.errorData!==void 0?Xv(r,new Kv(Ji("query",n.udfPath,r))):new Error(Ji("query",n.udfPath,r))}}hasQueryResult(t){return this.queryResults.get(t)!==void 0}queryLogs(t){return this.queryResults.get(t)?.result?.logLines}}var DD=Object.defineProperty,zD=(e,t,n)=>t in e?DD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hg=(e,t,n)=>zD(e,typeof t!="symbol"?t+"":t,n);let Lu=class ta{constructor(t,n){Hg(this,"low"),Hg(this,"high"),Hg(this,"__isUnsignedLong__"),this.low=t|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new ta(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?P1:t>=PD?LD:new ta(t%su|0,t/su|0)}toString(){return(BigInt(this.high)*BigInt(su)+BigInt(this.low)).toString()}equals(t){return ta.isLong(t)||(t=ta.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return ta.isLong(t)||(t=ta.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?ta.fromNumber(t):new ta(t.low,t.high)}};const P1=new Lu(0,0),L1=65536,su=L1*L1,PD=su*su,LD=new Lu(-1,-1);var ID=Object.defineProperty,$D=(e,t,n)=>t in e?ID(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bf=(e,t,n)=>$D(e,typeof t!="symbol"?t+"":t,n);class I1{constructor(t,n){bf(this,"version"),bf(this,"remoteQuerySet"),bf(this,"queryPath"),bf(this,"logger"),this.version={querySet:0,ts:Lu.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=n}transition(t){const n=t.startVersion;if(this.version.querySet!==n.querySet||this.version.ts.notEquals(n.ts)||this.version.identity!==n.identity)throw new Error(`Invalid start version: ${n.ts.toString()}:${n.querySet}:${n.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const r of t.modifications)switch(r.type){case"QueryUpdated":{const o=this.queryPath(r.queryId);if(o)for(const u of r.logLines)Kf(this.logger,"info","query",o,u);const l=fl(r.value??null);this.remoteQuerySet.set(r.queryId,{success:!0,value:l,logLines:r.logLines});break}case"QueryFailed":{const o=this.queryPath(r.queryId);if(o)for(const u of r.logLines)Kf(this.logger,"info","query",o,u);const{errorData:l}=r;this.remoteQuerySet.set(r.queryId,{success:!1,errorMessage:r.errorMessage,errorData:l!==void 0?fl(l):void 0,logLines:r.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(r.queryId);break}default:throw new Error(`Invalid modification ${r.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function Yg(e){const t=cu(e);return Lu.fromBytesLE(Array.from(t))}function FD(e){const t=new Uint8Array(e.toBytesLE());return uu(t)}function $1(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":return e.success?{...e,ts:Yg(e.ts)}:{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:Yg(e.startVersion.ts)},endVersion:{...e.endVersion,ts:Yg(e.endVersion.ts)}}}}function BD(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":return e.maxObservedTimestamp!==void 0?{...e,maxObservedTimestamp:FD(e.maxObservedTimestamp)}:{...e,maxObservedTimestamp:void 0}}}var UD=Object.defineProperty,qD=(e,t,n)=>t in e?UD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,on=(e,t,n)=>qD(e,typeof t!="symbol"?t+"":t,n);const VD=1e3,HD=1001,YD=1005,WD=4040;let Bf;function Gi(){return Bf===void 0&&(Bf=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(Bf+performance.now())}function F1(){return`t=${Math.round((Gi()-Bf)/100)/10}s`}const MN={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function GD(e){if(e===void 0)return"Unknown";for(const t of Object.keys(MN))if(e.startsWith(t))return t;return"Unknown"}class ZD{constructor(t,n,r,o,l,u){this.markConnectionStateDirty=l,this.debug=u,on(this,"socket"),on(this,"connectionCount"),on(this,"_hasEverConnected",!1),on(this,"lastCloseReason"),on(this,"transitionChunkBuffer",null),on(this,"defaultInitialBackoff"),on(this,"maxBackoff"),on(this,"retries"),on(this,"serverInactivityThreshold"),on(this,"reconnectDueToServerInactivityTimeout"),on(this,"scheduledReconnect",null),on(this,"networkOnlineHandler",null),on(this,"pendingNetworkRecoveryInfo",null),on(this,"uri"),on(this,"onOpen"),on(this,"onResume"),on(this,"onMessage"),on(this,"webSocketConstructor"),on(this,"logger"),on(this,"onServerDisconnectError"),this.webSocketConstructor=r,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=n.onOpen,this.onResume=n.onResume,this.onMessage=n.onMessage,this.onServerDisconnectError=n.onServerDisconnectError,this.logger=o,this.setupNetworkListener(),this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||t.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){const n=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${n}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){const n=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const r=$1(JSON.parse(n));if(r.type!=="Transition")throw new Error(`Expected Transition, got ${r.type} after assembling chunks`);return r}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:t,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Gi()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",F1(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",F1())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:n}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:n}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(n/1e3)}s of waiting`)}},t.onerror=n=>{this.transitionChunkBuffer=null;const r=n.message;r&&this.logger.log(`WebSocket error message: ${r}`)},t.onmessage=n=>{this.resetServerInactivityTimeout();const r=n.data.length;let o=$1(JSON.parse(n.data));if(this._logVerbose(`received ws message with type ${o.type}`),o.type==="Ping")return;if(o.type==="TransitionChunk"){const u=this.assembleTransition(o);if(!u)return;o=u,this._logVerbose(`assembled full ws message of type ${o.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${o.type} while buffering TransitionChunks`)),o.type==="Transition"&&this.reportLargeTransition({messageLength:r,transition:o}),this.onMessage(o).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},t.onclose=n=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=n.reason||`closed with code ${n.code}`),n.code!==VD&&n.code!==HD&&n.code!==YD&&n.code!==WD){let o=`WebSocket closed with code ${n.code}`;n.reason&&(o+=`: ${n.reason}`),this.logger.log(o),this.onServerDisconnectError&&n.reason&&this.onServerDisconnectError(o)}const r=GD(n.reason);this.scheduleReconnect(r)}}socketState(){return this.socket.state}sendMessage(t){const n={type:t.type,...t.type==="Authenticate"&&t.tokenType==="User"?{value:`...${t.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const r=BD(t),o=JSON.stringify(r);let l=!1;try{this.socket.ws.send(o),l=!0}catch(u){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${u}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${l?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(n)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(n)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const n=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(n)}ms`);const r=Gi(),o=setTimeout(()=>{this.scheduledReconnect?.timeout===o&&(this.scheduledReconnect=null,this.connect())},n);this.scheduledReconnect={timeout:o,scheduledAt:r,backoffMs:n}}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const t=this.socket.ws;return t.onmessage=n=>{this._logVerbose("Ignoring message received after close")},new Promise(n=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),n()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");const t=this.socket.ws;t.onmessage=r=>{this._logVerbose("Ignoring message received after close")};const n=new Promise(r=>{t.onclose=()=>{r()}});return t.close(),n}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let t=null;if(this.scheduledReconnect){const n=Gi()-this.scheduledReconnect.scheduledAt;t=Math.max(0,this.scheduledReconnect.backoffMs-n),this._logVerbose(`would have waited ${Math.round(t)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(n)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=t!==null?{timeSavedMs:t}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Gi()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){const r=(t==="client"?100:t==="Unknown"?this.defaultInitialBackoff:MN[t].timeout)*Math.pow(2,this.retries);this.retries+=1;const o=Math.min(r,this.maxBackoff),l=o*(Math.random()-.5);return o+l}reportLargeTransition({transition:t,messageLength:n}){if(t.clientClockSkew===void 0||t.serverTs===void 0)return;const r=Gi()-t.clientClockSkew-t.serverTs/1e6,o=`${Math.round(r)}ms`,l=`${Math.round(n/1e4)/100}MB`,u=n/(r/1e3),d=`${Math.round(u/1e4)/100}MB per second`;this._logVerbose(`received ${l} transition in ${o} at ${d}`),n>2e7?this.logger.log(`received query results totaling more that 20MB (${l}) which will take a long time to download on slower connections`):r>2e4&&this.logger.log(`received query results totaling ${l} which took more than 20s to arrive (${o})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:r,messageLength:n}})}}function QD(){return KD()}function KD(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}let Gc=class extends Error{};Gc.prototype.name="InvalidTokenError";function XD(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function JD(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return XD(t)}catch{return atob(t)}}function RN(e,t){if(typeof e!="string")throw new Gc("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Gc(`Invalid token specified: missing part #${n+1}`);let o;try{o=JD(r)}catch(l){throw new Gc(`Invalid token specified: invalid base64 for part #${n+1} (${l.message})`)}try{return JSON.parse(o)}catch(l){throw new Gc(`Invalid token specified: invalid json for part #${n+1} (${l.message})`)}}var ez=Object.defineProperty,tz=(e,t,n)=>t in e?ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zr=(e,t,n)=>tz(e,typeof t!="symbol"?t+"":t,n);const nz=480*60*60*1e3,B1=2;class rz{constructor(t,n,r){zr(this,"authState",{state:"noAuth"}),zr(this,"configVersion",0),zr(this,"syncState"),zr(this,"authenticate"),zr(this,"stopSocket"),zr(this,"tryRestartSocket"),zr(this,"pauseSocket"),zr(this,"resumeSocket"),zr(this,"clearAuth"),zr(this,"logger"),zr(this,"refreshTokenLeewaySeconds"),zr(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=n.authenticate,this.stopSocket=n.stopSocket,this.tryRestartSocket=n.tryRestartSocket,this.pauseSocket=n.pauseSocket,this.resumeSocket=n.resumeSocket,this.clearAuth=n.clearAuth,this.logger=r.logger,this.refreshTokenLeewaySeconds=r.refreshTokenLeewaySeconds}async setConfig(t,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const r=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});r.isFromOutdatedConfig||(r.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:n},hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:n}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(t.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:n}=t;if(!this.syncState.isCurrentOrNewerAuthVersion(n+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(t)}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=B1){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${B1-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const n=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});n.isFromOutdatedConfig||(n.value&&this.syncState.isNewAuth(n.value)?(this.authenticate(n.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:n.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if(this.authState.state==="noAuth")return;const n=this.decodeToken(t);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:r,exp:o}=n;if(!r||!o){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const l=o-r;if(l<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let u=Math.min(nz,(l-this.refreshTokenLeewaySeconds)*1e3);u<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${l}s`),u=0);const d=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},u);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:d,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${u}ms`)}async fetchTokenAndGuardAgainstRace(t,n){const r=++this.configVersion;this._logVerbose(`fetching token with config version ${r}`);const o=await t(n);return this.configVersion!==r?(this._logVerbose(`stale config version, expected ${r}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:o}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){const n=t.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(n)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=t}decodeToken(t){try{return RN(t)}catch(n){return this._logVerbose(`Error decoding token: ${n instanceof Error?n.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}const sz=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function az(e,t){const n={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(e,{detail:n})}function oz(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function iz(e){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const n of sz){const r=performance.getEntriesByName(n).filter(o=>o.entryType==="mark").filter(o=>o.detail.sessionId===e);t.push(...r)}return t.map(oz)}var lz=Object.defineProperty,cz=(e,t,n)=>t in e?lz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t,n)=>cz(e,typeof t!="symbol"?t+"":t,n);class uz{constructor(t,n,r){if(ln(this,"address"),ln(this,"state"),ln(this,"requestManager"),ln(this,"webSocketManager"),ln(this,"authenticationManager"),ln(this,"remoteQuerySet"),ln(this,"optimisticQueryResults"),ln(this,"_transitionHandlerCounter",0),ln(this,"_nextRequestId"),ln(this,"_onTransitionFns",new Map),ln(this,"_sessionId"),ln(this,"firstMessageReceived",!1),ln(this,"debug"),ln(this,"logger"),ln(this,"maxObservedTimestamp"),ln(this,"connectionStateSubscribers",new Map),ln(this,"nextConnectionStateSubscriberId",0),ln(this,"_lastPublishedConnectionState"),ln(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const w=this.connectionState();if(JSON.stringify(w)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=w;for(const S of this.connectionStateSubscribers.values())S(w)}})}),ln(this,"mark",w=>{this.debug&&az(w,this.sessionId)}),typeof t=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");r?.skipConvexDeploymentUrlCheck!==!0&&aD(t),r={...r};const o=r.authRefreshTokenLeewaySeconds??2;let l=r.webSocketConstructor;if(!l&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");l=l||WebSocket,this.debug=r.reportDebugInfoToConvex??!1,this.address=t,this.logger=r.logger===!1?_N({verbose:r.verbose??!1}):r.logger!==!0&&r.logger?r.logger:kN({verbose:r.verbose??!1});const u=t.search("://");if(u===-1)throw new Error("Provided address was not an absolute URL.");const d=t.substring(u+3),h=t.substring(0,u);let m;if(h==="http")m="ws";else if(h==="https")m="wss";else throw new Error(`Unknown parent protocol ${h}`);const v=`${m}://${d}/api/${O1}/sync`;this.state=new jD,this.remoteQuerySet=new I1(w=>this.state.queryPath(w),this.logger),this.requestManager=new kD(this.logger,this.markConnectionStateDirty);const g=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new rz(this.state,{authenticate:w=>{const S=this.state.setAuth(w);return this.webSocketManager.sendMessage(S),S.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:g,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:o}),this.optimisticQueryResults=new OD,this.addOnTransitionHandler(w=>{n(w.queries.map(S=>S.token))}),this._nextRequestId=0,this._sessionId=QD();const{unsavedChangesWarning:y}=r;if(typeof window>"u"||typeof window.addEventListener>"u"){if(y===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else y!==!1&&window.addEventListener("beforeunload",w=>{if(this.requestManager.hasIncompleteRequests()){w.preventDefault();const S="Are you sure you want to leave? Your changes may not be saved.";return(w||window.event).returnValue=S,S}});this.webSocketManager=new ZD(v,{onOpen:w=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...w,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const S=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new I1(C=>this.state.queryPath(C),this.logger);const[j,N]=this.state.restart(S);N&&this.webSocketManager.sendMessage(N),this.webSocketManager.sendMessage(j);for(const C of this.requestManager.restart())this.webSocketManager.sendMessage(C)},onResume:()=>{const[w,S]=this.state.resume();S&&this.webSocketManager.sendMessage(S),w&&this.webSocketManager.sendMessage(w);for(const j of this.requestManager.resume())this.webSocketManager.sendMessage(j)},onMessage:w=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),w.type){case"Transition":{this.observedTimestamp(w.endVersion.ts),this.authenticationManager.onTransition(w),this.remoteQuerySet.transition(w),this.state.transition(w);const S=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(S);break}case"MutationResponse":{w.success&&this.observedTimestamp(w.ts);const S=this.requestManager.onResponse(w);S!==null&&this.notifyOnQueryResultChanges(new Map([[S.requestId,S.result]]));break}case"ActionResponse":{this.requestManager.onResponse(w);break}case"AuthError":{this.authenticationManager.onAuthError(w);break}case"FatalError":{const S=bD(this.logger,w.error);throw this.webSocketManager.terminate(),S}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:r.onServerDisconnectError},l,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),r.expectAuth&&g()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){const n=this.remoteQuerySet.remoteQueryResults(),r=new Map;for(const[l,u]of n){const d=this.state.queryToken(l);if(d!==null){const h={result:u,udfPath:this.state.queryPath(l),args:this.state.queryArgs(l)};r.set(d,h)}}const o=this.optimisticQueryResults.ingestQueryResultsFromServer(r,new Set(t.keys()));this.handleTransition({queries:o.map(l=>{const u=this.optimisticQueryResults.rawQueryResult(l);return{token:l,modification:{kind:"Updated",result:u}}}),reflectedMutations:Array.from(t).map(([l,u])=>({requestId:l,result:u})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(const n of this._onTransitionFns.values())n(t)}addOnTransitionHandler(t){const n=this._transitionHandlerCounter++;return this._onTransitionFns.set(n,t),()=>this._onTransitionFns.delete(n)}getCurrentAuthClaims(){const t=this.state.getAuth();let n={};if(t&&t.tokenType==="User")try{n=t?RN(t.value):{}}catch{n={}}else return;return{token:t.value,decoded:n}}setAuth(t,n){this.authenticationManager.setConfig(t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,n){const r=this.state.setAdminAuth(t,n);this.webSocketManager.sendMessage(r)}clearAuth(){const t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,n,r){const o=na(n),{modification:l,queryToken:u,unsubscribe:d}=this.state.subscribe(t,o,r?.journal,r?.componentPath);return l!==null&&this.webSocketManager.sendMessage(l),{queryToken:u,unsubscribe:()=>{const h=d();h&&this.webSocketManager.sendMessage(h)}}}localQueryResult(t,n){const r=na(n),o=Oo(t,r);return this.optimisticQueryResults.queryResult(o)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,n){const r=na(n),o=Oo(t,r);return this.optimisticQueryResults.queryLogs(o)}queryJournal(t,n){const r=na(n),o=Oo(t,r);return this.state.queryJournal(o)}connectionState(){const t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){const n=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(n,t),()=>{this.connectionStateSubscribers.delete(n)}}async mutation(t,n,r){const o=await this.mutationInternal(t,n,r);if(!o.success)throw o.errorData!==void 0?Xv(o,new Kv(Ji("mutation",t,o))):new Error(Ji("mutation",t,o));return o.value}async mutationInternal(t,n,r,o){const{mutationPromise:l}=this.enqueueMutation(t,n,r,o);return l}enqueueMutation(t,n,r,o){const l=na(n);this.tryReportLongDisconnect();const u=this.nextRequestId;if(this._nextRequestId++,r!==void 0){const v=r.optimisticUpdate;if(v!==void 0){const g=S=>{v(S,l)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},w=this.optimisticQueryResults.applyOptimisticUpdate(g,u).map(S=>{const j=this.localQueryResultByToken(S);return{token:S,modification:{kind:"Updated",result:j===void 0?void 0:{success:!0,value:j,logLines:[]}}}});this.handleTransition({queries:w,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const d={type:"Mutation",requestId:u,udfPath:t,componentPath:o,args:[ks(l)]},h=this.webSocketManager.sendMessage(d),m=this.requestManager.request(d,h);return{requestId:u,mutationPromise:m}}async action(t,n){const r=await this.actionInternal(t,n);if(!r.success)throw r.errorData!==void 0?Xv(r,new Kv(Ji("action",t,r))):new Error(Ji("action",t,r));return r.value}async actionInternal(t,n,r){const o=na(n),l=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const u={type:"Action",requestId:l,udfPath:t,componentPath:r,args:[ks(o)]},d=this.webSocketManager.sendMessage(u);return this.requestManager.request(u,d)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const t=iz(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;const t=this.connectionState().timeOfOldestInflightRequest;if(t===null||Date.now()-t.getTime()<=60*1e3)return;const n=`${this.address}/api/debug_event`;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${O1}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(r=>{r.ok||this.logger.warn("Analytics request failed with response:",r.body)}).catch(r=>{this.logger.warn("Analytics response failed with error:",r)})}}function Wg(e){if(typeof e!="object"||e===null||!Array.isArray(e.page)||typeof e.isDone!="boolean"||typeof e.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var dz=Object.defineProperty,fz=(e,t,n)=>t in e?dz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U1=(e,t,n)=>fz(e,typeof t!="symbol"?t+"":t,n);class hz{constructor(t,n){this.client=t,this.onTransition=n,U1(this,"paginatedQuerySet",new Map),U1(this,"lastTransitionTs"),this.lastTransitionTs=Lu.fromNumber(0),this.client.addOnTransitionHandler(r=>this.onBaseTransition(r))}subscribe(t,n,r){const o=Lo(t),l=z1(o,n,r),u=()=>this.removePaginatedQuerySubscriber(l),d=this.paginatedQuerySet.get(l);return d?(d.numSubscribers+=1,{paginatedQueryToken:l,unsubscribe:u}):(this.paginatedQuerySet.set(l,{token:l,canonicalizedUdfPath:o,args:n,numSubscribers:1,options:{initialNumItems:r.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:r.id}),this.addPageToPaginatedQuery(l,null,r.initialNumItems),{paginatedQueryToken:l,unsubscribe:u})}localQueryResult(t,n,r){const o=Lo(t),l=z1(o,n,r);return this.localQueryResultByToken(l)}localQueryResultByToken(t){const n=this.paginatedQuerySet.get(t);if(!n)return;const r=this.activePageQueryTokens(n);if(r.length===0)return{results:[],status:"LoadingFirstPage",loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)};let o=[],l=!1,u=!1;for(const h of r){const m=this.client.localQueryResultByToken(h);if(m===void 0){l=!0,u=!1;continue}const v=Wg(m);o=o.concat(v.page),u=!!v.isDone}let d;return l?d=o.length===0?"LoadingFirstPage":"LoadingMore":u?d="Exhausted":d="CanLoadMore",{results:o,status:d,loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)}}onBaseTransition(t){const n=t.queries.map(u=>u.token),r=this.queriesContainingTokens(n);let o=[];r.length>0&&(this.processPaginatedQuerySplits(r,u=>this.client.localQueryResultByToken(u)),o=r.map(u=>({token:u,modification:{kind:"Updated",result:this.localQueryResultByToken(u)}})));const l={...t,paginatedQueries:o};this.onTransition(l)}loadMoreOfPaginatedQuery(t,n){this.mustGetPaginatedQuery(t);const r=this.queryTokenForLastPageOfPaginatedQuery(t),o=this.client.localQueryResultByToken(r);if(!o)return!1;const l=Wg(o);if(l.isDone)return!1;this.addPageToPaginatedQuery(t,l.continueCursor,n);const u={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:t,modification:{kind:"Updated",result:this.localQueryResultByToken(t)}}]};return this.onTransition(u),!0}queriesContainingTokens(t){if(t.length===0)return[];const n=[],r=new Set(t);for(const[o,l]of this.paginatedQuerySet)for(const u of this.allQueryTokens(l))if(r.has(u)){n.push(o);break}return n}processPaginatedQuerySplits(t,n){for(const r of t){const o=this.mustGetPaginatedQuery(r),{ongoingSplits:l,pageKeyToQuery:u,pageKeys:d}=o;for(const[h,[m,v]]of l)n(u.get(m).queryToken)!==void 0&&n(u.get(v).queryToken)!==void 0&&this.completePaginatedQuerySplit(o,h,m,v);for(const h of d){if(l.has(h))continue;const m=u.get(h).queryToken,v=n(m);if(!v)continue;const g=Wg(v);g.splitCursor&&(g.pageStatus==="SplitRecommended"||g.pageStatus==="SplitRequired"||g.page.length>o.options.initialNumItems*2)&&this.splitPaginatedQueryPage(o,h,g.splitCursor,g.continueCursor)}}}splitPaginatedQueryPage(t,n,r,o){const l=t.nextPageKey++,u=t.nextPageKey++,d={cursor:o,numItems:t.options.initialNumItems,id:t.id},h=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:null,endCursor:r}});t.pageKeyToQuery.set(l,h);const m=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:r,endCursor:o}});t.pageKeyToQuery.set(u,m),t.ongoingSplits.set(n,[l,u])}addPageToPaginatedQuery(t,n,r){const o=this.mustGetPaginatedQuery(t),l=o.nextPageKey++,u={cursor:n,numItems:r,id:o.id},d={...o.args,paginationOpts:u},h=this.client.subscribe(o.canonicalizedUdfPath,d);return o.pageKeys.push(l),o.pageKeyToQuery.set(l,h),h}removePaginatedQuerySubscriber(t){const n=this.paginatedQuerySet.get(t);if(n&&(n.numSubscribers-=1,!(n.numSubscribers>0))){for(const r of n.pageKeyToQuery.values())r.unsubscribe();this.paginatedQuerySet.delete(t)}}completePaginatedQuerySplit(t,n,r,o){const l=t.pageKeyToQuery.get(n);t.pageKeyToQuery.delete(n);const u=t.pageKeys.indexOf(n);t.pageKeys.splice(u,1,r,o),t.ongoingSplits.delete(n),l.unsubscribe()}activePageQueryTokens(t){return t.pageKeys.map(n=>t.pageKeyToQuery.get(n).queryToken)}allQueryTokens(t){return Array.from(t.pageKeyToQuery.values()).map(n=>n.queryToken)}queryTokenForLastPageOfPaginatedQuery(t){const n=this.mustGetPaginatedQuery(t),r=n.pageKeys[n.pageKeys.length-1];if(r===void 0)throw new Error(`No pages for paginated query ${t}`);return n.pageKeyToQuery.get(r).queryToken}mustGetPaginatedQuery(t){const n=this.paginatedQuerySet.get(t);if(!n)throw new Error("paginated query no longer exists for token "+t);return n}}function mz({getCurrentValue:e,subscribe:t}){const[n,r]=p.useState(()=>({getCurrentValue:e,subscribe:t,value:e()}));let o=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(o=e(),r({getCurrentValue:e,subscribe:t,value:o})),p.useEffect(()=>{let l=!1;const u=()=>{l||r(h=>{if(h.getCurrentValue!==e||h.subscribe!==t)return h;const m=e();return h.value===m?h:{...h,value:m}})},d=t(u);return u(),()=>{l=!0,d()}},[e,t]),o}var pz=Object.defineProperty,gz=(e,t,n)=>t in e?pz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xs=(e,t,n)=>gz(e,typeof t!="symbol"?t+"":t,n);const vz=5e3;if(typeof ee>"u")throw new Error("Required dependency 'react' not found");function AN(e,t,n){function r(o){return wz(o),t.mutation(e,o,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(l){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${tr(e)}`);return AN(e,t,l)},r}class xz{constructor(t,n){if(Xs(this,"address"),Xs(this,"cachedSync"),Xs(this,"cachedPaginatedQueryClient"),Xs(this,"listeners"),Xs(this,"options"),Xs(this,"closed",!1),Xs(this,"_logger"),Xs(this,"adminAuth"),Xs(this,"fakeUserIdentity"),t===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof t!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=n?.logger===!1?_N({verbose:n?.verbose??!1}):n?.logger!==!0&&n?.logger?n.logger:kN({verbose:n?.verbose??!1}),this.options={...n,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new uz(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new hz(this.cachedSync,t=>this.handleTransition(t)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(t,n){if(typeof t=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,n??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,n){if(this.adminAuth=t,this.fakeUserIdentity=n,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,n)}watchQuery(t,...n){const[r,o]=n,l=tr(t);return{onUpdate:u=>{const{queryToken:d,unsubscribe:h}=this.sync.subscribe(l,r,o),m=this.listeners.get(d);return m!==void 0?m.add(u):this.listeners.set(d,new Set([u])),()=>{if(this.closed)return;const v=this.listeners.get(d);v.delete(u),v.size===0&&this.listeners.delete(d),h()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(l,r)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(l,r)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(l,r)}}}prewarmQuery(t){const n=t.extendSubscriptionFor??vz,o=this.watchQuery(t.query,t.args||{}).onUpdate(()=>{});setTimeout(o,n)}watchPaginatedQuery(t,n,r){const o=tr(t);return{onUpdate:l=>{const{paginatedQueryToken:u,unsubscribe:d}=this.paginatedQueryClient.subscribe(o,n||{},r),h=this.listeners.get(u);return h!==void 0?h.add(l):this.listeners.set(u,new Set([l])),()=>{if(this.closed)return;const m=this.listeners.get(u);m.delete(l),m.size===0&&this.listeners.delete(u),d()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(o,n,r)}}mutation(t,...n){const[r,o]=n,l=tr(t);return this.sync.mutation(l,r,o)}action(t,...n){const r=tr(t);return this.sync.action(r,...n)}query(t,...n){const r=this.watchQuery(t,...n),o=r.localQueryResult();return o!==void 0?Promise.resolve(o):new Promise((l,u)=>{const d=r.onUpdate(()=>{d();try{l(r.localQueryResult())}catch(h){u(h)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const t=this.cachedSync;this.cachedSync=void 0,await t.close()}}handleTransition(t){const n=t.queries.map(o=>o.token),r=t.paginatedQueries.map(o=>o.token);this.transition([...n,...r])}transition(t){for(const n of t){const r=this.listeners.get(n);if(r)for(const o of r)o()}}}const Dx=ee.createContext(void 0);function yz(){return p.useContext(Dx)}const bz=({client:e,children:t})=>ee.createElement(Dx.Provider,{value:e},t);function He(e,...t){const n=t[0]==="skip",r=t[0]==="skip"?{}:na(t[0]),o=typeof e=="string"?EN(e):e,l=tr(o),u=p.useMemo(()=>n?{}:{query:{query:o,args:r}},[JSON.stringify(ks(r)),l,n]),h=Nz(u).query;if(h instanceof Error)throw h;return h}function et(e){const t=typeof e=="string"?EN(e):e,n=p.useContext(Dx);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return p.useMemo(()=>AN(t,n),[n,tr(t)])}function wz(e){if(typeof e=="object"&&e!==null&&"bubbles"in e&&"persist"in e&&"isDefaultPrevented"in e)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var Sz=Object.defineProperty,jz=(e,t,n)=>t in e?Sz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gg=(e,t,n)=>jz(e,typeof t!="symbol"?t+"":t,n);class Cz{constructor(t){Gg(this,"createWatch"),Gg(this,"queries"),Gg(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(const n of Object.keys(t)){const{query:r,args:o,paginationOptions:l}=t[n];if(tr(r),this.queries[n]===void 0)this.addQuery(n,r,o,l?{paginationOptions:l}:{});else{const u=this.queries[n];(tr(r)!==tr(u.query)||JSON.stringify(ks(o))!==JSON.stringify(ks(u.args))||JSON.stringify(l)!==JSON.stringify(u.paginationOptions))&&(this.removeQuery(n),this.addQuery(n,r,o,l?{paginationOptions:l}:{}))}}for(const n of Object.keys(this.queries))t[n]===void 0&&this.removeQuery(n)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){const n={};for(const r of Object.keys(t)){const{query:o,args:l}=t[r],u=t[r].paginationOptions;tr(o);const d=this.createWatch(o,l,u?{paginationOptions:u}:{});let h;try{h=d.localQueryResult()}catch(m){if(m instanceof Error)h=m;else throw m}n[r]=h}return n}setCreateWatch(t){this.createWatch=t;for(const n of Object.keys(this.queries)){const{query:r,args:o,watch:l,paginationOptions:u}=this.queries[n],d="journal"in l?l.journal():void 0;this.removeQuery(n),this.addQuery(n,r,o,{...d?{journal:d}:[],...u?{paginationOptions:u}:{}})}}destroy(){for(const t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,n,r,{paginationOptions:o,journal:l}){if(this.queries[t]!==void 0)throw new Error(`Tried to add a new query with identifier ${t} when it already exists.`);const u=this.createWatch(n,r,{...l?{journal:l}:[],...o?{paginationOptions:o}:{}}),d=u.onUpdate(()=>this.notifyListeners());this.queries[t]={query:n,args:r,watch:u,unsubscribe:d,...o?{paginationOptions:o}:{}}}removeQuery(t){const n=this.queries[t];if(n===void 0)throw new Error(`No query found with identifier ${t}.`);n.unsubscribe(),delete this.queries[t]}notifyListeners(){for(const t of this.listeners)t()}}function Nz(e){const t=yz();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const n=p.useMemo(()=>(r,o,{journal:l,paginationOptions:u})=>u?t.watchPaginatedQuery(r,o,u):t.watchQuery(r,o,l?{journal:l}:{}),[t]);return kz(e,n)}function kz(e,t){const[n]=p.useState(()=>new Cz(t));n.createWatch!==t&&n.setCreateWatch(t),p.useEffect(()=>()=>n.destroy(),[n]);const r=p.useMemo(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:o=>(n.setQueries(e),n.subscribe(o))}),[n,e]);return mz(r)}const Jv=new WeakMap,_z=new WeakMap,Jf={current:[]};let Zg=!1,au=0;const Zc=new Set,wf=new Map;function ON(e){for(const t of e){if(Jf.current.includes(t))continue;Jf.current.push(t),t.recompute();const n=_z.get(t);if(n)for(const r of n){const o=Jv.get(r);o?.length&&ON(o)}}}function Ez(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Tz(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function DN(e){if(au>0&&!wf.has(e)&&wf.set(e,e.prevState),Zc.add(e),!(au>0)&&!Zg)try{for(Zg=!0;Zc.size>0;){const t=Array.from(Zc);Zc.clear();for(const n of t){const r=wf.get(n)??n.prevState;n.prevState=r,Ez(n)}for(const n of t){const r=Jv.get(n);r&&(Jf.current.push(n),ON(r))}for(const n of t){const r=Jv.get(n);if(r)for(const o of r)Tz(o)}}}finally{Zg=!1,Jf.current=[],wf.clear()}}function Mz(e){au++;try{e()}finally{if(au--,au===0){const t=Zc.values().next().value;t&&DN(t)}}}function Rz(e){return typeof e=="function"}class Az{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,l;this.listeners.add(r);const u=(l=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:l.call(o,r,this);return()=>{this.listeners.delete(r),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):Rz(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),DN(this)}}const Ha="__TSR_index",q1="popstate",V1="beforeunload";function Oz(e){let t=e.getLocation();const n=new Set,r=u=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?r(u):t=e.getLocation()},l=async({task:u,navigateOpts:d,...h})=>{if(d?.ignoreBlocker??!1){u();return}const v=e.getBlockers?.()??[],g=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&v.length&&g)for(const y of v){const w=eh(h.path,h.state);if(await y.blockerFn({currentLocation:t,nextLocation:w,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,d,h)=>{const m=t.state[Ha];d=H1(m+1,d),l({task:()=>{e.pushState(u,d),r({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:d})},replace:(u,d,h)=>{const m=t.state[Ha];d=H1(m,d),l({task:()=>{e.replaceState(u,d),r({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:d})},go:(u,d)=>{l({task:()=>{e.go(u),o({type:"GO",index:u})},navigateOpts:d,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Ha]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const d=e.getBlockers?.()??[];return e.setBlockers([...d,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(m=>m!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function H1(e,t){t||(t={});const n=zx();return{...t,key:n,__TSR_key:n,[Ha]:e}}function Dz(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const l=()=>o,u=O=>o=O,d=(O=>O),h=(()=>eh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=zx();t.history.replaceState({[Ha]:0,key:O,__TSR_key:O},"")}let m=h(),v,g=!1,y=!1,w=!1,S=!1;const j=()=>m;let N,C;const _=()=>{N&&(T._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),T._ignoreSubscribers=!1,N=void 0,C=void 0,v=void 0)},E=(O,D,z)=>{const B=d(D);C||(v=m),m=eh(D,z),N={href:B,state:z,isPush:N?.isPush||O==="push"},C||(C=Promise.resolve().then(()=>_()))},M=O=>{m=h(),T.notify({type:O})},A=async()=>{if(y){y=!1;return}const O=h(),D=O.state[Ha]-m.state[Ha],z=D===1,B=D===-1,V=!z&&!B||g;g=!1;const Y=V?"GO":B?"BACK":"FORWARD",G=V?{type:"GO",index:D}:{type:B?"BACK":"FORWARD"};if(w)w=!1;else{const ae=l();if(typeof document<"u"&&ae.length){for(const L of ae)if(await L.blockerFn({currentLocation:m,nextLocation:O,action:Y})){y=!0,t.history.go(1),T.notify(G);return}}}m=h(),T.notify(G)},R=O=>{if(S){S=!1;return}let D=!1;const z=l();if(typeof document<"u"&&z.length)for(const B of z){const V=B.enableBeforeUnload??!0;if(V===!0){D=!0;break}if(typeof V=="function"&&V()===!0){D=!0;break}}if(D)return O.preventDefault(),O.returnValue=""},T=Oz({getLocation:j,getLength:()=>t.history.length,pushState:(O,D)=>E("push",O,D),replaceState:(O,D)=>E("replace",O,D),back:O=>(O&&(w=!0),S=!0,t.history.back()),forward:O=>{O&&(w=!0),S=!0,t.history.forward()},go:O=>{g=!0,t.history.go(O)},createHref:O=>d(O),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(V1,R,{capture:!0}),t.removeEventListener(q1,A)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(V1,R,{capture:!0}),t.addEventListener(q1,A),t.history.pushState=function(...O){const D=n.apply(t.history,O);return T._ignoreSubscribers||M("PUSH"),D},t.history.replaceState=function(...O){const D=r.apply(t.history,O);return T._ignoreSubscribers||M("REPLACE"),D},T}function zz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function eh(e,t){const n=zz(e),r=n.indexOf("#"),o=n.indexOf("?"),l=zx();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[Ha]:0,key:l,__TSR_key:l}}}function zx(){return(Math.random()+1).toString(36).substring(7)}const Pz=!1;function ou(e){let t;return Mz(()=>{t=e()}),t}function hu(e){return e[e.length-1]}function Lz(e){return typeof e=="function"}function qa(e,t){return Lz(e)?e(t):e}const Iz=Object.prototype.hasOwnProperty,Y1=Object.prototype.propertyIsEnumerable;function er(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=Z1(e)&&Z1(r);if(!o&&!(th(e)&&th(r)))return r;const l=o?e:W1(e);if(!l)return r;const u=o?r:W1(r);if(!u)return r;const d=l.length,h=u.length,m=o?new Array(h):{};let v=0;for(let g=0;g<h;g++){const y=o?g:u[g],w=e[y],S=r[y];if(w===S){m[y]=w,(o?g<d:Iz.call(e,y))&&v++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){m[y]=S;continue}const j=er(w,S,n+1);m[y]=j,j===w&&v++}return d===h&&v===d?e:m}function W1(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!Y1.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!Y1.call(e,o))return!1;r.push(o)}return r}function th(e){if(!G1(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!G1(n)||!n.hasOwnProperty("isPrototypeOf"))}function G1(e){return Object.prototype.toString.call(e)==="[object Object]"}function Z1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Do(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Do(e[r],t[r],n))return!1;return!0}if(th(e)&&th(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!r||t[u]!==void 0)&&!Do(e[u],t[u],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let l=0;for(const u in t)if((!r||t[u]!==void 0)&&(l++,l>o||!Do(e[u],t[u],n)))return!1;return o===l}return!1}function hl(e){let t,n;const r=new Promise((o,l)=>{t=o,n=l});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function sl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function $z(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Q1(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return $z(t)}const zN=["http:","https:","mailto:","tel:"];function nh(e){if(!e)return!1;try{const t=new URL(e);return!zN.includes(t.protocol)}catch{return!1}}function Lc(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let r=0,o="",l;for(;(l=n.exec(e))!==null;)o+=Q1(e.slice(r,l.index))+l[0],r=n.lastIndex;return o=o+Q1(r?e.slice(r):e),o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}function Fz(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Bz="Invariant failed";function da(e,t){if(!e)throw new Error(Bz)}function rh(e){const t=new Map;let n,r;const o=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,r&&(r.next=l,l.prev=r)):(l.next.prev=void 0,n=l.next,l.next=void 0,r&&(l.prev=r,r.next=l)),r=l)};return{get(l){const u=t.get(l);if(u)return o(u),u.value},set(l,u){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===r&&(r=void 0)}const d=t.get(l);if(d)d.value=u,o(d);else{const h={key:l,value:u,prev:r};r&&(r.next=h),r=h,n||(n=h),t.set(l,h)}},clear(){t.clear(),n=void 0,r=void 0}}}const ml=0,Io=1,$o=2,mu=3,To=4,PN=5;function Uz(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Px(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,l=e.substring(t,o);if(!l||!l.includes("$"))return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(l==="$"){const d=e.length;return n[0]=$o,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(l.charCodeAt(0)===36)return n[0]=Io,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const u=Uz(l);if(u){const[d,h]=u,m=l.charCodeAt(d+1);if(m===45){if(d+2<l.length&&l.charCodeAt(d+2)===36){const v=d+3,g=h;if(v<g)return n[0]=mu,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=o,n}}else if(m===36){const v=d+1,g=d+2;return g===h?(n[0]=$o,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=Io,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+1,n[5]=o,n)}}return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Ph(e,t,n,r,o,l,u){u?.(n);let d=r;{const h=n.fullPath??n.from,m=h.length,v=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;d<m;){const w=Px(h,d,t);let S;const j=d,N=w[5];switch(d=N+1,l++,w[0]){case ml:{const _=h.substring(w[2],w[3]);if(v){const E=o.static?.get(_);if(E)S=E;else{o.static??=new Map;const M=Mo(n.fullPath??n.from);M.parent=o,M.depth=l,S=M,o.static.set(_,M)}}else{const E=_.toLowerCase(),M=o.staticInsensitive?.get(E);if(M)S=M;else{o.staticInsensitive??=new Map;const A=Mo(n.fullPath??n.from);A.parent=o,A.depth=l,S=A,o.staticInsensitive.set(E,A)}}break}case Io:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=Kg(Io,n.fullPath??n.from,M,A,R);S=O,O.depth=l,O.parent=o,o.dynamic??=[],o.dynamic.push(O)}break}case mu:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=Kg(mu,n.fullPath??n.from,M,A,R);S=O,O.parent=o,O.depth=l,o.optional??=[],o.optional.push(O)}break}case $o:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=Kg($o,n.fullPath??n.from,M,A,R);S=T,T.parent=o,T.depth=l,o.wildcard??=[],o.wildcard.push(T)}}o=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const w=Mo(n.fullPath??n.from);w.kind=PN,w.parent=o,l++,w.depth=l,o.pathless??=[],o.pathless.push(w),o=w}const y=(n.path||!n.children)&&!n.isRoot;if(y&&h.endsWith("/")){const w=Mo(n.fullPath??n.from);w.kind=To,w.parent=o,l++,w.depth=l,o.index=w,o=w}o.parse=n.options?.params?.parse??null,o.skipOnParamError=g,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const h of n.children)Ph(e,t,h,d,o,l,u)}function Qg(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ua(e){if(e.pathless)for(const t of e.pathless)Ua(t);if(e.static)for(const t of e.static.values())Ua(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ua(t);if(e.dynamic?.length){e.dynamic.sort(Qg);for(const t of e.dynamic)Ua(t)}if(e.optional?.length){e.optional.sort(Qg);for(const t of e.optional)Ua(t)}if(e.wildcard?.length){e.wildcard.sort(Qg);for(const t of e.wildcard)Ua(t)}}function Mo(e){return{kind:ml,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Kg(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function qz(e,t){const n=Mo("/"),r=new Uint16Array(6);for(const o of e)Ph(!1,r,o,1,n,0);Ua(n),t.masksTree=n,t.flatCache=rh(1e3)}function Vz(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Lx(e,t.masksTree);return t.flatCache.set(e,r),r}function Hz(e,t,n,r,o){e||="/",r||="/";const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);if(!u){u=Mo("/");const d=new Uint16Array(6);Ph(t,d,{from:e},1,u,0),o.singleCache.set(l,u)}return Lx(r,u,n)}function Yz(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let l;try{l=Lx(e,t.segmentTree,n)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=Zz(l.route)),t.matchCache.set(r,l),l}function Wz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Gz(e,t=!1,n){const r=Mo(e.fullPath),o=new Uint16Array(6),l={},u={};let d=0;return Ph(t,o,e,1,r,0,m=>{if(n?.(m,d),da(!(m.id in l),`Duplicate routes found with id: ${String(m.id)}`),l[m.id]=m,d!==0&&m.path){const v=Wz(m.fullPath);(!u[v]||m.fullPath.endsWith("/"))&&(u[v]=m)}d++}),Ua(r),{processedTree:{segmentTree:r,singleCache:rh(1e3),matchCache:rh(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Lx(e,t,n=!1){const r=e.split("/"),o=Kz(e,r,t,n);if(!o)return null;const[l]=LN(e,r,o);return{route:o.node.route,rawParams:l,parsedParams:o.parsedParams}}function LN(e,t,n){const r=Qz(n.node);let o=null;const l={};let u=n.extract?.part??0,d=n.extract?.node??0,h=n.extract?.path??0,m=n.extract?.segment??0;for(;d<r.length;u++,d++,h++,m++){const v=r[d];if(v.kind===To)break;if(v.kind===PN){m--,u--,h--;continue}const g=t[u],y=h;if(g&&(h+=g.length),v.kind===Io){o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0;if(w.charCodeAt(S)===123){const N=v.suffix?.length??0,C=w.substring(S+2,w.length-N-1),_=g.substring(S,g.length-N);l[C]=decodeURIComponent(_)}else{const N=w.substring(1);l[N]=decodeURIComponent(g)}}else if(v.kind===mu){if(n.skipped&1<<d){u--,h=y-1;continue}o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0,j=v.suffix?.length??0,N=w.substring(S+3,w.length-j-1),C=v.suffix||v.prefix?g.substring(S,g.length-j):g;C&&(l[N]=decodeURIComponent(C))}else if(v.kind===$o){const w=v,S=e.substring(y+(w.prefix?.length??0),e.length-(w.suffix?.length??0)),j=decodeURIComponent(S);l["*"]=j,l._splat=j;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:d,path:h,segment:m}]}function Zz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Qz(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Kz(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!hu(t),l=o&&e!=="/",u=t.length-(o?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,m=null,v=null;for(;d.length;){const g=d.pop(),{node:y,index:w,skipped:S,depth:j,statics:N,dynamics:C,optionals:_}=g;let{extract:E,rawParams:M,parsedParams:A}=g;if(y.skipOnParamError){if(!Xg(e,t,g))continue;M=g.rawParams,E=g.extract,A=g.parsedParams}r&&y.route&&y.kind!==To&&Ic(m,g)&&(m=g);const R=w===u;if(R&&(y.route&&!l&&Ic(v,g)&&(v=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const T=R?void 0:t[w];let O;if(R&&y.index){const D={node:y.index,index:w,skipped:S,depth:j+1,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};let z=!0;if(y.index.skipOnParamError&&(Xg(e,t,D)||(z=!1)),z){if(N===u&&!C&&!_&&!S)return D;Ic(v,D)&&(v=D)}}if(y.wildcard&&Ic(h,g))for(const D of y.wildcard){const{prefix:z,suffix:B}=D;if(z&&(R||!(D.caseSensitive?T:O??=T.toLowerCase()).startsWith(z)))continue;if(B){if(R)continue;const Y=t.slice(w).join("/").slice(-B.length);if((D.caseSensitive?Y:Y.toLowerCase())!==B)continue}const V={node:D,index:u,skipped:S,depth:j,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};if(!(D.skipOnParamError&&!Xg(e,t,V))){h=V;break}}if(y.optional){const D=S|1<<j,z=j+1;for(let B=y.optional.length-1;B>=0;B--){const V=y.optional[B];d.push({node:V,index:w,skipped:D,depth:z,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R)for(let B=y.optional.length-1;B>=0;B--){const V=y.optional[B],{prefix:Y,suffix:G}=V;if(Y||G){const ae=V.caseSensitive?T:O??=T.toLowerCase();if(Y&&!ae.startsWith(Y)||G&&!ae.endsWith(G))continue}d.push({node:V,index:w+1,skipped:S,depth:z,statics:N,dynamics:C,optionals:_+1,extract:E,rawParams:M,parsedParams:A})}}if(!R&&y.dynamic&&T)for(let D=y.dynamic.length-1;D>=0;D--){const z=y.dynamic[D],{prefix:B,suffix:V}=z;if(B||V){const Y=z.caseSensitive?T:O??=T.toLowerCase();if(B&&!Y.startsWith(B)||V&&!Y.endsWith(V))continue}d.push({node:z,index:w+1,skipped:S,depth:j+1,statics:N,dynamics:C+1,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.staticInsensitive){const D=y.staticInsensitive.get(O??=T.toLowerCase());D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.static){const D=y.static.get(T);D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(y.pathless){const D=j+1;for(let z=y.pathless.length-1;z>=0;z--){const B=y.pathless[z];d.push({node:B,index:w,skipped:S,depth:D,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}}}if(v&&h)return Ic(h,v)?v:h;if(v)return v;if(h)return h;if(r&&m){let g=m.index;for(let w=0;w<m.index;w++)g+=t[w].length;const y=g===e.length?"/":e.slice(g);return m.rawParams??={},m.rawParams["**"]=decodeURIComponent(y),m}return null}function Xg(e,t,n){try{const[r,o]=LN(e,t,n);n.rawParams=r,n.extract=o;const l=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function Ic(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===To)>(e.node.kind===To)||t.node.kind===To==(e.node.kind===To)&&t.depth>e.depth))):!0}function Uf(e){return Ix(e.filter(t=>t!==void 0).join("/"))}function Ix(e){return e.replace(/\/{2,}/g,"/")}function IN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ra(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function $N(e){return ra(IN(e))}function sh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Xz(e,t,n){return sh(e,n)===sh(t,n)}function Jz({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),l=!o&&t===".";let u;if(r){u=o?t:l?e:e+"\0"+t;const g=r.get(u);if(g)return g}let d;if(l)d=e.split("/");else if(o)d=t.split("/");else{for(d=e.split("/");d.length>1&&hu(d)==="";)d.pop();const g=t.split("/");for(let y=0,w=g.length;y<w;y++){const S=g[y];S===""?y?y===w-1&&d.push(S):d=[S]:S===".."?d.pop():S==="."||d.push(S)}}d.length>1&&(hu(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));let h,m="";for(let g=0;g<d.length;g++){g>0&&(m+="/");const y=d[g];if(!y)continue;h=Px(y,0,h);const w=h[0];if(w===ml){m+=y;continue}const S=h[5],j=y.substring(0,h[1]),N=y.substring(h[4],S),C=y.substring(h[2],h[3]);w===Io?m+=j||N?`${j}{$${C}}${N}`:`$${C}`:w===$o?m+=j||N?`${j}{$}${N}`:"$":m+=`${j}{-$${C}}${N}`}m=Ix(m);const v=m||"/";return u&&r&&r.set(u,v),v}function e4(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,l=>t.get(l)??l)}function Jg(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>K1(o,n)).join("/"):K1(r,n)}function ev({path:e,params:t,decoder:n,server:r}){let o=!1;const l={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:o};const u=e.length;let d=0,h,m="";for(;d<u;){const g=d;h=Px(e,g,h);const y=h[5];if(d=y+1,g===y)continue;const w=h[0];if(w===ml){m+="/"+e.substring(g,y);continue}if(w===$o){const S=t._splat;l._splat=S,l["*"]=S;const j=e.substring(g,h[1]),N=e.substring(h[4],y);if(!S){o=!0,(j||N)&&(m+="/"+j+N);continue}const C=Jg("_splat",t,n);m+="/"+j+C+N;continue}if(w===Io){const S=e.substring(h[2],h[3]);!o&&!(S in t)&&(o=!0),l[S]=t[S];const j=e.substring(g,h[1]),N=e.substring(h[4],y),C=Jg(S,t,n)??"undefined";m+="/"+j+C+N;continue}if(w===mu){const S=e.substring(h[2],h[3]),j=t[S];if(j==null)continue;l[S]=j;const N=e.substring(g,h[1]),C=e.substring(h[4],y),_=Jg(S,t,n)??"";m+="/"+N+_+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:l,interpolatedPath:m||"/",isMissingParams:o}}function K1(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function yr(e){return!!e?.isNotFound}function t4(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ex="tsr-scroll-restoration-v1_3",n4=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function r4(){const e=t4();if(!e)return null;const t=e.getItem(ex);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=qa(r,n)||n;try{e.setItem(ex,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Sf=r4(),s4=e=>e.state.__TSR_key||e.href;function a4(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let ah=!1;function o4({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:o,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const d=t||window.history.state?.__TSR_key,h=u[d];ah=!0;e:{if(r&&h&&Object.keys(h).length>0){for(const g in h){const y=h[g];if(g==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(g){const w=document.querySelector(g);w&&(w.scrollLeft=y.scrollX,w.scrollTop=y.scrollY)}}break e}const m=(l??window.location).hash.split("#",2)[1];if(m){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const y=document.getElementById(m);y&&y.scrollIntoView(g)}break e}const v={top:0,left:0,behavior:n};if(window.scrollTo(v),o)for(const g of o){if(g==="window")continue;const y=typeof g=="function"?g():document.querySelector(g);y&&y.scrollTo(v)}}ah=!1}function i4(e,t){if(!Sf||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Sf))return;e.isScrollRestorationSetup=!0,ah=!1;const r=e.options.getScrollRestorationKey||s4;window.history.scrollRestoration="manual";const o=l=>{if(ah||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const h=l.target.getAttribute("data-scroll-restoration-id");h?u=`[data-scroll-restoration-id="${h}"]`:u=a4(l.target)}const d=r(e.state.location);Sf.set(h=>{const m=h[d]||={},v=m[u]||={};if(u==="window")v.scrollX=window.scrollX||0,v.scrollY=window.scrollY||0;else if(u){const g=document.querySelector(u);g&&(v.scrollX=g.scrollLeft||0,v.scrollY=g.scrollTop||0)}return h})};typeof document<"u"&&document.addEventListener("scroll",n4(o,100),!0),e.subscribe("onRendered",l=>{const u=r(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(o4({storageKey:ex,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Sf.set(d=>(d[u]||={},d)))})}function l4(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function c4(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function tv(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function u4(e){const t=new URLSearchParams(e),n={};for(const[r,o]of t.entries()){const l=n[r];l==null?n[r]=tv(o):Array.isArray(l)?l.push(tv(o)):n[r]=[l,tv(o)]}return n}const d4=h4(JSON.parse),f4=m4(JSON.stringify,JSON.parse);function h4(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=u4(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function m4(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const l=c4(o,r);return l?`?${l}`:""}}const $r="__root__";function p4(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&nh(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${zN.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Fr(e){return e instanceof Response&&!!e.options}const qf=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Lh=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),al=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let l=0;l<=o;l++){const u=e.matches[l];if(!u)continue;const d=e.router.getMatch(u.id);d&&Object.assign(r,d.__routeContext,d.__beforeLoadContext)}return r},FN=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),da(n.options.notFoundComponent);const r=e.matches.find(o=>o.routeId===n.id);da(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,FN(e,t))},Va=(e,t,n)=>{if(!(!Fr(n)&&!yr(n))){if(Fr(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Fr(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:r,context:al(e,t.index),isFetching:!1,error:n})),yr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Fr(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(FN(e,n),n)}},BN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,$c=(e,t,n,r)=>{const{id:o,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Va(e,e.router.getMatch(o),n);try{u.options.onError?.(n)}catch(d){n=d,Va(e,e.router.getMatch(o),n)}e.updateMatch(o,d=>(d._nonReactive.beforeLoadPromise?.resolve(),d._nonReactive.beforeLoadPromise=void 0,d._nonReactive.loadPromise?.resolve(),{...d,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},UN=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Lh(e,t)&&(n.options.loader||n.options.beforeLoad||HN(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{qf(e)},o);r._nonReactive.pendingTimeout=u}},g4=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;UN(e,t,n,r);const o=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Va(e,l,l.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},v4=(e,t,n,r)=>{const o=e.router.getMatch(t),l=o._nonReactive.loadPromise;o._nonReactive.loadPromise=hl(()=>{l?.resolve()});const{paramsError:u,searchError:d}=o;u&&$c(e,n,u,"PARSE_PARAMS"),d&&$c(e,n,d,"VALIDATE_SEARCH"),UN(e,t,r,o);const h=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:h})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,M=>({...M,isFetching:!1}))};if(!r.options.beforeLoad){ou(()=>{v(),g()});return}o._nonReactive.beforeLoadPromise=hl();const y={...al(e,n,!1),...o.__routeContext},{search:w,params:S,cause:j}=o,N=Lh(e,t),C={search:w,abortController:h,params:S,preload:N,context:y,location:e.location,navigate:M=>e.router.navigate({...M,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":j,matches:e.matches,...e.router.options.additionalContext},_=M=>{if(M===void 0){ou(()=>{v(),g()});return}(Fr(M)||yr(M))&&(v(),$c(e,n,M,"BEFORE_LOAD")),ou(()=>{v(),e.updateMatch(t,A=>({...A,__beforeLoadContext:M})),g()})};let E;try{if(E=r.options.beforeLoad(C),sl(E))return v(),E.catch(M=>{$c(e,n,M,"BEFORE_LOAD")}).then(_)}catch(M){v(),$c(e,n,M,"BEFORE_LOAD")}_(E)},x4=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],l=()=>d(),u=()=>v4(e,n,t,o),d=()=>{if(BN(e,n))return;const h=g4(e,n,o);return sl(h)?h.then(u):u()};return l()},y4=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([l,u,d])=>{const h=l?.meta,m=l?.links,v=l?.scripts,g=l?.styles;return{meta:h,links:m,headScripts:v,headers:d,scripts:u,styles:g}})},qN=(e,t,n,r)=>{const o=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:d,cause:h}=e.router.getMatch(t),m=al(e,n),v=Lh(e,t);return{params:l,deps:u,preload:!!v,parentMatchPromise:o,abortController:d,context:m,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:v?"preload":h,route:r,...e.router.options.additionalContext}},X1=async(e,t,n,r)=>{try{const o=e.router.getMatch(t);try{(!(Pz??e.router.isServer)||o.ssr===!0)&&VN(r);const l=r.options.loader?.(qN(e,t,n,r)),u=r.options.loader&&sl(l);if((u||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,m=>({...m,isFetching:"loader"})),r.options.loader){const m=u?await l:l;Va(e,e.router.getMatch(t),m),m!==void 0&&e.updateMatch(t,v=>({...v,loaderData:m}))}r._lazyPromise&&await r._lazyPromise;const h=o._nonReactive.minPendingPromise;h&&await h,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,m=>({...m,error:void 0,context:al(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){e.updateMatch(t,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:al(e,n)}));return}const d=o._nonReactive.minPendingPromise;d&&await d,yr(l)&&await r.options.notFoundComponent?.preload?.(),Va(e,e.router.getMatch(t),l);try{r.options.onError?.(l)}catch(h){u=h,Va(e,e.router.getMatch(t),h)}e.updateMatch(t,h=>({...h,error:u,context:al(e,n),status:"error",isFetching:!1}))}}catch(o){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),Va(e,l,o)}},b4=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let o=!1,l=!1;const u=e.router.looseRoutesById[r];if(!BN(e,n)){const m=e.router.getMatch(n);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!e.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const v=e.router.getMatch(n),g=v._nonReactive.error||v.error;g&&Va(e,v,g)}else{const v=Date.now()-m.updatedAt,g=Lh(e,n),y=g?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,w=u.options.shouldReload,S=typeof w=="function"?w(qN(e,n,t,u)):w,j=!!g&&!e.router.state.matches.some(E=>E.id===n),N=e.router.getMatch(n);N._nonReactive.loaderPromise=hl(),j!==N.preload&&e.updateMatch(n,E=>({...E,preload:j}));const{status:C,invalid:_}=N;o=C==="success"&&(_||(S??v>y)),g&&u.options.preload===!1||(o&&!e.sync?(l=!0,(async()=>{try{await X1(e,n,t,u);const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){Fr(E)&&await e.router.navigate(E.options)}})()):(C!=="success"||o&&e.sync)&&await X1(e,n,t,u))}}const d=e.router.getMatch(n);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(n,m=>({...m,isFetching:h,invalid:!1})),e.router.getMatch(n)):d};async function J1(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&qf(t);try{for(let d=0;d<t.matches.length;d++){const h=x4(t,d);sl(h)&&await h}const n=t.firstBadMatchIndex??t.matches.length;for(let d=0;d<n;d++)t.matchPromises.push(b4(t,d));const o=(await Promise.allSettled(t.matchPromises)).filter(d=>d.status==="rejected").map(d=>d.reason);let l;for(const d of o){if(Fr(d))throw d;!l&&yr(d)&&(l=d)}for(const d of t.matches){const{id:h,routeId:m}=d,v=t.router.looseRoutesById[m];try{const g=y4(t,h,v);if(g){const y=await g;t.updateMatch(h,w=>({...w,...y}))}}catch(g){console.error(`Error executing head for route ${m}:`,g)}}if(l)throw l;const u=qf(t);sl(u)&&await u}catch(n){if(yr(n)&&!t.preload){const r=qf(t);throw sl(r)&&await r,n}if(Fr(n))throw n}return t.matches}async function VN(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of YN){const o=e.options[r]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function HN(e){for(const t of YN)if(e.options[t]?.preload)return!0;return!1}const YN=["component","errorComponent","pendingComponent","notFoundComponent"];function w4(e){return{input:({url:t})=>{for(const n of e)t=tx(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=WN(e[n],t);return t}}}function S4(e){const t=$N(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?r:r.toLowerCase();return{input:({url:u})=>{const d=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return d===o?u.pathname="/":d.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=Uf(["/",t,u.pathname]),u)}}function tx(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function WN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function zo(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,o=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:o,hashChanged:l}}class j4{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,o=this.basepath??r?.basepath??"/",l=this.basepath===void 0,u=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=e4(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Dz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let y;this.resolvePathCache=rh(1e3),y=this.buildRouteTree(),this.setRoutes(y)}!this.__store&&this.latestLocation&&(this.__store=new Az(N4(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(y=>!["redirected"].includes(y.status))}}}),i4(this));let d=!1;const h=this.options.basepath??"/",m=this.options.rewrite;if(l||o!==h||u!==m){this.basepath=h;const y=[],w=$N(h);w&&w!=="/"&&y.push(S4({basepath:h})),m&&y.push(m),this.rewrite=y.length===0?void 0:y.length===1?y[0]:w4(y),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Gz(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&qz(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:h,search:m,hash:v,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const _=this.options.parseSearch(m),E=this.options.stringifySearch(_);return{href:h+E+v,publicHref:g,pathname:Lc(h),external:!1,searchStr:E,search:er(r?.search,_),hash:Lc(v.slice(1)),state:er(r?.state,y)}}const w=new URL(g,this.origin),S=tx(this.rewrite,w),j=this.options.parseSearch(S.search),N=this.options.stringifySearch(j);return S.search=N,{href:S.href.replace(S.origin,""),publicHref:g,pathname:Lc(S.pathname),external:!!this.rewrite&&S.origin!==this.origin,searchStr:N,search:er(r?.search,j),hash:Lc(S.hash.slice(1)),state:er(r?.state,y)}},l=o(n),{__tempLocation:u,__tempKey:d}=l.state;if(u&&(!d||d===this.tempLocationKey)){const h=o(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(n,r)=>Jz({base:n,to:Ix(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>k4({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),r=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const r=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??d.fullPath,m=this.resolvePathWithBase(h,"."),v=d.search,g={...d.params},y=l.to?this.resolvePathWithBase(m,`${l.to}`):this.resolvePathWithBase(m,"."),w=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,qa(l.params,g)),S=ev({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,j=this.getMatchedRoutes(S);let N=j.matchedRoutes;(j.foundRoute?j.foundRoute.path!=="/"&&j.routeParams["**"]:ra(S))&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]);let _=!1;if(Object.keys(w).length>0)for(const Y of N){const G=Y.options.params?.stringify??Y.options.stringifyParams;G&&(_=!0,Object.assign(w,G(w)))}const E=n.leaveParams?y:Lc(_?ev({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S);let M=v;if(n._includeValidateSearch&&this.options.search?.strict){const Y={};N.forEach(G=>{if(G.options.validateSearch)try{Object.assign(Y,Vf(G.options.validateSearch,{...Y,...M}))}catch{}}),M=Y}M=_4({search:M,dest:l,destRoutes:N,_includeValidateSearch:n._includeValidateSearch}),M=er(v,M);const A=this.options.stringifySearch(M),R=l.hash===!0?u.hash:l.hash?qa(l.hash,u.hash):void 0,T=R?`#${R}`:"";let O=l.state===!0?u.state:l.state?qa(l.state,u.state):{};O=er(u.state,O);const D=`${E}${A}${T}`;let z,B,V=!1;if(this.rewrite){const Y=new URL(D,this.origin),G=WN(this.rewrite,Y);z=Y.href.replace(Y.origin,""),G.origin!==this.origin?(B=G.href,V=!0):B=G.pathname+G.search+G.hash}else z=Fz(D),B=z;return{publicHref:B,href:z,pathname:E,search:M,searchStr:A,state:O,hash:R??"",external:V,unmaskOnReload:l.unmaskOnReload}},o=(l={},u)=>{const d=r(l);let h=u?r(u):void 0;if(!h){const m={};if(this.options.routeMasks){const v=Vz(d.pathname,this.processedTree);if(v){Object.assign(m,v.rawParams);const{from:g,params:y,...w}=v.route,S=y===!1||y===null?{}:(y??!0)===!0?m:Object.assign(m,qa(y,m));u={from:n.from,...w,params:S},h=r(u)}}}return h&&(d.maskedLocation=h),d};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(v=>{o.state[v]=this.latestLocation.state[v]});const m=Do(o.state,this.latestLocation.state);return h.forEach(v=>{delete o.state[v]}),m},u=ra(this.latestLocation.href)===ra(o.href),d=this.commitLocationPromise;if(this.commitLocationPromise=hl(()=>{d?.resolve()}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:m,...v}=o;h&&(v={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:u,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,y=eh(d,{__TSR_index:n?g:g+1}),w=new URL(y.pathname,this.origin),S=tx(this.rewrite,w);h.to=S.pathname,h.search=this.options.parseSearch(y.search),h.hash=y.hash.slice(1)}const m=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const v=this.commitLocation({...m,viewTransition:l,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),v},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:l,...u})=>{let d=!1;if(o)try{new URL(`${o}`),d=!0}catch{}if(d&&!r&&(r=!0),r){if(n!==void 0||!o){const m=this.buildLocation({to:n,...u});o=o??m.publicHref,l=l??m.publicHref}const h=!d&&l?l:o;if(nh(h))return Promise.resolve();if(!u.ignoreBlocker){const v=this.history.getBlockers?.()??[];for(const g of v)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(o=>!n.some(l=>l.id===o.id))}))},this.load=async n=>{let r,o,l;for(l=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...zo({resolvedLocation:m,location:h})}),this.emit({type:"onBeforeLoad",...zo({resolvedLocation:m,location:h})}),await J1({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],g=[],y=[];ou(()=>{this.__store.setState(w=>{const S=w.matches,j=w.pendingMatches||w.matches;return v=S.filter(N=>!j.some(C=>C.id===N.id)),g=j.filter(N=>!S.some(C=>C.id===N.id)),y=j.filter(N=>S.some(C=>C.id===N.id)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(N=>N.status!=="error"&&N.status!=="notFound")]}}),this.clearExpiredCache()}),[[v,"onLeave"],[g,"onEnter"],[y,"onStay"]].forEach(([w,S])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[S]?.(j)})})})})}})}catch(h){Fr(h)?(r=h,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):yr(h)&&(o=h),this.__store.setState(m=>({...m,statusCode:r?r.status:o?404:m.matches.some(v=>v.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(d=>d.status==="error")&&(u=500),u!==void 0&&this.__store.setState(d=>({...d,statusCode:u}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,d=typeof r.types=="function"?r.types(zo({resolvedLocation:u,location:l})):r.types;if(d===!1){n();return}o={update:n,types:d}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";o&&this.__store.setState(l=>({...l,[o]:l[o]?.map(u=>u.id===n?r(u):u)}))})},this.getMatch=n=>{const r=o=>o.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),l=this.getParsedLocationHref(o);n.options.href=l,n.headers.set("Location",l)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const l=o.pathname+o.search+o.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(l=>!r(l))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const l=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=VN,this.preloadRoute=async n=>{const r=this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),u=new Set([...l,...this.state.cachedMatches.map(d=>d.id)]);ou(()=>{o.forEach(d=>{u.has(d.id)||this.__store.setState(h=>({...h,cachedMatches:[...h.cachedMatches,d]}))})});try{return o=await J1({router:this,matches:o,location:r,preload:!0,updateMatch:(d,h)=>{l.has(d)?o=o.map(m=>m.id===d?h(m):m):this.updateMatch(d,h)}}),o}catch(d){if(Fr(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});yr(d)||console.error(d);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const d=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,h=Hz(l.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,d.pathname,this.processedTree);return!h||n.params&&!Do(h.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Do(d.search,l.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??f4,parseSearch:t.parseSearch??d4}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:l,parsedParams:u}=r;let{matchedRoutes:d}=r,h=!1;(o?o.path!=="/"&&l["**"]:ra(t.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:h=!0);const m=h?T4(this.options.notFoundMode,d):void 0,v=[],g=y=>y?.id?y.context??this.options.context??void 0:this.options.context??void 0;return d.forEach((y,w)=>{const S=v[w-1],[j,N,C]=(()=>{const G=S?.search??t.search,ae=S?._strictSearch??void 0;try{const L=Vf(y.options.validateSearch,{...G})??void 0;return[{...G,...L},{...ae,...L},void 0]}catch(L){let $=L;if(L instanceof oh||($=new oh(L.message,{cause:L})),n?.throwOnError)throw $;return[G,{},$]}})(),_=y.options.loaderDeps?.({search:j})??"",E=_?JSON.stringify(_):"",{interpolatedPath:M,usedParams:A}=ev({path:y.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),R=y.id+M+E,T=this.getMatch(R),O=this.state.matches.find(G=>G.routeId===y.id),D=T?._strictParams??A;let z;if(!T)try{ej(y,A,u,D)}catch(G){if(yr(G)||Fr(G)?z=G:z=new C4(G.message,{cause:G}),n?.throwOnError)throw z}Object.assign(l,D);const B=O?"stay":"enter";let V;if(T)V={...T,cause:B,params:O?er(O.params,l):l,_strictParams:D,search:er(O?O.search:T.search,j),_strictSearch:N};else{const G=y.options.loader||y.options.beforeLoad||y.lazyFn||HN(y)?"pending":"success";V={id:R,ssr:y.options.ssr,index:w,routeId:y.id,params:O?er(O.params,l):l,_strictParams:D,pathname:M,updatedAt:Date.now(),search:O?er(O.search,j):j,_strictSearch:N,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:O?er(O.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}n?.preload||(V.globalNotFound=m===y.id),V.searchError=C;const Y=g(S);V.context={...Y,...V.__routeContext,...V.__beforeLoadContext},v.push(V)}),v.forEach((y,w)=>{const S=this.looseRoutesById[y.routeId];if(!this.getMatch(y.id)){const N=v[w-1],C=g(N);if(S.options.context){const _={deps:y.loaderDeps,params:y.params,context:C??{},location:t,navigate:E=>this.navigate({...E,_fromLocation:t}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:v};y.__routeContext=S.options.context(_)??void 0}y.context={...C,...y.__routeContext,...y.__beforeLoadContext}}}),v}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),l=hu(n),u={...t.search};for(const v of n)try{Object.assign(u,Vf(v.options.validateSearch,u))}catch{}const d=hu(this.state.matches),h=d&&d.routeId===l.id&&t.pathname===this.state.location.pathname;let m;if(h)m=d.params;else{const v={...r};for(const g of n)try{ej(g,r,o??{},v)}catch{}m=v}return{matchedRoutes:n,fullPath:l.fullPath,search:u,params:m}}}class oh extends Error{}class C4 extends Error{}function N4(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Vf(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new oh("Async validation not supported");if(n.issues)throw new oh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function k4({pathname:e,routesById:t,processedTree:n}){const r={},o=ra(e);let l,u;const d=Yz(o,n,!0);return d&&(l=d.route,Object.assign(r,d.rawParams),u=Object.assign({},d.parsedParams)),{matchedRoutes:d?.branch||[t[$r]],routeParams:r,foundRoute:l,parsedParams:u}}function _4({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return E4(n)(e,t,r??!1)}function E4(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const l=({search:u,next:d})=>{let h=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((v,g)=>g(v),u));const m=d(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((v,g)=>g(v),m):m};t.middlewares.push(l)}if(o.options.validateSearch){const l=({search:u,next:d})=>{const h=d(u);if(!t._includeValidateSearch)return h;try{return{...h,...Vf(o.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const n=({search:o})=>{const l=t.dest;return l.search?l.search===!0?o:qa(l.search,o):{}};t.middlewares.push(n);const r=(o,l,u)=>{if(o>=u.length)return l;const d=u[o];return d({search:l,next:m=>r(o+1,m,u)})};return function(l,u,d){return t.dest=u,t._includeValidateSearch=d,r(0,l,t.middlewares)}}function T4(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return $r}function ej(e,t,n,r){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const l in t)l in n&&(r[l]=n[l]);else{const l=o(r);Object.assign(r,l)}}const M4="Error preloading route! ☝️";class GN{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=$r:this.parentRoute||da(!1);let l=o?$r:r?.path;l&&l!=="/"&&(l=IN(l));const u=r?.id||l;let d=o?$r:Uf([this.parentRoute.id===$r?"":this.parentRoute.id,u]);l===$r&&(l="/"),d!==$r&&(d=Uf(["/",d]));const h=d===$r?"/":Uf([this.parentRoute.fullPath,l]);this._path=l,this._id=d,this._fullPath=h,this._to=ra(h)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>p4({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class R4 extends GN{constructor(t){super(t)}}const jf=typeof window<"u"?p.useLayoutEffect:p.useEffect;function nv(e){const t=p.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function A4(e,t,n={},r={}){p.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([l])=>{t(l)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function O4(e){const t=p.useRef(null);return p.useImperativeHandle(e,()=>t.current,[]),t}function $x(e){const t=e.errorComponent??Fx;return i.jsx(D4,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?p.createElement(t,{error:n,reset:r}):e.children})}class D4 extends p.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Fx({error:e}){const[t,n]=p.useState(!1);return i.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[i.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),i.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),i.jsx("div",{style:{height:".25rem"}}),t?i.jsx("div",{children:i.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?i.jsx("code",{children:e.message}):null})}):null]})}function z4({children:e,fallback:t=null}){return ZN()?i.jsx(ee.Fragment,{children:e}):i.jsx(ee.Fragment,{children:t})}function ZN(){return ee.useSyncExternalStore(P4,()=>!0,()=>!1)}function P4(){return()=>{}}var rv={exports:{}},sv={},av={exports:{}},ov={};var tj;function L4(){if(tj)return ov;tj=1;var e=Pu();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(g,y){var w=y(),S=r({inst:{value:w,getSnapshot:y}}),j=S[0].inst,N=S[1];return l(function(){j.value=w,j.getSnapshot=y,h(j)&&N({inst:j})},[g,w,y]),o(function(){return h(j)&&N({inst:j}),g(function(){h(j)&&N({inst:j})})},[g]),u(w),w}function h(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!n(g,w)}catch{return!0}}function m(g,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return ov.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,ov}var nj;function QN(){return nj||(nj=1,av.exports=L4()),av.exports}var rj;function I4(){if(rj)return sv;rj=1;var e=Pu(),t=QN();function n(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return sv.useSyncExternalStoreWithSelector=function(m,v,g,y,w){var S=l(null);if(S.current===null){var j={hasValue:!1,value:null};S.current=j}else j=S.current;S=d(function(){function C(R){if(!_){if(_=!0,E=R,R=y(R),w!==void 0&&j.hasValue){var T=j.value;if(w(T,R))return M=T}return M=R}if(T=M,r(E,R))return T;var O=y(R);return w!==void 0&&w(T,O)?(E=R,T):(E=R,M=O)}var _=!1,E,M,A=g===void 0?null:g;return[function(){return C(v())},A===null?void 0:function(){return C(A())}]},[v,g,y,w]);var N=o(m,S[0],S[1]);return u(function(){j.hasValue=!0,j.value=N},[N]),h(N),N},sv}var sj;function $4(){return sj||(sj=1,rv.exports=I4()),rv.exports}var F4=$4();function B4(e,t=r=>r,n={}){const r=n.equal??U4;return F4.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function U4(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=aj(e);if(n.length!==aj(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function aj(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const iv=p.createContext(null);function KN(){return typeof document>"u"?iv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=iv,iv)}function Ur(e){const t=p.useContext(KN());return e?.warn,t}function $n(e){const t=Ur({warn:e?.router===void 0}),n=e?.router||t,r=p.useRef(void 0);return B4(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=er(r.current,e.select(o));return r.current=l,l}return e.select(o)}return o})}const Ih=p.createContext(void 0),q4=p.createContext(void 0);function _s(e){const t=p.useContext(e.from?q4:Ih);return $n({select:r=>{const o=r.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(da(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Bx(e){return _s({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ux(e){const{select:t,...n}=e;return _s({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Go(e){return _s({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function qx(e){return _s({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Xa(e){const t=Ur();return p.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Ml=xN();const V4=vN(Ml);function H4(e,t){const n=Ur(),r=O4(t),{activeProps:o,inactiveProps:l,activeOptions:u,to:d,preload:h,preloadDelay:m,hashScrollIntoView:v,replace:g,startTransition:y,resetScroll:w,viewTransition:S,children:j,target:N,disabled:C,style:_,className:E,onClick:M,onFocus:A,onMouseEnter:R,onMouseLeave:T,onTouchStart:O,ignoreBlocker:D,params:z,search:B,hash:V,state:Y,mask:G,reloadDocument:ae,unsafeRelative:L,from:$,_fromLocation:U,...H}=e,le=ZN(),I=$n({select:Qe=>Qe.location.search,structuralSharing:!0}),F=e.from,K=p.useMemo(()=>({...e,from:F}),[n,I,F,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ne=p.useMemo(()=>n.buildLocation({...K}),[n,K]),X=ne.maskedLocation?ne.maskedLocation.publicHref:ne.publicHref,ue=ne.maskedLocation?ne.maskedLocation.external:ne.external,te=p.useMemo(()=>K4(X,ue,n.history,C),[C,ue,X,n.history]),ye=p.useMemo(()=>{if(te?.external)return nh(te.href)?void 0:te.href;if(!X4(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),nh(d)?void 0:d}catch{}},[d,te]),Ce=$n({select:Qe=>{if(ye)return!1;if(u?.exact){if(!Xz(Qe.location.pathname,ne.pathname,n.basepath))return!1}else{const bt=sh(Qe.location.pathname,n.basepath),pt=sh(ne.pathname,n.basepath);if(!(bt.startsWith(pt)&&(bt.length===pt.length||bt[pt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Do(Qe.location.search,ne.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?le&&Qe.location.hash===ne.hash:!0}}),_e=Ce?qa(o,{})??Y4:lv,Re=Ce?lv:qa(l,{})??lv,ge=[E,_e.className,Re.className].filter(Boolean).join(" "),Fe=(_||_e.style||Re.style)&&{..._,..._e.style,...Re.style},[be,Be]=p.useState(!1),nt=p.useRef(!1),ot=e.reloadDocument||ye?!1:h??n.options.defaultPreload,yt=m??n.options.defaultPreloadDelay??0,pe=p.useCallback(()=>{n.preloadRoute({...K}).catch(Qe=>{console.warn(Qe),console.warn(M4)})},[n,K]),Le=p.useCallback(Qe=>{Qe?.isIntersecting&&pe()},[pe]);A4(r,Le,Q4,{disabled:!!C||ot!=="viewport"}),p.useEffect(()=>{nt.current||!C&&ot==="render"&&(pe(),nt.current=!0)},[C,pe,ot]);const Ye=Qe=>{const bt=Qe.currentTarget.getAttribute("target"),pt=N!==void 0?N:bt;if(!C&&!J4(Qe)&&!Qe.defaultPrevented&&(!pt||pt==="_self")&&Qe.button===0){Qe.preventDefault(),Ml.flushSync(()=>{Be(!0)});const Vn=n.subscribe("onResolved",()=>{Vn(),Be(!1)});n.navigate({...K,replace:g,resetScroll:w,hashScrollIntoView:v,startTransition:y,viewTransition:S,ignoreBlocker:D})}};if(ye)return{...H,ref:r,href:ye,...j&&{children:j},...N&&{target:N},...C&&{disabled:C},..._&&{style:_},...E&&{className:E},...M&&{onClick:M},...A&&{onFocus:A},...R&&{onMouseEnter:R},...T&&{onMouseLeave:T},...O&&{onTouchStart:O}};const Oe=Qe=>{C||ot&&pe()},dt=Oe,ct=Qe=>{if(!(C||!ot))if(!yt)pe();else{const bt=Qe.target;if(Fc.has(bt))return;const pt=setTimeout(()=>{Fc.delete(bt),pe()},yt);Fc.set(bt,pt)}},Mn=Qe=>{if(C||!ot||!yt)return;const bt=Qe.target,pt=Fc.get(bt);pt&&(clearTimeout(pt),Fc.delete(bt))};return{...H,..._e,...Re,href:te?.href,ref:r,onClick:Bc([M,Ye]),onFocus:Bc([A,Oe]),onMouseEnter:Bc([R,ct]),onMouseLeave:Bc([T,Mn]),onTouchStart:Bc([O,dt]),disabled:!!C,target:N,...Fe&&{style:Fe},...ge&&{className:ge},...C&&W4,...Ce&&G4,...le&&be&&Z4}}const lv={},Y4={className:"active"},W4={role:"link","aria-disabled":!0},G4={"data-status":"active","aria-current":"page"},Z4={"data-transitioning":"transitioning"},Fc=new WeakMap,Q4={rootMargin:"100px"},Bc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function K4(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function X4(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Ss=p.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...l}=H4(r,t),u=typeof r.children=="function"?r.children({isActive:l["data-status"]==="active"}):r.children;if(!n){const{disabled:d,...h}=l;return p.createElement("a",h,u)}return p.createElement(n,l,u)});function J4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class e3 extends GN{constructor(t){super(t),this.useMatch=n=>_s({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>_s({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>qx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Go({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Xa({from:this.fullPath}),this.Link=ee.forwardRef((n,r)=>i.jsx(Ss,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function os(e){return new e3(e)}class t3 extends R4{constructor(t){super(t),this.useMatch=n=>_s({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>_s({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>qx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Go({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Xa({from:this.fullPath}),this.Link=ee.forwardRef((n,r)=>i.jsx(Ss,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function n3(e){return new t3(e)}function oj(e){return typeof e=="object"?new ij(e,{silent:!0}).createRoute(e):new ij(e,{silent:!0}).createRoute}class ij{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const o=os(r);return o.isRoot=!1,o},this.silent=n?.silent}}class lj{constructor(t){this.useMatch=n=>_s({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>_s({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>qx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Go({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Ux({...n,from:this.options.id}),this.useLoaderData=n=>Bx({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ur();return Xa({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function cj(e){return typeof e=="object"?new lj(e):t=>new lj({id:e,...t})}function r3(){const e=Ur(),t=p.useRef({router:e,mounted:!1}),[n,r]=p.useState(!1),{hasPendingMatches:o,isLoading:l}=$n({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),u=nv(l),d=l||n||o,h=nv(d),m=l||o,v=nv(m);return e.startTransition=g=>{r(!0),p.startTransition(()=>{g(),r(!1)})},p.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ra(e.latestLocation.publicHref)!==ra(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),jf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),jf(()=>{u&&!l&&e.emit({type:"onLoad",...zo(e.state)})},[u,e,l]),jf(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...zo(e.state)})},[m,v,e]),jf(()=>{if(h&&!d){const g=zo(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),g.hrefChanged&&l4(e)}},[d,h,e]),null}function s3(e){const t=$n({select:n=>`not-found-${n.location.pathname}-${n.status}`});return i.jsx($x,{getResetKey:()=>t,onCatch:(n,r)=>{if(yr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(yr(n))return e.fallback?.(n);throw n},children:e.children})}function a3(){return i.jsx("p",{children:"Not Found"})}function Zi(e){return i.jsx(i.Fragment,{children:e.children})}function XN(e,t,n){return t.options.notFoundComponent?i.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?i.jsx(e.options.defaultNotFoundComponent,{...n}):i.jsx(a3,{})}function o3(){return Ur().isScrollRestoring,null}const JN=p.memo(function({matchId:t}){const n=Ur(),r=$n({select:j=>{const N=j.matches.findIndex(_=>_.id===t),C=j.matches[N];return da(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[N-1]?.routeId}},structuralSharing:!0}),o=n.routesById[r.routeId],l=o.options.pendingComponent??n.options.defaultPendingComponent,u=l?i.jsx(l,{}):null,d=o.options.errorComponent??n.options.defaultErrorComponent,h=o.options.onCatch??n.options.defaultOnCatch,m=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,v=r.ssr===!1||r.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||v)&&(o.options.wrapInSuspense??l??(o.options.errorComponent?.preload||v))?p.Suspense:Zi,y=d?$x:Zi,w=m?s3:Zi,S=o.isRoot?o.options.shellComponent??Zi:Zi;return i.jsxs(S,{children:[i.jsx(Ih.Provider,{value:t,children:i.jsx(g,{fallback:u,children:i.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:d||Fx,onCatch:(j,N)=>{if(yr(j))throw j;h?.(j,N)},children:i.jsx(w,{fallback:j=>{if(!m||j.routeId&&j.routeId!==r.routeId||!j.routeId&&!o.isRoot)throw j;return p.createElement(m,j)},children:v||r._displayPending?i.jsx(z4,{fallback:u,children:i.jsx(uj,{matchId:t})}):i.jsx(uj,{matchId:t})})})})}),r.parentRouteId===$r&&n.options.scrollRestoration?i.jsxs(i.Fragment,{children:[i.jsx(i3,{}),i.jsx(o3,{})]}):null]})});function i3(){const e=Ur(),t=p.useRef(void 0);return i.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...zo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const uj=p.memo(function({matchId:t}){const n=Ur(),{match:r,key:o,routeId:l}=$n({select:h=>{const m=h.matches.find(S=>S.id===t),v=m.routeId,y=(n.routesById[v].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,invalid:m.invalid,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),u=n.routesById[l],d=p.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?i.jsx(h,{},o):i.jsx(ek,{})},[o,u.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const m=n.getMatch(r.id);if(m&&!m._nonReactive.minPendingPromise){const v=hl();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},h)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return da(yr(r.error)),XN(n,u,r.error);if(r.status==="redirected")throw da(Fr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return d}),ek=p.memo(function(){const t=Ur(),n=p.useContext(Ih),r=$n({select:m=>m.matches.find(v=>v.id===n)?.routeId}),o=t.routesById[r],l=$n({select:m=>{const g=m.matches.find(y=>y.id===n);return da(g),g.globalNotFound}}),u=$n({select:m=>{const v=m.matches,g=v.findIndex(y=>y.id===n);return v[g+1]?.id}}),d=t.options.defaultPendingComponent?i.jsx(t.options.defaultPendingComponent,{}):null;if(l)return XN(t,o,void 0);if(!u)return null;const h=i.jsx(JN,{matchId:u});return r===$r?i.jsx(p.Suspense,{fallback:d,children:h}):h});function l3(){const e=Ur(),n=e.routesById[$r].options.pendingComponent??e.options.defaultPendingComponent,r=n?i.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?Zi:p.Suspense,l=i.jsxs(o,{fallback:r,children:[i.jsx(r3,{}),i.jsx(c3,{})]});return e.options.InnerWrap?i.jsx(e.options.InnerWrap,{children:l}):l}function c3(){const e=Ur(),t=$n({select:o=>o.matches[0]?.id}),n=$n({select:o=>o.loadedAt}),r=t?i.jsx(JN,{matchId:t}):null;return i.jsx(Ih.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:i.jsx($x,{getResetKey:()=>n,errorComponent:Fx,onCatch:o=>{o.message||o.toString()},children:r})})}const u3=e=>new d3(e);class d3 extends j4{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=oj,globalThis.createLazyFileRoute=cj):typeof window<"u"&&(window.createFileRoute=oj,window.createLazyFileRoute=cj);function f3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=KN(),o=i.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?i.jsx(e.options.Wrap,{children:o}):o}function h3({router:e,...t}){return i.jsx(f3,{router:e,...t,children:i.jsx(l3,{})})}function m3(e){return $n({select:t=>t.location})}const p3="0.0.16-alpha.0";const tk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const g3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const v3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const dj=e=>{const t=v3(e);return t.charAt(0).toUpperCase()+t.slice(1)};var x3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const y3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const b3=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:u,...d},h)=>p.createElement("svg",{ref:h,...x3,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tk("lucide",o),...!l&&!y3(d)&&{"aria-hidden":"true"},...d},[...u.map(([m,v])=>p.createElement(m,v)),...Array.isArray(l)?l:[l]]));const ve=(e,t)=>{const n=p.forwardRef(({className:r,...o},l)=>p.createElement(b3,{ref:l,iconNode:t,className:tk(`lucide-${g3(dj(e))}`,`lucide-${e}`,r),...o}));return n.displayName=dj(e),n};const w3=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],nk=ve("archive",w3);const S3=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],j3=ve("arrow-down",S3);const C3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],rk=ve("arrow-left",C3);const N3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],k3=ve("arrow-right",N3);const _3=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],E3=ve("arrow-up-down",_3);const T3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],M3=ve("arrow-up",T3);const R3=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],nx=ve("bell",R3);const A3=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],O3=ve("bold",A3);const D3=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],z3=ve("book",D3);const P3=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],L3=ve("bookmark",P3);const I3=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Vx=ve("braces",I3);const $3=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],pl=ve("calendar",$3);const F3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ms=ve("check",F3);const B3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vn=ve("chevron-down",B3);const U3=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hx=ve("chevron-left",U3);const q3=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Rl=ve("chevron-right",q3);const V3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Iu=ve("chevron-up",V3);const H3=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Y3=ve("chevrons-up-down",H3);const W3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$u=ve("circle-alert",W3);const G3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Yx=ve("circle-check-big",G3);const Z3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],sk=ve("circle-question-mark",Z3);const Q3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],K3=ve("circle-x",Q3);const X3=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ih=ve("clock",X3);const J3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],rx=ve("code-xml",J3);const eP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ak=ve("code",eP);const tP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ok=ve("copy",tP);const nP=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],ik=ve("dollar-sign",nP);const rP=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],sx=ve("download",rP);const sP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aP=ve("ellipsis-vertical",sP);const oP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],lk=ve("ellipsis",oP);const iP=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],lP=ve("expand",iP);const cP=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],uP=ve("external-link",cP);const dP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],lh=ve("eye",dP);const fP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],hP=ve("file-code",fP);const mP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Sr=ve("file-text",mP);const pP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],ch=ve("file-type",pP);const gP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Wx=ve("file",gP);const vP=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],xP=ve("flag",vP);const yP=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Gx=ve("folder-input",yP);const bP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Zx=ve("folder-open",bP);const wP=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],SP=ve("folder-plus",wP);const jP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],CP=ve("folder-tree",jP);const NP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],uh=ve("folder",NP);const kP=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],_P=ve("git-compare",kP);const EP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],TP=ve("globe",EP);const MP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],RP=ve("grid-3x3",MP);const AP=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Qx=ve("hash",AP);const OP=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],DP=ve("heading-2",OP);const zP=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],PP=ve("heart",zP);const LP=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ck=ve("history",LP);const IP=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],$h=ve("house",IP);const $P=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ns=ve("image",$P);const FP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],BP=ve("info",FP);const UP=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],qP=ve("italic",UP);const VP=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Kx=ve("layers",VP);const HP=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],YP=ve("layout-dashboard",HP);const WP=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],pu=ve("link-2",WP);const GP=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],uk=ve("link",GP);const ZP=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],gu=ve("list",ZP);const QP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vu=ve("loader-circle",QP);const KP=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Xx=ve("lock",KP);const XP=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],JP=ve("log-out",XP);const e5=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],t5=ve("mail",e5);const n5=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],r5=ve("map-pin",n5);const s5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],a5=ve("message-square",s5);const o5=[["path",{d:"M5 12h14",key:"1ays0h"}]],i5=ve("minus",o5);const l5=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],c5=ve("monitor",l5);const u5=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],d5=ve("moon",u5);const f5=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Jx=ve("music",f5);const h5=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],m5=ve("package",h5);const p5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],g5=ve("panel-left",p5);const v5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],fa=ve("pencil",v5);const x5=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],y5=ve("phone",x5);const b5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Un=ve("plus",b5);const w5=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],S5=ve("quote",w5);const j5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ey=ve("refresh-cw",j5);const C5=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xu=ve("rotate-ccw",C5);const N5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Al=ve("search",N5);const k5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],_5=ve("settings-2",k5);const E5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],dk=ve("settings",E5);const T5=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],M5=ve("square-check-big",T5);const R5=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],A5=ve("square-pen",R5);const O5=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],D5=ve("star",O5);const z5=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],P5=ve("sun",z5);const L5=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Po=ve("tag",L5);const I5=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],ty=ve("tags",I5);const $5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],ny=ve("text-align-start",$5);const F5=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],ry=ve("toggle-left",F5);const B5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Fn=ve("trash-2",B5);const U5=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],q5=ve("trending-up",U5);const V5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fo=ve("triangle-alert",V5);const H5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],sy=ve("upload",H5);const Y5=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],fk=ve("user",Y5);const W5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],G5=ve("users",W5);const Z5=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ay=ve("video",Z5);const Q5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],At=ve("x",Q5);var xs=[],fj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Cf=0,K5=fj.length;Cf<K5;++Cf)xs[Cf]=fj[Cf];function X5(e){return xs[e>>18&63]+xs[e>>12&63]+xs[e>>6&63]+xs[e&63]}function J5(e,t,n){for(var r,o=[],l=t;l<n;l+=3)r=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),o.push(X5(r));return o.join("")}function dh(e){for(var t,n=e.length,r=n%3,o=[],l=16383,u=0,d=n-r;u<d;u+=l)o.push(J5(e,u,u+l>d?d:u+l));return r===1?(t=e[n-1],o.push(xs[t>>2]+xs[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(xs[t>>10]+xs[t>>4&63]+xs[t<<2&63]+"=")),o.join("")}function eL(e){const t=typeof e=="object",n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name==="Object";return t&&r}const tL=!0,fh=BigInt("-9223372036854775808"),hk=BigInt("9223372036854775807"),nL=BigInt("0"),rL=BigInt("8");BigInt("256");function sL(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function aL(e){e<nL&&(e-=fh+fh);let t=e.toString(16);t.length%2===1&&(t="0"+t);const n=new Uint8Array(new ArrayBuffer(8));let r=0;for(const o of t.match(/.{2}/g).reverse())n.set([parseInt(o,16)],r++),e>>=rL;return dh(n)}function oL(e){if(e<fh||hk<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),dh(new Uint8Array(t))}const iL=DataView.prototype.setBigInt64?oL:aL,hj=1024;function lL(e){if(e.length>hj)throw new Error(`Field name ${e} exceeds maximum field name length ${hj}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||n>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}const mj=16384;function Hf(e){const t=JSON.stringify(e,(n,r)=>r===void 0?"undefined":typeof r=="bigint"?`${r.toString()}n`:r);if(t.length>mj){const n="[...truncated]";let r=mj-n.length;const o=t.codePointAt(r-1);return o!==void 0&&o>65535&&(r-=1),t.substring(0,r)+n}return t}function ax(e,t,n,r){if(e===void 0){const u=n&&` (present at path ${n} in original object ${Hf(t)})`;throw new Error(`undefined is not a valid Convex value${u}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<fh||hk<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:iL(e)}}if(typeof e=="number")if(sL(e)){const u=new ArrayBuffer(8);return new DataView(u).setFloat64(0,e,tL),{$float:dh(new Uint8Array(u))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:dh(new Uint8Array(e))};if(Array.isArray(e))return e.map((u,d)=>ax(u,t,n+`[${d}]`));if(e instanceof Set)throw new Error(cv(n,"Set",[...e],t));if(e instanceof Map)throw new Error(cv(n,"Map",[...e],t));if(!eL(e)){const u=e?.constructor?.name,d=u?`${u} `:"";throw new Error(cv(n,d,e,t))}const o={},l=Object.entries(e);l.sort(([u,d],[h,m])=>u===h?0:u<h?-1:1);for(const[u,d]of l)d!==void 0&&(lL(u),o[u]=ax(d,t,n+`.${u}`));return o}function cv(e,t,n,r){return e?`${t}${Hf(n)} is not a supported Convex type (present at path ${e} in original object ${Hf(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${Hf(n)} is not a supported Convex type.`}function cL(e){return ax(e,e,"")}var uL=Object.defineProperty,dL=(e,t,n)=>t in e?uL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lt=(e,t,n)=>dL(e,typeof t!="symbol"?t+"":t,n);const fL="https://docs.convex.dev/error#undefined-validator";function yu(e,t){const n=t!==void 0?` for field "${t}"`:"";throw new Error(`A validator is undefined${n} in ${e}. This is often caused by circular imports. See ${fL} for details.`)}class Cr{constructor({isOptional:t}){Lt(this,"type"),Lt(this,"fieldPaths"),Lt(this,"isOptional"),Lt(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}}class oy extends Cr{constructor({isOptional:t,tableName:n}){if(super({isOptional:t}),Lt(this,"tableName"),Lt(this,"kind","id"),typeof n!="string")throw new Error("v.id(tableName) requires a string");this.tableName=n}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new oy({isOptional:"optional",tableName:this.tableName})}}class hh extends Cr{constructor(){super(...arguments),Lt(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new hh({isOptional:"optional"})}}class mh extends Cr{constructor(){super(...arguments),Lt(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new mh({isOptional:"optional"})}}class iy extends Cr{constructor(){super(...arguments),Lt(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new iy({isOptional:"optional"})}}class ly extends Cr{constructor(){super(...arguments),Lt(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new ly({isOptional:"optional"})}}class cy extends Cr{constructor(){super(...arguments),Lt(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new cy({isOptional:"optional"})}}class uy extends Cr{constructor(){super(...arguments),Lt(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new uy({isOptional:"optional"})}}class dy extends Cr{constructor(){super(...arguments),Lt(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new dy({isOptional:"optional"})}}class Eo extends Cr{constructor({isOptional:t,fields:n}){super({isOptional:t}),Lt(this,"fields"),Lt(this,"kind","object"),globalThis.Object.entries(n).forEach(([r,o])=>{if(o===void 0&&yu("v.object()",r),!o.isConvexValidator)throw new Error("v.object() entries must be validators")}),this.fields=n}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,n])=>[t,{fieldType:n.json,optional:n.isOptional==="optional"}]))}}asOptional(){return new Eo({isOptional:"optional",fields:this.fields})}omit(...t){const n={...this.fields};for(const r of t)delete n[r];return new Eo({isOptional:this.isOptional,fields:n})}pick(...t){const n={};for(const r of t)n[r]=this.fields[r];return new Eo({isOptional:this.isOptional,fields:n})}partial(){const t={};for(const[n,r]of globalThis.Object.entries(this.fields))t[n]=r.asOptional();return new Eo({isOptional:this.isOptional,fields:t})}extend(t){return new Eo({isOptional:this.isOptional,fields:{...this.fields,...t}})}}class fy extends Cr{constructor({isOptional:t,value:n}){if(super({isOptional:t}),Lt(this,"value"),Lt(this,"kind","literal"),typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&typeof n!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=n}get json(){return{type:this.kind,value:cL(this.value)}}asOptional(){return new fy({isOptional:"optional",value:this.value})}}class hy extends Cr{constructor({isOptional:t,element:n}){super({isOptional:t}),Lt(this,"element"),Lt(this,"kind","array"),n===void 0&&yu("v.array()"),this.element=n}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new hy({isOptional:"optional",element:this.element})}}class my extends Cr{constructor({isOptional:t,key:n,value:r}){if(super({isOptional:t}),Lt(this,"key"),Lt(this,"value"),Lt(this,"kind","record"),n===void 0&&yu("v.record()","key"),r===void 0&&yu("v.record()","value"),n.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(r.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!n.isConvexValidator||!r.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=n,this.value=r}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new my({isOptional:"optional",key:this.key,value:this.value})}}class py extends Cr{constructor({isOptional:t,members:n}){super({isOptional:t}),Lt(this,"members"),Lt(this,"kind","union"),n.forEach((r,o)=>{if(r===void 0&&yu("v.union()",`member at index ${o}`),!r.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=n}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new py({isOptional:"optional",members:this.members})}}const Tt={id:e=>new oy({isOptional:"required",tableName:e}),null:()=>new uy({isOptional:"required"}),number:()=>new hh({isOptional:"required"}),float64:()=>new hh({isOptional:"required"}),bigint:()=>new mh({isOptional:"required"}),int64:()=>new mh({isOptional:"required"}),boolean:()=>new iy({isOptional:"required"}),string:()=>new cy({isOptional:"required"}),bytes:()=>new ly({isOptional:"required"}),literal:e=>new fy({isOptional:"required",value:e}),array:e=>new hy({isOptional:"required",element:e}),object:e=>new Eo({isOptional:"required",fields:e}),record:(e,t)=>new my({isOptional:"required",key:e,value:t}),union:(...e)=>new py({isOptional:"required",members:e}),any:()=>new dy({isOptional:"required"}),optional:e=>e.asOptional(),nullable:e=>Tt.union(e,Tt.null())};Tt.union(Tt.literal("admin"),Tt.literal("editor"),Tt.literal("author"),Tt.literal("viewer"));const hL=Tt.union(Tt.literal("contentTypes"),Tt.literal("contentEntries"),Tt.literal("mediaItems"),Tt.literal("settings"),Tt.literal("users")),mL=Tt.union(Tt.literal("create"),Tt.literal("read"),Tt.literal("update"),Tt.literal("delete"),Tt.literal("publish"),Tt.literal("unpublish"),Tt.literal("restore"),Tt.literal("manage"),Tt.literal("move"));Tt.object({resource:hL,action:mL,scope:Tt.optional(Tt.union(Tt.literal("all"),Tt.literal("own")))});function el(e,t="all"){return[{resource:e,action:"create",scope:t},{resource:e,action:"read",scope:t},{resource:e,action:"update",scope:t},{resource:e,action:"delete",scope:t}]}function ol(e,t="all"){return[{resource:e,action:"read",scope:t}]}function mk(e="all"){return[{resource:"contentEntries",action:"publish",scope:e},{resource:"contentEntries",action:"unpublish",scope:e}]}const pL={name:"admin",displayName:"Administrator",description:"Full access to all CMS features including settings and content type management",isSystem:!0,permissions:[...el("contentTypes"),...el("contentEntries"),...mk(),{resource:"contentEntries",action:"restore"},...el("mediaItems"),{resource:"settings",action:"manage"},...ol("settings"),...el("users"),{resource:"users",action:"manage"}]},gL={name:"editor",displayName:"Editor",description:"Can manage all content and media, but cannot modify settings or content types",isSystem:!0,permissions:[...ol("contentTypes"),...el("contentEntries"),...mk(),{resource:"contentEntries",action:"restore"},...el("mediaItems")]},vL={name:"author",displayName:"Author",description:"Can create and manage own content and media",isSystem:!0,permissions:[...ol("contentTypes"),{resource:"contentEntries",action:"create"},{resource:"contentEntries",action:"read",scope:"own"},{resource:"contentEntries",action:"update",scope:"own"},{resource:"contentEntries",action:"delete",scope:"own"},{resource:"contentEntries",action:"publish",scope:"own"},{resource:"contentEntries",action:"unpublish",scope:"own"},{resource:"mediaItems",action:"create"},{resource:"mediaItems",action:"read",scope:"all"},{resource:"mediaItems",action:"update",scope:"own"},{resource:"mediaItems",action:"delete",scope:"own"}]},xL={name:"viewer",displayName:"Viewer",description:"Read-only access to published content and media",isSystem:!0,permissions:[...ol("contentTypes"),...ol("contentEntries"),...ol("mediaItems")]},gy={admin:pL,editor:gL,author:vL,viewer:xL};function yL(e,t){if(e.resource!==t.resource||e.action!==t.action)return!1;const n=e.scope??"all",r=t.scope??"all";return n==="all"?!0:r==="own"}function pk(e,t,n){const r=gy[e]??n?.[e];return r?r.permissions.some(o=>yL(o,t)):!1}function bL(e,t){return(gy[e]??t?.[e])?.permissions??[]}function wL(e,t){return gy[e]??t?.[e]}function gk(e,t,n){return bL(e,n).filter(r=>r.resource===t)}function SL(e,t,n){return gk(e,t,n).length>0}const vk=p.createContext(null);function jL({children:e,getUser:t,getUserRole:n,onLogout:r,autoRedirectToLogin:o=!1,loginUrl:l="/login"}){const[u,d]=p.useState(null),[h,m]=p.useState(null),[v,g]=p.useState("loading"),[y,w]=p.useState(null),S=p.useCallback(async()=>{g("loading"),w(null);try{const E=await t();if(!E){d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l);return}const M=await n({userId:E.id});d(E),m(M),g("authenticated")}catch(E){console.error("Authentication error:",E),d(null),m(null),w(E instanceof Error?E.message:"Authentication failed"),g("error")}},[t,n,o,l]);p.useEffect(()=>{S()},[S]);const j=p.useCallback(E=>h?pk(h,E):!1,[h]),N=p.useCallback(async()=>{try{r&&await r(),d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l)}catch(E){console.error("Logout error:",E),w(E instanceof Error?E.message:"Logout failed")}},[r,o,l]),C=p.useCallback(async()=>{await S()},[S]),_={user:u,role:h,authState:v,isLoading:v==="loading",isAuthenticated:v==="authenticated",error:y,checkPermission:j,logout:N,refresh:C};return i.jsx(vk.Provider,{value:_,children:e})}function vy(){const e=p.useContext(vk);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const xk=p.createContext(null),yk="convex-cms-theme";function pj(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function gj(){if(typeof window>"u")return"system";const e=localStorage.getItem(yk);return e==="light"||e==="dark"||e==="system"?e:"system"}function uv(){return typeof window>"u"?!1:document.documentElement.classList.contains("dark")}function CL({children:e,themeMode:t="isolated",darkModeControl:n="independent"}){const r=t==="isolated"||n==="independent",o=t==="inherit"&&n==="follow-parent",[l,u]=p.useState(()=>o?uv()?"dark":"light":gj()),[d,h]=p.useState(()=>{if(o)return uv()?"dark":"light";const g=gj();return g==="system"?pj():g}),m=p.useCallback(g=>{const y=g==="system"?pj():g;if(h(y),r){const w=document.documentElement;w.classList.remove("light","dark"),w.classList.add(y)}},[r]),v=p.useCallback(g=>{r&&(u(g),localStorage.setItem(yk,g),m(g))},[m,r]);return p.useEffect(()=>{o||m(l)},[l,m,o]),p.useEffect(()=>{if(!o){const g=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{l==="system"&&m("system")};return g.addEventListener("change",y),()=>g.removeEventListener("change",y)}},[l,m,o]),p.useEffect(()=>{if(!o)return;const g=()=>{const S=uv()?"dark":"light";u(S),h(S)};g();const y=new MutationObserver(w=>{for(const S of w)if(S.type==="attributes"&&S.attributeName==="class"){g();break}});return y.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>y.disconnect()},[o]),i.jsx(xk.Provider,{value:{theme:l,resolvedTheme:d,setTheme:v,canToggleDarkMode:r},children:e})}function NL(){const e=p.useContext(xk);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function fe(e,t,n){function r(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=u.prototype,v=Object.keys(m);for(let g=0;g<v.length;g++){const y=v[g];y in d||(d[y]=m[y].bind(d))}}const o=n?.Parent??Object;class l extends o{}Object.defineProperty(l,"name",{value:e});function u(d){var h;const m=n?.Parent?new l:this;r(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(u,"init",{value:r}),Object.defineProperty(u,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class il extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bk extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const wk={};function Wa(e){return wk}function Sk(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ox(e,t){return typeof t=="bigint"?t.toString():t}function xy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function yy(e){return e==null}function by(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function kL(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const h=r.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const l=n>o?n:o,u=Number.parseInt(e.toFixed(l).replace(".","")),d=Number.parseInt(t.toFixed(l).replace(".",""));return u%d/10**l}const vj=Symbol("evaluating");function Nt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==vj)return r===void 0&&(r=vj,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Zo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ja(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function xj(e){return JSON.stringify(e)}function _L(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jk="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ph(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const EL=xy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function gl(e){if(ph(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ph(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ck(e){return gl(e)?{...e}:Array.isArray(e)?[...e]:e}const TL=new Set(["string","number","symbol"]);function Fh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function $e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ML(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const RL={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function AL(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Ja(e._zod.def,{get shape(){const u={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(u[d]=n.shape[d])}return Zo(this,"shape",u),u},checks:[]});return eo(e,l)}function OL(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Ja(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete u[d]}return Zo(this,"shape",u),u},checks:[]});return eo(e,l)}function DL(e,t){if(!gl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const l=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ja(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return Zo(this,"shape",l),l}});return eo(e,o)}function zL(e,t){if(!gl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Zo(this,"shape",r),r}});return eo(e,n)}function PL(e,t){const n=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Zo(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return eo(e,n)}function LL(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ja(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Zo(this,"shape",h),h},checks:[]});return eo(t,u)}function IL(e,t,n){const r=Ja(t._zod.def,{get shape(){const o=t._zod.def.shape,l={...o};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)l[u]=new e({type:"nonoptional",innerType:o[u]});return Zo(this,"shape",l),l}});return eo(t,r)}function tl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function nl(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Nf(e){return typeof e=="string"?e:e?.message}function Ga(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Nf(e.inst?._zod.def?.error?.(e))??Nf(t?.error?.(e))??Nf(n.customError?.(e))??Nf(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function wy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function bu(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Nk=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ox,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kk=fe("$ZodError",Nk),_k=fe("$ZodError",Nk,{Parent:Error});function $L(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function FL(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const l of o.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>r({issues:u}));else if(l.code==="invalid_key")r({issues:l.issues});else if(l.code==="invalid_element")r({issues:l.issues});else if(l.path.length===0)n._errors.push(t(l));else{let u=n,d=0;for(;d<l.path.length;){const h=l.path[d];d===l.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(l))):u[h]=u[h]||{_errors:[]},u=u[h],d++}}};return r(e),n}const Sy=e=>(t,n,r,o)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise)throw new il;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ga(h,l,Wa())));throw jk(d,o?.callee),d}return u.value},jy=e=>async(t,n,r,o)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ga(h,l,Wa())));throw jk(d,o?.callee),d}return u.value},Bh=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new il;return l.issues.length?{success:!1,error:new(e??kk)(l.issues.map(u=>Ga(u,o,Wa())))}:{success:!0,data:l.value}},BL=Bh(_k),Uh=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},o);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>Ga(u,o,Wa())))}:{success:!0,data:l.value}},UL=Uh(_k),qL=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Sy(e)(t,n,o)},VL=e=>(t,n,r)=>Sy(e)(t,n,r),HL=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return jy(e)(t,n,o)},YL=e=>async(t,n,r)=>jy(e)(t,n,r),WL=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bh(e)(t,n,o)},GL=e=>(t,n,r)=>Bh(e)(t,n,r),ZL=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Uh(e)(t,n,o)},QL=e=>async(t,n,r)=>Uh(e)(t,n,r),KL=/^[cC][^\s-]{8,}$/,XL=/^[0-9a-z]+$/,JL=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eI=/^[0-9a-vA-V]{20}$/,tI=/^[A-Za-z0-9]{27}$/,nI=/^[a-zA-Z0-9_-]{21}$/,rI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yj=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,aI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iI(){return new RegExp(oI,"u")}const lI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,uI=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,dI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ek=/^[A-Za-z0-9_-]*$/,hI=/^\+[1-9]\d{6,14}$/,Tk="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",mI=new RegExp(`^${Tk}$`);function Mk(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pI(e){return new RegExp(`^${Mk(e)}$`)}function gI(e){const t=Mk({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Tk}T(?:${r})$`)}const vI=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xI=/^-?\d+$/,Rk=/^-?\d+(?:\.\d+)?$/,yI=/^(?:true|false)$/i,bI=/^[^A-Z]*$/,wI=/^[^a-z]*$/,rr=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ak={number:"number",bigint:"bigint",object:"date"},Ok=fe("$ZodCheckLessThan",(e,t)=>{rr.init(e,t);const n=Ak[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,l=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<l&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dk=fe("$ZodCheckGreaterThan",(e,t)=>{rr.init(e,t);const n=Ak[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,l=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>l&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),SI=fe("$ZodCheckMultipleOf",(e,t)=>{rr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):kL(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),jI=fe("$ZodCheckNumberFormat",(e,t)=>{rr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,l]=RL[t.format];e._zod.onattach.push(u=>{const d=u._zod.bag;d.format=t.format,d.minimum=o,d.maximum=l,n&&(d.pattern=xI)}),e._zod.check=u=>{const d=u.value;if(n){if(!Number.isInteger(d)){u.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?u.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):u.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}d<o&&u.issues.push({origin:"number",input:d,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),d>l&&u.issues.push({origin:"number",input:d,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),CI=fe("$ZodCheckMaxLength",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!yy(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const u=wy(o);r.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),NI=fe("$ZodCheckMinLength",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!yy(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const u=wy(o);r.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),kI=fe("$ZodCheckLengthEquals",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!yy(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,l=o.length;if(l===t.length)return;const u=wy(o),d=l>t.length;r.issues.push({origin:u,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),qh=fe("$ZodCheckStringFormat",(e,t)=>{var n,r;rr.init(e,t),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),_I=fe("$ZodCheckRegex",(e,t)=>{qh.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),EI=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=bI),qh.init(e,t)}),TI=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=wI),qh.init(e,t)}),MI=fe("$ZodCheckIncludes",(e,t)=>{rr.init(e,t);const n=Fh(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),RI=fe("$ZodCheckStartsWith",(e,t)=>{rr.init(e,t);const n=new RegExp(`^${Fh(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),AI=fe("$ZodCheckEndsWith",(e,t)=>{rr.init(e,t);const n=new RegExp(`.*${Fh(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),OI=fe("$ZodCheckOverwrite",(e,t)=>{rr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class DI{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
10
+ Called by client`}function Xv(e,t){return t.data=e.errorData,t}function Lo(e){const t=e.split(":");let n,r;return t.length===1?(n=t[0],r="default"):(n=t.slice(0,t.length-1).join(":"),r=t[t.length-1]),n.endsWith(".js")&&(n=n.slice(0,-3)),`${n}:${r}`}function Oo(e,t){return JSON.stringify({udfPath:Lo(e),args:ks(t)})}function z1(e,t,n){const{initialNumItems:r,id:o}=n;return JSON.stringify({type:"paginated",udfPath:Lo(e),args:ks(t),options:ks({initialNumItems:r,id:o})})}var wD=Object.defineProperty,SD=(e,t,n)=>t in e?wD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ps=(e,t,n)=>SD(e,typeof t!="symbol"?t+"":t,n);class jD{constructor(){ps(this,"nextQueryId"),ps(this,"querySetVersion"),ps(this,"querySet"),ps(this,"queryIdToToken"),ps(this,"identityVersion"),ps(this,"auth"),ps(this,"outstandingQueriesOlderThanRestart"),ps(this,"outstandingAuthOlderThanRestart"),ps(this,"paused"),ps(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(t,n,r,o){const l=Lo(t),u=Oo(l,n),d=this.querySet.get(u);if(d!==void 0)return d.numSubscribers+=1,{queryToken:u,modification:null,unsubscribe:()=>this.removeSubscriber(u)};{const h=this.nextQueryId++,m={id:h,canonicalizedUdfPath:l,args:n,numSubscribers:1,journal:r,componentPath:o};this.querySet.set(u,m),this.queryIdToToken.set(h,u);const v=this.querySetVersion,g=this.querySetVersion+1,y={type:"Add",queryId:h,udfPath:l,args:[ks(n)],journal:r,componentPath:o};return this.paused?this.pendingQuerySetModifications.set(h,y):this.querySetVersion=g,{queryToken:u,modification:{type:"ModifyQuerySet",baseVersion:v,newVersion:g,modifications:[y]},unsubscribe:()=>this.removeSubscriber(u)}}}transition(t){for(const n of t.modifications)switch(n.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);const r=n.journal;if(r!==void 0){const o=this.queryIdToToken.get(n.queryId);o!==void 0&&(this.querySet.get(o).journal=r)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(n.queryId);break}default:throw new Error(`Invalid modification ${n.type}`)}}queryId(t,n){const r=Lo(t),o=Oo(r,n),l=this.querySet.get(o);return l!==void 0?l.id:null}isCurrentOrNewerAuthVersion(t){return t>=this.identityVersion}getAuth(){return this.auth}setAuth(t){this.auth={tokenType:"User",value:t};const n=this.identityVersion;return this.paused||(this.identityVersion=n+1),{type:"Authenticate",baseVersion:n,...this.auth}}setAdminAuth(t,n){const r={tokenType:"Admin",value:t,impersonating:n};this.auth=r;const o=this.identityVersion;return this.paused||(this.identityVersion=o+1),{type:"Authenticate",baseVersion:o,...r}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const t=this.identityVersion;return this.paused||(this.identityVersion=t+1),{type:"Authenticate",tokenType:"None",baseVersion:t}}hasAuth(){return!!this.auth}isNewAuth(t){return this.auth?.value!==t}queryPath(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).canonicalizedUdfPath:null}queryArgs(t){const n=this.queryIdToToken.get(t);return n?this.querySet.get(n).args:null}queryToken(t){return this.queryIdToToken.get(t)??null}queryJournal(t){return this.querySet.get(t)?.journal}restart(t){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const n=[];for(const l of this.querySet.values()){const u={type:"Add",queryId:l.id,udfPath:l.canonicalizedUdfPath,args:[ks(l.args)],journal:l.journal,componentPath:l.componentPath};n.push(u),t.has(l.id)||this.outstandingQueriesOlderThanRestart.add(l.id)}this.querySetVersion=1;const r={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:n};if(!this.auth)return this.identityVersion=0,[r,void 0];this.outstandingAuthOlderThanRestart=!0;const o={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[r,o]}pause(){this.paused=!0}resume(){const t=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,n=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[t,n]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(t){const n=this.querySet.get(t);if(n.numSubscribers>1)return n.numSubscribers-=1,null;{this.querySet.delete(t),this.queryIdToToken.delete(n.id),this.outstandingQueriesOlderThanRestart.delete(n.id);const r=this.querySetVersion,o=this.querySetVersion+1,l={type:"Remove",queryId:n.id};return this.paused?this.pendingQuerySetModifications.has(n.id)?this.pendingQuerySetModifications.delete(n.id):this.pendingQuerySetModifications.set(n.id,l):this.querySetVersion=o,{type:"ModifyQuerySet",baseVersion:r,newVersion:o,modifications:[l]}}}}var CD=Object.defineProperty,ND=(e,t,n)=>t in e?CD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yf=(e,t,n)=>ND(e,typeof t!="symbol"?t+"":t,n);class kD{constructor(t,n){this.logger=t,this.markConnectionStateDirty=n,yf(this,"inflightRequests"),yf(this,"requestsOlderThanRestart"),yf(this,"inflightMutationsCount",0),yf(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(t,n){const r=new Promise(o=>{const l=n?"Requested":"NotSent";this.inflightRequests.set(t.requestId,{message:t,status:{status:l,requestedAt:new Date,onResult:o}}),t.type==="Mutation"?this.inflightMutationsCount++:t.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),r}onResponse(t){const n=this.inflightRequests.get(t.requestId);if(n===void 0||n.status.status==="Completed")return null;const r=n.message.type==="Mutation"?"mutation":"action",o=n.message.udfPath;for(const h of t.logLines)Kf(this.logger,"info",r,o,h);const l=n.status;let u,d;if(t.success)u={success:!0,logLines:t.logLines,value:fl(t.result)},d=()=>l.onResult(u);else{const h=t.result,{errorData:m}=t;Kf(this.logger,"error",r,o,h),u={success:!1,errorMessage:h,errorData:m!==void 0?fl(m):void 0,logLines:t.logLines},d=()=>l.onResult(u)}return t.type==="ActionResponse"||!t.success?(d(),this.inflightRequests.delete(t.requestId),this.requestsOlderThanRestart.delete(t.requestId),n.message.type==="Action"?this.inflightActionsCount--:n.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:t.requestId,result:u}):(n.status={status:"Completed",result:u,ts:t.ts,onResolve:d},null)}removeCompleted(t){const n=new Map;for(const[r,o]of this.inflightRequests.entries()){const l=o.status;l.status==="Completed"&&l.ts.lessThanOrEqual(t)&&(l.onResolve(),n.set(r,l.result),o.message.type==="Mutation"?this.inflightMutationsCount--:o.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(r),this.requestsOlderThanRestart.delete(r))}return n.size>0&&this.markConnectionStateDirty(),n}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const t=[];for(const[n,r]of this.inflightRequests){if(r.status.status==="NotSent"){r.status.status="Requested",t.push(r.message);continue}if(r.message.type==="Mutation")t.push(r.message);else if(r.message.type==="Action"){if(this.inflightRequests.delete(n),this.requestsOlderThanRestart.delete(n),this.inflightActionsCount--,r.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");r.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),t}resume(){const t=[];for(const[,n]of this.inflightRequests)if(n.status.status==="NotSent"){n.status.status="Requested",t.push(n.message);continue}return t}hasIncompleteRequests(){for(const t of this.inflightRequests.values())if(t.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let t=Date.now();for(const n of this.inflightRequests.values())n.status.status!=="Completed"&&n.status.requestedAt.getTime()<t&&(t=n.status.requestedAt.getTime());return new Date(t)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const du=Symbol.for("functionName"),_D=Symbol.for("toReferencePath");function ED(e){return e[_D]??null}function TD(e){return e.startsWith("function://")}function MD(e){let t;if(typeof e=="string")TD(e)?t={functionHandle:e}:t={name:e};else if(e[du])t={name:e[du]};else{const n=ED(e);if(!n)throw new Error(`${e} is not a functionReference`);t={reference:n}}return t}function tr(e){const t=MD(e);if(t.name===void 0)throw t.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`):t.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`);if(typeof e=="string")return e;const n=e[du];if(!n)throw new Error(`${e} is not a functionReference`);return n}function EN(e){return{[du]:e}}function TN(e=[]){const t={get(n,r){if(typeof r=="string"){const o=[...e,r];return TN(o)}else if(r===du){if(e.length<2){const u=["api",...e].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${u}\``)}const o=e.slice(0,-1).join("/"),l=e[e.length-1];return l==="default"?o:o+":"+l}else return r===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},t)}TN();var RD=Object.defineProperty,AD=(e,t,n)=>t in e?RD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xf=(e,t,n)=>AD(e,typeof t!="symbol"?t+"":t,n);class fu{constructor(t){Xf(this,"queryResults"),Xf(this,"modifiedQueries"),this.queryResults=t,this.modifiedQueries=[]}getQuery(t,...n){const r=na(n[0]),o=tr(t),l=this.queryResults.get(Oo(o,r));if(l!==void 0)return fu.queryValue(l.result)}getAllQueries(t){const n=[],r=tr(t);for(const o of this.queryResults.values())o.udfPath===Lo(r)&&n.push({args:o.args,value:fu.queryValue(o.result)});return n}setQuery(t,n,r){const o=na(n),l=tr(t),u=Oo(l,o);let d;r===void 0?d=void 0:d={success:!0,value:r,logLines:[]};const h={udfPath:l,args:o,result:d};this.queryResults.set(u,h),this.modifiedQueries.push(u)}static queryValue(t){if(t!==void 0)return t.success?t.value:void 0}}class OD{constructor(){Xf(this,"queryResults"),Xf(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(t,n){this.optimisticUpdates=this.optimisticUpdates.filter(u=>!n.has(u.mutationId));const r=this.queryResults;this.queryResults=new Map(t);const o=new fu(this.queryResults);for(const u of this.optimisticUpdates)u.update(o);const l=[];for(const[u,d]of this.queryResults){const h=r.get(u);(h===void 0||h.result!==d.result)&&l.push(u)}return l}applyOptimisticUpdate(t,n){this.optimisticUpdates.push({update:t,mutationId:n});const r=new fu(this.queryResults);return t(r),r.modifiedQueries}rawQueryResult(t){const n=this.queryResults.get(t);if(n!==void 0)return n.result}queryResult(t){const n=this.queryResults.get(t);if(n===void 0)return;const r=n.result;if(r!==void 0){if(r.success)return r.value;throw r.errorData!==void 0?Xv(r,new Kv(Ji("query",n.udfPath,r))):new Error(Ji("query",n.udfPath,r))}}hasQueryResult(t){return this.queryResults.get(t)!==void 0}queryLogs(t){return this.queryResults.get(t)?.result?.logLines}}var DD=Object.defineProperty,zD=(e,t,n)=>t in e?DD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hg=(e,t,n)=>zD(e,typeof t!="symbol"?t+"":t,n);let Lu=class ta{constructor(t,n){Hg(this,"low"),Hg(this,"high"),Hg(this,"__isUnsignedLong__"),this.low=t|0,this.high=n|0,this.__isUnsignedLong__=!0}static isLong(t){return(t&&t.__isUnsignedLong__)===!0}static fromBytesLE(t){return new ta(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24)}toBytesLE(){const t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]}static fromNumber(t){return isNaN(t)||t<0?P1:t>=PD?LD:new ta(t%su|0,t/su|0)}toString(){return(BigInt(this.high)*BigInt(su)+BigInt(this.low)).toString()}equals(t){return ta.isLong(t)||(t=ta.fromValue(t)),this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low}notEquals(t){return!this.equals(t)}comp(t){return ta.isLong(t)||(t=ta.fromValue(t)),this.equals(t)?0:t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(t){return this.comp(t)<=0}static fromValue(t){return typeof t=="number"?ta.fromNumber(t):new ta(t.low,t.high)}};const P1=new Lu(0,0),L1=65536,su=L1*L1,PD=su*su,LD=new Lu(-1,-1);var ID=Object.defineProperty,$D=(e,t,n)=>t in e?ID(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bf=(e,t,n)=>$D(e,typeof t!="symbol"?t+"":t,n);class I1{constructor(t,n){bf(this,"version"),bf(this,"remoteQuerySet"),bf(this,"queryPath"),bf(this,"logger"),this.version={querySet:0,ts:Lu.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=t,this.logger=n}transition(t){const n=t.startVersion;if(this.version.querySet!==n.querySet||this.version.ts.notEquals(n.ts)||this.version.identity!==n.identity)throw new Error(`Invalid start version: ${n.ts.toString()}:${n.querySet}:${n.identity}, transitioning from ${this.version.ts.toString()}:${this.version.querySet}:${this.version.identity}`);for(const r of t.modifications)switch(r.type){case"QueryUpdated":{const o=this.queryPath(r.queryId);if(o)for(const u of r.logLines)Kf(this.logger,"info","query",o,u);const l=fl(r.value??null);this.remoteQuerySet.set(r.queryId,{success:!0,value:l,logLines:r.logLines});break}case"QueryFailed":{const o=this.queryPath(r.queryId);if(o)for(const u of r.logLines)Kf(this.logger,"info","query",o,u);const{errorData:l}=r;this.remoteQuerySet.set(r.queryId,{success:!1,errorMessage:r.errorMessage,errorData:l!==void 0?fl(l):void 0,logLines:r.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(r.queryId);break}default:throw new Error(`Invalid modification ${r.type}`)}this.version=t.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function Yg(e){const t=cu(e);return Lu.fromBytesLE(Array.from(t))}function FD(e){const t=new Uint8Array(e.toBytesLE());return uu(t)}function $1(e){switch(e.type){case"FatalError":case"AuthError":case"ActionResponse":case"TransitionChunk":case"Ping":return{...e};case"MutationResponse":return e.success?{...e,ts:Yg(e.ts)}:{...e};case"Transition":return{...e,startVersion:{...e.startVersion,ts:Yg(e.startVersion.ts)},endVersion:{...e.endVersion,ts:Yg(e.endVersion.ts)}}}}function BD(e){switch(e.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...e};case"Connect":return e.maxObservedTimestamp!==void 0?{...e,maxObservedTimestamp:FD(e.maxObservedTimestamp)}:{...e,maxObservedTimestamp:void 0}}}var UD=Object.defineProperty,qD=(e,t,n)=>t in e?UD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,on=(e,t,n)=>qD(e,typeof t!="symbol"?t+"":t,n);const VD=1e3,HD=1001,YD=1005,WD=4040;let Bf;function Gi(){return Bf===void 0&&(Bf=Date.now()),typeof performance>"u"||!performance.now?Date.now():Math.round(Bf+performance.now())}function F1(){return`t=${Math.round((Gi()-Bf)/100)/10}s`}const MN={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},TableSummariesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function GD(e){if(e===void 0)return"Unknown";for(const t of Object.keys(MN))if(e.startsWith(t))return t;return"Unknown"}class ZD{constructor(t,n,r,o,l,u){this.markConnectionStateDirty=l,this.debug=u,on(this,"socket"),on(this,"connectionCount"),on(this,"_hasEverConnected",!1),on(this,"lastCloseReason"),on(this,"transitionChunkBuffer",null),on(this,"defaultInitialBackoff"),on(this,"maxBackoff"),on(this,"retries"),on(this,"serverInactivityThreshold"),on(this,"reconnectDueToServerInactivityTimeout"),on(this,"scheduledReconnect",null),on(this,"networkOnlineHandler",null),on(this,"pendingNetworkRecoveryInfo",null),on(this,"uri"),on(this,"onOpen"),on(this,"onResume"),on(this,"onMessage"),on(this,"webSocketConstructor"),on(this,"logger"),on(this,"onServerDisconnectError"),this.webSocketConstructor=r,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=6e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=t,this.onOpen=n.onOpen,this.onResume=n.onResume,this.onMessage=n.onMessage,this.onServerDisconnectError=n.onServerDisconnectError,this.logger=o,this.setupNetworkListener(),this.connect()}setSocketState(t){this.socket=t,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}setupNetworkListener(){typeof window>"u"||typeof window.addEventListener!="function"||this.networkOnlineHandler===null&&(this.networkOnlineHandler=()=>{this._logVerbose("network online event detected"),this.tryReconnectImmediately()},window.addEventListener("online",this.networkOnlineHandler),this._logVerbose("network online event listener registered"))}cleanupNetworkListener(){this.networkOnlineHandler&&typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("online",this.networkOnlineHandler),this.networkOnlineHandler=null,this._logVerbose("network online event listener removed"))}assembleTransition(t){if(t.partNumber<0||t.partNumber>=t.totalParts||t.totalParts===0||this.transitionChunkBuffer&&(this.transitionChunkBuffer.totalParts!==t.totalParts||this.transitionChunkBuffer.transitionId!==t.transitionId))throw this.transitionChunkBuffer=null,new Error("Invalid TransitionChunk");if(this.transitionChunkBuffer===null&&(this.transitionChunkBuffer={chunks:[],totalParts:t.totalParts,transitionId:t.transitionId}),t.partNumber!==this.transitionChunkBuffer.chunks.length){const n=this.transitionChunkBuffer.chunks.length;throw this.transitionChunkBuffer=null,new Error(`TransitionChunk received out of order: expected part ${n}, got ${t.partNumber}`)}if(this.transitionChunkBuffer.chunks.push(t.chunk),this.transitionChunkBuffer.chunks.length===t.totalParts){const n=this.transitionChunkBuffer.chunks.join("");this.transitionChunkBuffer=null;const r=$1(JSON.parse(n));if(r.type!=="Transition")throw new Error(`Expected Transition, got ${r.type} after assembling chunks`);return r}return null}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const t=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:t,paused:"no"}),this.resetServerInactivityTimeout(),t.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");if(this.setSocketState({state:"ready",ws:t,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Gi()})),this.lastCloseReason!=="InitialConnect"&&(this.lastCloseReason?this.logger.log("WebSocket reconnected at",F1(),"after disconnect due to",this.lastCloseReason):this.logger.log("WebSocket reconnected at",F1())),this.connectionCount+=1,this.lastCloseReason=null,this.pendingNetworkRecoveryInfo!==null){const{timeSavedMs:n}=this.pendingNetworkRecoveryInfo;this.pendingNetworkRecoveryInfo=null,this.sendMessage({type:"Event",eventType:"NetworkRecoveryReconnect",event:{timeSavedMs:n}}),this.logger.log(`Network recovery reconnect saved ~${Math.round(n/1e3)}s of waiting`)}},t.onerror=n=>{this.transitionChunkBuffer=null;const r=n.message;r&&this.logger.log(`WebSocket error message: ${r}`)},t.onmessage=n=>{this.resetServerInactivityTimeout();const r=n.data.length;let o=$1(JSON.parse(n.data));if(this._logVerbose(`received ws message with type ${o.type}`),o.type==="Ping")return;if(o.type==="TransitionChunk"){const u=this.assembleTransition(o);if(!u)return;o=u,this._logVerbose(`assembled full ws message of type ${o.type}`)}this.transitionChunkBuffer!==null&&(this.transitionChunkBuffer=null,this.logger.log(`Received unexpected ${o.type} while buffering TransitionChunks`)),o.type==="Transition"&&this.reportLargeTransition({messageLength:r,transition:o}),this.onMessage(o).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},t.onclose=n=>{if(this._logVerbose("begin ws.onclose"),this.transitionChunkBuffer=null,this.lastCloseReason===null&&(this.lastCloseReason=n.reason||`closed with code ${n.code}`),n.code!==VD&&n.code!==HD&&n.code!==YD&&n.code!==WD){let o=`WebSocket closed with code ${n.code}`;n.reason&&(o+=`: ${n.reason}`),this.logger.log(o),this.onServerDisconnectError&&n.reason&&this.onServerDisconnectError(o)}const r=GD(n.reason);this.scheduleReconnect(r)}}socketState(){return this.socket.state}sendMessage(t){const n={type:t.type,...t.type==="Authenticate"&&t.tokenType==="User"?{value:`...${t.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const r=BD(t),o=JSON.stringify(r);let l=!1;try{this.socket.ws.send(o),l=!0}catch(u){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${u}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`${l?"sent":"failed to send"} message with type ${t.type}: ${JSON.stringify(n)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(n)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(t){this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.socket={state:"disconnected"};const n=this.nextBackoff(t);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${Math.round(n)}ms`);const r=Gi(),o=setTimeout(()=>{this.scheduledReconnect?.timeout===o&&(this.scheduledReconnect=null,this.connect())},n);this.scheduledReconnect={timeout:o,scheduledAt:r,backoffMs:n}}closeAndReconnect(t){switch(this._logVerbose(`begin closeAndReconnect with reason ${t}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=t,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.transitionChunkBuffer=null,this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const t=this.socket.ws;return t.onmessage=n=>{this._logVerbose("Ignoring message received after close")},new Promise(n=>{t.onclose=()=>{this._logVerbose("Closed after connecting"),n()},t.onopen=()=>{this._logVerbose("Opened after connecting"),t.close()}})}case"ready":{this._logVerbose("ws.close called");const t=this.socket.ws;t.onmessage=r=>{this._logVerbose("Ignoring message received after close")};const n=new Promise(r=>{t.onclose=()=>{r()}});return t.close(),n}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.scheduledReconnect&&(clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null),this.cleanupNetworkListener(),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const t=this.close();return this.setSocketState({state:"terminated"}),t}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{this.cleanupNetworkListener();const t=this.close();return this.socket={state:"stopped"},t}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.setupNetworkListener(),this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}tryReconnectImmediately(){if(this._logVerbose("tryReconnectImmediately called"),this.socket.state!=="disconnected"){this._logVerbose(`tryReconnectImmediately called but socket state is ${this.socket.state}, no action taken`);return}let t=null;if(this.scheduledReconnect){const n=Gi()-this.scheduledReconnect.scheduledAt;t=Math.max(0,this.scheduledReconnect.backoffMs-n),this._logVerbose(`would have waited ${Math.round(t)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(n)}ms)`),clearTimeout(this.scheduledReconnect.timeout),this.scheduledReconnect=null,this._logVerbose("canceled scheduled reconnect")}this.logger.log("Network recovery detected, reconnecting immediately"),this.pendingNetworkRecoveryInfo=t!==null?{timeSavedMs:t}:null,this.connect()}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason,clientTs:Gi()})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(t){this.logger.logVerbose(t)}nextBackoff(t){const r=(t==="client"?100:t==="Unknown"?this.defaultInitialBackoff:MN[t].timeout)*Math.pow(2,this.retries);this.retries+=1;const o=Math.min(r,this.maxBackoff),l=o*(Math.random()-.5);return o+l}reportLargeTransition({transition:t,messageLength:n}){if(t.clientClockSkew===void 0||t.serverTs===void 0)return;const r=Gi()-t.clientClockSkew-t.serverTs/1e6,o=`${Math.round(r)}ms`,l=`${Math.round(n/1e4)/100}MB`,u=n/(r/1e3),d=`${Math.round(u/1e4)/100}MB per second`;this._logVerbose(`received ${l} transition in ${o} at ${d}`),n>2e7?this.logger.log(`received query results totaling more that 20MB (${l}) which will take a long time to download on slower connections`):r>2e4&&this.logger.log(`received query results totaling ${l} which took more than 20s to arrive (${o})`),this.debug&&this.sendMessage({type:"Event",eventType:"ClientReceivedTransition",event:{transitionTransitTime:r,messageLength:n}})}}function QD(){return KD()}function KD(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}let Gc=class extends Error{};Gc.prototype.name="InvalidTokenError";function XD(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function JD(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return XD(t)}catch{return atob(t)}}function RN(e,t){if(typeof e!="string")throw new Gc("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Gc(`Invalid token specified: missing part #${n+1}`);let o;try{o=JD(r)}catch(l){throw new Gc(`Invalid token specified: invalid base64 for part #${n+1} (${l.message})`)}try{return JSON.parse(o)}catch(l){throw new Gc(`Invalid token specified: invalid json for part #${n+1} (${l.message})`)}}var ez=Object.defineProperty,tz=(e,t,n)=>t in e?ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zr=(e,t,n)=>tz(e,typeof t!="symbol"?t+"":t,n);const nz=480*60*60*1e3,B1=2;class rz{constructor(t,n,r){zr(this,"authState",{state:"noAuth"}),zr(this,"configVersion",0),zr(this,"syncState"),zr(this,"authenticate"),zr(this,"stopSocket"),zr(this,"tryRestartSocket"),zr(this,"pauseSocket"),zr(this,"resumeSocket"),zr(this,"clearAuth"),zr(this,"logger"),zr(this,"refreshTokenLeewaySeconds"),zr(this,"tokenConfirmationAttempts",0),this.syncState=t,this.authenticate=n.authenticate,this.stopSocket=n.stopSocket,this.tryRestartSocket=n.tryRestartSocket,this.pauseSocket=n.pauseSocket,this.resumeSocket=n.resumeSocket,this.clearAuth=n.clearAuth,this.logger=r.logger,this.refreshTokenLeewaySeconds=r.refreshTokenLeewaySeconds}async setConfig(t,n){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const r=await this.fetchTokenAndGuardAgainstRace(t,{forceRefreshToken:!1});r.isFromOutdatedConfig||(r.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:t,onAuthChange:n},hasRetried:!1}),this.authenticate(r.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:t,onAuthChange:n}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(t){if(this.syncState.isCurrentOrNewerAuthVersion(t.endVersion.identity)&&!(t.endVersion.identity<=t.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(t){if(t.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:n}=t;if(!this.syncState.isCurrentOrNewerAuthVersion(n+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(t)}async tryToReauthenticate(t){if(this._logVerbose(`attempting to reauthenticate: ${t.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=B1){this.logger.error(`Failed to authenticate: "${t.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${B1-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const n=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});n.isFromOutdatedConfig||(n.value&&this.syncState.isNewAuth(n.value)?(this.authenticate(n.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:n.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const t=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});t.isFromOutdatedConfig||(t.value?this.syncState.isNewAuth(t.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:t.value,config:this.authState.config}),this.authenticate(t.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(t){if(this.authState.state==="noAuth")return;const n=this.decodeToken(t);if(!n){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:r,exp:o}=n;if(!r||!o){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const l=o-r;if(l<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let u=Math.min(nz,(l-this.refreshTokenLeewaySeconds)*1e3);u<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${l}s`),u=0);const d=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},u);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:d,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${u}ms`)}async fetchTokenAndGuardAgainstRace(t,n){const r=++this.configVersion;this._logVerbose(`fetching token with config version ${r}`);const o=await t(n);return this.configVersion!==r?(this._logVerbose(`stale config version, expected ${r}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:o}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(t){t(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(t){const n=t.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:t.hadAuth,state:t.state,token:`...${t.token.slice(-7)}`}:{state:t.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(n)}`),t.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=t}decodeToken(t){try{return RN(t)}catch(n){return this._logVerbose(`Error decoding token: ${n instanceof Error?n.message:"Unknown error"}`),null}}_logVerbose(t){this.logger.logVerbose(`${t} [v${this.configVersion}]`)}}const sz=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function az(e,t){const n={sessionId:t};typeof performance>"u"||!performance.mark||performance.mark(e,{detail:n})}function oz(e){let t=e.name.slice(6);return t=t.charAt(0).toLowerCase()+t.slice(1),{name:t,startTime:e.startTime}}function iz(e){if(typeof performance>"u"||!performance.getEntriesByName)return[];const t=[];for(const n of sz){const r=performance.getEntriesByName(n).filter(o=>o.entryType==="mark").filter(o=>o.detail.sessionId===e);t.push(...r)}return t.map(oz)}var lz=Object.defineProperty,cz=(e,t,n)=>t in e?lz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ln=(e,t,n)=>cz(e,typeof t!="symbol"?t+"":t,n);class uz{constructor(t,n,r){if(ln(this,"address"),ln(this,"state"),ln(this,"requestManager"),ln(this,"webSocketManager"),ln(this,"authenticationManager"),ln(this,"remoteQuerySet"),ln(this,"optimisticQueryResults"),ln(this,"_transitionHandlerCounter",0),ln(this,"_nextRequestId"),ln(this,"_onTransitionFns",new Map),ln(this,"_sessionId"),ln(this,"firstMessageReceived",!1),ln(this,"debug"),ln(this,"logger"),ln(this,"maxObservedTimestamp"),ln(this,"connectionStateSubscribers",new Map),ln(this,"nextConnectionStateSubscriberId",0),ln(this,"_lastPublishedConnectionState"),ln(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const w=this.connectionState();if(JSON.stringify(w)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=w;for(const S of this.connectionStateSubscribers.values())S(w)}})}),ln(this,"mark",w=>{this.debug&&az(w,this.sessionId)}),typeof t=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");r?.skipConvexDeploymentUrlCheck!==!0&&aD(t),r={...r};const o=r.authRefreshTokenLeewaySeconds??2;let l=r.webSocketConstructor;if(!l&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");l=l||WebSocket,this.debug=r.reportDebugInfoToConvex??!1,this.address=t,this.logger=r.logger===!1?_N({verbose:r.verbose??!1}):r.logger!==!0&&r.logger?r.logger:kN({verbose:r.verbose??!1});const u=t.search("://");if(u===-1)throw new Error("Provided address was not an absolute URL.");const d=t.substring(u+3),h=t.substring(0,u);let m;if(h==="http")m="ws";else if(h==="https")m="wss";else throw new Error(`Unknown parent protocol ${h}`);const v=`${m}://${d}/api/${O1}/sync`;this.state=new jD,this.remoteQuerySet=new I1(w=>this.state.queryPath(w),this.logger),this.requestManager=new kD(this.logger,this.markConnectionStateDirty);const g=()=>{this.webSocketManager.pause(),this.state.pause()};this.authenticationManager=new rz(this.state,{authenticate:w=>{const S=this.state.setAuth(w);return this.webSocketManager.sendMessage(S),S.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:g,resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:o}),this.optimisticQueryResults=new OD,this.addOnTransitionHandler(w=>{n(w.queries.map(S=>S.token))}),this._nextRequestId=0,this._sessionId=QD();const{unsavedChangesWarning:y}=r;if(typeof window>"u"||typeof window.addEventListener>"u"){if(y===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else y!==!1&&window.addEventListener("beforeunload",w=>{if(this.requestManager.hasIncompleteRequests()){w.preventDefault();const S="Are you sure you want to leave? Your changes may not be saved.";return(w||window.event).returnValue=S,S}});this.webSocketManager=new ZD(v,{onOpen:w=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...w,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const S=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new I1(C=>this.state.queryPath(C),this.logger);const[j,N]=this.state.restart(S);N&&this.webSocketManager.sendMessage(N),this.webSocketManager.sendMessage(j);for(const C of this.requestManager.restart())this.webSocketManager.sendMessage(C)},onResume:()=>{const[w,S]=this.state.resume();S&&this.webSocketManager.sendMessage(S),w&&this.webSocketManager.sendMessage(w);for(const j of this.requestManager.resume())this.webSocketManager.sendMessage(j)},onMessage:w=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),w.type){case"Transition":{this.observedTimestamp(w.endVersion.ts),this.authenticationManager.onTransition(w),this.remoteQuerySet.transition(w),this.state.transition(w);const S=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(S);break}case"MutationResponse":{w.success&&this.observedTimestamp(w.ts);const S=this.requestManager.onResponse(w);S!==null&&this.notifyOnQueryResultChanges(new Map([[S.requestId,S.result]]));break}case"ActionResponse":{this.requestManager.onResponse(w);break}case"AuthError":{this.authenticationManager.onAuthError(w);break}case"FatalError":{const S=bD(this.logger,w.error);throw this.webSocketManager.terminate(),S}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:r.onServerDisconnectError},l,this.logger,this.markConnectionStateDirty,this.debug),this.mark("convexClientConstructed"),r.expectAuth&&g()}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(t){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(t))&&(this.maxObservedTimestamp=t)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(t){const n=this.remoteQuerySet.remoteQueryResults(),r=new Map;for(const[l,u]of n){const d=this.state.queryToken(l);if(d!==null){const h={result:u,udfPath:this.state.queryPath(l),args:this.state.queryArgs(l)};r.set(d,h)}}const o=this.optimisticQueryResults.ingestQueryResultsFromServer(r,new Set(t.keys()));this.handleTransition({queries:o.map(l=>{const u=this.optimisticQueryResults.rawQueryResult(l);return{token:l,modification:{kind:"Updated",result:u}}}),reflectedMutations:Array.from(t).map(([l,u])=>({requestId:l,result:u})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(t){for(const n of this._onTransitionFns.values())n(t)}addOnTransitionHandler(t){const n=this._transitionHandlerCounter++;return this._onTransitionFns.set(n,t),()=>this._onTransitionFns.delete(n)}getCurrentAuthClaims(){const t=this.state.getAuth();let n={};if(t&&t.tokenType==="User")try{n=t?RN(t.value):{}}catch{n={}}else return;return{token:t.value,decoded:n}}setAuth(t,n){this.authenticationManager.setConfig(t,n)}hasAuth(){return this.state.hasAuth()}setAdminAuth(t,n){const r=this.state.setAdminAuth(t,n);this.webSocketManager.sendMessage(r)}clearAuth(){const t=this.state.clearAuth();this.webSocketManager.sendMessage(t)}subscribe(t,n,r){const o=na(n),{modification:l,queryToken:u,unsubscribe:d}=this.state.subscribe(t,o,r?.journal,r?.componentPath);return l!==null&&this.webSocketManager.sendMessage(l),{queryToken:u,unsubscribe:()=>{const h=d();h&&this.webSocketManager.sendMessage(h)}}}localQueryResult(t,n){const r=na(n),o=Oo(t,r);return this.optimisticQueryResults.queryResult(o)}localQueryResultByToken(t){return this.optimisticQueryResults.queryResult(t)}hasLocalQueryResultByToken(t){return this.optimisticQueryResults.hasQueryResult(t)}localQueryLogs(t,n){const r=na(n),o=Oo(t,r);return this.optimisticQueryResults.queryLogs(o)}queryJournal(t,n){const r=na(n),o=Oo(t,r);return this.state.queryJournal(o)}connectionState(){const t=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:t.isConnected,hasEverConnected:t.hasEverConnected,connectionCount:t.connectionCount,connectionRetries:t.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(t){const n=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(n,t),()=>{this.connectionStateSubscribers.delete(n)}}async mutation(t,n,r){const o=await this.mutationInternal(t,n,r);if(!o.success)throw o.errorData!==void 0?Xv(o,new Kv(Ji("mutation",t,o))):new Error(Ji("mutation",t,o));return o.value}async mutationInternal(t,n,r,o){const{mutationPromise:l}=this.enqueueMutation(t,n,r,o);return l}enqueueMutation(t,n,r,o){const l=na(n);this.tryReportLongDisconnect();const u=this.nextRequestId;if(this._nextRequestId++,r!==void 0){const v=r.optimisticUpdate;if(v!==void 0){const g=S=>{v(S,l)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},w=this.optimisticQueryResults.applyOptimisticUpdate(g,u).map(S=>{const j=this.localQueryResultByToken(S);return{token:S,modification:{kind:"Updated",result:j===void 0?void 0:{success:!0,value:j,logLines:[]}}}});this.handleTransition({queries:w,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const d={type:"Mutation",requestId:u,udfPath:t,componentPath:o,args:[ks(l)]},h=this.webSocketManager.sendMessage(d),m=this.requestManager.request(d,h);return{requestId:u,mutationPromise:m}}async action(t,n){const r=await this.actionInternal(t,n);if(!r.success)throw r.errorData!==void 0?Xv(r,new Kv(Ji("action",t,r))):new Error(Ji("action",t,r));return r.value}async actionInternal(t,n,r){const o=na(n),l=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const u={type:"Action",requestId:l,udfPath:t,componentPath:r,args:[ks(o)]},d=this.webSocketManager.sendMessage(u);return this.requestManager.request(u,d)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const t=iz(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:t})}}tryReportLongDisconnect(){if(!this.debug)return;const t=this.connectionState().timeOfOldestInflightRequest;if(t===null||Date.now()-t.getTime()<=60*1e3)return;const n=`${this.address}/api/debug_event`;fetch(n,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${O1}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(r=>{r.ok||this.logger.warn("Analytics request failed with response:",r.body)}).catch(r=>{this.logger.warn("Analytics response failed with error:",r)})}}function Wg(e){if(typeof e!="object"||e===null||!Array.isArray(e.page)||typeof e.isDone!="boolean"||typeof e.continueCursor!="string")throw new Error(`Not a valid paginated query result: ${e?.toString()}`);return e}var dz=Object.defineProperty,fz=(e,t,n)=>t in e?dz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U1=(e,t,n)=>fz(e,typeof t!="symbol"?t+"":t,n);class hz{constructor(t,n){this.client=t,this.onTransition=n,U1(this,"paginatedQuerySet",new Map),U1(this,"lastTransitionTs"),this.lastTransitionTs=Lu.fromNumber(0),this.client.addOnTransitionHandler(r=>this.onBaseTransition(r))}subscribe(t,n,r){const o=Lo(t),l=z1(o,n,r),u=()=>this.removePaginatedQuerySubscriber(l),d=this.paginatedQuerySet.get(l);return d?(d.numSubscribers+=1,{paginatedQueryToken:l,unsubscribe:u}):(this.paginatedQuerySet.set(l,{token:l,canonicalizedUdfPath:o,args:n,numSubscribers:1,options:{initialNumItems:r.initialNumItems},nextPageKey:0,pageKeys:[],pageKeyToQuery:new Map,ongoingSplits:new Map,skip:!1,id:r.id}),this.addPageToPaginatedQuery(l,null,r.initialNumItems),{paginatedQueryToken:l,unsubscribe:u})}localQueryResult(t,n,r){const o=Lo(t),l=z1(o,n,r);return this.localQueryResultByToken(l)}localQueryResultByToken(t){const n=this.paginatedQuerySet.get(t);if(!n)return;const r=this.activePageQueryTokens(n);if(r.length===0)return{results:[],status:"LoadingFirstPage",loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)};let o=[],l=!1,u=!1;for(const h of r){const m=this.client.localQueryResultByToken(h);if(m===void 0){l=!0,u=!1;continue}const v=Wg(m);o=o.concat(v.page),u=!!v.isDone}let d;return l?d=o.length===0?"LoadingFirstPage":"LoadingMore":u?d="Exhausted":d="CanLoadMore",{results:o,status:d,loadMore:h=>this.loadMoreOfPaginatedQuery(t,h)}}onBaseTransition(t){const n=t.queries.map(u=>u.token),r=this.queriesContainingTokens(n);let o=[];r.length>0&&(this.processPaginatedQuerySplits(r,u=>this.client.localQueryResultByToken(u)),o=r.map(u=>({token:u,modification:{kind:"Updated",result:this.localQueryResultByToken(u)}})));const l={...t,paginatedQueries:o};this.onTransition(l)}loadMoreOfPaginatedQuery(t,n){this.mustGetPaginatedQuery(t);const r=this.queryTokenForLastPageOfPaginatedQuery(t),o=this.client.localQueryResultByToken(r);if(!o)return!1;const l=Wg(o);if(l.isDone)return!1;this.addPageToPaginatedQuery(t,l.continueCursor,n);const u={timestamp:this.lastTransitionTs,reflectedMutations:[],queries:[],paginatedQueries:[{token:t,modification:{kind:"Updated",result:this.localQueryResultByToken(t)}}]};return this.onTransition(u),!0}queriesContainingTokens(t){if(t.length===0)return[];const n=[],r=new Set(t);for(const[o,l]of this.paginatedQuerySet)for(const u of this.allQueryTokens(l))if(r.has(u)){n.push(o);break}return n}processPaginatedQuerySplits(t,n){for(const r of t){const o=this.mustGetPaginatedQuery(r),{ongoingSplits:l,pageKeyToQuery:u,pageKeys:d}=o;for(const[h,[m,v]]of l)n(u.get(m).queryToken)!==void 0&&n(u.get(v).queryToken)!==void 0&&this.completePaginatedQuerySplit(o,h,m,v);for(const h of d){if(l.has(h))continue;const m=u.get(h).queryToken,v=n(m);if(!v)continue;const g=Wg(v);g.splitCursor&&(g.pageStatus==="SplitRecommended"||g.pageStatus==="SplitRequired"||g.page.length>o.options.initialNumItems*2)&&this.splitPaginatedQueryPage(o,h,g.splitCursor,g.continueCursor)}}}splitPaginatedQueryPage(t,n,r,o){const l=t.nextPageKey++,u=t.nextPageKey++,d={cursor:o,numItems:t.options.initialNumItems,id:t.id},h=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:null,endCursor:r}});t.pageKeyToQuery.set(l,h);const m=this.client.subscribe(t.canonicalizedUdfPath,{...t.args,paginationOpts:{...d,cursor:r,endCursor:o}});t.pageKeyToQuery.set(u,m),t.ongoingSplits.set(n,[l,u])}addPageToPaginatedQuery(t,n,r){const o=this.mustGetPaginatedQuery(t),l=o.nextPageKey++,u={cursor:n,numItems:r,id:o.id},d={...o.args,paginationOpts:u},h=this.client.subscribe(o.canonicalizedUdfPath,d);return o.pageKeys.push(l),o.pageKeyToQuery.set(l,h),h}removePaginatedQuerySubscriber(t){const n=this.paginatedQuerySet.get(t);if(n&&(n.numSubscribers-=1,!(n.numSubscribers>0))){for(const r of n.pageKeyToQuery.values())r.unsubscribe();this.paginatedQuerySet.delete(t)}}completePaginatedQuerySplit(t,n,r,o){const l=t.pageKeyToQuery.get(n);t.pageKeyToQuery.delete(n);const u=t.pageKeys.indexOf(n);t.pageKeys.splice(u,1,r,o),t.ongoingSplits.delete(n),l.unsubscribe()}activePageQueryTokens(t){return t.pageKeys.map(n=>t.pageKeyToQuery.get(n).queryToken)}allQueryTokens(t){return Array.from(t.pageKeyToQuery.values()).map(n=>n.queryToken)}queryTokenForLastPageOfPaginatedQuery(t){const n=this.mustGetPaginatedQuery(t),r=n.pageKeys[n.pageKeys.length-1];if(r===void 0)throw new Error(`No pages for paginated query ${t}`);return n.pageKeyToQuery.get(r).queryToken}mustGetPaginatedQuery(t){const n=this.paginatedQuerySet.get(t);if(!n)throw new Error("paginated query no longer exists for token "+t);return n}}function mz({getCurrentValue:e,subscribe:t}){const[n,r]=p.useState(()=>({getCurrentValue:e,subscribe:t,value:e()}));let o=n.value;return(n.getCurrentValue!==e||n.subscribe!==t)&&(o=e(),r({getCurrentValue:e,subscribe:t,value:o})),p.useEffect(()=>{let l=!1;const u=()=>{l||r(h=>{if(h.getCurrentValue!==e||h.subscribe!==t)return h;const m=e();return h.value===m?h:{...h,value:m}})},d=t(u);return u(),()=>{l=!0,d()}},[e,t]),o}var pz=Object.defineProperty,gz=(e,t,n)=>t in e?pz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xs=(e,t,n)=>gz(e,typeof t!="symbol"?t+"":t,n);const vz=5e3;if(typeof ee>"u")throw new Error("Required dependency 'react' not found");function AN(e,t,n){function r(o){return wz(o),t.mutation(e,o,{optimisticUpdate:n})}return r.withOptimisticUpdate=function(l){if(n!==void 0)throw new Error(`Already specified optimistic update for mutation ${tr(e)}`);return AN(e,t,l)},r}class xz{constructor(t,n){if(Xs(this,"address"),Xs(this,"cachedSync"),Xs(this,"cachedPaginatedQueryClient"),Xs(this,"listeners"),Xs(this,"options"),Xs(this,"closed",!1),Xs(this,"_logger"),Xs(this,"adminAuth"),Xs(this,"fakeUserIdentity"),t===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof t!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof t} instead.`);if(!t.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=t,this.listeners=new Map,this._logger=n?.logger===!1?_N({verbose:n?.verbose??!1}):n?.logger!==!0&&n?.logger?n.logger:kN({verbose:n?.verbose??!1}),this.options={...n,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new uz(this.address,()=>{},this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedPaginatedQueryClient=new hz(this.cachedSync,t=>this.handleTransition(t)),this.cachedSync)}get paginatedQueryClient(){if(this.sync,this.cachedPaginatedQueryClient)return this.cachedPaginatedQueryClient;throw new Error("Should already be instantiated")}setAuth(t,n){if(typeof t=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(t,n??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(t,n){if(this.adminAuth=t,this.fakeUserIdentity=n,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(t,n)}watchQuery(t,...n){const[r,o]=n,l=tr(t);return{onUpdate:u=>{const{queryToken:d,unsubscribe:h}=this.sync.subscribe(l,r,o),m=this.listeners.get(d);return m!==void 0?m.add(u):this.listeners.set(d,new Set([u])),()=>{if(this.closed)return;const v=this.listeners.get(d);v.delete(u),v.size===0&&this.listeners.delete(d),h()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(l,r)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(l,r)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(l,r)}}}prewarmQuery(t){const n=t.extendSubscriptionFor??vz,o=this.watchQuery(t.query,t.args||{}).onUpdate(()=>{});setTimeout(o,n)}watchPaginatedQuery(t,n,r){const o=tr(t);return{onUpdate:l=>{const{paginatedQueryToken:u,unsubscribe:d}=this.paginatedQueryClient.subscribe(o,n||{},r),h=this.listeners.get(u);return h!==void 0?h.add(l):this.listeners.set(u,new Set([l])),()=>{if(this.closed)return;const m=this.listeners.get(u);m.delete(l),m.size===0&&this.listeners.delete(u),d()}},localQueryResult:()=>this.paginatedQueryClient.localQueryResult(o,n,r)}}mutation(t,...n){const[r,o]=n,l=tr(t);return this.sync.mutation(l,r,o)}action(t,...n){const r=tr(t);return this.sync.action(r,...n)}query(t,...n){const r=this.watchQuery(t,...n),o=r.localQueryResult();return o!==void 0?Promise.resolve(o):new Promise((l,u)=>{const d=r.onUpdate(()=>{d();try{l(r.localQueryResult())}catch(h){u(h)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(t){return this.sync.subscribeToConnectionState(t)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedPaginatedQueryClient&&(this.cachedPaginatedQueryClient=void 0),this.cachedSync){const t=this.cachedSync;this.cachedSync=void 0,await t.close()}}handleTransition(t){const n=t.queries.map(o=>o.token),r=t.paginatedQueries.map(o=>o.token);this.transition([...n,...r])}transition(t){for(const n of t){const r=this.listeners.get(n);if(r)for(const o of r)o()}}}const Dx=ee.createContext(void 0);function yz(){return p.useContext(Dx)}const bz=({client:e,children:t})=>ee.createElement(Dx.Provider,{value:e},t);function He(e,...t){const n=t[0]==="skip",r=t[0]==="skip"?{}:na(t[0]),o=typeof e=="string"?EN(e):e,l=tr(o),u=p.useMemo(()=>n?{}:{query:{query:o,args:r}},[JSON.stringify(ks(r)),l,n]),h=Nz(u).query;if(h instanceof Error)throw h;return h}function et(e){const t=typeof e=="string"?EN(e):e,n=p.useContext(Dx);if(n===void 0)throw new Error("Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return p.useMemo(()=>AN(t,n),[n,tr(t)])}function wz(e){if(typeof e=="object"&&e!==null&&"bubbles"in e&&"persist"in e&&"isDefaultPrevented"in e)throw new Error("Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler.")}var Sz=Object.defineProperty,jz=(e,t,n)=>t in e?Sz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gg=(e,t,n)=>jz(e,typeof t!="symbol"?t+"":t,n);class Cz{constructor(t){Gg(this,"createWatch"),Gg(this,"queries"),Gg(this,"listeners"),this.createWatch=t,this.queries={},this.listeners=new Set}setQueries(t){for(const n of Object.keys(t)){const{query:r,args:o,paginationOptions:l}=t[n];if(tr(r),this.queries[n]===void 0)this.addQuery(n,r,o,l?{paginationOptions:l}:{});else{const u=this.queries[n];(tr(r)!==tr(u.query)||JSON.stringify(ks(o))!==JSON.stringify(ks(u.args))||JSON.stringify(l)!==JSON.stringify(u.paginationOptions))&&(this.removeQuery(n),this.addQuery(n,r,o,l?{paginationOptions:l}:{}))}}for(const n of Object.keys(this.queries))t[n]===void 0&&this.removeQuery(n)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getLocalResults(t){const n={};for(const r of Object.keys(t)){const{query:o,args:l}=t[r],u=t[r].paginationOptions;tr(o);const d=this.createWatch(o,l,u?{paginationOptions:u}:{});let h;try{h=d.localQueryResult()}catch(m){if(m instanceof Error)h=m;else throw m}n[r]=h}return n}setCreateWatch(t){this.createWatch=t;for(const n of Object.keys(this.queries)){const{query:r,args:o,watch:l,paginationOptions:u}=this.queries[n],d="journal"in l?l.journal():void 0;this.removeQuery(n),this.addQuery(n,r,o,{...d?{journal:d}:[],...u?{paginationOptions:u}:{}})}}destroy(){for(const t of Object.keys(this.queries))this.removeQuery(t);this.listeners=new Set}addQuery(t,n,r,{paginationOptions:o,journal:l}){if(this.queries[t]!==void 0)throw new Error(`Tried to add a new query with identifier ${t} when it already exists.`);const u=this.createWatch(n,r,{...l?{journal:l}:[],...o?{paginationOptions:o}:{}}),d=u.onUpdate(()=>this.notifyListeners());this.queries[t]={query:n,args:r,watch:u,unsubscribe:d,...o?{paginationOptions:o}:{}}}removeQuery(t){const n=this.queries[t];if(n===void 0)throw new Error(`No query found with identifier ${t}.`);n.unsubscribe(),delete this.queries[t]}notifyListeners(){for(const t of this.listeners)t()}}function Nz(e){const t=yz();if(t===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const n=p.useMemo(()=>(r,o,{journal:l,paginationOptions:u})=>u?t.watchPaginatedQuery(r,o,u):t.watchQuery(r,o,l?{journal:l}:{}),[t]);return kz(e,n)}function kz(e,t){const[n]=p.useState(()=>new Cz(t));n.createWatch!==t&&n.setCreateWatch(t),p.useEffect(()=>()=>n.destroy(),[n]);const r=p.useMemo(()=>({getCurrentValue:()=>n.getLocalResults(e),subscribe:o=>(n.setQueries(e),n.subscribe(o))}),[n,e]);return mz(r)}const Jv=new WeakMap,_z=new WeakMap,Jf={current:[]};let Zg=!1,au=0;const Zc=new Set,wf=new Map;function ON(e){for(const t of e){if(Jf.current.includes(t))continue;Jf.current.push(t),t.recompute();const n=_z.get(t);if(n)for(const r of n){const o=Jv.get(r);o?.length&&ON(o)}}}function Ez(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Tz(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function DN(e){if(au>0&&!wf.has(e)&&wf.set(e,e.prevState),Zc.add(e),!(au>0)&&!Zg)try{for(Zg=!0;Zc.size>0;){const t=Array.from(Zc);Zc.clear();for(const n of t){const r=wf.get(n)??n.prevState;n.prevState=r,Ez(n)}for(const n of t){const r=Jv.get(n);r&&(Jf.current.push(n),ON(r))}for(const n of t){const r=Jv.get(n);if(r)for(const o of r)Tz(o)}}}finally{Zg=!1,Jf.current=[],wf.clear()}}function Mz(e){au++;try{e()}finally{if(au--,au===0){const t=Zc.values().next().value;t&&DN(t)}}}function Rz(e){return typeof e=="function"}class Az{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,l;this.listeners.add(r);const u=(l=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:l.call(o,r,this);return()=>{this.listeners.delete(r),u?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):Rz(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),DN(this)}}const Ha="__TSR_index",q1="popstate",V1="beforeunload";function Oz(e){let t=e.getLocation();const n=new Set,r=u=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?r(u):t=e.getLocation()},l=async({task:u,navigateOpts:d,...h})=>{if(d?.ignoreBlocker??!1){u();return}const v=e.getBlockers?.()??[],g=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&v.length&&g)for(const y of v){const w=eh(h.path,h.state);if(await y.blockerFn({currentLocation:t,nextLocation:w,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,d,h)=>{const m=t.state[Ha];d=H1(m+1,d),l({task:()=>{e.pushState(u,d),r({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:d})},replace:(u,d,h)=>{const m=t.state[Ha];d=H1(m,d),l({task:()=>{e.replaceState(u,d),r({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:d})},go:(u,d)=>{l({task:()=>{e.go(u),o({type:"GO",index:u})},navigateOpts:d,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Ha]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const d=e.getBlockers?.()??[];return e.setBlockers([...d,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(m=>m!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function H1(e,t){t||(t={});const n=zx();return{...t,key:n,__TSR_key:n,[Ha]:e}}function Dz(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let o=[];const l=()=>o,u=O=>o=O,d=(O=>O),h=(()=>eh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=zx();t.history.replaceState({[Ha]:0,key:O,__TSR_key:O},"")}let m=h(),v,g=!1,y=!1,w=!1,S=!1;const j=()=>m;let N,C;const _=()=>{N&&(T._ignoreSubscribers=!0,(N.isPush?t.history.pushState:t.history.replaceState)(N.state,"",N.href),T._ignoreSubscribers=!1,N=void 0,C=void 0,v=void 0)},E=(O,D,z)=>{const B=d(D);C||(v=m),m=eh(D,z),N={href:B,state:z,isPush:N?.isPush||O==="push"},C||(C=Promise.resolve().then(()=>_()))},M=O=>{m=h(),T.notify({type:O})},A=async()=>{if(y){y=!1;return}const O=h(),D=O.state[Ha]-m.state[Ha],z=D===1,B=D===-1,V=!z&&!B||g;g=!1;const Y=V?"GO":B?"BACK":"FORWARD",G=V?{type:"GO",index:D}:{type:B?"BACK":"FORWARD"};if(w)w=!1;else{const ae=l();if(typeof document<"u"&&ae.length){for(const L of ae)if(await L.blockerFn({currentLocation:m,nextLocation:O,action:Y})){y=!0,t.history.go(1),T.notify(G);return}}}m=h(),T.notify(G)},R=O=>{if(S){S=!1;return}let D=!1;const z=l();if(typeof document<"u"&&z.length)for(const B of z){const V=B.enableBeforeUnload??!0;if(V===!0){D=!0;break}if(typeof V=="function"&&V()===!0){D=!0;break}}if(D)return O.preventDefault(),O.returnValue=""},T=Oz({getLocation:j,getLength:()=>t.history.length,pushState:(O,D)=>E("push",O,D),replaceState:(O,D)=>E("replace",O,D),back:O=>(O&&(w=!0),S=!0,t.history.back()),forward:O=>{O&&(w=!0),S=!0,t.history.forward()},go:O=>{g=!0,t.history.go(O)},createHref:O=>d(O),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(V1,R,{capture:!0}),t.removeEventListener(q1,A)},onBlocked:()=>{v&&m!==v&&(m=v)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(V1,R,{capture:!0}),t.addEventListener(q1,A),t.history.pushState=function(...O){const D=n.apply(t.history,O);return T._ignoreSubscribers||M("PUSH"),D},t.history.replaceState=function(...O){const D=r.apply(t.history,O);return T._ignoreSubscribers||M("REPLACE"),D},T}function zz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function eh(e,t){const n=zz(e),r=n.indexOf("#"),o=n.indexOf("?"),l=zx();return{href:n,pathname:n.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:n.length),hash:r>-1?n.substring(r):"",search:o>-1?n.slice(o,r===-1?void 0:r):"",state:t||{[Ha]:0,key:l,__TSR_key:l}}}function zx(){return(Math.random()+1).toString(36).substring(7)}const Pz=!1;function ou(e){let t;return Mz(()=>{t=e()}),t}function hu(e){return e[e.length-1]}function Lz(e){return typeof e=="function"}function qa(e,t){return Lz(e)?e(t):e}const Iz=Object.prototype.hasOwnProperty,Y1=Object.prototype.propertyIsEnumerable;function er(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=t,o=Z1(e)&&Z1(r);if(!o&&!(th(e)&&th(r)))return r;const l=o?e:W1(e);if(!l)return r;const u=o?r:W1(r);if(!u)return r;const d=l.length,h=u.length,m=o?new Array(h):{};let v=0;for(let g=0;g<h;g++){const y=o?g:u[g],w=e[y],S=r[y];if(w===S){m[y]=w,(o?g<d:Iz.call(e,y))&&v++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){m[y]=S;continue}const j=er(w,S,n+1);m[y]=j,j===w&&v++}return d===h&&v===d?e:m}function W1(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!Y1.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const o of n){if(!Y1.call(e,o))return!1;r.push(o)}return r}function th(e){if(!G1(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!G1(n)||!n.hasOwnProperty("isPrototypeOf"))}function G1(e){return Object.prototype.toString.call(e)==="[object Object]"}function Z1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Do(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,o=e.length;r<o;r++)if(!Do(e[r],t[r],n))return!1;return!0}if(th(e)&&th(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!r||t[u]!==void 0)&&!Do(e[u],t[u],n))return!1;return!0}let o=0;if(!r)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let l=0;for(const u in t)if((!r||t[u]!==void 0)&&(l++,l>o||!Do(e[u],t[u],n)))return!1;return o===l}return!1}function hl(e){let t,n;const r=new Promise((o,l)=>{t=o,n=l});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,t(o),e?.(o)},r.reject=o=>{r.status="rejected",n(o)},r}function sl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function $z(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Q1(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return $z(t)}const zN=["http:","https:","mailto:","tel:"];function nh(e){if(!e)return!1;try{const t=new URL(e);return!zN.includes(t.protocol)}catch{return!1}}function Lc(e,t){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const n=/%25|%5C/gi;let r=0,o="",l;for(;(l=n.exec(e))!==null;)o+=Q1(e.slice(r,l.index))+l[0],r=n.lastIndex;return o=o+Q1(r?e.slice(r):e),o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}function Fz(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Bz="Invariant failed";function da(e,t){if(!e)throw new Error(Bz)}function rh(e){const t=new Map;let n,r;const o=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,r&&(r.next=l,l.prev=r)):(l.next.prev=void 0,n=l.next,l.next=void 0,r&&(l.prev=r,r.next=l)),r=l)};return{get(l){const u=t.get(l);if(u)return o(u),u.value},set(l,u){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===r&&(r=void 0)}const d=t.get(l);if(d)d.value=u,o(d);else{const h={key:l,value:u,prev:r};r&&(r.next=h),r=h,n||(n=h),t.set(l,h)}},clear(){t.clear(),n=void 0,r=void 0}}}const ml=0,Io=1,$o=2,mu=3,To=4,PN=5;function Uz(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Px(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),o=r===-1?e.length:r,l=e.substring(t,o);if(!l||!l.includes("$"))return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(l==="$"){const d=e.length;return n[0]=$o,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(l.charCodeAt(0)===36)return n[0]=Io,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const u=Uz(l);if(u){const[d,h]=u,m=l.charCodeAt(d+1);if(m===45){if(d+2<l.length&&l.charCodeAt(d+2)===36){const v=d+3,g=h;if(v<g)return n[0]=mu,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=o,n}}else if(m===36){const v=d+1,g=d+2;return g===h?(n[0]=$o,n[1]=t+d,n[2]=t+v,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=Io,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+1,n[5]=o,n)}}return n[0]=ml,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function Ph(e,t,n,r,o,l,u){u?.(n);let d=r;{const h=n.fullPath??n.from,m=h.length,v=n.options?.caseSensitive??e,g=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;d<m;){const w=Px(h,d,t);let S;const j=d,N=w[5];switch(d=N+1,l++,w[0]){case ml:{const _=h.substring(w[2],w[3]);if(v){const E=o.static?.get(_);if(E)S=E;else{o.static??=new Map;const M=Mo(n.fullPath??n.from);M.parent=o,M.depth=l,S=M,o.static.set(_,M)}}else{const E=_.toLowerCase(),M=o.staticInsensitive?.get(E);if(M)S=M;else{o.staticInsensitive??=new Map;const A=Mo(n.fullPath??n.from);A.parent=o,A.depth=l,S=A,o.staticInsensitive.set(E,A)}}break}case Io:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=Kg(Io,n.fullPath??n.from,M,A,R);S=O,O.depth=l,O.parent=o,o.dynamic??=[],o.dynamic.push(O)}break}case mu:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=!g&&o.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===M&&O.prefix===A&&O.suffix===R);if(T)S=T;else{const O=Kg(mu,n.fullPath??n.from,M,A,R);S=O,O.parent=o,O.depth=l,o.optional??=[],o.optional.push(O)}break}case $o:{const _=h.substring(j,w[1]),E=h.substring(w[4],N),M=v&&!!(_||E),A=_?M?_:_.toLowerCase():void 0,R=E?M?E:E.toLowerCase():void 0,T=Kg($o,n.fullPath??n.from,M,A,R);S=T,T.parent=o,T.depth=l,o.wildcard??=[],o.wildcard.push(T)}}o=S}if(g&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const w=Mo(n.fullPath??n.from);w.kind=PN,w.parent=o,l++,w.depth=l,o.pathless??=[],o.pathless.push(w),o=w}const y=(n.path||!n.children)&&!n.isRoot;if(y&&h.endsWith("/")){const w=Mo(n.fullPath??n.from);w.kind=To,w.parent=o,l++,w.depth=l,o.index=w,o=w}o.parse=n.options?.params?.parse??null,o.skipOnParamError=g,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const h of n.children)Ph(e,t,h,d,o,l,u)}function Qg(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ua(e){if(e.pathless)for(const t of e.pathless)Ua(t);if(e.static)for(const t of e.static.values())Ua(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Ua(t);if(e.dynamic?.length){e.dynamic.sort(Qg);for(const t of e.dynamic)Ua(t)}if(e.optional?.length){e.optional.sort(Qg);for(const t of e.optional)Ua(t)}if(e.wildcard?.length){e.wildcard.sort(Qg);for(const t of e.wildcard)Ua(t)}}function Mo(e){return{kind:ml,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Kg(e,t,n,r,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:o}}function qz(e,t){const n=Mo("/"),r=new Uint16Array(6);for(const o of e)Ph(!1,r,o,1,n,0);Ua(n),t.masksTree=n,t.flatCache=rh(1e3)}function Vz(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=Lx(e,t.masksTree);return t.flatCache.set(e,r),r}function Hz(e,t,n,r,o){e||="/",r||="/";const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);if(!u){u=Mo("/");const d=new Uint16Array(6);Ph(t,d,{from:e},1,u,0),o.singleCache.set(l,u)}return Lx(r,u,n)}function Yz(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,o=t.matchCache.get(r);if(o!==void 0)return o;e||="/";let l;try{l=Lx(e,t.segmentTree,n)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=Zz(l.route)),t.matchCache.set(r,l),l}function Wz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Gz(e,t=!1,n){const r=Mo(e.fullPath),o=new Uint16Array(6),l={},u={};let d=0;return Ph(t,o,e,1,r,0,m=>{if(n?.(m,d),da(!(m.id in l),`Duplicate routes found with id: ${String(m.id)}`),l[m.id]=m,d!==0&&m.path){const v=Wz(m.fullPath);(!u[v]||m.fullPath.endsWith("/"))&&(u[v]=m)}d++}),Ua(r),{processedTree:{segmentTree:r,singleCache:rh(1e3),matchCache:rh(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Lx(e,t,n=!1){const r=e.split("/"),o=Kz(e,r,t,n);if(!o)return null;const[l]=LN(e,r,o);return{route:o.node.route,rawParams:l,parsedParams:o.parsedParams}}function LN(e,t,n){const r=Qz(n.node);let o=null;const l={};let u=n.extract?.part??0,d=n.extract?.node??0,h=n.extract?.path??0,m=n.extract?.segment??0;for(;d<r.length;u++,d++,h++,m++){const v=r[d];if(v.kind===To)break;if(v.kind===PN){m--,u--,h--;continue}const g=t[u],y=h;if(g&&(h+=g.length),v.kind===Io){o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0;if(w.charCodeAt(S)===123){const N=v.suffix?.length??0,C=w.substring(S+2,w.length-N-1),_=g.substring(S,g.length-N);l[C]=decodeURIComponent(_)}else{const N=w.substring(1);l[N]=decodeURIComponent(g)}}else if(v.kind===mu){if(n.skipped&1<<d){u--,h=y-1;continue}o??=n.node.fullPath.split("/");const w=o[m],S=v.prefix?.length??0,j=v.suffix?.length??0,N=w.substring(S+3,w.length-j-1),C=v.suffix||v.prefix?g.substring(S,g.length-j):g;C&&(l[N]=decodeURIComponent(C))}else if(v.kind===$o){const w=v,S=e.substring(y+(w.prefix?.length??0),e.length-(w.suffix?.length??0)),j=decodeURIComponent(S);l["*"]=j,l._splat=j;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:d,path:h,segment:m}]}function Zz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Qz(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Kz(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!hu(t),l=o&&e!=="/",u=t.length-(o?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,m=null,v=null;for(;d.length;){const g=d.pop(),{node:y,index:w,skipped:S,depth:j,statics:N,dynamics:C,optionals:_}=g;let{extract:E,rawParams:M,parsedParams:A}=g;if(y.skipOnParamError){if(!Xg(e,t,g))continue;M=g.rawParams,E=g.extract,A=g.parsedParams}r&&y.route&&y.kind!==To&&Ic(m,g)&&(m=g);const R=w===u;if(R&&(y.route&&!l&&Ic(v,g)&&(v=g),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const T=R?void 0:t[w];let O;if(R&&y.index){const D={node:y.index,index:w,skipped:S,depth:j+1,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};let z=!0;if(y.index.skipOnParamError&&(Xg(e,t,D)||(z=!1)),z){if(N===u&&!C&&!_&&!S)return D;Ic(v,D)&&(v=D)}}if(y.wildcard&&Ic(h,g))for(const D of y.wildcard){const{prefix:z,suffix:B}=D;if(z&&(R||!(D.caseSensitive?T:O??=T.toLowerCase()).startsWith(z)))continue;if(B){if(R)continue;const Y=t.slice(w).join("/").slice(-B.length);if((D.caseSensitive?Y:Y.toLowerCase())!==B)continue}const V={node:D,index:u,skipped:S,depth:j,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A};if(!(D.skipOnParamError&&!Xg(e,t,V))){h=V;break}}if(y.optional){const D=S|1<<j,z=j+1;for(let B=y.optional.length-1;B>=0;B--){const V=y.optional[B];d.push({node:V,index:w,skipped:D,depth:z,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R)for(let B=y.optional.length-1;B>=0;B--){const V=y.optional[B],{prefix:Y,suffix:G}=V;if(Y||G){const ae=V.caseSensitive?T:O??=T.toLowerCase();if(Y&&!ae.startsWith(Y)||G&&!ae.endsWith(G))continue}d.push({node:V,index:w+1,skipped:S,depth:z,statics:N,dynamics:C,optionals:_+1,extract:E,rawParams:M,parsedParams:A})}}if(!R&&y.dynamic&&T)for(let D=y.dynamic.length-1;D>=0;D--){const z=y.dynamic[D],{prefix:B,suffix:V}=z;if(B||V){const Y=z.caseSensitive?T:O??=T.toLowerCase();if(B&&!Y.startsWith(B)||V&&!Y.endsWith(V))continue}d.push({node:z,index:w+1,skipped:S,depth:j+1,statics:N,dynamics:C+1,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.staticInsensitive){const D=y.staticInsensitive.get(O??=T.toLowerCase());D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(!R&&y.static){const D=y.static.get(T);D&&d.push({node:D,index:w+1,skipped:S,depth:j+1,statics:N+1,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}if(y.pathless){const D=j+1;for(let z=y.pathless.length-1;z>=0;z--){const B=y.pathless[z];d.push({node:B,index:w,skipped:S,depth:D,statics:N,dynamics:C,optionals:_,extract:E,rawParams:M,parsedParams:A})}}}if(v&&h)return Ic(h,v)?v:h;if(v)return v;if(h)return h;if(r&&m){let g=m.index;for(let w=0;w<m.index;w++)g+=t[w].length;const y=g===e.length?"/":e.slice(g);return m.rawParams??={},m.rawParams["**"]=decodeURIComponent(y),m}return null}function Xg(e,t,n){try{const[r,o]=LN(e,t,n);n.rawParams=r,n.extract=o;const l=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function Ic(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===To)>(e.node.kind===To)||t.node.kind===To==(e.node.kind===To)&&t.depth>e.depth))):!0}function Uf(e){return Ix(e.filter(t=>t!==void 0).join("/"))}function Ix(e){return e.replace(/\/{2,}/g,"/")}function IN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function ra(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function $N(e){return ra(IN(e))}function sh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function Xz(e,t,n){return sh(e,n)===sh(t,n)}function Jz({base:e,to:t,trailingSlash:n="never",cache:r}){const o=t.startsWith("/"),l=!o&&t===".";let u;if(r){u=o?t:l?e:e+"\0"+t;const g=r.get(u);if(g)return g}let d;if(l)d=e.split("/");else if(o)d=t.split("/");else{for(d=e.split("/");d.length>1&&hu(d)==="";)d.pop();const g=t.split("/");for(let y=0,w=g.length;y<w;y++){const S=g[y];S===""?y?y===w-1&&d.push(S):d=[S]:S===".."?d.pop():S==="."||d.push(S)}}d.length>1&&(hu(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));let h,m="";for(let g=0;g<d.length;g++){g>0&&(m+="/");const y=d[g];if(!y)continue;h=Px(y,0,h);const w=h[0];if(w===ml){m+=y;continue}const S=h[5],j=y.substring(0,h[1]),N=y.substring(h[4],S),C=y.substring(h[2],h[3]);w===Io?m+=j||N?`${j}{$${C}}${N}`:`$${C}`:w===$o?m+=j||N?`${j}{$}${N}`:"$":m+=`${j}{-$${C}}${N}`}m=Ix(m);const v=m||"/";return u&&r&&r.set(u,v),v}function e4(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return o=>o.replace(r,l=>t.get(l)??l)}function Jg(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(o=>K1(o,n)).join("/"):K1(r,n)}function ev({path:e,params:t,decoder:n,server:r}){let o=!1;const l={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:o};const u=e.length;let d=0,h,m="";for(;d<u;){const g=d;h=Px(e,g,h);const y=h[5];if(d=y+1,g===y)continue;const w=h[0];if(w===ml){m+="/"+e.substring(g,y);continue}if(w===$o){const S=t._splat;l._splat=S,l["*"]=S;const j=e.substring(g,h[1]),N=e.substring(h[4],y);if(!S){o=!0,(j||N)&&(m+="/"+j+N);continue}const C=Jg("_splat",t,n);m+="/"+j+C+N;continue}if(w===Io){const S=e.substring(h[2],h[3]);!o&&!(S in t)&&(o=!0),l[S]=t[S];const j=e.substring(g,h[1]),N=e.substring(h[4],y),C=Jg(S,t,n)??"undefined";m+="/"+j+C+N;continue}if(w===mu){const S=e.substring(h[2],h[3]),j=t[S];if(j==null)continue;l[S]=j;const N=e.substring(g,h[1]),C=e.substring(h[4],y),_=Jg(S,t,n)??"";m+="/"+N+_+C;continue}}return e.endsWith("/")&&(m+="/"),{usedParams:l,interpolatedPath:m||"/",isMissingParams:o}}function K1(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function yr(e){return!!e?.isNotFound}function t4(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const ex="tsr-scroll-restoration-v1_3",n4=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function r4(){const e=t4();if(!e)return null;const t=e.getItem(ex);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=qa(r,n)||n;try{e.setItem(ex,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Sf=r4(),s4=e=>e.state.__TSR_key||e.href;function a4(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let ah=!1;function o4({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:o,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(m){console.error(m);return}const d=t||window.history.state?.__TSR_key,h=u[d];ah=!0;e:{if(r&&h&&Object.keys(h).length>0){for(const g in h){const y=h[g];if(g==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(g){const w=document.querySelector(g);w&&(w.scrollLeft=y.scrollX,w.scrollTop=y.scrollY)}}break e}const m=(l??window.location).hash.split("#",2)[1];if(m){const g=window.history.state?.__hashScrollIntoViewOptions??!0;if(g){const y=document.getElementById(m);y&&y.scrollIntoView(g)}break e}const v={top:0,left:0,behavior:n};if(window.scrollTo(v),o)for(const g of o){if(g==="window")continue;const y=typeof g=="function"?g():document.querySelector(g);y&&y.scrollTo(v)}}ah=!1}function i4(e,t){if(!Sf||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Sf))return;e.isScrollRestorationSetup=!0,ah=!1;const r=e.options.getScrollRestorationKey||s4;window.history.scrollRestoration="manual";const o=l=>{if(ah||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const h=l.target.getAttribute("data-scroll-restoration-id");h?u=`[data-scroll-restoration-id="${h}"]`:u=a4(l.target)}const d=r(e.state.location);Sf.set(h=>{const m=h[d]||={},v=m[u]||={};if(u==="window")v.scrollX=window.scrollX||0,v.scrollY=window.scrollY||0;else if(u){const g=document.querySelector(u);g&&(v.scrollX=g.scrollLeft||0,v.scrollY=g.scrollTop||0)}return h})};typeof document<"u"&&document.addEventListener("scroll",n4(o,100),!0),e.subscribe("onRendered",l=>{const u=r(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(o4({storageKey:ex,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Sf.set(d=>(d[u]||={},d)))})}function l4(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function c4(e,t=String){const n=new URLSearchParams;for(const r in e){const o=e[r];o!==void 0&&n.set(r,t(o))}return n.toString()}function tv(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function u4(e){const t=new URLSearchParams(e),n={};for(const[r,o]of t.entries()){const l=n[r];l==null?n[r]=tv(o):Array.isArray(l)?l.push(tv(o)):n[r]=[l,tv(o)]}return n}const d4=h4(JSON.parse),f4=m4(JSON.stringify,JSON.parse);function h4(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=u4(t);for(const r in n){const o=n[r];if(typeof o=="string")try{n[r]=e(o)}catch{}}return n}}function m4(e,t){const n=typeof t=="function";function r(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const l=c4(o,r);return l?`?${l}`:""}}const $r="__root__";function p4(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&nh(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${zN.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Fr(e){return e instanceof Response&&!!e.options}const qf=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Lh=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),al=(e,t,n=!0)=>{const r={...e.router.options.context??{}},o=n?t:t-1;for(let l=0;l<=o;l++){const u=e.matches[l];if(!u)continue;const d=e.router.getMatch(u.id);d&&Object.assign(r,d.__routeContext,d.__beforeLoadContext)}return r},FN=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),da(n.options.notFoundComponent);const r=e.matches.find(o=>o.routeId===n.id);da(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,o=>({...o,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,FN(e,t))},Va=(e,t,n)=>{if(!(!Fr(n)&&!yr(n))){if(Fr(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Fr(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,o=>({...o,status:r,context:al(e,t.index),isFetching:!1,error:n})),yr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Fr(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(FN(e,n),n)}},BN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,$c=(e,t,n,r)=>{const{id:o,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Va(e,e.router.getMatch(o),n);try{u.options.onError?.(n)}catch(d){n=d,Va(e,e.router.getMatch(o),n)}e.updateMatch(o,d=>(d._nonReactive.beforeLoadPromise?.resolve(),d._nonReactive.beforeLoadPromise=void 0,d._nonReactive.loadPromise?.resolve(),{...d,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},UN=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!Lh(e,t)&&(n.options.loader||n.options.beforeLoad||HN(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{qf(e)},o);r._nonReactive.pendingTimeout=u}},g4=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;UN(e,t,n,r);const o=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Va(e,l,l.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(o):o()},v4=(e,t,n,r)=>{const o=e.router.getMatch(t),l=o._nonReactive.loadPromise;o._nonReactive.loadPromise=hl(()=>{l?.resolve()});const{paramsError:u,searchError:d}=o;u&&$c(e,n,u,"PARSE_PARAMS"),d&&$c(e,n,d,"VALIDATE_SEARCH"),UN(e,t,r,o);const h=new AbortController;let m=!1;const v=()=>{m||(m=!0,e.updateMatch(t,M=>({...M,isFetching:"beforeLoad",fetchCount:M.fetchCount+1,abortController:h})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,M=>({...M,isFetching:!1}))};if(!r.options.beforeLoad){ou(()=>{v(),g()});return}o._nonReactive.beforeLoadPromise=hl();const y={...al(e,n,!1),...o.__routeContext},{search:w,params:S,cause:j}=o,N=Lh(e,t),C={search:w,abortController:h,params:S,preload:N,context:y,location:e.location,navigate:M=>e.router.navigate({...M,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":j,matches:e.matches,...e.router.options.additionalContext},_=M=>{if(M===void 0){ou(()=>{v(),g()});return}(Fr(M)||yr(M))&&(v(),$c(e,n,M,"BEFORE_LOAD")),ou(()=>{v(),e.updateMatch(t,A=>({...A,__beforeLoadContext:M})),g()})};let E;try{if(E=r.options.beforeLoad(C),sl(E))return v(),E.catch(M=>{$c(e,n,M,"BEFORE_LOAD")}).then(_)}catch(M){v(),$c(e,n,M,"BEFORE_LOAD")}_(E)},x4=(e,t)=>{const{id:n,routeId:r}=e.matches[t],o=e.router.looseRoutesById[r],l=()=>d(),u=()=>v4(e,n,t,o),d=()=>{if(BN(e,n))return;const h=g4(e,n,o);return sl(h)?h.then(u):u()};return l()},y4=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([l,u,d])=>{const h=l?.meta,m=l?.links,v=l?.scripts,g=l?.styles;return{meta:h,links:m,headScripts:v,headers:d,scripts:u,styles:g}})},qN=(e,t,n,r)=>{const o=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:d,cause:h}=e.router.getMatch(t),m=al(e,n),v=Lh(e,t);return{params:l,deps:u,preload:!!v,parentMatchPromise:o,abortController:d,context:m,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:v?"preload":h,route:r,...e.router.options.additionalContext}},X1=async(e,t,n,r)=>{try{const o=e.router.getMatch(t);try{(!(Pz??e.router.isServer)||o.ssr===!0)&&VN(r);const l=r.options.loader?.(qN(e,t,n,r)),u=r.options.loader&&sl(l);if((u||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,m=>({...m,isFetching:"loader"})),r.options.loader){const m=u?await l:l;Va(e,e.router.getMatch(t),m),m!==void 0&&e.updateMatch(t,v=>({...v,loaderData:m}))}r._lazyPromise&&await r._lazyPromise;const h=o._nonReactive.minPendingPromise;h&&await h,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,m=>({...m,error:void 0,context:al(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){e.updateMatch(t,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:al(e,n)}));return}const d=o._nonReactive.minPendingPromise;d&&await d,yr(l)&&await r.options.notFoundComponent?.preload?.(),Va(e,e.router.getMatch(t),l);try{r.options.onError?.(l)}catch(h){u=h,Va(e,e.router.getMatch(t),h)}e.updateMatch(t,h=>({...h,error:u,context:al(e,n),status:"error",isFetching:!1}))}}catch(o){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),Va(e,l,o)}},b4=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let o=!1,l=!1;const u=e.router.looseRoutesById[r];if(!BN(e,n)){const m=e.router.getMatch(n);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!e.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const v=e.router.getMatch(n),g=v._nonReactive.error||v.error;g&&Va(e,v,g)}else{const v=Date.now()-m.updatedAt,g=Lh(e,n),y=g?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,w=u.options.shouldReload,S=typeof w=="function"?w(qN(e,n,t,u)):w,j=!!g&&!e.router.state.matches.some(E=>E.id===n),N=e.router.getMatch(n);N._nonReactive.loaderPromise=hl(),j!==N.preload&&e.updateMatch(n,E=>({...E,preload:j}));const{status:C,invalid:_}=N;o=C==="success"&&(_||(S??v>y)),g&&u.options.preload===!1||(o&&!e.sync?(l=!0,(async()=>{try{await X1(e,n,t,u);const E=e.router.getMatch(n);E._nonReactive.loaderPromise?.resolve(),E._nonReactive.loadPromise?.resolve(),E._nonReactive.loaderPromise=void 0}catch(E){Fr(E)&&await e.router.navigate(E.options)}})()):(C!=="success"||o&&e.sync)&&await X1(e,n,t,u))}}const d=e.router.getMatch(n);l||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,l||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const h=l?d.isFetching:!1;return h!==d.isFetching||d.invalid!==!1?(e.updateMatch(n,m=>({...m,isFetching:h,invalid:!1})),e.router.getMatch(n)):d};async function J1(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&qf(t);try{for(let d=0;d<t.matches.length;d++){const h=x4(t,d);sl(h)&&await h}const n=t.firstBadMatchIndex??t.matches.length;for(let d=0;d<n;d++)t.matchPromises.push(b4(t,d));const o=(await Promise.allSettled(t.matchPromises)).filter(d=>d.status==="rejected").map(d=>d.reason);let l;for(const d of o){if(Fr(d))throw d;!l&&yr(d)&&(l=d)}for(const d of t.matches){const{id:h,routeId:m}=d,v=t.router.looseRoutesById[m];try{const g=y4(t,h,v);if(g){const y=await g;t.updateMatch(h,w=>({...w,...y}))}}catch(g){console.error(`Error executing head for route ${m}:`,g)}}if(l)throw l;const u=qf(t);sl(u)&&await u}catch(n){if(yr(n)&&!t.preload){const r=qf(t);throw sl(r)&&await r,n}if(Fr(n))throw n}return t.matches}async function VN(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of YN){const o=e.options[r]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function HN(e){for(const t of YN)if(e.options[t]?.preload)return!0;return!1}const YN=["component","errorComponent","pendingComponent","notFoundComponent"];function w4(e){return{input:({url:t})=>{for(const n of e)t=tx(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=WN(e[n],t);return t}}}function S4(e){const t=$N(e.basepath),n=`/${t}`,r=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?r:r.toLowerCase();return{input:({url:u})=>{const d=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return d===o?u.pathname="/":d.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=Uf(["/",t,u.pathname]),u)}}function tx(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function WN(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function zo(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,o=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:o,hashChanged:l}}class j4{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,o=this.basepath??r?.basepath??"/",l=this.basepath===void 0,u=r?.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=e4(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Dz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let y;this.resolvePathCache=rh(1e3),y=this.buildRouteTree(),this.setRoutes(y)}!this.__store&&this.latestLocation&&(this.__store=new Az(N4(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(y=>!["redirected"].includes(y.status))}}}),i4(this));let d=!1;const h=this.options.basepath??"/",m=this.options.rewrite;if(l||o!==h||u!==m){this.basepath=h;const y=[],w=$N(h);w&&w!=="/"&&y.push(S4({basepath:h})),m&&y.push(m),this.rewrite=y.length===0?void 0:y.length===1?y[0]:w4(y),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=Gz(this.routeTree,this.options.caseSensitive,(r,o)=>{r.init({originalIndex:o})});return this.options.routeMasks&&qz(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const o={eventType:n,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const o=({pathname:h,search:m,hash:v,href:g,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const _=this.options.parseSearch(m),E=this.options.stringifySearch(_);return{href:h+E+v,publicHref:g,pathname:Lc(h),external:!1,searchStr:E,search:er(r?.search,_),hash:Lc(v.slice(1)),state:er(r?.state,y)}}const w=new URL(g,this.origin),S=tx(this.rewrite,w),j=this.options.parseSearch(S.search),N=this.options.stringifySearch(j);return S.search=N,{href:S.href.replace(S.origin,""),publicHref:g,pathname:Lc(S.pathname),external:!!this.rewrite&&S.origin!==this.origin,searchStr:N,search:er(r?.search,j),hash:Lc(S.hash.slice(1)),state:er(r?.state,y)}},l=o(n),{__tempLocation:u,__tempKey:d}=l.state;if(u&&(!d||d===this.tempLocationKey)){const h=o(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(n,r)=>Jz({base:n,to:Ix(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},o):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>k4({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),r=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const r=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??d.fullPath,m=this.resolvePathWithBase(h,"."),v=d.search,g={...d.params},y=l.to?this.resolvePathWithBase(m,`${l.to}`):this.resolvePathWithBase(m,"."),w=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,qa(l.params,g)),S=ev({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,j=this.getMatchedRoutes(S);let N=j.matchedRoutes;(j.foundRoute?j.foundRoute.path!=="/"&&j.routeParams["**"]:ra(S))&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]);let _=!1;if(Object.keys(w).length>0)for(const Y of N){const G=Y.options.params?.stringify??Y.options.stringifyParams;G&&(_=!0,Object.assign(w,G(w)))}const E=n.leaveParams?y:Lc(_?ev({path:y,params:w,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:S);let M=v;if(n._includeValidateSearch&&this.options.search?.strict){const Y={};N.forEach(G=>{if(G.options.validateSearch)try{Object.assign(Y,Vf(G.options.validateSearch,{...Y,...M}))}catch{}}),M=Y}M=_4({search:M,dest:l,destRoutes:N,_includeValidateSearch:n._includeValidateSearch}),M=er(v,M);const A=this.options.stringifySearch(M),R=l.hash===!0?u.hash:l.hash?qa(l.hash,u.hash):void 0,T=R?`#${R}`:"";let O=l.state===!0?u.state:l.state?qa(l.state,u.state):{};O=er(u.state,O);const D=`${E}${A}${T}`;let z,B,V=!1;if(this.rewrite){const Y=new URL(D,this.origin),G=WN(this.rewrite,Y);z=Y.href.replace(Y.origin,""),G.origin!==this.origin?(B=G.href,V=!0):B=G.pathname+G.search+G.hash}else z=Fz(D),B=z;return{publicHref:B,href:z,pathname:E,search:M,searchStr:A,state:O,hash:R??"",external:V,unmaskOnReload:l.unmaskOnReload}},o=(l={},u)=>{const d=r(l);let h=u?r(u):void 0;if(!h){const m={};if(this.options.routeMasks){const v=Vz(d.pathname,this.processedTree);if(v){Object.assign(m,v.rawParams);const{from:g,params:y,...w}=v.route,S=y===!1||y===null?{}:(y??!0)===!0?m:Object.assign(m,qa(y,m));u={from:n.from,...w,params:S},h=r(u)}}}return h&&(d.maskedLocation=h),d};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...o})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(v=>{o.state[v]=this.latestLocation.state[v]});const m=Do(o.state,this.latestLocation.state);return h.forEach(v=>{delete o.state[v]}),m},u=ra(this.latestLocation.href)===ra(o.href),d=this.commitLocationPromise;if(this.commitLocationPromise=hl(()=>{d?.resolve()}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:m,...v}=o;h&&(v={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:u,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,y=eh(d,{__TSR_index:n?g:g+1}),w=new URL(y.pathname,this.origin),S=tx(this.rewrite,w);h.to=S.pathname,h.search=this.options.parseSearch(y.search),h.hash=y.hash.slice(1)}const m=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const v=this.commitLocation({...m,viewTransition:l,replace:n,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),v},this.navigate=async({to:n,reloadDocument:r,href:o,publicHref:l,...u})=>{let d=!1;if(o)try{new URL(`${o}`),d=!0}catch{}if(d&&!r&&(r=!0),r){if(n!==void 0||!o){const m=this.buildLocation({to:n,...u});o=o??m.publicHref,l=l??m.publicHref}const h=!d&&l?l:o;if(nh(h))return Promise.resolve();if(!u.ignoreBlocker){const v=this.history.getBlockers?.()??[];for(const g of v)if(g?.blockerFn&&await g.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(o=>!n.some(l=>l.id===o.id))}))},this.load=async n=>{let r,o,l;for(l=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,m=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...zo({resolvedLocation:m,location:h})}),this.emit({type:"onBeforeLoad",...zo({resolvedLocation:m,location:h})}),await J1({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],g=[],y=[];ou(()=>{this.__store.setState(w=>{const S=w.matches,j=w.pendingMatches||w.matches;return v=S.filter(N=>!j.some(C=>C.id===N.id)),g=j.filter(N=>!S.some(C=>C.id===N.id)),y=j.filter(N=>S.some(C=>C.id===N.id)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(N=>N.status!=="error"&&N.status!=="notFound")]}}),this.clearExpiredCache()}),[[v,"onLeave"],[g,"onEnter"],[y,"onStay"]].forEach(([w,S])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[S]?.(j)})})})})}})}catch(h){Fr(h)?(r=h,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):yr(h)&&(o=h),this.__store.setState(m=>({...m,statusCode:r?r.status:o?404:m.matches.some(v=>v.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(d=>d.status==="error")&&(u=500),u!==void 0&&this.__store.setState(d=>({...d,statusCode:u}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,d=typeof r.types=="function"?r.types(zo({resolvedLocation:u,location:l})):r.types;if(d===!1){n();return}o={update:n,types:d}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";o&&this.__store.setState(l=>({...l,[o]:l[o]?.map(u=>u.id===n?r(u):u)}))})},this.getMatch=n=>{const r=o=>o.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:o.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),l=this.getParsedLocationHref(o);n.options.href=l,n.headers.set("Location",l)}else if(r)try{const o=new URL(r);if(this.origin&&o.origin===this.origin){const l=o.pathname+o.search+o.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(l=>!r(l))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const l=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=VN,this.preloadRoute=async n=>{const r=this.buildLocation(n);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),u=new Set([...l,...this.state.cachedMatches.map(d=>d.id)]);ou(()=>{o.forEach(d=>{u.has(d.id)||this.__store.setState(h=>({...h,cachedMatches:[...h.cachedMatches,d]}))})});try{return o=await J1({router:this,matches:o,location:r,preload:!0,updateMatch:(d,h)=>{l.has(d)?o=o.map(m=>m.id===d?h(m):m):this.updateMatch(d,h)}}),o}catch(d){if(Fr(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:r});yr(d)||console.error(d);return}},this.matchRoute=(n,r)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const d=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,h=Hz(l.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,d.pathname,this.processedTree);return!h||n.params&&!Do(h.rawParams,n.params,{partial:!0})?!1:r?.includeSearch??!0?Do(d.search,l.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??f4,parseSearch:t.parseSearch??d4}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:r}){this.routesById=t,this.routesByPath=n,this.processedTree=r;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const r=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:l,parsedParams:u}=r;let{matchedRoutes:d}=r,h=!1;(o?o.path!=="/"&&l["**"]:ra(t.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:h=!0);const m=h?T4(this.options.notFoundMode,d):void 0,v=[],g=y=>y?.id?y.context??this.options.context??void 0:this.options.context??void 0;return d.forEach((y,w)=>{const S=v[w-1],[j,N,C]=(()=>{const G=S?.search??t.search,ae=S?._strictSearch??void 0;try{const L=Vf(y.options.validateSearch,{...G})??void 0;return[{...G,...L},{...ae,...L},void 0]}catch(L){let $=L;if(L instanceof oh||($=new oh(L.message,{cause:L})),n?.throwOnError)throw $;return[G,{},$]}})(),_=y.options.loaderDeps?.({search:j})??"",E=_?JSON.stringify(_):"",{interpolatedPath:M,usedParams:A}=ev({path:y.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),R=y.id+M+E,T=this.getMatch(R),O=this.state.matches.find(G=>G.routeId===y.id),D=T?._strictParams??A;let z;if(!T)try{ej(y,A,u,D)}catch(G){if(yr(G)||Fr(G)?z=G:z=new C4(G.message,{cause:G}),n?.throwOnError)throw z}Object.assign(l,D);const B=O?"stay":"enter";let V;if(T)V={...T,cause:B,params:O?er(O.params,l):l,_strictParams:D,search:er(O?O.search:T.search,j),_strictSearch:N};else{const G=y.options.loader||y.options.beforeLoad||y.lazyFn||HN(y)?"pending":"success";V={id:R,ssr:y.options.ssr,index:w,routeId:y.id,params:O?er(O.params,l):l,_strictParams:D,pathname:M,updatedAt:Date.now(),search:O?er(O.search,j):j,_strictSearch:N,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:hl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:B,loaderDeps:O?er(O.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}n?.preload||(V.globalNotFound=m===y.id),V.searchError=C;const Y=g(S);V.context={...Y,...V.__routeContext,...V.__beforeLoadContext},v.push(V)}),v.forEach((y,w)=>{const S=this.looseRoutesById[y.routeId];if(!this.getMatch(y.id)){const N=v[w-1],C=g(N);if(S.options.context){const _={deps:y.loaderDeps,params:y.params,context:C??{},location:t,navigate:E=>this.navigate({...E,_fromLocation:t}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:v};y.__routeContext=S.options.context(_)??void 0}y.context={...C,...y.__routeContext,...y.__beforeLoadContext}}}),v}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:r,parsedParams:o}=this.getMatchedRoutes(t.pathname),l=hu(n),u={...t.search};for(const v of n)try{Object.assign(u,Vf(v.options.validateSearch,u))}catch{}const d=hu(this.state.matches),h=d&&d.routeId===l.id&&t.pathname===this.state.location.pathname;let m;if(h)m=d.params;else{const v={...r};for(const g of n)try{ej(g,r,o??{},v)}catch{}m=v}return{matchedRoutes:n,fullPath:l.fullPath,search:u,params:m}}}class oh extends Error{}class C4 extends Error{}function N4(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Vf(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new oh("Async validation not supported");if(n.issues)throw new oh(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function k4({pathname:e,routesById:t,processedTree:n}){const r={},o=ra(e);let l,u;const d=Yz(o,n,!0);return d&&(l=d.route,Object.assign(r,d.rawParams),u=Object.assign({},d.parsedParams)),{matchedRoutes:d?.branch||[t[$r]],routeParams:r,foundRoute:l,parsedParams:u}}function _4({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return E4(n)(e,t,r??!1)}function E4(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const l=({search:u,next:d})=>{let h=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((v,g)=>g(v),u));const m=d(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((v,g)=>g(v),m):m};t.middlewares.push(l)}if(o.options.validateSearch){const l=({search:u,next:d})=>{const h=d(u);if(!t._includeValidateSearch)return h;try{return{...h,...Vf(o.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const n=({search:o})=>{const l=t.dest;return l.search?l.search===!0?o:qa(l.search,o):{}};t.middlewares.push(n);const r=(o,l,u)=>{if(o>=u.length)return l;const d=u[o];return d({search:l,next:m=>r(o+1,m,u)})};return function(l,u,d){return t.dest=u,t._includeValidateSearch=d,r(0,l,t.middlewares)}}function T4(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return $r}function ej(e,t,n,r){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const l in t)l in n&&(r[l]=n[l]);else{const l=o(r);Object.assign(r,l)}}const M4="Error preloading route! ☝️";class GN{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,o=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=$r:this.parentRoute||da(!1);let l=o?$r:r?.path;l&&l!=="/"&&(l=IN(l));const u=r?.id||l;let d=o?$r:Uf([this.parentRoute.id===$r?"":this.parentRoute.id,u]);l===$r&&(l="/"),d!==$r&&(d=Uf(["/",d]));const h=d===$r?"/":Uf([this.parentRoute.fullPath,l]);this._path=l,this._id=d,this._fullPath=h,this._to=ra(h)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>p4({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class R4 extends GN{constructor(t){super(t)}}const jf=typeof window<"u"?p.useLayoutEffect:p.useEffect;function nv(e){const t=p.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function A4(e,t,n={},r={}){p.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([l])=>{t(l)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,r.disabled,e])}function O4(e){const t=p.useRef(null);return p.useImperativeHandle(e,()=>t.current,[]),t}function $x(e){const t=e.errorComponent??Fx;return i.jsx(D4,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?p.createElement(t,{error:n,reset:r}):e.children})}class D4 extends p.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Fx({error:e}){const[t,n]=p.useState(!1);return i.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[i.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),i.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),i.jsx("div",{style:{height:".25rem"}}),t?i.jsx("div",{children:i.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?i.jsx("code",{children:e.message}):null})}):null]})}function z4({children:e,fallback:t=null}){return ZN()?i.jsx(ee.Fragment,{children:e}):i.jsx(ee.Fragment,{children:t})}function ZN(){return ee.useSyncExternalStore(P4,()=>!0,()=>!1)}function P4(){return()=>{}}var rv={exports:{}},sv={},av={exports:{}},ov={};var tj;function L4(){if(tj)return ov;tj=1;var e=Pu();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(g,y){var w=y(),S=r({inst:{value:w,getSnapshot:y}}),j=S[0].inst,N=S[1];return l(function(){j.value=w,j.getSnapshot=y,h(j)&&N({inst:j})},[g,w,y]),o(function(){return h(j)&&N({inst:j}),g(function(){h(j)&&N({inst:j})})},[g]),u(w),w}function h(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!n(g,w)}catch{return!0}}function m(g,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return ov.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,ov}var nj;function QN(){return nj||(nj=1,av.exports=L4()),av.exports}var rj;function I4(){if(rj)return sv;rj=1;var e=Pu(),t=QN();function n(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return sv.useSyncExternalStoreWithSelector=function(m,v,g,y,w){var S=l(null);if(S.current===null){var j={hasValue:!1,value:null};S.current=j}else j=S.current;S=d(function(){function C(R){if(!_){if(_=!0,E=R,R=y(R),w!==void 0&&j.hasValue){var T=j.value;if(w(T,R))return M=T}return M=R}if(T=M,r(E,R))return T;var O=y(R);return w!==void 0&&w(T,O)?(E=R,T):(E=R,M=O)}var _=!1,E,M,A=g===void 0?null:g;return[function(){return C(v())},A===null?void 0:function(){return C(A())}]},[v,g,y,w]);var N=o(m,S[0],S[1]);return u(function(){j.hasValue=!0,j.value=N},[N]),h(N),N},sv}var sj;function $4(){return sj||(sj=1,rv.exports=I4()),rv.exports}var F4=$4();function B4(e,t=r=>r,n={}){const r=n.equal??U4;return F4.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function U4(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=aj(e);if(n.length!==aj(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function aj(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const iv=p.createContext(null);function KN(){return typeof document>"u"?iv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=iv,iv)}function Ur(e){const t=p.useContext(KN());return e?.warn,t}function $n(e){const t=Ur({warn:e?.router===void 0}),n=e?.router||t,r=p.useRef(void 0);return B4(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=er(r.current,e.select(o));return r.current=l,l}return e.select(o)}return o})}const Ih=p.createContext(void 0),q4=p.createContext(void 0);function _s(e){const t=p.useContext(e.from?q4:Ih);return $n({select:r=>{const o=r.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(da(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Bx(e){return _s({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ux(e){const{select:t,...n}=e;return _s({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Go(e){return _s({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function qx(e){return _s({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Xa(e){const t=Ur();return p.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Ml=xN();const V4=vN(Ml);function H4(e,t){const n=Ur(),r=O4(t),{activeProps:o,inactiveProps:l,activeOptions:u,to:d,preload:h,preloadDelay:m,hashScrollIntoView:v,replace:g,startTransition:y,resetScroll:w,viewTransition:S,children:j,target:N,disabled:C,style:_,className:E,onClick:M,onFocus:A,onMouseEnter:R,onMouseLeave:T,onTouchStart:O,ignoreBlocker:D,params:z,search:B,hash:V,state:Y,mask:G,reloadDocument:ae,unsafeRelative:L,from:$,_fromLocation:U,...H}=e,le=ZN(),I=$n({select:Qe=>Qe.location.search,structuralSharing:!0}),F=e.from,K=p.useMemo(()=>({...e,from:F}),[n,I,F,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ne=p.useMemo(()=>n.buildLocation({...K}),[n,K]),X=ne.maskedLocation?ne.maskedLocation.publicHref:ne.publicHref,ue=ne.maskedLocation?ne.maskedLocation.external:ne.external,te=p.useMemo(()=>K4(X,ue,n.history,C),[C,ue,X,n.history]),ye=p.useMemo(()=>{if(te?.external)return nh(te.href)?void 0:te.href;if(!X4(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),nh(d)?void 0:d}catch{}},[d,te]),Ce=$n({select:Qe=>{if(ye)return!1;if(u?.exact){if(!Xz(Qe.location.pathname,ne.pathname,n.basepath))return!1}else{const bt=sh(Qe.location.pathname,n.basepath),pt=sh(ne.pathname,n.basepath);if(!(bt.startsWith(pt)&&(bt.length===pt.length||bt[pt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Do(Qe.location.search,ne.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?le&&Qe.location.hash===ne.hash:!0}}),_e=Ce?qa(o,{})??Y4:lv,Re=Ce?lv:qa(l,{})??lv,ge=[E,_e.className,Re.className].filter(Boolean).join(" "),Fe=(_||_e.style||Re.style)&&{..._,..._e.style,...Re.style},[be,Be]=p.useState(!1),nt=p.useRef(!1),ot=e.reloadDocument||ye?!1:h??n.options.defaultPreload,yt=m??n.options.defaultPreloadDelay??0,pe=p.useCallback(()=>{n.preloadRoute({...K}).catch(Qe=>{console.warn(Qe),console.warn(M4)})},[n,K]),Le=p.useCallback(Qe=>{Qe?.isIntersecting&&pe()},[pe]);A4(r,Le,Q4,{disabled:!!C||ot!=="viewport"}),p.useEffect(()=>{nt.current||!C&&ot==="render"&&(pe(),nt.current=!0)},[C,pe,ot]);const Ye=Qe=>{const bt=Qe.currentTarget.getAttribute("target"),pt=N!==void 0?N:bt;if(!C&&!J4(Qe)&&!Qe.defaultPrevented&&(!pt||pt==="_self")&&Qe.button===0){Qe.preventDefault(),Ml.flushSync(()=>{Be(!0)});const Vn=n.subscribe("onResolved",()=>{Vn(),Be(!1)});n.navigate({...K,replace:g,resetScroll:w,hashScrollIntoView:v,startTransition:y,viewTransition:S,ignoreBlocker:D})}};if(ye)return{...H,ref:r,href:ye,...j&&{children:j},...N&&{target:N},...C&&{disabled:C},..._&&{style:_},...E&&{className:E},...M&&{onClick:M},...A&&{onFocus:A},...R&&{onMouseEnter:R},...T&&{onMouseLeave:T},...O&&{onTouchStart:O}};const Oe=Qe=>{C||ot&&pe()},dt=Oe,ct=Qe=>{if(!(C||!ot))if(!yt)pe();else{const bt=Qe.target;if(Fc.has(bt))return;const pt=setTimeout(()=>{Fc.delete(bt),pe()},yt);Fc.set(bt,pt)}},Mn=Qe=>{if(C||!ot||!yt)return;const bt=Qe.target,pt=Fc.get(bt);pt&&(clearTimeout(pt),Fc.delete(bt))};return{...H,..._e,...Re,href:te?.href,ref:r,onClick:Bc([M,Ye]),onFocus:Bc([A,Oe]),onMouseEnter:Bc([R,ct]),onMouseLeave:Bc([T,Mn]),onTouchStart:Bc([O,dt]),disabled:!!C,target:N,...Fe&&{style:Fe},...ge&&{className:ge},...C&&W4,...Ce&&G4,...le&&be&&Z4}}const lv={},Y4={className:"active"},W4={role:"link","aria-disabled":!0},G4={"data-status":"active","aria-current":"page"},Z4={"data-transitioning":"transitioning"},Fc=new WeakMap,Q4={rootMargin:"100px"},Bc=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function K4(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function X4(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const Ss=p.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:o,...l}=H4(r,t),u=typeof r.children=="function"?r.children({isActive:l["data-status"]==="active"}):r.children;if(!n){const{disabled:d,...h}=l;return p.createElement("a",h,u)}return p.createElement(n,l,u)});function J4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class e3 extends GN{constructor(t){super(t),this.useMatch=n=>_s({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>_s({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>qx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Go({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Xa({from:this.fullPath}),this.Link=ee.forwardRef((n,r)=>i.jsx(Ss,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function os(e){return new e3(e)}class t3 extends R4{constructor(t){super(t),this.useMatch=n=>_s({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>_s({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>qx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Go({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Ux({...n,from:this.id}),this.useLoaderData=n=>Bx({...n,from:this.id}),this.useNavigate=()=>Xa({from:this.fullPath}),this.Link=ee.forwardRef((n,r)=>i.jsx(Ss,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function n3(e){return new t3(e)}function oj(e){return typeof e=="object"?new ij(e,{silent:!0}).createRoute(e):new ij(e,{silent:!0}).createRoute}class ij{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const o=os(r);return o.isRoot=!1,o},this.silent=n?.silent}}class lj{constructor(t){this.useMatch=n=>_s({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>_s({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>qx({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Go({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Ux({...n,from:this.options.id}),this.useLoaderData=n=>Bx({...n,from:this.options.id}),this.useNavigate=()=>{const n=Ur();return Xa({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function cj(e){return typeof e=="object"?new lj(e):t=>new lj({id:e,...t})}function r3(){const e=Ur(),t=p.useRef({router:e,mounted:!1}),[n,r]=p.useState(!1),{hasPendingMatches:o,isLoading:l}=$n({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),u=nv(l),d=l||n||o,h=nv(d),m=l||o,v=nv(m);return e.startTransition=g=>{r(!0),p.startTransition(()=>{g(),r(!1)})},p.useEffect(()=>{const g=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ra(e.latestLocation.publicHref)!==ra(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{g()}},[e,e.history]),jf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),jf(()=>{u&&!l&&e.emit({type:"onLoad",...zo(e.state)})},[u,e,l]),jf(()=>{v&&!m&&e.emit({type:"onBeforeRouteMount",...zo(e.state)})},[m,v,e]),jf(()=>{if(h&&!d){const g=zo(e.state);e.emit({type:"onResolved",...g}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),g.hrefChanged&&l4(e)}},[d,h,e]),null}function s3(e){const t=$n({select:n=>`not-found-${n.location.pathname}-${n.status}`});return i.jsx($x,{getResetKey:()=>t,onCatch:(n,r)=>{if(yr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(yr(n))return e.fallback?.(n);throw n},children:e.children})}function a3(){return i.jsx("p",{children:"Not Found"})}function Zi(e){return i.jsx(i.Fragment,{children:e.children})}function XN(e,t,n){return t.options.notFoundComponent?i.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?i.jsx(e.options.defaultNotFoundComponent,{...n}):i.jsx(a3,{})}function o3(){return Ur().isScrollRestoring,null}const JN=p.memo(function({matchId:t}){const n=Ur(),r=$n({select:j=>{const N=j.matches.findIndex(_=>_.id===t),C=j.matches[N];return da(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[N-1]?.routeId}},structuralSharing:!0}),o=n.routesById[r.routeId],l=o.options.pendingComponent??n.options.defaultPendingComponent,u=l?i.jsx(l,{}):null,d=o.options.errorComponent??n.options.defaultErrorComponent,h=o.options.onCatch??n.options.defaultOnCatch,m=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,v=r.ssr===!1||r.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||v)&&(o.options.wrapInSuspense??l??(o.options.errorComponent?.preload||v))?p.Suspense:Zi,y=d?$x:Zi,w=m?s3:Zi,S=o.isRoot?o.options.shellComponent??Zi:Zi;return i.jsxs(S,{children:[i.jsx(Ih.Provider,{value:t,children:i.jsx(g,{fallback:u,children:i.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:d||Fx,onCatch:(j,N)=>{if(yr(j))throw j;h?.(j,N)},children:i.jsx(w,{fallback:j=>{if(!m||j.routeId&&j.routeId!==r.routeId||!j.routeId&&!o.isRoot)throw j;return p.createElement(m,j)},children:v||r._displayPending?i.jsx(z4,{fallback:u,children:i.jsx(uj,{matchId:t})}):i.jsx(uj,{matchId:t})})})})}),r.parentRouteId===$r&&n.options.scrollRestoration?i.jsxs(i.Fragment,{children:[i.jsx(i3,{}),i.jsx(o3,{})]}):null]})});function i3(){const e=Ur(),t=p.useRef(void 0);return i.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...zo(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const uj=p.memo(function({matchId:t}){const n=Ur(),{match:r,key:o,routeId:l}=$n({select:h=>{const m=h.matches.find(S=>S.id===t),v=m.routeId,y=(n.routesById[v].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:m.id,status:m.status,error:m.error,invalid:m.invalid,_forcePending:m._forcePending,_displayPending:m._displayPending}}},structuralSharing:!0}),u=n.routesById[l],d=p.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?i.jsx(h,{},o):i.jsx(ek,{})},[o,u.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const m=n.getMatch(r.id);if(m&&!m._nonReactive.minPendingPromise){const v=hl();m._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),m._nonReactive.minPendingPromise=void 0},h)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return da(yr(r.error)),XN(n,u,r.error);if(r.status==="redirected")throw da(Fr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return d}),ek=p.memo(function(){const t=Ur(),n=p.useContext(Ih),r=$n({select:m=>m.matches.find(v=>v.id===n)?.routeId}),o=t.routesById[r],l=$n({select:m=>{const g=m.matches.find(y=>y.id===n);return da(g),g.globalNotFound}}),u=$n({select:m=>{const v=m.matches,g=v.findIndex(y=>y.id===n);return v[g+1]?.id}}),d=t.options.defaultPendingComponent?i.jsx(t.options.defaultPendingComponent,{}):null;if(l)return XN(t,o,void 0);if(!u)return null;const h=i.jsx(JN,{matchId:u});return r===$r?i.jsx(p.Suspense,{fallback:d,children:h}):h});function l3(){const e=Ur(),n=e.routesById[$r].options.pendingComponent??e.options.defaultPendingComponent,r=n?i.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?Zi:p.Suspense,l=i.jsxs(o,{fallback:r,children:[i.jsx(r3,{}),i.jsx(c3,{})]});return e.options.InnerWrap?i.jsx(e.options.InnerWrap,{children:l}):l}function c3(){const e=Ur(),t=$n({select:o=>o.matches[0]?.id}),n=$n({select:o=>o.loadedAt}),r=t?i.jsx(JN,{matchId:t}):null;return i.jsx(Ih.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:i.jsx($x,{getResetKey:()=>n,errorComponent:Fx,onCatch:o=>{o.message||o.toString()},children:r})})}const u3=e=>new d3(e);class d3 extends j4{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=oj,globalThis.createLazyFileRoute=cj):typeof window<"u"&&(window.createFileRoute=oj,window.createLazyFileRoute=cj);function f3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=KN(),o=i.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?i.jsx(e.options.Wrap,{children:o}):o}function h3({router:e,...t}){return i.jsx(f3,{router:e,...t,children:i.jsx(l3,{})})}function m3(e){return $n({select:t=>t.location})}const p3="0.0.16";const tk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const g3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const v3=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const dj=e=>{const t=v3(e);return t.charAt(0).toUpperCase()+t.slice(1)};var x3={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const y3=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const b3=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:u,...d},h)=>p.createElement("svg",{ref:h,...x3,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tk("lucide",o),...!l&&!y3(d)&&{"aria-hidden":"true"},...d},[...u.map(([m,v])=>p.createElement(m,v)),...Array.isArray(l)?l:[l]]));const ve=(e,t)=>{const n=p.forwardRef(({className:r,...o},l)=>p.createElement(b3,{ref:l,iconNode:t,className:tk(`lucide-${g3(dj(e))}`,`lucide-${e}`,r),...o}));return n.displayName=dj(e),n};const w3=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],nk=ve("archive",w3);const S3=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],j3=ve("arrow-down",S3);const C3=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],rk=ve("arrow-left",C3);const N3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],k3=ve("arrow-right",N3);const _3=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],E3=ve("arrow-up-down",_3);const T3=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],M3=ve("arrow-up",T3);const R3=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],nx=ve("bell",R3);const A3=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],O3=ve("bold",A3);const D3=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],z3=ve("book",D3);const P3=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],L3=ve("bookmark",P3);const I3=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],Vx=ve("braces",I3);const $3=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],pl=ve("calendar",$3);const F3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ms=ve("check",F3);const B3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],vn=ve("chevron-down",B3);const U3=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hx=ve("chevron-left",U3);const q3=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Rl=ve("chevron-right",q3);const V3=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Iu=ve("chevron-up",V3);const H3=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Y3=ve("chevrons-up-down",H3);const W3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$u=ve("circle-alert",W3);const G3=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Yx=ve("circle-check-big",G3);const Z3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],sk=ve("circle-question-mark",Z3);const Q3=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],K3=ve("circle-x",Q3);const X3=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ih=ve("clock",X3);const J3=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],rx=ve("code-xml",J3);const eP=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ak=ve("code",eP);const tP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ok=ve("copy",tP);const nP=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],ik=ve("dollar-sign",nP);const rP=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],sx=ve("download",rP);const sP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],aP=ve("ellipsis-vertical",sP);const oP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],lk=ve("ellipsis",oP);const iP=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16v5h-5",key:"1ck2sf"}],["path",{d:"M21 8V3h-5",key:"1qoq8a"}],["path",{d:"M3 16v5h5",key:"1t08am"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 8V3h5",key:"1ln10m"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],lP=ve("expand",iP);const cP=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],uP=ve("external-link",cP);const dP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],lh=ve("eye",dP);const fP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],hP=ve("file-code",fP);const mP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Sr=ve("file-text",mP);const pP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]],ch=ve("file-type",pP);const gP=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],Wx=ve("file",gP);const vP=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],xP=ve("flag",vP);const yP=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],Gx=ve("folder-input",yP);const bP=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Zx=ve("folder-open",bP);const wP=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],SP=ve("folder-plus",wP);const jP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],CP=ve("folder-tree",jP);const NP=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],uh=ve("folder",NP);const kP=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],_P=ve("git-compare",kP);const EP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],TP=ve("globe",EP);const MP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],RP=ve("grid-3x3",MP);const AP=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Qx=ve("hash",AP);const OP=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],DP=ve("heading-2",OP);const zP=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],PP=ve("heart",zP);const LP=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],ck=ve("history",LP);const IP=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],$h=ve("house",IP);const $P=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ns=ve("image",$P);const FP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],BP=ve("info",FP);const UP=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],qP=ve("italic",UP);const VP=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Kx=ve("layers",VP);const HP=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],YP=ve("layout-dashboard",HP);const WP=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],pu=ve("link-2",WP);const GP=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],uk=ve("link",GP);const ZP=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],gu=ve("list",ZP);const QP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],vu=ve("loader-circle",QP);const KP=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Xx=ve("lock",KP);const XP=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],JP=ve("log-out",XP);const e5=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],t5=ve("mail",e5);const n5=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],r5=ve("map-pin",n5);const s5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],a5=ve("message-square",s5);const o5=[["path",{d:"M5 12h14",key:"1ays0h"}]],i5=ve("minus",o5);const l5=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],c5=ve("monitor",l5);const u5=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],d5=ve("moon",u5);const f5=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Jx=ve("music",f5);const h5=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],m5=ve("package",h5);const p5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],g5=ve("panel-left",p5);const v5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],fa=ve("pencil",v5);const x5=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],y5=ve("phone",x5);const b5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Un=ve("plus",b5);const w5=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],S5=ve("quote",w5);const j5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ey=ve("refresh-cw",j5);const C5=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xu=ve("rotate-ccw",C5);const N5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Al=ve("search",N5);const k5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],_5=ve("settings-2",k5);const E5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],dk=ve("settings",E5);const T5=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],M5=ve("square-check-big",T5);const R5=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],A5=ve("square-pen",R5);const O5=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],D5=ve("star",O5);const z5=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],P5=ve("sun",z5);const L5=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Po=ve("tag",L5);const I5=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],ty=ve("tags",I5);const $5=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],ny=ve("text-align-start",$5);const F5=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],ry=ve("toggle-left",F5);const B5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Fn=ve("trash-2",B5);const U5=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],q5=ve("trending-up",U5);const V5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Fo=ve("triangle-alert",V5);const H5=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],sy=ve("upload",H5);const Y5=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],fk=ve("user",Y5);const W5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],G5=ve("users",W5);const Z5=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],ay=ve("video",Z5);const Q5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],At=ve("x",Q5);var xs=[],fj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Cf=0,K5=fj.length;Cf<K5;++Cf)xs[Cf]=fj[Cf];function X5(e){return xs[e>>18&63]+xs[e>>12&63]+xs[e>>6&63]+xs[e&63]}function J5(e,t,n){for(var r,o=[],l=t;l<n;l+=3)r=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),o.push(X5(r));return o.join("")}function dh(e){for(var t,n=e.length,r=n%3,o=[],l=16383,u=0,d=n-r;u<d;u+=l)o.push(J5(e,u,u+l>d?d:u+l));return r===1?(t=e[n-1],o.push(xs[t>>2]+xs[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],o.push(xs[t>>10]+xs[t>>4&63]+xs[t<<2&63]+"=")),o.join("")}function eL(e){const t=typeof e=="object",n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name==="Object";return t&&r}const tL=!0,fh=BigInt("-9223372036854775808"),hk=BigInt("9223372036854775807"),nL=BigInt("0"),rL=BigInt("8");BigInt("256");function sL(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function aL(e){e<nL&&(e-=fh+fh);let t=e.toString(16);t.length%2===1&&(t="0"+t);const n=new Uint8Array(new ArrayBuffer(8));let r=0;for(const o of t.match(/.{2}/g).reverse())n.set([parseInt(o,16)],r++),e>>=rL;return dh(n)}function oL(e){if(e<fh||hk<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),dh(new Uint8Array(t))}const iL=DataView.prototype.setBigInt64?oL:aL,hj=1024;function lL(e){if(e.length>hj)throw new Error(`Field name ${e} exceeds maximum field name length ${hj}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||n>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}const mj=16384;function Hf(e){const t=JSON.stringify(e,(n,r)=>r===void 0?"undefined":typeof r=="bigint"?`${r.toString()}n`:r);if(t.length>mj){const n="[...truncated]";let r=mj-n.length;const o=t.codePointAt(r-1);return o!==void 0&&o>65535&&(r-=1),t.substring(0,r)+n}return t}function ax(e,t,n,r){if(e===void 0){const u=n&&` (present at path ${n} in original object ${Hf(t)})`;throw new Error(`undefined is not a valid Convex value${u}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<fh||hk<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:iL(e)}}if(typeof e=="number")if(sL(e)){const u=new ArrayBuffer(8);return new DataView(u).setFloat64(0,e,tL),{$float:dh(new Uint8Array(u))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:dh(new Uint8Array(e))};if(Array.isArray(e))return e.map((u,d)=>ax(u,t,n+`[${d}]`));if(e instanceof Set)throw new Error(cv(n,"Set",[...e],t));if(e instanceof Map)throw new Error(cv(n,"Map",[...e],t));if(!eL(e)){const u=e?.constructor?.name,d=u?`${u} `:"";throw new Error(cv(n,d,e,t))}const o={},l=Object.entries(e);l.sort(([u,d],[h,m])=>u===h?0:u<h?-1:1);for(const[u,d]of l)d!==void 0&&(lL(u),o[u]=ax(d,t,n+`.${u}`));return o}function cv(e,t,n,r){return e?`${t}${Hf(n)} is not a supported Convex type (present at path ${e} in original object ${Hf(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${Hf(n)} is not a supported Convex type.`}function cL(e){return ax(e,e,"")}var uL=Object.defineProperty,dL=(e,t,n)=>t in e?uL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lt=(e,t,n)=>dL(e,typeof t!="symbol"?t+"":t,n);const fL="https://docs.convex.dev/error#undefined-validator";function yu(e,t){const n=t!==void 0?` for field "${t}"`:"";throw new Error(`A validator is undefined${n} in ${e}. This is often caused by circular imports. See ${fL} for details.`)}class Cr{constructor({isOptional:t}){Lt(this,"type"),Lt(this,"fieldPaths"),Lt(this,"isOptional"),Lt(this,"isConvexValidator"),this.isOptional=t,this.isConvexValidator=!0}}class oy extends Cr{constructor({isOptional:t,tableName:n}){if(super({isOptional:t}),Lt(this,"tableName"),Lt(this,"kind","id"),typeof n!="string")throw new Error("v.id(tableName) requires a string");this.tableName=n}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new oy({isOptional:"optional",tableName:this.tableName})}}class hh extends Cr{constructor(){super(...arguments),Lt(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new hh({isOptional:"optional"})}}class mh extends Cr{constructor(){super(...arguments),Lt(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new mh({isOptional:"optional"})}}class iy extends Cr{constructor(){super(...arguments),Lt(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new iy({isOptional:"optional"})}}class ly extends Cr{constructor(){super(...arguments),Lt(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new ly({isOptional:"optional"})}}class cy extends Cr{constructor(){super(...arguments),Lt(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new cy({isOptional:"optional"})}}class uy extends Cr{constructor(){super(...arguments),Lt(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new uy({isOptional:"optional"})}}class dy extends Cr{constructor(){super(...arguments),Lt(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new dy({isOptional:"optional"})}}class Eo extends Cr{constructor({isOptional:t,fields:n}){super({isOptional:t}),Lt(this,"fields"),Lt(this,"kind","object"),globalThis.Object.entries(n).forEach(([r,o])=>{if(o===void 0&&yu("v.object()",r),!o.isConvexValidator)throw new Error("v.object() entries must be validators")}),this.fields=n}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([t,n])=>[t,{fieldType:n.json,optional:n.isOptional==="optional"}]))}}asOptional(){return new Eo({isOptional:"optional",fields:this.fields})}omit(...t){const n={...this.fields};for(const r of t)delete n[r];return new Eo({isOptional:this.isOptional,fields:n})}pick(...t){const n={};for(const r of t)n[r]=this.fields[r];return new Eo({isOptional:this.isOptional,fields:n})}partial(){const t={};for(const[n,r]of globalThis.Object.entries(this.fields))t[n]=r.asOptional();return new Eo({isOptional:this.isOptional,fields:t})}extend(t){return new Eo({isOptional:this.isOptional,fields:{...this.fields,...t}})}}class fy extends Cr{constructor({isOptional:t,value:n}){if(super({isOptional:t}),Lt(this,"value"),Lt(this,"kind","literal"),typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&typeof n!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=n}get json(){return{type:this.kind,value:cL(this.value)}}asOptional(){return new fy({isOptional:"optional",value:this.value})}}class hy extends Cr{constructor({isOptional:t,element:n}){super({isOptional:t}),Lt(this,"element"),Lt(this,"kind","array"),n===void 0&&yu("v.array()"),this.element=n}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new hy({isOptional:"optional",element:this.element})}}class my extends Cr{constructor({isOptional:t,key:n,value:r}){if(super({isOptional:t}),Lt(this,"key"),Lt(this,"value"),Lt(this,"kind","record"),n===void 0&&yu("v.record()","key"),r===void 0&&yu("v.record()","value"),n.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(r.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!n.isConvexValidator||!r.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=n,this.value=r}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new my({isOptional:"optional",key:this.key,value:this.value})}}class py extends Cr{constructor({isOptional:t,members:n}){super({isOptional:t}),Lt(this,"members"),Lt(this,"kind","union"),n.forEach((r,o)=>{if(r===void 0&&yu("v.union()",`member at index ${o}`),!r.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=n}get json(){return{type:this.kind,value:this.members.map(t=>t.json)}}asOptional(){return new py({isOptional:"optional",members:this.members})}}const Tt={id:e=>new oy({isOptional:"required",tableName:e}),null:()=>new uy({isOptional:"required"}),number:()=>new hh({isOptional:"required"}),float64:()=>new hh({isOptional:"required"}),bigint:()=>new mh({isOptional:"required"}),int64:()=>new mh({isOptional:"required"}),boolean:()=>new iy({isOptional:"required"}),string:()=>new cy({isOptional:"required"}),bytes:()=>new ly({isOptional:"required"}),literal:e=>new fy({isOptional:"required",value:e}),array:e=>new hy({isOptional:"required",element:e}),object:e=>new Eo({isOptional:"required",fields:e}),record:(e,t)=>new my({isOptional:"required",key:e,value:t}),union:(...e)=>new py({isOptional:"required",members:e}),any:()=>new dy({isOptional:"required"}),optional:e=>e.asOptional(),nullable:e=>Tt.union(e,Tt.null())};Tt.union(Tt.literal("admin"),Tt.literal("editor"),Tt.literal("author"),Tt.literal("viewer"));const hL=Tt.union(Tt.literal("contentTypes"),Tt.literal("contentEntries"),Tt.literal("mediaItems"),Tt.literal("settings"),Tt.literal("users")),mL=Tt.union(Tt.literal("create"),Tt.literal("read"),Tt.literal("update"),Tt.literal("delete"),Tt.literal("publish"),Tt.literal("unpublish"),Tt.literal("restore"),Tt.literal("manage"),Tt.literal("move"));Tt.object({resource:hL,action:mL,scope:Tt.optional(Tt.union(Tt.literal("all"),Tt.literal("own")))});function el(e,t="all"){return[{resource:e,action:"create",scope:t},{resource:e,action:"read",scope:t},{resource:e,action:"update",scope:t},{resource:e,action:"delete",scope:t}]}function ol(e,t="all"){return[{resource:e,action:"read",scope:t}]}function mk(e="all"){return[{resource:"contentEntries",action:"publish",scope:e},{resource:"contentEntries",action:"unpublish",scope:e}]}const pL={name:"admin",displayName:"Administrator",description:"Full access to all CMS features including settings and content type management",isSystem:!0,permissions:[...el("contentTypes"),...el("contentEntries"),...mk(),{resource:"contentEntries",action:"restore"},...el("mediaItems"),{resource:"settings",action:"manage"},...ol("settings"),...el("users"),{resource:"users",action:"manage"}]},gL={name:"editor",displayName:"Editor",description:"Can manage all content and media, but cannot modify settings or content types",isSystem:!0,permissions:[...ol("contentTypes"),...el("contentEntries"),...mk(),{resource:"contentEntries",action:"restore"},...el("mediaItems")]},vL={name:"author",displayName:"Author",description:"Can create and manage own content and media",isSystem:!0,permissions:[...ol("contentTypes"),{resource:"contentEntries",action:"create"},{resource:"contentEntries",action:"read",scope:"own"},{resource:"contentEntries",action:"update",scope:"own"},{resource:"contentEntries",action:"delete",scope:"own"},{resource:"contentEntries",action:"publish",scope:"own"},{resource:"contentEntries",action:"unpublish",scope:"own"},{resource:"mediaItems",action:"create"},{resource:"mediaItems",action:"read",scope:"all"},{resource:"mediaItems",action:"update",scope:"own"},{resource:"mediaItems",action:"delete",scope:"own"}]},xL={name:"viewer",displayName:"Viewer",description:"Read-only access to published content and media",isSystem:!0,permissions:[...ol("contentTypes"),...ol("contentEntries"),...ol("mediaItems")]},gy={admin:pL,editor:gL,author:vL,viewer:xL};function yL(e,t){if(e.resource!==t.resource||e.action!==t.action)return!1;const n=e.scope??"all",r=t.scope??"all";return n==="all"?!0:r==="own"}function pk(e,t,n){const r=gy[e]??n?.[e];return r?r.permissions.some(o=>yL(o,t)):!1}function bL(e,t){return(gy[e]??t?.[e])?.permissions??[]}function wL(e,t){return gy[e]??t?.[e]}function gk(e,t,n){return bL(e,n).filter(r=>r.resource===t)}function SL(e,t,n){return gk(e,t,n).length>0}const vk=p.createContext(null);function jL({children:e,getUser:t,getUserRole:n,onLogout:r,autoRedirectToLogin:o=!1,loginUrl:l="/login"}){const[u,d]=p.useState(null),[h,m]=p.useState(null),[v,g]=p.useState("loading"),[y,w]=p.useState(null),S=p.useCallback(async()=>{g("loading"),w(null);try{const E=await t();if(!E){d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l);return}const M=await n({userId:E.id});d(E),m(M),g("authenticated")}catch(E){console.error("Authentication error:",E),d(null),m(null),w(E instanceof Error?E.message:"Authentication failed"),g("error")}},[t,n,o,l]);p.useEffect(()=>{S()},[S]);const j=p.useCallback(E=>h?pk(h,E):!1,[h]),N=p.useCallback(async()=>{try{r&&await r(),d(null),m(null),g("unauthenticated"),o&&typeof window<"u"&&(window.location.href=l)}catch(E){console.error("Logout error:",E),w(E instanceof Error?E.message:"Logout failed")}},[r,o,l]),C=p.useCallback(async()=>{await S()},[S]),_={user:u,role:h,authState:v,isLoading:v==="loading",isAuthenticated:v==="authenticated",error:y,checkPermission:j,logout:N,refresh:C};return i.jsx(vk.Provider,{value:_,children:e})}function vy(){const e=p.useContext(vk);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const xk=p.createContext(null),yk="convex-cms-theme";function pj(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function gj(){if(typeof window>"u")return"system";const e=localStorage.getItem(yk);return e==="light"||e==="dark"||e==="system"?e:"system"}function uv(){return typeof window>"u"?!1:document.documentElement.classList.contains("dark")}function CL({children:e,themeMode:t="isolated",darkModeControl:n="independent"}){const r=t==="isolated"||n==="independent",o=t==="inherit"&&n==="follow-parent",[l,u]=p.useState(()=>o?uv()?"dark":"light":gj()),[d,h]=p.useState(()=>{if(o)return uv()?"dark":"light";const g=gj();return g==="system"?pj():g}),m=p.useCallback(g=>{const y=g==="system"?pj():g;if(h(y),r){const w=document.documentElement;w.classList.remove("light","dark"),w.classList.add(y)}},[r]),v=p.useCallback(g=>{r&&(u(g),localStorage.setItem(yk,g),m(g))},[m,r]);return p.useEffect(()=>{o||m(l)},[l,m,o]),p.useEffect(()=>{if(!o){const g=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{l==="system"&&m("system")};return g.addEventListener("change",y),()=>g.removeEventListener("change",y)}},[l,m,o]),p.useEffect(()=>{if(!o)return;const g=()=>{const S=uv()?"dark":"light";u(S),h(S)};g();const y=new MutationObserver(w=>{for(const S of w)if(S.type==="attributes"&&S.attributeName==="class"){g();break}});return y.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>y.disconnect()},[o]),i.jsx(xk.Provider,{value:{theme:l,resolvedTheme:d,setTheme:v,canToggleDarkMode:r},children:e})}function NL(){const e=p.useContext(xk);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function fe(e,t,n){function r(d,h){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:h,constr:u,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,h);const m=u.prototype,v=Object.keys(m);for(let g=0;g<v.length;g++){const y=v[g];y in d||(d[y]=m[y].bind(d))}}const o=n?.Parent??Object;class l extends o{}Object.defineProperty(l,"name",{value:e});function u(d){var h;const m=n?.Parent?new l:this;r(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(u,"init",{value:r}),Object.defineProperty(u,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class il extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bk extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const wk={};function Wa(e){return wk}function Sk(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ox(e,t){return typeof t=="bigint"?t.toString():t}function xy(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function yy(e){return e==null}function by(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function kL(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const h=r.match(/\d?e-(\d?)/);h?.[1]&&(o=Number.parseInt(h[1]))}const l=n>o?n:o,u=Number.parseInt(e.toFixed(l).replace(".","")),d=Number.parseInt(t.toFixed(l).replace(".",""));return u%d/10**l}const vj=Symbol("evaluating");function Nt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==vj)return r===void 0&&(r=vj,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Zo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ja(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function xj(e){return JSON.stringify(e)}function _L(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jk="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ph(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const EL=xy(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function gl(e){if(ph(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ph(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ck(e){return gl(e)?{...e}:Array.isArray(e)?[...e]:e}const TL=new Set(["string","number","symbol"]);function Fh(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function $e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ML(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const RL={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function AL(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const l=Ja(e._zod.def,{get shape(){const u={};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&(u[d]=n.shape[d])}return Zo(this,"shape",u),u},checks:[]});return eo(e,l)}function OL(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const l=Ja(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const d in t){if(!(d in n.shape))throw new Error(`Unrecognized key: "${d}"`);t[d]&&delete u[d]}return Zo(this,"shape",u),u},checks:[]});return eo(e,l)}function DL(e,t){if(!gl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const l=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(l,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Ja(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return Zo(this,"shape",l),l}});return eo(e,o)}function zL(e,t){if(!gl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Zo(this,"shape",r),r}});return eo(e,n)}function PL(e,t){const n=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Zo(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return eo(e,n)}function LL(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ja(t._zod.def,{get shape(){const d=t._zod.def.shape,h={...d};if(n)for(const m in n){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);n[m]&&(h[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)h[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Zo(this,"shape",h),h},checks:[]});return eo(t,u)}function IL(e,t,n){const r=Ja(t._zod.def,{get shape(){const o=t._zod.def.shape,l={...o};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)l[u]=new e({type:"nonoptional",innerType:o[u]});return Zo(this,"shape",l),l}});return eo(t,r)}function tl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function nl(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Nf(e){return typeof e=="string"?e:e?.message}function Ga(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Nf(e.inst?._zod.def?.error?.(e))??Nf(t?.error?.(e))??Nf(n.customError?.(e))??Nf(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function wy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function bu(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Nk=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ox,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kk=fe("$ZodError",Nk),_k=fe("$ZodError",Nk,{Parent:Error});function $L(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function FL(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const l of o.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>r({issues:u}));else if(l.code==="invalid_key")r({issues:l.issues});else if(l.code==="invalid_element")r({issues:l.issues});else if(l.path.length===0)n._errors.push(t(l));else{let u=n,d=0;for(;d<l.path.length;){const h=l.path[d];d===l.path.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(l))):u[h]=u[h]||{_errors:[]},u=u[h],d++}}};return r(e),n}const Sy=e=>(t,n,r,o)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise)throw new il;if(u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ga(h,l,Wa())));throw jk(d,o?.callee),d}return u.value},jy=e=>async(t,n,r,o)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},l);if(u instanceof Promise&&(u=await u),u.issues.length){const d=new(o?.Err??e)(u.issues.map(h=>Ga(h,l,Wa())));throw jk(d,o?.callee),d}return u.value},Bh=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},o);if(l instanceof Promise)throw new il;return l.issues.length?{success:!1,error:new(e??kk)(l.issues.map(u=>Ga(u,o,Wa())))}:{success:!0,data:l.value}},BL=Bh(_k),Uh=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},o);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(u=>Ga(u,o,Wa())))}:{success:!0,data:l.value}},UL=Uh(_k),qL=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Sy(e)(t,n,o)},VL=e=>(t,n,r)=>Sy(e)(t,n,r),HL=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return jy(e)(t,n,o)},YL=e=>async(t,n,r)=>jy(e)(t,n,r),WL=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bh(e)(t,n,o)},GL=e=>(t,n,r)=>Bh(e)(t,n,r),ZL=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Uh(e)(t,n,o)},QL=e=>async(t,n,r)=>Uh(e)(t,n,r),KL=/^[cC][^\s-]{8,}$/,XL=/^[0-9a-z]+$/,JL=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,eI=/^[0-9a-vA-V]{20}$/,tI=/^[A-Za-z0-9]{27}$/,nI=/^[a-zA-Z0-9_-]{21}$/,rI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yj=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,aI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,oI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iI(){return new RegExp(oI,"u")}const lI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,uI=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,dI=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ek=/^[A-Za-z0-9_-]*$/,hI=/^\+[1-9]\d{6,14}$/,Tk="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",mI=new RegExp(`^${Tk}$`);function Mk(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pI(e){return new RegExp(`^${Mk(e)}$`)}function gI(e){const t=Mk({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Tk}T(?:${r})$`)}const vI=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},xI=/^-?\d+$/,Rk=/^-?\d+(?:\.\d+)?$/,yI=/^(?:true|false)$/i,bI=/^[^A-Z]*$/,wI=/^[^a-z]*$/,rr=fe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ak={number:"number",bigint:"bigint",object:"date"},Ok=fe("$ZodCheckLessThan",(e,t)=>{rr.init(e,t);const n=Ak[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,l=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<l&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dk=fe("$ZodCheckGreaterThan",(e,t)=>{rr.init(e,t);const n=Ak[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,l=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>l&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),SI=fe("$ZodCheckMultipleOf",(e,t)=>{rr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):kL(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),jI=fe("$ZodCheckNumberFormat",(e,t)=>{rr.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,l]=RL[t.format];e._zod.onattach.push(u=>{const d=u._zod.bag;d.format=t.format,d.minimum=o,d.maximum=l,n&&(d.pattern=xI)}),e._zod.check=u=>{const d=u.value;if(n){if(!Number.isInteger(d)){u.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?u.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):u.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}d<o&&u.issues.push({origin:"number",input:d,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),d>l&&u.issues.push({origin:"number",input:d,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}}),CI=fe("$ZodCheckMaxLength",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!yy(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const u=wy(o);r.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),NI=fe("$ZodCheckMinLength",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!yy(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const u=wy(o);r.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),kI=fe("$ZodCheckLengthEquals",(e,t)=>{var n;rr.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!yy(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,l=o.length;if(l===t.length)return;const u=wy(o),d=l>t.length;r.issues.push({origin:u,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),qh=fe("$ZodCheckStringFormat",(e,t)=>{var n,r;rr.init(e,t),e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),_I=fe("$ZodCheckRegex",(e,t)=>{qh.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),EI=fe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=bI),qh.init(e,t)}),TI=fe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=wI),qh.init(e,t)}),MI=fe("$ZodCheckIncludes",(e,t)=>{rr.init(e,t);const n=Fh(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),RI=fe("$ZodCheckStartsWith",(e,t)=>{rr.init(e,t);const n=new RegExp(`^${Fh(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),AI=fe("$ZodCheckEndsWith",(e,t)=>{rr.init(e,t);const n=new RegExp(`.*${Fh(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),OI=fe("$ZodCheckOverwrite",(e,t)=>{rr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class DI{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
11
11
  `).filter(u=>u),o=Math.min(...r.map(u=>u.length-u.trimStart().length)),l=r.map(u=>u.slice(o)).map(u=>" ".repeat(this.indent*2)+u);for(const u of l)this.content.push(u)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(l=>` ${l}`)];return new t(...n,o.join(`
12
12
  `))}}const zI={major:4,minor:3,patch:6},Yt=fe("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zI;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const l of o._zod.onattach)l(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,d,h)=>{let m=tl(u),v;for(const g of d){if(g._zod.def.when){if(!g._zod.def.when(u))continue}else if(m)continue;const y=u.issues.length,w=g._zod.check(u);if(w instanceof Promise&&h?.async===!1)throw new il;if(v||w instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await w,u.issues.length!==y&&(m||(m=tl(u,y)))});else{if(u.issues.length===y)continue;m||(m=tl(u,y))}}return v?v.then(()=>u):u},l=(u,d,h)=>{if(tl(u))return u.aborted=!0,u;const m=o(d,r,h);if(m instanceof Promise){if(h.async===!1)throw new il;return m.then(v=>e._zod.parse(v,h))}return e._zod.parse(m,h)};e._zod.run=(u,d)=>{if(d.skipChecks)return e._zod.parse(u,d);if(d.direction==="backward"){const m=e._zod.parse({value:u.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(v=>l(v,u,d)):l(m,u,d)}const h=e._zod.parse(u,d);if(h instanceof Promise){if(d.async===!1)throw new il;return h.then(m=>o(m,r,d))}return o(h,r,d)}}Nt(e,"~standard",()=>({validate:o=>{try{const l=BL(e,o);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return UL(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),Cy=fe("$ZodString",(e,t)=>{Yt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vI(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),It=fe("$ZodStringFormat",(e,t)=>{qh.init(e,t),Cy.init(e,t)}),PI=fe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=sI),It.init(e,t)}),LI=fe("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=yj(r))}else t.pattern??(t.pattern=yj());It.init(e,t)}),II=fe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=aI),It.init(e,t)}),$I=fe("$ZodURL",(e,t)=>{It.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),FI=fe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=iI()),It.init(e,t)}),BI=fe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=nI),It.init(e,t)}),UI=fe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=KL),It.init(e,t)}),qI=fe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=XL),It.init(e,t)}),VI=fe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=JL),It.init(e,t)}),HI=fe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eI),It.init(e,t)}),YI=fe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tI),It.init(e,t)}),WI=fe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=gI(t)),It.init(e,t)}),GI=fe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mI),It.init(e,t)}),ZI=fe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pI(t)),It.init(e,t)}),QI=fe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rI),It.init(e,t)}),KI=fe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=lI),It.init(e,t),e._zod.bag.format="ipv4"}),XI=fe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=cI),It.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),JI=fe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=uI),It.init(e,t)}),e$=fe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=dI),It.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,l]=r;if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function zk(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const t$=fe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=fI),It.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{zk(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function n$(e){if(!Ek.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return zk(n)}const r$=fe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ek),It.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{n$(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),s$=fe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=hI),It.init(e,t)});function a$(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const o$=fe("$ZodJWT",(e,t)=>{It.init(e,t),e._zod.check=n=>{a$(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Pk=fe("$ZodNumber",(e,t)=>{Yt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Rk,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const l=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...l?{received:l}:{}}),n}}),i$=fe("$ZodNumberFormat",(e,t)=>{jI.init(e,t),Pk.init(e,t)}),l$=fe("$ZodBoolean",(e,t)=>{Yt.init(e,t),e._zod.pattern=yI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),c$=fe("$ZodUnknown",(e,t)=>{Yt.init(e,t),e._zod.parse=n=>n}),u$=fe("$ZodNever",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function bj(e,t,n){e.issues.length&&t.issues.push(...nl(n,e.issues)),t.value[n]=e.value}const d$=fe("$ZodArray",(e,t)=>{Yt.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const l=[];for(let u=0;u<o.length;u++){const d=o[u],h=t.element._zod.run({value:d,issues:[]},r);h instanceof Promise?l.push(h.then(m=>bj(m,n,u))):bj(h,n,u)}return l.length?Promise.all(l).then(()=>n):n}});function gh(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...nl(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Lk(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=ML(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ik(e,t,n,r,o,l){const u=[],d=o.keySet,h=o.catchall._zod,m=h.def.type,v=h.optout==="optional";for(const g in t){if(d.has(g))continue;if(m==="never"){u.push(g);continue}const y=h.run({value:t[g],issues:[]},r);y instanceof Promise?e.push(y.then(w=>gh(w,n,g,t,v))):gh(y,n,g,t,v)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:l}),e.length?Promise.all(e).then(()=>n):n}const f$=fe("$ZodObject",(e,t)=>{if(Yt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...d};return Object.defineProperty(t,"shape",{value:h}),h}})}const r=xy(()=>Lk(t));Nt(e._zod,"propValues",()=>{const d=t.shape,h={};for(const m in d){const v=d[m]._zod;if(v.values){h[m]??(h[m]=new Set);for(const g of v.values)h[m].add(g)}}return h});const o=ph,l=t.catchall;let u;e._zod.parse=(d,h)=>{u??(u=r.value);const m=d.value;if(!o(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const v=[],g=u.shape;for(const y of u.keys){const w=g[y],S=w._zod.optout==="optional",j=w._zod.run({value:m[y],issues:[]},h);j instanceof Promise?v.push(j.then(N=>gh(N,d,y,m,S))):gh(j,d,y,m,S)}return l?Ik(v,m,d,h,r.value,e):v.length?Promise.all(v).then(()=>d):d}}),h$=fe("$ZodObjectJIT",(e,t)=>{f$.init(e,t);const n=e._zod.parse,r=xy(()=>Lk(t)),o=y=>{const w=new DI(["shape","payload","ctx"]),S=r.value,j=E=>{const M=xj(E);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};w.write("const input = payload.value;");const N=Object.create(null);let C=0;for(const E of S.keys)N[E]=`key_${C++}`;w.write("const newResult = {};");for(const E of S.keys){const M=N[E],A=xj(E),T=y[E]?._zod?.optout==="optional";w.write(`const ${M} = ${j(E)};`),T?w.write(`
13
13
  if (${M}.issues.length) {