lg-dev-manager-bridge 1.0.2 → 1.0.3
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.
- package/README.md +6 -0
- package/dist/cli.js +44 -44
- package/package.json +3 -3
- package/web/assets/{index-CWU_4o5k.js → index-DxHthEKA.js} +2 -2
- package/web/index.html +1 -1
|
@@ -8,7 +8,7 @@ Error generating stack: `+a.message+`
|
|
|
8
8
|
`+a.stack}}var bi=Object.prototype.hasOwnProperty,Ss=s.unstable_scheduleCallback,Fi=s.unstable_cancelCallback,Tl=s.unstable_shouldYield,rr=s.unstable_requestPaint,ns=s.unstable_now,ai=s.unstable_getCurrentPriorityLevel,Vi=s.unstable_ImmediatePriority,fa=s.unstable_UserBlockingPriority,kl=s.unstable_NormalPriority,hS=s.unstable_LowPriority,Nm=s.unstable_IdlePriority,dS=s.log,fS=s.unstable_setDisableYieldValue,ma=null,xs=null;function qi(e){if(typeof dS=="function"&&fS(e),xs&&typeof xs.setStrictMode=="function")try{xs.setStrictMode(ma,e)}catch{}}var ws=Math.clz32?Math.clz32:gS,mS=Math.log,pS=Math.LN2;function gS(e){return e>>>=0,e===0?32:31-(mS(e)/pS|0)|0}var Rl=256,Dl=262144,Al=4194304;function jn(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ol(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var u=0,m=e.suspendedLanes,R=e.pingedLanes;e=e.warmLanes;var H=a&134217727;return H!==0?(a=H&~m,a!==0?u=jn(a):(R&=H,R!==0?u=jn(R):i||(i=H&~e,i!==0&&(u=jn(i))))):(H=a&~m,H!==0?u=jn(H):R!==0?u=jn(R):i||(i=a&~e,i!==0&&(u=jn(i)))),u===0?0:t!==0&&t!==u&&(t&m)===0&&(m=u&-u,i=t&-t,m>=i||m===32&&(i&4194048)!==0)?t:u}function pa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function jm(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var a=31-ws(i),u=1<<a;t|=e[a],i&=~u}return t}function vS(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Tm(){var e=Al;return Al<<=1,(Al&62914560)===0&&(Al=4194304),e}function Kc(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ga(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _S(e,t,i,a,u,m){var R=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var H=e.entanglements,K=e.expirationTimes,ie=e.hiddenUpdates;for(i=R&~i;0<i;){var oe=31-ws(i),_e=1<<oe;H[oe]=0,K[oe]=-1;var te=ie[oe];if(te!==null)for(ie[oe]=null,oe=0;oe<te.length;oe++){var ae=te[oe];ae!==null&&(ae.lane&=-536870913)}i&=~_e}a!==0&&km(e,a,0),m!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=m&~(R&~t))}function km(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-ws(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function Rm(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-ws(i),u=1<<a;u&t|e[a]&t&&(e[a]|=t),i&=~u}}function Dm(e,t){var i=t&-t;return i=(i&42)!==0?1:Gc(i),(i&(e.suspendedLanes|t))!==0?0:i}function Gc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Yc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Am(){var e=ge.p;return e!==0?e:(e=window.event,e===void 0?32:U_(e.type))}function Om(e,t){var i=ge.p;try{return ge.p=e,t()}finally{ge.p=i}}var Si=Math.random().toString(36).slice(2),qt="__reactFiber$"+Si,us="__reactProps$"+Si,ar="__reactContainer$"+Si,Lm="__reactEvents$"+Si,yS="__reactListeners$"+Si,bS="__reactHandles$"+Si,Mm="__reactResources$"+Si,va="__reactMarker$"+Si,Ll="__reactLoad$"+Si;function Ml(e){delete e[qt],delete e[us],delete e[yS],delete e[bS]}function Tn(e){var t;if(t=e[qt])return t;for(var i=e.parentNode;i;){if(t=i[ar]||i[qt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=y_(e);e!==null;){if(i=e[qt])return i;e=y_(e)}return t}e=i,i=e.parentNode}return null}function lr(e){if(e=e[qt]||e[ar]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _a(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function or(e){var t=e[Mm];return t||(t=e[Mm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ut(e){e[va]=!0}function Bm(e){e[Ll]=void 0}var Im=new Set,Hm={};function kn(e,t){cr(e,t),cr(e+"Capture",t)}function cr(e,t){for(Hm[e]=t,e=0;e<t.length;e++)Im.add(t[e])}var SS=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]*$"),Um={},zm={};function xS(e){return bi.call(zm,e)?!0:bi.call(Um,e)?!1:SS.test(e)?zm[e]=!0:(Um[e]=!0,!1)}var it=!1;function $m(){var e=it;return it=!1,e}function Bl(e,t,i){if(xS(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function Il(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function xi(e,t,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,a)}}function Cs(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wS(e,t,i){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,m=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(R){i=""+R,m.call(this,R)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(R){i=""+R},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zc(e){if(!e._valueTracker){var t=Pm(e)?"checked":"value";e._valueTracker=wS(e,t,""+e[t])}}function Fm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=Pm(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}var CS=/[\n"\\]/g;function Ls(e){return e.replace(CS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Xc(e,t,i,a,u,m,R,H){e.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.type=R:e.removeAttribute("type"),t!=null?R==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Cs(t)):e.value!==""+Cs(t)&&(e.value=""+Cs(t)):R!=="submit"&&R!=="reset"||e.removeAttribute("value"),t!=null?R==="number"&&e.value==t?Wc(e,Cs(e.value)):Wc(e,Cs(t)):i!=null?Wc(e,Cs(i)):a!=null&&e.removeAttribute("value"),u==null&&m!=null&&(e.defaultChecked=!!m),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?e.name=""+Cs(H):e.removeAttribute("name")}function Vm(e,t,i,a,u,m,R,H){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){Zc(e);return}i=i!=null?""+Cs(i):"",t=t!=null?""+Cs(t):i,H||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=H?e.checked:!!a,e.defaultChecked=!!a,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(e.name=R),Zc(e)}function Wc(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ur(e,t,i,a){if(e=e.options,t){t={};for(var u=0;u<i.length;u++)t["$"+i[u]]=!0;for(i=0;i<e.length;i++)u=t.hasOwnProperty("$"+e[i].value),e[i].selected!==u&&(e[i].selected=u),u&&a&&(e[i].defaultSelected=!0)}else{for(i=""+Cs(i),t=null,u=0;u<e.length;u++){if(e[u].value===i){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function qm(e,t,i){if(t!=null&&(t=""+Cs(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Cs(i):""}function Km(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(o(92));if(pe(a)){if(1<a.length)throw Error(o(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=Cs(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Zc(e)}function hr(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ES=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 Gm(e,t,i){var a=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,i):typeof i!="number"||i===0||ES.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Ym(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var a in i)!i.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="",it=!0);for(var u in t)a=t[u],t.hasOwnProperty(u)&&i[u]!==a&&(Gm(e,u,a),it=!0)}else for(var m in t)t.hasOwnProperty(m)&&Gm(e,m,t[m])}function Qc(e){if(e.indexOf("-")===-1)return!1;switch(e){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 NS=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"],["maskType","mask-type"],["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"]]),jS=/^[\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 Hl(e){return jS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function li(){}var Jc=null;function eu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dr=null,fr=null;function Zm(e){var t=lr(e);if(t&&(e=t.stateNode)){var i=e[us]||null;e:switch(e=t.stateNode,t.type){case"input":if(Xc(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Ls(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var a=i[t];if(a!==e&&a.form===e.form){var u=a[us]||null;if(!u)throw Error(o(90));Xc(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<i.length;t++)a=i[t],a.form===e.form&&Fm(a)}break e;case"textarea":qm(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ur(e,!!i.multiple,t,!1)}}}var tu=!1;function Xm(e,t,i){if(tu)return e(t,i);tu=!0;try{var a=e(t);return a}finally{if(tu=!1,(dr!==null||fr!==null)&&(Uo(),dr&&(t=dr,e=fr,fr=dr=null,Zm(t),e)))for(t=0;t<e.length;t++)Zm(e[t])}}function ya(e,t){var i=e.stateNode;if(i===null)return null;var a=i[us]||null;if(a===null)return null;i=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),su=!1;if(wi)try{var ba={};Object.defineProperty(ba,"passive",{get:function(){su=!0}}),window.addEventListener("test",ba,ba),window.removeEventListener("test",ba,ba)}catch{su=!1}var Ki=null,iu=null,Ul=null;function Wm(){if(Ul)return Ul;var e,t=iu,i=t.length,a,u="value"in Ki?Ki.value:Ki.textContent,m=u.length;for(e=0;e<i&&t[e]===u[e];e++);var R=i-e;for(a=1;a<=R&&t[i-a]===u[m-a];a++);return Ul=u.slice(e,1<a?1-a:void 0)}function zl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $l(){return!0}function Qm(){return!1}function rs(e){function t(i,a,u,m,R){this._reactName=i,this._targetInst=u,this.type=a,this.nativeEvent=m,this.target=R,this.currentTarget=null;for(var H in e)e.hasOwnProperty(H)&&(i=e[H],this[H]=i?i(m):m[H]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?$l:Qm,this.isPropagationStopped=Qm,this}return O(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=$l)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=$l)},persist:function(){},isPersistent:$l}),t}var Gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pl=rs(Gi),Sa=O({},Gi,{view:0,detail:0}),TS=rs(Sa),nu,ru,xa,Fl=O({},Sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xa&&(xa&&e.type==="mousemove"?(nu=e.screenX-xa.screenX,ru=e.screenY-xa.screenY):ru=nu=0,xa=e),nu)},movementY:function(e){return"movementY"in e?e.movementY:ru}}),Jm=rs(Fl),kS=O({},Fl,{dataTransfer:0}),RS=rs(kS),DS=O({},Sa,{relatedTarget:0}),au=rs(DS),AS=O({},Gi,{animationName:0,elapsedTime:0,pseudoElement:0}),OS=rs(AS),LS=O({},Gi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),MS=rs(LS),BS=O({},Gi,{data:0}),ep=rs(BS),IS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},HS={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"},US={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=US[e])?!!t[e]:!1}function lu(){return zS}var $S=O({},Sa,{key:function(e){if(e.key){var t=IS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?HS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lu,charCode:function(e){return e.type==="keypress"?zl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),PS=rs($S),FS=O({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tp=rs(FS),VS=O({},Gi,{submitter:0}),qS=rs(VS),KS=O({},Sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lu}),GS=rs(KS),YS=O({},Gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ZS=rs(YS),XS=O({},Fl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),WS=rs(XS),QS=O({},Gi,{newState:0,oldState:0,source:0}),JS=rs(QS),e1=[9,13,27,32],ou=wi&&"CompositionEvent"in window,wa=null;wi&&"documentMode"in document&&(wa=document.documentMode);var t1=wi&&"TextEvent"in window&&!wa,sp=wi&&(!ou||wa&&8<wa&&11>=wa),ip=" ",np=!1;function rp(e,t){switch(e){case"keyup":return e1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ap(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mr=!1;function s1(e,t){switch(e){case"compositionend":return ap(t);case"keypress":return t.which!==32?null:(np=!0,ip);case"textInput":return e=t.data,e===ip&&np?null:e;default:return null}}function i1(e,t){if(mr)return e==="compositionend"||!ou&&rp(e,t)?(e=Wm(),Ul=iu=Ki=null,mr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return sp&&t.locale!=="ko"?null:t.data;default:return null}}var n1={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 lp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!n1[e.type]:t==="textarea"}function op(e,t,i,a){dr?fr?fr.push(a):fr=[a]:dr=a,t=qo(t,"onChange"),0<t.length&&(i=new Pl("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var Ca=null,Ea=null;function r1(e){Zv(e,0)}function Vl(e){var t=_a(e);if(Fm(t))return e}function cp(e,t){if(e==="change")return t}var up=!1;if(wi){var cu;if(wi){var uu="oninput"in document;if(!uu){var hp=document.createElement("div");hp.setAttribute("oninput","return;"),uu=typeof hp.oninput=="function"}cu=uu}else cu=!1;up=cu&&(!document.documentMode||9<document.documentMode)}function dp(){Ca&&(Ca.detachEvent("onpropertychange",fp),Ea=Ca=null)}function fp(e){if(e.propertyName==="value"&&Vl(Ea)){var t=[];op(t,Ea,e,eu(e)),Xm(r1,t)}}function a1(e,t,i){e==="focusin"?(dp(),Ca=t,Ea=i,Ca.attachEvent("onpropertychange",fp)):e==="focusout"&&dp()}function l1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vl(Ea)}function o1(e,t){if(e==="click")return Vl(t)}function c1(e,t){if(e==="input"||e==="change")return Vl(t)}function u1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Es=typeof Object.is=="function"?Object.is:u1;function Na(e,t){if(Es(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(a=0;a<i.length;a++){var u=i[a];if(!bi.call(t,u)||!Es(e[u],t[u]))return!1}return!0}function hu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function mp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pp(e,t){var i=mp(e);e=0;for(var a;i;){if(i.nodeType===3){if(a=e+i.textContent.length,e<=t&&a>=t)return{node:i,offset:t-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=mp(i)}}function gp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vp(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=hu(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=hu(e.document)}return t}function du(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var h1=wi&&"documentMode"in document&&11>=document.documentMode,pr=null,fu=null,ja=null,mu=!1;function _p(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;mu||pr==null||pr!==hu(a)||(a=pr,"selectionStart"in a&&du(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ja&&Na(ja,a)||(ja=a,a=qo(fu,"onSelect"),0<a.length&&(t=new Pl("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=pr)))}function Rn(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var gr={animationend:Rn("Animation","AnimationEnd"),animationiteration:Rn("Animation","AnimationIteration"),animationstart:Rn("Animation","AnimationStart"),transitionrun:Rn("Transition","TransitionRun"),transitionstart:Rn("Transition","TransitionStart"),transitioncancel:Rn("Transition","TransitionCancel"),transitionend:Rn("Transition","TransitionEnd")},pu={},yp={};wi&&(yp=document.createElement("div").style,"AnimationEvent"in window||(delete gr.animationend.animation,delete gr.animationiteration.animation,delete gr.animationstart.animation),"TransitionEvent"in window||delete gr.transitionend.transition);function Dn(e){if(pu[e])return pu[e];if(!gr[e])return e;var t=gr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in yp)return pu[e]=t[i];return e}var bp=Dn("animationend"),Sp=Dn("animationiteration"),xp=Dn("animationstart"),d1=Dn("transitionrun"),f1=Dn("transitionstart"),m1=Dn("transitioncancel"),wp=Dn("transitionend"),Cp=new Map,gu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");gu.push("scrollEnd");function Gs(e,t){Cp.set(e,t),kn(t,[e])}var p1=0;function Ci(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Ws.identifierPrefix;var i=p1++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function Ep(e){if(e==null||typeof e=="string")return e;var t=null,i=Br;if(i!==null)for(var a=0;a<i.length;a++){var u=e[i[a]];if(u!=null){if(u==="none")return"none";t=t==null?u:t+(" "+u)}}return t??e.default}function Ei(e,t){return e=Ep(e),t=Ep(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var ql=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ms=[],vr=0,vu=0;function Kl(){for(var e=vr,t=vu=vr=0;t<e;){var i=Ms[t];Ms[t++]=null;var a=Ms[t];Ms[t++]=null;var u=Ms[t];Ms[t++]=null;var m=Ms[t];if(Ms[t++]=null,a!==null&&u!==null){var R=a.pending;R===null?u.next=u:(u.next=R.next,R.next=u),a.pending=u}m!==0&&Np(i,u,m)}}function Gl(e,t,i,a){Ms[vr++]=e,Ms[vr++]=t,Ms[vr++]=i,Ms[vr++]=a,vu|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function _u(e,t,i,a){return Gl(e,t,i,a),Yl(e)}function An(e,t){return Gl(e,null,null,t),Yl(e)}function Np(e,t,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var u=!1,m=e.return;m!==null;)m.childLanes|=i,a=m.alternate,a!==null&&(a.childLanes|=i),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(u=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,u&&t!==null&&(u=31-ws(i),e=m.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=i|536870912),m):null}function Yl(e){if(50<Za)throw Za=0,Ho=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _r={};function g1(e,t,i,a){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hs(e,t,i,a){return new g1(e,t,i,a)}function yu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ni(e,t){var i=e.alternate;return i===null?(i=hs(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function jp(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zl(e,t,i,a,u,m){var R=0;if(a=e,typeof a=="function")yu(a)&&(R=1);else if(typeof a=="string")R=Vx(e,i,Bt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(a){case F:return e=hs(31,i,t,u),e.elementType=F,e.lanes=m,e;case q:return On(i.children,u,m,t);case Y:R=8,u|=24;break;case P:return e=hs(12,i,t,u|2),e.elementType=P,e.lanes=m,e;case W:return e=hs(13,i,t,u),e.elementType=W,e.lanes=m,e;case I:return e=hs(19,i,t,u),e.elementType=I,e.lanes=m,e;case $:case z:return e=u|32,e=hs(30,i,t,e),e.elementType=z,e.lanes=m,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case he:R=10;break e;case Q:R=9;break e;case ne:R=11;break e;case A:R=14;break e;case B:R=16,a=null;break e}R=29,i=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=hs(R,i,t,u),t.elementType=e,t.type=a,t.lanes=m,t}function On(e,t,i,a){return e=hs(7,e,a,t),e.lanes=i,e}function bu(e,t,i){return e=hs(6,e,null,t),e.lanes=i,e}function Tp(e){var t=hs(18,null,null,0);return t.stateNode=e,t}function Su(e,t,i){return t=hs(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var kp=new WeakMap;function Bs(e,t){if(typeof e=="object"&&e!==null){var i=kp.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Vt(t)},kp.set(e,t),t)}return{value:e,source:t,stack:Vt(t)}}var yr=[],br=0,Xl=null,Ta=0,Is=[],Hs=0,Yi=null,oi=1,ci="";function ji(e,t){yr[br++]=Ta,yr[br++]=Xl,Xl=e,Ta=t}function Rp(e,t,i){Is[Hs++]=oi,Is[Hs++]=ci,Is[Hs++]=Yi,Yi=e;var a=oi;e=ci;var u=32-ws(a)-1;a&=~(1<<u),i+=1;var m=32-ws(t)+u;if(30<m){var R=u-u%5;m=(a&(1<<R)-1).toString(32),a>>=R,u-=R,oi=1<<32-ws(t)+u|i<<u|a,ci=m+e}else oi=1<<m|i<<u|a,ci=e}function Wl(e){e.return!==null&&(ji(e,1),Rp(e,1,0))}function xu(e){for(;e===Xl;)Xl=yr[--br],yr[br]=null,Ta=yr[--br],yr[br]=null;for(;e===Yi;)Yi=Is[--Hs],Is[Hs]=null,ci=Is[--Hs],Is[Hs]=null,oi=Is[--Hs],Is[Hs]=null}function Dp(e,t){Is[Hs++]=oi,Is[Hs++]=ci,Is[Hs++]=Yi,oi=t.id,ci=t.overflow,Yi=e}var zt=null,mt=null,Fe=!1,Zi=null,Us=!1,wu=Error(o(519));function Xi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ka(Bs(t,e)),wu}function Ap(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[qt]=e,t[us]=a,i){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(i=0;i<Wa.length;i++)Ye(Wa[i],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),Vm(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),Km(t,a.value,a.defaultValue,a.children)}i=a.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||a.suppressHydrationWarning===!0||Jv(t.textContent,i)?(a.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),a.onScroll!=null&&Ye("scroll",t),a.onScrollEnd!=null&&Ye("scrollend",t),a.onClick!=null&&(t.onclick=li),t=!0):t=!1,t||Xi(e,!0)}function Ql(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:Us=!1;return;case 27:case 3:Us=!0;return;default:zt=zt.return}}function Sr(e){if(e!==zt)return!1;if(!Fe)return Ql(e),Fe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Jh(e.type,e.memoizedProps)),i=!i),i&&mt&&Xi(e),Ql(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));mt=__(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));mt=__(e)}else t===27?(t=mt,fn(e.type)?(e=od,od=null,mt=e):mt=t):mt=zt?$s(e.stateNode.nextSibling):null;return!0}function Ln(){mt=zt=null,Fe=!1}function Cu(){var e=Zi;return e!==null&&(ms===null?ms=e:ms.push.apply(ms,e),Zi=null),e}function ka(e){Zi===null?Zi=[e]:Zi.push(e)}var Eu=at(null),Mn=null,Ti=null;function Wi(e,t,i){Ke(Eu,t._currentValue),t._currentValue=i}function ki(e){e._currentValue=Eu.current,we(Eu)}function Jl(e,t,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===i)break;e=e.return}}function Nu(e,t,i,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var m=u.dependencies;if(m!==null){var R=u.child;m=m.firstContext;e:for(;m!==null;){var H=m;m=u;for(var K=0;K<t.length;K++)if(H.context===t[K]){m.lanes|=i,H=m.alternate,H!==null&&(H.lanes|=i),Jl(m.return,i,e),a||(R=null);break e}m=H.next}}else if(u.tag===18){if(R=u.return,R===null)throw Error(o(341));R.lanes|=i,m=R.alternate,m!==null&&(m.lanes|=i),Jl(R,i,e),R=null}else u.tag===13&&u.memoizedState!==null&&u.memoizedState.dehydrated===null?(u.lanes|=i,R=u.alternate,R!==null&&(R.lanes|=i),Jl(u.return,i,e),R=u.child,R=R!==null?R.sibling:null):R=u.child;if(R!==null)R.return=u;else for(R=u;R!==null;){if(R===e){R=null;break}if(u=R.sibling,u!==null){u.return=R.return,R=u;break}R=R.return}u=R}}function Bn(e,t,i,a){e=null;for(var u=t,m=!1;u!==null;){if(!m){if((u.flags&524288)!==0)m=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var R=u.alternate;if(R===null)throw Error(o(387));if(R=R.memoizedProps,R!==null){var H=u.type;Es(u.pendingProps.value,R.value)||(e!==null?e.push(H):e=[H])}}else if(u===es.current){if(R=u.alternate,R===null)throw Error(o(387));R.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Kr):e=[Kr])}u=u.return}return e!==null&&Nu(t,e,i,a),t.flags|=262144,e!==null}function eo(e){for(e=e.firstContext;e!==null;){if(!Es(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function In(e){Mn=e,Ti=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Kt(e){return Op(Mn,e)}function to(e,t){return Mn===null&&In(e),Op(e,t)}function Op(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ti===null){if(e===null)throw Error(o(308));Ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ti=Ti.next=t;return i}var v1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},_1=s.unstable_scheduleCallback,y1=s.unstable_NormalPriority,kt={$$typeof:he,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ju(){return{controller:new v1,data:new Map,refCount:0}}function Ra(e){e.refCount--,e.refCount===0&&_1(y1,function(){e.controller.abort()})}function Lp(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var a=t[e];i.indexOf(a)===-1&&i.push(a)}}}var Da=null;function b1(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Aa=null,Tu=0,Hn=0,xr=null;function S1(e,t){if(Aa===null){var i=Aa=[];Tu=0,Hn=Vh(),xr={status:"pending",value:void 0,then:function(a){i.push(a)}}}return Tu++,t.then(Mp,Mp),t}function Mp(){if(--Tu===0&&(Da=null,Aa!==null)){xr!==null&&(xr.status="fulfilled");var e=Aa;Aa=null,Hn=0,xr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function x1(e,t){var i=[],a={status:"pending",value:null,reason:null,then:function(u){i.push(u)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var u=0;u<i.length;u++)(0,i[u])(t)},function(u){for(a.status="rejected",a.reason=u,u=0;u<i.length;u++)(0,i[u])(void 0)}),a}var Bp=me.S;me.S=function(e,t){if(Tv=ns(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&S1(e,t),Da!==null)for(var i=zr;i!==null;)Lp(i,Da),i=i.next;if(i=e.types,i!==null){for(var a=zr;a!==null;)Lp(a,i),a=a.next;if(Hn!==0){a=Da,a===null&&(a=Da=[]);for(var u=0;u<i.length;u++){var m=i[u];a.indexOf(m)===-1&&a.push(m)}}}Bp!==null&&Bp(e,t)};var Un=at(null);function ku(){var e=Un.current;return e!==null?e:ft.pooledCache}function so(e,t){t===null?Ke(Un,Un.current):Ke(Un,t.pool)}function Ip(){var e=ku();return e===null?null:{parent:kt._currentValue,pool:e}}var wr=Error(o(460)),Ru=Error(o(474)),io=Error(o(542)),no={then:function(){}};function Hp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Up(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(li,li),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,$p(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(li,li);else{if(e=ft,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,$p(e),e}throw $n=t,wr}}function zn(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?($n=i,wr):i}}var $n=null;function zp(){if($n===null)throw Error(o(459));var e=$n;return $n=null,e}function $p(e){if(e===wr||e===io)throw Error(o(483))}var Cr=null,Oa=0;function ro(e){var t=Oa;return Oa+=1,Cr===null&&(Cr=[]),Up(Cr,e,t)}function Qi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ao(e,t){throw t.$$typeof===k?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Pp(e){function t(se,X){if(e){var re=se.deletions;re===null?(se.deletions=[X],se.flags|=16):re.push(X)}}function i(se,X){if(!e)return null;for(;X!==null;)t(se,X),X=X.sibling;return null}function a(se){for(var X=new Map;se!==null;)se.key===null?X.set(se.index,se):X.set(se.key,se),se=se.sibling;return X}function u(se,X){return se=Ni(se,X),se.index=0,se.sibling=null,se}function m(se,X,re){return se.index=re,e?(re=se.alternate,re!==null?(re=re.index,re<X?(se.flags|=2,X):re):(se.flags|=134217730,X)):(se.flags|=1048576,X)}function R(se){return e&&se.alternate===null&&(se.flags|=134217730),se}function H(se,X,re,ve){return X===null||X.tag!==6?(X=bu(re,se.mode,ve),X.return=se,X):(X=u(X,re),X.return=se,X)}function K(se,X,re,ve){var Ce=re.type;return Ce===q?(se=oe(se,X,re.props.children,ve,re.key),Qi(se,re),se):X!==null&&(X.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===B&&zn(Ce)===X.type)?(X=u(X,re.props),Qi(X,re),X.return=se,X):(X=Zl(re.type,re.key,re.props,null,se.mode,ve),Qi(X,re),X.return=se,X)}function ie(se,X,re,ve){return X===null||X.tag!==4||X.stateNode.containerInfo!==re.containerInfo||X.stateNode.implementation!==re.implementation?(X=Su(re,se.mode,ve),X.return=se,X):(X=u(X,re.children||[]),X.return=se,X)}function oe(se,X,re,ve,Ce){return X===null||X.tag!==7?(X=On(re,se.mode,ve,Ce),X.return=se,X):(X=u(X,re),X.return=se,X)}function _e(se,X,re){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=bu(""+X,se.mode,re),X.return=se,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case L:return re=Zl(X.type,X.key,X.props,null,se.mode,re),Qi(re,X),re.return=se,re;case V:return X=Su(X,se.mode,re),X.return=se,X;case B:return X=zn(X),_e(se,X,re)}if(pe(X)||Z(X))return X=On(X,se.mode,re,null),X.return=se,X;if(typeof X.then=="function")return _e(se,ro(X),re);if(X.$$typeof===he)return _e(se,to(se,X),re);ao(se,X)}return null}function te(se,X,re,ve){var Ce=X!==null?X.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ce!==null?null:H(se,X,""+re,ve);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case L:return re.key===Ce?K(se,X,re,ve):null;case V:return re.key===Ce?ie(se,X,re,ve):null;case B:return re=zn(re),te(se,X,re,ve)}if(pe(re)||Z(re))return Ce!==null?null:oe(se,X,re,ve,null);if(typeof re.then=="function")return te(se,X,ro(re),ve);if(re.$$typeof===he)return te(se,X,to(se,re),ve);ao(se,re)}return null}function ae(se,X,re,ve,Ce){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return se=se.get(re)||null,H(X,se,""+ve,Ce);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case L:return se=se.get(ve.key===null?re:ve.key)||null,K(X,se,ve,Ce);case V:return se=se.get(ve.key===null?re:ve.key)||null,ie(X,se,ve,Ce);case B:return ve=zn(ve),ae(se,X,re,ve,Ce)}if(pe(ve)||Z(ve))return se=se.get(re)||null,oe(X,se,ve,Ce,null);if(typeof ve.then=="function")return ae(se,X,re,ro(ve),Ce);if(ve.$$typeof===he)return ae(se,X,re,to(X,ve),Ce);ao(X,ve)}return null}function be(se,X,re,ve){for(var Ce=null,Xe=null,Te=X,Ae=X=0,At=null;Te!==null&&Ae<re.length;Ae++){Te.index>Ae?(At=Te,Te=null):At=Te.sibling;var Je=te(se,Te,re[Ae],ve);if(Je===null){Te===null&&(Te=At);break}e&&Te&&Je.alternate===null&&t(se,Te),X=m(Je,X,Ae),Xe===null?Ce=Je:Xe.sibling=Je,Xe=Je,Te=At}if(Ae===re.length)return i(se,Te),Fe&&ji(se,Ae),Ce;if(Te===null){for(;Ae<re.length;Ae++)Te=_e(se,re[Ae],ve),Te!==null&&(X=m(Te,X,Ae),Xe===null?Ce=Te:Xe.sibling=Te,Xe=Te);return Fe&&ji(se,Ae),Ce}for(Te=a(Te);Ae<re.length;Ae++)At=ae(Te,se,Ae,re[Ae],ve),At!==null&&(e&&(Je=At.alternate,Je!==null&&Te.delete(Je.key===null?Ae:Je.key)),X=m(At,X,Ae),Xe===null?Ce=At:Xe.sibling=At,Xe=At);return e&&Te.forEach(function(_n){return t(se,_n)}),Fe&&ji(se,Ae),Ce}function Ne(se,X,re,ve){if(re==null)throw Error(o(151));for(var Ce=null,Xe=null,Te=X,Ae=X=0,At=null,Je=re.next();Te!==null&&!Je.done;Ae++,Je=re.next()){Te.index>Ae?(At=Te,Te=null):At=Te.sibling;var _n=te(se,Te,Je.value,ve);if(_n===null){Te===null&&(Te=At);break}e&&Te&&_n.alternate===null&&t(se,Te),X=m(_n,X,Ae),Xe===null?Ce=_n:Xe.sibling=_n,Xe=_n,Te=At}if(Je.done)return i(se,Te),Fe&&ji(se,Ae),Ce;if(Te===null){for(;!Je.done;Ae++,Je=re.next())Je=_e(se,Je.value,ve),Je!==null&&(X=m(Je,X,Ae),Xe===null?Ce=Je:Xe.sibling=Je,Xe=Je);return Fe&&ji(se,Ae),Ce}for(Te=a(Te);!Je.done;Ae++,Je=re.next())Je=ae(Te,se,Ae,Je.value,ve),Je!==null&&(e&&(At=Je.alternate,At!==null&&Te.delete(At.key===null?Ae:At.key)),X=m(Je,X,Ae),Xe===null?Ce=Je:Xe.sibling=Je,Xe=Je);return e&&Te.forEach(function(sw){return t(se,sw)}),Fe&&ji(se,Ae),Ce}function ze(se,X,re,ve){if(typeof re=="object"&&re!==null&&re.type===q&&re.key===null&&re.props.ref===void 0&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case L:e:{for(var Ce=re.key;X!==null;){if(X.key===Ce){if(Ce=re.type,Ce===q){if(X.tag===7){i(se,X.sibling),ve=u(X,re.props.children),Qi(ve,re),ve.return=se,se=ve;break e}}else if(X.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===B&&zn(Ce)===X.type){i(se,X.sibling),ve=u(X,re.props),Qi(ve,re),ve.return=se,se=ve;break e}i(se,X);break}else t(se,X);X=X.sibling}re.type===q?(ve=On(re.props.children,se.mode,ve,re.key),Qi(ve,re),ve.return=se,se=ve):(ve=Zl(re.type,re.key,re.props,null,se.mode,ve),Qi(ve,re),ve.return=se,se=ve)}return R(se);case V:e:{for(Ce=re.key;X!==null;){if(X.key===Ce)if(X.tag===4&&X.stateNode.containerInfo===re.containerInfo&&X.stateNode.implementation===re.implementation){i(se,X.sibling),ve=u(X,re.children||[]),ve.return=se,se=ve;break e}else{i(se,X);break}else t(se,X);X=X.sibling}ve=Su(re,se.mode,ve),ve.return=se,se=ve}return R(se);case B:return re=zn(re),ze(se,X,re,ve)}if(pe(re))return be(se,X,re,ve);if(Z(re)){if(Ce=Z(re),typeof Ce!="function")throw Error(o(150));return re=Ce.call(re),Ne(se,X,re,ve)}if(typeof re.then=="function")return ze(se,X,ro(re),ve);if(re.$$typeof===he)return ze(se,X,to(se,re),ve);ao(se,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,X!==null&&X.tag===6?(i(se,X.sibling),ve=u(X,re),ve.return=se,se=ve):(i(se,X),ve=bu(re,se.mode,ve),ve.return=se,se=ve),R(se)):i(se,X)}return function(se,X,re,ve){try{Oa=0;var Ce=ze(se,X,re,ve);return Cr=null,Ce}catch(Te){if(Te===wr||Te===io)throw Te;var Xe=hs(29,Te,null,se.mode);return Xe.lanes=ve,Xe.return=se,Xe}}}var Pn=Pp(!0),Fp=Pp(!1),Ji=!1;function Du(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Au(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function en(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function tn(e,t,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(nt&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Yl(e),Np(e,null,i),t}return Gl(e,a,t,i),Yl(e)}function La(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,Rm(e,i)}}function Ou(e,t){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var u=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var R={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?u=m=R:m=m.next=R,i=i.next}while(i!==null);m===null?u=m=t:m=m.next=t}else u=m=t;i={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:m,shared:a.shared,callbacks:a.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Lu=!1;function Ma(){if(Lu){var e=xr;if(e!==null)throw e}}function Ba(e,t,i,a){Lu=!1;var u=e.updateQueue;Ji=!1;var m=u.firstBaseUpdate,R=u.lastBaseUpdate,H=u.shared.pending;if(H!==null){u.shared.pending=null;var K=H,ie=K.next;K.next=null,R===null?m=ie:R.next=ie,R=K;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,H=oe.lastBaseUpdate,H!==R&&(H===null?oe.firstBaseUpdate=ie:H.next=ie,oe.lastBaseUpdate=K))}if(m!==null){var _e=u.baseState;R=0,oe=ie=K=null,H=m;do{var te=H.lane&-536870913,ae=te!==H.lane;if(ae?(Ze&te)===te:(a&te)===te){te!==0&&te===Hn&&(Lu=!0),oe!==null&&(oe=oe.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var be=e,Ne=H;te=t;var ze=i;switch(Ne.tag){case 1:if(be=Ne.payload,typeof be=="function"){_e=be.call(ze,_e,te);break e}_e=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Ne.payload,te=typeof be=="function"?be.call(ze,_e,te):be,te==null)break e;_e=O({},_e,te);break e;case 2:Ji=!0}}te=H.callback,te!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=u.callbacks,ae===null?u.callbacks=[te]:ae.push(te))}else ae={lane:te,tag:H.tag,payload:H.payload,callback:H.callback,next:null},oe===null?(ie=oe=ae,K=_e):oe=oe.next=ae,R|=te;if(H=H.next,H===null){if(H=u.shared.pending,H===null)break;ae=H,H=ae.next,ae.next=null,u.lastBaseUpdate=ae,u.shared.pending=null}}while(!0);oe===null&&(K=_e),u.baseState=K,u.firstBaseUpdate=ie,u.lastBaseUpdate=oe,m===null&&(u.shared.lanes=0),cn|=R,e.lanes=R,e.memoizedState=_e}}function Vp(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function qp(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Vp(i[e],t)}var sn=at(null),lo=at(0);function Kp(e,t){e=Li,Ke(lo,e),Ke(sn,t),Li=e|t.baseLanes}function Mu(){Ke(lo,Li),Ke(sn,sn.current)}function Bu(){Li=lo.current,we(sn),we(lo)}var Gt=at(null),ts=null;function nn(e){var t=e.alternate;Ke(Yt,Yt.current&1),Ke(Gt,e),ts===null&&(t===null||sn.current!==null||t.memoizedState!==null)&&(ts=e)}function Iu(e){Ke(Yt,Yt.current),Ke(Gt,e),ts===null&&(ts=e)}function Gp(e){e.tag===22?(Ke(Yt,Yt.current),Ke(Gt,e),ts===null&&(ts=e)):rn()}function rn(){Ke(Yt,Yt.current),Ke(Gt,Gt.current)}function Ns(e){we(Gt),ts===e&&(ts=null),we(Yt)}var Yt=at(0);function Ia(e,t){Ke(Gt,Gt.current),Ke(Yt,t)}function Hu(e){we(Yt),we(Gt),ts===e&&(ts=null)}function oo(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||ad(i)||ld(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ri=0,Ue=null,ht=null,Rt=null,co=!1,Er=!1,Fn=!1,uo=0,Ha=0,Nr=null,w1=0;function Ct(){throw Error(o(321))}function Uu(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Es(e[i],t[i]))return!1;return!0}function zu(e,t,i,a,u,m){return Ri=m,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?Rg:Dg,Fn=!1,m=i(a,u),Fn=!1,Er&&(m=Zp(t,i,a,u)),Yp(e),m}function Yp(e){me.H=_o;var t=ht!==null&&ht.next!==null;if(Ri=0,Rt=ht=Ue=null,co=!1,Ha=0,Nr=null,t)throw Error(o(300));e===null||Dt||(e=e.dependencies,e!==null&&eo(e)&&(Dt=!0))}function Zp(e,t,i,a){Ue=e;var u=0;do{if(Er&&(Nr=null),Ha=0,Er=!1,25<=u)throw Error(o(301));if(u+=1,Rt=ht=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}me.H=D1,m=t(i,a)}while(Er);return m}function C1(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Ua(t):t,e=e.useState()[0],(ht!==null?ht.memoizedState:null)!==e&&(Ue.flags|=1024),t}function $u(){var e=uo!==0;return uo=0,e}function Pu(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Fu(e){if(co){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}co=!1}Ri=0,Rt=ht=Ue=null,Er=!1,Ha=uo=0,Nr=null}function as(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Ue.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function Tt(){if(ht===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=ht.next;var t=Rt===null?Ue.memoizedState:Rt.next;if(t!==null)Rt=t,ht=e;else{if(e===null)throw Ue.alternate===null?Error(o(467)):Error(o(310));ht=e,e={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Rt===null?Ue.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function ho(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ua(e){var t=Ha;return Ha+=1,Nr===null&&(Nr=[]),e=Up(Nr,e,t),t=Ue,(Rt===null?t.memoizedState:Rt.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?Rg:Dg),e}function fo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ua(e);if(e.$$typeof===ee)return;if(e.$$typeof===he)return Kt(e)}throw Error(o(438,String(e)))}function Vu(e){var t=null,i=Ue.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var a=Ue.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=ho(),Ue.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),a=0;a<e;a++)i[a]=J;return t.index++,i}function Di(e,t){return typeof t=="function"?t(e):t}function mo(e){var t=Tt();return qu(t,ht,e)}function qu(e,t,i){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=i;var u=e.baseQueue,m=a.pending;if(m!==null){if(u!==null){var R=u.next;u.next=m.next,m.next=R}t.baseQueue=u=m,a.pending=null}if(m=e.baseState,u===null)e.memoizedState=m;else{t=u.next;var H=R=null,K=null,ie=t,oe=!1;do{var _e=ie.lane&-536870913;if(_e!==ie.lane?(Ze&_e)===_e:(Ri&_e)===_e){var te=ie.revertLane;if(te===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),_e===Hn&&(oe=!0);else if((Ri&te)===te){ie=ie.next,te===Hn&&(oe=!0);continue}else _e={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(H=K=_e,R=m):K=K.next=_e,Ue.lanes|=te,cn|=te;_e=ie.action,Fn&&i(m,_e),m=ie.hasEagerState?ie.eagerState:i(m,_e)}else te={lane:_e,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},K===null?(H=K=te,R=m):K=K.next=te,Ue.lanes|=_e,cn|=_e;ie=ie.next}while(ie!==null&&ie!==t);if(K===null?R=m:K.next=H,!Es(m,e.memoizedState)&&(Dt=!0,oe&&(i=xr,i!==null)))throw i;e.memoizedState=m,e.baseState=R,e.baseQueue=K,a.lastRenderedState=m}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ku(e){var t=Tt(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var a=i.dispatch,u=i.pending,m=t.memoizedState;if(u!==null){i.pending=null;var R=u=u.next;do m=e(m,R.action),R=R.next;while(R!==u);Es(m,t.memoizedState)||(Dt=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),i.lastRenderedState=m}return[m,a]}function Xp(e,t,i){var a=Ue,u=Tt(),m=Fe;if(m){if(i===void 0)throw Error(o(407));i=i()}else i=t();var R=!Es((ht||u).memoizedState,i);if(R&&(u.memoizedState=i,Dt=!0),u=u.queue,Zu(Jp.bind(null,a,u,e),[e]),e=u.getSnapshot!==t||R||Rt!==null&&(Rt.memoizedState.tag&1)!==0,jr(e?9:8,{destroy:void 0},Qp.bind(null,a,u,i,t),null),e){if(a.flags|=2048,ft===null)throw Error(o(349));m||(Ri&127)!==0||Wp(a,t,i)}return i}function Wp(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ue.updateQueue,t===null?(t=ho(),Ue.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Qp(e,t,i,a){t.value=i,t.getSnapshot=a,eg(t)&&tg(e)}function Jp(e,t,i){return i(function(){eg(t)&&tg(e)})}function eg(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Es(e,i)}catch{return!0}}function tg(e){var t=An(e,2);t!==null&&ps(t,e,2)}function Gu(e){var t=as();if(typeof e=="function"){var i=e;if(e=i(),Fn){qi(!0);try{i()}finally{qi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:e},t}function sg(e,t,i,a){return e.baseState=i,qu(e,ht,typeof a=="function"?a:Di)}function E1(e,t,i,a,u){if(vo(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){m.listeners.push(R)}};me.T!==null?i(!0):m.isTransition=!1,a(m),i=t.pending,i===null?(m.next=t.pending=m,ig(t,m)):(m.next=i.next,t.pending=i.next=m)}}function ig(e,t){var i=t.action,a=t.payload,u=e.state;if(t.isTransition){var m=me.T,R={};R.types=m!==null?m.types:null,me.T=R;try{var H=i(u,a),K=me.S;K!==null&&K(R,H),ng(e,t,H)}catch(ie){Yu(e,t,ie)}finally{m!==null&&R.types!==null&&(m.types=R.types),me.T=m}}else try{m=i(u,a),ng(e,t,m)}catch(ie){Yu(e,t,ie)}}function ng(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){rg(e,t,a)},function(a){return Yu(e,t,a)}):rg(e,t,i)}function rg(e,t,i){t.status="fulfilled",t.value=i,ag(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,ig(e,i)))}function Yu(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,ag(t),t=t.next;while(t!==a)}e.action=null}function ag(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function lg(e,t){return t}function og(e,t){if(Fe){var i=ft.formState;if(i!==null){e:{var a=Ue;if(Fe){if(mt){t:{for(var u=mt,m=Us;u.nodeType!==8;){if(!m){u=null;break t}if(u=$s(u.nextSibling),u===null){u=null;break t}}m=u.data,u=m==="F!"||m==="F"?u:null}if(u){mt=$s(u.nextSibling),a=u.data==="F!";break e}}Xi(a)}a=!1}a&&(t=i[0])}}return i=as(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lg,lastRenderedState:t},i.queue=a,i=jg.bind(null,Ue,a),a.dispatch=i,a=Gu(!1),m=eh.bind(null,Ue,!1,a.queue),a=as(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,i=E1.bind(null,Ue,u,m,i),u.dispatch=i,a.memoizedState=e,[t,i,!1]}function cg(e){var t=Tt();return ug(t,ht,e)}function ug(e,t,i){if(t=qu(e,t,lg)[0],e=mo(Di)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ua(t)}catch(R){throw R===wr?io:R}else a=t;t=Tt();var u=t.queue,m=u.dispatch;return i!==t.memoizedState&&(Ue.flags|=2048,jr(9,{destroy:void 0},N1.bind(null,u,i),null)),[a,m,e]}function N1(e,t){e.action=t}function hg(e){var t=Tt(),i=ht;if(i!==null)return ug(t,i,e);Tt(),t=t.memoizedState,i=Tt();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function jr(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=Ue.updateQueue,t===null&&(t=ho(),Ue.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(a=i.next,i.next=e,e.next=a,t.lastEffect=e),e}function dg(){return Tt().memoizedState}function po(e,t,i,a){var u=as();Ue.flags|=e,u.memoizedState=jr(1|t,{destroy:void 0},i,a===void 0?null:a)}function go(e,t,i,a){var u=Tt();a=a===void 0?null:a;var m=u.memoizedState.inst;ht!==null&&a!==null&&Uu(a,ht.memoizedState.deps)?u.memoizedState=jr(t,m,i,a):(Ue.flags|=e,u.memoizedState=jr(1|t,m,i,a))}function fg(e,t){po(8390656,8,e,t)}function Zu(e,t){go(2048,8,e,t)}function j1(e){Ue.flags|=4;var t=Ue.updateQueue;if(t===null)t=ho(),Ue.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function mg(e){var t=Tt().memoizedState;return j1({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function pg(e,t){return go(4,2,e,t)}function gg(e,t){return go(4,4,e,t)}function vg(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _g(e,t,i){i=i!=null?i.concat([e]):null,go(4,4,vg.bind(null,t,e),i)}function Xu(){}function yg(e,t){var i=Tt();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&Uu(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function bg(e,t){var i=Tt();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&Uu(t,a[1]))return a[0];if(a=e(),Fn){qi(!0);try{e()}finally{qi(!1)}}return i.memoizedState=[a,t],a}function Wu(e,t,i){return i===void 0||(Ri&1073741824)!==0&&(Ze&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Rv(),Ue.lanes|=e,cn|=e,i)}function Sg(e,t,i,a){return Es(i,t)?i:sn.current!==null?(e=Wu(e,i,a),Es(e,t)||(Dt=!0),e):(Ri&106)===0||(Ri&1073741824)!==0&&(Ze&261930)===0?(Dt=!0,e.memoizedState=i):(e=Rv(),Ue.lanes|=e,cn|=e,t)}function xg(e,t,i,a,u){var m=ge.p;ge.p=m!==0&&8>m?m:8;var R=me.T,H={};H.types=R!==null?R.types:null,me.T=H,eh(e,!1,t,i);try{var K=u(),ie=me.S;if(ie!==null&&ie(H,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var oe=x1(K,a);za(e,t,oe,Rs(e))}else za(e,t,a,Rs(e))}catch(_e){za(e,t,{then:function(){},status:"rejected",reason:_e},Rs())}finally{ge.p=m,R!==null&&H.types!==null&&(R.types=H.types),me.T=R}}function T1(){}function Qu(e,t,i,a){if(e.tag!==5)throw Error(o(476));var u=wg(e).queue;xg(e,u,t,Re,i===null?T1:function(){return Cg(e),i(a)})}function wg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Re,baseState:Re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:Re},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cg(e){var t=wg(e);t.next===null&&(t=e.alternate.memoizedState),za(e,t.next.queue,{},Rs())}function Ju(){return Kt(Kr)}function Eg(){return Tt().memoizedState}function Ng(){return Tt().memoizedState}function k1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Rs();e=en(i);var a=tn(t,e,i);a!==null&&(ps(a,t,i),La(a,t,i)),t={cache:ju()},e.payload=t;return}t=t.return}}function R1(e,t,i){var a=Rs();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},vo(e)?Tg(t,i):(i=_u(e,t,i,a),i!==null&&(ps(i,e,a),kg(i,t,a)))}function jg(e,t,i){var a=Rs();za(e,t,i,a)}function za(e,t,i,a){var u={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(vo(e))Tg(t,u);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var R=t.lastRenderedState,H=m(R,i);if(u.hasEagerState=!0,u.eagerState=H,Es(H,R))return Gl(e,t,u,0),ft===null&&Kl(),!1}catch{}if(i=_u(e,t,u,a),i!==null)return ps(i,e,a),kg(i,t,a),!0}return!1}function eh(e,t,i,a){if(a={lane:2,revertLane:Vh(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vo(e)){if(t)throw Error(o(479))}else t=_u(e,i,a,2),t!==null&&ps(t,e,2)}function vo(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Tg(e,t){Er=co=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function kg(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,Rm(e,i)}}var _o={readContext:Kt,use:fo,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct,useEffectEvent:Ct},Rg={readContext:Kt,use:fo,useCallback:function(e,t){return as().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:fg,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,po(4194308,4,vg.bind(null,t,e),i)},useLayoutEffect:function(e,t){return po(4194308,4,e,t)},useInsertionEffect:function(e,t){po(4,2,e,t)},useMemo:function(e,t){var i=as();t=t===void 0?null:t;var a=e();if(Fn){qi(!0);try{e()}finally{qi(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=as();if(i!==void 0){var u=i(t);if(Fn){qi(!0);try{i(t)}finally{qi(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=R1.bind(null,Ue,e),[a.memoizedState,e]},useRef:function(e){var t=as();return e={current:e},t.memoizedState=e},useState:function(e){e=Gu(e);var t=e.queue,i=jg.bind(null,Ue,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Xu,useDeferredValue:function(e,t){var i=as();return Wu(i,e,t)},useTransition:function(){var e=Gu(!1);return e=xg.bind(null,Ue,e.queue,!0,!1),as().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=Ue,u=as();if(Fe){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),ft===null)throw Error(o(349));(Ze&127)!==0||Wp(a,t,i)}u.memoizedState=i;var m={value:i,getSnapshot:t};return u.queue=m,fg(Jp.bind(null,a,m,e),[e]),a.flags|=2048,jr(9,{destroy:void 0},Qp.bind(null,a,m,i,t),null),i},useId:function(){var e=as(),t=ft.identifierPrefix;if(Fe){var i=ci,a=oi;i=(a&~(1<<32-ws(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=uo++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=w1++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ju,useFormState:og,useActionState:og,useOptimistic:function(e){var t=as();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=eh.bind(null,Ue,!0,i),i.dispatch=t,[e,t]},useMemoCache:Vu,useCacheRefresh:function(){return as().memoizedState=k1.bind(null,Ue)},useEffectEvent:function(e){var t=as(),i={impl:e};return t.memoizedState=i,function(){if((nt&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},Dg={readContext:Kt,use:fo,useCallback:yg,useContext:Kt,useEffect:Zu,useImperativeHandle:_g,useInsertionEffect:pg,useLayoutEffect:gg,useMemo:bg,useReducer:mo,useRef:dg,useState:function(){return mo(Di)},useDebugValue:Xu,useDeferredValue:function(e,t){var i=Tt();return Sg(i,ht.memoizedState,e,t)},useTransition:function(){var e=mo(Di)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:Ua(e),t]},useSyncExternalStore:Xp,useId:Eg,useHostTransitionStatus:Ju,useFormState:cg,useActionState:cg,useOptimistic:function(e,t){var i=Tt();return sg(i,ht,e,t)},useMemoCache:Vu,useCacheRefresh:Ng,useEffectEvent:mg},D1={readContext:Kt,use:fo,useCallback:yg,useContext:Kt,useEffect:Zu,useImperativeHandle:_g,useInsertionEffect:pg,useLayoutEffect:gg,useMemo:bg,useReducer:Ku,useRef:dg,useState:function(){return Ku(Di)},useDebugValue:Xu,useDeferredValue:function(e,t){var i=Tt();return ht===null?Wu(i,e,t):Sg(i,ht.memoizedState,e,t)},useTransition:function(){var e=Ku(Di)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:Ua(e),t]},useSyncExternalStore:Xp,useId:Eg,useHostTransitionStatus:Ju,useFormState:hg,useActionState:hg,useOptimistic:function(e,t){var i=Tt();return ht!==null?sg(i,ht,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Vu,useCacheRefresh:Ng,useEffectEvent:mg};function th(e,t,i,a){t=e.memoizedState,i=i(a,t),i=i==null?t:O({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var sh={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=Rs(),u=en(a);u.payload=t,i!=null&&(u.callback=i),t=tn(e,u,a),t!==null&&(ps(t,e,a),La(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=Rs(),u=en(a);u.tag=1,u.payload=t,i!=null&&(u.callback=i),t=tn(e,u,a),t!==null&&(ps(t,e,a),La(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Rs(),a=en(i);a.tag=2,t!=null&&(a.callback=t),t=tn(e,a,i),t!==null&&(ps(t,e,i),La(t,e,i))}};function Ag(e,t,i,a,u,m,R){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,m,R):t.prototype&&t.prototype.isPureReactComponent?!Na(i,a)||!Na(u,m):!0}function Og(e,t,i,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,a),t.state!==e&&sh.enqueueReplaceState(t,t.state,null)}function Vn(e,t){var i=t;if("ref"in t){i={};for(var a in t)a!=="ref"&&(i[a]=t[a])}if(e=e.defaultProps){i===t&&(i=O({},i));for(var u in e)i[u]===void 0&&(i[u]=e[u])}return i}function Lg(e){ql(e)}function Mg(e){console.error(e)}function Bg(e){ql(e)}function yo(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Ig(e,t,i){try{var a=e.onCaughtError;a(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function ih(e,t,i){return i=en(i),i.tag=3,i.payload={element:null},i.callback=function(){yo(e,t)},i}function Hg(e){return e=en(e),e.tag=3,e}function Ug(e,t,i,a){var u=i.type.getDerivedStateFromError;if(typeof u=="function"){var m=a.value;e.payload=function(){return u(m)},e.callback=function(){Ig(t,i,a)}}var R=i.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(e.callback=function(){Ig(t,i,a),typeof u!="function"&&(un===null?un=new Set([this]):un.add(this));var H=a.stack;this.componentDidCatch(a.value,{componentStack:H!==null?H:""})})}function A1(e,t,i,a,u){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&Bn(t,i,u,!0),i=Gt.current,i!==null){switch(i.tag){case 31:case 13:case 19:return ts===null?zo():i.alternate===null&&Et===0&&(Et=3),i.flags&=-257,i.flags|=65536,i.lanes=u,a===no?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),$h(e,a,u)),!1;case 22:return i.flags|=65536,a===no?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([a]):i.add(a)),$h(e,a,u)),!1}throw Error(o(435,i.tag))}return $h(e,a,u),zo(),!1}if(Fe)return t=Gt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==wu&&(e=Error(o(422),{cause:a}),ka(Bs(e,i)))):(a!==wu&&(t=Error(o(423),{cause:a}),ka(Bs(t,i))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Bs(a,i),u=ih(e.stateNode,a,u),Ou(e,u),Et!==4&&(Et=2)),!1;var m=Error(o(520),{cause:a});if(m=Bs(m,i),Ya===null?Ya=[m]:Ya.push(m),Et!==4&&(Et=2),t===null)return!0;a=Bs(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=u&-u,i.lanes|=e,e=ih(i.stateNode,a,e),Ou(i,e),!1;case 1:if(t=i.type,m=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(un===null||!un.has(m))))return i.flags|=65536,u&=-u,i.lanes|=u,u=Hg(u),Ug(u,e,i,a),Ou(i,u),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var nh=Error(o(461)),Dt=!1;function Ht(e,t,i,a){t.child=e===null?Fp(t,null,i,a):Pn(t,e.child,i,a)}function zg(e,t,i,a,u){i=i.render;var m=t.ref;if("ref"in a){var R={};for(var H in a)H!=="ref"&&(R[H]=a[H])}else R=a;return In(t),a=zu(e,t,i,R,m,u),H=$u(),e!==null&&!Dt?(Pu(e,t,u),Ai(e,t,u)):(Fe&&H&&Wl(t),t.flags|=1,Ht(e,t,a,u),t.child)}function $g(e,t,i,a,u){if(e===null){var m=i.type;return typeof m=="function"&&!yu(m)&&m.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=m,Pg(e,t,m,a,u)):(e=Zl(i.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!dh(e,u)){var R=m.memoizedProps;if(i=i.compare,i=i!==null?i:Na,i(R,a)&&e.ref===t.ref)return Ai(e,t,u)}return t.flags|=1,e=Ni(m,a),e.ref=t.ref,e.return=t,t.child=e}function Pg(e,t,i,a,u){if(e!==null){var m=e.memoizedProps;if(Na(m,a)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=a=m,dh(e,u))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Ai(e,t,u)}return rh(e,t,i,a,u)}function Fg(e,t,i,a){var u=a.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|i:i,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~m}else a=0,t.child=null;return Vg(e,t,m,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&so(t,m!==null?m.cachePool:null),m!==null?Kp(t,m):Mu(),Gp(t);else return a=t.lanes=536870912,Vg(e,t,m!==null?m.baseLanes|i:i,i,a)}else m!==null?(so(t,m.cachePool),Kp(t,m),rn(),t.memoizedState=null):(e!==null&&so(t,null),Mu(),rn());return Ht(e,t,u,i),t.child}function $a(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vg(e,t,i,a,u){var m=ku();return m=m===null?null:{parent:kt._currentValue,pool:m},t.memoizedState={baseLanes:i,cachePool:m},e!==null&&so(t,null),Mu(),Gp(t),e!==null&&Bn(e,t,a,!0),t.childLanes=u,null}function bo(e,t){return t=So({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qg(e,t,i){return Pn(t,e.child,null,i),e=bo(t,t.pendingProps),e.flags|=2,Ns(t),t.memoizedState=null,e}function O1(e,t,i){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Fe){if(a.mode==="hidden")return e=bo(t,a),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},$a(null,e);if(Iu(t),(e=mt)?(e=v_(e,Us),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi!==null?{id:oi,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},i=Tp(e),i.return=t,t.child=i,zt=t,mt=null)):e=null,e===null)throw Xi(t);return t.lanes=536870912,null}return bo(t,a)}var m=e.memoizedState;if(m!==null){var R=m.dehydrated;if(Iu(t),u)if(t.flags&256)t.flags&=-257,t=qg(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Dt||Bn(e,t,i,!1),u=(i&e.childLanes)!==0,Dt||u){if(sn.current===null){if(a=ft,a!==null&&(R=Dm(a,i),R!==0&&R!==m.retryLane))throw m.retryLane=R,An(e,R),ps(a,e,R),nh;zo()}t=qg(e,t,i)}else e=m.treeContext,mt=$s(R.nextSibling),zt=t,Fe=!0,Zi=null,Us=!1,e!==null&&Dp(t,e),t=bo(t,a),t.flags|=134221824;return t}return e=Ni(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Tr(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function rh(e,t,i,a,u){return In(t),i=zu(e,t,i,a,void 0,u),a=$u(),e!==null&&!Dt?(Pu(e,t,u),Ai(e,t,u)):(Fe&&a&&Wl(t),t.flags|=1,Ht(e,t,i,u),t.child)}function Kg(e,t,i,a,u,m){return In(t),t.updateQueue=null,i=Zp(t,a,i,u),Yp(e),a=$u(),e!==null&&!Dt?(Pu(e,t,m),Ai(e,t,m)):(Fe&&a&&Wl(t),t.flags|=1,Ht(e,t,i,m),t.child)}function Gg(e,t,i,a,u){if(In(t),t.stateNode===null){var m=_r,R=i.contextType;typeof R=="object"&&R!==null&&(m=Kt(R)),m=new i(a,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=sh,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=a,m.state=t.memoizedState,m.refs={},Du(t),R=i.contextType,m.context=typeof R=="object"&&R!==null?Kt(R):_r,m.state=t.memoizedState,R=i.getDerivedStateFromProps,typeof R=="function"&&(th(t,i,R,a),m.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(R=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),R!==m.state&&sh.enqueueReplaceState(m,m.state,null),Ba(t,a,m,u),Ma(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){m=t.stateNode;var H=t.memoizedProps,K=Vn(i,H);m.props=K;var ie=m.context,oe=i.contextType;R=_r,typeof oe=="object"&&oe!==null&&(R=Kt(oe));var _e=i.getDerivedStateFromProps;oe=typeof _e=="function"||typeof m.getSnapshotBeforeUpdate=="function",H=t.pendingProps!==H,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(H||ie!==R)&&Og(t,m,a,R),Ji=!1;var te=t.memoizedState;m.state=te,Ba(t,a,m,u),Ma(),ie=t.memoizedState,H||te!==ie||Ji?(typeof _e=="function"&&(th(t,i,_e,a),ie=t.memoizedState),(K=Ji||Ag(t,i,K,a,te,ie,R))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=ie),m.props=a,m.state=ie,m.context=R,a=K):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{m=t.stateNode,Au(e,t),R=t.memoizedProps,oe=Vn(i,R),m.props=oe,_e=t.pendingProps,te=m.context,ie=i.contextType,K=_r,typeof ie=="object"&&ie!==null&&(K=Kt(ie)),H=i.getDerivedStateFromProps,(ie=typeof H=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(R!==_e||te!==K)&&Og(t,m,a,K),Ji=!1,te=t.memoizedState,m.state=te,Ba(t,a,m,u),Ma();var ae=t.memoizedState;R!==_e||te!==ae||Ji||e!==null&&e.dependencies!==null&&eo(e.dependencies)?(typeof H=="function"&&(th(t,i,H,a),ae=t.memoizedState),(oe=Ji||Ag(t,i,oe,a,te,ae,K)||e!==null&&e.dependencies!==null&&eo(e.dependencies))?(ie||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(a,ae,K),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(a,ae,K)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ae),m.props=a,m.state=ae,m.context=K,a=oe):(typeof m.componentDidUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||R===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),a=!1)}return m=a,Tr(e,t),a=(t.flags&128)!==0,m||a?(m=t.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&a?(t.child=Pn(t,e.child,null,u),t.child=Pn(t,null,i,u)):Ht(e,t,i,u),t.memoizedState=m.state,e=t.child):e=Ai(e,t,u),e}function Yg(e,t,i,a){return Ln(),t.flags|=256,Ht(e,t,i,a),t.child}var ah={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lh(e){return{baseLanes:e,cachePool:Ip()}}function oh(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ks),e}function Zg(e,t,i){var a=t.pendingProps,u=!1,m=(t.flags&128)!==0,R;if((R=m)||(R=e!==null&&e.memoizedState===null?!1:(Yt.current&2)!==0),R&&(u=!0,t.flags&=-129),R=(t.flags&32)!==0,t.flags&=-33,e===null){if(Fe){if(u?nn(t):rn(),(e=mt)?(e=v_(e,Us),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi!==null?{id:oi,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},i=Tp(e),i.return=t,t.child=i,zt=t,mt=null)):e=null,e===null)throw Xi(t);return ld(e)?t.lanes=32:t.lanes=536870912,null}return m=a.children,a=a.fallback,u?(rn(),u=t.mode,m=So({mode:"hidden",children:m},u),a=On(a,u,i,null),m.return=t,a.return=t,m.sibling=a,t.child=m,a=t.child,a.memoizedState=lh(i),a.childLanes=oh(e,R,i),t.memoizedState=ah,$a(null,a)):(nn(t),ch(t,m))}var H=e.memoizedState;if(H!==null){var K=H.dehydrated;if(K!==null)return L1(e,t,m,R,a,K,H,i)}return u?(rn(),u=a.fallback,m=t.mode,H=e.child,K=H.sibling,a=Ni(H,{mode:"hidden",children:a.children}),a.subtreeFlags=H.subtreeFlags&1206910976,K!==null?u=Ni(K,u):(u=On(u,m,i,null),u.flags|=2),u.return=t,a.return=t,a.sibling=u,t.child=a,$a(null,a),a=t.child,u=e.child.memoizedState,u===null?u=lh(i):(m=u.cachePool,m!==null?(H=kt._currentValue,m=m.parent!==H?{parent:H,pool:H}:m):m=Ip(),u={baseLanes:u.baseLanes|i,cachePool:m}),a.memoizedState=u,a.childLanes=oh(e,R,i),t.memoizedState=ah,$a(e.child,a)):(nn(t),i=e.child,e=i.sibling,i=Ni(i,{mode:"visible",children:a.children}),i.return=t,i.sibling=null,e!==null&&(R=t.deletions,R===null?(t.deletions=[e],t.flags|=16):R.push(e)),t.child=i,t.memoizedState=null,i)}function ch(e,t){return t=So({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function So(e,t){return e=hs(22,e,null,t),e.lanes=0,e}function xo(e,t,i){return Pn(t,e.child,null,i),e=ch(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function L1(e,t,i,a,u,m,R,H){if(i)return t.flags&256?(nn(t),t.flags&=-257,xo(e,t,H)):t.memoizedState!==null?(rn(),t.child=e.child,t.flags|=128,null):(rn(),m=u.fallback,R=t.mode,u=So({mode:"visible",children:u.children},R),m=On(m,R,H,null),m.flags|=2,u.return=t,m.return=t,u.sibling=m,t.child=u,Pn(t,e.child,null,H),u=t.child,u.memoizedState=lh(H),u.childLanes=oh(e,a,H),t.memoizedState=ah,$a(null,u));if(nn(t),ld(m)){if(a=m.nextSibling&&m.nextSibling.dataset,a)var K=a.dgst;return a=K,a!==""&&(u=Error(o(419)),u.stack="",u.digest=a,ka({value:u,source:null,stack:null})),xo(e,t,H)}if(Dt||Bn(e,t,H,!1),a=(H&e.childLanes)!==0,Dt||a){if(sn.current!==null)return xo(e,t,H);if(a=ft,a!==null&&(u=Dm(a,H),u!==0&&u!==R.retryLane))throw R.retryLane=u,An(e,u),ps(a,e,u),nh;return ad(m)||zo(),xo(e,t,H)}return ad(m)?(t.flags|=192,t.child=e.child,null):(e=R.treeContext,mt=$s(m.nextSibling),zt=t,Fe=!0,Zi=null,Us=!1,e!==null&&Dp(t,e),t=ch(t,u.children),t.flags|=134221824,t)}function Xg(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Jl(e.return,t,i)}function Wg(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&oo(i)===null&&(t=e),e=e.sibling}return t}function wo(e,t,i,a,u,m){var R=e.memoizedState;R===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:u,treeForkCount:m}:(R.isBackwards=t,R.rendering=null,R.renderingStartTime=0,R.last=a,R.tail=i,R.tailMode=u,R.treeForkCount=m)}function uh(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function hh(e,t,i){var a=t.pendingProps,u=a.revealOrder,m=a.tail;a=a.children;var R=Yt.current;if(t.flags&128)return Ia(t,R),null;var H=(R&2)!==0;if(H?(R=R&1|2,t.flags|=128):R&=1,Ia(t,R),u==="backwards"&&e!==null?(uh(e),Ht(e,t,a,i),uh(e)):Ht(e,t,a,i),a=Fe?Ta:0,!H&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xg(e,i,t);else if(e.tag===19)Xg(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"backwards":i=Wg(t.child),i===null?(u=t.child,t.child=null):(u=i.sibling,i.sibling=null,uh(t)),wo(t,!0,u,null,m,a);break;case"unstable_legacy-backwards":for(i=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&oo(e)===null){t.child=u;break}e=u.sibling,u.sibling=i,i=u,u=e}wo(t,!0,i,null,m,a);break;case"together":wo(t,!1,null,null,void 0,a);break;case"independent":t.memoizedState=null;break;default:i=Wg(t.child),i===null?(u=t.child,t.child=null):(u=i.sibling,i.sibling=null),wo(t,!1,u,i,m,a)}return t.child}function Qg(e,t,i){var a=t.pendingProps;return Wi(t,t.type,a.value),Ht(e,t,a.children,i),t.child}function Ai(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),cn|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Bn(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=Ni(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ni(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function dh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&eo(e)))}function M1(e,t,i){switch(t.tag){case 3:wt(t,t.stateNode.containerInfo),Wi(t,kt,e.memoizedState.cache),Ln();break;case 27:case 5:G(t);break;case 4:wt(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Iu(t),null;break;case 13:var a=t.memoizedState;if(a!==null){if(a.dehydrated!==null)return nn(t),t.flags|=128,null;a=Bn(e,t,i,!1);var u=t.child.childLanes;return a||(i&u)!==0?Zg(e,t,i):(nn(t),e=Ai(e,t,i),e!==null?e.sibling:null)}nn(t);break;case 19:if(t.flags&128)return hh(e,t,i);if(u=(e.flags&128)!==0,a=(i&t.childLanes)!==0,a||(Bn(e,t,i,!1),a=(i&t.childLanes)!==0),u){if(a)return hh(e,t,i);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Ia(t,Yt.current),a)break;return null;case 22:return t.lanes=0,Fg(e,t,i,t.pendingProps);case 24:Wi(t,kt,e.memoizedState.cache)}return Ai(e,t,i)}function Jg(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!dh(e,i)&&(t.flags&128)===0)return Dt=!1,M1(e,t,i);Dt=(e.flags&131072)!==0}else Dt=!1,Fe&&(t.flags&1048576)!==0&&Rp(t,Ta,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=zn(t.elementType),t.type=e,typeof e=="function")yu(e)?(a=Vn(e,a),t.tag=1,t=Gg(null,t,e,a,i)):(t.tag=0,t=rh(null,t,e,a,i));else{if(e!=null){var u=e.$$typeof;if(u===ne){t.tag=11,t=zg(null,t,e,a,i);break e}else if(u===A){t.tag=14,t=$g(null,t,e,a,i);break e}else if(u===he){t.tag=10,t.type=e,t=Qg(null,t,i);break e}}throw t=ue(e)||e,Error(o(306,t,""))}}return t;case 0:return rh(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,u=Vn(a,t.pendingProps),Gg(e,t,a,u,i);case 3:e:{if(wt(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var m=t.memoizedState;u=m.element,Au(e,t),Ba(t,a,null,i);var R=t.memoizedState;if(a=R.cache,Wi(t,kt,a),a!==m.cache&&Nu(t,[kt],i,!0),Ma(),a=R.element,m.isDehydrated)if(m={element:a,isDehydrated:!1,cache:R.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=Yg(e,t,a,i);break e}else if(a!==u){u=Bs(Error(o(424)),t),ka(u),t=Yg(e,t,a,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,mt=$s(e.firstChild),zt=t,Fe=!0,Zi=null,Us=!0,i=Fp(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(Ln(),a===u){t=Ai(e,t,i);break e}Ht(e,t,a,i)}t=t.child}return t;case 26:return Tr(e,t),e===null?(i=C_(t.type,null,t.pendingProps,null))?t.memoizedState=i:Fe||(t.stateNode=i_(t.type,t.pendingProps,is.current,t)):t.memoizedState=C_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return G(t),e===null&&Fe&&(a=t.stateNode=b_(t.type,t.pendingProps,is.current),zt=t,Us=!0,u=mt,fn(t.type)?(od=u,mt=$s(a.firstChild)):mt=u),Ht(e,t,t.pendingProps.children,i),Tr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fe&&((u=a=mt)&&(a=kx(a,t.type,t.pendingProps,Us),a!==null?(t.stateNode=a,zt=t,mt=$s(a.firstChild),Us=!1,u=!0):u=!1),u||Xi(t)),G(t),u=t.type,m=t.pendingProps,R=e!==null?e.memoizedProps:null,a=m.children,Jh(u,m)?a=null:R!==null&&Jh(u,R)&&(t.flags|=32),t.memoizedState!==null&&(u=zu(e,t,C1,null,null,i),Kr._currentValue=u),Tr(e,t),Ht(e,t,a,i),t.child;case 6:return e===null&&Fe&&((e=i=mt)&&(i=Rx(i,t.pendingProps,Us),i!==null?(t.stateNode=i,zt=t,mt=null,e=!0):e=!1),e||Xi(t)),null;case 13:return Zg(e,t,i);case 4:return wt(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Pn(t,null,a,i):Ht(e,t,a,i),t.child;case 11:return zg(e,t,t.type,t.pendingProps,i);case 7:return a=t.pendingProps,Tr(e,t),Ht(e,t,a,i),t.child;case 8:return Ht(e,t,t.pendingProps.children,i),t.child;case 12:return Ht(e,t,t.pendingProps.children,i),t.child;case 10:return Qg(e,t,i);case 9:return u=t.type._context,a=t.pendingProps.children,In(t),u=Kt(u),a=a(u),t.flags|=1,Ht(e,t,a,i),t.child;case 14:return $g(e,t,t.type,t.pendingProps,i);case 15:return Pg(e,t,t.type,t.pendingProps,i);case 19:return hh(e,t,i);case 31:return O1(e,t,i);case 22:return Fg(e,t,i,t.pendingProps);case 24:return In(t),a=Kt(kt),e===null?(u=ku(),u===null&&(u=ft,m=ju(),u.pooledCache=m,m.refCount++,m!==null&&(u.pooledCacheLanes|=i),u=m),t.memoizedState={parent:a,cache:u},Du(t),Wi(t,kt,u)):((e.lanes&i)!==0&&(Au(e,t),Ba(t,null,null,i),Ma()),u=e.memoizedState,m=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Wi(t,kt,a)):(a=m.cache,Wi(t,kt,a),a!==u.cache&&Nu(t,[kt],i,!0))),Ht(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),a=t.pendingProps,a.name!=null&&a.name!=="auto"?t.flags|=e===null?18882560:18874368:Fe&&Wl(t),e!==null&&e.memoizedProps.name!==a.name?t.flags|=4194816:Tr(e,t),Ht(e,t,a.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Oi(e){e.flags|=4}function fh(e,t,i,a,u){var m;if((m=(e.mode&32)!==0)&&(m=i===null?T_(t,a):T_(t,a)&&(a.src!==i.src||a.srcSet!==i.srcSet)),m){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Lv())e.flags|=8192;else throw $n=no,Ru}else e.flags&=-16777217}function ev(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!k_(t))if(Lv())e.flags|=8192;else throw $n=no,Ru}function Co(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Tm():536870912,e.lanes|=t,Or|=t)}function Pa(e,t){if(!Fe)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(t)for(var u=e.child;u!==null;)i|=u.lanes|u.childLanes,a|=u.subtreeFlags&1206910976,a|=u.flags&1206910976,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)i|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=i,t}function B1(e,t,i){var a=t.pendingProps;switch(xu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return pt(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ki(kt),It(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Sr(t)?Oi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Cu())),pt(t),null;case 26:var u=t.type,m=t.memoizedState;return e===null?(Oi(t),m!==null?(pt(t),ev(t,m)):(pt(t),fh(t,u,null,a,i))):m?m!==e.memoizedState?(Oi(t),pt(t),ev(t,m)):(pt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Oi(t),pt(t),fh(t,u,e,a,i)),null;case 27:if(Se(t),i=is.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Oi(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return pt(t),t.subtreeFlags&=-33554433,null}e=Bt.current,Sr(t)?Ap(t):(e=b_(u,a,i),t.stateNode=e,Oi(t))}return pt(t),t.subtreeFlags&=-33554433,null;case 5:if(Se(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Oi(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return pt(t),t.subtreeFlags&=-33554433,null}if(m=Bt.current,Sr(t))Ap(t);else{var R=Ja(is.current);switch(m){case 1:m=R.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:m=R.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":m=R.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":m=R.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":m=R.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof a.is=="string"?R.createElement("select",{is:a.is}):R.createElement("select"),a.multiple?m.multiple=!0:a.size&&(m.size=a.size);break;default:m=typeof a.is=="string"?R.createElement(u,{is:a.is}):R.createElement(u)}}m[qt]=t,m[us]=a;e:for(R=t.child;R!==null;){if(R.tag===5||R.tag===6)m.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===t)break e;for(;R.sibling===null;){if(R.return===null||R.return===t)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}t.stateNode=m;e:switch(Xt(m,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Oi(t)}}return pt(t),t.subtreeFlags&=-33554433,fh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Oi(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=is.current,Sr(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,u=zt,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[qt]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Jv(e.nodeValue,i)),e||Xi(t,!0)}else e=Ja(e).createTextNode(a),e[qt]=t,t.stateNode=e}return pt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=Sr(t),i!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[qt]=t}else Ln(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),e=!1}else i=Cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Ns(t),t):(Ns(t),null);if((t.flags&128)!==0)throw Error(o(558))}return pt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Sr(t),a!==null&&a.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[qt]=t}else Ln(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pt(t),u=!1}else u=Cu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Ns(t),t):(Ns(t),null)}return Ns(t),(t.flags&128)!==0?(t.lanes=i,t):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),m=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(m=a.memoizedState.cachePool.pool),m!==u&&(a.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Co(t,t.updateQueue),pt(t),null);case 4:return It(),e===null&&Yh(t.stateNode.containerInfo),t.flags|=67108864,pt(t),null;case 10:return ki(t.type),pt(t),null;case 19:if(Hu(t),a=t.memoizedState,a===null)return pt(t),null;if(u=(t.flags&128)!==0,m=a.rendering,m===null)if(u)Pa(a,!1);else{if(Et!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=oo(e),m!==null){for(t.flags|=128,Pa(a,!1),e=m.updateQueue,t.updateQueue=e,Co(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)jp(i,e),i=i.sibling;return Ia(t,Yt.current&1|2),Fe&&ji(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ns()>Bo&&(t.flags|=128,u=!0,Pa(a,!1),t.lanes=4194304)}else{if(!u)if(e=oo(m),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Co(t,e),Pa(a,!0),a.tail===null&&a.tailMode!=="collapsed"&&a.tailMode!=="visible"&&!m.alternate&&!Fe)return pt(t),null}else 2*ns()-a.renderingStartTime>Bo&&i!==536870912&&(t.flags|=128,u=!0,Pa(a,!1),t.lanes=4194304);a.isBackwards?(m.sibling=t.child,t.child=m):(e=a.last,e!==null?e.sibling=m:t.child=m,a.last=m)}if(a.tail!==null){e=a.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ns(),e.sibling=null,m=Yt.current,m=u?m&1|2:m&1,a.tailMode==="visible"||a.tailMode==="collapsed"||!i||Fe?Ia(t,m):(i=m,Ke(Gt,t),Ke(Yt,i),ts===null&&(ts=t)),Fe&&ji(t,a.treeForkCount),e}return pt(t),null;case 22:case 23:return Ns(t),Bu(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(i&536870912)!==0&&(t.flags&128)===0&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),i=t.updateQueue,i!==null&&Co(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==i&&(t.flags|=2048),e!==null&&we(Un),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ki(kt),pt(t),null;case 25:return null;case 30:return t.flags|=33554432,pt(t),null}throw Error(o(156,t.tag))}function I1(e,t){switch(xu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ki(kt),It(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(Ns(t),t.alternate===null)throw Error(o(340));Ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ns(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Hu(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return It(),null;case 10:return ki(t.type),null;case 22:case 23:return Ns(t),Bu(),e!==null&&we(Un),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ki(kt),null;case 25:return null;default:return null}}function tv(e,t){switch(xu(t),t.tag){case 3:ki(kt),It();break;case 26:case 27:case 5:Se(t);break;case 4:It();break;case 31:t.memoizedState!==null&&Ns(t);break;case 13:Ns(t);break;case 19:Hu(t);break;case 10:ki(t.type);break;case 22:case 23:Ns(t),Bu(),e!==null&&we(Un);break;case 24:ki(kt)}}function Fa(e,t){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var u=a.next;i=u;do{if((i.tag&e)===e){a=void 0;var m=i.create,R=i.inst;a=m(),R.destroy=a}i=i.next}while(i!==u)}}catch(H){ot(t,t.return,H)}}function an(e,t,i){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var m=u.next;a=m;do{if((a.tag&e)===e){var R=a.inst,H=R.destroy;if(H!==void 0){R.destroy=void 0,u=t;var K=i,ie=H;try{ie()}catch(oe){ot(u,K,oe)}}}a=a.next}while(a!==m)}}catch(oe){ot(t,t.return,oe)}}function sv(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{qp(t,i)}catch(a){ot(e,e.return,a)}}}function iv(e,t,i){i.props=Vn(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){ot(e,t,a)}}function ui(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:var u=e.stateNode,m=Ci(e.memoizedProps,u);(u.ref===null||u.ref.name!==m)&&(u.ref=u_(m)),a=u.ref;break;case 7:if(e.stateNode===null){var R=new Ds(e);f(e.child,!1,jx,R,void 0,void 0),e.stateNode=R}a=e.stateNode;break;default:a=e.stateNode}typeof i=="function"?e.refCleanup=i(a):i.current=a}}catch(H){ot(e,t,H)}}function Zt(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(u){ot(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(u){ot(e,t,u)}else i.current=null}function Eo(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)g_(e.stateNode,t[i])}function nv(e){for(var t=e.return;t!==null&&(ph(t)&&g_(e.stateNode,t.stateNode),!mh(t));)t=t.return}function Va(e){for(var t=e.return;t!==null&&(ph(t)&&Tx(e.stateNode,t.stateNode),!mh(t));)t=t.return}function mh(e){return e.tag===5||e.tag===3||e.tag===27}function ph(e){return e&&e.tag===7&&e.stateNode!==null}function gh(e){var t=e.type,i=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break e;case"img":i.src?a.src=i.src:i.srcSet&&(a.srcset=i.srcSet)}}catch(u){ot(e,e.return,u)}}function vh(e,t,i){try{var a=e.stateNode;cx(a,e.type,i,t),a[us]=t}catch(u){ot(e,e.return,u)}}function rv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fn(e.type)||e.tag===4}function _h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rv(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yh(e,t,i,a){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(u,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(u),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=li)),Eo(e,a),it=!0;else if(u!==4&&(u===27&&(Eo(e,a),a=null,fn(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(yh(e,t,i,a),e=e.sibling;e!==null;)yh(e,t,i,a),e=e.sibling}function No(e,t,i,a){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?i.insertBefore(u,t):i.appendChild(u),Eo(e,a),it=!0;else if(u!==4&&(u===27&&(Eo(e,a),a=null,fn(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(No(e,t,i,a),e=e.sibling;e!==null;)No(e,t,i,a),e=e.sibling}function av(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Xt(t,a,i),t[qt]=e,t[us]=i}catch(m){ot(e,e.return,m)}}var jo=!1,js=null;function lv(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(jo=!0)}var hi=null;function ov(){var e=hi;return hi=null,e}var ds=0;function kr(e,t,i,a,u){return ds=0,cv(e.child,t,i,a,u)}function cv(e,t,i,a,u){for(var m=!1;e!==null;){if(e.tag===5){var R=e.stateNode;if(a!==null){var H=sd(R);a.push(H),H.view&&(m=!0)}else m||sd(R).view&&(m=!0);jo=!0,o_(R,ds===0?t:t+"_"+ds,i),ds++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&u||cv(e.child,t,i,a,u)&&(m=!0));e=e.sibling}return m}function di(e,t){for(;e!==null;)e.tag===5?c_(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||di(e.child,t)),e=e.sibling}function To(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(To(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var i=t.name;t=Ei(t.default,t.share),t!=="none"&&(kr(e,i,t,null,!1)||di(e.child,!1))}e=e.sibling}}function bh(e,t){if(e.tag===30){var i=e.stateNode,a=e.memoizedProps,u=Ci(a,i),m=Ei(a.default,i.paired?a.share:a.enter);m!=="none"?kr(e,u,m,null,!1)?(To(e),i.paired||t||Ir(e,a.onEnter)):di(e.child,!1):To(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)bh(e,t),e=e.sibling;else To(e)}function Sh(e){if(js!==null&&js.size!==0){var t=js;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,a=i.name;if(a!=null&&a!=="auto"){var u=t.get(a);if(u!==void 0){var m=Ei(i.default,i.share);if(m!=="none"&&(kr(e,a,m,null,!1)?(m=e.stateNode,u.paired=m,m.paired=u,Ir(e,i.onShare)):di(e.child,!1)),t.delete(a),t.size===0)break}}}Sh(e)}e=e.sibling}}}function xh(e){if(e.tag===30){var t=e.memoizedProps,i=Ci(t,e.stateNode),a=js!==null?js.get(i):void 0,u=Ei(t.default,a!==void 0?t.share:t.exit);u!=="none"&&(kr(e,i,u,null,!1)?a!==void 0?(u=e.stateNode,a.paired=u,u.paired=a,js.delete(i),Ir(e,t.onShare)):Ir(e,t.onExit):di(e.child,!1)),js!==null&&Sh(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)xh(e),e=e.sibling;else js!==null&&Sh(e)}function uv(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Ci(t,e.stateNode);t=Ei(t.default,t.update),e.flags&=-5,t!=="none"&&kr(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&uv(e);e=e.sibling}}function wh(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,di(e.child,!1))}wh(e)}e=e.sibling}}function ko(e){if(e.tag===30)e.stateNode.paired=null,di(e.child,!1),wh(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)ko(e),e=e.sibling;else wh(e)}function hv(e){for(e=e.child;e!==null;)e.tag===30?di(e.child,!1):(e.subtreeFlags&33554432)!==0&&hv(e),e=e.sibling}function Ch(e,t,i,a,u,m,R){for(var H=!1;t!==null;){if(t.tag===5){var K=t.stateNode;if(m!==null&&ds<m.length){var ie=m[ds],oe=sd(K);(ie.view||oe.view)&&(H=!0);var _e;if(_e=(e.flags&4)===0)if(oe.clip)_e=!0;else{_e=ie.rect;var te=oe.rect;_e=_e.y!==te.y||_e.x!==te.x||_e.height!==te.height||_e.width!==te.width}_e&&(e.flags|=4),oe.abs?oe=!ie.abs:(ie=ie.rect,oe=oe.rect,oe=ie.height!==oe.height||ie.width!==oe.width),oe&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&o_(K,ds===0?i:i+"_"+ds,u),H&&(e.flags&4)!==0||(hi===null&&(hi=[]),hi.push(K,ds===0?a:a+"_"+ds,t.memoizedProps)),ds++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&R?e.flags|=t.flags&32:Ch(e,t.child,i,a,u,m,R)&&(H=!0));t=t.sibling}return H}function dv(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,a=e.stateNode,u=Ci(i,a),m=Ei(i.default,i.update),R;R=e.memoizedState,e.memoizedState=null,a=e;var H=e.child;ds=0,u=Ch(a,H,u,u,m,R,!1),(e.flags&4)!==0&&u&&Ir(e,i.onUpdate)}else(e.subtreeFlags&33554432)!==0&&dv(e);e=e.sibling}}var $t=!1,rt=!1,fi=!1,Eh=!1,fv=typeof WeakSet=="function"?WeakSet:Set,Pt=null,mi=!1,qa=!1,Ro=!1,Nh=!1;function H1(e,t,i){if(e=e.containerInfo,Wh=Gr,e=vp(e),du(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var m=u.anchorOffset,R=u.focusNode;u=u.focusOffset;try{a.nodeType,R.nodeType}catch{a=null;break e}var H=0,K=-1,ie=-1,oe=0,_e=0,te=e,ae=null;t:for(;;){for(var be;te!==a||m!==0&&te.nodeType!==3||(K=H+m),te!==R||u!==0&&te.nodeType!==3||(ie=H+u),te.nodeType===3&&(H+=te.nodeValue.length),(be=te.firstChild)!==null;)ae=te,te=be;for(;;){if(te===e)break t;if(ae===a&&++oe===m&&(K=H),ae===R&&++_e===u&&(ie=H),(be=te.nextSibling)!==null)break;te=ae,ae=te.parentNode}te=be}a=K===-1||ie===-1?null:{start:K,end:ie}}else a=null}a=a||{start:0,end:0}}else a=null;for(Qh={focusedElem:e,selectionRange:a},Gr=!1,i=(i&335544064)===i,Pt=t,t=i?9270:1024;Pt!==null;){if(e=Pt,i&&(a=e.deletions,a!==null))for(m=0;m<a.length;m++)i&&xh(a[m]);if(e.alternate===null&&(e.flags&2)!==0)i&&lv(e),Do(i);else{if(e.tag===22){if(a=e.alternate,e.memoizedState!==null){a!==null&&a.memoizedState===null&&i&&xh(a),Do(i);continue}else if(a!==null&&a.memoizedState!==null){i&&lv(e),Do(i);continue}}a=e.child,(e.subtreeFlags&t)!==0&&a!==null?(a.return=e,Pt=a):(i&&uv(e),Do(i))}}js=null}function Do(e){for(;Pt!==null;){var t=Pt,i=e,a=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((u&1024)!==0&&a!==null){i=void 0,u=a.memoizedProps,a=a.memoizedState;var m=t.stateNode;try{var R=Vn(t.type,u);i=m.getSnapshotBeforeUpdate(R,a),m.__reactInternalSnapshotBeforeUpdate=i}catch(H){ot(t,t.return,H)}}break;case 3:if((u&1024)!==0){if(a=t.stateNode.containerInfo,i=a.nodeType,i===9)rd(a);else if(i===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":rd(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&a!==null&&(i=Ci(a.memoizedProps,a.stateNode),u=t.memoizedProps,u=Ei(u.default,u.update),u!=="none"&&kr(a,i,u,a.memoizedState=[],!0));break;default:if((u&1024)!==0)throw Error(o(163))}if(a=t.sibling,a!==null){a.return=t.return,Pt=a;break}Pt=t.return}}function mv(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:pi(e,i),a&4&&Fa(5,i);break;case 1:if(pi(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(R){ot(i,i.return,R)}else{var u=Vn(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(R){ot(i,i.return,R)}}a&64&&sv(i),a&512&&ui(i,i.return);break;case 3:if(pi(e,i),a&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{qp(e,t)}catch(R){ot(i,i.return,R)}}break;case 27:t===null&&a&4&&av(i);case 26:case 5:pi(e,i),t===null&&a&4&&gh(i),a&512&&ui(i,i.return);break;case 12:pi(e,i);break;case 31:pi(e,i),a&4&&_v(e,i);break;case 13:pi(e,i),a&4&&yv(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=X1.bind(null,i),Dx(e,i))));break;case 22:if(a=i.memoizedState!==null||$t,!a){var m=t!==null&&t.memoizedState!==null||rt;t=$t,u=rt,$t=a,(rt=m)&&!u?(a=2,(i.subtreeFlags&8772)!==0&&(a|=1),Xs(e,i,a)):pi(e,i),$t=t,rt=u}break;case 30:pi(e,i),a&512&&ui(i,i.return);break;case 7:a&512&&ui(i,i.return);default:pi(e,i)}}function jh(e,t){for(e=e.child;e!==null;)pv(e,t),e=e.sibling}function pv(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var a=i.style;typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"}else{var u=e.stateNode,m=e.memoizedProps.style,R=m!=null&&m.hasOwnProperty("display")?m.display:null;u.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(K){ot(e,e.return,K)}Th(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,it=!0}catch(K){ot(e,e.return,K)}break;case 18:try{var H=e.stateNode;t?l_(H,!0):l_(e.stateNode,!1)}catch(K){ot(e,e.return,K)}break;case 22:case 23:e.memoizedState===null&&jh(e,t);break;default:jh(e,t)}}function Th(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,a=t;switch(i.tag){case 4:pv(i,a);break e;case 22:i.memoizedState===null&&Th(i,a);break e;default:Th(i,a)}}e=e.sibling}}function gv(e){var t=e.alternate;t!==null&&(e.alternate=null,gv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ml(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var vt=null,fs=!1;function Ys(e,t,i){for(i=i.child;i!==null;)vv(e,t,i),i=i.sibling}function vv(e,t,i){if(xs&&typeof xs.onCommitFiberUnmount=="function")try{xs.onCommitFiberUnmount(ma,i)}catch{}switch(i.tag){case 26:rt||Zt(i,t),Ys(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!rt&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:rt||Zt(i,t),Va(i);var a=vt,u=fs;fn(i.type)&&(vt=i.stateNode,fs=!1),Ys(e,t,i),S_(i.stateNode,i.type,i.memoizedProps),vt=a,fs=u;break;case 5:rt||Zt(i,t),Va(i);case 6:if(i.tag===6&&Va(i),a=vt,u=fs,vt=null,Ys(e,t,i),vt=a,fs=u,vt!==null)if(fs)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode),it=!0}catch(m){ot(i,t,m)}else try{vt.removeChild(i.stateNode),it=!0}catch(m){ot(i,t,m)}break;case 18:vt!==null&&(fs?(e=vt,a_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Yr(e)):a_(vt,i.stateNode));break;case 4:a=vt,u=fs,vt=i.stateNode.containerInfo,fs=!0,Ys(e,t,i),vt=a,fs=u;break;case 0:case 11:case 14:case 15:an(2,i,t),rt||an(4,i,t),Ys(e,t,i);break;case 1:rt||(Zt(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&iv(i,t,a)),Ys(e,t,i);break;case 21:Ys(e,t,i);break;case 22:rt=(a=rt)||i.memoizedState!==null,Ys(e,t,i),rt=a;break;case 30:Zt(i,t),Ys(e,t,i);break;case 7:rt||Zt(i,t),Ys(e,t,i);break;default:Ys(e,t,i)}}function _v(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yr(e)}catch(i){ot(t,t.return,i)}}}function yv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yr(e)}catch(i){ot(t,t.return,i)}}function U1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new fv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new fv),t;default:throw Error(o(435,e.tag))}}function Ao(e,t){var i=U1(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var u=W1.bind(null,e,a);a.then(u,u)}})}function ls(e,t,i){var a=t.deletions;if(a!==null)for(var u=0;u<a.length;u++){var m=a[u],R=e,H=t,K=H;e:for(;K!==null;){switch(K.tag){case 27:if(fn(K.type)){vt=K.stateNode,fs=!1;break e}break;case 5:vt=K.stateNode,fs=!1;break e;case 3:case 4:vt=K.stateNode.containerInfo,fs=!0;break e}K=K.return}if(vt===null)throw Error(o(160));vv(R,H,m),vt=null,fs=!1,R=m.alternate,R!==null&&(R.return=null),m.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bv(t,e,i),t=t.sibling}var Zs=null;function bv(e,t,i){var a=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(u&4&&(a=e.updateQueue,a=a!==null?a.events:null,a!==null))for(var m=0;m<a.length;m++){var R=a[m];R.ref.impl=R.nextImpl}ls(t,e,i),os(e),u&4&&(an(3,e,e.return),Fa(3,e),an(5,e,e.return));break;case 1:ls(t,e,i),os(e),u&512&&(rt||a===null||Zt(a,a.return)),u&64&&$t&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(m=Zs,ls(t,e,i),os(e),u&512&&(rt||a===null||Zt(a,a.return)),u&4)if(u=a!==null?a.memoizedState:null,i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null)if($t)e.stateNode=i_(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,u=m.ownerDocument||m;t:switch(t){case"title":a=u.getElementsByTagName("title")[0],(!a||a[va]||a[qt]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=u.createElement(t),u.head.insertBefore(a,u.querySelector("head > title"))),Xt(a,t,i),a[qt]=e,Ut(a),t=a;break e;case"link":if(m=j_("link","href",u).get(t+(i.href||""))){for(R=0;R<m.length;R++)if(a=m[R],a.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&a.getAttribute("rel")===(i.rel==null?null:i.rel)&&a.getAttribute("title")===(i.title==null?null:i.title)&&a.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){m.splice(R,1);break t}}a=u.createElement(t),Xt(a,t,i),u.head.appendChild(a);break;case"meta":if(m=j_("meta","content",u).get(t+(i.content||""))){for(R=0;R<m.length;R++)if(a=m[R],a.getAttribute("content")===(i.content==null?null:""+i.content)&&a.getAttribute("name")===(i.name==null?null:i.name)&&a.getAttribute("property")===(i.property==null?null:i.property)&&a.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&a.getAttribute("charset")===(i.charSet==null?null:i.charSet)){m.splice(R,1);break t}}a=u.createElement(t),Xt(a,t,i),u.head.appendChild(a);break;default:throw Error(o(468,t))}a[qt]=e,Ut(a),t=a}e.stateNode=t}else $t||dd(m,e.type,e.stateNode);else e.stateNode=N_(m,i,e.memoizedProps);else u!==i?(u===null?(t=a.stateNode,t===null||rt||t.parentNode.removeChild(t)):u.count--,i===null?$t||dd(m,e.type,e.stateNode):N_(m,i,e.memoizedProps)):i===null&&e.stateNode!==null&&vh(e,e.memoizedProps,a.memoizedProps);break;case 27:ls(t,e,i),os(e),u&512&&(rt||a===null||Zt(a,a.return)),a!==null&&u&4&&vh(e,e.memoizedProps,a.memoizedProps);break;case 5:if(m=fi,fi=!1,ls(t,e,i),fi=m,os(e),u&512&&(rt||a===null||Zt(a,a.return)),e.flags&32){t=e.stateNode;try{hr(t,""),it=!0}catch(oe){ot(e,e.return,oe)}}u&4&&e.stateNode!=null&&(t=e.memoizedProps,vh(e,t,a!==null?a.memoizedProps:t)),u&1024&&(Eh=!0);break;case 6:if(ls(t,e,i),os(e),u&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,it=!0}catch(oe){ot(e,e.return,oe)}}break;case 3:if(it=!1,Go=null,m=Zs,Zs=el(t.containerInfo),ls(t,e,i),Zs=m,os(e),u&4&&a!==null&&a.memoizedState.isDehydrated)try{Yr(t.containerInfo)}catch(oe){ot(e,e.return,oe)}Eh&&(Eh=!1,Sv(e)),it=!1;break;case 4:u=fi,fi=$t,a=$m(),m=Zs,Zs=el(e.stateNode.containerInfo),ls(t,e,i),os(e),Zs=m,it&&qa&&(Ro=!0),it=a,fi=u;break;case 12:ls(t,e,i),os(e);break;case 31:ls(t,e,i),os(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ao(e,t)));break;case 13:ls(t,e,i),os(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Mo=ns()),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ao(e,t)));break;case 22:m=e.memoizedState!==null,R=a!==null&&a.memoizedState!==null;var H=$t,K=rt,ie=fi;$t=H||m,fi=ie||m,rt=K||R,ls(t,e,i),rt=K,fi=ie,$t=H,os(e),u&8192&&(t=e.stateNode,t._visibility=m?t._visibility&-2:t._visibility|1,!m||a===null||R||$t||rt||(t=R||rt,i=$t,a=rt,$t=m||$t,rt=t,ln(e,2),$t=i,rt=a),!m&&fi||jh(e,m)),u&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,Ao(e,i))));break;case 19:ls(t,e,i),os(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ao(e,t)));break;case 30:u&512&&(rt||a===null||Zt(a,a.return)),u=$m(),m=qa,R=(i&335544064)===i,H=e.memoizedProps,qa=R&&Ei(H.default,H.update)!=="none",ls(t,e,i),os(e),R&&a!==null&&it&&(e.flags|=4),qa=m,it=u;break;case 21:break;case 7:u&512&&(rt||a===null||Zt(a,a.return)),a&&a.stateNode!==null&&(a.stateNode._fragmentFiber=e);default:ls(t,e,i),os(e)}}function os(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(rv(a)){i=a;break}a=a.return}a=null;for(var u=e.return;u!==null;){if(ph(u)){var m=u.stateNode;a===null?a=[m]:a.push(m)}if(mh(u))break;u=u.return}var R=a;if(i==null)throw Error(o(160));switch(i.tag){case 27:var H=i.stateNode,K=_h(e);No(e,K,H,R);break;case 5:var ie=i.stateNode;i.flags&32&&(hr(ie,""),i.flags&=-33);var oe=_h(e);No(e,oe,ie,R);break;case 3:case 4:var _e=i.stateNode.containerInfo,te=_h(e);yh(e,te,_e,R);break;default:throw Error(o(161))}}catch(ae){ot(e,e.return,ae)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sv(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Gr=!0,t.reset(),Gr=!1),e=e.sibling}}function Rr(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)xv(t,e),t=t.sibling;else dv(t)}function xv(e,t){var i=e.alternate;if(i===null)bh(e,!1);else switch(e.tag){case 3:if(Nh=mi=!1,ov(),Rr(t,e),!mi&&!Ro){if(e=hi,e!==null)for(var a=0;a<e.length;a+=3){i=e[a];var u=e[a+1];c_(i,e[a+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+u+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Nh=!0}hi=null;break;case 5:Rr(t,e);break;case 4:a=mi,mi=!1,Rr(t,e),mi&&(Ro=!0),mi=a;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?bh(e,!1):Rr(t,e));break;case 30:a=mi,u=ov(),mi=!1,Rr(t,e),mi&&(e.flags|=4);var m=e.memoizedProps,R=e.stateNode;t=Ci(m,R),R=Ci(i.memoizedProps,R);var H=Ei(m.default,m.update);H==="none"?t=!1:(m=i.memoizedState,i.memoizedState=null,i=e.child,ds=0,t=Ch(e,i,t,R,H,m,!0),ds!==(m===null?0:m.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Ir(e,e.memoizedProps.onUpdate),hi=u):u!==null&&(u.push.apply(u,hi),hi=u),mi=(e.flags&32)!==0?!0:a;break;default:Rr(t,e)}}function pi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mv(e,t.alternate,t),t=t.sibling}function ln(e,t){for(e=e.child;e!==null;){var i=e,a=t;switch(i.tag){case 0:case 11:case 14:case 15:an(4,i,i.return),ln(i,a);break;case 1:Zt(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&iv(i,i.return,u),ln(i,a);break;case 27:(a&2)!==0&&S_(i.stateNode,i.type,i.memoizedProps);case 5:Zt(i,i.return),i.tag!==5&&i.tag!==27||Va(i),ln(i,a);break;case 6:Va(i);break;case 26:Zt(i,i.return),u=i.stateNode,i.memoizedState!==null||u===null||rt||u.parentNode.removeChild(u),ln(i,a);break;case 22:i.memoizedState===null&&ln(i,a);break;case 30:Zt(i,i.return),ln(i,a);break;case 7:Zt(i,i.return);default:ln(i,a)}e=e.sibling}}function Xs(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var a=t.alternate,u=e,m=t,R=m.flags,H=(i&1)!==0;switch(m.tag){case 0:case 11:case 15:Xs(u,m,i),Fa(4,m);break;case 1:if(Xs(u,m,i),a=m,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(oe){ot(a,a.return,oe)}if(a=m,u=a.updateQueue,u!==null){var K=a.stateNode;try{var ie=u.shared.hiddenCallbacks;if(ie!==null)for(u.shared.hiddenCallbacks=null,u=0;u<ie.length;u++)Vp(ie[u],K)}catch(oe){ot(a,a.return,oe)}}H&&R&64&&sv(m),ui(m,m.return);break;case 27:(i&2)!==0&&av(m);case 5:m.tag!==5&&m.tag!==27||nv(m),Xs(u,m,i),H&&a===null&&R&4&&gh(m),ui(m,m.return);break;case 6:nv(m);break;case 26:K=m.stateNode,m.memoizedState!==null||K===null||$t||dd(el(K.ownerDocument),m.type,K),Xs(u,m,i),H&&a===null&&R&4&&gh(m),ui(m,m.return);break;case 12:Xs(u,m,i);break;case 31:Xs(u,m,i),H&&R&4&&_v(u,m);break;case 13:Xs(u,m,i),H&&R&4&&yv(u,m);break;case 22:m.memoizedState===null&&Xs(u,m,i),ui(m,m.return);break;case 30:Xs(u,m,i),ui(m,m.return);break;case 7:ui(m,m.return);default:Xs(u,m,i)}t=t.sibling}}function kh(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ra(i))}function Rh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ra(e))}function zs(e,t,i,a){var u=(i&335544064)===i;if(t.subtreeFlags&(u?10262:10256))for(t=t.child;t!==null;)wv(e,t,i,a),t=t.sibling;else u&&hv(t)}function wv(e,t,i,a){var u=(i&335544064)===i;u&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ko(t);var m=t.flags;switch(t.tag){case 0:case 11:case 15:zs(e,t,i,a),m&2048&&Fa(9,t);break;case 1:zs(e,t,i,a);break;case 3:zs(e,t,i,a),u&&Nh&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),m&2048&&(m=null,t.alternate!==null&&(m=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==m&&(t.refCount++,m!=null&&Ra(m)));break;case 12:if(m&2048){zs(e,t,i,a),m=t.stateNode;try{var R=t.memoizedProps,H=R.id,K=R.onPostCommit;typeof K=="function"&&K(H,t.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(ie){ot(t,t.return,ie)}}else zs(e,t,i,a);break;case 31:zs(e,t,i,a);break;case 13:zs(e,t,i,a);break;case 23:break;case 22:R=t.stateNode,H=t.alternate,t.memoizedState!==null?(u&&H!==null&&H.memoizedState===null&&ko(H),R._visibility&2?zs(e,t,i,a):Ka(e,t)):(u&&H!==null&&H.memoizedState!==null&&ko(t),R._visibility&2?zs(e,t,i,a):(R._visibility|=2,Dr(e,t,i,a,(t.subtreeFlags&10256)!==0||!1))),m&2048&&kh(H,t);break;case 24:zs(e,t,i,a),m&2048&&Rh(t.alternate,t);break;case 30:u&&(m=t.alternate,m!==null&&(di(m.child,!0),di(t.child,!0))),zs(e,t,i,a);break;default:zs(e,t,i,a)}}function Dr(e,t,i,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,R=t,H=i,K=a,ie=R.flags;switch(R.tag){case 0:case 11:case 15:Dr(m,R,H,K,u),Fa(8,R);break;case 23:break;case 22:var oe=R.stateNode;R.memoizedState!==null?oe._visibility&2?Dr(m,R,H,K,u):Ka(m,R):(oe._visibility|=2,Dr(m,R,H,K,u)),u&&ie&2048&&kh(R.alternate,R);break;case 24:Dr(m,R,H,K,u),u&&ie&2048&&Rh(R.alternate,R);break;default:Dr(m,R,H,K,u)}t=t.sibling}}function Ka(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,a=t,u=a.flags;switch(a.tag){case 22:Ka(i,a),u&2048&&kh(a.alternate,a);break;case 24:Ka(i,a),u&2048&&Rh(a.alternate,a);break;default:Ka(i,a)}t=t.sibling}}var qn=8192;function Kn(e,t,i){if(e.subtreeFlags&qn)for(e=e.child;e!==null;)Cv(e,t,i),e=e.sibling}function Cv(e,t,i){switch(e.tag){case 26:Kn(e,t,i),e.flags&qn&&(e.memoizedState!==null?qx(i,Zs,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&D_(i,e)));break;case 5:Kn(e,t,i),e.flags&qn&&(e=e.stateNode,(t&335544128)===t&&D_(i,e));break;case 3:case 4:var a=Zs;Zs=el(e.stateNode.containerInfo),Kn(e,t,i),Zs=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=qn,qn=16777216,Kn(e,t,i),qn=a):Kn(e,t,i));break;case 30:if((e.flags&qn)!==0&&(a=e.memoizedProps.name,a!=null&&a!=="auto")){var u=e.stateNode;u.paired=null,js===null&&(js=new Map),js.set(a,u)}Kn(e,t,i);break;default:Kn(e,t,i)}}function Ev(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ga(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];Pt=a,jv(a,e)}Ev(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Nv(e),e=e.sibling}function Nv(e){switch(e.tag){case 0:case 11:case 15:Ga(e),e.flags&2048&&an(9,e,e.return);break;case 3:Ga(e);break;case 12:Ga(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Oo(e)):Ga(e);break;default:Ga(e)}}function Oo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];Pt=a,jv(a,e)}Ev(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:an(8,t,t.return),Oo(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Oo(t));break;default:Oo(t)}e=e.sibling}}function jv(e,t){for(;Pt!==null;){var i=Pt;switch(i.tag){case 0:case 11:case 15:an(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var a=i.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ra(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,Pt=a;else e:for(i=e;Pt!==null;){a=Pt;var u=a.sibling,m=a.return;if(gv(a),a===i){Pt=null;break e}if(u!==null){u.return=m,Pt=u;break e}Pt=m}}}var z1={getCacheForType:function(e){var t=Kt(kt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Kt(kt).controller.signal}},$1=typeof WeakMap=="function"?WeakMap:Map,nt=0,ft=null,Ge=null,Ze=0,lt=0,Ts=null,on=!1,Ar=!1,Dh=!1,Li=0,Et=0,cn=0,Gn=0,Lo=0,ks=0,Or=0,Ya=null,ms=null,Ah=!1,Mo=0,Tv=0,Bo=1/0,Io=null,un=null,St=0,Ws=null,Yn=null,gi=0,Oh=0,Lh=null,kv=null,Lr=null,Mr=null,Br=null,Za=0,Ho=null;function Rs(){return(nt&2)!==0&&Ze!==0?Ze&-Ze:me.T!==null?Vh():Am()}function Rv(){if(ks===0)if((Ze&536870912)===0||Fe){var e=Dl;Dl<<=1,(Dl&3932160)===0&&(Dl=262144),ks=e}else ks=536870912;return e=Gt.current,e!==null&&(e.flags|=32),ks}function Ir(e,t){if(t!=null){var i=e.stateNode,a=i.ref;a===null&&(a=i.ref=u_(Ci(e.memoizedProps,i))),Mr===null&&(Mr=[]),Mr.push(t.bind(null,a))}}function ps(e,t,i){(e===ft&&(lt===2||lt===9)||e.cancelPendingCommit!==null)&&(Hr(e,0),hn(e,Ze,ks,!1)),ga(e,i),((nt&2)===0||e!==ft)&&(e===ft&&((nt&2)===0&&(Gn|=i),Et===4&&hn(e,Ze,ks,!1)),vi(e))}function Dv(e,t,i){if((nt&6)!==0)throw Error(o(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||pa(e,t),u=a?V1(e,t):Bh(e,t,!0),m=a;do{if(u===0){Ar&&!a&&hn(e,t,0,!1);break}else{if(i=e.current.alternate,m&&!P1(i)){u=Bh(e,t,!1),m=!1;continue}if(u===2){if(m=t,e.errorRecoveryDisabledLanes&m)var R=0;else R=e.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){t=R;e:{var H=e;u=Ya;var K=H.current.memoizedState.isDehydrated;if(K&&(Hr(H,R).flags|=256),R=Bh(H,R,!1),R!==2&&R!==6){if(Dh&&!K){H.errorRecoveryDisabledLanes|=m,Gn|=m,u=4;break e}m=ms,ms=u,m!==null&&(ms===null?ms=m:ms.push.apply(ms,m))}u=R}if(m=!1,u!==2)continue}}if(u===1){Hr(e,0),hn(e,t,0,!0);break}e:{switch(a=e,m=u,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:hn(a,t,ks,!on);break e;case 2:ms=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(u=Mo+300-ns(),10<u)){if(hn(a,t,ks,!on),Ol(a,0,!0)!==0)break e;gi=t,a.timeoutHandle=td(Av.bind(null,a,i,ms,Io,Ah,t,ks,Gn,Or,on,m,"Throttled",-0,0),u);break e}Av(a,i,ms,Io,Ah,t,ks,Gn,Or,on,m,null,-0,0)}}break}while(!0);vi(e)}function Av(e,t,i,a,u,m,R,H,K,ie,oe,_e,te,ae){e.timeoutHandle=-1;var be=t.subtreeFlags,Ne=(m&335544064)===m;if(_e=null,(Ne||be&8192||(be&16785408)===16785408)&&(_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:li},js=null,Cv(t,m,_e),Ne&&(be=_e,Ne=e.containerInfo,Ne=(Ne.nodeType===9?Ne:Ne.ownerDocument).__reactViewTransition,Ne!=null&&(be.count++,be.waitingForViewTransition=!0,be=il.bind(be),Ne.finished.then(be,be))),be=(m&62914560)===m?Mo-ns():(m&4194048)===m?Tv-ns():0,be=Kx(_e,be),be!==null)){gi=m,e.cancelPendingCommit=be(zv.bind(null,e,t,m,i,a,u,R,H,K,ie,oe,_e,null,te,ae)),hn(e,m,R,!ie);return}zv(e,t,m,i,a,u,R,H,K,ie,oe,_e)}function P1(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var a=0;a<i.length;a++){var u=i[a],m=u.getSnapshot;u=u.value;try{if(!Es(m(),u))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function hn(e,t,i,a){t=jm(e,t),t&=~Lo,t&=~Gn,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var m=31-ws(u),R=1<<m;a[m]=-1,u&=~R}i!==0&&km(e,i,t)}function Uo(){return(nt&6)===0?(Xa(0),!1):!0}function Mh(){if(Ge!==null){if(lt===0)var e=Ge.return;else e=Ge,Ti=Mn=null,Fu(e),Cr=null,Oa=0,e=Ge;for(;e!==null;)tv(e.alternate,e),e=e.return;Ge=null}}function Hr(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,dx(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),gi=0,Mh(),ft=e,Ge=i=Ni(e.current,null),Ze=t,lt=0,Ts=null,on=!1,Ar=pa(e,t),Dh=!1,Or=ks=Lo=Gn=cn=Et=0,ms=Ya=null,Ah=!1,Li=jm(e,t),Kl(),i}function Ov(e,t){Ue=null,me.H=_o,t===wr||t===io?(t=zp(),lt=3):t===Ru?(t=zp(),lt=4):lt=t===nh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ts=t,Ge===null&&(Et=1,yo(e,Bs(t,e.current)))}function Lv(){var e=Gt.current;return e===null?!0:(Ze&4194048)===Ze?ts===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?e===ts:!1}function Mv(){var e=me.H;return me.H=_o,e===null?_o:e}function Bv(){var e=me.A;return me.A=z1,e}function zo(){Et=4,on||(Ze&4194048)!==Ze&&Gt.current!==null||(Ar=!0),(cn&134217727)===0&&(Gn&134217727)===0||ft===null||hn(ft,Ze,ks,!1)}function Bh(e,t,i){var a=nt;nt|=2;var u=Mv(),m=Bv();(ft!==e||Ze!==t)&&(Io=null,Hr(e,t)),t=!1;var R=Et;e:do try{if(lt!==0&&Ge!==null){var H=Ge,K=Ts;switch(lt){case 8:Mh(),R=6;break e;case 3:case 2:case 9:case 6:Gt.current===null&&(t=!0);var ie=lt;if(lt=0,Ts=null,Ur(e,H,K,ie),i&&Ar){R=0;break e}break;default:ie=lt,lt=0,Ts=null,Ur(e,H,K,ie)}}F1(),R=Et;break}catch(oe){Ov(e,oe)}while(!0);return t&&e.shellSuspendCounter++,Ti=Mn=null,nt=a,me.H=u,me.A=m,Ge===null&&(ft=null,Ze=0,Kl()),R}function F1(){for(;Ge!==null;)Iv(Ge)}function V1(e,t){var i=nt;nt|=2;var a=Mv(),u=Bv();ft!==e||Ze!==t?(Io=null,Bo=ns()+500,Hr(e,t)):Ar=pa(e,t);e:do try{if(lt!==0&&Ge!==null){t=Ge;var m=Ts;t:switch(lt){case 1:lt=0,Ts=null,Ur(e,t,m,1);break;case 2:case 9:if(Hp(m)){lt=0,Ts=null,Hv(t);break}t=function(){lt!==2&<!==9||ft!==e||(lt=7),vi(e)},m.then(t,t);break e;case 3:lt=7;break e;case 4:lt=5;break e;case 7:Hp(m)?(lt=0,Ts=null,Hv(t)):(lt=0,Ts=null,Ur(e,t,m,7));break;case 5:var R=null;switch(Ge.tag){case 26:R=Ge.memoizedState;case 5:case 27:var H=Ge;if(R?k_(R):H.stateNode.complete){lt=0,Ts=null;var K=H.sibling;if(K!==null)Ge=K;else{var ie=H.return;ie!==null?(Ge=ie,$o(ie)):Ge=null}break t}}lt=0,Ts=null,Ur(e,t,m,5);break;case 6:lt=0,Ts=null,Ur(e,t,m,6);break;case 8:Mh(),Et=6;break e;default:throw Error(o(462))}}q1();break}catch(oe){Ov(e,oe)}while(!0);return Ti=Mn=null,me.H=a,me.A=u,nt=i,Ge!==null?0:(ft=null,Ze=0,Kl(),Et)}function q1(){for(;Ge!==null&&!Tl();)Iv(Ge)}function Iv(e){var t=Jg(e.alternate,e,Li);e.memoizedProps=e.pendingProps,t===null?$o(e):Ge=t}function Hv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Kg(i,t,t.pendingProps,t.type,void 0,Ze);break;case 11:t=Kg(i,t,t.pendingProps,t.type.render,t.ref,Ze);break;case 5:Fu(t);var a=t;a===zt&&(Fe?(Ql(a),a.tag===5&&a.stateNode!=null&&(mt=a.stateNode)):(Ql(a),Fe=!0));default:tv(i,t),t=Ge=jp(t,Li),t=Jg(i,t,Li)}e.memoizedProps=e.pendingProps,t===null?$o(e):Ge=t}function Ur(e,t,i,a){Ti=Mn=null,Fu(t),Cr=null,Oa=0;var u=t.return;try{if(A1(e,u,t,i,Ze)){Et=1,yo(e,Bs(i,e.current)),Ge=null;return}}catch(m){if(u!==null)throw Ge=u,m;Et=1,yo(e,Bs(i,e.current)),Ge=null;return}t.flags&32768?(Fe||a===1?e=!0:Ar||(Ze&536870912)!==0?e=!1:(on=e=!0,(a===2||a===9||a===3||a===6)&&(a=Gt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Uv(t,e)):$o(t)}function $o(e){var t=e;do{if((t.flags&32768)!==0){Uv(t,on);return}e=t.return;var i=B1(t.alternate,t,Li);if(i!==null){Ge=i;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Et===0&&(Et=5)}function Uv(e,t){do{var i=I1(e.alternate,e);if(i!==null){i.flags&=32767,Ge=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);Et=6,Ge=null}function zv(e,t,i,a,u,m,R,H,K,ie,oe,_e){e.cancelPendingCommit=null;do Po();while(St!==0);if((nt&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===ft&&(Ge=ft=null,Ze=0),Yn=t,Ws=e,gi=i,Lh=u,kv=a,K1(e,t,i,R,H,K,_e)}}function K1(e,t,i,a,u,m,R){var H=t.lanes|t.childLanes;if(Oh=H,H|=vu,_S(e,i,H,a,u,m),Mr=null,(i&335544064)===i?(Br=b1(e),a=10262):(Br=null,a=10256),(t.subtreeFlags&a)!==0||(t.flags&a)!==0?(e.callbackNode=null,e.callbackPriority=0,Q1(kl,function(){return zh(),null})):(e.callbackNode=null,e.callbackPriority=0),jo=!1,a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=me.T,me.T=null,u=ge.p,ge.p=2,m=nt,nt|=4;try{H1(e,t,i)}finally{nt=m,ge.p=u,me.T=a}}St=1,jo?Lr=_x(R,e.containerInfo,Br,Ih,Hh,Y1,Uh,zh,G1):(Ih(),Hh(),Uh())}function G1(e){if(St!==0){var t=Ws.onRecoverableError;t(e,{componentStack:null})}}function Y1(){St===3&&(St=0,xv(Yn,Ws),St=4)}function Ih(){if(St===1){St=0;var e=Ws,t=Yn,i=gi,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=me.T,me.T=null;var u=ge.p;ge.p=2;var m=nt;nt|=4;try{qa=Ro=!1,bv(t,e,i),i=Qh;var R=vp(e.containerInfo),H=i.focusedElem,K=i.selectionRange;if(R!==H&&H&&H.ownerDocument&&gp(H.ownerDocument.documentElement,H)){if(K!==null&&du(H)){var ie=K.start,oe=K.end;if(oe===void 0&&(oe=ie),"selectionStart"in H)H.selectionStart=ie,H.selectionEnd=Math.min(oe,H.value.length);else{var _e=H.ownerDocument||document,te=_e&&_e.defaultView||window;if(te.getSelection){var ae=te.getSelection(),be=H.textContent.length,Ne=Math.min(K.start,be),ze=K.end===void 0?Ne:Math.min(K.end,be);!ae.extend&&Ne>ze&&(R=ze,ze=Ne,Ne=R);var se=pp(H,Ne),X=pp(H,ze);if(se&&X&&(ae.rangeCount!==1||ae.anchorNode!==se.node||ae.anchorOffset!==se.offset||ae.focusNode!==X.node||ae.focusOffset!==X.offset)){var re=_e.createRange();re.setStart(se.node,se.offset),ae.removeAllRanges(),Ne>ze?(ae.addRange(re),ae.extend(X.node,X.offset)):(re.setEnd(X.node,X.offset),ae.addRange(re))}}}}for(_e=[],ae=H;ae=ae.parentNode;)ae.nodeType===1&&_e.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<_e.length;H++){var ve=_e[H];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}Gr=!!Wh,Qh=Wh=null}finally{nt=m,ge.p=u,me.T=a}}e.current=t,St=2}}function Hh(){if(St===2){St=0;var e=Ws,t=Yn,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=me.T,me.T=null;var a=ge.p;ge.p=2;var u=nt;nt|=4;try{mv(e,t.alternate,t)}finally{nt=u,ge.p=a,me.T=i}}St=3}}function Uh(){if(St===4||St===3){St=0;var e=Lr;Lr=null,rr();var t=Ws,i=Yn,a=gi,u=kv,m=(a&335544064)===a?10262:10256;if((i.subtreeFlags&m)!==0||(i.flags&m)!==0?St=5:(St=0,Yn=Ws=null,$v(t,t.pendingLanes)),m=t.pendingLanes,m===0&&(un=null),Yc(a),i=i.stateNode,xs&&typeof xs.onCommitFiberRoot=="function")try{xs.onCommitFiberRoot(ma,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=me.T,m=ge.p,ge.p=2,me.T=null;try{for(var R=t.onRecoverableError,H=0;H<u.length;H++){var K=u[H];R(K.value,{componentStack:K.stack})}}finally{me.T=i,ge.p=m}}if(u=Mr,R=Br,Br=null,u!==null&&(Mr=null,R===null&&(R=[]),e!==null))for(K=0;K<u.length;K++)i=(0,u[K])(R),i!==void 0&&e.finished.finally(i);(gi&3)!==0&&Po(),vi(t),m=t.pendingLanes,(a&261930)!==0&&(m&42)!==0?t===Ho?Za++:(Za=0,Ho=t):(Za=0,Ho=null),Xa(0)}}function $v(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ra(t)))}function Po(){return Lr!==null&&(Lr.skipTransition(),Lr=null),Ih(),Hh(),Uh(),zh()}function zh(){if(St!==5)return!1;var e=Ws,t=Oh;Oh=0;var i=Yc(gi),a=me.T,u=ge.p;try{ge.p=32>i?32:i,me.T=null,i=Lh,Lh=null;var m=Ws,R=gi;if(St=0,Yn=Ws=null,gi=0,(nt&6)!==0)throw Error(o(331));var H=nt;if(nt|=4,Nv(m.current),wv(m,m.current,R,i),nt=H,Xa(0,!1),xs&&typeof xs.onPostCommitFiberRoot=="function")try{xs.onPostCommitFiberRoot(ma,m)}catch{}return!0}finally{ge.p=u,me.T=a,$v(e,t)}}function Pv(e,t,i){t=Bs(i,t),t=ih(e.stateNode,t,2),e=tn(e,t,2),e!==null&&(ga(e,2),vi(e))}function ot(e,t,i){if(e.tag===3)Pv(e,e,i);else for(;t!==null;){if(t.tag===3){Pv(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(un===null||!un.has(a))){e=Bs(i,e),i=Hg(2),a=tn(t,i,2),a!==null&&(Ug(i,a,t,e),ga(a,2),vi(a));break}}t=t.return}}function $h(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new $1;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(i)||(Dh=!0,u.add(i),e=Z1.bind(null,e,t,i),t.then(e,e))}function Z1(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ft===e&&(Ze&i)===i&&((Et===4||Et===3&&(Ze&62914560)===Ze&&300>ns()-Mo)&&(nt&2)===0?Hr(e,0):Lo|=i,Or===Ze&&(Or=0)),vi(e)}function Fv(e,t){t===0&&(t=Tm()),e=An(e,t),e!==null&&(ga(e,t),vi(e))}function X1(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Fv(e,i)}function W1(e,t){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(i=u.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),Fv(e,i)}function Q1(e,t){return Ss(e,t)}var zr=null,$r=null,Ph=!1,Fo=!1,Fh=!1,dn=0;function vi(e){e!==$r&&e.next===null&&($r===null?zr=$r=e:$r=$r.next=e),Fo=!0,Ph||(Ph=!0,ex())}function Xa(e,t){if(!Fh&&Fo){Fh=!0;do for(var i=!1,a=zr;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var m=0;else{var R=a.suspendedLanes,H=a.pingedLanes;m=(1<<31-ws(42|e)+1)-1,m&=u&~(R&~H),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,Gv(a,m))}else m=Ze,m=Ol(a,a===ft?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(m&3)===0||pa(a,m)||(i=!0,Gv(a,m));a=a.next}while(i);Fh=!1}}function J1(){Vv()}function Vv(){Fo=Ph=!1;var e=0;dn!==0&&hx()&&(e=dn);for(var t=ns(),i=null,a=zr;a!==null;){var u=a.next,m=qv(a,t);m===0?(a.next=null,i===null?zr=u:i.next=u,u===null&&($r=i)):(i=a,(e!==0||(m&3)!==0)&&(Fo=!0)),a=u}St!==0&&St!==5||Xa(e),dn!==0&&(dn=0)}function qv(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var R=31-ws(m),H=1<<R,K=u[R];K===-1?((H&i)===0||(H&a)!==0)&&(u[R]=vS(H,t)):K<=t&&(e.expiredLanes|=H),m&=~H}if(t=ft,i=Ze,i=Ol(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(lt===2||lt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Fi(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||pa(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&Fi(a),Yc(i)){case 2:case 8:i=fa;break;case 32:i=kl;break;case 268435456:i=Nm;break;default:i=kl}return a=Kv.bind(null,e),i=Ss(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&Fi(a),e.callbackPriority=2,e.callbackNode=null,2}function Kv(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Po()&&e.callbackNode!==i)return null;var a=Ze;return a=Ol(e,e===ft?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Dv(e,a,t),qv(e,ns()),e.callbackNode!=null&&e.callbackNode===i?Kv.bind(null,e):null)}function Gv(e,t){if(Po())return null;Dv(e,t,!0)}function ex(){fx(function(){(nt&6)!==0?Ss(Vi,J1):Vv()})}function Vh(){if(dn===0){var e=Hn;e===0&&(e=Rl,Rl<<=1,(Rl&261888)===0&&(Rl=256)),dn=e}return dn}function Yv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Hl(e)}function tx(e,t,i,a,u){if(t==="submit"&&i&&i.stateNode===u){var m=Yv((u[us]||null).action),R=a.submitter;R&&(t=(t=R[us]||null)?Yv(t.formAction):R.getAttribute("formAction"),t!==null&&(m=t,R=null));var H=new Pl("action","action",null,a,u);e.push({event:H,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(dn!==0){var K=new FormData(u,R);Qu(i,{pending:!0,data:K,method:u.method,action:m},null,K)}}else typeof m=="function"&&(H.preventDefault(),K=new FormData(u,R),Qu(i,{pending:!0,data:K,method:u.method,action:m},m,K))},currentTarget:u}]})}}for(var qh=0;qh<gu.length;qh++){var Kh=gu[qh],sx=Kh.toLowerCase(),ix=Kh[0].toUpperCase()+Kh.slice(1);Gs(sx,"on"+ix)}Gs(bp,"onAnimationEnd"),Gs(Sp,"onAnimationIteration"),Gs(xp,"onAnimationStart"),Gs("dblclick","onDoubleClick"),Gs("focusin","onFocus"),Gs("focusout","onBlur"),Gs(d1,"onTransitionRun"),Gs(f1,"onTransitionStart"),Gs(m1,"onTransitionCancel"),Gs(wp,"onTransitionEnd"),cr("onMouseEnter",["mouseout","mouseover"]),cr("onMouseLeave",["mouseout","mouseover"]),cr("onPointerEnter",["pointerout","pointerover"]),cr("onPointerLeave",["pointerout","pointerover"]),kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kn("onBeforeInput",["compositionend","keypress","textInput","paste"]),kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wa="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(" "),nx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wa));function Zv(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var a=e[i],u=a.event;a=a.listeners;e:{var m=void 0;if(t)for(var R=a.length-1;0<=R;R--){var H=a[R],K=H.instance,ie=H.currentTarget;if(H=H.listener,K!==m&&u.isPropagationStopped())break e;m=H,u.currentTarget=ie;try{m(u)}catch(oe){ql(oe)}u.currentTarget=null,m=K}else for(R=0;R<a.length;R++){if(H=a[R],K=H.instance,ie=H.currentTarget,H=H.listener,K!==m&&u.isPropagationStopped())break e;m=H,u.currentTarget=ie;try{m(u)}catch(oe){ql(oe)}u.currentTarget=null,m=K}}}}function Ye(e,t){var i=t[Lm];i===void 0&&(i=t[Lm]=new Set);var a=e+"__bubble";i.has(a)||(Xv(t,e,2,!1),i.add(a))}function Gh(e,t,i){var a=0;t&&(a|=4),Xv(i,e,a,t)}var Vo="_reactListening"+Math.random().toString(36).slice(2);function Yh(e){if(!e[Vo]){e[Vo]=!0,Im.forEach(function(i){i!=="selectionchange"&&(nx.has(i)||Gh(i,!1,e),Gh(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vo]||(t[Vo]=!0,Gh("selectionchange",!1,t))}}function Xv(e,t,i,a){switch(U_(t)){case 2:var u=Xx;break;case 8:u=Wx;break;default:u=md}i=u.bind(null,t,i,e),u=void 0,!su||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,i,{capture:!0,passive:u}):e.addEventListener(t,i,!0):u!==void 0?e.addEventListener(t,i,{passive:u}):e.addEventListener(t,i,!1)}function Zh(e,t,i,a,u){var m=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var R=a.tag;if(R===3||R===4){var H=a.stateNode.containerInfo;if(H===u)break;if(R===4)for(R=a.return;R!==null;){var K=R.tag;if((K===3||K===4)&&R.stateNode.containerInfo===u)return;R=R.return}for(;H!==null;){if(R=Tn(H),R===null)return;if(K=R.tag,K===5||K===6||K===26||K===27){a=m=R;continue e}H=H.parentNode}}a=a.return}Xm(function(){var ie=m,oe=eu(i),_e=[];e:{var te=Cp.get(e);if(te!==void 0){var ae=Pl,be=e;switch(e){case"keypress":if(zl(i)===0)break e;case"keydown":case"keyup":ae=PS;break;case"focusin":be="focus",ae=au;break;case"focusout":be="blur",ae=au;break;case"beforeblur":case"afterblur":ae=au;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=Jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=RS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=GS;break;case bp:case Sp:case xp:ae=OS;break;case wp:ae=ZS;break;case"scroll":case"scrollend":ae=TS;break;case"wheel":ae=WS;break;case"copy":case"cut":case"paste":ae=MS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=tp;break;case"submit":ae=qS;break;case"toggle":case"beforetoggle":ae=JS}var Ne=(t&4)!==0,ze=!Ne&&(e==="scroll"||e==="scrollend"),se=Ne?te!==null?te+"Capture":null:te;Ne=[];for(var X=ie,re;X!==null;){var ve=X;if(re=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||re===null||se===null||(ve=ya(X,se),ve!=null&&Ne.push(Qa(X,ve,re))),ze)break;X=X.return}0<Ne.length&&(te=new ae(te,be,null,i,oe),_e.push({event:te,listeners:Ne}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",ae&&i!==Jc&&(be=i.relatedTarget||i.fromElement)&&(Tn(be)||be[ar]))break e;(te||ae)&&(be=oe.window===oe?oe:(ae=oe.ownerDocument)?ae.defaultView||ae.parentWindow:window,te?(ae=i.relatedTarget||i.toElement,te=ie,ae=ae?Tn(ae):null,ae!==null&&(ze=_(ae),Ne=ae.tag,ae!==ze||Ne!==5&&Ne!==27&&Ne!==6)&&(ae=null)):(te=null,ae=ie),te!==ae&&(Ne=Jm,ve="onMouseLeave",se="onMouseEnter",X="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=tp,ve="onPointerLeave",se="onPointerEnter",X="pointer"),ze=te==null?be:_a(te),re=ae==null?be:_a(ae),be=new Ne(ve,X+"leave",te,i,oe),be.target=ze,be.relatedTarget=re,ve=null,Tn(oe)===ie&&(Ne=new Ne(se,X+"enter",ae,i,oe),Ne.target=re,Ne.relatedTarget=ze,ve=Ne),ze=ve,Ne=te&&ae?D(te,ae,rx):null,te!==null&&Wv(_e,be,te,Ne,!1),ae!==null&&ze!==null&&Wv(_e,ze,ae,Ne,!0)))}e:{if(te=ie?_a(ie):window,ae=te.nodeName&&te.nodeName.toLowerCase(),ae==="select"||ae==="input"&&te.type==="file")var Ce=cp;else if(lp(te))if(up)Ce=c1;else{Ce=l1;var Xe=a1}else ae=te.nodeName,!ae||ae.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ie&&Qc(ie.elementType)&&(Ce=cp):Ce=o1;if(Ce&&(Ce=Ce(e,ie))){op(_e,Ce,i,oe);break e}Xe&&Xe(e,te,ie)}switch(Xe=ie?_a(ie):window,e){case"focusin":(lp(Xe)||Xe.contentEditable==="true")&&(pr=Xe,fu=ie,ja=null);break;case"focusout":ja=fu=pr=null;break;case"mousedown":mu=!0;break;case"contextmenu":case"mouseup":case"dragend":mu=!1,_p(_e,i,oe);break;case"selectionchange":if(h1)break;case"keydown":case"keyup":_p(_e,i,oe)}var Te;if(ou)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else mr?rp(e,i)&&(Ae="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ae="onCompositionStart");Ae&&(sp&&i.locale!=="ko"&&(mr||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&mr&&(Te=Wm()):(Ki=oe,iu="value"in Ki?Ki.value:Ki.textContent,mr=!0)),Xe=qo(ie,Ae),0<Xe.length&&(Ae=new ep(Ae,e,null,i,oe),_e.push({event:Ae,listeners:Xe}),Te?Ae.data=Te:(Te=ap(i),Te!==null&&(Ae.data=Te)))),(Te=t1?s1(e,i):i1(e,i))&&(Ae=qo(ie,"onBeforeInput"),0<Ae.length&&(Xe=new ep("onBeforeInput","beforeinput",null,i,oe),_e.push({event:Xe,listeners:Ae}),Xe.data=Te)),tx(_e,e,ie,i,oe)}Zv(_e,t)})}function Qa(e,t,i){return{instance:e,listener:t,currentTarget:i}}function qo(e,t){for(var i=t+"Capture",a=[];e!==null;){var u=e,m=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||m===null||(u=ya(e,i),u!=null&&a.unshift(Qa(e,u,m)),u=ya(e,t),u!=null&&a.push(Qa(e,u,m))),e.tag===3)return a;e=e.return}return[]}function rx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Wv(e,t,i,a,u){for(var m=t._reactName,R=[];i!==null&&i!==a;){var H=i,K=H.alternate,ie=H.stateNode;if(H=H.tag,K!==null&&K===a)break;H!==5&&H!==26&&H!==27||ie===null||(K=ie,u?(ie=ya(i,m),ie!=null&&R.unshift(Qa(i,ie,K))):u||(ie=ya(i,m),ie!=null&&R.push(Qa(i,ie,K)))),i=i.return}R.length!==0&&e.push({event:t,listeners:R})}var ax=/\r\n?/g,lx=/\u0000|\uFFFD/g;function Qv(e){return(typeof e=="string"?e:""+e).replace(ax,`
|
|
9
9
|
`).replace(lx,"")}function Jv(e,t){return t=Qv(t),Qv(e)===t}function ct(e,t,i,a,u,m){switch(i){case"children":if(typeof a=="string")t==="body"||t==="textarea"&&a===""||hr(e,a);else if(typeof a=="number"||typeof a=="bigint")t!=="body"&&hr(e,""+a);else return;break;case"className":Il(e,"class",a);break;case"tabIndex":Il(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Il(e,i,a);break;case"style":Ym(e,a,m);return;case"data":if(t!=="object"){Il(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=Hl(a),e.setAttribute(i,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(i,"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 m=="function"&&(i==="formAction"?(t!=="input"&&ct(e,t,"name",u.name,u,null),ct(e,t,"formEncType",u.formEncType,u,null),ct(e,t,"formMethod",u.formMethod,u,null),ct(e,t,"formTarget",u.formTarget,u,null)):(ct(e,t,"encType",u.encType,u,null),ct(e,t,"method",u.method,u,null),ct(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=Hl(a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=li);return;case"onScroll":a!=null&&Ye("scroll",e);return;case"onScrollEnd":a!=null&&Ye("scrollend",e);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(i=a.__html,i!=null){if(u.children!=null)throw Error(o(60));m?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}i=Hl(a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":a===!0?e.setAttribute(i,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(i,a):e.removeAttribute(i);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(i):e.setAttribute(i,a);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),Bl(e,"popover",a);break;case"xlinkActuate":xi(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":xi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":xi(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":xi(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":xi(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":xi(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":xi(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":xi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":xi(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Bl(e,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=NS.get(i)||i,Bl(e,i,a);else return}it=!0}function Xh(e,t,i,a,u,m){switch(i){case"style":Ym(e,a,m);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(i=a.__html,i!=null){if(u.children!=null)throw Error(o(60));m?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof a=="string")hr(e,a);else if(typeof a=="number"||typeof a=="bigint")hr(e,""+a);else return;break;case"onScroll":a!=null&&Ye("scroll",e);return;case"onScrollEnd":a!=null&&Ye("scrollend",e);return;case"onClick":a!=null&&(e.onclick=li);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Hm.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(u=i.endsWith("Capture"),m=i.slice(2,u?i.length-7:void 0),t=e[us]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(m,t,u),typeof a=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(m,a,u);break e}it=!0,i in e?e[i]=a:a===!0?e.setAttribute(i,""):Bl(e,i,a)}return}it=!0}function Xt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var a=!1,u=!1,m;for(m in i)if(i.hasOwnProperty(m)){var R=i[m];if(R!=null)switch(m){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ct(e,t,m,R,i,null)}}u&&ct(e,t,"srcSet",i.srcSet,i,null),a&&ct(e,t,"src",i.src,i,null);return;case"input":Ye("invalid",e);var H=m=R=u=null,K=null,ie=null;for(a in i)if(i.hasOwnProperty(a)){var oe=i[a];if(oe!=null)switch(a){case"name":u=oe;break;case"type":R=oe;break;case"checked":K=oe;break;case"defaultChecked":ie=oe;break;case"value":m=oe;break;case"defaultValue":H=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:ct(e,t,a,oe,i,null)}}Vm(e,m,H,K,ie,R,u,!1);return;case"select":Ye("invalid",e),a=R=m=null;for(u in i)if(i.hasOwnProperty(u)&&(H=i[u],H!=null))switch(u){case"value":m=H;break;case"defaultValue":R=H;break;case"multiple":a=H;default:ct(e,t,u,H,i,null)}t=m,i=R,e.multiple=!!a,t!=null?ur(e,!!a,t,!1):i!=null&&ur(e,!!a,i,!0);return;case"textarea":Ye("invalid",e),m=u=a=null;for(R in i)if(i.hasOwnProperty(R)&&(H=i[R],H!=null))switch(R){case"value":a=H;break;case"defaultValue":u=H;break;case"children":m=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(o(91));break;default:ct(e,t,R,H,i,null)}Km(e,a,u,m);return;case"option":for(K in i)i.hasOwnProperty(K)&&(a=i[K],a!=null)&&(K==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":ct(e,t,K,a,i,null));return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(a=0;a<Wa.length;a++)Ye(Wa[a],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in i)if(i.hasOwnProperty(ie)&&(a=i[ie],a!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ct(e,t,ie,a,i,null)}return;default:if(Qc(t)){for(oe in i)i.hasOwnProperty(oe)&&(a=i[oe],a!==void 0&&Xh(e,t,oe,a,i,void 0));return}}for(H in i)i.hasOwnProperty(H)&&(a=i[H],a!=null&&ct(e,t,H,a,i,null))}var ox={};function cx(e,t,i,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,m=null,R=null,H=null,K=null,ie=null,oe=null;for(ae in i){var _e=i[ae];if(i.hasOwnProperty(ae)&&_e!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":K=_e;default:a.hasOwnProperty(ae)||ct(e,t,ae,null,a,_e)}}for(var te in a){var ae=a[te];if(_e=i[te],a.hasOwnProperty(te)&&(ae!=null||_e!=null))switch(te){case"type":ae!==_e&&(it=!0),m=ae;break;case"name":ae!==_e&&(it=!0),u=ae;break;case"checked":ae!==_e&&(it=!0),ie=ae;break;case"defaultChecked":ae!==_e&&(it=!0),oe=ae;break;case"value":ae!==_e&&(it=!0),R=ae;break;case"defaultValue":ae!==_e&&(it=!0),H=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:ae!==_e&&ct(e,t,te,ae,a,_e)}}Xc(e,R,H,K,ie,oe,m,u);return;case"select":ae=R=H=te=null;for(m in i)if(K=i[m],i.hasOwnProperty(m)&&K!=null)switch(m){case"value":break;case"multiple":ae=K;default:a.hasOwnProperty(m)||ct(e,t,m,null,a,K)}for(u in a)if(m=a[u],K=i[u],a.hasOwnProperty(u)&&(m!=null||K!=null))switch(u){case"value":m!==K&&(it=!0),te=m;break;case"defaultValue":m!==K&&(it=!0),H=m;break;case"multiple":m!==K&&(it=!0),R=m;default:m!==K&&ct(e,t,u,m,a,K)}t=H,i=R,a=ae,te!=null?ur(e,!!i,te,!1):!!a!=!!i&&(t!=null?ur(e,!!i,t,!0):ur(e,!!i,i?[]:"",!1));return;case"textarea":ae=te=null;for(H in i)if(u=i[H],i.hasOwnProperty(H)&&u!=null&&!a.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:ct(e,t,H,null,a,u)}for(R in a)if(u=a[R],m=i[R],a.hasOwnProperty(R)&&(u!=null||m!=null))switch(R){case"value":u!==m&&(it=!0),te=u;break;case"defaultValue":u!==m&&(it=!0),ae=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(o(91));break;default:u!==m&&ct(e,t,R,u,a,m)}qm(e,te,ae);return;case"option":for(var be in i)te=i[be],i.hasOwnProperty(be)&&te!=null&&!a.hasOwnProperty(be)&&(be==="selected"?e.selected=!1:ct(e,t,be,null,a,te));for(K in a)te=a[K],ae=i[K],a.hasOwnProperty(K)&&te!==ae&&(te!=null||ae!=null)&&(K==="selected"?(te!==ae&&(it=!0),e.selected=te&&typeof te!="function"&&typeof te!="symbol"):ct(e,t,K,te,a,ae));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 Ne in i)te=i[Ne],i.hasOwnProperty(Ne)&&te!=null&&!a.hasOwnProperty(Ne)&&ct(e,t,Ne,null,a,te);for(ie in a)if(te=a[ie],ae=i[ie],a.hasOwnProperty(ie)&&te!==ae&&(te!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(o(137,t));break;default:ct(e,t,ie,te,a,ae)}return;default:if(Qc(t)){for(var ze in i)te=i[ze],i.hasOwnProperty(ze)&&te!==void 0&&!a.hasOwnProperty(ze)&&Xh(e,t,ze,void 0,a,te);for(oe in a)te=a[oe],ae=i[oe],!a.hasOwnProperty(oe)||te===ae||te===void 0&&ae===void 0||Xh(e,t,oe,te,a,ae);return}}for(var se in i)te=i[se],i.hasOwnProperty(se)&&te!=null&&!a.hasOwnProperty(se)&&ct(e,t,se,null,a,te);for(_e in a)te=a[_e],ae=i[_e],!a.hasOwnProperty(_e)||te===ae||te==null&&ae==null||ct(e,t,_e,te,a,ae)}function e_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ux(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var u=i[a],m=u.transferSize,R=u.initiatorType,H=u.duration;if(m&&H&&e_(R)){for(R=0,H=u.responseEnd,a+=1;a<i.length;a++){var K=i[a],ie=K.startTime;if(ie>H)break;var oe=K.transferSize,_e=K.initiatorType;oe&&e_(_e)&&(K=K.responseEnd,R+=oe*(K<H?1:(H-ie)/(K-ie)))}if(--a,t+=8*(m+R)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Wh=null,Qh=null;function Ja(e){return e.nodeType===9?e:e.ownerDocument}function t_(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function s_(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function i_(e,t,i,a){return i=Ja(i).createElement(e),i[qt]=a,i[us]=t,Xt(i,e,t),Ut(i),i}function Jh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ed=null;function hx(){var e=window.event;return e&&e.type==="popstate"?e===ed?!1:(ed=e,!0):(ed=null,!1)}var td=typeof setTimeout=="function"?setTimeout:void 0,dx=typeof clearTimeout=="function"?clearTimeout:void 0,n_=typeof Promise=="function"?Promise:void 0,r_=typeof requestAnimationFrame=="function"?requestAnimationFrame:td,fx=typeof queueMicrotask=="function"?queueMicrotask:typeof n_<"u"?function(e){return n_.resolve(null).then(e).catch(mx)}:td;function mx(e){setTimeout(function(){throw e})}function fn(e){return e==="head"}function a_(e,t){var i=t,a=0;do{var u=i.nextSibling;if(e.removeChild(i),u&&u.nodeType===8)if(i=u.data,i==="/$"||i==="/&"){if(a===0){e.removeChild(u),Yr(t);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")cd(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,cd(i);for(var m=i.firstChild;m;){var R=m.nextSibling,H=m.nodeName;m[va]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&m.rel.toLowerCase()==="stylesheet"||i.removeChild(m),m=R}}else i==="body"&&cd(e.ownerDocument.body);i=u}while(i);Yr(t)}function l_(e,t){var i=e;e=0;do{var a=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),a&&a.nodeType===8)if(i=a.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=a}while(i)}function o_(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var a=1;else for(var u=a=0;u<t.length;u++){var m=t[u];0<m.width&&0<m.height&&a++}a===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function c_(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function px(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function sd(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return px(t,i,e)}function gx(e){return e.documentElement.clientHeight}function vx(e){this.addEventListener("load",e),this.addEventListener("error",e)}function _x(e,t,i,a,u,m,R,H,K){var ie=t.nodeType===9?t:t.ownerDocument;try{var oe=ie.startViewTransition({update:function(){var te=ie.defaultView,ae=te.navigation&&te.navigation.transition,be=ie.fonts.status;a();var Ne=[];if(be==="loaded"&&(gx(ie),ie.fonts.status==="loading"&&Ne.push(ie.fonts.ready)),be=Ne.length,e!==null)for(var ze=e.suspenseyImages,se=0,X=0;X<ze.length;X++){var re=ze[X];if(!re.complete){var ve=re.getBoundingClientRect();if(0<ve.bottom&&0<ve.right&&ve.top<te.innerHeight&&ve.left<te.innerWidth){if(se+=R_(re),se>Yo){Ne.length=be;break}re=new Promise(vx.bind(re)),Ne.push(re)}}}if(0<Ne.length)return te=Promise.race([Promise.all(Ne),new Promise(function(Ce){return setTimeout(Ce,500)})]).then(u,u),(ae?Promise.allSettled([ae.finished,te]):te).then(m,m);if(u(),ae)return ae.finished.then(m,m);m()},types:i});ie.__reactViewTransition=oe;var _e=[];return oe.ready.then(function(){for(var te=ie.documentElement.getAnimations({subtree:!0}),ae=0;ae<te.length;ae++){var be=te[ae],Ne=be.effect,ze=Ne.pseudoElement;if(ze!=null&&ze.startsWith("::view-transition")){_e.push(be),be=Ne.getKeyframes();for(var se=ze=void 0,X=!0,re=0;re<be.length;re++){var ve=be[re],Ce=ve.width;if(ze===void 0)ze=Ce;else if(ze!==Ce){X=!1;break}if(Ce=ve.height,se===void 0)se=Ce;else if(se!==Ce){X=!1;break}delete ve.width,delete ve.height,ve.transform==="none"&&delete ve.transform}X&&ze!==void 0&&se!==void 0&&(Ne.setKeyframes(be),X=getComputedStyle(Ne.target,Ne.pseudoElement),X.width!==ze||X.height!==se)&&(X=be[0],X.width=ze,X.height=se,X=be[be.length-1],X.width=ze,X.height=se,Ne.setKeyframes(be))}}R()},function(te){ie.__reactViewTransition===oe&&(ie.__reactViewTransition=null);try{typeof te=="object"&&te!==null&&te.name==="InvalidStateError"&&(te.message==="View transition was skipped because document visibility state is hidden."||te.message==="Skipping view transition because document visibility state has become hidden."||te.message==="Skipping view transition because viewport size changed."||te.message==="Transition was aborted because of invalid state")&&(te=null),te!==null&&K(te)}finally{a(),u(),R()}}),oe.finished.finally(function(){for(var te=0;te<_e.length;te++)_e[te].cancel();ie.__reactViewTransition===oe&&(ie.__reactViewTransition=null),H()}),oe}catch{return a(),u(),R(),null}}function Zn(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Zn.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:O({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Zn.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),a=[],u=0;u<i.length;u++){var m=i[u].effect;m!==null&&m.target===e&&m.pseudoElement===t&&a.push(i[u])}return a},Zn.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function u_(e){return{name:e,group:new Zn("group",e),imagePair:new Zn("image-pair",e),old:new Zn("old",e),new:new Zn("new",e)}}function Ds(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ds.prototype.addEventListener=function(e,t,i){var a=null,u=null;if(!(i!=null&&typeof i!="boolean"&&(a=i.signal||null,a!==null&&a.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var m=this._eventListeners;if(d_(m,e,t,i)===-1){var R=this,H=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(H=function(K){R.removeEventListener(e,t,i),typeof t=="function"?t.call(this,K):t.handleEvent(K)}),a!==null&&(u=R.removeEventListener.bind(R,e,t,i),a.addEventListener("abort",u,{once:!0}),u=a.removeEventListener.bind(a,"abort",u)),a=Pr(i),m.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:H,cleanup:u}),f(this._fragmentFiber.child,!1,yx,e,H,a)}this._eventListeners=m}};function yx(e,t,i,a){return g(e).addEventListener(t,i,a),!1}Ds.prototype.removeEventListener=function(e,t,i){var a=this._eventListeners;if(a!==null&&(t=d_(a,e,t,i),t!==-1)){var u=a[t];i=u.attachedListener;var m=u.cleanup;u=Pr(u.optionsOrUseCapture),f(this._fragmentFiber.child,!1,bx,e,i,u),a.splice(t,1),m!==null&&m()}};function bx(e,t,i,a){return g(e).removeEventListener(t,i,a),!1}function Pr(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function h_(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function d_(e,t,i,a){if(e.length===0)return-1;a=h_(a);for(var u=0;u<e.length;u++){var m=e[u];if(m.type===t&&m.listener===i&&h_(m.optionsOrUseCapture)===a)return u}return-1}Ds.prototype.dispatchEvent=function(e){var t=x(this._fragmentFiber);if(t===null)return!0;t=g(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var a=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var u=0;u<i.length;u++){var m=i[u];a.addEventListener(m.type,m.attachedListener,Pr(m.optionsOrUseCapture))}if(t.appendChild(a),e=a.dispatchEvent(e),i)for(u=0;u<i.length;u++)m=i[u],a.removeEventListener(m.type,m.attachedListener,Pr(m.optionsOrUseCapture));return t.removeChild(a),e}return t.dispatchEvent(e)},Ds.prototype.focus=function(e){f(this._fragmentFiber.child,!0,f_,e,void 0,void 0)};function f_(e,t){return e.tag===6?!1:(e=g(e),Ax(e,t))}Ds.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,id,t,void 0,void 0);for(var i=t.length-1;0<=i&&!f_(t[i],e);i--);};function id(e,t){return t.push(e),!1}Ds.prototype.blur=function(){var e=x(this._fragmentFiber);e!==null&&(e=g(e),e=Ja(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Sx,e,void 0,void 0))};function Sx(e,t){return e.tag===6?!1:(e=g(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ds.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,xx,e,void 0,void 0)};function xx(e,t){return e.tag===6||(e=g(e),t.observe(e)),!1}Ds.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,wx,e,void 0,void 0);for(var i=t=0;i<Qs.length;i++){var a=Qs[i];a.fragmentInstance===this&&a.observer===e?e.unobserve(a.instance):Qs[t++]=a}Qs.length=t}};function wx(e,t){return e.tag===6||(e=g(e),t.unobserve(e)),!1}var Qs=[],nd=!1;function Cx(e,t,i){Qs.push({fragmentInstance:e,observer:t,instance:i}),nd||(nd=!0,Ox(function(){nd=!1;var a=Qs;Qs=[];for(var u=0;u<a.length;u++){var m=a[u];m.observer.unobserve(m.instance)}}))}Ds.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,Ex,e,void 0,void 0),e};function Ex(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=g(e),t.push.apply(t,e.getClientRects());return!1}Ds.prototype.getRootNode=function(e){var t=x(this._fragmentFiber);return t===null?this:g(t).getRootNode(e)},Ds.prototype.compareDocumentPosition=function(e){var t=x(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];f(this._fragmentFiber.child,!1,id,i,void 0,void 0);var a=g(t);if(i.length===0){if(i=a,C(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var u=a=i.compareDocumentPosition(e);return i===e?u=Node.DOCUMENT_POSITION_CONTAINS:a&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=j(t)[1],i===null?u=Node.DOCUMENT_POSITION_PRECEDING:(e=g(i).compareDocumentPosition(e),u=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),u|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=g(i[0]),u=g(i[i.length-1]);var m=C(this._fragmentFiber)?t.parentElement:a;if(m==null)return Node.DOCUMENT_POSITION_DISCONNECTED;a=m.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,m=m.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY;var R=t.compareDocumentPosition(e),H=u.compareDocumentPosition(e),K=R&Node.DOCUMENT_POSITION_CONTAINED_BY||H&Node.DOCUMENT_POSITION_CONTAINED_BY;return H=a&&m&&R&Node.DOCUMENT_POSITION_FOLLOWING&&H&Node.DOCUMENT_POSITION_PRECEDING,t=a&&t===e||m&&u===e||K||H?Node.DOCUMENT_POSITION_CONTAINED_BY:!a&&t===e||!m&&u===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:R,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Nx(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Nx(e,t,i,a,u){var m=Tn(u);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!m)e:{for(;m!==null;){if(m.tag===7&&(m===t||m.alternate===t)){i=!0;break e}m=m.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(m===null)return m=u.ownerDocument,u===m||u===m.documentElement||u===m.body;e:{for(m=t,t=x(t);m!==null;){if(!(m.tag!==5&&m.tag!==3&&m.tag!==27||m!==t&&m.alternate!==t)){m=!0;break e}m=m.return}m=!1}return m}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!m)&&!(t=m===i)&&(t=D(i,m,T),t===null?t=!1:(f(t,!0,S,m,i),m=b,b=null,t=m!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!m)&&!(t=m===a)&&(t=D(a,m,T),t===null?t=!1:(f(t,!0,N,m,a),m=b,v=b=null,t=m!==null)),t):!1}function m_(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Ds.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];f(this._fragmentFiber.child,!1,id,t,void 0,void 0);var i=e!==!1;if(t.length===0){var a=j(this._fragmentFiber);if(a=i?a[1]||a[0]||x(this._fragmentFiber):a[0]||a[1],a===null)return;if(a.tag===6){e=g(a),m_(e,i);return}if(a=g(a),a.nodeType!==9){if(a.nodeType===11){i="host"in a?a.host:null,i!==null&&i.scrollIntoView(e);return}a.scrollIntoView(e)}}for(a=i?t.length-1:0;a!==(i?-1:t.length);){var u=t[a];u.tag===6?(u=g(u),m_(u,i)):g(u).scrollIntoView(e),a+=i?-1:1}};function jx(e,t){return e=g(e),p_(e,t),!1}function p_(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function g_(e,t){var i=t._eventListeners;if(i!==null)for(var a=0;a<i.length;a++){var u=i[a];e.addEventListener(u.type,u.attachedListener,Pr(u.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(m){for(var R=0,H=0;H<Qs.length;H++){var K=Qs[H];(K.fragmentInstance!==t||K.observer!==m||K.instance!==e)&&(Qs[R++]=K)}Qs.length=R,m.observe(e)}),p_(e,t))}function Tx(e,t){var i=t._eventListeners;if(i!==null)for(var a=0;a<i.length;a++){var u=i[a];e.removeEventListener(u.type,u.attachedListener,Pr(u.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(m){typeof m.rootMargin=="string"?Cx(t,m,e):m.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":rd(i),Ml(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function kx(e,t,i,a){for(;e.nodeType===1;){var u=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[va])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=$s(e.nextSibling),e===null)break}return null}function Rx(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=$s(e.nextSibling),e===null))return null;return e}function v_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$s(e.nextSibling),e===null))return null;return e}function ad(e){return e.data==="$?"||e.data==="$~"}function ld(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Dx(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var a=function(){t(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function $s(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var od=null;function __(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return $s(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function y_(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Ax(e,t){function i(){a=!0}if(e.ownerDocument.activeElement===e)return!0;var a=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return a}function Ox(e){r_(function(){r_(function(t){return e(t)})})}function b_(e,t,i){switch(t=Ja(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function S_(e,t,i){for(var a in i){var u=i[a];i.hasOwnProperty(a)&&u!=null&&ct(e,t,a,null,ox,u)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===li&&(e.onclick=null),Ml(e)}function cd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ml(e)}var Ps=new Map,x_=new Set;function el(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Mi=ge.d;ge.d={f:Lx,r:Mx,D:Bx,C:Ix,L:Hx,m:Ux,X:$x,S:zx,M:Px};function Lx(){var e=Mi.f(),t=Uo();return e||t}function Mx(e){var t=lr(e);t!==null&&t.tag===5&&t.type==="form"?Cg(t):Mi.r(e)}var Fr=typeof document>"u"?null:document;function w_(e,t,i){var a=Fr;if(a&&typeof t=="string"&&t){var u=Ls(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof i=="string"&&(u+='[crossorigin="'+i+'"]'),x_.has(u)||(x_.add(u),e={rel:e,crossOrigin:i,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),Xt(t,"link",e),Ut(t),a.head.appendChild(t)))}}function Bx(e){Mi.D(e),w_("dns-prefetch",e,null)}function Ix(e,t){Mi.C(e,t),w_("preconnect",e,t)}function Hx(e,t,i){Mi.L(e,t,i);var a=Fr;if(a&&e&&t){var u='link[rel="preload"][as="'+Ls(t)+'"]';t==="image"&&i&&i.imageSrcSet?(u+='[imagesrcset="'+Ls(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(u+='[imagesizes="'+Ls(i.imageSizes)+'"]')):u+='[href="'+Ls(e)+'"]';var m=u;switch(t){case"style":m=Vr(e);break;case"script":m=qr(e)}if(!(Ps.has(m)||(e=O({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ps.set(m,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(tl(m))||t==="script"&&a.querySelector(sl(m))))){var R=a.createElement("link");Xt(R,"link",e),t==="style"&&(R[Ll]=!0,R.onload=R.onerror=function(){Bm(R)}),Ut(R),a.head.appendChild(R)}}}function Ux(e,t){Mi.m(e,t);var i=Fr;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Ls(a)+'"][href="'+Ls(e)+'"]',m=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=qr(e)}if(!Ps.has(m)&&(e=O({rel:"modulepreload",href:e},t),Ps.set(m,e),i.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(sl(m)))return}a=i.createElement("link"),Xt(a,"link",e),Ut(a),i.head.appendChild(a)}}}function zx(e,t,i){Mi.S(e,t,i);var a=Fr;if(a&&e){var u=or(a).hoistableStyles,m=Vr(e);t=t||"default";var R=u.get(m);if(!R){var H={loading:0,preload:null};if(R=a.querySelector(tl(m)))H.loading=5;else{e=O({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ps.get(m))&&ud(e,i);var K=R=a.createElement("link");Ut(K),Xt(K,"link",e),K._p=new Promise(function(ie,oe){K.onload=ie,K.onerror=oe}),K.addEventListener("load",function(){H.loading|=1}),K.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Ko(R,t,a)}R={type:"stylesheet",instance:R,count:1,state:H},u.set(m,R)}}}function $x(e,t){Mi.X(e,t);var i=Fr;if(i&&e){var a=or(i).hoistableScripts,u=qr(e),m=a.get(u);m||(m=i.querySelector(sl(u)),m||(e=O({src:e,async:!0},t),(t=Ps.get(u))&&hd(e,t),m=i.createElement("script"),Ut(m),Xt(m,"link",e),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},a.set(u,m))}}function Px(e,t){Mi.M(e,t);var i=Fr;if(i&&e){var a=or(i).hoistableScripts,u=qr(e),m=a.get(u);m||(m=i.querySelector(sl(u)),m||(e=O({src:e,async:!0,type:"module"},t),(t=Ps.get(u))&&hd(e,t),m=i.createElement("script"),Ut(m),Xt(m,"link",e),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},a.set(u,m))}}function C_(e,t,i,a){var u=(u=is.current)?el(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=Vr(i.href),t=or(u).hoistableStyles,a=t.get(i),a||(a={type:"style",instance:null,count:0,state:null},t.set(i,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Vr(i.href);var m=or(u).hoistableStyles,R=m.get(e);if(R||(u=u.ownerDocument||u,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,R),(m=u.querySelector(tl(e)))?m._p||(R.instance=m,R.state.loading=5):(m=Ps.get(e),m||(m={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Ps.set(e,m)),Fx(u,e,m,R.state))),t&&a===null)throw Error(o(528,""));return R}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=qr(i),t=or(u).hoistableScripts,a=t.get(i),a||(a={type:"script",instance:null,count:0,state:null},t.set(i,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Vr(e){return'href="'+Ls(e)+'"'}function tl(e){return'link[rel="stylesheet"]['+e+"]"}function E_(e){return O({},e,{"data-precedence":e.precedence,precedence:null})}function Fx(e,t,i,a){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Ll]!==!0){a.loading=1;return}}else t=e.createElement("link"),t[Ll]=!0,t.onload=t.onerror=Bm.bind(null,t),Xt(t,"link",i),Ut(t),e.head.appendChild(t);a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2})}function qr(e){return'[src="'+Ls(e)+'"]'}function sl(e){return"script[async]"+e}function N_(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Ls(i.href)+'"]');if(a)return t.instance=a,Ut(a),a;var u=O({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ut(a),Xt(a,"style",u),Ko(a,i.precedence,e),t.instance=a;case"stylesheet":u=Vr(i.href);var m=e.querySelector(tl(u));if(m)return t.state.loading|=4,t.instance=m,Ut(m),m;a=E_(i),(u=Ps.get(u))&&ud(a,u),m=(e.ownerDocument||e).createElement("link"),Ut(m);var R=m;return R._p=new Promise(function(H,K){R.onload=H,R.onerror=K}),Xt(m,"link",a),t.state.loading|=4,Ko(m,i.precedence,e),t.instance=m;case"script":return m=qr(i.src),(u=e.querySelector(sl(m)))?(t.instance=u,Ut(u),u):(a=i,(u=Ps.get(m))&&(a=O({},i),hd(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ut(u),Xt(u,"link",a),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Ko(a,i.precedence,e));return t.instance}function Ko(e,t,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,m=u,R=0;R<a.length;R++){var H=a[R];if(H.dataset.precedence===t)m=H;else if(m!==u)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function hd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Go=null;function j_(e,t,i){if(Go===null){var a=new Map,u=Go=new Map;u.set(i,a)}else u=Go,a=u.get(i),a||(a=new Map,u.set(i,a));if(a.has(e))return a;for(a.set(e,null),i=i.getElementsByTagName(e),u=0;u<i.length;u++){var m=i[u];if(!(m[va]||m[qt]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var R=m.getAttribute(t)||"";R=e+R;var H=a.get(R);H?H.push(m):a.set(R,[m])}}return a}function dd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Vx(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function T_(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function k_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function R_(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function D_(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=R_(t),e.suspenseyImages.push(t)),e=Gx.bind(e),t.decode().then(e,e))}function qx(e,t,i,a){if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var u=Vr(a.href),m=t.querySelector(tl(u));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=il.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=m,Ut(m);return}m=t.ownerDocument||t,a=E_(a),(u=Ps.get(u))&&ud(a,u),m=m.createElement("link"),Ut(m);var R=m;R._p=new Promise(function(H,K){R.onload=H,R.onerror=K}),Xt(m,"link",a),i.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=il.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Yo=0;function Kx(e,t){return e.stylesheets&&e.count===0&&Xo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&Xo(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&Yo===0&&(Yo=62500*ux());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xo(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>Yo?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function A_(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Xo(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function il(){this.count--,A_(this)}function Gx(){this.imgCount--,A_(this)}var Zo=null;function Xo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zo=new Map,t.forEach(Yx,e),Zo=null,il.call(e))}function Yx(e,t){if(!(t.state.loading&4)){var i=Zo.get(e);if(i)var a=i.get(null);else{i=new Map,Zo.set(e,i);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<u.length;m++){var R=u[m];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(i.set(R.dataset.precedence,R),a=R)}a&&i.set(null,a)}u=t.instance,R=u.getAttribute("data-precedence"),m=i.get(R)||a,m===a&&i.set(null,u),i.set(R,u),this.count++,a=il.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),m?m.parentNode.insertBefore(u,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Kr={$$typeof:he,Provider:null,Consumer:null,_currentValue:Re,_currentValue2:Re,_threadCount:0};function Zx(e,t,i,a,u,m,R,H,K){this.tag=1,this.containerInfo=e,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=Kc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kc(0),this.hiddenUpdates=Kc(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=m,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.transitionTypes=null,this.incompleteTransitions=new Map}function O_(e,t,i,a,u,m,R,H,K,ie,oe,_e){return e=new Zx(e,t,i,R,K,ie,oe,_e,H),t=1,m===!0&&(t|=24),m=hs(3,null,null,t),e.current=m,m.stateNode=e,t=ju(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:a,isDehydrated:i,cache:t},Du(m),e}function L_(e){return e?(e=_r,e):_r}function M_(e,t,i,a,u,m){u=L_(u),a.context===null?a.context=u:a.pendingContext=u,a=en(t),a.payload={element:i},m=m===void 0?null:m,m!==null&&(a.callback=m),i=tn(e,a,t),i!==null&&(ps(i,e,t),La(i,e,t))}function B_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function fd(e,t){B_(e,t),(e=e.alternate)&&B_(e,t)}function I_(e){if(e.tag===13||e.tag===31){var t=An(e,67108864);t!==null&&ps(t,e,67108864),fd(e,67108864)}}function H_(e){if(e.tag===13||e.tag===31){var t=Rs();t=Gc(t);var i=An(e,t);i!==null&&ps(i,e,t),fd(e,t)}}var Gr=!0;function Xx(e,t,i,a){var u=me.T;me.T=null;var m=ge.p;try{ge.p=2,md(e,t,i,a)}finally{ge.p=m,me.T=u}}function Wx(e,t,i,a){var u=me.T;me.T=null;var m=ge.p;try{ge.p=8,md(e,t,i,a)}finally{ge.p=m,me.T=u}}function md(e,t,i,a){if(Gr){var u=pd(a);if(u===null)Zh(e,t,a,Wo,i),z_(e,a);else if(Jx(u,e,t,i,a))a.stopPropagation();else if(z_(e,a),t&4&&-1<Qx.indexOf(e)){for(;u!==null;){var m=lr(u);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var R=jn(m.pendingLanes);if(R!==0){var H=m;for(H.pendingLanes|=2,H.entangledLanes|=2;R;){var K=1<<31-ws(R);H.entanglements[1]|=K,R&=~K}vi(m),(nt&6)===0&&(Bo=ns()+500,Xa(0))}}break;case 31:case 13:H=An(m,2),H!==null&&ps(H,m,2),Uo(),fd(m,2)}if(m=pd(a),m===null&&Zh(e,t,a,Wo,i),m===u)break;u=m}u!==null&&a.stopPropagation()}else Zh(e,t,a,null,i)}}function pd(e){return e=eu(e),gd(e)}var Wo=null;function gd(e){if(Wo=null,e=Tn(e),e!==null){var t=_(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=w(t),e!==null)return e;e=null}else if(i===31){if(e=c(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Wo=e,null}function U_(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ai()){case Vi:return 2;case fa:return 8;case kl:case hS:return 32;case Nm:return 268435456;default:return 32}default:return 32}}var vd=!1,mn=null,pn=null,gn=null,nl=new Map,rl=new Map,vn=[],Qx="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 z_(e,t){switch(e){case"focusin":case"focusout":mn=null;break;case"dragenter":case"dragleave":pn=null;break;case"mouseover":case"mouseout":gn=null;break;case"pointerover":case"pointerout":nl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(t.pointerId)}}function al(e,t,i,a,u,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:i,eventSystemFlags:a,nativeEvent:m,targetContainers:[u]},t!==null&&(t=lr(t),t!==null&&I_(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Jx(e,t,i,a,u){switch(t){case"focusin":return mn=al(mn,e,t,i,a,u),!0;case"dragenter":return pn=al(pn,e,t,i,a,u),!0;case"mouseover":return gn=al(gn,e,t,i,a,u),!0;case"pointerover":var m=u.pointerId;return nl.set(m,al(nl.get(m)||null,e,t,i,a,u)),!0;case"gotpointercapture":return m=u.pointerId,rl.set(m,al(rl.get(m)||null,e,t,i,a,u)),!0}return!1}function $_(e){var t=Tn(e.target);if(t!==null){var i=_(t);if(i!==null){if(t=i.tag,t===13){if(t=w(i),t!==null){e.blockedOn=t,Om(e.priority,function(){H_(i)});return}}else if(t===31){if(t=c(i),t!==null){e.blockedOn=t,Om(e.priority,function(){H_(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=pd(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);Jc=a,i.target.dispatchEvent(a),Jc=null}else return t=lr(i),t!==null&&I_(t),e.blockedOn=i,!1;t.shift()}return!0}function P_(e,t,i){Qo(e)&&i.delete(t)}function ew(){vd=!1,mn!==null&&Qo(mn)&&(mn=null),pn!==null&&Qo(pn)&&(pn=null),gn!==null&&Qo(gn)&&(gn=null),nl.forEach(P_),rl.forEach(P_)}function Jo(e,t){e.blockedOn===t&&(e.blockedOn=null,vd||(vd=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,ew)))}var ec=null;function F_(e){ec!==e&&(ec=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){ec===e&&(ec=null);for(var t=0;t<e.length;t+=3){var i=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(gd(a||i)===null)continue;break}var m=lr(i);m!==null&&(e.splice(t,3),t-=3,Qu(m,{pending:!0,data:u,method:i.method,action:a},a,u))}}))}function Yr(e){function t(K){return Jo(K,e)}mn!==null&&Jo(mn,e),pn!==null&&Jo(pn,e),gn!==null&&Jo(gn,e),nl.forEach(t),rl.forEach(t);for(var i=0;i<vn.length;i++){var a=vn[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<vn.length&&(i=vn[0],i.blockedOn===null);)$_(i),i.blockedOn===null&&vn.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var u=i[a],m=i[a+1],R=u[us]||null;if(typeof m=="function")R||F_(i);else if(R){var H=null;if(m&&m.hasAttribute("formAction")){if(u=m,R=m[us]||null)H=R.formAction;else if(gd(u)!==null)continue}else H=R.action;typeof H=="function"?i[a+1]=H:(i.splice(a,3),a-=3),F_(i)}}}function V_(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(R){return u=R})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(i,20)}function i(){if(!a&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function _d(e){this._internalRoot=e}tc.prototype.render=_d.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,a=Rs();M_(i,a,e,t,null,null)},tc.prototype.unmount=_d.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;M_(e.current,2,null,e,null,null),Uo(),t[ar]=null}};function tc(e){this._internalRoot=e}tc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Am();e={blockedOn:null,target:e,priority:t};for(var i=0;i<vn.length&&t!==0&&t<vn[i].priority;i++);vn.splice(i,0,e),i===0&&$_(e)}};var q_=n.version;if(q_!=="19.3.0")throw Error(o(527,q_,"19.3.0"));ge.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=y(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var tw={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sc.isDisabled&&sc.supportsFiber)try{ma=sc.inject(tw),xs=sc}catch{}}return ol.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,a="",u=Lg,m=Mg,R=Bg;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(R=t.onRecoverableError)),t=O_(e,1,!1,null,null,i,a,null,u,m,R,V_),e[ar]=t.current,Yh(e),new _d(t)},ol.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var a=!1,u="",m=Lg,R=Mg,H=Bg,K=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(R=i.onCaughtError),i.onRecoverableError!==void 0&&(H=i.onRecoverableError),i.formState!==void 0&&(K=i.formState)),t=O_(e,1,!0,t,i??null,a,u,K,m,R,H,V_),t.context=L_(null),i=t.current,a=Rs(),a=Gc(a),u=en(a),u.callback=null,tn(i,u,a),i=a,t.current.lanes=i,ga(t,i),vi(t),e[ar]=t.current,Yh(e),new tc(t)},ol.version="19.3.0",ol}var ty;function uw(){if(ty)return Sd.exports;ty=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),Sd.exports=cw(),Sd.exports}var hw=uw();var Gf=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,$b=/^[\\/]{2}/;function dw(s,n){return n+s.replace(/\\/g,"/")}var sy="popstate";function iy(s){return typeof s=="object"&&s!=null&&"pathname"in s&&"search"in s&&"hash"in s&&"state"in s&&"key"in s}function fw(s={}){function n(d,_){let{pathname:w="/",search:c="",hash:h=""}=sr(d.location.hash.substring(1));return!w.startsWith("/")&&!w.startsWith(".")&&(w="/"+w),mf("",{pathname:w,search:c,hash:h},_.state&&_.state.usr||null,_.state&&_.state.key||"default")}function l(d,_){let w=d.document.querySelector("base"),c="";if(w&&w.getAttribute("href")){let h=d.location.href,y=h.indexOf("#");c=y===-1?h:h.slice(0,y)}return c+"#"+(typeof _=="string"?_:Wn(_))}function o(d,_){qs(d.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(_)})`)}return pw(n,l,o,s)}function bt(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function qs(s,n){if(!s){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function mw(){return Math.random().toString(36).substring(2,10)}function ny(s,n){return{usr:s.state,key:s.key,idx:n,masked:s.mask?{pathname:s.pathname,search:s.search,hash:s.hash}:void 0}}function mf(s,n,l=null,o,d){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof n=="string"?sr(n):n,state:l,key:n&&n.key||o||mw(),mask:d}}function Wn({pathname:s="/",search:n="",hash:l=""}){return n&&n!=="?"&&(s+=n.charAt(0)==="?"?n:"?"+n),l&&l!=="#"&&(s+=l.charAt(0)==="#"?l:"#"+l),s}function sr(s){let n={};if(s){let l=s.indexOf("#");l>=0&&(n.hash=s.substring(l),s=s.substring(0,l));let o=s.indexOf("?");o>=0&&(n.search=s.substring(o),s=s.substring(0,o)),s&&(n.pathname=s)}return n}function pw(s,n,l,o={}){let{window:d=document.defaultView,v5Compat:_=!1}=o,w=d.history,c="POP",h=null,y=p();y==null&&(y=0,w.replaceState({...w.state,idx:y},""));function p(){return(w.state||{idx:null}).idx}function f(){c="POP";let g=p(),b=g==null?null:g-y;y=g,h&&h({action:c,location:E.location,delta:b})}function x(g,b){c="PUSH";let v=iy(g)?g:mf(E.location,g,b);l&&l(v,g),y=p()+1;let S=ny(v,y),N=E.createHref(v.mask||v);try{w.pushState(S,"",N)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;d.location.assign(N)}_&&h&&h({action:c,location:E.location,delta:1})}function C(g,b){c="REPLACE";let v=iy(g)?g:mf(E.location,g,b);l&&l(v,g),y=p();let S=ny(v,y),N=E.createHref(v.mask||v);w.replaceState(S,"",N),_&&h&&h({action:c,location:E.location,delta:0})}function j(g){return gw(d,g)}let E={get action(){return c},get location(){return s(d,w)},listen(g){if(h)throw new Error("A history only accepts one active listener");return d.addEventListener(sy,f),h=g,()=>{d.removeEventListener(sy,f),h=null}},createHref(g){return n(d,g)},createURL:j,encodeLocation(g){let b=j(g);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:x,replace:C,go(g){return w.go(g)}};return E}function gw(s,n,l=!1){let o="http://localhost";s&&(o=s.location.origin!=="null"?s.location.origin:s.location.href),bt(o,"No window.location.(origin|href) available to create URL");let d=typeof n=="string"?n:Wn(n);return d=d.replace(/ $/,"%20"),!l&&$b.test(d)&&(d=o+d),new URL(d,o)}function Pb(s,n,l="/"){return vw(s,n,l,!1)}function vw(s,n,l,o,d){let _=typeof n=="string"?sr(n):n,w=Ui(_.pathname||"/",l);if(w==null)return null;let c=_w(s),h=null,y=kw(w);for(let p=0;h==null&&p<c.length;++p)h=Tw(c[p],y,o);return h}function _w(s){let n=Fb(s);return yw(n),n}function Fb(s,n=[],l=[],o="",d=!1){let _=(w,c,h=d,y)=>{let p={relativePath:y===void 0?w.path||"":y,caseSensitive:w.caseSensitive===!0,childrenIndex:c,route:w};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(o)&&h)return;bt(p.relativePath.startsWith(o),`Absolute route path "${p.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(o.length)}let f=ti([o,p.relativePath]),x=l.concat(p);w.children&&w.children.length>0&&(bt(w.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Fb(w.children,n,x,f,h)),!(w.path==null&&!w.index)&&n.push({path:f,score:Nw(f,w.index),routesMeta:x.map((C,j)=>{let[E,g]=Kb(C.relativePath,C.caseSensitive,j===x.length-1);return{...C,matcher:E,compiledParams:g}})})};return s.forEach((w,c)=>{if(w.path===""||!w.path?.includes("?"))_(w,c);else for(let h of Vb(w.path))_(w,c,!0,h)}),n}function Vb(s){let n=s.split("/");if(n.length===0)return[];let[l,...o]=n,d=l.endsWith("?"),_=l.replace(/\?$/,"");if(o.length===0)return d?[_,""]:[_];let w=Vb(o.join("/")),c=[];return c.push(...w.map(h=>h===""?_:[_,h].join("/"))),d&&c.push(...w),c.map(h=>s.startsWith("/")&&h===""?"/":h)}function yw(s){s.sort((n,l)=>n.score!==l.score?l.score-n.score:jw(n.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var bw=/^:[\w-]+$/,Sw=3,xw=2,ww=1,Cw=10,Ew=-2,ry=s=>s==="*";function Nw(s,n){let l=s.split("/"),o=l.length;return l.some(ry)&&(o+=Ew),n&&(o+=xw),l.filter(d=>!ry(d)).reduce((d,_)=>d+(bw.test(_)?Sw:_===""?ww:Cw),o)}function jw(s,n){return s.length===n.length&&s.slice(0,-1).every((o,d)=>o===n[d])?s[s.length-1]-n[n.length-1]:0}function Tw(s,n,l=!1){let{routesMeta:o}=s,d={},_="/",w=[];for(let c=0;c<o.length;++c){let h=o[c],y=c===o.length-1,p=_==="/"?n:n.slice(_.length)||"/",f={path:h.relativePath,caseSensitive:h.caseSensitive,end:y},x=h.matcher&&h.compiledParams?qb(f,p,h.matcher,h.compiledParams):gc(f,p),C=h.route;if(!x&&y&&l&&!o[o.length-1].route.index&&(x=gc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},p)),!x)return null;Object.assign(d,x.params),w.push({params:d,pathname:ti([_,x.pathname]),pathnameBase:Aw(ti([_,x.pathnameBase])),route:C}),x.pathnameBase!=="/"&&(_=ti([_,x.pathnameBase]))}return w}function gc(s,n){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[l,o]=Kb(s.path,s.caseSensitive,s.end);return qb(s,n,l,o)}function qb(s,n,l,o){let d=n.match(l);if(!d)return null;let _=d[0],w=ta(_,1),c=d.slice(1);return{params:o.reduce((y,{paramName:p,isOptional:f},x)=>{if(p==="*"){let j=c[x]||"";w=ta(_.slice(0,_.length-j.length),1)}const C=c[x];return f&&!C?y[p]=void 0:y[p]=(C||"").replace(/%2F/g,"/"),y},{}),pathname:_,pathnameBase:w,pattern:s}}function Kb(s,n=!1,l=!0){qs(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let o=[],d="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(w,c,h,y,p)=>{if(o.push({paramName:c,isOptional:h!=null}),h){let f=p.charAt(y+w.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(o.push({paramName:"*"}),d+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?d+="\\/*$":s!==""&&s!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,n?void 0:"i"),o]}function kw(s){try{return s.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return qs(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),s}}function Ui(s,n){if(n==="/")return s;if(!s.toLowerCase().startsWith(n.toLowerCase()))return null;let l=n.endsWith("/")?n.length-1:n.length,o=s.charAt(l);return o&&o!=="/"?null:s.slice(l)||"/"}function Rw(s,n="/"){let{pathname:l,search:o="",hash:d=""}=typeof s=="string"?sr(s):s,_;return l?(l=Gb(l),l.startsWith("/")||l.startsWith("\\")?_=ay(l.substring(1),"/"):_=ay(l,n)):_=n,{pathname:_,search:Ow(o),hash:Lw(d)}}function ay(s,n){let l=ta(n).split("/");return s.split("/").forEach(d=>{d===".."?l.length>1&&l.pop():d!=="."&&l.push(d)}),l.length>1?l.join("/"):"/"}function Ed(s,n,l,o){return`Cannot include a '${s}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dw(s){return s.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function Yf(s){let n=Dw(s);return n.map((l,o)=>o===n.length-1?l.pathname:l.pathnameBase)}function Oc(s,n,l,o=!1){let d;typeof s=="string"?d=sr(s):(d={...s},bt(!d.pathname||!d.pathname.includes("?"),Ed("?","pathname","search",d)),bt(!d.pathname||!d.pathname.includes("#"),Ed("#","pathname","hash",d)),bt(!d.search||!d.search.includes("#"),Ed("#","search","hash",d)));let _=s===""||d.pathname==="",w=_?"/":d.pathname,c;if(w==null)c=l;else{let f=n.length-1;if(!o&&w.startsWith("..")){let x=w.split("/");for(;x[0]==="..";)x.shift(),f-=1;d.pathname=x.join("/")}c=f>=0?n[f]:"/"}let h=Rw(d,c),y=w&&w!=="/"&&w.endsWith("/"),p=(_||w===".")&&l.endsWith("/");return!h.pathname.endsWith("/")&&(y||p)&&(h.pathname+="/"),h}var Gb=s=>s.replace(/[\\/]{2,}/g,"/"),ti=s=>Gb(s.join("/"));function ta(s,n=0){let l=s.length;for(;l>n&&s.charCodeAt(l-1)===47;)l--;return l===s.length?s:s.slice(0,l)}var Aw=s=>ta(s).replace(/^\/*/,"/"),Ow=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Lw=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,Mw=class{constructor(s,n,l,o=!1){this.status=s,this.statusText=n||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function Bw(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function Iw(s){let n=s.map(l=>l.route.path).filter(Boolean);return ti(n)||"/"}var Yb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Zb(s,n){let l=s;if(typeof l!="string"||!Gf.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,d=!1;if(Yb)try{let _=new URL(window.location.href),w=$b.test(l)?new URL(dw(l,_.protocol)):new URL(l),c=Ui(w.pathname,n);w.origin===_.origin&&c!=null?l=c+w.search+w.hash:d=!0}catch{qs(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:d,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ly=new URL("http://localhost");function Zf(s){if(s.createURL)return s.createURL("/");try{return new URL(s.createHref("/"),ly)}catch{return ly}}function Nd(s,n){return s.origin===n.origin&&(s.origin!=="null"||s.protocol===n.protocol&&s.host===n.host)}function Hw(s,n){if(s.startsWith("//"))return!0;let l=n.protocol.toLowerCase();return s.toLowerCase().startsWith(l)?n.host===""||s.slice(l.length).startsWith("//"):!1}function Xf(s,n,l,o){let d=null;try{d=s==null?null:new URL(s,l)}catch{}let _=new URL(n,l),w=d!=null&&!Nd(d,l),c=!Nd(_,l);if(o==="reject"){if(w||c)throw new Error("External navigation is not allowed")}else if(c&&(d==null||!Hw(s,d)||!Nd(d,_)))throw new Error("External navigation is not allowed")}var Xb=["POST","PUT","PATCH","DELETE"];new Set(Xb);var Uw=["GET",...Xb];new Set(Uw);var zw=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function $w(s){try{return zw.includes(new URL(s).protocol)}catch{return!1}}var oa=M.createContext(null);oa.displayName="DataRouter";var Lc=M.createContext(null);Lc.displayName="DataRouterState";var Wb=M.createContext(!1);function Pw(){return M.useContext(Wb)}var Qb=M.createContext({isTransitioning:!1});Qb.displayName="ViewTransition";var Fw=M.createContext(new Map);Fw.displayName="Fetchers";var Vw=M.createContext(null);Vw.displayName="Await";var Os=M.createContext(null);Os.displayName="Navigation";var wl=M.createContext(null);wl.displayName="Location";var ni=M.createContext({outlet:null,matches:[],isDataRoute:!1});ni.displayName="Route";var Wf=M.createContext(null);Wf.displayName="RouteError";var Jb="REACT_ROUTER_ERROR",qw="REDIRECT",Kw="ROUTE_ERROR_RESPONSE";function Gw(s){if(s.startsWith(`${Jb}:${qw}:{`))try{let n=JSON.parse(s.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function Yw(s){if(s.startsWith(`${Jb}:${Kw}:{`))try{let n=JSON.parse(s.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Mw(n.status,n.statusText,n.data)}catch{}}function Zw(s,{relative:n}={}){bt(ca(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=M.useContext(Os),{hash:d,pathname:_,search:w}=El(s,{relative:n}),c=_;return l!=="/"&&(c=_==="/"?l:ti([l,_])),o.createHref({pathname:c,search:w,hash:d})}function ca(){return M.useContext(wl)!=null}function _s(){return bt(ca(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(wl).location}var e0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function t0(s){M.useContext(Os).static||M.useLayoutEffect(s)}function Cl(){let{isDataRoute:s}=M.useContext(ni);return s?uC():Xw()}function Xw(){bt(ca(),"useNavigate() may be used only in the context of a <Router> component.");let s=M.useContext(oa),{basename:n,navigator:l}=M.useContext(Os),{matches:o}=M.useContext(ni),{pathname:d}=_s(),_=JSON.stringify(Yf(o)),w=M.useRef(!1);return t0(()=>{w.current=!0}),M.useCallback((h,y={})=>{if(qs(w.current,e0),!w.current)return;if(typeof h=="number"){l.go(h);return}let p=Oc(h,JSON.parse(_),d,y.relative==="path");s==null&&n!=="/"&&(p.pathname=p.pathname==="/"?n:ti([n,p.pathname])),Xf(typeof h=="string"?h:Wn(h),l.createHref(p),Zf(l),"reject"),(y.replace?l.replace:l.push)(p,y.state,y)},[n,l,_,d,s])}var Ww=M.createContext(null);function Qw(s){let n=M.useContext(ni).outlet;return M.useMemo(()=>n&&M.createElement(Ww.Provider,{value:s},n),[n,s])}function El(s,{relative:n}={}){let{matches:l}=M.useContext(ni),{pathname:o}=_s(),d=JSON.stringify(Yf(l));return M.useMemo(()=>Oc(s,JSON.parse(d),o,n==="path"),[s,d,o,n])}function Jw(s,n){return s0(s,n)}function s0(s,n,l){bt(ca(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=M.useContext(Os),{matches:d}=M.useContext(ni),_=d[d.length-1],w=_?_.params:{},c=_?_.pathname:"/",h=_?_.pathnameBase:"/",y=_&&_.route;{let g=y&&y.path||"";n0(c,!y||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
10
|
|
|
11
|
-
Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let p=_s(),f;if(n){let g=typeof n=="string"?sr(n):n;bt(h==="/"||g.pathname?.startsWith(h),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${g.pathname}" was given in the \`location\` prop.`),f=g}else f=p;let x=f.pathname||"/",C=x;if(h!=="/"){let g=h.replace(/^\//,"").split("/");C="/"+x.replace(/^\//,"").split("/").slice(g.length).join("/")}let j=l&&l.state.matches.length?l.state.matches.map(g=>Object.assign(g,{route:l.manifest[g.route.id]||g.route})):Pb(s,{pathname:C});qs(y||j!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),qs(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=nC(j&&j.map(g=>Object.assign({},g,{params:Object.assign({},w,g.params),pathname:ti([h,o.encodeLocation?o.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?h:ti([h,o.encodeLocation?o.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),d,l);return n&&E?M.createElement(wl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},E):E}function eC(){let s=cC(),n=Bw(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.stack:null,o="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:o},_={padding:"2px 4px",backgroundColor:o},w=null;return console.error("Error handled by React Router default ErrorBoundary:",s),w=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:_},"ErrorBoundary")," or"," ",M.createElement("code",{style:_},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},n),l?M.createElement("pre",{style:d},l):null,w)}var tC=M.createElement(eC,null),i0=class extends M.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,n){return n.location!==s.location||n.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:n.error,location:n.location,revalidation:s.revalidation||n.revalidation}}componentDidCatch(s,n){this.props.onError?this.props.onError(s,n):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const l=Yw(s.digest);l&&(s=l)}let n=s!==void 0?M.createElement(ni.Provider,{value:this.props.routeContext},M.createElement(Wf.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?M.createElement(sC,{error:s},n):n}};i0.contextType=Wb;var jd=new WeakMap;function sC({children:s,error:n}){let{basename:l,navigator:o}=M.useContext(Os);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let d=Gw(n.digest);if(d){let _=jd.get(n);if(_)throw _;let w=Zb(d.location,l),c=w.absoluteURL||w.to;if(Xf(d.location,c,Zf(o),"allow-explicit"),$w(c))throw new Error("Invalid redirect location");if(Yb&&!jd.get(n))if(w.isExternal||d.reloadDocument)window.location.href=c;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(w.to,{replace:d.replace}));throw jd.set(n,h),h}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return s}function iC({routeContext:s,match:n,children:l}){let o=M.useContext(oa);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),M.createElement(ni.Provider,{value:s},l)}function nC(s,n=[],l){let o=l?.state;if(s==null){if(!o)return null;if(o.errors)s=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)s=o.matches;else return null}let d=s,_=o?.errors;if(_!=null){let p=d.findIndex(f=>f.route.id&&_?.[f.route.id]!==void 0);bt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(_).join(",")}`),d=d.slice(0,Math.min(d.length,p+1))}let w=!1,c=-1;if(l&&o){w=o.renderFallback;for(let p=0;p<d.length;p++){let f=d[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=p),f.route.id){let{loaderData:x,errors:C}=o,j=f.route.loader&&!x.hasOwnProperty(f.route.id)&&(!C||C[f.route.id]===void 0);if(f.route.lazy||j){l.isStatic&&(w=!0),c>=0?d=d.slice(0,c+1):d=[d[0]];break}}}}let h=l?.onError,y=o&&h?(p,f)=>{h(p,{location:o.location,params:o.matches?.[0]?.params??{},pattern:Iw(o.matches),errorInfo:f})}:void 0;return d.reduceRight((p,f,x)=>{let C,j=!1,E=null,g=null;o&&(C=_&&f.route.id?_[f.route.id]:void 0,E=f.route.errorElement||tC,w&&(c<0&&x===0?(n0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,g=null):c===x&&(j=!0,g=f.route.hydrateFallbackElement||null)));let b=n.concat(d.slice(0,x+1)),v=()=>{let S;return C?S=E:j?S=g:f.route.Component?S=M.createElement(f.route.Component,null):f.route.element?S=f.route.element:S=p,M.createElement(iC,{match:f,routeContext:{outlet:p,matches:b,isDataRoute:o!=null},children:S})};return o&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?M.createElement(i0,{location:o.location,revalidation:o.revalidation,component:E,error:C,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0},onError:y}):v()},null)}function Qf(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rC(s){let n=M.useContext(oa);return bt(n,Qf(s)),n}function aC(s){let n=M.useContext(Lc);return bt(n,Qf(s)),n}function lC(s){let n=M.useContext(ni);return bt(n,Qf(s)),n}function Jf(s){let n=lC(s),l=n.matches[n.matches.length-1];return bt(l.route.id,`${s} can only be used on routes that contain a unique "id"`),l.route.id}function oC(){return Jf("useRouteId")}function cC(){let s=M.useContext(Wf),n=aC("useRouteError"),l=Jf("useRouteError");return s!==void 0?s:n.errors?.[l]}function uC(){let{router:s}=rC("useNavigate"),n=Jf("useNavigate"),l=M.useRef(!1);return t0(()=>{l.current=!0}),M.useCallback(async(d,_={})=>{qs(l.current,e0),l.current&&(typeof d=="number"?await s.navigate(d):await s.navigate(d,{fromRouteId:n,..._}))},[s,n])}var oy={};function n0(s,n,l){!n&&!oy[s]&&(oy[s]=!0,qs(!1,l))}M.memo(hC);function hC({routes:s,manifest:n,future:l,state:o,isStatic:d,onError:_}){return s0(s,void 0,{manifest:n,state:o,isStatic:d,onError:_})}function dc({to:s,replace:n,state:l,relative:o}){bt(ca(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:_}=M.useContext(Os);qs(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:w}=M.useContext(ni),{pathname:c}=_s(),h=Cl(),y=Oc(s,Yf(w),c,o==="path");Xf(typeof s=="string"?s:Wn(s),_.createHref(y),Zf(_),"reject");let p=JSON.stringify(y);return M.useEffect(()=>{h(JSON.parse(p),{replace:n,state:l,relative:o})},[h,p,o,n,l]),null}function dC(s){return Qw(s.context)}function Ot(s){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function fC({basename:s="/",children:n=null,location:l,navigationType:o="POP",navigator:d,static:_=!1,useTransitions:w}){bt(!ca(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=s.replace(/^\/*/,"/"),h=M.useMemo(()=>({basename:c,navigator:d,static:_,useTransitions:w,future:{}}),[c,d,_,w]);typeof l=="string"&&(l=sr(l));let{pathname:y="/",search:p="",hash:f="",state:x=null,key:C="default",mask:j}=l,E=M.useMemo(()=>{let g=Ui(y,c);return g==null?null:{location:{pathname:g,search:p,hash:f,state:x,key:C,mask:j},navigationType:o}},[c,y,p,f,x,C,o,j]);return qs(E!=null,`<Router basename="${c}"> is not able to match the URL "${y}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:M.createElement(Os.Provider,{value:h},M.createElement(wl.Provider,{children:n,value:E}))}function mC({children:s,location:n}){return Jw(pf(s),n)}function pf(s,n=[]){let l=[];return M.Children.forEach(s,(o,d)=>{if(!M.isValidElement(o))return;let _=[...n,d];if(o.type===M.Fragment){l.push.apply(l,pf(o.props.children,_));return}bt(o.type===Ot,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let w={id:o.props.id||_.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(w.children=pf(o.props.children,_)),l.push(w)}),l}var fc="get",mc="application/x-www-form-urlencoded";function Mc(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function pC(s){return Mc(s)&&s.tagName.toLowerCase()==="button"}function gC(s){return Mc(s)&&s.tagName.toLowerCase()==="form"}function vC(s){return Mc(s)&&s.tagName.toLowerCase()==="input"}function _C(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function yC(s,n){return s.button===0&&(!n||n==="_self")&&!_C(s)}var ic=null;function bC(){if(ic===null)try{new FormData(document.createElement("form"),0),ic=!1}catch{ic=!0}return ic}var SC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Td(s){return s!=null&&!SC.has(s)?(qs(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mc}"`),null):s}function xC(s,n){let l,o,d,_,w;if(gC(s)){let c=s.getAttribute("action");o=c?Ui(c,n):null,l=s.getAttribute("method")||fc,d=Td(s.getAttribute("enctype"))||mc,_=new FormData(s)}else if(pC(s)||vC(s)&&(s.type==="submit"||s.type==="image")){let c=s.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=s.getAttribute("formaction")||c.getAttribute("action");if(o=h?Ui(h,n):null,l=s.getAttribute("formmethod")||c.getAttribute("method")||fc,d=Td(s.getAttribute("formenctype"))||Td(c.getAttribute("enctype"))||mc,_=new FormData(c,s),!bC()){let{name:y,type:p,value:f}=s;if(p==="image"){let x=y?`${y}.`:"";_.append(`${x}x`,"0"),_.append(`${x}y`,"0")}else y&&_.append(y,f)}}else{if(Mc(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=fc,o=null,d=mc,w=s}return _&&d==="text/plain"&&(w=_,_=void 0),{action:o,method:l.toLowerCase(),encType:d,formData:_,body:w}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function em(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function r0(s,n,l,o){let d=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return l?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${o}`:d.pathname=`${d.pathname}.${o}`:d.pathname==="/"?d.pathname=`_root.${o}`:n&&Ui(d.pathname,n)==="/"?d.pathname=`${ta(n)}/_root.${o}`:d.pathname=`${ta(d.pathname)}.${o}`,d}async function wC(s,n){if(s.id in n)return n[s.id];try{let l=await import(s.module);return n[s.id]=l,l}catch(l){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function CC(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function EC(s,n,l){let o=await Promise.all(s.map(async d=>{let _=n.routes[d.route.id];if(_){let w=await wC(_,l);return w.links?w.links():[]}return[]}));return kC(o.flat(1).filter(CC).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function cy(s,n,l,o,d,_){let w=(h,y)=>l[y]?h.route.id!==l[y].route.id:!0,c=(h,y)=>l[y].pathname!==h.pathname||l[y].route.path?.endsWith("*")&&l[y].params["*"]!==h.params["*"];return _==="assets"?n.filter((h,y)=>w(h,y)||c(h,y)):_==="data"?n.filter((h,y)=>{let p=o.routes[h.route.id];if(!p||!p.hasLoader)return!1;if(w(h,y)||c(h,y))return!0;if(h.route.shouldRevalidate){let f=h.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:l[0]?.params||{},nextUrl:new URL(s,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function NC(s,n,{includeHydrateFallback:l}={}){return jC(s.map(o=>{let d=n.routes[o.route.id];if(!d)return[];let _=[d.module];return d.clientActionModule&&(_=_.concat(d.clientActionModule)),d.clientLoaderModule&&(_=_.concat(d.clientLoaderModule)),l&&d.hydrateFallbackModule&&(_=_.concat(d.hydrateFallbackModule)),d.imports&&(_=_.concat(d.imports)),_}).flat(1))}function jC(s){return[...new Set(s)]}function TC(s){let n={},l=Object.keys(s).sort();for(let o of l)n[o]=s[o];return n}function kC(s,n){let l=new Set;return new Set(n),s.reduce((o,d)=>{let _=JSON.stringify(TC(d));return l.has(_)||(l.add(_),o.push({key:_,link:d})),o},[])}function tm(){let s=M.useContext(oa);return em(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function RC(){let s=M.useContext(Lc);return em(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var sm=M.createContext(void 0);sm.displayName="FrameworkContext";function Bc(){let s=M.useContext(sm);return em(s,"You must render this element inside a <HydratedRouter> element"),s}function DC(s,n){let l=M.useContext(sm),[o,d]=M.useState(!1),[_,w]=M.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:y,onMouseLeave:p,onTouchStart:f}=n,x=M.useRef(null);M.useEffect(()=>{if(s==="render"&&w(!0),s==="viewport"){let E=b=>{b.forEach(v=>{w(v.isIntersecting)})},g=new IntersectionObserver(E,{threshold:.5});return x.current&&g.observe(x.current),()=>{g.disconnect()}}},[s]),M.useEffect(()=>{if(o){let E=setTimeout(()=>{w(!0)},100);return()=>{clearTimeout(E)}}},[o]);let C=()=>{d(!0)},j=()=>{d(!1),w(!1)};return l?s!=="intent"?[_,x,{}]:[_,x,{onFocus:cl(c,C),onBlur:cl(h,j),onMouseEnter:cl(y,C),onMouseLeave:cl(p,j),onTouchStart:cl(f,C)}]:[!1,x,{}]}function cl(s,n){return l=>{s&&s(l),l.defaultPrevented||n(l)}}function AC({page:s,...n}){let l=Pw(),{nonce:o}=Bc(),{router:d}=tm(),_=M.useMemo(()=>Pb(d.routes,s,d.basename),[d.routes,s,d.basename]);return _?(n.nonce==null&&o&&(n={...n,nonce:o}),l?M.createElement(LC,{page:s,matches:_,...n}):M.createElement(MC,{page:s,matches:_,...n})):null}function OC(s){let{manifest:n,routeModules:l}=Bc(),[o,d]=M.useState([]);return M.useEffect(()=>{let _=!1;return EC(s,n,l).then(w=>{_||d(w)}),()=>{_=!0}},[s,n,l]),o}function LC({page:s,matches:n,...l}){let o=_s(),{future:d}=Bc(),{basename:_}=tm(),w=M.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let c=r0(s,_,d.v8_trailingSlashAwareDataRequests,"rsc"),h=!1,y=[];for(let p of n)typeof p.route.shouldRevalidate=="function"?h=!0:y.push(p.route.id);return h&&y.length>0&&c.searchParams.set("_routes",y.join(",")),[c.pathname+c.search]},[_,d.v8_trailingSlashAwareDataRequests,s,o,n]);return M.createElement(M.Fragment,null,w.map(c=>M.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...l})))}function MC({page:s,matches:n,...l}){let o=_s(),{future:d,manifest:_,routeModules:w}=Bc(),{basename:c}=tm(),{loaderData:h,matches:y}=RC(),p=M.useMemo(()=>cy(s,n,y,_,o,"data"),[s,n,y,_,o]),f=M.useMemo(()=>cy(s,n,y,_,o,"assets"),[s,n,y,_,o]),x=M.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let E=new Set,g=!1;if(n.forEach(v=>{let S=_.routes[v.route.id];!S||!S.hasLoader||(!p.some(N=>N.route.id===v.route.id)&&v.route.id in h&&w[v.route.id]?.shouldRevalidate||S.hasClientLoader?g=!0:E.add(v.route.id))}),E.size===0)return[];let b=r0(s,c,d.v8_trailingSlashAwareDataRequests,"data");return g&&E.size>0&&b.searchParams.set("_routes",n.filter(v=>E.has(v.route.id)).map(v=>v.route.id).join(",")),[b.pathname+b.search]},[c,d.v8_trailingSlashAwareDataRequests,h,o,_,p,n,s,w]),C=M.useMemo(()=>NC(f,_),[f,_]),j=OC(f);return M.createElement(M.Fragment,null,x.map(E=>M.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...l})),C.map(E=>M.createElement("link",{key:E,rel:"modulepreload",href:E,...l})),j.map(({key:E,link:g})=>M.createElement("link",{key:E,nonce:l.nonce,...g,crossOrigin:g.crossOrigin??l.crossOrigin})))}function BC(...s){return n=>{s.forEach(l=>{typeof l=="function"?l(n):l!=null&&(l.current=n)})}}var IC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{IC&&(window.__reactRouterVersion="7.18.4")}catch{}function HC({basename:s,children:n,useTransitions:l,window:o}){let d=M.useRef();d.current==null&&(d.current=fw({window:o,v5Compat:!0}));let _=d.current,[w,c]=M.useState({action:_.action,location:_.location}),h=M.useCallback(y=>{l===!1?c(y):M.startTransition(()=>c(y))},[l]);return M.useLayoutEffect(()=>_.listen(h),[_,h]),M.createElement(fC,{basename:s,children:n,location:w.location,navigationType:w.action,navigator:_,useTransitions:l})}var Jt=M.forwardRef(function({onClick:n,discover:l="render",prefetch:o="none",relative:d,reloadDocument:_,replace:w,mask:c,state:h,target:y,to:p,preventScrollReset:f,viewTransition:x,defaultShouldRevalidate:C,...j},E){let{basename:g,navigator:b,useTransitions:v}=M.useContext(Os),S=typeof p=="string"&&Gf.test(p),N=Zb(p,g);p=N.to;let T=Zw(p,{relative:d}),D=_s(),O=null;if(c){let he=Oc(c,[],D.mask?D.mask.pathname:"/",!0);g!=="/"&&(he.pathname=he.pathname==="/"?g:ti([g,he.pathname])),O=b.createHref(he)}let[k,L,V]=DC(o,j),q=$C(p,{replace:w,mask:c,state:h,target:y,preventScrollReset:f,relative:d,viewTransition:x,defaultShouldRevalidate:C,useTransitions:v});function Y(he){n&&n(he),he.defaultPrevented||q(he)}let P=!(N.isExternal||_),Q=M.createElement("a",{...j,...V,href:(P?O:void 0)||N.absoluteURL||T,onClick:P?Y:n,ref:BC(E,L),target:y,"data-discover":!S&&l==="render"?"true":void 0});return k&&!S?M.createElement(M.Fragment,null,Q,M.createElement(AC,{page:T})):Q});Jt.displayName="Link";var im=M.forwardRef(function({"aria-current":n="page",caseSensitive:l=!1,className:o="",end:d=!1,style:_,to:w,viewTransition:c,children:h,...y},p){let f=El(w,{relative:y.relative}),x=_s(),C=M.useContext(Lc),{navigator:j,basename:E}=M.useContext(Os),g=C!=null&&KC(f)&&c===!0,b=j.encodeLocation?j.encodeLocation(f).pathname:f.pathname,v=x.pathname,S=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;l||(v=v.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&E&&(S=Ui(S,E)||S);const N=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let T=v===b||!d&&v.startsWith(b)&&v.charAt(N)==="/",D=S!=null&&(S===b||!d&&S.startsWith(b)&&S.charAt(b.length)==="/"),O={isActive:T,isPending:D,isTransitioning:g},k=T?n:void 0,L;typeof o=="function"?L=o(O):L=[o,T?"active":null,D?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let V=typeof _=="function"?_(O):_;return M.createElement(Jt,{...y,"aria-current":k,className:L,ref:p,style:V,to:w,viewTransition:c},typeof h=="function"?h(O):h)});im.displayName="NavLink";var UC=M.forwardRef(({discover:s="render",fetcherKey:n,navigate:l,reloadDocument:o,replace:d,state:_,method:w=fc,action:c,onSubmit:h,relative:y,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:x,...C},j)=>{let{useTransitions:E}=M.useContext(Os),g=VC(),b=qC(c,{relative:y}),v=w.toLowerCase()==="get"?"get":"post",S=typeof c=="string"&&Gf.test(c),N=T=>{if(h&&h(T),T.defaultPrevented)return;T.preventDefault();let D=T.nativeEvent.submitter,O=D?.getAttribute("formmethod")||w,k=()=>g(D||T.currentTarget,{fetcherKey:n,method:O,navigate:l,replace:d,state:_,relative:y,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:x});E&&l!==!1?M.startTransition(()=>k()):k()};return M.createElement("form",{ref:j,method:v,action:b,onSubmit:o?h:N,...C,"data-discover":!S&&s==="render"?"true":void 0})});UC.displayName="Form";function zC(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a0(s){let n=M.useContext(oa);return bt(n,zC(s)),n}function $C(s,{target:n,replace:l,mask:o,state:d,preventScrollReset:_,relative:w,viewTransition:c,defaultShouldRevalidate:h,useTransitions:y}={}){let p=Cl(),f=_s(),x=El(s,{relative:w});return M.useCallback(C=>{if(yC(C,n)){C.preventDefault();let j=l!==void 0?l:Wn(f)===Wn(x),E=()=>p(s,{replace:j,mask:o,state:d,preventScrollReset:_,relative:w,viewTransition:c,defaultShouldRevalidate:h});y?M.startTransition(()=>E()):E()}},[f,p,x,l,o,d,n,s,_,w,c,h,y])}var PC=0,FC=()=>`__${String(++PC)}__`;function VC(){let{router:s}=a0("useSubmit"),{basename:n}=M.useContext(Os),l=oC(),o=s.fetch,d=s.navigate;return M.useCallback(async(_,w={})=>{let{action:c,method:h,encType:y,formData:p,body:f}=xC(_,n);if(w.navigate===!1){let x=w.fetcherKey||FC();await o(x,l,w.action||c,{defaultShouldRevalidate:w.defaultShouldRevalidate,preventScrollReset:w.preventScrollReset,formData:p,body:f,formMethod:w.method||h,formEncType:w.encType||y,flushSync:w.flushSync})}else await d(w.action||c,{defaultShouldRevalidate:w.defaultShouldRevalidate,preventScrollReset:w.preventScrollReset,formData:p,body:f,formMethod:w.method||h,formEncType:w.encType||y,replace:w.replace,state:w.state,fromRouteId:l,flushSync:w.flushSync,viewTransition:w.viewTransition})},[o,d,n,l])}function qC(s,{relative:n}={}){let{basename:l}=M.useContext(Os),o=M.useContext(ni);bt(o,"useFormAction must be used inside a RouteContext");let[d]=o.matches.slice(-1),_={...El(s||".",{relative:n})},w=_s();if(s==null){_.search=w.search;let c=new URLSearchParams(_.search),h=c.getAll("index");if(h.some(p=>p==="")){c.delete("index"),h.filter(f=>f).forEach(f=>c.append("index",f));let p=c.toString();_.search=p?`?${p}`:""}}return(!s||s===".")&&d.route.index&&(_.search=_.search?_.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(_.pathname=_.pathname==="/"?l:ti([l,_.pathname])),Wn(_)}function KC(s,{relative:n}={}){let l=M.useContext(Qb);bt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=a0("useViewTransitionState"),d=El(s,{relative:n});if(!l.isTransitioning)return!1;let _=Ui(l.currentLocation.pathname,o)||l.currentLocation.pathname,w=Ui(l.nextLocation.pathname,o)||l.nextLocation.pathname;return gc(d.pathname,w)!=null||gc(d.pathname,_)!=null}var GC=zb();const l0=M.createContext(void 0),En=s=>{const n=M.useContext(l0);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},YC=({client:s,children:n})=>(M.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),r.jsx(l0.Provider,{value:s,children:n})),ZC={setTimeout:(s,n)=>setTimeout(s,n),clearTimeout:s=>clearTimeout(s),setInterval:(s,n)=>setInterval(s,n),clearInterval:s=>clearInterval(s)};var XC=class{#e=ZC;#t=!1;setTimeoutProvider(s){this.#e=s}setTimeout(s,n){return this.#e.setTimeout(s,n)}clearTimeout(s){this.#e.clearTimeout(s)}setInterval(s,n){return this.#e.setInterval(s,n)}clearInterval(s){this.#e.clearInterval(s)}};const Xn=new XC;function WC(s){setTimeout(s,0)}const QC=typeof window>"u"||"Deno"in globalThis;function gs(){}function JC(s,n){return typeof s=="function"?s(n):s}function o0(s){return typeof s=="number"&&s>=0&&s!==1/0}function c0(s,n){return Math.max(s+(n||0)-Date.now(),0)}function _t(s,n){return typeof s=="function"?s(n):s}function uy(s,n){const{type:l="all",exact:o,fetchStatus:d,predicate:_,queryKey:w,stale:c}=s;if(w){if(o){if(n.queryHash!==nm(w,n.options))return!1}else if(!sa(n.queryKey,w))return!1}if(l!=="all"){const h=n.isActive();if(l==="active"&&!h||l==="inactive"&&h)return!1}return!(typeof c=="boolean"&&n.isStale()!==c||d&&d!==n.state.fetchStatus||_&&!_(n))}function hy(s,n){const{exact:l,status:o,predicate:d,mutationKey:_}=s;if(_){if(!n.options.mutationKey)return!1;if(l){if(pl(n.options.mutationKey)!==pl(_))return!1}else if(!sa(n.options.mutationKey,_))return!1}return!(o&&n.state.status!==o||d&&!d(n))}function nm(s,n){return(n?.queryKeyHashFn||pl)(s)}function pl(s){return JSON.stringify(s,(n,l)=>gf(l)?Object.keys(l).sort().reduce((o,d)=>(o[d]=l[d],o),{}):l)}function sa(s,n){if(s===n)return!0;if(typeof s!=typeof n)return!1;if(s&&n&&typeof s=="object"&&typeof n=="object"){if(Array.isArray(s)&&Array.isArray(n)){if(n.length>s.length)return!1;for(let o=0;o<n.length;o++)if(!sa(s[o],n[o]))return!1;return!0}const l=Object.keys(n);for(const o of l)if(!sa(s[o],n[o]))return!1;return!0}return!1}const eE=Object.prototype.hasOwnProperty;function u0(s,n,l=0){if(s===n)return s;if(l>500)return n;const o=dy(s)&&dy(n);if(!o&&!(gf(s)&&gf(n)))return n;const d=(o?s:Object.keys(s)).length,_=o?n:Object.keys(n),w=_.length,c=o?new Array(w):{};let h=0;for(let y=0;y<w;y++){const p=o?y:_[y],f=s[p],x=n[p];if(f===x){c[p]=f,(o?y<d:eE.call(s,p))&&h++;continue}if(f===null||x===null||typeof f!="object"||typeof x!="object"){c[p]=x;continue}const C=u0(f,x,l+1);c[p]=C,C===f&&h++}return d===w&&h===d?s:c}function kd(s,n){if(!n||Object.keys(s).length!==Object.keys(n).length)return!1;for(const l in s)if(s[l]!==n[l])return!1;return!0}function dy(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function gf(s){if(!fy(s))return!1;const n=Object.getPrototypeOf(s),l=n?.constructor;if(l===void 0)return!0;if(typeof l!="function")return!1;const o=l.prototype;return!(!fy(o)||!o.hasOwnProperty("isPrototypeOf")||n!==Object.prototype)}function fy(s){return Object.prototype.toString.call(s)==="[object Object]"}function tE(s){return new Promise(n=>{Xn.setTimeout(n,s)})}function vf(s,n,l){return typeof l.structuralSharing=="function"?l.structuralSharing(s,n):l.structuralSharing!==!1?u0(s,n):n}function sE(s,n,l=0){const o=[...s,n];return l&&o.length>l?o.slice(1):o}function iE(s,n,l=0){const o=[n,...s];return l&&o.length>l?o.slice(0,-1):o}const rm=Symbol();function h0(s,n){return!s.queryFn&&n?.initialPromise?()=>n.initialPromise:!s.queryFn||s.queryFn===rm?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function d0(s,n){return typeof s=="function"?s(...n):!!s}function nE(s,n,l){let o=!1,d;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(d??=n(),o||(o=!0,d.aborted?l():d.addEventListener("abort",l,{once:!0})),d)}),s}let rE=()=>QC;const am=()=>rE();var Nl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},aE=class extends Nl{#e;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const n=()=>s();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(s){this.#e!==s&&(this.#e=s,this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(n=>{n(s)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const lm=new aE,lE=WC;function oE(){let s=[],n=0,l=c=>{c()},o=c=>{c()},d=lE;const _=c=>{n?s.push(c):d(()=>{l(c)})},w=()=>{const c=s;s=[],c.length&&d(()=>{o(()=>{c.forEach(h=>{l(h)})})})};return{batch:c=>{let h;n++;try{h=c()}finally{n--,n||w()}return h},batchCalls:c=>(...h)=>{_(()=>{c(...h)})},schedule:_,setNotifyFunction:c=>{l=c},setBatchNotifyFunction:c=>{o=c},setScheduler:c=>{d=c}}}const Qt=oE();var cE=class extends Nl{#e=!0;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const n=()=>s(!0),l=()=>s(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",l,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",l)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(this.setOnline.bind(this))}setOnline(s){this.#e!==s&&(this.#e=s,this.listeners.forEach(n=>{n(s)}))}isOnline(){return this.#e}};const vc=new cE;function uE(s){return Math.min(1e3*2**s,3e4)}function f0(s){return(s??"online")==="online"?vc.isOnline():!0}var _f=class extends Error{constructor(s){super("CancelledError"),this.revert=s?.revert,this.silent=s?.silent}};function m0(s){let n=!1,l=0,o,d="pending",_,w;const c=new Promise((v,S)=>{_=v,w=S});c.catch(gs);const h=()=>d!=="pending",y=v=>{if(!h()){const S=new _f(v);E(S),s.onCancel?.(S)}},p=()=>{n=!0},f=()=>{n=!1},x=()=>lm.isFocused()&&(s.networkMode==="always"||vc.isOnline())&&s.canRun(),C=()=>f0(s.networkMode)&&s.canRun(),j=v=>{h()||(o?.(),d="resolved",_(v))},E=v=>{h()||(o?.(),d="rejected",w(v))},g=()=>new Promise(v=>{o=S=>{(h()||x())&&v(S)},s.onPause?.()}).then(()=>{o=void 0,h()||s.onContinue?.()}),b=()=>{if(h())return;let v;const S=l===0?s.initialPromise:void 0;try{v=S??s.fn()}catch(N){v=Promise.reject(N)}Promise.resolve(v).then(j).catch(N=>{if(h())return;const T=s.retry??(am()?0:3),D=s.retryDelay??uE,O=typeof D=="function"?D(l,N):D,k=T===!0||typeof T=="number"&&l<T||typeof T=="function"&&T(l,N);if(n||!k){E(N);return}l++,s.onFail?.(l,N),tE(O).then(()=>x()?void 0:g()).then(()=>{n?E(N):b()})})};return{promise:c,status:()=>d,cancel:y,continue:()=>(o?.(),c),cancelRetry:p,continueRetry:f,canStart:C,start:()=>(C()?b():g().then(b),c)}}var p0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o0(this.gcTime)&&(this.#e=Xn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(am()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Xn.clearTimeout(this.#e),this.#e=void 0)}};function hE(s){return{onFetch:(n,l)=>{const o=n.options,d=n.fetchOptions?.meta?.fetchMore?.direction,_=n.state.data?.pages||[],w=n.state.data?.pageParams||[];let c={pages:[],pageParams:[]},h=0;const y=async()=>{let p=!1;const f=j=>{nE(j,()=>n.signal,()=>p=!0)},x=h0(n.options,n.fetchOptions),C=async(j,E,g)=>{if(p)return Promise.reject(n.signal.reason);if(E==null&&j.pages.length)return Promise.resolve(j);const v=(()=>{const D={client:n.client,queryKey:n.queryKey,pageParam:E,direction:g?"backward":"forward",meta:n.options.meta};return f(D),D})(),S=await x(v),{maxPages:N}=n.options,T=g?iE:sE;return{pages:T(j.pages,S,N),pageParams:T(j.pageParams,E,N)}};if(d&&_.length){const j=d==="backward",E=j?dE:my,g={pages:_,pageParams:w};c=await C(g,E(o,g),j)}else{const j=s??_.length;do{const E=h===0?w[0]??o.initialPageParam:my(o,c);if(h>0&&E==null)break;c=await C(c,E),h++}while(h<j)}return c};n.options.persister?n.fetchFn=()=>n.options.persister?.(y,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},l):n.fetchFn=y}}}function my(s,{pages:n,pageParams:l}){const o=n.length-1;return n.length>0?s.getNextPageParam(n[o],n,l[o],l):void 0}function dE(s,{pages:n,pageParams:l}){return n.length>0?s.getPreviousPageParam?.(n[0],n,l[0],l):void 0}var fE=class extends p0{#e;#t;#s;#i;#r;#n;#a;#o;constructor(s){super(),this.#o=!1,this.#a=s.defaultOptions,this.setOptions(s.options),this.observers=[],this.#r=s.client,this.#i=this.#r.getQueryCache(),this.queryKey=s.queryKey,this.queryHash=s.queryHash,this.#t=gy(this.options),this.state=s.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#n?.promise}setOptions(s){if(this.options={...this.#a,...s},s?._type&&(this.#e=s._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=gy(this.options);n.data!==void 0&&(this.setState(py(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(s,n){const l=vf(this.state.data,s,this.options);return this.#l({data:l,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),l}setState(s){this.#l({type:"setState",state:s})}cancel(s){const n=this.#n?.promise;return this.#n?.cancel(s),n?n.then(gs).catch(gs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(s=>_t(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>_t(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!c0(this.state.dataUpdatedAt,s)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){const n=this.observers.indexOf(s);n!==-1&&(this.observers.splice(n,1),this.observers.length||(this.#n&&(this.#o||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(s,n){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(s&&this.setOptions(s),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const l=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,l.signal)})},d=()=>{const h=h0(this.options,n),p=(()=>{const f={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(f),f})();return this.#o=!1,this.options.persister?this.options.persister(h,p,this):h(p)},w=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:d};return o(h),h})();(this.#e==="infinite"?hE(this.options.pages):this.options.behavior)?.onFetch(w,this),this.#s=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==w.fetchOptions?.meta)&&this.#l({type:"fetch",meta:w.fetchOptions?.meta});const c=this.#n=m0({initialPromise:n?.initialPromise,fn:w.fetchFn,onCancel:h=>{h instanceof _f&&h.revert&&this.setState({...this.#s,fetchStatus:"idle"}),l.abort()},onFail:(h,y)=>{this.#l({type:"failed",failureCount:h,error:y})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:w.options.retry,retryDelay:w.options.retryDelay,networkMode:w.options.networkMode,canRun:()=>!0});try{const h=await c.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#i.config.onSuccess?.(h,this),this.#i.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof _f){if(h.silent)return this.#n.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#i.config.onError?.(h,this),this.#i.config.onSettled?.(this.state.data,h,this),h}finally{this.#n===c&&(this.#n=void 0),this.scheduleGc()}}#l(s){const n=l=>{switch(s.type){case"failed":return{...l,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,...g0(l.data,this.options),fetchMeta:s.meta??null};case"success":const o={...l,...py(s.data,s.dataUpdatedAt),dataUpdateCount:l.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=s.manual?o:void 0,o;case"error":const d=s.error;return{...l,error:d,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...s.state}}};this.state=n(this.state),Qt.batch(()=>{this.observers.slice().forEach(l=>{l.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:s})})}};function g0(s,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f0(n.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function py(s,n){return{data:s,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function gy(s){const n=typeof s.initialData=="function"?s.initialData():s.initialData,l=n!==void 0,o=l?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:l?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:l?"success":"pending",fetchStatus:"idle"}}var mE=class extends Nl{#e;#t=void 0;#s=void 0;#i=void 0;#r;#n;#a;#o;#l;#f;#u;#h;#c;#m=new Set;constructor(s,n){super(),this.options=n,this.#e=s,this.#a=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),vy(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yf(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yf(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(s){const n=this.options,l=this.#t;if(this.options=this.#e.defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _t(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),n._defaulted&&!kd(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&_y(this.#t,l,this.options,n)&&this.#d(),this.updateResult(),o&&(this.#t!==l||_t(this.options.enabled,this.#t)!==_t(n.enabled,this.#t)||_t(this.options.staleTime,this.#t)!==_t(n.staleTime,this.#t))&&this.#g();const d=this.#v();o&&(this.#t!==l||_t(this.options.enabled,this.#t)!==_t(n.enabled,this.#t)||d!==this.#c)&&this.#_(d)}getOptimisticResult(s){const n=this.#e.getQueryCache().build(this.#e,s),l=this.createResult(n,s);return kd(this.getCurrentResult(),l)||(this.#i=l,this.#n=this.options,this.#r=this.#t.state),l}getCurrentResult(){return this.#i}trackResult(s,n){return new Proxy(s,{get:(l,o)=>(this.trackProp(o),n?.(o),Reflect.get(l,o))})}trackProp(s){this.#m.add(s)}getCurrentQuery(){return this.#t}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const n=this.#e.defaultQueryOptions(s),l=this.#e.getQueryCache().build(this.#e,n);let o=()=>{},d;const _=new Promise(w=>{d=w,o=this.#e.getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===l.queryHash&&l.state.data!==void 0&&(o(),w(this.createResult(l,n)))})});return Promise.race([l.fetch().then(()=>{const w=this.createResult(l,n);return d?.(w),w}).finally(()=>{o()}),_])}fetch(s){return this.#d({...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(s){this.#x();let n=this.#t.fetch(this.options,s);return s?.throwOnError||(n=n.catch(gs)),n}#p(s){return!am()&&_t(this.options.enabled,this.#t)!==!1&&o0(s)}#g(){this.#b();const s=_t(this.options.staleTime,this.#t);if(this.#i.isStale||!this.#p(s))return;const n=c0(this.#i.dataUpdatedAt,s)+1;this.#u=Xn.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return _t(this.options.refetchInterval,this.#t)??!1}#_(s){this.#S(),this.#c=s,!(this.#c===0||!this.#p(this.#c))&&(this.#h=Xn.setInterval(()=>{(this.options.refetchIntervalInBackground||lm.isFocused())&&this.#d()},this.#c))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#u!==void 0&&(Xn.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#h!==void 0&&(Xn.clearInterval(this.#h),this.#h=void 0)}createResult(s,n){const l=this.#t,o=this.options,d=this.#i,_=this.#r,w=this.#n,c=s!==l?s.state:this.#s,{state:h}=s;let y={...h},p=!1,f;if(n._optimisticResults){const T=this.hasListeners(),D=!T&&vy(s,n),O=T&&_y(s,l,n,o);(D||O)&&(y={...y,...g0(h.data,s.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:C,status:j}=y;f=y.data;let E=!1;if(n.placeholderData!==void 0&&f===void 0&&j==="pending"){let T;d?.isPlaceholderData&&n.placeholderData===w?.placeholderData?(T=d.data,E=!0):T=typeof n.placeholderData=="function"?n.placeholderData(this.#f?.state.data,this.#f):n.placeholderData,T!==void 0&&(j="success",f=vf(d?.data,T,n),p=!0)}if(n.select&&f!==void 0&&!E)if(d&&f===_?.data&&n.select===this.#o)f=this.#l;else try{this.#o=n.select,f=n.select(f),f=vf(d?.data,f,n),this.#l=f,this.#a=null}catch(T){this.#a=T}else f===void 0&&(this.#a=null);this.#a&&(x=this.#a,f=this.#l,C=Date.now(),j="error",p=!1);const g=y.fetchStatus==="fetching",b=j==="pending",v=j==="error",S=b&&g,N=f!==void 0;return{status:j,fetchStatus:y.fetchStatus,isPending:b,isSuccess:j==="success",isError:v,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:C,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:y.dataUpdateCount>c.dataUpdateCount||y.errorUpdateCount>c.errorUpdateCount,isFetching:g,isRefetching:g&&!b,isLoadingError:v&&!N,isPaused:y.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:v&&N,isStale:om(s,n),refetch:this.refetch,isEnabled:_t(n.enabled,s)!==!1}}updateResult(){const s=this.#i,n=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#n=this.options,this.#r.data!==void 0&&(this.#f=this.#t),kd(n,s))return;this.#i=n;const o=(()=>{if(!s)return!0;const{notifyOnChangeProps:d}=this.options,_=typeof d=="function"?d():d;if(_==="all"||!_&&!this.#m.size)return!0;const w=new Set(_??this.#m);return this.options.throwOnError&&w.add("error"),Object.keys(this.#i).some(c=>{const h=c;return this.#i[h]!==s[h]&&w.has(h)})})();Qt.batch(()=>{o&&this.listeners.forEach(d=>{d(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#x(){const s=this.#e.getQueryCache().build(this.#e,this.options);if(s===this.#t)return;const n=this.#t;this.#t=s,this.#s=s.state,this.hasListeners()&&(n?.removeObserver(this),s.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function pE(s,n){return _t(n.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&_t(n.retryOnMount,s)===!1)}function vy(s,n){return pE(s,n)||s.state.data!==void 0&&yf(s,n,n.refetchOnMount)}function yf(s,n,l){if(_t(n.enabled,s)!==!1&&_t(n.staleTime,s)!=="static"){const o=_t(l,s);return o==="always"||o!==!1&&om(s,n)}return!1}function _y(s,n,l,o){return(s!==n||_t(o.enabled,s)===!1)&&(!l.suspense||s.state.status!=="error")&&om(s,l)}function om(s,n){return _t(n.enabled,s)!==!1&&s.isStaleByTime(_t(n.staleTime,s))}var gE=class extends p0{#e;#t;#s;#i;constructor(s){super(),this.#e=s.client,this.mutationId=s.mutationId,this.#s=s.mutationCache,this.#t=[],this.state=s.state||vE(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){this.#t.includes(s)||(this.#t.push(s),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){this.#t=this.#t.filter(n=>n!==s),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(s){const n=()=>{this.#r({type:"continue"})},l={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},o=this.#i=m0({fn:()=>this.options.mutationFn?this.options.mutationFn(s,l):Promise.reject(new Error("No mutationFn found")),onFail:(w,c)=>{this.#r({type:"failed",failureCount:w,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)}),d=this.state.status==="pending",_=!o.canStart();try{if(d)n();else{this.#r({type:"pending",variables:s,isPaused:_}),this.#s.config.onMutate&&await this.#s.config.onMutate(s,this,l);const c=await this.options.onMutate?.(s,l);c!==this.state.context&&this.#r({type:"pending",context:c,variables:s,isPaused:_})}const w=await o.start();return await this.#s.config.onSuccess?.(w,s,this.state.context,this,l),await this.options.onSuccess?.(w,s,this.state.context,l),await this.#s.config.onSettled?.(w,null,this.state.variables,this.state.context,this,l),await this.options.onSettled?.(w,null,s,this.state.context,l),this.#r({type:"success",data:w}),w}catch(w){try{await this.#s.config.onError?.(w,s,this.state.context,this,l)}catch(c){Promise.reject(c)}try{await this.options.onError?.(w,s,this.state.context,l)}catch(c){Promise.reject(c)}try{await this.#s.config.onSettled?.(void 0,w,this.state.variables,this.state.context,this,l)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,w,s,this.state.context,l)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:w}),w}finally{this.#i===o&&(this.#i=void 0),this.#s.runNext(this)}}#r(s){const n=l=>{switch(s.type){case"failed":return{...l,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"pending":return{...l,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...l,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:s.error,failureCount:l.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qt.batch(()=>{this.#t.forEach(l=>{l.onMutationUpdate(s)}),this.#s.notify({mutation:this,type:"updated",action:s})})}};function vE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _E=class extends Nl{#e;#t;#s;constructor(s={}){super(),this.config=s,this.#e=new Set,this.#t=new Map,this.#s=0}build(s,n,l){const o=new gE({client:s,mutationCache:this,mutationId:++this.#s,options:s.defaultMutationOptions(n),state:l});return this.add(o),o}add(s){this.#e.add(s);const n=nc(s);if(typeof n=="string"){const l=this.#t.get(n);l?l.push(s):this.#t.set(n,[s])}this.notify({type:"added",mutation:s})}remove(s){if(this.#e.delete(s)){const n=nc(s);if(typeof n=="string"){const l=this.#t.get(n);if(l)if(l.length>1){const o=l.indexOf(s);o!==-1&&l.splice(o,1)}else l[0]===s&&this.#t.delete(n)}}this.notify({type:"removed",mutation:s})}canRun(s){const n=nc(s);if(typeof n=="string"){const l=this.#t.get(n)?.find(o=>o.state.status==="pending");return!l||l===s}else return!0}runNext(s){const n=nc(s);return typeof n=="string"?this.#t.get(n)?.find(l=>l!==s&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Qt.batch(()=>{this.#e.forEach(s=>{this.notify({type:"removed",mutation:s})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(s){const n={exact:!0,...s};return this.getAll().find(l=>hy(n,l))}findAll(s={}){return this.getAll().filter(n=>hy(s,n))}notify(s){Qt.batch(()=>{this.listeners.forEach(n=>{n(s)})})}resumePausedMutations(){const s=this.getAll().filter(n=>n.state.isPaused);return Qt.batch(()=>Promise.all(s.map(n=>n.continue().catch(gs))))}};function nc(s){return s.options.scope?.id}var yE=class extends Nl{#e;constructor(s={}){super(),this.config=s,this.#e=new Map}build(s,n,l){const o=n.queryKey,d=n.queryHash??nm(o,n);let _=this.get(d);return _||(_=new fE({client:s,queryKey:o,queryHash:d,options:s.defaultQueryOptions(n),state:l,defaultOptions:s.getQueryDefaults(o)}),this.add(_)),_}add(s){this.#e.has(s.queryHash)||(this.#e.set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){this.#e.get(s.queryHash)===s&&(s.destroy(),this.#e.delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){Qt.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return this.#e.get(s)}getAll(){return[...this.#e.values()]}find(s){const n={exact:!0,...s};return this.getAll().find(l=>uy(n,l))}findAll(s={}){const n=this.getAll();return Object.keys(s).length>0?n.filter(l=>uy(s,l)):n}notify(s){Qt.batch(()=>{this.listeners.forEach(n=>{n(s)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},bE=class{#e;#t;#s;#i;#r;#n;#a;#o;constructor(s={}){this.#e=s.queryCache||new yE,this.#t=s.mutationCache||new _E,this.#s=s.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#a=lm.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=vc.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(s){return this.#e.findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return this.#t.findAll({...s,status:"pending"}).length}getQueryData(s){const n=this.defaultQueryOptions({queryKey:s});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(s){const n=this.defaultQueryOptions(s),l=this.#e.build(this,n),o=l.state.data;return o===void 0?this.fetchQuery(s):(s.revalidateIfStale&&l.isStaleByTime(_t(n.staleTime,l))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(s){return this.#e.findAll(s).map(({queryKey:n,state:l})=>[n,l.data])}setQueryData(s,n,l){const o=this.defaultQueryOptions({queryKey:s}),d=this.#e.get(o.queryHash)?.state.data,_=JC(n,d);if(_!==void 0)return this.#e.build(this,o).setData(_,{...l,manual:!0})}setQueriesData(s,n,l){return Qt.batch(()=>this.#e.findAll(s).map(({queryKey:o})=>[o,this.setQueryData(o,n,l)]))}getQueryState(s){const n=this.defaultQueryOptions({queryKey:s});return this.#e.get(n.queryHash)?.state}removeQueries(s){const n=this.#e;Qt.batch(()=>{n.findAll(s).forEach(l=>{n.remove(l)})})}resetQueries(s,n){const l=this.#e;return Qt.batch(()=>{const o=l.findAll(s),d=new Set(o);return o.forEach(_=>{_.reset()}),this.refetchQueries({type:"active",predicate:_=>d.has(_)},n)})}cancelQueries(s,n={}){const l={revert:!0,...n},o=Qt.batch(()=>this.#e.findAll(s).map(d=>d.cancel(l)));return Promise.all(o).then(gs).catch(gs)}invalidateQueries(s,n={}){return Qt.batch(()=>(this.#e.findAll(s).forEach(l=>{l.invalidate()}),s?.refetchType==="none"?Promise.resolve():this.refetchQueries({...s,type:s?.refetchType??s?.type??"active"},n)))}refetchQueries(s,n={}){const l={...n,cancelRefetch:n.cancelRefetch??!0},o=Qt.batch(()=>this.#e.findAll(s).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let _=d.fetch(void 0,l);return l.throwOnError||(_=_.catch(gs)),d.state.fetchStatus==="paused"?Promise.resolve():_}));return Promise.all(o).then(gs)}async query(s){const n=this.defaultQueryOptions(s);n.retry===void 0&&(n.retry=!1);const l=this.#e.build(this,n),o=l.isStaleByTime(_t(n.staleTime,l))?await l.fetch(n):l.state.data,d=n.select;return d?d(o):o}fetchQuery(s){const n=this.defaultQueryOptions(s);n.retry===void 0&&(n.retry=!1);const l=this.#e.build(this,n);return l.isStaleByTime(_t(n.staleTime,l))?l.fetch(n):Promise.resolve(l.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(gs).catch(gs)}infiniteQuery(s){return s._type="infinite",this.query(s)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(gs).catch(gs)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return vc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(s){this.#s=s}setQueryDefaults(s,n){this.#i.set(pl(s),{queryKey:s,defaultOptions:n})}getQueryDefaults(s){const n=[...this.#i.values()],l={};return n.forEach(o=>{sa(s,o.queryKey)&&Object.assign(l,o.defaultOptions)}),l}setMutationDefaults(s,n){this.#r.set(pl(s),{mutationKey:s,defaultOptions:n})}getMutationDefaults(s){const n=[...this.#r.values()],l={};return n.forEach(o=>{sa(s,o.mutationKey)&&Object.assign(l,o.defaultOptions)}),l}defaultQueryOptions(s){if(s._defaulted)return s;const n={...this.#s.queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return n.queryHash||(n.queryHash=nm(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===rm&&(n.enabled=!1),n}defaultMutationOptions(s){return s?._defaulted?s:{...this.#s.mutations,...s?.mutationKey&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const v0=M.createContext(!1),SE=()=>M.useContext(v0);v0.Provider;function xE(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}const wE=M.createContext(xE()),CE=()=>M.useContext(wE),EE=(s,n,l)=>{const o=l?.state.error&&typeof s.throwOnError=="function"?d0(s.throwOnError,[l.state.error,l]):s.throwOnError;(s.suspense||o)&&(n.isReset()||(s.retryOnMount=!1))},NE=s=>{M.useEffect(()=>{s.clearReset()},[s])},jE=({result:s,errorResetBoundary:n,throwOnError:l,query:o,suspense:d})=>s.isError&&!n.isReset()&&!s.isFetching&&o&&(d&&s.data===void 0||d0(l,[s.error,o])),TE=s=>{if(s.suspense){const l=d=>d==="static"?d:Math.max(d??1e3,1e3),o=s.staleTime;s.staleTime=typeof o=="function"?(...d)=>l(o(...d)):l(o),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},kE=(s,n)=>s?.suspense&&n.isPending,RE=(s,n,l)=>n.fetchOptimistic(s).catch(()=>{l.clearReset()});function DE(s,n,l){const o=SE(),d=CE(),_=En(),w=_.defaultQueryOptions(s),c=_.getQueryCache().get(w.queryHash),h=s.subscribed!==!1;w._optimisticResults=o?"isRestoring":h?"optimistic":void 0,TE(w),EE(w,d,c),NE(d);const[y]=M.useState(()=>new n(_,w)),p=y.getOptimisticResult(w),f=!o&&h;if(M.useSyncExternalStore(M.useCallback(x=>{const C=f?y.subscribe(Qt.batchCalls(x)):gs;return y.updateResult(),C},[y,f]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),M.useEffect(()=>{y.setOptions(w)},[w,y]),kE(w,p))throw RE(w,y,d);if(jE({result:p,errorResetBoundary:d,throwOnError:w.throwOnError,query:c,suspense:w.suspense}))throw p.error;return w.notifyOnChangeProps?p:y.trackResult(p)}function ss(s,n){return DE(s,mE)}var st;(function(s){s.assertEqual=d=>{};function n(d){}s.assertIs=n;function l(d){throw new Error}s.assertNever=l,s.arrayToEnum=d=>{const _={};for(const w of d)_[w]=w;return _},s.getValidEnumValues=d=>{const _=s.objectKeys(d).filter(c=>typeof d[d[c]]!="number"),w={};for(const c of _)w[c]=d[c];return s.objectValues(w)},s.objectValues=d=>s.objectKeys(d).map(function(_){return d[_]}),s.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{const _=[];for(const w in d)Object.prototype.hasOwnProperty.call(d,w)&&_.push(w);return _},s.find=(d,_)=>{for(const w of d)if(_(w))return w},s.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&Number.isFinite(d)&&Math.floor(d)===d;function o(d,_=" | "){return d.map(w=>typeof w=="string"?`'${w}'`:w).join(_)}s.joinValues=o,s.jsonStringifyReplacer=(d,_)=>typeof _=="bigint"?_.toString():_})(st||(st={}));var yy;(function(s){s.mergeShapes=(n,l)=>({...n,...l})})(yy||(yy={}));const Ee=st.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),yn=s=>{switch(typeof s){case"undefined":return Ee.undefined;case"string":return Ee.string;case"number":return Number.isNaN(s)?Ee.nan:Ee.number;case"boolean":return Ee.boolean;case"function":return Ee.function;case"bigint":return Ee.bigint;case"symbol":return Ee.symbol;case"object":return Array.isArray(s)?Ee.array:s===null?Ee.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?Ee.promise:typeof Map<"u"&&s instanceof Map?Ee.map:typeof Set<"u"&&s instanceof Set?Ee.set:typeof Date<"u"&&s instanceof Date?Ee.date:Ee.object;default:return Ee.unknown}},ye=st.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class zi extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const l=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,l):this.__proto__=l,this.name="ZodError",this.issues=n}format(n){const l=n||function(_){return _.message},o={_errors:[]},d=_=>{for(const w of _.issues)if(w.code==="invalid_union")w.unionErrors.map(d);else if(w.code==="invalid_return_type")d(w.returnTypeError);else if(w.code==="invalid_arguments")d(w.argumentsError);else if(w.path.length===0)o._errors.push(l(w));else{let c=o,h=0;for(;h<w.path.length;){const y=w.path[h];h===w.path.length-1?(c[y]=c[y]||{_errors:[]},c[y]._errors.push(l(w))):c[y]=c[y]||{_errors:[]},c=c[y],h++}}};return d(this),o}static assert(n){if(!(n instanceof zi))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,st.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=l=>l.message){const l={},o=[];for(const d of this.issues)if(d.path.length>0){const _=d.path[0];l[_]=l[_]||[],l[_].push(n(d))}else o.push(n(d));return{formErrors:o,fieldErrors:l}}get formErrors(){return this.flatten()}}zi.create=s=>new zi(s);const bf=(s,n)=>{let l;switch(s.code){case ye.invalid_type:s.received===Ee.undefined?l="Required":l=`Expected ${s.expected}, received ${s.received}`;break;case ye.invalid_literal:l=`Invalid literal value, expected ${JSON.stringify(s.expected,st.jsonStringifyReplacer)}`;break;case ye.unrecognized_keys:l=`Unrecognized key(s) in object: ${st.joinValues(s.keys,", ")}`;break;case ye.invalid_union:l="Invalid input";break;case ye.invalid_union_discriminator:l=`Invalid discriminator value. Expected ${st.joinValues(s.options)}`;break;case ye.invalid_enum_value:l=`Invalid enum value. Expected ${st.joinValues(s.options)}, received '${s.received}'`;break;case ye.invalid_arguments:l="Invalid function arguments";break;case ye.invalid_return_type:l="Invalid function return type";break;case ye.invalid_date:l="Invalid date";break;case ye.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(l=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(l=`${l} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?l=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?l=`Invalid input: must end with "${s.validation.endsWith}"`:st.assertNever(s.validation):s.validation!=="regex"?l=`Invalid ${s.validation}`:l="Invalid";break;case ye.too_small:s.type==="array"?l=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?l=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?l=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?l=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?l=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:l="Invalid input";break;case ye.too_big:s.type==="array"?l=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?l=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?l=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?l=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?l=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:l="Invalid input";break;case ye.custom:l="Invalid input";break;case ye.invalid_intersection_types:l="Intersection results could not be merged";break;case ye.not_multiple_of:l=`Number must be a multiple of ${s.multipleOf}`;break;case ye.not_finite:l="Number must be finite";break;default:l=n.defaultError,st.assertNever(s)}return{message:l}};let AE=bf;function OE(){return AE}const LE=s=>{const{data:n,path:l,errorMaps:o,issueData:d}=s,_=[...l,...d.path||[]],w={...d,path:_};if(d.message!==void 0)return{...d,path:_,message:d.message};let c="";const h=o.filter(y=>!!y).slice().reverse();for(const y of h)c=y(w,{data:n,defaultError:c}).message;return{...d,path:_,message:c}};function xe(s,n){const l=OE(),o=LE({issueData:n,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,l,l===bf?void 0:bf].filter(d=>!!d)});s.common.issues.push(o)}class cs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,l){const o=[];for(const d of l){if(d.status==="aborted")return Oe;d.status==="dirty"&&n.dirty(),o.push(d.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,l){const o=[];for(const d of l){const _=await d.key,w=await d.value;o.push({key:_,value:w})}return cs.mergeObjectSync(n,o)}static mergeObjectSync(n,l){const o={};for(const d of l){const{key:_,value:w}=d;if(_.status==="aborted"||w.status==="aborted")return Oe;_.status==="dirty"&&n.dirty(),w.status==="dirty"&&n.dirty(),_.value!=="__proto__"&&(typeof w.value<"u"||d.alwaysSet)&&(o[_.value]=w.value)}return{status:n.value,value:o}}}const Oe=Object.freeze({status:"aborted"}),fl=s=>({status:"dirty",value:s}),Ks=s=>({status:"valid",value:s}),by=s=>s.status==="aborted",Sy=s=>s.status==="dirty",ia=s=>s.status==="valid",_c=s=>typeof Promise<"u"&&s instanceof Promise;var je;(function(s){s.errToObj=n=>typeof n=="string"?{message:n}:n||{},s.toString=n=>typeof n=="string"?n:n?.message})(je||(je={}));class yi{constructor(n,l,o,d){this._cachedPath=[],this.parent=n,this.data=l,this._path=o,this._key=d}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const xy=(s,n)=>{if(ia(n))return{success:!0,data:n.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const l=new zi(s.common.issues);return this._error=l,this._error}}};function Pe(s){if(!s)return{};const{errorMap:n,invalid_type_error:l,required_error:o,description:d}=s;if(n&&(l||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:d}:{errorMap:(w,c)=>{const{message:h}=s;return w.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:h??o??c.defaultError}:w.code!=="invalid_type"?{message:c.defaultError}:{message:h??l??c.defaultError}},description:d}}class We{get description(){return this._def.description}_getType(n){return yn(n.data)}_getOrReturnCtx(n,l){return l||{common:n.parent.common,data:n.data,parsedType:yn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new cs,ctx:{common:n.parent.common,data:n.data,parsedType:yn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const l=this._parse(n);if(_c(l))throw new Error("Synchronous parse encountered promise.");return l}_parseAsync(n){const l=this._parse(n);return Promise.resolve(l)}parse(n,l){const o=this.safeParse(n,l);if(o.success)return o.data;throw o.error}safeParse(n,l){const o={common:{issues:[],async:l?.async??!1,contextualErrorMap:l?.errorMap},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:yn(n)},d=this._parseSync({data:n,path:o.path,parent:o});return xy(o,d)}"~validate"(n){const l={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:yn(n)};if(!this["~standard"].async)try{const o=this._parseSync({data:n,path:[],parent:l});return ia(o)?{value:o.value}:{issues:l.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),l.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:l}).then(o=>ia(o)?{value:o.value}:{issues:l.common.issues})}async parseAsync(n,l){const o=await this.safeParseAsync(n,l);if(o.success)return o.data;throw o.error}async safeParseAsync(n,l){const o={common:{issues:[],contextualErrorMap:l?.errorMap,async:!0},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:yn(n)},d=this._parse({data:n,path:o.path,parent:o}),_=await(_c(d)?d:Promise.resolve(d));return xy(o,_)}refine(n,l){const o=d=>typeof l=="string"||typeof l>"u"?{message:l}:typeof l=="function"?l(d):l;return this._refinement((d,_)=>{const w=n(d),c=()=>_.addIssue({code:ye.custom,...o(d)});return typeof Promise<"u"&&w instanceof Promise?w.then(h=>h?!0:(c(),!1)):w?!0:(c(),!1)})}refinement(n,l){return this._refinement((o,d)=>n(o)?!0:(d.addIssue(typeof l=="function"?l(o,d):l),!1))}_refinement(n){return new er({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:l=>this["~validate"](l)}}optional(){return Hi.create(this,this._def)}nullable(){return tr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _i.create(this)}promise(){return Cc.create(this,this._def)}or(n){return bc.create([this,n],this._def)}and(n){return Sc.create(this,n,this._def)}transform(n){return new er({...Pe(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const l=typeof n=="function"?n:()=>n;return new Ec({...Pe(this._def),innerType:this,defaultValue:l,typeName:Le.ZodDefault})}brand(){return new S0({typeName:Le.ZodBranded,type:this,...Pe(this._def)})}catch(n){const l=typeof n=="function"?n:()=>n;return new Nc({...Pe(this._def),innerType:this,catchValue:l,typeName:Le.ZodCatch})}describe(n){const l=this.constructor;return new l({...this._def,description:n})}pipe(n){return um.create(this,n)}readonly(){return jc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ME=/^c[^\s-]{8,}$/i,BE=/^[0-9a-z]+$/,IE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,UE=/^[a-z0-9_-]{21}$/i,zE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$E=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Rd;const VE=/^(?:(?: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])$/,qE=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,KE=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,GE=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_0="((\\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])))",XE=new RegExp(`^${_0}$`);function y0(s){let n="[0-5]\\d";s.precision?n=`${n}\\.\\d{${s.precision}}`:s.precision==null&&(n=`${n}(\\.\\d+)?`);const l=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${l}`}function WE(s){return new RegExp(`^${y0(s)}$`)}function QE(s){let n=`${_0}T${y0(s)}`;const l=[];return l.push(s.local?"Z?":"Z"),s.offset&&l.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${l.join("|")})`,new RegExp(`^${n}$`)}function JE(s,n){return!!((n==="v4"||!n)&&VE.test(s)||(n==="v6"||!n)&&KE.test(s))}function e2(s,n){if(!zE.test(s))return!1;try{const[l]=s.split(".");if(!l)return!1;const o=l.replace(/-/g,"+").replace(/_/g,"/").padEnd(l.length+(4-l.length%4)%4,"="),d=JSON.parse(atob(o));return!(typeof d!="object"||d===null||"typ"in d&&d?.typ!=="JWT"||!d.alg||n&&d.alg!==n)}catch{return!1}}function t2(s,n){return!!((n==="v4"||!n)&&qE.test(s)||(n==="v6"||!n)&&GE.test(s))}class Ii extends We{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==Ee.string){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_type,expected:Ee.string,received:_.parsedType}),Oe}const o=new cs;let d;for(const _ of this._def.checks)if(_.kind==="min")n.data.length<_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),o.dirty());else if(_.kind==="max")n.data.length>_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),o.dirty());else if(_.kind==="length"){const w=n.data.length>_.value,c=n.data.length<_.value;(w||c)&&(d=this._getOrReturnCtx(n,d),w?xe(d,{code:ye.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}):c&&xe(d,{code:ye.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}),o.dirty())}else if(_.kind==="email")PE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"email",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="emoji")Rd||(Rd=new RegExp(FE,"u")),Rd.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"emoji",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="uuid")HE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"uuid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="nanoid")UE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"nanoid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="cuid")ME.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"cuid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="cuid2")BE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"cuid2",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="ulid")IE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"ulid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="url")try{new URL(n.data)}catch{d=this._getOrReturnCtx(n,d),xe(d,{validation:"url",code:ye.invalid_string,message:_.message}),o.dirty()}else _.kind==="regex"?(_.regex.lastIndex=0,_.regex.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"regex",code:ye.invalid_string,message:_.message}),o.dirty())):_.kind==="trim"?n.data=n.data.trim():_.kind==="includes"?n.data.includes(_.value,_.position)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),o.dirty()):_.kind==="toLowerCase"?n.data=n.data.toLowerCase():_.kind==="toUpperCase"?n.data=n.data.toUpperCase():_.kind==="startsWith"?n.data.startsWith(_.value)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:{startsWith:_.value},message:_.message}),o.dirty()):_.kind==="endsWith"?n.data.endsWith(_.value)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:{endsWith:_.value},message:_.message}),o.dirty()):_.kind==="datetime"?QE(_).test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:"datetime",message:_.message}),o.dirty()):_.kind==="date"?XE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:"date",message:_.message}),o.dirty()):_.kind==="time"?WE(_).test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:"time",message:_.message}),o.dirty()):_.kind==="duration"?$E.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"duration",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="ip"?JE(n.data,_.version)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"ip",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="jwt"?e2(n.data,_.alg)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"jwt",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="cidr"?t2(n.data,_.version)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"cidr",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="base64"?YE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"base64",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="base64url"?ZE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"base64url",code:ye.invalid_string,message:_.message}),o.dirty()):st.assertNever(_);return{status:o.value,value:n.data}}_regex(n,l,o){return this.refinement(d=>n.test(d),{validation:l,code:ye.invalid_string,...je.errToObj(o)})}_addCheck(n){return new Ii({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...je.errToObj(n)})}url(n){return this._addCheck({kind:"url",...je.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...je.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...je.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...je.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...je.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...je.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...je.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...je.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...je.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...je.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...je.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...je.errToObj(n)})}datetime(n){return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof n?.precision>"u"?null:n?.precision,offset:n?.offset??!1,local:n?.local??!1,...je.errToObj(n?.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof n?.precision>"u"?null:n?.precision,...je.errToObj(n?.message)})}duration(n){return this._addCheck({kind:"duration",...je.errToObj(n)})}regex(n,l){return this._addCheck({kind:"regex",regex:n,...je.errToObj(l)})}includes(n,l){return this._addCheck({kind:"includes",value:n,position:l?.position,...je.errToObj(l?.message)})}startsWith(n,l){return this._addCheck({kind:"startsWith",value:n,...je.errToObj(l)})}endsWith(n,l){return this._addCheck({kind:"endsWith",value:n,...je.errToObj(l)})}min(n,l){return this._addCheck({kind:"min",value:n,...je.errToObj(l)})}max(n,l){return this._addCheck({kind:"max",value:n,...je.errToObj(l)})}length(n,l){return this._addCheck({kind:"length",value:n,...je.errToObj(l)})}nonempty(n){return this.min(1,je.errToObj(n))}trim(){return new Ii({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ii({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ii({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n}get maxLength(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n}}Ii.create=s=>new Ii({checks:[],typeName:Le.ZodString,coerce:s?.coerce??!1,...Pe(s)});function s2(s,n){const l=(s.toString().split(".")[1]||"").length,o=(n.toString().split(".")[1]||"").length,d=l>o?l:o,_=Number.parseInt(s.toFixed(d).replace(".","")),w=Number.parseInt(n.toFixed(d).replace(".",""));return _%w/10**d}class na extends We{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==Ee.number){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_type,expected:Ee.number,received:_.parsedType}),Oe}let o;const d=new cs;for(const _ of this._def.checks)_.kind==="int"?st.isInteger(n.data)||(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.invalid_type,expected:"integer",received:"float",message:_.message}),d.dirty()):_.kind==="min"?(_.inclusive?n.data<_.value:n.data<=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),d.dirty()):_.kind==="max"?(_.inclusive?n.data>_.value:n.data>=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),d.dirty()):_.kind==="multipleOf"?s2(n.data,_.value)!==0&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.not_multiple_of,multipleOf:_.value,message:_.message}),d.dirty()):_.kind==="finite"?Number.isFinite(n.data)||(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.not_finite,message:_.message}),d.dirty()):st.assertNever(_);return{status:d.value,value:n.data}}gte(n,l){return this.setLimit("min",n,!0,je.toString(l))}gt(n,l){return this.setLimit("min",n,!1,je.toString(l))}lte(n,l){return this.setLimit("max",n,!0,je.toString(l))}lt(n,l){return this.setLimit("max",n,!1,je.toString(l))}setLimit(n,l,o,d){return new na({...this._def,checks:[...this._def.checks,{kind:n,value:l,inclusive:o,message:je.toString(d)}]})}_addCheck(n){return new na({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:je.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(n)})}multipleOf(n,l){return this._addCheck({kind:"multipleOf",value:n,message:je.toString(l)})}finite(n){return this._addCheck({kind:"finite",message:je.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.toString(n)})}get minValue(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n}get maxValue(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&st.isInteger(n.value))}get isFinite(){let n=null,l=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(l===null||o.value>l)&&(l=o.value):o.kind==="max"&&(n===null||o.value<n)&&(n=o.value)}return Number.isFinite(l)&&Number.isFinite(n)}}na.create=s=>new na({checks:[],typeName:Le.ZodNumber,coerce:s?.coerce||!1,...Pe(s)});class gl extends We{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==Ee.bigint)return this._getInvalidInput(n);let o;const d=new cs;for(const _ of this._def.checks)_.kind==="min"?(_.inclusive?n.data<_.value:n.data<=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),d.dirty()):_.kind==="max"?(_.inclusive?n.data>_.value:n.data>=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),d.dirty()):_.kind==="multipleOf"?n.data%_.value!==BigInt(0)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.not_multiple_of,multipleOf:_.value,message:_.message}),d.dirty()):st.assertNever(_);return{status:d.value,value:n.data}}_getInvalidInput(n){const l=this._getOrReturnCtx(n);return xe(l,{code:ye.invalid_type,expected:Ee.bigint,received:l.parsedType}),Oe}gte(n,l){return this.setLimit("min",n,!0,je.toString(l))}gt(n,l){return this.setLimit("min",n,!1,je.toString(l))}lte(n,l){return this.setLimit("max",n,!0,je.toString(l))}lt(n,l){return this.setLimit("max",n,!1,je.toString(l))}setLimit(n,l,o,d){return new gl({...this._def,checks:[...this._def.checks,{kind:n,value:l,inclusive:o,message:je.toString(d)}]})}_addCheck(n){return new gl({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(n)})}multipleOf(n,l){return this._addCheck({kind:"multipleOf",value:n,message:je.toString(l)})}get minValue(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n}get maxValue(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n}}gl.create=s=>new gl({checks:[],typeName:Le.ZodBigInt,coerce:s?.coerce??!1,...Pe(s)});class Sf extends We{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==Ee.boolean){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.boolean,received:o.parsedType}),Oe}return Ks(n.data)}}Sf.create=s=>new Sf({typeName:Le.ZodBoolean,coerce:s?.coerce||!1,...Pe(s)});class yc extends We{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==Ee.date){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_type,expected:Ee.date,received:_.parsedType}),Oe}if(Number.isNaN(n.data.getTime())){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_date}),Oe}const o=new cs;let d;for(const _ of this._def.checks)_.kind==="min"?n.data.getTime()<_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),o.dirty()):_.kind==="max"?n.data.getTime()>_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),o.dirty()):st.assertNever(_);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new yc({...this._def,checks:[...this._def.checks,n]})}min(n,l){return this._addCheck({kind:"min",value:n.getTime(),message:je.toString(l)})}max(n,l){return this._addCheck({kind:"max",value:n.getTime(),message:je.toString(l)})}get minDate(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n!=null?new Date(n):null}}yc.create=s=>new yc({checks:[],coerce:s?.coerce||!1,typeName:Le.ZodDate,...Pe(s)});class wy extends We{_parse(n){if(this._getType(n)!==Ee.symbol){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.symbol,received:o.parsedType}),Oe}return Ks(n.data)}}wy.create=s=>new wy({typeName:Le.ZodSymbol,...Pe(s)});class xf extends We{_parse(n){if(this._getType(n)!==Ee.undefined){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.undefined,received:o.parsedType}),Oe}return Ks(n.data)}}xf.create=s=>new xf({typeName:Le.ZodUndefined,...Pe(s)});class wf extends We{_parse(n){if(this._getType(n)!==Ee.null){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.null,received:o.parsedType}),Oe}return Ks(n.data)}}wf.create=s=>new wf({typeName:Le.ZodNull,...Pe(s)});class Cy extends We{constructor(){super(...arguments),this._any=!0}_parse(n){return Ks(n.data)}}Cy.create=s=>new Cy({typeName:Le.ZodAny,...Pe(s)});class Cf extends We{constructor(){super(...arguments),this._unknown=!0}_parse(n){return Ks(n.data)}}Cf.create=s=>new Cf({typeName:Le.ZodUnknown,...Pe(s)});class wn extends We{_parse(n){const l=this._getOrReturnCtx(n);return xe(l,{code:ye.invalid_type,expected:Ee.never,received:l.parsedType}),Oe}}wn.create=s=>new wn({typeName:Le.ZodNever,...Pe(s)});class Ey extends We{_parse(n){if(this._getType(n)!==Ee.undefined){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.void,received:o.parsedType}),Oe}return Ks(n.data)}}Ey.create=s=>new Ey({typeName:Le.ZodVoid,...Pe(s)});class _i extends We{_parse(n){const{ctx:l,status:o}=this._processInputParams(n),d=this._def;if(l.parsedType!==Ee.array)return xe(l,{code:ye.invalid_type,expected:Ee.array,received:l.parsedType}),Oe;if(d.exactLength!==null){const w=l.data.length>d.exactLength.value,c=l.data.length<d.exactLength.value;(w||c)&&(xe(l,{code:w?ye.too_big:ye.too_small,minimum:c?d.exactLength.value:void 0,maximum:w?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),o.dirty())}if(d.minLength!==null&&l.data.length<d.minLength.value&&(xe(l,{code:ye.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),o.dirty()),d.maxLength!==null&&l.data.length>d.maxLength.value&&(xe(l,{code:ye.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),o.dirty()),l.common.async)return Promise.all([...l.data].map((w,c)=>d.type._parseAsync(new yi(l,w,l.path,c)))).then(w=>cs.mergeArray(o,w));const _=[...l.data].map((w,c)=>d.type._parseSync(new yi(l,w,l.path,c)));return cs.mergeArray(o,_)}get element(){return this._def.type}min(n,l){return new _i({...this._def,minLength:{value:n,message:je.toString(l)}})}max(n,l){return new _i({...this._def,maxLength:{value:n,message:je.toString(l)}})}length(n,l){return new _i({...this._def,exactLength:{value:n,message:je.toString(l)}})}nonempty(n){return this.min(1,n)}}_i.create=(s,n)=>new _i({type:s,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...Pe(n)});function Qr(s){if(s instanceof Lt){const n={};for(const l in s.shape){const o=s.shape[l];n[l]=Hi.create(Qr(o))}return new Lt({...s._def,shape:()=>n})}else return s instanceof _i?new _i({...s._def,type:Qr(s.element)}):s instanceof Hi?Hi.create(Qr(s.unwrap())):s instanceof tr?tr.create(Qr(s.unwrap())):s instanceof Qn?Qn.create(s.items.map(n=>Qr(n))):s}class Lt extends We{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),l=st.objectKeys(n);return this._cached={shape:n,keys:l},this._cached}_parse(n){if(this._getType(n)!==Ee.object){const y=this._getOrReturnCtx(n);return xe(y,{code:ye.invalid_type,expected:Ee.object,received:y.parsedType}),Oe}const{status:o,ctx:d}=this._processInputParams(n),{shape:_,keys:w}=this._getCached(),c=[];if(!(this._def.catchall instanceof wn&&this._def.unknownKeys==="strip"))for(const y in d.data)w.includes(y)||c.push(y);const h=[];for(const y of w){const p=_[y],f=d.data[y];h.push({key:{status:"valid",value:y},value:p._parse(new yi(d,f,d.path,y)),alwaysSet:y in d.data})}if(this._def.catchall instanceof wn){const y=this._def.unknownKeys;if(y==="passthrough")for(const p of c)h.push({key:{status:"valid",value:p},value:{status:"valid",value:d.data[p]}});else if(y==="strict")c.length>0&&(xe(d,{code:ye.unrecognized_keys,keys:c}),o.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const p of c){const f=d.data[p];h.push({key:{status:"valid",value:p},value:y._parse(new yi(d,f,d.path,p)),alwaysSet:p in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const y=[];for(const p of h){const f=await p.key,x=await p.value;y.push({key:f,value:x,alwaysSet:p.alwaysSet})}return y}).then(y=>cs.mergeObjectSync(o,y)):cs.mergeObjectSync(o,h)}get shape(){return this._def.shape()}strict(n){return je.errToObj,new Lt({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(l,o)=>{const d=this._def.errorMap?.(l,o).message??o.defaultError;return l.code==="unrecognized_keys"?{message:je.errToObj(n).message??d}:{message:d}}}:{}})}strip(){return new Lt({...this._def,unknownKeys:"strip"})}passthrough(){return new Lt({...this._def,unknownKeys:"passthrough"})}extend(n){return new Lt({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Lt({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:Le.ZodObject})}setKey(n,l){return this.augment({[n]:l})}catchall(n){return new Lt({...this._def,catchall:n})}pick(n){const l={};for(const o of st.objectKeys(n))n[o]&&this.shape[o]&&(l[o]=this.shape[o]);return new Lt({...this._def,shape:()=>l})}omit(n){const l={};for(const o of st.objectKeys(this.shape))n[o]||(l[o]=this.shape[o]);return new Lt({...this._def,shape:()=>l})}deepPartial(){return Qr(this)}partial(n){const l={};for(const o of st.objectKeys(this.shape)){const d=this.shape[o];n&&!n[o]?l[o]=d:l[o]=d.optional()}return new Lt({...this._def,shape:()=>l})}required(n){const l={};for(const o of st.objectKeys(this.shape))if(n&&!n[o])l[o]=this.shape[o];else{let _=this.shape[o];for(;_ instanceof Hi;)_=_._def.innerType;l[o]=_}return new Lt({...this._def,shape:()=>l})}keyof(){return b0(st.objectKeys(this.shape))}}Lt.create=(s,n)=>new Lt({shape:()=>s,unknownKeys:"strip",catchall:wn.create(),typeName:Le.ZodObject,...Pe(n)});Lt.strictCreate=(s,n)=>new Lt({shape:()=>s,unknownKeys:"strict",catchall:wn.create(),typeName:Le.ZodObject,...Pe(n)});Lt.lazycreate=(s,n)=>new Lt({shape:s,unknownKeys:"strip",catchall:wn.create(),typeName:Le.ZodObject,...Pe(n)});class bc extends We{_parse(n){const{ctx:l}=this._processInputParams(n),o=this._def.options;function d(_){for(const c of _)if(c.result.status==="valid")return c.result;for(const c of _)if(c.result.status==="dirty")return l.common.issues.push(...c.ctx.common.issues),c.result;const w=_.map(c=>new zi(c.ctx.common.issues));return xe(l,{code:ye.invalid_union,unionErrors:w}),Oe}if(l.common.async)return Promise.all(o.map(async _=>{const w={...l,common:{...l.common,issues:[]},parent:null};return{result:await _._parseAsync({data:l.data,path:l.path,parent:w}),ctx:w}})).then(d);{let _;const w=[];for(const h of o){const y={...l,common:{...l.common,issues:[]},parent:null},p=h._parseSync({data:l.data,path:l.path,parent:y});if(p.status==="valid")return p;p.status==="dirty"&&!_&&(_={result:p,ctx:y}),y.common.issues.length&&w.push(y.common.issues)}if(_)return l.common.issues.push(..._.ctx.common.issues),_.result;const c=w.map(h=>new zi(h));return xe(l,{code:ye.invalid_union,unionErrors:c}),Oe}}get options(){return this._def.options}}bc.create=(s,n)=>new bc({options:s,typeName:Le.ZodUnion,...Pe(n)});const Bi=s=>s instanceof Nf?Bi(s.schema):s instanceof er?Bi(s.innerType()):s instanceof wc?[s.value]:s instanceof Jn?s.options:s instanceof jf?st.objectValues(s.enum):s instanceof Ec?Bi(s._def.innerType):s instanceof xf?[void 0]:s instanceof wf?[null]:s instanceof Hi?[void 0,...Bi(s.unwrap())]:s instanceof tr?[null,...Bi(s.unwrap())]:s instanceof S0||s instanceof jc?Bi(s.unwrap()):s instanceof Nc?Bi(s._def.innerType):[];class cm extends We{_parse(n){const{ctx:l}=this._processInputParams(n);if(l.parsedType!==Ee.object)return xe(l,{code:ye.invalid_type,expected:Ee.object,received:l.parsedType}),Oe;const o=this.discriminator,d=l.data[o],_=this.optionsMap.get(d);return _?l.common.async?_._parseAsync({data:l.data,path:l.path,parent:l}):_._parseSync({data:l.data,path:l.path,parent:l}):(xe(l,{code:ye.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,l,o){const d=new Map;for(const _ of l){const w=Bi(_.shape[n]);if(!w.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const c of w){if(d.has(c))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(c)}`);d.set(c,_)}}return new cm({typeName:Le.ZodDiscriminatedUnion,discriminator:n,options:l,optionsMap:d,...Pe(o)})}}function Ef(s,n){const l=yn(s),o=yn(n);if(s===n)return{valid:!0,data:s};if(l===Ee.object&&o===Ee.object){const d=st.objectKeys(n),_=st.objectKeys(s).filter(c=>d.indexOf(c)!==-1),w={...s,...n};for(const c of _){const h=Ef(s[c],n[c]);if(!h.valid)return{valid:!1};w[c]=h.data}return{valid:!0,data:w}}else if(l===Ee.array&&o===Ee.array){if(s.length!==n.length)return{valid:!1};const d=[];for(let _=0;_<s.length;_++){const w=s[_],c=n[_],h=Ef(w,c);if(!h.valid)return{valid:!1};d.push(h.data)}return{valid:!0,data:d}}else return l===Ee.date&&o===Ee.date&&+s==+n?{valid:!0,data:s}:{valid:!1}}class Sc extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n),d=(_,w)=>{if(by(_)||by(w))return Oe;const c=Ef(_.value,w.value);return c.valid?((Sy(_)||Sy(w))&&l.dirty(),{status:l.value,value:c.data}):(xe(o,{code:ye.invalid_intersection_types}),Oe)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([_,w])=>d(_,w)):d(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Sc.create=(s,n,l)=>new Sc({left:s,right:n,typeName:Le.ZodIntersection,...Pe(l)});class Qn extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.array)return xe(o,{code:ye.invalid_type,expected:Ee.array,received:o.parsedType}),Oe;if(o.data.length<this._def.items.length)return xe(o,{code:ye.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&o.data.length>this._def.items.length&&(xe(o,{code:ye.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.dirty());const _=[...o.data].map((w,c)=>{const h=this._def.items[c]||this._def.rest;return h?h._parse(new yi(o,w,o.path,c)):null}).filter(w=>!!w);return o.common.async?Promise.all(_).then(w=>cs.mergeArray(l,w)):cs.mergeArray(l,_)}get items(){return this._def.items}rest(n){return new Qn({...this._def,rest:n})}}Qn.create=(s,n)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qn({items:s,typeName:Le.ZodTuple,rest:null,...Pe(n)})};class xc extends We{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.object)return xe(o,{code:ye.invalid_type,expected:Ee.object,received:o.parsedType}),Oe;const d=[],_=this._def.keyType,w=this._def.valueType;for(const c in o.data)d.push({key:_._parse(new yi(o,c,o.path,c)),value:w._parse(new yi(o,o.data[c],o.path,c)),alwaysSet:c in o.data});return o.common.async?cs.mergeObjectAsync(l,d):cs.mergeObjectSync(l,d)}get element(){return this._def.valueType}static create(n,l,o){return l instanceof We?new xc({keyType:n,valueType:l,typeName:Le.ZodRecord,...Pe(o)}):new xc({keyType:Ii.create(),valueType:n,typeName:Le.ZodRecord,...Pe(l)})}}class Ny extends We{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.map)return xe(o,{code:ye.invalid_type,expected:Ee.map,received:o.parsedType}),Oe;const d=this._def.keyType,_=this._def.valueType,w=[...o.data.entries()].map(([c,h],y)=>({key:d._parse(new yi(o,c,o.path,[y,"key"])),value:_._parse(new yi(o,h,o.path,[y,"value"]))}));if(o.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const h of w){const y=await h.key,p=await h.value;if(y.status==="aborted"||p.status==="aborted")return Oe;(y.status==="dirty"||p.status==="dirty")&&l.dirty(),c.set(y.value,p.value)}return{status:l.value,value:c}})}else{const c=new Map;for(const h of w){const y=h.key,p=h.value;if(y.status==="aborted"||p.status==="aborted")return Oe;(y.status==="dirty"||p.status==="dirty")&&l.dirty(),c.set(y.value,p.value)}return{status:l.value,value:c}}}}Ny.create=(s,n,l)=>new Ny({valueType:n,keyType:s,typeName:Le.ZodMap,...Pe(l)});class vl extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.set)return xe(o,{code:ye.invalid_type,expected:Ee.set,received:o.parsedType}),Oe;const d=this._def;d.minSize!==null&&o.data.size<d.minSize.value&&(xe(o,{code:ye.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),l.dirty()),d.maxSize!==null&&o.data.size>d.maxSize.value&&(xe(o,{code:ye.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),l.dirty());const _=this._def.valueType;function w(h){const y=new Set;for(const p of h){if(p.status==="aborted")return Oe;p.status==="dirty"&&l.dirty(),y.add(p.value)}return{status:l.value,value:y}}const c=[...o.data.values()].map((h,y)=>_._parse(new yi(o,h,o.path,y)));return o.common.async?Promise.all(c).then(h=>w(h)):w(c)}min(n,l){return new vl({...this._def,minSize:{value:n,message:je.toString(l)}})}max(n,l){return new vl({...this._def,maxSize:{value:n,message:je.toString(l)}})}size(n,l){return this.min(n,l).max(n,l)}nonempty(n){return this.min(1,n)}}vl.create=(s,n)=>new vl({valueType:s,minSize:null,maxSize:null,typeName:Le.ZodSet,...Pe(n)});class Nf extends We{get schema(){return this._def.getter()}_parse(n){const{ctx:l}=this._processInputParams(n);return this._def.getter()._parse({data:l.data,path:l.path,parent:l})}}Nf.create=(s,n)=>new Nf({getter:s,typeName:Le.ZodLazy,...Pe(n)});class wc extends We{_parse(n){if(n.data!==this._def.value){const l=this._getOrReturnCtx(n);return xe(l,{received:l.data,code:ye.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:n.data}}get value(){return this._def.value}}wc.create=(s,n)=>new wc({value:s,typeName:Le.ZodLiteral,...Pe(n)});function b0(s,n){return new Jn({values:s,typeName:Le.ZodEnum,...Pe(n)})}class Jn extends We{_parse(n){if(typeof n.data!="string"){const l=this._getOrReturnCtx(n),o=this._def.values;return xe(l,{expected:st.joinValues(o),received:l.parsedType,code:ye.invalid_type}),Oe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(n.data)){const l=this._getOrReturnCtx(n),o=this._def.values;return xe(l,{received:l.data,code:ye.invalid_enum_value,options:o}),Oe}return Ks(n.data)}get options(){return this._def.values}get enum(){const n={};for(const l of this._def.values)n[l]=l;return n}get Values(){const n={};for(const l of this._def.values)n[l]=l;return n}get Enum(){const n={};for(const l of this._def.values)n[l]=l;return n}extract(n,l=this._def){return Jn.create(n,{...this._def,...l})}exclude(n,l=this._def){return Jn.create(this.options.filter(o=>!n.includes(o)),{...this._def,...l})}}Jn.create=b0;class jf extends We{_parse(n){const l=st.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==Ee.string&&o.parsedType!==Ee.number){const d=st.objectValues(l);return xe(o,{expected:st.joinValues(d),received:o.parsedType,code:ye.invalid_type}),Oe}if(this._cache||(this._cache=new Set(st.getValidEnumValues(this._def.values))),!this._cache.has(n.data)){const d=st.objectValues(l);return xe(o,{received:o.data,code:ye.invalid_enum_value,options:d}),Oe}return Ks(n.data)}get enum(){return this._def.values}}jf.create=(s,n)=>new jf({values:s,typeName:Le.ZodNativeEnum,...Pe(n)});class Cc extends We{unwrap(){return this._def.type}_parse(n){const{ctx:l}=this._processInputParams(n);if(l.parsedType!==Ee.promise&&l.common.async===!1)return xe(l,{code:ye.invalid_type,expected:Ee.promise,received:l.parsedType}),Oe;const o=l.parsedType===Ee.promise?l.data:Promise.resolve(l.data);return Ks(o.then(d=>this._def.type.parseAsync(d,{path:l.path,errorMap:l.common.contextualErrorMap})))}}Cc.create=(s,n)=>new Cc({type:s,typeName:Le.ZodPromise,...Pe(n)});class er extends We{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:l,ctx:o}=this._processInputParams(n),d=this._def.effect||null,_={addIssue:w=>{xe(o,w),w.fatal?l.abort():l.dirty()},get path(){return o.path}};if(_.addIssue=_.addIssue.bind(_),d.type==="preprocess"){const w=d.transform(o.data,_);if(o.common.async)return Promise.resolve(w).then(async c=>{if(l.value==="aborted")return Oe;const h=await this._def.schema._parseAsync({data:c,path:o.path,parent:o});return h.status==="aborted"?Oe:h.status==="dirty"||l.value==="dirty"?fl(h.value):h});{if(l.value==="aborted")return Oe;const c=this._def.schema._parseSync({data:w,path:o.path,parent:o});return c.status==="aborted"?Oe:c.status==="dirty"||l.value==="dirty"?fl(c.value):c}}if(d.type==="refinement"){const w=c=>{const h=d.refinement(c,_);if(o.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return c.status==="aborted"?Oe:(c.status==="dirty"&&l.dirty(),w(c.value),{status:l.value,value:c.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>c.status==="aborted"?Oe:(c.status==="dirty"&&l.dirty(),w(c.value).then(()=>({status:l.value,value:c.value}))))}if(d.type==="transform")if(o.common.async===!1){const w=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!ia(w))return Oe;const c=d.transform(w.value,_);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:l.value,value:c}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(w=>ia(w)?Promise.resolve(d.transform(w.value,_)).then(c=>({status:l.value,value:c})):Oe);st.assertNever(d)}}er.create=(s,n,l)=>new er({schema:s,typeName:Le.ZodEffects,effect:n,...Pe(l)});er.createWithPreprocess=(s,n,l)=>new er({schema:n,effect:{type:"preprocess",transform:s},typeName:Le.ZodEffects,...Pe(l)});class Hi extends We{_parse(n){return this._getType(n)===Ee.undefined?Ks(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Hi.create=(s,n)=>new Hi({innerType:s,typeName:Le.ZodOptional,...Pe(n)});class tr extends We{_parse(n){return this._getType(n)===Ee.null?Ks(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}tr.create=(s,n)=>new tr({innerType:s,typeName:Le.ZodNullable,...Pe(n)});class Ec extends We{_parse(n){const{ctx:l}=this._processInputParams(n);let o=l.data;return l.parsedType===Ee.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:l.path,parent:l})}removeDefault(){return this._def.innerType}}Ec.create=(s,n)=>new Ec({innerType:s,typeName:Le.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...Pe(n)});class Nc extends We{_parse(n){const{ctx:l}=this._processInputParams(n),o={...l,common:{...l.common,issues:[]}},d=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return _c(d)?d.then(_=>({status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new zi(o.common.issues)},input:o.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new zi(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Nc.create=(s,n)=>new Nc({innerType:s,typeName:Le.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...Pe(n)});class jy extends We{_parse(n){if(this._getType(n)!==Ee.nan){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.nan,received:o.parsedType}),Oe}return{status:"valid",value:n.data}}}jy.create=s=>new jy({typeName:Le.ZodNaN,...Pe(s)});class S0 extends We{_parse(n){const{ctx:l}=this._processInputParams(n),o=l.data;return this._def.type._parse({data:o,path:l.path,parent:l})}unwrap(){return this._def.type}}class um extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{const _=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return _.status==="aborted"?Oe:_.status==="dirty"?(l.dirty(),fl(_.value)):this._def.out._parseAsync({data:_.value,path:o.path,parent:o})})();{const d=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?Oe:d.status==="dirty"?(l.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:o.path,parent:o})}}static create(n,l){return new um({in:n,out:l,typeName:Le.ZodPipeline})}}class jc extends We{_parse(n){const l=this._def.innerType._parse(n),o=d=>(ia(d)&&(d.value=Object.freeze(d.value)),d);return _c(l)?l.then(d=>o(d)):o(l)}unwrap(){return this._def.innerType}}jc.create=(s,n)=>new jc({innerType:s,typeName:Le.ZodReadonly,...Pe(n)});var Le;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(Le||(Le={}));const le=Ii.create,ke=na.create,Ve=Sf.create,Jr=Cf.create;wn.create;const vs=_i.create,fe=Lt.create,x0=bc.create,i2=cm.create;Sc.create;Qn.create;const Dd=xc.create,_l=wc.create,Ft=Jn.create;Cc.create;Hi.create;tr.create;fe({id:ke().int().nonnegative(),method:le().min(1),params:Jr().optional()});const n2=fe({code:le(),message:le(),detail:le().optional()});x0([fe({id:ke(),result:Jr()}),fe({id:ke(),error:n2})]);fe({event:le(),data:Jr().optional()});const w0=i2("kind",[fe({kind:_l("key"),privateKey:le().min(1).max(64*1024),passphrase:le().max(1024).optional()}),fe({kind:_l("password"),password:le().max(1024)})]),C0=/^[a-z_][a-z0-9_-]{0,31}$/,E0=/^(\[[0-9a-fA-F:.]+\]|[0-9a-fA-F:.]+|[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*)$/,Tf=le().min(1).max(255).regex(E0,"Not an IP address or host name"),r2=le().regex(C0,"Not a valid user name"),et=fe({host:Tf,port:ke().int().min(1).max(65535),username:r2,auth:w0}),hm=9922,a2="prisoner",yl=22,Ty="root",l2=9991,Vs={PassphraseRequired:"passphrase_required",BadPassphrase:"bad_passphrase",BadKey:"bad_key",KeyNotFound:"key_not_found",KeyServerUnreachable:"key_server_unreachable",Unreachable:"ssh_unreachable",AuthFailed:"ssh_auth_failed",Timeout:"ssh_timeout"},rc=le().min(1).max(255).regex(/^[\w.-]+$/,"Not a valid app id"),o2=fe({id:le(),title:le().optional(),version:le().optional(),type:le().optional(),vendor:le().optional(),folderPath:le().optional(),icon:le().optional(),systemApp:Ve().optional(),removable:Ve().optional(),visible:Ve().optional()}).passthrough(),kf="org.webosbrew.hbchannel",Rf=512*1024*1024,c2=4*1024*1024,u2=fe({opId:le(),stage:Ft(["upload","verify","install","remove","cleanup"]),percent:ke().min(0).max(100).optional(),text:le().optional()}),h2="op.progress",ac={InstallFailed:"install_failed",InsufficientSpace:"insufficient_space",ChecksumMismatch:"checksum_mismatch",Conflict:"app_conflict"},d2=fe({id:le(),phase:Ft(["start","end"]),target:le(),command:le(),kind:Ft(["exec","stream","sftp","tunnel","http"]),quiet:Ve().optional(),at:ke(),exitCode:ke().nullable().optional(),durationMs:ke().optional(),output:le().optional(),error:le().optional()}),f2="cmd.log",m2=fe({opId:le(),stream:Ft(["stdout","stderr"]),data:le()}),p2="cmd.output",g2=fe({host:le(),name:le().optional(),modelName:le().optional(),ports:fe({ssh22:Ve(),ssh9922:Ve(),keyServer:Ve(),webos:Ve()}),via:vs(Ft(["ssdp","sweep"]))}),ra=le().max(2048).refine(s=>{try{const n=new URL(s).protocol;return n==="https:"||n==="http:"}catch{return!1}},"Not an http(s) URL"),ky=fe({id:le(),version:le(),type:le().optional(),title:le().optional(),appDescription:le().optional(),sourceUrl:ra.optional(),rootRequired:x0([Ve(),_l("optional")]).optional(),ipkUrl:ra,ipkHash:fe({sha256:le().regex(/^[0-9a-f]{64}$/i)}).optional(),ipkSize:ke().nonnegative().optional()}),v2=fe({url:ra,caption:le().optional(),width:ke().optional(),height:ke().optional()}),_2=fe({id:le(),title:le(),iconUri:ra.optional(),detailIconUri:ra.optional(),shortDescription:le().optional(),featured:Ve().optional(),manifest:ky.optional(),manifestBeta:ky.optional(),requirements:fe({webosRelease:le().optional(),deviceSoC:vs(le()).optional()}).optional(),screenshots:vs(v2).optional(),hasDescription:Ve()}),Ry={Unreachable:"repo_unreachable",DownloadFailed:"download_failed"},Js=le().min(1).max(4096).refine(s=>s.startsWith("/")&&!s.split("/").includes("..")&&!s.includes("\0"),"Not an absolute path"),Ad=le().min(1).max(255).refine(s=>!s.includes("/")&&!s.includes("\0")&&s!=="."&&s!=="..","Not a valid file name"),y2=fe({name:le(),type:Ft(["d","-","l","c","b","p","s","?"]),mode:le(),size:ke(),mtime:ke(),user:le().optional(),group:le().optional(),link:fe({target:le().optional(),broken:Ve().optional(),type:Ft(["d","-","l","c","b","p","s","?"]).optional()}).optional(),access:fe({read:Ve(),write:Ve(),execute:Ve()}).optional()}),Df=4*1024*1024,Od=64*1024,b2=fe({shellId:le(),data:le(),stream:Ft(["stdout","stderr"]).optional()}),S2="shell.output",x2=fe({shellId:le(),code:ke().nullable().optional(),signal:le().optional(),error:le().optional()}),w2="shell.exit",C2=Ft(["syslog","dmesg","lsmonitor"]),E2=fe({opId:le(),lines:vs(le()),dropped:ke().int().optional()}),N2="logs.lines",j2=Ft(["none","debug","info","notice","warning","err","crit","alert","emerg"]),N0=le().min(1).max(128).regex(/^[\w.\-<>*]+$/,"Not a log context name"),T2=fe({name:le(),path:le(),size:ke(),mtime:ke().optional(),writable:Ve()}),k2="org.litefin.app",Af="https://github.com/MoazSalem/litefin/releases",R2=5,j0=le().min(1).max(64).regex(/^[A-Za-z0-9][\w.-]*$/,"Not a variant name"),D2=fe({variant:j0,name:le(),size:ke(),sha256:le().optional()}),A2=fe({tag:le(),version:le(),title:le(),publishedAt:le(),assets:vs(D2)}),O2={Unreachable:"litefin_unreachable"},L2=8,M2=le().regex(/^[A-Za-z0-9+/]*={0,2}$/,"Not base64"),Tc=5199;fe({token:le().min(1),protocolVersion:ke().int(),client:le().optional()}),fe({protocolVersion:ke().int(),bridgeVersion:le(),platform:le(),distribution:Ft(["app","npm","source"]).optional()}),fe({}).optional(),fe({now:ke()}),fe({host:Tf}),fe({ssh22:Ve(),ssh9922:Ve(),keyServer:Ve(),webos:Ve()}),fe({timeoutMs:ke().int().min(500).max(15e3).optional()}).optional(),fe({tvs:vs(g2)}),fe({host:Tf,passphrase:le().max(1024).optional()}),fe({privateKey:le(),fingerprint:le()}),fe({privateKey:le().min(1).max(64*1024),passphrase:le().max(1024).optional()}),fe({fingerprint:le(),type:le()}),fe({device:et}),fe({latencyMs:ke(),root:Ve()}),fe({device:et,quiet:Ve().optional()}),fe({modelName:le().optional(),osVersion:le().optional(),firmwareVersion:le().optional(),otaId:le().optional(),socName:le().optional()}),fe({device:et,path:Js.optional()}),fe({total:ke(),used:ke(),available:ke()}).nullable(),fe({comment:le().max(64).optional()}),fe({privateKey:le(),publicKey:le(),fingerprint:le()}),fe({device:et.optional()}),fe({closed:ke()}),fe({device:et,command:le().min(1).max(64*1024),stdin:le().max(4*1024*1024).optional(),timeoutMs:ke().int().min(100).max(6e5).optional()}),fe({stdout:le(),stderr:le(),exitCode:ke().nullable()}),fe({device:et,command:le().min(1).max(8192),opId:le().max(64)}),fe({exitCode:ke().nullable(),cancelled:Ve()}),fe({opId:le().max(64)}),fe({cancelled:Ve()}),fe({device:et,uri:le().regex(/^luna:\/\/[\w.\-/]+$/,"Not a luna:// URI"),params:Dd(Jr()).optional(),public:Ve().optional(),falseAsError:Ve().optional()}),Dd(Jr()),fe({device:et}),fe({apps:vs(o2)}),fe({device:et,id:rc,params:Dd(Jr()).optional()}),fe({}),fe({device:et,path:Js}),fe({mime:le(),base64:le()}),fe({device:et,id:rc,opId:le().max(64)}),fe({}),fe({device:et,uploadId:le().max(64),opId:le().max(64)}),fe({appId:le().optional(),via:Ft(["devmode","hbchannel"])}),fe({name:le().min(1).max(255),size:ke().int().min(1).max(Rf)}),fe({uploadId:le()}),fe({uploadId:le().max(64),offset:ke().int().min(0),data:M2.max(Math.ceil(c2/3)*4)}),fe({received:ke()}),fe({uploadId:le().max(64)}),fe({}),fe({device:et}),fe({token:le().optional(),remaining:le().optional(),problem:le().optional()}),fe({device:et}),fe({}),fe({device:et,method:Ft(["DISPLAY","VIDEO","GRAPHIC"]).default("DISPLAY")}),fe({mime:le(),base64:le()}),fe({device:et}),fe({path:le()}),fe({device:et,path:Js}),fe({path:le(),items:vs(y2)}),fe({device:et,path:Js}),fe({device:et,path:Js,offset:ke().int().min(0),length:ke().int().min(1).max(Df)}),fe({data:le(),eof:Ve()}),fe({device:et,path:Js,uploadId:le().max(64),opId:le().max(64),overwrite:Ve().optional()}),fe({size:ke()}),fe({device:et,parent:Js,name:Ad}),fe({path:le()}),fe({device:et,parent:Js,from:Ad,to:Ad}),fe({path:le()}),fe({device:et,path:Js}),fe({}),fe({device:et,rows:ke().int().min(2).max(500),cols:ke().int().min(10).max(1e3),pty:Ve().optional()}),fe({shellId:le(),pty:Ve(),title:le()}),fe({shellId:le().max(64),data:le().max(1024*1024)}),fe({}),fe({shellId:le().max(64),rows:ke().int().min(2).max(500),cols:ke().int().min(10).max(1e3)}),fe({}),fe({shellId:le().max(64),bytes:ke().int().min(0)}),fe({}),fe({shellId:le().max(64)}),fe({}),fe({refresh:Ve().optional()}),fe({packages:vs(_2),fetchedAt:ke()}),fe({url:ra}),fe({mime:le(),base64:le()}),fe({id:rc}),fe({html:le().nullable(),baseUrl:le().optional()}),fe({device:et,id:rc,channel:Ft(["stable","beta"]).default("stable"),opId:le().max(64)}),fe({appId:le(),version:le(),via:Ft(["devmode","hbchannel"])}),fe({device:et,quiet:Ve().optional()}),fe({installed:Ve(),root:Ve().optional()}),fe({device:et,source:C2,opId:le().min(1).max(64),lines:ke().int().min(0).max(5e3).optional()}),fe({exitCode:ke().nullable(),stopped:Ve()}),fe({opId:le().max(64)}),fe({stopped:Ve()}),fe({device:et,source:Ft(["syslog","dmesg"])}),fe({}),fe({device:et}),fe({contexts:vs(fe({name:le(),level:le()}))}),fe({device:et,context:N0,level:j2}),fe({changed:vs(le())}),fe({device:et}),fe({dir:le().nullable(),reports:vs(T2)}),fe({device:et,path:Js}),fe({text:le(),truncated:Ve()}),fe({refresh:Ve().optional()}).optional(),fe({releases:vs(A2),fetchedAt:ke(),stale:le().optional()}),fe({device:et,tag:le().min(1).max(100),variant:j0,opId:le().max(64)}),fe({appId:le(),version:le(),via:Ft(["devmode","hbchannel"])}),fe({device:et,path:Js}),fe({});const B2="https://lg.scoty.uk",I2=[B2],H2=["http://localhost:5173","http://127.0.0.1:5173"],dm="https://github.com/Scoty/lg-dev-manager",Of=`${dm}/releases/latest`;class yt extends Error{constructor(n,l,o){super(l),this.code=n,this.detail=o}code;detail;static from(n){return new yt(n.code,n.message,n.detail)}}class U2{constructor(n,l){this.url=n,this.token=l}url;token;ws;nextId=1;pending=new Map;listeners=new Map;onClose;async connect(n=8e3){return await new Promise((l,o)=>{let d;try{d=new WebSocket(this.url)}catch(w){o(new yt("bad_url",`Invalid bridge address: ${this.url}`,String(w)));return}this.ws=d;const _=setTimeout(()=>{d.close(),o(new yt("timeout","The bridge did not answer in time."))},n);d.onopen=()=>{clearTimeout(_),l()},d.onerror=()=>{clearTimeout(_),o(new yt("unreachable","Could not reach the bridge. Is it running, and is this site allowed?"))},d.onmessage=w=>this.handle(String(w.data)),d.onclose=w=>{const c=w.reason||(w.code===4401?"unauthorized":"closed");for(const h of this.pending.values())clearTimeout(h.timer),h.reject(new yt("disconnected","Connection to the bridge was lost."));this.pending.clear(),this.onClose?.(c)}}),this.call("system.hello",{token:this.token,protocolVersion:L2,client:"web"})}call(n,l,o=3e4){const d=this.ws;if(!d||d.readyState!==WebSocket.OPEN)return Promise.reject(new yt("disconnected","Not connected to the bridge."));const _=this.nextId++;return new Promise((w,c)=>{const h=setTimeout(()=>{this.pending.delete(_),c(new yt("timeout",`${n} timed out.`))},o);this.pending.set(_,{resolve:w,reject:c,timer:h}),d.send(JSON.stringify({id:_,method:n,params:l}))})}on(n,l){let o=this.listeners.get(n);return o||this.listeners.set(n,o=new Set),o.add(l),()=>o.delete(l)}close(){this.onClose=void 0,this.ws?.close()}handle(n){let l;try{l=JSON.parse(n)}catch{return}if(typeof l.id=="number"){const o=this.pending.get(l.id);if(!o)return;this.pending.delete(l.id),clearTimeout(o.timer),l.error?o.reject(yt.from(l.error)):o.resolve(l.result)}else l.event&&this.listeners.get(l.event)?.forEach(o=>o(l.data))}}const Lf="lgdm-bridge",z2=new Set(["127.0.0.1","localhost"]),Dy=`The bridge only runs on this computer, so its address must start with ws://127.0.0.1: or ws://localhost: (default ws://127.0.0.1:${Tc}/rpc).`;function fm(s){let n;try{n=new URL(s.trim())}catch{return`That isn’t a valid address. ${Dy}`}return n.protocol!=="ws:"||!z2.has(n.hostname)||n.username||n.password?Dy:null}function Ay(s=window.location){const n=s.hostname==="localhost"||s.hostname==="127.0.0.1";return s.protocol==="http:"&&n&&!["localhost:5173","127.0.0.1:5173"].includes(s.host)?`ws://${s.host}/rpc`:`ws://127.0.0.1:${Tc}/rpc`}function $2(){try{const s=localStorage.getItem(Lf);if(!s)return null;const n=JSON.parse(s);return n.url&&n.token&&!fm(n.url)?{url:n.url,token:n.token}:null}catch{return null}}function Oy(s){try{s?localStorage.setItem(Lf,JSON.stringify(s)):localStorage.removeItem(Lf)}catch{}}const T0=M.createContext(null),Ly=[1e3,2e3,5e3,1e4];function P2({children:s}){const[n,l]=M.useState(()=>$2()),[o,d]=M.useState(n?{state:"connecting"}:{state:"unpaired"}),[_,w]=M.useState(null),c=M.useRef(0),h=M.useRef(void 0),y=M.useRef(0),p=M.useCallback(async C=>{const j=++y.current;clearTimeout(h.current),d({state:"connecting"});const E=new U2(C.url,C.token);try{const g=await E.connect();if(j!==y.current)return E.close();c.current=0,w(E),d({state:"connected",bridgeVersion:g.bridgeVersion,platform:g.platform,distribution:g.distribution}),E.onClose=b=>{if(j===y.current){if(w(null),b==="unauthorized"){d({state:"error",code:"unauthorized",message:"The bridge rejected the pairing token."});return}d({state:"error",code:"disconnected",message:"Lost connection to the bridge. Retrying…"}),f(C,j)}}}catch(g){if(E.close(),j!==y.current)return;const b=g instanceof yt?g:new yt("unknown",String(g));throw w(null),d({state:"error",code:b.code,message:b.message}),b.code!=="unauthorized"&&b.code!=="protocol_mismatch"&&f(C,j),b}},[]),f=M.useCallback((C,j)=>{const E=Ly[Math.min(c.current++,Ly.length-1)];h.current=setTimeout(()=>{j===y.current&&p(C).catch(()=>{})},E)},[p]);M.useEffect(()=>(n&&p(n).catch(()=>{}),()=>{y.current++,clearTimeout(h.current)}),[]);const x=M.useMemo(()=>({status:o,settings:n,client:_,pair:async C=>{const j=fm(C.url);if(j)throw new yt("bad_url",j);_?.close(),Oy(C),l(C),await p(C)},reconnect:()=>{c.current=0,n&&p(n).catch(()=>{})},forget:()=>{y.current++,clearTimeout(h.current),_?.close(),Oy(null),l(null),w(null),d({state:"unpaired"})}}),[o,n,_,p]);return r.jsx(T0.Provider,{value:x,children:s})}function Pi(){const s=M.useContext(T0);if(!s)throw new Error("useBridge must be used inside <BridgeProvider>");return s}const k0={apps:'<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>',store:'<path d="M3 9h18l-1.5 11a1 1 0 0 1-1 .9h-13a1 1 0 0 1-1-.9z"/><path d="M8 9V6a4 4 0 0 1 8 0v3"/>',files:'<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>',terminal:'<rect x="3" y="4" width="18" height="16" rx="2"/><path d="m7 9 3 3-3 3M13 15h4"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>',debug:'<path d="M8 2l1.5 2M16 2l-1.5 2"/><rect x="7" y="5" width="10" height="15" rx="5"/><path d="M3 12h4M17 12h4M4 7l3 2M20 7l-3 2M4 18l3-2M20 18l-3-2M12 10v7"/>',tv:'<rect x="3" y="5" width="18" height="12" rx="2"/><path d="M8 21h8M12 17v4"/>',plug:'<path d="M9 2v6M15 2v6"/><path d="M6 8h12v3a6 6 0 0 1-12 0z"/><path d="M12 17v5"/>',github:'<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/>',sun:'<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/>',moon:'<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',search:'<circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/>',menu:'<line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/>',folder:'<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>',folderPlus:'<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><path d="M12 10v6M9 13h6"/>',file:'<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/>',image:'<rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-5-5L5 21"/>',cog:'<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/>',chevLeft:'<path d="m15 18-6-6 6-6"/>',chevDown:'<path d="m6 9 6 6 6-6"/>',arrowUp:'<path d="M12 19V5M5 12l7-7 7 7"/>',home:'<path d="m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z"/>',clock:'<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',chevRight:'<path d="m9 18 6-6-6-6"/>',left:'<path d="m15 18-6-6 6-6"/>',right:'<path d="m9 18 6-6-6-6"/>',updown:'<path d="m7 9 5-5 5 5"/><path d="m7 15 5 5 5-5"/>',plus:'<path d="M12 5v14M5 12h14"/>',key:'<circle cx="7.5" cy="15.5" r="4.5"/><path d="m10.7 12.3 9.3-9.3M17 6l3 3M14 9l2 2"/>',wrench:'<path d="M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4z"/>',play:'<path d="M7 4.5v15a.8.8 0 0 0 1.2.7l12-7.5a.8.8 0 0 0 0-1.4l-12-7.5A.8.8 0 0 0 7 4.5z"/>',trash:'<path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6"/>',edit:'<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"/>',refresh:'<path d="M21 12a9 9 0 1 1-2.6-6.4L21 8"/><path d="M21 3v5h-5"/>',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5M12 15V3"/>',upload:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m17 8-5-5-5 5M12 3v12"/>',check:'<path d="M20 6 9 17l-5-5"/>',x:'<path d="M18 6 6 18M6 6l12 12"/>',copy:'<rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>',more:'<circle cx="12" cy="5" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="12" cy="19" r="1"/>',alert:'<path d="M12 9v4M12 17h.01"/><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>',lock:'<rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',shield:'<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>',pulse:'<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>',link:'<path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/>',external:'<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14 21 3"/>',box:'<path d="M21 8 12 3 3 8v8l9 5 9-5z"/><path d="m3 8 9 5 9-5M12 13v8"/>',disk:'<ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5"/><path d="M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3"/>'};function ce({name:s,className:n,strokeWidth:l}){return r.jsx("svg",{viewBox:"0 0 24 24",className:n,fill:"none",stroke:"currentColor",strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:k0[s]}})}function si({open:s,onClose:n,title:l,children:o,footer:d,size:_="md",dismissible:w=!0}){const c=M.useRef(null),h=M.useId();return M.useEffect(()=>{const y=c.current;y&&(s&&!y.open&&y.showModal(),!s&&y.open&&y.close())},[s]),r.jsx("dialog",{ref:c,className:`modal modal--${_}`,"aria-labelledby":h,onCancel:y=>{y.preventDefault(),w&&n()},onMouseDown:y=>{w&&y.target===y.currentTarget&&n()},children:s&&r.jsxs("div",{className:"modal-card",children:[r.jsxs("div",{className:"modal-head",children:[r.jsx("h2",{className:"modal-title",id:h,children:l}),w&&r.jsx("button",{type:"button",className:"icon-btn icon-btn--sm",onClick:n,"aria-label":"Close",children:r.jsx(ce,{name:"x",strokeWidth:2})})]}),r.jsx("div",{className:"modal-body",children:o}),d&&r.jsx("div",{className:"modal-foot",children:d})]})})}const F2={success:'<path d="M20 6 9 17l-5-5"/>',danger:'<path d="M18 6 6 18M6 6l12 12"/>',warning:'<path d="M12 9v4M12 17h.01"/><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>',primary:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>'};function $e({kind:s,title:n,children:l,action:o}){return r.jsxs("div",{className:`alert ${s}`,role:s==="danger"?"alert":"status",children:[r.jsx("div",{className:"ico",children:r.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F2[s]}})}),r.jsxs("div",{className:"body",children:[n&&r.jsx("div",{className:"title",children:n}),l]}),o??r.jsx("span",{})]})}const R0=M.createContext(null);function V2({children:s}){const[n,l]=M.useState(null),[o,d]=M.useState([]),_=M.useRef(1),w=M.useCallback(p=>new Promise(f=>{l({...p,resolve:f})}),[]),c=M.useCallback(p=>{const f=_.current++;d(x=>[...x.slice(-3),{...p,id:f}]),setTimeout(()=>d(x=>x.filter(C=>C.id!==f)),p.kind==="danger"?9e3:5e3)},[]),h=p=>{n?.resolve(p),l(null)},y=M.useMemo(()=>({confirm:w,toast:c}),[w,c]);return r.jsxs(R0.Provider,{value:y,children:[s,r.jsx(si,{open:!!n,onClose:()=>h(!1),title:n?.title??"",size:"sm",footer:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn btn--ghost",onClick:()=>h(!1),autoFocus:n?.danger,children:n?.cancelText??"Cancel"}),r.jsx("button",{type:"button",className:`btn ${n?.danger?"btn--danger":"btn--primary"}`,onClick:()=>h(!0),autoFocus:!n?.danger,children:n?.confirmText??"OK"})]}),children:n?.message}),r.jsx("div",{className:"toasts","aria-live":"polite",children:o.map(p=>r.jsx("div",{className:"toast",children:r.jsx($e,{kind:p.kind,title:p.title,action:r.jsx("button",{type:"button",className:"close","aria-label":"Dismiss",onClick:()=>d(f=>f.filter(x=>x.id!==p.id)),children:r.jsx("svg",{viewBox:"0 0 24 24",children:r.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}),children:p.text})},p.id))})]})}function jt(){const s=M.useContext(R0);if(!s)throw new Error("useFeedback must be used inside <FeedbackProvider>");return s}function mm(s){const[n,l]=M.useState(()=>typeof matchMedia=="function"&&matchMedia(s).matches);return M.useEffect(()=>{if(typeof matchMedia!="function")return;const o=matchMedia(s),d=()=>l(o.matches);return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[s]),n}const D0="(min-width: 721px) and (max-width: 1100px)",pm=[{label:"Device",items:[{key:"apps",text:"Apps",icon:"apps",children:[{key:"apps-installed",text:"Installed",to:"/apps/installed"},{key:"apps-homebrew",text:"Homebrew repo",to:"/apps/homebrew"},{key:"apps-litefin",text:"Litefin repo",to:"/apps/litefin"}]},{key:"files",text:"Files",icon:"files",to:"/files"},{key:"terminal",text:"Terminal",icon:"terminal",to:"/terminal"},{key:"info",text:"Device info",icon:"info",to:"/info"},{key:"debug",text:"Debug",icon:"debug",children:[{key:"debug-logs",text:"System log",to:"/debug/logs"},{key:"debug-pmlog",text:"Log levels",to:"/debug/pmlog"},{key:"debug-dmesg",text:"Kernel log",to:"/debug/dmesg"},{key:"debug-crashes",text:"Crash reports",to:"/debug/crashes"},{key:"debug-luna",text:"Luna monitor",to:"/debug/luna"}]}]},{label:"Setup",items:[{key:"devices",text:"Devices",icon:"tv",to:"/devices"},{key:"bridge",text:"Bridge",icon:"plug",to:"/bridge"}]},{label:"Links",items:[{key:"homebrew-site",text:"webOS Homebrew",icon:"store",href:"https://www.webosbrew.org/"},{key:"source",text:"Source code",icon:"github",href:dm}]}];function q2(s){if(s.startsWith("/devices/new"))return["Setup","Devices","Add a TV"];for(const n of pm)for(const l of n.items){if(l.to&&s.startsWith(l.to))return[n.label,l.text];for(const o of l.children??[])if(s.startsWith(o.to))return[n.label,l.text,o.text]}return["LG Dev Manager"]}const A0="1.0.2",ml="1.0.2",lc=6,ul=8;function K2(){const n=document.querySelector(".console-dock")?.getBoundingClientRect().top;return n&&n>0?Math.min(n,window.innerHeight):window.innerHeight}function Ic({trigger:s,children:n,placement:l="down-right",className:o="",menuClassName:d="",label:_,floating:w=!1}){const[c,h]=M.useState(!1),y=M.useRef(null),p=M.useRef(null),[f,x]=M.useState(null),C=M.useCallback(()=>{const E=y.current?.getBoundingClientRect(),g=p.current;if(!E||!g)return;const b=g.offsetHeight,v=g.offsetWidth,N=K2()-E.bottom-lc,T=E.top-lc,O=b>N-ul&&T>N?Math.max(ul,E.top-lc-b):E.bottom+lc,k=l==="down-right"?Math.max(ul,E.right-v):Math.min(Math.max(ul,E.left),window.innerWidth-v-ul);x({top:O,left:k})},[l]);M.useLayoutEffect(()=>{if(w){if(!c)return x(null);C()}},[w,c,C]),M.useEffect(()=>{if(!c)return;const E=b=>{const v=b.target;!y.current?.contains(v)&&!p.current?.contains(v)&&h(!1)},g=b=>{b.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",E),document.addEventListener("keydown",g),w&&(window.addEventListener("scroll",C,!0),window.addEventListener("resize",C)),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",g),window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[c,w,C]);const j=c&&n(()=>h(!1));return r.jsxs("div",{ref:y,className:`dd-wrap${c?" is-open":""} ${o}`,children:[s({open:c,toggle:()=>h(E=>!E),"aria-expanded":c,"aria-haspopup":"menu"}),w?c&&GC.createPortal(r.jsx("div",{ref:p,className:`dd-menu dd-menu--floating${f?" is-placed":""} ${d}`,role:"menu","aria-label":_,style:f??void 0,children:j}),document.body):r.jsx("div",{ref:p,className:`dd-menu dd-menu--${l} ${d}`,role:"menu","aria-label":_,children:j})]})}const Hc=s=>C0.test(s);function bl(s){const n=s.trim();return n?n.length>255||!E0.test(n)?"That doesn’t look like an IP address or host name.":null:"Enter the TV’s IP address."}const G2=s=>s===s.trim()&&bl(s)===null,O0=fe({modelName:le().max(64).optional(),osVersion:le().max(64).optional(),firmwareVersion:le().max(64).optional(),socName:le().max(64).optional(),from:le().max(300),at:ke(),v:ke().optional()}),L0=2;function Uc(s,n){const l=o=>o?o.slice(0,64):void 0;return O0.parse({...n.modelName?{modelName:l(n.modelName)}:{},...n.osVersion?{osVersion:l(n.osVersion)}:{},...n.firmwareVersion?{firmwareVersion:l(n.firmwareVersion)}:{},...n.socName?{socName:l(n.socName)}:{},from:`${s.host}:${s.port}`,at:Date.now(),v:L0})}const ua=fe({id:le(),name:le().min(1).max(64),mode:Ft(["devmode","rooted"]),host:le().min(1).max(255),port:ke().int().min(1).max(65535),username:le().min(1).max(64),auth:w0,description:le().max(200).optional(),info:O0.optional(),createdAt:ke(),updatedAt:ke()}),Y2=ua.extend({host:le().trim().refine(s=>bl(s)===null,"Not a valid IP address or host name."),username:le().refine(Hc,"Not a valid user name.")}),Z2=fe({format:_l("lg-dev-manager/devices"),version:_l(1),exportedAt:ke(),devices:vs(Y2).max(500)});class M0 extends Error{name="BackupError"}const X2="That file is not an LG Dev Manager device backup.";function W2(s,n){const l=s.issues.find(h=>h.path[0]==="devices"&&typeof h.path[1]=="number");if(!l)return X2;const o=l.path[1],d=n.devices?.[o]?.name,_=typeof d=="string"&&d.trim()?`“${d.trim().slice(0,64)}”`:`number ${o+1}`,w=l.path[2];return`Nothing was imported: TV ${_} in this backup ${w==="username"?"has a user name that isn’t allowed":w==="host"?"has an address that isn’t an IP address or host name":"has settings this app can’t use"}. Only import backups you made yourself.`}const Q2="lgdm",J2=2,aa="devices",As="screenshots",Mf="lgdm-active-device";function zc(s){return new Promise((n,l)=>{s.onsuccess=()=>n(s.result),s.onerror=()=>l(s.error)})}let oc=null;function ir(){return oc??=new Promise((s,n)=>{const l=indexedDB.open(Q2,J2);l.onupgradeneeded=()=>{const o=l.result;o.objectStoreNames.contains(aa)||o.createObjectStore(aa,{keyPath:"id"}),o.objectStoreNames.contains(As)||o.createObjectStore(As,{keyPath:"id"}).createIndex("deviceId","deviceId")},l.onsuccess=()=>{l.result.onversionchange=()=>{l.result.close(),oc=null},s(l.result)},l.onerror=()=>{oc=null,n(l.error)}}),oc}async function nr(s,n){const l=await ir();return zc(n(l.transaction(aa,s).objectStore(aa)))}async function eN(s){const n=await ir();await new Promise((l,o)=>{const d=n.transaction(As,"readwrite"),_=d.objectStore(As).index("deviceId").openKeyCursor(IDBKeyRange.only(s));_.onsuccess=()=>{const w=_.result;w&&(d.objectStore(As).delete(w.primaryKey),w.continue())},d.oncomplete=()=>l(),d.onerror=()=>o(d.error)}),Sl.forEach(l=>l())}async function tN(){const s=await ir();await zc(s.transaction(As,"readwrite").objectStore(As).clear()),Sl.forEach(n=>n())}const Sl=new Set,Bf=new Set,ha=()=>Bf.forEach(s=>s());function My(s){return Bf.add(s),()=>Bf.delete(s)}async function gm(){return(await nr("readonly",n=>n.getAll())).map(n=>ua.safeParse(n)).flatMap(n=>n.success?[n.data]:[]).sort((n,l)=>n.name.localeCompare(l.name))}async function B0(s){const n=await nr("readonly",o=>o.get(s)),l=ua.safeParse(n);return l.success?l.data:void 0}async function sN(s){const n=Date.now(),l=ua.parse({...s,id:crypto.randomUUID(),createdAt:n,updatedAt:n});return await nr("readwrite",o=>o.add(l)),$c()||Nn(l.id),ha(),l}async function iN(s,n){const l=await B0(s);if(!l)throw new Error("Device not found");const o=ua.parse({...l,...n,id:s,updatedAt:Date.now()});return await nr("readwrite",d=>d.put(o)),ha(),o}async function vm(s,n){const l=await B0(s);l&&(await nr("readwrite",o=>o.put(ua.parse({...l,info:n}))),ha())}async function nN(s){if(await nr("readwrite",n=>n.delete(s)),await eN(s).catch(()=>{}),$c()===s){const n=await gm();Nn(n[0]?.id??null)}ha()}function $c(){try{return localStorage.getItem(Mf)}catch{return null}}function Nn(s){try{s?localStorage.setItem(Mf,s):localStorage.removeItem(Mf)}catch{}ha()}function gt(s){return{host:s.host,port:s.port,username:s.username,auth:s.auth}}async function rN(){return{format:"lg-dev-manager/devices",version:1,exportedAt:Date.now(),devices:await gm()}}async function aN(s){const n=Z2.safeParse(s);if(!n.success)throw new M0(W2(n.error,s));const l=n.data,o=await ir();return await new Promise((d,_)=>{const w=o.transaction(aa,"readwrite");for(const c of l.devices)w.objectStore(aa).put(c);w.oncomplete=()=>d(),w.onerror=()=>_(w.error)}),!$c()&&l.devices[0]&&Nn(l.devices[0].id),ha(),l.devices.length}async function lN(){await nr("readwrite",s=>s.clear()),await tN().catch(()=>{}),Nn(null)}function Mt(){const[s,n]=M.useState(null),l=M.useSyncExternalStore(My,$c,()=>null);M.useEffect(()=>{let d=!0;const _=()=>gm().then(c=>d&&n(c)).catch(()=>d&&n([]));_();const w=My(_);return()=>{d=!1,w()}},[]);const o=s?.find(d=>d.id===l)??null;return{devices:s,active:o,activeId:l,loading:s===null}}const oN=[[/^OLED\d{2,3}([A-Z])([0-9X])/,s=>`${s[1]}${s[2]}`],[/^\d{2,3}(QNED\d{2}|NANO\d{2})/,s=>s[1]],[/^\d{2,3}((?:U[A-Z]|S[KM])\d{2})/,s=>s[1]],[/^\d{2}ART10/,()=>"StanbyME"]];function _m(s){const n=s?.trim().toUpperCase();if(n)for(const[l,o]of oN){const d=n.match(l);if(d)return o(d)}}function xl(s){const n=_m(s);return n?`LG ${n}`:s?.trim()||void 0}function If(s){const n=s?.trim();if(!n)return;const l=_m(n);return l?`LG ${l} · ${n}`:n}function cN(){const s=Cl(),{devices:n,active:l}=Mt();return r.jsx(Ic,{label:"Choose TV",placement:"up-left",className:"device-switcher",menuClassName:"dd-menu--compact",trigger:({toggle:o,...d})=>r.jsxs("button",{type:"button",className:"workspace",title:"Choose TV","aria-label":l?`Active TV: ${l.name}. Choose TV`:"Choose TV",onClick:o,...d,children:[r.jsx("div",{className:"workspace-avatar",children:r.jsx(ce,{name:"tv"})}),r.jsxs("div",{className:"workspace-text",children:[r.jsx("div",{className:"workspace-name",children:l?.name??"No TV selected"}),r.jsx("div",{className:"workspace-role",children:l?`${xl(l.info?.modelName)??l.host} · ${l.mode==="rooted"?"rooted":"Dev Mode"}`:n?.length?"choose a TV":"add a TV to start"})]}),r.jsx(ce,{name:"updown",className:"workspace-chev",strokeWidth:1.8})]}),children:o=>r.jsxs(r.Fragment,{children:[!!n?.length&&r.jsx("div",{className:"dd-section-label",children:"Your TVs"}),n?.map(d=>r.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":d.id===l?.id,className:`dd-menu-item${d.id===l?.id?" is-active":""}`,onClick:()=>{Nn(d.id),o()},children:[r.jsx(ce,{name:"tv"}),r.jsxs("span",{className:"dd-menu-text",children:[r.jsx("span",{children:d.name}),r.jsx("span",{className:"dd-menu-sub mono",children:[xl(d.info?.modelName),d.host].filter(Boolean).join(" · ")})]}),d.id===l?.id&&r.jsx(ce,{name:"check",className:"dd-check",strokeWidth:2.4})]},d.id)),!!n?.length&&r.jsx("div",{className:"dd-divider"}),r.jsxs("button",{type:"button",role:"menuitem",className:"dd-menu-item",onClick:()=>(o(),s("/devices/new")),children:[r.jsx(ce,{name:"plus"})," Add a TV"]}),r.jsxs("button",{type:"button",role:"menuitem",className:"dd-menu-item",onClick:()=>(o(),s("/devices")),children:[r.jsx(ce,{name:"wrench"})," Manage devices"]})]})})}function uN({item:s,pathname:n}){const l=s.children.some(f=>n.startsWith(f.to)),[o,d]=M.useState(l),_=mm(D0),[w,c]=M.useState(null),h=M.useRef(null),y=_?!!w:o||l;M.useEffect(()=>c(null),[n,_]),M.useEffect(()=>{if(!w)return;const f=j=>!h.current?.contains(j.target)&&c(null),x=j=>j.key==="Escape"&&c(null),C=()=>c(null);return document.addEventListener("pointerdown",f),document.addEventListener("keydown",x),window.addEventListener("resize",C),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",x),window.removeEventListener("resize",C)}},[w]);const p=f=>{if(!_)return d(!y);if(w)return c(null);const x=f.currentTarget.getBoundingClientRect(),C=s.children.length*40+14;c({top:Math.max(8,Math.min(x.top,window.innerHeight-C-8)),left:x.right+10})};return r.jsxs("div",{ref:h,className:`nav-item-group${y?" is-open":""}`,children:[r.jsxs("button",{type:"button",className:`nav-link${_&&l?" is-active":""}`,"aria-expanded":y,"aria-label":_?s.text:void 0,title:_?s.text:void 0,onClick:p,children:[r.jsx(ce,{name:s.icon}),r.jsx("span",{children:s.text}),r.jsx(ce,{name:"chevRight",className:"chev",strokeWidth:1.8})]}),r.jsx("div",{className:"nav-submenu",style:_&&w?w:void 0,children:s.children.map(f=>r.jsx(im,{to:f.to,className:({isActive:x})=>x?"is-active":void 0,children:f.text},f.key))})]})}function hN({item:s,pathname:n}){const l=mm(D0);if(s.children)return r.jsx(uN,{item:s,pathname:n});const o=l?{title:s.text,"aria-label":s.text}:{},d=r.jsxs(r.Fragment,{children:[r.jsx(ce,{name:s.icon}),r.jsx("span",{children:s.text}),s.badge&&r.jsx("span",{className:`nav-badge ${s.badge.kind}`,children:s.badge.text})]});return s.href?r.jsx("a",{className:"nav-link",href:s.href,target:"_blank",rel:"noopener noreferrer",...o,children:d}):r.jsx(im,{to:s.to,className:({isActive:_})=>`nav-link${_?" is-active":""}`,...o,children:d})}function dN(){const{pathname:s}=_s();return r.jsxs("aside",{className:"d-sidebar",children:[r.jsxs(Jt,{to:"/",className:"brand",children:[r.jsx("div",{className:"brand-logo",children:r.jsx(ce,{name:"tv",strokeWidth:2})}),r.jsxs("div",{className:"brand-text",children:[r.jsx("div",{className:"brand-name",children:"LG Dev Manager"}),r.jsxs("div",{className:"brand-tag",children:["v",A0]})]})]}),r.jsx("div",{className:"sidebar-scroll",children:pm.map(n=>r.jsxs("nav",{className:"nav-section",children:[r.jsx("div",{className:"nav-label",children:n.label}),n.items.map(l=>r.jsx(hN,{item:l,pathname:s},l.key))]},n.label))}),r.jsx("div",{className:"sidebar-footer",children:r.jsx(cN,{})})]})}const fN="lgdm-theme";function I0(){return document.documentElement.getAttribute("data-theme")==="dark"?"dark":"light"}function mN(s){document.documentElement.setAttribute("data-theme",s);try{localStorage.setItem(fN,s)}catch{}}function H0(){const s=I0()==="dark"?"light":"dark";return mN(s),s}function pN(){const{status:s}=Pi(),n={unpaired:{cls:"",text:"Bridge not set up"},connecting:{cls:" is-connecting",text:"Connecting…"},connected:{cls:" is-connected",text:"Bridge connected"},error:{cls:" is-error",text:"Bridge offline"}},{cls:l,text:o}=n[s.state];return r.jsxs(Jt,{to:"/bridge",className:`bridge-pill${l}`,title:s.state==="error"?s.message:o,children:[r.jsx("span",{className:"dot","aria-hidden":"true"}),r.jsx("span",{children:o})]})}function gN({onOpenDrawer:s,onOpenPalette:n}){const{pathname:l}=_s(),o=q2(l),[d,_]=M.useState(I0),w=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);return r.jsxs("header",{className:"d-topbar",children:[r.jsxs("div",{className:"crumbs",children:[r.jsx("button",{className:"hamburger",onClick:s,"aria-label":"Open navigation",children:r.jsx(ce,{name:"menu",strokeWidth:2})}),o.map((c,h)=>r.jsxs(M.Fragment,{children:[h>0&&r.jsx(ce,{name:"chevRight",className:"sep",strokeWidth:2}),r.jsx("span",{className:h===o.length-1?"current":void 0,children:c})]},h))]}),r.jsxs("div",{className:"topbar-actions",children:[r.jsxs("button",{className:"cmd",onClick:n,children:[r.jsx(ce,{name:"search"}),r.jsx("span",{children:"Search..."}),r.jsx("kbd",{className:"kbd",children:w?"⌘K":"Ctrl K"})]}),r.jsx(pN,{}),r.jsx("button",{className:"icon-btn","aria-label":`Switch to ${d==="dark"?"light":"dark"} theme`,onClick:()=>_(H0()),children:r.jsx(ce,{name:d==="dark"?"sun":"moon",strokeWidth:1.8})})]})]})}function vN(){const{status:s}=Pi();return r.jsxs("footer",{className:"d-footer",children:[r.jsxs("div",{children:["Based on"," ",r.jsx("a",{href:"https://github.com/webosbrew/dev-manager-desktop",target:"_blank",rel:"noopener noreferrer",children:"webOS Dev Manager"})," ","· design by"," ",r.jsx("a",{href:"https://github.com/puikinsh/adminator-admin-dashboard",target:"_blank",rel:"noopener noreferrer",children:"Adminator"}),r.jsx("div",{className:"d-footer-note",children:"Not affiliated with or endorsed by LG Electronics. LG and webOS are trademarks of LG Electronics."})]}),r.jsxs("div",{className:"d-footer-meta",children:[r.jsxs("span",{children:["web v",A0]}),r.jsx("span",{children:s.state==="connected"?`bridge v${s.bridgeVersion}`:"no bridge"})]})]})}function _N(s,n){if(!n)return 1;const l=s.label.toLowerCase();return l===n?100:l.startsWith(n)?50:l.includes(n)?20:s.section.toLowerCase().includes(n)?5:0}function yN({open:s,onClose:n}){const l=Cl(),[o,d]=M.useState(""),[_,w]=M.useState(0),c=M.useRef(null),{devices:h,activeId:y}=Mt(),p=M.useMemo(()=>{const C=[];for(const j of pm)for(const E of j.items)if(E.children)for(const g of E.children)C.push({label:g.text,section:`${j.label} › ${E.text}`,icon:E.icon,run:()=>l(g.to)});else E.to?C.push({label:E.text,section:j.label,icon:E.icon,run:()=>l(E.to)}):E.href&&C.push({label:E.text,section:"External",icon:E.icon,run:()=>window.open(E.href,"_blank","noopener")});C.push({label:"Toggle theme (light / dark)",section:"Action",icon:"sun",run:()=>H0()}),C.push({label:"Add a TV",section:"Action",icon:"plus",run:()=>l("/devices/new")}),C.push({label:"Install an IPK",section:"Action",icon:"upload",run:()=>l("/apps/installed")});for(const j of h??[])j.id!==y&&C.push({label:`Switch to ${j.name}`,section:"TV",icon:"tv",run:()=>Nn(j.id)});return C},[l,h,y]),f=M.useMemo(()=>{const C=o.trim().toLowerCase();return p.map(j=>({item:j,s:_N(j,C)})).filter(j=>j.s>0).sort((j,E)=>E.s-j.s).slice(0,12).map(j=>j.item)},[p,o]);if(M.useEffect(()=>(document.body.classList.toggle("has-palette-open",s),s&&(d(""),w(0),requestAnimationFrame(()=>c.current?.focus())),()=>document.body.classList.remove("has-palette-open")),[s]),M.useEffect(()=>w(0),[o]),!s)return null;const x=C=>{C&&(n(),C.run())};return r.jsx("div",{className:"palette-backdrop",onMouseDown:C=>C.target===C.currentTarget&&n(),children:r.jsxs("div",{className:"palette-modal",role:"dialog","aria-modal":"true","aria-label":"Command palette",onKeyDown:C=>{C.key==="Escape"?n():C.key==="ArrowDown"?(C.preventDefault(),w(j=>Math.min(j+1,f.length-1))):C.key==="ArrowUp"?(C.preventDefault(),w(j=>Math.max(j-1,0))):C.key==="Enter"&&(C.preventDefault(),x(f[_]))},children:[r.jsxs("div",{className:"palette-input-row",children:[r.jsxs("svg",{viewBox:"0 0 24 24",className:"palette-icon","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:2,children:[r.jsx("circle",{cx:"11",cy:"11",r:"7"}),r.jsx("path",{d:"m21 21-4.3-4.3"})]}),r.jsx("input",{ref:c,className:"palette-input",type:"text",placeholder:"Search pages, actions…",autoComplete:"off",spellCheck:!1,value:o,onChange:C=>d(C.target.value),"aria-label":"Search"}),r.jsx("kbd",{className:"palette-esc",children:"esc"})]}),r.jsx("div",{className:"palette-results",role:"listbox",children:f.length===0?r.jsx("div",{className:"palette-empty",children:"No results"}):f.map((C,j)=>r.jsxs("div",{className:`palette-result${j===_?" is-selected":""}`,role:"option","aria-selected":j===_,onMouseEnter:()=>w(j),onClick:()=>x(C),children:[r.jsx("span",{className:"palette-result-icon",children:r.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,dangerouslySetInnerHTML:{__html:k0[C.icon]}})}),r.jsx("span",{className:"palette-result-label",children:C.label}),r.jsx("span",{className:"palette-result-section",children:C.section})]},`${C.section}/${C.label}`))}),r.jsxs("div",{className:"palette-foot",children:[r.jsxs("span",{children:[r.jsx("kbd",{children:"↑"}),r.jsx("kbd",{children:"↓"})," navigate"]}),r.jsxs("span",{children:[r.jsx("kbd",{children:"↵"})," select"]}),r.jsxs("span",{children:[r.jsx("kbd",{children:"esc"})," close"]})]})]})})}function ut(){const{client:s,status:n}=Pi(),l=n.state==="connected"&&!!s,o=M.useCallback((d,_,w)=>s?s.call(d,_,w):Promise.reject(new yt("disconnected","The bridge is not connected.")),[s]);return{ready:l,call:o,client:s}}function pc(s,n,l){return s.on(h2,o=>{const d=u2.safeParse(o);d.success&&d.data.opId===n&&l(d.data)})}const ea=()=>crypto.randomUUID(),Ld=1024*1024;function bN(s){return new Promise((n,l)=>{const o=new FileReader;o.onload=()=>{const d=String(o.result);n(d.slice(d.indexOf(",")+1))},o.onerror=()=>l(o.error??new Error("Could not read the file.")),o.readAsDataURL(s)})}async function U0(s,n,l,o){const{uploadId:d}=await s.call("upload.begin",{name:n.name,size:n.size});try{for(let _=0;_<n.size;_+=Ld){if(o?.aborted)throw new yt("cancelled","Cancelled.");const w=await bN(n.slice(_,_+Ld));await s.call("upload.chunk",{uploadId:d,offset:_,data:w},6e4),l?.(Math.min(n.size,_+Ld),n.size)}return d}catch(_){throw s.call("upload.discard",{uploadId:d}).catch(()=>{}),_}}function xt(s){return s instanceof yt?{code:s.code,message:s.message,detail:s.detail}:s instanceof Error?{code:"error",message:s.message}:{code:"error",message:String(s)}}function Nt({error:s,title:n,hint:l,action:o}){const{code:d,message:_,detail:w}=xt(s);return r.jsxs($e,{kind:"danger",title:n,action:o,children:[r.jsx("div",{children:_}),l&&r.jsx("div",{className:"alert-hint",children:l}),r.jsxs("details",{className:"error-details",children:[r.jsx("summary",{children:"Technical details"}),r.jsx("pre",{children:[`code: ${d}`,w].filter(Boolean).join(`
|
|
11
|
+
Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let p=_s(),f;if(n){let g=typeof n=="string"?sr(n):n;bt(h==="/"||g.pathname?.startsWith(h),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${g.pathname}" was given in the \`location\` prop.`),f=g}else f=p;let x=f.pathname||"/",C=x;if(h!=="/"){let g=h.replace(/^\//,"").split("/");C="/"+x.replace(/^\//,"").split("/").slice(g.length).join("/")}let j=l&&l.state.matches.length?l.state.matches.map(g=>Object.assign(g,{route:l.manifest[g.route.id]||g.route})):Pb(s,{pathname:C});qs(y||j!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),qs(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=nC(j&&j.map(g=>Object.assign({},g,{params:Object.assign({},w,g.params),pathname:ti([h,o.encodeLocation?o.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?h:ti([h,o.encodeLocation?o.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),d,l);return n&&E?M.createElement(wl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},E):E}function eC(){let s=cC(),n=Bw(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.stack:null,o="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:o},_={padding:"2px 4px",backgroundColor:o},w=null;return console.error("Error handled by React Router default ErrorBoundary:",s),w=M.createElement(M.Fragment,null,M.createElement("p",null,"💿 Hey developer 👋"),M.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",M.createElement("code",{style:_},"ErrorBoundary")," or"," ",M.createElement("code",{style:_},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},n),l?M.createElement("pre",{style:d},l):null,w)}var tC=M.createElement(eC,null),i0=class extends M.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,n){return n.location!==s.location||n.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:n.error,location:n.location,revalidation:s.revalidation||n.revalidation}}componentDidCatch(s,n){this.props.onError?this.props.onError(s,n):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const l=Yw(s.digest);l&&(s=l)}let n=s!==void 0?M.createElement(ni.Provider,{value:this.props.routeContext},M.createElement(Wf.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?M.createElement(sC,{error:s},n):n}};i0.contextType=Wb;var jd=new WeakMap;function sC({children:s,error:n}){let{basename:l,navigator:o}=M.useContext(Os);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let d=Gw(n.digest);if(d){let _=jd.get(n);if(_)throw _;let w=Zb(d.location,l),c=w.absoluteURL||w.to;if(Xf(d.location,c,Zf(o),"allow-explicit"),$w(c))throw new Error("Invalid redirect location");if(Yb&&!jd.get(n))if(w.isExternal||d.reloadDocument)window.location.href=c;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(w.to,{replace:d.replace}));throw jd.set(n,h),h}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c}`})}}return s}function iC({routeContext:s,match:n,children:l}){let o=M.useContext(oa);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),M.createElement(ni.Provider,{value:s},l)}function nC(s,n=[],l){let o=l?.state;if(s==null){if(!o)return null;if(o.errors)s=o.matches;else if(n.length===0&&!o.initialized&&o.matches.length>0)s=o.matches;else return null}let d=s,_=o?.errors;if(_!=null){let p=d.findIndex(f=>f.route.id&&_?.[f.route.id]!==void 0);bt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(_).join(",")}`),d=d.slice(0,Math.min(d.length,p+1))}let w=!1,c=-1;if(l&&o){w=o.renderFallback;for(let p=0;p<d.length;p++){let f=d[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=p),f.route.id){let{loaderData:x,errors:C}=o,j=f.route.loader&&!x.hasOwnProperty(f.route.id)&&(!C||C[f.route.id]===void 0);if(f.route.lazy||j){l.isStatic&&(w=!0),c>=0?d=d.slice(0,c+1):d=[d[0]];break}}}}let h=l?.onError,y=o&&h?(p,f)=>{h(p,{location:o.location,params:o.matches?.[0]?.params??{},pattern:Iw(o.matches),errorInfo:f})}:void 0;return d.reduceRight((p,f,x)=>{let C,j=!1,E=null,g=null;o&&(C=_&&f.route.id?_[f.route.id]:void 0,E=f.route.errorElement||tC,w&&(c<0&&x===0?(n0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,g=null):c===x&&(j=!0,g=f.route.hydrateFallbackElement||null)));let b=n.concat(d.slice(0,x+1)),v=()=>{let S;return C?S=E:j?S=g:f.route.Component?S=M.createElement(f.route.Component,null):f.route.element?S=f.route.element:S=p,M.createElement(iC,{match:f,routeContext:{outlet:p,matches:b,isDataRoute:o!=null},children:S})};return o&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?M.createElement(i0,{location:o.location,revalidation:o.revalidation,component:E,error:C,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0},onError:y}):v()},null)}function Qf(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rC(s){let n=M.useContext(oa);return bt(n,Qf(s)),n}function aC(s){let n=M.useContext(Lc);return bt(n,Qf(s)),n}function lC(s){let n=M.useContext(ni);return bt(n,Qf(s)),n}function Jf(s){let n=lC(s),l=n.matches[n.matches.length-1];return bt(l.route.id,`${s} can only be used on routes that contain a unique "id"`),l.route.id}function oC(){return Jf("useRouteId")}function cC(){let s=M.useContext(Wf),n=aC("useRouteError"),l=Jf("useRouteError");return s!==void 0?s:n.errors?.[l]}function uC(){let{router:s}=rC("useNavigate"),n=Jf("useNavigate"),l=M.useRef(!1);return t0(()=>{l.current=!0}),M.useCallback(async(d,_={})=>{qs(l.current,e0),l.current&&(typeof d=="number"?await s.navigate(d):await s.navigate(d,{fromRouteId:n,..._}))},[s,n])}var oy={};function n0(s,n,l){!n&&!oy[s]&&(oy[s]=!0,qs(!1,l))}M.memo(hC);function hC({routes:s,manifest:n,future:l,state:o,isStatic:d,onError:_}){return s0(s,void 0,{manifest:n,state:o,isStatic:d,onError:_})}function dc({to:s,replace:n,state:l,relative:o}){bt(ca(),"<Navigate> may be used only in the context of a <Router> component.");let{static:d,navigator:_}=M.useContext(Os);qs(!d,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:w}=M.useContext(ni),{pathname:c}=_s(),h=Cl(),y=Oc(s,Yf(w),c,o==="path");Xf(typeof s=="string"?s:Wn(s),_.createHref(y),Zf(_),"reject");let p=JSON.stringify(y);return M.useEffect(()=>{h(JSON.parse(p),{replace:n,state:l,relative:o})},[h,p,o,n,l]),null}function dC(s){return Qw(s.context)}function Ot(s){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function fC({basename:s="/",children:n=null,location:l,navigationType:o="POP",navigator:d,static:_=!1,useTransitions:w}){bt(!ca(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=s.replace(/^\/*/,"/"),h=M.useMemo(()=>({basename:c,navigator:d,static:_,useTransitions:w,future:{}}),[c,d,_,w]);typeof l=="string"&&(l=sr(l));let{pathname:y="/",search:p="",hash:f="",state:x=null,key:C="default",mask:j}=l,E=M.useMemo(()=>{let g=Ui(y,c);return g==null?null:{location:{pathname:g,search:p,hash:f,state:x,key:C,mask:j},navigationType:o}},[c,y,p,f,x,C,o,j]);return qs(E!=null,`<Router basename="${c}"> is not able to match the URL "${y}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:M.createElement(Os.Provider,{value:h},M.createElement(wl.Provider,{children:n,value:E}))}function mC({children:s,location:n}){return Jw(pf(s),n)}function pf(s,n=[]){let l=[];return M.Children.forEach(s,(o,d)=>{if(!M.isValidElement(o))return;let _=[...n,d];if(o.type===M.Fragment){l.push.apply(l,pf(o.props.children,_));return}bt(o.type===Ot,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let w={id:o.props.id||_.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(w.children=pf(o.props.children,_)),l.push(w)}),l}var fc="get",mc="application/x-www-form-urlencoded";function Mc(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function pC(s){return Mc(s)&&s.tagName.toLowerCase()==="button"}function gC(s){return Mc(s)&&s.tagName.toLowerCase()==="form"}function vC(s){return Mc(s)&&s.tagName.toLowerCase()==="input"}function _C(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function yC(s,n){return s.button===0&&(!n||n==="_self")&&!_C(s)}var ic=null;function bC(){if(ic===null)try{new FormData(document.createElement("form"),0),ic=!1}catch{ic=!0}return ic}var SC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Td(s){return s!=null&&!SC.has(s)?(qs(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mc}"`),null):s}function xC(s,n){let l,o,d,_,w;if(gC(s)){let c=s.getAttribute("action");o=c?Ui(c,n):null,l=s.getAttribute("method")||fc,d=Td(s.getAttribute("enctype"))||mc,_=new FormData(s)}else if(pC(s)||vC(s)&&(s.type==="submit"||s.type==="image")){let c=s.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=s.getAttribute("formaction")||c.getAttribute("action");if(o=h?Ui(h,n):null,l=s.getAttribute("formmethod")||c.getAttribute("method")||fc,d=Td(s.getAttribute("formenctype"))||Td(c.getAttribute("enctype"))||mc,_=new FormData(c,s),!bC()){let{name:y,type:p,value:f}=s;if(p==="image"){let x=y?`${y}.`:"";_.append(`${x}x`,"0"),_.append(`${x}y`,"0")}else y&&_.append(y,f)}}else{if(Mc(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=fc,o=null,d=mc,w=s}return _&&d==="text/plain"&&(w=_,_=void 0),{action:o,method:l.toLowerCase(),encType:d,formData:_,body:w}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function em(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function r0(s,n,l,o){let d=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return l?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${o}`:d.pathname=`${d.pathname}.${o}`:d.pathname==="/"?d.pathname=`_root.${o}`:n&&Ui(d.pathname,n)==="/"?d.pathname=`${ta(n)}/_root.${o}`:d.pathname=`${ta(d.pathname)}.${o}`,d}async function wC(s,n){if(s.id in n)return n[s.id];try{let l=await import(s.module);return n[s.id]=l,l}catch(l){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function CC(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function EC(s,n,l){let o=await Promise.all(s.map(async d=>{let _=n.routes[d.route.id];if(_){let w=await wC(_,l);return w.links?w.links():[]}return[]}));return kC(o.flat(1).filter(CC).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function cy(s,n,l,o,d,_){let w=(h,y)=>l[y]?h.route.id!==l[y].route.id:!0,c=(h,y)=>l[y].pathname!==h.pathname||l[y].route.path?.endsWith("*")&&l[y].params["*"]!==h.params["*"];return _==="assets"?n.filter((h,y)=>w(h,y)||c(h,y)):_==="data"?n.filter((h,y)=>{let p=o.routes[h.route.id];if(!p||!p.hasLoader)return!1;if(w(h,y)||c(h,y))return!0;if(h.route.shouldRevalidate){let f=h.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:l[0]?.params||{},nextUrl:new URL(s,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function NC(s,n,{includeHydrateFallback:l}={}){return jC(s.map(o=>{let d=n.routes[o.route.id];if(!d)return[];let _=[d.module];return d.clientActionModule&&(_=_.concat(d.clientActionModule)),d.clientLoaderModule&&(_=_.concat(d.clientLoaderModule)),l&&d.hydrateFallbackModule&&(_=_.concat(d.hydrateFallbackModule)),d.imports&&(_=_.concat(d.imports)),_}).flat(1))}function jC(s){return[...new Set(s)]}function TC(s){let n={},l=Object.keys(s).sort();for(let o of l)n[o]=s[o];return n}function kC(s,n){let l=new Set;return new Set(n),s.reduce((o,d)=>{let _=JSON.stringify(TC(d));return l.has(_)||(l.add(_),o.push({key:_,link:d})),o},[])}function tm(){let s=M.useContext(oa);return em(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function RC(){let s=M.useContext(Lc);return em(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var sm=M.createContext(void 0);sm.displayName="FrameworkContext";function Bc(){let s=M.useContext(sm);return em(s,"You must render this element inside a <HydratedRouter> element"),s}function DC(s,n){let l=M.useContext(sm),[o,d]=M.useState(!1),[_,w]=M.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:y,onMouseLeave:p,onTouchStart:f}=n,x=M.useRef(null);M.useEffect(()=>{if(s==="render"&&w(!0),s==="viewport"){let E=b=>{b.forEach(v=>{w(v.isIntersecting)})},g=new IntersectionObserver(E,{threshold:.5});return x.current&&g.observe(x.current),()=>{g.disconnect()}}},[s]),M.useEffect(()=>{if(o){let E=setTimeout(()=>{w(!0)},100);return()=>{clearTimeout(E)}}},[o]);let C=()=>{d(!0)},j=()=>{d(!1),w(!1)};return l?s!=="intent"?[_,x,{}]:[_,x,{onFocus:cl(c,C),onBlur:cl(h,j),onMouseEnter:cl(y,C),onMouseLeave:cl(p,j),onTouchStart:cl(f,C)}]:[!1,x,{}]}function cl(s,n){return l=>{s&&s(l),l.defaultPrevented||n(l)}}function AC({page:s,...n}){let l=Pw(),{nonce:o}=Bc(),{router:d}=tm(),_=M.useMemo(()=>Pb(d.routes,s,d.basename),[d.routes,s,d.basename]);return _?(n.nonce==null&&o&&(n={...n,nonce:o}),l?M.createElement(LC,{page:s,matches:_,...n}):M.createElement(MC,{page:s,matches:_,...n})):null}function OC(s){let{manifest:n,routeModules:l}=Bc(),[o,d]=M.useState([]);return M.useEffect(()=>{let _=!1;return EC(s,n,l).then(w=>{_||d(w)}),()=>{_=!0}},[s,n,l]),o}function LC({page:s,matches:n,...l}){let o=_s(),{future:d}=Bc(),{basename:_}=tm(),w=M.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let c=r0(s,_,d.v8_trailingSlashAwareDataRequests,"rsc"),h=!1,y=[];for(let p of n)typeof p.route.shouldRevalidate=="function"?h=!0:y.push(p.route.id);return h&&y.length>0&&c.searchParams.set("_routes",y.join(",")),[c.pathname+c.search]},[_,d.v8_trailingSlashAwareDataRequests,s,o,n]);return M.createElement(M.Fragment,null,w.map(c=>M.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...l})))}function MC({page:s,matches:n,...l}){let o=_s(),{future:d,manifest:_,routeModules:w}=Bc(),{basename:c}=tm(),{loaderData:h,matches:y}=RC(),p=M.useMemo(()=>cy(s,n,y,_,o,"data"),[s,n,y,_,o]),f=M.useMemo(()=>cy(s,n,y,_,o,"assets"),[s,n,y,_,o]),x=M.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let E=new Set,g=!1;if(n.forEach(v=>{let S=_.routes[v.route.id];!S||!S.hasLoader||(!p.some(N=>N.route.id===v.route.id)&&v.route.id in h&&w[v.route.id]?.shouldRevalidate||S.hasClientLoader?g=!0:E.add(v.route.id))}),E.size===0)return[];let b=r0(s,c,d.v8_trailingSlashAwareDataRequests,"data");return g&&E.size>0&&b.searchParams.set("_routes",n.filter(v=>E.has(v.route.id)).map(v=>v.route.id).join(",")),[b.pathname+b.search]},[c,d.v8_trailingSlashAwareDataRequests,h,o,_,p,n,s,w]),C=M.useMemo(()=>NC(f,_),[f,_]),j=OC(f);return M.createElement(M.Fragment,null,x.map(E=>M.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...l})),C.map(E=>M.createElement("link",{key:E,rel:"modulepreload",href:E,...l})),j.map(({key:E,link:g})=>M.createElement("link",{key:E,nonce:l.nonce,...g,crossOrigin:g.crossOrigin??l.crossOrigin})))}function BC(...s){return n=>{s.forEach(l=>{typeof l=="function"?l(n):l!=null&&(l.current=n)})}}var IC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{IC&&(window.__reactRouterVersion="7.18.4")}catch{}function HC({basename:s,children:n,useTransitions:l,window:o}){let d=M.useRef();d.current==null&&(d.current=fw({window:o,v5Compat:!0}));let _=d.current,[w,c]=M.useState({action:_.action,location:_.location}),h=M.useCallback(y=>{l===!1?c(y):M.startTransition(()=>c(y))},[l]);return M.useLayoutEffect(()=>_.listen(h),[_,h]),M.createElement(fC,{basename:s,children:n,location:w.location,navigationType:w.action,navigator:_,useTransitions:l})}var Jt=M.forwardRef(function({onClick:n,discover:l="render",prefetch:o="none",relative:d,reloadDocument:_,replace:w,mask:c,state:h,target:y,to:p,preventScrollReset:f,viewTransition:x,defaultShouldRevalidate:C,...j},E){let{basename:g,navigator:b,useTransitions:v}=M.useContext(Os),S=typeof p=="string"&&Gf.test(p),N=Zb(p,g);p=N.to;let T=Zw(p,{relative:d}),D=_s(),O=null;if(c){let he=Oc(c,[],D.mask?D.mask.pathname:"/",!0);g!=="/"&&(he.pathname=he.pathname==="/"?g:ti([g,he.pathname])),O=b.createHref(he)}let[k,L,V]=DC(o,j),q=$C(p,{replace:w,mask:c,state:h,target:y,preventScrollReset:f,relative:d,viewTransition:x,defaultShouldRevalidate:C,useTransitions:v});function Y(he){n&&n(he),he.defaultPrevented||q(he)}let P=!(N.isExternal||_),Q=M.createElement("a",{...j,...V,href:(P?O:void 0)||N.absoluteURL||T,onClick:P?Y:n,ref:BC(E,L),target:y,"data-discover":!S&&l==="render"?"true":void 0});return k&&!S?M.createElement(M.Fragment,null,Q,M.createElement(AC,{page:T})):Q});Jt.displayName="Link";var im=M.forwardRef(function({"aria-current":n="page",caseSensitive:l=!1,className:o="",end:d=!1,style:_,to:w,viewTransition:c,children:h,...y},p){let f=El(w,{relative:y.relative}),x=_s(),C=M.useContext(Lc),{navigator:j,basename:E}=M.useContext(Os),g=C!=null&&KC(f)&&c===!0,b=j.encodeLocation?j.encodeLocation(f).pathname:f.pathname,v=x.pathname,S=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;l||(v=v.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&E&&(S=Ui(S,E)||S);const N=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let T=v===b||!d&&v.startsWith(b)&&v.charAt(N)==="/",D=S!=null&&(S===b||!d&&S.startsWith(b)&&S.charAt(b.length)==="/"),O={isActive:T,isPending:D,isTransitioning:g},k=T?n:void 0,L;typeof o=="function"?L=o(O):L=[o,T?"active":null,D?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let V=typeof _=="function"?_(O):_;return M.createElement(Jt,{...y,"aria-current":k,className:L,ref:p,style:V,to:w,viewTransition:c},typeof h=="function"?h(O):h)});im.displayName="NavLink";var UC=M.forwardRef(({discover:s="render",fetcherKey:n,navigate:l,reloadDocument:o,replace:d,state:_,method:w=fc,action:c,onSubmit:h,relative:y,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:x,...C},j)=>{let{useTransitions:E}=M.useContext(Os),g=VC(),b=qC(c,{relative:y}),v=w.toLowerCase()==="get"?"get":"post",S=typeof c=="string"&&Gf.test(c),N=T=>{if(h&&h(T),T.defaultPrevented)return;T.preventDefault();let D=T.nativeEvent.submitter,O=D?.getAttribute("formmethod")||w,k=()=>g(D||T.currentTarget,{fetcherKey:n,method:O,navigate:l,replace:d,state:_,relative:y,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:x});E&&l!==!1?M.startTransition(()=>k()):k()};return M.createElement("form",{ref:j,method:v,action:b,onSubmit:o?h:N,...C,"data-discover":!S&&s==="render"?"true":void 0})});UC.displayName="Form";function zC(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a0(s){let n=M.useContext(oa);return bt(n,zC(s)),n}function $C(s,{target:n,replace:l,mask:o,state:d,preventScrollReset:_,relative:w,viewTransition:c,defaultShouldRevalidate:h,useTransitions:y}={}){let p=Cl(),f=_s(),x=El(s,{relative:w});return M.useCallback(C=>{if(yC(C,n)){C.preventDefault();let j=l!==void 0?l:Wn(f)===Wn(x),E=()=>p(s,{replace:j,mask:o,state:d,preventScrollReset:_,relative:w,viewTransition:c,defaultShouldRevalidate:h});y?M.startTransition(()=>E()):E()}},[f,p,x,l,o,d,n,s,_,w,c,h,y])}var PC=0,FC=()=>`__${String(++PC)}__`;function VC(){let{router:s}=a0("useSubmit"),{basename:n}=M.useContext(Os),l=oC(),o=s.fetch,d=s.navigate;return M.useCallback(async(_,w={})=>{let{action:c,method:h,encType:y,formData:p,body:f}=xC(_,n);if(w.navigate===!1){let x=w.fetcherKey||FC();await o(x,l,w.action||c,{defaultShouldRevalidate:w.defaultShouldRevalidate,preventScrollReset:w.preventScrollReset,formData:p,body:f,formMethod:w.method||h,formEncType:w.encType||y,flushSync:w.flushSync})}else await d(w.action||c,{defaultShouldRevalidate:w.defaultShouldRevalidate,preventScrollReset:w.preventScrollReset,formData:p,body:f,formMethod:w.method||h,formEncType:w.encType||y,replace:w.replace,state:w.state,fromRouteId:l,flushSync:w.flushSync,viewTransition:w.viewTransition})},[o,d,n,l])}function qC(s,{relative:n}={}){let{basename:l}=M.useContext(Os),o=M.useContext(ni);bt(o,"useFormAction must be used inside a RouteContext");let[d]=o.matches.slice(-1),_={...El(s||".",{relative:n})},w=_s();if(s==null){_.search=w.search;let c=new URLSearchParams(_.search),h=c.getAll("index");if(h.some(p=>p==="")){c.delete("index"),h.filter(f=>f).forEach(f=>c.append("index",f));let p=c.toString();_.search=p?`?${p}`:""}}return(!s||s===".")&&d.route.index&&(_.search=_.search?_.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(_.pathname=_.pathname==="/"?l:ti([l,_.pathname])),Wn(_)}function KC(s,{relative:n}={}){let l=M.useContext(Qb);bt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=a0("useViewTransitionState"),d=El(s,{relative:n});if(!l.isTransitioning)return!1;let _=Ui(l.currentLocation.pathname,o)||l.currentLocation.pathname,w=Ui(l.nextLocation.pathname,o)||l.nextLocation.pathname;return gc(d.pathname,w)!=null||gc(d.pathname,_)!=null}var GC=zb();const l0=M.createContext(void 0),En=s=>{const n=M.useContext(l0);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},YC=({client:s,children:n})=>(M.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),r.jsx(l0.Provider,{value:s,children:n})),ZC={setTimeout:(s,n)=>setTimeout(s,n),clearTimeout:s=>clearTimeout(s),setInterval:(s,n)=>setInterval(s,n),clearInterval:s=>clearInterval(s)};var XC=class{#e=ZC;#t=!1;setTimeoutProvider(s){this.#e=s}setTimeout(s,n){return this.#e.setTimeout(s,n)}clearTimeout(s){this.#e.clearTimeout(s)}setInterval(s,n){return this.#e.setInterval(s,n)}clearInterval(s){this.#e.clearInterval(s)}};const Xn=new XC;function WC(s){setTimeout(s,0)}const QC=typeof window>"u"||"Deno"in globalThis;function gs(){}function JC(s,n){return typeof s=="function"?s(n):s}function o0(s){return typeof s=="number"&&s>=0&&s!==1/0}function c0(s,n){return Math.max(s+(n||0)-Date.now(),0)}function _t(s,n){return typeof s=="function"?s(n):s}function uy(s,n){const{type:l="all",exact:o,fetchStatus:d,predicate:_,queryKey:w,stale:c}=s;if(w){if(o){if(n.queryHash!==nm(w,n.options))return!1}else if(!sa(n.queryKey,w))return!1}if(l!=="all"){const h=n.isActive();if(l==="active"&&!h||l==="inactive"&&h)return!1}return!(typeof c=="boolean"&&n.isStale()!==c||d&&d!==n.state.fetchStatus||_&&!_(n))}function hy(s,n){const{exact:l,status:o,predicate:d,mutationKey:_}=s;if(_){if(!n.options.mutationKey)return!1;if(l){if(pl(n.options.mutationKey)!==pl(_))return!1}else if(!sa(n.options.mutationKey,_))return!1}return!(o&&n.state.status!==o||d&&!d(n))}function nm(s,n){return(n?.queryKeyHashFn||pl)(s)}function pl(s){return JSON.stringify(s,(n,l)=>gf(l)?Object.keys(l).sort().reduce((o,d)=>(o[d]=l[d],o),{}):l)}function sa(s,n){if(s===n)return!0;if(typeof s!=typeof n)return!1;if(s&&n&&typeof s=="object"&&typeof n=="object"){if(Array.isArray(s)&&Array.isArray(n)){if(n.length>s.length)return!1;for(let o=0;o<n.length;o++)if(!sa(s[o],n[o]))return!1;return!0}const l=Object.keys(n);for(const o of l)if(!sa(s[o],n[o]))return!1;return!0}return!1}const eE=Object.prototype.hasOwnProperty;function u0(s,n,l=0){if(s===n)return s;if(l>500)return n;const o=dy(s)&&dy(n);if(!o&&!(gf(s)&&gf(n)))return n;const d=(o?s:Object.keys(s)).length,_=o?n:Object.keys(n),w=_.length,c=o?new Array(w):{};let h=0;for(let y=0;y<w;y++){const p=o?y:_[y],f=s[p],x=n[p];if(f===x){c[p]=f,(o?y<d:eE.call(s,p))&&h++;continue}if(f===null||x===null||typeof f!="object"||typeof x!="object"){c[p]=x;continue}const C=u0(f,x,l+1);c[p]=C,C===f&&h++}return d===w&&h===d?s:c}function kd(s,n){if(!n||Object.keys(s).length!==Object.keys(n).length)return!1;for(const l in s)if(s[l]!==n[l])return!1;return!0}function dy(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function gf(s){if(!fy(s))return!1;const n=Object.getPrototypeOf(s),l=n?.constructor;if(l===void 0)return!0;if(typeof l!="function")return!1;const o=l.prototype;return!(!fy(o)||!o.hasOwnProperty("isPrototypeOf")||n!==Object.prototype)}function fy(s){return Object.prototype.toString.call(s)==="[object Object]"}function tE(s){return new Promise(n=>{Xn.setTimeout(n,s)})}function vf(s,n,l){return typeof l.structuralSharing=="function"?l.structuralSharing(s,n):l.structuralSharing!==!1?u0(s,n):n}function sE(s,n,l=0){const o=[...s,n];return l&&o.length>l?o.slice(1):o}function iE(s,n,l=0){const o=[n,...s];return l&&o.length>l?o.slice(0,-1):o}const rm=Symbol();function h0(s,n){return!s.queryFn&&n?.initialPromise?()=>n.initialPromise:!s.queryFn||s.queryFn===rm?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function d0(s,n){return typeof s=="function"?s(...n):!!s}function nE(s,n,l){let o=!1,d;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(d??=n(),o||(o=!0,d.aborted?l():d.addEventListener("abort",l,{once:!0})),d)}),s}let rE=()=>QC;const am=()=>rE();var Nl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},aE=class extends Nl{#e;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const n=()=>s();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(s){this.#e!==s&&(this.#e=s,this.onFocus())}onFocus(){const s=this.isFocused();this.listeners.forEach(n=>{n(s)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const lm=new aE,lE=WC;function oE(){let s=[],n=0,l=c=>{c()},o=c=>{c()},d=lE;const _=c=>{n?s.push(c):d(()=>{l(c)})},w=()=>{const c=s;s=[],c.length&&d(()=>{o(()=>{c.forEach(h=>{l(h)})})})};return{batch:c=>{let h;n++;try{h=c()}finally{n--,n||w()}return h},batchCalls:c=>(...h)=>{_(()=>{c(...h)})},schedule:_,setNotifyFunction:c=>{l=c},setBatchNotifyFunction:c=>{o=c},setScheduler:c=>{d=c}}}const Qt=oE();var cE=class extends Nl{#e=!0;#t;#s;constructor(){super(),this.#s=s=>{if(typeof window<"u"&&window.addEventListener){const n=()=>s(!0),l=()=>s(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",l,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",l)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(s){this.#s=s,this.#t?.(),this.#t=s(this.setOnline.bind(this))}setOnline(s){this.#e!==s&&(this.#e=s,this.listeners.forEach(n=>{n(s)}))}isOnline(){return this.#e}};const vc=new cE;function uE(s){return Math.min(1e3*2**s,3e4)}function f0(s){return(s??"online")==="online"?vc.isOnline():!0}var _f=class extends Error{constructor(s){super("CancelledError"),this.revert=s?.revert,this.silent=s?.silent}};function m0(s){let n=!1,l=0,o,d="pending",_,w;const c=new Promise((v,S)=>{_=v,w=S});c.catch(gs);const h=()=>d!=="pending",y=v=>{if(!h()){const S=new _f(v);E(S),s.onCancel?.(S)}},p=()=>{n=!0},f=()=>{n=!1},x=()=>lm.isFocused()&&(s.networkMode==="always"||vc.isOnline())&&s.canRun(),C=()=>f0(s.networkMode)&&s.canRun(),j=v=>{h()||(o?.(),d="resolved",_(v))},E=v=>{h()||(o?.(),d="rejected",w(v))},g=()=>new Promise(v=>{o=S=>{(h()||x())&&v(S)},s.onPause?.()}).then(()=>{o=void 0,h()||s.onContinue?.()}),b=()=>{if(h())return;let v;const S=l===0?s.initialPromise:void 0;try{v=S??s.fn()}catch(N){v=Promise.reject(N)}Promise.resolve(v).then(j).catch(N=>{if(h())return;const T=s.retry??(am()?0:3),D=s.retryDelay??uE,O=typeof D=="function"?D(l,N):D,k=T===!0||typeof T=="number"&&l<T||typeof T=="function"&&T(l,N);if(n||!k){E(N);return}l++,s.onFail?.(l,N),tE(O).then(()=>x()?void 0:g()).then(()=>{n?E(N):b()})})};return{promise:c,status:()=>d,cancel:y,continue:()=>(o?.(),c),cancelRetry:p,continueRetry:f,canStart:C,start:()=>(C()?b():g().then(b),c)}}var p0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),o0(this.gcTime)&&(this.#e=Xn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(am()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Xn.clearTimeout(this.#e),this.#e=void 0)}};function hE(s){return{onFetch:(n,l)=>{const o=n.options,d=n.fetchOptions?.meta?.fetchMore?.direction,_=n.state.data?.pages||[],w=n.state.data?.pageParams||[];let c={pages:[],pageParams:[]},h=0;const y=async()=>{let p=!1;const f=j=>{nE(j,()=>n.signal,()=>p=!0)},x=h0(n.options,n.fetchOptions),C=async(j,E,g)=>{if(p)return Promise.reject(n.signal.reason);if(E==null&&j.pages.length)return Promise.resolve(j);const v=(()=>{const D={client:n.client,queryKey:n.queryKey,pageParam:E,direction:g?"backward":"forward",meta:n.options.meta};return f(D),D})(),S=await x(v),{maxPages:N}=n.options,T=g?iE:sE;return{pages:T(j.pages,S,N),pageParams:T(j.pageParams,E,N)}};if(d&&_.length){const j=d==="backward",E=j?dE:my,g={pages:_,pageParams:w};c=await C(g,E(o,g),j)}else{const j=s??_.length;do{const E=h===0?w[0]??o.initialPageParam:my(o,c);if(h>0&&E==null)break;c=await C(c,E),h++}while(h<j)}return c};n.options.persister?n.fetchFn=()=>n.options.persister?.(y,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},l):n.fetchFn=y}}}function my(s,{pages:n,pageParams:l}){const o=n.length-1;return n.length>0?s.getNextPageParam(n[o],n,l[o],l):void 0}function dE(s,{pages:n,pageParams:l}){return n.length>0?s.getPreviousPageParam?.(n[0],n,l[0],l):void 0}var fE=class extends p0{#e;#t;#s;#i;#r;#n;#a;#o;constructor(s){super(),this.#o=!1,this.#a=s.defaultOptions,this.setOptions(s.options),this.observers=[],this.#r=s.client,this.#i=this.#r.getQueryCache(),this.queryKey=s.queryKey,this.queryHash=s.queryHash,this.#t=gy(this.options),this.state=s.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#n?.promise}setOptions(s){if(this.options={...this.#a,...s},s?._type&&(this.#e=s._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=gy(this.options);n.data!==void 0&&(this.setState(py(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(s,n){const l=vf(this.state.data,s,this.options);return this.#l({data:l,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),l}setState(s){this.#l({type:"setState",state:s})}cancel(s){const n=this.#n?.promise;return this.#n?.cancel(s),n?n.then(gs).catch(gs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(s=>_t(s.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(s=>_t(s.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(s=>s.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(s=0){return this.state.data===void 0?!0:s==="static"?!1:this.state.isInvalidated?!0:!c0(this.state.dataUpdatedAt,s)}onFocus(){this.observers.find(s=>s.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(s=>s.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(s){this.observers.includes(s)||(this.observers.push(s),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:s}))}removeObserver(s){const n=this.observers.indexOf(s);n!==-1&&(this.observers.splice(n,1),this.observers.length||(this.#n&&(this.#o||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:s}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(s,n){if(this.state.fetchStatus!=="idle"&&this.#n?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(s&&this.setOptions(s),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const l=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,l.signal)})},d=()=>{const h=h0(this.options,n),p=(()=>{const f={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(f),f})();return this.#o=!1,this.options.persister?this.options.persister(h,p,this):h(p)},w=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:d};return o(h),h})();(this.#e==="infinite"?hE(this.options.pages):this.options.behavior)?.onFetch(w,this),this.#s=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==w.fetchOptions?.meta)&&this.#l({type:"fetch",meta:w.fetchOptions?.meta});const c=this.#n=m0({initialPromise:n?.initialPromise,fn:w.fetchFn,onCancel:h=>{h instanceof _f&&h.revert&&this.setState({...this.#s,fetchStatus:"idle"}),l.abort()},onFail:(h,y)=>{this.#l({type:"failed",failureCount:h,error:y})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:w.options.retry,retryDelay:w.options.retryDelay,networkMode:w.options.networkMode,canRun:()=>!0});try{const h=await c.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#i.config.onSuccess?.(h,this),this.#i.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof _f){if(h.silent)return this.#n.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#i.config.onError?.(h,this),this.#i.config.onSettled?.(this.state.data,h,this),h}finally{this.#n===c&&(this.#n=void 0),this.scheduleGc()}}#l(s){const n=l=>{switch(s.type){case"failed":return{...l,fetchFailureCount:s.failureCount,fetchFailureReason:s.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,...g0(l.data,this.options),fetchMeta:s.meta??null};case"success":const o={...l,...py(s.data,s.dataUpdatedAt),dataUpdateCount:l.dataUpdateCount+1,...!s.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#s=s.manual?o:void 0,o;case"error":const d=s.error;return{...l,error:d,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...s.state}}};this.state=n(this.state),Qt.batch(()=>{this.observers.slice().forEach(l=>{l.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:s})})}};function g0(s,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f0(n.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function py(s,n){return{data:s,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function gy(s){const n=typeof s.initialData=="function"?s.initialData():s.initialData,l=n!==void 0,o=l?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:l?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:l?"success":"pending",fetchStatus:"idle"}}var mE=class extends Nl{#e;#t=void 0;#s=void 0;#i=void 0;#r;#n;#a;#o;#l;#f;#u;#h;#c;#m=new Set;constructor(s,n){super(),this.options=n,this.#e=s,this.#a=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),vy(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yf(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yf(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(s){const n=this.options,l=this.#t;if(this.options=this.#e.defaultQueryOptions(s),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof _t(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),n._defaulted&&!kd(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&_y(this.#t,l,this.options,n)&&this.#d(),this.updateResult(),o&&(this.#t!==l||_t(this.options.enabled,this.#t)!==_t(n.enabled,this.#t)||_t(this.options.staleTime,this.#t)!==_t(n.staleTime,this.#t))&&this.#g();const d=this.#v();o&&(this.#t!==l||_t(this.options.enabled,this.#t)!==_t(n.enabled,this.#t)||d!==this.#c)&&this.#_(d)}getOptimisticResult(s){const n=this.#e.getQueryCache().build(this.#e,s),l=this.createResult(n,s);return kd(this.getCurrentResult(),l)||(this.#i=l,this.#n=this.options,this.#r=this.#t.state),l}getCurrentResult(){return this.#i}trackResult(s,n){return new Proxy(s,{get:(l,o)=>(this.trackProp(o),n?.(o),Reflect.get(l,o))})}trackProp(s){this.#m.add(s)}getCurrentQuery(){return this.#t}refetch({...s}={}){return this.fetch({...s})}fetchOptimistic(s){const n=this.#e.defaultQueryOptions(s),l=this.#e.getQueryCache().build(this.#e,n);let o=()=>{},d;const _=new Promise(w=>{d=w,o=this.#e.getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===l.queryHash&&l.state.data!==void 0&&(o(),w(this.createResult(l,n)))})});return Promise.race([l.fetch().then(()=>{const w=this.createResult(l,n);return d?.(w),w}).finally(()=>{o()}),_])}fetch(s){return this.#d({...s,cancelRefetch:s.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(s){this.#x();let n=this.#t.fetch(this.options,s);return s?.throwOnError||(n=n.catch(gs)),n}#p(s){return!am()&&_t(this.options.enabled,this.#t)!==!1&&o0(s)}#g(){this.#b();const s=_t(this.options.staleTime,this.#t);if(this.#i.isStale||!this.#p(s))return;const n=c0(this.#i.dataUpdatedAt,s)+1;this.#u=Xn.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return _t(this.options.refetchInterval,this.#t)??!1}#_(s){this.#S(),this.#c=s,!(this.#c===0||!this.#p(this.#c))&&(this.#h=Xn.setInterval(()=>{(this.options.refetchIntervalInBackground||lm.isFocused())&&this.#d()},this.#c))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#u!==void 0&&(Xn.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#h!==void 0&&(Xn.clearInterval(this.#h),this.#h=void 0)}createResult(s,n){const l=this.#t,o=this.options,d=this.#i,_=this.#r,w=this.#n,c=s!==l?s.state:this.#s,{state:h}=s;let y={...h},p=!1,f;if(n._optimisticResults){const T=this.hasListeners(),D=!T&&vy(s,n),O=T&&_y(s,l,n,o);(D||O)&&(y={...y,...g0(h.data,s.options)}),n._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:C,status:j}=y;f=y.data;let E=!1;if(n.placeholderData!==void 0&&f===void 0&&j==="pending"){let T;d?.isPlaceholderData&&n.placeholderData===w?.placeholderData?(T=d.data,E=!0):T=typeof n.placeholderData=="function"?n.placeholderData(this.#f?.state.data,this.#f):n.placeholderData,T!==void 0&&(j="success",f=vf(d?.data,T,n),p=!0)}if(n.select&&f!==void 0&&!E)if(d&&f===_?.data&&n.select===this.#o)f=this.#l;else try{this.#o=n.select,f=n.select(f),f=vf(d?.data,f,n),this.#l=f,this.#a=null}catch(T){this.#a=T}else f===void 0&&(this.#a=null);this.#a&&(x=this.#a,f=this.#l,C=Date.now(),j="error",p=!1);const g=y.fetchStatus==="fetching",b=j==="pending",v=j==="error",S=b&&g,N=f!==void 0;return{status:j,fetchStatus:y.fetchStatus,isPending:b,isSuccess:j==="success",isError:v,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:C,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:s.isFetched(),isFetchedAfterMount:y.dataUpdateCount>c.dataUpdateCount||y.errorUpdateCount>c.errorUpdateCount,isFetching:g,isRefetching:g&&!b,isLoadingError:v&&!N,isPaused:y.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:v&&N,isStale:om(s,n),refetch:this.refetch,isEnabled:_t(n.enabled,s)!==!1}}updateResult(){const s=this.#i,n=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#n=this.options,this.#r.data!==void 0&&(this.#f=this.#t),kd(n,s))return;this.#i=n;const o=(()=>{if(!s)return!0;const{notifyOnChangeProps:d}=this.options,_=typeof d=="function"?d():d;if(_==="all"||!_&&!this.#m.size)return!0;const w=new Set(_??this.#m);return this.options.throwOnError&&w.add("error"),Object.keys(this.#i).some(c=>{const h=c;return this.#i[h]!==s[h]&&w.has(h)})})();Qt.batch(()=>{o&&this.listeners.forEach(d=>{d(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#x(){const s=this.#e.getQueryCache().build(this.#e,this.options);if(s===this.#t)return;const n=this.#t;this.#t=s,this.#s=s.state,this.hasListeners()&&(n?.removeObserver(this),s.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function pE(s,n){return _t(n.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&_t(n.retryOnMount,s)===!1)}function vy(s,n){return pE(s,n)||s.state.data!==void 0&&yf(s,n,n.refetchOnMount)}function yf(s,n,l){if(_t(n.enabled,s)!==!1&&_t(n.staleTime,s)!=="static"){const o=_t(l,s);return o==="always"||o!==!1&&om(s,n)}return!1}function _y(s,n,l,o){return(s!==n||_t(o.enabled,s)===!1)&&(!l.suspense||s.state.status!=="error")&&om(s,l)}function om(s,n){return _t(n.enabled,s)!==!1&&s.isStaleByTime(_t(n.staleTime,s))}var gE=class extends p0{#e;#t;#s;#i;constructor(s){super(),this.#e=s.client,this.mutationId=s.mutationId,this.#s=s.mutationCache,this.#t=[],this.state=s.state||vE(),this.setOptions(s.options),this.scheduleGc()}setOptions(s){this.options=s,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(s){this.#t.includes(s)||(this.#t.push(s),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:s}))}removeObserver(s){this.#t=this.#t.filter(n=>n!==s),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:s})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(s){const n=()=>{this.#r({type:"continue"})},l={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},o=this.#i=m0({fn:()=>this.options.mutationFn?this.options.mutationFn(s,l):Promise.reject(new Error("No mutationFn found")),onFail:(w,c)=>{this.#r({type:"failed",failureCount:w,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)}),d=this.state.status==="pending",_=!o.canStart();try{if(d)n();else{this.#r({type:"pending",variables:s,isPaused:_}),this.#s.config.onMutate&&await this.#s.config.onMutate(s,this,l);const c=await this.options.onMutate?.(s,l);c!==this.state.context&&this.#r({type:"pending",context:c,variables:s,isPaused:_})}const w=await o.start();return await this.#s.config.onSuccess?.(w,s,this.state.context,this,l),await this.options.onSuccess?.(w,s,this.state.context,l),await this.#s.config.onSettled?.(w,null,this.state.variables,this.state.context,this,l),await this.options.onSettled?.(w,null,s,this.state.context,l),this.#r({type:"success",data:w}),w}catch(w){try{await this.#s.config.onError?.(w,s,this.state.context,this,l)}catch(c){Promise.reject(c)}try{await this.options.onError?.(w,s,this.state.context,l)}catch(c){Promise.reject(c)}try{await this.#s.config.onSettled?.(void 0,w,this.state.variables,this.state.context,this,l)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,w,s,this.state.context,l)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:w}),w}finally{this.#i===o&&(this.#i=void 0),this.#s.runNext(this)}}#r(s){const n=l=>{switch(s.type){case"failed":return{...l,failureCount:s.failureCount,failureReason:s.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"pending":return{...l,context:s.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:s.isPaused,status:"pending",variables:s.variables,submittedAt:Date.now()};case"success":return{...l,data:s.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:s.error,failureCount:l.failureCount+1,failureReason:s.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qt.batch(()=>{this.#t.forEach(l=>{l.onMutationUpdate(s)}),this.#s.notify({mutation:this,type:"updated",action:s})})}};function vE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _E=class extends Nl{#e;#t;#s;constructor(s={}){super(),this.config=s,this.#e=new Set,this.#t=new Map,this.#s=0}build(s,n,l){const o=new gE({client:s,mutationCache:this,mutationId:++this.#s,options:s.defaultMutationOptions(n),state:l});return this.add(o),o}add(s){this.#e.add(s);const n=nc(s);if(typeof n=="string"){const l=this.#t.get(n);l?l.push(s):this.#t.set(n,[s])}this.notify({type:"added",mutation:s})}remove(s){if(this.#e.delete(s)){const n=nc(s);if(typeof n=="string"){const l=this.#t.get(n);if(l)if(l.length>1){const o=l.indexOf(s);o!==-1&&l.splice(o,1)}else l[0]===s&&this.#t.delete(n)}}this.notify({type:"removed",mutation:s})}canRun(s){const n=nc(s);if(typeof n=="string"){const l=this.#t.get(n)?.find(o=>o.state.status==="pending");return!l||l===s}else return!0}runNext(s){const n=nc(s);return typeof n=="string"?this.#t.get(n)?.find(l=>l!==s&&l.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Qt.batch(()=>{this.#e.forEach(s=>{this.notify({type:"removed",mutation:s})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(s){const n={exact:!0,...s};return this.getAll().find(l=>hy(n,l))}findAll(s={}){return this.getAll().filter(n=>hy(s,n))}notify(s){Qt.batch(()=>{this.listeners.forEach(n=>{n(s)})})}resumePausedMutations(){const s=this.getAll().filter(n=>n.state.isPaused);return Qt.batch(()=>Promise.all(s.map(n=>n.continue().catch(gs))))}};function nc(s){return s.options.scope?.id}var yE=class extends Nl{#e;constructor(s={}){super(),this.config=s,this.#e=new Map}build(s,n,l){const o=n.queryKey,d=n.queryHash??nm(o,n);let _=this.get(d);return _||(_=new fE({client:s,queryKey:o,queryHash:d,options:s.defaultQueryOptions(n),state:l,defaultOptions:s.getQueryDefaults(o)}),this.add(_)),_}add(s){this.#e.has(s.queryHash)||(this.#e.set(s.queryHash,s),this.notify({type:"added",query:s}))}remove(s){this.#e.get(s.queryHash)===s&&(s.destroy(),this.#e.delete(s.queryHash),this.notify({type:"removed",query:s}))}clear(){Qt.batch(()=>{this.getAll().forEach(s=>{this.remove(s)})})}get(s){return this.#e.get(s)}getAll(){return[...this.#e.values()]}find(s){const n={exact:!0,...s};return this.getAll().find(l=>uy(n,l))}findAll(s={}){const n=this.getAll();return Object.keys(s).length>0?n.filter(l=>uy(s,l)):n}notify(s){Qt.batch(()=>{this.listeners.forEach(n=>{n(s)})})}onFocus(){Qt.batch(()=>{this.getAll().forEach(s=>{s.onFocus()})})}onOnline(){Qt.batch(()=>{this.getAll().forEach(s=>{s.onOnline()})})}},bE=class{#e;#t;#s;#i;#r;#n;#a;#o;constructor(s={}){this.#e=s.queryCache||new yE,this.#t=s.mutationCache||new _E,this.#s=s.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#a=lm.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=vc.subscribe(async s=>{s&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(s){return this.#e.findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return this.#t.findAll({...s,status:"pending"}).length}getQueryData(s){const n=this.defaultQueryOptions({queryKey:s});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(s){const n=this.defaultQueryOptions(s),l=this.#e.build(this,n),o=l.state.data;return o===void 0?this.fetchQuery(s):(s.revalidateIfStale&&l.isStaleByTime(_t(n.staleTime,l))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(s){return this.#e.findAll(s).map(({queryKey:n,state:l})=>[n,l.data])}setQueryData(s,n,l){const o=this.defaultQueryOptions({queryKey:s}),d=this.#e.get(o.queryHash)?.state.data,_=JC(n,d);if(_!==void 0)return this.#e.build(this,o).setData(_,{...l,manual:!0})}setQueriesData(s,n,l){return Qt.batch(()=>this.#e.findAll(s).map(({queryKey:o})=>[o,this.setQueryData(o,n,l)]))}getQueryState(s){const n=this.defaultQueryOptions({queryKey:s});return this.#e.get(n.queryHash)?.state}removeQueries(s){const n=this.#e;Qt.batch(()=>{n.findAll(s).forEach(l=>{n.remove(l)})})}resetQueries(s,n){const l=this.#e;return Qt.batch(()=>{const o=l.findAll(s),d=new Set(o);return o.forEach(_=>{_.reset()}),this.refetchQueries({type:"active",predicate:_=>d.has(_)},n)})}cancelQueries(s,n={}){const l={revert:!0,...n},o=Qt.batch(()=>this.#e.findAll(s).map(d=>d.cancel(l)));return Promise.all(o).then(gs).catch(gs)}invalidateQueries(s,n={}){return Qt.batch(()=>(this.#e.findAll(s).forEach(l=>{l.invalidate()}),s?.refetchType==="none"?Promise.resolve():this.refetchQueries({...s,type:s?.refetchType??s?.type??"active"},n)))}refetchQueries(s,n={}){const l={...n,cancelRefetch:n.cancelRefetch??!0},o=Qt.batch(()=>this.#e.findAll(s).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let _=d.fetch(void 0,l);return l.throwOnError||(_=_.catch(gs)),d.state.fetchStatus==="paused"?Promise.resolve():_}));return Promise.all(o).then(gs)}async query(s){const n=this.defaultQueryOptions(s);n.retry===void 0&&(n.retry=!1);const l=this.#e.build(this,n),o=l.isStaleByTime(_t(n.staleTime,l))?await l.fetch(n):l.state.data,d=n.select;return d?d(o):o}fetchQuery(s){const n=this.defaultQueryOptions(s);n.retry===void 0&&(n.retry=!1);const l=this.#e.build(this,n);return l.isStaleByTime(_t(n.staleTime,l))?l.fetch(n):Promise.resolve(l.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(gs).catch(gs)}infiniteQuery(s){return s._type="infinite",this.query(s)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(gs).catch(gs)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return vc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(s){this.#s=s}setQueryDefaults(s,n){this.#i.set(pl(s),{queryKey:s,defaultOptions:n})}getQueryDefaults(s){const n=[...this.#i.values()],l={};return n.forEach(o=>{sa(s,o.queryKey)&&Object.assign(l,o.defaultOptions)}),l}setMutationDefaults(s,n){this.#r.set(pl(s),{mutationKey:s,defaultOptions:n})}getMutationDefaults(s){const n=[...this.#r.values()],l={};return n.forEach(o=>{sa(s,o.mutationKey)&&Object.assign(l,o.defaultOptions)}),l}defaultQueryOptions(s){if(s._defaulted)return s;const n={...this.#s.queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return n.queryHash||(n.queryHash=nm(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===rm&&(n.enabled=!1),n}defaultMutationOptions(s){return s?._defaulted?s:{...this.#s.mutations,...s?.mutationKey&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const v0=M.createContext(!1),SE=()=>M.useContext(v0);v0.Provider;function xE(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}const wE=M.createContext(xE()),CE=()=>M.useContext(wE),EE=(s,n,l)=>{const o=l?.state.error&&typeof s.throwOnError=="function"?d0(s.throwOnError,[l.state.error,l]):s.throwOnError;(s.suspense||o)&&(n.isReset()||(s.retryOnMount=!1))},NE=s=>{M.useEffect(()=>{s.clearReset()},[s])},jE=({result:s,errorResetBoundary:n,throwOnError:l,query:o,suspense:d})=>s.isError&&!n.isReset()&&!s.isFetching&&o&&(d&&s.data===void 0||d0(l,[s.error,o])),TE=s=>{if(s.suspense){const l=d=>d==="static"?d:Math.max(d??1e3,1e3),o=s.staleTime;s.staleTime=typeof o=="function"?(...d)=>l(o(...d)):l(o),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},kE=(s,n)=>s?.suspense&&n.isPending,RE=(s,n,l)=>n.fetchOptimistic(s).catch(()=>{l.clearReset()});function DE(s,n,l){const o=SE(),d=CE(),_=En(),w=_.defaultQueryOptions(s),c=_.getQueryCache().get(w.queryHash),h=s.subscribed!==!1;w._optimisticResults=o?"isRestoring":h?"optimistic":void 0,TE(w),EE(w,d,c),NE(d);const[y]=M.useState(()=>new n(_,w)),p=y.getOptimisticResult(w),f=!o&&h;if(M.useSyncExternalStore(M.useCallback(x=>{const C=f?y.subscribe(Qt.batchCalls(x)):gs;return y.updateResult(),C},[y,f]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),M.useEffect(()=>{y.setOptions(w)},[w,y]),kE(w,p))throw RE(w,y,d);if(jE({result:p,errorResetBoundary:d,throwOnError:w.throwOnError,query:c,suspense:w.suspense}))throw p.error;return w.notifyOnChangeProps?p:y.trackResult(p)}function ss(s,n){return DE(s,mE)}var st;(function(s){s.assertEqual=d=>{};function n(d){}s.assertIs=n;function l(d){throw new Error}s.assertNever=l,s.arrayToEnum=d=>{const _={};for(const w of d)_[w]=w;return _},s.getValidEnumValues=d=>{const _=s.objectKeys(d).filter(c=>typeof d[d[c]]!="number"),w={};for(const c of _)w[c]=d[c];return s.objectValues(w)},s.objectValues=d=>s.objectKeys(d).map(function(_){return d[_]}),s.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{const _=[];for(const w in d)Object.prototype.hasOwnProperty.call(d,w)&&_.push(w);return _},s.find=(d,_)=>{for(const w of d)if(_(w))return w},s.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&Number.isFinite(d)&&Math.floor(d)===d;function o(d,_=" | "){return d.map(w=>typeof w=="string"?`'${w}'`:w).join(_)}s.joinValues=o,s.jsonStringifyReplacer=(d,_)=>typeof _=="bigint"?_.toString():_})(st||(st={}));var yy;(function(s){s.mergeShapes=(n,l)=>({...n,...l})})(yy||(yy={}));const Ee=st.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),yn=s=>{switch(typeof s){case"undefined":return Ee.undefined;case"string":return Ee.string;case"number":return Number.isNaN(s)?Ee.nan:Ee.number;case"boolean":return Ee.boolean;case"function":return Ee.function;case"bigint":return Ee.bigint;case"symbol":return Ee.symbol;case"object":return Array.isArray(s)?Ee.array:s===null?Ee.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?Ee.promise:typeof Map<"u"&&s instanceof Map?Ee.map:typeof Set<"u"&&s instanceof Set?Ee.set:typeof Date<"u"&&s instanceof Date?Ee.date:Ee.object;default:return Ee.unknown}},ye=st.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class zi extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const l=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,l):this.__proto__=l,this.name="ZodError",this.issues=n}format(n){const l=n||function(_){return _.message},o={_errors:[]},d=_=>{for(const w of _.issues)if(w.code==="invalid_union")w.unionErrors.map(d);else if(w.code==="invalid_return_type")d(w.returnTypeError);else if(w.code==="invalid_arguments")d(w.argumentsError);else if(w.path.length===0)o._errors.push(l(w));else{let c=o,h=0;for(;h<w.path.length;){const y=w.path[h];h===w.path.length-1?(c[y]=c[y]||{_errors:[]},c[y]._errors.push(l(w))):c[y]=c[y]||{_errors:[]},c=c[y],h++}}};return d(this),o}static assert(n){if(!(n instanceof zi))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,st.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=l=>l.message){const l={},o=[];for(const d of this.issues)if(d.path.length>0){const _=d.path[0];l[_]=l[_]||[],l[_].push(n(d))}else o.push(n(d));return{formErrors:o,fieldErrors:l}}get formErrors(){return this.flatten()}}zi.create=s=>new zi(s);const bf=(s,n)=>{let l;switch(s.code){case ye.invalid_type:s.received===Ee.undefined?l="Required":l=`Expected ${s.expected}, received ${s.received}`;break;case ye.invalid_literal:l=`Invalid literal value, expected ${JSON.stringify(s.expected,st.jsonStringifyReplacer)}`;break;case ye.unrecognized_keys:l=`Unrecognized key(s) in object: ${st.joinValues(s.keys,", ")}`;break;case ye.invalid_union:l="Invalid input";break;case ye.invalid_union_discriminator:l=`Invalid discriminator value. Expected ${st.joinValues(s.options)}`;break;case ye.invalid_enum_value:l=`Invalid enum value. Expected ${st.joinValues(s.options)}, received '${s.received}'`;break;case ye.invalid_arguments:l="Invalid function arguments";break;case ye.invalid_return_type:l="Invalid function return type";break;case ye.invalid_date:l="Invalid date";break;case ye.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(l=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(l=`${l} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?l=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?l=`Invalid input: must end with "${s.validation.endsWith}"`:st.assertNever(s.validation):s.validation!=="regex"?l=`Invalid ${s.validation}`:l="Invalid";break;case ye.too_small:s.type==="array"?l=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?l=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?l=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?l=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?l=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:l="Invalid input";break;case ye.too_big:s.type==="array"?l=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?l=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?l=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?l=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?l=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:l="Invalid input";break;case ye.custom:l="Invalid input";break;case ye.invalid_intersection_types:l="Intersection results could not be merged";break;case ye.not_multiple_of:l=`Number must be a multiple of ${s.multipleOf}`;break;case ye.not_finite:l="Number must be finite";break;default:l=n.defaultError,st.assertNever(s)}return{message:l}};let AE=bf;function OE(){return AE}const LE=s=>{const{data:n,path:l,errorMaps:o,issueData:d}=s,_=[...l,...d.path||[]],w={...d,path:_};if(d.message!==void 0)return{...d,path:_,message:d.message};let c="";const h=o.filter(y=>!!y).slice().reverse();for(const y of h)c=y(w,{data:n,defaultError:c}).message;return{...d,path:_,message:c}};function xe(s,n){const l=OE(),o=LE({issueData:n,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,l,l===bf?void 0:bf].filter(d=>!!d)});s.common.issues.push(o)}class cs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,l){const o=[];for(const d of l){if(d.status==="aborted")return Oe;d.status==="dirty"&&n.dirty(),o.push(d.value)}return{status:n.value,value:o}}static async mergeObjectAsync(n,l){const o=[];for(const d of l){const _=await d.key,w=await d.value;o.push({key:_,value:w})}return cs.mergeObjectSync(n,o)}static mergeObjectSync(n,l){const o={};for(const d of l){const{key:_,value:w}=d;if(_.status==="aborted"||w.status==="aborted")return Oe;_.status==="dirty"&&n.dirty(),w.status==="dirty"&&n.dirty(),_.value!=="__proto__"&&(typeof w.value<"u"||d.alwaysSet)&&(o[_.value]=w.value)}return{status:n.value,value:o}}}const Oe=Object.freeze({status:"aborted"}),fl=s=>({status:"dirty",value:s}),Ks=s=>({status:"valid",value:s}),by=s=>s.status==="aborted",Sy=s=>s.status==="dirty",ia=s=>s.status==="valid",_c=s=>typeof Promise<"u"&&s instanceof Promise;var je;(function(s){s.errToObj=n=>typeof n=="string"?{message:n}:n||{},s.toString=n=>typeof n=="string"?n:n?.message})(je||(je={}));class yi{constructor(n,l,o,d){this._cachedPath=[],this.parent=n,this.data=l,this._path=o,this._key=d}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const xy=(s,n)=>{if(ia(n))return{success:!0,data:n.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const l=new zi(s.common.issues);return this._error=l,this._error}}};function Pe(s){if(!s)return{};const{errorMap:n,invalid_type_error:l,required_error:o,description:d}=s;if(n&&(l||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:d}:{errorMap:(w,c)=>{const{message:h}=s;return w.code==="invalid_enum_value"?{message:h??c.defaultError}:typeof c.data>"u"?{message:h??o??c.defaultError}:w.code!=="invalid_type"?{message:c.defaultError}:{message:h??l??c.defaultError}},description:d}}class We{get description(){return this._def.description}_getType(n){return yn(n.data)}_getOrReturnCtx(n,l){return l||{common:n.parent.common,data:n.data,parsedType:yn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new cs,ctx:{common:n.parent.common,data:n.data,parsedType:yn(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const l=this._parse(n);if(_c(l))throw new Error("Synchronous parse encountered promise.");return l}_parseAsync(n){const l=this._parse(n);return Promise.resolve(l)}parse(n,l){const o=this.safeParse(n,l);if(o.success)return o.data;throw o.error}safeParse(n,l){const o={common:{issues:[],async:l?.async??!1,contextualErrorMap:l?.errorMap},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:yn(n)},d=this._parseSync({data:n,path:o.path,parent:o});return xy(o,d)}"~validate"(n){const l={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:yn(n)};if(!this["~standard"].async)try{const o=this._parseSync({data:n,path:[],parent:l});return ia(o)?{value:o.value}:{issues:l.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),l.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:l}).then(o=>ia(o)?{value:o.value}:{issues:l.common.issues})}async parseAsync(n,l){const o=await this.safeParseAsync(n,l);if(o.success)return o.data;throw o.error}async safeParseAsync(n,l){const o={common:{issues:[],contextualErrorMap:l?.errorMap,async:!0},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:yn(n)},d=this._parse({data:n,path:o.path,parent:o}),_=await(_c(d)?d:Promise.resolve(d));return xy(o,_)}refine(n,l){const o=d=>typeof l=="string"||typeof l>"u"?{message:l}:typeof l=="function"?l(d):l;return this._refinement((d,_)=>{const w=n(d),c=()=>_.addIssue({code:ye.custom,...o(d)});return typeof Promise<"u"&&w instanceof Promise?w.then(h=>h?!0:(c(),!1)):w?!0:(c(),!1)})}refinement(n,l){return this._refinement((o,d)=>n(o)?!0:(d.addIssue(typeof l=="function"?l(o,d):l),!1))}_refinement(n){return new er({schema:this,typeName:Le.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:l=>this["~validate"](l)}}optional(){return Hi.create(this,this._def)}nullable(){return tr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _i.create(this)}promise(){return Cc.create(this,this._def)}or(n){return bc.create([this,n],this._def)}and(n){return Sc.create(this,n,this._def)}transform(n){return new er({...Pe(this._def),schema:this,typeName:Le.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const l=typeof n=="function"?n:()=>n;return new Ec({...Pe(this._def),innerType:this,defaultValue:l,typeName:Le.ZodDefault})}brand(){return new S0({typeName:Le.ZodBranded,type:this,...Pe(this._def)})}catch(n){const l=typeof n=="function"?n:()=>n;return new Nc({...Pe(this._def),innerType:this,catchValue:l,typeName:Le.ZodCatch})}describe(n){const l=this.constructor;return new l({...this._def,description:n})}pipe(n){return um.create(this,n)}readonly(){return jc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ME=/^c[^\s-]{8,}$/i,BE=/^[0-9a-z]+$/,IE=/^[0-9A-HJKMNP-TV-Z]{26}$/i,HE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,UE=/^[a-z0-9_-]{21}$/i,zE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$E=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Rd;const VE=/^(?:(?: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])$/,qE=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,KE=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,GE=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ZE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_0="((\\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])))",XE=new RegExp(`^${_0}$`);function y0(s){let n="[0-5]\\d";s.precision?n=`${n}\\.\\d{${s.precision}}`:s.precision==null&&(n=`${n}(\\.\\d+)?`);const l=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${l}`}function WE(s){return new RegExp(`^${y0(s)}$`)}function QE(s){let n=`${_0}T${y0(s)}`;const l=[];return l.push(s.local?"Z?":"Z"),s.offset&&l.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${l.join("|")})`,new RegExp(`^${n}$`)}function JE(s,n){return!!((n==="v4"||!n)&&VE.test(s)||(n==="v6"||!n)&&KE.test(s))}function e2(s,n){if(!zE.test(s))return!1;try{const[l]=s.split(".");if(!l)return!1;const o=l.replace(/-/g,"+").replace(/_/g,"/").padEnd(l.length+(4-l.length%4)%4,"="),d=JSON.parse(atob(o));return!(typeof d!="object"||d===null||"typ"in d&&d?.typ!=="JWT"||!d.alg||n&&d.alg!==n)}catch{return!1}}function t2(s,n){return!!((n==="v4"||!n)&&qE.test(s)||(n==="v6"||!n)&&GE.test(s))}class Ii extends We{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==Ee.string){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_type,expected:Ee.string,received:_.parsedType}),Oe}const o=new cs;let d;for(const _ of this._def.checks)if(_.kind==="min")n.data.length<_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),o.dirty());else if(_.kind==="max")n.data.length>_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!1,message:_.message}),o.dirty());else if(_.kind==="length"){const w=n.data.length>_.value,c=n.data.length<_.value;(w||c)&&(d=this._getOrReturnCtx(n,d),w?xe(d,{code:ye.too_big,maximum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}):c&&xe(d,{code:ye.too_small,minimum:_.value,type:"string",inclusive:!0,exact:!0,message:_.message}),o.dirty())}else if(_.kind==="email")PE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"email",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="emoji")Rd||(Rd=new RegExp(FE,"u")),Rd.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"emoji",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="uuid")HE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"uuid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="nanoid")UE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"nanoid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="cuid")ME.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"cuid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="cuid2")BE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"cuid2",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="ulid")IE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"ulid",code:ye.invalid_string,message:_.message}),o.dirty());else if(_.kind==="url")try{new URL(n.data)}catch{d=this._getOrReturnCtx(n,d),xe(d,{validation:"url",code:ye.invalid_string,message:_.message}),o.dirty()}else _.kind==="regex"?(_.regex.lastIndex=0,_.regex.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"regex",code:ye.invalid_string,message:_.message}),o.dirty())):_.kind==="trim"?n.data=n.data.trim():_.kind==="includes"?n.data.includes(_.value,_.position)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:{includes:_.value,position:_.position},message:_.message}),o.dirty()):_.kind==="toLowerCase"?n.data=n.data.toLowerCase():_.kind==="toUpperCase"?n.data=n.data.toUpperCase():_.kind==="startsWith"?n.data.startsWith(_.value)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:{startsWith:_.value},message:_.message}),o.dirty()):_.kind==="endsWith"?n.data.endsWith(_.value)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:{endsWith:_.value},message:_.message}),o.dirty()):_.kind==="datetime"?QE(_).test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:"datetime",message:_.message}),o.dirty()):_.kind==="date"?XE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:"date",message:_.message}),o.dirty()):_.kind==="time"?WE(_).test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.invalid_string,validation:"time",message:_.message}),o.dirty()):_.kind==="duration"?$E.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"duration",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="ip"?JE(n.data,_.version)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"ip",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="jwt"?e2(n.data,_.alg)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"jwt",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="cidr"?t2(n.data,_.version)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"cidr",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="base64"?YE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"base64",code:ye.invalid_string,message:_.message}),o.dirty()):_.kind==="base64url"?ZE.test(n.data)||(d=this._getOrReturnCtx(n,d),xe(d,{validation:"base64url",code:ye.invalid_string,message:_.message}),o.dirty()):st.assertNever(_);return{status:o.value,value:n.data}}_regex(n,l,o){return this.refinement(d=>n.test(d),{validation:l,code:ye.invalid_string,...je.errToObj(o)})}_addCheck(n){return new Ii({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...je.errToObj(n)})}url(n){return this._addCheck({kind:"url",...je.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...je.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...je.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...je.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...je.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...je.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...je.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...je.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...je.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...je.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...je.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...je.errToObj(n)})}datetime(n){return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof n?.precision>"u"?null:n?.precision,offset:n?.offset??!1,local:n?.local??!1,...je.errToObj(n?.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof n?.precision>"u"?null:n?.precision,...je.errToObj(n?.message)})}duration(n){return this._addCheck({kind:"duration",...je.errToObj(n)})}regex(n,l){return this._addCheck({kind:"regex",regex:n,...je.errToObj(l)})}includes(n,l){return this._addCheck({kind:"includes",value:n,position:l?.position,...je.errToObj(l?.message)})}startsWith(n,l){return this._addCheck({kind:"startsWith",value:n,...je.errToObj(l)})}endsWith(n,l){return this._addCheck({kind:"endsWith",value:n,...je.errToObj(l)})}min(n,l){return this._addCheck({kind:"min",value:n,...je.errToObj(l)})}max(n,l){return this._addCheck({kind:"max",value:n,...je.errToObj(l)})}length(n,l){return this._addCheck({kind:"length",value:n,...je.errToObj(l)})}nonempty(n){return this.min(1,je.errToObj(n))}trim(){return new Ii({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ii({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ii({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n}get maxLength(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n}}Ii.create=s=>new Ii({checks:[],typeName:Le.ZodString,coerce:s?.coerce??!1,...Pe(s)});function s2(s,n){const l=(s.toString().split(".")[1]||"").length,o=(n.toString().split(".")[1]||"").length,d=l>o?l:o,_=Number.parseInt(s.toFixed(d).replace(".","")),w=Number.parseInt(n.toFixed(d).replace(".",""));return _%w/10**d}class na extends We{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==Ee.number){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_type,expected:Ee.number,received:_.parsedType}),Oe}let o;const d=new cs;for(const _ of this._def.checks)_.kind==="int"?st.isInteger(n.data)||(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.invalid_type,expected:"integer",received:"float",message:_.message}),d.dirty()):_.kind==="min"?(_.inclusive?n.data<_.value:n.data<=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_small,minimum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),d.dirty()):_.kind==="max"?(_.inclusive?n.data>_.value:n.data>=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_big,maximum:_.value,type:"number",inclusive:_.inclusive,exact:!1,message:_.message}),d.dirty()):_.kind==="multipleOf"?s2(n.data,_.value)!==0&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.not_multiple_of,multipleOf:_.value,message:_.message}),d.dirty()):_.kind==="finite"?Number.isFinite(n.data)||(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.not_finite,message:_.message}),d.dirty()):st.assertNever(_);return{status:d.value,value:n.data}}gte(n,l){return this.setLimit("min",n,!0,je.toString(l))}gt(n,l){return this.setLimit("min",n,!1,je.toString(l))}lte(n,l){return this.setLimit("max",n,!0,je.toString(l))}lt(n,l){return this.setLimit("max",n,!1,je.toString(l))}setLimit(n,l,o,d){return new na({...this._def,checks:[...this._def.checks,{kind:n,value:l,inclusive:o,message:je.toString(d)}]})}_addCheck(n){return new na({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:je.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:je.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:je.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:je.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:je.toString(n)})}multipleOf(n,l){return this._addCheck({kind:"multipleOf",value:n,message:je.toString(l)})}finite(n){return this._addCheck({kind:"finite",message:je.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:je.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:je.toString(n)})}get minValue(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n}get maxValue(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&st.isInteger(n.value))}get isFinite(){let n=null,l=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(l===null||o.value>l)&&(l=o.value):o.kind==="max"&&(n===null||o.value<n)&&(n=o.value)}return Number.isFinite(l)&&Number.isFinite(n)}}na.create=s=>new na({checks:[],typeName:Le.ZodNumber,coerce:s?.coerce||!1,...Pe(s)});class gl extends We{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==Ee.bigint)return this._getInvalidInput(n);let o;const d=new cs;for(const _ of this._def.checks)_.kind==="min"?(_.inclusive?n.data<_.value:n.data<=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_small,type:"bigint",minimum:_.value,inclusive:_.inclusive,message:_.message}),d.dirty()):_.kind==="max"?(_.inclusive?n.data>_.value:n.data>=_.value)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.too_big,type:"bigint",maximum:_.value,inclusive:_.inclusive,message:_.message}),d.dirty()):_.kind==="multipleOf"?n.data%_.value!==BigInt(0)&&(o=this._getOrReturnCtx(n,o),xe(o,{code:ye.not_multiple_of,multipleOf:_.value,message:_.message}),d.dirty()):st.assertNever(_);return{status:d.value,value:n.data}}_getInvalidInput(n){const l=this._getOrReturnCtx(n);return xe(l,{code:ye.invalid_type,expected:Ee.bigint,received:l.parsedType}),Oe}gte(n,l){return this.setLimit("min",n,!0,je.toString(l))}gt(n,l){return this.setLimit("min",n,!1,je.toString(l))}lte(n,l){return this.setLimit("max",n,!0,je.toString(l))}lt(n,l){return this.setLimit("max",n,!1,je.toString(l))}setLimit(n,l,o,d){return new gl({...this._def,checks:[...this._def.checks,{kind:n,value:l,inclusive:o,message:je.toString(d)}]})}_addCheck(n){return new gl({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:je.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:je.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:je.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:je.toString(n)})}multipleOf(n,l){return this._addCheck({kind:"multipleOf",value:n,message:je.toString(l)})}get minValue(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n}get maxValue(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n}}gl.create=s=>new gl({checks:[],typeName:Le.ZodBigInt,coerce:s?.coerce??!1,...Pe(s)});class Sf extends We{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==Ee.boolean){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.boolean,received:o.parsedType}),Oe}return Ks(n.data)}}Sf.create=s=>new Sf({typeName:Le.ZodBoolean,coerce:s?.coerce||!1,...Pe(s)});class yc extends We{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==Ee.date){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_type,expected:Ee.date,received:_.parsedType}),Oe}if(Number.isNaN(n.data.getTime())){const _=this._getOrReturnCtx(n);return xe(_,{code:ye.invalid_date}),Oe}const o=new cs;let d;for(const _ of this._def.checks)_.kind==="min"?n.data.getTime()<_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_small,message:_.message,inclusive:!0,exact:!1,minimum:_.value,type:"date"}),o.dirty()):_.kind==="max"?n.data.getTime()>_.value&&(d=this._getOrReturnCtx(n,d),xe(d,{code:ye.too_big,message:_.message,inclusive:!0,exact:!1,maximum:_.value,type:"date"}),o.dirty()):st.assertNever(_);return{status:o.value,value:new Date(n.data.getTime())}}_addCheck(n){return new yc({...this._def,checks:[...this._def.checks,n]})}min(n,l){return this._addCheck({kind:"min",value:n.getTime(),message:je.toString(l)})}max(n,l){return this._addCheck({kind:"max",value:n.getTime(),message:je.toString(l)})}get minDate(){let n=null;for(const l of this._def.checks)l.kind==="min"&&(n===null||l.value>n)&&(n=l.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const l of this._def.checks)l.kind==="max"&&(n===null||l.value<n)&&(n=l.value);return n!=null?new Date(n):null}}yc.create=s=>new yc({checks:[],coerce:s?.coerce||!1,typeName:Le.ZodDate,...Pe(s)});class wy extends We{_parse(n){if(this._getType(n)!==Ee.symbol){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.symbol,received:o.parsedType}),Oe}return Ks(n.data)}}wy.create=s=>new wy({typeName:Le.ZodSymbol,...Pe(s)});class xf extends We{_parse(n){if(this._getType(n)!==Ee.undefined){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.undefined,received:o.parsedType}),Oe}return Ks(n.data)}}xf.create=s=>new xf({typeName:Le.ZodUndefined,...Pe(s)});class wf extends We{_parse(n){if(this._getType(n)!==Ee.null){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.null,received:o.parsedType}),Oe}return Ks(n.data)}}wf.create=s=>new wf({typeName:Le.ZodNull,...Pe(s)});class Cy extends We{constructor(){super(...arguments),this._any=!0}_parse(n){return Ks(n.data)}}Cy.create=s=>new Cy({typeName:Le.ZodAny,...Pe(s)});class Cf extends We{constructor(){super(...arguments),this._unknown=!0}_parse(n){return Ks(n.data)}}Cf.create=s=>new Cf({typeName:Le.ZodUnknown,...Pe(s)});class wn extends We{_parse(n){const l=this._getOrReturnCtx(n);return xe(l,{code:ye.invalid_type,expected:Ee.never,received:l.parsedType}),Oe}}wn.create=s=>new wn({typeName:Le.ZodNever,...Pe(s)});class Ey extends We{_parse(n){if(this._getType(n)!==Ee.undefined){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.void,received:o.parsedType}),Oe}return Ks(n.data)}}Ey.create=s=>new Ey({typeName:Le.ZodVoid,...Pe(s)});class _i extends We{_parse(n){const{ctx:l,status:o}=this._processInputParams(n),d=this._def;if(l.parsedType!==Ee.array)return xe(l,{code:ye.invalid_type,expected:Ee.array,received:l.parsedType}),Oe;if(d.exactLength!==null){const w=l.data.length>d.exactLength.value,c=l.data.length<d.exactLength.value;(w||c)&&(xe(l,{code:w?ye.too_big:ye.too_small,minimum:c?d.exactLength.value:void 0,maximum:w?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),o.dirty())}if(d.minLength!==null&&l.data.length<d.minLength.value&&(xe(l,{code:ye.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),o.dirty()),d.maxLength!==null&&l.data.length>d.maxLength.value&&(xe(l,{code:ye.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),o.dirty()),l.common.async)return Promise.all([...l.data].map((w,c)=>d.type._parseAsync(new yi(l,w,l.path,c)))).then(w=>cs.mergeArray(o,w));const _=[...l.data].map((w,c)=>d.type._parseSync(new yi(l,w,l.path,c)));return cs.mergeArray(o,_)}get element(){return this._def.type}min(n,l){return new _i({...this._def,minLength:{value:n,message:je.toString(l)}})}max(n,l){return new _i({...this._def,maxLength:{value:n,message:je.toString(l)}})}length(n,l){return new _i({...this._def,exactLength:{value:n,message:je.toString(l)}})}nonempty(n){return this.min(1,n)}}_i.create=(s,n)=>new _i({type:s,minLength:null,maxLength:null,exactLength:null,typeName:Le.ZodArray,...Pe(n)});function Qr(s){if(s instanceof Lt){const n={};for(const l in s.shape){const o=s.shape[l];n[l]=Hi.create(Qr(o))}return new Lt({...s._def,shape:()=>n})}else return s instanceof _i?new _i({...s._def,type:Qr(s.element)}):s instanceof Hi?Hi.create(Qr(s.unwrap())):s instanceof tr?tr.create(Qr(s.unwrap())):s instanceof Qn?Qn.create(s.items.map(n=>Qr(n))):s}class Lt extends We{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),l=st.objectKeys(n);return this._cached={shape:n,keys:l},this._cached}_parse(n){if(this._getType(n)!==Ee.object){const y=this._getOrReturnCtx(n);return xe(y,{code:ye.invalid_type,expected:Ee.object,received:y.parsedType}),Oe}const{status:o,ctx:d}=this._processInputParams(n),{shape:_,keys:w}=this._getCached(),c=[];if(!(this._def.catchall instanceof wn&&this._def.unknownKeys==="strip"))for(const y in d.data)w.includes(y)||c.push(y);const h=[];for(const y of w){const p=_[y],f=d.data[y];h.push({key:{status:"valid",value:y},value:p._parse(new yi(d,f,d.path,y)),alwaysSet:y in d.data})}if(this._def.catchall instanceof wn){const y=this._def.unknownKeys;if(y==="passthrough")for(const p of c)h.push({key:{status:"valid",value:p},value:{status:"valid",value:d.data[p]}});else if(y==="strict")c.length>0&&(xe(d,{code:ye.unrecognized_keys,keys:c}),o.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const p of c){const f=d.data[p];h.push({key:{status:"valid",value:p},value:y._parse(new yi(d,f,d.path,p)),alwaysSet:p in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const y=[];for(const p of h){const f=await p.key,x=await p.value;y.push({key:f,value:x,alwaysSet:p.alwaysSet})}return y}).then(y=>cs.mergeObjectSync(o,y)):cs.mergeObjectSync(o,h)}get shape(){return this._def.shape()}strict(n){return je.errToObj,new Lt({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(l,o)=>{const d=this._def.errorMap?.(l,o).message??o.defaultError;return l.code==="unrecognized_keys"?{message:je.errToObj(n).message??d}:{message:d}}}:{}})}strip(){return new Lt({...this._def,unknownKeys:"strip"})}passthrough(){return new Lt({...this._def,unknownKeys:"passthrough"})}extend(n){return new Lt({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Lt({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:Le.ZodObject})}setKey(n,l){return this.augment({[n]:l})}catchall(n){return new Lt({...this._def,catchall:n})}pick(n){const l={};for(const o of st.objectKeys(n))n[o]&&this.shape[o]&&(l[o]=this.shape[o]);return new Lt({...this._def,shape:()=>l})}omit(n){const l={};for(const o of st.objectKeys(this.shape))n[o]||(l[o]=this.shape[o]);return new Lt({...this._def,shape:()=>l})}deepPartial(){return Qr(this)}partial(n){const l={};for(const o of st.objectKeys(this.shape)){const d=this.shape[o];n&&!n[o]?l[o]=d:l[o]=d.optional()}return new Lt({...this._def,shape:()=>l})}required(n){const l={};for(const o of st.objectKeys(this.shape))if(n&&!n[o])l[o]=this.shape[o];else{let _=this.shape[o];for(;_ instanceof Hi;)_=_._def.innerType;l[o]=_}return new Lt({...this._def,shape:()=>l})}keyof(){return b0(st.objectKeys(this.shape))}}Lt.create=(s,n)=>new Lt({shape:()=>s,unknownKeys:"strip",catchall:wn.create(),typeName:Le.ZodObject,...Pe(n)});Lt.strictCreate=(s,n)=>new Lt({shape:()=>s,unknownKeys:"strict",catchall:wn.create(),typeName:Le.ZodObject,...Pe(n)});Lt.lazycreate=(s,n)=>new Lt({shape:s,unknownKeys:"strip",catchall:wn.create(),typeName:Le.ZodObject,...Pe(n)});class bc extends We{_parse(n){const{ctx:l}=this._processInputParams(n),o=this._def.options;function d(_){for(const c of _)if(c.result.status==="valid")return c.result;for(const c of _)if(c.result.status==="dirty")return l.common.issues.push(...c.ctx.common.issues),c.result;const w=_.map(c=>new zi(c.ctx.common.issues));return xe(l,{code:ye.invalid_union,unionErrors:w}),Oe}if(l.common.async)return Promise.all(o.map(async _=>{const w={...l,common:{...l.common,issues:[]},parent:null};return{result:await _._parseAsync({data:l.data,path:l.path,parent:w}),ctx:w}})).then(d);{let _;const w=[];for(const h of o){const y={...l,common:{...l.common,issues:[]},parent:null},p=h._parseSync({data:l.data,path:l.path,parent:y});if(p.status==="valid")return p;p.status==="dirty"&&!_&&(_={result:p,ctx:y}),y.common.issues.length&&w.push(y.common.issues)}if(_)return l.common.issues.push(..._.ctx.common.issues),_.result;const c=w.map(h=>new zi(h));return xe(l,{code:ye.invalid_union,unionErrors:c}),Oe}}get options(){return this._def.options}}bc.create=(s,n)=>new bc({options:s,typeName:Le.ZodUnion,...Pe(n)});const Bi=s=>s instanceof Nf?Bi(s.schema):s instanceof er?Bi(s.innerType()):s instanceof wc?[s.value]:s instanceof Jn?s.options:s instanceof jf?st.objectValues(s.enum):s instanceof Ec?Bi(s._def.innerType):s instanceof xf?[void 0]:s instanceof wf?[null]:s instanceof Hi?[void 0,...Bi(s.unwrap())]:s instanceof tr?[null,...Bi(s.unwrap())]:s instanceof S0||s instanceof jc?Bi(s.unwrap()):s instanceof Nc?Bi(s._def.innerType):[];class cm extends We{_parse(n){const{ctx:l}=this._processInputParams(n);if(l.parsedType!==Ee.object)return xe(l,{code:ye.invalid_type,expected:Ee.object,received:l.parsedType}),Oe;const o=this.discriminator,d=l.data[o],_=this.optionsMap.get(d);return _?l.common.async?_._parseAsync({data:l.data,path:l.path,parent:l}):_._parseSync({data:l.data,path:l.path,parent:l}):(xe(l,{code:ye.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,l,o){const d=new Map;for(const _ of l){const w=Bi(_.shape[n]);if(!w.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const c of w){if(d.has(c))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(c)}`);d.set(c,_)}}return new cm({typeName:Le.ZodDiscriminatedUnion,discriminator:n,options:l,optionsMap:d,...Pe(o)})}}function Ef(s,n){const l=yn(s),o=yn(n);if(s===n)return{valid:!0,data:s};if(l===Ee.object&&o===Ee.object){const d=st.objectKeys(n),_=st.objectKeys(s).filter(c=>d.indexOf(c)!==-1),w={...s,...n};for(const c of _){const h=Ef(s[c],n[c]);if(!h.valid)return{valid:!1};w[c]=h.data}return{valid:!0,data:w}}else if(l===Ee.array&&o===Ee.array){if(s.length!==n.length)return{valid:!1};const d=[];for(let _=0;_<s.length;_++){const w=s[_],c=n[_],h=Ef(w,c);if(!h.valid)return{valid:!1};d.push(h.data)}return{valid:!0,data:d}}else return l===Ee.date&&o===Ee.date&&+s==+n?{valid:!0,data:s}:{valid:!1}}class Sc extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n),d=(_,w)=>{if(by(_)||by(w))return Oe;const c=Ef(_.value,w.value);return c.valid?((Sy(_)||Sy(w))&&l.dirty(),{status:l.value,value:c.data}):(xe(o,{code:ye.invalid_intersection_types}),Oe)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([_,w])=>d(_,w)):d(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}Sc.create=(s,n,l)=>new Sc({left:s,right:n,typeName:Le.ZodIntersection,...Pe(l)});class Qn extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.array)return xe(o,{code:ye.invalid_type,expected:Ee.array,received:o.parsedType}),Oe;if(o.data.length<this._def.items.length)return xe(o,{code:ye.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&o.data.length>this._def.items.length&&(xe(o,{code:ye.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.dirty());const _=[...o.data].map((w,c)=>{const h=this._def.items[c]||this._def.rest;return h?h._parse(new yi(o,w,o.path,c)):null}).filter(w=>!!w);return o.common.async?Promise.all(_).then(w=>cs.mergeArray(l,w)):cs.mergeArray(l,_)}get items(){return this._def.items}rest(n){return new Qn({...this._def,rest:n})}}Qn.create=(s,n)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qn({items:s,typeName:Le.ZodTuple,rest:null,...Pe(n)})};class xc extends We{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.object)return xe(o,{code:ye.invalid_type,expected:Ee.object,received:o.parsedType}),Oe;const d=[],_=this._def.keyType,w=this._def.valueType;for(const c in o.data)d.push({key:_._parse(new yi(o,c,o.path,c)),value:w._parse(new yi(o,o.data[c],o.path,c)),alwaysSet:c in o.data});return o.common.async?cs.mergeObjectAsync(l,d):cs.mergeObjectSync(l,d)}get element(){return this._def.valueType}static create(n,l,o){return l instanceof We?new xc({keyType:n,valueType:l,typeName:Le.ZodRecord,...Pe(o)}):new xc({keyType:Ii.create(),valueType:n,typeName:Le.ZodRecord,...Pe(l)})}}class Ny extends We{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.map)return xe(o,{code:ye.invalid_type,expected:Ee.map,received:o.parsedType}),Oe;const d=this._def.keyType,_=this._def.valueType,w=[...o.data.entries()].map(([c,h],y)=>({key:d._parse(new yi(o,c,o.path,[y,"key"])),value:_._parse(new yi(o,h,o.path,[y,"value"]))}));if(o.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const h of w){const y=await h.key,p=await h.value;if(y.status==="aborted"||p.status==="aborted")return Oe;(y.status==="dirty"||p.status==="dirty")&&l.dirty(),c.set(y.value,p.value)}return{status:l.value,value:c}})}else{const c=new Map;for(const h of w){const y=h.key,p=h.value;if(y.status==="aborted"||p.status==="aborted")return Oe;(y.status==="dirty"||p.status==="dirty")&&l.dirty(),c.set(y.value,p.value)}return{status:l.value,value:c}}}}Ny.create=(s,n,l)=>new Ny({valueType:n,keyType:s,typeName:Le.ZodMap,...Pe(l)});class vl extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.parsedType!==Ee.set)return xe(o,{code:ye.invalid_type,expected:Ee.set,received:o.parsedType}),Oe;const d=this._def;d.minSize!==null&&o.data.size<d.minSize.value&&(xe(o,{code:ye.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),l.dirty()),d.maxSize!==null&&o.data.size>d.maxSize.value&&(xe(o,{code:ye.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),l.dirty());const _=this._def.valueType;function w(h){const y=new Set;for(const p of h){if(p.status==="aborted")return Oe;p.status==="dirty"&&l.dirty(),y.add(p.value)}return{status:l.value,value:y}}const c=[...o.data.values()].map((h,y)=>_._parse(new yi(o,h,o.path,y)));return o.common.async?Promise.all(c).then(h=>w(h)):w(c)}min(n,l){return new vl({...this._def,minSize:{value:n,message:je.toString(l)}})}max(n,l){return new vl({...this._def,maxSize:{value:n,message:je.toString(l)}})}size(n,l){return this.min(n,l).max(n,l)}nonempty(n){return this.min(1,n)}}vl.create=(s,n)=>new vl({valueType:s,minSize:null,maxSize:null,typeName:Le.ZodSet,...Pe(n)});class Nf extends We{get schema(){return this._def.getter()}_parse(n){const{ctx:l}=this._processInputParams(n);return this._def.getter()._parse({data:l.data,path:l.path,parent:l})}}Nf.create=(s,n)=>new Nf({getter:s,typeName:Le.ZodLazy,...Pe(n)});class wc extends We{_parse(n){if(n.data!==this._def.value){const l=this._getOrReturnCtx(n);return xe(l,{received:l.data,code:ye.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:n.data}}get value(){return this._def.value}}wc.create=(s,n)=>new wc({value:s,typeName:Le.ZodLiteral,...Pe(n)});function b0(s,n){return new Jn({values:s,typeName:Le.ZodEnum,...Pe(n)})}class Jn extends We{_parse(n){if(typeof n.data!="string"){const l=this._getOrReturnCtx(n),o=this._def.values;return xe(l,{expected:st.joinValues(o),received:l.parsedType,code:ye.invalid_type}),Oe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(n.data)){const l=this._getOrReturnCtx(n),o=this._def.values;return xe(l,{received:l.data,code:ye.invalid_enum_value,options:o}),Oe}return Ks(n.data)}get options(){return this._def.values}get enum(){const n={};for(const l of this._def.values)n[l]=l;return n}get Values(){const n={};for(const l of this._def.values)n[l]=l;return n}get Enum(){const n={};for(const l of this._def.values)n[l]=l;return n}extract(n,l=this._def){return Jn.create(n,{...this._def,...l})}exclude(n,l=this._def){return Jn.create(this.options.filter(o=>!n.includes(o)),{...this._def,...l})}}Jn.create=b0;class jf extends We{_parse(n){const l=st.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(n);if(o.parsedType!==Ee.string&&o.parsedType!==Ee.number){const d=st.objectValues(l);return xe(o,{expected:st.joinValues(d),received:o.parsedType,code:ye.invalid_type}),Oe}if(this._cache||(this._cache=new Set(st.getValidEnumValues(this._def.values))),!this._cache.has(n.data)){const d=st.objectValues(l);return xe(o,{received:o.data,code:ye.invalid_enum_value,options:d}),Oe}return Ks(n.data)}get enum(){return this._def.values}}jf.create=(s,n)=>new jf({values:s,typeName:Le.ZodNativeEnum,...Pe(n)});class Cc extends We{unwrap(){return this._def.type}_parse(n){const{ctx:l}=this._processInputParams(n);if(l.parsedType!==Ee.promise&&l.common.async===!1)return xe(l,{code:ye.invalid_type,expected:Ee.promise,received:l.parsedType}),Oe;const o=l.parsedType===Ee.promise?l.data:Promise.resolve(l.data);return Ks(o.then(d=>this._def.type.parseAsync(d,{path:l.path,errorMap:l.common.contextualErrorMap})))}}Cc.create=(s,n)=>new Cc({type:s,typeName:Le.ZodPromise,...Pe(n)});class er extends We{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:l,ctx:o}=this._processInputParams(n),d=this._def.effect||null,_={addIssue:w=>{xe(o,w),w.fatal?l.abort():l.dirty()},get path(){return o.path}};if(_.addIssue=_.addIssue.bind(_),d.type==="preprocess"){const w=d.transform(o.data,_);if(o.common.async)return Promise.resolve(w).then(async c=>{if(l.value==="aborted")return Oe;const h=await this._def.schema._parseAsync({data:c,path:o.path,parent:o});return h.status==="aborted"?Oe:h.status==="dirty"||l.value==="dirty"?fl(h.value):h});{if(l.value==="aborted")return Oe;const c=this._def.schema._parseSync({data:w,path:o.path,parent:o});return c.status==="aborted"?Oe:c.status==="dirty"||l.value==="dirty"?fl(c.value):c}}if(d.type==="refinement"){const w=c=>{const h=d.refinement(c,_);if(o.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return c.status==="aborted"?Oe:(c.status==="dirty"&&l.dirty(),w(c.value),{status:l.value,value:c.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>c.status==="aborted"?Oe:(c.status==="dirty"&&l.dirty(),w(c.value).then(()=>({status:l.value,value:c.value}))))}if(d.type==="transform")if(o.common.async===!1){const w=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!ia(w))return Oe;const c=d.transform(w.value,_);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:l.value,value:c}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(w=>ia(w)?Promise.resolve(d.transform(w.value,_)).then(c=>({status:l.value,value:c})):Oe);st.assertNever(d)}}er.create=(s,n,l)=>new er({schema:s,typeName:Le.ZodEffects,effect:n,...Pe(l)});er.createWithPreprocess=(s,n,l)=>new er({schema:n,effect:{type:"preprocess",transform:s},typeName:Le.ZodEffects,...Pe(l)});class Hi extends We{_parse(n){return this._getType(n)===Ee.undefined?Ks(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Hi.create=(s,n)=>new Hi({innerType:s,typeName:Le.ZodOptional,...Pe(n)});class tr extends We{_parse(n){return this._getType(n)===Ee.null?Ks(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}tr.create=(s,n)=>new tr({innerType:s,typeName:Le.ZodNullable,...Pe(n)});class Ec extends We{_parse(n){const{ctx:l}=this._processInputParams(n);let o=l.data;return l.parsedType===Ee.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:l.path,parent:l})}removeDefault(){return this._def.innerType}}Ec.create=(s,n)=>new Ec({innerType:s,typeName:Le.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...Pe(n)});class Nc extends We{_parse(n){const{ctx:l}=this._processInputParams(n),o={...l,common:{...l.common,issues:[]}},d=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return _c(d)?d.then(_=>({status:"valid",value:_.status==="valid"?_.value:this._def.catchValue({get error(){return new zi(o.common.issues)},input:o.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new zi(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}Nc.create=(s,n)=>new Nc({innerType:s,typeName:Le.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...Pe(n)});class jy extends We{_parse(n){if(this._getType(n)!==Ee.nan){const o=this._getOrReturnCtx(n);return xe(o,{code:ye.invalid_type,expected:Ee.nan,received:o.parsedType}),Oe}return{status:"valid",value:n.data}}}jy.create=s=>new jy({typeName:Le.ZodNaN,...Pe(s)});class S0 extends We{_parse(n){const{ctx:l}=this._processInputParams(n),o=l.data;return this._def.type._parse({data:o,path:l.path,parent:l})}unwrap(){return this._def.type}}class um extends We{_parse(n){const{status:l,ctx:o}=this._processInputParams(n);if(o.common.async)return(async()=>{const _=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return _.status==="aborted"?Oe:_.status==="dirty"?(l.dirty(),fl(_.value)):this._def.out._parseAsync({data:_.value,path:o.path,parent:o})})();{const d=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?Oe:d.status==="dirty"?(l.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:o.path,parent:o})}}static create(n,l){return new um({in:n,out:l,typeName:Le.ZodPipeline})}}class jc extends We{_parse(n){const l=this._def.innerType._parse(n),o=d=>(ia(d)&&(d.value=Object.freeze(d.value)),d);return _c(l)?l.then(d=>o(d)):o(l)}unwrap(){return this._def.innerType}}jc.create=(s,n)=>new jc({innerType:s,typeName:Le.ZodReadonly,...Pe(n)});var Le;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(Le||(Le={}));const le=Ii.create,ke=na.create,Ve=Sf.create,Jr=Cf.create;wn.create;const vs=_i.create,fe=Lt.create,x0=bc.create,i2=cm.create;Sc.create;Qn.create;const Dd=xc.create,_l=wc.create,Ft=Jn.create;Cc.create;Hi.create;tr.create;fe({id:ke().int().nonnegative(),method:le().min(1),params:Jr().optional()});const n2=fe({code:le(),message:le(),detail:le().optional()});x0([fe({id:ke(),result:Jr()}),fe({id:ke(),error:n2})]);fe({event:le(),data:Jr().optional()});const w0=i2("kind",[fe({kind:_l("key"),privateKey:le().min(1).max(64*1024),passphrase:le().max(1024).optional()}),fe({kind:_l("password"),password:le().max(1024)})]),C0=/^[a-z_][a-z0-9_-]{0,31}$/,E0=/^(\[[0-9a-fA-F:.]+\]|[0-9a-fA-F:.]+|[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)*)$/,Tf=le().min(1).max(255).regex(E0,"Not an IP address or host name"),r2=le().regex(C0,"Not a valid user name"),et=fe({host:Tf,port:ke().int().min(1).max(65535),username:r2,auth:w0}),hm=9922,a2="prisoner",yl=22,Ty="root",l2=9991,Vs={PassphraseRequired:"passphrase_required",BadPassphrase:"bad_passphrase",BadKey:"bad_key",KeyNotFound:"key_not_found",KeyServerUnreachable:"key_server_unreachable",Unreachable:"ssh_unreachable",AuthFailed:"ssh_auth_failed",Timeout:"ssh_timeout"},rc=le().min(1).max(255).regex(/^[\w.-]+$/,"Not a valid app id"),o2=fe({id:le(),title:le().optional(),version:le().optional(),type:le().optional(),vendor:le().optional(),folderPath:le().optional(),icon:le().optional(),systemApp:Ve().optional(),removable:Ve().optional(),visible:Ve().optional()}).passthrough(),kf="org.webosbrew.hbchannel",Rf=512*1024*1024,c2=4*1024*1024,u2=fe({opId:le(),stage:Ft(["upload","verify","install","remove","cleanup"]),percent:ke().min(0).max(100).optional(),text:le().optional()}),h2="op.progress",ac={InstallFailed:"install_failed",InsufficientSpace:"insufficient_space",ChecksumMismatch:"checksum_mismatch",Conflict:"app_conflict"},d2=fe({id:le(),phase:Ft(["start","end"]),target:le(),command:le(),kind:Ft(["exec","stream","sftp","tunnel","http"]),quiet:Ve().optional(),at:ke(),exitCode:ke().nullable().optional(),durationMs:ke().optional(),output:le().optional(),error:le().optional()}),f2="cmd.log",m2=fe({opId:le(),stream:Ft(["stdout","stderr"]),data:le()}),p2="cmd.output",g2=fe({host:le(),name:le().optional(),modelName:le().optional(),ports:fe({ssh22:Ve(),ssh9922:Ve(),keyServer:Ve(),webos:Ve()}),via:vs(Ft(["ssdp","sweep"]))}),ra=le().max(2048).refine(s=>{try{const n=new URL(s).protocol;return n==="https:"||n==="http:"}catch{return!1}},"Not an http(s) URL"),ky=fe({id:le(),version:le(),type:le().optional(),title:le().optional(),appDescription:le().optional(),sourceUrl:ra.optional(),rootRequired:x0([Ve(),_l("optional")]).optional(),ipkUrl:ra,ipkHash:fe({sha256:le().regex(/^[0-9a-f]{64}$/i)}).optional(),ipkSize:ke().nonnegative().optional()}),v2=fe({url:ra,caption:le().optional(),width:ke().optional(),height:ke().optional()}),_2=fe({id:le(),title:le(),iconUri:ra.optional(),detailIconUri:ra.optional(),shortDescription:le().optional(),featured:Ve().optional(),manifest:ky.optional(),manifestBeta:ky.optional(),requirements:fe({webosRelease:le().optional(),deviceSoC:vs(le()).optional()}).optional(),screenshots:vs(v2).optional(),hasDescription:Ve()}),Ry={Unreachable:"repo_unreachable",DownloadFailed:"download_failed"},Js=le().min(1).max(4096).refine(s=>s.startsWith("/")&&!s.split("/").includes("..")&&!s.includes("\0"),"Not an absolute path"),Ad=le().min(1).max(255).refine(s=>!s.includes("/")&&!s.includes("\0")&&s!=="."&&s!=="..","Not a valid file name"),y2=fe({name:le(),type:Ft(["d","-","l","c","b","p","s","?"]),mode:le(),size:ke(),mtime:ke(),user:le().optional(),group:le().optional(),link:fe({target:le().optional(),broken:Ve().optional(),type:Ft(["d","-","l","c","b","p","s","?"]).optional()}).optional(),access:fe({read:Ve(),write:Ve(),execute:Ve()}).optional()}),Df=4*1024*1024,Od=64*1024,b2=fe({shellId:le(),data:le(),stream:Ft(["stdout","stderr"]).optional()}),S2="shell.output",x2=fe({shellId:le(),code:ke().nullable().optional(),signal:le().optional(),error:le().optional()}),w2="shell.exit",C2=Ft(["syslog","dmesg","lsmonitor"]),E2=fe({opId:le(),lines:vs(le()),dropped:ke().int().optional()}),N2="logs.lines",j2=Ft(["none","debug","info","notice","warning","err","crit","alert","emerg"]),N0=le().min(1).max(128).regex(/^[\w.\-<>*]+$/,"Not a log context name"),T2=fe({name:le(),path:le(),size:ke(),mtime:ke().optional(),writable:Ve()}),k2="org.litefin.app",Af="https://github.com/MoazSalem/litefin/releases",R2=5,j0=le().min(1).max(64).regex(/^[A-Za-z0-9][\w.-]*$/,"Not a variant name"),D2=fe({variant:j0,name:le(),size:ke(),sha256:le().optional()}),A2=fe({tag:le(),version:le(),title:le(),publishedAt:le(),assets:vs(D2)}),O2={Unreachable:"litefin_unreachable"},L2=8,M2=le().regex(/^[A-Za-z0-9+/]*={0,2}$/,"Not base64"),Tc=5199;fe({token:le().min(1),protocolVersion:ke().int(),client:le().optional()}),fe({protocolVersion:ke().int(),bridgeVersion:le(),platform:le(),distribution:Ft(["app","npm","source"]).optional()}),fe({}).optional(),fe({now:ke()}),fe({host:Tf}),fe({ssh22:Ve(),ssh9922:Ve(),keyServer:Ve(),webos:Ve()}),fe({timeoutMs:ke().int().min(500).max(15e3).optional()}).optional(),fe({tvs:vs(g2)}),fe({host:Tf,passphrase:le().max(1024).optional()}),fe({privateKey:le(),fingerprint:le()}),fe({privateKey:le().min(1).max(64*1024),passphrase:le().max(1024).optional()}),fe({fingerprint:le(),type:le()}),fe({device:et}),fe({latencyMs:ke(),root:Ve()}),fe({device:et,quiet:Ve().optional()}),fe({modelName:le().optional(),osVersion:le().optional(),firmwareVersion:le().optional(),otaId:le().optional(),socName:le().optional()}),fe({device:et,path:Js.optional()}),fe({total:ke(),used:ke(),available:ke()}).nullable(),fe({comment:le().max(64).optional()}),fe({privateKey:le(),publicKey:le(),fingerprint:le()}),fe({device:et.optional()}),fe({closed:ke()}),fe({device:et,command:le().min(1).max(64*1024),stdin:le().max(4*1024*1024).optional(),timeoutMs:ke().int().min(100).max(6e5).optional()}),fe({stdout:le(),stderr:le(),exitCode:ke().nullable()}),fe({device:et,command:le().min(1).max(8192),opId:le().max(64)}),fe({exitCode:ke().nullable(),cancelled:Ve()}),fe({opId:le().max(64)}),fe({cancelled:Ve()}),fe({device:et,uri:le().regex(/^luna:\/\/[\w.\-/]+$/,"Not a luna:// URI"),params:Dd(Jr()).optional(),public:Ve().optional(),falseAsError:Ve().optional()}),Dd(Jr()),fe({device:et}),fe({apps:vs(o2)}),fe({device:et,id:rc,params:Dd(Jr()).optional()}),fe({}),fe({device:et,path:Js}),fe({mime:le(),base64:le()}),fe({device:et,id:rc,opId:le().max(64)}),fe({}),fe({device:et,uploadId:le().max(64),opId:le().max(64)}),fe({appId:le().optional(),via:Ft(["devmode","hbchannel"])}),fe({name:le().min(1).max(255),size:ke().int().min(1).max(Rf)}),fe({uploadId:le()}),fe({uploadId:le().max(64),offset:ke().int().min(0),data:M2.max(Math.ceil(c2/3)*4)}),fe({received:ke()}),fe({uploadId:le().max(64)}),fe({}),fe({device:et}),fe({token:le().optional(),remaining:le().optional(),problem:le().optional()}),fe({device:et}),fe({}),fe({device:et,method:Ft(["DISPLAY","VIDEO","GRAPHIC"]).default("DISPLAY")}),fe({mime:le(),base64:le()}),fe({device:et}),fe({path:le()}),fe({device:et,path:Js}),fe({path:le(),items:vs(y2)}),fe({device:et,path:Js}),fe({device:et,path:Js,offset:ke().int().min(0),length:ke().int().min(1).max(Df)}),fe({data:le(),eof:Ve()}),fe({device:et,path:Js,uploadId:le().max(64),opId:le().max(64),overwrite:Ve().optional()}),fe({size:ke()}),fe({device:et,parent:Js,name:Ad}),fe({path:le()}),fe({device:et,parent:Js,from:Ad,to:Ad}),fe({path:le()}),fe({device:et,path:Js}),fe({}),fe({device:et,rows:ke().int().min(2).max(500),cols:ke().int().min(10).max(1e3),pty:Ve().optional()}),fe({shellId:le(),pty:Ve(),title:le()}),fe({shellId:le().max(64),data:le().max(1024*1024)}),fe({}),fe({shellId:le().max(64),rows:ke().int().min(2).max(500),cols:ke().int().min(10).max(1e3)}),fe({}),fe({shellId:le().max(64),bytes:ke().int().min(0)}),fe({}),fe({shellId:le().max(64)}),fe({}),fe({refresh:Ve().optional()}),fe({packages:vs(_2),fetchedAt:ke()}),fe({url:ra}),fe({mime:le(),base64:le()}),fe({id:rc}),fe({html:le().nullable(),baseUrl:le().optional()}),fe({device:et,id:rc,channel:Ft(["stable","beta"]).default("stable"),opId:le().max(64)}),fe({appId:le(),version:le(),via:Ft(["devmode","hbchannel"])}),fe({device:et,quiet:Ve().optional()}),fe({installed:Ve(),root:Ve().optional()}),fe({device:et,source:C2,opId:le().min(1).max(64),lines:ke().int().min(0).max(5e3).optional()}),fe({exitCode:ke().nullable(),stopped:Ve()}),fe({opId:le().max(64)}),fe({stopped:Ve()}),fe({device:et,source:Ft(["syslog","dmesg"])}),fe({}),fe({device:et}),fe({contexts:vs(fe({name:le(),level:le()}))}),fe({device:et,context:N0,level:j2}),fe({changed:vs(le())}),fe({device:et}),fe({dir:le().nullable(),reports:vs(T2)}),fe({device:et,path:Js}),fe({text:le(),truncated:Ve()}),fe({refresh:Ve().optional()}).optional(),fe({releases:vs(A2),fetchedAt:ke(),stale:le().optional()}),fe({device:et,tag:le().min(1).max(100),variant:j0,opId:le().max(64)}),fe({appId:le(),version:le(),via:Ft(["devmode","hbchannel"])}),fe({device:et,path:Js}),fe({});const B2="https://lg.scoty.uk",I2=[B2],H2=["http://localhost:5173","http://127.0.0.1:5173"],dm="https://github.com/Scoty/lg-dev-manager",Of=`${dm}/releases/latest`;class yt extends Error{constructor(n,l,o){super(l),this.code=n,this.detail=o}code;detail;static from(n){return new yt(n.code,n.message,n.detail)}}class U2{constructor(n,l){this.url=n,this.token=l}url;token;ws;nextId=1;pending=new Map;listeners=new Map;onClose;async connect(n=8e3){return await new Promise((l,o)=>{let d;try{d=new WebSocket(this.url)}catch(w){o(new yt("bad_url",`Invalid bridge address: ${this.url}`,String(w)));return}this.ws=d;const _=setTimeout(()=>{d.close(),o(new yt("timeout","The bridge did not answer in time."))},n);d.onopen=()=>{clearTimeout(_),l()},d.onerror=()=>{clearTimeout(_),o(new yt("unreachable","Could not reach the bridge. Is it running, and is this site allowed?"))},d.onmessage=w=>this.handle(String(w.data)),d.onclose=w=>{const c=w.reason||(w.code===4401?"unauthorized":"closed");for(const h of this.pending.values())clearTimeout(h.timer),h.reject(new yt("disconnected","Connection to the bridge was lost."));this.pending.clear(),this.onClose?.(c)}}),this.call("system.hello",{token:this.token,protocolVersion:L2,client:"web"})}call(n,l,o=3e4){const d=this.ws;if(!d||d.readyState!==WebSocket.OPEN)return Promise.reject(new yt("disconnected","Not connected to the bridge."));const _=this.nextId++;return new Promise((w,c)=>{const h=setTimeout(()=>{this.pending.delete(_),c(new yt("timeout",`${n} timed out.`))},o);this.pending.set(_,{resolve:w,reject:c,timer:h}),d.send(JSON.stringify({id:_,method:n,params:l}))})}on(n,l){let o=this.listeners.get(n);return o||this.listeners.set(n,o=new Set),o.add(l),()=>o.delete(l)}close(){this.onClose=void 0,this.ws?.close()}handle(n){let l;try{l=JSON.parse(n)}catch{return}if(typeof l.id=="number"){const o=this.pending.get(l.id);if(!o)return;this.pending.delete(l.id),clearTimeout(o.timer),l.error?o.reject(yt.from(l.error)):o.resolve(l.result)}else l.event&&this.listeners.get(l.event)?.forEach(o=>o(l.data))}}const Lf="lgdm-bridge",z2=new Set(["127.0.0.1","localhost"]),Dy=`The bridge only runs on this computer, so its address must start with ws://127.0.0.1: or ws://localhost: (default ws://127.0.0.1:${Tc}/rpc).`;function fm(s){let n;try{n=new URL(s.trim())}catch{return`That isn’t a valid address. ${Dy}`}return n.protocol!=="ws:"||!z2.has(n.hostname)||n.username||n.password?Dy:null}function Ay(s=window.location){const n=s.hostname==="localhost"||s.hostname==="127.0.0.1";return s.protocol==="http:"&&n&&!["localhost:5173","127.0.0.1:5173"].includes(s.host)?`ws://${s.host}/rpc`:`ws://127.0.0.1:${Tc}/rpc`}function $2(){try{const s=localStorage.getItem(Lf);if(!s)return null;const n=JSON.parse(s);return n.url&&n.token&&!fm(n.url)?{url:n.url,token:n.token}:null}catch{return null}}function Oy(s){try{s?localStorage.setItem(Lf,JSON.stringify(s)):localStorage.removeItem(Lf)}catch{}}const T0=M.createContext(null),Ly=[1e3,2e3,5e3,1e4];function P2({children:s}){const[n,l]=M.useState(()=>$2()),[o,d]=M.useState(n?{state:"connecting"}:{state:"unpaired"}),[_,w]=M.useState(null),c=M.useRef(0),h=M.useRef(void 0),y=M.useRef(0),p=M.useCallback(async C=>{const j=++y.current;clearTimeout(h.current),d({state:"connecting"});const E=new U2(C.url,C.token);try{const g=await E.connect();if(j!==y.current)return E.close();c.current=0,w(E),d({state:"connected",bridgeVersion:g.bridgeVersion,platform:g.platform,distribution:g.distribution}),E.onClose=b=>{if(j===y.current){if(w(null),b==="unauthorized"){d({state:"error",code:"unauthorized",message:"The bridge rejected the pairing token."});return}d({state:"error",code:"disconnected",message:"Lost connection to the bridge. Retrying…"}),f(C,j)}}}catch(g){if(E.close(),j!==y.current)return;const b=g instanceof yt?g:new yt("unknown",String(g));throw w(null),d({state:"error",code:b.code,message:b.message}),b.code!=="unauthorized"&&b.code!=="protocol_mismatch"&&f(C,j),b}},[]),f=M.useCallback((C,j)=>{const E=Ly[Math.min(c.current++,Ly.length-1)];h.current=setTimeout(()=>{j===y.current&&p(C).catch(()=>{})},E)},[p]);M.useEffect(()=>(n&&p(n).catch(()=>{}),()=>{y.current++,clearTimeout(h.current)}),[]);const x=M.useMemo(()=>({status:o,settings:n,client:_,pair:async C=>{const j=fm(C.url);if(j)throw new yt("bad_url",j);_?.close(),Oy(C),l(C),await p(C)},reconnect:()=>{c.current=0,n&&p(n).catch(()=>{})},forget:()=>{y.current++,clearTimeout(h.current),_?.close(),Oy(null),l(null),w(null),d({state:"unpaired"})}}),[o,n,_,p]);return r.jsx(T0.Provider,{value:x,children:s})}function Pi(){const s=M.useContext(T0);if(!s)throw new Error("useBridge must be used inside <BridgeProvider>");return s}const k0={apps:'<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>',store:'<path d="M3 9h18l-1.5 11a1 1 0 0 1-1 .9h-13a1 1 0 0 1-1-.9z"/><path d="M8 9V6a4 4 0 0 1 8 0v3"/>',files:'<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>',terminal:'<rect x="3" y="4" width="18" height="16" rx="2"/><path d="m7 9 3 3-3 3M13 15h4"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>',debug:'<path d="M8 2l1.5 2M16 2l-1.5 2"/><rect x="7" y="5" width="10" height="15" rx="5"/><path d="M3 12h4M17 12h4M4 7l3 2M20 7l-3 2M4 18l3-2M20 18l-3-2M12 10v7"/>',tv:'<rect x="3" y="5" width="18" height="12" rx="2"/><path d="M8 21h8M12 17v4"/>',plug:'<path d="M9 2v6M15 2v6"/><path d="M6 8h12v3a6 6 0 0 1-12 0z"/><path d="M12 17v5"/>',github:'<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/>',sun:'<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"/>',moon:'<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',search:'<circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/>',menu:'<line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/>',folder:'<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>',folderPlus:'<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><path d="M12 10v6M9 13h6"/>',file:'<path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/>',image:'<rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-5-5L5 21"/>',cog:'<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/>',chevLeft:'<path d="m15 18-6-6 6-6"/>',chevDown:'<path d="m6 9 6 6 6-6"/>',arrowUp:'<path d="M12 19V5M5 12l7-7 7 7"/>',home:'<path d="m3 10 9-7 9 7v10a1 1 0 0 1-1 1h-5v-6h-6v6H4a1 1 0 0 1-1-1z"/>',clock:'<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',chevRight:'<path d="m9 18 6-6-6-6"/>',left:'<path d="m15 18-6-6 6-6"/>',right:'<path d="m9 18 6-6-6-6"/>',updown:'<path d="m7 9 5-5 5 5"/><path d="m7 15 5 5 5-5"/>',plus:'<path d="M12 5v14M5 12h14"/>',key:'<circle cx="7.5" cy="15.5" r="4.5"/><path d="m10.7 12.3 9.3-9.3M17 6l3 3M14 9l2 2"/>',wrench:'<path d="M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4z"/>',play:'<path d="M7 4.5v15a.8.8 0 0 0 1.2.7l12-7.5a.8.8 0 0 0 0-1.4l-12-7.5A.8.8 0 0 0 7 4.5z"/>',trash:'<path d="M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6"/>',edit:'<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"/>',refresh:'<path d="M21 12a9 9 0 1 1-2.6-6.4L21 8"/><path d="M21 3v5h-5"/>',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5M12 15V3"/>',upload:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m17 8-5-5-5 5M12 3v12"/>',check:'<path d="M20 6 9 17l-5-5"/>',x:'<path d="M18 6 6 18M6 6l12 12"/>',copy:'<rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>',more:'<circle cx="12" cy="5" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="12" cy="19" r="1"/>',alert:'<path d="M12 9v4M12 17h.01"/><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>',lock:'<rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/>',shield:'<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>',pulse:'<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>',link:'<path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/>',external:'<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14 21 3"/>',box:'<path d="M21 8 12 3 3 8v8l9 5 9-5z"/><path d="m3 8 9 5 9-5M12 13v8"/>',disk:'<ellipse cx="12" cy="5" rx="8" ry="3"/><path d="M4 5v14c0 1.7 3.6 3 8 3s8-1.3 8-3V5"/><path d="M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3"/>'};function ce({name:s,className:n,strokeWidth:l}){return r.jsx("svg",{viewBox:"0 0 24 24",className:n,fill:"none",stroke:"currentColor",strokeWidth:l,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:k0[s]}})}function si({open:s,onClose:n,title:l,children:o,footer:d,size:_="md",dismissible:w=!0}){const c=M.useRef(null),h=M.useId();return M.useEffect(()=>{const y=c.current;y&&(s&&!y.open&&y.showModal(),!s&&y.open&&y.close())},[s]),r.jsx("dialog",{ref:c,className:`modal modal--${_}`,"aria-labelledby":h,onCancel:y=>{y.preventDefault(),w&&n()},onMouseDown:y=>{w&&y.target===y.currentTarget&&n()},children:s&&r.jsxs("div",{className:"modal-card",children:[r.jsxs("div",{className:"modal-head",children:[r.jsx("h2",{className:"modal-title",id:h,children:l}),w&&r.jsx("button",{type:"button",className:"icon-btn icon-btn--sm",onClick:n,"aria-label":"Close",children:r.jsx(ce,{name:"x",strokeWidth:2})})]}),r.jsx("div",{className:"modal-body",children:o}),d&&r.jsx("div",{className:"modal-foot",children:d})]})})}const F2={success:'<path d="M20 6 9 17l-5-5"/>',danger:'<path d="M18 6 6 18M6 6l12 12"/>',warning:'<path d="M12 9v4M12 17h.01"/><path d="M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>',primary:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>'};function $e({kind:s,title:n,children:l,action:o}){return r.jsxs("div",{className:`alert ${s}`,role:s==="danger"?"alert":"status",children:[r.jsx("div",{className:"ico",children:r.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:F2[s]}})}),r.jsxs("div",{className:"body",children:[n&&r.jsx("div",{className:"title",children:n}),l]}),o??r.jsx("span",{})]})}const R0=M.createContext(null);function V2({children:s}){const[n,l]=M.useState(null),[o,d]=M.useState([]),_=M.useRef(1),w=M.useCallback(p=>new Promise(f=>{l({...p,resolve:f})}),[]),c=M.useCallback(p=>{const f=_.current++;d(x=>[...x.slice(-3),{...p,id:f}]),setTimeout(()=>d(x=>x.filter(C=>C.id!==f)),p.kind==="danger"?9e3:5e3)},[]),h=p=>{n?.resolve(p),l(null)},y=M.useMemo(()=>({confirm:w,toast:c}),[w,c]);return r.jsxs(R0.Provider,{value:y,children:[s,r.jsx(si,{open:!!n,onClose:()=>h(!1),title:n?.title??"",size:"sm",footer:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn btn--ghost",onClick:()=>h(!1),autoFocus:n?.danger,children:n?.cancelText??"Cancel"}),r.jsx("button",{type:"button",className:`btn ${n?.danger?"btn--danger":"btn--primary"}`,onClick:()=>h(!0),autoFocus:!n?.danger,children:n?.confirmText??"OK"})]}),children:n?.message}),r.jsx("div",{className:"toasts","aria-live":"polite",children:o.map(p=>r.jsx("div",{className:"toast",children:r.jsx($e,{kind:p.kind,title:p.title,action:r.jsx("button",{type:"button",className:"close","aria-label":"Dismiss",onClick:()=>d(f=>f.filter(x=>x.id!==p.id)),children:r.jsx("svg",{viewBox:"0 0 24 24",children:r.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}),children:p.text})},p.id))})]})}function jt(){const s=M.useContext(R0);if(!s)throw new Error("useFeedback must be used inside <FeedbackProvider>");return s}function mm(s){const[n,l]=M.useState(()=>typeof matchMedia=="function"&&matchMedia(s).matches);return M.useEffect(()=>{if(typeof matchMedia!="function")return;const o=matchMedia(s),d=()=>l(o.matches);return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[s]),n}const D0="(min-width: 721px) and (max-width: 1100px)",pm=[{label:"Device",items:[{key:"apps",text:"Apps",icon:"apps",children:[{key:"apps-installed",text:"Installed",to:"/apps/installed"},{key:"apps-homebrew",text:"Homebrew repo",to:"/apps/homebrew"},{key:"apps-litefin",text:"Litefin repo",to:"/apps/litefin"}]},{key:"files",text:"Files",icon:"files",to:"/files"},{key:"terminal",text:"Terminal",icon:"terminal",to:"/terminal"},{key:"info",text:"Device info",icon:"info",to:"/info"},{key:"debug",text:"Debug",icon:"debug",children:[{key:"debug-logs",text:"System log",to:"/debug/logs"},{key:"debug-pmlog",text:"Log levels",to:"/debug/pmlog"},{key:"debug-dmesg",text:"Kernel log",to:"/debug/dmesg"},{key:"debug-crashes",text:"Crash reports",to:"/debug/crashes"},{key:"debug-luna",text:"Luna monitor",to:"/debug/luna"}]}]},{label:"Setup",items:[{key:"devices",text:"Devices",icon:"tv",to:"/devices"},{key:"bridge",text:"Bridge",icon:"plug",to:"/bridge"}]},{label:"Links",items:[{key:"homebrew-site",text:"webOS Homebrew",icon:"store",href:"https://www.webosbrew.org/"},{key:"source",text:"Source code",icon:"github",href:dm}]}];function q2(s){if(s.startsWith("/devices/new"))return["Setup","Devices","Add a TV"];for(const n of pm)for(const l of n.items){if(l.to&&s.startsWith(l.to))return[n.label,l.text];for(const o of l.children??[])if(s.startsWith(o.to))return[n.label,l.text,o.text]}return["LG Dev Manager"]}const A0="1.0.3",ml="1.0.3",lc=6,ul=8;function K2(){const n=document.querySelector(".console-dock")?.getBoundingClientRect().top;return n&&n>0?Math.min(n,window.innerHeight):window.innerHeight}function Ic({trigger:s,children:n,placement:l="down-right",className:o="",menuClassName:d="",label:_,floating:w=!1}){const[c,h]=M.useState(!1),y=M.useRef(null),p=M.useRef(null),[f,x]=M.useState(null),C=M.useCallback(()=>{const E=y.current?.getBoundingClientRect(),g=p.current;if(!E||!g)return;const b=g.offsetHeight,v=g.offsetWidth,N=K2()-E.bottom-lc,T=E.top-lc,O=b>N-ul&&T>N?Math.max(ul,E.top-lc-b):E.bottom+lc,k=l==="down-right"?Math.max(ul,E.right-v):Math.min(Math.max(ul,E.left),window.innerWidth-v-ul);x({top:O,left:k})},[l]);M.useLayoutEffect(()=>{if(w){if(!c)return x(null);C()}},[w,c,C]),M.useEffect(()=>{if(!c)return;const E=b=>{const v=b.target;!y.current?.contains(v)&&!p.current?.contains(v)&&h(!1)},g=b=>{b.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",E),document.addEventListener("keydown",g),w&&(window.addEventListener("scroll",C,!0),window.addEventListener("resize",C)),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",g),window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[c,w,C]);const j=c&&n(()=>h(!1));return r.jsxs("div",{ref:y,className:`dd-wrap${c?" is-open":""} ${o}`,children:[s({open:c,toggle:()=>h(E=>!E),"aria-expanded":c,"aria-haspopup":"menu"}),w?c&&GC.createPortal(r.jsx("div",{ref:p,className:`dd-menu dd-menu--floating${f?" is-placed":""} ${d}`,role:"menu","aria-label":_,style:f??void 0,children:j}),document.body):r.jsx("div",{ref:p,className:`dd-menu dd-menu--${l} ${d}`,role:"menu","aria-label":_,children:j})]})}const Hc=s=>C0.test(s);function bl(s){const n=s.trim();return n?n.length>255||!E0.test(n)?"That doesn’t look like an IP address or host name.":null:"Enter the TV’s IP address."}const G2=s=>s===s.trim()&&bl(s)===null,O0=fe({modelName:le().max(64).optional(),osVersion:le().max(64).optional(),firmwareVersion:le().max(64).optional(),socName:le().max(64).optional(),from:le().max(300),at:ke(),v:ke().optional()}),L0=2;function Uc(s,n){const l=o=>o?o.slice(0,64):void 0;return O0.parse({...n.modelName?{modelName:l(n.modelName)}:{},...n.osVersion?{osVersion:l(n.osVersion)}:{},...n.firmwareVersion?{firmwareVersion:l(n.firmwareVersion)}:{},...n.socName?{socName:l(n.socName)}:{},from:`${s.host}:${s.port}`,at:Date.now(),v:L0})}const ua=fe({id:le(),name:le().min(1).max(64),mode:Ft(["devmode","rooted"]),host:le().min(1).max(255),port:ke().int().min(1).max(65535),username:le().min(1).max(64),auth:w0,description:le().max(200).optional(),info:O0.optional(),createdAt:ke(),updatedAt:ke()}),Y2=ua.extend({host:le().trim().refine(s=>bl(s)===null,"Not a valid IP address or host name."),username:le().refine(Hc,"Not a valid user name.")}),Z2=fe({format:_l("lg-dev-manager/devices"),version:_l(1),exportedAt:ke(),devices:vs(Y2).max(500)});class M0 extends Error{name="BackupError"}const X2="That file is not an LG Dev Manager device backup.";function W2(s,n){const l=s.issues.find(h=>h.path[0]==="devices"&&typeof h.path[1]=="number");if(!l)return X2;const o=l.path[1],d=n.devices?.[o]?.name,_=typeof d=="string"&&d.trim()?`“${d.trim().slice(0,64)}”`:`number ${o+1}`,w=l.path[2];return`Nothing was imported: TV ${_} in this backup ${w==="username"?"has a user name that isn’t allowed":w==="host"?"has an address that isn’t an IP address or host name":"has settings this app can’t use"}. Only import backups you made yourself.`}const Q2="lgdm",J2=2,aa="devices",As="screenshots",Mf="lgdm-active-device";function zc(s){return new Promise((n,l)=>{s.onsuccess=()=>n(s.result),s.onerror=()=>l(s.error)})}let oc=null;function ir(){return oc??=new Promise((s,n)=>{const l=indexedDB.open(Q2,J2);l.onupgradeneeded=()=>{const o=l.result;o.objectStoreNames.contains(aa)||o.createObjectStore(aa,{keyPath:"id"}),o.objectStoreNames.contains(As)||o.createObjectStore(As,{keyPath:"id"}).createIndex("deviceId","deviceId")},l.onsuccess=()=>{l.result.onversionchange=()=>{l.result.close(),oc=null},s(l.result)},l.onerror=()=>{oc=null,n(l.error)}}),oc}async function nr(s,n){const l=await ir();return zc(n(l.transaction(aa,s).objectStore(aa)))}async function eN(s){const n=await ir();await new Promise((l,o)=>{const d=n.transaction(As,"readwrite"),_=d.objectStore(As).index("deviceId").openKeyCursor(IDBKeyRange.only(s));_.onsuccess=()=>{const w=_.result;w&&(d.objectStore(As).delete(w.primaryKey),w.continue())},d.oncomplete=()=>l(),d.onerror=()=>o(d.error)}),Sl.forEach(l=>l())}async function tN(){const s=await ir();await zc(s.transaction(As,"readwrite").objectStore(As).clear()),Sl.forEach(n=>n())}const Sl=new Set,Bf=new Set,ha=()=>Bf.forEach(s=>s());function My(s){return Bf.add(s),()=>Bf.delete(s)}async function gm(){return(await nr("readonly",n=>n.getAll())).map(n=>ua.safeParse(n)).flatMap(n=>n.success?[n.data]:[]).sort((n,l)=>n.name.localeCompare(l.name))}async function B0(s){const n=await nr("readonly",o=>o.get(s)),l=ua.safeParse(n);return l.success?l.data:void 0}async function sN(s){const n=Date.now(),l=ua.parse({...s,id:crypto.randomUUID(),createdAt:n,updatedAt:n});return await nr("readwrite",o=>o.add(l)),$c()||Nn(l.id),ha(),l}async function iN(s,n){const l=await B0(s);if(!l)throw new Error("Device not found");const o=ua.parse({...l,...n,id:s,updatedAt:Date.now()});return await nr("readwrite",d=>d.put(o)),ha(),o}async function vm(s,n){const l=await B0(s);l&&(await nr("readwrite",o=>o.put(ua.parse({...l,info:n}))),ha())}async function nN(s){if(await nr("readwrite",n=>n.delete(s)),await eN(s).catch(()=>{}),$c()===s){const n=await gm();Nn(n[0]?.id??null)}ha()}function $c(){try{return localStorage.getItem(Mf)}catch{return null}}function Nn(s){try{s?localStorage.setItem(Mf,s):localStorage.removeItem(Mf)}catch{}ha()}function gt(s){return{host:s.host,port:s.port,username:s.username,auth:s.auth}}async function rN(){return{format:"lg-dev-manager/devices",version:1,exportedAt:Date.now(),devices:await gm()}}async function aN(s){const n=Z2.safeParse(s);if(!n.success)throw new M0(W2(n.error,s));const l=n.data,o=await ir();return await new Promise((d,_)=>{const w=o.transaction(aa,"readwrite");for(const c of l.devices)w.objectStore(aa).put(c);w.oncomplete=()=>d(),w.onerror=()=>_(w.error)}),!$c()&&l.devices[0]&&Nn(l.devices[0].id),ha(),l.devices.length}async function lN(){await nr("readwrite",s=>s.clear()),await tN().catch(()=>{}),Nn(null)}function Mt(){const[s,n]=M.useState(null),l=M.useSyncExternalStore(My,$c,()=>null);M.useEffect(()=>{let d=!0;const _=()=>gm().then(c=>d&&n(c)).catch(()=>d&&n([]));_();const w=My(_);return()=>{d=!1,w()}},[]);const o=s?.find(d=>d.id===l)??null;return{devices:s,active:o,activeId:l,loading:s===null}}const oN=[[/^OLED\d{2,3}([A-Z])([0-9X])/,s=>`${s[1]}${s[2]}`],[/^\d{2,3}(QNED\d{2}|NANO\d{2})/,s=>s[1]],[/^\d{2,3}((?:U[A-Z]|S[KM])\d{2})/,s=>s[1]],[/^\d{2}ART10/,()=>"StanbyME"]];function _m(s){const n=s?.trim().toUpperCase();if(n)for(const[l,o]of oN){const d=n.match(l);if(d)return o(d)}}function xl(s){const n=_m(s);return n?`LG ${n}`:s?.trim()||void 0}function If(s){const n=s?.trim();if(!n)return;const l=_m(n);return l?`LG ${l} · ${n}`:n}function cN(){const s=Cl(),{devices:n,active:l}=Mt();return r.jsx(Ic,{label:"Choose TV",placement:"up-left",className:"device-switcher",menuClassName:"dd-menu--compact",trigger:({toggle:o,...d})=>r.jsxs("button",{type:"button",className:"workspace",title:"Choose TV","aria-label":l?`Active TV: ${l.name}. Choose TV`:"Choose TV",onClick:o,...d,children:[r.jsx("div",{className:"workspace-avatar",children:r.jsx(ce,{name:"tv"})}),r.jsxs("div",{className:"workspace-text",children:[r.jsx("div",{className:"workspace-name",children:l?.name??"No TV selected"}),r.jsx("div",{className:"workspace-role",children:l?`${xl(l.info?.modelName)??l.host} · ${l.mode==="rooted"?"rooted":"Dev Mode"}`:n?.length?"choose a TV":"add a TV to start"})]}),r.jsx(ce,{name:"updown",className:"workspace-chev",strokeWidth:1.8})]}),children:o=>r.jsxs(r.Fragment,{children:[!!n?.length&&r.jsx("div",{className:"dd-section-label",children:"Your TVs"}),n?.map(d=>r.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":d.id===l?.id,className:`dd-menu-item${d.id===l?.id?" is-active":""}`,onClick:()=>{Nn(d.id),o()},children:[r.jsx(ce,{name:"tv"}),r.jsxs("span",{className:"dd-menu-text",children:[r.jsx("span",{children:d.name}),r.jsx("span",{className:"dd-menu-sub mono",children:[xl(d.info?.modelName),d.host].filter(Boolean).join(" · ")})]}),d.id===l?.id&&r.jsx(ce,{name:"check",className:"dd-check",strokeWidth:2.4})]},d.id)),!!n?.length&&r.jsx("div",{className:"dd-divider"}),r.jsxs("button",{type:"button",role:"menuitem",className:"dd-menu-item",onClick:()=>(o(),s("/devices/new")),children:[r.jsx(ce,{name:"plus"})," Add a TV"]}),r.jsxs("button",{type:"button",role:"menuitem",className:"dd-menu-item",onClick:()=>(o(),s("/devices")),children:[r.jsx(ce,{name:"wrench"})," Manage devices"]})]})})}function uN({item:s,pathname:n}){const l=s.children.some(f=>n.startsWith(f.to)),[o,d]=M.useState(l),_=mm(D0),[w,c]=M.useState(null),h=M.useRef(null),y=_?!!w:o||l;M.useEffect(()=>c(null),[n,_]),M.useEffect(()=>{if(!w)return;const f=j=>!h.current?.contains(j.target)&&c(null),x=j=>j.key==="Escape"&&c(null),C=()=>c(null);return document.addEventListener("pointerdown",f),document.addEventListener("keydown",x),window.addEventListener("resize",C),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",x),window.removeEventListener("resize",C)}},[w]);const p=f=>{if(!_)return d(!y);if(w)return c(null);const x=f.currentTarget.getBoundingClientRect(),C=s.children.length*40+14;c({top:Math.max(8,Math.min(x.top,window.innerHeight-C-8)),left:x.right+10})};return r.jsxs("div",{ref:h,className:`nav-item-group${y?" is-open":""}`,children:[r.jsxs("button",{type:"button",className:`nav-link${_&&l?" is-active":""}`,"aria-expanded":y,"aria-label":_?s.text:void 0,title:_?s.text:void 0,onClick:p,children:[r.jsx(ce,{name:s.icon}),r.jsx("span",{children:s.text}),r.jsx(ce,{name:"chevRight",className:"chev",strokeWidth:1.8})]}),r.jsx("div",{className:"nav-submenu",style:_&&w?w:void 0,children:s.children.map(f=>r.jsx(im,{to:f.to,className:({isActive:x})=>x?"is-active":void 0,children:f.text},f.key))})]})}function hN({item:s,pathname:n}){const l=mm(D0);if(s.children)return r.jsx(uN,{item:s,pathname:n});const o=l?{title:s.text,"aria-label":s.text}:{},d=r.jsxs(r.Fragment,{children:[r.jsx(ce,{name:s.icon}),r.jsx("span",{children:s.text}),s.badge&&r.jsx("span",{className:`nav-badge ${s.badge.kind}`,children:s.badge.text})]});return s.href?r.jsx("a",{className:"nav-link",href:s.href,target:"_blank",rel:"noopener noreferrer",...o,children:d}):r.jsx(im,{to:s.to,className:({isActive:_})=>`nav-link${_?" is-active":""}`,...o,children:d})}function dN(){const{pathname:s}=_s();return r.jsxs("aside",{className:"d-sidebar",children:[r.jsxs(Jt,{to:"/",className:"brand",children:[r.jsx("div",{className:"brand-logo",children:r.jsx(ce,{name:"tv",strokeWidth:2})}),r.jsxs("div",{className:"brand-text",children:[r.jsx("div",{className:"brand-name",children:"LG Dev Manager"}),r.jsxs("div",{className:"brand-tag",children:["v",A0]})]})]}),r.jsx("div",{className:"sidebar-scroll",children:pm.map(n=>r.jsxs("nav",{className:"nav-section",children:[r.jsx("div",{className:"nav-label",children:n.label}),n.items.map(l=>r.jsx(hN,{item:l,pathname:s},l.key))]},n.label))}),r.jsx("div",{className:"sidebar-footer",children:r.jsx(cN,{})})]})}const fN="lgdm-theme";function I0(){return document.documentElement.getAttribute("data-theme")==="dark"?"dark":"light"}function mN(s){document.documentElement.setAttribute("data-theme",s);try{localStorage.setItem(fN,s)}catch{}}function H0(){const s=I0()==="dark"?"light":"dark";return mN(s),s}function pN(){const{status:s}=Pi(),n={unpaired:{cls:"",text:"Bridge not set up"},connecting:{cls:" is-connecting",text:"Connecting…"},connected:{cls:" is-connected",text:"Bridge connected"},error:{cls:" is-error",text:"Bridge offline"}},{cls:l,text:o}=n[s.state];return r.jsxs(Jt,{to:"/bridge",className:`bridge-pill${l}`,title:s.state==="error"?s.message:o,children:[r.jsx("span",{className:"dot","aria-hidden":"true"}),r.jsx("span",{children:o})]})}function gN({onOpenDrawer:s,onOpenPalette:n}){const{pathname:l}=_s(),o=q2(l),[d,_]=M.useState(I0),w=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);return r.jsxs("header",{className:"d-topbar",children:[r.jsxs("div",{className:"crumbs",children:[r.jsx("button",{className:"hamburger",onClick:s,"aria-label":"Open navigation",children:r.jsx(ce,{name:"menu",strokeWidth:2})}),o.map((c,h)=>r.jsxs(M.Fragment,{children:[h>0&&r.jsx(ce,{name:"chevRight",className:"sep",strokeWidth:2}),r.jsx("span",{className:h===o.length-1?"current":void 0,children:c})]},h))]}),r.jsxs("div",{className:"topbar-actions",children:[r.jsxs("button",{className:"cmd",onClick:n,children:[r.jsx(ce,{name:"search"}),r.jsx("span",{children:"Search..."}),r.jsx("kbd",{className:"kbd",children:w?"⌘K":"Ctrl K"})]}),r.jsx(pN,{}),r.jsx("button",{className:"icon-btn","aria-label":`Switch to ${d==="dark"?"light":"dark"} theme`,onClick:()=>_(H0()),children:r.jsx(ce,{name:d==="dark"?"sun":"moon",strokeWidth:1.8})})]})]})}function vN(){const{status:s}=Pi();return r.jsxs("footer",{className:"d-footer",children:[r.jsxs("div",{children:["Based on"," ",r.jsx("a",{href:"https://github.com/webosbrew/dev-manager-desktop",target:"_blank",rel:"noopener noreferrer",children:"webOS Dev Manager"})," ","· design by"," ",r.jsx("a",{href:"https://github.com/puikinsh/adminator-admin-dashboard",target:"_blank",rel:"noopener noreferrer",children:"Adminator"}),r.jsx("div",{className:"d-footer-note",children:"Not affiliated with or endorsed by LG Electronics. LG and webOS are trademarks of LG Electronics."})]}),r.jsxs("div",{className:"d-footer-meta",children:[r.jsxs("span",{children:["web v",A0]}),r.jsx("span",{children:s.state==="connected"?`bridge v${s.bridgeVersion}`:"no bridge"})]})]})}function _N(s,n){if(!n)return 1;const l=s.label.toLowerCase();return l===n?100:l.startsWith(n)?50:l.includes(n)?20:s.section.toLowerCase().includes(n)?5:0}function yN({open:s,onClose:n}){const l=Cl(),[o,d]=M.useState(""),[_,w]=M.useState(0),c=M.useRef(null),{devices:h,activeId:y}=Mt(),p=M.useMemo(()=>{const C=[];for(const j of pm)for(const E of j.items)if(E.children)for(const g of E.children)C.push({label:g.text,section:`${j.label} › ${E.text}`,icon:E.icon,run:()=>l(g.to)});else E.to?C.push({label:E.text,section:j.label,icon:E.icon,run:()=>l(E.to)}):E.href&&C.push({label:E.text,section:"External",icon:E.icon,run:()=>window.open(E.href,"_blank","noopener")});C.push({label:"Toggle theme (light / dark)",section:"Action",icon:"sun",run:()=>H0()}),C.push({label:"Add a TV",section:"Action",icon:"plus",run:()=>l("/devices/new")}),C.push({label:"Install an IPK",section:"Action",icon:"upload",run:()=>l("/apps/installed")});for(const j of h??[])j.id!==y&&C.push({label:`Switch to ${j.name}`,section:"TV",icon:"tv",run:()=>Nn(j.id)});return C},[l,h,y]),f=M.useMemo(()=>{const C=o.trim().toLowerCase();return p.map(j=>({item:j,s:_N(j,C)})).filter(j=>j.s>0).sort((j,E)=>E.s-j.s).slice(0,12).map(j=>j.item)},[p,o]);if(M.useEffect(()=>(document.body.classList.toggle("has-palette-open",s),s&&(d(""),w(0),requestAnimationFrame(()=>c.current?.focus())),()=>document.body.classList.remove("has-palette-open")),[s]),M.useEffect(()=>w(0),[o]),!s)return null;const x=C=>{C&&(n(),C.run())};return r.jsx("div",{className:"palette-backdrop",onMouseDown:C=>C.target===C.currentTarget&&n(),children:r.jsxs("div",{className:"palette-modal",role:"dialog","aria-modal":"true","aria-label":"Command palette",onKeyDown:C=>{C.key==="Escape"?n():C.key==="ArrowDown"?(C.preventDefault(),w(j=>Math.min(j+1,f.length-1))):C.key==="ArrowUp"?(C.preventDefault(),w(j=>Math.max(j-1,0))):C.key==="Enter"&&(C.preventDefault(),x(f[_]))},children:[r.jsxs("div",{className:"palette-input-row",children:[r.jsxs("svg",{viewBox:"0 0 24 24",className:"palette-icon","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:2,children:[r.jsx("circle",{cx:"11",cy:"11",r:"7"}),r.jsx("path",{d:"m21 21-4.3-4.3"})]}),r.jsx("input",{ref:c,className:"palette-input",type:"text",placeholder:"Search pages, actions…",autoComplete:"off",spellCheck:!1,value:o,onChange:C=>d(C.target.value),"aria-label":"Search"}),r.jsx("kbd",{className:"palette-esc",children:"esc"})]}),r.jsx("div",{className:"palette-results",role:"listbox",children:f.length===0?r.jsx("div",{className:"palette-empty",children:"No results"}):f.map((C,j)=>r.jsxs("div",{className:`palette-result${j===_?" is-selected":""}`,role:"option","aria-selected":j===_,onMouseEnter:()=>w(j),onClick:()=>x(C),children:[r.jsx("span",{className:"palette-result-icon",children:r.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,dangerouslySetInnerHTML:{__html:k0[C.icon]}})}),r.jsx("span",{className:"palette-result-label",children:C.label}),r.jsx("span",{className:"palette-result-section",children:C.section})]},`${C.section}/${C.label}`))}),r.jsxs("div",{className:"palette-foot",children:[r.jsxs("span",{children:[r.jsx("kbd",{children:"↑"}),r.jsx("kbd",{children:"↓"})," navigate"]}),r.jsxs("span",{children:[r.jsx("kbd",{children:"↵"})," select"]}),r.jsxs("span",{children:[r.jsx("kbd",{children:"esc"})," close"]})]})]})})}function ut(){const{client:s,status:n}=Pi(),l=n.state==="connected"&&!!s,o=M.useCallback((d,_,w)=>s?s.call(d,_,w):Promise.reject(new yt("disconnected","The bridge is not connected.")),[s]);return{ready:l,call:o,client:s}}function pc(s,n,l){return s.on(h2,o=>{const d=u2.safeParse(o);d.success&&d.data.opId===n&&l(d.data)})}const ea=()=>crypto.randomUUID(),Ld=1024*1024;function bN(s){return new Promise((n,l)=>{const o=new FileReader;o.onload=()=>{const d=String(o.result);n(d.slice(d.indexOf(",")+1))},o.onerror=()=>l(o.error??new Error("Could not read the file.")),o.readAsDataURL(s)})}async function U0(s,n,l,o){const{uploadId:d}=await s.call("upload.begin",{name:n.name,size:n.size});try{for(let _=0;_<n.size;_+=Ld){if(o?.aborted)throw new yt("cancelled","Cancelled.");const w=await bN(n.slice(_,_+Ld));await s.call("upload.chunk",{uploadId:d,offset:_,data:w},6e4),l?.(Math.min(n.size,_+Ld),n.size)}return d}catch(_){throw s.call("upload.discard",{uploadId:d}).catch(()=>{}),_}}function xt(s){return s instanceof yt?{code:s.code,message:s.message,detail:s.detail}:s instanceof Error?{code:"error",message:s.message}:{code:"error",message:String(s)}}function Nt({error:s,title:n,hint:l,action:o}){const{code:d,message:_,detail:w}=xt(s);return r.jsxs($e,{kind:"danger",title:n,action:o,children:[r.jsx("div",{children:_}),l&&r.jsx("div",{className:"alert-hint",children:l}),r.jsxs("details",{className:"error-details",children:[r.jsx("summary",{children:"Technical details"}),r.jsx("pre",{children:[`code: ${d}`,w].filter(Boolean).join(`
|
|
12
12
|
`)})]})]})}const By=400;class SN{entries=[];listeners=new Set;subscribe=n=>(this.listeners.add(n),()=>this.listeners.delete(n));getSnapshot=()=>this.entries;set(n){this.entries=n.length>By?n.slice(n.length-By):n,this.listeners.forEach(l=>l())}update(n,l){const o=this.entries.findIndex(_=>_.id===n);if(o<0)return;const d=this.entries.slice();d[o]={...d[o],...l(d[o])},this.set(d)}log(n){n.phase==="start"?this.set([...this.entries,{id:n.id,source:"bridge",target:n.target,command:n.command,kind:n.kind,quiet:!!n.quiet,startedAt:n.at,output:"",running:!0}]):this.update(n.id,()=>({running:!1,durationMs:n.durationMs,exitCode:n.exitCode,output:n.output??"",error:n.error}))}startManual(n,l,o){this.set([...this.entries,{id:n,source:"manual",target:l,command:o,kind:"stream",quiet:!1,startedAt:Date.now(),output:"",running:!0}])}appendManual(n,l){this.update(n,o=>({output:(o.output+l).slice(-262144)}))}finishManual(n,l){this.update(n,o=>({running:!1,durationMs:Date.now()-o.startedAt,...l}))}clear(){this.set(this.entries.filter(n=>n.running))}}const bn=new SN;class xN{value=null;listeners=new Set;subscribe=n=>(this.listeners.add(n),()=>this.listeners.delete(n));getSnapshot=()=>this.value;set(n){this.value=n,this.listeners.forEach(l=>l())}}const kc=new xN,z0="lgdm-console",Iy=140,Hy=300;function wN(){try{const s=JSON.parse(localStorage.getItem(z0)??"{}");return{open:!!s.open,height:Number(s.height)||Hy,showQuiet:!!s.showQuiet}}catch{return{open:!1,height:Hy,showQuiet:!1}}}function CN(s){try{localStorage.setItem(z0,JSON.stringify(s))}catch{}}function EN(){const{client:s}=Pi();M.useEffect(()=>{if(!s)return;const n=s.on(f2,o=>{const d=d2.safeParse(o);d.success&&bn.log(d.data)}),l=s.on(p2,o=>{const d=m2.safeParse(o);d.success&&bn.appendManual(d.data.opId,d.data.data)});return()=>{n(),l()}},[s])}const NN=s=>new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),jN=s=>s===void 0?"":s<1e3?`${s} ms`:`${(s/1e3).toFixed(1)} s`;function TN({e:s}){return s.running?r.jsxs("span",{className:"cons-status is-running",children:[r.jsx("span",{className:"spinner sm"})," running"]}):s.cancelled?r.jsx("span",{className:"cons-status is-warn",children:"stopped"}):s.error?r.jsx("span",{className:"cons-status is-err",title:s.error,children:"failed"}):s.exitCode===0||s.exitCode===void 0&&!s.error?r.jsx("span",{className:"cons-status is-ok",children:s.exitCode===0?"exit 0":"done"}):s.exitCode===null?r.jsx("span",{className:"cons-status",children:"closed"}):r.jsxs("span",{className:"cons-status is-err",children:["exit ",s.exitCode]})}function kN({e:s,expanded:n,onToggle:l}){const o=!!(s.output||s.error),d=s.source==="manual"||n;return r.jsxs("div",{className:`cons-entry is-${s.source}${s.running?" is-running":""}`,children:[r.jsxs("button",{type:"button",className:"cons-line",onClick:l,"aria-expanded":o?d:void 0,disabled:!o,children:[r.jsx("span",{className:"cons-time",children:NN(s.startedAt)}),r.jsx("span",{className:"cons-target",children:s.target}),r.jsxs("span",{className:"cons-cmd",children:[r.jsx("span",{className:"cons-prompt",children:s.kind==="sftp"||s.kind==="tunnel"||s.kind==="http"?"⇄":"$"})," ",s.command]}),r.jsxs("span",{className:"cons-meta",children:[!o&&!s.running&&s.kind!=="sftp"&&s.kind!=="tunnel"&&s.kind!=="http"&&r.jsx("span",{className:"cons-nooutput",children:"no output"}),r.jsx(TN,{e:s}),r.jsx("span",{className:"cons-dur",children:jN(s.durationMs)})]})]}),d&&o&&r.jsxs("pre",{className:"cons-output",children:[s.output,s.error&&r.jsxs("span",{className:"cons-error",children:[s.output?`
|
|
13
13
|
`:"",s.error]})]})]})}function RN(){EN();const s=M.useSyncExternalStore(bn.subscribe,bn.getSnapshot),{ready:n,client:l}=ut(),{active:o}=Mt(),d=M.useSyncExternalStore(kc.subscribe,kc.getSnapshot),_=M.useMemo(()=>d?{name:d.name,host:d.host,port:d.port,username:d.username,target:d.device}:o?{name:o.name,host:o.host,port:o.port,username:o.username,target:gt(o)}:null,[d,o]),[w,c]=M.useState(wN),[h,y]=M.useState(!1),[p,f]=M.useState(""),[x,C]=M.useState([]),[j,E]=M.useState(-1),[g,b]=M.useState(null),[v,S]=M.useState(new Set),N=M.useRef(null),T=M.useRef(null),D=M.useRef(!0),O=I=>c(A=>{const B={...A,...I};return CN(B),B}),k=M.useMemo(()=>s.filter(I=>w.showQuiet||!I.quiet),[s,w.showQuiet]),L=s.filter(I=>I.running),V=k[k.length-1];M.useLayoutEffect(()=>{const I=N.current;I&&D.current&&(I.scrollTop=I.scrollHeight)},[k,w.open]),M.useEffect(()=>{h&&w.open&&T.current?.focus()},[h,w.open]),M.useEffect(()=>{document.documentElement.style.setProperty("--console-h",`${w.open?w.height+44:44}px`)},[w.open,w.height]);const q=_?`${_.username}@${_.name}`:"no TV",Y=h&&n&&!!_&&!g,P=async()=>{const I=p.trim();if(!I||!l||!_||g)return;const A=ea();f(""),C(B=>[...B.filter(F=>F!==I),I].slice(-100)),E(-1),D.current=!0,bn.startManual(A,`${_.username}@${_.host}:${_.port}`,I),b(A);try{const B=await l.call("cmd.stream",{device:_.target,command:I,opId:A},18e5);bn.finishManual(A,B)}catch(B){bn.finishManual(A,{error:xt(B).message})}finally{b(null),requestAnimationFrame(()=>T.current?.focus())}},Q=()=>{g&&l&&l.call("cmd.cancel",{opId:g}).catch(()=>{})},he=I=>{if(I.key==="Enter")I.preventDefault(),P();else if(I.key==="ArrowUp"&&x.length){I.preventDefault();const A=j<0?x.length-1:Math.max(0,j-1);E(A),f(x[A])}else if(I.key==="ArrowDown"&&j>=0){I.preventDefault();const A=j+1;A>=x.length?(E(-1),f("")):(E(A),f(x[A]))}},ne=I=>{I.key==="c"&&I.ctrlKey&&g&&(I.preventDefault(),Q())},W=I=>{I.preventDefault();const A=I.clientY,B=w.height,F=Math.max(Iy,window.innerHeight-160),$=z=>O({height:Math.min(F,Math.max(Iy,B+A-z.clientY))}),J=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",J)};window.addEventListener("pointermove",$),window.addEventListener("pointerup",J)};return r.jsxs("section",{className:`console-dock${w.open?" is-open":""}`,"aria-label":"Console",onKeyDown:ne,children:[w.open&&r.jsx("div",{className:"cons-resize",onPointerDown:W,role:"separator","aria-orientation":"horizontal","aria-label":"Resize console"}),r.jsxs("div",{className:"cons-bar",children:[r.jsxs("button",{type:"button",className:"cons-toggle",onClick:()=>O({open:!w.open}),"aria-expanded":w.open,children:[r.jsx(ce,{name:"terminal"}),r.jsx("span",{className:"cons-title",children:"Console"}),L.length>0?r.jsxs("span",{className:"badge primary dot",children:[L.length," running"]}):r.jsx("span",{className:"cons-count",children:k.length}),!w.open&&V&&r.jsxs("span",{className:"cons-last mono",children:["$ ",V.command]}),r.jsx(ce,{name:"chevRight",className:`cons-chev${w.open?" is-open":""}`,strokeWidth:2})]}),r.jsxs("div",{className:"cons-tools",children:[r.jsxs("label",{className:"check",title:"Type commands and run them on the active TV",children:[r.jsx("input",{type:"checkbox",checked:h,onChange:I=>{y(I.target.checked),I.target.checked&&!w.open&&O({open:!0})}}),r.jsx("span",{className:"box"}),r.jsx("span",{className:"cons-check-label",children:"Send commands"})]}),w.open&&r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"check cons-quiet",title:"Show routine background reads such as app icons",children:[r.jsx("input",{type:"checkbox",checked:w.showQuiet,onChange:I=>O({showQuiet:I.target.checked})}),r.jsx("span",{className:"box"}),r.jsx("span",{className:"cons-check-label",children:"Background reads"})]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>bn.clear(),disabled:!s.length,children:"Clear"})]})]})]}),w.open&&r.jsxs("div",{className:"cons-body",style:{height:w.height},children:[r.jsx("div",{className:"cons-list",ref:N,onScroll:I=>{const A=I.currentTarget;D.current=A.scrollHeight-A.scrollTop-A.clientHeight<24},children:k.length===0?r.jsxs("div",{className:"cons-empty",children:["Commands the bridge runs on your TV appear here — listing apps, installs, file transfers. Tick ",r.jsx("b",{children:"Send commands"})," to type your own."]}):k.map(I=>r.jsx(kN,{e:I,expanded:v.has(I.id)||!!I.error&&!I.quiet,onToggle:()=>S(A=>{const B=new Set(A);return B.has(I.id)?B.delete(I.id):B.add(I.id),B})},I.id))}),h&&r.jsx("div",{className:"cons-input-row",children:!n||!_?r.jsx("span",{className:"cons-hint",children:n?"Choose a TV to send commands to.":"Connect the bridge to send commands."}):r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"cons-ps1 mono",htmlFor:"console-input",children:[q," $"]}),r.jsx("input",{id:"console-input",ref:T,className:"cons-input mono",value:p,onChange:I=>f(I.target.value),onKeyDown:he,disabled:!Y,placeholder:g?"Running… (Ctrl+C to stop)":"Type a command and press Enter — e.g. uname -a",autoComplete:"off",spellCheck:!1,"aria-label":`Command to run on ${_.name}`}),g?r.jsx("button",{type:"button",className:"btn btn--sm btn--soft-danger",onClick:Q,children:"Stop"}):r.jsx("button",{type:"button",className:"btn btn--sm btn--soft-primary",onClick:P,disabled:!p.trim(),children:"Run"})]})}),h&&n&&_&&r.jsxs("div",{className:"cons-warning",children:["Commands run directly on ",_.name," as ",r.jsx("span",{className:"mono",children:_.username}),". There is no undo."]})]})]})}const DN=1440*60*1e3;function AN(){const{ready:s,call:n}=ut(),{active:l}=Mt(),o=M.useRef(new Set);M.useEffect(()=>{if(!s||!l)return;const d=`${l.host}:${l.port}`,_=l.info&&l.info.from===d&&l.info.v===L0&&Date.now()-l.info.at<DN,w=`${l.id}@${d}`;_||o.current.has(w)||(o.current.add(w),n("device.info",{device:gt(l),quiet:!0},4e4).then(c=>vm(l.id,Uc(l,c))).catch(()=>{}))},[s,l,n])}function ON(s=navigator){return s.userAgentData?.mobile||/Android|iPhone|iPad|iPod|Mobile|Silk|Kindle|Opera Mini/i.test(s.userAgent)?!0:/Macintosh/.test(s.userAgent)&&s.maxTouchPoints>1}const Uy="lgdm-phone-notice-dismissed";function $0({always:s=!1}){const[n,l]=M.useState(()=>{try{return sessionStorage.getItem(Uy)==="1"}catch{return!1}});if(!ON()||n&&!s)return null;const o=()=>{l(!0);try{sessionStorage.setItem(Uy,"1")}catch{}};return r.jsx("div",{className:"phone-notice",children:r.jsx($e,{kind:"warning",title:"Use a computer for this",action:s?void 0:r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:o,children:"Got it"}),children:"LG Dev Manager talks to your TV through the bridge, a small program that has to run on the same computer as this browser. Phones and tablets can’t run it, and the workarounds — running it in a terminal app on the phone, or opening a bridge to your Wi-Fi — are risky: the bridge holds your TV’s keys and passwords and can do anything on the TV, including as root. Please open this page on a desktop or laptop instead."})})}var Md,zy;function Pc(){if(zy)return Md;zy=1;var s={};return Md=typeof process=="object"&&s&&s.NODE_DEBUG&&/\bsemver\b/i.test(s.NODE_DEBUG)?(...l)=>console.error("SEMVER",...l):()=>{},Md}var Bd,$y;function ym(){if($y)return Bd;$y=1;const s="2.0.0",n=256,l=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,d=n-6;return Bd={MAX_LENGTH:n,MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:d,MAX_SAFE_INTEGER:l,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:s,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Bd}var cc={exports:{}},Py;function Fc(){return Py||(Py=1,(function(s,n){const{MAX_SAFE_COMPONENT_LENGTH:l,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:d}=ym(),_=Pc();n=s.exports={};const w=n.re=[],c=n.safeRe=[],h=n.src=[],y=n.safeSrc=[],p=n.t={};let f=0;const x="[a-zA-Z0-9-]",C=[["\\s",1],["\\d",d],[x,o]],j=g=>{for(const[b,v]of C)g=g.split(`${b}*`).join(`${b}{0,${v}}`).split(`${b}+`).join(`${b}{1,${v}}`);return g},E=(g,b,v)=>{const S=j(b),N=f++;_(g,N,b),p[g]=N,h[N]=b,y[N]=S,w[N]=new RegExp(b,v?"g":void 0),c[N]=new RegExp(S,v?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${x}*`),E("MAINVERSION",`(${h[p.NUMERICIDENTIFIER]})\\.(${h[p.NUMERICIDENTIFIER]})\\.(${h[p.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${h[p.NUMERICIDENTIFIERLOOSE]})\\.(${h[p.NUMERICIDENTIFIERLOOSE]})\\.(${h[p.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${h[p.NONNUMERICIDENTIFIER]}|${h[p.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${h[p.NONNUMERICIDENTIFIER]}|${h[p.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${h[p.PRERELEASEIDENTIFIER]}(?:\\.${h[p.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${h[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[p.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${x}+`),E("BUILD",`(?:\\+(${h[p.BUILDIDENTIFIER]}(?:\\.${h[p.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${h[p.MAINVERSION]}${h[p.PRERELEASE]}?${h[p.BUILD]}?`),E("FULL",`^${h[p.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${h[p.MAINVERSIONLOOSE]}${h[p.PRERELEASELOOSE]}?${h[p.BUILD]}?`),E("LOOSE",`^${h[p.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${h[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${h[p.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${h[p.XRANGEIDENTIFIER]})(?:\\.(${h[p.XRANGEIDENTIFIER]})(?:\\.(${h[p.XRANGEIDENTIFIER]})(?:${h[p.PRERELEASE]})?${h[p.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${h[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[p.XRANGEIDENTIFIERLOOSE]})(?:${h[p.PRERELEASELOOSE]})?${h[p.BUILD]}?)?)?`),E("XRANGE",`^${h[p.GTLT]}\\s*${h[p.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${h[p.GTLT]}\\s*${h[p.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${l}})(?:\\.(\\d{1,${l}}))?(?:\\.(\\d{1,${l}}))?`),E("COERCE",`${h[p.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",h[p.COERCEPLAIN]+`(?:${h[p.PRERELEASE]})?(?:${h[p.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",h[p.COERCE],!0),E("COERCERTLFULL",h[p.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${h[p.LONETILDE]}\\s+`,!0),n.tildeTrimReplace="$1~",E("TILDE",`^${h[p.LONETILDE]}${h[p.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${h[p.LONETILDE]}${h[p.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${h[p.LONECARET]}\\s+`,!0),n.caretTrimReplace="$1^",E("CARET",`^${h[p.LONECARET]}${h[p.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${h[p.LONECARET]}${h[p.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${h[p.GTLT]}\\s*(${h[p.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${h[p.GTLT]}\\s*(${h[p.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${h[p.GTLT]}\\s*(${h[p.LOOSEPLAIN]}|${h[p.XRANGEPLAIN]})`,!0),n.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${h[p.XRANGEPLAIN]})\\s+-\\s+(${h[p.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${h[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[p.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(cc,cc.exports)),cc.exports}var Id,Fy;function bm(){if(Fy)return Id;Fy=1;const s=Object.freeze({loose:!0}),n=Object.freeze({});return Id=o=>o?typeof o!="object"?s:o:n,Id}var Hd,Vy;function LN(){if(Vy)return Hd;Vy=1;const s=/^[0-9]+$/,n=(o,d)=>{if(typeof o=="number"&&typeof d=="number")return o===d?0:o<d?-1:1;const _=s.test(o),w=s.test(d);return _&&w&&(o=+o,d=+d),o===d?0:_&&!w?-1:w&&!_?1:o<d?-1:1};return Hd={compareIdentifiers:n,rcompareIdentifiers:(o,d)=>n(d,o)},Hd}var Ud,qy;function jl(){if(qy)return Ud;qy=1;const s=Pc(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:l}=ym(),{safeRe:o,t:d}=Fc(),_=bm(),{compareIdentifiers:w}=LN(),c=(y,p)=>{const f=p.split(".");if(f.length>y.length)return!1;for(let x=0;x<f.length;x++)if(w(y[x],f[x])!==0)return!1;return!0};class h{constructor(p,f){if(f=_(f),p instanceof h){if(p.loose===!!f.loose&&p.includePrerelease===!!f.includePrerelease)return p;p=p.version}else if(typeof p!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof p}".`);if(p.length>n)throw new TypeError(`version is longer than ${n} characters`);s("SemVer",p,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const x=p.trim().match(f.loose?o[d.LOOSE]:o[d.FULL]);if(!x)throw new TypeError(`Invalid Version: ${p}`);if(this.raw=p,this.major=+x[1],this.minor=+x[2],this.patch=+x[3],this.major>l||this.major<0)throw new TypeError("Invalid major version");if(this.minor>l||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>l||this.patch<0)throw new TypeError("Invalid patch version");x[4]?this.prerelease=x[4].split(".").map(C=>{if(/^[0-9]+$/.test(C)){const j=+C;if(j>=0&&j<l)return j}return C}):this.prerelease=[],this.build=x[5]?x[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(p){if(s("SemVer.compare",this.version,this.options,p),!(p instanceof h)){if(typeof p=="string"&&p===this.version)return 0;p=new h(p,this.options)}return p.version===this.version?0:this.compareMain(p)||this.comparePre(p)}compareMain(p){return p instanceof h||(p=new h(p,this.options)),this.major<p.major?-1:this.major>p.major?1:this.minor<p.minor?-1:this.minor>p.minor?1:this.patch<p.patch?-1:this.patch>p.patch?1:0}comparePre(p){if(p instanceof h||(p=new h(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;let f=0;do{const x=this.prerelease[f],C=p.prerelease[f];if(s("prerelease compare",f,x,C),x===void 0&&C===void 0)return 0;if(C===void 0)return 1;if(x===void 0)return-1;if(x===C)continue;return w(x,C)}while(++f)}compareBuild(p){p instanceof h||(p=new h(p,this.options));let f=0;do{const x=this.build[f],C=p.build[f];if(s("build compare",f,x,C),x===void 0&&C===void 0)return 0;if(C===void 0)return 1;if(x===void 0)return-1;if(x===C)continue;return w(x,C)}while(++f)}inc(p,f,x){if(p.startsWith("pre")){if(!f&&x===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const C=`-${f}`.match(this.options.loose?o[d.PRERELEASELOOSE]:o[d.PRERELEASE]);if(!C||C[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(p){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,x),this.inc("pre",f,x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,x),this.inc("pre",f,x);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const C=Number(x)?1:0;if(this.prerelease.length===0)this.prerelease=[C];else{let j=this.prerelease.length;for(;--j>=0;)typeof this.prerelease[j]=="number"&&(this.prerelease[j]++,j=-2);if(j===-1){if(f===this.prerelease.join(".")&&x===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(C)}}if(f){let j=[f,C];if(x===!1&&(j=[f]),c(this.prerelease,f)){const E=this.prerelease[f.split(".").length];isNaN(E)&&(this.prerelease=j)}else this.prerelease=j}break}default:throw new Error(`invalid increment argument: ${p}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ud=h,Ud}var zd,Ky;function da(){if(Ky)return zd;Ky=1;const s=jl();return zd=(l,o,d)=>new s(l,d).compare(new s(o,d)),zd}var $d,Gy;function P0(){if(Gy)return $d;Gy=1;const s=da();return $d=(l,o,d)=>s(l,o,d)>0,$d}var MN=P0();const Hf=la(MN);var Pd,Yy;function F0(){if(Yy)return Pd;Yy=1;const s=jl();return Pd=(l,o,d=!1)=>{if(l instanceof s)return l;try{return new s(l,o)}catch(_){if(!d)return null;throw _}},Pd}var Fd,Zy;function BN(){if(Zy)return Fd;Zy=1;const s=F0();return Fd=(l,o)=>{const d=s(l,o);return d?d.version:null},Fd}var IN=BN();const Xy=la(IN),Wy="lgdm-bridge-update-dismissed";function HN(s,n=ml){return!!Xy(s)&&!!Xy(n)&&Hf(n,s)}function V0({always:s=!1}){const{status:n}=Pi(),[l,o]=M.useState(()=>{try{return sessionStorage.getItem(Wy)}catch{return null}});if(n.state!=="connected"||!HN(n.bridgeVersion)||!s&&l===ml)return null;const d=()=>{o(ml);try{sessionStorage.setItem(Wy,ml)}catch{}};return r.jsx("div",{className:"page-notice",children:r.jsxs($e,{kind:"info",title:`Bridge v${ml} is available`,action:s?void 0:r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:d,children:"Later"}),children:["Yours is v",n.bridgeVersion,"."," ",n.distribution==="app"?r.jsxs(r.Fragment,{children:["Close it, download the new version from the"," ",r.jsx("a",{href:Of,target:"_blank",rel:"noopener noreferrer",children:"releases page"})," ","and start that one instead."]}):n.distribution==="source"?r.jsxs(r.Fragment,{children:["In the repository run ",r.jsx("span",{className:"mono",children:"git pull"}),", ",r.jsx("span",{className:"mono",children:"pnpm install"}),","," ",r.jsx("span",{className:"mono",children:"pnpm build"})," and ",r.jsx("span",{className:"mono",children:"pnpm bridge"}),"."]}):n.distribution==="npm"?r.jsxs(r.Fragment,{children:["Stop it (Ctrl+C) and start it again with ",r.jsx("span",{className:"mono",children:"npx lg-dev-manager-bridge@latest"}),"."]}):r.jsxs(r.Fragment,{children:["Stop it (Ctrl+C) and start it again with ",r.jsx("span",{className:"mono",children:"npx lg-dev-manager-bridge@latest"})," — or, if you run it from the repository, ",r.jsx("span",{className:"mono",children:"git pull"}),", ",r.jsx("span",{className:"mono",children:"pnpm install"}),","," ",r.jsx("span",{className:"mono",children:"pnpm build"})," and ",r.jsx("span",{className:"mono",children:"pnpm bridge"}),"; if you use the app, download the new version from the"," ",r.jsx("a",{href:Of,target:"_blank",rel:"noopener noreferrer",children:"releases page"}),"."]})," ","Your pairing stays the same."]})})}function $i({eyebrow:s,title:n,action:l,className:o="col-12",children:d}){return r.jsxs("section",{className:`card ${o}`,children:[r.jsxs("div",{className:"card-head",children:[r.jsxs("div",{className:"card-title-wrap",children:[s&&r.jsx("span",{className:"eyebrow",children:s}),r.jsx("h2",{className:"card-title",children:n})]}),l]}),d]})}class q0 extends M.Component{state={error:null,key:this.props.resetKey};static getDerivedStateFromError(n){return{error:n instanceof Error?n:new Error(String(n))}}static getDerivedStateFromProps(n,l){return Object.is(n.resetKey,l.key)?null:{error:null,key:n.resetKey}}componentDidCatch(n,l){console.error("Page error",n,l.componentStack)}render(){const{error:n}=this.state;if(!n)return this.props.children;const l=r.jsx($i,{eyebrow:"Something went wrong",title:"This page hit an error",className:"col-12 page-error",children:r.jsxs("div",{className:"stack",children:[r.jsx($e,{kind:"danger",title:"Error",children:r.jsx("span",{className:"mono",children:n.message.slice(0,500)||n.name})}),r.jsx("p",{className:"muted",style:{margin:0,fontSize:13},children:"Your saved TVs are safe. Reload the page to try again, or pick another page from the menu."}),r.jsx("div",{className:"row",children:r.jsx("button",{type:"button",className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Reload"})})]})});return this.props.fullPage?r.jsx("div",{className:"standalone-notice",children:l}):r.jsx("div",{className:"grid",children:l})}}function UN(){const[s,n]=M.useState(!1),[l,o]=M.useState(!1),{pathname:d}=_s();AN(),M.useEffect(()=>{document.body.classList.toggle("has-drawer-open",s)},[s]),M.useEffect(()=>n(!1),[d]);const _=M.useCallback(w=>{const c=w.target,h=!!c&&(c.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(c.tagName));(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"?(w.preventDefault(),o(y=>!y)):w.key==="/"&&!h?(w.preventDefault(),o(!0)):w.key==="Escape"&&n(!1)},[]);return M.useEffect(()=>(window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)),[_]),r.jsxs("div",{className:"shell",children:[r.jsx(dN,{}),r.jsx("div",{className:"drawer-backdrop",onClick:()=>n(!1)}),r.jsxs("div",{className:"main",children:[r.jsx(gN,{onOpenDrawer:()=>n(!0),onOpenPalette:()=>o(!0)}),r.jsxs("main",{className:"content",children:[!d.startsWith("/bridge")&&r.jsxs(r.Fragment,{children:[r.jsx($0,{}),r.jsx(V0,{})]}),r.jsx(q0,{resetKey:d,children:r.jsx(dC,{})})]}),r.jsx(vN,{}),r.jsx(RN,{})]}),r.jsx(yN,{open:l,onClose:()=>o(!1)})]})}function ys({eyebrow:s,title:n,accent:l,sub:o,actions:d}){return r.jsxs("section",{className:"hero",children:[r.jsxs("div",{className:"hero-text",children:[r.jsx("span",{className:"eyebrow",children:s}),r.jsxs("h1",{className:"hero-title",children:[n," ",l&&r.jsx("span",{className:"accent",children:l})]}),o&&r.jsx("p",{className:"hero-sub",children:o})]}),d&&r.jsx("div",{className:"hero-actions",children:d})]})}function zN(){const{status:s,reconnect:n}=Pi();switch(s.state){case"connected":return r.jsxs($e,{kind:"success",title:"Connected",children:["Bridge v",s.bridgeVersion," on ",s.platform,"."]});case"connecting":return r.jsx($e,{kind:"info",title:"Connecting…",children:"Trying to reach the bridge."});case"error":return r.jsx($e,{kind:"danger",title:"Not connected",action:r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:n,children:"Retry"}),children:s.message});default:return r.jsx($e,{kind:"warning",title:"Not paired yet",children:"Start the bridge, then paste its pairing token below."})}}function $N(){const{settings:s,pair:n,forget:l,status:o}=Pi(),[d,_]=M.useState(s?.url??Ay()),[w,c]=M.useState(s?.token??""),[h,y]=M.useState(!1),[p,f]=M.useState(!1),[x,C]=M.useState(null),j=async g=>{g.preventDefault(),C(null);const b=fm(d);if(b){C(new yt("bad_url",b));return}f(!0);try{await n({url:d.trim(),token:w.trim()})}catch(v){C(v instanceof yt?v:new yt("unknown",String(v)))}finally{f(!1)}},E=window.location.origin;return r.jsxs(r.Fragment,{children:[r.jsx(ys,{eyebrow:"Setup",title:"Connect the",accent:"bridge",sub:"Browsers can't open SSH connections to your TV, so a small helper runs on your computer and does it for this page. It only accepts this website and needs a pairing token."}),r.jsx($0,{always:!0}),r.jsx(V0,{always:!0}),r.jsxs("div",{className:"grid",children:[r.jsx($i,{eyebrow:"Step 1",title:"Run the bridge",className:"col-6",children:r.jsxs("div",{className:"stack",children:[r.jsxs("div",{children:[r.jsx("div",{className:"eyebrow",children:"In a terminal on this computer (Node.js 22.12 or newer)"}),r.jsx("div",{className:"codeblock",children:"npx lg-dev-manager-bridge@latest"})]}),r.jsxs("p",{className:"muted",style:{margin:0,fontSize:13},children:["It prints a ",r.jsx("strong",{children:"pairing token"})," — paste it below. Keep the terminal open while you use the app; Ctrl+C stops the bridge. It also serves this app at ",r.jsxs("span",{className:"mono",children:["http://localhost:",Tc]})," if you’d rather not use the website."]}),r.jsxs("div",{className:"bridge-app",children:[r.jsx("div",{className:"eyebrow",children:"No Node.js? Download the app instead"}),r.jsx("p",{className:"muted",style:{margin:0,fontSize:13},children:"The same bridge as one file for Windows, macOS and Linux — nothing else to install. Open it: a window shows the token."}),r.jsxs("a",{className:"btn btn--sm btn--ghost",href:Of,target:"_blank",rel:"noopener noreferrer",children:[r.jsx(ce,{name:"download"})," Download the app"]})]}),r.jsxs("p",{className:"muted",style:{margin:0,fontSize:13},children:["On macOS, the first time the bridge looks for or connects to your TV, the system asks whether your terminal app may find devices on your local network — choose ",r.jsx("strong",{children:"Allow"}),"."]}),r.jsxs("details",{className:"muted bridge-from-repo",children:[r.jsx("summary",{children:"Run it from the source code instead"}),r.jsx("div",{className:"codeblock",children:`git clone ${dm}.git
|
|
14
14
|
cd lg-dev-manager
|
|
@@ -106,4 +106,4 @@ CHECK_RESULT=$(curl --max-time 3 -s "https://developer.lge.com/secure/ResetDevMo
|
|
|
106
106
|
|
|
107
107
|
echo "\${CHECK_RESULT}"
|
|
108
108
|
`}function Ak(s){const n=/^(\d+):(\d+):(\d+)$/.exec(s??"");return n?((Number(n[1])*60+Number(n[2]))*60+Number(n[3]))*1e3:null}function Ok(s){const n=Math.max(0,Math.floor(s/1e3)),l=o=>String(o).padStart(2,"0");return`${l(Math.floor(n/3600))}:${l(Math.floor(n%3600/60))}:${l(n%60)}`}function Lk(){const{active:s}=Mt();return r.jsxs(r.Fragment,{children:[r.jsx(ys,{eyebrow:"Device",title:"Device",accent:"info",sub:s?r.jsxs(r.Fragment,{children:["Details of ",r.jsx("b",{children:s.name}),"."]}):"Details of your TV."}),r.jsx("div",{className:"grid",children:r.jsx(ri,{device:s,children:s&&r.jsx(Mk,{device:s},`${s.id}:${s.updatedAt}`)})})]})}function Mk({device:s}){const n=s.username==="prisoner";return r.jsxs(r.Fragment,{children:[r.jsx(Bk,{device:s}),n?r.jsx(Uk,{device:s}):r.jsx(Ub,{device:s}),r.jsx(Ek,{device:s,className:n?"col-8":"col-12"}),n&&r.jsx(Ub,{device:s})]})}function Bk({device:s}){const{ready:n,call:l}=ut(),o=M.useMemo(()=>gt(s),[s]),d=ss({queryKey:["device-info",s.id,s.updatedAt],queryFn:async()=>{const c=await l("device.info",{device:o},4e4);return vm(s.id,Uc(s,c)).catch(()=>{}),c},enabled:n,staleTime:6e4,retry:!1}),_=d.data,w=_m(_?.modelName);return r.jsx($i,{eyebrow:"Device",title:_?.modelName?xl(_.modelName)??_.modelName:s.name,className:"col-8",action:r.jsx("button",{type:"button",className:"btn btn--icon btn--ghost",onClick:()=>d.refetch(),disabled:d.isFetching,"aria-label":"Refresh",title:"Refresh",children:r.jsx(ce,{name:"refresh",className:d.isFetching?"spin":void 0})}),children:d.error?r.jsx(Nt,{error:d.error,title:"Couldn’t read the TV’s details",action:r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>d.refetch(),children:"Retry"})}):_?r.jsxs("div",{className:"info-device",children:[r.jsxs("div",{className:"info-device-art","aria-hidden":"true",children:[r.jsx(ce,{name:"tv"}),w&&r.jsx("span",{children:w})]}),r.jsxs("dl",{className:"kv info-kv",children:[r.jsx("dt",{children:"Model"}),r.jsx("dd",{className:"mono",children:_.modelName??"—"}),r.jsx("dt",{children:"webOS"}),r.jsx("dd",{children:Rc(_.osVersion)??"—"}),r.jsx("dt",{children:"Firmware"}),r.jsx("dd",{className:"mono",children:_.firmwareVersion??"—"}),r.jsx("dt",{children:"OTA ID"}),r.jsx("dd",{className:"mono",children:_.otaId??"—"}),r.jsx("dt",{children:"SoC"}),r.jsx("dd",{className:"mono",children:_.socName??"—"}),r.jsx("dt",{children:"Address"}),r.jsxs("dd",{className:"mono",children:[s.host,":",s.port]}),r.jsx("dt",{children:"Logged in as"}),r.jsxs("dd",{children:[r.jsx("span",{className:"mono",children:s.username})," ",r.jsx("span",{className:`badge ${s.mode==="rooted"?"purple":"info"}`,children:s.mode==="rooted"?"Rooted":"Dev Mode"})]})]})]}):r.jsxs("div",{className:"empty-state",children:[r.jsx("span",{className:"spinner"}),r.jsxs("p",{children:["Asking ",s.name,"…"]})]})})}function Ik(s,n){const l=Ak(s),[o,d]=M.useState(Date.now());return M.useEffect(()=>{if(l===null)return;d(Date.now());const w=setInterval(()=>d(Date.now()),1e3);return()=>clearInterval(w)},[l]),l===null?null:{left:Math.min(l,Math.max(0,l-(o-n))),ends:new Date(n+l)}}const Hk=1e3*3600*1e3;function Uk({device:s}){const{ready:n,call:l}=ut(),{toast:o}=jt(),d=M.useMemo(()=>gt(s),[s]),[_,w]=M.useState(!1),[c,h]=M.useState(!1),y=M.useRef(void 0);M.useEffect(()=>()=>clearTimeout(y.current),[]);const p=ss({queryKey:["devmode",s.id,s.updatedAt],queryFn:async()=>({...await l("devmode.status",{device:d},4e4),at:Date.now()}),enabled:n,staleTime:6e4,retry:!1}),f=Ik(p.data?.remaining,p.data?.at??Date.now()),x=async()=>{w(!0);try{await l("devmode.renew",{device:d},4e4),o({kind:"success",title:"Developer Mode session renewed",text:"LG may take a moment to show the new time."}),clearTimeout(y.current),y.current=setTimeout(()=>p.refetch(),1500)}catch(E){o({kind:"danger",title:"Couldn’t renew the session",text:xt(E).message})}finally{w(!1)}},C=f?Math.min(100,Math.round(f.left/Hk*100)):0,j=f?f.left<72*3600*1e3:!1;return r.jsxs($i,{eyebrow:"Developer Mode",title:"Session",className:"col-4",children:[p.error&&r.jsx(Nt,{error:p.error,title:"Couldn’t check the session",action:r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>p.refetch(),children:"Retry"})}),p.data?p.data.token?r.jsxs("div",{className:"stack",children:[f?r.jsxs("div",{className:"devmode-time",children:[r.jsx("div",{className:`devmode-countdown mono${j?" is-low":""}`,role:"timer","aria-label":"Time left",children:Ok(f.left)}),r.jsx("div",{className:"progress thin",role:"progressbar","aria-label":"Session left","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":C,children:r.jsx("div",{className:`progress-fill${j?" danger":""}`,style:{width:`${C}%`}})}),r.jsxs("div",{className:"muted devmode-ends",children:["Ends ",f.ends.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}),". The time shown on the TV only updates when it restarts."]})]}):r.jsx($e,{kind:"warning",title:"Time left unknown",children:p.data.problem??"LG didn’t say how long is left."}),r.jsxs("div",{className:"row",children:[r.jsxs("button",{type:"button",className:"btn btn--primary",onClick:x,disabled:_||!n,children:[_?r.jsx("span",{className:"spinner sm"}):r.jsx(ce,{name:"refresh"})," Renew now"]}),r.jsxs("button",{type:"button",className:"btn btn--ghost",onClick:()=>h(!0),children:[r.jsx(ce,{name:"clock"})," Renew automatically…"]})]})]}):r.jsx($e,{kind:"warning",title:"No Developer Mode token",children:"The TV has no valid Developer Mode session token. Open the Developer Mode app on the TV and sign in again."}):!p.error&&r.jsxs("div",{className:"empty-state",children:[r.jsx("span",{className:"spinner"}),r.jsx("p",{children:"Checking…"})]}),p.data?.token&&r.jsx(zk,{open:c,onClose:()=>h(!1),device:s,token:p.data.token})]})}function Hb({text:s,label:n}){const{toast:l}=jt();return r.jsxs("div",{className:"copybox",children:[r.jsx("code",{className:"mono",children:s}),r.jsx("button",{type:"button",className:"btn btn--icon btn--sm btn--ghost","aria-label":`Copy ${n}`,title:"Copy",onClick:()=>navigator.clipboard.writeText(s).then(()=>l({kind:"success",title:`${n} copied`}),()=>l({kind:"warning",title:"Copy failed",text:"Select the text and copy it by hand."})),children:r.jsx(ce,{name:"copy"})})]})}function zk({open:s,onClose:n,device:l,token:o}){const[d,_]=M.useState("url"),{toast:w}=jt(),c=Nk(o),h=M.useMemo(()=>Ib(l),[l]),[y,p]=M.useState(!1),f=M.useMemo(()=>y?h:Ib(l,{redact:!0}),[y,h,l]),x=`renew-devmode-${l.name.replace(/[^A-Za-z0-9._-]+/g,"-")||"tv"}.sh`;return r.jsx(si,{open:s,onClose:n,size:"lg",title:"Renew Developer Mode automatically",children:r.jsxs("div",{className:"stack",children:[r.jsx("div",{className:"tabs pills",role:"group","aria-label":"Ways to renew",children:[["url","Renew URL"],["script","Shell script"],["ifttt","IFTTT"]].map(([C,j])=>r.jsx("button",{type:"button","aria-pressed":d===C,className:`tab${d===C?" is-active":""}`,onClick:()=>_(C),children:j},C))}),d==="url"&&r.jsxs(r.Fragment,{children:[r.jsx("p",{children:"Opening this address renews the session for another 1000 hours. Anything that can open a URL on a schedule can keep Developer Mode alive with it."}),r.jsx(Hb,{text:c,label:"Renew URL"}),r.jsx($e,{kind:"warning",children:"Anyone with this URL can renew your TV’s session. It changes when you sign in to Developer Mode again."})]}),d==="script"&&(h?r.jsxs(r.Fragment,{children:[r.jsxs("p",{children:["A shell script for macOS or Linux (or WSL). It logs in to the TV to read the current token, then renews. Run it on a computer on the same network as the TV, for example daily with ",r.jsx("span",{className:"mono",children:"cron"})," (run it as"," ",r.jsxs("span",{className:"mono",children:["sh ",x]}),", or ",r.jsx("span",{className:"mono",children:"chmod 700"})," it first)."]}),r.jsx($e,{kind:"danger",title:"Contains this TV’s private key",children:"Keep the script private — it can log in to the TV."}),r.jsx("pre",{className:"file-preview-text renew-script",children:f}),r.jsxs("div",{className:"row",children:[r.jsxs("button",{type:"button",className:"btn btn--ghost",onClick:()=>p(C=>!C),"aria-pressed":y,children:[r.jsx(ce,{name:"key"})," ",y?"Hide key":"Show key"]}),r.jsxs("button",{type:"button",className:"btn btn--ghost",onClick:()=>navigator.clipboard.writeText(h).then(()=>w({kind:"success",title:"Script copied"}),()=>w({kind:"warning",title:"Copy failed"})),children:[r.jsx(ce,{name:"copy"})," Copy"]}),r.jsxs("button",{type:"button",className:"btn btn--primary",onClick:()=>Cn(new Blob([h],{type:"text/x-shellscript"}),x),children:[r.jsx(ce,{name:"download"})," Download ",x]})]})]}):r.jsx($e,{kind:"info",children:"The script needs the TV’s SSH key in the usual PEM / OpenSSH form, and an address and user name the add-TV form accepts. This TV’s saved settings don’t have that — edit the TV, or use the renew URL instead."})),d==="ifttt"&&r.jsxs(r.Fragment,{children:[r.jsx($e,{kind:"warning",children:"IFTTT’s webhook action is no longer free."}),r.jsxs("ol",{className:"plain-list numbered",children:[r.jsxs("li",{children:["Create an applet at ",r.jsx("a",{href:"https://ifttt.com/create",target:"_blank",rel:"noopener noreferrer",children:"ifttt.com/create"}),"."]}),r.jsxs("li",{children:["Pick ",r.jsx("b",{children:"Date & Time"})," as the trigger, then ",r.jsx("b",{children:"Every day at"})," or ",r.jsx("b",{children:"Every hour at"}),"."]}),r.jsxs("li",{children:["Pick ",r.jsx("b",{children:"Webhooks"})," as the action, with this URL:"]})]}),r.jsx(Hb,{text:c,label:"Renew URL"}),r.jsx("p",{className:"muted",children:"Then create the action and save the applet. If it stops working, open this page again for the new URL."})]})]})})}function Ub({device:s}){const n=Vc(s),l=eS(s),o=J0(),d=qc(s,n.data),_=En(),w=n.data?.find(y=>y.id===kf),c=o.byId.get(kf),h=w&&c?.manifest?W0(c.manifest.version,w.version)===!0:!1;return r.jsxs($i,{eyebrow:"Homebrew",title:"Homebrew Channel",className:"col-4",children:[n.error?r.jsx(Nt,{error:n.error,title:"Couldn’t read the installed apps"}):n.data?r.jsxs("div",{className:"stack",children:[r.jsxs("dl",{className:"kv",children:[r.jsx("dt",{children:"Installed"}),r.jsx("dd",{children:w?r.jsxs("span",{className:"mono",children:["v",w.version]}):"No"}),r.jsx("dt",{children:"Root"}),r.jsx("dd",{children:l.data?l.data.root?r.jsx("span",{className:"badge success",children:"Rooted"}):r.jsx("span",{className:"badge",children:"Not rooted"}):"—"}),c?.manifest&&r.jsxs(r.Fragment,{children:[r.jsx("dt",{children:"Latest"}),r.jsxs("dd",{className:"mono",children:["v",c.manifest.version]})]})]}),r.jsxs("div",{className:"row",children:[c?.manifest&&(!w||h)&&r.jsxs("button",{type:"button",className:"btn btn--primary",disabled:d.busy,onClick:async()=>{await d.installFromRepo(c,{update:!!w}),_.invalidateQueries({queryKey:["hbchannel",s.id]})},children:[r.jsx(ce,{name:"download"})," ",w?`Update to v${c.manifest.version}`:"Install"]}),r.jsxs("a",{className:"btn btn--ghost",href:"https://github.com/webosbrew/webos-homebrew-channel",target:"_blank",rel:"noopener noreferrer",children:[r.jsx(ce,{name:"github"})," GitHub"]})]})]}):r.jsx("div",{className:"empty-state",children:r.jsx("span",{className:"spinner"})}),d.dialog]})}function $k(){return r.jsx(oj,{},_s().key)}const Pk=new bE({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});function Fk(){const{status:s}=Pi();return r.jsx(dc,{to:s.state==="unpaired"?"/bridge":"/apps/installed",replace:!0})}function Vk(){return r.jsx(YC,{client:Pk,children:r.jsx(P2,{children:r.jsx(V2,{children:r.jsx(HC,{children:r.jsx(mC,{children:r.jsxs(Ot,{element:r.jsx(UN,{}),children:[r.jsx(Ot,{index:!0,element:r.jsx(Fk,{})}),r.jsx(Ot,{path:"bridge",element:r.jsx($N,{})}),r.jsx(Ot,{path:"devices",element:r.jsx(QN,{})}),r.jsx(Ot,{path:"devices/new",element:r.jsx($k,{})}),r.jsx(Ot,{path:"apps",element:r.jsx(dc,{to:"/apps/installed",replace:!0})}),r.jsx(Ot,{path:"apps/installed",element:r.jsx(eT,{})}),r.jsx(Ot,{path:"apps/homebrew",element:r.jsx(sT,{})}),r.jsx(Ot,{path:"apps/litefin",element:r.jsx(yk,{})}),r.jsx(Ot,{path:"files",element:r.jsx(gT,{})}),r.jsx(Ot,{path:"terminal",element:r.jsx(kT,{})}),r.jsx(Ot,{path:"info",element:r.jsx(Lk,{})}),r.jsx(Ot,{path:"debug",element:r.jsx(dc,{to:"/debug/logs",replace:!0})}),r.jsx(Ot,{path:"debug/logs",element:r.jsx(QT,{})}),r.jsx(Ot,{path:"debug/pmlog",element:r.jsx(ek,{})}),r.jsx(Ot,{path:"debug/dmesg",element:r.jsx(JT,{})}),r.jsx(Ot,{path:"debug/crashes",element:r.jsx(ck,{})}),r.jsx(Ot,{path:"debug/luna",element:r.jsx(mk,{})}),r.jsx(Ot,{path:"*",element:r.jsx(dc,{to:"/",replace:!0})})]})})})})})})}const qk=()=>document.documentElement.hasAttribute("data-framed");function Kk(){const s=window.location.href;return r.jsx("div",{className:"standalone-notice",children:r.jsx($i,{eyebrow:"LG Dev Manager",title:"Open LG Dev Manager in its own tab",children:r.jsxs("div",{className:"stack",children:[r.jsx("p",{className:"muted",style:{margin:0,fontSize:13,lineHeight:1.6},children:"For your TVs’ safety, LG Dev Manager doesn’t run inside another website."}),r.jsx("div",{className:"row",children:r.jsx("a",{className:"btn btn--primary",href:s,target:"_top",children:"Open LG Dev Manager"})})]})})})}hw.createRoot(document.getElementById("root")).render(r.jsx(M.StrictMode,{children:qk()?r.jsx(Kk,{}):r.jsx(q0,{fullPage:!0,children:r.jsx(Vk,{})})}));
|
|
109
|
-
//# sourceMappingURL=index-
|
|
109
|
+
//# sourceMappingURL=index-DxHthEKA.js.map
|