@coralai/sps-cli 0.50.23 → 0.50.24
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/dist/commands/projectInit.d.ts +4 -0
- package/dist/commands/projectInit.d.ts.map +1 -1
- package/dist/commands/projectInit.js +26 -11
- package/dist/commands/projectInit.js.map +1 -1
- package/dist/console/routes/projects.d.ts.map +1 -1
- package/dist/console/routes/projects.js +5 -0
- package/dist/console/routes/projects.js.map +1 -1
- package/dist/console-assets/assets/{index-KZ-tPjmm.js → index-QBai48VV.js} +25 -25
- package/dist/console-assets/index.html +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +3 -2
- package/dist/core/config.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/services/ProjectService.d.ts +4 -0
- package/dist/services/ProjectService.d.ts.map +1 -1
- package/dist/services/ProjectService.js.map +1 -1
- package/dist/services/SystemService.d.ts.map +1 -1
- package/dist/services/SystemService.js +4 -1
- package/dist/services/SystemService.js.map +1 -1
- package/package.json +1 -1
|
@@ -45,8 +45,8 @@ var Bk=Object.defineProperty;var cv=e=>{throw TypeError(e)};var Uk=(e,t,n)=>t in
|
|
|
45
45
|
`);for(p=u=0;u<I.length&&!I[u].includes("DetermineComponentFrameRoot");)u++;for(;p<Y.length&&!Y[p].includes("DetermineComponentFrameRoot");)p++;if(u===I.length||p===Y.length)for(u=I.length-1,p=Y.length-1;1<=u&&0<=p&&I[u]!==Y[p];)p--;for(;1<=u&&0<=p;u--,p--)if(I[u]!==Y[p]){if(u!==1||p!==1)do if(u--,p--,0>p||I[u]!==Y[p]){var ne=`
|
|
46
46
|
`+I[u].replace(" at new "," at ");return i.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",i.displayName)),ne}while(1<=u&&0<=p);break}}}finally{Li=!1,Error.prepareStackTrace=l}return(l=i?i.displayName||i.name:"")?Kn(l):""}function _i(i,r){switch(i.tag){case 26:case 27:case 5:return Kn(i.type);case 16:return Kn("Lazy");case 13:return i.child!==r&&r!==null?Kn("Suspense Fallback"):Kn("Suspense");case 19:return Kn("SuspenseList");case 0:case 15:return We(i.type,!1);case 11:return We(i.type.render,!1);case 1:return We(i.type,!0);case 31:return Kn("Activity");default:return""}}function li(i){try{var r="",l=null;do r+=_i(i,l),l=i,i=i.return;while(i);return r}catch(u){return`
|
|
47
47
|
Error generating stack: `+u.message+`
|
|
48
|
-
`+u.stack}}var Ii=Object.prototype.hasOwnProperty,Ji=e.unstable_scheduleCallback,Nr=e.unstable_cancelCallback,Gl=e.unstable_shouldYield,bs=e.unstable_requestPaint,Ot=e.unstable_now,ys=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,qe=e.unstable_LowPriority,nt=e.unstable_IdlePriority,xn=e.log,ki=e.unstable_setDisableYieldValue,an=null,Lt=null;function un(i){if(typeof xn=="function"&&ki(i),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(an,i)}catch{}}var ot=Math.clz32?Math.clz32:Nc,zi=Math.log,vn=Math.LN2;function Nc(i){return i>>>=0,i===0?32:31-(zi(i)/vn|0)|0}var Tr=256,xs=262144,Cr=4194304;function Cn(i){var r=i&42;if(r!==0)return r;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function B(i,r,l){var u=i.pendingLanes;if(u===0)return 0;var p=0,b=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var N=u&134217727;return N!==0?(u=N&~b,u!==0?p=Cn(u):(E&=N,E!==0?p=Cn(E):l||(l=N&~i,l!==0&&(p=Cn(l))))):(N=u&~b,N!==0?p=Cn(N):E!==0?p=Cn(E):l||(l=u&~i,l!==0&&(p=Cn(l)))),p===0?0:r!==0&&r!==p&&(r&b)===0&&(b=p&-p,l=r&-r,b>=l||b===32&&(l&4194048)!==0)?r:p}function ie(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function ge(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Le(){var i=Cr;return Cr<<=1,(Cr&62914560)===0&&(Cr=4194304),i}function wt(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function bt(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ee(i,r,l,u,p,b){var E=i.pendingLanes;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=l,i.entangledLanes&=l,i.errorRecoveryDisabledLanes&=l,i.shellSuspendCounter=0;var N=i.entanglements,I=i.expirationTimes,Y=i.hiddenUpdates;for(l=E&~l;0<l;){var ne=31-ot(l),se=1<<ne;N[ne]=0,I[ne]=-1;var X=Y[ne];if(X!==null)for(Y[ne]=null,ne=0;ne<X.length;ne++){var ee=X[ne];ee!==null&&(ee.lane&=-536870913)}l&=~se}u!==0&&ye(i,u,0),b!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=b&~(E&~r))}function ye(i,r,l){i.pendingLanes|=r,i.suspendedLanes&=~r;var u=31-ot(r);i.entangledLanes|=r,i.entanglements[u]=i.entanglements[u]|1073741824|l&261930}function De(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var u=31-ot(l),p=1<<u;p&r|i[u]&r&&(i[u]|=r),l&=~p}}function Ut(i,r){var l=r&-r;return l=(l&42)!==0?1:Nt(l),(l&(i.suspendedLanes|r))!==0?0:l}function Nt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ea(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function vs(){var i=oe.p;return i!==0?i:(i=window.event,i===void 0?32:nv(i.type))}function Es(i,r){var l=oe.p;try{return oe.p=i,r()}finally{oe.p=l}}var Bi=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Bi,fn="__reactProps$"+Bi,Ra="__reactContainer$"+Bi,Ql="__reactEvents$"+Bi,Tc="__reactListeners$"+Bi,Ss="__reactHandles$"+Bi,Cc="__reactResources$"+Bi,Ar="__reactMarker$"+Bi;function Yl(i){delete i[Ft],delete i[fn],delete i[Ql],delete i[Tc],delete i[Ss]}function En(i){var r=i[Ft];if(r)return r;for(var l=i.parentNode;l;){if(r=l[Ra]||l[Ft]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=Fx(i);i!==null;){if(l=i[Ft])return l;i=Fx(i)}return r}i=l,l=i.parentNode}return null}function ta(i){if(i=i[Ft]||i[Ra]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function Ma(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(a(33))}function ja(i){var r=i[Cc];return r||(r=i[Cc]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Kt(i){i[Ar]=!0}var Ac=new Set,Or={};function na(i,r){ue(i,r),ue(i+"Capture",r)}function ue(i,r){for(Or[i]=r,i=0;i<r.length;i++)Ac.add(r[i])}var Ne=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]*$"),He={},ct={};function $t(i){return Ii.call(ct,i)?!0:Ii.call(He,i)?!1:Ne.test(i)?ct[i]=!0:(He[i]=!0,!1)}function dn(i,r,l){if($t(r))if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+l)}}function Gn(i,r,l){if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+l)}}function An(i,r,l,u){if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttributeNS(r,l,""+u)}}function Et(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Qn(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Oc(i,r,l){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,b=u.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return p.call(this)},set:function(E){l=""+E,b.call(this,E)}}),Object.defineProperty(i,r,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function ws(i){if(!i._valueTracker){var r=Qn(i)?"checked":"value";i._valueTracker=Oc(i,r,""+i[r])}}function Vl(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),u="";return i&&(u=Qn(i)?i.checked?"true":"false":i.value),i=u,i!==l?(r.setValue(i),!0):!1}function _s(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var ed=/[\n"\\]/g;function On(i){return i.replace(ed,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Xl(i,r,l,u,p,b,E,N){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),r!=null?E==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Et(r)):i.value!==""+Et(r)&&(i.value=""+Et(r)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),r!=null?ks(i,E,Et(r)):l!=null?ks(i,E,Et(l)):u!=null&&i.removeAttribute("value"),p==null&&b!=null&&(i.defaultChecked=!!b),p!=null&&(i.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Et(N):i.removeAttribute("name")}function Rr(i,r,l,u,p,b,E,N){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.type=b),r!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||r!=null)){ws(i);return}l=l!=null?""+Et(l):"",r=r!=null?""+Et(r):l,N||r===i.value||(i.value=r),i.defaultValue=r}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=N?i.checked:!!u,i.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),ws(i)}function ks(i,r,l){r==="number"&&_s(i.ownerDocument)===i||i.defaultValue===""+l||(i.defaultValue=""+l)}function rn(i,r,l,u){if(i=i.options,r){r={};for(var p=0;p<l.length;p++)r["$"+l[p]]=!0;for(l=0;l<i.length;l++)p=r.hasOwnProperty("$"+i[l].value),i[l].selected!==p&&(i[l].selected=p),p&&u&&(i[l].defaultSelected=!0)}else{for(l=""+Et(l),r=null,p=0;p<i.length;p++){if(i[p].value===l){i[p].selected=!0,u&&(i[p].defaultSelected=!0);return}r!==null||i[p].disabled||(r=i[p])}r!==null&&(r.selected=!0)}}function Rc(i,r,l){if(r!=null&&(r=""+Et(r),r!==i.value&&(i.value=r),l==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=l!=null?""+Et(l):""}function Ns(i,r,l,u){if(r==null){if(u!=null){if(l!=null)throw Error(a(92));if(W(u)){if(1<u.length)throw Error(a(93));u=u[0]}l=u}l==null&&(l=""),r=l}l=Et(r),i.defaultValue=l,u=i.textContent,u===l&&u!==""&&u!==null&&(i.value=u),ws(i)}function je(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var Mc=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 Gt(i,r,l){var u=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":u?i.setProperty(r,l):typeof l!="number"||l===0||Mc.has(r)?r==="float"?i.cssFloat=l:i[r]=(""+l).trim():i[r]=l+"px"}function ut(i,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(i=i.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var p in r)u=r[p],r.hasOwnProperty(p)&&l[p]!==u&&Gt(i,p,u)}else for(var b in r)r.hasOwnProperty(b)&&Gt(i,b,r[b])}function Da(i){if(i.indexOf("-")===-1)return!1;switch(i){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 ia=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Zl=/^[\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 La(i){return Zl.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function he(){}var Se=null;function Be(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ve=null,Rt=null;function oi(i){var r=ta(i);if(r&&(i=r.stateNode)){var l=i[fn]||null;e:switch(i=r.stateNode,r.type){case"input":if(Xl(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+On(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var u=l[r];if(u!==i&&u.form===i.form){var p=u[fn]||null;if(!p)throw Error(a(90));Xl(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<l.length;r++)u=l[r],u.form===i.form&&Vl(u)}break e;case"textarea":Rc(i,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&rn(i,!!l.multiple,r,!1)}}}var Wl=!1;function jc(i,r,l){if(Wl)return i(r,l);Wl=!0;try{var u=i(r);return u}finally{if(Wl=!1,(Ve!==null||Rt!==null)&&(vu(),Ve&&(r=Ve,i=Rt,Rt=Ve=null,oi(r),i)))for(r=0;r<i.length;r++)oi(i[r])}}function Jl(i,r){var l=i.stateNode;if(l===null)return null;var u=l[fn]||null;if(u===null)return null;l=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),td=!1;if(aa)try{var eo={};Object.defineProperty(eo,"passive",{get:function(){td=!0}}),window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch{td=!1}var Ia=null,nd=null,Dc=null;function jg(){if(Dc)return Dc;var i,r=nd,l=r.length,u,p="value"in Ia?Ia.value:Ia.textContent,b=p.length;for(i=0;i<l&&r[i]===p[i];i++);var E=l-i;for(u=1;u<=E&&r[l-u]===p[b-u];u++);return Dc=p.slice(i,1<u?1-u:void 0)}function Lc(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Ic(){return!0}function Dg(){return!1}function Rn(i){function r(l,u,p,b,E){this._reactName=l,this._targetInst=p,this.type=u,this.nativeEvent=b,this.target=E,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(l=i[N],this[N]=l?l(b):b[N]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Ic:Dg,this.isPropagationStopped=Dg,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ic)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ic)},persist:function(){},isPersistent:Ic}),r}var Mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zc=Rn(Mr),to=g({},Mr,{view:0,detail:0}),Iw=Rn(to),id,ad,no,Bc=g({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sd,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==no&&(no&&i.type==="mousemove"?(id=i.screenX-no.screenX,ad=i.screenY-no.screenY):ad=id=0,no=i),id)},movementY:function(i){return"movementY"in i?i.movementY:ad}}),Lg=Rn(Bc),zw=g({},Bc,{dataTransfer:0}),Bw=Rn(zw),Uw=g({},to,{relatedTarget:0}),rd=Rn(Uw),Fw=g({},Mr,{animationName:0,elapsedTime:0,pseudoElement:0}),$w=Rn(Fw),Pw=g({},Mr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),qw=Rn(Pw),Hw=g({},Mr,{data:0}),Ig=Rn(Hw),Kw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gw={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"},Qw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yw(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=Qw[i])?!!r[i]:!1}function sd(){return Yw}var Vw=g({},to,{key:function(i){if(i.key){var r=Kw[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Lc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Gw[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sd,charCode:function(i){return i.type==="keypress"?Lc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Lc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Xw=Rn(Vw),Zw=g({},Bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zg=Rn(Zw),Ww=g({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sd}),Jw=Rn(Ww),e_=g({},Mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),t_=Rn(e_),n_=g({},Bc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),i_=Rn(n_),a_=g({},Mr,{newState:0,oldState:0}),r_=Rn(a_),s_=[9,13,27,32],ld=aa&&"CompositionEvent"in window,io=null;aa&&"documentMode"in document&&(io=document.documentMode);var l_=aa&&"TextEvent"in window&&!io,Bg=aa&&(!ld||io&&8<io&&11>=io),Ug=" ",Fg=!1;function $g(i,r){switch(i){case"keyup":return s_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ts=!1;function o_(i,r){switch(i){case"compositionend":return Pg(r);case"keypress":return r.which!==32?null:(Fg=!0,Ug);case"textInput":return i=r.data,i===Ug&&Fg?null:i;default:return null}}function c_(i,r){if(Ts)return i==="compositionend"||!ld&&$g(i,r)?(i=jg(),Dc=nd=Ia=null,Ts=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Bg&&r.locale!=="ko"?null:r.data;default:return null}}var u_={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 qg(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!u_[i.type]:r==="textarea"}function Hg(i,r,l,u){Ve?Rt?Rt.push(u):Rt=[u]:Ve=u,r=Tu(r,"onChange"),0<r.length&&(l=new zc("onChange","change",null,l,u),i.push({event:l,listeners:r}))}var ao=null,ro=null;function f_(i){Nx(i,0)}function Uc(i){var r=Ma(i);if(Vl(r))return i}function Kg(i,r){if(i==="change")return r}var Gg=!1;if(aa){var od;if(aa){var cd="oninput"in document;if(!cd){var Qg=document.createElement("div");Qg.setAttribute("oninput","return;"),cd=typeof Qg.oninput=="function"}od=cd}else od=!1;Gg=od&&(!document.documentMode||9<document.documentMode)}function Yg(){ao&&(ao.detachEvent("onpropertychange",Vg),ro=ao=null)}function Vg(i){if(i.propertyName==="value"&&Uc(ro)){var r=[];Hg(r,ro,i,Be(i)),jc(f_,r)}}function d_(i,r,l){i==="focusin"?(Yg(),ao=r,ro=l,ao.attachEvent("onpropertychange",Vg)):i==="focusout"&&Yg()}function h_(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Uc(ro)}function m_(i,r){if(i==="click")return Uc(r)}function p_(i,r){if(i==="input"||i==="change")return Uc(r)}function g_(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var Yn=typeof Object.is=="function"?Object.is:g_;function so(i,r){if(Yn(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),u=Object.keys(r);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var p=l[u];if(!Ii.call(r,p)||!Yn(i[p],r[p]))return!1}return!0}function Xg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Zg(i,r){var l=Xg(i);i=0;for(var u;l;){if(l.nodeType===3){if(u=i+l.textContent.length,i<=r&&u>=r)return{node:l,offset:r-i};i=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xg(l)}}function Wg(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?Wg(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function Jg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=_s(i.document);r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=_s(i.document)}return r}function ud(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var b_=aa&&"documentMode"in document&&11>=document.documentMode,Cs=null,fd=null,lo=null,dd=!1;function eb(i,r,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;dd||Cs==null||Cs!==_s(u)||(u=Cs,"selectionStart"in u&&ud(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),lo&&so(lo,u)||(lo=u,u=Tu(fd,"onSelect"),0<u.length&&(r=new zc("onSelect","select",null,r,l),i.push({event:r,listeners:u}),r.target=Cs)))}function jr(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var As={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},hd={},tb={};aa&&(tb=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Dr(i){if(hd[i])return hd[i];if(!As[i])return i;var r=As[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in tb)return hd[i]=r[l];return i}var nb=Dr("animationend"),ib=Dr("animationiteration"),ab=Dr("animationstart"),y_=Dr("transitionrun"),x_=Dr("transitionstart"),v_=Dr("transitioncancel"),rb=Dr("transitionend"),sb=new Map,md="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");md.push("scrollEnd");function Ni(i,r){sb.set(i,r),na(r,[i])}var Fc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},ci=[],Os=0,pd=0;function $c(){for(var i=Os,r=pd=Os=0;r<i;){var l=ci[r];ci[r++]=null;var u=ci[r];ci[r++]=null;var p=ci[r];ci[r++]=null;var b=ci[r];if(ci[r++]=null,u!==null&&p!==null){var E=u.pending;E===null?p.next=p:(p.next=E.next,E.next=p),u.pending=p}b!==0&&lb(l,p,b)}}function Pc(i,r,l,u){ci[Os++]=i,ci[Os++]=r,ci[Os++]=l,ci[Os++]=u,pd|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function gd(i,r,l,u){return Pc(i,r,l,u),qc(i)}function Lr(i,r){return Pc(i,null,null,r),qc(i)}function lb(i,r,l){i.lanes|=l;var u=i.alternate;u!==null&&(u.lanes|=l);for(var p=!1,b=i.return;b!==null;)b.childLanes|=l,u=b.alternate,u!==null&&(u.childLanes|=l),b.tag===22&&(i=b.stateNode,i===null||i._visibility&1||(p=!0)),i=b,b=b.return;return i.tag===3?(b=i.stateNode,p&&r!==null&&(p=31-ot(l),i=b.hiddenUpdates,u=i[p],u===null?i[p]=[r]:u.push(r),r.lane=l|536870912),b):null}function qc(i){if(50<Oo)throw Oo=0,kh=null,Error(a(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Rs={};function E_(i,r,l,u){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(i,r,l,u){return new E_(i,r,l,u)}function bd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ra(i,r){var l=i.alternate;return l===null?(l=Vn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&65011712,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l.refCleanup=i.refCleanup,l}function ob(i,r){i.flags&=65011714;var l=i.alternate;return l===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,r=l.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Hc(i,r,l,u,p,b){var E=0;if(u=i,typeof i=="function")bd(i)&&(E=1);else if(typeof i=="string")E=Nk(i,l,me.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=Vn(31,l,r,p),i.elementType=Z,i.lanes=b,i;case w:return Ir(l.children,p,b,r);case k:E=8,p|=24;break;case _:return i=Vn(12,l,r,p|2),i.elementType=_,i.lanes=b,i;case $:return i=Vn(13,l,r,p),i.elementType=$,i.lanes=b,i;case j:return i=Vn(19,l,r,p),i.elementType=j,i.lanes=b,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:E=10;break e;case A:E=9;break e;case D:E=11;break e;case q:E=14;break e;case U:E=16,u=null;break e}E=29,l=Error(a(130,i===null?"null":typeof i,"")),u=null}return r=Vn(E,l,r,p),r.elementType=i,r.type=u,r.lanes=b,r}function Ir(i,r,l,u){return i=Vn(7,i,u,r),i.lanes=l,i}function yd(i,r,l){return i=Vn(6,i,null,r),i.lanes=l,i}function cb(i){var r=Vn(18,null,null,0);return r.stateNode=i,r}function xd(i,r,l){return r=Vn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var ub=new WeakMap;function ui(i,r){if(typeof i=="object"&&i!==null){var l=ub.get(i);return l!==void 0?l:(r={value:i,source:r,stack:li(r)},ub.set(i,r),r)}return{value:i,source:r,stack:li(r)}}var Ms=[],js=0,Kc=null,oo=0,fi=[],di=0,za=null,Ui=1,Fi="";function sa(i,r){Ms[js++]=oo,Ms[js++]=Kc,Kc=i,oo=r}function fb(i,r,l){fi[di++]=Ui,fi[di++]=Fi,fi[di++]=za,za=i;var u=Ui;i=Fi;var p=32-ot(u)-1;u&=~(1<<p),l+=1;var b=32-ot(r)+p;if(30<b){var E=p-p%5;b=(u&(1<<E)-1).toString(32),u>>=E,p-=E,Ui=1<<32-ot(r)+p|l<<p|u,Fi=b+i}else Ui=1<<b|l<<p|u,Fi=i}function vd(i){i.return!==null&&(sa(i,1),fb(i,1,0))}function Ed(i){for(;i===Kc;)Kc=Ms[--js],Ms[js]=null,oo=Ms[--js],Ms[js]=null;for(;i===za;)za=fi[--di],fi[di]=null,Fi=fi[--di],fi[di]=null,Ui=fi[--di],fi[di]=null}function db(i,r){fi[di++]=Ui,fi[di++]=Fi,fi[di++]=za,Ui=r.id,Fi=r.overflow,za=i}var sn=null,_t=null,Je=!1,Ba=null,hi=!1,Sd=Error(a(519));function Ua(i){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw co(ui(r,i)),Sd}function hb(i){var r=i.stateNode,l=i.type,u=i.memoizedProps;switch(r[Ft]=i,r[fn]=u,l){case"dialog":Qe("cancel",r),Qe("close",r);break;case"iframe":case"object":case"embed":Qe("load",r);break;case"video":case"audio":for(l=0;l<Mo.length;l++)Qe(Mo[l],r);break;case"source":Qe("error",r);break;case"img":case"image":case"link":Qe("error",r),Qe("load",r);break;case"details":Qe("toggle",r);break;case"input":Qe("invalid",r),Rr(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Qe("invalid",r);break;case"textarea":Qe("invalid",r),Ns(r,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||u.suppressHydrationWarning===!0||Ox(r.textContent,l)?(u.popover!=null&&(Qe("beforetoggle",r),Qe("toggle",r)),u.onScroll!=null&&Qe("scroll",r),u.onScrollEnd!=null&&Qe("scrollend",r),u.onClick!=null&&(r.onclick=he),r=!0):r=!1,r||Ua(i,!0)}function mb(i){for(sn=i.return;sn;)switch(sn.tag){case 5:case 31:case 13:hi=!1;return;case 27:case 3:hi=!0;return;default:sn=sn.return}}function Ds(i){if(i!==sn)return!1;if(!Je)return mb(i),Je=!0,!1;var r=i.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=i.type,l=!(l!=="form"&&l!=="button")||Fh(i.type,i.memoizedProps)),l=!l),l&&_t&&Ua(i),mb(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));_t=Ux(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));_t=Ux(i)}else r===27?(r=_t,Ja(i.type)?(i=Kh,Kh=null,_t=i):_t=r):_t=sn?pi(i.stateNode.nextSibling):null;return!0}function zr(){_t=sn=null,Je=!1}function wd(){var i=Ba;return i!==null&&(Ln===null?Ln=i:Ln.push.apply(Ln,i),Ba=null),i}function co(i){Ba===null?Ba=[i]:Ba.push(i)}var _d=L(null),Br=null,la=null;function Fa(i,r,l){C(_d,r._currentValue),r._currentValue=l}function oa(i){i._currentValue=_d.current,J(_d)}function kd(i,r,l){for(;i!==null;){var u=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),i===l)break;i=i.return}}function Nd(i,r,l,u){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var b=p.dependencies;if(b!==null){var E=p.child;b=b.firstContext;e:for(;b!==null;){var N=b;b=p;for(var I=0;I<r.length;I++)if(N.context===r[I]){b.lanes|=l,N=b.alternate,N!==null&&(N.lanes|=l),kd(b.return,l,i),u||(E=null);break e}b=N.next}}else if(p.tag===18){if(E=p.return,E===null)throw Error(a(341));E.lanes|=l,b=E.alternate,b!==null&&(b.lanes|=l),kd(E,l,i),E=null}else E=p.child;if(E!==null)E.return=p;else for(E=p;E!==null;){if(E===i){E=null;break}if(p=E.sibling,p!==null){p.return=E.return,E=p;break}E=E.return}p=E}}function Ls(i,r,l,u){i=null;for(var p=r,b=!1;p!==null;){if(!b){if((p.flags&524288)!==0)b=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var E=p.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var N=p.type;Yn(p.pendingProps.value,E.value)||(i!==null?i.push(N):i=[N])}}else if(p===ce.current){if(E=p.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(i!==null?i.push(zo):i=[zo])}p=p.return}i!==null&&Nd(r,i,l,u),r.flags|=262144}function Gc(i){for(i=i.firstContext;i!==null;){if(!Yn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ur(i){Br=i,la=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ln(i){return pb(Br,i)}function Qc(i,r){return Br===null&&Ur(i),pb(i,r)}function pb(i,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},la===null){if(i===null)throw Error(a(308));la=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else la=la.next=r;return l}var S_=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(l,u){i.push(u)}};this.abort=function(){r.aborted=!0,i.forEach(function(l){return l()})}},w_=e.unstable_scheduleCallback,__=e.unstable_NormalPriority,Qt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Td(){return{controller:new S_,data:new Map,refCount:0}}function uo(i){i.refCount--,i.refCount===0&&w_(__,function(){i.controller.abort()})}var fo=null,Cd=0,Is=0,zs=null;function k_(i,r){if(fo===null){var l=fo=[];Cd=0,Is=Rh(),zs={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Cd++,r.then(gb,gb),r}function gb(){if(--Cd===0&&fo!==null){zs!==null&&(zs.status="fulfilled");var i=fo;fo=null,Is=0,zs=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function N_(i,r){var l=[],u={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return i.then(function(){u.status="fulfilled",u.value=r;for(var p=0;p<l.length;p++)(0,l[p])(r)},function(p){for(u.status="rejected",u.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),u}var bb=K.S;K.S=function(i,r){ex=Ot(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&k_(i,r),bb!==null&&bb(i,r)};var Fr=L(null);function Ad(){var i=Fr.current;return i!==null?i:yt.pooledCache}function Yc(i,r){r===null?C(Fr,Fr.current):C(Fr,r.pool)}function yb(){var i=Ad();return i===null?null:{parent:Qt._currentValue,pool:i}}var Bs=Error(a(460)),Od=Error(a(474)),Vc=Error(a(542)),Xc={then:function(){}};function xb(i){return i=i.status,i==="fulfilled"||i==="rejected"}function vb(i,r,l){switch(l=i[l],l===void 0?i.push(r):l!==r&&(r.then(he,he),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Sb(i),i;default:if(typeof r.status=="string")r.then(he,he);else{if(i=yt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=r,i.status="pending",i.then(function(u){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=u}},function(u){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Sb(i),i}throw Pr=r,Bs}}function $r(i){try{var r=i._init;return r(i._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Pr=l,Bs):l}}var Pr=null;function Eb(){if(Pr===null)throw Error(a(459));var i=Pr;return Pr=null,i}function Sb(i){if(i===Bs||i===Vc)throw Error(a(483))}var Us=null,ho=0;function Zc(i){var r=ho;return ho+=1,Us===null&&(Us=[]),vb(Us,i,r)}function mo(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Wc(i,r){throw r.$$typeof===x?Error(a(525)):(i=Object.prototype.toString.call(r),Error(a(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function wb(i){function r(H,F){if(i){var Q=H.deletions;Q===null?(H.deletions=[F],H.flags|=16):Q.push(F)}}function l(H,F){if(!i)return null;for(;F!==null;)r(H,F),F=F.sibling;return null}function u(H){for(var F=new Map;H!==null;)H.key!==null?F.set(H.key,H):F.set(H.index,H),H=H.sibling;return F}function p(H,F){return H=ra(H,F),H.index=0,H.sibling=null,H}function b(H,F,Q){return H.index=Q,i?(Q=H.alternate,Q!==null?(Q=Q.index,Q<F?(H.flags|=67108866,F):Q):(H.flags|=67108866,F)):(H.flags|=1048576,F)}function E(H){return i&&H.alternate===null&&(H.flags|=67108866),H}function N(H,F,Q,re){return F===null||F.tag!==6?(F=yd(Q,H.mode,re),F.return=H,F):(F=p(F,Q),F.return=H,F)}function I(H,F,Q,re){var Ce=Q.type;return Ce===w?ne(H,F,Q.props.children,re,Q.key):F!==null&&(F.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&$r(Ce)===F.type)?(F=p(F,Q.props),mo(F,Q),F.return=H,F):(F=Hc(Q.type,Q.key,Q.props,null,H.mode,re),mo(F,Q),F.return=H,F)}function Y(H,F,Q,re){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=xd(Q,H.mode,re),F.return=H,F):(F=p(F,Q.children||[]),F.return=H,F)}function ne(H,F,Q,re,Ce){return F===null||F.tag!==7?(F=Ir(Q,H.mode,re,Ce),F.return=H,F):(F=p(F,Q),F.return=H,F)}function se(H,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=yd(""+F,H.mode,Q),F.return=H,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return Q=Hc(F.type,F.key,F.props,null,H.mode,Q),mo(Q,F),Q.return=H,Q;case S:return F=xd(F,H.mode,Q),F.return=H,F;case U:return F=$r(F),se(H,F,Q)}if(W(F)||G(F))return F=Ir(F,H.mode,Q,null),F.return=H,F;if(typeof F.then=="function")return se(H,Zc(F),Q);if(F.$$typeof===T)return se(H,Qc(H,F),Q);Wc(H,F)}return null}function X(H,F,Q,re){var Ce=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ce!==null?null:N(H,F,""+Q,re);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===Ce?I(H,F,Q,re):null;case S:return Q.key===Ce?Y(H,F,Q,re):null;case U:return Q=$r(Q),X(H,F,Q,re)}if(W(Q)||G(Q))return Ce!==null?null:ne(H,F,Q,re,null);if(typeof Q.then=="function")return X(H,F,Zc(Q),re);if(Q.$$typeof===T)return X(H,F,Qc(H,Q),re);Wc(H,Q)}return null}function ee(H,F,Q,re,Ce){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return H=H.get(Q)||null,N(F,H,""+re,Ce);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return H=H.get(re.key===null?Q:re.key)||null,I(F,H,re,Ce);case S:return H=H.get(re.key===null?Q:re.key)||null,Y(F,H,re,Ce);case U:return re=$r(re),ee(H,F,Q,re,Ce)}if(W(re)||G(re))return H=H.get(Q)||null,ne(F,H,re,Ce,null);if(typeof re.then=="function")return ee(H,F,Q,Zc(re),Ce);if(re.$$typeof===T)return ee(H,F,Q,Qc(F,re),Ce);Wc(F,re)}return null}function xe(H,F,Q,re){for(var Ce=null,it=null,we=F,Fe=F=0,Ze=null;we!==null&&Fe<Q.length;Fe++){we.index>Fe?(Ze=we,we=null):Ze=we.sibling;var at=X(H,we,Q[Fe],re);if(at===null){we===null&&(we=Ze);break}i&&we&&at.alternate===null&&r(H,we),F=b(at,F,Fe),it===null?Ce=at:it.sibling=at,it=at,we=Ze}if(Fe===Q.length)return l(H,we),Je&&sa(H,Fe),Ce;if(we===null){for(;Fe<Q.length;Fe++)we=se(H,Q[Fe],re),we!==null&&(F=b(we,F,Fe),it===null?Ce=we:it.sibling=we,it=we);return Je&&sa(H,Fe),Ce}for(we=u(we);Fe<Q.length;Fe++)Ze=ee(we,H,Fe,Q[Fe],re),Ze!==null&&(i&&Ze.alternate!==null&&we.delete(Ze.key===null?Fe:Ze.key),F=b(Ze,F,Fe),it===null?Ce=Ze:it.sibling=Ze,it=Ze);return i&&we.forEach(function(ar){return r(H,ar)}),Je&&sa(H,Fe),Ce}function Re(H,F,Q,re){if(Q==null)throw Error(a(151));for(var Ce=null,it=null,we=F,Fe=F=0,Ze=null,at=Q.next();we!==null&&!at.done;Fe++,at=Q.next()){we.index>Fe?(Ze=we,we=null):Ze=we.sibling;var ar=X(H,we,at.value,re);if(ar===null){we===null&&(we=Ze);break}i&&we&&ar.alternate===null&&r(H,we),F=b(ar,F,Fe),it===null?Ce=ar:it.sibling=ar,it=ar,we=Ze}if(at.done)return l(H,we),Je&&sa(H,Fe),Ce;if(we===null){for(;!at.done;Fe++,at=Q.next())at=se(H,at.value,re),at!==null&&(F=b(at,F,Fe),it===null?Ce=at:it.sibling=at,it=at);return Je&&sa(H,Fe),Ce}for(we=u(we);!at.done;Fe++,at=Q.next())at=ee(we,H,Fe,at.value,re),at!==null&&(i&&at.alternate!==null&&we.delete(at.key===null?Fe:at.key),F=b(at,F,Fe),it===null?Ce=at:it.sibling=at,it=at);return i&&we.forEach(function(zk){return r(H,zk)}),Je&&sa(H,Fe),Ce}function pt(H,F,Q,re){if(typeof Q=="object"&&Q!==null&&Q.type===w&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:e:{for(var Ce=Q.key;F!==null;){if(F.key===Ce){if(Ce=Q.type,Ce===w){if(F.tag===7){l(H,F.sibling),re=p(F,Q.props.children),re.return=H,H=re;break e}}else if(F.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&$r(Ce)===F.type){l(H,F.sibling),re=p(F,Q.props),mo(re,Q),re.return=H,H=re;break e}l(H,F);break}else r(H,F);F=F.sibling}Q.type===w?(re=Ir(Q.props.children,H.mode,re,Q.key),re.return=H,H=re):(re=Hc(Q.type,Q.key,Q.props,null,H.mode,re),mo(re,Q),re.return=H,H=re)}return E(H);case S:e:{for(Ce=Q.key;F!==null;){if(F.key===Ce)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){l(H,F.sibling),re=p(F,Q.children||[]),re.return=H,H=re;break e}else{l(H,F);break}else r(H,F);F=F.sibling}re=xd(Q,H.mode,re),re.return=H,H=re}return E(H);case U:return Q=$r(Q),pt(H,F,Q,re)}if(W(Q))return xe(H,F,Q,re);if(G(Q)){if(Ce=G(Q),typeof Ce!="function")throw Error(a(150));return Q=Ce.call(Q),Re(H,F,Q,re)}if(typeof Q.then=="function")return pt(H,F,Zc(Q),re);if(Q.$$typeof===T)return pt(H,F,Qc(H,Q),re);Wc(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,F!==null&&F.tag===6?(l(H,F.sibling),re=p(F,Q),re.return=H,H=re):(l(H,F),re=yd(Q,H.mode,re),re.return=H,H=re),E(H)):l(H,F)}return function(H,F,Q,re){try{ho=0;var Ce=pt(H,F,Q,re);return Us=null,Ce}catch(we){if(we===Bs||we===Vc)throw we;var it=Vn(29,we,null,H.mode);return it.lanes=re,it.return=H,it}finally{}}}var qr=wb(!0),_b=wb(!1),$a=!1;function Rd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Md(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Pa(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function qa(i,r,l){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(rt&2)!==0){var p=u.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),u.pending=r,r=qc(i),lb(i,null,l),r}return Pc(i,u,r,l),qc(i)}function po(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,De(i,l)}}function jd(i,r){var l=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var p=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var E={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?p=b=E:b=b.next=E,l=l.next}while(l!==null);b===null?p=b=r:b=b.next=r}else p=b=r;l={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:b,shared:u.shared,callbacks:u.callbacks},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}var Dd=!1;function go(){if(Dd){var i=zs;if(i!==null)throw i}}function bo(i,r,l,u){Dd=!1;var p=i.updateQueue;$a=!1;var b=p.firstBaseUpdate,E=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var I=N,Y=I.next;I.next=null,E===null?b=Y:E.next=Y,E=I;var ne=i.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==E&&(N===null?ne.firstBaseUpdate=Y:N.next=Y,ne.lastBaseUpdate=I))}if(b!==null){var se=p.baseState;E=0,ne=Y=I=null,N=b;do{var X=N.lane&-536870913,ee=X!==N.lane;if(ee?(Xe&X)===X:(u&X)===X){X!==0&&X===Is&&(Dd=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var xe=i,Re=N;X=r;var pt=l;switch(Re.tag){case 1:if(xe=Re.payload,typeof xe=="function"){se=xe.call(pt,se,X);break e}se=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Re.payload,X=typeof xe=="function"?xe.call(pt,se,X):xe,X==null)break e;se=g({},se,X);break e;case 2:$a=!0}}X=N.callback,X!==null&&(i.flags|=64,ee&&(i.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(Y=ne=ee,I=se):ne=ne.next=ee,E|=X;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;ee=N,N=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);ne===null&&(I=se),p.baseState=I,p.firstBaseUpdate=Y,p.lastBaseUpdate=ne,b===null&&(p.shared.lanes=0),Ya|=E,i.lanes=E,i.memoizedState=se}}function kb(i,r){if(typeof i!="function")throw Error(a(191,i));i.call(r)}function Nb(i,r){var l=i.callbacks;if(l!==null)for(i.callbacks=null,i=0;i<l.length;i++)kb(l[i],r)}var Fs=L(null),Jc=L(0);function Tb(i,r){i=ba,C(Jc,i),C(Fs,r),ba=i|r.baseLanes}function Ld(){C(Jc,ba),C(Fs,Fs.current)}function Id(){ba=Jc.current,J(Fs),J(Jc)}var Xn=L(null),mi=null;function Ha(i){var r=i.alternate;C(Pt,Pt.current&1),C(Xn,i),mi===null&&(r===null||Fs.current!==null||r.memoizedState!==null)&&(mi=i)}function zd(i){C(Pt,Pt.current),C(Xn,i),mi===null&&(mi=i)}function Cb(i){i.tag===22?(C(Pt,Pt.current),C(Xn,i),mi===null&&(mi=i)):Ka()}function Ka(){C(Pt,Pt.current),C(Xn,Xn.current)}function Zn(i){J(Xn),mi===i&&(mi=null),J(Pt)}var Pt=L(0);function eu(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||qh(l)||Hh(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var ca=0,Ue=null,ht=null,Yt=null,tu=!1,$s=!1,Hr=!1,nu=0,yo=0,Ps=null,T_=0;function It(){throw Error(a(321))}function Bd(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!Yn(i[l],r[l]))return!1;return!0}function Ud(i,r,l,u,p,b){return ca=b,Ue=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,K.H=i===null||i.memoizedState===null?fy:eh,Hr=!1,b=l(u,p),Hr=!1,$s&&(b=Ob(r,l,u,p)),Ab(i),b}function Ab(i){K.H=Eo;var r=ht!==null&&ht.next!==null;if(ca=0,Yt=ht=Ue=null,tu=!1,yo=0,Ps=null,r)throw Error(a(300));i===null||Vt||(i=i.dependencies,i!==null&&Gc(i)&&(Vt=!0))}function Ob(i,r,l,u){Ue=i;var p=0;do{if($s&&(Ps=null),yo=0,$s=!1,25<=p)throw Error(a(301));if(p+=1,Yt=ht=null,i.updateQueue!=null){var b=i.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}K.H=dy,b=r(l,u)}while($s);return b}function C_(){var i=K.H,r=i.useState()[0];return r=typeof r.then=="function"?xo(r):r,i=i.useState()[0],(ht!==null?ht.memoizedState:null)!==i&&(Ue.flags|=1024),r}function Fd(){var i=nu!==0;return nu=0,i}function $d(i,r,l){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~l}function Pd(i){if(tu){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}tu=!1}ca=0,Yt=ht=Ue=null,$s=!1,yo=nu=0,Ps=null}function Sn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?Ue.memoizedState=Yt=i:Yt=Yt.next=i,Yt}function qt(){if(ht===null){var i=Ue.alternate;i=i!==null?i.memoizedState:null}else i=ht.next;var r=Yt===null?Ue.memoizedState:Yt.next;if(r!==null)Yt=r,ht=i;else{if(i===null)throw Ue.alternate===null?Error(a(467)):Error(a(310));ht=i,i={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Yt===null?Ue.memoizedState=Yt=i:Yt=Yt.next=i}return Yt}function iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(i){var r=yo;return yo+=1,Ps===null&&(Ps=[]),i=vb(Ps,i,r),r=Ue,(Yt===null?r.memoizedState:Yt.next)===null&&(r=r.alternate,K.H=r===null||r.memoizedState===null?fy:eh),i}function au(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return xo(i);if(i.$$typeof===T)return ln(i)}throw Error(a(438,String(i)))}function qd(i){var r=null,l=Ue.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var u=Ue.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=iu(),Ue.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(i),u=0;u<i;u++)l[u]=O;return r.index++,l}function ua(i,r){return typeof r=="function"?r(i):r}function ru(i){var r=qt();return Hd(r,ht,i)}function Hd(i,r,l){var u=i.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=l;var p=i.baseQueue,b=u.pending;if(b!==null){if(p!==null){var E=p.next;p.next=b.next,b.next=E}r.baseQueue=p=b,u.pending=null}if(b=i.baseState,p===null)i.memoizedState=b;else{r=p.next;var N=E=null,I=null,Y=r,ne=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(Xe&se)===se:(ca&se)===se){var X=Y.revertLane;if(X===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===Is&&(ne=!0);else if((ca&X)===X){Y=Y.next,X===Is&&(ne=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(N=I=se,E=b):I=I.next=se,Ue.lanes|=X,Ya|=X;se=Y.action,Hr&&l(b,se),b=Y.hasEagerState?Y.eagerState:l(b,se)}else X={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(N=I=X,E=b):I=I.next=X,Ue.lanes|=se,Ya|=se;Y=Y.next}while(Y!==null&&Y!==r);if(I===null?E=b:I.next=N,!Yn(b,i.memoizedState)&&(Vt=!0,ne&&(l=zs,l!==null)))throw l;i.memoizedState=b,i.baseState=E,i.baseQueue=I,u.lastRenderedState=b}return p===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Kd(i){var r=qt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=i;var u=l.dispatch,p=l.pending,b=r.memoizedState;if(p!==null){l.pending=null;var E=p=p.next;do b=i(b,E.action),E=E.next;while(E!==p);Yn(b,r.memoizedState)||(Vt=!0),r.memoizedState=b,r.baseQueue===null&&(r.baseState=b),l.lastRenderedState=b}return[b,u]}function Rb(i,r,l){var u=Ue,p=qt(),b=Je;if(b){if(l===void 0)throw Error(a(407));l=l()}else l=r();var E=!Yn((ht||p).memoizedState,l);if(E&&(p.memoizedState=l,Vt=!0),p=p.queue,Yd(Db.bind(null,u,p,i),[i]),p.getSnapshot!==r||E||Yt!==null&&Yt.memoizedState.tag&1){if(u.flags|=2048,qs(9,{destroy:void 0},jb.bind(null,u,p,l,r),null),yt===null)throw Error(a(349));b||(ca&127)!==0||Mb(u,r,l)}return l}function Mb(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=Ue.updateQueue,r===null?(r=iu(),Ue.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function jb(i,r,l,u){r.value=l,r.getSnapshot=u,Lb(r)&&Ib(i)}function Db(i,r,l){return l(function(){Lb(r)&&Ib(i)})}function Lb(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!Yn(i,l)}catch{return!0}}function Ib(i){var r=Lr(i,2);r!==null&&In(r,i,2)}function Gd(i){var r=Sn();if(typeof i=="function"){var l=i;if(i=l(),Hr){un(!0);try{l()}finally{un(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:i},r}function zb(i,r,l,u){return i.baseState=l,Hd(i,ht,typeof u=="function"?u:ua)}function A_(i,r,l,u,p){if(ou(i))throw Error(a(485));if(i=r.action,i!==null){var b={payload:p,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){b.listeners.push(E)}};K.T!==null?l(!0):b.isTransition=!1,u(b),l=r.pending,l===null?(b.next=r.pending=b,Bb(r,b)):(b.next=l.next,r.pending=l.next=b)}}function Bb(i,r){var l=r.action,u=r.payload,p=i.state;if(r.isTransition){var b=K.T,E={};K.T=E;try{var N=l(p,u),I=K.S;I!==null&&I(E,N),Ub(i,r,N)}catch(Y){Qd(i,r,Y)}finally{b!==null&&E.types!==null&&(b.types=E.types),K.T=b}}else try{b=l(p,u),Ub(i,r,b)}catch(Y){Qd(i,r,Y)}}function Ub(i,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Fb(i,r,u)},function(u){return Qd(i,r,u)}):Fb(i,r,l)}function Fb(i,r,l){r.status="fulfilled",r.value=l,$b(r),i.state=l,r=i.pending,r!==null&&(l=r.next,l===r?i.pending=null:(l=l.next,r.next=l,Bb(i,l)))}function Qd(i,r,l){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=l,$b(r),r=r.next;while(r!==u)}i.action=null}function $b(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function Pb(i,r){return r}function qb(i,r){if(Je){var l=yt.formState;if(l!==null){e:{var u=Ue;if(Je){if(_t){t:{for(var p=_t,b=hi;p.nodeType!==8;){if(!b){p=null;break t}if(p=pi(p.nextSibling),p===null){p=null;break t}}b=p.data,p=b==="F!"||b==="F"?p:null}if(p){_t=pi(p.nextSibling),u=p.data==="F!";break e}}Ua(u)}u=!1}u&&(r=l[0])}}return l=Sn(),l.memoizedState=l.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pb,lastRenderedState:r},l.queue=u,l=oy.bind(null,Ue,u),u.dispatch=l,u=Gd(!1),b=Jd.bind(null,Ue,!1,u.queue),u=Sn(),p={state:r,dispatch:null,action:i,pending:null},u.queue=p,l=A_.bind(null,Ue,p,b,l),p.dispatch=l,u.memoizedState=i,[r,l,!1]}function Hb(i){var r=qt();return Kb(r,ht,i)}function Kb(i,r,l){if(r=Hd(i,r,Pb)[0],i=ru(ua)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=xo(r)}catch(E){throw E===Bs?Vc:E}else u=r;r=qt();var p=r.queue,b=p.dispatch;return l!==r.memoizedState&&(Ue.flags|=2048,qs(9,{destroy:void 0},O_.bind(null,p,l),null)),[u,b,i]}function O_(i,r){i.action=r}function Gb(i){var r=qt(),l=ht;if(l!==null)return Kb(r,l,i);qt(),r=r.memoizedState,l=qt();var u=l.queue.dispatch;return l.memoizedState=i,[r,u,!1]}function qs(i,r,l,u){return i={tag:i,create:l,deps:u,inst:r,next:null},r=Ue.updateQueue,r===null&&(r=iu(),Ue.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=i.next=i:(u=l.next,l.next=i,i.next=u,r.lastEffect=i),i}function Qb(){return qt().memoizedState}function su(i,r,l,u){var p=Sn();Ue.flags|=i,p.memoizedState=qs(1|r,{destroy:void 0},l,u===void 0?null:u)}function lu(i,r,l,u){var p=qt();u=u===void 0?null:u;var b=p.memoizedState.inst;ht!==null&&u!==null&&Bd(u,ht.memoizedState.deps)?p.memoizedState=qs(r,b,l,u):(Ue.flags|=i,p.memoizedState=qs(1|r,b,l,u))}function Yb(i,r){su(8390656,8,i,r)}function Yd(i,r){lu(2048,8,i,r)}function R_(i){Ue.flags|=4;var r=Ue.updateQueue;if(r===null)r=iu(),Ue.updateQueue=r,r.events=[i];else{var l=r.events;l===null?r.events=[i]:l.push(i)}}function Vb(i){var r=qt().memoizedState;return R_({ref:r,nextImpl:i}),function(){if((rt&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function Xb(i,r){return lu(4,2,i,r)}function Zb(i,r){return lu(4,4,i,r)}function Wb(i,r){if(typeof r=="function"){i=i();var l=r(i);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function Jb(i,r,l){l=l!=null?l.concat([i]):null,lu(4,4,Wb.bind(null,r,i),l)}function Vd(){}function ey(i,r){var l=qt();r=r===void 0?null:r;var u=l.memoizedState;return r!==null&&Bd(r,u[1])?u[0]:(l.memoizedState=[i,r],i)}function ty(i,r){var l=qt();r=r===void 0?null:r;var u=l.memoizedState;if(r!==null&&Bd(r,u[1]))return u[0];if(u=i(),Hr){un(!0);try{i()}finally{un(!1)}}return l.memoizedState=[u,r],u}function Xd(i,r,l){return l===void 0||(ca&1073741824)!==0&&(Xe&261930)===0?i.memoizedState=r:(i.memoizedState=l,i=nx(),Ue.lanes|=i,Ya|=i,l)}function ny(i,r,l,u){return Yn(l,r)?l:Fs.current!==null?(i=Xd(i,l,u),Yn(i,r)||(Vt=!0),i):(ca&42)===0||(ca&1073741824)!==0&&(Xe&261930)===0?(Vt=!0,i.memoizedState=l):(i=nx(),Ue.lanes|=i,Ya|=i,r)}function iy(i,r,l,u,p){var b=oe.p;oe.p=b!==0&&8>b?b:8;var E=K.T,N={};K.T=N,Jd(i,!1,r,l);try{var I=p(),Y=K.S;if(Y!==null&&Y(N,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=N_(I,u);vo(i,r,ne,ei(i))}else vo(i,r,u,ei(i))}catch(se){vo(i,r,{then:function(){},status:"rejected",reason:se},ei())}finally{oe.p=b,E!==null&&N.types!==null&&(E.types=N.types),K.T=E}}function M_(){}function Zd(i,r,l,u){if(i.tag!==5)throw Error(a(476));var p=ay(i).queue;iy(i,p,r,V,l===null?M_:function(){return ry(i),l(u)})}function ay(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:V},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:l},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function ry(i){var r=ay(i);r.next===null&&(r=i.alternate.memoizedState),vo(i,r.next.queue,{},ei())}function Wd(){return ln(zo)}function sy(){return qt().memoizedState}function ly(){return qt().memoizedState}function j_(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var l=ei();i=Pa(l);var u=qa(r,i,l);u!==null&&(In(u,r,l),po(u,r,l)),r={cache:Td()},i.payload=r;return}r=r.return}}function D_(i,r,l){var u=ei();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ou(i)?cy(r,l):(l=gd(i,r,l,u),l!==null&&(In(l,i,u),uy(l,r,u)))}function oy(i,r,l){var u=ei();vo(i,r,l,u)}function vo(i,r,l,u){var p={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ou(i))cy(r,p);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=r.lastRenderedReducer,b!==null))try{var E=r.lastRenderedState,N=b(E,l);if(p.hasEagerState=!0,p.eagerState=N,Yn(N,E))return Pc(i,r,p,0),yt===null&&$c(),!1}catch{}finally{}if(l=gd(i,r,p,u),l!==null)return In(l,i,u),uy(l,r,u),!0}return!1}function Jd(i,r,l,u){if(u={lane:2,revertLane:Rh(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ou(i)){if(r)throw Error(a(479))}else r=gd(i,l,u,2),r!==null&&In(r,i,2)}function ou(i){var r=i.alternate;return i===Ue||r!==null&&r===Ue}function cy(i,r){$s=tu=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function uy(i,r,l){if((l&4194048)!==0){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,De(i,l)}}var Eo={readContext:ln,use:au,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};Eo.useEffectEvent=It;var fy={readContext:ln,use:au,useCallback:function(i,r){return Sn().memoizedState=[i,r===void 0?null:r],i},useContext:ln,useEffect:Yb,useImperativeHandle:function(i,r,l){l=l!=null?l.concat([i]):null,su(4194308,4,Wb.bind(null,r,i),l)},useLayoutEffect:function(i,r){return su(4194308,4,i,r)},useInsertionEffect:function(i,r){su(4,2,i,r)},useMemo:function(i,r){var l=Sn();r=r===void 0?null:r;var u=i();if(Hr){un(!0);try{i()}finally{un(!1)}}return l.memoizedState=[u,r],u},useReducer:function(i,r,l){var u=Sn();if(l!==void 0){var p=l(r);if(Hr){un(!0);try{l(r)}finally{un(!1)}}}else p=r;return u.memoizedState=u.baseState=p,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},u.queue=i,i=i.dispatch=D_.bind(null,Ue,i),[u.memoizedState,i]},useRef:function(i){var r=Sn();return i={current:i},r.memoizedState=i},useState:function(i){i=Gd(i);var r=i.queue,l=oy.bind(null,Ue,r);return r.dispatch=l,[i.memoizedState,l]},useDebugValue:Vd,useDeferredValue:function(i,r){var l=Sn();return Xd(l,i,r)},useTransition:function(){var i=Gd(!1);return i=iy.bind(null,Ue,i.queue,!0,!1),Sn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,l){var u=Ue,p=Sn();if(Je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),yt===null)throw Error(a(349));(Xe&127)!==0||Mb(u,r,l)}p.memoizedState=l;var b={value:l,getSnapshot:r};return p.queue=b,Yb(Db.bind(null,u,b,i),[i]),u.flags|=2048,qs(9,{destroy:void 0},jb.bind(null,u,b,l,r),null),l},useId:function(){var i=Sn(),r=yt.identifierPrefix;if(Je){var l=Fi,u=Ui;l=(u&~(1<<32-ot(u)-1)).toString(32)+l,r="_"+r+"R_"+l,l=nu++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=T_++,r="_"+r+"r_"+l.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Wd,useFormState:qb,useActionState:qb,useOptimistic:function(i){var r=Sn();r.memoizedState=r.baseState=i;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=Jd.bind(null,Ue,!0,l),l.dispatch=r,[i,r]},useMemoCache:qd,useCacheRefresh:function(){return Sn().memoizedState=j_.bind(null,Ue)},useEffectEvent:function(i){var r=Sn(),l={impl:i};return r.memoizedState=l,function(){if((rt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},eh={readContext:ln,use:au,useCallback:ey,useContext:ln,useEffect:Yd,useImperativeHandle:Jb,useInsertionEffect:Xb,useLayoutEffect:Zb,useMemo:ty,useReducer:ru,useRef:Qb,useState:function(){return ru(ua)},useDebugValue:Vd,useDeferredValue:function(i,r){var l=qt();return ny(l,ht.memoizedState,i,r)},useTransition:function(){var i=ru(ua)[0],r=qt().memoizedState;return[typeof i=="boolean"?i:xo(i),r]},useSyncExternalStore:Rb,useId:sy,useHostTransitionStatus:Wd,useFormState:Hb,useActionState:Hb,useOptimistic:function(i,r){var l=qt();return zb(l,ht,i,r)},useMemoCache:qd,useCacheRefresh:ly};eh.useEffectEvent=Vb;var dy={readContext:ln,use:au,useCallback:ey,useContext:ln,useEffect:Yd,useImperativeHandle:Jb,useInsertionEffect:Xb,useLayoutEffect:Zb,useMemo:ty,useReducer:Kd,useRef:Qb,useState:function(){return Kd(ua)},useDebugValue:Vd,useDeferredValue:function(i,r){var l=qt();return ht===null?Xd(l,i,r):ny(l,ht.memoizedState,i,r)},useTransition:function(){var i=Kd(ua)[0],r=qt().memoizedState;return[typeof i=="boolean"?i:xo(i),r]},useSyncExternalStore:Rb,useId:sy,useHostTransitionStatus:Wd,useFormState:Gb,useActionState:Gb,useOptimistic:function(i,r){var l=qt();return ht!==null?zb(l,ht,i,r):(l.baseState=i,[i,l.queue.dispatch])},useMemoCache:qd,useCacheRefresh:ly};dy.useEffectEvent=Vb;function th(i,r,l,u){r=i.memoizedState,l=l(u,r),l=l==null?r:g({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var nh={enqueueSetState:function(i,r,l){i=i._reactInternals;var u=ei(),p=Pa(u);p.payload=r,l!=null&&(p.callback=l),r=qa(i,p,u),r!==null&&(In(r,i,u),po(r,i,u))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var u=ei(),p=Pa(u);p.tag=1,p.payload=r,l!=null&&(p.callback=l),r=qa(i,p,u),r!==null&&(In(r,i,u),po(r,i,u))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=ei(),u=Pa(l);u.tag=2,r!=null&&(u.callback=r),r=qa(i,u,l),r!==null&&(In(r,i,l),po(r,i,l))}};function hy(i,r,l,u,p,b,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,b,E):r.prototype&&r.prototype.isPureReactComponent?!so(l,u)||!so(p,b):!0}function my(i,r,l,u){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,u),r.state!==i&&nh.enqueueReplaceState(r,r.state,null)}function Kr(i,r){var l=r;if("ref"in r){l={};for(var u in r)u!=="ref"&&(l[u]=r[u])}if(i=i.defaultProps){l===r&&(l=g({},l));for(var p in i)l[p]===void 0&&(l[p]=i[p])}return l}function py(i){Fc(i)}function gy(i){console.error(i)}function by(i){Fc(i)}function cu(i,r){try{var l=i.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function yy(i,r,l){try{var u=i.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function ih(i,r,l){return l=Pa(l),l.tag=3,l.payload={element:null},l.callback=function(){cu(i,r)},l}function xy(i){return i=Pa(i),i.tag=3,i}function vy(i,r,l,u){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var b=u.value;i.payload=function(){return p(b)},i.callback=function(){yy(r,l,u)}}var E=l.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){yy(r,l,u),typeof p!="function"&&(Va===null?Va=new Set([this]):Va.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})})}function L_(i,r,l,u,p){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=l.alternate,r!==null&&Ls(r,l,p,!0),l=Xn.current,l!==null){switch(l.tag){case 31:case 13:return mi===null?Eu():l.alternate===null&&zt===0&&(zt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,u===Xc?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([u]):r.add(u),Ch(i,u,p)),!1;case 22:return l.flags|=65536,u===Xc?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([u]):l.add(u)),Ch(i,u,p)),!1}throw Error(a(435,l.tag))}return Ch(i,u,p),Eu(),!1}if(Je)return r=Xn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,u!==Sd&&(i=Error(a(422),{cause:u}),co(ui(i,l)))):(u!==Sd&&(r=Error(a(423),{cause:u}),co(ui(r,l))),i=i.current.alternate,i.flags|=65536,p&=-p,i.lanes|=p,u=ui(u,l),p=ih(i.stateNode,u,p),jd(i,p),zt!==4&&(zt=2)),!1;var b=Error(a(520),{cause:u});if(b=ui(b,l),Ao===null?Ao=[b]:Ao.push(b),zt!==4&&(zt=2),r===null)return!0;u=ui(u,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,i=p&-p,l.lanes|=i,i=ih(l.stateNode,u,i),jd(l,i),!1;case 1:if(r=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Va===null||!Va.has(b))))return l.flags|=65536,p&=-p,l.lanes|=p,p=xy(p),vy(p,i,l,u),jd(l,p),!1}l=l.return}while(l!==null);return!1}var ah=Error(a(461)),Vt=!1;function on(i,r,l,u){r.child=i===null?_b(r,null,l,u):qr(r,i.child,l,u)}function Ey(i,r,l,u,p){l=l.render;var b=r.ref;if("ref"in u){var E={};for(var N in u)N!=="ref"&&(E[N]=u[N])}else E=u;return Ur(r),u=Ud(i,r,l,E,b,p),N=Fd(),i!==null&&!Vt?($d(i,r,p),fa(i,r,p)):(Je&&N&&vd(r),r.flags|=1,on(i,r,u,p),r.child)}function Sy(i,r,l,u,p){if(i===null){var b=l.type;return typeof b=="function"&&!bd(b)&&b.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=b,wy(i,r,b,u,p)):(i=Hc(l.type,null,u,r,r.mode,p),i.ref=r.ref,i.return=r,r.child=i)}if(b=i.child,!dh(i,p)){var E=b.memoizedProps;if(l=l.compare,l=l!==null?l:so,l(E,u)&&i.ref===r.ref)return fa(i,r,p)}return r.flags|=1,i=ra(b,u),i.ref=r.ref,i.return=r,r.child=i}function wy(i,r,l,u,p){if(i!==null){var b=i.memoizedProps;if(so(b,u)&&i.ref===r.ref)if(Vt=!1,r.pendingProps=u=b,dh(i,p))(i.flags&131072)!==0&&(Vt=!0);else return r.lanes=i.lanes,fa(i,r,p)}return rh(i,r,l,u,p)}function _y(i,r,l,u){var p=u.children,b=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(b=b!==null?b.baseLanes|l:l,i!==null){for(u=r.child=i.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~b}else u=0,r.child=null;return ky(i,r,b,l,u)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Yc(r,b!==null?b.cachePool:null),b!==null?Tb(r,b):Ld(),Cb(r);else return u=r.lanes=536870912,ky(i,r,b!==null?b.baseLanes|l:l,l,u)}else b!==null?(Yc(r,b.cachePool),Tb(r,b),Ka(),r.memoizedState=null):(i!==null&&Yc(r,null),Ld(),Ka());return on(i,r,p,l),r.child}function So(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ky(i,r,l,u,p){var b=Ad();return b=b===null?null:{parent:Qt._currentValue,pool:b},r.memoizedState={baseLanes:l,cachePool:b},i!==null&&Yc(r,null),Ld(),Cb(r),i!==null&&Ls(i,r,u,!0),r.childLanes=p,null}function uu(i,r){return r=du({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function Ny(i,r,l){return qr(r,i.child,null,l),i=uu(r,r.pendingProps),i.flags|=2,Zn(r),r.memoizedState=null,i}function I_(i,r,l){var u=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(Je){if(u.mode==="hidden")return i=uu(r,u),r.lanes=536870912,So(null,i);if(zd(r),(i=_t)?(i=Bx(i,hi),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:za!==null?{id:Ui,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},l=cb(i),l.return=r,r.child=l,sn=r,_t=null)):i=null,i===null)throw Ua(r);return r.lanes=536870912,null}return uu(r,u)}var b=i.memoizedState;if(b!==null){var E=b.dehydrated;if(zd(r),p)if(r.flags&256)r.flags&=-257,r=Ny(i,r,l);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(a(558));else if(Vt||Ls(i,r,l,!1),p=(l&i.childLanes)!==0,Vt||p){if(u=yt,u!==null&&(E=Ut(u,l),E!==0&&E!==b.retryLane))throw b.retryLane=E,Lr(i,E),In(u,i,E),ah;Eu(),r=Ny(i,r,l)}else i=b.treeContext,_t=pi(E.nextSibling),sn=r,Je=!0,Ba=null,hi=!1,i!==null&&db(r,i),r=uu(r,u),r.flags|=4096;return r}return i=ra(i.child,{mode:u.mode,children:u.children}),i.ref=r.ref,r.child=i,i.return=r,i}function fu(i,r){var l=r.ref;if(l===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(i===null||i.ref!==l)&&(r.flags|=4194816)}}function rh(i,r,l,u,p){return Ur(r),l=Ud(i,r,l,u,void 0,p),u=Fd(),i!==null&&!Vt?($d(i,r,p),fa(i,r,p)):(Je&&u&&vd(r),r.flags|=1,on(i,r,l,p),r.child)}function Ty(i,r,l,u,p,b){return Ur(r),r.updateQueue=null,l=Ob(r,u,l,p),Ab(i),u=Fd(),i!==null&&!Vt?($d(i,r,b),fa(i,r,b)):(Je&&u&&vd(r),r.flags|=1,on(i,r,l,b),r.child)}function Cy(i,r,l,u,p){if(Ur(r),r.stateNode===null){var b=Rs,E=l.contextType;typeof E=="object"&&E!==null&&(b=ln(E)),b=new l(u,b),r.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=nh,r.stateNode=b,b._reactInternals=r,b=r.stateNode,b.props=u,b.state=r.memoizedState,b.refs={},Rd(r),E=l.contextType,b.context=typeof E=="object"&&E!==null?ln(E):Rs,b.state=r.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(th(r,l,E,u),b.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(E=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),E!==b.state&&nh.enqueueReplaceState(b,b.state,null),bo(r,u,b,p),go(),b.state=r.memoizedState),typeof b.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(i===null){b=r.stateNode;var N=r.memoizedProps,I=Kr(l,N);b.props=I;var Y=b.context,ne=l.contextType;E=Rs,typeof ne=="object"&&ne!==null&&(E=ln(ne));var se=l.getDerivedStateFromProps;ne=typeof se=="function"||typeof b.getSnapshotBeforeUpdate=="function",N=r.pendingProps!==N,ne||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(N||Y!==E)&&my(r,b,u,E),$a=!1;var X=r.memoizedState;b.state=X,bo(r,u,b,p),go(),Y=r.memoizedState,N||X!==Y||$a?(typeof se=="function"&&(th(r,l,se,u),Y=r.memoizedState),(I=$a||hy(r,l,I,u,X,Y,E))?(ne||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(r.flags|=4194308)):(typeof b.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=Y),b.props=u,b.state=Y,b.context=E,u=I):(typeof b.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{b=r.stateNode,Md(i,r),E=r.memoizedProps,ne=Kr(l,E),b.props=ne,se=r.pendingProps,X=b.context,Y=l.contextType,I=Rs,typeof Y=="object"&&Y!==null&&(I=ln(Y)),N=l.getDerivedStateFromProps,(Y=typeof N=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==se||X!==I)&&my(r,b,u,I),$a=!1,X=r.memoizedState,b.state=X,bo(r,u,b,p),go();var ee=r.memoizedState;E!==se||X!==ee||$a||i!==null&&i.dependencies!==null&&Gc(i.dependencies)?(typeof N=="function"&&(th(r,l,N,u),ee=r.memoizedState),(ne=$a||hy(r,l,ne,u,X,ee,I)||i!==null&&i.dependencies!==null&&Gc(i.dependencies))?(Y||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(u,ee,I),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(u,ee,I)),typeof b.componentDidUpdate=="function"&&(r.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof b.componentDidUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ee),b.props=u,b.state=ee,b.context=I,u=ne):(typeof b.componentDidUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=1024),u=!1)}return b=u,fu(i,r),u=(r.flags&128)!==0,b||u?(b=r.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:b.render(),r.flags|=1,i!==null&&u?(r.child=qr(r,i.child,null,p),r.child=qr(r,null,l,p)):on(i,r,l,p),r.memoizedState=b.state,i=r.child):i=fa(i,r,p),i}function Ay(i,r,l,u){return zr(),r.flags|=256,on(i,r,l,u),r.child}var sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lh(i){return{baseLanes:i,cachePool:yb()}}function oh(i,r,l){return i=i!==null?i.childLanes&~l:0,r&&(i|=Jn),i}function Oy(i,r,l){var u=r.pendingProps,p=!1,b=(r.flags&128)!==0,E;if((E=b)||(E=i!==null&&i.memoizedState===null?!1:(Pt.current&2)!==0),E&&(p=!0,r.flags&=-129),E=(r.flags&32)!==0,r.flags&=-33,i===null){if(Je){if(p?Ha(r):Ka(),(i=_t)?(i=Bx(i,hi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:za!==null?{id:Ui,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},l=cb(i),l.return=r,r.child=l,sn=r,_t=null)):i=null,i===null)throw Ua(r);return Hh(i)?r.lanes=32:r.lanes=536870912,null}var N=u.children;return u=u.fallback,p?(Ka(),p=r.mode,N=du({mode:"hidden",children:N},p),u=Ir(u,p,l,null),N.return=r,u.return=r,N.sibling=u,r.child=N,u=r.child,u.memoizedState=lh(l),u.childLanes=oh(i,E,l),r.memoizedState=sh,So(null,u)):(Ha(r),ch(r,N))}var I=i.memoizedState;if(I!==null&&(N=I.dehydrated,N!==null)){if(b)r.flags&256?(Ha(r),r.flags&=-257,r=uh(i,r,l)):r.memoizedState!==null?(Ka(),r.child=i.child,r.flags|=128,r=null):(Ka(),N=u.fallback,p=r.mode,u=du({mode:"visible",children:u.children},p),N=Ir(N,p,l,null),N.flags|=2,u.return=r,N.return=r,u.sibling=N,r.child=u,qr(r,i.child,null,l),u=r.child,u.memoizedState=lh(l),u.childLanes=oh(i,E,l),r.memoizedState=sh,r=So(null,u));else if(Ha(r),Hh(N)){if(E=N.nextSibling&&N.nextSibling.dataset,E)var Y=E.dgst;E=Y,u=Error(a(419)),u.stack="",u.digest=E,co({value:u,source:null,stack:null}),r=uh(i,r,l)}else if(Vt||Ls(i,r,l,!1),E=(l&i.childLanes)!==0,Vt||E){if(E=yt,E!==null&&(u=Ut(E,l),u!==0&&u!==I.retryLane))throw I.retryLane=u,Lr(i,u),In(E,i,u),ah;qh(N)||Eu(),r=uh(i,r,l)}else qh(N)?(r.flags|=192,r.child=i.child,r=null):(i=I.treeContext,_t=pi(N.nextSibling),sn=r,Je=!0,Ba=null,hi=!1,i!==null&&db(r,i),r=ch(r,u.children),r.flags|=4096);return r}return p?(Ka(),N=u.fallback,p=r.mode,I=i.child,Y=I.sibling,u=ra(I,{mode:"hidden",children:u.children}),u.subtreeFlags=I.subtreeFlags&65011712,Y!==null?N=ra(Y,N):(N=Ir(N,p,l,null),N.flags|=2),N.return=r,u.return=r,u.sibling=N,r.child=u,So(null,u),u=r.child,N=i.child.memoizedState,N===null?N=lh(l):(p=N.cachePool,p!==null?(I=Qt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=yb(),N={baseLanes:N.baseLanes|l,cachePool:p}),u.memoizedState=N,u.childLanes=oh(i,E,l),r.memoizedState=sh,So(i.child,u)):(Ha(r),l=i.child,i=l.sibling,l=ra(l,{mode:"visible",children:u.children}),l.return=r,l.sibling=null,i!==null&&(E=r.deletions,E===null?(r.deletions=[i],r.flags|=16):E.push(i)),r.child=l,r.memoizedState=null,l)}function ch(i,r){return r=du({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function du(i,r){return i=Vn(22,i,null,r),i.lanes=0,i}function uh(i,r,l){return qr(r,i.child,null,l),i=ch(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function Ry(i,r,l){i.lanes|=r;var u=i.alternate;u!==null&&(u.lanes|=r),kd(i.return,r,l)}function fh(i,r,l,u,p,b){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:p,treeForkCount:b}:(E.isBackwards=r,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=l,E.tailMode=p,E.treeForkCount=b)}function My(i,r,l){var u=r.pendingProps,p=u.revealOrder,b=u.tail;u=u.children;var E=Pt.current,N=(E&2)!==0;if(N?(E=E&1|2,r.flags|=128):E&=1,C(Pt,E),on(i,r,u,l),u=Je?oo:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Ry(i,l,r);else if(i.tag===19)Ry(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(p){case"forwards":for(l=r.child,p=null;l!==null;)i=l.alternate,i!==null&&eu(i)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),fh(r,!1,p,l,b,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=r.child,r.child=null;p!==null;){if(i=p.alternate,i!==null&&eu(i)===null){r.child=p;break}i=p.sibling,p.sibling=l,l=p,p=i}fh(r,!0,l,null,b,u);break;case"together":fh(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function fa(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ya|=r.lanes,(l&r.childLanes)===0)if(i!==null){if(Ls(i,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(a(153));if(r.child!==null){for(i=r.child,l=ra(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=ra(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function dh(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Gc(i)))}function z_(i,r,l){switch(r.tag){case 3:ke(r,r.stateNode.containerInfo),Fa(r,Qt,i.memoizedState.cache),zr();break;case 27:case 5:Dt(r);break;case 4:ke(r,r.stateNode.containerInfo);break;case 10:Fa(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,zd(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Ha(r),r.flags|=128,null):(l&r.child.childLanes)!==0?Oy(i,r,l):(Ha(r),i=fa(i,r,l),i!==null?i.sibling:null);Ha(r);break;case 19:var p=(i.flags&128)!==0;if(u=(l&r.childLanes)!==0,u||(Ls(i,r,l,!1),u=(l&r.childLanes)!==0),p){if(u)return My(i,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),C(Pt,Pt.current),u)break;return null;case 22:return r.lanes=0,_y(i,r,l,r.pendingProps);case 24:Fa(r,Qt,i.memoizedState.cache)}return fa(i,r,l)}function jy(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps)Vt=!0;else{if(!dh(i,l)&&(r.flags&128)===0)return Vt=!1,z_(i,r,l);Vt=(i.flags&131072)!==0}else Vt=!1,Je&&(r.flags&1048576)!==0&&fb(r,oo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(i=$r(r.elementType),r.type=i,typeof i=="function")bd(i)?(u=Kr(i,u),r.tag=1,r=Cy(null,r,i,u,l)):(r.tag=0,r=rh(null,r,i,u,l));else{if(i!=null){var p=i.$$typeof;if(p===D){r.tag=11,r=Ey(null,r,i,u,l);break e}else if(p===q){r.tag=14,r=Sy(null,r,i,u,l);break e}}throw r=ae(i)||i,Error(a(306,r,""))}}return r;case 0:return rh(i,r,r.type,r.pendingProps,l);case 1:return u=r.type,p=Kr(u,r.pendingProps),Cy(i,r,u,p,l);case 3:e:{if(ke(r,r.stateNode.containerInfo),i===null)throw Error(a(387));u=r.pendingProps;var b=r.memoizedState;p=b.element,Md(i,r),bo(r,u,null,l);var E=r.memoizedState;if(u=E.cache,Fa(r,Qt,u),u!==b.cache&&Nd(r,[Qt],l,!0),go(),u=E.element,b.isDehydrated)if(b={element:u,isDehydrated:!1,cache:E.cache},r.updateQueue.baseState=b,r.memoizedState=b,r.flags&256){r=Ay(i,r,u,l);break e}else if(u!==p){p=ui(Error(a(424)),r),co(p),r=Ay(i,r,u,l);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(_t=pi(i.firstChild),sn=r,Je=!0,Ba=null,hi=!0,l=_b(r,null,u,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(zr(),u===p){r=fa(i,r,l);break e}on(i,r,u,l)}r=r.child}return r;case 26:return fu(i,r),i===null?(l=Hx(r.type,null,r.pendingProps,null))?r.memoizedState=l:Je||(l=r.type,i=r.pendingProps,u=Cu(ve.current).createElement(l),u[Ft]=r,u[fn]=i,cn(u,l,i),Kt(u),r.stateNode=u):r.memoizedState=Hx(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Dt(r),i===null&&Je&&(u=r.stateNode=$x(r.type,r.pendingProps,ve.current),sn=r,hi=!0,p=_t,Ja(r.type)?(Kh=p,_t=pi(u.firstChild)):_t=p),on(i,r,r.pendingProps.children,l),fu(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&Je&&((p=u=_t)&&(u=hk(u,r.type,r.pendingProps,hi),u!==null?(r.stateNode=u,sn=r,_t=pi(u.firstChild),hi=!1,p=!0):p=!1),p||Ua(r)),Dt(r),p=r.type,b=r.pendingProps,E=i!==null?i.memoizedProps:null,u=b.children,Fh(p,b)?u=null:E!==null&&Fh(p,E)&&(r.flags|=32),r.memoizedState!==null&&(p=Ud(i,r,C_,null,null,l),zo._currentValue=p),fu(i,r),on(i,r,u,l),r.child;case 6:return i===null&&Je&&((i=l=_t)&&(l=mk(l,r.pendingProps,hi),l!==null?(r.stateNode=l,sn=r,_t=null,i=!0):i=!1),i||Ua(r)),null;case 13:return Oy(i,r,l);case 4:return ke(r,r.stateNode.containerInfo),u=r.pendingProps,i===null?r.child=qr(r,null,u,l):on(i,r,u,l),r.child;case 11:return Ey(i,r,r.type,r.pendingProps,l);case 7:return on(i,r,r.pendingProps,l),r.child;case 8:return on(i,r,r.pendingProps.children,l),r.child;case 12:return on(i,r,r.pendingProps.children,l),r.child;case 10:return u=r.pendingProps,Fa(r,r.type,u.value),on(i,r,u.children,l),r.child;case 9:return p=r.type._context,u=r.pendingProps.children,Ur(r),p=ln(p),u=u(p),r.flags|=1,on(i,r,u,l),r.child;case 14:return Sy(i,r,r.type,r.pendingProps,l);case 15:return wy(i,r,r.type,r.pendingProps,l);case 19:return My(i,r,l);case 31:return I_(i,r,l);case 22:return _y(i,r,l,r.pendingProps);case 24:return Ur(r),u=ln(Qt),i===null?(p=Ad(),p===null&&(p=yt,b=Td(),p.pooledCache=b,b.refCount++,b!==null&&(p.pooledCacheLanes|=l),p=b),r.memoizedState={parent:u,cache:p},Rd(r),Fa(r,Qt,p)):((i.lanes&l)!==0&&(Md(i,r),bo(r,null,null,l),go()),p=i.memoizedState,b=r.memoizedState,p.parent!==u?(p={parent:u,cache:u},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Fa(r,Qt,u)):(u=b.cache,Fa(r,Qt,u),u!==p.cache&&Nd(r,[Qt],l,!0))),on(i,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function da(i){i.flags|=4}function hh(i,r,l,u,p){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(p&335544128)===p)if(i.stateNode.complete)i.flags|=8192;else if(sx())i.flags|=8192;else throw Pr=Xc,Od}else i.flags&=-16777217}function Dy(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Vx(r))if(sx())i.flags|=8192;else throw Pr=Xc,Od}function hu(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Le():536870912,i.lanes|=r,Qs|=r)}function wo(i,r){if(!Je)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function kt(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,u=0;if(r)for(var p=i.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=u,i.childLanes=l,r}function B_(i,r,l){var u=r.pendingProps;switch(Ed(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(r),null;case 1:return kt(r),null;case 3:return l=r.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),oa(Qt),Ke(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(i===null||i.child===null)&&(Ds(r)?da(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,wd())),kt(r),null;case 26:var p=r.type,b=r.memoizedState;return i===null?(da(r),b!==null?(kt(r),Dy(r,b)):(kt(r),hh(r,p,null,u,l))):b?b!==i.memoizedState?(da(r),kt(r),Dy(r,b)):(kt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==u&&da(r),kt(r),hh(r,p,i,u,l)),null;case 27:if(yn(r),l=ve.current,p=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&da(r);else{if(!u){if(r.stateNode===null)throw Error(a(166));return kt(r),null}i=me.current,Ds(r)?hb(r):(i=$x(p,u,l),r.stateNode=i,da(r))}return kt(r),null;case 5:if(yn(r),p=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&da(r);else{if(!u){if(r.stateNode===null)throw Error(a(166));return kt(r),null}if(b=me.current,Ds(r))hb(r);else{var E=Cu(ve.current);switch(b){case 1:b=E.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:b=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":b=E.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":b=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":b=E.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?b.multiple=!0:u.size&&(b.size=u.size);break;default:b=typeof u.is=="string"?E.createElement(p,{is:u.is}):E.createElement(p)}}b[Ft]=r,b[fn]=u;e:for(E=r.child;E!==null;){if(E.tag===5||E.tag===6)b.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===r)break e;for(;E.sibling===null;){if(E.return===null||E.return===r)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}r.stateNode=b;e:switch(cn(b,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&da(r)}}return kt(r),hh(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,l),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==u&&da(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(a(166));if(i=ve.current,Ds(r)){if(i=r.stateNode,l=r.memoizedProps,u=null,p=sn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}i[Ft]=r,i=!!(i.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||Ox(i.nodeValue,l)),i||Ua(r,!0)}else i=Cu(i).createTextNode(u),i[Ft]=r,r.stateNode=i}return kt(r),null;case 31:if(l=r.memoizedState,i===null||i.memoizedState!==null){if(u=Ds(r),l!==null){if(i===null){if(!u)throw Error(a(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(557));i[Ft]=r}else zr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;kt(r),i=!1}else l=wd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=l),i=!0;if(!i)return r.flags&256?(Zn(r),r):(Zn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return kt(r),null;case 13:if(u=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(p=Ds(r),u!==null&&u.dehydrated!==null){if(i===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Ft]=r}else zr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;kt(r),p=!1}else p=wd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(Zn(r),r):(Zn(r),null)}return Zn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=u!==null,i=i!==null&&i.memoizedState!==null,l&&(u=r.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),b=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),b!==p&&(u.flags|=2048)),l!==i&&l&&(r.child.flags|=8192),hu(r,r.updateQueue),kt(r),null);case 4:return Ke(),i===null&&Lh(r.stateNode.containerInfo),kt(r),null;case 10:return oa(r.type),kt(r),null;case 19:if(J(Pt),u=r.memoizedState,u===null)return kt(r),null;if(p=(r.flags&128)!==0,b=u.rendering,b===null)if(p)wo(u,!1);else{if(zt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(b=eu(i),b!==null){for(r.flags|=128,wo(u,!1),i=b.updateQueue,r.updateQueue=i,hu(r,i),r.subtreeFlags=0,i=l,l=r.child;l!==null;)ob(l,i),l=l.sibling;return C(Pt,Pt.current&1|2),Je&&sa(r,u.treeForkCount),r.child}i=i.sibling}u.tail!==null&&Ot()>yu&&(r.flags|=128,p=!0,wo(u,!1),r.lanes=4194304)}else{if(!p)if(i=eu(b),i!==null){if(r.flags|=128,p=!0,i=i.updateQueue,r.updateQueue=i,hu(r,i),wo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!b.alternate&&!Je)return kt(r),null}else 2*Ot()-u.renderingStartTime>yu&&l!==536870912&&(r.flags|=128,p=!0,wo(u,!1),r.lanes=4194304);u.isBackwards?(b.sibling=r.child,r.child=b):(i=u.last,i!==null?i.sibling=b:r.child=b,u.last=b)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=Ot(),i.sibling=null,l=Pt.current,C(Pt,p?l&1|2:l&1),Je&&sa(r,u.treeForkCount),i):(kt(r),null);case 22:case 23:return Zn(r),Id(),u=r.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(l&536870912)!==0&&(r.flags&128)===0&&(kt(r),r.subtreeFlags&6&&(r.flags|=8192)):kt(r),l=r.updateQueue,l!==null&&hu(r,l.retryQueue),l=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==l&&(r.flags|=2048),i!==null&&J(Fr),null;case 24:return l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),oa(Qt),kt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function U_(i,r){switch(Ed(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return oa(Qt),Ke(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return yn(r),null;case 31:if(r.memoizedState!==null){if(Zn(r),r.alternate===null)throw Error(a(340));zr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Zn(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(a(340));zr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return J(Pt),null;case 4:return Ke(),null;case 10:return oa(r.type),null;case 22:case 23:return Zn(r),Id(),i!==null&&J(Fr),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return oa(Qt),null;case 25:return null;default:return null}}function Ly(i,r){switch(Ed(r),r.tag){case 3:oa(Qt),Ke();break;case 26:case 27:case 5:yn(r);break;case 4:Ke();break;case 31:r.memoizedState!==null&&Zn(r);break;case 13:Zn(r);break;case 19:J(Pt);break;case 10:oa(r.type);break;case 22:case 23:Zn(r),Id(),i!==null&&J(Fr);break;case 24:oa(Qt)}}function _o(i,r){try{var l=r.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var p=u.next;l=p;do{if((l.tag&i)===i){u=void 0;var b=l.create,E=l.inst;u=b(),E.destroy=u}l=l.next}while(l!==p)}}catch(N){dt(r,r.return,N)}}function Ga(i,r,l){try{var u=r.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var b=p.next;u=b;do{if((u.tag&i)===i){var E=u.inst,N=E.destroy;if(N!==void 0){E.destroy=void 0,p=r;var I=l,Y=N;try{Y()}catch(ne){dt(p,I,ne)}}}u=u.next}while(u!==b)}}catch(ne){dt(r,r.return,ne)}}function Iy(i){var r=i.updateQueue;if(r!==null){var l=i.stateNode;try{Nb(r,l)}catch(u){dt(i,i.return,u)}}}function zy(i,r,l){l.props=Kr(i.type,i.memoizedProps),l.state=i.memoizedState;try{l.componentWillUnmount()}catch(u){dt(i,r,u)}}function ko(i,r){try{var l=i.ref;if(l!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof l=="function"?i.refCleanup=l(u):l.current=u}}catch(p){dt(i,r,p)}}function $i(i,r){var l=i.ref,u=i.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(p){dt(i,r,p)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){dt(i,r,p)}else l.current=null}function By(i){var r=i.type,l=i.memoizedProps,u=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(p){dt(i,i.return,p)}}function mh(i,r,l){try{var u=i.stateNode;lk(u,i.type,l,r),u[fn]=r}catch(p){dt(i,i.return,p)}}function Uy(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ja(i.type)||i.tag===4}function ph(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Uy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ja(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function gh(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(i,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(i),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=he));else if(u!==4&&(u===27&&Ja(i.type)&&(l=i.stateNode,r=null),i=i.child,i!==null))for(gh(i,r,l),i=i.sibling;i!==null;)gh(i,r,l),i=i.sibling}function mu(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(u!==4&&(u===27&&Ja(i.type)&&(l=i.stateNode),i=i.child,i!==null))for(mu(i,r,l),i=i.sibling;i!==null;)mu(i,r,l),i=i.sibling}function Fy(i){var r=i.stateNode,l=i.memoizedProps;try{for(var u=i.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);cn(r,u,l),r[Ft]=i,r[fn]=l}catch(b){dt(i,i.return,b)}}var ha=!1,Xt=!1,bh=!1,$y=typeof WeakSet=="function"?WeakSet:Set,tn=null;function F_(i,r){if(i=i.containerInfo,Bh=Lu,i=Jg(i),ud(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var p=u.anchorOffset,b=u.focusNode;u=u.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var E=0,N=-1,I=-1,Y=0,ne=0,se=i,X=null;t:for(;;){for(var ee;se!==l||p!==0&&se.nodeType!==3||(N=E+p),se!==b||u!==0&&se.nodeType!==3||(I=E+u),se.nodeType===3&&(E+=se.nodeValue.length),(ee=se.firstChild)!==null;)X=se,se=ee;for(;;){if(se===i)break t;if(X===l&&++Y===p&&(N=E),X===b&&++ne===u&&(I=E),(ee=se.nextSibling)!==null)break;se=X,X=se.parentNode}se=ee}l=N===-1||I===-1?null:{start:N,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Uh={focusedElem:i,selectionRange:l},Lu=!1,tn=r;tn!==null;)if(r=tn,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,tn=i;else for(;tn!==null;){switch(r=tn,b=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(l=0;l<i.length;l++)p=i[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&b!==null){i=void 0,l=r,p=b.memoizedProps,b=b.memoizedState,u=l.stateNode;try{var xe=Kr(l.type,p);i=u.getSnapshotBeforeUpdate(xe,b),u.__reactInternalSnapshotBeforeUpdate=i}catch(Re){dt(l,l.return,Re)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,l=i.nodeType,l===9)Ph(i);else if(l===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Ph(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(a(163))}if(i=r.sibling,i!==null){i.return=r.return,tn=i;break}tn=r.return}}function Py(i,r,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:pa(i,l),u&4&&_o(5,l);break;case 1:if(pa(i,l),u&4)if(i=l.stateNode,r===null)try{i.componentDidMount()}catch(E){dt(l,l.return,E)}else{var p=Kr(l.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(p,r,i.__reactInternalSnapshotBeforeUpdate)}catch(E){dt(l,l.return,E)}}u&64&&Iy(l),u&512&&ko(l,l.return);break;case 3:if(pa(i,l),u&64&&(i=l.updateQueue,i!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Nb(i,r)}catch(E){dt(l,l.return,E)}}break;case 27:r===null&&u&4&&Fy(l);case 26:case 5:pa(i,l),r===null&&u&4&&By(l),u&512&&ko(l,l.return);break;case 12:pa(i,l);break;case 31:pa(i,l),u&4&&Ky(i,l);break;case 13:pa(i,l),u&4&&Gy(i,l),u&64&&(i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(l=V_.bind(null,l),pk(i,l))));break;case 22:if(u=l.memoizedState!==null||ha,!u){r=r!==null&&r.memoizedState!==null||Xt,p=ha;var b=Xt;ha=u,(Xt=r)&&!b?ga(i,l,(l.subtreeFlags&8772)!==0):pa(i,l),ha=p,Xt=b}break;case 30:break;default:pa(i,l)}}function qy(i){var r=i.alternate;r!==null&&(i.alternate=null,qy(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Yl(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Tt=null,Mn=!1;function ma(i,r,l){for(l=l.child;l!==null;)Hy(i,r,l),l=l.sibling}function Hy(i,r,l){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(an,l)}catch{}switch(l.tag){case 26:Xt||$i(l,r),ma(i,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Xt||$i(l,r);var u=Tt,p=Mn;Ja(l.type)&&(Tt=l.stateNode,Mn=!1),ma(i,r,l),Do(l.stateNode),Tt=u,Mn=p;break;case 5:Xt||$i(l,r);case 6:if(u=Tt,p=Mn,Tt=null,ma(i,r,l),Tt=u,Mn=p,Tt!==null)if(Mn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(l.stateNode)}catch(b){dt(l,r,b)}else try{Tt.removeChild(l.stateNode)}catch(b){dt(l,r,b)}break;case 18:Tt!==null&&(Mn?(i=Tt,Ix(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,l.stateNode),tl(i)):Ix(Tt,l.stateNode));break;case 4:u=Tt,p=Mn,Tt=l.stateNode.containerInfo,Mn=!0,ma(i,r,l),Tt=u,Mn=p;break;case 0:case 11:case 14:case 15:Ga(2,l,r),Xt||Ga(4,l,r),ma(i,r,l);break;case 1:Xt||($i(l,r),u=l.stateNode,typeof u.componentWillUnmount=="function"&&zy(l,r,u)),ma(i,r,l);break;case 21:ma(i,r,l);break;case 22:Xt=(u=Xt)||l.memoizedState!==null,ma(i,r,l),Xt=u;break;default:ma(i,r,l)}}function Ky(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{tl(i)}catch(l){dt(r,r.return,l)}}}function Gy(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{tl(i)}catch(l){dt(r,r.return,l)}}function $_(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new $y),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new $y),r;default:throw Error(a(435,i.tag))}}function pu(i,r){var l=$_(i);r.forEach(function(u){if(!l.has(u)){l.add(u);var p=X_.bind(null,i,u);u.then(p,p)}})}function jn(i,r){var l=r.deletions;if(l!==null)for(var u=0;u<l.length;u++){var p=l[u],b=i,E=r,N=E;e:for(;N!==null;){switch(N.tag){case 27:if(Ja(N.type)){Tt=N.stateNode,Mn=!1;break e}break;case 5:Tt=N.stateNode,Mn=!1;break e;case 3:case 4:Tt=N.stateNode.containerInfo,Mn=!0;break e}N=N.return}if(Tt===null)throw Error(a(160));Hy(b,E,p),Tt=null,Mn=!1,b=p.alternate,b!==null&&(b.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Qy(r,i),r=r.sibling}var Ti=null;function Qy(i,r){var l=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:jn(r,i),Dn(i),u&4&&(Ga(3,i,i.return),_o(3,i),Ga(5,i,i.return));break;case 1:jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),u&64&&ha&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(l=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var p=Ti;if(jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),u&4){var b=l!==null?l.memoizedState:null;if(u=i.memoizedState,l===null)if(u===null)if(i.stateNode===null){e:{u=i.type,l=i.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":b=p.getElementsByTagName("title")[0],(!b||b[Ar]||b[Ft]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=p.createElement(u),p.head.insertBefore(b,p.querySelector("head > title"))),cn(b,u,l),b[Ft]=i,Kt(b),u=b;break e;case"link":var E=Qx("link","href",p).get(u+(l.href||""));if(E){for(var N=0;N<E.length;N++)if(b=E[N],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){E.splice(N,1);break t}}b=p.createElement(u),cn(b,u,l),p.head.appendChild(b);break;case"meta":if(E=Qx("meta","content",p).get(u+(l.content||""))){for(N=0;N<E.length;N++)if(b=E[N],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){E.splice(N,1);break t}}b=p.createElement(u),cn(b,u,l),p.head.appendChild(b);break;default:throw Error(a(468,u))}b[Ft]=i,Kt(b),u=b}i.stateNode=u}else Yx(p,i.type,i.stateNode);else i.stateNode=Gx(p,u,i.memoizedProps);else b!==u?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,u===null?Yx(p,i.type,i.stateNode):Gx(p,u,i.memoizedProps)):u===null&&i.stateNode!==null&&mh(i,i.memoizedProps,l.memoizedProps)}break;case 27:jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),l!==null&&u&4&&mh(i,i.memoizedProps,l.memoizedProps);break;case 5:if(jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),i.flags&32){p=i.stateNode;try{je(p,"")}catch(xe){dt(i,i.return,xe)}}u&4&&i.stateNode!=null&&(p=i.memoizedProps,mh(i,p,l!==null?l.memoizedProps:p)),u&1024&&(bh=!0);break;case 6:if(jn(r,i),Dn(i),u&4){if(i.stateNode===null)throw Error(a(162));u=i.memoizedProps,l=i.stateNode;try{l.nodeValue=u}catch(xe){dt(i,i.return,xe)}}break;case 3:if(Ru=null,p=Ti,Ti=Au(r.containerInfo),jn(r,i),Ti=p,Dn(i),u&4&&l!==null&&l.memoizedState.isDehydrated)try{tl(r.containerInfo)}catch(xe){dt(i,i.return,xe)}bh&&(bh=!1,Yy(i));break;case 4:u=Ti,Ti=Au(i.stateNode.containerInfo),jn(r,i),Dn(i),Ti=u;break;case 12:jn(r,i),Dn(i);break;case 31:jn(r,i),Dn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,pu(i,u)));break;case 13:jn(r,i),Dn(i),i.child.flags&8192&&i.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(bu=Ot()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,pu(i,u)));break;case 22:p=i.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,Y=ha,ne=Xt;if(ha=Y||p,Xt=ne||I,jn(r,i),Xt=ne,ha=Y,Dn(i),u&8192)e:for(r=i.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(l===null||I||ha||Xt||Gr(i)),l=null,r=i;;){if(r.tag===5||r.tag===26){if(l===null){I=l=r;try{if(b=I.stateNode,p)E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{N=I.stateNode;var se=I.memoizedProps.style,X=se!=null&&se.hasOwnProperty("display")?se.display:null;N.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(xe){dt(I,I.return,xe)}}}else if(r.tag===6){if(l===null){I=r;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(xe){dt(I,I.return,xe)}}}else if(r.tag===18){if(l===null){I=r;try{var ee=I.stateNode;p?zx(ee,!0):zx(I.stateNode,!1)}catch(xe){dt(I,I.return,xe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=i.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,pu(i,l))));break;case 19:jn(r,i),Dn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,pu(i,u)));break;case 30:break;case 21:break;default:jn(r,i),Dn(i)}}function Dn(i){var r=i.flags;if(r&2){try{for(var l,u=i.return;u!==null;){if(Uy(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,b=ph(i);mu(i,b,p);break;case 5:var E=l.stateNode;l.flags&32&&(je(E,""),l.flags&=-33);var N=ph(i);mu(i,N,E);break;case 3:case 4:var I=l.stateNode.containerInfo,Y=ph(i);gh(i,Y,I);break;default:throw Error(a(161))}}catch(ne){dt(i,i.return,ne)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function Yy(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;Yy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function pa(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Py(i,r.alternate,r),r=r.sibling}function Gr(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Ga(4,r,r.return),Gr(r);break;case 1:$i(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&zy(r,r.return,l),Gr(r);break;case 27:Do(r.stateNode);case 26:case 5:$i(r,r.return),Gr(r);break;case 22:r.memoizedState===null&&Gr(r);break;case 30:Gr(r);break;default:Gr(r)}i=i.sibling}}function ga(i,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,p=i,b=r,E=b.flags;switch(b.tag){case 0:case 11:case 15:ga(p,b,l),_o(4,b);break;case 1:if(ga(p,b,l),u=b,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Y){dt(u,u.return,Y)}if(u=b,p=u.updateQueue,p!==null){var N=u.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)kb(I[p],N)}catch(Y){dt(u,u.return,Y)}}l&&E&64&&Iy(b),ko(b,b.return);break;case 27:Fy(b);case 26:case 5:ga(p,b,l),l&&u===null&&E&4&&By(b),ko(b,b.return);break;case 12:ga(p,b,l);break;case 31:ga(p,b,l),l&&E&4&&Ky(p,b);break;case 13:ga(p,b,l),l&&E&4&&Gy(p,b);break;case 22:b.memoizedState===null&&ga(p,b,l),ko(b,b.return);break;case 30:break;default:ga(p,b,l)}r=r.sibling}}function yh(i,r){var l=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==l&&(i!=null&&i.refCount++,l!=null&&uo(l))}function xh(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&uo(i))}function Ci(i,r,l,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Vy(i,r,l,u),r=r.sibling}function Vy(i,r,l,u){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Ci(i,r,l,u),p&2048&&_o(9,r);break;case 1:Ci(i,r,l,u);break;case 3:Ci(i,r,l,u),p&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&uo(i)));break;case 12:if(p&2048){Ci(i,r,l,u),i=r.stateNode;try{var b=r.memoizedProps,E=b.id,N=b.onPostCommit;typeof N=="function"&&N(E,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(I){dt(r,r.return,I)}}else Ci(i,r,l,u);break;case 31:Ci(i,r,l,u);break;case 13:Ci(i,r,l,u);break;case 23:break;case 22:b=r.stateNode,E=r.alternate,r.memoizedState!==null?b._visibility&2?Ci(i,r,l,u):No(i,r):b._visibility&2?Ci(i,r,l,u):(b._visibility|=2,Hs(i,r,l,u,(r.subtreeFlags&10256)!==0||!1)),p&2048&&yh(E,r);break;case 24:Ci(i,r,l,u),p&2048&&xh(r.alternate,r);break;default:Ci(i,r,l,u)}}function Hs(i,r,l,u,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var b=i,E=r,N=l,I=u,Y=E.flags;switch(E.tag){case 0:case 11:case 15:Hs(b,E,N,I,p),_o(8,E);break;case 23:break;case 22:var ne=E.stateNode;E.memoizedState!==null?ne._visibility&2?Hs(b,E,N,I,p):No(b,E):(ne._visibility|=2,Hs(b,E,N,I,p)),p&&Y&2048&&yh(E.alternate,E);break;case 24:Hs(b,E,N,I,p),p&&Y&2048&&xh(E.alternate,E);break;default:Hs(b,E,N,I,p)}r=r.sibling}}function No(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=i,u=r,p=u.flags;switch(u.tag){case 22:No(l,u),p&2048&&yh(u.alternate,u);break;case 24:No(l,u),p&2048&&xh(u.alternate,u);break;default:No(l,u)}r=r.sibling}}var To=8192;function Ks(i,r,l){if(i.subtreeFlags&To)for(i=i.child;i!==null;)Xy(i,r,l),i=i.sibling}function Xy(i,r,l){switch(i.tag){case 26:Ks(i,r,l),i.flags&To&&i.memoizedState!==null&&Tk(l,Ti,i.memoizedState,i.memoizedProps);break;case 5:Ks(i,r,l);break;case 3:case 4:var u=Ti;Ti=Au(i.stateNode.containerInfo),Ks(i,r,l),Ti=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=To,To=16777216,Ks(i,r,l),To=u):Ks(i,r,l));break;default:Ks(i,r,l)}}function Zy(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function Co(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];tn=u,Jy(u,i)}Zy(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Wy(i),i=i.sibling}function Wy(i){switch(i.tag){case 0:case 11:case 15:Co(i),i.flags&2048&&Ga(9,i,i.return);break;case 3:Co(i);break;case 12:Co(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,gu(i)):Co(i);break;default:Co(i)}}function gu(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];tn=u,Jy(u,i)}Zy(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Ga(8,r,r.return),gu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,gu(r));break;default:gu(r)}i=i.sibling}}function Jy(i,r){for(;tn!==null;){var l=tn;switch(l.tag){case 0:case 11:case 15:Ga(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:uo(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,tn=u;else e:for(l=i;tn!==null;){u=tn;var p=u.sibling,b=u.return;if(qy(u),u===l){tn=null;break e}if(p!==null){p.return=b,tn=p;break e}tn=b}}}var P_={getCacheForType:function(i){var r=ln(Qt),l=r.data.get(i);return l===void 0&&(l=i(),r.data.set(i,l)),l},cacheSignal:function(){return ln(Qt).controller.signal}},q_=typeof WeakMap=="function"?WeakMap:Map,rt=0,yt=null,Ge=null,Xe=0,ft=0,Wn=null,Qa=!1,Gs=!1,vh=!1,ba=0,zt=0,Ya=0,Qr=0,Eh=0,Jn=0,Qs=0,Ao=null,Ln=null,Sh=!1,bu=0,ex=0,yu=1/0,xu=null,Va=null,Jt=0,Xa=null,Ys=null,ya=0,wh=0,_h=null,tx=null,Oo=0,kh=null;function ei(){return(rt&2)!==0&&Xe!==0?Xe&-Xe:K.T!==null?Rh():vs()}function nx(){if(Jn===0)if((Xe&536870912)===0||Je){var i=xs;xs<<=1,(xs&3932160)===0&&(xs=262144),Jn=i}else Jn=536870912;return i=Xn.current,i!==null&&(i.flags|=32),Jn}function In(i,r,l){(i===yt&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Vs(i,0),Za(i,Xe,Jn,!1)),bt(i,l),((rt&2)===0||i!==yt)&&(i===yt&&((rt&2)===0&&(Qr|=l),zt===4&&Za(i,Xe,Jn,!1)),Pi(i))}function ix(i,r,l){if((rt&6)!==0)throw Error(a(327));var u=!l&&(r&127)===0&&(r&i.expiredLanes)===0||ie(i,r),p=u?G_(i,r):Th(i,r,!0),b=u;do{if(p===0){Gs&&!u&&Za(i,r,0,!1);break}else{if(l=i.current.alternate,b&&!H_(l)){p=Th(i,r,!1),b=!1;continue}if(p===2){if(b=r,i.errorRecoveryDisabledLanes&b)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){r=E;e:{var N=i;p=Ao;var I=N.current.memoizedState.isDehydrated;if(I&&(Vs(N,E).flags|=256),E=Th(N,E,!1),E!==2){if(vh&&!I){N.errorRecoveryDisabledLanes|=b,Qr|=b,p=4;break e}b=Ln,Ln=p,b!==null&&(Ln===null?Ln=b:Ln.push.apply(Ln,b))}p=E}if(b=!1,p!==2)continue}}if(p===1){Vs(i,0),Za(i,r,0,!0);break}e:{switch(u=i,b=p,b){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:Za(u,r,Jn,!Qa);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=bu+300-Ot(),10<p)){if(Za(u,r,Jn,!Qa),B(u,0,!0)!==0)break e;ya=r,u.timeoutHandle=Dx(ax.bind(null,u,l,Ln,xu,Sh,r,Jn,Qr,Qs,Qa,b,"Throttled",-0,0),p);break e}ax(u,l,Ln,xu,Sh,r,Jn,Qr,Qs,Qa,b,null,-0,0)}}break}while(!0);Pi(i)}function ax(i,r,l,u,p,b,E,N,I,Y,ne,se,X,ee){if(i.timeoutHandle=-1,se=r.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:he},Xy(r,b,se);var xe=(b&62914560)===b?bu-Ot():(b&4194048)===b?ex-Ot():0;if(xe=Ck(se,xe),xe!==null){ya=b,i.cancelPendingCommit=xe(dx.bind(null,i,r,b,l,u,p,E,N,I,ne,se,null,X,ee)),Za(i,b,E,!Y);return}}dx(i,r,b,l,u,p,E,N,I)}function H_(i){for(var r=i;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var p=l[u],b=p.getSnapshot;p=p.value;try{if(!Yn(b(),p))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Za(i,r,l,u){r&=~Eh,r&=~Qr,i.suspendedLanes|=r,i.pingedLanes&=~r,u&&(i.warmLanes|=r),u=i.expirationTimes;for(var p=r;0<p;){var b=31-ot(p),E=1<<b;u[b]=-1,p&=~E}l!==0&&ye(i,l,r)}function vu(){return(rt&6)===0?(Ro(0),!1):!0}function Nh(){if(Ge!==null){if(ft===0)var i=Ge.return;else i=Ge,la=Br=null,Pd(i),Us=null,ho=0,i=Ge;for(;i!==null;)Ly(i.alternate,i),i=i.return;Ge=null}}function Vs(i,r){var l=i.timeoutHandle;l!==-1&&(i.timeoutHandle=-1,uk(l)),l=i.cancelPendingCommit,l!==null&&(i.cancelPendingCommit=null,l()),ya=0,Nh(),yt=i,Ge=l=ra(i.current,null),Xe=r,ft=0,Wn=null,Qa=!1,Gs=ie(i,r),vh=!1,Qs=Jn=Eh=Qr=Ya=zt=0,Ln=Ao=null,Sh=!1,(r&8)!==0&&(r|=r&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=r;0<u;){var p=31-ot(u),b=1<<p;r|=i[p],u&=~b}return ba=r,$c(),l}function rx(i,r){Ue=null,K.H=Eo,r===Bs||r===Vc?(r=Eb(),ft=3):r===Od?(r=Eb(),ft=4):ft=r===ah?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Wn=r,Ge===null&&(zt=1,cu(i,ui(r,i.current)))}function sx(){var i=Xn.current;return i===null?!0:(Xe&4194048)===Xe?mi===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?i===mi:!1}function lx(){var i=K.H;return K.H=Eo,i===null?Eo:i}function ox(){var i=K.A;return K.A=P_,i}function Eu(){zt=4,Qa||(Xe&4194048)!==Xe&&Xn.current!==null||(Gs=!0),(Ya&134217727)===0&&(Qr&134217727)===0||yt===null||Za(yt,Xe,Jn,!1)}function Th(i,r,l){var u=rt;rt|=2;var p=lx(),b=ox();(yt!==i||Xe!==r)&&(xu=null,Vs(i,r)),r=!1;var E=zt;e:do try{if(ft!==0&&Ge!==null){var N=Ge,I=Wn;switch(ft){case 8:Nh(),E=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(r=!0);var Y=ft;if(ft=0,Wn=null,Xs(i,N,I,Y),l&&Gs){E=0;break e}break;default:Y=ft,ft=0,Wn=null,Xs(i,N,I,Y)}}K_(),E=zt;break}catch(ne){rx(i,ne)}while(!0);return r&&i.shellSuspendCounter++,la=Br=null,rt=u,K.H=p,K.A=b,Ge===null&&(yt=null,Xe=0,$c()),E}function K_(){for(;Ge!==null;)cx(Ge)}function G_(i,r){var l=rt;rt|=2;var u=lx(),p=ox();yt!==i||Xe!==r?(xu=null,yu=Ot()+500,Vs(i,r)):Gs=ie(i,r);e:do try{if(ft!==0&&Ge!==null){r=Ge;var b=Wn;t:switch(ft){case 1:ft=0,Wn=null,Xs(i,r,b,1);break;case 2:case 9:if(xb(b)){ft=0,Wn=null,ux(r);break}r=function(){ft!==2&&ft!==9||yt!==i||(ft=7),Pi(i)},b.then(r,r);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:xb(b)?(ft=0,Wn=null,ux(r)):(ft=0,Wn=null,Xs(i,r,b,7));break;case 5:var E=null;switch(Ge.tag){case 26:E=Ge.memoizedState;case 5:case 27:var N=Ge;if(E?Vx(E):N.stateNode.complete){ft=0,Wn=null;var I=N.sibling;if(I!==null)Ge=I;else{var Y=N.return;Y!==null?(Ge=Y,Su(Y)):Ge=null}break t}}ft=0,Wn=null,Xs(i,r,b,5);break;case 6:ft=0,Wn=null,Xs(i,r,b,6);break;case 8:Nh(),zt=6;break e;default:throw Error(a(462))}}Q_();break}catch(ne){rx(i,ne)}while(!0);return la=Br=null,K.H=u,K.A=p,rt=l,Ge!==null?0:(yt=null,Xe=0,$c(),zt)}function Q_(){for(;Ge!==null&&!Gl();)cx(Ge)}function cx(i){var r=jy(i.alternate,i,ba);i.memoizedProps=i.pendingProps,r===null?Su(i):Ge=r}function ux(i){var r=i,l=r.alternate;switch(r.tag){case 15:case 0:r=Ty(l,r,r.pendingProps,r.type,void 0,Xe);break;case 11:r=Ty(l,r,r.pendingProps,r.type.render,r.ref,Xe);break;case 5:Pd(r);default:Ly(l,r),r=Ge=ob(r,ba),r=jy(l,r,ba)}i.memoizedProps=i.pendingProps,r===null?Su(i):Ge=r}function Xs(i,r,l,u){la=Br=null,Pd(r),Us=null,ho=0;var p=r.return;try{if(L_(i,p,r,l,Xe)){zt=1,cu(i,ui(l,i.current)),Ge=null;return}}catch(b){if(p!==null)throw Ge=p,b;zt=1,cu(i,ui(l,i.current)),Ge=null;return}r.flags&32768?(Je||u===1?i=!0:Gs||(Xe&536870912)!==0?i=!1:(Qa=i=!0,(u===2||u===9||u===3||u===6)&&(u=Xn.current,u!==null&&u.tag===13&&(u.flags|=16384))),fx(r,i)):Su(r)}function Su(i){var r=i;do{if((r.flags&32768)!==0){fx(r,Qa);return}i=r.return;var l=B_(r.alternate,r,ba);if(l!==null){Ge=l;return}if(r=r.sibling,r!==null){Ge=r;return}Ge=r=i}while(r!==null);zt===0&&(zt=5)}function fx(i,r){do{var l=U_(i.alternate,i);if(l!==null){l.flags&=32767,Ge=l;return}if(l=i.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(i=i.sibling,i!==null)){Ge=i;return}Ge=i=l}while(i!==null);zt=6,Ge=null}function dx(i,r,l,u,p,b,E,N,I){i.cancelPendingCommit=null;do wu();while(Jt!==0);if((rt&6)!==0)throw Error(a(327));if(r!==null){if(r===i.current)throw Error(a(177));if(b=r.lanes|r.childLanes,b|=pd,Ee(i,l,b,E,N,I),i===yt&&(Ge=yt=null,Xe=0),Ys=r,Xa=i,ya=l,wh=b,_h=p,tx=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Z_(Oe,function(){return bx(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=K.T,K.T=null,p=oe.p,oe.p=2,E=rt,rt|=4;try{F_(i,r,l)}finally{rt=E,oe.p=p,K.T=u}}Jt=1,hx(),mx(),px()}}function hx(){if(Jt===1){Jt=0;var i=Xa,r=Ys,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=K.T,K.T=null;var u=oe.p;oe.p=2;var p=rt;rt|=4;try{Qy(r,i);var b=Uh,E=Jg(i.containerInfo),N=b.focusedElem,I=b.selectionRange;if(E!==N&&N&&N.ownerDocument&&Wg(N.ownerDocument.documentElement,N)){if(I!==null&&ud(N)){var Y=I.start,ne=I.end;if(ne===void 0&&(ne=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ne,N.value.length);else{var se=N.ownerDocument||document,X=se&&se.defaultView||window;if(X.getSelection){var ee=X.getSelection(),xe=N.textContent.length,Re=Math.min(I.start,xe),pt=I.end===void 0?Re:Math.min(I.end,xe);!ee.extend&&Re>pt&&(E=pt,pt=Re,Re=E);var H=Zg(N,Re),F=Zg(N,pt);if(H&&F&&(ee.rangeCount!==1||ee.anchorNode!==H.node||ee.anchorOffset!==H.offset||ee.focusNode!==F.node||ee.focusOffset!==F.offset)){var Q=se.createRange();Q.setStart(H.node,H.offset),ee.removeAllRanges(),Re>pt?(ee.addRange(Q),ee.extend(F.node,F.offset)):(Q.setEnd(F.node,F.offset),ee.addRange(Q))}}}}for(se=[],ee=N;ee=ee.parentNode;)ee.nodeType===1&&se.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var re=se[N];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Lu=!!Bh,Uh=Bh=null}finally{rt=p,oe.p=u,K.T=l}}i.current=r,Jt=2}}function mx(){if(Jt===2){Jt=0;var i=Xa,r=Ys,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var u=oe.p;oe.p=2;var p=rt;rt|=4;try{Py(i,r.alternate,r)}finally{rt=p,oe.p=u,K.T=l}}Jt=3}}function px(){if(Jt===4||Jt===3){Jt=0,bs();var i=Xa,r=Ys,l=ya,u=tx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Jt=5:(Jt=0,Ys=Xa=null,gx(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(Va=null),ea(l),r=r.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(an,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=K.T,p=oe.p,oe.p=2,K.T=null;try{for(var b=i.onRecoverableError,E=0;E<u.length;E++){var N=u[E];b(N.value,{componentStack:N.stack})}}finally{K.T=r,oe.p=p}}(ya&3)!==0&&wu(),Pi(i),p=i.pendingLanes,(l&261930)!==0&&(p&42)!==0?i===kh?Oo++:(Oo=0,kh=i):Oo=0,Ro(0)}}function gx(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,uo(r)))}function wu(){return hx(),mx(),px(),bx()}function bx(){if(Jt!==5)return!1;var i=Xa,r=wh;wh=0;var l=ea(ya),u=K.T,p=oe.p;try{oe.p=32>l?32:l,K.T=null,l=_h,_h=null;var b=Xa,E=ya;if(Jt=0,Ys=Xa=null,ya=0,(rt&6)!==0)throw Error(a(331));var N=rt;if(rt|=4,Wy(b.current),Vy(b,b.current,E,l),rt=N,Ro(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(an,b)}catch{}return!0}finally{oe.p=p,K.T=u,gx(i,r)}}function yx(i,r,l){r=ui(l,r),r=ih(i.stateNode,r,2),i=qa(i,r,2),i!==null&&(bt(i,2),Pi(i))}function dt(i,r,l){if(i.tag===3)yx(i,i,l);else for(;r!==null;){if(r.tag===3){yx(r,i,l);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Va===null||!Va.has(u))){i=ui(l,i),l=xy(2),u=qa(r,l,2),u!==null&&(vy(l,u,r,i),bt(u,2),Pi(u));break}}r=r.return}}function Ch(i,r,l){var u=i.pingCache;if(u===null){u=i.pingCache=new q_;var p=new Set;u.set(r,p)}else p=u.get(r),p===void 0&&(p=new Set,u.set(r,p));p.has(l)||(vh=!0,p.add(l),i=Y_.bind(null,i,r,l),r.then(i,i))}function Y_(i,r,l){var u=i.pingCache;u!==null&&u.delete(r),i.pingedLanes|=i.suspendedLanes&l,i.warmLanes&=~l,yt===i&&(Xe&l)===l&&(zt===4||zt===3&&(Xe&62914560)===Xe&&300>Ot()-bu?(rt&2)===0&&Vs(i,0):Eh|=l,Qs===Xe&&(Qs=0)),Pi(i)}function xx(i,r){r===0&&(r=Le()),i=Lr(i,r),i!==null&&(bt(i,r),Pi(i))}function V_(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),xx(i,l)}function X_(i,r){var l=0;switch(i.tag){case 31:case 13:var u=i.stateNode,p=i.memoizedState;p!==null&&(l=p.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(r),xx(i,l)}function Z_(i,r){return Ji(i,r)}var _u=null,Zs=null,Ah=!1,ku=!1,Oh=!1,Wa=0;function Pi(i){i!==Zs&&i.next===null&&(Zs===null?_u=Zs=i:Zs=Zs.next=i),ku=!0,Ah||(Ah=!0,J_())}function Ro(i,r){if(!Oh&&ku){Oh=!0;do for(var l=!1,u=_u;u!==null;){if(i!==0){var p=u.pendingLanes;if(p===0)var b=0;else{var E=u.suspendedLanes,N=u.pingedLanes;b=(1<<31-ot(42|i)+1)-1,b&=p&~(E&~N),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,wx(u,b))}else b=Xe,b=B(u,u===yt?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(b&3)===0||ie(u,b)||(l=!0,wx(u,b));u=u.next}while(l);Oh=!1}}function W_(){vx()}function vx(){ku=Ah=!1;var i=0;Wa!==0&&ck()&&(i=Wa);for(var r=Ot(),l=null,u=_u;u!==null;){var p=u.next,b=Ex(u,r);b===0?(u.next=null,l===null?_u=p:l.next=p,p===null&&(Zs=l)):(l=u,(i!==0||(b&3)!==0)&&(ku=!0)),u=p}Jt!==0&&Jt!==5||Ro(i),Wa!==0&&(Wa=0)}function Ex(i,r){for(var l=i.suspendedLanes,u=i.pingedLanes,p=i.expirationTimes,b=i.pendingLanes&-62914561;0<b;){var E=31-ot(b),N=1<<E,I=p[E];I===-1?((N&l)===0||(N&u)!==0)&&(p[E]=ge(N,r)):I<=r&&(i.expiredLanes|=N),b&=~N}if(r=yt,l=Xe,l=B(i,i===r?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,l===0||i===r&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&Nr(u),i.callbackNode=null,i.callbackPriority=0;if((l&3)===0||ie(i,l)){if(r=l&-l,r===i.callbackPriority)return r;switch(u!==null&&Nr(u),ea(l)){case 2:case 8:l=de;break;case 32:l=Oe;break;case 268435456:l=nt;break;default:l=Oe}return u=Sx.bind(null,i),l=Ji(l,u),i.callbackPriority=r,i.callbackNode=l,r}return u!==null&&u!==null&&Nr(u),i.callbackPriority=2,i.callbackNode=null,2}function Sx(i,r){if(Jt!==0&&Jt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var l=i.callbackNode;if(wu()&&i.callbackNode!==l)return null;var u=Xe;return u=B(i,i===yt?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(ix(i,u,r),Ex(i,Ot()),i.callbackNode!=null&&i.callbackNode===l?Sx.bind(null,i):null)}function wx(i,r){if(wu())return null;ix(i,r,!0)}function J_(){fk(function(){(rt&6)!==0?Ji(te,W_):vx()})}function Rh(){if(Wa===0){var i=Is;i===0&&(i=Tr,Tr<<=1,(Tr&261888)===0&&(Tr=256)),Wa=i}return Wa}function _x(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:La(""+i)}function kx(i,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,i.id&&l.setAttribute("form",i.id),r.parentNode.insertBefore(l,r),i=new FormData(i),l.parentNode.removeChild(l),i}function ek(i,r,l,u,p){if(r==="submit"&&l&&l.stateNode===p){var b=_x((p[fn]||null).action),E=u.submitter;E&&(r=(r=E[fn]||null)?_x(r.formAction):E.getAttribute("formAction"),r!==null&&(b=r,E=null));var N=new zc("action","action",null,u,p);i.push({event:N,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Wa!==0){var I=E?kx(p,E):new FormData(p);Zd(l,{pending:!0,data:I,method:p.method,action:b},null,I)}}else typeof b=="function"&&(N.preventDefault(),I=E?kx(p,E):new FormData(p),Zd(l,{pending:!0,data:I,method:p.method,action:b},b,I))},currentTarget:p}]})}}for(var Mh=0;Mh<md.length;Mh++){var jh=md[Mh],tk=jh.toLowerCase(),nk=jh[0].toUpperCase()+jh.slice(1);Ni(tk,"on"+nk)}Ni(nb,"onAnimationEnd"),Ni(ib,"onAnimationIteration"),Ni(ab,"onAnimationStart"),Ni("dblclick","onDoubleClick"),Ni("focusin","onFocus"),Ni("focusout","onBlur"),Ni(y_,"onTransitionRun"),Ni(x_,"onTransitionStart"),Ni(v_,"onTransitionCancel"),Ni(rb,"onTransitionEnd"),ue("onMouseEnter",["mouseout","mouseover"]),ue("onMouseLeave",["mouseout","mouseover"]),ue("onPointerEnter",["pointerout","pointerover"]),ue("onPointerLeave",["pointerout","pointerover"]),na("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),na("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),na("onBeforeInput",["compositionend","keypress","textInput","paste"]),na("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),na("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),na("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="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(" "),ik=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mo));function Nx(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var u=i[l],p=u.event;u=u.listeners;e:{var b=void 0;if(r)for(var E=u.length-1;0<=E;E--){var N=u[E],I=N.instance,Y=N.currentTarget;if(N=N.listener,I!==b&&p.isPropagationStopped())break e;b=N,p.currentTarget=Y;try{b(p)}catch(ne){Fc(ne)}p.currentTarget=null,b=I}else for(E=0;E<u.length;E++){if(N=u[E],I=N.instance,Y=N.currentTarget,N=N.listener,I!==b&&p.isPropagationStopped())break e;b=N,p.currentTarget=Y;try{b(p)}catch(ne){Fc(ne)}p.currentTarget=null,b=I}}}}function Qe(i,r){var l=r[Ql];l===void 0&&(l=r[Ql]=new Set);var u=i+"__bubble";l.has(u)||(Tx(r,i,2,!1),l.add(u))}function Dh(i,r,l){var u=0;r&&(u|=4),Tx(l,i,u,r)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function Lh(i){if(!i[Nu]){i[Nu]=!0,Ac.forEach(function(l){l!=="selectionchange"&&(ik.has(l)||Dh(l,!1,i),Dh(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[Nu]||(r[Nu]=!0,Dh("selectionchange",!1,r))}}function Tx(i,r,l,u){switch(nv(r)){case 2:var p=Rk;break;case 8:p=Mk;break;default:p=Xh}l=p.bind(null,r,l,i),p=void 0,!td||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),u?p!==void 0?i.addEventListener(r,l,{capture:!0,passive:p}):i.addEventListener(r,l,!0):p!==void 0?i.addEventListener(r,l,{passive:p}):i.addEventListener(r,l,!1)}function Ih(i,r,l,u,p){var b=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var N=u.stateNode.containerInfo;if(N===p)break;if(E===4)for(E=u.return;E!==null;){var I=E.tag;if((I===3||I===4)&&E.stateNode.containerInfo===p)return;E=E.return}for(;N!==null;){if(E=En(N),E===null)return;if(I=E.tag,I===5||I===6||I===26||I===27){u=b=E;continue e}N=N.parentNode}}u=u.return}jc(function(){var Y=b,ne=Be(l),se=[];e:{var X=sb.get(i);if(X!==void 0){var ee=zc,xe=i;switch(i){case"keypress":if(Lc(l)===0)break e;case"keydown":case"keyup":ee=Xw;break;case"focusin":xe="focus",ee=rd;break;case"focusout":xe="blur",ee=rd;break;case"beforeblur":case"afterblur":ee=rd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Lg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Bw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Jw;break;case nb:case ib:case ab:ee=$w;break;case rb:ee=t_;break;case"scroll":case"scrollend":ee=Iw;break;case"wheel":ee=i_;break;case"copy":case"cut":case"paste":ee=qw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=zg;break;case"toggle":case"beforetoggle":ee=r_}var Re=(r&4)!==0,pt=!Re&&(i==="scroll"||i==="scrollend"),H=Re?X!==null?X+"Capture":null:X;Re=[];for(var F=Y,Q;F!==null;){var re=F;if(Q=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Q===null||H===null||(re=Jl(F,H),re!=null&&Re.push(jo(F,re,Q))),pt)break;F=F.return}0<Re.length&&(X=new ee(X,xe,null,l,ne),se.push({event:X,listeners:Re}))}}if((r&7)===0){e:{if(X=i==="mouseover"||i==="pointerover",ee=i==="mouseout"||i==="pointerout",X&&l!==Se&&(xe=l.relatedTarget||l.fromElement)&&(En(xe)||xe[Ra]))break e;if((ee||X)&&(X=ne.window===ne?ne:(X=ne.ownerDocument)?X.defaultView||X.parentWindow:window,ee?(xe=l.relatedTarget||l.toElement,ee=Y,xe=xe?En(xe):null,xe!==null&&(pt=o(xe),Re=xe.tag,xe!==pt||Re!==5&&Re!==27&&Re!==6)&&(xe=null)):(ee=null,xe=Y),ee!==xe)){if(Re=Lg,re="onMouseLeave",H="onMouseEnter",F="mouse",(i==="pointerout"||i==="pointerover")&&(Re=zg,re="onPointerLeave",H="onPointerEnter",F="pointer"),pt=ee==null?X:Ma(ee),Q=xe==null?X:Ma(xe),X=new Re(re,F+"leave",ee,l,ne),X.target=pt,X.relatedTarget=Q,re=null,En(ne)===Y&&(Re=new Re(H,F+"enter",xe,l,ne),Re.target=Q,Re.relatedTarget=pt,re=Re),pt=re,ee&&xe)t:{for(Re=ak,H=ee,F=xe,Q=0,re=H;re;re=Re(re))Q++;re=0;for(var Ce=F;Ce;Ce=Re(Ce))re++;for(;0<Q-re;)H=Re(H),Q--;for(;0<re-Q;)F=Re(F),re--;for(;Q--;){if(H===F||F!==null&&H===F.alternate){Re=H;break t}H=Re(H),F=Re(F)}Re=null}else Re=null;ee!==null&&Cx(se,X,ee,Re,!1),xe!==null&&pt!==null&&Cx(se,pt,xe,Re,!0)}}e:{if(X=Y?Ma(Y):window,ee=X.nodeName&&X.nodeName.toLowerCase(),ee==="select"||ee==="input"&&X.type==="file")var it=Kg;else if(qg(X))if(Gg)it=p_;else{it=h_;var we=d_}else ee=X.nodeName,!ee||ee.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Y&&Da(Y.elementType)&&(it=Kg):it=m_;if(it&&(it=it(i,Y))){Hg(se,it,l,ne);break e}we&&we(i,X,Y),i==="focusout"&&Y&&X.type==="number"&&Y.memoizedProps.value!=null&&ks(X,"number",X.value)}switch(we=Y?Ma(Y):window,i){case"focusin":(qg(we)||we.contentEditable==="true")&&(Cs=we,fd=Y,lo=null);break;case"focusout":lo=fd=Cs=null;break;case"mousedown":dd=!0;break;case"contextmenu":case"mouseup":case"dragend":dd=!1,eb(se,l,ne);break;case"selectionchange":if(b_)break;case"keydown":case"keyup":eb(se,l,ne)}var Fe;if(ld)e:{switch(i){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Ts?$g(i,l)&&(Ze="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&(Bg&&l.locale!=="ko"&&(Ts||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Ts&&(Fe=jg()):(Ia=ne,nd="value"in Ia?Ia.value:Ia.textContent,Ts=!0)),we=Tu(Y,Ze),0<we.length&&(Ze=new Ig(Ze,i,null,l,ne),se.push({event:Ze,listeners:we}),Fe?Ze.data=Fe:(Fe=Pg(l),Fe!==null&&(Ze.data=Fe)))),(Fe=l_?o_(i,l):c_(i,l))&&(Ze=Tu(Y,"onBeforeInput"),0<Ze.length&&(we=new Ig("onBeforeInput","beforeinput",null,l,ne),se.push({event:we,listeners:Ze}),we.data=Fe)),ek(se,i,Y,l,ne)}Nx(se,r)})}function jo(i,r,l){return{instance:i,listener:r,currentTarget:l}}function Tu(i,r){for(var l=r+"Capture",u=[];i!==null;){var p=i,b=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||b===null||(p=Jl(i,l),p!=null&&u.unshift(jo(i,p,b)),p=Jl(i,r),p!=null&&u.push(jo(i,p,b))),i.tag===3)return u;i=i.return}return[]}function ak(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Cx(i,r,l,u,p){for(var b=r._reactName,E=[];l!==null&&l!==u;){var N=l,I=N.alternate,Y=N.stateNode;if(N=N.tag,I!==null&&I===u)break;N!==5&&N!==26&&N!==27||Y===null||(I=Y,p?(Y=Jl(l,b),Y!=null&&E.unshift(jo(l,Y,I))):p||(Y=Jl(l,b),Y!=null&&E.push(jo(l,Y,I)))),l=l.return}E.length!==0&&i.push({event:r,listeners:E})}var rk=/\r\n?/g,sk=/\u0000|\uFFFD/g;function Ax(i){return(typeof i=="string"?i:""+i).replace(rk,`
|
|
49
|
-
`).replace(sk,"")}function Ox(i,r){return r=Ax(r),Ax(i)===r}function mt(i,r,l,u,p,b){switch(l){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||je(i,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&je(i,""+u);break;case"className":Gn(i,"class",u);break;case"tabIndex":Gn(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Gn(i,l,u);break;case"style":ut(i,u,b);break;case"data":if(r!=="object"){Gn(i,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||l!=="href")){i.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=La(""+u),i.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(l==="formAction"?(r!=="input"&&mt(i,r,"name",p.name,p,null),mt(i,r,"formEncType",p.formEncType,p,null),mt(i,r,"formMethod",p.formMethod,p,null),mt(i,r,"formTarget",p.formTarget,p,null)):(mt(i,r,"encType",p.encType,p,null),mt(i,r,"method",p.method,p,null),mt(i,r,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=La(""+u),i.setAttribute(l,u);break;case"onClick":u!=null&&(i.onclick=he);break;case"onScroll":u!=null&&Qe("scroll",i);break;case"onScrollEnd":u!=null&&Qe("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));i.innerHTML=l}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}l=La(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""+u):i.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""):i.removeAttribute(l);break;case"capture":case"download":u===!0?i.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,u):i.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(l,u):i.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(l):i.setAttribute(l,u);break;case"popover":Qe("beforetoggle",i),Qe("toggle",i),dn(i,"popover",u);break;case"xlinkActuate":An(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":An(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":An(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":An(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":An(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":An(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":An(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":An(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":An(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":dn(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ia.get(l)||l,dn(i,l,u))}}function zh(i,r,l,u,p,b){switch(l){case"style":ut(i,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));i.innerHTML=l}}break;case"children":typeof u=="string"?je(i,u):(typeof u=="number"||typeof u=="bigint")&&je(i,""+u);break;case"onScroll":u!=null&&Qe("scroll",i);break;case"onScrollEnd":u!=null&&Qe("scrollend",i);break;case"onClick":u!=null&&(i.onclick=he);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Or.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),r=l.slice(2,p?l.length-7:void 0),b=i[fn]||null,b=b!=null?b[l]:null,typeof b=="function"&&i.removeEventListener(r,b,p),typeof u=="function")){typeof b!="function"&&b!==null&&(l in i?i[l]=null:i.hasAttribute(l)&&i.removeAttribute(l)),i.addEventListener(r,u,p);break e}l in i?i[l]=u:u===!0?i.setAttribute(l,""):dn(i,l,u)}}}function cn(i,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",i),Qe("load",i);var u=!1,p=!1,b;for(b in l)if(l.hasOwnProperty(b)){var E=l[b];if(E!=null)switch(b){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:mt(i,r,b,E,l,null)}}p&&mt(i,r,"srcSet",l.srcSet,l,null),u&&mt(i,r,"src",l.src,l,null);return;case"input":Qe("invalid",i);var N=b=E=p=null,I=null,Y=null;for(u in l)if(l.hasOwnProperty(u)){var ne=l[u];if(ne!=null)switch(u){case"name":p=ne;break;case"type":E=ne;break;case"checked":I=ne;break;case"defaultChecked":Y=ne;break;case"value":b=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,r));break;default:mt(i,r,u,ne,l,null)}}Rr(i,b,N,I,Y,E,p,!1);return;case"select":Qe("invalid",i),u=E=b=null;for(p in l)if(l.hasOwnProperty(p)&&(N=l[p],N!=null))switch(p){case"value":b=N;break;case"defaultValue":E=N;break;case"multiple":u=N;default:mt(i,r,p,N,l,null)}r=b,l=E,i.multiple=!!u,r!=null?rn(i,!!u,r,!1):l!=null&&rn(i,!!u,l,!0);return;case"textarea":Qe("invalid",i),b=p=u=null;for(E in l)if(l.hasOwnProperty(E)&&(N=l[E],N!=null))switch(E){case"value":u=N;break;case"defaultValue":p=N;break;case"children":b=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:mt(i,r,E,N,l,null)}Ns(i,u,p,b);return;case"option":for(I in l)if(l.hasOwnProperty(I)&&(u=l[I],u!=null))switch(I){case"selected":i.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:mt(i,r,I,u,l,null)}return;case"dialog":Qe("beforetoggle",i),Qe("toggle",i),Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":Qe("load",i);break;case"video":case"audio":for(u=0;u<Mo.length;u++)Qe(Mo[u],i);break;case"image":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"embed":case"source":case"link":Qe("error",i),Qe("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in l)if(l.hasOwnProperty(Y)&&(u=l[Y],u!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:mt(i,r,Y,u,l,null)}return;default:if(Da(r)){for(ne in l)l.hasOwnProperty(ne)&&(u=l[ne],u!==void 0&&zh(i,r,ne,u,l,void 0));return}}for(N in l)l.hasOwnProperty(N)&&(u=l[N],u!=null&&mt(i,r,N,u,l,null))}function lk(i,r,l,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,b=null,E=null,N=null,I=null,Y=null,ne=null;for(ee in l){var se=l[ee];if(l.hasOwnProperty(ee)&&se!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":I=se;default:u.hasOwnProperty(ee)||mt(i,r,ee,null,u,se)}}for(var X in u){var ee=u[X];if(se=l[X],u.hasOwnProperty(X)&&(ee!=null||se!=null))switch(X){case"type":b=ee;break;case"name":p=ee;break;case"checked":Y=ee;break;case"defaultChecked":ne=ee;break;case"value":E=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,r));break;default:ee!==se&&mt(i,r,X,ee,u,se)}}Xl(i,E,N,I,Y,ne,b,p);return;case"select":ee=E=N=X=null;for(b in l)if(I=l[b],l.hasOwnProperty(b)&&I!=null)switch(b){case"value":break;case"multiple":ee=I;default:u.hasOwnProperty(b)||mt(i,r,b,null,u,I)}for(p in u)if(b=u[p],I=l[p],u.hasOwnProperty(p)&&(b!=null||I!=null))switch(p){case"value":X=b;break;case"defaultValue":N=b;break;case"multiple":E=b;default:b!==I&&mt(i,r,p,b,u,I)}r=N,l=E,u=ee,X!=null?rn(i,!!l,X,!1):!!u!=!!l&&(r!=null?rn(i,!!l,r,!0):rn(i,!!l,l?[]:"",!1));return;case"textarea":ee=X=null;for(N in l)if(p=l[N],l.hasOwnProperty(N)&&p!=null&&!u.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:mt(i,r,N,null,u,p)}for(E in u)if(p=u[E],b=l[E],u.hasOwnProperty(E)&&(p!=null||b!=null))switch(E){case"value":X=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==b&&mt(i,r,E,p,u,b)}Rc(i,X,ee);return;case"option":for(var xe in l)if(X=l[xe],l.hasOwnProperty(xe)&&X!=null&&!u.hasOwnProperty(xe))switch(xe){case"selected":i.selected=!1;break;default:mt(i,r,xe,null,u,X)}for(I in u)if(X=u[I],ee=l[I],u.hasOwnProperty(I)&&X!==ee&&(X!=null||ee!=null))switch(I){case"selected":i.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:mt(i,r,I,X,u,ee)}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 Re in l)X=l[Re],l.hasOwnProperty(Re)&&X!=null&&!u.hasOwnProperty(Re)&&mt(i,r,Re,null,u,X);for(Y in u)if(X=u[Y],ee=l[Y],u.hasOwnProperty(Y)&&X!==ee&&(X!=null||ee!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,r));break;default:mt(i,r,Y,X,u,ee)}return;default:if(Da(r)){for(var pt in l)X=l[pt],l.hasOwnProperty(pt)&&X!==void 0&&!u.hasOwnProperty(pt)&&zh(i,r,pt,void 0,u,X);for(ne in u)X=u[ne],ee=l[ne],!u.hasOwnProperty(ne)||X===ee||X===void 0&&ee===void 0||zh(i,r,ne,X,u,ee);return}}for(var H in l)X=l[H],l.hasOwnProperty(H)&&X!=null&&!u.hasOwnProperty(H)&&mt(i,r,H,null,u,X);for(se in u)X=u[se],ee=l[se],!u.hasOwnProperty(se)||X===ee||X==null&&ee==null||mt(i,r,se,X,u,ee)}function Rx(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ok(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var p=l[u],b=p.transferSize,E=p.initiatorType,N=p.duration;if(b&&N&&Rx(E)){for(E=0,N=p.responseEnd,u+=1;u<l.length;u++){var I=l[u],Y=I.startTime;if(Y>N)break;var ne=I.transferSize,se=I.initiatorType;ne&&Rx(se)&&(I=I.responseEnd,E+=ne*(I<N?1:(N-Y)/(I-Y)))}if(--u,r+=8*(b+E)/(p.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Bh=null,Uh=null;function Cu(i){return i.nodeType===9?i:i.ownerDocument}function Mx(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jx(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function Fh(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var $h=null;function ck(){var i=window.event;return i&&i.type==="popstate"?i===$h?!1:($h=i,!0):($h=null,!1)}var Dx=typeof setTimeout=="function"?setTimeout:void 0,uk=typeof clearTimeout=="function"?clearTimeout:void 0,Lx=typeof Promise=="function"?Promise:void 0,fk=typeof queueMicrotask=="function"?queueMicrotask:typeof Lx<"u"?function(i){return Lx.resolve(null).then(i).catch(dk)}:Dx;function dk(i){setTimeout(function(){throw i})}function Ja(i){return i==="head"}function Ix(i,r){var l=r,u=0;do{var p=l.nextSibling;if(i.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(u===0){i.removeChild(p),tl(r);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Do(i.ownerDocument.documentElement);else if(l==="head"){l=i.ownerDocument.head,Do(l);for(var b=l.firstChild;b;){var E=b.nextSibling,N=b.nodeName;b[Ar]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&b.rel.toLowerCase()==="stylesheet"||l.removeChild(b),b=E}}else l==="body"&&Do(i.ownerDocument.body);l=p}while(l);tl(r)}function zx(i,r){var l=i;i=0;do{var u=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(i===0)break;i--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||i++;l=u}while(l)}function Ph(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ph(l),Yl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}i.removeChild(l)}}function hk(i,r,l,u){for(;i.nodeType===1;){var p=l;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[Ar])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(b=i.getAttribute("rel"),b==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(b!==p.rel||i.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||i.getAttribute("title")!==(p.title==null?null:p.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(b=i.getAttribute("src"),(b!==(p.src==null?null:p.src)||i.getAttribute("type")!==(p.type==null?null:p.type)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&b&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var b=p.name==null?null:""+p.name;if(p.type==="hidden"&&i.getAttribute("name")===b)return i}else return i;if(i=pi(i.nextSibling),i===null)break}return null}function mk(i,r,l){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=pi(i.nextSibling),i===null))return null;return i}function Bx(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=pi(i.nextSibling),i===null))return null;return i}function qh(i){return i.data==="$?"||i.data==="$~"}function Hh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function pk(i,r){var l=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||l.readyState!=="loading")r();else{var u=function(){r(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function pi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var Kh=null;function Ux(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"||l==="/&"){if(r===0)return pi(i.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}i=i.nextSibling}return null}function Fx(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return i;r--}else l!=="/$"&&l!=="/&"||r++}i=i.previousSibling}return null}function $x(i,r,l){switch(r=Cu(l),i){case"html":if(i=r.documentElement,!i)throw Error(a(452));return i;case"head":if(i=r.head,!i)throw Error(a(453));return i;case"body":if(i=r.body,!i)throw Error(a(454));return i;default:throw Error(a(451))}}function Do(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Yl(i)}var gi=new Map,Px=new Set;function Au(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var xa=oe.d;oe.d={f:gk,r:bk,D:yk,C:xk,L:vk,m:Ek,X:wk,S:Sk,M:_k};function gk(){var i=xa.f(),r=vu();return i||r}function bk(i){var r=ta(i);r!==null&&r.tag===5&&r.type==="form"?ry(r):xa.r(i)}var Ws=typeof document>"u"?null:document;function qx(i,r,l){var u=Ws;if(u&&typeof r=="string"&&r){var p=On(r);p='link[rel="'+i+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Px.has(p)||(Px.add(p),i={rel:i,crossOrigin:l,href:r},u.querySelector(p)===null&&(r=u.createElement("link"),cn(r,"link",i),Kt(r),u.head.appendChild(r)))}}function yk(i){xa.D(i),qx("dns-prefetch",i,null)}function xk(i,r){xa.C(i,r),qx("preconnect",i,r)}function vk(i,r,l){xa.L(i,r,l);var u=Ws;if(u&&i&&r){var p='link[rel="preload"][as="'+On(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+On(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+On(l.imageSizes)+'"]')):p+='[href="'+On(i)+'"]';var b=p;switch(r){case"style":b=Js(i);break;case"script":b=el(i)}gi.has(b)||(i=g({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:i,as:r},l),gi.set(b,i),u.querySelector(p)!==null||r==="style"&&u.querySelector(Lo(b))||r==="script"&&u.querySelector(Io(b))||(r=u.createElement("link"),cn(r,"link",i),Kt(r),u.head.appendChild(r)))}}function Ek(i,r){xa.m(i,r);var l=Ws;if(l&&i){var u=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+On(u)+'"][href="'+On(i)+'"]',b=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=el(i)}if(!gi.has(b)&&(i=g({rel:"modulepreload",href:i},r),gi.set(b,i),l.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Io(b)))return}u=l.createElement("link"),cn(u,"link",i),Kt(u),l.head.appendChild(u)}}}function Sk(i,r,l){xa.S(i,r,l);var u=Ws;if(u&&i){var p=ja(u).hoistableStyles,b=Js(i);r=r||"default";var E=p.get(b);if(!E){var N={loading:0,preload:null};if(E=u.querySelector(Lo(b)))N.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":r},l),(l=gi.get(b))&&Gh(i,l);var I=E=u.createElement("link");Kt(I),cn(I,"link",i),I._p=new Promise(function(Y,ne){I.onload=Y,I.onerror=ne}),I.addEventListener("load",function(){N.loading|=1}),I.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ou(E,r,u)}E={type:"stylesheet",instance:E,count:1,state:N},p.set(b,E)}}}function wk(i,r){xa.X(i,r);var l=Ws;if(l&&i){var u=ja(l).hoistableScripts,p=el(i),b=u.get(p);b||(b=l.querySelector(Io(p)),b||(i=g({src:i,async:!0},r),(r=gi.get(p))&&Qh(i,r),b=l.createElement("script"),Kt(b),cn(b,"link",i),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(p,b))}}function _k(i,r){xa.M(i,r);var l=Ws;if(l&&i){var u=ja(l).hoistableScripts,p=el(i),b=u.get(p);b||(b=l.querySelector(Io(p)),b||(i=g({src:i,async:!0,type:"module"},r),(r=gi.get(p))&&Qh(i,r),b=l.createElement("script"),Kt(b),cn(b,"link",i),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(p,b))}}function Hx(i,r,l,u){var p=(p=ve.current)?Au(p):null;if(!p)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=Js(l.href),l=ja(p).hoistableStyles,u=l.get(r),u||(u={type:"style",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){i=Js(l.href);var b=ja(p).hoistableStyles,E=b.get(i);if(E||(p=p.ownerDocument||p,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(i,E),(b=p.querySelector(Lo(i)))&&!b._p&&(E.instance=b,E.state.loading=5),gi.has(i)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},gi.set(i,l),b||kk(p,i,l,E.state))),r&&u===null)throw Error(a(528,""));return E}if(r&&u!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=el(l),l=ja(p).hoistableScripts,u=l.get(r),u||(u={type:"script",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,i))}}function Js(i){return'href="'+On(i)+'"'}function Lo(i){return'link[rel="stylesheet"]['+i+"]"}function Kx(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function kk(i,r,l,u){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=i.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),cn(r,"link",l),Kt(r),i.head.appendChild(r))}function el(i){return'[src="'+On(i)+'"]'}function Io(i){return"script[async]"+i}function Gx(i,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var u=i.querySelector('style[data-href~="'+On(l.href)+'"]');if(u)return r.instance=u,Kt(u),u;var p=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Kt(u),cn(u,"style",p),Ou(u,l.precedence,i),r.instance=u;case"stylesheet":p=Js(l.href);var b=i.querySelector(Lo(p));if(b)return r.state.loading|=4,r.instance=b,Kt(b),b;u=Kx(l),(p=gi.get(p))&&Gh(u,p),b=(i.ownerDocument||i).createElement("link"),Kt(b);var E=b;return E._p=new Promise(function(N,I){E.onload=N,E.onerror=I}),cn(b,"link",u),r.state.loading|=4,Ou(b,l.precedence,i),r.instance=b;case"script":return b=el(l.src),(p=i.querySelector(Io(b)))?(r.instance=p,Kt(p),p):(u=l,(p=gi.get(b))&&(u=g({},l),Qh(u,p)),i=i.ownerDocument||i,p=i.createElement("script"),Kt(p),cn(p,"link",u),i.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Ou(u,l.precedence,i));return r.instance}function Ou(i,r,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,b=p,E=0;E<u.length;E++){var N=u[E];if(N.dataset.precedence===r)b=N;else if(b!==p)break}b?b.parentNode.insertBefore(i,b.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(i,r.firstChild))}function Gh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Qh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Ru=null;function Qx(i,r,l){if(Ru===null){var u=new Map,p=Ru=new Map;p.set(l,u)}else p=Ru,u=p.get(l),u||(u=new Map,p.set(l,u));if(u.has(i))return u;for(u.set(i,null),l=l.getElementsByTagName(i),p=0;p<l.length;p++){var b=l[p];if(!(b[Ar]||b[Ft]||i==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var E=b.getAttribute(r)||"";E=i+E;var N=u.get(E);N?N.push(b):u.set(E,[b])}}return u}function Yx(i,r,l){i=i.ownerDocument||i,i.head.insertBefore(l,r==="title"?i.querySelector("head > title"):null)}function Nk(i,r,l){if(l===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Vx(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Tk(i,r,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=Js(u.href),b=r.querySelector(Lo(p));if(b){r=b._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=Mu.bind(i),r.then(i,i)),l.state.loading|=4,l.instance=b,Kt(b);return}b=r.ownerDocument||r,u=Kx(u),(p=gi.get(p))&&Gh(u,p),b=b.createElement("link"),Kt(b);var E=b;E._p=new Promise(function(N,I){E.onload=N,E.onerror=I}),cn(b,"link",u),l.instance=b}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(i.count++,l=Mu.bind(i),r.addEventListener("load",l),r.addEventListener("error",l))}}var Yh=0;function Ck(i,r){return i.stylesheets&&i.count===0&&Du(i,i.stylesheets),0<i.count||0<i.imgCount?function(l){var u=setTimeout(function(){if(i.stylesheets&&Du(i,i.stylesheets),i.unsuspend){var b=i.unsuspend;i.unsuspend=null,b()}},6e4+r);0<i.imgBytes&&Yh===0&&(Yh=62500*ok());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Du(i,i.stylesheets),i.unsuspend)){var b=i.unsuspend;i.unsuspend=null,b()}},(i.imgBytes>Yh?50:800)+r);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Mu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Du(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var ju=null;function Du(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,ju=new Map,r.forEach(Ak,i),ju=null,Mu.call(i))}function Ak(i,r){if(!(r.state.loading&4)){var l=ju.get(i);if(l)var u=l.get(null);else{l=new Map,ju.set(i,l);for(var p=i.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<p.length;b++){var E=p[b];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(l.set(E.dataset.precedence,E),u=E)}u&&l.set(null,u)}p=r.instance,E=p.getAttribute("data-precedence"),b=l.get(E)||u,b===u&&l.set(null,p),l.set(E,p),this.count++,u=Mu.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),b?b.parentNode.insertBefore(p,b.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(p,i.firstChild)),r.state.loading|=4}}var zo={$$typeof:T,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function Ok(i,r,l,u,p,b,E,N,I){this.tag=1,this.containerInfo=i,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=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=b,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Xx(i,r,l,u,p,b,E,N,I,Y,ne,se){return i=new Ok(i,r,l,E,I,Y,ne,se,N),r=1,b===!0&&(r|=24),b=Vn(3,null,null,r),i.current=b,b.stateNode=i,r=Td(),r.refCount++,i.pooledCache=r,r.refCount++,b.memoizedState={element:u,isDehydrated:l,cache:r},Rd(b),i}function Zx(i){return i?(i=Rs,i):Rs}function Wx(i,r,l,u,p,b){p=Zx(p),u.context===null?u.context=p:u.pendingContext=p,u=Pa(r),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=qa(i,u,r),l!==null&&(In(l,i,r),po(l,i,r))}function Jx(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function Vh(i,r){Jx(i,r),(i=i.alternate)&&Jx(i,r)}function ev(i){if(i.tag===13||i.tag===31){var r=Lr(i,67108864);r!==null&&In(r,i,67108864),Vh(i,67108864)}}function tv(i){if(i.tag===13||i.tag===31){var r=ei();r=Nt(r);var l=Lr(i,r);l!==null&&In(l,i,r),Vh(i,r)}}var Lu=!0;function Rk(i,r,l,u){var p=K.T;K.T=null;var b=oe.p;try{oe.p=2,Xh(i,r,l,u)}finally{oe.p=b,K.T=p}}function Mk(i,r,l,u){var p=K.T;K.T=null;var b=oe.p;try{oe.p=8,Xh(i,r,l,u)}finally{oe.p=b,K.T=p}}function Xh(i,r,l,u){if(Lu){var p=Zh(u);if(p===null)Ih(i,r,u,Iu,l),iv(i,u);else if(Dk(p,i,r,l,u))u.stopPropagation();else if(iv(i,u),r&4&&-1<jk.indexOf(i)){for(;p!==null;){var b=ta(p);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var E=Cn(b.pendingLanes);if(E!==0){var N=b;for(N.pendingLanes|=2,N.entangledLanes|=2;E;){var I=1<<31-ot(E);N.entanglements[1]|=I,E&=~I}Pi(b),(rt&6)===0&&(yu=Ot()+500,Ro(0))}}break;case 31:case 13:N=Lr(b,2),N!==null&&In(N,b,2),vu(),Vh(b,2)}if(b=Zh(u),b===null&&Ih(i,r,u,Iu,l),b===p)break;p=b}p!==null&&u.stopPropagation()}else Ih(i,r,u,null,l)}}function Zh(i){return i=Be(i),Wh(i)}var Iu=null;function Wh(i){if(Iu=null,i=En(i),i!==null){var r=o(i);if(r===null)i=null;else{var l=r.tag;if(l===13){if(i=c(r),i!==null)return i;i=null}else if(l===31){if(i=f(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Iu=i,null}function nv(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ys()){case te:return 2;case de:return 8;case Oe:case qe:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Jh=!1,er=null,tr=null,nr=null,Bo=new Map,Uo=new Map,ir=[],jk="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 iv(i,r){switch(i){case"focusin":case"focusout":er=null;break;case"dragenter":case"dragleave":tr=null;break;case"mouseover":case"mouseout":nr=null;break;case"pointerover":case"pointerout":Bo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(r.pointerId)}}function Fo(i,r,l,u,p,b){return i===null||i.nativeEvent!==b?(i={blockedOn:r,domEventName:l,eventSystemFlags:u,nativeEvent:b,targetContainers:[p]},r!==null&&(r=ta(r),r!==null&&ev(r)),i):(i.eventSystemFlags|=u,r=i.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),i)}function Dk(i,r,l,u,p){switch(r){case"focusin":return er=Fo(er,i,r,l,u,p),!0;case"dragenter":return tr=Fo(tr,i,r,l,u,p),!0;case"mouseover":return nr=Fo(nr,i,r,l,u,p),!0;case"pointerover":var b=p.pointerId;return Bo.set(b,Fo(Bo.get(b)||null,i,r,l,u,p)),!0;case"gotpointercapture":return b=p.pointerId,Uo.set(b,Fo(Uo.get(b)||null,i,r,l,u,p)),!0}return!1}function av(i){var r=En(i.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=c(l),r!==null){i.blockedOn=r,Es(i.priority,function(){tv(l)});return}}else if(r===31){if(r=f(l),r!==null){i.blockedOn=r,Es(i.priority,function(){tv(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function zu(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=Zh(i.nativeEvent);if(l===null){l=i.nativeEvent;var u=new l.constructor(l.type,l);Se=u,l.target.dispatchEvent(u),Se=null}else return r=ta(l),r!==null&&ev(r),i.blockedOn=l,!1;r.shift()}return!0}function rv(i,r,l){zu(i)&&l.delete(r)}function Lk(){Jh=!1,er!==null&&zu(er)&&(er=null),tr!==null&&zu(tr)&&(tr=null),nr!==null&&zu(nr)&&(nr=null),Bo.forEach(rv),Uo.forEach(rv)}function Bu(i,r){i.blockedOn===r&&(i.blockedOn=null,Jh||(Jh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Lk)))}var Uu=null;function sv(i){Uu!==i&&(Uu=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Uu===i&&(Uu=null);for(var r=0;r<i.length;r+=3){var l=i[r],u=i[r+1],p=i[r+2];if(typeof u!="function"){if(Wh(u||l)===null)continue;break}var b=ta(l);b!==null&&(i.splice(r,3),r-=3,Zd(b,{pending:!0,data:p,method:l.method,action:u},u,p))}}))}function tl(i){function r(I){return Bu(I,i)}er!==null&&Bu(er,i),tr!==null&&Bu(tr,i),nr!==null&&Bu(nr,i),Bo.forEach(r),Uo.forEach(r);for(var l=0;l<ir.length;l++){var u=ir[l];u.blockedOn===i&&(u.blockedOn=null)}for(;0<ir.length&&(l=ir[0],l.blockedOn===null);)av(l),l.blockedOn===null&&ir.shift();if(l=(i.ownerDocument||i).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var p=l[u],b=l[u+1],E=p[fn]||null;if(typeof b=="function")E||sv(l);else if(E){var N=null;if(b&&b.hasAttribute("formAction")){if(p=b,E=b[fn]||null)N=E.formAction;else if(Wh(p)!==null)continue}else N=E.action;typeof N=="function"?l[u+1]=N:(l.splice(u,3),u-=3),sv(l)}}}function lv(){function i(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(E){return p=E})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function em(i){this._internalRoot=i}Fu.prototype.render=em.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,u=ei();Wx(l,u,i,r,null,null)},Fu.prototype.unmount=em.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Wx(i.current,2,null,i,null,null),vu(),r[Ra]=null}};function Fu(i){this._internalRoot=i}Fu.prototype.unstable_scheduleHydration=function(i){if(i){var r=vs();i={blockedOn:null,target:i,priority:r};for(var l=0;l<ir.length&&r!==0&&r<ir[l].priority;l++);ir.splice(l,0,i),l===0&&av(i)}};var ov=t.version;if(ov!=="19.2.5")throw Error(a(527,ov,"19.2.5"));oe.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(a(188)):(i=Object.keys(i).join(","),Error(a(268,i)));return i=h(r),i=i!==null?y(i):null,i=i===null?null:i.stateNode,i};var Ik={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{an=$u.inject(Ik),Lt=$u}catch{}}return Po.createRoot=function(i,r){if(!s(i))throw Error(a(299));var l=!1,u="",p=py,b=gy,E=by;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError)),r=Xx(i,1,!1,null,null,l,u,null,p,b,E,lv),i[Ra]=r.current,Lh(i),new em(r)},Po.hydrateRoot=function(i,r,l){if(!s(i))throw Error(a(299));var u=!1,p="",b=py,E=gy,N=by,I=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=Xx(i,1,!0,r,l??null,u,p,I,b,E,N,lv),r.context=Zx(null),l=r.current,u=ei(),u=Nt(u),p=Pa(u),p.callback=null,qa(l,p,u),l=u,r.current.lanes=l,bt(r,l),Pi(r),i[Ra]=r.current,Lh(i),new Fu(r)},Po.version="19.2.5",Po}var vv;function Yk(){if(vv)return am.exports;vv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),am.exports=Qk(),am.exports}var Vk=Yk(),Ml=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},es,cr,gl,aE,Xk=(aE=class extends Ml{constructor(){super();Te(this,es);Te(this,cr);Te(this,gl);be(this,gl,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,cr)||this.setEventListener(z(this,gl))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,cr))==null||t.call(this),be(this,cr,void 0))}setEventListener(t){var n;be(this,gl,t),(n=z(this,cr))==null||n.call(this),be(this,cr,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){z(this,es)!==t&&(be(this,es,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof z(this,es)=="boolean"?z(this,es):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},es=new WeakMap,cr=new WeakMap,gl=new WeakMap,aE),Cp=new Xk,Zk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ur,kp,rE,Wk=(rE=class{constructor(){Te(this,ur,Zk);Te(this,kp,!1)}setTimeoutProvider(e){be(this,ur,e)}setTimeout(e,t){return z(this,ur).setTimeout(e,t)}clearTimeout(e){z(this,ur).clearTimeout(e)}setInterval(e,t){return z(this,ur).setInterval(e,t)}clearInterval(e){z(this,ur).clearInterval(e)}},ur=new WeakMap,kp=new WeakMap,rE),Xr=new Wk;function Jk(e){setTimeout(e,0)}var eN=typeof window>"u"||"Deno"in globalThis;function kn(){}function tN(e,t){return typeof e=="function"?e(t):e}function $m(e){return typeof e=="number"&&e>=0&&e!==1/0}function pE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yr(e,t){return typeof e=="function"?e(t):e}function yi(e,t){return typeof e=="function"?e(t):e}function Ev(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Ap(c,t.options))return!1}else if(!nc(t.queryKey,c))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||s&&s!==t.state.fetchStatus||o&&!o(t))}function Sv(e,t){const{exact:n,status:a,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(cs(t.options.mutationKey)!==cs(o))return!1}else if(!nc(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function Ap(e,t){return((t==null?void 0:t.queryKeyHashFn)||cs)(e)}function cs(e){return JSON.stringify(e,(t,n)=>Pm(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function nc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>nc(e[n],t[n])):!1}var nN=Object.prototype.hasOwnProperty;function gE(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=wv(e)&&wv(t);if(!a&&!(Pm(e)&&Pm(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,d=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:c[y],x=e[g],v=t[g];if(x===v){d[g]=x,(a?y<o:nN.call(e,g))&&h++;continue}if(x===null||v===null||typeof x!="object"||typeof v!="object"){d[g]=v;continue}const S=gE(x,v,n+1);d[g]=S,S===x&&h++}return o===f&&h===o?e:d}function pf(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function wv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pm(e){if(!_v(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_v(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _v(e){return Object.prototype.toString.call(e)==="[object Object]"}function iN(e){return new Promise(t=>{Xr.setTimeout(t,e)})}function qm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gE(e,t):t}function aN(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function rN(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Op=Symbol();function bE(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Op?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rp(e,t){return typeof e=="function"?e(...t):!!e}function sN(e,t,n){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),a||(a=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var ic=(()=>{let e=()=>eN;return{isServer(){return e()},setIsServer(t){e=t}}})();function Hm(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function a(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},n.reject=s=>{a({status:"rejected",reason:s}),t(s)},n}var lN=Jk;function oN(){let e=[],t=0,n=f=>{f()},a=f=>{f()},s=lN;const o=f=>{t?e.push(f):s(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&s(()=>{a(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||c()}return d},batchCalls:f=>(...d)=>{o(()=>{f(...d)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{s=f}}}var en=oN(),bl,fr,yl,sE,cN=(sE=class extends Ml{constructor(){super();Te(this,bl,!0);Te(this,fr);Te(this,yl);be(this,yl,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){z(this,fr)||this.setEventListener(z(this,yl))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,fr))==null||t.call(this),be(this,fr,void 0))}setEventListener(t){var n;be(this,yl,t),(n=z(this,fr))==null||n.call(this),be(this,fr,t(this.setOnline.bind(this)))}setOnline(t){z(this,bl)!==t&&(be(this,bl,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return z(this,bl)}},bl=new WeakMap,fr=new WeakMap,yl=new WeakMap,sE),gf=new cN;function uN(e){return Math.min(1e3*2**e,3e4)}function yE(e){return(e??"online")==="online"?gf.isOnline():!0}var Km=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function xE(e){let t=!1,n=0,a;const s=Hm(),o=()=>s.status!=="pending",c=w=>{var k;if(!o()){const _=new Km(w);x(_),(k=e.onCancel)==null||k.call(e,_)}},f=()=>{t=!0},d=()=>{t=!1},h=()=>Cp.isFocused()&&(e.networkMode==="always"||gf.isOnline())&&e.canRun(),y=()=>yE(e.networkMode)&&e.canRun(),g=w=>{o()||(a==null||a(),s.resolve(w))},x=w=>{o()||(a==null||a(),s.reject(w))},v=()=>new Promise(w=>{var k;a=_=>{(o()||h())&&w(_)},(k=e.onPause)==null||k.call(e)}).then(()=>{var w;a=void 0,o()||(w=e.onContinue)==null||w.call(e)}),S=()=>{if(o())return;let w;const k=n===0?e.initialPromise:void 0;try{w=k??e.fn()}catch(_){w=Promise.reject(_)}Promise.resolve(w).then(g).catch(_=>{var j;if(o())return;const A=e.retry??(ic.isServer()?0:3),T=e.retryDelay??uN,D=typeof T=="function"?T(n,_):T,$=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,_);if(t||!$){x(_);return}n++,(j=e.onFail)==null||j.call(e,n,_),iN(D).then(()=>h()?void 0:v()).then(()=>{t?x(_):S()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(a==null||a(),s),cancelRetry:f,continueRetry:d,canStart:y,start:()=>(y()?S():v().then(S),s)}}var ts,lE,vE=(lE=class{constructor(){Te(this,ts)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$m(this.gcTime)&&be(this,ts,Xr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ic.isServer()?1/0:300*1e3))}clearGcTimeout(){z(this,ts)!==void 0&&(Xr.clearTimeout(z(this,ts)),be(this,ts,void 0))}},ts=new WeakMap,lE),ns,xl,bi,is,nn,fc,as,ni,EE,va,oE,fN=(oE=class extends vE{constructor(t){super();Te(this,ni);Te(this,ns);Te(this,xl);Te(this,bi);Te(this,is);Te(this,nn);Te(this,fc);Te(this,as);be(this,as,!1),be(this,fc,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,is,t.client),be(this,bi,z(this,is).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,ns,Nv(this.options)),this.state=t.state??z(this,ns),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=z(this,nn))==null?void 0:t.promise}setOptions(t){if(this.options={...z(this,fc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Nv(this.options);n.data!==void 0&&(this.setState(kv(n.data,n.dataUpdatedAt)),be(this,ns,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,bi).remove(this)}setData(t,n){const a=qm(this.state.data,t,this.options);return $e(this,ni,va).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){$e(this,ni,va).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,s;const n=(a=z(this,nn))==null?void 0:a.promise;return(s=z(this,nn))==null||s.cancel(t),n?n.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return z(this,ns)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>yi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Op||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>yr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!pE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,nn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,nn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,bi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(z(this,nn)&&(z(this,as)||$e(this,ni,EE).call(this)?z(this,nn).cancel({revert:!0}):z(this,nn).cancelRetry()),this.scheduleGc()),z(this,bi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,ni,va).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,y,g,x,v,S,w,k,_,A,T;if(this.state.fetchStatus!=="idle"&&((d=z(this,nn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,nn))return z(this,nn).continueRetry(),z(this,nn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const D=this.observers.find($=>$.options.queryFn);D&&this.setOptions(D.options)}const a=new AbortController,s=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>(be(this,as,!0),a.signal)})},o=()=>{const D=bE(this.options,n),j=(()=>{const q={client:z(this,is),queryKey:this.queryKey,meta:this.meta};return s(q),q})();return be(this,as,!1),this.options.persister?this.options.persister(D,j,this):D(j)},f=(()=>{const D={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:z(this,is),state:this.state,fetchFn:o};return s(D),D})();(h=this.options.behavior)==null||h.onFetch(f,this),be(this,xl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&$e(this,ni,va).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),be(this,nn,xE({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:D=>{D instanceof Km&&D.revert&&this.setState({...z(this,xl),fetchStatus:"idle"}),a.abort()},onFail:(D,$)=>{$e(this,ni,va).call(this,{type:"failed",failureCount:D,error:$})},onPause:()=>{$e(this,ni,va).call(this,{type:"pause"})},onContinue:()=>{$e(this,ni,va).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const D=await z(this,nn).start();if(D===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(D),(v=(x=z(this,bi).config).onSuccess)==null||v.call(x,D,this),(w=(S=z(this,bi).config).onSettled)==null||w.call(S,D,this.state.error,this),D}catch(D){if(D instanceof Km){if(D.silent)return z(this,nn).promise;if(D.revert){if(this.state.data===void 0)throw D;return this.state.data}}throw $e(this,ni,va).call(this,{type:"error",error:D}),(_=(k=z(this,bi).config).onError)==null||_.call(k,D,this),(T=(A=z(this,bi).config).onSettled)==null||T.call(A,this.state.data,D,this),D}finally{this.scheduleGc()}}},ns=new WeakMap,xl=new WeakMap,bi=new WeakMap,is=new WeakMap,nn=new WeakMap,fc=new WeakMap,as=new WeakMap,ni=new WeakSet,EE=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},va=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...SE(a.data,this.options),fetchMeta:t.meta??null};case"success":const s={...a,...kv(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return be(this,xl,t.manual?s:void 0),s;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),en.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),z(this,bi).notify({query:this,type:"updated",action:t})})},oE);function SE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function kv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Nv(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Un,et,dc,wn,rs,vl,Ea,dr,hc,El,Sl,ss,ls,hr,wl,st,Xo,Gm,Qm,Ym,Vm,Xm,Zm,Wm,wE,cE,dN=(cE=class extends Ml{constructor(t,n){super();Te(this,st);Te(this,Un);Te(this,et);Te(this,dc);Te(this,wn);Te(this,rs);Te(this,vl);Te(this,Ea);Te(this,dr);Te(this,hc);Te(this,El);Te(this,Sl);Te(this,ss);Te(this,ls);Te(this,hr);Te(this,wl,new Set);this.options=n,be(this,Un,t),be(this,dr,null),be(this,Ea,Hm()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,et).addObserver(this),Tv(z(this,et),this.options)?$e(this,st,Xo).call(this):this.updateResult(),$e(this,st,Vm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jm(z(this,et),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jm(z(this,et),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$e(this,st,Xm).call(this),$e(this,st,Zm).call(this),z(this,et).removeObserver(this)}setOptions(t){const n=this.options,a=z(this,et);if(this.options=z(this,Un).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yi(this.options.enabled,z(this,et))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$e(this,st,Wm).call(this),z(this,et).setOptions(this.options),n._defaulted&&!pf(this.options,n)&&z(this,Un).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,et),observer:this});const s=this.hasListeners();s&&Cv(z(this,et),a,this.options,n)&&$e(this,st,Xo).call(this),this.updateResult(),s&&(z(this,et)!==a||yi(this.options.enabled,z(this,et))!==yi(n.enabled,z(this,et))||yr(this.options.staleTime,z(this,et))!==yr(n.staleTime,z(this,et)))&&$e(this,st,Gm).call(this);const o=$e(this,st,Qm).call(this);s&&(z(this,et)!==a||yi(this.options.enabled,z(this,et))!==yi(n.enabled,z(this,et))||o!==z(this,hr))&&$e(this,st,Ym).call(this,o)}getOptimisticResult(t){const n=z(this,Un).getQueryCache().build(z(this,Un),t),a=this.createResult(n,t);return mN(this,a)&&(be(this,wn,a),be(this,vl,this.options),be(this,rs,z(this,et).state)),a}getCurrentResult(){return z(this,wn)}trackResult(t,n){return new Proxy(t,{get:(a,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&z(this,Ea).status==="pending"&&z(this,Ea).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,s))})}trackProp(t){z(this,wl).add(t)}getCurrentQuery(){return z(this,et)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=z(this,Un).defaultQueryOptions(t),a=z(this,Un).getQueryCache().build(z(this,Un),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return $e(this,st,Xo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,wn)))}createResult(t,n){var Z;const a=z(this,et),s=this.options,o=z(this,wn),c=z(this,rs),f=z(this,vl),h=t!==a?t.state:z(this,dc),{state:y}=t;let g={...y},x=!1,v;if(n._optimisticResults){const O=this.hasListeners(),P=!O&&Tv(t,n),G=O&&Cv(t,a,n,s);(P||G)&&(g={...g,...SE(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:k}=g;v=g.data;let _=!1;if(n.placeholderData!==void 0&&v===void 0&&k==="pending"){let O;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(O=o.data,_=!0):O=typeof n.placeholderData=="function"?n.placeholderData((Z=z(this,Sl))==null?void 0:Z.state.data,z(this,Sl)):n.placeholderData,O!==void 0&&(k="success",v=qm(o==null?void 0:o.data,O,n),x=!0)}if(n.select&&v!==void 0&&!_)if(o&&v===(c==null?void 0:c.data)&&n.select===z(this,hc))v=z(this,El);else try{be(this,hc,n.select),v=n.select(v),v=qm(o==null?void 0:o.data,v,n),be(this,El,v),be(this,dr,null)}catch(O){be(this,dr,O)}z(this,dr)&&(S=z(this,dr),v=z(this,El),w=Date.now(),k="error");const A=g.fetchStatus==="fetching",T=k==="pending",D=k==="error",$=T&&A,j=v!==void 0,U={status:k,fetchStatus:g.fetchStatus,isPending:T,isSuccess:k==="success",isError:D,isInitialLoading:$,isLoading:$,data:v,dataUpdatedAt:g.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!T,isLoadingError:D&&!j,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:D&&j,isStale:Mp(t,n),refetch:this.refetch,promise:z(this,Ea),isEnabled:yi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=U.data!==void 0,P=U.status==="error"&&!O,G=W=>{P?W.reject(U.error):O&&W.resolve(U.data)},le=()=>{const W=be(this,Ea,U.promise=Hm());G(W)},ae=z(this,Ea);switch(ae.status){case"pending":t.queryHash===a.queryHash&&G(ae);break;case"fulfilled":(P||U.data!==ae.value)&&le();break;case"rejected":(!P||U.error!==ae.reason)&&le();break}}return U}updateResult(){const t=z(this,wn),n=this.createResult(z(this,et),this.options);if(be(this,rs,z(this,et).state),be(this,vl,this.options),z(this,rs).data!==void 0&&be(this,Sl,z(this,et)),pf(n,t))return;be(this,wn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!z(this,wl).size)return!0;const c=new Set(o??z(this,wl));return this.options.throwOnError&&c.add("error"),Object.keys(z(this,wn)).some(f=>{const d=f;return z(this,wn)[d]!==t[d]&&c.has(d)})};$e(this,st,wE).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$e(this,st,Vm).call(this)}},Un=new WeakMap,et=new WeakMap,dc=new WeakMap,wn=new WeakMap,rs=new WeakMap,vl=new WeakMap,Ea=new WeakMap,dr=new WeakMap,hc=new WeakMap,El=new WeakMap,Sl=new WeakMap,ss=new WeakMap,ls=new WeakMap,hr=new WeakMap,wl=new WeakMap,st=new WeakSet,Xo=function(t){$e(this,st,Wm).call(this);let n=z(this,et).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kn)),n},Gm=function(){$e(this,st,Xm).call(this);const t=yr(this.options.staleTime,z(this,et));if(ic.isServer()||z(this,wn).isStale||!$m(t))return;const a=pE(z(this,wn).dataUpdatedAt,t)+1;be(this,ss,Xr.setTimeout(()=>{z(this,wn).isStale||this.updateResult()},a))},Qm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,et)):this.options.refetchInterval)??!1},Ym=function(t){$e(this,st,Zm).call(this),be(this,hr,t),!(ic.isServer()||yi(this.options.enabled,z(this,et))===!1||!$m(z(this,hr))||z(this,hr)===0)&&be(this,ls,Xr.setInterval(()=>{(this.options.refetchIntervalInBackground||Cp.isFocused())&&$e(this,st,Xo).call(this)},z(this,hr)))},Vm=function(){$e(this,st,Gm).call(this),$e(this,st,Ym).call(this,$e(this,st,Qm).call(this))},Xm=function(){z(this,ss)!==void 0&&(Xr.clearTimeout(z(this,ss)),be(this,ss,void 0))},Zm=function(){z(this,ls)!==void 0&&(Xr.clearInterval(z(this,ls)),be(this,ls,void 0))},Wm=function(){const t=z(this,Un).getQueryCache().build(z(this,Un),this.options);if(t===z(this,et))return;const n=z(this,et);be(this,et,t),be(this,dc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},wE=function(t){en.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(z(this,wn))}),z(this,Un).getQueryCache().notify({query:z(this,et),type:"observerResultsUpdated"})})},cE);function hN(e,t){return yi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Tv(e,t){return hN(e,t)||e.state.data!==void 0&&Jm(e,t,t.refetchOnMount)}function Jm(e,t,n){if(yi(t.enabled,e)!==!1&&yr(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Mp(e,t)}return!1}function Cv(e,t,n,a){return(e!==t||yi(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Mp(e,n)}function Mp(e,t){return yi(t.enabled,e)!==!1&&e.isStaleByTime(yr(t.staleTime,e))}function mN(e,t){return!pf(e.getCurrentResult(),t)}function Av(e){return{onFetch:(t,n)=>{var y,g,x,v,S;const a=t.options,s=(x=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:x.direction,o=((v=t.state.data)==null?void 0:v.pages)||[],c=((S=t.state.data)==null?void 0:S.pageParams)||[];let f={pages:[],pageParams:[]},d=0;const h=async()=>{let w=!1;const k=T=>{sN(T,()=>t.signal,()=>w=!0)},_=bE(t.options,t.fetchOptions),A=async(T,D,$)=>{if(w)return Promise.reject();if(D==null&&T.pages.length)return Promise.resolve(T);const q=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:D,direction:$?"backward":"forward",meta:t.options.meta};return k(P),P})(),U=await _(q),{maxPages:Z}=t.options,O=$?rN:aN;return{pages:O(T.pages,U,Z),pageParams:O(T.pageParams,D,Z)}};if(s&&o.length){const T=s==="backward",D=T?pN:Ov,$={pages:o,pageParams:c},j=D(a,$);f=await A($,j,T)}else{const T=e??o.length;do{const D=d===0?c[0]??a.initialPageParam:Ov(a,f);if(d>0&&D==null)break;f=await A(f,D),d++}while(d<T)}return f};t.options.persister?t.fetchFn=()=>{var w,k;return(k=(w=t.options).persister)==null?void 0:k.call(w,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function Ov(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function pN(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var mc,Ki,mn,os,Gi,lr,uE,gN=(uE=class extends vE{constructor(t){super();Te(this,Gi);Te(this,mc);Te(this,Ki);Te(this,mn);Te(this,os);be(this,mc,t.client),this.mutationId=t.mutationId,be(this,mn,t.mutationCache),be(this,Ki,[]),this.state=t.state||_E(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,Ki).includes(t)||(z(this,Ki).push(t),this.clearGcTimeout(),z(this,mn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,Ki,z(this,Ki).filter(n=>n!==t)),this.scheduleGc(),z(this,mn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():z(this,mn).remove(this))}continue(){var t;return((t=z(this,os))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,d,h,y,g,x,v,S,w,k,_,A,T,D,$,j,q;const n=()=>{$e(this,Gi,lr).call(this,{type:"continue"})},a={client:z(this,mc),meta:this.options.meta,mutationKey:this.options.mutationKey};be(this,os,xE({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,Z)=>{$e(this,Gi,lr).call(this,{type:"failed",failureCount:U,error:Z})},onPause:()=>{$e(this,Gi,lr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,mn).canRun(this)}));const s=this.state.status==="pending",o=!z(this,os).canStart();try{if(s)n();else{$e(this,Gi,lr).call(this,{type:"pending",variables:t,isPaused:o}),z(this,mn).config.onMutate&&await z(this,mn).config.onMutate(t,this,a);const Z=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));Z!==this.state.context&&$e(this,Gi,lr).call(this,{type:"pending",context:Z,variables:t,isPaused:o})}const U=await z(this,os).start();return await((h=(d=z(this,mn).config).onSuccess)==null?void 0:h.call(d,U,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,U,t,this.state.context,a)),await((v=(x=z(this,mn).config).onSettled)==null?void 0:v.call(x,U,null,this.state.variables,this.state.context,this,a)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,U,null,t,this.state.context,a)),$e(this,Gi,lr).call(this,{type:"success",data:U}),U}catch(U){try{await((_=(k=z(this,mn).config).onError)==null?void 0:_.call(k,U,t,this.state.context,this,a))}catch(Z){Promise.reject(Z)}try{await((T=(A=this.options).onError)==null?void 0:T.call(A,U,t,this.state.context,a))}catch(Z){Promise.reject(Z)}try{await(($=(D=z(this,mn).config).onSettled)==null?void 0:$.call(D,void 0,U,this.state.variables,this.state.context,this,a))}catch(Z){Promise.reject(Z)}try{await((q=(j=this.options).onSettled)==null?void 0:q.call(j,void 0,U,t,this.state.context,a))}catch(Z){Promise.reject(Z)}throw $e(this,Gi,lr).call(this,{type:"error",error:U}),U}finally{z(this,mn).runNext(this)}}},mc=new WeakMap,Ki=new WeakMap,mn=new WeakMap,os=new WeakMap,Gi=new WeakSet,lr=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),en.batch(()=>{z(this,Ki).forEach(a=>{a.onMutationUpdate(t)}),z(this,mn).notify({mutation:this,type:"updated",action:t})})},uE);function _E(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sa,Oi,pc,fE,bN=(fE=class extends Ml{constructor(t={}){super();Te(this,Sa);Te(this,Oi);Te(this,pc);this.config=t,be(this,Sa,new Set),be(this,Oi,new Map),be(this,pc,0)}build(t,n,a){const s=new gN({client:t,mutationCache:this,mutationId:++Pu(this,pc)._,options:t.defaultMutationOptions(n),state:a});return this.add(s),s}add(t){z(this,Sa).add(t);const n=qu(t);if(typeof n=="string"){const a=z(this,Oi).get(n);a?a.push(t):z(this,Oi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,Sa).delete(t)){const n=qu(t);if(typeof n=="string"){const a=z(this,Oi).get(n);if(a)if(a.length>1){const s=a.indexOf(t);s!==-1&&a.splice(s,1)}else a[0]===t&&z(this,Oi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=qu(t);if(typeof n=="string"){const a=z(this,Oi).get(n),s=a==null?void 0:a.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var a;const n=qu(t);if(typeof n=="string"){const s=(a=z(this,Oi).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){en.batch(()=>{z(this,Sa).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,Sa).clear(),z(this,Oi).clear()})}getAll(){return Array.from(z(this,Sa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>Sv(n,a))}findAll(t={}){return this.getAll().filter(n=>Sv(t,n))}notify(t){en.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return en.batch(()=>Promise.all(t.map(n=>n.continue().catch(kn))))}},Sa=new WeakMap,Oi=new WeakMap,pc=new WeakMap,fE);function qu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var wa,mr,Fn,_a,Ta,lf,ep,dE,yN=(dE=class extends Ml{constructor(n,a){super();Te(this,Ta);Te(this,wa);Te(this,mr);Te(this,Fn);Te(this,_a);be(this,wa,n),this.setOptions(a),this.bindMethods(),$e(this,Ta,lf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const a=this.options;this.options=z(this,wa).defaultMutationOptions(n),pf(this.options,a)||z(this,wa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:z(this,Fn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&cs(a.mutationKey)!==cs(this.options.mutationKey)?this.reset():((s=z(this,Fn))==null?void 0:s.state.status)==="pending"&&z(this,Fn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=z(this,Fn))==null||n.removeObserver(this)}onMutationUpdate(n){$e(this,Ta,lf).call(this),$e(this,Ta,ep).call(this,n)}getCurrentResult(){return z(this,mr)}reset(){var n;(n=z(this,Fn))==null||n.removeObserver(this),be(this,Fn,void 0),$e(this,Ta,lf).call(this),$e(this,Ta,ep).call(this)}mutate(n,a){var s;return be(this,_a,a),(s=z(this,Fn))==null||s.removeObserver(this),be(this,Fn,z(this,wa).getMutationCache().build(z(this,wa),this.options)),z(this,Fn).addObserver(this),z(this,Fn).execute(n)}},wa=new WeakMap,mr=new WeakMap,Fn=new WeakMap,_a=new WeakMap,Ta=new WeakSet,lf=function(){var a;const n=((a=z(this,Fn))==null?void 0:a.state)??_E();be(this,mr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ep=function(n){en.batch(()=>{var a,s,o,c,f,d,h,y;if(z(this,_a)&&this.hasListeners()){const g=z(this,mr).variables,x=z(this,mr).context,v={client:z(this,wa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(a=z(this,_a)).onSuccess)==null||s.call(a,n.data,g,x,v)}catch(S){Promise.reject(S)}try{(c=(o=z(this,_a)).onSettled)==null||c.call(o,n.data,null,g,x,v)}catch(S){Promise.reject(S)}}else if((n==null?void 0:n.type)==="error"){try{(d=(f=z(this,_a)).onError)==null||d.call(f,n.error,g,x,v)}catch(S){Promise.reject(S)}try{(y=(h=z(this,_a)).onSettled)==null||y.call(h,void 0,n.error,g,x,v)}catch(S){Promise.reject(S)}}}this.listeners.forEach(g=>{g(z(this,mr))})})},dE),Qi,hE,xN=(hE=class extends Ml{constructor(t={}){super();Te(this,Qi);this.config=t,be(this,Qi,new Map)}build(t,n,a){const s=n.queryKey,o=n.queryHash??Ap(s,n);let c=this.get(o);return c||(c=new fN({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){z(this,Qi).has(t.queryHash)||(z(this,Qi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=z(this,Qi).get(t.queryHash);n&&(t.destroy(),n===t&&z(this,Qi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){en.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,Qi).get(t)}getAll(){return[...z(this,Qi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>Ev(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>Ev(t,a)):n}notify(t){en.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){en.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){en.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qi=new WeakMap,hE),Bt,pr,gr,_l,kl,br,Nl,Tl,mE,vN=(mE=class{constructor(e={}){Te(this,Bt);Te(this,pr);Te(this,gr);Te(this,_l);Te(this,kl);Te(this,br);Te(this,Nl);Te(this,Tl);be(this,Bt,e.queryCache||new xN),be(this,pr,e.mutationCache||new bN),be(this,gr,e.defaultOptions||{}),be(this,_l,new Map),be(this,kl,new Map),be(this,br,0)}mount(){Pu(this,br)._++,z(this,br)===1&&(be(this,Nl,Cp.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Bt).onFocus())})),be(this,Tl,gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Bt).onOnline())})))}unmount(){var e,t;Pu(this,br)._--,z(this,br)===0&&((e=z(this,Nl))==null||e.call(this),be(this,Nl,void 0),(t=z(this,Tl))==null||t.call(this),be(this,Tl,void 0))}isFetching(e){return z(this,Bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,pr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,Bt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=z(this,Bt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(yr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return z(this,Bt).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),s=z(this,Bt).get(a.queryHash),o=s==null?void 0:s.state.data,c=tN(t,o);if(c!==void 0)return z(this,Bt).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return en.batch(()=>z(this,Bt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,Bt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=z(this,Bt);en.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=z(this,Bt);return en.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=en.batch(()=>z(this,Bt).findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(kn).catch(kn)}invalidateQueries(e,t={}){return en.batch(()=>(z(this,Bt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=en.batch(()=>z(this,Bt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(kn)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=z(this,Bt).build(this,t);return n.isStaleByTime(yr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}fetchInfiniteQuery(e){return e.behavior=Av(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e.behavior=Av(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return gf.isOnline()?z(this,pr).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,Bt)}getMutationCache(){return z(this,pr)}getDefaultOptions(){return z(this,gr)}setDefaultOptions(e){be(this,gr,e)}setQueryDefaults(e,t){z(this,_l).set(cs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,_l).values()],n={};return t.forEach(a=>{nc(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){z(this,kl).set(cs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,kl).values()],n={};return t.forEach(a=>{nc(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,gr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ap(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Op&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,gr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,Bt).clear(),z(this,pr).clear()}},Bt=new WeakMap,pr=new WeakMap,gr=new WeakMap,_l=new WeakMap,kl=new WeakMap,br=new WeakMap,Nl=new WeakMap,Tl=new WeakMap,mE),kE=M.createContext(void 0),qn=e=>{const t=M.useContext(kE);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},EN=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(kE.Provider,{value:e,children:t})),NE=M.createContext(!1),SN=()=>M.useContext(NE);NE.Provider;function wN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var _N=M.createContext(wN()),kN=()=>M.useContext(_N),NN=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Rp(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},TN=e=>{M.useEffect(()=>{e.clearReset()},[e])},CN=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||Rp(n,[e.error,a])),AN=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>n(a(...s)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ON=(e,t)=>e.isLoading&&e.isFetching&&!t,RN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Rv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function MN(e,t,n){var x,v,S,w;const a=SN(),s=kN(),o=qn(),c=o.defaultQueryOptions(e);(v=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||v.call(x,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",AN(c),NN(c,s,f),TN(s);const d=!o.getQueryCache().get(c.queryHash),[h]=M.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(k=>{const _=g?h.subscribe(en.batchCalls(k)):kn;return h.updateResult(),_},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),M.useEffect(()=>{h.setOptions(c)},[c,h]),RN(c,y))throw Rv(c,h,s);if(CN({result:y,errorResetBoundary:s,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((w=(S=o.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||w.call(S,c,y),c.experimental_prefetchInRender&&!ic.isServer()&&ON(y,a)){const k=d?Rv(c,h,s):f==null?void 0:f.promise;k==null||k.catch(kn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function lt(e,t){return MN(e,dN)}function Pn(e,t){const n=qn(),[a]=M.useState(()=>new yN(n,e));M.useEffect(()=>{a.setOptions(e)},[a,e]);const s=M.useSyncExternalStore(M.useCallback(c=>a.subscribe(en.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=M.useCallback((c,f)=>{a.mutate(c,f).catch(kn)},[a]);if(s.error&&Rp(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}/**
|
|
48
|
+
`+u.stack}}var Ii=Object.prototype.hasOwnProperty,Ji=e.unstable_scheduleCallback,Tr=e.unstable_cancelCallback,Gl=e.unstable_shouldYield,bs=e.unstable_requestPaint,Ot=e.unstable_now,ys=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,qe=e.unstable_LowPriority,nt=e.unstable_IdlePriority,xn=e.log,ki=e.unstable_setDisableYieldValue,an=null,Lt=null;function un(i){if(typeof xn=="function"&&ki(i),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(an,i)}catch{}}var ot=Math.clz32?Math.clz32:Nc,zi=Math.log,vn=Math.LN2;function Nc(i){return i>>>=0,i===0?32:31-(zi(i)/vn|0)|0}var Cr=256,xs=262144,Ar=4194304;function Cn(i){var r=i&42;if(r!==0)return r;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function B(i,r,l){var u=i.pendingLanes;if(u===0)return 0;var p=0,b=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var N=u&134217727;return N!==0?(u=N&~b,u!==0?p=Cn(u):(E&=N,E!==0?p=Cn(E):l||(l=N&~i,l!==0&&(p=Cn(l))))):(N=u&~b,N!==0?p=Cn(N):E!==0?p=Cn(E):l||(l=u&~i,l!==0&&(p=Cn(l)))),p===0?0:r!==0&&r!==p&&(r&b)===0&&(b=p&-p,l=r&-r,b>=l||b===32&&(l&4194048)!==0)?r:p}function ie(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function ge(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Le(){var i=Ar;return Ar<<=1,(Ar&62914560)===0&&(Ar=4194304),i}function wt(i){for(var r=[],l=0;31>l;l++)r.push(i);return r}function bt(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ee(i,r,l,u,p,b){var E=i.pendingLanes;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=l,i.entangledLanes&=l,i.errorRecoveryDisabledLanes&=l,i.shellSuspendCounter=0;var N=i.entanglements,I=i.expirationTimes,Y=i.hiddenUpdates;for(l=E&~l;0<l;){var ne=31-ot(l),se=1<<ne;N[ne]=0,I[ne]=-1;var X=Y[ne];if(X!==null)for(Y[ne]=null,ne=0;ne<X.length;ne++){var ee=X[ne];ee!==null&&(ee.lane&=-536870913)}l&=~se}u!==0&&ye(i,u,0),b!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=b&~(E&~r))}function ye(i,r,l){i.pendingLanes|=r,i.suspendedLanes&=~r;var u=31-ot(r);i.entangledLanes|=r,i.entanglements[u]=i.entanglements[u]|1073741824|l&261930}function De(i,r){var l=i.entangledLanes|=r;for(i=i.entanglements;l;){var u=31-ot(l),p=1<<u;p&r|i[u]&r&&(i[u]|=r),l&=~p}}function Ut(i,r){var l=r&-r;return l=(l&42)!==0?1:Nt(l),(l&(i.suspendedLanes|r))!==0?0:l}function Nt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ea(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function vs(){var i=oe.p;return i!==0?i:(i=window.event,i===void 0?32:nv(i.type))}function Es(i,r){var l=oe.p;try{return oe.p=i,r()}finally{oe.p=l}}var Bi=Math.random().toString(36).slice(2),Ft="__reactFiber$"+Bi,fn="__reactProps$"+Bi,Ra="__reactContainer$"+Bi,Ql="__reactEvents$"+Bi,Tc="__reactListeners$"+Bi,Ss="__reactHandles$"+Bi,Cc="__reactResources$"+Bi,Or="__reactMarker$"+Bi;function Yl(i){delete i[Ft],delete i[fn],delete i[Ql],delete i[Tc],delete i[Ss]}function En(i){var r=i[Ft];if(r)return r;for(var l=i.parentNode;l;){if(r=l[Ra]||l[Ft]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(i=Fx(i);i!==null;){if(l=i[Ft])return l;i=Fx(i)}return r}i=l,l=i.parentNode}return null}function ta(i){if(i=i[Ft]||i[Ra]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function Ma(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(a(33))}function ja(i){var r=i[Cc];return r||(r=i[Cc]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Kt(i){i[Or]=!0}var Ac=new Set,Rr={};function na(i,r){ue(i,r),ue(i+"Capture",r)}function ue(i,r){for(Rr[i]=r,i=0;i<r.length;i++)Ac.add(r[i])}var Ne=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]*$"),He={},ct={};function $t(i){return Ii.call(ct,i)?!0:Ii.call(He,i)?!1:Ne.test(i)?ct[i]=!0:(He[i]=!0,!1)}function dn(i,r,l){if($t(r))if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+l)}}function Gn(i,r,l){if(l===null)i.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+l)}}function An(i,r,l,u){if(u===null)i.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttributeNS(r,l,""+u)}}function Et(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Qn(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Oc(i,r,l){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,b=u.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return p.call(this)},set:function(E){l=""+E,b.call(this,E)}}),Object.defineProperty(i,r,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function ws(i){if(!i._valueTracker){var r=Qn(i)?"checked":"value";i._valueTracker=Oc(i,r,""+i[r])}}function Vl(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var l=r.getValue(),u="";return i&&(u=Qn(i)?i.checked?"true":"false":i.value),i=u,i!==l?(r.setValue(i),!0):!1}function _s(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var ed=/[\n"\\]/g;function On(i){return i.replace(ed,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Xl(i,r,l,u,p,b,E,N){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),r!=null?E==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Et(r)):i.value!==""+Et(r)&&(i.value=""+Et(r)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),r!=null?ks(i,E,Et(r)):l!=null?ks(i,E,Et(l)):u!=null&&i.removeAttribute("value"),p==null&&b!=null&&(i.defaultChecked=!!b),p!=null&&(i.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Et(N):i.removeAttribute("name")}function Mr(i,r,l,u,p,b,E,N){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.type=b),r!=null||l!=null){if(!(b!=="submit"&&b!=="reset"||r!=null)){ws(i);return}l=l!=null?""+Et(l):"",r=r!=null?""+Et(r):l,N||r===i.value||(i.value=r),i.defaultValue=r}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=N?i.checked:!!u,i.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),ws(i)}function ks(i,r,l){r==="number"&&_s(i.ownerDocument)===i||i.defaultValue===""+l||(i.defaultValue=""+l)}function rn(i,r,l,u){if(i=i.options,r){r={};for(var p=0;p<l.length;p++)r["$"+l[p]]=!0;for(l=0;l<i.length;l++)p=r.hasOwnProperty("$"+i[l].value),i[l].selected!==p&&(i[l].selected=p),p&&u&&(i[l].defaultSelected=!0)}else{for(l=""+Et(l),r=null,p=0;p<i.length;p++){if(i[p].value===l){i[p].selected=!0,u&&(i[p].defaultSelected=!0);return}r!==null||i[p].disabled||(r=i[p])}r!==null&&(r.selected=!0)}}function Rc(i,r,l){if(r!=null&&(r=""+Et(r),r!==i.value&&(i.value=r),l==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=l!=null?""+Et(l):""}function Ns(i,r,l,u){if(r==null){if(u!=null){if(l!=null)throw Error(a(92));if(W(u)){if(1<u.length)throw Error(a(93));u=u[0]}l=u}l==null&&(l=""),r=l}l=Et(r),i.defaultValue=l,u=i.textContent,u===l&&u!==""&&u!==null&&(i.value=u),ws(i)}function je(i,r){if(r){var l=i.firstChild;if(l&&l===i.lastChild&&l.nodeType===3){l.nodeValue=r;return}}i.textContent=r}var Mc=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 Gt(i,r,l){var u=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":u?i.setProperty(r,l):typeof l!="number"||l===0||Mc.has(r)?r==="float"?i.cssFloat=l:i[r]=(""+l).trim():i[r]=l+"px"}function ut(i,r,l){if(r!=null&&typeof r!="object")throw Error(a(62));if(i=i.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var p in r)u=r[p],r.hasOwnProperty(p)&&l[p]!==u&&Gt(i,p,u)}else for(var b in r)r.hasOwnProperty(b)&&Gt(i,b,r[b])}function Da(i){if(i.indexOf("-")===-1)return!1;switch(i){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 ia=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Zl=/^[\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 La(i){return Zl.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function he(){}var Se=null;function Be(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ve=null,Rt=null;function oi(i){var r=ta(i);if(r&&(i=r.stateNode)){var l=i[fn]||null;e:switch(i=r.stateNode,r.type){case"input":if(Xl(i,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=i;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+On(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var u=l[r];if(u!==i&&u.form===i.form){var p=u[fn]||null;if(!p)throw Error(a(90));Xl(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<l.length;r++)u=l[r],u.form===i.form&&Vl(u)}break e;case"textarea":Rc(i,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&rn(i,!!l.multiple,r,!1)}}}var Wl=!1;function jc(i,r,l){if(Wl)return i(r,l);Wl=!0;try{var u=i(r);return u}finally{if(Wl=!1,(Ve!==null||Rt!==null)&&(vu(),Ve&&(r=Ve,i=Rt,Rt=Ve=null,oi(r),i)))for(r=0;r<i.length;r++)oi(i[r])}}function Jl(i,r){var l=i.stateNode;if(l===null)return null;var u=l[fn]||null;if(u===null)return null;l=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(l&&typeof l!="function")throw Error(a(231,r,typeof l));return l}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),td=!1;if(aa)try{var eo={};Object.defineProperty(eo,"passive",{get:function(){td=!0}}),window.addEventListener("test",eo,eo),window.removeEventListener("test",eo,eo)}catch{td=!1}var Ia=null,nd=null,Dc=null;function jg(){if(Dc)return Dc;var i,r=nd,l=r.length,u,p="value"in Ia?Ia.value:Ia.textContent,b=p.length;for(i=0;i<l&&r[i]===p[i];i++);var E=l-i;for(u=1;u<=E&&r[l-u]===p[b-u];u++);return Dc=p.slice(i,1<u?1-u:void 0)}function Lc(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function Ic(){return!0}function Dg(){return!1}function Rn(i){function r(l,u,p,b,E){this._reactName=l,this._targetInst=p,this.type=u,this.nativeEvent=b,this.target=E,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(l=i[N],this[N]=l?l(b):b[N]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Ic:Dg,this.isPropagationStopped=Dg,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ic)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ic)},persist:function(){},isPersistent:Ic}),r}var jr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zc=Rn(jr),to=g({},jr,{view:0,detail:0}),Iw=Rn(to),id,ad,no,Bc=g({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sd,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==no&&(no&&i.type==="mousemove"?(id=i.screenX-no.screenX,ad=i.screenY-no.screenY):ad=id=0,no=i),id)},movementY:function(i){return"movementY"in i?i.movementY:ad}}),Lg=Rn(Bc),zw=g({},Bc,{dataTransfer:0}),Bw=Rn(zw),Uw=g({},to,{relatedTarget:0}),rd=Rn(Uw),Fw=g({},jr,{animationName:0,elapsedTime:0,pseudoElement:0}),$w=Rn(Fw),Pw=g({},jr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),qw=Rn(Pw),Hw=g({},jr,{data:0}),Ig=Rn(Hw),Kw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gw={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"},Qw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yw(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=Qw[i])?!!r[i]:!1}function sd(){return Yw}var Vw=g({},to,{key:function(i){if(i.key){var r=Kw[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Lc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Gw[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sd,charCode:function(i){return i.type==="keypress"?Lc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Lc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Xw=Rn(Vw),Zw=g({},Bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zg=Rn(Zw),Ww=g({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sd}),Jw=Rn(Ww),e_=g({},jr,{propertyName:0,elapsedTime:0,pseudoElement:0}),t_=Rn(e_),n_=g({},Bc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),i_=Rn(n_),a_=g({},jr,{newState:0,oldState:0}),r_=Rn(a_),s_=[9,13,27,32],ld=aa&&"CompositionEvent"in window,io=null;aa&&"documentMode"in document&&(io=document.documentMode);var l_=aa&&"TextEvent"in window&&!io,Bg=aa&&(!ld||io&&8<io&&11>=io),Ug=" ",Fg=!1;function $g(i,r){switch(i){case"keyup":return s_.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ts=!1;function o_(i,r){switch(i){case"compositionend":return Pg(r);case"keypress":return r.which!==32?null:(Fg=!0,Ug);case"textInput":return i=r.data,i===Ug&&Fg?null:i;default:return null}}function c_(i,r){if(Ts)return i==="compositionend"||!ld&&$g(i,r)?(i=jg(),Dc=nd=Ia=null,Ts=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Bg&&r.locale!=="ko"?null:r.data;default:return null}}var u_={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 qg(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!u_[i.type]:r==="textarea"}function Hg(i,r,l,u){Ve?Rt?Rt.push(u):Rt=[u]:Ve=u,r=Tu(r,"onChange"),0<r.length&&(l=new zc("onChange","change",null,l,u),i.push({event:l,listeners:r}))}var ao=null,ro=null;function f_(i){Nx(i,0)}function Uc(i){var r=Ma(i);if(Vl(r))return i}function Kg(i,r){if(i==="change")return r}var Gg=!1;if(aa){var od;if(aa){var cd="oninput"in document;if(!cd){var Qg=document.createElement("div");Qg.setAttribute("oninput","return;"),cd=typeof Qg.oninput=="function"}od=cd}else od=!1;Gg=od&&(!document.documentMode||9<document.documentMode)}function Yg(){ao&&(ao.detachEvent("onpropertychange",Vg),ro=ao=null)}function Vg(i){if(i.propertyName==="value"&&Uc(ro)){var r=[];Hg(r,ro,i,Be(i)),jc(f_,r)}}function d_(i,r,l){i==="focusin"?(Yg(),ao=r,ro=l,ao.attachEvent("onpropertychange",Vg)):i==="focusout"&&Yg()}function h_(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Uc(ro)}function m_(i,r){if(i==="click")return Uc(r)}function p_(i,r){if(i==="input"||i==="change")return Uc(r)}function g_(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var Yn=typeof Object.is=="function"?Object.is:g_;function so(i,r){if(Yn(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var l=Object.keys(i),u=Object.keys(r);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var p=l[u];if(!Ii.call(r,p)||!Yn(i[p],r[p]))return!1}return!0}function Xg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Zg(i,r){var l=Xg(i);i=0;for(var u;l;){if(l.nodeType===3){if(u=i+l.textContent.length,i<=r&&u>=r)return{node:l,offset:r-i};i=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xg(l)}}function Wg(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?Wg(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function Jg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=_s(i.document);r instanceof i.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)i=r.contentWindow;else break;r=_s(i.document)}return r}function ud(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var b_=aa&&"documentMode"in document&&11>=document.documentMode,Cs=null,fd=null,lo=null,dd=!1;function eb(i,r,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;dd||Cs==null||Cs!==_s(u)||(u=Cs,"selectionStart"in u&&ud(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),lo&&so(lo,u)||(lo=u,u=Tu(fd,"onSelect"),0<u.length&&(r=new zc("onSelect","select",null,r,l),i.push({event:r,listeners:u}),r.target=Cs)))}function Dr(i,r){var l={};return l[i.toLowerCase()]=r.toLowerCase(),l["Webkit"+i]="webkit"+r,l["Moz"+i]="moz"+r,l}var As={animationend:Dr("Animation","AnimationEnd"),animationiteration:Dr("Animation","AnimationIteration"),animationstart:Dr("Animation","AnimationStart"),transitionrun:Dr("Transition","TransitionRun"),transitionstart:Dr("Transition","TransitionStart"),transitioncancel:Dr("Transition","TransitionCancel"),transitionend:Dr("Transition","TransitionEnd")},hd={},tb={};aa&&(tb=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Lr(i){if(hd[i])return hd[i];if(!As[i])return i;var r=As[i],l;for(l in r)if(r.hasOwnProperty(l)&&l in tb)return hd[i]=r[l];return i}var nb=Lr("animationend"),ib=Lr("animationiteration"),ab=Lr("animationstart"),y_=Lr("transitionrun"),x_=Lr("transitionstart"),v_=Lr("transitioncancel"),rb=Lr("transitionend"),sb=new Map,md="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");md.push("scrollEnd");function Ni(i,r){sb.set(i,r),na(r,[i])}var Fc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},ci=[],Os=0,pd=0;function $c(){for(var i=Os,r=pd=Os=0;r<i;){var l=ci[r];ci[r++]=null;var u=ci[r];ci[r++]=null;var p=ci[r];ci[r++]=null;var b=ci[r];if(ci[r++]=null,u!==null&&p!==null){var E=u.pending;E===null?p.next=p:(p.next=E.next,E.next=p),u.pending=p}b!==0&&lb(l,p,b)}}function Pc(i,r,l,u){ci[Os++]=i,ci[Os++]=r,ci[Os++]=l,ci[Os++]=u,pd|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function gd(i,r,l,u){return Pc(i,r,l,u),qc(i)}function Ir(i,r){return Pc(i,null,null,r),qc(i)}function lb(i,r,l){i.lanes|=l;var u=i.alternate;u!==null&&(u.lanes|=l);for(var p=!1,b=i.return;b!==null;)b.childLanes|=l,u=b.alternate,u!==null&&(u.childLanes|=l),b.tag===22&&(i=b.stateNode,i===null||i._visibility&1||(p=!0)),i=b,b=b.return;return i.tag===3?(b=i.stateNode,p&&r!==null&&(p=31-ot(l),i=b.hiddenUpdates,u=i[p],u===null?i[p]=[r]:u.push(r),r.lane=l|536870912),b):null}function qc(i){if(50<Oo)throw Oo=0,kh=null,Error(a(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Rs={};function E_(i,r,l,u){this.tag=i,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(i,r,l,u){return new E_(i,r,l,u)}function bd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ra(i,r){var l=i.alternate;return l===null?(l=Vn(i.tag,r,i.key,i.mode),l.elementType=i.elementType,l.type=i.type,l.stateNode=i.stateNode,l.alternate=i,i.alternate=l):(l.pendingProps=r,l.type=i.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=i.flags&65011712,l.childLanes=i.childLanes,l.lanes=i.lanes,l.child=i.child,l.memoizedProps=i.memoizedProps,l.memoizedState=i.memoizedState,l.updateQueue=i.updateQueue,r=i.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=i.sibling,l.index=i.index,l.ref=i.ref,l.refCleanup=i.refCleanup,l}function ob(i,r){i.flags&=65011714;var l=i.alternate;return l===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,r=l.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Hc(i,r,l,u,p,b){var E=0;if(u=i,typeof i=="function")bd(i)&&(E=1);else if(typeof i=="string")E=Nk(i,l,me.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=Vn(31,l,r,p),i.elementType=Z,i.lanes=b,i;case w:return zr(l.children,p,b,r);case k:E=8,p|=24;break;case _:return i=Vn(12,l,r,p|2),i.elementType=_,i.lanes=b,i;case $:return i=Vn(13,l,r,p),i.elementType=$,i.lanes=b,i;case j:return i=Vn(19,l,r,p),i.elementType=j,i.lanes=b,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:E=10;break e;case A:E=9;break e;case D:E=11;break e;case q:E=14;break e;case U:E=16,u=null;break e}E=29,l=Error(a(130,i===null?"null":typeof i,"")),u=null}return r=Vn(E,l,r,p),r.elementType=i,r.type=u,r.lanes=b,r}function zr(i,r,l,u){return i=Vn(7,i,u,r),i.lanes=l,i}function yd(i,r,l){return i=Vn(6,i,null,r),i.lanes=l,i}function cb(i){var r=Vn(18,null,null,0);return r.stateNode=i,r}function xd(i,r,l){return r=Vn(4,i.children!==null?i.children:[],i.key,r),r.lanes=l,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var ub=new WeakMap;function ui(i,r){if(typeof i=="object"&&i!==null){var l=ub.get(i);return l!==void 0?l:(r={value:i,source:r,stack:li(r)},ub.set(i,r),r)}return{value:i,source:r,stack:li(r)}}var Ms=[],js=0,Kc=null,oo=0,fi=[],di=0,za=null,Ui=1,Fi="";function sa(i,r){Ms[js++]=oo,Ms[js++]=Kc,Kc=i,oo=r}function fb(i,r,l){fi[di++]=Ui,fi[di++]=Fi,fi[di++]=za,za=i;var u=Ui;i=Fi;var p=32-ot(u)-1;u&=~(1<<p),l+=1;var b=32-ot(r)+p;if(30<b){var E=p-p%5;b=(u&(1<<E)-1).toString(32),u>>=E,p-=E,Ui=1<<32-ot(r)+p|l<<p|u,Fi=b+i}else Ui=1<<b|l<<p|u,Fi=i}function vd(i){i.return!==null&&(sa(i,1),fb(i,1,0))}function Ed(i){for(;i===Kc;)Kc=Ms[--js],Ms[js]=null,oo=Ms[--js],Ms[js]=null;for(;i===za;)za=fi[--di],fi[di]=null,Fi=fi[--di],fi[di]=null,Ui=fi[--di],fi[di]=null}function db(i,r){fi[di++]=Ui,fi[di++]=Fi,fi[di++]=za,Ui=r.id,Fi=r.overflow,za=i}var sn=null,_t=null,Je=!1,Ba=null,hi=!1,Sd=Error(a(519));function Ua(i){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw co(ui(r,i)),Sd}function hb(i){var r=i.stateNode,l=i.type,u=i.memoizedProps;switch(r[Ft]=i,r[fn]=u,l){case"dialog":Qe("cancel",r),Qe("close",r);break;case"iframe":case"object":case"embed":Qe("load",r);break;case"video":case"audio":for(l=0;l<Mo.length;l++)Qe(Mo[l],r);break;case"source":Qe("error",r);break;case"img":case"image":case"link":Qe("error",r),Qe("load",r);break;case"details":Qe("toggle",r);break;case"input":Qe("invalid",r),Mr(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Qe("invalid",r);break;case"textarea":Qe("invalid",r),Ns(r,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||u.suppressHydrationWarning===!0||Ox(r.textContent,l)?(u.popover!=null&&(Qe("beforetoggle",r),Qe("toggle",r)),u.onScroll!=null&&Qe("scroll",r),u.onScrollEnd!=null&&Qe("scrollend",r),u.onClick!=null&&(r.onclick=he),r=!0):r=!1,r||Ua(i,!0)}function mb(i){for(sn=i.return;sn;)switch(sn.tag){case 5:case 31:case 13:hi=!1;return;case 27:case 3:hi=!0;return;default:sn=sn.return}}function Ds(i){if(i!==sn)return!1;if(!Je)return mb(i),Je=!0,!1;var r=i.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=i.type,l=!(l!=="form"&&l!=="button")||Fh(i.type,i.memoizedProps)),l=!l),l&&_t&&Ua(i),mb(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));_t=Ux(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));_t=Ux(i)}else r===27?(r=_t,Ja(i.type)?(i=Kh,Kh=null,_t=i):_t=r):_t=sn?pi(i.stateNode.nextSibling):null;return!0}function Br(){_t=sn=null,Je=!1}function wd(){var i=Ba;return i!==null&&(Ln===null?Ln=i:Ln.push.apply(Ln,i),Ba=null),i}function co(i){Ba===null?Ba=[i]:Ba.push(i)}var _d=L(null),Ur=null,la=null;function Fa(i,r,l){C(_d,r._currentValue),r._currentValue=l}function oa(i){i._currentValue=_d.current,J(_d)}function kd(i,r,l){for(;i!==null;){var u=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),i===l)break;i=i.return}}function Nd(i,r,l,u){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var b=p.dependencies;if(b!==null){var E=p.child;b=b.firstContext;e:for(;b!==null;){var N=b;b=p;for(var I=0;I<r.length;I++)if(N.context===r[I]){b.lanes|=l,N=b.alternate,N!==null&&(N.lanes|=l),kd(b.return,l,i),u||(E=null);break e}b=N.next}}else if(p.tag===18){if(E=p.return,E===null)throw Error(a(341));E.lanes|=l,b=E.alternate,b!==null&&(b.lanes|=l),kd(E,l,i),E=null}else E=p.child;if(E!==null)E.return=p;else for(E=p;E!==null;){if(E===i){E=null;break}if(p=E.sibling,p!==null){p.return=E.return,E=p;break}E=E.return}p=E}}function Ls(i,r,l,u){i=null;for(var p=r,b=!1;p!==null;){if(!b){if((p.flags&524288)!==0)b=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var E=p.alternate;if(E===null)throw Error(a(387));if(E=E.memoizedProps,E!==null){var N=p.type;Yn(p.pendingProps.value,E.value)||(i!==null?i.push(N):i=[N])}}else if(p===ce.current){if(E=p.alternate,E===null)throw Error(a(387));E.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(i!==null?i.push(zo):i=[zo])}p=p.return}i!==null&&Nd(r,i,l,u),r.flags|=262144}function Gc(i){for(i=i.firstContext;i!==null;){if(!Yn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Fr(i){Ur=i,la=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ln(i){return pb(Ur,i)}function Qc(i,r){return Ur===null&&Fr(i),pb(i,r)}function pb(i,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},la===null){if(i===null)throw Error(a(308));la=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else la=la.next=r;return l}var S_=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(l,u){i.push(u)}};this.abort=function(){r.aborted=!0,i.forEach(function(l){return l()})}},w_=e.unstable_scheduleCallback,__=e.unstable_NormalPriority,Qt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Td(){return{controller:new S_,data:new Map,refCount:0}}function uo(i){i.refCount--,i.refCount===0&&w_(__,function(){i.controller.abort()})}var fo=null,Cd=0,Is=0,zs=null;function k_(i,r){if(fo===null){var l=fo=[];Cd=0,Is=Rh(),zs={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Cd++,r.then(gb,gb),r}function gb(){if(--Cd===0&&fo!==null){zs!==null&&(zs.status="fulfilled");var i=fo;fo=null,Is=0,zs=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function N_(i,r){var l=[],u={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return i.then(function(){u.status="fulfilled",u.value=r;for(var p=0;p<l.length;p++)(0,l[p])(r)},function(p){for(u.status="rejected",u.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),u}var bb=K.S;K.S=function(i,r){ex=Ot(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&k_(i,r),bb!==null&&bb(i,r)};var $r=L(null);function Ad(){var i=$r.current;return i!==null?i:yt.pooledCache}function Yc(i,r){r===null?C($r,$r.current):C($r,r.pool)}function yb(){var i=Ad();return i===null?null:{parent:Qt._currentValue,pool:i}}var Bs=Error(a(460)),Od=Error(a(474)),Vc=Error(a(542)),Xc={then:function(){}};function xb(i){return i=i.status,i==="fulfilled"||i==="rejected"}function vb(i,r,l){switch(l=i[l],l===void 0?i.push(r):l!==r&&(r.then(he,he),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Sb(i),i;default:if(typeof r.status=="string")r.then(he,he);else{if(i=yt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=r,i.status="pending",i.then(function(u){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=u}},function(u){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Sb(i),i}throw qr=r,Bs}}function Pr(i){try{var r=i._init;return r(i._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(qr=l,Bs):l}}var qr=null;function Eb(){if(qr===null)throw Error(a(459));var i=qr;return qr=null,i}function Sb(i){if(i===Bs||i===Vc)throw Error(a(483))}var Us=null,ho=0;function Zc(i){var r=ho;return ho+=1,Us===null&&(Us=[]),vb(Us,i,r)}function mo(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Wc(i,r){throw r.$$typeof===x?Error(a(525)):(i=Object.prototype.toString.call(r),Error(a(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function wb(i){function r(H,F){if(i){var Q=H.deletions;Q===null?(H.deletions=[F],H.flags|=16):Q.push(F)}}function l(H,F){if(!i)return null;for(;F!==null;)r(H,F),F=F.sibling;return null}function u(H){for(var F=new Map;H!==null;)H.key!==null?F.set(H.key,H):F.set(H.index,H),H=H.sibling;return F}function p(H,F){return H=ra(H,F),H.index=0,H.sibling=null,H}function b(H,F,Q){return H.index=Q,i?(Q=H.alternate,Q!==null?(Q=Q.index,Q<F?(H.flags|=67108866,F):Q):(H.flags|=67108866,F)):(H.flags|=1048576,F)}function E(H){return i&&H.alternate===null&&(H.flags|=67108866),H}function N(H,F,Q,re){return F===null||F.tag!==6?(F=yd(Q,H.mode,re),F.return=H,F):(F=p(F,Q),F.return=H,F)}function I(H,F,Q,re){var Ce=Q.type;return Ce===w?ne(H,F,Q.props.children,re,Q.key):F!==null&&(F.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&Pr(Ce)===F.type)?(F=p(F,Q.props),mo(F,Q),F.return=H,F):(F=Hc(Q.type,Q.key,Q.props,null,H.mode,re),mo(F,Q),F.return=H,F)}function Y(H,F,Q,re){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=xd(Q,H.mode,re),F.return=H,F):(F=p(F,Q.children||[]),F.return=H,F)}function ne(H,F,Q,re,Ce){return F===null||F.tag!==7?(F=zr(Q,H.mode,re,Ce),F.return=H,F):(F=p(F,Q),F.return=H,F)}function se(H,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=yd(""+F,H.mode,Q),F.return=H,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return Q=Hc(F.type,F.key,F.props,null,H.mode,Q),mo(Q,F),Q.return=H,Q;case S:return F=xd(F,H.mode,Q),F.return=H,F;case U:return F=Pr(F),se(H,F,Q)}if(W(F)||G(F))return F=zr(F,H.mode,Q,null),F.return=H,F;if(typeof F.then=="function")return se(H,Zc(F),Q);if(F.$$typeof===T)return se(H,Qc(H,F),Q);Wc(H,F)}return null}function X(H,F,Q,re){var Ce=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Ce!==null?null:N(H,F,""+Q,re);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:return Q.key===Ce?I(H,F,Q,re):null;case S:return Q.key===Ce?Y(H,F,Q,re):null;case U:return Q=Pr(Q),X(H,F,Q,re)}if(W(Q)||G(Q))return Ce!==null?null:ne(H,F,Q,re,null);if(typeof Q.then=="function")return X(H,F,Zc(Q),re);if(Q.$$typeof===T)return X(H,F,Qc(H,Q),re);Wc(H,Q)}return null}function ee(H,F,Q,re,Ce){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return H=H.get(Q)||null,N(F,H,""+re,Ce);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return H=H.get(re.key===null?Q:re.key)||null,I(F,H,re,Ce);case S:return H=H.get(re.key===null?Q:re.key)||null,Y(F,H,re,Ce);case U:return re=Pr(re),ee(H,F,Q,re,Ce)}if(W(re)||G(re))return H=H.get(Q)||null,ne(F,H,re,Ce,null);if(typeof re.then=="function")return ee(H,F,Q,Zc(re),Ce);if(re.$$typeof===T)return ee(H,F,Q,Qc(F,re),Ce);Wc(F,re)}return null}function xe(H,F,Q,re){for(var Ce=null,it=null,we=F,Fe=F=0,Ze=null;we!==null&&Fe<Q.length;Fe++){we.index>Fe?(Ze=we,we=null):Ze=we.sibling;var at=X(H,we,Q[Fe],re);if(at===null){we===null&&(we=Ze);break}i&&we&&at.alternate===null&&r(H,we),F=b(at,F,Fe),it===null?Ce=at:it.sibling=at,it=at,we=Ze}if(Fe===Q.length)return l(H,we),Je&&sa(H,Fe),Ce;if(we===null){for(;Fe<Q.length;Fe++)we=se(H,Q[Fe],re),we!==null&&(F=b(we,F,Fe),it===null?Ce=we:it.sibling=we,it=we);return Je&&sa(H,Fe),Ce}for(we=u(we);Fe<Q.length;Fe++)Ze=ee(we,H,Fe,Q[Fe],re),Ze!==null&&(i&&Ze.alternate!==null&&we.delete(Ze.key===null?Fe:Ze.key),F=b(Ze,F,Fe),it===null?Ce=Ze:it.sibling=Ze,it=Ze);return i&&we.forEach(function(ar){return r(H,ar)}),Je&&sa(H,Fe),Ce}function Re(H,F,Q,re){if(Q==null)throw Error(a(151));for(var Ce=null,it=null,we=F,Fe=F=0,Ze=null,at=Q.next();we!==null&&!at.done;Fe++,at=Q.next()){we.index>Fe?(Ze=we,we=null):Ze=we.sibling;var ar=X(H,we,at.value,re);if(ar===null){we===null&&(we=Ze);break}i&&we&&ar.alternate===null&&r(H,we),F=b(ar,F,Fe),it===null?Ce=ar:it.sibling=ar,it=ar,we=Ze}if(at.done)return l(H,we),Je&&sa(H,Fe),Ce;if(we===null){for(;!at.done;Fe++,at=Q.next())at=se(H,at.value,re),at!==null&&(F=b(at,F,Fe),it===null?Ce=at:it.sibling=at,it=at);return Je&&sa(H,Fe),Ce}for(we=u(we);!at.done;Fe++,at=Q.next())at=ee(we,H,Fe,at.value,re),at!==null&&(i&&at.alternate!==null&&we.delete(at.key===null?Fe:at.key),F=b(at,F,Fe),it===null?Ce=at:it.sibling=at,it=at);return i&&we.forEach(function(zk){return r(H,zk)}),Je&&sa(H,Fe),Ce}function pt(H,F,Q,re){if(typeof Q=="object"&&Q!==null&&Q.type===w&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case v:e:{for(var Ce=Q.key;F!==null;){if(F.key===Ce){if(Ce=Q.type,Ce===w){if(F.tag===7){l(H,F.sibling),re=p(F,Q.props.children),re.return=H,H=re;break e}}else if(F.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&Pr(Ce)===F.type){l(H,F.sibling),re=p(F,Q.props),mo(re,Q),re.return=H,H=re;break e}l(H,F);break}else r(H,F);F=F.sibling}Q.type===w?(re=zr(Q.props.children,H.mode,re,Q.key),re.return=H,H=re):(re=Hc(Q.type,Q.key,Q.props,null,H.mode,re),mo(re,Q),re.return=H,H=re)}return E(H);case S:e:{for(Ce=Q.key;F!==null;){if(F.key===Ce)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){l(H,F.sibling),re=p(F,Q.children||[]),re.return=H,H=re;break e}else{l(H,F);break}else r(H,F);F=F.sibling}re=xd(Q,H.mode,re),re.return=H,H=re}return E(H);case U:return Q=Pr(Q),pt(H,F,Q,re)}if(W(Q))return xe(H,F,Q,re);if(G(Q)){if(Ce=G(Q),typeof Ce!="function")throw Error(a(150));return Q=Ce.call(Q),Re(H,F,Q,re)}if(typeof Q.then=="function")return pt(H,F,Zc(Q),re);if(Q.$$typeof===T)return pt(H,F,Qc(H,Q),re);Wc(H,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,F!==null&&F.tag===6?(l(H,F.sibling),re=p(F,Q),re.return=H,H=re):(l(H,F),re=yd(Q,H.mode,re),re.return=H,H=re),E(H)):l(H,F)}return function(H,F,Q,re){try{ho=0;var Ce=pt(H,F,Q,re);return Us=null,Ce}catch(we){if(we===Bs||we===Vc)throw we;var it=Vn(29,we,null,H.mode);return it.lanes=re,it.return=H,it}finally{}}}var Hr=wb(!0),_b=wb(!1),$a=!1;function Rd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Md(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Pa(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function qa(i,r,l){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(rt&2)!==0){var p=u.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),u.pending=r,r=qc(i),lb(i,null,l),r}return Pc(i,u,r,l),qc(i)}function po(i,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,De(i,l)}}function jd(i,r){var l=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var p=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var E={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};b===null?p=b=E:b=b.next=E,l=l.next}while(l!==null);b===null?p=b=r:b=b.next=r}else p=b=r;l={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:b,shared:u.shared,callbacks:u.callbacks},i.updateQueue=l;return}i=l.lastBaseUpdate,i===null?l.firstBaseUpdate=r:i.next=r,l.lastBaseUpdate=r}var Dd=!1;function go(){if(Dd){var i=zs;if(i!==null)throw i}}function bo(i,r,l,u){Dd=!1;var p=i.updateQueue;$a=!1;var b=p.firstBaseUpdate,E=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var I=N,Y=I.next;I.next=null,E===null?b=Y:E.next=Y,E=I;var ne=i.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==E&&(N===null?ne.firstBaseUpdate=Y:N.next=Y,ne.lastBaseUpdate=I))}if(b!==null){var se=p.baseState;E=0,ne=Y=I=null,N=b;do{var X=N.lane&-536870913,ee=X!==N.lane;if(ee?(Xe&X)===X:(u&X)===X){X!==0&&X===Is&&(Dd=!0),ne!==null&&(ne=ne.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var xe=i,Re=N;X=r;var pt=l;switch(Re.tag){case 1:if(xe=Re.payload,typeof xe=="function"){se=xe.call(pt,se,X);break e}se=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Re.payload,X=typeof xe=="function"?xe.call(pt,se,X):xe,X==null)break e;se=g({},se,X);break e;case 2:$a=!0}}X=N.callback,X!==null&&(i.flags|=64,ee&&(i.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[X]:ee.push(X))}else ee={lane:X,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(Y=ne=ee,I=se):ne=ne.next=ee,E|=X;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;ee=N,N=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);ne===null&&(I=se),p.baseState=I,p.firstBaseUpdate=Y,p.lastBaseUpdate=ne,b===null&&(p.shared.lanes=0),Ya|=E,i.lanes=E,i.memoizedState=se}}function kb(i,r){if(typeof i!="function")throw Error(a(191,i));i.call(r)}function Nb(i,r){var l=i.callbacks;if(l!==null)for(i.callbacks=null,i=0;i<l.length;i++)kb(l[i],r)}var Fs=L(null),Jc=L(0);function Tb(i,r){i=ba,C(Jc,i),C(Fs,r),ba=i|r.baseLanes}function Ld(){C(Jc,ba),C(Fs,Fs.current)}function Id(){ba=Jc.current,J(Fs),J(Jc)}var Xn=L(null),mi=null;function Ha(i){var r=i.alternate;C(Pt,Pt.current&1),C(Xn,i),mi===null&&(r===null||Fs.current!==null||r.memoizedState!==null)&&(mi=i)}function zd(i){C(Pt,Pt.current),C(Xn,i),mi===null&&(mi=i)}function Cb(i){i.tag===22?(C(Pt,Pt.current),C(Xn,i),mi===null&&(mi=i)):Ka()}function Ka(){C(Pt,Pt.current),C(Xn,Xn.current)}function Zn(i){J(Xn),mi===i&&(mi=null),J(Pt)}var Pt=L(0);function eu(i){for(var r=i;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||qh(l)||Hh(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var ca=0,Ue=null,ht=null,Yt=null,tu=!1,$s=!1,Kr=!1,nu=0,yo=0,Ps=null,T_=0;function It(){throw Error(a(321))}function Bd(i,r){if(r===null)return!1;for(var l=0;l<r.length&&l<i.length;l++)if(!Yn(i[l],r[l]))return!1;return!0}function Ud(i,r,l,u,p,b){return ca=b,Ue=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,K.H=i===null||i.memoizedState===null?fy:eh,Kr=!1,b=l(u,p),Kr=!1,$s&&(b=Ob(r,l,u,p)),Ab(i),b}function Ab(i){K.H=Eo;var r=ht!==null&&ht.next!==null;if(ca=0,Yt=ht=Ue=null,tu=!1,yo=0,Ps=null,r)throw Error(a(300));i===null||Vt||(i=i.dependencies,i!==null&&Gc(i)&&(Vt=!0))}function Ob(i,r,l,u){Ue=i;var p=0;do{if($s&&(Ps=null),yo=0,$s=!1,25<=p)throw Error(a(301));if(p+=1,Yt=ht=null,i.updateQueue!=null){var b=i.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}K.H=dy,b=r(l,u)}while($s);return b}function C_(){var i=K.H,r=i.useState()[0];return r=typeof r.then=="function"?xo(r):r,i=i.useState()[0],(ht!==null?ht.memoizedState:null)!==i&&(Ue.flags|=1024),r}function Fd(){var i=nu!==0;return nu=0,i}function $d(i,r,l){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~l}function Pd(i){if(tu){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}tu=!1}ca=0,Yt=ht=Ue=null,$s=!1,yo=nu=0,Ps=null}function Sn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?Ue.memoizedState=Yt=i:Yt=Yt.next=i,Yt}function qt(){if(ht===null){var i=Ue.alternate;i=i!==null?i.memoizedState:null}else i=ht.next;var r=Yt===null?Ue.memoizedState:Yt.next;if(r!==null)Yt=r,ht=i;else{if(i===null)throw Ue.alternate===null?Error(a(467)):Error(a(310));ht=i,i={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},Yt===null?Ue.memoizedState=Yt=i:Yt=Yt.next=i}return Yt}function iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(i){var r=yo;return yo+=1,Ps===null&&(Ps=[]),i=vb(Ps,i,r),r=Ue,(Yt===null?r.memoizedState:Yt.next)===null&&(r=r.alternate,K.H=r===null||r.memoizedState===null?fy:eh),i}function au(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return xo(i);if(i.$$typeof===T)return ln(i)}throw Error(a(438,String(i)))}function qd(i){var r=null,l=Ue.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var u=Ue.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=iu(),Ue.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(i),u=0;u<i;u++)l[u]=O;return r.index++,l}function ua(i,r){return typeof r=="function"?r(i):r}function ru(i){var r=qt();return Hd(r,ht,i)}function Hd(i,r,l){var u=i.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=l;var p=i.baseQueue,b=u.pending;if(b!==null){if(p!==null){var E=p.next;p.next=b.next,b.next=E}r.baseQueue=p=b,u.pending=null}if(b=i.baseState,p===null)i.memoizedState=b;else{r=p.next;var N=E=null,I=null,Y=r,ne=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(Xe&se)===se:(ca&se)===se){var X=Y.revertLane;if(X===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===Is&&(ne=!0);else if((ca&X)===X){Y=Y.next,X===Is&&(ne=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(N=I=se,E=b):I=I.next=se,Ue.lanes|=X,Ya|=X;se=Y.action,Kr&&l(b,se),b=Y.hasEagerState?Y.eagerState:l(b,se)}else X={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(N=I=X,E=b):I=I.next=X,Ue.lanes|=se,Ya|=se;Y=Y.next}while(Y!==null&&Y!==r);if(I===null?E=b:I.next=N,!Yn(b,i.memoizedState)&&(Vt=!0,ne&&(l=zs,l!==null)))throw l;i.memoizedState=b,i.baseState=E,i.baseQueue=I,u.lastRenderedState=b}return p===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Kd(i){var r=qt(),l=r.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=i;var u=l.dispatch,p=l.pending,b=r.memoizedState;if(p!==null){l.pending=null;var E=p=p.next;do b=i(b,E.action),E=E.next;while(E!==p);Yn(b,r.memoizedState)||(Vt=!0),r.memoizedState=b,r.baseQueue===null&&(r.baseState=b),l.lastRenderedState=b}return[b,u]}function Rb(i,r,l){var u=Ue,p=qt(),b=Je;if(b){if(l===void 0)throw Error(a(407));l=l()}else l=r();var E=!Yn((ht||p).memoizedState,l);if(E&&(p.memoizedState=l,Vt=!0),p=p.queue,Yd(Db.bind(null,u,p,i),[i]),p.getSnapshot!==r||E||Yt!==null&&Yt.memoizedState.tag&1){if(u.flags|=2048,qs(9,{destroy:void 0},jb.bind(null,u,p,l,r),null),yt===null)throw Error(a(349));b||(ca&127)!==0||Mb(u,r,l)}return l}function Mb(i,r,l){i.flags|=16384,i={getSnapshot:r,value:l},r=Ue.updateQueue,r===null?(r=iu(),Ue.updateQueue=r,r.stores=[i]):(l=r.stores,l===null?r.stores=[i]:l.push(i))}function jb(i,r,l,u){r.value=l,r.getSnapshot=u,Lb(r)&&Ib(i)}function Db(i,r,l){return l(function(){Lb(r)&&Ib(i)})}function Lb(i){var r=i.getSnapshot;i=i.value;try{var l=r();return!Yn(i,l)}catch{return!0}}function Ib(i){var r=Ir(i,2);r!==null&&In(r,i,2)}function Gd(i){var r=Sn();if(typeof i=="function"){var l=i;if(i=l(),Kr){un(!0);try{l()}finally{un(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:i},r}function zb(i,r,l,u){return i.baseState=l,Hd(i,ht,typeof u=="function"?u:ua)}function A_(i,r,l,u,p){if(ou(i))throw Error(a(485));if(i=r.action,i!==null){var b={payload:p,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){b.listeners.push(E)}};K.T!==null?l(!0):b.isTransition=!1,u(b),l=r.pending,l===null?(b.next=r.pending=b,Bb(r,b)):(b.next=l.next,r.pending=l.next=b)}}function Bb(i,r){var l=r.action,u=r.payload,p=i.state;if(r.isTransition){var b=K.T,E={};K.T=E;try{var N=l(p,u),I=K.S;I!==null&&I(E,N),Ub(i,r,N)}catch(Y){Qd(i,r,Y)}finally{b!==null&&E.types!==null&&(b.types=E.types),K.T=b}}else try{b=l(p,u),Ub(i,r,b)}catch(Y){Qd(i,r,Y)}}function Ub(i,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Fb(i,r,u)},function(u){return Qd(i,r,u)}):Fb(i,r,l)}function Fb(i,r,l){r.status="fulfilled",r.value=l,$b(r),i.state=l,r=i.pending,r!==null&&(l=r.next,l===r?i.pending=null:(l=l.next,r.next=l,Bb(i,l)))}function Qd(i,r,l){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=l,$b(r),r=r.next;while(r!==u)}i.action=null}function $b(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function Pb(i,r){return r}function qb(i,r){if(Je){var l=yt.formState;if(l!==null){e:{var u=Ue;if(Je){if(_t){t:{for(var p=_t,b=hi;p.nodeType!==8;){if(!b){p=null;break t}if(p=pi(p.nextSibling),p===null){p=null;break t}}b=p.data,p=b==="F!"||b==="F"?p:null}if(p){_t=pi(p.nextSibling),u=p.data==="F!";break e}}Ua(u)}u=!1}u&&(r=l[0])}}return l=Sn(),l.memoizedState=l.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pb,lastRenderedState:r},l.queue=u,l=oy.bind(null,Ue,u),u.dispatch=l,u=Gd(!1),b=Jd.bind(null,Ue,!1,u.queue),u=Sn(),p={state:r,dispatch:null,action:i,pending:null},u.queue=p,l=A_.bind(null,Ue,p,b,l),p.dispatch=l,u.memoizedState=i,[r,l,!1]}function Hb(i){var r=qt();return Kb(r,ht,i)}function Kb(i,r,l){if(r=Hd(i,r,Pb)[0],i=ru(ua)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=xo(r)}catch(E){throw E===Bs?Vc:E}else u=r;r=qt();var p=r.queue,b=p.dispatch;return l!==r.memoizedState&&(Ue.flags|=2048,qs(9,{destroy:void 0},O_.bind(null,p,l),null)),[u,b,i]}function O_(i,r){i.action=r}function Gb(i){var r=qt(),l=ht;if(l!==null)return Kb(r,l,i);qt(),r=r.memoizedState,l=qt();var u=l.queue.dispatch;return l.memoizedState=i,[r,u,!1]}function qs(i,r,l,u){return i={tag:i,create:l,deps:u,inst:r,next:null},r=Ue.updateQueue,r===null&&(r=iu(),Ue.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=i.next=i:(u=l.next,l.next=i,i.next=u,r.lastEffect=i),i}function Qb(){return qt().memoizedState}function su(i,r,l,u){var p=Sn();Ue.flags|=i,p.memoizedState=qs(1|r,{destroy:void 0},l,u===void 0?null:u)}function lu(i,r,l,u){var p=qt();u=u===void 0?null:u;var b=p.memoizedState.inst;ht!==null&&u!==null&&Bd(u,ht.memoizedState.deps)?p.memoizedState=qs(r,b,l,u):(Ue.flags|=i,p.memoizedState=qs(1|r,b,l,u))}function Yb(i,r){su(8390656,8,i,r)}function Yd(i,r){lu(2048,8,i,r)}function R_(i){Ue.flags|=4;var r=Ue.updateQueue;if(r===null)r=iu(),Ue.updateQueue=r,r.events=[i];else{var l=r.events;l===null?r.events=[i]:l.push(i)}}function Vb(i){var r=qt().memoizedState;return R_({ref:r,nextImpl:i}),function(){if((rt&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function Xb(i,r){return lu(4,2,i,r)}function Zb(i,r){return lu(4,4,i,r)}function Wb(i,r){if(typeof r=="function"){i=i();var l=r(i);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function Jb(i,r,l){l=l!=null?l.concat([i]):null,lu(4,4,Wb.bind(null,r,i),l)}function Vd(){}function ey(i,r){var l=qt();r=r===void 0?null:r;var u=l.memoizedState;return r!==null&&Bd(r,u[1])?u[0]:(l.memoizedState=[i,r],i)}function ty(i,r){var l=qt();r=r===void 0?null:r;var u=l.memoizedState;if(r!==null&&Bd(r,u[1]))return u[0];if(u=i(),Kr){un(!0);try{i()}finally{un(!1)}}return l.memoizedState=[u,r],u}function Xd(i,r,l){return l===void 0||(ca&1073741824)!==0&&(Xe&261930)===0?i.memoizedState=r:(i.memoizedState=l,i=nx(),Ue.lanes|=i,Ya|=i,l)}function ny(i,r,l,u){return Yn(l,r)?l:Fs.current!==null?(i=Xd(i,l,u),Yn(i,r)||(Vt=!0),i):(ca&42)===0||(ca&1073741824)!==0&&(Xe&261930)===0?(Vt=!0,i.memoizedState=l):(i=nx(),Ue.lanes|=i,Ya|=i,r)}function iy(i,r,l,u,p){var b=oe.p;oe.p=b!==0&&8>b?b:8;var E=K.T,N={};K.T=N,Jd(i,!1,r,l);try{var I=p(),Y=K.S;if(Y!==null&&Y(N,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=N_(I,u);vo(i,r,ne,ei(i))}else vo(i,r,u,ei(i))}catch(se){vo(i,r,{then:function(){},status:"rejected",reason:se},ei())}finally{oe.p=b,E!==null&&N.types!==null&&(E.types=N.types),K.T=E}}function M_(){}function Zd(i,r,l,u){if(i.tag!==5)throw Error(a(476));var p=ay(i).queue;iy(i,p,r,V,l===null?M_:function(){return ry(i),l(u)})}function ay(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:V},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ua,lastRenderedState:l},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function ry(i){var r=ay(i);r.next===null&&(r=i.alternate.memoizedState),vo(i,r.next.queue,{},ei())}function Wd(){return ln(zo)}function sy(){return qt().memoizedState}function ly(){return qt().memoizedState}function j_(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var l=ei();i=Pa(l);var u=qa(r,i,l);u!==null&&(In(u,r,l),po(u,r,l)),r={cache:Td()},i.payload=r;return}r=r.return}}function D_(i,r,l){var u=ei();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ou(i)?cy(r,l):(l=gd(i,r,l,u),l!==null&&(In(l,i,u),uy(l,r,u)))}function oy(i,r,l){var u=ei();vo(i,r,l,u)}function vo(i,r,l,u){var p={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ou(i))cy(r,p);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=r.lastRenderedReducer,b!==null))try{var E=r.lastRenderedState,N=b(E,l);if(p.hasEagerState=!0,p.eagerState=N,Yn(N,E))return Pc(i,r,p,0),yt===null&&$c(),!1}catch{}finally{}if(l=gd(i,r,p,u),l!==null)return In(l,i,u),uy(l,r,u),!0}return!1}function Jd(i,r,l,u){if(u={lane:2,revertLane:Rh(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ou(i)){if(r)throw Error(a(479))}else r=gd(i,l,u,2),r!==null&&In(r,i,2)}function ou(i){var r=i.alternate;return i===Ue||r!==null&&r===Ue}function cy(i,r){$s=tu=!0;var l=i.pending;l===null?r.next=r:(r.next=l.next,l.next=r),i.pending=r}function uy(i,r,l){if((l&4194048)!==0){var u=r.lanes;u&=i.pendingLanes,l|=u,r.lanes=l,De(i,l)}}var Eo={readContext:ln,use:au,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};Eo.useEffectEvent=It;var fy={readContext:ln,use:au,useCallback:function(i,r){return Sn().memoizedState=[i,r===void 0?null:r],i},useContext:ln,useEffect:Yb,useImperativeHandle:function(i,r,l){l=l!=null?l.concat([i]):null,su(4194308,4,Wb.bind(null,r,i),l)},useLayoutEffect:function(i,r){return su(4194308,4,i,r)},useInsertionEffect:function(i,r){su(4,2,i,r)},useMemo:function(i,r){var l=Sn();r=r===void 0?null:r;var u=i();if(Kr){un(!0);try{i()}finally{un(!1)}}return l.memoizedState=[u,r],u},useReducer:function(i,r,l){var u=Sn();if(l!==void 0){var p=l(r);if(Kr){un(!0);try{l(r)}finally{un(!1)}}}else p=r;return u.memoizedState=u.baseState=p,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},u.queue=i,i=i.dispatch=D_.bind(null,Ue,i),[u.memoizedState,i]},useRef:function(i){var r=Sn();return i={current:i},r.memoizedState=i},useState:function(i){i=Gd(i);var r=i.queue,l=oy.bind(null,Ue,r);return r.dispatch=l,[i.memoizedState,l]},useDebugValue:Vd,useDeferredValue:function(i,r){var l=Sn();return Xd(l,i,r)},useTransition:function(){var i=Gd(!1);return i=iy.bind(null,Ue,i.queue,!0,!1),Sn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,l){var u=Ue,p=Sn();if(Je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=r(),yt===null)throw Error(a(349));(Xe&127)!==0||Mb(u,r,l)}p.memoizedState=l;var b={value:l,getSnapshot:r};return p.queue=b,Yb(Db.bind(null,u,b,i),[i]),u.flags|=2048,qs(9,{destroy:void 0},jb.bind(null,u,b,l,r),null),l},useId:function(){var i=Sn(),r=yt.identifierPrefix;if(Je){var l=Fi,u=Ui;l=(u&~(1<<32-ot(u)-1)).toString(32)+l,r="_"+r+"R_"+l,l=nu++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=T_++,r="_"+r+"r_"+l.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Wd,useFormState:qb,useActionState:qb,useOptimistic:function(i){var r=Sn();r.memoizedState=r.baseState=i;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=Jd.bind(null,Ue,!0,l),l.dispatch=r,[i,r]},useMemoCache:qd,useCacheRefresh:function(){return Sn().memoizedState=j_.bind(null,Ue)},useEffectEvent:function(i){var r=Sn(),l={impl:i};return r.memoizedState=l,function(){if((rt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},eh={readContext:ln,use:au,useCallback:ey,useContext:ln,useEffect:Yd,useImperativeHandle:Jb,useInsertionEffect:Xb,useLayoutEffect:Zb,useMemo:ty,useReducer:ru,useRef:Qb,useState:function(){return ru(ua)},useDebugValue:Vd,useDeferredValue:function(i,r){var l=qt();return ny(l,ht.memoizedState,i,r)},useTransition:function(){var i=ru(ua)[0],r=qt().memoizedState;return[typeof i=="boolean"?i:xo(i),r]},useSyncExternalStore:Rb,useId:sy,useHostTransitionStatus:Wd,useFormState:Hb,useActionState:Hb,useOptimistic:function(i,r){var l=qt();return zb(l,ht,i,r)},useMemoCache:qd,useCacheRefresh:ly};eh.useEffectEvent=Vb;var dy={readContext:ln,use:au,useCallback:ey,useContext:ln,useEffect:Yd,useImperativeHandle:Jb,useInsertionEffect:Xb,useLayoutEffect:Zb,useMemo:ty,useReducer:Kd,useRef:Qb,useState:function(){return Kd(ua)},useDebugValue:Vd,useDeferredValue:function(i,r){var l=qt();return ht===null?Xd(l,i,r):ny(l,ht.memoizedState,i,r)},useTransition:function(){var i=Kd(ua)[0],r=qt().memoizedState;return[typeof i=="boolean"?i:xo(i),r]},useSyncExternalStore:Rb,useId:sy,useHostTransitionStatus:Wd,useFormState:Gb,useActionState:Gb,useOptimistic:function(i,r){var l=qt();return ht!==null?zb(l,ht,i,r):(l.baseState=i,[i,l.queue.dispatch])},useMemoCache:qd,useCacheRefresh:ly};dy.useEffectEvent=Vb;function th(i,r,l,u){r=i.memoizedState,l=l(u,r),l=l==null?r:g({},r,l),i.memoizedState=l,i.lanes===0&&(i.updateQueue.baseState=l)}var nh={enqueueSetState:function(i,r,l){i=i._reactInternals;var u=ei(),p=Pa(u);p.payload=r,l!=null&&(p.callback=l),r=qa(i,p,u),r!==null&&(In(r,i,u),po(r,i,u))},enqueueReplaceState:function(i,r,l){i=i._reactInternals;var u=ei(),p=Pa(u);p.tag=1,p.payload=r,l!=null&&(p.callback=l),r=qa(i,p,u),r!==null&&(In(r,i,u),po(r,i,u))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var l=ei(),u=Pa(l);u.tag=2,r!=null&&(u.callback=r),r=qa(i,u,l),r!==null&&(In(r,i,l),po(r,i,l))}};function hy(i,r,l,u,p,b,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,b,E):r.prototype&&r.prototype.isPureReactComponent?!so(l,u)||!so(p,b):!0}function my(i,r,l,u){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,u),r.state!==i&&nh.enqueueReplaceState(r,r.state,null)}function Gr(i,r){var l=r;if("ref"in r){l={};for(var u in r)u!=="ref"&&(l[u]=r[u])}if(i=i.defaultProps){l===r&&(l=g({},l));for(var p in i)l[p]===void 0&&(l[p]=i[p])}return l}function py(i){Fc(i)}function gy(i){console.error(i)}function by(i){Fc(i)}function cu(i,r){try{var l=i.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function yy(i,r,l){try{var u=i.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function ih(i,r,l){return l=Pa(l),l.tag=3,l.payload={element:null},l.callback=function(){cu(i,r)},l}function xy(i){return i=Pa(i),i.tag=3,i}function vy(i,r,l,u){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var b=u.value;i.payload=function(){return p(b)},i.callback=function(){yy(r,l,u)}}var E=l.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){yy(r,l,u),typeof p!="function"&&(Va===null?Va=new Set([this]):Va.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})})}function L_(i,r,l,u,p){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=l.alternate,r!==null&&Ls(r,l,p,!0),l=Xn.current,l!==null){switch(l.tag){case 31:case 13:return mi===null?Eu():l.alternate===null&&zt===0&&(zt=3),l.flags&=-257,l.flags|=65536,l.lanes=p,u===Xc?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([u]):r.add(u),Ch(i,u,p)),!1;case 22:return l.flags|=65536,u===Xc?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([u]):l.add(u)),Ch(i,u,p)),!1}throw Error(a(435,l.tag))}return Ch(i,u,p),Eu(),!1}if(Je)return r=Xn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,u!==Sd&&(i=Error(a(422),{cause:u}),co(ui(i,l)))):(u!==Sd&&(r=Error(a(423),{cause:u}),co(ui(r,l))),i=i.current.alternate,i.flags|=65536,p&=-p,i.lanes|=p,u=ui(u,l),p=ih(i.stateNode,u,p),jd(i,p),zt!==4&&(zt=2)),!1;var b=Error(a(520),{cause:u});if(b=ui(b,l),Ao===null?Ao=[b]:Ao.push(b),zt!==4&&(zt=2),r===null)return!0;u=ui(u,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,i=p&-p,l.lanes|=i,i=ih(l.stateNode,u,i),jd(l,i),!1;case 1:if(r=l.type,b=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Va===null||!Va.has(b))))return l.flags|=65536,p&=-p,l.lanes|=p,p=xy(p),vy(p,i,l,u),jd(l,p),!1}l=l.return}while(l!==null);return!1}var ah=Error(a(461)),Vt=!1;function on(i,r,l,u){r.child=i===null?_b(r,null,l,u):Hr(r,i.child,l,u)}function Ey(i,r,l,u,p){l=l.render;var b=r.ref;if("ref"in u){var E={};for(var N in u)N!=="ref"&&(E[N]=u[N])}else E=u;return Fr(r),u=Ud(i,r,l,E,b,p),N=Fd(),i!==null&&!Vt?($d(i,r,p),fa(i,r,p)):(Je&&N&&vd(r),r.flags|=1,on(i,r,u,p),r.child)}function Sy(i,r,l,u,p){if(i===null){var b=l.type;return typeof b=="function"&&!bd(b)&&b.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=b,wy(i,r,b,u,p)):(i=Hc(l.type,null,u,r,r.mode,p),i.ref=r.ref,i.return=r,r.child=i)}if(b=i.child,!dh(i,p)){var E=b.memoizedProps;if(l=l.compare,l=l!==null?l:so,l(E,u)&&i.ref===r.ref)return fa(i,r,p)}return r.flags|=1,i=ra(b,u),i.ref=r.ref,i.return=r,r.child=i}function wy(i,r,l,u,p){if(i!==null){var b=i.memoizedProps;if(so(b,u)&&i.ref===r.ref)if(Vt=!1,r.pendingProps=u=b,dh(i,p))(i.flags&131072)!==0&&(Vt=!0);else return r.lanes=i.lanes,fa(i,r,p)}return rh(i,r,l,u,p)}function _y(i,r,l,u){var p=u.children,b=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(b=b!==null?b.baseLanes|l:l,i!==null){for(u=r.child=i.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~b}else u=0,r.child=null;return ky(i,r,b,l,u)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Yc(r,b!==null?b.cachePool:null),b!==null?Tb(r,b):Ld(),Cb(r);else return u=r.lanes=536870912,ky(i,r,b!==null?b.baseLanes|l:l,l,u)}else b!==null?(Yc(r,b.cachePool),Tb(r,b),Ka(),r.memoizedState=null):(i!==null&&Yc(r,null),Ld(),Ka());return on(i,r,p,l),r.child}function So(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ky(i,r,l,u,p){var b=Ad();return b=b===null?null:{parent:Qt._currentValue,pool:b},r.memoizedState={baseLanes:l,cachePool:b},i!==null&&Yc(r,null),Ld(),Cb(r),i!==null&&Ls(i,r,u,!0),r.childLanes=p,null}function uu(i,r){return r=du({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function Ny(i,r,l){return Hr(r,i.child,null,l),i=uu(r,r.pendingProps),i.flags|=2,Zn(r),r.memoizedState=null,i}function I_(i,r,l){var u=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(Je){if(u.mode==="hidden")return i=uu(r,u),r.lanes=536870912,So(null,i);if(zd(r),(i=_t)?(i=Bx(i,hi),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:za!==null?{id:Ui,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},l=cb(i),l.return=r,r.child=l,sn=r,_t=null)):i=null,i===null)throw Ua(r);return r.lanes=536870912,null}return uu(r,u)}var b=i.memoizedState;if(b!==null){var E=b.dehydrated;if(zd(r),p)if(r.flags&256)r.flags&=-257,r=Ny(i,r,l);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(a(558));else if(Vt||Ls(i,r,l,!1),p=(l&i.childLanes)!==0,Vt||p){if(u=yt,u!==null&&(E=Ut(u,l),E!==0&&E!==b.retryLane))throw b.retryLane=E,Ir(i,E),In(u,i,E),ah;Eu(),r=Ny(i,r,l)}else i=b.treeContext,_t=pi(E.nextSibling),sn=r,Je=!0,Ba=null,hi=!1,i!==null&&db(r,i),r=uu(r,u),r.flags|=4096;return r}return i=ra(i.child,{mode:u.mode,children:u.children}),i.ref=r.ref,r.child=i,i.return=r,i}function fu(i,r){var l=r.ref;if(l===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(i===null||i.ref!==l)&&(r.flags|=4194816)}}function rh(i,r,l,u,p){return Fr(r),l=Ud(i,r,l,u,void 0,p),u=Fd(),i!==null&&!Vt?($d(i,r,p),fa(i,r,p)):(Je&&u&&vd(r),r.flags|=1,on(i,r,l,p),r.child)}function Ty(i,r,l,u,p,b){return Fr(r),r.updateQueue=null,l=Ob(r,u,l,p),Ab(i),u=Fd(),i!==null&&!Vt?($d(i,r,b),fa(i,r,b)):(Je&&u&&vd(r),r.flags|=1,on(i,r,l,b),r.child)}function Cy(i,r,l,u,p){if(Fr(r),r.stateNode===null){var b=Rs,E=l.contextType;typeof E=="object"&&E!==null&&(b=ln(E)),b=new l(u,b),r.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=nh,r.stateNode=b,b._reactInternals=r,b=r.stateNode,b.props=u,b.state=r.memoizedState,b.refs={},Rd(r),E=l.contextType,b.context=typeof E=="object"&&E!==null?ln(E):Rs,b.state=r.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(th(r,l,E,u),b.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(E=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),E!==b.state&&nh.enqueueReplaceState(b,b.state,null),bo(r,u,b,p),go(),b.state=r.memoizedState),typeof b.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(i===null){b=r.stateNode;var N=r.memoizedProps,I=Gr(l,N);b.props=I;var Y=b.context,ne=l.contextType;E=Rs,typeof ne=="object"&&ne!==null&&(E=ln(ne));var se=l.getDerivedStateFromProps;ne=typeof se=="function"||typeof b.getSnapshotBeforeUpdate=="function",N=r.pendingProps!==N,ne||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(N||Y!==E)&&my(r,b,u,E),$a=!1;var X=r.memoizedState;b.state=X,bo(r,u,b,p),go(),Y=r.memoizedState,N||X!==Y||$a?(typeof se=="function"&&(th(r,l,se,u),Y=r.memoizedState),(I=$a||hy(r,l,I,u,X,Y,E))?(ne||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(r.flags|=4194308)):(typeof b.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=Y),b.props=u,b.state=Y,b.context=E,u=I):(typeof b.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{b=r.stateNode,Md(i,r),E=r.memoizedProps,ne=Gr(l,E),b.props=ne,se=r.pendingProps,X=b.context,Y=l.contextType,I=Rs,typeof Y=="object"&&Y!==null&&(I=ln(Y)),N=l.getDerivedStateFromProps,(Y=typeof N=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(E!==se||X!==I)&&my(r,b,u,I),$a=!1,X=r.memoizedState,b.state=X,bo(r,u,b,p),go();var ee=r.memoizedState;E!==se||X!==ee||$a||i!==null&&i.dependencies!==null&&Gc(i.dependencies)?(typeof N=="function"&&(th(r,l,N,u),ee=r.memoizedState),(ne=$a||hy(r,l,ne,u,X,ee,I)||i!==null&&i.dependencies!==null&&Gc(i.dependencies))?(Y||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(u,ee,I),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(u,ee,I)),typeof b.componentDidUpdate=="function"&&(r.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof b.componentDidUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=ee),b.props=u,b.state=ee,b.context=I,u=ne):(typeof b.componentDidUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&X===i.memoizedState||(r.flags|=1024),u=!1)}return b=u,fu(i,r),u=(r.flags&128)!==0,b||u?(b=r.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:b.render(),r.flags|=1,i!==null&&u?(r.child=Hr(r,i.child,null,p),r.child=Hr(r,null,l,p)):on(i,r,l,p),r.memoizedState=b.state,i=r.child):i=fa(i,r,p),i}function Ay(i,r,l,u){return Br(),r.flags|=256,on(i,r,l,u),r.child}var sh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lh(i){return{baseLanes:i,cachePool:yb()}}function oh(i,r,l){return i=i!==null?i.childLanes&~l:0,r&&(i|=Jn),i}function Oy(i,r,l){var u=r.pendingProps,p=!1,b=(r.flags&128)!==0,E;if((E=b)||(E=i!==null&&i.memoizedState===null?!1:(Pt.current&2)!==0),E&&(p=!0,r.flags&=-129),E=(r.flags&32)!==0,r.flags&=-33,i===null){if(Je){if(p?Ha(r):Ka(),(i=_t)?(i=Bx(i,hi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:za!==null?{id:Ui,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},l=cb(i),l.return=r,r.child=l,sn=r,_t=null)):i=null,i===null)throw Ua(r);return Hh(i)?r.lanes=32:r.lanes=536870912,null}var N=u.children;return u=u.fallback,p?(Ka(),p=r.mode,N=du({mode:"hidden",children:N},p),u=zr(u,p,l,null),N.return=r,u.return=r,N.sibling=u,r.child=N,u=r.child,u.memoizedState=lh(l),u.childLanes=oh(i,E,l),r.memoizedState=sh,So(null,u)):(Ha(r),ch(r,N))}var I=i.memoizedState;if(I!==null&&(N=I.dehydrated,N!==null)){if(b)r.flags&256?(Ha(r),r.flags&=-257,r=uh(i,r,l)):r.memoizedState!==null?(Ka(),r.child=i.child,r.flags|=128,r=null):(Ka(),N=u.fallback,p=r.mode,u=du({mode:"visible",children:u.children},p),N=zr(N,p,l,null),N.flags|=2,u.return=r,N.return=r,u.sibling=N,r.child=u,Hr(r,i.child,null,l),u=r.child,u.memoizedState=lh(l),u.childLanes=oh(i,E,l),r.memoizedState=sh,r=So(null,u));else if(Ha(r),Hh(N)){if(E=N.nextSibling&&N.nextSibling.dataset,E)var Y=E.dgst;E=Y,u=Error(a(419)),u.stack="",u.digest=E,co({value:u,source:null,stack:null}),r=uh(i,r,l)}else if(Vt||Ls(i,r,l,!1),E=(l&i.childLanes)!==0,Vt||E){if(E=yt,E!==null&&(u=Ut(E,l),u!==0&&u!==I.retryLane))throw I.retryLane=u,Ir(i,u),In(E,i,u),ah;qh(N)||Eu(),r=uh(i,r,l)}else qh(N)?(r.flags|=192,r.child=i.child,r=null):(i=I.treeContext,_t=pi(N.nextSibling),sn=r,Je=!0,Ba=null,hi=!1,i!==null&&db(r,i),r=ch(r,u.children),r.flags|=4096);return r}return p?(Ka(),N=u.fallback,p=r.mode,I=i.child,Y=I.sibling,u=ra(I,{mode:"hidden",children:u.children}),u.subtreeFlags=I.subtreeFlags&65011712,Y!==null?N=ra(Y,N):(N=zr(N,p,l,null),N.flags|=2),N.return=r,u.return=r,u.sibling=N,r.child=u,So(null,u),u=r.child,N=i.child.memoizedState,N===null?N=lh(l):(p=N.cachePool,p!==null?(I=Qt._currentValue,p=p.parent!==I?{parent:I,pool:I}:p):p=yb(),N={baseLanes:N.baseLanes|l,cachePool:p}),u.memoizedState=N,u.childLanes=oh(i,E,l),r.memoizedState=sh,So(i.child,u)):(Ha(r),l=i.child,i=l.sibling,l=ra(l,{mode:"visible",children:u.children}),l.return=r,l.sibling=null,i!==null&&(E=r.deletions,E===null?(r.deletions=[i],r.flags|=16):E.push(i)),r.child=l,r.memoizedState=null,l)}function ch(i,r){return r=du({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function du(i,r){return i=Vn(22,i,null,r),i.lanes=0,i}function uh(i,r,l){return Hr(r,i.child,null,l),i=ch(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function Ry(i,r,l){i.lanes|=r;var u=i.alternate;u!==null&&(u.lanes|=r),kd(i.return,r,l)}function fh(i,r,l,u,p,b){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:p,treeForkCount:b}:(E.isBackwards=r,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=l,E.tailMode=p,E.treeForkCount=b)}function My(i,r,l){var u=r.pendingProps,p=u.revealOrder,b=u.tail;u=u.children;var E=Pt.current,N=(E&2)!==0;if(N?(E=E&1|2,r.flags|=128):E&=1,C(Pt,E),on(i,r,u,l),u=Je?oo:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Ry(i,l,r);else if(i.tag===19)Ry(i,l,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(p){case"forwards":for(l=r.child,p=null;l!==null;)i=l.alternate,i!==null&&eu(i)===null&&(p=l),l=l.sibling;l=p,l===null?(p=r.child,r.child=null):(p=l.sibling,l.sibling=null),fh(r,!1,p,l,b,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=r.child,r.child=null;p!==null;){if(i=p.alternate,i!==null&&eu(i)===null){r.child=p;break}i=p.sibling,p.sibling=l,l=p,p=i}fh(r,!0,l,null,b,u);break;case"together":fh(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function fa(i,r,l){if(i!==null&&(r.dependencies=i.dependencies),Ya|=r.lanes,(l&r.childLanes)===0)if(i!==null){if(Ls(i,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(a(153));if(r.child!==null){for(i=r.child,l=ra(i,i.pendingProps),r.child=l,l.return=r;i.sibling!==null;)i=i.sibling,l=l.sibling=ra(i,i.pendingProps),l.return=r;l.sibling=null}return r.child}function dh(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Gc(i)))}function z_(i,r,l){switch(r.tag){case 3:ke(r,r.stateNode.containerInfo),Fa(r,Qt,i.memoizedState.cache),Br();break;case 27:case 5:Dt(r);break;case 4:ke(r,r.stateNode.containerInfo);break;case 10:Fa(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,zd(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Ha(r),r.flags|=128,null):(l&r.child.childLanes)!==0?Oy(i,r,l):(Ha(r),i=fa(i,r,l),i!==null?i.sibling:null);Ha(r);break;case 19:var p=(i.flags&128)!==0;if(u=(l&r.childLanes)!==0,u||(Ls(i,r,l,!1),u=(l&r.childLanes)!==0),p){if(u)return My(i,r,l);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),C(Pt,Pt.current),u)break;return null;case 22:return r.lanes=0,_y(i,r,l,r.pendingProps);case 24:Fa(r,Qt,i.memoizedState.cache)}return fa(i,r,l)}function jy(i,r,l){if(i!==null)if(i.memoizedProps!==r.pendingProps)Vt=!0;else{if(!dh(i,l)&&(r.flags&128)===0)return Vt=!1,z_(i,r,l);Vt=(i.flags&131072)!==0}else Vt=!1,Je&&(r.flags&1048576)!==0&&fb(r,oo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(i=Pr(r.elementType),r.type=i,typeof i=="function")bd(i)?(u=Gr(i,u),r.tag=1,r=Cy(null,r,i,u,l)):(r.tag=0,r=rh(null,r,i,u,l));else{if(i!=null){var p=i.$$typeof;if(p===D){r.tag=11,r=Ey(null,r,i,u,l);break e}else if(p===q){r.tag=14,r=Sy(null,r,i,u,l);break e}}throw r=ae(i)||i,Error(a(306,r,""))}}return r;case 0:return rh(i,r,r.type,r.pendingProps,l);case 1:return u=r.type,p=Gr(u,r.pendingProps),Cy(i,r,u,p,l);case 3:e:{if(ke(r,r.stateNode.containerInfo),i===null)throw Error(a(387));u=r.pendingProps;var b=r.memoizedState;p=b.element,Md(i,r),bo(r,u,null,l);var E=r.memoizedState;if(u=E.cache,Fa(r,Qt,u),u!==b.cache&&Nd(r,[Qt],l,!0),go(),u=E.element,b.isDehydrated)if(b={element:u,isDehydrated:!1,cache:E.cache},r.updateQueue.baseState=b,r.memoizedState=b,r.flags&256){r=Ay(i,r,u,l);break e}else if(u!==p){p=ui(Error(a(424)),r),co(p),r=Ay(i,r,u,l);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(_t=pi(i.firstChild),sn=r,Je=!0,Ba=null,hi=!0,l=_b(r,null,u,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Br(),u===p){r=fa(i,r,l);break e}on(i,r,u,l)}r=r.child}return r;case 26:return fu(i,r),i===null?(l=Hx(r.type,null,r.pendingProps,null))?r.memoizedState=l:Je||(l=r.type,i=r.pendingProps,u=Cu(ve.current).createElement(l),u[Ft]=r,u[fn]=i,cn(u,l,i),Kt(u),r.stateNode=u):r.memoizedState=Hx(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Dt(r),i===null&&Je&&(u=r.stateNode=$x(r.type,r.pendingProps,ve.current),sn=r,hi=!0,p=_t,Ja(r.type)?(Kh=p,_t=pi(u.firstChild)):_t=p),on(i,r,r.pendingProps.children,l),fu(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&Je&&((p=u=_t)&&(u=hk(u,r.type,r.pendingProps,hi),u!==null?(r.stateNode=u,sn=r,_t=pi(u.firstChild),hi=!1,p=!0):p=!1),p||Ua(r)),Dt(r),p=r.type,b=r.pendingProps,E=i!==null?i.memoizedProps:null,u=b.children,Fh(p,b)?u=null:E!==null&&Fh(p,E)&&(r.flags|=32),r.memoizedState!==null&&(p=Ud(i,r,C_,null,null,l),zo._currentValue=p),fu(i,r),on(i,r,u,l),r.child;case 6:return i===null&&Je&&((i=l=_t)&&(l=mk(l,r.pendingProps,hi),l!==null?(r.stateNode=l,sn=r,_t=null,i=!0):i=!1),i||Ua(r)),null;case 13:return Oy(i,r,l);case 4:return ke(r,r.stateNode.containerInfo),u=r.pendingProps,i===null?r.child=Hr(r,null,u,l):on(i,r,u,l),r.child;case 11:return Ey(i,r,r.type,r.pendingProps,l);case 7:return on(i,r,r.pendingProps,l),r.child;case 8:return on(i,r,r.pendingProps.children,l),r.child;case 12:return on(i,r,r.pendingProps.children,l),r.child;case 10:return u=r.pendingProps,Fa(r,r.type,u.value),on(i,r,u.children,l),r.child;case 9:return p=r.type._context,u=r.pendingProps.children,Fr(r),p=ln(p),u=u(p),r.flags|=1,on(i,r,u,l),r.child;case 14:return Sy(i,r,r.type,r.pendingProps,l);case 15:return wy(i,r,r.type,r.pendingProps,l);case 19:return My(i,r,l);case 31:return I_(i,r,l);case 22:return _y(i,r,l,r.pendingProps);case 24:return Fr(r),u=ln(Qt),i===null?(p=Ad(),p===null&&(p=yt,b=Td(),p.pooledCache=b,b.refCount++,b!==null&&(p.pooledCacheLanes|=l),p=b),r.memoizedState={parent:u,cache:p},Rd(r),Fa(r,Qt,p)):((i.lanes&l)!==0&&(Md(i,r),bo(r,null,null,l),go()),p=i.memoizedState,b=r.memoizedState,p.parent!==u?(p={parent:u,cache:u},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Fa(r,Qt,u)):(u=b.cache,Fa(r,Qt,u),u!==p.cache&&Nd(r,[Qt],l,!0))),on(i,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function da(i){i.flags|=4}function hh(i,r,l,u,p){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(p&335544128)===p)if(i.stateNode.complete)i.flags|=8192;else if(sx())i.flags|=8192;else throw qr=Xc,Od}else i.flags&=-16777217}function Dy(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Vx(r))if(sx())i.flags|=8192;else throw qr=Xc,Od}function hu(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Le():536870912,i.lanes|=r,Qs|=r)}function wo(i,r){if(!Je)switch(i.tailMode){case"hidden":r=i.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?i.tail=null:l.sibling=null;break;case"collapsed":l=i.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function kt(i){var r=i.alternate!==null&&i.alternate.child===i.child,l=0,u=0;if(r)for(var p=i.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=u,i.childLanes=l,r}function B_(i,r,l){var u=r.pendingProps;switch(Ed(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(r),null;case 1:return kt(r),null;case 3:return l=r.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),oa(Qt),Ke(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(i===null||i.child===null)&&(Ds(r)?da(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,wd())),kt(r),null;case 26:var p=r.type,b=r.memoizedState;return i===null?(da(r),b!==null?(kt(r),Dy(r,b)):(kt(r),hh(r,p,null,u,l))):b?b!==i.memoizedState?(da(r),kt(r),Dy(r,b)):(kt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==u&&da(r),kt(r),hh(r,p,i,u,l)),null;case 27:if(yn(r),l=ve.current,p=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&da(r);else{if(!u){if(r.stateNode===null)throw Error(a(166));return kt(r),null}i=me.current,Ds(r)?hb(r):(i=$x(p,u,l),r.stateNode=i,da(r))}return kt(r),null;case 5:if(yn(r),p=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&da(r);else{if(!u){if(r.stateNode===null)throw Error(a(166));return kt(r),null}if(b=me.current,Ds(r))hb(r);else{var E=Cu(ve.current);switch(b){case 1:b=E.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:b=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":b=E.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":b=E.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":b=E.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?b.multiple=!0:u.size&&(b.size=u.size);break;default:b=typeof u.is=="string"?E.createElement(p,{is:u.is}):E.createElement(p)}}b[Ft]=r,b[fn]=u;e:for(E=r.child;E!==null;){if(E.tag===5||E.tag===6)b.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===r)break e;for(;E.sibling===null;){if(E.return===null||E.return===r)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}r.stateNode=b;e:switch(cn(b,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&da(r)}}return kt(r),hh(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,l),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==u&&da(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(a(166));if(i=ve.current,Ds(r)){if(i=r.stateNode,l=r.memoizedProps,u=null,p=sn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}i[Ft]=r,i=!!(i.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||Ox(i.nodeValue,l)),i||Ua(r,!0)}else i=Cu(i).createTextNode(u),i[Ft]=r,r.stateNode=i}return kt(r),null;case 31:if(l=r.memoizedState,i===null||i.memoizedState!==null){if(u=Ds(r),l!==null){if(i===null){if(!u)throw Error(a(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(557));i[Ft]=r}else Br(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;kt(r),i=!1}else l=wd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=l),i=!0;if(!i)return r.flags&256?(Zn(r),r):(Zn(r),null);if((r.flags&128)!==0)throw Error(a(558))}return kt(r),null;case 13:if(u=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(p=Ds(r),u!==null&&u.dehydrated!==null){if(i===null){if(!p)throw Error(a(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Ft]=r}else Br(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;kt(r),p=!1}else p=wd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(Zn(r),r):(Zn(r),null)}return Zn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=u!==null,i=i!==null&&i.memoizedState!==null,l&&(u=r.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),b=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(b=u.memoizedState.cachePool.pool),b!==p&&(u.flags|=2048)),l!==i&&l&&(r.child.flags|=8192),hu(r,r.updateQueue),kt(r),null);case 4:return Ke(),i===null&&Lh(r.stateNode.containerInfo),kt(r),null;case 10:return oa(r.type),kt(r),null;case 19:if(J(Pt),u=r.memoizedState,u===null)return kt(r),null;if(p=(r.flags&128)!==0,b=u.rendering,b===null)if(p)wo(u,!1);else{if(zt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(b=eu(i),b!==null){for(r.flags|=128,wo(u,!1),i=b.updateQueue,r.updateQueue=i,hu(r,i),r.subtreeFlags=0,i=l,l=r.child;l!==null;)ob(l,i),l=l.sibling;return C(Pt,Pt.current&1|2),Je&&sa(r,u.treeForkCount),r.child}i=i.sibling}u.tail!==null&&Ot()>yu&&(r.flags|=128,p=!0,wo(u,!1),r.lanes=4194304)}else{if(!p)if(i=eu(b),i!==null){if(r.flags|=128,p=!0,i=i.updateQueue,r.updateQueue=i,hu(r,i),wo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!b.alternate&&!Je)return kt(r),null}else 2*Ot()-u.renderingStartTime>yu&&l!==536870912&&(r.flags|=128,p=!0,wo(u,!1),r.lanes=4194304);u.isBackwards?(b.sibling=r.child,r.child=b):(i=u.last,i!==null?i.sibling=b:r.child=b,u.last=b)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=Ot(),i.sibling=null,l=Pt.current,C(Pt,p?l&1|2:l&1),Je&&sa(r,u.treeForkCount),i):(kt(r),null);case 22:case 23:return Zn(r),Id(),u=r.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(l&536870912)!==0&&(r.flags&128)===0&&(kt(r),r.subtreeFlags&6&&(r.flags|=8192)):kt(r),l=r.updateQueue,l!==null&&hu(r,l.retryQueue),l=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==l&&(r.flags|=2048),i!==null&&J($r),null;case 24:return l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),oa(Qt),kt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function U_(i,r){switch(Ed(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return oa(Qt),Ke(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return yn(r),null;case 31:if(r.memoizedState!==null){if(Zn(r),r.alternate===null)throw Error(a(340));Br()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Zn(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(a(340));Br()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return J(Pt),null;case 4:return Ke(),null;case 10:return oa(r.type),null;case 22:case 23:return Zn(r),Id(),i!==null&&J($r),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return oa(Qt),null;case 25:return null;default:return null}}function Ly(i,r){switch(Ed(r),r.tag){case 3:oa(Qt),Ke();break;case 26:case 27:case 5:yn(r);break;case 4:Ke();break;case 31:r.memoizedState!==null&&Zn(r);break;case 13:Zn(r);break;case 19:J(Pt);break;case 10:oa(r.type);break;case 22:case 23:Zn(r),Id(),i!==null&&J($r);break;case 24:oa(Qt)}}function _o(i,r){try{var l=r.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var p=u.next;l=p;do{if((l.tag&i)===i){u=void 0;var b=l.create,E=l.inst;u=b(),E.destroy=u}l=l.next}while(l!==p)}}catch(N){dt(r,r.return,N)}}function Ga(i,r,l){try{var u=r.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var b=p.next;u=b;do{if((u.tag&i)===i){var E=u.inst,N=E.destroy;if(N!==void 0){E.destroy=void 0,p=r;var I=l,Y=N;try{Y()}catch(ne){dt(p,I,ne)}}}u=u.next}while(u!==b)}}catch(ne){dt(r,r.return,ne)}}function Iy(i){var r=i.updateQueue;if(r!==null){var l=i.stateNode;try{Nb(r,l)}catch(u){dt(i,i.return,u)}}}function zy(i,r,l){l.props=Gr(i.type,i.memoizedProps),l.state=i.memoizedState;try{l.componentWillUnmount()}catch(u){dt(i,r,u)}}function ko(i,r){try{var l=i.ref;if(l!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof l=="function"?i.refCleanup=l(u):l.current=u}}catch(p){dt(i,r,p)}}function $i(i,r){var l=i.ref,u=i.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(p){dt(i,r,p)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){dt(i,r,p)}else l.current=null}function By(i){var r=i.type,l=i.memoizedProps,u=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(p){dt(i,i.return,p)}}function mh(i,r,l){try{var u=i.stateNode;lk(u,i.type,l,r),u[fn]=r}catch(p){dt(i,i.return,p)}}function Uy(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ja(i.type)||i.tag===4}function ph(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Uy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ja(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function gh(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(i,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(i),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=he));else if(u!==4&&(u===27&&Ja(i.type)&&(l=i.stateNode,r=null),i=i.child,i!==null))for(gh(i,r,l),i=i.sibling;i!==null;)gh(i,r,l),i=i.sibling}function mu(i,r,l){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?l.insertBefore(i,r):l.appendChild(i);else if(u!==4&&(u===27&&Ja(i.type)&&(l=i.stateNode),i=i.child,i!==null))for(mu(i,r,l),i=i.sibling;i!==null;)mu(i,r,l),i=i.sibling}function Fy(i){var r=i.stateNode,l=i.memoizedProps;try{for(var u=i.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);cn(r,u,l),r[Ft]=i,r[fn]=l}catch(b){dt(i,i.return,b)}}var ha=!1,Xt=!1,bh=!1,$y=typeof WeakSet=="function"?WeakSet:Set,tn=null;function F_(i,r){if(i=i.containerInfo,Bh=Lu,i=Jg(i),ud(i)){if("selectionStart"in i)var l={start:i.selectionStart,end:i.selectionEnd};else e:{l=(l=i.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var p=u.anchorOffset,b=u.focusNode;u=u.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var E=0,N=-1,I=-1,Y=0,ne=0,se=i,X=null;t:for(;;){for(var ee;se!==l||p!==0&&se.nodeType!==3||(N=E+p),se!==b||u!==0&&se.nodeType!==3||(I=E+u),se.nodeType===3&&(E+=se.nodeValue.length),(ee=se.firstChild)!==null;)X=se,se=ee;for(;;){if(se===i)break t;if(X===l&&++Y===p&&(N=E),X===b&&++ne===u&&(I=E),(ee=se.nextSibling)!==null)break;se=X,X=se.parentNode}se=ee}l=N===-1||I===-1?null:{start:N,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Uh={focusedElem:i,selectionRange:l},Lu=!1,tn=r;tn!==null;)if(r=tn,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,tn=i;else for(;tn!==null;){switch(r=tn,b=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(l=0;l<i.length;l++)p=i[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&b!==null){i=void 0,l=r,p=b.memoizedProps,b=b.memoizedState,u=l.stateNode;try{var xe=Gr(l.type,p);i=u.getSnapshotBeforeUpdate(xe,b),u.__reactInternalSnapshotBeforeUpdate=i}catch(Re){dt(l,l.return,Re)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,l=i.nodeType,l===9)Ph(i);else if(l===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Ph(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(a(163))}if(i=r.sibling,i!==null){i.return=r.return,tn=i;break}tn=r.return}}function Py(i,r,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:pa(i,l),u&4&&_o(5,l);break;case 1:if(pa(i,l),u&4)if(i=l.stateNode,r===null)try{i.componentDidMount()}catch(E){dt(l,l.return,E)}else{var p=Gr(l.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(p,r,i.__reactInternalSnapshotBeforeUpdate)}catch(E){dt(l,l.return,E)}}u&64&&Iy(l),u&512&&ko(l,l.return);break;case 3:if(pa(i,l),u&64&&(i=l.updateQueue,i!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{Nb(i,r)}catch(E){dt(l,l.return,E)}}break;case 27:r===null&&u&4&&Fy(l);case 26:case 5:pa(i,l),r===null&&u&4&&By(l),u&512&&ko(l,l.return);break;case 12:pa(i,l);break;case 31:pa(i,l),u&4&&Ky(i,l);break;case 13:pa(i,l),u&4&&Gy(i,l),u&64&&(i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(l=V_.bind(null,l),pk(i,l))));break;case 22:if(u=l.memoizedState!==null||ha,!u){r=r!==null&&r.memoizedState!==null||Xt,p=ha;var b=Xt;ha=u,(Xt=r)&&!b?ga(i,l,(l.subtreeFlags&8772)!==0):pa(i,l),ha=p,Xt=b}break;case 30:break;default:pa(i,l)}}function qy(i){var r=i.alternate;r!==null&&(i.alternate=null,qy(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Yl(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Tt=null,Mn=!1;function ma(i,r,l){for(l=l.child;l!==null;)Hy(i,r,l),l=l.sibling}function Hy(i,r,l){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(an,l)}catch{}switch(l.tag){case 26:Xt||$i(l,r),ma(i,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Xt||$i(l,r);var u=Tt,p=Mn;Ja(l.type)&&(Tt=l.stateNode,Mn=!1),ma(i,r,l),Do(l.stateNode),Tt=u,Mn=p;break;case 5:Xt||$i(l,r);case 6:if(u=Tt,p=Mn,Tt=null,ma(i,r,l),Tt=u,Mn=p,Tt!==null)if(Mn)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(l.stateNode)}catch(b){dt(l,r,b)}else try{Tt.removeChild(l.stateNode)}catch(b){dt(l,r,b)}break;case 18:Tt!==null&&(Mn?(i=Tt,Ix(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,l.stateNode),tl(i)):Ix(Tt,l.stateNode));break;case 4:u=Tt,p=Mn,Tt=l.stateNode.containerInfo,Mn=!0,ma(i,r,l),Tt=u,Mn=p;break;case 0:case 11:case 14:case 15:Ga(2,l,r),Xt||Ga(4,l,r),ma(i,r,l);break;case 1:Xt||($i(l,r),u=l.stateNode,typeof u.componentWillUnmount=="function"&&zy(l,r,u)),ma(i,r,l);break;case 21:ma(i,r,l);break;case 22:Xt=(u=Xt)||l.memoizedState!==null,ma(i,r,l),Xt=u;break;default:ma(i,r,l)}}function Ky(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{tl(i)}catch(l){dt(r,r.return,l)}}}function Gy(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{tl(i)}catch(l){dt(r,r.return,l)}}function $_(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new $y),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new $y),r;default:throw Error(a(435,i.tag))}}function pu(i,r){var l=$_(i);r.forEach(function(u){if(!l.has(u)){l.add(u);var p=X_.bind(null,i,u);u.then(p,p)}})}function jn(i,r){var l=r.deletions;if(l!==null)for(var u=0;u<l.length;u++){var p=l[u],b=i,E=r,N=E;e:for(;N!==null;){switch(N.tag){case 27:if(Ja(N.type)){Tt=N.stateNode,Mn=!1;break e}break;case 5:Tt=N.stateNode,Mn=!1;break e;case 3:case 4:Tt=N.stateNode.containerInfo,Mn=!0;break e}N=N.return}if(Tt===null)throw Error(a(160));Hy(b,E,p),Tt=null,Mn=!1,b=p.alternate,b!==null&&(b.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Qy(r,i),r=r.sibling}var Ti=null;function Qy(i,r){var l=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:jn(r,i),Dn(i),u&4&&(Ga(3,i,i.return),_o(3,i),Ga(5,i,i.return));break;case 1:jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),u&64&&ha&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(l=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var p=Ti;if(jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),u&4){var b=l!==null?l.memoizedState:null;if(u=i.memoizedState,l===null)if(u===null)if(i.stateNode===null){e:{u=i.type,l=i.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":b=p.getElementsByTagName("title")[0],(!b||b[Or]||b[Ft]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=p.createElement(u),p.head.insertBefore(b,p.querySelector("head > title"))),cn(b,u,l),b[Ft]=i,Kt(b),u=b;break e;case"link":var E=Qx("link","href",p).get(u+(l.href||""));if(E){for(var N=0;N<E.length;N++)if(b=E[N],b.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&b.getAttribute("rel")===(l.rel==null?null:l.rel)&&b.getAttribute("title")===(l.title==null?null:l.title)&&b.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){E.splice(N,1);break t}}b=p.createElement(u),cn(b,u,l),p.head.appendChild(b);break;case"meta":if(E=Qx("meta","content",p).get(u+(l.content||""))){for(N=0;N<E.length;N++)if(b=E[N],b.getAttribute("content")===(l.content==null?null:""+l.content)&&b.getAttribute("name")===(l.name==null?null:l.name)&&b.getAttribute("property")===(l.property==null?null:l.property)&&b.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&b.getAttribute("charset")===(l.charSet==null?null:l.charSet)){E.splice(N,1);break t}}b=p.createElement(u),cn(b,u,l),p.head.appendChild(b);break;default:throw Error(a(468,u))}b[Ft]=i,Kt(b),u=b}i.stateNode=u}else Yx(p,i.type,i.stateNode);else i.stateNode=Gx(p,u,i.memoizedProps);else b!==u?(b===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):b.count--,u===null?Yx(p,i.type,i.stateNode):Gx(p,u,i.memoizedProps)):u===null&&i.stateNode!==null&&mh(i,i.memoizedProps,l.memoizedProps)}break;case 27:jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),l!==null&&u&4&&mh(i,i.memoizedProps,l.memoizedProps);break;case 5:if(jn(r,i),Dn(i),u&512&&(Xt||l===null||$i(l,l.return)),i.flags&32){p=i.stateNode;try{je(p,"")}catch(xe){dt(i,i.return,xe)}}u&4&&i.stateNode!=null&&(p=i.memoizedProps,mh(i,p,l!==null?l.memoizedProps:p)),u&1024&&(bh=!0);break;case 6:if(jn(r,i),Dn(i),u&4){if(i.stateNode===null)throw Error(a(162));u=i.memoizedProps,l=i.stateNode;try{l.nodeValue=u}catch(xe){dt(i,i.return,xe)}}break;case 3:if(Ru=null,p=Ti,Ti=Au(r.containerInfo),jn(r,i),Ti=p,Dn(i),u&4&&l!==null&&l.memoizedState.isDehydrated)try{tl(r.containerInfo)}catch(xe){dt(i,i.return,xe)}bh&&(bh=!1,Yy(i));break;case 4:u=Ti,Ti=Au(i.stateNode.containerInfo),jn(r,i),Dn(i),Ti=u;break;case 12:jn(r,i),Dn(i);break;case 31:jn(r,i),Dn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,pu(i,u)));break;case 13:jn(r,i),Dn(i),i.child.flags&8192&&i.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(bu=Ot()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,pu(i,u)));break;case 22:p=i.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,Y=ha,ne=Xt;if(ha=Y||p,Xt=ne||I,jn(r,i),Xt=ne,ha=Y,Dn(i),u&8192)e:for(r=i.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(l===null||I||ha||Xt||Qr(i)),l=null,r=i;;){if(r.tag===5||r.tag===26){if(l===null){I=l=r;try{if(b=I.stateNode,p)E=b.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{N=I.stateNode;var se=I.memoizedProps.style,X=se!=null&&se.hasOwnProperty("display")?se.display:null;N.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(xe){dt(I,I.return,xe)}}}else if(r.tag===6){if(l===null){I=r;try{I.stateNode.nodeValue=p?"":I.memoizedProps}catch(xe){dt(I,I.return,xe)}}}else if(r.tag===18){if(l===null){I=r;try{var ee=I.stateNode;p?zx(ee,!0):zx(I.stateNode,!1)}catch(xe){dt(I,I.return,xe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=i.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,pu(i,l))));break;case 19:jn(r,i),Dn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,pu(i,u)));break;case 30:break;case 21:break;default:jn(r,i),Dn(i)}}function Dn(i){var r=i.flags;if(r&2){try{for(var l,u=i.return;u!==null;){if(Uy(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,b=ph(i);mu(i,b,p);break;case 5:var E=l.stateNode;l.flags&32&&(je(E,""),l.flags&=-33);var N=ph(i);mu(i,N,E);break;case 3:case 4:var I=l.stateNode.containerInfo,Y=ph(i);gh(i,Y,I);break;default:throw Error(a(161))}}catch(ne){dt(i,i.return,ne)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function Yy(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;Yy(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function pa(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Py(i,r.alternate,r),r=r.sibling}function Qr(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Ga(4,r,r.return),Qr(r);break;case 1:$i(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&zy(r,r.return,l),Qr(r);break;case 27:Do(r.stateNode);case 26:case 5:$i(r,r.return),Qr(r);break;case 22:r.memoizedState===null&&Qr(r);break;case 30:Qr(r);break;default:Qr(r)}i=i.sibling}}function ga(i,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,p=i,b=r,E=b.flags;switch(b.tag){case 0:case 11:case 15:ga(p,b,l),_o(4,b);break;case 1:if(ga(p,b,l),u=b,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Y){dt(u,u.return,Y)}if(u=b,p=u.updateQueue,p!==null){var N=u.stateNode;try{var I=p.shared.hiddenCallbacks;if(I!==null)for(p.shared.hiddenCallbacks=null,p=0;p<I.length;p++)kb(I[p],N)}catch(Y){dt(u,u.return,Y)}}l&&E&64&&Iy(b),ko(b,b.return);break;case 27:Fy(b);case 26:case 5:ga(p,b,l),l&&u===null&&E&4&&By(b),ko(b,b.return);break;case 12:ga(p,b,l);break;case 31:ga(p,b,l),l&&E&4&&Ky(p,b);break;case 13:ga(p,b,l),l&&E&4&&Gy(p,b);break;case 22:b.memoizedState===null&&ga(p,b,l),ko(b,b.return);break;case 30:break;default:ga(p,b,l)}r=r.sibling}}function yh(i,r){var l=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==l&&(i!=null&&i.refCount++,l!=null&&uo(l))}function xh(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&uo(i))}function Ci(i,r,l,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Vy(i,r,l,u),r=r.sibling}function Vy(i,r,l,u){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Ci(i,r,l,u),p&2048&&_o(9,r);break;case 1:Ci(i,r,l,u);break;case 3:Ci(i,r,l,u),p&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&uo(i)));break;case 12:if(p&2048){Ci(i,r,l,u),i=r.stateNode;try{var b=r.memoizedProps,E=b.id,N=b.onPostCommit;typeof N=="function"&&N(E,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(I){dt(r,r.return,I)}}else Ci(i,r,l,u);break;case 31:Ci(i,r,l,u);break;case 13:Ci(i,r,l,u);break;case 23:break;case 22:b=r.stateNode,E=r.alternate,r.memoizedState!==null?b._visibility&2?Ci(i,r,l,u):No(i,r):b._visibility&2?Ci(i,r,l,u):(b._visibility|=2,Hs(i,r,l,u,(r.subtreeFlags&10256)!==0||!1)),p&2048&&yh(E,r);break;case 24:Ci(i,r,l,u),p&2048&&xh(r.alternate,r);break;default:Ci(i,r,l,u)}}function Hs(i,r,l,u,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var b=i,E=r,N=l,I=u,Y=E.flags;switch(E.tag){case 0:case 11:case 15:Hs(b,E,N,I,p),_o(8,E);break;case 23:break;case 22:var ne=E.stateNode;E.memoizedState!==null?ne._visibility&2?Hs(b,E,N,I,p):No(b,E):(ne._visibility|=2,Hs(b,E,N,I,p)),p&&Y&2048&&yh(E.alternate,E);break;case 24:Hs(b,E,N,I,p),p&&Y&2048&&xh(E.alternate,E);break;default:Hs(b,E,N,I,p)}r=r.sibling}}function No(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=i,u=r,p=u.flags;switch(u.tag){case 22:No(l,u),p&2048&&yh(u.alternate,u);break;case 24:No(l,u),p&2048&&xh(u.alternate,u);break;default:No(l,u)}r=r.sibling}}var To=8192;function Ks(i,r,l){if(i.subtreeFlags&To)for(i=i.child;i!==null;)Xy(i,r,l),i=i.sibling}function Xy(i,r,l){switch(i.tag){case 26:Ks(i,r,l),i.flags&To&&i.memoizedState!==null&&Tk(l,Ti,i.memoizedState,i.memoizedProps);break;case 5:Ks(i,r,l);break;case 3:case 4:var u=Ti;Ti=Au(i.stateNode.containerInfo),Ks(i,r,l),Ti=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=To,To=16777216,Ks(i,r,l),To=u):Ks(i,r,l));break;default:Ks(i,r,l)}}function Zy(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function Co(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];tn=u,Jy(u,i)}Zy(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Wy(i),i=i.sibling}function Wy(i){switch(i.tag){case 0:case 11:case 15:Co(i),i.flags&2048&&Ga(9,i,i.return);break;case 3:Co(i);break;case 12:Co(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,gu(i)):Co(i);break;default:Co(i)}}function gu(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var u=r[l];tn=u,Jy(u,i)}Zy(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Ga(8,r,r.return),gu(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,gu(r));break;default:gu(r)}i=i.sibling}}function Jy(i,r){for(;tn!==null;){var l=tn;switch(l.tag){case 0:case 11:case 15:Ga(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:uo(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,tn=u;else e:for(l=i;tn!==null;){u=tn;var p=u.sibling,b=u.return;if(qy(u),u===l){tn=null;break e}if(p!==null){p.return=b,tn=p;break e}tn=b}}}var P_={getCacheForType:function(i){var r=ln(Qt),l=r.data.get(i);return l===void 0&&(l=i(),r.data.set(i,l)),l},cacheSignal:function(){return ln(Qt).controller.signal}},q_=typeof WeakMap=="function"?WeakMap:Map,rt=0,yt=null,Ge=null,Xe=0,ft=0,Wn=null,Qa=!1,Gs=!1,vh=!1,ba=0,zt=0,Ya=0,Yr=0,Eh=0,Jn=0,Qs=0,Ao=null,Ln=null,Sh=!1,bu=0,ex=0,yu=1/0,xu=null,Va=null,Jt=0,Xa=null,Ys=null,ya=0,wh=0,_h=null,tx=null,Oo=0,kh=null;function ei(){return(rt&2)!==0&&Xe!==0?Xe&-Xe:K.T!==null?Rh():vs()}function nx(){if(Jn===0)if((Xe&536870912)===0||Je){var i=xs;xs<<=1,(xs&3932160)===0&&(xs=262144),Jn=i}else Jn=536870912;return i=Xn.current,i!==null&&(i.flags|=32),Jn}function In(i,r,l){(i===yt&&(ft===2||ft===9)||i.cancelPendingCommit!==null)&&(Vs(i,0),Za(i,Xe,Jn,!1)),bt(i,l),((rt&2)===0||i!==yt)&&(i===yt&&((rt&2)===0&&(Yr|=l),zt===4&&Za(i,Xe,Jn,!1)),Pi(i))}function ix(i,r,l){if((rt&6)!==0)throw Error(a(327));var u=!l&&(r&127)===0&&(r&i.expiredLanes)===0||ie(i,r),p=u?G_(i,r):Th(i,r,!0),b=u;do{if(p===0){Gs&&!u&&Za(i,r,0,!1);break}else{if(l=i.current.alternate,b&&!H_(l)){p=Th(i,r,!1),b=!1;continue}if(p===2){if(b=r,i.errorRecoveryDisabledLanes&b)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){r=E;e:{var N=i;p=Ao;var I=N.current.memoizedState.isDehydrated;if(I&&(Vs(N,E).flags|=256),E=Th(N,E,!1),E!==2){if(vh&&!I){N.errorRecoveryDisabledLanes|=b,Yr|=b,p=4;break e}b=Ln,Ln=p,b!==null&&(Ln===null?Ln=b:Ln.push.apply(Ln,b))}p=E}if(b=!1,p!==2)continue}}if(p===1){Vs(i,0),Za(i,r,0,!0);break}e:{switch(u=i,b=p,b){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:Za(u,r,Jn,!Qa);break e;case 2:Ln=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(p=bu+300-Ot(),10<p)){if(Za(u,r,Jn,!Qa),B(u,0,!0)!==0)break e;ya=r,u.timeoutHandle=Dx(ax.bind(null,u,l,Ln,xu,Sh,r,Jn,Yr,Qs,Qa,b,"Throttled",-0,0),p);break e}ax(u,l,Ln,xu,Sh,r,Jn,Yr,Qs,Qa,b,null,-0,0)}}break}while(!0);Pi(i)}function ax(i,r,l,u,p,b,E,N,I,Y,ne,se,X,ee){if(i.timeoutHandle=-1,se=r.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:he},Xy(r,b,se);var xe=(b&62914560)===b?bu-Ot():(b&4194048)===b?ex-Ot():0;if(xe=Ck(se,xe),xe!==null){ya=b,i.cancelPendingCommit=xe(dx.bind(null,i,r,b,l,u,p,E,N,I,ne,se,null,X,ee)),Za(i,b,E,!Y);return}}dx(i,r,b,l,u,p,E,N,I)}function H_(i){for(var r=i;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var p=l[u],b=p.getSnapshot;p=p.value;try{if(!Yn(b(),p))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Za(i,r,l,u){r&=~Eh,r&=~Yr,i.suspendedLanes|=r,i.pingedLanes&=~r,u&&(i.warmLanes|=r),u=i.expirationTimes;for(var p=r;0<p;){var b=31-ot(p),E=1<<b;u[b]=-1,p&=~E}l!==0&&ye(i,l,r)}function vu(){return(rt&6)===0?(Ro(0),!1):!0}function Nh(){if(Ge!==null){if(ft===0)var i=Ge.return;else i=Ge,la=Ur=null,Pd(i),Us=null,ho=0,i=Ge;for(;i!==null;)Ly(i.alternate,i),i=i.return;Ge=null}}function Vs(i,r){var l=i.timeoutHandle;l!==-1&&(i.timeoutHandle=-1,uk(l)),l=i.cancelPendingCommit,l!==null&&(i.cancelPendingCommit=null,l()),ya=0,Nh(),yt=i,Ge=l=ra(i.current,null),Xe=r,ft=0,Wn=null,Qa=!1,Gs=ie(i,r),vh=!1,Qs=Jn=Eh=Yr=Ya=zt=0,Ln=Ao=null,Sh=!1,(r&8)!==0&&(r|=r&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=r;0<u;){var p=31-ot(u),b=1<<p;r|=i[p],u&=~b}return ba=r,$c(),l}function rx(i,r){Ue=null,K.H=Eo,r===Bs||r===Vc?(r=Eb(),ft=3):r===Od?(r=Eb(),ft=4):ft=r===ah?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Wn=r,Ge===null&&(zt=1,cu(i,ui(r,i.current)))}function sx(){var i=Xn.current;return i===null?!0:(Xe&4194048)===Xe?mi===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?i===mi:!1}function lx(){var i=K.H;return K.H=Eo,i===null?Eo:i}function ox(){var i=K.A;return K.A=P_,i}function Eu(){zt=4,Qa||(Xe&4194048)!==Xe&&Xn.current!==null||(Gs=!0),(Ya&134217727)===0&&(Yr&134217727)===0||yt===null||Za(yt,Xe,Jn,!1)}function Th(i,r,l){var u=rt;rt|=2;var p=lx(),b=ox();(yt!==i||Xe!==r)&&(xu=null,Vs(i,r)),r=!1;var E=zt;e:do try{if(ft!==0&&Ge!==null){var N=Ge,I=Wn;switch(ft){case 8:Nh(),E=6;break e;case 3:case 2:case 9:case 6:Xn.current===null&&(r=!0);var Y=ft;if(ft=0,Wn=null,Xs(i,N,I,Y),l&&Gs){E=0;break e}break;default:Y=ft,ft=0,Wn=null,Xs(i,N,I,Y)}}K_(),E=zt;break}catch(ne){rx(i,ne)}while(!0);return r&&i.shellSuspendCounter++,la=Ur=null,rt=u,K.H=p,K.A=b,Ge===null&&(yt=null,Xe=0,$c()),E}function K_(){for(;Ge!==null;)cx(Ge)}function G_(i,r){var l=rt;rt|=2;var u=lx(),p=ox();yt!==i||Xe!==r?(xu=null,yu=Ot()+500,Vs(i,r)):Gs=ie(i,r);e:do try{if(ft!==0&&Ge!==null){r=Ge;var b=Wn;t:switch(ft){case 1:ft=0,Wn=null,Xs(i,r,b,1);break;case 2:case 9:if(xb(b)){ft=0,Wn=null,ux(r);break}r=function(){ft!==2&&ft!==9||yt!==i||(ft=7),Pi(i)},b.then(r,r);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:xb(b)?(ft=0,Wn=null,ux(r)):(ft=0,Wn=null,Xs(i,r,b,7));break;case 5:var E=null;switch(Ge.tag){case 26:E=Ge.memoizedState;case 5:case 27:var N=Ge;if(E?Vx(E):N.stateNode.complete){ft=0,Wn=null;var I=N.sibling;if(I!==null)Ge=I;else{var Y=N.return;Y!==null?(Ge=Y,Su(Y)):Ge=null}break t}}ft=0,Wn=null,Xs(i,r,b,5);break;case 6:ft=0,Wn=null,Xs(i,r,b,6);break;case 8:Nh(),zt=6;break e;default:throw Error(a(462))}}Q_();break}catch(ne){rx(i,ne)}while(!0);return la=Ur=null,K.H=u,K.A=p,rt=l,Ge!==null?0:(yt=null,Xe=0,$c(),zt)}function Q_(){for(;Ge!==null&&!Gl();)cx(Ge)}function cx(i){var r=jy(i.alternate,i,ba);i.memoizedProps=i.pendingProps,r===null?Su(i):Ge=r}function ux(i){var r=i,l=r.alternate;switch(r.tag){case 15:case 0:r=Ty(l,r,r.pendingProps,r.type,void 0,Xe);break;case 11:r=Ty(l,r,r.pendingProps,r.type.render,r.ref,Xe);break;case 5:Pd(r);default:Ly(l,r),r=Ge=ob(r,ba),r=jy(l,r,ba)}i.memoizedProps=i.pendingProps,r===null?Su(i):Ge=r}function Xs(i,r,l,u){la=Ur=null,Pd(r),Us=null,ho=0;var p=r.return;try{if(L_(i,p,r,l,Xe)){zt=1,cu(i,ui(l,i.current)),Ge=null;return}}catch(b){if(p!==null)throw Ge=p,b;zt=1,cu(i,ui(l,i.current)),Ge=null;return}r.flags&32768?(Je||u===1?i=!0:Gs||(Xe&536870912)!==0?i=!1:(Qa=i=!0,(u===2||u===9||u===3||u===6)&&(u=Xn.current,u!==null&&u.tag===13&&(u.flags|=16384))),fx(r,i)):Su(r)}function Su(i){var r=i;do{if((r.flags&32768)!==0){fx(r,Qa);return}i=r.return;var l=B_(r.alternate,r,ba);if(l!==null){Ge=l;return}if(r=r.sibling,r!==null){Ge=r;return}Ge=r=i}while(r!==null);zt===0&&(zt=5)}function fx(i,r){do{var l=U_(i.alternate,i);if(l!==null){l.flags&=32767,Ge=l;return}if(l=i.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(i=i.sibling,i!==null)){Ge=i;return}Ge=i=l}while(i!==null);zt=6,Ge=null}function dx(i,r,l,u,p,b,E,N,I){i.cancelPendingCommit=null;do wu();while(Jt!==0);if((rt&6)!==0)throw Error(a(327));if(r!==null){if(r===i.current)throw Error(a(177));if(b=r.lanes|r.childLanes,b|=pd,Ee(i,l,b,E,N,I),i===yt&&(Ge=yt=null,Xe=0),Ys=r,Xa=i,ya=l,wh=b,_h=p,tx=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Z_(Oe,function(){return bx(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=K.T,K.T=null,p=oe.p,oe.p=2,E=rt,rt|=4;try{F_(i,r,l)}finally{rt=E,oe.p=p,K.T=u}}Jt=1,hx(),mx(),px()}}function hx(){if(Jt===1){Jt=0;var i=Xa,r=Ys,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=K.T,K.T=null;var u=oe.p;oe.p=2;var p=rt;rt|=4;try{Qy(r,i);var b=Uh,E=Jg(i.containerInfo),N=b.focusedElem,I=b.selectionRange;if(E!==N&&N&&N.ownerDocument&&Wg(N.ownerDocument.documentElement,N)){if(I!==null&&ud(N)){var Y=I.start,ne=I.end;if(ne===void 0&&(ne=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ne,N.value.length);else{var se=N.ownerDocument||document,X=se&&se.defaultView||window;if(X.getSelection){var ee=X.getSelection(),xe=N.textContent.length,Re=Math.min(I.start,xe),pt=I.end===void 0?Re:Math.min(I.end,xe);!ee.extend&&Re>pt&&(E=pt,pt=Re,Re=E);var H=Zg(N,Re),F=Zg(N,pt);if(H&&F&&(ee.rangeCount!==1||ee.anchorNode!==H.node||ee.anchorOffset!==H.offset||ee.focusNode!==F.node||ee.focusOffset!==F.offset)){var Q=se.createRange();Q.setStart(H.node,H.offset),ee.removeAllRanges(),Re>pt?(ee.addRange(Q),ee.extend(F.node,F.offset)):(Q.setEnd(F.node,F.offset),ee.addRange(Q))}}}}for(se=[],ee=N;ee=ee.parentNode;)ee.nodeType===1&&se.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<se.length;N++){var re=se[N];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Lu=!!Bh,Uh=Bh=null}finally{rt=p,oe.p=u,K.T=l}}i.current=r,Jt=2}}function mx(){if(Jt===2){Jt=0;var i=Xa,r=Ys,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var u=oe.p;oe.p=2;var p=rt;rt|=4;try{Py(i,r.alternate,r)}finally{rt=p,oe.p=u,K.T=l}}Jt=3}}function px(){if(Jt===4||Jt===3){Jt=0,bs();var i=Xa,r=Ys,l=ya,u=tx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Jt=5:(Jt=0,Ys=Xa=null,gx(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(Va=null),ea(l),r=r.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(an,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=K.T,p=oe.p,oe.p=2,K.T=null;try{for(var b=i.onRecoverableError,E=0;E<u.length;E++){var N=u[E];b(N.value,{componentStack:N.stack})}}finally{K.T=r,oe.p=p}}(ya&3)!==0&&wu(),Pi(i),p=i.pendingLanes,(l&261930)!==0&&(p&42)!==0?i===kh?Oo++:(Oo=0,kh=i):Oo=0,Ro(0)}}function gx(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,uo(r)))}function wu(){return hx(),mx(),px(),bx()}function bx(){if(Jt!==5)return!1;var i=Xa,r=wh;wh=0;var l=ea(ya),u=K.T,p=oe.p;try{oe.p=32>l?32:l,K.T=null,l=_h,_h=null;var b=Xa,E=ya;if(Jt=0,Ys=Xa=null,ya=0,(rt&6)!==0)throw Error(a(331));var N=rt;if(rt|=4,Wy(b.current),Vy(b,b.current,E,l),rt=N,Ro(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(an,b)}catch{}return!0}finally{oe.p=p,K.T=u,gx(i,r)}}function yx(i,r,l){r=ui(l,r),r=ih(i.stateNode,r,2),i=qa(i,r,2),i!==null&&(bt(i,2),Pi(i))}function dt(i,r,l){if(i.tag===3)yx(i,i,l);else for(;r!==null;){if(r.tag===3){yx(r,i,l);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Va===null||!Va.has(u))){i=ui(l,i),l=xy(2),u=qa(r,l,2),u!==null&&(vy(l,u,r,i),bt(u,2),Pi(u));break}}r=r.return}}function Ch(i,r,l){var u=i.pingCache;if(u===null){u=i.pingCache=new q_;var p=new Set;u.set(r,p)}else p=u.get(r),p===void 0&&(p=new Set,u.set(r,p));p.has(l)||(vh=!0,p.add(l),i=Y_.bind(null,i,r,l),r.then(i,i))}function Y_(i,r,l){var u=i.pingCache;u!==null&&u.delete(r),i.pingedLanes|=i.suspendedLanes&l,i.warmLanes&=~l,yt===i&&(Xe&l)===l&&(zt===4||zt===3&&(Xe&62914560)===Xe&&300>Ot()-bu?(rt&2)===0&&Vs(i,0):Eh|=l,Qs===Xe&&(Qs=0)),Pi(i)}function xx(i,r){r===0&&(r=Le()),i=Ir(i,r),i!==null&&(bt(i,r),Pi(i))}function V_(i){var r=i.memoizedState,l=0;r!==null&&(l=r.retryLane),xx(i,l)}function X_(i,r){var l=0;switch(i.tag){case 31:case 13:var u=i.stateNode,p=i.memoizedState;p!==null&&(l=p.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(r),xx(i,l)}function Z_(i,r){return Ji(i,r)}var _u=null,Zs=null,Ah=!1,ku=!1,Oh=!1,Wa=0;function Pi(i){i!==Zs&&i.next===null&&(Zs===null?_u=Zs=i:Zs=Zs.next=i),ku=!0,Ah||(Ah=!0,J_())}function Ro(i,r){if(!Oh&&ku){Oh=!0;do for(var l=!1,u=_u;u!==null;){if(i!==0){var p=u.pendingLanes;if(p===0)var b=0;else{var E=u.suspendedLanes,N=u.pingedLanes;b=(1<<31-ot(42|i)+1)-1,b&=p&~(E&~N),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(l=!0,wx(u,b))}else b=Xe,b=B(u,u===yt?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(b&3)===0||ie(u,b)||(l=!0,wx(u,b));u=u.next}while(l);Oh=!1}}function W_(){vx()}function vx(){ku=Ah=!1;var i=0;Wa!==0&&ck()&&(i=Wa);for(var r=Ot(),l=null,u=_u;u!==null;){var p=u.next,b=Ex(u,r);b===0?(u.next=null,l===null?_u=p:l.next=p,p===null&&(Zs=l)):(l=u,(i!==0||(b&3)!==0)&&(ku=!0)),u=p}Jt!==0&&Jt!==5||Ro(i),Wa!==0&&(Wa=0)}function Ex(i,r){for(var l=i.suspendedLanes,u=i.pingedLanes,p=i.expirationTimes,b=i.pendingLanes&-62914561;0<b;){var E=31-ot(b),N=1<<E,I=p[E];I===-1?((N&l)===0||(N&u)!==0)&&(p[E]=ge(N,r)):I<=r&&(i.expiredLanes|=N),b&=~N}if(r=yt,l=Xe,l=B(i,i===r?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,l===0||i===r&&(ft===2||ft===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&Tr(u),i.callbackNode=null,i.callbackPriority=0;if((l&3)===0||ie(i,l)){if(r=l&-l,r===i.callbackPriority)return r;switch(u!==null&&Tr(u),ea(l)){case 2:case 8:l=de;break;case 32:l=Oe;break;case 268435456:l=nt;break;default:l=Oe}return u=Sx.bind(null,i),l=Ji(l,u),i.callbackPriority=r,i.callbackNode=l,r}return u!==null&&u!==null&&Tr(u),i.callbackPriority=2,i.callbackNode=null,2}function Sx(i,r){if(Jt!==0&&Jt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var l=i.callbackNode;if(wu()&&i.callbackNode!==l)return null;var u=Xe;return u=B(i,i===yt?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(ix(i,u,r),Ex(i,Ot()),i.callbackNode!=null&&i.callbackNode===l?Sx.bind(null,i):null)}function wx(i,r){if(wu())return null;ix(i,r,!0)}function J_(){fk(function(){(rt&6)!==0?Ji(te,W_):vx()})}function Rh(){if(Wa===0){var i=Is;i===0&&(i=Cr,Cr<<=1,(Cr&261888)===0&&(Cr=256)),Wa=i}return Wa}function _x(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:La(""+i)}function kx(i,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,i.id&&l.setAttribute("form",i.id),r.parentNode.insertBefore(l,r),i=new FormData(i),l.parentNode.removeChild(l),i}function ek(i,r,l,u,p){if(r==="submit"&&l&&l.stateNode===p){var b=_x((p[fn]||null).action),E=u.submitter;E&&(r=(r=E[fn]||null)?_x(r.formAction):E.getAttribute("formAction"),r!==null&&(b=r,E=null));var N=new zc("action","action",null,u,p);i.push({event:N,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Wa!==0){var I=E?kx(p,E):new FormData(p);Zd(l,{pending:!0,data:I,method:p.method,action:b},null,I)}}else typeof b=="function"&&(N.preventDefault(),I=E?kx(p,E):new FormData(p),Zd(l,{pending:!0,data:I,method:p.method,action:b},b,I))},currentTarget:p}]})}}for(var Mh=0;Mh<md.length;Mh++){var jh=md[Mh],tk=jh.toLowerCase(),nk=jh[0].toUpperCase()+jh.slice(1);Ni(tk,"on"+nk)}Ni(nb,"onAnimationEnd"),Ni(ib,"onAnimationIteration"),Ni(ab,"onAnimationStart"),Ni("dblclick","onDoubleClick"),Ni("focusin","onFocus"),Ni("focusout","onBlur"),Ni(y_,"onTransitionRun"),Ni(x_,"onTransitionStart"),Ni(v_,"onTransitionCancel"),Ni(rb,"onTransitionEnd"),ue("onMouseEnter",["mouseout","mouseover"]),ue("onMouseLeave",["mouseout","mouseover"]),ue("onPointerEnter",["pointerout","pointerover"]),ue("onPointerLeave",["pointerout","pointerover"]),na("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),na("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),na("onBeforeInput",["compositionend","keypress","textInput","paste"]),na("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),na("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),na("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mo="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(" "),ik=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mo));function Nx(i,r){r=(r&4)!==0;for(var l=0;l<i.length;l++){var u=i[l],p=u.event;u=u.listeners;e:{var b=void 0;if(r)for(var E=u.length-1;0<=E;E--){var N=u[E],I=N.instance,Y=N.currentTarget;if(N=N.listener,I!==b&&p.isPropagationStopped())break e;b=N,p.currentTarget=Y;try{b(p)}catch(ne){Fc(ne)}p.currentTarget=null,b=I}else for(E=0;E<u.length;E++){if(N=u[E],I=N.instance,Y=N.currentTarget,N=N.listener,I!==b&&p.isPropagationStopped())break e;b=N,p.currentTarget=Y;try{b(p)}catch(ne){Fc(ne)}p.currentTarget=null,b=I}}}}function Qe(i,r){var l=r[Ql];l===void 0&&(l=r[Ql]=new Set);var u=i+"__bubble";l.has(u)||(Tx(r,i,2,!1),l.add(u))}function Dh(i,r,l){var u=0;r&&(u|=4),Tx(l,i,u,r)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function Lh(i){if(!i[Nu]){i[Nu]=!0,Ac.forEach(function(l){l!=="selectionchange"&&(ik.has(l)||Dh(l,!1,i),Dh(l,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[Nu]||(r[Nu]=!0,Dh("selectionchange",!1,r))}}function Tx(i,r,l,u){switch(nv(r)){case 2:var p=Rk;break;case 8:p=Mk;break;default:p=Xh}l=p.bind(null,r,l,i),p=void 0,!td||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),u?p!==void 0?i.addEventListener(r,l,{capture:!0,passive:p}):i.addEventListener(r,l,!0):p!==void 0?i.addEventListener(r,l,{passive:p}):i.addEventListener(r,l,!1)}function Ih(i,r,l,u,p){var b=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var N=u.stateNode.containerInfo;if(N===p)break;if(E===4)for(E=u.return;E!==null;){var I=E.tag;if((I===3||I===4)&&E.stateNode.containerInfo===p)return;E=E.return}for(;N!==null;){if(E=En(N),E===null)return;if(I=E.tag,I===5||I===6||I===26||I===27){u=b=E;continue e}N=N.parentNode}}u=u.return}jc(function(){var Y=b,ne=Be(l),se=[];e:{var X=sb.get(i);if(X!==void 0){var ee=zc,xe=i;switch(i){case"keypress":if(Lc(l)===0)break e;case"keydown":case"keyup":ee=Xw;break;case"focusin":xe="focus",ee=rd;break;case"focusout":xe="blur",ee=rd;break;case"beforeblur":case"afterblur":ee=rd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=Lg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Bw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Jw;break;case nb:case ib:case ab:ee=$w;break;case rb:ee=t_;break;case"scroll":case"scrollend":ee=Iw;break;case"wheel":ee=i_;break;case"copy":case"cut":case"paste":ee=qw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=zg;break;case"toggle":case"beforetoggle":ee=r_}var Re=(r&4)!==0,pt=!Re&&(i==="scroll"||i==="scrollend"),H=Re?X!==null?X+"Capture":null:X;Re=[];for(var F=Y,Q;F!==null;){var re=F;if(Q=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Q===null||H===null||(re=Jl(F,H),re!=null&&Re.push(jo(F,re,Q))),pt)break;F=F.return}0<Re.length&&(X=new ee(X,xe,null,l,ne),se.push({event:X,listeners:Re}))}}if((r&7)===0){e:{if(X=i==="mouseover"||i==="pointerover",ee=i==="mouseout"||i==="pointerout",X&&l!==Se&&(xe=l.relatedTarget||l.fromElement)&&(En(xe)||xe[Ra]))break e;if((ee||X)&&(X=ne.window===ne?ne:(X=ne.ownerDocument)?X.defaultView||X.parentWindow:window,ee?(xe=l.relatedTarget||l.toElement,ee=Y,xe=xe?En(xe):null,xe!==null&&(pt=o(xe),Re=xe.tag,xe!==pt||Re!==5&&Re!==27&&Re!==6)&&(xe=null)):(ee=null,xe=Y),ee!==xe)){if(Re=Lg,re="onMouseLeave",H="onMouseEnter",F="mouse",(i==="pointerout"||i==="pointerover")&&(Re=zg,re="onPointerLeave",H="onPointerEnter",F="pointer"),pt=ee==null?X:Ma(ee),Q=xe==null?X:Ma(xe),X=new Re(re,F+"leave",ee,l,ne),X.target=pt,X.relatedTarget=Q,re=null,En(ne)===Y&&(Re=new Re(H,F+"enter",xe,l,ne),Re.target=Q,Re.relatedTarget=pt,re=Re),pt=re,ee&&xe)t:{for(Re=ak,H=ee,F=xe,Q=0,re=H;re;re=Re(re))Q++;re=0;for(var Ce=F;Ce;Ce=Re(Ce))re++;for(;0<Q-re;)H=Re(H),Q--;for(;0<re-Q;)F=Re(F),re--;for(;Q--;){if(H===F||F!==null&&H===F.alternate){Re=H;break t}H=Re(H),F=Re(F)}Re=null}else Re=null;ee!==null&&Cx(se,X,ee,Re,!1),xe!==null&&pt!==null&&Cx(se,pt,xe,Re,!0)}}e:{if(X=Y?Ma(Y):window,ee=X.nodeName&&X.nodeName.toLowerCase(),ee==="select"||ee==="input"&&X.type==="file")var it=Kg;else if(qg(X))if(Gg)it=p_;else{it=h_;var we=d_}else ee=X.nodeName,!ee||ee.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?Y&&Da(Y.elementType)&&(it=Kg):it=m_;if(it&&(it=it(i,Y))){Hg(se,it,l,ne);break e}we&&we(i,X,Y),i==="focusout"&&Y&&X.type==="number"&&Y.memoizedProps.value!=null&&ks(X,"number",X.value)}switch(we=Y?Ma(Y):window,i){case"focusin":(qg(we)||we.contentEditable==="true")&&(Cs=we,fd=Y,lo=null);break;case"focusout":lo=fd=Cs=null;break;case"mousedown":dd=!0;break;case"contextmenu":case"mouseup":case"dragend":dd=!1,eb(se,l,ne);break;case"selectionchange":if(b_)break;case"keydown":case"keyup":eb(se,l,ne)}var Fe;if(ld)e:{switch(i){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Ts?$g(i,l)&&(Ze="onCompositionEnd"):i==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&(Bg&&l.locale!=="ko"&&(Ts||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Ts&&(Fe=jg()):(Ia=ne,nd="value"in Ia?Ia.value:Ia.textContent,Ts=!0)),we=Tu(Y,Ze),0<we.length&&(Ze=new Ig(Ze,i,null,l,ne),se.push({event:Ze,listeners:we}),Fe?Ze.data=Fe:(Fe=Pg(l),Fe!==null&&(Ze.data=Fe)))),(Fe=l_?o_(i,l):c_(i,l))&&(Ze=Tu(Y,"onBeforeInput"),0<Ze.length&&(we=new Ig("onBeforeInput","beforeinput",null,l,ne),se.push({event:we,listeners:Ze}),we.data=Fe)),ek(se,i,Y,l,ne)}Nx(se,r)})}function jo(i,r,l){return{instance:i,listener:r,currentTarget:l}}function Tu(i,r){for(var l=r+"Capture",u=[];i!==null;){var p=i,b=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||b===null||(p=Jl(i,l),p!=null&&u.unshift(jo(i,p,b)),p=Jl(i,r),p!=null&&u.push(jo(i,p,b))),i.tag===3)return u;i=i.return}return[]}function ak(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Cx(i,r,l,u,p){for(var b=r._reactName,E=[];l!==null&&l!==u;){var N=l,I=N.alternate,Y=N.stateNode;if(N=N.tag,I!==null&&I===u)break;N!==5&&N!==26&&N!==27||Y===null||(I=Y,p?(Y=Jl(l,b),Y!=null&&E.unshift(jo(l,Y,I))):p||(Y=Jl(l,b),Y!=null&&E.push(jo(l,Y,I)))),l=l.return}E.length!==0&&i.push({event:r,listeners:E})}var rk=/\r\n?/g,sk=/\u0000|\uFFFD/g;function Ax(i){return(typeof i=="string"?i:""+i).replace(rk,`
|
|
49
|
+
`).replace(sk,"")}function Ox(i,r){return r=Ax(r),Ax(i)===r}function mt(i,r,l,u,p,b){switch(l){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||je(i,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&je(i,""+u);break;case"className":Gn(i,"class",u);break;case"tabIndex":Gn(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Gn(i,l,u);break;case"style":ut(i,u,b);break;case"data":if(r!=="object"){Gn(i,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||l!=="href")){i.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=La(""+u),i.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(l==="formAction"?(r!=="input"&&mt(i,r,"name",p.name,p,null),mt(i,r,"formEncType",p.formEncType,p,null),mt(i,r,"formMethod",p.formMethod,p,null),mt(i,r,"formTarget",p.formTarget,p,null)):(mt(i,r,"encType",p.encType,p,null),mt(i,r,"method",p.method,p,null),mt(i,r,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(l);break}u=La(""+u),i.setAttribute(l,u);break;case"onClick":u!=null&&(i.onclick=he);break;case"onScroll":u!=null&&Qe("scroll",i);break;case"onScrollEnd":u!=null&&Qe("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));i.innerHTML=l}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}l=La(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""+u):i.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,""):i.removeAttribute(l);break;case"capture":case"download":u===!0?i.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(l,u):i.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(l,u):i.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(l):i.setAttribute(l,u);break;case"popover":Qe("beforetoggle",i),Qe("toggle",i),dn(i,"popover",u);break;case"xlinkActuate":An(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":An(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":An(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":An(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":An(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":An(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":An(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":An(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":An(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":dn(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ia.get(l)||l,dn(i,l,u))}}function zh(i,r,l,u,p,b){switch(l){case"style":ut(i,u,b);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));i.innerHTML=l}}break;case"children":typeof u=="string"?je(i,u):(typeof u=="number"||typeof u=="bigint")&&je(i,""+u);break;case"onScroll":u!=null&&Qe("scroll",i);break;case"onScrollEnd":u!=null&&Qe("scrollend",i);break;case"onClick":u!=null&&(i.onclick=he);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),r=l.slice(2,p?l.length-7:void 0),b=i[fn]||null,b=b!=null?b[l]:null,typeof b=="function"&&i.removeEventListener(r,b,p),typeof u=="function")){typeof b!="function"&&b!==null&&(l in i?i[l]=null:i.hasAttribute(l)&&i.removeAttribute(l)),i.addEventListener(r,u,p);break e}l in i?i[l]=u:u===!0?i.setAttribute(l,""):dn(i,l,u)}}}function cn(i,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",i),Qe("load",i);var u=!1,p=!1,b;for(b in l)if(l.hasOwnProperty(b)){var E=l[b];if(E!=null)switch(b){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:mt(i,r,b,E,l,null)}}p&&mt(i,r,"srcSet",l.srcSet,l,null),u&&mt(i,r,"src",l.src,l,null);return;case"input":Qe("invalid",i);var N=b=E=p=null,I=null,Y=null;for(u in l)if(l.hasOwnProperty(u)){var ne=l[u];if(ne!=null)switch(u){case"name":p=ne;break;case"type":E=ne;break;case"checked":I=ne;break;case"defaultChecked":Y=ne;break;case"value":b=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,r));break;default:mt(i,r,u,ne,l,null)}}Mr(i,b,N,I,Y,E,p,!1);return;case"select":Qe("invalid",i),u=E=b=null;for(p in l)if(l.hasOwnProperty(p)&&(N=l[p],N!=null))switch(p){case"value":b=N;break;case"defaultValue":E=N;break;case"multiple":u=N;default:mt(i,r,p,N,l,null)}r=b,l=E,i.multiple=!!u,r!=null?rn(i,!!u,r,!1):l!=null&&rn(i,!!u,l,!0);return;case"textarea":Qe("invalid",i),b=p=u=null;for(E in l)if(l.hasOwnProperty(E)&&(N=l[E],N!=null))switch(E){case"value":u=N;break;case"defaultValue":p=N;break;case"children":b=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:mt(i,r,E,N,l,null)}Ns(i,u,p,b);return;case"option":for(I in l)if(l.hasOwnProperty(I)&&(u=l[I],u!=null))switch(I){case"selected":i.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:mt(i,r,I,u,l,null)}return;case"dialog":Qe("beforetoggle",i),Qe("toggle",i),Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":Qe("load",i);break;case"video":case"audio":for(u=0;u<Mo.length;u++)Qe(Mo[u],i);break;case"image":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"embed":case"source":case"link":Qe("error",i),Qe("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in l)if(l.hasOwnProperty(Y)&&(u=l[Y],u!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:mt(i,r,Y,u,l,null)}return;default:if(Da(r)){for(ne in l)l.hasOwnProperty(ne)&&(u=l[ne],u!==void 0&&zh(i,r,ne,u,l,void 0));return}}for(N in l)l.hasOwnProperty(N)&&(u=l[N],u!=null&&mt(i,r,N,u,l,null))}function lk(i,r,l,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,b=null,E=null,N=null,I=null,Y=null,ne=null;for(ee in l){var se=l[ee];if(l.hasOwnProperty(ee)&&se!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":I=se;default:u.hasOwnProperty(ee)||mt(i,r,ee,null,u,se)}}for(var X in u){var ee=u[X];if(se=l[X],u.hasOwnProperty(X)&&(ee!=null||se!=null))switch(X){case"type":b=ee;break;case"name":p=ee;break;case"checked":Y=ee;break;case"defaultChecked":ne=ee;break;case"value":E=ee;break;case"defaultValue":N=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(a(137,r));break;default:ee!==se&&mt(i,r,X,ee,u,se)}}Xl(i,E,N,I,Y,ne,b,p);return;case"select":ee=E=N=X=null;for(b in l)if(I=l[b],l.hasOwnProperty(b)&&I!=null)switch(b){case"value":break;case"multiple":ee=I;default:u.hasOwnProperty(b)||mt(i,r,b,null,u,I)}for(p in u)if(b=u[p],I=l[p],u.hasOwnProperty(p)&&(b!=null||I!=null))switch(p){case"value":X=b;break;case"defaultValue":N=b;break;case"multiple":E=b;default:b!==I&&mt(i,r,p,b,u,I)}r=N,l=E,u=ee,X!=null?rn(i,!!l,X,!1):!!u!=!!l&&(r!=null?rn(i,!!l,r,!0):rn(i,!!l,l?[]:"",!1));return;case"textarea":ee=X=null;for(N in l)if(p=l[N],l.hasOwnProperty(N)&&p!=null&&!u.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:mt(i,r,N,null,u,p)}for(E in u)if(p=u[E],b=l[E],u.hasOwnProperty(E)&&(p!=null||b!=null))switch(E){case"value":X=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==b&&mt(i,r,E,p,u,b)}Rc(i,X,ee);return;case"option":for(var xe in l)if(X=l[xe],l.hasOwnProperty(xe)&&X!=null&&!u.hasOwnProperty(xe))switch(xe){case"selected":i.selected=!1;break;default:mt(i,r,xe,null,u,X)}for(I in u)if(X=u[I],ee=l[I],u.hasOwnProperty(I)&&X!==ee&&(X!=null||ee!=null))switch(I){case"selected":i.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:mt(i,r,I,X,u,ee)}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 Re in l)X=l[Re],l.hasOwnProperty(Re)&&X!=null&&!u.hasOwnProperty(Re)&&mt(i,r,Re,null,u,X);for(Y in u)if(X=u[Y],ee=l[Y],u.hasOwnProperty(Y)&&X!==ee&&(X!=null||ee!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,r));break;default:mt(i,r,Y,X,u,ee)}return;default:if(Da(r)){for(var pt in l)X=l[pt],l.hasOwnProperty(pt)&&X!==void 0&&!u.hasOwnProperty(pt)&&zh(i,r,pt,void 0,u,X);for(ne in u)X=u[ne],ee=l[ne],!u.hasOwnProperty(ne)||X===ee||X===void 0&&ee===void 0||zh(i,r,ne,X,u,ee);return}}for(var H in l)X=l[H],l.hasOwnProperty(H)&&X!=null&&!u.hasOwnProperty(H)&&mt(i,r,H,null,u,X);for(se in u)X=u[se],ee=l[se],!u.hasOwnProperty(se)||X===ee||X==null&&ee==null||mt(i,r,se,X,u,ee)}function Rx(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ok(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var p=l[u],b=p.transferSize,E=p.initiatorType,N=p.duration;if(b&&N&&Rx(E)){for(E=0,N=p.responseEnd,u+=1;u<l.length;u++){var I=l[u],Y=I.startTime;if(Y>N)break;var ne=I.transferSize,se=I.initiatorType;ne&&Rx(se)&&(I=I.responseEnd,E+=ne*(I<N?1:(N-Y)/(I-Y)))}if(--u,r+=8*(b+E)/(p.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Bh=null,Uh=null;function Cu(i){return i.nodeType===9?i:i.ownerDocument}function Mx(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function jx(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function Fh(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var $h=null;function ck(){var i=window.event;return i&&i.type==="popstate"?i===$h?!1:($h=i,!0):($h=null,!1)}var Dx=typeof setTimeout=="function"?setTimeout:void 0,uk=typeof clearTimeout=="function"?clearTimeout:void 0,Lx=typeof Promise=="function"?Promise:void 0,fk=typeof queueMicrotask=="function"?queueMicrotask:typeof Lx<"u"?function(i){return Lx.resolve(null).then(i).catch(dk)}:Dx;function dk(i){setTimeout(function(){throw i})}function Ja(i){return i==="head"}function Ix(i,r){var l=r,u=0;do{var p=l.nextSibling;if(i.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(u===0){i.removeChild(p),tl(r);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Do(i.ownerDocument.documentElement);else if(l==="head"){l=i.ownerDocument.head,Do(l);for(var b=l.firstChild;b;){var E=b.nextSibling,N=b.nodeName;b[Or]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&b.rel.toLowerCase()==="stylesheet"||l.removeChild(b),b=E}}else l==="body"&&Do(i.ownerDocument.body);l=p}while(l);tl(r)}function zx(i,r){var l=i;i=0;do{var u=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(i===0)break;i--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||i++;l=u}while(l)}function Ph(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ph(l),Yl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}i.removeChild(l)}}function hk(i,r,l,u){for(;i.nodeType===1;){var p=l;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[Or])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(b=i.getAttribute("rel"),b==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(b!==p.rel||i.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||i.getAttribute("title")!==(p.title==null?null:p.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(b=i.getAttribute("src"),(b!==(p.src==null?null:p.src)||i.getAttribute("type")!==(p.type==null?null:p.type)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&b&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var b=p.name==null?null:""+p.name;if(p.type==="hidden"&&i.getAttribute("name")===b)return i}else return i;if(i=pi(i.nextSibling),i===null)break}return null}function mk(i,r,l){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!l||(i=pi(i.nextSibling),i===null))return null;return i}function Bx(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=pi(i.nextSibling),i===null))return null;return i}function qh(i){return i.data==="$?"||i.data==="$~"}function Hh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function pk(i,r){var l=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||l.readyState!=="loading")r();else{var u=function(){r(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function pi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var Kh=null;function Ux(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="/$"||l==="/&"){if(r===0)return pi(i.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}i=i.nextSibling}return null}function Fx(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var l=i.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return i;r--}else l!=="/$"&&l!=="/&"||r++}i=i.previousSibling}return null}function $x(i,r,l){switch(r=Cu(l),i){case"html":if(i=r.documentElement,!i)throw Error(a(452));return i;case"head":if(i=r.head,!i)throw Error(a(453));return i;case"body":if(i=r.body,!i)throw Error(a(454));return i;default:throw Error(a(451))}}function Do(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Yl(i)}var gi=new Map,Px=new Set;function Au(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var xa=oe.d;oe.d={f:gk,r:bk,D:yk,C:xk,L:vk,m:Ek,X:wk,S:Sk,M:_k};function gk(){var i=xa.f(),r=vu();return i||r}function bk(i){var r=ta(i);r!==null&&r.tag===5&&r.type==="form"?ry(r):xa.r(i)}var Ws=typeof document>"u"?null:document;function qx(i,r,l){var u=Ws;if(u&&typeof r=="string"&&r){var p=On(r);p='link[rel="'+i+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),Px.has(p)||(Px.add(p),i={rel:i,crossOrigin:l,href:r},u.querySelector(p)===null&&(r=u.createElement("link"),cn(r,"link",i),Kt(r),u.head.appendChild(r)))}}function yk(i){xa.D(i),qx("dns-prefetch",i,null)}function xk(i,r){xa.C(i,r),qx("preconnect",i,r)}function vk(i,r,l){xa.L(i,r,l);var u=Ws;if(u&&i&&r){var p='link[rel="preload"][as="'+On(r)+'"]';r==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+On(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+On(l.imageSizes)+'"]')):p+='[href="'+On(i)+'"]';var b=p;switch(r){case"style":b=Js(i);break;case"script":b=el(i)}gi.has(b)||(i=g({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:i,as:r},l),gi.set(b,i),u.querySelector(p)!==null||r==="style"&&u.querySelector(Lo(b))||r==="script"&&u.querySelector(Io(b))||(r=u.createElement("link"),cn(r,"link",i),Kt(r),u.head.appendChild(r)))}}function Ek(i,r){xa.m(i,r);var l=Ws;if(l&&i){var u=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+On(u)+'"][href="'+On(i)+'"]',b=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=el(i)}if(!gi.has(b)&&(i=g({rel:"modulepreload",href:i},r),gi.set(b,i),l.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Io(b)))return}u=l.createElement("link"),cn(u,"link",i),Kt(u),l.head.appendChild(u)}}}function Sk(i,r,l){xa.S(i,r,l);var u=Ws;if(u&&i){var p=ja(u).hoistableStyles,b=Js(i);r=r||"default";var E=p.get(b);if(!E){var N={loading:0,preload:null};if(E=u.querySelector(Lo(b)))N.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":r},l),(l=gi.get(b))&&Gh(i,l);var I=E=u.createElement("link");Kt(I),cn(I,"link",i),I._p=new Promise(function(Y,ne){I.onload=Y,I.onerror=ne}),I.addEventListener("load",function(){N.loading|=1}),I.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ou(E,r,u)}E={type:"stylesheet",instance:E,count:1,state:N},p.set(b,E)}}}function wk(i,r){xa.X(i,r);var l=Ws;if(l&&i){var u=ja(l).hoistableScripts,p=el(i),b=u.get(p);b||(b=l.querySelector(Io(p)),b||(i=g({src:i,async:!0},r),(r=gi.get(p))&&Qh(i,r),b=l.createElement("script"),Kt(b),cn(b,"link",i),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(p,b))}}function _k(i,r){xa.M(i,r);var l=Ws;if(l&&i){var u=ja(l).hoistableScripts,p=el(i),b=u.get(p);b||(b=l.querySelector(Io(p)),b||(i=g({src:i,async:!0,type:"module"},r),(r=gi.get(p))&&Qh(i,r),b=l.createElement("script"),Kt(b),cn(b,"link",i),l.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},u.set(p,b))}}function Hx(i,r,l,u){var p=(p=ve.current)?Au(p):null;if(!p)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=Js(l.href),l=ja(p).hoistableStyles,u=l.get(r),u||(u={type:"style",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){i=Js(l.href);var b=ja(p).hoistableStyles,E=b.get(i);if(E||(p=p.ownerDocument||p,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(i,E),(b=p.querySelector(Lo(i)))&&!b._p&&(E.instance=b,E.state.loading=5),gi.has(i)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},gi.set(i,l),b||kk(p,i,l,E.state))),r&&u===null)throw Error(a(528,""));return E}if(r&&u!==null)throw Error(a(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=el(l),l=ja(p).hoistableScripts,u=l.get(r),u||(u={type:"script",instance:null,count:0,state:null},l.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,i))}}function Js(i){return'href="'+On(i)+'"'}function Lo(i){return'link[rel="stylesheet"]['+i+"]"}function Kx(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function kk(i,r,l,u){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=i.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),cn(r,"link",l),Kt(r),i.head.appendChild(r))}function el(i){return'[src="'+On(i)+'"]'}function Io(i){return"script[async]"+i}function Gx(i,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var u=i.querySelector('style[data-href~="'+On(l.href)+'"]');if(u)return r.instance=u,Kt(u),u;var p=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Kt(u),cn(u,"style",p),Ou(u,l.precedence,i),r.instance=u;case"stylesheet":p=Js(l.href);var b=i.querySelector(Lo(p));if(b)return r.state.loading|=4,r.instance=b,Kt(b),b;u=Kx(l),(p=gi.get(p))&&Gh(u,p),b=(i.ownerDocument||i).createElement("link"),Kt(b);var E=b;return E._p=new Promise(function(N,I){E.onload=N,E.onerror=I}),cn(b,"link",u),r.state.loading|=4,Ou(b,l.precedence,i),r.instance=b;case"script":return b=el(l.src),(p=i.querySelector(Io(b)))?(r.instance=p,Kt(p),p):(u=l,(p=gi.get(b))&&(u=g({},l),Qh(u,p)),i=i.ownerDocument||i,p=i.createElement("script"),Kt(p),cn(p,"link",u),i.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Ou(u,l.precedence,i));return r.instance}function Ou(i,r,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,b=p,E=0;E<u.length;E++){var N=u[E];if(N.dataset.precedence===r)b=N;else if(b!==p)break}b?b.parentNode.insertBefore(i,b.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(i,r.firstChild))}function Gh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Qh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Ru=null;function Qx(i,r,l){if(Ru===null){var u=new Map,p=Ru=new Map;p.set(l,u)}else p=Ru,u=p.get(l),u||(u=new Map,p.set(l,u));if(u.has(i))return u;for(u.set(i,null),l=l.getElementsByTagName(i),p=0;p<l.length;p++){var b=l[p];if(!(b[Or]||b[Ft]||i==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var E=b.getAttribute(r)||"";E=i+E;var N=u.get(E);N?N.push(b):u.set(E,[b])}}return u}function Yx(i,r,l){i=i.ownerDocument||i,i.head.insertBefore(l,r==="title"?i.querySelector("head > title"):null)}function Nk(i,r,l){if(l===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function Vx(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Tk(i,r,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=Js(u.href),b=r.querySelector(Lo(p));if(b){r=b._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=Mu.bind(i),r.then(i,i)),l.state.loading|=4,l.instance=b,Kt(b);return}b=r.ownerDocument||r,u=Kx(u),(p=gi.get(p))&&Gh(u,p),b=b.createElement("link"),Kt(b);var E=b;E._p=new Promise(function(N,I){E.onload=N,E.onerror=I}),cn(b,"link",u),l.instance=b}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(i.count++,l=Mu.bind(i),r.addEventListener("load",l),r.addEventListener("error",l))}}var Yh=0;function Ck(i,r){return i.stylesheets&&i.count===0&&Du(i,i.stylesheets),0<i.count||0<i.imgCount?function(l){var u=setTimeout(function(){if(i.stylesheets&&Du(i,i.stylesheets),i.unsuspend){var b=i.unsuspend;i.unsuspend=null,b()}},6e4+r);0<i.imgBytes&&Yh===0&&(Yh=62500*ok());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Du(i,i.stylesheets),i.unsuspend)){var b=i.unsuspend;i.unsuspend=null,b()}},(i.imgBytes>Yh?50:800)+r);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Mu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Du(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var ju=null;function Du(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,ju=new Map,r.forEach(Ak,i),ju=null,Mu.call(i))}function Ak(i,r){if(!(r.state.loading&4)){var l=ju.get(i);if(l)var u=l.get(null);else{l=new Map,ju.set(i,l);for(var p=i.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<p.length;b++){var E=p[b];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(l.set(E.dataset.precedence,E),u=E)}u&&l.set(null,u)}p=r.instance,E=p.getAttribute("data-precedence"),b=l.get(E)||u,b===u&&l.set(null,p),l.set(E,p),this.count++,u=Mu.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),b?b.parentNode.insertBefore(p,b.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(p,i.firstChild)),r.state.loading|=4}}var zo={$$typeof:T,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function Ok(i,r,l,u,p,b,E,N,I){this.tag=1,this.containerInfo=i,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=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=b,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function Xx(i,r,l,u,p,b,E,N,I,Y,ne,se){return i=new Ok(i,r,l,E,I,Y,ne,se,N),r=1,b===!0&&(r|=24),b=Vn(3,null,null,r),i.current=b,b.stateNode=i,r=Td(),r.refCount++,i.pooledCache=r,r.refCount++,b.memoizedState={element:u,isDehydrated:l,cache:r},Rd(b),i}function Zx(i){return i?(i=Rs,i):Rs}function Wx(i,r,l,u,p,b){p=Zx(p),u.context===null?u.context=p:u.pendingContext=p,u=Pa(r),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=qa(i,u,r),l!==null&&(In(l,i,r),po(l,i,r))}function Jx(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var l=i.retryLane;i.retryLane=l!==0&&l<r?l:r}}function Vh(i,r){Jx(i,r),(i=i.alternate)&&Jx(i,r)}function ev(i){if(i.tag===13||i.tag===31){var r=Ir(i,67108864);r!==null&&In(r,i,67108864),Vh(i,67108864)}}function tv(i){if(i.tag===13||i.tag===31){var r=ei();r=Nt(r);var l=Ir(i,r);l!==null&&In(l,i,r),Vh(i,r)}}var Lu=!0;function Rk(i,r,l,u){var p=K.T;K.T=null;var b=oe.p;try{oe.p=2,Xh(i,r,l,u)}finally{oe.p=b,K.T=p}}function Mk(i,r,l,u){var p=K.T;K.T=null;var b=oe.p;try{oe.p=8,Xh(i,r,l,u)}finally{oe.p=b,K.T=p}}function Xh(i,r,l,u){if(Lu){var p=Zh(u);if(p===null)Ih(i,r,u,Iu,l),iv(i,u);else if(Dk(p,i,r,l,u))u.stopPropagation();else if(iv(i,u),r&4&&-1<jk.indexOf(i)){for(;p!==null;){var b=ta(p);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var E=Cn(b.pendingLanes);if(E!==0){var N=b;for(N.pendingLanes|=2,N.entangledLanes|=2;E;){var I=1<<31-ot(E);N.entanglements[1]|=I,E&=~I}Pi(b),(rt&6)===0&&(yu=Ot()+500,Ro(0))}}break;case 31:case 13:N=Ir(b,2),N!==null&&In(N,b,2),vu(),Vh(b,2)}if(b=Zh(u),b===null&&Ih(i,r,u,Iu,l),b===p)break;p=b}p!==null&&u.stopPropagation()}else Ih(i,r,u,null,l)}}function Zh(i){return i=Be(i),Wh(i)}var Iu=null;function Wh(i){if(Iu=null,i=En(i),i!==null){var r=o(i);if(r===null)i=null;else{var l=r.tag;if(l===13){if(i=c(r),i!==null)return i;i=null}else if(l===31){if(i=f(r),i!==null)return i;i=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Iu=i,null}function nv(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ys()){case te:return 2;case de:return 8;case Oe:case qe:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Jh=!1,er=null,tr=null,nr=null,Bo=new Map,Uo=new Map,ir=[],jk="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 iv(i,r){switch(i){case"focusin":case"focusout":er=null;break;case"dragenter":case"dragleave":tr=null;break;case"mouseover":case"mouseout":nr=null;break;case"pointerover":case"pointerout":Bo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(r.pointerId)}}function Fo(i,r,l,u,p,b){return i===null||i.nativeEvent!==b?(i={blockedOn:r,domEventName:l,eventSystemFlags:u,nativeEvent:b,targetContainers:[p]},r!==null&&(r=ta(r),r!==null&&ev(r)),i):(i.eventSystemFlags|=u,r=i.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),i)}function Dk(i,r,l,u,p){switch(r){case"focusin":return er=Fo(er,i,r,l,u,p),!0;case"dragenter":return tr=Fo(tr,i,r,l,u,p),!0;case"mouseover":return nr=Fo(nr,i,r,l,u,p),!0;case"pointerover":var b=p.pointerId;return Bo.set(b,Fo(Bo.get(b)||null,i,r,l,u,p)),!0;case"gotpointercapture":return b=p.pointerId,Uo.set(b,Fo(Uo.get(b)||null,i,r,l,u,p)),!0}return!1}function av(i){var r=En(i.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=c(l),r!==null){i.blockedOn=r,Es(i.priority,function(){tv(l)});return}}else if(r===31){if(r=f(l),r!==null){i.blockedOn=r,Es(i.priority,function(){tv(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){i.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}i.blockedOn=null}function zu(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var l=Zh(i.nativeEvent);if(l===null){l=i.nativeEvent;var u=new l.constructor(l.type,l);Se=u,l.target.dispatchEvent(u),Se=null}else return r=ta(l),r!==null&&ev(r),i.blockedOn=l,!1;r.shift()}return!0}function rv(i,r,l){zu(i)&&l.delete(r)}function Lk(){Jh=!1,er!==null&&zu(er)&&(er=null),tr!==null&&zu(tr)&&(tr=null),nr!==null&&zu(nr)&&(nr=null),Bo.forEach(rv),Uo.forEach(rv)}function Bu(i,r){i.blockedOn===r&&(i.blockedOn=null,Jh||(Jh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Lk)))}var Uu=null;function sv(i){Uu!==i&&(Uu=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Uu===i&&(Uu=null);for(var r=0;r<i.length;r+=3){var l=i[r],u=i[r+1],p=i[r+2];if(typeof u!="function"){if(Wh(u||l)===null)continue;break}var b=ta(l);b!==null&&(i.splice(r,3),r-=3,Zd(b,{pending:!0,data:p,method:l.method,action:u},u,p))}}))}function tl(i){function r(I){return Bu(I,i)}er!==null&&Bu(er,i),tr!==null&&Bu(tr,i),nr!==null&&Bu(nr,i),Bo.forEach(r),Uo.forEach(r);for(var l=0;l<ir.length;l++){var u=ir[l];u.blockedOn===i&&(u.blockedOn=null)}for(;0<ir.length&&(l=ir[0],l.blockedOn===null);)av(l),l.blockedOn===null&&ir.shift();if(l=(i.ownerDocument||i).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var p=l[u],b=l[u+1],E=p[fn]||null;if(typeof b=="function")E||sv(l);else if(E){var N=null;if(b&&b.hasAttribute("formAction")){if(p=b,E=b[fn]||null)N=E.formAction;else if(Wh(p)!==null)continue}else N=E.action;typeof N=="function"?l[u+1]=N:(l.splice(u,3),u-=3),sv(l)}}}function lv(){function i(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(E){return p=E})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function em(i){this._internalRoot=i}Fu.prototype.render=em.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(a(409));var l=r.current,u=ei();Wx(l,u,i,r,null,null)},Fu.prototype.unmount=em.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;Wx(i.current,2,null,i,null,null),vu(),r[Ra]=null}};function Fu(i){this._internalRoot=i}Fu.prototype.unstable_scheduleHydration=function(i){if(i){var r=vs();i={blockedOn:null,target:i,priority:r};for(var l=0;l<ir.length&&r!==0&&r<ir[l].priority;l++);ir.splice(l,0,i),l===0&&av(i)}};var ov=t.version;if(ov!=="19.2.5")throw Error(a(527,ov,"19.2.5"));oe.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(a(188)):(i=Object.keys(i).join(","),Error(a(268,i)));return i=h(r),i=i!==null?y(i):null,i=i===null?null:i.stateNode,i};var Ik={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{an=$u.inject(Ik),Lt=$u}catch{}}return Po.createRoot=function(i,r){if(!s(i))throw Error(a(299));var l=!1,u="",p=py,b=gy,E=by;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(E=r.onRecoverableError)),r=Xx(i,1,!1,null,null,l,u,null,p,b,E,lv),i[Ra]=r.current,Lh(i),new em(r)},Po.hydrateRoot=function(i,r,l){if(!s(i))throw Error(a(299));var u=!1,p="",b=py,E=gy,N=by,I=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),r=Xx(i,1,!0,r,l??null,u,p,I,b,E,N,lv),r.context=Zx(null),l=r.current,u=ei(),u=Nt(u),p=Pa(u),p.callback=null,qa(l,p,u),l=u,r.current.lanes=l,bt(r,l),Pi(r),i[Ra]=r.current,Lh(i),new Fu(r)},Po.version="19.2.5",Po}var vv;function Yk(){if(vv)return am.exports;vv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),am.exports=Qk(),am.exports}var Vk=Yk(),Ml=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},es,ur,gl,aE,Xk=(aE=class extends Ml{constructor(){super();Te(this,es);Te(this,ur);Te(this,gl);be(this,gl,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,ur)||this.setEventListener(z(this,gl))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,ur))==null||t.call(this),be(this,ur,void 0))}setEventListener(t){var n;be(this,gl,t),(n=z(this,ur))==null||n.call(this),be(this,ur,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){z(this,es)!==t&&(be(this,es,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof z(this,es)=="boolean"?z(this,es):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},es=new WeakMap,ur=new WeakMap,gl=new WeakMap,aE),Cp=new Xk,Zk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fr,kp,rE,Wk=(rE=class{constructor(){Te(this,fr,Zk);Te(this,kp,!1)}setTimeoutProvider(e){be(this,fr,e)}setTimeout(e,t){return z(this,fr).setTimeout(e,t)}clearTimeout(e){z(this,fr).clearTimeout(e)}setInterval(e,t){return z(this,fr).setInterval(e,t)}clearInterval(e){z(this,fr).clearInterval(e)}},fr=new WeakMap,kp=new WeakMap,rE),Xr=new Wk;function Jk(e){setTimeout(e,0)}var eN=typeof window>"u"||"Deno"in globalThis;function kn(){}function tN(e,t){return typeof e=="function"?e(t):e}function $m(e){return typeof e=="number"&&e>=0&&e!==1/0}function pE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xr(e,t){return typeof e=="function"?e(t):e}function yi(e,t){return typeof e=="function"?e(t):e}function Ev(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==Ap(c,t.options))return!1}else if(!nc(t.queryKey,c))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||s&&s!==t.state.fetchStatus||o&&!o(t))}function Sv(e,t){const{exact:n,status:a,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(cs(t.options.mutationKey)!==cs(o))return!1}else if(!nc(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function Ap(e,t){return((t==null?void 0:t.queryKeyHashFn)||cs)(e)}function cs(e){return JSON.stringify(e,(t,n)=>Pm(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function nc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>nc(e[n],t[n])):!1}var nN=Object.prototype.hasOwnProperty;function gE(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=wv(e)&&wv(t);if(!a&&!(Pm(e)&&Pm(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,d=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:c[y],x=e[g],v=t[g];if(x===v){d[g]=x,(a?y<o:nN.call(e,g))&&h++;continue}if(x===null||v===null||typeof x!="object"||typeof v!="object"){d[g]=v;continue}const S=gE(x,v,n+1);d[g]=S,S===x&&h++}return o===f&&h===o?e:d}function pf(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function wv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pm(e){if(!_v(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_v(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _v(e){return Object.prototype.toString.call(e)==="[object Object]"}function iN(e){return new Promise(t=>{Xr.setTimeout(t,e)})}function qm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gE(e,t):t}function aN(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function rN(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Op=Symbol();function bE(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Op?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rp(e,t){return typeof e=="function"?e(...t):!!e}function sN(e,t,n){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),a||(a=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var ic=(()=>{let e=()=>eN;return{isServer(){return e()},setIsServer(t){e=t}}})();function Hm(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function a(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},n.reject=s=>{a({status:"rejected",reason:s}),t(s)},n}var lN=Jk;function oN(){let e=[],t=0,n=f=>{f()},a=f=>{f()},s=lN;const o=f=>{t?e.push(f):s(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&s(()=>{a(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||c()}return d},batchCalls:f=>(...d)=>{o(()=>{f(...d)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{s=f}}}var en=oN(),bl,dr,yl,sE,cN=(sE=class extends Ml{constructor(){super();Te(this,bl,!0);Te(this,dr);Te(this,yl);be(this,yl,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){z(this,dr)||this.setEventListener(z(this,yl))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,dr))==null||t.call(this),be(this,dr,void 0))}setEventListener(t){var n;be(this,yl,t),(n=z(this,dr))==null||n.call(this),be(this,dr,t(this.setOnline.bind(this)))}setOnline(t){z(this,bl)!==t&&(be(this,bl,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return z(this,bl)}},bl=new WeakMap,dr=new WeakMap,yl=new WeakMap,sE),gf=new cN;function uN(e){return Math.min(1e3*2**e,3e4)}function yE(e){return(e??"online")==="online"?gf.isOnline():!0}var Km=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function xE(e){let t=!1,n=0,a;const s=Hm(),o=()=>s.status!=="pending",c=w=>{var k;if(!o()){const _=new Km(w);x(_),(k=e.onCancel)==null||k.call(e,_)}},f=()=>{t=!0},d=()=>{t=!1},h=()=>Cp.isFocused()&&(e.networkMode==="always"||gf.isOnline())&&e.canRun(),y=()=>yE(e.networkMode)&&e.canRun(),g=w=>{o()||(a==null||a(),s.resolve(w))},x=w=>{o()||(a==null||a(),s.reject(w))},v=()=>new Promise(w=>{var k;a=_=>{(o()||h())&&w(_)},(k=e.onPause)==null||k.call(e)}).then(()=>{var w;a=void 0,o()||(w=e.onContinue)==null||w.call(e)}),S=()=>{if(o())return;let w;const k=n===0?e.initialPromise:void 0;try{w=k??e.fn()}catch(_){w=Promise.reject(_)}Promise.resolve(w).then(g).catch(_=>{var j;if(o())return;const A=e.retry??(ic.isServer()?0:3),T=e.retryDelay??uN,D=typeof T=="function"?T(n,_):T,$=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,_);if(t||!$){x(_);return}n++,(j=e.onFail)==null||j.call(e,n,_),iN(D).then(()=>h()?void 0:v()).then(()=>{t?x(_):S()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(a==null||a(),s),cancelRetry:f,continueRetry:d,canStart:y,start:()=>(y()?S():v().then(S),s)}}var ts,lE,vE=(lE=class{constructor(){Te(this,ts)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$m(this.gcTime)&&be(this,ts,Xr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ic.isServer()?1/0:300*1e3))}clearGcTimeout(){z(this,ts)!==void 0&&(Xr.clearTimeout(z(this,ts)),be(this,ts,void 0))}},ts=new WeakMap,lE),ns,xl,bi,is,nn,fc,as,ni,EE,va,oE,fN=(oE=class extends vE{constructor(t){super();Te(this,ni);Te(this,ns);Te(this,xl);Te(this,bi);Te(this,is);Te(this,nn);Te(this,fc);Te(this,as);be(this,as,!1),be(this,fc,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,is,t.client),be(this,bi,z(this,is).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,ns,Nv(this.options)),this.state=t.state??z(this,ns),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=z(this,nn))==null?void 0:t.promise}setOptions(t){if(this.options={...z(this,fc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Nv(this.options);n.data!==void 0&&(this.setState(kv(n.data,n.dataUpdatedAt)),be(this,ns,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,bi).remove(this)}setData(t,n){const a=qm(this.state.data,t,this.options);return $e(this,ni,va).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){$e(this,ni,va).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,s;const n=(a=z(this,nn))==null?void 0:a.promise;return(s=z(this,nn))==null||s.cancel(t),n?n.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return z(this,ns)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>yi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Op||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>xr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!pE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,nn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,nn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,bi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(z(this,nn)&&(z(this,as)||$e(this,ni,EE).call(this)?z(this,nn).cancel({revert:!0}):z(this,nn).cancelRetry()),this.scheduleGc()),z(this,bi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,ni,va).call(this,{type:"invalidate"})}async fetch(t,n){var d,h,y,g,x,v,S,w,k,_,A,T;if(this.state.fetchStatus!=="idle"&&((d=z(this,nn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,nn))return z(this,nn).continueRetry(),z(this,nn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const D=this.observers.find($=>$.options.queryFn);D&&this.setOptions(D.options)}const a=new AbortController,s=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>(be(this,as,!0),a.signal)})},o=()=>{const D=bE(this.options,n),j=(()=>{const q={client:z(this,is),queryKey:this.queryKey,meta:this.meta};return s(q),q})();return be(this,as,!1),this.options.persister?this.options.persister(D,j,this):D(j)},f=(()=>{const D={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:z(this,is),state:this.state,fetchFn:o};return s(D),D})();(h=this.options.behavior)==null||h.onFetch(f,this),be(this,xl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&$e(this,ni,va).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),be(this,nn,xE({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:D=>{D instanceof Km&&D.revert&&this.setState({...z(this,xl),fetchStatus:"idle"}),a.abort()},onFail:(D,$)=>{$e(this,ni,va).call(this,{type:"failed",failureCount:D,error:$})},onPause:()=>{$e(this,ni,va).call(this,{type:"pause"})},onContinue:()=>{$e(this,ni,va).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const D=await z(this,nn).start();if(D===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(D),(v=(x=z(this,bi).config).onSuccess)==null||v.call(x,D,this),(w=(S=z(this,bi).config).onSettled)==null||w.call(S,D,this.state.error,this),D}catch(D){if(D instanceof Km){if(D.silent)return z(this,nn).promise;if(D.revert){if(this.state.data===void 0)throw D;return this.state.data}}throw $e(this,ni,va).call(this,{type:"error",error:D}),(_=(k=z(this,bi).config).onError)==null||_.call(k,D,this),(T=(A=z(this,bi).config).onSettled)==null||T.call(A,this.state.data,D,this),D}finally{this.scheduleGc()}}},ns=new WeakMap,xl=new WeakMap,bi=new WeakMap,is=new WeakMap,nn=new WeakMap,fc=new WeakMap,as=new WeakMap,ni=new WeakSet,EE=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},va=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...SE(a.data,this.options),fetchMeta:t.meta??null};case"success":const s={...a,...kv(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return be(this,xl,t.manual?s:void 0),s;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),en.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),z(this,bi).notify({query:this,type:"updated",action:t})})},oE);function SE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function kv(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Nv(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Un,et,dc,wn,rs,vl,Ea,hr,hc,El,Sl,ss,ls,mr,wl,st,Xo,Gm,Qm,Ym,Vm,Xm,Zm,Wm,wE,cE,dN=(cE=class extends Ml{constructor(t,n){super();Te(this,st);Te(this,Un);Te(this,et);Te(this,dc);Te(this,wn);Te(this,rs);Te(this,vl);Te(this,Ea);Te(this,hr);Te(this,hc);Te(this,El);Te(this,Sl);Te(this,ss);Te(this,ls);Te(this,mr);Te(this,wl,new Set);this.options=n,be(this,Un,t),be(this,hr,null),be(this,Ea,Hm()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,et).addObserver(this),Tv(z(this,et),this.options)?$e(this,st,Xo).call(this):this.updateResult(),$e(this,st,Vm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jm(z(this,et),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jm(z(this,et),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$e(this,st,Xm).call(this),$e(this,st,Zm).call(this),z(this,et).removeObserver(this)}setOptions(t){const n=this.options,a=z(this,et);if(this.options=z(this,Un).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yi(this.options.enabled,z(this,et))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$e(this,st,Wm).call(this),z(this,et).setOptions(this.options),n._defaulted&&!pf(this.options,n)&&z(this,Un).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,et),observer:this});const s=this.hasListeners();s&&Cv(z(this,et),a,this.options,n)&&$e(this,st,Xo).call(this),this.updateResult(),s&&(z(this,et)!==a||yi(this.options.enabled,z(this,et))!==yi(n.enabled,z(this,et))||xr(this.options.staleTime,z(this,et))!==xr(n.staleTime,z(this,et)))&&$e(this,st,Gm).call(this);const o=$e(this,st,Qm).call(this);s&&(z(this,et)!==a||yi(this.options.enabled,z(this,et))!==yi(n.enabled,z(this,et))||o!==z(this,mr))&&$e(this,st,Ym).call(this,o)}getOptimisticResult(t){const n=z(this,Un).getQueryCache().build(z(this,Un),t),a=this.createResult(n,t);return mN(this,a)&&(be(this,wn,a),be(this,vl,this.options),be(this,rs,z(this,et).state)),a}getCurrentResult(){return z(this,wn)}trackResult(t,n){return new Proxy(t,{get:(a,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&z(this,Ea).status==="pending"&&z(this,Ea).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,s))})}trackProp(t){z(this,wl).add(t)}getCurrentQuery(){return z(this,et)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=z(this,Un).defaultQueryOptions(t),a=z(this,Un).getQueryCache().build(z(this,Un),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return $e(this,st,Xo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,wn)))}createResult(t,n){var Z;const a=z(this,et),s=this.options,o=z(this,wn),c=z(this,rs),f=z(this,vl),h=t!==a?t.state:z(this,dc),{state:y}=t;let g={...y},x=!1,v;if(n._optimisticResults){const O=this.hasListeners(),P=!O&&Tv(t,n),G=O&&Cv(t,a,n,s);(P||G)&&(g={...g,...SE(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:k}=g;v=g.data;let _=!1;if(n.placeholderData!==void 0&&v===void 0&&k==="pending"){let O;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(O=o.data,_=!0):O=typeof n.placeholderData=="function"?n.placeholderData((Z=z(this,Sl))==null?void 0:Z.state.data,z(this,Sl)):n.placeholderData,O!==void 0&&(k="success",v=qm(o==null?void 0:o.data,O,n),x=!0)}if(n.select&&v!==void 0&&!_)if(o&&v===(c==null?void 0:c.data)&&n.select===z(this,hc))v=z(this,El);else try{be(this,hc,n.select),v=n.select(v),v=qm(o==null?void 0:o.data,v,n),be(this,El,v),be(this,hr,null)}catch(O){be(this,hr,O)}z(this,hr)&&(S=z(this,hr),v=z(this,El),w=Date.now(),k="error");const A=g.fetchStatus==="fetching",T=k==="pending",D=k==="error",$=T&&A,j=v!==void 0,U={status:k,fetchStatus:g.fetchStatus,isPending:T,isSuccess:k==="success",isError:D,isInitialLoading:$,isLoading:$,data:v,dataUpdatedAt:g.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:A,isRefetching:A&&!T,isLoadingError:D&&!j,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:D&&j,isStale:Mp(t,n),refetch:this.refetch,promise:z(this,Ea),isEnabled:yi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=U.data!==void 0,P=U.status==="error"&&!O,G=W=>{P?W.reject(U.error):O&&W.resolve(U.data)},le=()=>{const W=be(this,Ea,U.promise=Hm());G(W)},ae=z(this,Ea);switch(ae.status){case"pending":t.queryHash===a.queryHash&&G(ae);break;case"fulfilled":(P||U.data!==ae.value)&&le();break;case"rejected":(!P||U.error!==ae.reason)&&le();break}}return U}updateResult(){const t=z(this,wn),n=this.createResult(z(this,et),this.options);if(be(this,rs,z(this,et).state),be(this,vl,this.options),z(this,rs).data!==void 0&&be(this,Sl,z(this,et)),pf(n,t))return;be(this,wn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!z(this,wl).size)return!0;const c=new Set(o??z(this,wl));return this.options.throwOnError&&c.add("error"),Object.keys(z(this,wn)).some(f=>{const d=f;return z(this,wn)[d]!==t[d]&&c.has(d)})};$e(this,st,wE).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$e(this,st,Vm).call(this)}},Un=new WeakMap,et=new WeakMap,dc=new WeakMap,wn=new WeakMap,rs=new WeakMap,vl=new WeakMap,Ea=new WeakMap,hr=new WeakMap,hc=new WeakMap,El=new WeakMap,Sl=new WeakMap,ss=new WeakMap,ls=new WeakMap,mr=new WeakMap,wl=new WeakMap,st=new WeakSet,Xo=function(t){$e(this,st,Wm).call(this);let n=z(this,et).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kn)),n},Gm=function(){$e(this,st,Xm).call(this);const t=xr(this.options.staleTime,z(this,et));if(ic.isServer()||z(this,wn).isStale||!$m(t))return;const a=pE(z(this,wn).dataUpdatedAt,t)+1;be(this,ss,Xr.setTimeout(()=>{z(this,wn).isStale||this.updateResult()},a))},Qm=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,et)):this.options.refetchInterval)??!1},Ym=function(t){$e(this,st,Zm).call(this),be(this,mr,t),!(ic.isServer()||yi(this.options.enabled,z(this,et))===!1||!$m(z(this,mr))||z(this,mr)===0)&&be(this,ls,Xr.setInterval(()=>{(this.options.refetchIntervalInBackground||Cp.isFocused())&&$e(this,st,Xo).call(this)},z(this,mr)))},Vm=function(){$e(this,st,Gm).call(this),$e(this,st,Ym).call(this,$e(this,st,Qm).call(this))},Xm=function(){z(this,ss)!==void 0&&(Xr.clearTimeout(z(this,ss)),be(this,ss,void 0))},Zm=function(){z(this,ls)!==void 0&&(Xr.clearInterval(z(this,ls)),be(this,ls,void 0))},Wm=function(){const t=z(this,Un).getQueryCache().build(z(this,Un),this.options);if(t===z(this,et))return;const n=z(this,et);be(this,et,t),be(this,dc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},wE=function(t){en.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(z(this,wn))}),z(this,Un).getQueryCache().notify({query:z(this,et),type:"observerResultsUpdated"})})},cE);function hN(e,t){return yi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Tv(e,t){return hN(e,t)||e.state.data!==void 0&&Jm(e,t,t.refetchOnMount)}function Jm(e,t,n){if(yi(t.enabled,e)!==!1&&xr(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Mp(e,t)}return!1}function Cv(e,t,n,a){return(e!==t||yi(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Mp(e,n)}function Mp(e,t){return yi(t.enabled,e)!==!1&&e.isStaleByTime(xr(t.staleTime,e))}function mN(e,t){return!pf(e.getCurrentResult(),t)}function Av(e){return{onFetch:(t,n)=>{var y,g,x,v,S;const a=t.options,s=(x=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:x.direction,o=((v=t.state.data)==null?void 0:v.pages)||[],c=((S=t.state.data)==null?void 0:S.pageParams)||[];let f={pages:[],pageParams:[]},d=0;const h=async()=>{let w=!1;const k=T=>{sN(T,()=>t.signal,()=>w=!0)},_=bE(t.options,t.fetchOptions),A=async(T,D,$)=>{if(w)return Promise.reject();if(D==null&&T.pages.length)return Promise.resolve(T);const q=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:D,direction:$?"backward":"forward",meta:t.options.meta};return k(P),P})(),U=await _(q),{maxPages:Z}=t.options,O=$?rN:aN;return{pages:O(T.pages,U,Z),pageParams:O(T.pageParams,D,Z)}};if(s&&o.length){const T=s==="backward",D=T?pN:Ov,$={pages:o,pageParams:c},j=D(a,$);f=await A($,j,T)}else{const T=e??o.length;do{const D=d===0?c[0]??a.initialPageParam:Ov(a,f);if(d>0&&D==null)break;f=await A(f,D),d++}while(d<T)}return f};t.options.persister?t.fetchFn=()=>{var w,k;return(k=(w=t.options).persister)==null?void 0:k.call(w,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function Ov(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function pN(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var mc,Ki,mn,os,Gi,or,uE,gN=(uE=class extends vE{constructor(t){super();Te(this,Gi);Te(this,mc);Te(this,Ki);Te(this,mn);Te(this,os);be(this,mc,t.client),this.mutationId=t.mutationId,be(this,mn,t.mutationCache),be(this,Ki,[]),this.state=t.state||_E(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,Ki).includes(t)||(z(this,Ki).push(t),this.clearGcTimeout(),z(this,mn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,Ki,z(this,Ki).filter(n=>n!==t)),this.scheduleGc(),z(this,mn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,Ki).length||(this.state.status==="pending"?this.scheduleGc():z(this,mn).remove(this))}continue(){var t;return((t=z(this,os))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,d,h,y,g,x,v,S,w,k,_,A,T,D,$,j,q;const n=()=>{$e(this,Gi,or).call(this,{type:"continue"})},a={client:z(this,mc),meta:this.options.meta,mutationKey:this.options.mutationKey};be(this,os,xE({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,Z)=>{$e(this,Gi,or).call(this,{type:"failed",failureCount:U,error:Z})},onPause:()=>{$e(this,Gi,or).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,mn).canRun(this)}));const s=this.state.status==="pending",o=!z(this,os).canStart();try{if(s)n();else{$e(this,Gi,or).call(this,{type:"pending",variables:t,isPaused:o}),z(this,mn).config.onMutate&&await z(this,mn).config.onMutate(t,this,a);const Z=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));Z!==this.state.context&&$e(this,Gi,or).call(this,{type:"pending",context:Z,variables:t,isPaused:o})}const U=await z(this,os).start();return await((h=(d=z(this,mn).config).onSuccess)==null?void 0:h.call(d,U,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,U,t,this.state.context,a)),await((v=(x=z(this,mn).config).onSettled)==null?void 0:v.call(x,U,null,this.state.variables,this.state.context,this,a)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,U,null,t,this.state.context,a)),$e(this,Gi,or).call(this,{type:"success",data:U}),U}catch(U){try{await((_=(k=z(this,mn).config).onError)==null?void 0:_.call(k,U,t,this.state.context,this,a))}catch(Z){Promise.reject(Z)}try{await((T=(A=this.options).onError)==null?void 0:T.call(A,U,t,this.state.context,a))}catch(Z){Promise.reject(Z)}try{await(($=(D=z(this,mn).config).onSettled)==null?void 0:$.call(D,void 0,U,this.state.variables,this.state.context,this,a))}catch(Z){Promise.reject(Z)}try{await((q=(j=this.options).onSettled)==null?void 0:q.call(j,void 0,U,t,this.state.context,a))}catch(Z){Promise.reject(Z)}throw $e(this,Gi,or).call(this,{type:"error",error:U}),U}finally{z(this,mn).runNext(this)}}},mc=new WeakMap,Ki=new WeakMap,mn=new WeakMap,os=new WeakMap,Gi=new WeakSet,or=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),en.batch(()=>{z(this,Ki).forEach(a=>{a.onMutationUpdate(t)}),z(this,mn).notify({mutation:this,type:"updated",action:t})})},uE);function _E(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Sa,Oi,pc,fE,bN=(fE=class extends Ml{constructor(t={}){super();Te(this,Sa);Te(this,Oi);Te(this,pc);this.config=t,be(this,Sa,new Set),be(this,Oi,new Map),be(this,pc,0)}build(t,n,a){const s=new gN({client:t,mutationCache:this,mutationId:++Pu(this,pc)._,options:t.defaultMutationOptions(n),state:a});return this.add(s),s}add(t){z(this,Sa).add(t);const n=qu(t);if(typeof n=="string"){const a=z(this,Oi).get(n);a?a.push(t):z(this,Oi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,Sa).delete(t)){const n=qu(t);if(typeof n=="string"){const a=z(this,Oi).get(n);if(a)if(a.length>1){const s=a.indexOf(t);s!==-1&&a.splice(s,1)}else a[0]===t&&z(this,Oi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=qu(t);if(typeof n=="string"){const a=z(this,Oi).get(n),s=a==null?void 0:a.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var a;const n=qu(t);if(typeof n=="string"){const s=(a=z(this,Oi).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){en.batch(()=>{z(this,Sa).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,Sa).clear(),z(this,Oi).clear()})}getAll(){return Array.from(z(this,Sa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>Sv(n,a))}findAll(t={}){return this.getAll().filter(n=>Sv(t,n))}notify(t){en.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return en.batch(()=>Promise.all(t.map(n=>n.continue().catch(kn))))}},Sa=new WeakMap,Oi=new WeakMap,pc=new WeakMap,fE);function qu(e){var t;return(t=e.options.scope)==null?void 0:t.id}var wa,pr,Fn,_a,Ta,lf,ep,dE,yN=(dE=class extends Ml{constructor(n,a){super();Te(this,Ta);Te(this,wa);Te(this,pr);Te(this,Fn);Te(this,_a);be(this,wa,n),this.setOptions(a),this.bindMethods(),$e(this,Ta,lf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const a=this.options;this.options=z(this,wa).defaultMutationOptions(n),pf(this.options,a)||z(this,wa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:z(this,Fn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&cs(a.mutationKey)!==cs(this.options.mutationKey)?this.reset():((s=z(this,Fn))==null?void 0:s.state.status)==="pending"&&z(this,Fn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=z(this,Fn))==null||n.removeObserver(this)}onMutationUpdate(n){$e(this,Ta,lf).call(this),$e(this,Ta,ep).call(this,n)}getCurrentResult(){return z(this,pr)}reset(){var n;(n=z(this,Fn))==null||n.removeObserver(this),be(this,Fn,void 0),$e(this,Ta,lf).call(this),$e(this,Ta,ep).call(this)}mutate(n,a){var s;return be(this,_a,a),(s=z(this,Fn))==null||s.removeObserver(this),be(this,Fn,z(this,wa).getMutationCache().build(z(this,wa),this.options)),z(this,Fn).addObserver(this),z(this,Fn).execute(n)}},wa=new WeakMap,pr=new WeakMap,Fn=new WeakMap,_a=new WeakMap,Ta=new WeakSet,lf=function(){var a;const n=((a=z(this,Fn))==null?void 0:a.state)??_E();be(this,pr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ep=function(n){en.batch(()=>{var a,s,o,c,f,d,h,y;if(z(this,_a)&&this.hasListeners()){const g=z(this,pr).variables,x=z(this,pr).context,v={client:z(this,wa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(a=z(this,_a)).onSuccess)==null||s.call(a,n.data,g,x,v)}catch(S){Promise.reject(S)}try{(c=(o=z(this,_a)).onSettled)==null||c.call(o,n.data,null,g,x,v)}catch(S){Promise.reject(S)}}else if((n==null?void 0:n.type)==="error"){try{(d=(f=z(this,_a)).onError)==null||d.call(f,n.error,g,x,v)}catch(S){Promise.reject(S)}try{(y=(h=z(this,_a)).onSettled)==null||y.call(h,void 0,n.error,g,x,v)}catch(S){Promise.reject(S)}}}this.listeners.forEach(g=>{g(z(this,pr))})})},dE),Qi,hE,xN=(hE=class extends Ml{constructor(t={}){super();Te(this,Qi);this.config=t,be(this,Qi,new Map)}build(t,n,a){const s=n.queryKey,o=n.queryHash??Ap(s,n);let c=this.get(o);return c||(c=new fN({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){z(this,Qi).has(t.queryHash)||(z(this,Qi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=z(this,Qi).get(t.queryHash);n&&(t.destroy(),n===t&&z(this,Qi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){en.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,Qi).get(t)}getAll(){return[...z(this,Qi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>Ev(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>Ev(t,a)):n}notify(t){en.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){en.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){en.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qi=new WeakMap,hE),Bt,gr,br,_l,kl,yr,Nl,Tl,mE,vN=(mE=class{constructor(e={}){Te(this,Bt);Te(this,gr);Te(this,br);Te(this,_l);Te(this,kl);Te(this,yr);Te(this,Nl);Te(this,Tl);be(this,Bt,e.queryCache||new xN),be(this,gr,e.mutationCache||new bN),be(this,br,e.defaultOptions||{}),be(this,_l,new Map),be(this,kl,new Map),be(this,yr,0)}mount(){Pu(this,yr)._++,z(this,yr)===1&&(be(this,Nl,Cp.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Bt).onFocus())})),be(this,Tl,gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Bt).onOnline())})))}unmount(){var e,t;Pu(this,yr)._--,z(this,yr)===0&&((e=z(this,Nl))==null||e.call(this),be(this,Nl,void 0),(t=z(this,Tl))==null||t.call(this),be(this,Tl,void 0))}isFetching(e){return z(this,Bt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,gr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,Bt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=z(this,Bt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(xr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return z(this,Bt).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),s=z(this,Bt).get(a.queryHash),o=s==null?void 0:s.state.data,c=tN(t,o);if(c!==void 0)return z(this,Bt).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return en.batch(()=>z(this,Bt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,Bt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=z(this,Bt);en.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=z(this,Bt);return en.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=en.batch(()=>z(this,Bt).findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(kn).catch(kn)}invalidateQueries(e,t={}){return en.batch(()=>(z(this,Bt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=en.batch(()=>z(this,Bt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(kn)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=z(this,Bt).build(this,t);return n.isStaleByTime(xr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}fetchInfiniteQuery(e){return e.behavior=Av(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e.behavior=Av(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return gf.isOnline()?z(this,gr).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,Bt)}getMutationCache(){return z(this,gr)}getDefaultOptions(){return z(this,br)}setDefaultOptions(e){be(this,br,e)}setQueryDefaults(e,t){z(this,_l).set(cs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,_l).values()],n={};return t.forEach(a=>{nc(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){z(this,kl).set(cs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,kl).values()],n={};return t.forEach(a=>{nc(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,br).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ap(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Op&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,br).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,Bt).clear(),z(this,gr).clear()}},Bt=new WeakMap,gr=new WeakMap,br=new WeakMap,_l=new WeakMap,kl=new WeakMap,yr=new WeakMap,Nl=new WeakMap,Tl=new WeakMap,mE),kE=M.createContext(void 0),qn=e=>{const t=M.useContext(kE);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},EN=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(kE.Provider,{value:e,children:t})),NE=M.createContext(!1),SN=()=>M.useContext(NE);NE.Provider;function wN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var _N=M.createContext(wN()),kN=()=>M.useContext(_N),NN=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Rp(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},TN=e=>{M.useEffect(()=>{e.clearReset()},[e])},CN=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||Rp(n,[e.error,a])),AN=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>n(a(...s)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ON=(e,t)=>e.isLoading&&e.isFetching&&!t,RN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Rv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function MN(e,t,n){var x,v,S,w;const a=SN(),s=kN(),o=qn(),c=o.defaultQueryOptions(e);(v=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||v.call(x,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",AN(c),NN(c,s,f),TN(s);const d=!o.getQueryCache().get(c.queryHash),[h]=M.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(k=>{const _=g?h.subscribe(en.batchCalls(k)):kn;return h.updateResult(),_},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),M.useEffect(()=>{h.setOptions(c)},[c,h]),RN(c,y))throw Rv(c,h,s);if(CN({result:y,errorResetBoundary:s,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((w=(S=o.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||w.call(S,c,y),c.experimental_prefetchInRender&&!ic.isServer()&&ON(y,a)){const k=d?Rv(c,h,s):f==null?void 0:f.promise;k==null||k.catch(kn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function lt(e,t){return MN(e,dN)}function Pn(e,t){const n=qn(),[a]=M.useState(()=>new yN(n,e));M.useEffect(()=>{a.setOptions(e)},[a,e]);const s=M.useSyncExternalStore(M.useCallback(c=>a.subscribe(en.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=M.useCallback((c,f)=>{a.mutate(c,f).catch(kn)},[a]);if(s.error&&Rp(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}/**
|
|
50
50
|
* react-router v7.14.2
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,9 +55,9 @@ Error generating stack: `+u.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/var Mv="popstate";function jv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jN(e={}){function t(a,s){var h;let o=(h=s.state)==null?void 0:h.masked,{pathname:c,search:f,hash:d}=o||a.location;return tp("",{pathname:c,search:f,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,s){return typeof s=="string"?s:ac(s)}return LN(t,n,null,e)}function Ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ei(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DN(){return Math.random().toString(36).substring(2,10)}function Dv(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function tp(e,t,n=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jl(t):t,state:n,key:t&&t.key||a||DN(),unstable_mask:s}}function ac({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function LN(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:o=!1}=a,c=s.history,f="POP",d=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let k=y(),_=k==null?null:k-h;h=k,d&&d({action:f,location:w.location,delta:_})}function x(k,_){f="PUSH";let A=jv(k)?k:tp(w.location,k,_);h=y()+1;let T=Dv(A,h),D=w.createHref(A.unstable_mask||A);try{c.pushState(T,"",D)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;s.location.assign(D)}o&&d&&d({action:f,location:w.location,delta:1})}function v(k,_){f="REPLACE";let A=jv(k)?k:tp(w.location,k,_);h=y();let T=Dv(A,h),D=w.createHref(A.unstable_mask||A);c.replaceState(T,"",D),o&&d&&d({action:f,location:w.location,delta:0})}function S(k){return IN(k)}let w={get action(){return f},get location(){return e(s,c)},listen(k){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(Mv,g),d=k,()=>{s.removeEventListener(Mv,g),d=null}},createHref(k){return t(s,k)},createURL:S,encodeLocation(k){let _=S(k);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:x,replace:v,go(k){return c.go(k)}};return w}function IN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ct(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ac(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function TE(e,t,n="/"){return zN(e,t,n,!1)}function zN(e,t,n,a){let s=typeof t=="string"?jl(t):t,o=Ca(s.pathname||"/",n);if(o==null)return null;let c=CE(e);BN(c);let f=null;for(let d=0;f==null&&d<c.length;++d){let h=VN(o);f=QN(c[d],h,a)}return f}function CE(e,t=[],n=[],a="",s=!1){let o=(c,f,d=s,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&d)return;Ct(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Ri([a,y.relativePath]),x=n.concat(y);c.children&&c.children.length>0&&(Ct(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),CE(c.children,t,x,g,d)),!(c.path==null&&!c.index)&&t.push({path:g,score:KN(g,c.index),routesMeta:x})};return e.forEach((c,f)=>{var d;if(c.path===""||!((d=c.path)!=null&&d.includes("?")))o(c,f);else for(let h of AE(c.path))o(c,f,!0,h)}),t}function AE(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return s?[o,""]:[o];let c=AE(a.join("/")),f=[];return f.push(...c.map(d=>d===""?o:[o,d].join("/"))),s&&f.push(...c),f.map(d=>e.startsWith("/")&&d===""?"/":d)}function BN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GN(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var UN=/^:[\w-]+$/,FN=3,$N=2,PN=1,qN=10,HN=-2,Lv=e=>e==="*";function KN(e,t){let n=e.split("/"),a=n.length;return n.some(Lv)&&(a+=HN),t&&(a+=$N),n.filter(s=>!Lv(s)).reduce((s,o)=>s+(UN.test(o)?FN:o===""?PN:qN),a)}function GN(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function QN(e,t,n=!1){let{routesMeta:a}=e,s={},o="/",c=[];for(let f=0;f<a.length;++f){let d=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=bf({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},y),x=d.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=bf({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},y)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:Ri([o,g.pathname]),pathnameBase:JN(Ri([o,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(o=Ri([o,g.pathnameBase]))}return c}function bf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=YN(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],c=o.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},x)=>{if(y==="*"){let S=f[x]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const v=f[x];return g&&!v?h[y]=void 0:h[y]=(v||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function YN(e,t=!1,n=!0){Ei(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,d,h,y)=>{if(a.push({paramName:f,isOptional:d!=null}),d){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function VN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ei(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ca(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var XN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ZN(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?jl(e):e,o;return n?(n=OE(n),n.startsWith("/")?o=Iv(n.substring(1),"/"):o=Iv(n,t)):o=t,{pathname:o,search:eT(a),hash:tT(s)}}function Iv(e,t){let n=yf(t).split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function om(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function WN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function jp(e){let t=WN(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Of(e,t,n,a=!1){let s;typeof e=="string"?s=jl(e):(s={...e},Ct(!s.pathname||!s.pathname.includes("?"),om("?","pathname","search",s)),Ct(!s.pathname||!s.pathname.includes("#"),om("#","pathname","hash",s)),Ct(!s.search||!s.search.includes("#"),om("#","search","hash",s)));let o=e===""||s.pathname==="",c=o?"/":s.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}f=g>=0?t[g]:"/"}let d=ZN(s,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||y)&&(d.pathname+="/"),d}var OE=e=>e.replace(/\/\/+/g,"/"),Ri=e=>OE(e.join("/")),yf=e=>e.replace(/\/+$/,""),JN=e=>yf(e).replace(/^\/*/,"/"),eT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,nT=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function iT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aT(e){let t=e.map(n=>n.route.path).filter(Boolean);return Ri(t)||"/"}var RE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ME(e,t){let n=e;if(typeof n!="string"||!XN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(RE)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ca(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:s=!0}catch{Ei(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var jE=["POST","PUT","PATCH","DELETE"];new Set(jE);var rT=["GET",...jE];new Set(rT);var Dl=M.createContext(null);Dl.displayName="DataRouter";var Rf=M.createContext(null);Rf.displayName="DataRouterState";var DE=M.createContext(!1);function sT(){return M.useContext(DE)}var LE=M.createContext({isTransitioning:!1});LE.displayName="ViewTransition";var lT=M.createContext(new Map);lT.displayName="Fetchers";var oT=M.createContext(null);oT.displayName="Await";var ri=M.createContext(null);ri.displayName="Navigation";var gc=M.createContext(null);gc.displayName="Location";var wi=M.createContext({outlet:null,matches:[],isDataRoute:!1});wi.displayName="Route";var Dp=M.createContext(null);Dp.displayName="RouteError";var IE="REACT_ROUTER_ERROR",cT="REDIRECT",uT="ROUTE_ERROR_RESPONSE";function fT(e){if(e.startsWith(`${IE}:${cT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function dT(e){if(e.startsWith(`${IE}:${uT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new nT(t.status,t.statusText,t.data)}catch{}}function hT(e,{relative:t}={}){Ct(Ll(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=M.useContext(ri),{hash:s,pathname:o,search:c}=bc(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Ri([n,o])),a.createHref({pathname:f,search:c,hash:s})}function Ll(){return M.useContext(gc)!=null}function ji(){return Ct(Ll(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(gc).location}var zE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function BE(e){M.useContext(ri).static||M.useLayoutEffect(e)}function Sr(){let{isDataRoute:e}=M.useContext(wi);return e?CT():mT()}function mT(){Ct(Ll(),"useNavigate() may be used only in the context of a <Router> component.");let e=M.useContext(Dl),{basename:t,navigator:n}=M.useContext(ri),{matches:a}=M.useContext(wi),{pathname:s}=ji(),o=JSON.stringify(jp(a)),c=M.useRef(!1);return BE(()=>{c.current=!0}),M.useCallback((d,h={})=>{if(Ei(c.current,zE),!c.current)return;if(typeof d=="number"){n.go(d);return}let y=Of(d,JSON.parse(o),s,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Ri([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,s,e])}var pT=M.createContext(null);function gT(e){let t=M.useContext(wi).outlet;return M.useMemo(()=>t&&M.createElement(pT.Provider,{value:e},t),[t,e])}function UE(){let{matches:e}=M.useContext(wi),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function bc(e,{relative:t}={}){let{matches:n}=M.useContext(wi),{pathname:a}=ji(),s=JSON.stringify(jp(n));return M.useMemo(()=>Of(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function bT(e,t){return FE(e,t)}function FE(e,t,n){var k;Ct(Ll(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=M.useContext(ri),{matches:s}=M.useContext(wi),o=s[s.length-1],c=o?o.params:{},f=o?o.pathname:"/",d=o?o.pathnameBase:"/",h=o&&o.route;{let _=h&&h.path||"";PE(f,!h||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${_}">) 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.
|
|
58
|
+
*/var Mv="popstate";function jv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jN(e={}){function t(a,s){var h;let o=(h=s.state)==null?void 0:h.masked,{pathname:c,search:f,hash:d}=o||a.location;return tp("",{pathname:c,search:f,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,s){return typeof s=="string"?s:ac(s)}return LN(t,n,null,e)}function Ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ei(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DN(){return Math.random().toString(36).substring(2,10)}function Dv(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function tp(e,t,n=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jl(t):t,state:n,key:t&&t.key||a||DN(),unstable_mask:s}}function ac({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function jl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function LN(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:o=!1}=a,c=s.history,f="POP",d=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let k=y(),_=k==null?null:k-h;h=k,d&&d({action:f,location:w.location,delta:_})}function x(k,_){f="PUSH";let A=jv(k)?k:tp(w.location,k,_);h=y()+1;let T=Dv(A,h),D=w.createHref(A.unstable_mask||A);try{c.pushState(T,"",D)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;s.location.assign(D)}o&&d&&d({action:f,location:w.location,delta:1})}function v(k,_){f="REPLACE";let A=jv(k)?k:tp(w.location,k,_);h=y();let T=Dv(A,h),D=w.createHref(A.unstable_mask||A);c.replaceState(T,"",D),o&&d&&d({action:f,location:w.location,delta:0})}function S(k){return IN(k)}let w={get action(){return f},get location(){return e(s,c)},listen(k){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(Mv,g),d=k,()=>{s.removeEventListener(Mv,g),d=null}},createHref(k){return t(s,k)},createURL:S,encodeLocation(k){let _=S(k);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:x,replace:v,go(k){return c.go(k)}};return w}function IN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ct(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ac(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function TE(e,t,n="/"){return zN(e,t,n,!1)}function zN(e,t,n,a){let s=typeof t=="string"?jl(t):t,o=Ca(s.pathname||"/",n);if(o==null)return null;let c=CE(e);BN(c);let f=null;for(let d=0;f==null&&d<c.length;++d){let h=VN(o);f=QN(c[d],h,a)}return f}function CE(e,t=[],n=[],a="",s=!1){let o=(c,f,d=s,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&d)return;Ct(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Ri([a,y.relativePath]),x=n.concat(y);c.children&&c.children.length>0&&(Ct(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),CE(c.children,t,x,g,d)),!(c.path==null&&!c.index)&&t.push({path:g,score:KN(g,c.index),routesMeta:x})};return e.forEach((c,f)=>{var d;if(c.path===""||!((d=c.path)!=null&&d.includes("?")))o(c,f);else for(let h of AE(c.path))o(c,f,!0,h)}),t}function AE(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return s?[o,""]:[o];let c=AE(a.join("/")),f=[];return f.push(...c.map(d=>d===""?o:[o,d].join("/"))),s&&f.push(...c),f.map(d=>e.startsWith("/")&&d===""?"/":d)}function BN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GN(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var UN=/^:[\w-]+$/,FN=3,$N=2,PN=1,qN=10,HN=-2,Lv=e=>e==="*";function KN(e,t){let n=e.split("/"),a=n.length;return n.some(Lv)&&(a+=HN),t&&(a+=$N),n.filter(s=>!Lv(s)).reduce((s,o)=>s+(UN.test(o)?FN:o===""?PN:qN),a)}function GN(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function QN(e,t,n=!1){let{routesMeta:a}=e,s={},o="/",c=[];for(let f=0;f<a.length;++f){let d=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=bf({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},y),x=d.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=bf({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},y)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:Ri([o,g.pathname]),pathnameBase:JN(Ri([o,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(o=Ri([o,g.pathnameBase]))}return c}function bf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=YN(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],c=o.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},x)=>{if(y==="*"){let S=f[x]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const v=f[x];return g&&!v?h[y]=void 0:h[y]=(v||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function YN(e,t=!1,n=!0){Ei(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,d,h,y)=>{if(a.push({paramName:f,isOptional:d!=null}),d){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function VN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ei(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ca(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var XN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ZN(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?jl(e):e,o;return n?(n=OE(n),n.startsWith("/")?o=Iv(n.substring(1),"/"):o=Iv(n,t)):o=t,{pathname:o,search:eT(a),hash:tT(s)}}function Iv(e,t){let n=yf(t).split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function om(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function WN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function jp(e){let t=WN(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Of(e,t,n,a=!1){let s;typeof e=="string"?s=jl(e):(s={...e},Ct(!s.pathname||!s.pathname.includes("?"),om("?","pathname","search",s)),Ct(!s.pathname||!s.pathname.includes("#"),om("#","pathname","hash",s)),Ct(!s.search||!s.search.includes("#"),om("#","search","hash",s)));let o=e===""||s.pathname==="",c=o?"/":s.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}f=g>=0?t[g]:"/"}let d=ZN(s,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||y)&&(d.pathname+="/"),d}var OE=e=>e.replace(/\/\/+/g,"/"),Ri=e=>OE(e.join("/")),yf=e=>e.replace(/\/+$/,""),JN=e=>yf(e).replace(/^\/*/,"/"),eT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,nT=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function iT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aT(e){let t=e.map(n=>n.route.path).filter(Boolean);return Ri(t)||"/"}var RE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ME(e,t){let n=e;if(typeof n!="string"||!XN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(RE)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ca(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:s=!0}catch{Ei(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var jE=["POST","PUT","PATCH","DELETE"];new Set(jE);var rT=["GET",...jE];new Set(rT);var Dl=M.createContext(null);Dl.displayName="DataRouter";var Rf=M.createContext(null);Rf.displayName="DataRouterState";var DE=M.createContext(!1);function sT(){return M.useContext(DE)}var LE=M.createContext({isTransitioning:!1});LE.displayName="ViewTransition";var lT=M.createContext(new Map);lT.displayName="Fetchers";var oT=M.createContext(null);oT.displayName="Await";var ri=M.createContext(null);ri.displayName="Navigation";var gc=M.createContext(null);gc.displayName="Location";var wi=M.createContext({outlet:null,matches:[],isDataRoute:!1});wi.displayName="Route";var Dp=M.createContext(null);Dp.displayName="RouteError";var IE="REACT_ROUTER_ERROR",cT="REDIRECT",uT="ROUTE_ERROR_RESPONSE";function fT(e){if(e.startsWith(`${IE}:${cT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function dT(e){if(e.startsWith(`${IE}:${uT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new nT(t.status,t.statusText,t.data)}catch{}}function hT(e,{relative:t}={}){Ct(Ll(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=M.useContext(ri),{hash:s,pathname:o,search:c}=bc(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Ri([n,o])),a.createHref({pathname:f,search:c,hash:s})}function Ll(){return M.useContext(gc)!=null}function ji(){return Ct(Ll(),"useLocation() may be used only in the context of a <Router> component."),M.useContext(gc).location}var zE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function BE(e){M.useContext(ri).static||M.useLayoutEffect(e)}function wr(){let{isDataRoute:e}=M.useContext(wi);return e?CT():mT()}function mT(){Ct(Ll(),"useNavigate() may be used only in the context of a <Router> component.");let e=M.useContext(Dl),{basename:t,navigator:n}=M.useContext(ri),{matches:a}=M.useContext(wi),{pathname:s}=ji(),o=JSON.stringify(jp(a)),c=M.useRef(!1);return BE(()=>{c.current=!0}),M.useCallback((d,h={})=>{if(Ei(c.current,zE),!c.current)return;if(typeof d=="number"){n.go(d);return}let y=Of(d,JSON.parse(o),s,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Ri([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,s,e])}var pT=M.createContext(null);function gT(e){let t=M.useContext(wi).outlet;return M.useMemo(()=>t&&M.createElement(pT.Provider,{value:e},t),[t,e])}function UE(){let{matches:e}=M.useContext(wi),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function bc(e,{relative:t}={}){let{matches:n}=M.useContext(wi),{pathname:a}=ji(),s=JSON.stringify(jp(n));return M.useMemo(()=>Of(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function bT(e,t){return FE(e,t)}function FE(e,t,n){var k;Ct(Ll(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=M.useContext(ri),{matches:s}=M.useContext(wi),o=s[s.length-1],c=o?o.params:{},f=o?o.pathname:"/",d=o?o.pathnameBase:"/",h=o&&o.route;{let _=h&&h.path||"";PE(f,!h||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${_}">) 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.
|
|
59
59
|
|
|
60
|
-
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let y=ji(),g;if(t){let _=typeof t=="string"?jl(t):t;Ct(d==="/"||((k=_.pathname)==null?void 0:k.startsWith(d)),`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 "${d}" but pathname "${_.pathname}" was given in the \`location\` prop.`),g=_}else g=y;let x=g.pathname||"/",v=x;if(d!=="/"){let _=d.replace(/^\//,"").split("/");v="/"+x.replace(/^\//,"").split("/").slice(_.length).join("/")}let S=TE(e,{pathname:v});Ei(h||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Ei(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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 w=ST(S&&S.map(_=>Object.assign({},_,{params:Object.assign({},c,_.params),pathname:Ri([d,a.encodeLocation?a.encodeLocation(_.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?d:Ri([d,a.encodeLocation?a.encodeLocation(_.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),s,n);return t&&w?M.createElement(gc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},w):w}function yT(){let e=TT(),t=iT(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=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:o},"ErrorBoundary")," or"," ",M.createElement("code",{style:o},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},t),n?M.createElement("pre",{style:s},n):null,c)}var xT=M.createElement(yT,null),$E=class extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=dT(e.digest);n&&(e=n)}let t=e!==void 0?M.createElement(wi.Provider,{value:this.props.routeContext},M.createElement(Dp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?M.createElement(vT,{error:e},t):t}};$E.contextType=DE;var cm=new WeakMap;function vT({children:e,error:t}){let{basename:n}=M.useContext(ri);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=fT(t.digest);if(a){let s=cm.get(t);if(s)throw s;let o=ME(a.location,n);if(RE&&!cm.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw cm.set(t,c),c}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function ET({routeContext:e,match:t,children:n}){let a=M.useContext(Dl);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),M.createElement(wi.Provider,{value:e},n)}function ST(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,o=a==null?void 0:a.errors;if(o!=null){let y=s.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Ct(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,y+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let y=0;y<s.length;y++){let g=s[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:v}=a,S=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||S){n.isStatic&&(c=!0),f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}}let d=n==null?void 0:n.onError,h=a&&d?(y,g)=>{var x,v;d(y,{location:a.location,params:((v=(x=a.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:aT(a.matches),errorInfo:g})}:void 0;return s.reduceRight((y,g,x)=>{let v,S=!1,w=null,k=null;a&&(v=o&&g.route.id?o[g.route.id]:void 0,w=g.route.errorElement||xT,c&&(f<0&&x===0?(PE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,k=null):f===x&&(S=!0,k=g.route.hydrateFallbackElement||null)));let _=t.concat(s.slice(0,x+1)),A=()=>{let T;return v?T=w:S?T=k:g.route.Component?T=M.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=y,M.createElement(ET,{match:g,routeContext:{outlet:y,matches:_,isDataRoute:a!=null},children:T})};return a&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?M.createElement($E,{location:a.location,revalidation:a.revalidation,component:w,error:v,children:A(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:h}):A()},null)}function Lp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wT(e){let t=M.useContext(Dl);return Ct(t,Lp(e)),t}function _T(e){let t=M.useContext(Rf);return Ct(t,Lp(e)),t}function kT(e){let t=M.useContext(wi);return Ct(t,Lp(e)),t}function Ip(e){let t=kT(e),n=t.matches[t.matches.length-1];return Ct(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function NT(){return Ip("useRouteId")}function TT(){var a;let e=M.useContext(Dp),t=_T("useRouteError"),n=Ip("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function CT(){let{router:e}=wT("useNavigate"),t=Ip("useNavigate"),n=M.useRef(!1);return BE(()=>{n.current=!0}),M.useCallback(async(s,o={})=>{Ei(n.current,zE),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var zv={};function PE(e,t,n){!t&&!zv[e]&&(zv[e]=!0,Ei(!1,n))}M.memo(AT);function AT({routes:e,future:t,state:n,isStatic:a,onError:s}){return FE(e,void 0,{state:n,isStatic:a,onError:s})}function OT({to:e,replace:t,state:n,relative:a}){Ct(Ll(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=M.useContext(ri);Ei(!s,"<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:o}=M.useContext(wi),{pathname:c}=ji(),f=Sr(),d=Of(e,jp(o),c,a==="path"),h=JSON.stringify(d);return M.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function RT(e){return gT(e.context)}function zn(e){Ct(!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 MT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:o=!1,unstable_useTransitions:c}){Ct(!Ll(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),d=M.useMemo(()=>({basename:f,navigator:s,static:o,unstable_useTransitions:c,future:{}}),[f,s,o,c]);typeof n=="string"&&(n=jl(n));let{pathname:h="/",search:y="",hash:g="",state:x=null,key:v="default",unstable_mask:S}=n,w=M.useMemo(()=>{let k=Ca(h,f);return k==null?null:{location:{pathname:k,search:y,hash:g,state:x,key:v,unstable_mask:S},navigationType:a}},[f,h,y,g,x,v,a,S]);return Ei(w!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:M.createElement(ri.Provider,{value:d},M.createElement(gc.Provider,{children:t,value:w}))}function jT({children:e,location:t}){return bT(np(e),t)}function np(e,t=[]){let n=[];return M.Children.forEach(e,(a,s)=>{if(!M.isValidElement(a))return;let o=[...t,s];if(a.type===M.Fragment){n.push.apply(n,np(a.props.children,o));return}Ct(a.type===zn,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ct(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=np(a.props.children,o)),n.push(c)}),n}var of="get",cf="application/x-www-form-urlencoded";function Mf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function DT(e){return Mf(e)&&e.tagName.toLowerCase()==="button"}function LT(e){return Mf(e)&&e.tagName.toLowerCase()==="form"}function IT(e){return Mf(e)&&e.tagName.toLowerCase()==="input"}function zT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function BT(e,t){return e.button===0&&(!t||t==="_self")&&!zT(e)}function ip(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(s=>[n,s]):[[n,a]])},[]))}function UT(e,t){let n=ip(e);return t&&t.forEach((a,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var Hu=null;function FT(){if(Hu===null)try{new FormData(document.createElement("form"),0),Hu=!1}catch{Hu=!0}return Hu}var $T=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function um(e){return e!=null&&!$T.has(e)?(Ei(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${cf}"`),null):e}function PT(e,t){let n,a,s,o,c;if(LT(e)){let f=e.getAttribute("action");a=f?Ca(f,t):null,n=e.getAttribute("method")||of,s=um(e.getAttribute("enctype"))||cf,o=new FormData(e)}else if(DT(e)||IT(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||f.getAttribute("action");if(a=d?Ca(d,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||of,s=um(e.getAttribute("formenctype"))||um(f.getAttribute("enctype"))||cf,o=new FormData(f,e),!FT()){let{name:h,type:y,value:g}=e;if(y==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,g)}}else{if(Mf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=of,a=null,s=cf,c=e}return o&&s==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qE(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&Ca(s.pathname,t)==="/"?s.pathname=`${yf(t)}/_root.${a}`:s.pathname=`${yf(s.pathname)}.${a}`,s}async function qT(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function HT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function KT(e,t,n){let a=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let c=await qT(o,n);return c.links?c.links():[]}return[]}));return VT(a.flat(1).filter(HT).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Bv(e,t,n,a,s,o){let c=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,f=(d,h)=>{var y;return n[h].pathname!==d.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==d.params["*"]};return o==="assets"?t.filter((d,h)=>c(d,h)||f(d,h)):o==="data"?t.filter((d,h)=>{var g;let y=a.routes[d.route.id];if(!y||!y.hasLoader)return!1;if(c(d,h)||f(d,h))return!0;if(d.route.shouldRevalidate){let x=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function GT(e,t,{includeHydrateFallback:n}={}){return QT(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function QT(e){return[...new Set(e)]}function YT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function VT(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let o=JSON.stringify(YT(s));return n.has(o)||(n.add(o),a.push({key:o,link:s})),a},[])}function Bp(){let e=M.useContext(Dl);return zp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function XT(){let e=M.useContext(Rf);return zp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Up=M.createContext(void 0);Up.displayName="FrameworkContext";function Fp(){let e=M.useContext(Up);return zp(e,"You must render this element inside a <HydratedRouter> element"),e}function ZT(e,t){let n=M.useContext(Up),[a,s]=M.useState(!1),[o,c]=M.useState(!1),{onFocus:f,onBlur:d,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,x=M.useRef(null);M.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let w=_=>{_.forEach(A=>{c(A.isIntersecting)})},k=new IntersectionObserver(w,{threshold:.5});return x.current&&k.observe(x.current),()=>{k.disconnect()}}},[e]),M.useEffect(()=>{if(a){let w=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(w)}}},[a]);let v=()=>{s(!0)},S=()=>{s(!1),c(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:qo(f,v),onBlur:qo(d,S),onMouseEnter:qo(h,v),onMouseLeave:qo(y,S),onTouchStart:qo(g,v)}]:[!1,x,{}]}function qo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function WT({page:e,...t}){let n=sT(),{router:a}=Bp(),s=M.useMemo(()=>TE(a.routes,e,a.basename),[a.routes,e,a.basename]);return s?n?M.createElement(eC,{page:e,matches:s,...t}):M.createElement(tC,{page:e,matches:s,...t}):null}function JT(e){let{manifest:t,routeModules:n}=Fp(),[a,s]=M.useState([]);return M.useEffect(()=>{let o=!1;return KT(e,t,n).then(c=>{o||s(c)}),()=>{o=!0}},[e,t,n]),a}function eC({page:e,matches:t,...n}){let a=ji(),{future:s}=Fp(),{basename:o}=Bp(),c=M.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let f=qE(e,o,s.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,h=[];for(let y of t)typeof y.route.shouldRevalidate=="function"?d=!0:h.push(y.route.id);return d&&h.length>0&&f.searchParams.set("_routes",h.join(",")),[f.pathname+f.search]},[o,s.unstable_trailingSlashAwareDataRequests,e,a,t]);return M.createElement(M.Fragment,null,c.map(f=>M.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...n})))}function tC({page:e,matches:t,...n}){let a=ji(),{future:s,manifest:o,routeModules:c}=Fp(),{basename:f}=Bp(),{loaderData:d,matches:h}=XT(),y=M.useMemo(()=>Bv(e,t,h,o,a,"data"),[e,t,h,o,a]),g=M.useMemo(()=>Bv(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=M.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let w=new Set,k=!1;if(t.forEach(A=>{var D;let T=o.routes[A.route.id];!T||!T.hasLoader||(!y.some($=>$.route.id===A.route.id)&&A.route.id in d&&((D=c[A.route.id])!=null&&D.shouldRevalidate)||T.hasClientLoader?k=!0:w.add(A.route.id))}),w.size===0)return[];let _=qE(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return k&&w.size>0&&_.searchParams.set("_routes",t.filter(A=>w.has(A.route.id)).map(A=>A.route.id).join(",")),[_.pathname+_.search]},[f,s.unstable_trailingSlashAwareDataRequests,d,a,o,y,t,e,c]),v=M.useMemo(()=>GT(g,o),[g,o]),S=JT(g);return M.createElement(M.Fragment,null,x.map(w=>M.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>M.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:k})=>M.createElement("link",{key:w,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function nC(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var iC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{iC&&(window.__reactRouterVersion="7.14.2")}catch{}function aC({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=M.useRef();s.current==null&&(s.current=jN({window:a,v5Compat:!0}));let o=s.current,[c,f]=M.useState({action:o.action,location:o.location}),d=M.useCallback(h=>{n===!1?f(h):M.startTransition(()=>f(h))},[n]);return M.useLayoutEffect(()=>o.listen(d),[o,d]),M.createElement(MT,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var HE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ds=M.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:o,replace:c,unstable_mask:f,state:d,target:h,to:y,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:v,...S},w){let{basename:k,navigator:_,unstable_useTransitions:A}=M.useContext(ri),T=typeof y=="string"&&HE.test(y),D=ME(y,k);y=D.to;let $=hT(y,{relative:s}),j=ji(),q=null;if(f){let W=Of(f,[],j.unstable_mask?j.unstable_mask.pathname:"/",!0);k!=="/"&&(W.pathname=W.pathname==="/"?k:Ri([k,W.pathname])),q=_.createHref(W)}let[U,Z,O]=ZT(a,S),P=lC(y,{replace:c,unstable_mask:f,state:d,target:h,preventScrollReset:g,relative:s,viewTransition:x,unstable_defaultShouldRevalidate:v,unstable_useTransitions:A});function G(W){t&&t(W),W.defaultPrevented||P(W)}let le=!(D.isExternal||o),ae=M.createElement("a",{...S,...O,href:(le?q:void 0)||D.absoluteURL||$,onClick:le?G:t,ref:nC(w,Z),target:h,"data-discover":!T&&n==="render"?"true":void 0});return U&&!T?M.createElement(M.Fragment,null,ae,M.createElement(WT,{page:$})):ae});ds.displayName="Link";var KE=M.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:f,children:d,...h},y){let g=bc(c,{relative:h.relative}),x=ji(),v=M.useContext(Rf),{navigator:S,basename:w}=M.useContext(ri),k=v!=null&&dC(g)&&f===!0,_=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,A=x.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(A=A.toLowerCase(),T=T?T.toLowerCase():null,_=_.toLowerCase()),T&&w&&(T=Ca(T,w)||T);const D=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let $=A===_||!s&&A.startsWith(_)&&A.charAt(D)==="/",j=T!=null&&(T===_||!s&&T.startsWith(_)&&T.charAt(_.length)==="/"),q={isActive:$,isPending:j,isTransitioning:k},U=$?t:void 0,Z;typeof a=="function"?Z=a(q):Z=[a,$?"active":null,j?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let O=typeof o=="function"?o(q):o;return M.createElement(ds,{...h,"aria-current":U,className:Z,ref:y,style:O,to:c,viewTransition:f},typeof d=="function"?d(q):d)});KE.displayName="NavLink";var rC=M.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:o,method:c=of,action:f,onSubmit:d,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x,...v},S)=>{let{unstable_useTransitions:w}=M.useContext(ri),k=uC(),_=fC(f,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",T=typeof f=="string"&&HE.test(f),D=$=>{if(d&&d($),$.defaultPrevented)return;$.preventDefault();let j=$.nativeEvent.submitter,q=(j==null?void 0:j.getAttribute("formmethod"))||c,U=()=>k(j||$.currentTarget,{fetcherKey:t,method:q,navigate:n,replace:s,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x});w&&n!==!1?M.startTransition(()=>U()):U()};return M.createElement("form",{ref:S,method:A,action:_,onSubmit:a?d:D,...v,"data-discover":!T&&e==="render"?"true":void 0})});rC.displayName="Form";function sC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GE(e){let t=M.useContext(Dl);return Ct(t,sC(e)),t}function lC(e,{target:t,replace:n,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let y=Sr(),g=ji(),x=bc(e,{relative:c});return M.useCallback(v=>{if(BT(v,t)){v.preventDefault();let S=n!==void 0?n:ac(g)===ac(x),w=()=>y(e,{replace:S,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:d});h?M.startTransition(()=>w()):w()}},[g,y,x,n,a,s,t,e,o,c,f,d,h])}function QE(e){Ei(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=M.useRef(ip(e)),n=M.useRef(!1),a=ji(),s=M.useMemo(()=>UT(a.search,n.current?null:t.current),[a.search]),o=Sr(),c=M.useCallback((f,d)=>{const h=ip(typeof f=="function"?f(new URLSearchParams(s)):f);n.current=!0,o("?"+h,d)},[o,s]);return[s,c]}var oC=0,cC=()=>`__${String(++oC)}__`;function uC(){let{router:e}=GE("useSubmit"),{basename:t}=M.useContext(ri),n=NT(),a=e.fetch,s=e.navigate;return M.useCallback(async(o,c={})=>{let{action:f,method:d,encType:h,formData:y,body:g}=PT(o,t);if(c.navigate===!1){let x=c.fetcherKey||cC();await a(x,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||d,formEncType:c.encType||h,flushSync:c.flushSync})}else await s(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||d,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,s,t,n])}function fC(e,{relative:t}={}){let{basename:n}=M.useContext(ri),a=M.useContext(wi);Ct(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...bc(e||".",{relative:t})},c=ji();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),d=f.getAll("index");if(d.some(y=>y==="")){f.delete("index"),d.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ri([n,o.pathname])),ac(o)}function dC(e,{relative:t}={}){let n=M.useContext(LE);Ct(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=GE("useViewTransitionState"),s=bc(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ca(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Ca(n.nextLocation.pathname,a)||n.nextLocation.pathname;return bf(s.pathname,c)!=null||bf(s.pathname,o)!=null}/**
|
|
60
|
+
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let y=ji(),g;if(t){let _=typeof t=="string"?jl(t):t;Ct(d==="/"||((k=_.pathname)==null?void 0:k.startsWith(d)),`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 "${d}" but pathname "${_.pathname}" was given in the \`location\` prop.`),g=_}else g=y;let x=g.pathname||"/",v=x;if(d!=="/"){let _=d.replace(/^\//,"").split("/");v="/"+x.replace(/^\//,"").split("/").slice(_.length).join("/")}let S=TE(e,{pathname:v});Ei(h||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Ei(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.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 w=ST(S&&S.map(_=>Object.assign({},_,{params:Object.assign({},c,_.params),pathname:Ri([d,a.encodeLocation?a.encodeLocation(_.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?d:Ri([d,a.encodeLocation?a.encodeLocation(_.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),s,n);return t&&w?M.createElement(gc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},w):w}function yT(){let e=TT(),t=iT(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=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:o},"ErrorBoundary")," or"," ",M.createElement("code",{style:o},"errorElement")," prop on your route.")),M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},t),n?M.createElement("pre",{style:s},n):null,c)}var xT=M.createElement(yT,null),$E=class extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=dT(e.digest);n&&(e=n)}let t=e!==void 0?M.createElement(wi.Provider,{value:this.props.routeContext},M.createElement(Dp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?M.createElement(vT,{error:e},t):t}};$E.contextType=DE;var cm=new WeakMap;function vT({children:e,error:t}){let{basename:n}=M.useContext(ri);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=fT(t.digest);if(a){let s=cm.get(t);if(s)throw s;let o=ME(a.location,n);if(RE&&!cm.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw cm.set(t,c),c}return M.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function ET({routeContext:e,match:t,children:n}){let a=M.useContext(Dl);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),M.createElement(wi.Provider,{value:e},n)}function ST(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,o=a==null?void 0:a.errors;if(o!=null){let y=s.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Ct(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,y+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let y=0;y<s.length;y++){let g=s[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:v}=a,S=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||S){n.isStatic&&(c=!0),f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}}let d=n==null?void 0:n.onError,h=a&&d?(y,g)=>{var x,v;d(y,{location:a.location,params:((v=(x=a.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:aT(a.matches),errorInfo:g})}:void 0;return s.reduceRight((y,g,x)=>{let v,S=!1,w=null,k=null;a&&(v=o&&g.route.id?o[g.route.id]:void 0,w=g.route.errorElement||xT,c&&(f<0&&x===0?(PE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,k=null):f===x&&(S=!0,k=g.route.hydrateFallbackElement||null)));let _=t.concat(s.slice(0,x+1)),A=()=>{let T;return v?T=w:S?T=k:g.route.Component?T=M.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=y,M.createElement(ET,{match:g,routeContext:{outlet:y,matches:_,isDataRoute:a!=null},children:T})};return a&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?M.createElement($E,{location:a.location,revalidation:a.revalidation,component:w,error:v,children:A(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:h}):A()},null)}function Lp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wT(e){let t=M.useContext(Dl);return Ct(t,Lp(e)),t}function _T(e){let t=M.useContext(Rf);return Ct(t,Lp(e)),t}function kT(e){let t=M.useContext(wi);return Ct(t,Lp(e)),t}function Ip(e){let t=kT(e),n=t.matches[t.matches.length-1];return Ct(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function NT(){return Ip("useRouteId")}function TT(){var a;let e=M.useContext(Dp),t=_T("useRouteError"),n=Ip("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function CT(){let{router:e}=wT("useNavigate"),t=Ip("useNavigate"),n=M.useRef(!1);return BE(()=>{n.current=!0}),M.useCallback(async(s,o={})=>{Ei(n.current,zE),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var zv={};function PE(e,t,n){!t&&!zv[e]&&(zv[e]=!0,Ei(!1,n))}M.memo(AT);function AT({routes:e,future:t,state:n,isStatic:a,onError:s}){return FE(e,void 0,{state:n,isStatic:a,onError:s})}function OT({to:e,replace:t,state:n,relative:a}){Ct(Ll(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=M.useContext(ri);Ei(!s,"<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:o}=M.useContext(wi),{pathname:c}=ji(),f=wr(),d=Of(e,jp(o),c,a==="path"),h=JSON.stringify(d);return M.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function RT(e){return gT(e.context)}function zn(e){Ct(!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 MT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:o=!1,unstable_useTransitions:c}){Ct(!Ll(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),d=M.useMemo(()=>({basename:f,navigator:s,static:o,unstable_useTransitions:c,future:{}}),[f,s,o,c]);typeof n=="string"&&(n=jl(n));let{pathname:h="/",search:y="",hash:g="",state:x=null,key:v="default",unstable_mask:S}=n,w=M.useMemo(()=>{let k=Ca(h,f);return k==null?null:{location:{pathname:k,search:y,hash:g,state:x,key:v,unstable_mask:S},navigationType:a}},[f,h,y,g,x,v,a,S]);return Ei(w!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:M.createElement(ri.Provider,{value:d},M.createElement(gc.Provider,{children:t,value:w}))}function jT({children:e,location:t}){return bT(np(e),t)}function np(e,t=[]){let n=[];return M.Children.forEach(e,(a,s)=>{if(!M.isValidElement(a))return;let o=[...t,s];if(a.type===M.Fragment){n.push.apply(n,np(a.props.children,o));return}Ct(a.type===zn,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ct(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=np(a.props.children,o)),n.push(c)}),n}var of="get",cf="application/x-www-form-urlencoded";function Mf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function DT(e){return Mf(e)&&e.tagName.toLowerCase()==="button"}function LT(e){return Mf(e)&&e.tagName.toLowerCase()==="form"}function IT(e){return Mf(e)&&e.tagName.toLowerCase()==="input"}function zT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function BT(e,t){return e.button===0&&(!t||t==="_self")&&!zT(e)}function ip(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(s=>[n,s]):[[n,a]])},[]))}function UT(e,t){let n=ip(e);return t&&t.forEach((a,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var Hu=null;function FT(){if(Hu===null)try{new FormData(document.createElement("form"),0),Hu=!1}catch{Hu=!0}return Hu}var $T=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function um(e){return e!=null&&!$T.has(e)?(Ei(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${cf}"`),null):e}function PT(e,t){let n,a,s,o,c;if(LT(e)){let f=e.getAttribute("action");a=f?Ca(f,t):null,n=e.getAttribute("method")||of,s=um(e.getAttribute("enctype"))||cf,o=new FormData(e)}else if(DT(e)||IT(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||f.getAttribute("action");if(a=d?Ca(d,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||of,s=um(e.getAttribute("formenctype"))||um(f.getAttribute("enctype"))||cf,o=new FormData(f,e),!FT()){let{name:h,type:y,value:g}=e;if(y==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,g)}}else{if(Mf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=of,a=null,s=cf,c=e}return o&&s==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zp(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qE(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&Ca(s.pathname,t)==="/"?s.pathname=`${yf(t)}/_root.${a}`:s.pathname=`${yf(s.pathname)}.${a}`,s}async function qT(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function HT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function KT(e,t,n){let a=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let c=await qT(o,n);return c.links?c.links():[]}return[]}));return VT(a.flat(1).filter(HT).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Bv(e,t,n,a,s,o){let c=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,f=(d,h)=>{var y;return n[h].pathname!==d.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==d.params["*"]};return o==="assets"?t.filter((d,h)=>c(d,h)||f(d,h)):o==="data"?t.filter((d,h)=>{var g;let y=a.routes[d.route.id];if(!y||!y.hasLoader)return!1;if(c(d,h)||f(d,h))return!0;if(d.route.shouldRevalidate){let x=d.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function GT(e,t,{includeHydrateFallback:n}={}){return QT(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function QT(e){return[...new Set(e)]}function YT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function VT(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let o=JSON.stringify(YT(s));return n.has(o)||(n.add(o),a.push({key:o,link:s})),a},[])}function Bp(){let e=M.useContext(Dl);return zp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function XT(){let e=M.useContext(Rf);return zp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Up=M.createContext(void 0);Up.displayName="FrameworkContext";function Fp(){let e=M.useContext(Up);return zp(e,"You must render this element inside a <HydratedRouter> element"),e}function ZT(e,t){let n=M.useContext(Up),[a,s]=M.useState(!1),[o,c]=M.useState(!1),{onFocus:f,onBlur:d,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,x=M.useRef(null);M.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let w=_=>{_.forEach(A=>{c(A.isIntersecting)})},k=new IntersectionObserver(w,{threshold:.5});return x.current&&k.observe(x.current),()=>{k.disconnect()}}},[e]),M.useEffect(()=>{if(a){let w=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(w)}}},[a]);let v=()=>{s(!0)},S=()=>{s(!1),c(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:qo(f,v),onBlur:qo(d,S),onMouseEnter:qo(h,v),onMouseLeave:qo(y,S),onTouchStart:qo(g,v)}]:[!1,x,{}]}function qo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function WT({page:e,...t}){let n=sT(),{router:a}=Bp(),s=M.useMemo(()=>TE(a.routes,e,a.basename),[a.routes,e,a.basename]);return s?n?M.createElement(eC,{page:e,matches:s,...t}):M.createElement(tC,{page:e,matches:s,...t}):null}function JT(e){let{manifest:t,routeModules:n}=Fp(),[a,s]=M.useState([]);return M.useEffect(()=>{let o=!1;return KT(e,t,n).then(c=>{o||s(c)}),()=>{o=!0}},[e,t,n]),a}function eC({page:e,matches:t,...n}){let a=ji(),{future:s}=Fp(),{basename:o}=Bp(),c=M.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let f=qE(e,o,s.unstable_trailingSlashAwareDataRequests,"rsc"),d=!1,h=[];for(let y of t)typeof y.route.shouldRevalidate=="function"?d=!0:h.push(y.route.id);return d&&h.length>0&&f.searchParams.set("_routes",h.join(",")),[f.pathname+f.search]},[o,s.unstable_trailingSlashAwareDataRequests,e,a,t]);return M.createElement(M.Fragment,null,c.map(f=>M.createElement("link",{key:f,rel:"prefetch",as:"fetch",href:f,...n})))}function tC({page:e,matches:t,...n}){let a=ji(),{future:s,manifest:o,routeModules:c}=Fp(),{basename:f}=Bp(),{loaderData:d,matches:h}=XT(),y=M.useMemo(()=>Bv(e,t,h,o,a,"data"),[e,t,h,o,a]),g=M.useMemo(()=>Bv(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=M.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let w=new Set,k=!1;if(t.forEach(A=>{var D;let T=o.routes[A.route.id];!T||!T.hasLoader||(!y.some($=>$.route.id===A.route.id)&&A.route.id in d&&((D=c[A.route.id])!=null&&D.shouldRevalidate)||T.hasClientLoader?k=!0:w.add(A.route.id))}),w.size===0)return[];let _=qE(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return k&&w.size>0&&_.searchParams.set("_routes",t.filter(A=>w.has(A.route.id)).map(A=>A.route.id).join(",")),[_.pathname+_.search]},[f,s.unstable_trailingSlashAwareDataRequests,d,a,o,y,t,e,c]),v=M.useMemo(()=>GT(g,o),[g,o]),S=JT(g);return M.createElement(M.Fragment,null,x.map(w=>M.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>M.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:k})=>M.createElement("link",{key:w,nonce:n.nonce,...k,crossOrigin:k.crossOrigin??n.crossOrigin})))}function nC(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var iC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{iC&&(window.__reactRouterVersion="7.14.2")}catch{}function aC({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=M.useRef();s.current==null&&(s.current=jN({window:a,v5Compat:!0}));let o=s.current,[c,f]=M.useState({action:o.action,location:o.location}),d=M.useCallback(h=>{n===!1?f(h):M.startTransition(()=>f(h))},[n]);return M.useLayoutEffect(()=>o.listen(d),[o,d]),M.createElement(MT,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var HE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ds=M.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:o,replace:c,unstable_mask:f,state:d,target:h,to:y,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:v,...S},w){let{basename:k,navigator:_,unstable_useTransitions:A}=M.useContext(ri),T=typeof y=="string"&&HE.test(y),D=ME(y,k);y=D.to;let $=hT(y,{relative:s}),j=ji(),q=null;if(f){let W=Of(f,[],j.unstable_mask?j.unstable_mask.pathname:"/",!0);k!=="/"&&(W.pathname=W.pathname==="/"?k:Ri([k,W.pathname])),q=_.createHref(W)}let[U,Z,O]=ZT(a,S),P=lC(y,{replace:c,unstable_mask:f,state:d,target:h,preventScrollReset:g,relative:s,viewTransition:x,unstable_defaultShouldRevalidate:v,unstable_useTransitions:A});function G(W){t&&t(W),W.defaultPrevented||P(W)}let le=!(D.isExternal||o),ae=M.createElement("a",{...S,...O,href:(le?q:void 0)||D.absoluteURL||$,onClick:le?G:t,ref:nC(w,Z),target:h,"data-discover":!T&&n==="render"?"true":void 0});return U&&!T?M.createElement(M.Fragment,null,ae,M.createElement(WT,{page:$})):ae});ds.displayName="Link";var KE=M.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:o,to:c,viewTransition:f,children:d,...h},y){let g=bc(c,{relative:h.relative}),x=ji(),v=M.useContext(Rf),{navigator:S,basename:w}=M.useContext(ri),k=v!=null&&dC(g)&&f===!0,_=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,A=x.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(A=A.toLowerCase(),T=T?T.toLowerCase():null,_=_.toLowerCase()),T&&w&&(T=Ca(T,w)||T);const D=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let $=A===_||!s&&A.startsWith(_)&&A.charAt(D)==="/",j=T!=null&&(T===_||!s&&T.startsWith(_)&&T.charAt(_.length)==="/"),q={isActive:$,isPending:j,isTransitioning:k},U=$?t:void 0,Z;typeof a=="function"?Z=a(q):Z=[a,$?"active":null,j?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let O=typeof o=="function"?o(q):o;return M.createElement(ds,{...h,"aria-current":U,className:Z,ref:y,style:O,to:c,viewTransition:f},typeof d=="function"?d(q):d)});KE.displayName="NavLink";var rC=M.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:o,method:c=of,action:f,onSubmit:d,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x,...v},S)=>{let{unstable_useTransitions:w}=M.useContext(ri),k=uC(),_=fC(f,{relative:h}),A=c.toLowerCase()==="get"?"get":"post",T=typeof f=="string"&&HE.test(f),D=$=>{if(d&&d($),$.defaultPrevented)return;$.preventDefault();let j=$.nativeEvent.submitter,q=(j==null?void 0:j.getAttribute("formmethod"))||c,U=()=>k(j||$.currentTarget,{fetcherKey:t,method:q,navigate:n,replace:s,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x});w&&n!==!1?M.startTransition(()=>U()):U()};return M.createElement("form",{ref:S,method:A,action:_,onSubmit:a?d:D,...v,"data-discover":!T&&e==="render"?"true":void 0})});rC.displayName="Form";function sC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GE(e){let t=M.useContext(Dl);return Ct(t,sC(e)),t}function lC(e,{target:t,replace:n,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let y=wr(),g=ji(),x=bc(e,{relative:c});return M.useCallback(v=>{if(BT(v,t)){v.preventDefault();let S=n!==void 0?n:ac(g)===ac(x),w=()=>y(e,{replace:S,unstable_mask:a,state:s,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:d});h?M.startTransition(()=>w()):w()}},[g,y,x,n,a,s,t,e,o,c,f,d,h])}function QE(e){Ei(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=M.useRef(ip(e)),n=M.useRef(!1),a=ji(),s=M.useMemo(()=>UT(a.search,n.current?null:t.current),[a.search]),o=wr(),c=M.useCallback((f,d)=>{const h=ip(typeof f=="function"?f(new URLSearchParams(s)):f);n.current=!0,o("?"+h,d)},[o,s]);return[s,c]}var oC=0,cC=()=>`__${String(++oC)}__`;function uC(){let{router:e}=GE("useSubmit"),{basename:t}=M.useContext(ri),n=NT(),a=e.fetch,s=e.navigate;return M.useCallback(async(o,c={})=>{let{action:f,method:d,encType:h,formData:y,body:g}=PT(o,t);if(c.navigate===!1){let x=c.fetcherKey||cC();await a(x,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||d,formEncType:c.encType||h,flushSync:c.flushSync})}else await s(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||d,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,s,t,n])}function fC(e,{relative:t}={}){let{basename:n}=M.useContext(ri),a=M.useContext(wi);Ct(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...bc(e||".",{relative:t})},c=ji();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),d=f.getAll("index");if(d.some(y=>y==="")){f.delete("index"),d.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ri([n,o.pathname])),ac(o)}function dC(e,{relative:t}={}){let n=M.useContext(LE);Ct(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=GE("useViewTransitionState"),s=bc(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ca(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Ca(n.nextLocation.pathname,a)||n.nextLocation.pathname;return bf(s.pathname,c)!=null||bf(s.pathname,o)!=null}/**
|
|
61
61
|
* @license lucide-react v0.544.0 - ISC
|
|
62
62
|
*
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
@@ -327,13 +327,13 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
327
327
|
*
|
|
328
328
|
* This source code is licensed under the ISC license.
|
|
329
329
|
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const LA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],
|
|
330
|
+
*/const LA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Er=Me("x",LA);/**
|
|
331
331
|
* @license lucide-react v0.544.0 - ISC
|
|
332
332
|
*
|
|
333
333
|
* This source code is licensed under the ISC license.
|
|
334
334
|
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const IA=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],zA=Me("zap",IA),BA=[{to:"/chat",label:"对话",icon:lA},{to:"/projects",label:"项目",icon:tA},{to:"/board",label:"看板",icon:JC},{to:"/workers",label:"Workers",icon:n1},{to:"/logs",label:"Logs",icon:qp},{to:"/skills",label:"Skills",icon:VC},{to:"/system",label:"系统",icon:JE}];function UA(){return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"font-[family-name:var(--font-heading)] font-bold text-lg px-3 pt-2 pb-4 flex items-center gap-3 text-[var(--color-text)]",children:[m.jsx("span",{className:"w-5 h-5 rounded-md bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]"}),"SPS Console"]}),m.jsx("nav",{className:"flex flex-col gap-1.5 mt-2","aria-label":"主导航",children:BA.map(e=>{const t=e.icon;return m.jsxs(KE,{to:e.to,className:({isActive:n})=>["flex items-center gap-3 px-3 py-2.5 rounded-xl font-semibold text-sm cursor-pointer transition-transform duration-150","border-2 border-transparent",n?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] font-bold":"text-[var(--color-text)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)] hover:shadow-[3px_3px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px"].join(" "),children:[m.jsx(t,{size:18,strokeWidth:2.5}),e.label]},e.to)})})]})}class FA extends Error{constructor(t,n,a){super(n),this.status=t,this.detail=a,this.name="ApiError"}}async function Ht(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok){let n;try{n=await t.json()}catch{n=await t.text()}throw new FA(t.status,`${t.status} ${t.statusText}`,n)}return await t.json()}function r1(){return Ht("/api/system/info")}function $A(){return Ht("/api/system/env")}function PA(){return Ht("/api/system/env/raw")}async function qA(e,t){const n=await fetch("/api/system/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,etag:t})});if(!n.ok){const a=await n.text(),s=new Error(`${n.status}: ${a}`);throw s.status=n.status,s}return n.json()}function HA(){return Ht("/api/system/latest-version")}async function KA(){const e=await fetch("/api/system/upgrade",{method:"POST"});if(!e.ok&&e.status!==409)throw new Error(`${e.status}: ${await e.text()}`);return e.json()}async function GA(e,t=!1){const n=t?"?fix=1":"",a=await fetch(`/api/system/doctor/${encodeURIComponent(e)}${n}`,{method:"POST"});if(!a.ok)throw new Error(`${a.status}: ${await a.text()}`);return a.json()}function wr(){return Ht("/api/projects")}function QA(e){return Ht(`/api/projects/${encodeURIComponent(e)}`)}async function YA(e){const t=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text();throw new Error(`${t.status}: ${n}`)}return t.json()}function VA(e){return Ht(`/api/projects/${encodeURIComponent(e)}/conf`)}async function XA(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/conf`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,etag:n})});if(!a.ok){const s=await a.text(),o=new Error(`${a.status}: ${s}`);throw o.status=a.status,o}return a.json()}async function ZA(e,t={}){const n=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}return n.json()}function WA(e){return Ht(`/api/projects/${encodeURIComponent(e)}/pipelines`)}async function JA(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipeline`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipeline:t})});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}return n.json()}function e2(e,t){return Ht(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`)}async function t2(e,t,n,a){const s=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,etag:a})});if(!s.ok){const o=await s.text(),c=new Error(`${s.status}: ${o}`);throw c.status=s.status,c}return s.json()}async function n2(e,t,n="blank"){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,template:n})});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}return a.json()}async function i2(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}}function a2(){var f;const e=lt({queryKey:["system-info"],queryFn:r1,refetchInterval:3e4}),t=lt({queryKey:["projects"],queryFn:wr,refetchInterval:1e4}),n=s2(),a=!e.isError,s=((f=t.data)==null?void 0:f.data)??[],o=s.filter(d=>d.pipelineStatus==="running").length,c=s.reduce((d,h)=>d+h.workers.active,0);return m.jsxs("div",{className:"h-10 flex items-center gap-3 px-6 font-[family-name:var(--font-mono)] text-[11px] text-[var(--color-text-muted)]",children:[m.jsx("span",{className:"nb-status",style:{background:a?"var(--color-running-bg)":"var(--color-crashed-bg)",color:a?"var(--color-running)":"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:a?"server":"offline"}),m.jsx(r2,{state:n}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{className:"flex items-center gap-1",title:"活跃 pipeline 数",children:[m.jsx(jf,{size:10,strokeWidth:2.5}),m.jsx("span",{className:"font-bold text-[var(--color-text)]",children:o})," pipeline"]}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{className:"flex items-center gap-1",title:"活跃 worker 数",children:[m.jsx(ZE,{size:10,strokeWidth:2.5}),m.jsx("span",{className:"font-bold text-[var(--color-text)]",children:c})," worker"]}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{children:["localhost:",window.location.port]}),e.data&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{children:["v",e.data.version]}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{children:["node ",e.data.nodeVersion]})]})]})}function r2({state:e}){return e==="open"?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px 2px 7px"},children:"SSE"}):e==="connecting"?m.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)",padding:"2px 8px 2px 7px"},children:"SSE·connect"}):m.jsxs("span",{className:"nb-status",style:{background:"var(--color-crashed-bg)",color:"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:[m.jsx(rc,{size:9,strokeWidth:2.5}),"SSE·down"]})}function s2(){const[e,t]=M.useState("connecting");return M.useEffect(()=>{let n=null,a=null,s=!1;const o=()=>{s||(n=new EventSource("/stream/heartbeat"),n.addEventListener("server.heartbeat",()=>t("open")),n.addEventListener("open",()=>t("open")),n.addEventListener("error",()=>{(n==null?void 0:n.readyState)===EventSource.CLOSED?(t("closed"),a==null&&(a=setTimeout(()=>{a=null,n==null||n.close(),o()},1e4))):t("connecting")}))};return o(),()=>{s=!0,a!=null&&clearTimeout(a),n==null||n.close()}},[]),e}function l2(){return m.jsxs("div",{className:"grid grid-cols-[240px_1fr] grid-rows-[1fr_40px] min-h-screen",children:[m.jsx("aside",{className:"row-span-1 row-start-1 border-r-[3px] border-[var(--color-text)] bg-[var(--color-bg)] p-4 flex flex-col",children:m.jsx(UA,{})}),m.jsx("main",{className:"row-start-1 overflow-auto p-6 flex flex-col gap-4",children:m.jsx(RT,{})}),m.jsx("footer",{className:"col-span-2 row-start-2 border-t-[3px] border-[var(--color-text)] bg-[var(--color-bg)]",children:m.jsx(a2,{})})]})}function rp(e,t){try{const n=JSON.stringify({message:(e instanceof Error?e.message:String(e)).slice(0,1e3),stack:(e instanceof Error?e.stack??"":"").slice(0,4e3),url:typeof window<"u"?window.location.href:"",ua:typeof navigator<"u"?navigator.userAgent:"",ts:new Date().toISOString(),context:t==null?void 0:t.slice(0,200)});fetch("/api/system/client-errors",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}catch{}}function o2(){typeof window>"u"||(window.addEventListener("error",e=>{rp(e.error??e.message??"unknown error","window.error")}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;rp(t instanceof Error?t:String(t),"unhandledrejection")}))}class c2 extends M.Component{constructor(){super(...arguments);uv(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,a){var s;rp(n,`ErrorBoundary: ${((s=a.componentStack)==null?void 0:s.slice(0,200))??""}`),console.error("[ErrorBoundary]",n,a)}render(){return this.state.error?m.jsx("div",{className:"p-6",children:m.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"💥 UI 崩了"}),m.jsx("p",{className:"text-sm mb-3 text-[var(--color-text-muted)]",children:this.state.error.message}),m.jsxs("details",{className:"text-xs mb-4",children:[m.jsx("summary",{className:"cursor-pointer font-semibold",children:"stack"}),m.jsx("pre",{className:"mt-2 font-[family-name:var(--font-mono)] overflow-auto max-h-60 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md p-3",children:this.state.error.stack??"(no stack)"})]}),m.jsx("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>{this.setState({error:null}),window.location.reload()},children:"刷新页面"})]})}):this.props.children}}function u2(){const e=Sr(),{data:t,isLoading:n,isError:a,error:s,refetch:o}=lt({queryKey:["projects"],queryFn:wr});return m.jsxs("div",{className:"flex flex-col gap-6 max-w-6xl",children:[m.jsxs("header",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"项目 🎯"}),m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:t?`${t.data.length} 个本机项目`:n?"加载中…":"点击刷新重试"})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs("button",{className:"nb-btn nb-btn-yellow",onClick:()=>o(),type:"button",children:[m.jsx(jf,{size:16,strokeWidth:2.5}),"刷新"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>e("/projects/new"),"aria-label":"新建项目",children:[m.jsx(Xi,{size:16,strokeWidth:3}),"新建项目"]})]})]}),n&&m.jsx(h2,{}),a&&m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:"加载失败"}),m.jsx("p",{className:"text-sm text-[var(--color-text)]",children:s instanceof Error?s.message:String(s)}),m.jsx("button",{className:"nb-btn mt-4",onClick:()=>o(),type:"button",children:"重试"})]}),t&&t.data.length===0&&m.jsx(m2,{}),t&&t.data.length>0&&m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.data.map(c=>m.jsx(f2,{project:c},c.name))})]})}function f2({project:e}){const t=e.pipelineStatus==="running";return m.jsxs(ds,{to:`/projects/${encodeURIComponent(e.name)}`,className:"nb-card nb-card-interactive block no-underline text-[var(--color-text)]",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-xl truncate",children:e.name}),m.jsx(d2,{status:e.pipelineStatus})]}),e.repoDir&&m.jsx("p",{className:"text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] truncate mb-3",children:e.repoDir}),m.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm mt-4 pt-3 border-t-[1.5px] border-dashed border-[var(--color-border-light)]",children:[m.jsx(fm,{label:"cards",value:e.cards.total,accent:"purple"}),m.jsx(fm,{label:"inprogress",value:e.cards.inprogress,accent:e.cards.inprogress>0?"yellow":"idle"}),m.jsx(fm,{label:"workers",value:`${e.workers.active}/${e.workers.total}`,accent:t?"mint":"idle"})]})]})}function fm({label:e,value:t,accent:n}){const a={purple:"var(--color-accent-purple)",yellow:"var(--color-accent-yellow)",mint:"var(--color-accent-mint)",idle:"var(--color-bg-cream)"};return m.jsxs("div",{className:"flex flex-col items-center justify-center py-2 rounded-lg border-2 border-[var(--color-text)]",style:{background:a[n]},children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-lg",children:t}),m.jsx("span",{className:"text-[10px] uppercase tracking-wider text-[var(--color-text-muted)] font-semibold",children:e})]})}function d2({status:e}){const t={running:{bg:"var(--color-running-bg)",label:"running"},idle:{bg:"var(--color-idle-bg)",label:"idle"},stopping:{bg:"var(--color-stuck-bg)",label:"stopping"},error:{bg:"var(--color-crashed-bg)",label:"error"}},{bg:n,label:a}=t[e],s=e==="running"?"var(--color-running)":e==="error"?"var(--color-crashed)":e==="stopping"?"var(--color-stuck)":"var(--color-idle)";return m.jsx("span",{className:"nb-status",style:{background:n,color:s},children:a})}function h2(){return m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[0,1,2].map(e=>m.jsxs("div",{className:"nb-card opacity-60 animate-pulse",children:[m.jsx("div",{className:"h-6 w-32 bg-[var(--color-border-light)] rounded-md mb-3"}),m.jsx("div",{className:"h-3 w-full bg-[var(--color-border-light)] rounded-md mb-2"}),m.jsx("div",{className:"h-3 w-2/3 bg-[var(--color-border-light)] rounded-md"})]},e))})}function m2(){return m.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] flex items-center gap-6 p-8",children:[m.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center",children:m.jsx(n1,{size:32,strokeWidth:2.5})}),m.jsxs("div",{className:"flex-1",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"还没有项目 ✨"}),m.jsxs("p",{className:"text-sm text-[var(--color-text)] mb-4",children:["运行 ",m.jsx("code",{className:"bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded-md font-[family-name:var(--font-mono)]",children:"sps project init <name>"})," 创建第一个项目。"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",children:[m.jsx(Xi,{size:16,strokeWidth:3}),"新建项目"]})]})]})}function p2({title:e,body:t,confirm:n,onConfirm:a,onCancel:s,danger:o}){return M.useEffect(()=>{const c=f=>{f.key==="Escape"&&s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),m.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsx("h2",{id:"confirm-title",className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5",children:t}),m.jsxs("div",{className:"flex gap-3 justify-end",children:[m.jsx("button",{className:"nb-btn",onClick:s,type:"button",children:"取消"}),m.jsx("button",{className:o?"nb-btn nb-btn-danger":"nb-btn nb-btn-yellow",onClick:async()=>{await a()},type:"button",children:n})]})]})})}const s1=M.createContext(null);function g2({children:e}){const[t,n]=M.useState(null),a=M.useCallback(c=>new Promise(f=>{n({kind:"confirm",opts:c,resolve:d=>{n(null),f(d)}})}),[]),s=M.useCallback(c=>new Promise(f=>{n({kind:"alert",opts:c,resolve:()=>{n(null),f()}})}),[]),o=M.useCallback(c=>new Promise(f=>{n({kind:"prompt",opts:c,resolve:d=>{n(null),f(d)}})}),[]);return m.jsxs(s1.Provider,{value:{confirm:a,alert:s,prompt:o},children:[e,(t==null?void 0:t.kind)==="confirm"&&m.jsx(p2,{title:t.opts.title,body:t.opts.body,confirm:t.opts.confirm??"确定",danger:t.opts.danger,onConfirm:()=>t.resolve(!0),onCancel:()=>t.resolve(!1)}),(t==null?void 0:t.kind)==="alert"&&m.jsx(b2,{title:t.opts.title,body:t.opts.body,confirm:t.opts.confirm??"知道了",onClose:()=>t.resolve()}),(t==null?void 0:t.kind)==="prompt"&&m.jsx(y2,{title:t.opts.title,body:t.opts.body,placeholder:t.opts.placeholder,defaultValue:t.opts.defaultValue,confirm:t.opts.confirm??"确定",cancel:t.opts.cancel??"取消",onConfirm:c=>t.resolve(c),onCancel:()=>t.resolve(null)})]})}function si(){const e=M.useContext(s1);if(!e)throw new Error("useDialog must be used inside <DialogProvider>");return e}function b2({title:e,body:t,confirm:n,onClose:a}){return M.useEffect(()=>{const s=o=>{(o.key==="Escape"||o.key==="Enter")&&a()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[a]),m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5 whitespace-pre-wrap break-words",children:t}),m.jsx("div",{className:"flex gap-3 justify-end",children:m.jsx("button",{className:"nb-btn nb-btn-primary",onClick:a,type:"button",autoFocus:!0,children:n})})]})})}function y2({title:e,body:t,placeholder:n,defaultValue:a,confirm:s,cancel:o,onConfirm:c,onCancel:f}){const[d,h]=M.useState(a??""),y=M.useRef(null);M.useEffect(()=>{var v,S;(v=y.current)==null||v.focus(),(S=y.current)==null||S.select();const x=w=>{w.key==="Escape"&&f()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[f]);const g=()=>{const x=d.trim();x&&c(x)};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),t&&m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-3 whitespace-pre-wrap break-words",children:t}),m.jsx("input",{ref:y,type:"text",className:"nb-input w-full mb-5",placeholder:n,value:d,onChange:x=>h(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&(x.preventDefault(),g())}}),m.jsxs("div",{className:"flex gap-3 justify-end",children:[m.jsx("button",{className:"nb-btn",onClick:f,type:"button",children:o}),m.jsx("button",{className:"nb-btn nb-btn-primary",onClick:g,type:"button",disabled:!d.trim(),children:s})]})]})})}function x2(){const e=Sr(),t=qn(),{alert:n}=si(),[a,s]=M.useState({name:"",projectDir:"",mergeBranch:"main",maxWorkers:"1"}),o=Pn({mutationFn:d=>YA(d),onSuccess:d=>{t.invalidateQueries({queryKey:["projects"]}),e(`/projects/${encodeURIComponent(d.name)}`)},onError:d=>{n({title:"创建失败",body:d instanceof Error?d.message:String(d)})}}),c=/^[a-zA-Z0-9_-]+$/.test(a.name),f=c&&a.projectDir.trim()!==""&&!o.isPending;return m.jsxs("div",{className:"flex flex-col gap-5 max-w-2xl",children:[m.jsxs("header",{className:"flex items-center gap-3",children:[m.jsxs("button",{type:"button",onClick:()=>e("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":"返回项目列表",children:[m.jsx(VE,{size:14,strokeWidth:3}),"返回"]}),m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:"新建项目"})]}),m.jsx("div",{className:"nb-card",children:m.jsxs("form",{onSubmit:d=>{d.preventDefault(),f&&o.mutate(a)},className:"flex flex-col gap-5",children:[m.jsxs(Yr,{label:"项目名",hint:"只能用字母、数字、下划线、连字符。例如 acme-web",children:[m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"例如: acme-web",value:a.name,onChange:d=>s({...a,name:d.target.value}),autoFocus:!0,required:!0}),a.name&&!c&&m.jsx("p",{className:"text-xs text-[var(--color-crashed)] mt-1",children:"名称只能包含 a-z A-Z 0-9 _ -"})]}),m.jsx(Yr,{label:"Git 仓库路径",hint:"本机绝对路径,如 /home/coral/code/acme",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"/home/coral/code/acme",value:a.projectDir,onChange:d=>s({...a,projectDir:d.target.value}),required:!0})}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsx(Yr,{label:"合并分支",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:a.mergeBranch,onChange:d=>s({...a,mergeBranch:d.target.value})})}),m.jsx(Yr,{label:"最大 Worker 数",children:m.jsx("input",{type:"number",min:"1",max:"8",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:a.maxWorkers,onChange:d=>s({...a,maxWorkers:d.target.value})})})]}),m.jsxs("div",{className:"pt-2 border-t-2 border-[var(--color-text)] border-dashed",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-3 text-[var(--color-text-muted)]",children:"可选配置"}),m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsx(Yr,{label:"Git 远程项目路径",hint:"如 user/repo,空则跳过 Git API",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"user/repo",value:a.gitlabProject??"",onChange:d=>s({...a,gitlabProject:d.target.value})})}),a.gitlabProject&&m.jsx(Yr,{label:"GitLab 项目 ID",hint:"数字,GitHub 用户可留空",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"42",value:a.gitlabProjectId??"",onChange:d=>s({...a,gitlabProjectId:d.target.value})})}),m.jsx(Yr,{label:"Matrix 房间 ID",hint:"空则使用全局配置",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"!abc:matrix.example.com",value:a.matrixRoomId??"",onChange:d=>s({...a,matrixRoomId:d.target.value})})})]})]}),m.jsxs("div",{className:"flex gap-3 justify-end pt-3",children:[m.jsx("button",{type:"button",className:"nb-btn",onClick:()=>e("/projects"),disabled:o.isPending,children:"取消"}),m.jsx("button",{type:"submit",className:"nb-btn nb-btn-primary",disabled:!f,"aria-label":"创建项目",children:o.isPending?m.jsxs(m.Fragment,{children:[m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}),"创建中…"]}):m.jsxs(m.Fragment,{children:[m.jsx(Xi,{size:14,strokeWidth:3}),"创建"]})})]})]})})]})}function Yr({label:e,hint:t,children:n}){return m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:e}),n,t&&m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t})]})}const Gp=Symbol.for("yaml.alias"),sp=Symbol.for("yaml.document"),xr=Symbol.for("yaml.map"),l1=Symbol.for("yaml.pair"),Vi=Symbol.for("yaml.scalar"),zl=Symbol.for("yaml.seq"),Si=Symbol.for("yaml.node.type"),_r=e=>!!e&&typeof e=="object"&&e[Si]===Gp,hs=e=>!!e&&typeof e=="object"&&e[Si]===sp,Bl=e=>!!e&&typeof e=="object"&&e[Si]===xr,At=e=>!!e&&typeof e=="object"&&e[Si]===l1,vt=e=>!!e&&typeof e=="object"&&e[Si]===Vi,Ul=e=>!!e&&typeof e=="object"&&e[Si]===zl;function Mt(e){if(e&&typeof e=="object")switch(e[Si]){case xr:case zl:return!0}return!1}function jt(e){if(e&&typeof e=="object")switch(e[Si]){case Gp:case xr:case Vi:case zl:return!0}return!1}const o1=e=>(vt(e)||Mt(e))&&!!e.anchor,$n=Symbol("break visit"),c1=Symbol("skip children"),Yi=Symbol("remove node");function ms(e,t){const n=u1(t);hs(e)?cl(null,e.contents,n,Object.freeze([e]))===Yi&&(e.contents=null):cl(null,e,n,Object.freeze([]))}ms.BREAK=$n;ms.SKIP=c1;ms.REMOVE=Yi;function cl(e,t,n,a){const s=f1(e,t,n,a);if(jt(s)||At(s))return d1(e,a,s),cl(e,s,n,a);if(typeof s!="symbol"){if(Mt(t)){a=Object.freeze(a.concat(t));for(let o=0;o<t.items.length;++o){const c=cl(o,t.items[o],n,a);if(typeof c=="number")o=c-1;else{if(c===$n)return $n;c===Yi&&(t.items.splice(o,1),o-=1)}}}else if(At(t)){a=Object.freeze(a.concat(t));const o=cl("key",t.key,n,a);if(o===$n)return $n;o===Yi&&(t.key=null);const c=cl("value",t.value,n,a);if(c===$n)return $n;c===Yi&&(t.value=null)}}return s}async function Lf(e,t){const n=u1(t);hs(e)?await ul(null,e.contents,n,Object.freeze([e]))===Yi&&(e.contents=null):await ul(null,e,n,Object.freeze([]))}Lf.BREAK=$n;Lf.SKIP=c1;Lf.REMOVE=Yi;async function ul(e,t,n,a){const s=await f1(e,t,n,a);if(jt(s)||At(s))return d1(e,a,s),ul(e,s,n,a);if(typeof s!="symbol"){if(Mt(t)){a=Object.freeze(a.concat(t));for(let o=0;o<t.items.length;++o){const c=await ul(o,t.items[o],n,a);if(typeof c=="number")o=c-1;else{if(c===$n)return $n;c===Yi&&(t.items.splice(o,1),o-=1)}}}else if(At(t)){a=Object.freeze(a.concat(t));const o=await ul("key",t.key,n,a);if(o===$n)return $n;o===Yi&&(t.key=null);const c=await ul("value",t.value,n,a);if(c===$n)return $n;c===Yi&&(t.value=null)}}return s}function u1(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function f1(e,t,n,a){var s,o,c,f,d;if(typeof n=="function")return n(e,t,a);if(Bl(t))return(s=n.Map)==null?void 0:s.call(n,e,t,a);if(Ul(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,a);if(At(t))return(c=n.Pair)==null?void 0:c.call(n,e,t,a);if(vt(t))return(f=n.Scalar)==null?void 0:f.call(n,e,t,a);if(_r(t))return(d=n.Alias)==null?void 0:d.call(n,e,t,a)}function d1(e,t,n){const a=t[t.length-1];if(Mt(a))a.items[e]=n;else if(At(a))e==="key"?a.key=n:a.value=n;else if(hs(a))a.contents=n;else{const s=_r(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const v2={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},E2=e=>e.replace(/[!,[\]{}]/g,t=>v2[t]);class Nn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Nn.defaultYaml,t),this.tags=Object.assign({},Nn.defaultTags,n)}clone(){const t=new Nn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Nn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Nn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Nn.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Nn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Nn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),s=a.shift();switch(s){case"%TAG":{if(a.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[o,c]=a;return this.tags[o]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=a;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const c=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,c),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const c=t.slice(2,-1);return c==="!"||c==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),c)}const[,a,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const o=this.tags[a];if(o)try{return o+decodeURIComponent(s)}catch(c){return n(String(c)),null}return a==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,a]of Object.entries(this.tags))if(t.startsWith(a))return n+E2(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let s;if(t&&a.length>0&&jt(t.contents)){const o={};ms(t.contents,(c,f)=>{jt(f)&&f.tag&&(o[f.tag]=!0)}),s=Object.keys(o)}else s=[];for(const[o,c]of a)o==="!!"&&c==="tag:yaml.org,2002:"||(!t||s.some(f=>f.startsWith(c)))&&n.push(`%TAG ${o} ${c}`);return n.join(`
|
|
336
|
-
`)}}Nn.defaultYaml={explicit:!1,version:"1.2"};Nn.defaultTags={"!!":"tag:yaml.org,2002:"};function h1(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function m1(e){const t=new Set;return ms(e,{Value(n,a){a.anchor&&t.add(a.anchor)}}),t}function p1(e,t){for(let n=1;;++n){const a=`${e}${n}`;if(!t.has(a))return a}}function S2(e,t){const n=[],a=new Map;let s=null;return{onAnchor:o=>{n.push(o),s??(s=m1(e));const c=p1(t,s);return s.add(c),c},setAnchors:()=>{for(const o of n){const c=a.get(o);if(typeof c=="object"&&c.anchor&&(vt(c.node)||Mt(c.node)))c.node.anchor=c.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=o,f}}},sourceObjects:a}}function fl(e,t,n,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let s=0,o=a.length;s<o;++s){const c=a[s],f=fl(e,a,String(s),c);f===void 0?delete a[s]:f!==c&&(a[s]=f)}else if(a instanceof Map)for(const s of Array.from(a.keys())){const o=a.get(s),c=fl(e,a,s,o);c===void 0?a.delete(s):c!==o&&a.set(s,c)}else if(a instanceof Set)for(const s of Array.from(a)){const o=fl(e,a,s,s);o===void 0?a.delete(s):o!==s&&(a.delete(s),a.add(o))}else for(const[s,o]of Object.entries(a)){const c=fl(e,a,s,o);c===void 0?delete a[s]:c!==o&&(a[s]=c)}return e.call(t,n,a)}function vi(e,t,n){if(Array.isArray(e))return e.map((a,s)=>vi(a,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!o1(e))return e.toJSON(t,n);const a={aliasCount:0,count:1,res:void 0};n.anchors.set(e,a),n.onCreate=o=>{a.res=o,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Qp{constructor(t){Object.defineProperty(this,Si,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:a,onAnchor:s,reviver:o}={}){if(!hs(t))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=vi(this,"",c);if(typeof s=="function")for(const{count:d,res:h}of c.anchors.values())s(h,d);return typeof o=="function"?fl(o,{"":f},"",f):f}}class If extends Qp{constructor(t){super(Gp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let a;n!=null&&n.aliasResolveCache?a=n.aliasResolveCache:(a=[],ms(t,{Node:(o,c)=>{(
|
|
335
|
+
*/const IA=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],zA=Me("zap",IA),BA=[{to:"/chat",label:"对话",icon:lA},{to:"/projects",label:"项目",icon:tA},{to:"/board",label:"看板",icon:JC},{to:"/workers",label:"Workers",icon:n1},{to:"/logs",label:"Logs",icon:qp},{to:"/skills",label:"Skills",icon:VC},{to:"/system",label:"系统",icon:JE}];function UA(){return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"font-[family-name:var(--font-heading)] font-bold text-lg px-3 pt-2 pb-4 flex items-center gap-3 text-[var(--color-text)]",children:[m.jsx("span",{className:"w-5 h-5 rounded-md bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]"}),"SPS Console"]}),m.jsx("nav",{className:"flex flex-col gap-1.5 mt-2","aria-label":"主导航",children:BA.map(e=>{const t=e.icon;return m.jsxs(KE,{to:e.to,className:({isActive:n})=>["flex items-center gap-3 px-3 py-2.5 rounded-xl font-semibold text-sm cursor-pointer transition-transform duration-150","border-2 border-transparent",n?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] font-bold":"text-[var(--color-text)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)] hover:shadow-[3px_3px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px"].join(" "),children:[m.jsx(t,{size:18,strokeWidth:2.5}),e.label]},e.to)})})]})}class FA extends Error{constructor(t,n,a){super(n),this.status=t,this.detail=a,this.name="ApiError"}}async function Ht(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok){let n;try{n=await t.json()}catch{n=await t.text()}throw new FA(t.status,`${t.status} ${t.statusText}`,n)}return await t.json()}function r1(){return Ht("/api/system/info")}function $A(){return Ht("/api/system/env")}function PA(){return Ht("/api/system/env/raw")}async function qA(e,t){const n=await fetch("/api/system/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,etag:t})});if(!n.ok){const a=await n.text(),s=new Error(`${n.status}: ${a}`);throw s.status=n.status,s}return n.json()}function HA(){return Ht("/api/system/latest-version")}async function KA(){const e=await fetch("/api/system/upgrade",{method:"POST"});if(!e.ok&&e.status!==409)throw new Error(`${e.status}: ${await e.text()}`);return e.json()}async function GA(e,t=!1){const n=t?"?fix=1":"",a=await fetch(`/api/system/doctor/${encodeURIComponent(e)}${n}`,{method:"POST"});if(!a.ok)throw new Error(`${a.status}: ${await a.text()}`);return a.json()}function _r(){return Ht("/api/projects")}function QA(e){return Ht(`/api/projects/${encodeURIComponent(e)}`)}async function YA(e){const t=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text();throw new Error(`${t.status}: ${n}`)}return t.json()}function VA(e){return Ht(`/api/projects/${encodeURIComponent(e)}/conf`)}async function XA(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/conf`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,etag:n})});if(!a.ok){const s=await a.text(),o=new Error(`${a.status}: ${s}`);throw o.status=a.status,o}return a.json()}async function ZA(e,t={}){const n=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}return n.json()}function WA(e){return Ht(`/api/projects/${encodeURIComponent(e)}/pipelines`)}async function JA(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipeline`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipeline:t})});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}return n.json()}function e2(e,t){return Ht(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`)}async function t2(e,t,n,a){const s=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,etag:a})});if(!s.ok){const o=await s.text(),c=new Error(`${s.status}: ${o}`);throw c.status=s.status,c}return s.json()}async function n2(e,t,n="blank"){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,template:n})});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}return a.json()}async function i2(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}}function a2(){var f;const e=lt({queryKey:["system-info"],queryFn:r1,refetchInterval:3e4}),t=lt({queryKey:["projects"],queryFn:_r,refetchInterval:1e4}),n=s2(),a=!e.isError,s=((f=t.data)==null?void 0:f.data)??[],o=s.filter(d=>d.pipelineStatus==="running").length,c=s.reduce((d,h)=>d+h.workers.active,0);return m.jsxs("div",{className:"h-10 flex items-center gap-3 px-6 font-[family-name:var(--font-mono)] text-[11px] text-[var(--color-text-muted)]",children:[m.jsx("span",{className:"nb-status",style:{background:a?"var(--color-running-bg)":"var(--color-crashed-bg)",color:a?"var(--color-running)":"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:a?"server":"offline"}),m.jsx(r2,{state:n}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{className:"flex items-center gap-1",title:"活跃 pipeline 数",children:[m.jsx(jf,{size:10,strokeWidth:2.5}),m.jsx("span",{className:"font-bold text-[var(--color-text)]",children:o})," pipeline"]}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{className:"flex items-center gap-1",title:"活跃 worker 数",children:[m.jsx(ZE,{size:10,strokeWidth:2.5}),m.jsx("span",{className:"font-bold text-[var(--color-text)]",children:c})," worker"]}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{children:["localhost:",window.location.port]}),e.data&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{children:["v",e.data.version]}),m.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),m.jsxs("span",{children:["node ",e.data.nodeVersion]})]})]})}function r2({state:e}){return e==="open"?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px 2px 7px"},children:"SSE"}):e==="connecting"?m.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)",padding:"2px 8px 2px 7px"},children:"SSE·connect"}):m.jsxs("span",{className:"nb-status",style:{background:"var(--color-crashed-bg)",color:"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:[m.jsx(rc,{size:9,strokeWidth:2.5}),"SSE·down"]})}function s2(){const[e,t]=M.useState("connecting");return M.useEffect(()=>{let n=null,a=null,s=!1;const o=()=>{s||(n=new EventSource("/stream/heartbeat"),n.addEventListener("server.heartbeat",()=>t("open")),n.addEventListener("open",()=>t("open")),n.addEventListener("error",()=>{(n==null?void 0:n.readyState)===EventSource.CLOSED?(t("closed"),a==null&&(a=setTimeout(()=>{a=null,n==null||n.close(),o()},1e4))):t("connecting")}))};return o(),()=>{s=!0,a!=null&&clearTimeout(a),n==null||n.close()}},[]),e}function l2(){return m.jsxs("div",{className:"grid grid-cols-[240px_1fr] grid-rows-[1fr_40px] min-h-screen",children:[m.jsx("aside",{className:"row-span-1 row-start-1 border-r-[3px] border-[var(--color-text)] bg-[var(--color-bg)] p-4 flex flex-col",children:m.jsx(UA,{})}),m.jsx("main",{className:"row-start-1 overflow-auto p-6 flex flex-col gap-4",children:m.jsx(RT,{})}),m.jsx("footer",{className:"col-span-2 row-start-2 border-t-[3px] border-[var(--color-text)] bg-[var(--color-bg)]",children:m.jsx(a2,{})})]})}function rp(e,t){try{const n=JSON.stringify({message:(e instanceof Error?e.message:String(e)).slice(0,1e3),stack:(e instanceof Error?e.stack??"":"").slice(0,4e3),url:typeof window<"u"?window.location.href:"",ua:typeof navigator<"u"?navigator.userAgent:"",ts:new Date().toISOString(),context:t==null?void 0:t.slice(0,200)});fetch("/api/system/client-errors",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}catch{}}function o2(){typeof window>"u"||(window.addEventListener("error",e=>{rp(e.error??e.message??"unknown error","window.error")}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;rp(t instanceof Error?t:String(t),"unhandledrejection")}))}class c2 extends M.Component{constructor(){super(...arguments);uv(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,a){var s;rp(n,`ErrorBoundary: ${((s=a.componentStack)==null?void 0:s.slice(0,200))??""}`),console.error("[ErrorBoundary]",n,a)}render(){return this.state.error?m.jsx("div",{className:"p-6",children:m.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"💥 UI 崩了"}),m.jsx("p",{className:"text-sm mb-3 text-[var(--color-text-muted)]",children:this.state.error.message}),m.jsxs("details",{className:"text-xs mb-4",children:[m.jsx("summary",{className:"cursor-pointer font-semibold",children:"stack"}),m.jsx("pre",{className:"mt-2 font-[family-name:var(--font-mono)] overflow-auto max-h-60 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md p-3",children:this.state.error.stack??"(no stack)"})]}),m.jsx("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>{this.setState({error:null}),window.location.reload()},children:"刷新页面"})]})}):this.props.children}}function u2(){const e=wr(),{data:t,isLoading:n,isError:a,error:s,refetch:o}=lt({queryKey:["projects"],queryFn:_r});return m.jsxs("div",{className:"flex flex-col gap-6 max-w-6xl",children:[m.jsxs("header",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"项目 🎯"}),m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:t?`${t.data.length} 个本机项目`:n?"加载中…":"点击刷新重试"})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs("button",{className:"nb-btn nb-btn-yellow",onClick:()=>o(),type:"button",children:[m.jsx(jf,{size:16,strokeWidth:2.5}),"刷新"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>e("/projects/new"),"aria-label":"新建项目",children:[m.jsx(Xi,{size:16,strokeWidth:3}),"新建项目"]})]})]}),n&&m.jsx(h2,{}),a&&m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:"加载失败"}),m.jsx("p",{className:"text-sm text-[var(--color-text)]",children:s instanceof Error?s.message:String(s)}),m.jsx("button",{className:"nb-btn mt-4",onClick:()=>o(),type:"button",children:"重试"})]}),t&&t.data.length===0&&m.jsx(m2,{}),t&&t.data.length>0&&m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.data.map(c=>m.jsx(f2,{project:c},c.name))})]})}function f2({project:e}){const t=e.pipelineStatus==="running";return m.jsxs(ds,{to:`/projects/${encodeURIComponent(e.name)}`,className:"nb-card nb-card-interactive block no-underline text-[var(--color-text)]",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-xl truncate",children:e.name}),m.jsx(d2,{status:e.pipelineStatus})]}),e.repoDir&&m.jsx("p",{className:"text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] truncate mb-3",children:e.repoDir}),m.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm mt-4 pt-3 border-t-[1.5px] border-dashed border-[var(--color-border-light)]",children:[m.jsx(fm,{label:"cards",value:e.cards.total,accent:"purple"}),m.jsx(fm,{label:"inprogress",value:e.cards.inprogress,accent:e.cards.inprogress>0?"yellow":"idle"}),m.jsx(fm,{label:"workers",value:`${e.workers.active}/${e.workers.total}`,accent:t?"mint":"idle"})]})]})}function fm({label:e,value:t,accent:n}){const a={purple:"var(--color-accent-purple)",yellow:"var(--color-accent-yellow)",mint:"var(--color-accent-mint)",idle:"var(--color-bg-cream)"};return m.jsxs("div",{className:"flex flex-col items-center justify-center py-2 rounded-lg border-2 border-[var(--color-text)]",style:{background:a[n]},children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-lg",children:t}),m.jsx("span",{className:"text-[10px] uppercase tracking-wider text-[var(--color-text-muted)] font-semibold",children:e})]})}function d2({status:e}){const t={running:{bg:"var(--color-running-bg)",label:"running"},idle:{bg:"var(--color-idle-bg)",label:"idle"},stopping:{bg:"var(--color-stuck-bg)",label:"stopping"},error:{bg:"var(--color-crashed-bg)",label:"error"}},{bg:n,label:a}=t[e],s=e==="running"?"var(--color-running)":e==="error"?"var(--color-crashed)":e==="stopping"?"var(--color-stuck)":"var(--color-idle)";return m.jsx("span",{className:"nb-status",style:{background:n,color:s},children:a})}function h2(){return m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[0,1,2].map(e=>m.jsxs("div",{className:"nb-card opacity-60 animate-pulse",children:[m.jsx("div",{className:"h-6 w-32 bg-[var(--color-border-light)] rounded-md mb-3"}),m.jsx("div",{className:"h-3 w-full bg-[var(--color-border-light)] rounded-md mb-2"}),m.jsx("div",{className:"h-3 w-2/3 bg-[var(--color-border-light)] rounded-md"})]},e))})}function m2(){return m.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] flex items-center gap-6 p-8",children:[m.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center",children:m.jsx(n1,{size:32,strokeWidth:2.5})}),m.jsxs("div",{className:"flex-1",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"还没有项目 ✨"}),m.jsxs("p",{className:"text-sm text-[var(--color-text)] mb-4",children:["运行 ",m.jsx("code",{className:"bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded-md font-[family-name:var(--font-mono)]",children:"sps project init <name>"})," 创建第一个项目。"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",children:[m.jsx(Xi,{size:16,strokeWidth:3}),"新建项目"]})]})]})}function p2({title:e,body:t,confirm:n,onConfirm:a,onCancel:s,danger:o}){return M.useEffect(()=>{const c=f=>{f.key==="Escape"&&s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),m.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsx("h2",{id:"confirm-title",className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5",children:t}),m.jsxs("div",{className:"flex gap-3 justify-end",children:[m.jsx("button",{className:"nb-btn",onClick:s,type:"button",children:"取消"}),m.jsx("button",{className:o?"nb-btn nb-btn-danger":"nb-btn nb-btn-yellow",onClick:async()=>{await a()},type:"button",children:n})]})]})})}const s1=M.createContext(null);function g2({children:e}){const[t,n]=M.useState(null),a=M.useCallback(c=>new Promise(f=>{n({kind:"confirm",opts:c,resolve:d=>{n(null),f(d)}})}),[]),s=M.useCallback(c=>new Promise(f=>{n({kind:"alert",opts:c,resolve:()=>{n(null),f()}})}),[]),o=M.useCallback(c=>new Promise(f=>{n({kind:"prompt",opts:c,resolve:d=>{n(null),f(d)}})}),[]);return m.jsxs(s1.Provider,{value:{confirm:a,alert:s,prompt:o},children:[e,(t==null?void 0:t.kind)==="confirm"&&m.jsx(p2,{title:t.opts.title,body:t.opts.body,confirm:t.opts.confirm??"确定",danger:t.opts.danger,onConfirm:()=>t.resolve(!0),onCancel:()=>t.resolve(!1)}),(t==null?void 0:t.kind)==="alert"&&m.jsx(b2,{title:t.opts.title,body:t.opts.body,confirm:t.opts.confirm??"知道了",onClose:()=>t.resolve()}),(t==null?void 0:t.kind)==="prompt"&&m.jsx(y2,{title:t.opts.title,body:t.opts.body,placeholder:t.opts.placeholder,defaultValue:t.opts.defaultValue,confirm:t.opts.confirm??"确定",cancel:t.opts.cancel??"取消",onConfirm:c=>t.resolve(c),onCancel:()=>t.resolve(null)})]})}function si(){const e=M.useContext(s1);if(!e)throw new Error("useDialog must be used inside <DialogProvider>");return e}function b2({title:e,body:t,confirm:n,onClose:a}){return M.useEffect(()=>{const s=o=>{(o.key==="Escape"||o.key==="Enter")&&a()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[a]),m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5 whitespace-pre-wrap break-words",children:t}),m.jsx("div",{className:"flex gap-3 justify-end",children:m.jsx("button",{className:"nb-btn nb-btn-primary",onClick:a,type:"button",autoFocus:!0,children:n})})]})})}function y2({title:e,body:t,placeholder:n,defaultValue:a,confirm:s,cancel:o,onConfirm:c,onCancel:f}){const[d,h]=M.useState(a??""),y=M.useRef(null);M.useEffect(()=>{var v,S;(v=y.current)==null||v.focus(),(S=y.current)==null||S.select();const x=w=>{w.key==="Escape"&&f()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[f]);const g=()=>{const x=d.trim();x&&c(x)};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),t&&m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-3 whitespace-pre-wrap break-words",children:t}),m.jsx("input",{ref:y,type:"text",className:"nb-input w-full mb-5",placeholder:n,value:d,onChange:x=>h(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&(x.preventDefault(),g())}}),m.jsxs("div",{className:"flex gap-3 justify-end",children:[m.jsx("button",{className:"nb-btn",onClick:f,type:"button",children:o}),m.jsx("button",{className:"nb-btn nb-btn-primary",onClick:g,type:"button",disabled:!d.trim(),children:s})]})]})})}function x2(){const e=wr(),t=qn(),{alert:n}=si(),[a,s]=M.useState({name:"",projectDir:"",enableGit:!0,mergeBranch:"main",maxWorkers:"1",ackTimeoutMin:"5"}),o=Pn({mutationFn:d=>YA(d),onSuccess:d=>{t.invalidateQueries({queryKey:["projects"]}),e(`/projects/${encodeURIComponent(d.name)}`)},onError:d=>{n({title:"创建失败",body:d instanceof Error?d.message:String(d)})}}),c=/^[a-zA-Z0-9_-]+$/.test(a.name),f=c&&a.projectDir.trim()!==""&&!o.isPending;return m.jsxs("div",{className:"flex flex-col gap-5 max-w-2xl",children:[m.jsxs("header",{className:"flex items-center gap-3",children:[m.jsxs("button",{type:"button",onClick:()=>e("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":"返回项目列表",children:[m.jsx(VE,{size:14,strokeWidth:3}),"返回"]}),m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:"新建项目"})]}),m.jsx("div",{className:"nb-card",children:m.jsxs("form",{onSubmit:d=>{d.preventDefault(),f&&o.mutate(a)},className:"flex flex-col gap-5",children:[m.jsxs(rr,{label:"项目名",hint:"只能用字母、数字、下划线、连字符。例如 acme-web",children:[m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"例如: acme-web",value:a.name,onChange:d=>s({...a,name:d.target.value}),autoFocus:!0,required:!0}),a.name&&!c&&m.jsx("p",{className:"text-xs text-[var(--color-crashed)] mt-1",children:"名称只能包含 a-z A-Z 0-9 _ -"})]}),m.jsx(rr,{label:"项目目录",hint:"本机绝对路径(代码或文档都可)。和是否启用 git 无关。",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"/home/coral/code/acme",value:a.projectDir,onChange:d=>s({...a,projectDir:d.target.value}),required:!0})}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsx(rr,{label:"最大 Worker 数",children:m.jsx("input",{type:"number",min:"1",max:"8",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:a.maxWorkers,onChange:d=>s({...a,maxWorkers:d.target.value})})}),m.jsx(rr,{label:"ACK 超时(分钟)",hint:"Worker 启动后多久没 ACK 视为失败",children:m.jsx("input",{type:"number",min:"1",max:"30",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:a.ackTimeoutMin??"5",onChange:d=>s({...a,ackTimeoutMin:d.target.value})})})]}),m.jsxs("div",{className:"pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[m.jsxs("label",{className:"flex items-center gap-3 mb-3 cursor-pointer select-none",children:[m.jsx("input",{type:"checkbox",checked:a.enableGit??!0,onChange:d=>s({...a,enableGit:d.target.checked}),className:"w-4 h-4 cursor-pointer"}),m.jsx("span",{className:"text-sm font-bold",children:"启用 Git(Worker 自动 commit + push)"})]}),m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:"关闭后 Worker 只做任务、不做版本控制;适合文档/数据处理等非代码项目。"}),a.enableGit!==!1&&m.jsxs("div",{className:"flex flex-col gap-4 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[m.jsx(rr,{label:"合并分支",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:a.mergeBranch??"main",onChange:d=>s({...a,mergeBranch:d.target.value})})}),m.jsx(rr,{label:"Git 远程项目路径",hint:"如 user/repo,空则跳过远程 API(只本地 commit/push)",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"user/repo",value:a.gitlabProject??"",onChange:d=>s({...a,gitlabProject:d.target.value})})}),a.gitlabProject&&m.jsx(rr,{label:"GitLab 项目 ID",hint:"数字;GitHub 用户留空",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"42",value:a.gitlabProjectId??"",onChange:d=>s({...a,gitlabProjectId:d.target.value})})})]})]}),m.jsxs("div",{className:"pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-3 text-[var(--color-text-muted)]",children:"通知"}),m.jsx(rr,{label:"Matrix 房间 ID",hint:"空则使用全局配置;不填 = 不通知",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"!abc:matrix.example.com",value:a.matrixRoomId??"",onChange:d=>s({...a,matrixRoomId:d.target.value})})})]}),m.jsxs("div",{className:"flex gap-3 justify-end pt-3",children:[m.jsx("button",{type:"button",className:"nb-btn",onClick:()=>e("/projects"),disabled:o.isPending,children:"取消"}),m.jsx("button",{type:"submit",className:"nb-btn nb-btn-primary",disabled:!f,"aria-label":"创建项目",children:o.isPending?m.jsxs(m.Fragment,{children:[m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}),"创建中…"]}):m.jsxs(m.Fragment,{children:[m.jsx(Xi,{size:14,strokeWidth:3}),"创建"]})})]})]})})]})}function rr({label:e,hint:t,children:n}){return m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:e}),n,t&&m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t})]})}const Gp=Symbol.for("yaml.alias"),sp=Symbol.for("yaml.document"),vr=Symbol.for("yaml.map"),l1=Symbol.for("yaml.pair"),Vi=Symbol.for("yaml.scalar"),zl=Symbol.for("yaml.seq"),Si=Symbol.for("yaml.node.type"),kr=e=>!!e&&typeof e=="object"&&e[Si]===Gp,hs=e=>!!e&&typeof e=="object"&&e[Si]===sp,Bl=e=>!!e&&typeof e=="object"&&e[Si]===vr,At=e=>!!e&&typeof e=="object"&&e[Si]===l1,vt=e=>!!e&&typeof e=="object"&&e[Si]===Vi,Ul=e=>!!e&&typeof e=="object"&&e[Si]===zl;function Mt(e){if(e&&typeof e=="object")switch(e[Si]){case vr:case zl:return!0}return!1}function jt(e){if(e&&typeof e=="object")switch(e[Si]){case Gp:case vr:case Vi:case zl:return!0}return!1}const o1=e=>(vt(e)||Mt(e))&&!!e.anchor,$n=Symbol("break visit"),c1=Symbol("skip children"),Yi=Symbol("remove node");function ms(e,t){const n=u1(t);hs(e)?cl(null,e.contents,n,Object.freeze([e]))===Yi&&(e.contents=null):cl(null,e,n,Object.freeze([]))}ms.BREAK=$n;ms.SKIP=c1;ms.REMOVE=Yi;function cl(e,t,n,a){const s=f1(e,t,n,a);if(jt(s)||At(s))return d1(e,a,s),cl(e,s,n,a);if(typeof s!="symbol"){if(Mt(t)){a=Object.freeze(a.concat(t));for(let o=0;o<t.items.length;++o){const c=cl(o,t.items[o],n,a);if(typeof c=="number")o=c-1;else{if(c===$n)return $n;c===Yi&&(t.items.splice(o,1),o-=1)}}}else if(At(t)){a=Object.freeze(a.concat(t));const o=cl("key",t.key,n,a);if(o===$n)return $n;o===Yi&&(t.key=null);const c=cl("value",t.value,n,a);if(c===$n)return $n;c===Yi&&(t.value=null)}}return s}async function Lf(e,t){const n=u1(t);hs(e)?await ul(null,e.contents,n,Object.freeze([e]))===Yi&&(e.contents=null):await ul(null,e,n,Object.freeze([]))}Lf.BREAK=$n;Lf.SKIP=c1;Lf.REMOVE=Yi;async function ul(e,t,n,a){const s=await f1(e,t,n,a);if(jt(s)||At(s))return d1(e,a,s),ul(e,s,n,a);if(typeof s!="symbol"){if(Mt(t)){a=Object.freeze(a.concat(t));for(let o=0;o<t.items.length;++o){const c=await ul(o,t.items[o],n,a);if(typeof c=="number")o=c-1;else{if(c===$n)return $n;c===Yi&&(t.items.splice(o,1),o-=1)}}}else if(At(t)){a=Object.freeze(a.concat(t));const o=await ul("key",t.key,n,a);if(o===$n)return $n;o===Yi&&(t.key=null);const c=await ul("value",t.value,n,a);if(c===$n)return $n;c===Yi&&(t.value=null)}}return s}function u1(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function f1(e,t,n,a){var s,o,c,f,d;if(typeof n=="function")return n(e,t,a);if(Bl(t))return(s=n.Map)==null?void 0:s.call(n,e,t,a);if(Ul(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,a);if(At(t))return(c=n.Pair)==null?void 0:c.call(n,e,t,a);if(vt(t))return(f=n.Scalar)==null?void 0:f.call(n,e,t,a);if(kr(t))return(d=n.Alias)==null?void 0:d.call(n,e,t,a)}function d1(e,t,n){const a=t[t.length-1];if(Mt(a))a.items[e]=n;else if(At(a))e==="key"?a.key=n:a.value=n;else if(hs(a))a.contents=n;else{const s=kr(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const v2={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},E2=e=>e.replace(/[!,[\]{}]/g,t=>v2[t]);class Nn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Nn.defaultYaml,t),this.tags=Object.assign({},Nn.defaultTags,n)}clone(){const t=new Nn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Nn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Nn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Nn.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Nn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Nn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),s=a.shift();switch(s){case"%TAG":{if(a.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[o,c]=a;return this.tags[o]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=a;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const c=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,c),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const c=t.slice(2,-1);return c==="!"||c==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),c)}const[,a,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const o=this.tags[a];if(o)try{return o+decodeURIComponent(s)}catch(c){return n(String(c)),null}return a==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,a]of Object.entries(this.tags))if(t.startsWith(a))return n+E2(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let s;if(t&&a.length>0&&jt(t.contents)){const o={};ms(t.contents,(c,f)=>{jt(f)&&f.tag&&(o[f.tag]=!0)}),s=Object.keys(o)}else s=[];for(const[o,c]of a)o==="!!"&&c==="tag:yaml.org,2002:"||(!t||s.some(f=>f.startsWith(c)))&&n.push(`%TAG ${o} ${c}`);return n.join(`
|
|
336
|
+
`)}}Nn.defaultYaml={explicit:!1,version:"1.2"};Nn.defaultTags={"!!":"tag:yaml.org,2002:"};function h1(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function m1(e){const t=new Set;return ms(e,{Value(n,a){a.anchor&&t.add(a.anchor)}}),t}function p1(e,t){for(let n=1;;++n){const a=`${e}${n}`;if(!t.has(a))return a}}function S2(e,t){const n=[],a=new Map;let s=null;return{onAnchor:o=>{n.push(o),s??(s=m1(e));const c=p1(t,s);return s.add(c),c},setAnchors:()=>{for(const o of n){const c=a.get(o);if(typeof c=="object"&&c.anchor&&(vt(c.node)||Mt(c.node)))c.node.anchor=c.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=o,f}}},sourceObjects:a}}function fl(e,t,n,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let s=0,o=a.length;s<o;++s){const c=a[s],f=fl(e,a,String(s),c);f===void 0?delete a[s]:f!==c&&(a[s]=f)}else if(a instanceof Map)for(const s of Array.from(a.keys())){const o=a.get(s),c=fl(e,a,s,o);c===void 0?a.delete(s):c!==o&&a.set(s,c)}else if(a instanceof Set)for(const s of Array.from(a)){const o=fl(e,a,s,s);o===void 0?a.delete(s):o!==s&&(a.delete(s),a.add(o))}else for(const[s,o]of Object.entries(a)){const c=fl(e,a,s,o);c===void 0?delete a[s]:c!==o&&(a[s]=c)}return e.call(t,n,a)}function vi(e,t,n){if(Array.isArray(e))return e.map((a,s)=>vi(a,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!o1(e))return e.toJSON(t,n);const a={aliasCount:0,count:1,res:void 0};n.anchors.set(e,a),n.onCreate=o=>{a.res=o,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Qp{constructor(t){Object.defineProperty(this,Si,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:a,onAnchor:s,reviver:o}={}){if(!hs(t))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=vi(this,"",c);if(typeof s=="function")for(const{count:d,res:h}of c.anchors.values())s(h,d);return typeof o=="function"?fl(o,{"":f},"",f):f}}class If extends Qp{constructor(t){super(Gp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let a;n!=null&&n.aliasResolveCache?a=n.aliasResolveCache:(a=[],ms(t,{Node:(o,c)=>{(kr(c)||o1(c))&&a.push(c)}}),n&&(n.aliasResolveCache=a));let s;for(const o of a){if(o===this)break;o.anchor===this.source&&(s=o)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:a,doc:s,maxAliasCount:o}=n,c=this.resolve(s,n);if(!c){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let f=a.get(c);if(f||(vi(c,null,n),f=a.get(c)),(f==null?void 0:f.res)===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(o>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=uf(s,c,a)),f.count*f.aliasCount>o)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return f.res}toString(t,n,a){const s=`*${this.source}`;if(t){if(h1(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${s} `}return s}}function uf(e,t,n){if(kr(t)){const a=t.resolve(e),s=n&&a&&n.get(a);return s?s.count*s.aliasCount:0}else if(Mt(t)){let a=0;for(const s of t.items){const o=uf(e,s,n);o>a&&(a=o)}return a}else if(At(t)){const a=uf(e,t.key,n),s=uf(e,t.value,n);return Math.max(a,s)}return 1}const g1=e=>!e||typeof e!="function"&&typeof e!="object";class ze extends Qp{constructor(t){super(Vi),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:vi(this.value,t,n)}toString(){return String(this.value)}}ze.BLOCK_FOLDED="BLOCK_FOLDED";ze.BLOCK_LITERAL="BLOCK_LITERAL";ze.PLAIN="PLAIN";ze.QUOTE_DOUBLE="QUOTE_DOUBLE";ze.QUOTE_SINGLE="QUOTE_SINGLE";const w2="tag:yaml.org,2002:";function _2(e,t,n){if(t){const a=n.filter(o=>o.tag===t),s=a.find(o=>!o.format)??a[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(a=>{var s;return((s=a.identify)==null?void 0:s.call(a,e))&&!a.format})}function sc(e,t,n){var g,x,v;if(hs(e)&&(e=e.contents),jt(e))return e;if(At(e)){const S=(x=(g=n.schema[vr]).createNode)==null?void 0:x.call(g,n.schema,null,n);return S.items.push(e),S}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:s,onTagObj:o,schema:c,sourceObjects:f}=n;let d;if(a&&e&&typeof e=="object"){if(d=f.get(e),d)return d.anchor??(d.anchor=s(e)),new If(d.anchor);d={anchor:null,node:null},f.set(e,d)}t!=null&&t.startsWith("!!")&&(t=w2+t.slice(2));let h=_2(e,t,c.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const S=new ze(e);return d&&(d.node=S),S}h=e instanceof Map?c[vr]:Symbol.iterator in Object(e)?c[zl]:c[vr]}o&&(o(h),delete n.onTagObj);const y=h!=null&&h.createNode?h.createNode(n.schema,e,n):typeof((v=h==null?void 0:h.nodeClass)==null?void 0:v.from)=="function"?h.nodeClass.from(n.schema,e,n):new ze(e);return t?y.tag=t:h.default||(y.tag=h.tag),d&&(d.node=y),y}function vf(e,t,n){let a=n;for(let s=t.length-1;s>=0;--s){const o=t[s];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const c=[];c[o]=a,a=c}else a=new Map([[o,a]])}return sc(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Zo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class b1 extends Qp{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(a=>jt(a)||At(a)?a.clone(t):a),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Zo(t))this.add(n);else{const[a,...s]=t,o=this.get(a,!0);if(Mt(o))o.addIn(s,n);else if(o===void 0&&this.schema)this.set(a,vf(this.schema,s,n));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${s}`)}}deleteIn(t){const[n,...a]=t;if(a.length===0)return this.delete(n);const s=this.get(n,!0);if(Mt(s))return s.deleteIn(a);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${a}`)}getIn(t,n){const[a,...s]=t,o=this.get(a,!0);return s.length===0?!n&&vt(o)?o.value:o:Mt(o)?o.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!At(n))return!1;const a=n.value;return a==null||t&&vt(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[n,...a]=t;if(a.length===0)return this.has(n);const s=this.get(n,!0);return Mt(s)?s.hasIn(a):!1}setIn(t,n){const[a,...s]=t;if(s.length===0)this.set(a,n);else{const o=this.get(a,!0);if(Mt(o))o.setIn(s,n);else if(o===void 0&&this.schema)this.set(a,vf(this.schema,s,n));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${s}`)}}}const k2=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ka(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Zr=(e,t,n)=>e.endsWith(`
|
|
337
337
|
`)?ka(n,t):n.includes(`
|
|
338
338
|
`)?`
|
|
339
339
|
`+ka(n,t):(e.endsWith(" ")?"":" ")+n,y1="flow",lp="block",ff="quoted";function zf(e,t,n="flow",{indentAtStart:a,lineWidth:s=80,minContentWidth:o=20,onFold:c,onOverflow:f}={}){if(!s||s<0)return e;s<o&&(o=0);const d=Math.max(1+o,1+s-t.length);if(e.length<=d)return e;const h=[],y={};let g=s-t.length;typeof a=="number"&&(a>s-Math.max(2,o)?h.push(0):g=s-a);let x,v,S=!1,w=-1,k=-1,_=-1;n===lp&&(w=Pv(e,w,t.length),w!==-1&&(g=w+d));for(let T;T=e[w+=1];){if(n===ff&&T==="\\"){switch(k=w,e[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}_=w}if(T===`
|
|
@@ -364,7 +364,7 @@ ${h}${A}${n}${v}`}function T2(e,t,n,a){const{type:s,value:o}=e,{actualString:c,i
|
|
|
364
364
|
`)||y&&/[[\]{},]/.test(o))return dl(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return f||y||!o.includes(`
|
|
365
365
|
`)?dl(o,t):df(e,t,n,a);if(!f&&!y&&s!==ze.PLAIN&&o.includes(`
|
|
366
366
|
`))return df(e,t,n,a);if(Uf(o)){if(d==="")return t.forceBlockIndent=!0,df(e,t,n,a);if(f&&d===h)return dl(o,t)}const g=o.replace(/\n+/g,`$&
|
|
367
|
-
${d}`);if(c){const x=w=>{var k;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((k=w.test)==null?void 0:k.test(g))},{compat:v,tags:S}=t.doc.schema;if(S.some(x)||v!=null&&v.some(x))return dl(o,t)}return f?g:zf(g,d,y1,Bf(t,!1))}function xc(e,t,n,a){const{implicitKey:s,inFlow:o}=t,c=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==ze.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(f=ze.QUOTE_DOUBLE);const d=y=>{switch(y){case ze.BLOCK_FOLDED:case ze.BLOCK_LITERAL:return s||o?dl(c.value,t):df(c,t,n,a);case ze.QUOTE_DOUBLE:return Wo(c.value,t);case ze.QUOTE_SINGLE:return op(c.value,t);case ze.PLAIN:return T2(c,t,n,a);default:return null}};let h=d(f);if(h===null){const{defaultKeyType:y,defaultStringType:g}=t.options,x=s&&y||g;if(h=d(x),h===null)throw new Error(`Unsupported default string type ${x}`)}return h}function x1(e,t){const n=Object.assign({blockQuote:!0,commentString:k2,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let a;switch(n.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:a,options:n}}function C2(e,t){var s;if(t.tag){const o=e.filter(c=>c.tag===t.tag);if(o.length>0)return o.find(c=>c.format===t.format)??o[0]}let n,a;if(vt(t)){a=t.value;let o=e.filter(c=>{var f;return(f=c.identify)==null?void 0:f.call(c,a)});if(o.length>1){const c=o.filter(f=>f.test);c.length>0&&(o=c)}n=o.find(c=>c.format===t.format)??o.find(c=>!c.format)}else a=t,n=e.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!n){const o=((s=a==null?void 0:a.constructor)==null?void 0:s.name)??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return n}function A2(e,t,{anchors:n,doc:a}){if(!a.directives)return"";const s=[],o=(vt(e)||Mt(e))&&e.anchor;o&&h1(o)&&(n.add(o),s.push(`&${o}`));const c=e.tag??(t.default?null:t.tag);return c&&s.push(a.directives.tagString(c)),s.join(" ")}function Al(e,t,n,a){var d;if(At(e))return e.toString(t,n,a);if(
|
|
367
|
+
${d}`);if(c){const x=w=>{var k;return w.default&&w.tag!=="tag:yaml.org,2002:str"&&((k=w.test)==null?void 0:k.test(g))},{compat:v,tags:S}=t.doc.schema;if(S.some(x)||v!=null&&v.some(x))return dl(o,t)}return f?g:zf(g,d,y1,Bf(t,!1))}function xc(e,t,n,a){const{implicitKey:s,inFlow:o}=t,c=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==ze.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(f=ze.QUOTE_DOUBLE);const d=y=>{switch(y){case ze.BLOCK_FOLDED:case ze.BLOCK_LITERAL:return s||o?dl(c.value,t):df(c,t,n,a);case ze.QUOTE_DOUBLE:return Wo(c.value,t);case ze.QUOTE_SINGLE:return op(c.value,t);case ze.PLAIN:return T2(c,t,n,a);default:return null}};let h=d(f);if(h===null){const{defaultKeyType:y,defaultStringType:g}=t.options,x=s&&y||g;if(h=d(x),h===null)throw new Error(`Unsupported default string type ${x}`)}return h}function x1(e,t){const n=Object.assign({blockQuote:!0,commentString:k2,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let a;switch(n.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:a,options:n}}function C2(e,t){var s;if(t.tag){const o=e.filter(c=>c.tag===t.tag);if(o.length>0)return o.find(c=>c.format===t.format)??o[0]}let n,a;if(vt(t)){a=t.value;let o=e.filter(c=>{var f;return(f=c.identify)==null?void 0:f.call(c,a)});if(o.length>1){const c=o.filter(f=>f.test);c.length>0&&(o=c)}n=o.find(c=>c.format===t.format)??o.find(c=>!c.format)}else a=t,n=e.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!n){const o=((s=a==null?void 0:a.constructor)==null?void 0:s.name)??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return n}function A2(e,t,{anchors:n,doc:a}){if(!a.directives)return"";const s=[],o=(vt(e)||Mt(e))&&e.anchor;o&&h1(o)&&(n.add(o),s.push(`&${o}`));const c=e.tag??(t.default?null:t.tag);return c&&s.push(a.directives.tagString(c)),s.join(" ")}function Al(e,t,n,a){var d;if(At(e))return e.toString(t,n,a);if(kr(e)){if(t.doc.directives)return e.toString(t);if((d=t.resolvedAliases)!=null&&d.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const o=jt(e)?e:t.doc.createNode(e,{onTagObj:h=>s=h});s??(s=C2(t.doc.schema.tags,o));const c=A2(o,s,t);c.length>0&&(t.indentAtStart=(t.indentAtStart??0)+c.length+1);const f=typeof s.stringify=="function"?s.stringify(o,t,n,a):vt(o)?xc(o,t,n,a):o.toString(t,n,a);return c?vt(o)||f[0]==="{"||f[0]==="["?`${c} ${f}`:`${c}
|
|
368
368
|
${t.indent}${f}`:f}function O2({key:e,value:t},n,a,s){const{allNullValues:o,doc:c,indent:f,indentStep:d,options:{commentString:h,indentSeq:y,simpleKeys:g}}=n;let x=jt(e)&&e.comment||null;if(g){if(x)throw new Error("With simple keys, key nodes cannot have comments");if(Mt(e)||!jt(e)&&typeof e=="object"){const q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let v=!g&&(!e||x&&t==null&&!n.inFlow||Mt(e)||(vt(e)?e.type===ze.BLOCK_FOLDED||e.type===ze.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(g||!o),indent:f+d});let S=!1,w=!1,k=Al(e,n,()=>S=!0,()=>w=!0);if(!v&&!n.inFlow&&k.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(o||t==null)return S&&a&&a(),k===""?"?":v?`? ${k}`:k}else if(o&&!g||t==null&&v)return k=`? ${k}`,x&&!S?k+=Zr(k,n.indent,h(x)):w&&s&&s(),k;S&&(x=null),v?(x&&(k+=Zr(k,n.indent,h(x))),k=`? ${k}
|
|
369
369
|
${f}:`):(k=`${k}:`,x&&(k+=Zr(k,n.indent,h(x))));let _,A,T;jt(t)?(_=!!t.spaceBefore,A=t.commentBefore,T=t.comment):(_=!1,A=null,T=null,t&&typeof t=="object"&&(t=c.createNode(t))),n.implicitKey=!1,!v&&!x&&vt(t)&&(n.indentAtStart=k.length+1),w=!1,!y&&d.length>=2&&!n.inFlow&&!v&&Ul(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let D=!1;const $=Al(t,n,()=>D=!0,()=>w=!0);let j=" ";if(x||_||A){if(j=_?`
|
|
370
370
|
`:"",A){const q=h(A);j+=`
|
|
@@ -375,17 +375,17 @@ ${ka(q,n.indent)}`}$===""&&!n.inFlow?j===`
|
|
|
375
375
|
${n.indent}`}else if(!v&&Mt(t)){const q=$[0],U=$.indexOf(`
|
|
376
376
|
`),Z=U!==-1,O=n.inFlow??t.flow??t.items.length===0;if(Z||!O){let P=!1;if(Z&&(q==="&"||q==="!")){let G=$.indexOf(" ");q==="&"&&G!==-1&&G<U&&$[G+1]==="!"&&(G=$.indexOf(" ",G+1)),(G===-1||U<G)&&(P=!0)}P||(j=`
|
|
377
377
|
${n.indent}`)}}else($===""||$[0]===`
|
|
378
|
-
`)&&(j="");return k+=j+$,n.inFlow?D&&a&&a():T&&!D?k+=Zr(k,n.indent,h(T)):w&&s&&s(),k}function v1(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ku="<<",Na={identify:e=>e===Ku||typeof e=="symbol"&&e.description===Ku,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ze(Symbol(Ku)),{addToJSMap:E1}),stringify:()=>Ku},R2=(e,t)=>(Na.identify(t)||vt(t)&&(!t.type||t.type===ze.PLAIN)&&Na.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Na.tag&&n.default));function E1(e,t,n){if(n=e&&
|
|
378
|
+
`)&&(j="");return k+=j+$,n.inFlow?D&&a&&a():T&&!D?k+=Zr(k,n.indent,h(T)):w&&s&&s(),k}function v1(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ku="<<",Na={identify:e=>e===Ku||typeof e=="symbol"&&e.description===Ku,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ze(Symbol(Ku)),{addToJSMap:E1}),stringify:()=>Ku},R2=(e,t)=>(Na.identify(t)||vt(t)&&(!t.type||t.type===ze.PLAIN)&&Na.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Na.tag&&n.default));function E1(e,t,n){if(n=e&&kr(n)?n.resolve(e.doc):n,Ul(n))for(const a of n.items)dm(e,t,a);else if(Array.isArray(n))for(const a of n)dm(e,t,a);else dm(e,t,n)}function dm(e,t,n){const a=e&&kr(n)?n.resolve(e.doc):n;if(!Bl(a))throw new Error("Merge sources must be maps or map aliases");const s=a.toJSON(null,e,Map);for(const[o,c]of s)t instanceof Map?t.has(o)||t.set(o,c):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:c,writable:!0,enumerable:!0,configurable:!0});return t}function S1(e,t,{key:n,value:a}){if(jt(n)&&n.addToJSMap)n.addToJSMap(e,t,a);else if(R2(e,n))E1(e,t,a);else{const s=vi(n,"",e);if(t instanceof Map)t.set(s,vi(a,s,e));else if(t instanceof Set)t.add(s);else{const o=M2(n,s,e),c=vi(a,o,e);o in t?Object.defineProperty(t,o,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[o]=c}}return t}function M2(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(jt(e)&&(n!=null&&n.doc)){const a=x1(n.doc,{});a.anchors=new Set;for(const o of n.anchors.keys())a.anchors.add(o.anchor);a.inFlow=!0,a.inStringifyKey=!0;const s=e.toString(a);if(!n.mapKeyWarned){let o=JSON.stringify(s);o.length>40&&(o=o.substring(0,36)+'..."'),v1(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function Yp(e,t,n){const a=sc(e,void 0,n),s=sc(t,void 0,n);return new gn(a,s)}class gn{constructor(t,n=null){Object.defineProperty(this,Si,{value:l1}),this.key=t,this.value=n}clone(t){let{key:n,value:a}=this;return jt(n)&&(n=n.clone(t)),jt(a)&&(a=a.clone(t)),new gn(n,a)}toJSON(t,n){const a=n!=null&&n.mapAsMap?new Map:{};return S1(n,a,this)}toString(t,n,a){return t!=null&&t.doc?O2(this,t,n,a):JSON.stringify(this)}}function w1(e,t,n){return(t.inFlow??e.flow?D2:j2)(e,t,n)}function j2({comment:e,items:t},n,{blockItemPrefix:a,flowChars:s,itemIndent:o,onChompKeep:c,onComment:f}){const{indent:d,options:{commentString:h}}=n,y=Object.assign({},n,{indent:o,type:null});let g=!1;const x=[];for(let S=0;S<t.length;++S){const w=t[S];let k=null;if(jt(w))!g&&w.spaceBefore&&x.push(""),Ef(n,x,w.commentBefore,g),w.comment&&(k=w.comment);else if(At(w)){const A=jt(w.key)?w.key:null;A&&(!g&&A.spaceBefore&&x.push(""),Ef(n,x,A.commentBefore,g))}g=!1;let _=Al(w,y,()=>k=null,()=>g=!0);k&&(_+=Zr(_,o,h(k))),g&&k&&(g=!1),x.push(a+_)}let v;if(x.length===0)v=s.start+s.end;else{v=x[0];for(let S=1;S<x.length;++S){const w=x[S];v+=w?`
|
|
379
379
|
${d}${w}`:`
|
|
380
380
|
`}}return e?(v+=`
|
|
381
381
|
`+ka(h(e),d),f&&f()):g&&c&&c(),v}function D2({items:e},t,{flowChars:n,itemIndent:a}){const{indent:s,indentStep:o,flowCollectionPadding:c,options:{commentString:f}}=t;a+=o;const d=Object.assign({},t,{indent:a,inFlow:!0,type:null});let h=!1,y=0;const g=[];for(let S=0;S<e.length;++S){const w=e[S];let k=null;if(jt(w))w.spaceBefore&&g.push(""),Ef(t,g,w.commentBefore,!1),w.comment&&(k=w.comment);else if(At(w)){const A=jt(w.key)?w.key:null;A&&(A.spaceBefore&&g.push(""),Ef(t,g,A.commentBefore,!1),A.comment&&(h=!0));const T=jt(w.value)?w.value:null;T?(T.comment&&(k=T.comment),T.commentBefore&&(h=!0)):w.value==null&&(A!=null&&A.comment)&&(k=A.comment)}k&&(h=!0);let _=Al(w,d,()=>k=null);h||(h=g.length>y||_.includes(`
|
|
382
382
|
`)),S<e.length-1?_+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||(h=g.reduce((A,T)=>A+T.length+2,2)+(_.length+2)>t.options.lineWidth)),h&&(_+=",")),k&&(_+=Zr(_,a,f(k))),g.push(_),y=g.length}const{start:x,end:v}=n;if(g.length===0)return x+v;if(!h){const S=g.reduce((w,k)=>w+k.length+2,2);h=t.options.lineWidth>0&&S>t.options.lineWidth}if(h){let S=x;for(const w of g)S+=w?`
|
|
383
383
|
${o}${s}${w}`:`
|
|
384
384
|
`;return`${S}
|
|
385
|
-
${s}${v}`}else return`${x}${c}${g.join(" ")}${c}${v}`}function Ef({indent:e,options:{commentString:t}},n,a,s){if(a&&s&&(a=a.replace(/^\n+/,"")),a){const o=ka(t(a),e);n.push(o.trimStart())}}function Wr(e,t){const n=vt(t)?t.value:t;for(const a of e)if(At(a)&&(a.key===t||a.key===n||vt(a.key)&&a.key.value===n))return a}class ii extends b1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(
|
|
385
|
+
${s}${v}`}else return`${x}${c}${g.join(" ")}${c}${v}`}function Ef({indent:e,options:{commentString:t}},n,a,s){if(a&&s&&(a=a.replace(/^\n+/,"")),a){const o=ka(t(a),e);n.push(o.trimStart())}}function Wr(e,t){const n=vt(t)?t.value:t;for(const a of e)if(At(a)&&(a.key===t||a.key===n||vt(a.key)&&a.key.value===n))return a}class ii extends b1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(vr,t),this.items=[]}static from(t,n,a){const{keepUndefined:s,replacer:o}=a,c=new this(t),f=(d,h)=>{if(typeof o=="function")h=o.call(n,d,h);else if(Array.isArray(o)&&!o.includes(d))return;(h!==void 0||s)&&c.items.push(Yp(d,h,a))};if(n instanceof Map)for(const[d,h]of n)f(d,h);else if(n&&typeof n=="object")for(const d of Object.keys(n))f(d,n[d]);return typeof t.sortMapEntries=="function"&&c.items.sort(t.sortMapEntries),c}add(t,n){var c;let a;At(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new gn(t,t==null?void 0:t.value):a=new gn(t.key,t.value);const s=Wr(this.items,a.key),o=(c=this.schema)==null?void 0:c.sortMapEntries;if(s){if(!n)throw new Error(`Key ${a.key} already set`);vt(s.value)&&g1(a.value)?s.value.value=a.value:s.value=a.value}else if(o){const f=this.items.findIndex(d=>o(a,d)<0);f===-1?this.items.push(a):this.items.splice(f,0,a)}else this.items.push(a)}delete(t){const n=Wr(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const a=Wr(this.items,t),s=a==null?void 0:a.value;return(!n&&vt(s)?s.value:s)??void 0}has(t){return!!Wr(this.items,t)}set(t,n){this.add(new gn(t,n),!0)}toJSON(t,n,a){const s=a?new a:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const o of this.items)S1(n,s,o);return s}toString(t,n,a){if(!t)return JSON.stringify(this);for(const s of this.items)if(!At(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),w1(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:n})}}const Fl={collection:"map",default:!0,nodeClass:ii,tag:"tag:yaml.org,2002:map",resolve(e,t){return Bl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>ii.from(e,t,n)};class Sr extends b1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(zl,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Gu(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const a=Gu(t);if(typeof a!="number")return;const s=this.items[a];return!n&&vt(s)?s.value:s}has(t){const n=Gu(t);return typeof n=="number"&&n<this.items.length}set(t,n){const a=Gu(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[a];vt(s)&&g1(n)?s.value=n:this.items[a]=n}toJSON(t,n){const a=[];n!=null&&n.onCreate&&n.onCreate(a);let s=0;for(const o of this.items)a.push(vi(o,String(s++),n));return a}toString(t,n,a){return t?w1(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:n}):JSON.stringify(this)}static from(t,n,a){const{replacer:s}=a,o=new this(t);if(n&&Symbol.iterator in Object(n)){let c=0;for(let f of n){if(typeof s=="function"){const d=n instanceof Set?f:String(c++);f=s.call(n,d,f)}o.items.push(sc(f,void 0,a))}}return o}}function Gu(e){let t=vt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const $l={collection:"seq",default:!0,nodeClass:Sr,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Ul(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Sr.from(e,t,n)},Ff={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,a){return t=Object.assign({actualString:!0},t),xc(e,t,n,a)}},$f={identify:e=>e==null,createNode:()=>new ze(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ze(null),stringify:({source:e},t)=>typeof e=="string"&&$f.test.test(e)?e:t.options.nullStr},Vp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ze(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Vp.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(t===a)return e}return t?n.options.trueStr:n.options.falseStr}};function Di({format:e,minFractionDigits:t,tag:n,value:a}){if(typeof a=="bigint")return String(a);const s=typeof a=="number"?a:Number(a);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let o=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let c=o.indexOf(".");c<0&&(c=o.length,o+=".");let f=t-(o.length-c-1);for(;f-- >0;)o+="0"}return o}const _1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Di},k1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Di(e)}},N1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ze(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Di},Pf=e=>typeof e=="bigint"||Number.isInteger(e),Xp=(e,t,n,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),n);function T1(e,t,n){const{value:a}=e;return Pf(a)&&a>=0?n+a.toString(t):Di(e)}const C1={identify:e=>Pf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Xp(e,2,8,n),stringify:e=>T1(e,8,"0o")},A1={identify:Pf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Xp(e,0,10,n),stringify:Di},O1={identify:e=>Pf(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Xp(e,2,16,n),stringify:e=>T1(e,16,"0x")},L2=[Fl,$l,Ff,$f,Vp,C1,A1,O1,_1,k1,N1];function qv(e){return typeof e=="bigint"||Number.isInteger(e)}const Qu=({value:e})=>JSON.stringify(e),I2=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Qu},{identify:e=>e==null,createNode:()=>new ze(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Qu},{identify:qv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>qv(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Qu}],z2={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},B2=[Fl,$l].concat(I2,z2),Zp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(n.length);for(let s=0;s<n.length;++s)a[s]=n.charCodeAt(s);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},a,s,o){if(!n)return"";const c=n;let f;if(typeof btoa=="function"){let d="";for(let h=0;h<c.length;++h)d+=String.fromCharCode(c[h]);f=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ze.BLOCK_LITERAL),t!==ze.QUOTE_DOUBLE){const d=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),h=Math.ceil(f.length/d),y=new Array(h);for(let g=0,x=0;g<h;++g,x+=d)y[g]=f.substr(x,d);f=y.join(t===ze.BLOCK_LITERAL?`
|
|
386
386
|
`:" ")}return xc({comment:e,type:t,value:f},a,s,o)}};function R1(e,t){if(Ul(e))for(let n=0;n<e.items.length;++n){let a=e.items[n];if(!At(a)){if(Bl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const s=a.items[0]||new gn(new ze(null));if(a.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${a.commentBefore}
|
|
387
387
|
${s.key.commentBefore}`:a.commentBefore),a.comment){const o=s.value??s.key;o.comment=o.comment?`${a.comment}
|
|
388
|
-
${o.comment}`:a.comment}a=s}e.items[n]=At(a)?a:new gn(a)}}else t("Expected a sequence for this tag");return e}function M1(e,t,n){const{replacer:a}=n,s=new
|
|
388
|
+
${o.comment}`:a.comment}a=s}e.items[n]=At(a)?a:new gn(a)}}else t("Expected a sequence for this tag");return e}function M1(e,t,n){const{replacer:a}=n,s=new Sr(e);s.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let c of t){typeof a=="function"&&(c=a.call(t,String(o++),c));let f,d;if(Array.isArray(c))if(c.length===2)f=c[0],d=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){const h=Object.keys(c);if(h.length===1)f=h[0],d=c[f];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else f=c;s.items.push(Yp(f,d,n))}return s}const Wp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:R1,createNode:M1};class hl extends Sr{constructor(){super(),this.add=ii.prototype.add.bind(this),this.delete=ii.prototype.delete.bind(this),this.get=ii.prototype.get.bind(this),this.has=ii.prototype.has.bind(this),this.set=ii.prototype.set.bind(this),this.tag=hl.tag}toJSON(t,n){if(!n)return super.toJSON(t);const a=new Map;n!=null&&n.onCreate&&n.onCreate(a);for(const s of this.items){let o,c;if(At(s)?(o=vi(s.key,"",n),c=vi(s.value,o,n)):o=vi(s,"",n),a.has(o))throw new Error("Ordered maps must not include duplicate keys");a.set(o,c)}return a}static from(t,n,a){const s=M1(t,n,a),o=new this;return o.items=s.items,o}}hl.tag="tag:yaml.org,2002:omap";const Jp={collection:"seq",identify:e=>e instanceof Map,nodeClass:hl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=R1(e,t),a=[];for(const{key:s}of n.items)vt(s)&&(a.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):a.push(s.value));return Object.assign(new hl,n)},createNode:(e,t,n)=>hl.from(e,t,n)};function j1({value:e,source:t},n){return t&&(e?D1:L1).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const D1={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ze(!0),stringify:j1},L1={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ze(!1),stringify:j1},U2={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Di},F2={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Di(e)}},$2={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ze(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const a=e.substring(n+1).replace(/_/g,"");a[a.length-1]==="0"&&(t.minFractionDigits=a.length)}return t},stringify:Di},vc=e=>typeof e=="bigint"||Number.isInteger(e);function qf(e,t,n,{intAsBigInt:a}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const c=BigInt(e);return s==="-"?BigInt(-1)*c:c}const o=parseInt(e,n);return s==="-"?-1*o:o}function eg(e,t,n){const{value:a}=e;if(vc(a)){const s=a.toString(t);return a<0?"-"+n+s.substr(1):n+s}return Di(e)}const P2={identify:vc,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>qf(e,2,2,n),stringify:e=>eg(e,2,"0b")},q2={identify:vc,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>qf(e,1,8,n),stringify:e=>eg(e,8,"0")},H2={identify:vc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>qf(e,0,10,n),stringify:Di},K2={identify:vc,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>qf(e,2,16,n),stringify:e=>eg(e,16,"0x")};class ml extends ii{constructor(t){super(t),this.tag=ml.tag}add(t){let n;At(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new gn(t.key,null):n=new gn(t,null),Wr(this.items,n.key)||this.items.push(n)}get(t,n){const a=Wr(this.items,t);return!n&&At(a)?vt(a.key)?a.key.value:a.key:a}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const a=Wr(this.items,t);a&&!n?this.items.splice(this.items.indexOf(a),1):!a&&n&&this.items.push(new gn(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,a){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,a);throw new Error("Set items must all have null values")}static from(t,n,a){const{replacer:s}=a,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let c of n)typeof s=="function"&&(c=s.call(n,c,c)),o.items.push(Yp(c,null,a));return o}}ml.tag="tag:yaml.org,2002:set";const tg={collection:"map",identify:e=>e instanceof Set,nodeClass:ml,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>ml.from(e,t,n),resolve(e,t){if(Bl(e)){if(e.hasAllNullValues(!0))return Object.assign(new ml,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ng(e,t){const n=e[0],a=n==="-"||n==="+"?e.substring(1):e,s=c=>t?BigInt(c):Number(c),o=a.replace(/_/g,"").split(":").reduce((c,f)=>c*s(60)+s(f),s(0));return n==="-"?s(-1)*o:o}function I1(e){let{value:t}=e,n=c=>c;if(typeof t=="bigint")n=c=>BigInt(c);else if(isNaN(t)||!isFinite(t))return Di(e);let a="";t<0&&(a="-",t*=n(-1));const s=n(60),o=[t%s];return t<60?o.unshift(0):(t=(t-o[0])/s,o.unshift(t%s),t>=60&&(t=(t-o[0])/s,o.unshift(t))),a+o.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const z1={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ng(e,n),stringify:I1},B1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ng(e,!1),stringify:I1},Hf={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Hf.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,a,s,o,c,f]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,a-1,s,o||0,c||0,f||0,d);const y=t[8];if(y&&y!=="Z"){let g=ng(y,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Hv=[Fl,$l,Ff,$f,D1,L1,P2,q2,H2,K2,U2,F2,$2,Zp,Na,Jp,Wp,tg,z1,B1,Hf],Kv=new Map([["core",L2],["failsafe",[Fl,$l,Ff]],["json",B2],["yaml11",Hv],["yaml-1.1",Hv]]),Gv={binary:Zp,bool:Vp,float:N1,floatExp:k1,floatNaN:_1,floatTime:B1,int:A1,intHex:O1,intOct:C1,intTime:z1,map:Fl,merge:Na,null:$f,omap:Jp,pairs:Wp,seq:$l,set:tg,timestamp:Hf},G2={"tag:yaml.org,2002:binary":Zp,"tag:yaml.org,2002:merge":Na,"tag:yaml.org,2002:omap":Jp,"tag:yaml.org,2002:pairs":Wp,"tag:yaml.org,2002:set":tg,"tag:yaml.org,2002:timestamp":Hf};function hm(e,t,n){const a=Kv.get(t);if(a&&!e)return n&&!a.includes(Na)?a.concat(Na):a.slice();let s=a;if(!s)if(Array.isArray(e))s=[];else{const o=Array.from(Kv.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)s=s.concat(o);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(Na)),s.reduce((o,c)=>{const f=typeof c=="string"?Gv[c]:c;if(!f){const d=JSON.stringify(c),h=Object.keys(Gv).map(y=>JSON.stringify(y)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${h}`)}return o.includes(f)||o.push(f),o},[])}const Q2=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let U1=class F1{constructor({compat:t,customTags:n,merge:a,resolveKnownTags:s,schema:o,sortMapEntries:c,toStringDefaults:f}){this.compat=Array.isArray(t)?hm(t,"compat"):t?hm(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=s?G2:{},this.tags=hm(n,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,vr,{value:Fl}),Object.defineProperty(this,Vi,{value:Ff}),Object.defineProperty(this,zl,{value:$l}),this.sortMapEntries=typeof c=="function"?c:c===!0?Q2:null}clone(){const t=Object.create(F1.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Y2(e,t){var d;const n=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(n.push(h),a=!0):e.directives.docStart&&(a=!0)}a&&n.push("---");const s=x1(e,t),{commentString:o}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=o(e.commentBefore);n.unshift(ka(h,""))}let c=!1,f=null;if(e.contents){if(jt(e.contents)){if(e.contents.spaceBefore&&a&&n.push(""),e.contents.commentBefore){const g=o(e.contents.commentBefore);n.push(ka(g,""))}s.forceBlockIndent=!!e.comment,f=e.contents.comment}const h=f?void 0:()=>c=!0;let y=Al(e.contents,s,()=>f=null,h);f&&(y+=Zr(y,"",o(f))),(y[0]==="|"||y[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${y}`:n.push(y)}else n.push(Al(e.contents,s));if((d=e.directives)!=null&&d.docEnd)if(e.comment){const h=o(e.comment);h.includes(`
|
|
389
389
|
`)?(n.push("..."),n.push(ka(h,""))):n.push(`... ${h}`)}else n.push("...");else{let h=e.comment;h&&c&&(h=h.replace(/^\n+/,"")),h&&((!c||f)&&n[n.length-1]!==""&&n.push(""),n.push(ka(o(h),"")))}return n.join(`
|
|
390
390
|
`)+`
|
|
391
391
|
`}class Pl{constructor(t,n,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Si,{value:sp});let s=null;typeof n=="function"||Array.isArray(n)?s=n:a===void 0&&n&&(a=n,n=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=o;let{version:c}=o;a!=null&&a._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new Nn({version:c}),this.setSchema(c,a),this.contents=t===void 0?null:this.createNode(t,s,a)}clone(){const t=Object.create(Pl.prototype,{[Si]:{value:sp}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=jt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){nl(this.contents)&&this.contents.add(t)}addIn(t,n){nl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const a=m1(this);t.anchor=!n||a.has(n)?p1(n||"a",a):n}return new If(t.anchor)}createNode(t,n,a){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const k=A=>typeof A=="number"||A instanceof String||A instanceof Number,_=n.filter(k).map(String);_.length>0&&(n=n.concat(_)),s=n}else a===void 0&&n&&(a=n,n=void 0);const{aliasDuplicateObjects:o,anchorPrefix:c,flow:f,keepUndefined:d,onTagObj:h,tag:y}=a??{},{onAnchor:g,setAnchors:x,sourceObjects:v}=S2(this,c||"a"),S={aliasDuplicateObjects:o??!0,keepUndefined:d??!1,onAnchor:g,onTagObj:h,replacer:s,schema:this.schema,sourceObjects:v},w=sc(t,y,S);return f&&Mt(w)&&(w.flow=!0),x(),w}createPair(t,n,a={}){const s=this.createNode(t,null,a),o=this.createNode(n,null,a);return new gn(s,o)}delete(t){return nl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Zo(t)?this.contents==null?!1:(this.contents=null,!0):nl(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Mt(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Zo(t)?!n&&vt(this.contents)?this.contents.value:this.contents:Mt(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Mt(this.contents)?this.contents.has(t):!1}hasIn(t){return Zo(t)?this.contents!==void 0:Mt(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=vf(this.schema,[t],n):nl(this.contents)&&this.contents.set(t,n)}setIn(t,n){Zo(t)?this.contents=n:this.contents==null?this.contents=vf(this.schema,Array.from(t),n):nl(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let a;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Nn({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Nn({version:t}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(a)this.schema=new U1(Object.assign(a,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:a,maxAliasCount:s,onAnchor:o,reviver:c}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},d=vi(this.contents,n??"",f);if(typeof o=="function")for(const{count:h,res:y}of f.anchors.values())o(y,h);return typeof c=="function"?fl(c,{"":d},"",d):d}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Y2(this,t)}}function nl(e){if(Mt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class ig extends Error{constructor(t,n,a,s){super(),this.name=t,this.code=a,this.message=s,this.pos=n}}class Jr extends ig{constructor(t,n,a){super("YAMLParseError",t,n,a)}}class $1 extends ig{constructor(t,n,a){super("YAMLWarning",t,n,a)}}const Sf=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(f=>t.linePos(f));const{line:a,col:s}=n.linePos[0];n.message+=` at line ${a}, column ${s}`;let o=s-1,c=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(o>=60&&c.length>80){const f=Math.min(o-39,c.length-79);c="…"+c.substring(f),o-=f-1}if(c.length>80&&(c=c.substring(0,79)+"…"),a>1&&/^ *$/.test(c.substring(0,o))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
|
|
@@ -396,11 +396,11 @@ ${h}
|
|
|
396
396
|
`}};function Ol(e,{flow:t,indicator:n,next:a,offset:s,onError:o,parentIndent:c,startOnNewline:f}){let d=!1,h=f,y=f,g="",x="",v=!1,S=!1,w=null,k=null,_=null,A=null,T=null,D=null,$=null;for(const U of e)switch(S&&(U.type!=="space"&&U.type!=="newline"&&U.type!=="comma"&&o(U.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S=!1),w&&(h&&U.type!=="comment"&&U.type!=="newline"&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),U.type){case"space":!t&&(n!=="doc-start"||(a==null?void 0:a.type)!=="flow-collection")&&U.source.includes(" ")&&(w=U),y=!0;break;case"comment":{y||o(U,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const Z=U.source.substring(1)||" ";g?g+=x+Z:g=Z,x="",h=!1;break}case"newline":h?g?g+=U.source:(!D||n!=="seq-item-ind")&&(d=!0):x+=U.source,h=!0,v=!0,(k||_)&&(A=U),y=!0;break;case"anchor":k&&o(U,"MULTIPLE_ANCHORS","A node can have at most one anchor"),U.source.endsWith(":")&&o(U.offset+U.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),k=U,$??($=U.offset),h=!1,y=!1,S=!0;break;case"tag":{_&&o(U,"MULTIPLE_TAGS","A node can have at most one tag"),_=U,$??($=U.offset),h=!1,y=!1,S=!0;break}case n:(k||_)&&o(U,"BAD_PROP_ORDER",`Anchors and tags must be after the ${U.source} indicator`),D&&o(U,"UNEXPECTED_TOKEN",`Unexpected ${U.source} in ${t??"collection"}`),D=U,h=n==="seq-item-ind"||n==="explicit-key-ind",y=!1;break;case"comma":if(t){T&&o(U,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),T=U,h=!1,y=!1;break}default:o(U,"UNEXPECTED_TOKEN",`Unexpected ${U.type} token`),h=!1,y=!1}const j=e[e.length-1],q=j?j.offset+j.source.length:s;return S&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&o(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(h&&w.indent<=c||(a==null?void 0:a.type)==="block-map"||(a==null?void 0:a.type)==="block-seq")&&o(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:T,found:D,spaceBefore:d,comment:g,hasNewline:v,anchor:k,tag:_,newlineAfterProp:A,end:q,start:$??q}}function lc(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
397
397
|
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(lc(t.key)||lc(t.value))return!0}return!1;default:return!0}}function up(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&lc(t)&&n(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function P1(e,t,n){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const s=typeof a=="function"?a:(o,c)=>o===c||vt(o)&&vt(c)&&o.value===c.value;return t.some(o=>s(o.key,n))}const Qv="All mapping items must start at the same column";function V2({composeNode:e,composeEmptyNode:t},n,a,s,o){var y;const c=(o==null?void 0:o.nodeClass)??ii,f=new c(n.schema);n.atRoot&&(n.atRoot=!1);let d=a.offset,h=null;for(const g of a.items){const{start:x,key:v,sep:S,value:w}=g,k=Ol(x,{indicator:"explicit-key-ind",next:v??(S==null?void 0:S[0]),offset:d,onError:s,parentIndent:a.indent,startOnNewline:!0}),_=!k.found;if(_){if(v&&(v.type==="block-seq"?s(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==a.indent&&s(d,"BAD_INDENT",Qv)),!k.anchor&&!k.tag&&!S){h=k.end,k.comment&&(f.comment?f.comment+=`
|
|
398
398
|
`+k.comment:f.comment=k.comment);continue}(k.newlineAfterProp||lc(v))&&s(v??x[x.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((y=k.found)==null?void 0:y.indent)!==a.indent&&s(d,"BAD_INDENT",Qv);n.atKey=!0;const A=k.end,T=v?e(n,v,k,s):t(n,A,x,null,k,s);n.schema.compat&&up(a.indent,v,s),n.atKey=!1,P1(n,f.items,T)&&s(A,"DUPLICATE_KEY","Map keys must be unique");const D=Ol(S??[],{indicator:"map-value-ind",next:w,offset:T.range[2],onError:s,parentIndent:a.indent,startOnNewline:!v||v.type==="block-scalar"});if(d=D.end,D.found){_&&((w==null?void 0:w.type)==="block-map"&&!D.hasNewline&&s(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&k.start<D.found.offset-1024&&s(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const $=w?e(n,w,D,s):t(n,d,S,null,D,s);n.schema.compat&&up(a.indent,w,s),d=$.range[2];const j=new gn(T,$);n.options.keepSourceTokens&&(j.srcToken=g),f.items.push(j)}else{_&&s(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),D.comment&&(T.comment?T.comment+=`
|
|
399
|
-
`+D.comment:T.comment=D.comment);const $=new gn(T);n.options.keepSourceTokens&&($.srcToken=g),f.items.push($)}}return h&&h<d&&s(h,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,d,h??d],f}function X2({composeNode:e,composeEmptyNode:t},n,a,s,o){const c=(o==null?void 0:o.nodeClass)??
|
|
399
|
+
`+D.comment:T.comment=D.comment);const $=new gn(T);n.options.keepSourceTokens&&($.srcToken=g),f.items.push($)}}return h&&h<d&&s(h,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,d,h??d],f}function X2({composeNode:e,composeEmptyNode:t},n,a,s,o){const c=(o==null?void 0:o.nodeClass)??Sr,f=new c(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=a.offset,h=null;for(const{start:y,value:g}of a.items){const x=Ol(y,{indicator:"seq-item-ind",next:g,offset:d,onError:s,parentIndent:a.indent,startOnNewline:!0});if(!x.found)if(x.anchor||x.tag||g)(g==null?void 0:g.type)==="block-seq"?s(x.end,"BAD_INDENT","All sequence items must start at the same column"):s(d,"MISSING_CHAR","Sequence item without - indicator");else{h=x.end,x.comment&&(f.comment=x.comment);continue}const v=g?e(n,g,x,s):t(n,x.end,y,null,x,s);n.schema.compat&&up(a.indent,g,s),d=v.range[2],f.items.push(v)}return f.range=[a.offset,d,h??d],f}function Ec(e,t,n,a){let s="";if(e){let o=!1,c="";for(const f of e){const{source:d,type:h}=f;switch(h){case"space":o=!0;break;case"comment":{n&&!o&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const y=d.substring(1)||" ";s?s+=c+y:s=y,c="";break}case"newline":s&&(c+=d),o=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=d.length}}return{comment:s,offset:t}}const mm="Block collections are not allowed within flow collections",pm=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Z2({composeNode:e,composeEmptyNode:t},n,a,s,o){var k;const c=a.start.source==="{",f=c?"flow map":"flow sequence",d=(o==null?void 0:o.nodeClass)??(c?ii:Sr),h=new d(n.schema);h.flow=!0;const y=n.atRoot;y&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let g=a.offset+a.start.source.length;for(let _=0;_<a.items.length;++_){const A=a.items[_],{start:T,key:D,sep:$,value:j}=A,q=Ol(T,{flow:f,indicator:"explicit-key-ind",next:D??($==null?void 0:$[0]),offset:g,onError:s,parentIndent:a.indent,startOnNewline:!1});if(!q.found){if(!q.anchor&&!q.tag&&!$&&!j){_===0&&q.comma?s(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):_<a.items.length-1&&s(q.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),q.comment&&(h.comment?h.comment+=`
|
|
400
400
|
`+q.comment:h.comment=q.comment),g=q.end;continue}!c&&n.options.strict&&lc(D)&&s(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(_===0)q.comma&&s(q.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(q.comma||s(q.start,"MISSING_CHAR",`Missing , between ${f} items`),q.comment){let U="";e:for(const Z of T)switch(Z.type){case"comma":case"space":break;case"comment":U=Z.source.substring(1);break e;default:break e}if(U){let Z=h.items[h.items.length-1];At(Z)&&(Z=Z.value??Z.key),Z.comment?Z.comment+=`
|
|
401
401
|
`+U:Z.comment=U,q.comment=q.comment.substring(U.length+1)}}if(!c&&!$&&!q.found){const U=j?e(n,j,q,s):t(n,q.end,$,null,q,s);h.items.push(U),g=U.range[2],pm(j)&&s(U.range,"BLOCK_IN_FLOW",mm)}else{n.atKey=!0;const U=q.end,Z=D?e(n,D,q,s):t(n,U,T,null,q,s);pm(D)&&s(Z.range,"BLOCK_IN_FLOW",mm),n.atKey=!1;const O=Ol($??[],{flow:f,indicator:"map-value-ind",next:j,offset:Z.range[2],onError:s,parentIndent:a.indent,startOnNewline:!1});if(O.found){if(!c&&!q.found&&n.options.strict){if($)for(const le of $){if(le===O.found)break;if(le.type==="newline"){s(le,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}q.start<O.found.offset-1024&&s(O.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&((k=j.source)==null?void 0:k[0])===":"?s(j,"MISSING_CHAR",`Missing space after : in ${f}`):s(O.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const P=j?e(n,j,O,s):O.found?t(n,O.end,$,null,O,s):null;P?pm(j)&&s(P.range,"BLOCK_IN_FLOW",mm):O.comment&&(Z.comment?Z.comment+=`
|
|
402
402
|
`+O.comment:Z.comment=O.comment);const G=new gn(Z,P);if(n.options.keepSourceTokens&&(G.srcToken=A),c){const le=h;P1(n,le.items,Z)&&s(U,"DUPLICATE_KEY","Map keys must be unique"),le.items.push(G)}else{const le=new ii(n.schema);le.flow=!0,le.items.push(G);const ae=(P??Z).range;le.range=[Z.range[0],ae[1],ae[2]],h.items.push(le)}g=P?P.range[2]:O.end}}const x=c?"}":"]",[v,...S]=a.end;let w=g;if((v==null?void 0:v.source)===x)w=v.offset+v.source.length;else{const _=f[0].toUpperCase()+f.substring(1),A=y?`${_} must end with a ${x}`:`${_} in block collection must be sufficiently indented and end with a ${x}`;s(g,y?"MISSING_CHAR":"BAD_INDENT",A),v&&v.source.length!==1&&S.unshift(v)}if(S.length>0){const _=Ec(S,w,n.options.strict,s);_.comment&&(h.comment?h.comment+=`
|
|
403
|
-
`+_.comment:h.comment=_.comment),h.range=[a.offset,w,_.offset]}else h.range=[a.offset,w,w];return h}function gm(e,t,n,a,s,o){const c=n.type==="block-map"?V2(e,t,n,a,o):n.type==="block-seq"?X2(e,t,n,a,o):Z2(e,t,n,a,o),f=c.constructor;return s==="!"||s===f.tagName?(c.tag=f.tagName,c):(s&&(c.tag=s),c)}function W2(e,t,n,a,s){var x;const o=a.tag,c=o?t.directives.tagName(o.source,v=>s(o,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:S}=a,w=v&&o?v.offset>o.offset?v:o:v??o;w&&(!S||S.offset<w.offset)&&s(w,"MISSING_CHAR","Missing newline after block sequence props")}const f=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!c||c==="!"||c===ii.tagName&&f==="map"||c===
|
|
403
|
+
`+_.comment:h.comment=_.comment),h.range=[a.offset,w,_.offset]}else h.range=[a.offset,w,w];return h}function gm(e,t,n,a,s,o){const c=n.type==="block-map"?V2(e,t,n,a,o):n.type==="block-seq"?X2(e,t,n,a,o):Z2(e,t,n,a,o),f=c.constructor;return s==="!"||s===f.tagName?(c.tag=f.tagName,c):(s&&(c.tag=s),c)}function W2(e,t,n,a,s){var x;const o=a.tag,c=o?t.directives.tagName(o.source,v=>s(o,"TAG_RESOLVE_FAILED",v)):null;if(n.type==="block-seq"){const{anchor:v,newlineAfterProp:S}=a,w=v&&o?v.offset>o.offset?v:o:v??o;w&&(!S||S.offset<w.offset)&&s(w,"MISSING_CHAR","Missing newline after block sequence props")}const f=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!c||c==="!"||c===ii.tagName&&f==="map"||c===Sr.tagName&&f==="seq")return gm(e,t,n,s,c);let d=t.schema.tags.find(v=>v.tag===c&&v.collection===f);if(!d){const v=t.schema.knownTags[c];if((v==null?void 0:v.collection)===f)t.schema.tags.push(Object.assign({},v,{default:!1})),d=v;else return v?s(o,"BAD_COLLECTION_TYPE",`${v.tag} used for ${f} collection, but expects ${v.collection??"scalar"}`,!0):s(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),gm(e,t,n,s,c)}const h=gm(e,t,n,s,c,d),y=((x=d.resolve)==null?void 0:x.call(d,h,v=>s(o,"TAG_RESOLVE_FAILED",v),t.options))??h,g=jt(y)?y:new ze(y);return g.range=h.range,g.tag=c,d!=null&&d.format&&(g.format=d.format),g}function q1(e,t,n){const a=t.offset,s=J2(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[a,a,a]};const o=s.mode===">"?ze.BLOCK_FOLDED:ze.BLOCK_LITERAL,c=t.source?eO(t.source):[];let f=c.length;for(let w=c.length-1;w>=0;--w){const k=c[w][1];if(k===""||k==="\r")f=w;else break}if(f===0){const w=s.chomp==="+"&&c.length>0?`
|
|
404
404
|
`.repeat(Math.max(1,c.length-1)):"";let k=a+s.length;return t.source&&(k+=t.source.length),{value:w,type:o,comment:s.comment,range:[a,k,k]}}let d=t.indent+s.indent,h=t.offset+s.length,y=0;for(let w=0;w<f;++w){const[k,_]=c[w];if(_===""||_==="\r")s.indent===0&&k.length>d&&(d=k.length);else{k.length<d&&n(h+k.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(d=k.length),y=w,d===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=k.length+_.length+1}for(let w=c.length-1;w>=f;--w)c[w][0].length>d&&(f=w+1);let g="",x="",v=!1;for(let w=0;w<y;++w)g+=c[w][0].slice(d)+`
|
|
405
405
|
`;for(let w=y;w<f;++w){let[k,_]=c[w];h+=k.length+_.length+1;const A=_[_.length-1]==="\r";if(A&&(_=_.slice(0,-1)),_&&k.length<d){const D=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(h-_.length-(A?2:1),"BAD_INDENT",D),k=""}o===ze.BLOCK_LITERAL?(g+=x+k.slice(d)+_,x=`
|
|
406
406
|
`):k.length>d||_[0]===" "?(x===" "?x=`
|
|
@@ -466,21 +466,21 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
466
466
|
`,o=this.buffer[a+1]):n=a),o==="#"||t&&Yu.has(o))break;if(s===`
|
|
467
467
|
`){const c=this.continueScalar(a+1);if(c===-1)break;a=Math.max(a,c-2)}}else{if(t&&Yu.has(s))break;n=a}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield oc,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const a=this.buffer.slice(this.pos,t);return a?(yield a,this.pos+=a.length,a.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ym))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Ai(n)||t&&Yu.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Ai(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(wO.has(n))n=this.buffer[++t];else if(n==="%"&&Vv.has(this.buffer[t+1])&&Vv.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
468
468
|
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
469
|
-
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,a;do a=this.buffer[++n];while(a===" "||t&&a===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,a=this.buffer[n];for(;!t(a);)a=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class J1{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,a=this.lineStarts.length;for(;n<a;){const o=n+a>>1;this.lineStarts[o]<t?n=o+1:a=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function
|
|
469
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,a;do a=this.buffer[++n];while(a===" "||t&&a===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,a=this.buffer[n];for(;!t(a);)a=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class J1{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,a=this.lineStarts.length;for(;n<a;){const o=n+a>>1;this.lineStarts[o]<t?n=o+1:a=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function cr(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Xv(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function eS(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Vu(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function il(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Zv(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!cr(t.start,"explicit-key-ind")&&!cr(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,eS(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class sg{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new W1,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(t,n))yield*this.next(a);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=Z1(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const a=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const a=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in a?a.indent:0:n.type==="flow-collection"&&a.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Zv(n),a.type){case"document":a.value=n;break;case"block-scalar":a.props.push(n);break;case"block-map":{const s=a.items[a.items.length-1];if(s.value){a.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=a.items[a.items.length-1];s.value?a.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=a.items[a.items.length-1];!s||s.value?a.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Xv(s.start)===-1&&(n.indent===0||s.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(a.type==="document"?a.end=s.start:a.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Xv(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Vu(this.peek(2)),a=il(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
470
470
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
471
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var a;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(a=s==null?void 0:s.value)==null?void 0:a.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,o=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&n.sep&&!n.value){const f=[];for(let d=0;d<n.sep.length;++d){const h=n.sep[d];switch(h.type){case"newline":f.push(d);break;case"space":break;case"comment":h.indent>t.indent&&(f.length=0);break;default:f.length=0}}f.length>=2&&(c=n.sep.splice(f[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(c.push(this.sourceToken),t.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(
|
|
471
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var a;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(a=s==null?void 0:s.value)==null?void 0:a.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,o=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&n.sep&&!n.value){const f=[];for(let d=0;d<n.sep.length;++d){const h=n.sep[d];switch(h.type){case"newline":f.push(d);break;case"space":break;case"comment":h.indent>t.indent&&(f.length=0);break;default:f.length=0}}f.length>=2&&(c=n.sep.splice(f[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(c.push(this.sourceToken),t.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(cr(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(eS(n.key)&&!cr(n.sep,"newline")){const f=il(n.start),d=n.key,h=n.sep;h.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:d,sep:h}]})}else c.length>0?n.sep=n.sep.concat(c,this.sourceToken):n.sep.push(this.sourceToken);else if(cr(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const f=il(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:f,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:c,key:null,sep:[this.sourceToken]}):cr(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const f=this.flowScalar(this.type);o||n.value?(t.items.push({start:c,key:f,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(f):(Object.assign(n,{key:f,sep:[]}),this.onKeyLine=!0);return}default:{const f=this.startBlockValue(t);if(f){if(f.type==="block-seq"){if(!n.explicitKey&&n.sep&&!cr(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else s&&t.items.push({start:c});this.stack.push(f);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var a;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,o=Array.isArray(s)?s[s.length-1]:void 0;(o==null?void 0:o.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],o=(a=s==null?void 0:s.value)==null?void 0:a.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||cr(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while((a==null?void 0:a.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===t.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const s=Vu(a),o=il(s);Zv(t);const c=t.end.splice(1,t.end.length);c.push(this.sourceToken);const f={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
472
472
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
473
|
-
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Vu(t),a=il(n);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Vu(t),a=il(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function tS(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new J1||null,prettyErrors:t}}function kO(e,t={}){const{lineCounter:n,prettyErrors:a}=tS(t),s=new sg(n==null?void 0:n.addNewLine),o=new rg(t),c=Array.from(o.compose(s.parse(e)));if(a&&n)for(const f of c)f.errors.forEach(Sf(e,n)),f.warnings.forEach(Sf(e,n));return c.length>0?c:Object.assign([],{empty:!0},o.streamInfo())}function nS(e,t={}){const{lineCounter:n,prettyErrors:a}=tS(t),s=new sg(n==null?void 0:n.addNewLine),o=new rg(t);let c=null;for(const f of o.compose(s.parse(e),!0,e.length))if(!c)c=f;else if(c.options.logLevel!=="silent"){c.errors.push(new Jr(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&n&&(c.errors.forEach(Sf(e,n)),c.warnings.forEach(Sf(e,n))),c}function NO(e,t,n){let a;typeof t=="function"?a=t:n===void 0&&t&&typeof t=="object"&&(n=t);const s=nS(e,n);if(!s)return null;if(s.warnings.forEach(o=>v1(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:a},n))}function TO(e,t,n){let a=null;if(typeof t=="function"||Array.isArray(t)?a=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return hs(e)&&!a?e.toString(n):new Pl(e,a,n).toString(n)}const Wv=Object.freeze(Object.defineProperty({__proto__:null,Alias:If,CST:SO,Composer:rg,Document:Pl,Lexer:W1,LineCounter:J1,Pair:gn,Parser:sg,Scalar:ze,Schema:U1,YAMLError:ig,YAMLMap:ii,YAMLParseError:Jr,YAMLSeq:Er,YAMLWarning:$1,isAlias:_r,isCollection:Mt,isDocument:hs,isMap:Bl,isNode:jt,isPair:At,isScalar:vt,isSeq:Ul,parse:NO,parseAllDocuments:kO,parseDocument:nS,stringify:TO,visit:ms,visitAsync:Lf},Symbol.toStringTag,{value:"Module"}));function CO({projectName:e,file:t,onClose:n,onSaved:a}){const s=qn(),{alert:o}=si(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=lt({queryKey:["pipeline-file",e,t],queryFn:()=>e2(e,t)}),[g,x]=M.useState("structured"),[v,S]=M.useState(null),[w,k]=M.useState(null);M.useEffect(()=>{c&&v===null&&(S(c.content),k(c.etag),c.parseError&&x("yaml"))},[c,v]),M.useEffect(()=>{const j=q=>{q.key==="Escape"&&n()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[n]);const _=Pn({mutationFn:()=>{if(v===null||w===null)throw new Error("no draft");return t2(e,t,v,w)},onSuccess:j=>{k(j.etag),s.invalidateQueries({queryKey:["pipeline-file",e,t]}),s.invalidateQueries({queryKey:["project-pipelines",e]}),a()},onError:j=>{const q=j.status;o({title:q===409?"文件已被其他地方修改":q===422?"YAML 语法错":"保存失败",body:j instanceof Error?j.message:String(j)})}}),A=v!==null&&c&&v!==c.content,{parsed:T,parseError:D}=M.useMemo(()=>{if(v===null)return{parsed:null,parseError:null};try{return{parsed:Wv.parse(v)??{},parseError:null}}catch(j){return{parsed:null,parseError:j instanceof Error?j.message:String(j)}}},[v]),$=j=>{try{const q=Wv.stringify(j,{lineWidth:0});S(q)}catch(q){o({title:"YAML 序列化失败",body:q instanceof Error?q.message:String(q)})}};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-start justify-between gap-3 mb-3 flex-shrink-0",children:[m.jsxs("div",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold flex items-center gap-2",children:[m.jsx(Fv,{size:20,strokeWidth:2.5}),m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-lg",children:t}),(c==null?void 0:c.isActive)&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px"},children:"active"})]}),m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:[e,"/pipelines/",t,w&&` · etag ${w}`]})]}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(vr,{size:14,strokeWidth:3})})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&v!==null&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-shrink-0 flex-wrap",children:[m.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[m.jsxs("button",{type:"button",onClick:()=>x("structured"),"aria-pressed":g==="structured",disabled:!!D,className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",g==="structured"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]",D?"opacity-50 cursor-not-allowed":""].join(" "),title:D??void 0,children:[m.jsx(qp,{size:11,strokeWidth:2.5}),"结构化"]}),m.jsxs("button",{type:"button",onClick:()=>x("yaml"),"aria-pressed":g==="yaml",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",g==="yaml"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[m.jsx(Fv,{size:11,strokeWidth:2.5}),"原始 YAML"]})]}),D&&m.jsxs("div",{className:"flex items-center gap-1 text-xs text-[var(--color-crashed)] font-bold",children:[m.jsx(rc,{size:12,strokeWidth:2.5}),"YAML parse: ",D]}),(c==null?void 0:c.isActive)&&m.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold ml-auto",children:"⚠ 这是当前激活的 pipeline,保存后下一轮 tick 生效"})]}),m.jsxs("div",{className:"flex-1 overflow-auto",children:[g==="structured"&&T&&m.jsx(AO,{parsed:T,onChange:$}),g==="yaml"&&m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:400,resize:"vertical"},value:v,onChange:j=>S(j.target.value),spellCheck:!1,"aria-label":"pipeline YAML 编辑器"})]}),m.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:A?m.jsx("span",{className:"text-[var(--color-stuck)] font-bold",children:"● 未保存"}):_.isSuccess?m.jsxs("span",{className:"text-[var(--color-running)] font-bold flex items-center gap-1",children:[m.jsx(Pp,{size:12,strokeWidth:2.5})," 已保存"]}):"无变化"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:()=>{S(null),y()},disabled:_.isPending,type:"button",children:"重新加载"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:()=>_.mutate(),disabled:!A||_.isPending,type:"button","aria-label":"保存 pipeline",children:[_.isPending?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:13,strokeWidth:3}),"保存"]})]})]})]})]})})}function AO({parsed:e,onChange:t}){const n=e.stages??[],a=d=>{t({...e,stages:d})},s=()=>{a([...n,{name:`stage-${n.length+1}`,on_complete:"move_card Done"}])},o=d=>{a(n.filter((h,y)=>y!==d))},c=(d,h)=>{const y=[...n],g=d+h;g<0||g>=y.length||([y[d],y[g]]=[y[g],y[d]],a(y))},f=(d,h)=>{a(n.map((y,g)=>g===d?{...y,...h}:y))};return m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[m.jsx("span",{className:"font-bold",children:"mode:"}),m.jsxs("select",{className:"nb-input",style:{padding:"4px 10px",fontSize:12},value:e.mode??"project",onChange:d=>t({...e,mode:d.target.value}),children:[m.jsx("option",{value:"project",children:"project"}),m.jsx("option",{value:"steps",children:"steps"})]})]}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"project = 事件驱动流水线(默认) · steps = 顺序脚本"})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider",children:["Stages (",n.length,")"]}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 12px",fontSize:12},onClick:s,"aria-label":"添加 stage",children:[m.jsx(Xi,{size:11,strokeWidth:3})," 添加 stage"]})]}),n.length===0?m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:'还没 stage。点"添加 stage"开始。'}):m.jsx("div",{className:"flex flex-col gap-3",children:n.map((d,h)=>m.jsx(OO,{stage:d,index:h,total:n.length,onChange:y=>f(h,y),onRemove:()=>o(h),onMoveUp:()=>c(h,-1),onMoveDown:()=>c(h,1)},h))})]})]})}function OO({stage:e,index:t,total:n,onChange:a,onRemove:s,onMoveUp:o,onMoveDown:c}){const f=e.on_fail??{};return m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("h4",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["Stage #",t+1,e.name&&m.jsx("code",{className:"ml-2 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:e.name})]}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:o,disabled:t===0,"aria-label":"上移",children:m.jsx(kC,{size:12,strokeWidth:3})}),m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:c,disabled:t===n-1,"aria-label":"下移",children:m.jsx(yc,{size:12,strokeWidth:3})}),m.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"3px 8px"},onClick:s,"aria-label":"删除 stage",children:m.jsx(Il,{size:12,strokeWidth:3})})]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[m.jsx(rr,{label:"name",hint:"stage 唯一名",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.name??"",onChange:d=>a({name:d.target.value}),placeholder:"develop"})}),m.jsx(rr,{label:"profile",hint:"skill 画像,可空",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.profile??"",onChange:d=>a({profile:d.target.value||void 0}),placeholder:"fullstack"})}),m.jsx(rr,{label:"card_state",hint:"本 stage 期间卡片状态",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.card_state??"",onChange:d=>a({card_state:d.target.value||void 0}),placeholder:"Inprogress"})}),m.jsx(rr,{label:"timeout",hint:"可选,如 30m 2h",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.timeout??"",onChange:d=>a({timeout:d.target.value||void 0}),placeholder:"2h"})}),m.jsx(rr,{label:"trigger",hint:"触发条件,可空走默认",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.trigger??"",onChange:d=>a({trigger:d.target.value||void 0}),placeholder:"card_enters 'Todo'"})}),m.jsx(rr,{label:"on_complete",hint:"成功后动作",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.on_complete??"",onChange:d=>a({on_complete:d.target.value}),placeholder:"move_card Done"})})]}),m.jsxs("div",{className:"mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[m.jsx("h5",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-[var(--color-text-muted)]",children:"on_fail"}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[m.jsx(rr,{label:"action",hint:"失败时动作,如 label NEEDS-FIX",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.action??"",onChange:d=>a({on_fail:{...f,action:d.target.value||void 0}}),placeholder:"label NEEDS-FIX"})}),m.jsx(rr,{label:"comment",hint:"写进卡片的注释",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.comment??"",onChange:d=>a({on_fail:{...f,comment:d.target.value||void 0}}),placeholder:"Worker failed. Check logs."})})]}),m.jsxs("label",{className:"flex items-center gap-2 mt-3 text-sm cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f.halt??!0,onChange:d=>a({on_fail:{...f,halt:d.target.checked}})}),m.jsx("span",{className:"font-bold",children:"halt"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(失败后停流水线;去掉则继续下一张卡)"})]})]})]})}function rr({label:e,hint:t,children:n}){return m.jsxs("label",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-xs font-bold font-[family-name:var(--font-mono)]",children:e}),n,t&&m.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t})]})}function RO({onCancel:e,onCreate:t,hasActive:n,hasSample:a,isPending:s}){const[o,c]=M.useState(""),[f,d]=M.useState("blank");M.useEffect(()=>{const v=S=>{S.key==="Escape"&&e()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[e]);const h=o.trim(),y=h.endsWith(".yaml")?h:h?`${h}.yaml`:"",g=y&&/^[a-zA-Z0-9_.-]+\.yaml$/.test(y),x=()=>{!g||s||t(y,f)};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsxs("header",{className:"flex items-start justify-between mb-4",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"新建 pipeline"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:e,type:"button","aria-label":"关闭",children:m.jsx(vr,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:v=>{v.preventDefault(),x()},className:"flex flex-col gap-4",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"文件名"}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"例如 ci",value:o,onChange:v=>c(v.target.value),autoFocus:!0}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["实际会保存为 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:y||"xxx.yaml"}),"。 只允许 a-z A-Z 0-9 _ -;已有同名文件会 409 报错。"]})]}),m.jsxs("fieldset",{className:"flex flex-col gap-2",children:[m.jsx("legend",{className:"text-sm font-bold mb-1",children:"初始内容"}),m.jsx(xm,{value:"blank",current:f,label:"空白模板",desc:"最简 1 stage (develop → Done)",onSelect:d}),m.jsx(xm,{value:"sample",current:f,label:"教学模板",desc:"从 sample.yaml.example 复制(带注释,讲解所有字段)",onSelect:d,disabled:!a,disabledReason:"sample.yaml.example 不存在"}),m.jsx(xm,{value:"active",current:f,label:"复制当前活动的",desc:"从 project.yaml 复制(基于目前的配置改)",onSelect:d,disabled:!n,disabledReason:"project.yaml 不存在"})]}),m.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[m.jsx("button",{className:"nb-btn",onClick:e,type:"button",disabled:s,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"submit",disabled:!g||s,"aria-label":"创建 pipeline",children:[s?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:13,strokeWidth:3}),"创建"]})]})]})]})})}function xm({value:e,current:t,label:n,desc:a,onSelect:s,disabled:o,disabledReason:c}){const f=t===e;return m.jsxs("label",{className:["flex items-start gap-2 p-2 rounded-lg border-2 cursor-pointer",o?"border-[var(--color-border-light)] opacity-50 cursor-not-allowed":f?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"border-[var(--color-border-light)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[m.jsx("input",{type:"radio",name:"pipeline-template",value:e,checked:f,disabled:o,onChange:()=>s(e),className:"mt-1 flex-shrink-0"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:n}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:o?c:a})]})]})}function MO(){var o;const{name:e=""}=UE(),t=Sr(),[n,a]=M.useState("overview"),s=lt({queryKey:["project",e],queryFn:()=>QA(e),enabled:!!e});return m.jsxs("div",{className:"flex flex-col gap-5 max-w-4xl",children:[m.jsxs("header",{className:"flex items-center gap-3",children:[m.jsxs("button",{type:"button",onClick:()=>t("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":"返回项目列表",children:[m.jsx(VE,{size:14,strokeWidth:3}),"返回"]}),m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold flex-1",children:e}),m.jsx(ds,{to:`/board?project=${encodeURIComponent(e)}`,className:"nb-btn nb-btn-mint",children:"看板"})]}),m.jsxs("nav",{className:"flex gap-2 flex-wrap",children:[m.jsx(Xu,{current:n,value:"overview",onSelect:a,icon:$C,children:"概览"}),m.jsx(Xu,{current:n,value:"config",onSelect:a,icon:JE,children:"配置"}),m.jsx(Xu,{current:n,value:"pipelines",onSelect:a,icon:i1,children:"Pipelines"}),m.jsx(Xu,{current:n,value:"danger",onSelect:a,icon:Il,children:"危险操作"})]}),n==="overview"&&m.jsx(jO,{name:e,data:s.data,loading:s.isLoading}),n==="config"&&m.jsx(DO,{name:e}),n==="pipelines"&&m.jsx(LO,{name:e}),n==="danger"&&m.jsx(IO,{name:e,repoDir:((o=s.data)==null?void 0:o.repoDir)??null})]})}function Xu({current:e,value:t,onSelect:n,icon:a,children:s}){const o=e===t;return m.jsxs("button",{type:"button",onClick:()=>n(t),"aria-current":o?"page":void 0,className:["nb-btn",o?"nb-btn-primary":""].join(" "),style:{padding:"6px 14px",fontSize:13},children:[m.jsx(a,{size:13,strokeWidth:2.5}),s]})}function jO({name:e,data:t,loading:n}){return n?m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})}):t?m.jsx("div",{className:"nb-card",children:m.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-3 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"仓库路径"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.repoDir??"—"}),m.jsx("dt",{className:"font-bold",children:"PM 后端"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pmBackend}),m.jsx("dt",{className:"font-bold",children:"Agent"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.agentProvider}),m.jsx("dt",{className:"font-bold",children:"卡片"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)]",children:[t.cards.total," 张 · ",t.cards.inprogress," 进行中 · ",t.cards.done," 完成"]}),m.jsx("dt",{className:"font-bold",children:"Worker"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)]",children:[t.workers.total," 个(",t.workers.active," 活跃)"]}),m.jsx("dt",{className:"font-bold",children:"Pipeline"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pipelineStatus}),m.jsx("dt",{className:"font-bold",children:"最近活动"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.lastActivityAt?new Date(t.lastActivityAt).toLocaleString():"—"})]})}):m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["项目 ",e," 不存在或无法读取。"]})})}function DO({name:e}){const t=qn(),{alert:n}=si(),{data:a,isLoading:s,isError:o,error:c,refetch:f}=lt({queryKey:["project-conf",e],queryFn:()=>VA(e)}),[d,h]=M.useState(null),[y,g]=M.useState(null);M.useEffect(()=>{a&&d===null&&(h(a.content),g(a.etag))},[a,d]);const x=d!==null&&a!==void 0&&d!==a.content,v=Pn({mutationFn:()=>{if(d===null||y===null)throw new Error("no draft");return XA(e,d,y)},onSuccess:S=>{g(S.etag),t.invalidateQueries({queryKey:["project-conf",e]}),t.invalidateQueries({queryKey:["project",e]})},onError:S=>{const w=S.status;n({title:w===409?"配置已被其他地方修改":"保存失败",body:w===409?'conf 文件在你编辑期间被改过。点"重新加载"后再编辑。':S instanceof Error?S.message:String(S)})}});return s?m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})}):o?m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["加载失败: ",c instanceof Error?c.message:String(c)]})}):m.jsxs("div",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:m.jsxs("code",{className:"font-[family-name:var(--font-mono)] text-sm bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:["~/.coral/projects/",e,"/conf"]})}),y&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:["etag: ",y]})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>{h(null),f()},disabled:v.isPending,"aria-label":"重新加载",children:[m.jsx(Cl,{size:13,strokeWidth:2.5}),"重新加载"]}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>v.mutate(),disabled:!x||v.isPending,"aria-label":"保存配置",children:[v.isPending?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):v.isSuccess&&!x?m.jsx(EC,{size:13,strokeWidth:3}):m.jsx(Df,{size:13,strokeWidth:3}),"保存"]})]})]}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:480,resize:"vertical"},value:d??"",onChange:S=>h(S.target.value),spellCheck:!1,"aria-label":"conf 文件编辑器"}),x&&m.jsx("p",{className:"text-xs text-[var(--color-stuck)] mt-2 font-bold",children:"● 未保存的修改"})]})}function LO({name:e}){const t=qn(),{confirm:n,alert:a}=si(),{data:s,isLoading:o}=lt({queryKey:["project-pipelines",e],queryFn:()=>WA(e)}),[c,f]=M.useState(null),[d,h]=M.useState(!1),y=Pn({mutationFn:S=>JA(e,S),onSuccess:()=>t.invalidateQueries({queryKey:["project-pipelines",e]}),onError:S=>{a({title:"切换失败",body:S instanceof Error?S.message:String(S)})}}),g=Pn({mutationFn:S=>i2(e,S),onSuccess:()=>t.invalidateQueries({queryKey:["project-pipelines",e]}),onError:S=>{a({title:"删除失败",body:S instanceof Error?S.message:String(S)})}}),x=Pn({mutationFn:S=>n2(e,S.name,S.template),onSuccess:S=>{t.invalidateQueries({queryKey:["project-pipelines",e]}),h(!1),f(S.name)},onError:S=>{a({title:"创建失败",body:S instanceof Error?S.message:String(S)})}});if(o)return m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})});const v=[];s!=null&&s.active&&v.push({name:s.active,isActive:!0});for(const S of(s==null?void 0:s.available)??[])v.push({name:S.name,isActive:!1});return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:"Pipelines"}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(!0),disabled:x.isPending,"aria-label":"新建 pipeline",children:[m.jsx(Xi,{size:12,strokeWidth:3}),"新建 pipeline"]})]}),v.length===0?m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:'还没有 pipeline 文件。点"新建 pipeline"开始。'}):m.jsx("ul",{className:"flex flex-col gap-2",children:v.map(S=>m.jsxs("li",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsx(i1,{size:16,strokeWidth:2.5}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold flex-1",children:S.name}),S.isActive&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"active"}),m.jsxs("div",{className:"flex gap-1",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>f(S.name),"aria-label":`编辑 ${S.name}`,children:[m.jsx(Hp,{size:11,strokeWidth:2.5}),"编辑"]}),!S.isActive&&m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await n({title:`切换到 ${S.name}`,body:`当前 project.yaml 会被 ${S.name} 的内容覆盖。继续?`,confirm:"切换"})&&y.mutate(S.name)},disabled:y.isPending,"aria-label":`切换到 ${S.name}`,children:"切换"}),m.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await n({title:`删除 ${S.name}`,body:"这个 pipeline 文件会被永久删除。",confirm:"删除",danger:!0})&&g.mutate(S.name)},disabled:g.isPending,"aria-label":`删除 ${S.name}`,children:m.jsx(Il,{size:11,strokeWidth:2.5})})]})]})]},S.name))})]}),c&&m.jsx(CO,{projectName:e,file:c,onClose:()=>f(null),onSaved:()=>{t.invalidateQueries({queryKey:["project-pipelines",e]})}}),d&&m.jsx(RO,{hasActive:!!(s!=null&&s.active),hasSample:!0,isPending:x.isPending,onCancel:()=>h(!1),onCreate:(S,w)=>x.mutate({name:S,template:w})})]})}function IO({name:e,repoDir:t}){const n=Sr(),a=qn(),{alert:s}=si(),[o,c]=M.useState(""),[f,d]=M.useState(!0),h=Pn({mutationFn:()=>ZA(e,{includeClaudeDir:f}),onSuccess:y=>{a.invalidateQueries({queryKey:["projects"]});const g=y.claudeRemoved.filter(x=>x.ok).map(x=>x.path);s({title:"已删除",body:g.length>0?`项目已删除。同时清理了:
|
|
473
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Vu(t),a=il(n);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Vu(t),a=il(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function tS(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new J1||null,prettyErrors:t}}function kO(e,t={}){const{lineCounter:n,prettyErrors:a}=tS(t),s=new sg(n==null?void 0:n.addNewLine),o=new rg(t),c=Array.from(o.compose(s.parse(e)));if(a&&n)for(const f of c)f.errors.forEach(Sf(e,n)),f.warnings.forEach(Sf(e,n));return c.length>0?c:Object.assign([],{empty:!0},o.streamInfo())}function nS(e,t={}){const{lineCounter:n,prettyErrors:a}=tS(t),s=new sg(n==null?void 0:n.addNewLine),o=new rg(t);let c=null;for(const f of o.compose(s.parse(e),!0,e.length))if(!c)c=f;else if(c.options.logLevel!=="silent"){c.errors.push(new Jr(f.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&n&&(c.errors.forEach(Sf(e,n)),c.warnings.forEach(Sf(e,n))),c}function NO(e,t,n){let a;typeof t=="function"?a=t:n===void 0&&t&&typeof t=="object"&&(n=t);const s=nS(e,n);if(!s)return null;if(s.warnings.forEach(o=>v1(s.options.logLevel,o)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:a},n))}function TO(e,t,n){let a=null;if(typeof t=="function"||Array.isArray(t)?a=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return hs(e)&&!a?e.toString(n):new Pl(e,a,n).toString(n)}const Wv=Object.freeze(Object.defineProperty({__proto__:null,Alias:If,CST:SO,Composer:rg,Document:Pl,Lexer:W1,LineCounter:J1,Pair:gn,Parser:sg,Scalar:ze,Schema:U1,YAMLError:ig,YAMLMap:ii,YAMLParseError:Jr,YAMLSeq:Sr,YAMLWarning:$1,isAlias:kr,isCollection:Mt,isDocument:hs,isMap:Bl,isNode:jt,isPair:At,isScalar:vt,isSeq:Ul,parse:NO,parseAllDocuments:kO,parseDocument:nS,stringify:TO,visit:ms,visitAsync:Lf},Symbol.toStringTag,{value:"Module"}));function CO({projectName:e,file:t,onClose:n,onSaved:a}){const s=qn(),{alert:o}=si(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=lt({queryKey:["pipeline-file",e,t],queryFn:()=>e2(e,t)}),[g,x]=M.useState("structured"),[v,S]=M.useState(null),[w,k]=M.useState(null);M.useEffect(()=>{c&&v===null&&(S(c.content),k(c.etag),c.parseError&&x("yaml"))},[c,v]),M.useEffect(()=>{const j=q=>{q.key==="Escape"&&n()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[n]);const _=Pn({mutationFn:()=>{if(v===null||w===null)throw new Error("no draft");return t2(e,t,v,w)},onSuccess:j=>{k(j.etag),s.invalidateQueries({queryKey:["pipeline-file",e,t]}),s.invalidateQueries({queryKey:["project-pipelines",e]}),a()},onError:j=>{const q=j.status;o({title:q===409?"文件已被其他地方修改":q===422?"YAML 语法错":"保存失败",body:j instanceof Error?j.message:String(j)})}}),A=v!==null&&c&&v!==c.content,{parsed:T,parseError:D}=M.useMemo(()=>{if(v===null)return{parsed:null,parseError:null};try{return{parsed:Wv.parse(v)??{},parseError:null}}catch(j){return{parsed:null,parseError:j instanceof Error?j.message:String(j)}}},[v]),$=j=>{try{const q=Wv.stringify(j,{lineWidth:0});S(q)}catch(q){o({title:"YAML 序列化失败",body:q instanceof Error?q.message:String(q)})}};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-start justify-between gap-3 mb-3 flex-shrink-0",children:[m.jsxs("div",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold flex items-center gap-2",children:[m.jsx(Fv,{size:20,strokeWidth:2.5}),m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-lg",children:t}),(c==null?void 0:c.isActive)&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px"},children:"active"})]}),m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:[e,"/pipelines/",t,w&&` · etag ${w}`]})]}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(Er,{size:14,strokeWidth:3})})]}),f&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&v!==null&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-shrink-0 flex-wrap",children:[m.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[m.jsxs("button",{type:"button",onClick:()=>x("structured"),"aria-pressed":g==="structured",disabled:!!D,className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",g==="structured"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]",D?"opacity-50 cursor-not-allowed":""].join(" "),title:D??void 0,children:[m.jsx(qp,{size:11,strokeWidth:2.5}),"结构化"]}),m.jsxs("button",{type:"button",onClick:()=>x("yaml"),"aria-pressed":g==="yaml",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",g==="yaml"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[m.jsx(Fv,{size:11,strokeWidth:2.5}),"原始 YAML"]})]}),D&&m.jsxs("div",{className:"flex items-center gap-1 text-xs text-[var(--color-crashed)] font-bold",children:[m.jsx(rc,{size:12,strokeWidth:2.5}),"YAML parse: ",D]}),(c==null?void 0:c.isActive)&&m.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold ml-auto",children:"⚠ 这是当前激活的 pipeline,保存后下一轮 tick 生效"})]}),m.jsxs("div",{className:"flex-1 overflow-auto",children:[g==="structured"&&T&&m.jsx(AO,{parsed:T,onChange:$}),g==="yaml"&&m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:400,resize:"vertical"},value:v,onChange:j=>S(j.target.value),spellCheck:!1,"aria-label":"pipeline YAML 编辑器"})]}),m.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:A?m.jsx("span",{className:"text-[var(--color-stuck)] font-bold",children:"● 未保存"}):_.isSuccess?m.jsxs("span",{className:"text-[var(--color-running)] font-bold flex items-center gap-1",children:[m.jsx(Pp,{size:12,strokeWidth:2.5})," 已保存"]}):"无变化"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:()=>{S(null),y()},disabled:_.isPending,type:"button",children:"重新加载"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:()=>_.mutate(),disabled:!A||_.isPending,type:"button","aria-label":"保存 pipeline",children:[_.isPending?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:13,strokeWidth:3}),"保存"]})]})]})]})]})})}function AO({parsed:e,onChange:t}){const n=e.stages??[],a=d=>{t({...e,stages:d})},s=()=>{a([...n,{name:`stage-${n.length+1}`,on_complete:"move_card Done"}])},o=d=>{a(n.filter((h,y)=>y!==d))},c=(d,h)=>{const y=[...n],g=d+h;g<0||g>=y.length||([y[d],y[g]]=[y[g],y[d]],a(y))},f=(d,h)=>{a(n.map((y,g)=>g===d?{...y,...h}:y))};return m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[m.jsx("span",{className:"font-bold",children:"mode:"}),m.jsxs("select",{className:"nb-input",style:{padding:"4px 10px",fontSize:12},value:e.mode??"project",onChange:d=>t({...e,mode:d.target.value}),children:[m.jsx("option",{value:"project",children:"project"}),m.jsx("option",{value:"steps",children:"steps"})]})]}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"project = 事件驱动流水线(默认) · steps = 顺序脚本"})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider",children:["Stages (",n.length,")"]}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 12px",fontSize:12},onClick:s,"aria-label":"添加 stage",children:[m.jsx(Xi,{size:11,strokeWidth:3})," 添加 stage"]})]}),n.length===0?m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:'还没 stage。点"添加 stage"开始。'}):m.jsx("div",{className:"flex flex-col gap-3",children:n.map((d,h)=>m.jsx(OO,{stage:d,index:h,total:n.length,onChange:y=>f(h,y),onRemove:()=>o(h),onMoveUp:()=>c(h,-1),onMoveDown:()=>c(h,1)},h))})]})]})}function OO({stage:e,index:t,total:n,onChange:a,onRemove:s,onMoveUp:o,onMoveDown:c}){const f=e.on_fail??{};return m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("h4",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["Stage #",t+1,e.name&&m.jsx("code",{className:"ml-2 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:e.name})]}),m.jsxs("div",{className:"flex gap-1",children:[m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:o,disabled:t===0,"aria-label":"上移",children:m.jsx(kC,{size:12,strokeWidth:3})}),m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:c,disabled:t===n-1,"aria-label":"下移",children:m.jsx(yc,{size:12,strokeWidth:3})}),m.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"3px 8px"},onClick:s,"aria-label":"删除 stage",children:m.jsx(Il,{size:12,strokeWidth:3})})]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[m.jsx(sr,{label:"name",hint:"stage 唯一名",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.name??"",onChange:d=>a({name:d.target.value}),placeholder:"develop"})}),m.jsx(sr,{label:"profile",hint:"skill 画像,可空",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.profile??"",onChange:d=>a({profile:d.target.value||void 0}),placeholder:"fullstack"})}),m.jsx(sr,{label:"card_state",hint:"本 stage 期间卡片状态",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.card_state??"",onChange:d=>a({card_state:d.target.value||void 0}),placeholder:"Inprogress"})}),m.jsx(sr,{label:"timeout",hint:"可选,如 30m 2h",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.timeout??"",onChange:d=>a({timeout:d.target.value||void 0}),placeholder:"2h"})}),m.jsx(sr,{label:"trigger",hint:"触发条件,可空走默认",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.trigger??"",onChange:d=>a({trigger:d.target.value||void 0}),placeholder:"card_enters 'Todo'"})}),m.jsx(sr,{label:"on_complete",hint:"成功后动作",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.on_complete??"",onChange:d=>a({on_complete:d.target.value}),placeholder:"move_card Done"})})]}),m.jsxs("div",{className:"mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[m.jsx("h5",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-[var(--color-text-muted)]",children:"on_fail"}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[m.jsx(sr,{label:"action",hint:"失败时动作,如 label NEEDS-FIX",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.action??"",onChange:d=>a({on_fail:{...f,action:d.target.value||void 0}}),placeholder:"label NEEDS-FIX"})}),m.jsx(sr,{label:"comment",hint:"写进卡片的注释",children:m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.comment??"",onChange:d=>a({on_fail:{...f,comment:d.target.value||void 0}}),placeholder:"Worker failed. Check logs."})})]}),m.jsxs("label",{className:"flex items-center gap-2 mt-3 text-sm cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f.halt??!0,onChange:d=>a({on_fail:{...f,halt:d.target.checked}})}),m.jsx("span",{className:"font-bold",children:"halt"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"(失败后停流水线;去掉则继续下一张卡)"})]})]})]})}function sr({label:e,hint:t,children:n}){return m.jsxs("label",{className:"flex flex-col gap-1",children:[m.jsx("span",{className:"text-xs font-bold font-[family-name:var(--font-mono)]",children:e}),n,t&&m.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t})]})}function RO({onCancel:e,onCreate:t,hasActive:n,hasSample:a,isPending:s}){const[o,c]=M.useState(""),[f,d]=M.useState("blank");M.useEffect(()=>{const v=S=>{S.key==="Escape"&&e()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[e]);const h=o.trim(),y=h.endsWith(".yaml")?h:h?`${h}.yaml`:"",g=y&&/^[a-zA-Z0-9_.-]+\.yaml$/.test(y),x=()=>{!g||s||t(y,f)};return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:m.jsxs("div",{className:"nb-card max-w-md w-full",children:[m.jsxs("header",{className:"flex items-start justify-between mb-4",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"新建 pipeline"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:e,type:"button","aria-label":"关闭",children:m.jsx(Er,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:v=>{v.preventDefault(),x()},className:"flex flex-col gap-4",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"文件名"}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:"例如 ci",value:o,onChange:v=>c(v.target.value),autoFocus:!0}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:["实际会保存为 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:y||"xxx.yaml"}),"。 只允许 a-z A-Z 0-9 _ -;已有同名文件会 409 报错。"]})]}),m.jsxs("fieldset",{className:"flex flex-col gap-2",children:[m.jsx("legend",{className:"text-sm font-bold mb-1",children:"初始内容"}),m.jsx(xm,{value:"blank",current:f,label:"空白模板",desc:"最简 1 stage (develop → Done)",onSelect:d}),m.jsx(xm,{value:"sample",current:f,label:"教学模板",desc:"从 sample.yaml.example 复制(带注释,讲解所有字段)",onSelect:d,disabled:!a,disabledReason:"sample.yaml.example 不存在"}),m.jsx(xm,{value:"active",current:f,label:"复制当前活动的",desc:"从 project.yaml 复制(基于目前的配置改)",onSelect:d,disabled:!n,disabledReason:"project.yaml 不存在"})]}),m.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[m.jsx("button",{className:"nb-btn",onClick:e,type:"button",disabled:s,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"submit",disabled:!g||s,"aria-label":"创建 pipeline",children:[s?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:13,strokeWidth:3}),"创建"]})]})]})]})})}function xm({value:e,current:t,label:n,desc:a,onSelect:s,disabled:o,disabledReason:c}){const f=t===e;return m.jsxs("label",{className:["flex items-start gap-2 p-2 rounded-lg border-2 cursor-pointer",o?"border-[var(--color-border-light)] opacity-50 cursor-not-allowed":f?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"border-[var(--color-border-light)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[m.jsx("input",{type:"radio",name:"pipeline-template",value:e,checked:f,disabled:o,onChange:()=>s(e),className:"mt-1 flex-shrink-0"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:n}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:o?c:a})]})]})}function MO(){var o;const{name:e=""}=UE(),t=wr(),[n,a]=M.useState("overview"),s=lt({queryKey:["project",e],queryFn:()=>QA(e),enabled:!!e});return m.jsxs("div",{className:"flex flex-col gap-5 max-w-4xl",children:[m.jsxs("header",{className:"flex items-center gap-3",children:[m.jsxs("button",{type:"button",onClick:()=>t("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":"返回项目列表",children:[m.jsx(VE,{size:14,strokeWidth:3}),"返回"]}),m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold flex-1",children:e}),m.jsx(ds,{to:`/board?project=${encodeURIComponent(e)}`,className:"nb-btn nb-btn-mint",children:"看板"})]}),m.jsxs("nav",{className:"flex gap-2 flex-wrap",children:[m.jsx(Xu,{current:n,value:"overview",onSelect:a,icon:$C,children:"概览"}),m.jsx(Xu,{current:n,value:"config",onSelect:a,icon:JE,children:"配置"}),m.jsx(Xu,{current:n,value:"pipelines",onSelect:a,icon:i1,children:"Pipelines"}),m.jsx(Xu,{current:n,value:"danger",onSelect:a,icon:Il,children:"危险操作"})]}),n==="overview"&&m.jsx(jO,{name:e,data:s.data,loading:s.isLoading}),n==="config"&&m.jsx(DO,{name:e}),n==="pipelines"&&m.jsx(LO,{name:e}),n==="danger"&&m.jsx(IO,{name:e,repoDir:((o=s.data)==null?void 0:o.repoDir)??null})]})}function Xu({current:e,value:t,onSelect:n,icon:a,children:s}){const o=e===t;return m.jsxs("button",{type:"button",onClick:()=>n(t),"aria-current":o?"page":void 0,className:["nb-btn",o?"nb-btn-primary":""].join(" "),style:{padding:"6px 14px",fontSize:13},children:[m.jsx(a,{size:13,strokeWidth:2.5}),s]})}function jO({name:e,data:t,loading:n}){return n?m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})}):t?m.jsx("div",{className:"nb-card",children:m.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-3 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"仓库路径"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.repoDir??"—"}),m.jsx("dt",{className:"font-bold",children:"PM 后端"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pmBackend}),m.jsx("dt",{className:"font-bold",children:"Agent"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.agentProvider}),m.jsx("dt",{className:"font-bold",children:"卡片"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)]",children:[t.cards.total," 张 · ",t.cards.inprogress," 进行中 · ",t.cards.done," 完成"]}),m.jsx("dt",{className:"font-bold",children:"Worker"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)]",children:[t.workers.total," 个(",t.workers.active," 活跃)"]}),m.jsx("dt",{className:"font-bold",children:"Pipeline"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pipelineStatus}),m.jsx("dt",{className:"font-bold",children:"最近活动"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.lastActivityAt?new Date(t.lastActivityAt).toLocaleString():"—"})]})}):m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["项目 ",e," 不存在或无法读取。"]})})}function DO({name:e}){const t=qn(),{alert:n}=si(),{data:a,isLoading:s,isError:o,error:c,refetch:f}=lt({queryKey:["project-conf",e],queryFn:()=>VA(e)}),[d,h]=M.useState(null),[y,g]=M.useState(null);M.useEffect(()=>{a&&d===null&&(h(a.content),g(a.etag))},[a,d]);const x=d!==null&&a!==void 0&&d!==a.content,v=Pn({mutationFn:()=>{if(d===null||y===null)throw new Error("no draft");return XA(e,d,y)},onSuccess:S=>{g(S.etag),t.invalidateQueries({queryKey:["project-conf",e]}),t.invalidateQueries({queryKey:["project",e]})},onError:S=>{const w=S.status;n({title:w===409?"配置已被其他地方修改":"保存失败",body:w===409?'conf 文件在你编辑期间被改过。点"重新加载"后再编辑。':S instanceof Error?S.message:String(S)})}});return s?m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})}):o?m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["加载失败: ",c instanceof Error?c.message:String(c)]})}):m.jsxs("div",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:m.jsxs("code",{className:"font-[family-name:var(--font-mono)] text-sm bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:["~/.coral/projects/",e,"/conf"]})}),y&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:["etag: ",y]})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>{h(null),f()},disabled:v.isPending,"aria-label":"重新加载",children:[m.jsx(Cl,{size:13,strokeWidth:2.5}),"重新加载"]}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>v.mutate(),disabled:!x||v.isPending,"aria-label":"保存配置",children:[v.isPending?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):v.isSuccess&&!x?m.jsx(EC,{size:13,strokeWidth:3}):m.jsx(Df,{size:13,strokeWidth:3}),"保存"]})]})]}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:480,resize:"vertical"},value:d??"",onChange:S=>h(S.target.value),spellCheck:!1,"aria-label":"conf 文件编辑器"}),x&&m.jsx("p",{className:"text-xs text-[var(--color-stuck)] mt-2 font-bold",children:"● 未保存的修改"})]})}function LO({name:e}){const t=qn(),{confirm:n,alert:a}=si(),{data:s,isLoading:o}=lt({queryKey:["project-pipelines",e],queryFn:()=>WA(e)}),[c,f]=M.useState(null),[d,h]=M.useState(!1),y=Pn({mutationFn:S=>JA(e,S),onSuccess:()=>t.invalidateQueries({queryKey:["project-pipelines",e]}),onError:S=>{a({title:"切换失败",body:S instanceof Error?S.message:String(S)})}}),g=Pn({mutationFn:S=>i2(e,S),onSuccess:()=>t.invalidateQueries({queryKey:["project-pipelines",e]}),onError:S=>{a({title:"删除失败",body:S instanceof Error?S.message:String(S)})}}),x=Pn({mutationFn:S=>n2(e,S.name,S.template),onSuccess:S=>{t.invalidateQueries({queryKey:["project-pipelines",e]}),h(!1),f(S.name)},onError:S=>{a({title:"创建失败",body:S instanceof Error?S.message:String(S)})}});if(o)return m.jsx("div",{className:"nb-card",children:m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})});const v=[];s!=null&&s.active&&v.push({name:s.active,isActive:!0});for(const S of(s==null?void 0:s.available)??[])v.push({name:S.name,isActive:!1});return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:"Pipelines"}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(!0),disabled:x.isPending,"aria-label":"新建 pipeline",children:[m.jsx(Xi,{size:12,strokeWidth:3}),"新建 pipeline"]})]}),v.length===0?m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:'还没有 pipeline 文件。点"新建 pipeline"开始。'}):m.jsx("ul",{className:"flex flex-col gap-2",children:v.map(S=>m.jsxs("li",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsx(i1,{size:16,strokeWidth:2.5}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold flex-1",children:S.name}),S.isActive&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"active"}),m.jsxs("div",{className:"flex gap-1",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>f(S.name),"aria-label":`编辑 ${S.name}`,children:[m.jsx(Hp,{size:11,strokeWidth:2.5}),"编辑"]}),!S.isActive&&m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await n({title:`切换到 ${S.name}`,body:`当前 project.yaml 会被 ${S.name} 的内容覆盖。继续?`,confirm:"切换"})&&y.mutate(S.name)},disabled:y.isPending,"aria-label":`切换到 ${S.name}`,children:"切换"}),m.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await n({title:`删除 ${S.name}`,body:"这个 pipeline 文件会被永久删除。",confirm:"删除",danger:!0})&&g.mutate(S.name)},disabled:g.isPending,"aria-label":`删除 ${S.name}`,children:m.jsx(Il,{size:11,strokeWidth:2.5})})]})]})]},S.name))})]}),c&&m.jsx(CO,{projectName:e,file:c,onClose:()=>f(null),onSaved:()=>{t.invalidateQueries({queryKey:["project-pipelines",e]})}}),d&&m.jsx(RO,{hasActive:!!(s!=null&&s.active),hasSample:!0,isPending:x.isPending,onCancel:()=>h(!1),onCreate:(S,w)=>x.mutate({name:S,template:w})})]})}function IO({name:e,repoDir:t}){const n=wr(),a=qn(),{alert:s}=si(),[o,c]=M.useState(""),[f,d]=M.useState(!0),h=Pn({mutationFn:()=>ZA(e,{includeClaudeDir:f}),onSuccess:y=>{a.invalidateQueries({queryKey:["projects"]});const g=y.claudeRemoved.filter(x=>x.ok).map(x=>x.path);s({title:"已删除",body:g.length>0?`项目已删除。同时清理了:
|
|
474
474
|
${g.join(`
|
|
475
|
-
`)}`:"项目已删除。"}).then(()=>n("/projects"))},onError:y=>{s({title:"删除失败",body:y instanceof Error?y.message:String(y)})}});return m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold mb-2 text-[var(--color-crashed)]",children:"删除项目"}),m.jsxs("p",{className:"text-sm mb-4",children:["这会清理 ",m.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),"(包括所有卡片、runtime、logs)。"]}),t&&m.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f,onChange:y=>d(y.target.checked),className:"mt-0.5"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"同时清理 repo 的 .claude/"}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[t,"/.claude/"]}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"repo 本身不动,只清这个目录。"})]})]}),m.jsx("div",{className:"mb-4",children:m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsxs("span",{className:"text-sm font-bold",children:["输入项目名 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e})," 确认:"]}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:o,onChange:y=>c(y.target.value),placeholder:e})]})}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:o!==e||h.isPending,onClick:()=>h.mutate(),"aria-label":"永久删除项目",children:[h.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Il,{size:14,strokeWidth:3}),"永久删除"]})]})}function lg(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return Ht(`/api/skills${t}`)}function zO(e){return Ht(`/api/skills/${encodeURIComponent(e)}`)}function BO(e,t){return Ht(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Yf(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function UO(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/link`,{project:t})}function FO(e,t){return fetch(`/api/skills/${encodeURIComponent(e)}/link?project=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>{if(!n.ok)throw new Error(`${n.status}`);return n.json()})}function $O(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/freeze`,{project:t})}function PO(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/unfreeze`,{project:t})}function qO(){return Yf("/api/skills/sync")}function HO({project:e,isPending:t,onCancel:n,onCreate:a}){var A;const[s,o]=M.useState(""),[c,f]=M.useState(""),[d,h]=M.useState(new Set),[y,g]=M.useState(!0),x=lt({queryKey:["skills-all",e],queryFn:()=>lg(e)});M.useEffect(()=>{const T=D=>{D.key==="Escape"&&n()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n]);const S=s.trim().length>0&&s.trim().length<=200&&!t,w=T=>{const D=new Set(d);D.has(T)?D.delete(T):D.add(T),h(D)},k=()=>{S&&a({title:s.trim(),description:c.trim(),skills:[...d],labels:y?["AI-PIPELINE"]:[]})},_=((A=x.data)==null?void 0:A.data)??[];return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:"新建卡片"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(vr,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:T=>{T.preventDefault(),k()},className:"flex flex-col gap-4 overflow-auto",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"标题 *"}),m.jsx("input",{type:"text",className:"nb-input w-full",placeholder:"例如:接入 GitHub OAuth 登录",value:s,onChange:T=>o(T.target.value),maxLength:200,autoFocus:!0,required:!0}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"写简短明了的目标(<200 字符)"})]}),m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full",style:{minHeight:120,resize:"vertical"},placeholder:"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容",value:c,onChange:T=>f(T.target.value)}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。"})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"Skills"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。"}),x.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),x.isError&&m.jsxs("p",{className:"text-xs text-[var(--color-crashed)]",children:["skill 列表加载失败,不影响创建:",x.error instanceof Error?x.error.message:String(x.error)]}),_.length>0&&m.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(T=>{const D=d.has(T.name);return m.jsx("button",{type:"button",onClick:()=>w(T.name),className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",D?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":D,children:T.name},T.name)})}),d.size>0&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["已选 ",d.size," 个:",[...d].join(", ")]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"流水线"}),m.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[m.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:y,onChange:T=>g(T.target.checked)}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"加入流水线(`AI-PIPELINE` 标签)"}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:"打开后 pipeline 会识别这张卡并派 worker 跑。关闭则只是一个普通 todo,需要人工改标签才会被流水线拾起。"})]})]})]})]}),m.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:k,disabled:!S,type:"button","aria-label":"创建卡片",children:[t?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:13,strokeWidth:3}),"创建"]})]})]})})}function KO(e){return Ht(`/api/projects/${encodeURIComponent(e)}/cards`)}function GO(e,t){return Ht(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function ql(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.text();throw new Error(`${n.status} ${n.statusText}: ${a}`)}return n.json().catch(()=>({}))}function QO(e,t){return ql(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function YO(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"DELETE"});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}}function VO(e,t){return ql(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function XO(e,t){const n=typeof t=="string"?{title:t}:t;return ql(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function ZO(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}}async function WO(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}return a.json()}function JO(e){return ql(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function eR(e){return ql(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function tR(e,t){return ql(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function nR(e){const t=qn();M.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,a=new EventSource(n),s=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["cards",d.project]}),t.invalidateQueries({queryKey:["card",d.project,d.seq]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["workers",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},c=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["pipeline-status",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return a.addEventListener("card.created",s),a.addEventListener("card.updated",s),a.addEventListener("card.moved",s),a.addEventListener("card.deleted",s),a.addEventListener("worker.updated",o),a.addEventListener("worker.added",o),a.addEventListener("worker.deleted",o),a.addEventListener("pipeline.status",c),a.addEventListener("pipeline.started",c),a.addEventListener("pipeline.stopped",c),()=>a.close()},[e,t])}const iR=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),aR=new Set(["frontend","backend","mobile","database","devops"]),rR=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),sR=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function lR(e){return iR.has(e)?"lang":aR.has(e)?"end":rR.has(e)?"persona":sR.has(e)?"workflow":"other"}const oR={lang:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg)"};function iS({name:e}){const t=oR[lR(e)];return m.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function aS({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return m.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function cR({card:e,onClick:t,done:n,draggable:a}){const s=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return m.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:a,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl p-3","shadow-[3px_3px_0_var(--color-text)] cursor-pointer","transition-[transform,box-shadow] duration-[180ms] ease-out","hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[5px_5px_0_var(--color-text)]","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",a?"active:cursor-grabbing":""].join(" "),children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-[11px] px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),s&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),m.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&m.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>m.jsx(iS,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>m.jsx(aS,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&m.jsx(uR,{stats:e.checklist}),m.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[m.jsx("span",{children:fR(e.updatedAt??e.createdAt)}),e.branch&&m.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function uR({stats:e}){return m.jsxs("div",{className:"mb-2",children:[m.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[m.jsxs("span",{className:"font-bold",children:["检查清单 ",e.done,"/",e.total]}),m.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),m.jsx("div",{className:"w-full h-1.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full overflow-hidden mb-1.5",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),m.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((t,n)=>m.jsxs("li",{className:`flex items-start gap-1 ${t.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{className:"flex-shrink-0 mt-0.5",children:t.done?"✓":"○"}),m.jsx("span",{className:"line-clamp-1",children:t.text})]},n)),e.items.length>3&&m.jsxs("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:["… 还有 ",e.items.length-3," 条"]})]})]})}function fR(e){if(!e)return"—";const t=new Date(e),n=Date.now()-t.getTime();return n<6e4?"刚才":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:t.toLocaleDateString()}function dR({label:e,bg:t,cards:n,onCardClick:a,onDropCard:s}){const[o,c]=M.useState(!1);return m.jsxs("div",{className:["flex flex-col gap-2 p-3 rounded-2xl border-[3px] min-h-[340px]","transition-all",o?"border-[var(--color-cta)] shadow-[4px_4px_0_var(--color-cta)]":"border-[var(--color-text)]"].join(" "),style:{background:t},onDragOver:f=>{!s||!f.dataTransfer.types.includes("application/x-sps-card-seq")||(f.preventDefault(),f.dataTransfer.dropEffect="move",o||c(!0))},onDragLeave:()=>c(!1),onDrop:f=>{if(c(!1),!s)return;const d=f.dataTransfer.getData("application/x-sps-card-seq"),h=Number.parseInt(d,10);Number.isFinite(h)&&(f.preventDefault(),s(h))},children:[m.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 border-b-2 border-[var(--color-text)]",children:[m.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full",children:n.length})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[n.length===0&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:"— 空 —"}),n.map(f=>m.jsx(cR,{card:f,onClick:()=>a(f),done:e==="Done",draggable:!!s},f.seq))]})]})}function dp(e,t){if(!e)return"";const n=e.split(`
|
|
475
|
+
`)}`:"项目已删除。"}).then(()=>n("/projects"))},onError:y=>{s({title:"删除失败",body:y instanceof Error?y.message:String(y)})}});return m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold mb-2 text-[var(--color-crashed)]",children:"删除项目"}),m.jsxs("p",{className:"text-sm mb-4",children:["这会清理 ",m.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),"(包括所有卡片、runtime、logs)。"]}),t&&m.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:f,onChange:y=>d(y.target.checked),className:"mt-0.5"}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"同时清理 repo 的 .claude/"}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[t,"/.claude/"]}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"repo 本身不动,只清这个目录。"})]})]}),m.jsx("div",{className:"mb-4",children:m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsxs("span",{className:"text-sm font-bold",children:["输入项目名 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e})," 确认:"]}),m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:o,onChange:y=>c(y.target.value),placeholder:e})]})}),m.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:o!==e||h.isPending,onClick:()=>h.mutate(),"aria-label":"永久删除项目",children:[h.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Il,{size:14,strokeWidth:3}),"永久删除"]})]})}function lg(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return Ht(`/api/skills${t}`)}function zO(e){return Ht(`/api/skills/${encodeURIComponent(e)}`)}function BO(e,t){return Ht(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Yf(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function UO(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/link`,{project:t})}function FO(e,t){return fetch(`/api/skills/${encodeURIComponent(e)}/link?project=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>{if(!n.ok)throw new Error(`${n.status}`);return n.json()})}function $O(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/freeze`,{project:t})}function PO(e,t){return Yf(`/api/skills/${encodeURIComponent(e)}/unfreeze`,{project:t})}function qO(){return Yf("/api/skills/sync")}function HO({project:e,isPending:t,onCancel:n,onCreate:a}){var A;const[s,o]=M.useState(""),[c,f]=M.useState(""),[d,h]=M.useState(new Set),[y,g]=M.useState(!0),x=lt({queryKey:["skills-all",e],queryFn:()=>lg(e)});M.useEffect(()=>{const T=D=>{D.key==="Escape"&&n()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[n]);const S=s.trim().length>0&&s.trim().length<=200&&!t,w=T=>{const D=new Set(d);D.has(T)?D.delete(T):D.add(T),h(D)},k=()=>{S&&a({title:s.trim(),description:c.trim(),skills:[...d],labels:y?["AI-PIPELINE"]:[]})},_=((A=x.data)==null?void 0:A.data)??[];return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[m.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:"新建卡片"}),m.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":"关闭",children:m.jsx(Er,{size:14,strokeWidth:3})})]}),m.jsxs("form",{onSubmit:T=>{T.preventDefault(),k()},className:"flex flex-col gap-4 overflow-auto",children:[m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"标题 *"}),m.jsx("input",{type:"text",className:"nb-input w-full",placeholder:"例如:接入 GitHub OAuth 登录",value:s,onChange:T=>o(T.target.value),maxLength:200,autoFocus:!0,required:!0}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"写简短明了的目标(<200 字符)"})]}),m.jsxs("label",{className:"flex flex-col gap-1.5",children:[m.jsx("span",{className:"text-sm font-bold",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full",style:{minHeight:120,resize:"vertical"},placeholder:"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容",value:c,onChange:T=>f(T.target.value)}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。"})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"Skills"}),m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。"}),x.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),x.isError&&m.jsxs("p",{className:"text-xs text-[var(--color-crashed)]",children:["skill 列表加载失败,不影响创建:",x.error instanceof Error?x.error.message:String(x.error)]}),_.length>0&&m.jsx("div",{className:"flex flex-wrap gap-2",children:_.map(T=>{const D=d.has(T.name);return m.jsx("button",{type:"button",onClick:()=>w(T.name),className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",D?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":D,children:T.name},T.name)})}),d.size>0&&m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)]",children:["已选 ",d.size," 个:",[...d].join(", ")]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("span",{className:"text-sm font-bold",children:"流水线"}),m.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[m.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:y,onChange:T=>g(T.target.checked)}),m.jsxs("div",{className:"flex-1",children:[m.jsx("div",{className:"text-sm font-bold",children:"加入流水线(`AI-PIPELINE` 标签)"}),m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:"打开后 pipeline 会识别这张卡并派 worker 跑。关闭则只是一个普通 todo,需要人工改标签才会被流水线拾起。"})]})]})]})]}),m.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:k,disabled:!S,type:"button","aria-label":"创建卡片",children:[t?m.jsx(Wt,{size:13,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:13,strokeWidth:3}),"创建"]})]})]})})}function KO(e){return Ht(`/api/projects/${encodeURIComponent(e)}/cards`)}function GO(e,t){return Ht(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function ql(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const a=await n.text();throw new Error(`${n.status} ${n.statusText}: ${a}`)}return n.json().catch(()=>({}))}function QO(e,t){return ql(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function YO(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"DELETE"});if(!n.ok){const a=await n.text();throw new Error(`${n.status}: ${a}`)}}function VO(e,t){return ql(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function XO(e,t){const n=typeof t=="string"?{title:t}:t;return ql(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function ZO(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}}async function WO(e,t,n){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok){const s=await a.text();throw new Error(`${a.status}: ${s}`)}return a.json()}function JO(e){return ql(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function eR(e){return ql(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function tR(e,t){return ql(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function nR(e){const t=qn();M.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,a=new EventSource(n),s=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["cards",d.project]}),t.invalidateQueries({queryKey:["card",d.project,d.seq]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["workers",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},c=f=>{try{const d=JSON.parse(f.data);t.invalidateQueries({queryKey:["pipeline-status",d.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return a.addEventListener("card.created",s),a.addEventListener("card.updated",s),a.addEventListener("card.moved",s),a.addEventListener("card.deleted",s),a.addEventListener("worker.updated",o),a.addEventListener("worker.added",o),a.addEventListener("worker.deleted",o),a.addEventListener("pipeline.status",c),a.addEventListener("pipeline.started",c),a.addEventListener("pipeline.stopped",c),()=>a.close()},[e,t])}const iR=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),aR=new Set(["frontend","backend","mobile","database","devops"]),rR=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),sR=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function lR(e){return iR.has(e)?"lang":aR.has(e)?"end":rR.has(e)?"persona":sR.has(e)?"workflow":"other"}const oR={lang:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg)"};function iS({name:e}){const t=oR[lR(e)];return m.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function aS({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return m.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function cR({card:e,onClick:t,done:n,draggable:a}){const s=e.labels.some(o=>o.startsWith("STARTED-"))&&!n;return m.jsxs("article",{onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},draggable:a,onDragStart:o=>{o.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),o.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl p-3","shadow-[3px_3px_0_var(--color-text)] cursor-pointer","transition-[transform,box-shadow] duration-[180ms] ease-out","hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[5px_5px_0_var(--color-text)]","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",a?"active:cursor-grabbing":""].join(" "),children:[m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-[11px] px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),s&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),m.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&m.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(o=>m.jsx(iS,{name:o},o)),e.labels.filter(o=>o==="NEEDS-FIX").map(o=>m.jsx(aS,{label:o,kind:"warn"},o))]}),e.checklist&&e.checklist.total>0&&m.jsx(uR,{stats:e.checklist}),m.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[m.jsx("span",{children:fR(e.updatedAt??e.createdAt)}),e.branch&&m.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function uR({stats:e}){return m.jsxs("div",{className:"mb-2",children:[m.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[m.jsxs("span",{className:"font-bold",children:["检查清单 ",e.done,"/",e.total]}),m.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),m.jsx("div",{className:"w-full h-1.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full overflow-hidden mb-1.5",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),m.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((t,n)=>m.jsxs("li",{className:`flex items-start gap-1 ${t.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{className:"flex-shrink-0 mt-0.5",children:t.done?"✓":"○"}),m.jsx("span",{className:"line-clamp-1",children:t.text})]},n)),e.items.length>3&&m.jsxs("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:["… 还有 ",e.items.length-3," 条"]})]})]})}function fR(e){if(!e)return"—";const t=new Date(e),n=Date.now()-t.getTime();return n<6e4?"刚才":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:t.toLocaleDateString()}function dR({label:e,bg:t,cards:n,onCardClick:a,onDropCard:s}){const[o,c]=M.useState(!1);return m.jsxs("div",{className:["flex flex-col gap-2 p-3 rounded-2xl border-[3px] min-h-[340px]","transition-all",o?"border-[var(--color-cta)] shadow-[4px_4px_0_var(--color-cta)]":"border-[var(--color-text)]"].join(" "),style:{background:t},onDragOver:f=>{!s||!f.dataTransfer.types.includes("application/x-sps-card-seq")||(f.preventDefault(),f.dataTransfer.dropEffect="move",o||c(!0))},onDragLeave:()=>c(!1),onDrop:f=>{if(c(!1),!s)return;const d=f.dataTransfer.getData("application/x-sps-card-seq"),h=Number.parseInt(d,10);Number.isFinite(h)&&(f.preventDefault(),s(h))},children:[m.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 border-b-2 border-[var(--color-text)]",children:[m.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full",children:n.length})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[n.length===0&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:"— 空 —"}),n.map(f=>m.jsx(cR,{card:f,onClick:()=>a(f),done:e==="Done",draggable:!!s},f.seq))]})]})}function dp(e,t){if(!e)return"";const n=e.split(`
|
|
476
476
|
`),a=new RegExp(`^##\\s+${t}\\s*$`),s=n.findIndex(c=>a.test(c));if(s===-1)return"";let o=n.length;for(let c=s+1;c<n.length;c++)if(/^##\s+/.test(n[c]??"")){o=c;break}return n.slice(s+1,o).join(`
|
|
477
|
-
`).trim()}function vm(e){return dp(e,"描述")}function hR({project:e,seq:t,onClose:n,onChanged:a}){var K,oe,V,pe,R,L,J,C,me,_e,ve;const s=qn(),{confirm:o,alert:c}=si(),{data:f,isLoading:d,isError:h,error:y,refetch:g}=lt({queryKey:["card",e,t],queryFn:()=>GO(e,t)}),[x,v]=M.useState(!1),[S,w]=M.useState(""),[k,_]=M.useState(""),[A,T]=M.useState(new Set),[D,$]=M.useState([]),[j,q]=M.useState(""),U=lt({queryKey:["skills-all",e],queryFn:()=>lg(e),enabled:x}),O=((oe=(K=lt({queryKey:["projects"],queryFn:wr,refetchInterval:1e4}).data)==null?void 0:K.data.find(ce=>ce.name===e))==null?void 0:oe.pipelineStatus)==="running";M.useEffect(()=>{x&&f&&(w(f.title),_(vm(f.body)),T(new Set(f.skills)),$([...f.labels]))},[x,f]),M.useEffect(()=>{const ce=ke=>{ke.key==="Escape"&&(x?v(!1):n())};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[n,x]);const P=Pn({mutationFn:()=>{if(!f)throw new Error("no data");const ce={},ke=S.trim();ke&&ke!==f.title&&(ce.title=ke);const Ke=vm(f.body);k!==Ke&&(ce.description=k);const Dt=[...A].sort(),yn=[...f.skills].sort();return JSON.stringify(Dt)!==JSON.stringify(yn)&&(ce.skills=Dt),JSON.stringify(D)!==JSON.stringify(f.labels)&&(ce.labels=D),Object.keys(ce).length===0?Promise.resolve({ok:!0,noop:!0}):WO(e,t,ce)},onSuccess:()=>{s.invalidateQueries({queryKey:["card",e,t]}),s.invalidateQueries({queryKey:["cards",e]}),v(!1),a()},onError:ce=>{c({title:"保存失败",body:ce instanceof Error?ce.message:String(ce)})}}),G=M.useMemo(()=>{if(!x||!f)return!1;if(S.trim()!==f.title||k!==vm(f.body))return!0;const ce=[...A].sort(),ke=[...f.skills].sort();return JSON.stringify(ce)!==JSON.stringify(ke)||JSON.stringify(D)!==JSON.stringify(f.labels)},[x,f,S,k,A,D]),le=ce=>{const ke=new Set(A);ke.has(ce)?ke.delete(ce):ke.add(ce),T(ke)},ae=()=>{const ce=j.trim();if(ce){if(D.includes(ce)){q("");return}$([...D,ce]),q("")}},W=ce=>{$(D.filter(ke=>ke!==ce))};return m.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[m.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&m.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),x&&m.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:"⚠ 编辑中"})]}),x?m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:S,onChange:ce=>w(ce.target.value),maxLength:200,"aria-label":"卡片标题"}):m.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??"加载中…"})]}),m.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!x&&f&&m.jsxs("button",{onClick:()=>v(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":"编辑卡片",children:[m.jsx(Hp,{size:12,strokeWidth:2.5})," 编辑"]}),m.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":"关闭",type:"button",children:m.jsx(vr,{size:14,strokeWidth:3})})]})]}),d&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),h&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",y instanceof Error?y.message:String(y)]}),f&&m.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!x&&m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(QC,{size:14}),m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:f.branch})]}),x?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),U.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),U.data&&U.data.data.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:U.data.data.map(ce=>{const ke=A.has(ce.name);return m.jsx("button",{type:"button",onClick:()=>le(ce.name),"aria-pressed":ke,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",ke?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:ce.name},ce.name)})})]}),m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[D.map(ce=>m.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[ce,m.jsx("button",{type:"button",onClick:()=>W(ce),className:"hover:text-[var(--color-crashed)]","aria-label":`删除 ${ce}`,children:m.jsx(vr,{size:10,strokeWidth:3})})]},ce)),m.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:"+ 添加 label",value:j,onChange:ce=>q(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),ae())}}),j&&m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:ae,"aria-label":"添加 label",children:m.jsx(Xi,{size:10,strokeWidth:3})})]}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖"})]})]}):m.jsxs(m.Fragment,{children:[f.skills.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),m.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.skills.map(ce=>m.jsx(iS,{name:ce},ce))})]}),f.labels.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.labels.map(ce=>m.jsx(aS,{label:ce,kind:ce==="NEEDS-FIX"?"warn":"default"},ce))})]})]}),x?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:k,onChange:ce=>_(ce.target.value),"aria-label":"卡片描述"}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:'只替换 "## 描述" 段的内容;检查清单和日志段不动。'})]}),(((C=f.checklist)==null?void 0:C.total)??0)>0&&m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[m.jsx("div",{className:"flex items-center justify-between mb-2",children:m.jsxs("span",{className:"font-bold text-sm",children:["检查清单 ",((me=f.checklist)==null?void 0:me.done)??0,"/",((_e=f.checklist)==null?void 0:_e.total)??0]})}),m.jsx("ul",{className:"text-sm space-y-1",children:(((ve=f.checklist)==null?void 0:ve.items)??[]).map((ce,ke)=>m.jsxs("li",{className:`flex items-start gap-2 ${ce.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:ce.done?"✓":"○"}),m.jsx("span",{children:ce.text})]},ke))})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:dp(f.body,"描述")||"(空)"})]}),m.jsxs("div",{children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:["检查清单 ",m.jsxs("span",{className:"text-[var(--color-text-muted)] normal-case tracking-normal",children:[((V=f.checklist)==null?void 0:V.done)??0,"/",((pe=f.checklist)==null?void 0:pe.total)??0]})]}),m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:(((R=f.checklist)==null?void 0:R.total)??0)>0?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"flex items-center justify-end mb-2",children:m.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${((L=f.checklist)==null?void 0:L.percent)??0}%`}})})}),m.jsx("ul",{className:"text-sm space-y-1",children:(((J=f.checklist)==null?void 0:J.items)??[]).map((ce,ke)=>m.jsxs("li",{className:`flex items-start gap-2 ${ce.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:ce.done?"✓":"○"}),m.jsx("span",{children:ce.text})]},ke))})]}):m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:["暂无清单项。在描述里用 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"- [ ] 项"})," 语法添加。"]})})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"日志"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:dp(f.body,"日志")||"(空)"})]})]}),m.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end flex-wrap",children:x?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{v(!1),g()},disabled:P.isPending,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>P.mutate(),disabled:!G||!S.trim()||P.isPending,"aria-label":"保存卡片修改",children:[P.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:14,strokeWidth:3}),"保存"]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",disabled:f.state==="Done"||O,title:f.state==="Done"?"卡片已完成;先拖回 Todo 再启动":O?"Pipeline 正在跑——supervisor 会自动 dispatch,无需手动启动":void 0,onClick:async()=>{try{await VO(e,t),a()}catch(ce){c({title:"启动 worker 失败",body:ce instanceof Error?ce.message:String(ce)})}},children:[m.jsx(Kp,{size:14,strokeWidth:3}),"启动 worker"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:`重置卡片 #${t}`,body:"卡片状态会回到初始,已做的 checklist 会清空。",confirm:"重置",danger:!0}))try{await QO(e,t),a(),n()}catch(ke){c({title:"重置失败",body:ke instanceof Error?ke.message:String(ke)})}},children:[m.jsx(WE,{size:14,strokeWidth:2.5}),"重置卡片"]}),m.jsxs("button",{className:"nb-btn",style:{background:"var(--color-crashed)",color:"var(--color-bg)"},type:"button",onClick:async()=>{if(!(!await o({title:`删除卡片 #${t}`,body:`即将删除 "${f.title}"。此操作不可恢复(md 文件将被物理删除)。是否继续?`,confirm:"继续",danger:!0})||!await o({title:"最终确认",body:`请再次确认删除卡片 #${t}。`,confirm:"确定删除",danger:!0})))try{await YO(e,t),a(),n()}catch(Ke){c({title:"删除失败",body:Ke instanceof Error?Ke.message:String(Ke)})}},"aria-label":"删除卡片",children:[m.jsx(Il,{size:14,strokeWidth:2.5}),"删除卡片"]})]})})]})]})})}function mR({current:e,onChange:t}){const[n,a]=M.useState(!1),s=M.useRef(null),{data:o}=lt({queryKey:["projects"],queryFn:wr});return M.useEffect(()=>{const c=f=>{var d;(d=s.current)!=null&&d.contains(f.target)||a(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),m.jsxs("div",{className:"relative",ref:s,children:[m.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 px-3 py-2 bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[3px_3px_0_var(--color-text)] font-[family-name:var(--font-mono)] text-sm font-bold hover:-translate-x-px hover:-translate-y-px hover:shadow-[4px_4px_0_var(--color-text)] transition-[transform,box-shadow] duration-150",onClick:()=>a(c=>!c),children:[e,m.jsx(yc,{size:14,strokeWidth:2.5})]}),n&&o&&m.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[5px_5px_0_var(--color-text)] overflow-hidden",children:o.data.map(c=>m.jsxs("button",{type:"button",onClick:()=>{t(c.name),a(!1)},className:["w-full text-left px-4 py-2 text-sm font-semibold",c.name===e?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:c.name}),m.jsxs("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:[c.cards.total," cards"]})]},c.name))})]})}const pR=[{state:"Planning",label:"Planning",bg:"var(--color-accent-purple)"},{state:"Backlog",label:"Backlog",bg:"var(--color-bg-cream)"},{state:"Todo",label:"Todo",bg:"var(--color-accent-yellow)"},{state:"Inprogress",label:"Inprogress",bg:"var(--color-secondary)"},{state:"QA",label:"QA / Review",bg:"var(--color-accent-pink)"},{state:"Done",label:"Done",bg:"var(--color-accent-mint)"}],rS="sps-console:last-board-project";function gR(){if(typeof window>"u")return null;try{return localStorage.getItem(rS)}catch{return null}}function bR(e){if(!(typeof window>"u"))try{localStorage.setItem(rS,e)}catch{}}function yR(){var W,K,oe;const[e,t]=QE(),n=e.get("project"),[a,s]=M.useState(null),[o,c]=M.useState(""),[f,d]=M.useState(()=>new Set),[h,y]=M.useState(()=>new Set),{confirm:g,alert:x}=si();nR(n);const v=lt({queryKey:["projects"],queryFn:wr}),S=lt({queryKey:["cards",n],queryFn:()=>KO(n??""),enabled:!!n}),w=qn(),k=()=>{w.invalidateQueries({queryKey:["cards",n]}),w.invalidateQueries({queryKey:["projects"]}),w.invalidateQueries({queryKey:["pipeline-status",n]})},_=V=>{t({project:V})};M.useEffect(()=>{var pe;if(n){bR(n);return}const V=gR();V&&((pe=v.data)!=null&&pe.data.some(R=>R.name===V))&&t({project:V},{replace:!0})},[n,v.data,t]);const A=Pn({mutationFn:()=>JO(n),onSuccess:()=>{k()},onError:V=>{x({title:"启动 pipeline 失败",body:V instanceof Error?V.message:String(V)})}}),T=Pn({mutationFn:()=>eR(n),onSuccess:()=>k(),onError:V=>{x({title:"停止 pipeline 失败",body:V instanceof Error?V.message:String(V)})}}),D=Pn({mutationFn:()=>tR(n,{all:!0}),onSuccess:()=>k(),onError:V=>{x({title:"重置失败",body:V instanceof Error?V.message:String(V)})}}),[$,j]=M.useState(!1),q=Pn({mutationFn:V=>XO(n,V),onSuccess:()=>{k(),j(!1)},onError:V=>{x({title:"新建卡片失败",body:V instanceof Error?V.message:String(V)})}}),U=Pn({mutationFn:({seq:V,state:pe})=>ZO(n,V,pe),onMutate:async({seq:V,state:pe})=>{await w.cancelQueries({queryKey:["cards",n]});const R=w.getQueryData(["cards",n]);return R&&w.setQueryData(["cards",n],{...R,data:R.data.map(L=>L.seq===V?{...L,state:pe}:L)}),{prev:R}},onError:(V,pe,R)=>{R!=null&&R.prev&&w.setQueryData(["cards",n],R.prev),x({title:"移动卡片失败",body:V instanceof Error?V.message:String(V)})},onSettled:()=>{w.invalidateQueries({queryKey:["cards",n]})}}),Z=((W=S.data)==null?void 0:W.data)??[],{allSkills:O,allLabels:P}=M.useMemo(()=>{const V=new Set,pe=new Set;for(const R of Z){for(const L of R.skills)V.add(L);for(const L of R.labels)pe.add(L)}return{allSkills:[...V].sort(),allLabels:[...pe].sort()}},[Z]);if(!n)return m.jsxs("div",{className:"flex flex-col gap-6 max-w-4xl",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"看板"}),m.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:"选择一个项目 🎯"}),m.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:"看板按项目分。挑一个开始:"}),m.jsx("div",{className:"flex flex-wrap gap-2",children:(K=v.data)==null?void 0:K.data.map(V=>m.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>_(V.name),type:"button",children:V.name},V.name))})]})]});const G=Z.filter(V=>{if(o){const pe=o.toLowerCase();if(!(V.title.toLowerCase().includes(pe)||V.skills.some(L=>L.toLowerCase().includes(pe))||V.labels.some(L=>L.toLowerCase().includes(pe))))return!1}return!(f.size>0&&!V.skills.some(R=>f.has(R))||h.size>0&&!V.labels.some(R=>h.has(R)))}),le=(oe=v.data)==null?void 0:oe.data.find(V=>V.name===n),ae=(le==null?void 0:le.pipelineStatus)==="running";return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"看板 ✨"}),m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:le?`${le.name} · ${le.cards.total} cards · ${le.workers.active} workers 活跃`:"加载中…"})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsx(mR,{current:n,onChange:_}),m.jsxs("button",{className:ae?"nb-btn nb-btn-danger":"nb-btn nb-btn-primary",onClick:()=>ae?T.mutate():A.mutate(),disabled:A.isPending||T.isPending,type:"button","aria-label":ae?"停止 pipeline":"启动 pipeline",title:ae?"停止 pipeline":"启动 pipeline",children:[A.isPending||T.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):ae?m.jsx(e1,{size:14,strokeWidth:3}):m.jsx(Kp,{size:14,strokeWidth:3}),ae?"停止":"启动"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await g({title:"重置整个流水线",body:"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。",confirm:"重置全部",danger:!0})&&D.mutate()},disabled:D.isPending,children:[D.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(WE,{size:14,strokeWidth:2.5}),"重置"]}),m.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>j(!0),disabled:q.isPending,children:[q.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:14,strokeWidth:3}),"新卡片"]})]})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(xf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"搜索标题 / skill / label…",value:o,onChange:V=>c(V.target.value),"aria-label":"搜索卡片"})]}),m.jsx(Jv,{label:"skill",options:O,selected:f,onChange:d}),m.jsx(Jv,{label:"label",options:P,selected:h,onChange:y}),(o||f.size>0||h.size>0)&&m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{c(""),d(new Set),y(new Set)},type:"button","aria-label":"清空筛选",children:[m.jsx(vr,{size:11,strokeWidth:3}),"清空"]}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[m.jsx(KC,{size:12}),G.length," / ",Z.length]})]}),S.isError&&m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("p",{className:"font-semibold",children:"加载卡片失败"}),m.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:S.error instanceof Error?S.error.message:String(S.error)})]}),!S.isError&&m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-3",children:pR.map(V=>m.jsx(dR,{label:V.label,bg:V.bg,cards:G.filter(xR(V.state)),onCardClick:pe=>s(pe.seq),onDropCard:pe=>U.mutate({seq:pe,state:V.state})},V.state))}),a!==null&&m.jsx(hR,{project:n,seq:a,onClose:()=>s(null),onChanged:k}),$&&m.jsx(HO,{project:n,isPending:q.isPending,onCancel:()=>j(!1),onCreate:V=>q.mutate(V)})]})}function xR(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Jv({label:e,options:t,selected:n,onChange:a}){const[s,o]=M.useState(!1),c=M.useRef(null);M.useEffect(()=>{if(!s)return;const y=x=>{var v;(v=c.current)!=null&&v.contains(x.target)||o(!1)},g=x=>{x.key==="Escape"&&o(!1)};return window.addEventListener("click",y),window.addEventListener("keydown",g),()=>{window.removeEventListener("click",y),window.removeEventListener("keydown",g)}},[s]);const f=y=>{const g=new Set(n);g.has(y)?g.delete(y):g.add(y),a(g)},d=t.length===0,h=n.size;return m.jsxs("div",{ref:c,className:"relative",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!d&&o(y=>!y),disabled:d,"aria-haspopup":"listbox","aria-expanded":s,"aria-label":`按 ${e} 筛选`,children:[e,h>0&&m.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:h}),m.jsx(yc,{size:11,strokeWidth:3,className:["transition-transform",s?"rotate-180":""].join(" ")})]}),s&&m.jsxs("div",{role:"listbox",className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] max-h-64 overflow-auto nb-card p-2",style:{padding:8},children:[t.map(y=>{const g=n.has(y);return m.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",g?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("input",{type:"checkbox",checked:g,onChange:()=>f(y),className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:y})]},y)}),h>0&&m.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>a(new Set),children:"清空选择"})]})]})}function vR(){return Ht("/api/workers/all")}function ER(e){return Ht(`/api/projects/${encodeURIComponent(e)}/workers`)}function SR(e,t){return Ht(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function sS(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function e0(e,t){return sS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function wR(e,t,n){return sS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function og({state:e}){const n={running:{bg:"var(--color-running-bg)",color:"var(--color-running)",label:"running"},starting:{bg:"var(--color-secondary)",color:"var(--color-text)",label:"starting",icon:m.jsx(Wt,{size:9,strokeWidth:3,className:"animate-spin"})},stuck:{bg:"var(--color-stuck-bg)",color:"var(--color-stuck)",label:"stuck"},crashed:{bg:"var(--color-crashed-bg)",color:"var(--color-crashed)",label:"crashed",icon:m.jsx(SA,{size:9,strokeWidth:2.5})},idle:{bg:"var(--color-idle-bg)",color:"var(--color-idle)",label:"idle"}}[e];return m.jsxs("span",{className:"nb-status inline-flex items-center gap-1",style:{background:n.bg,color:n.color},children:[n.icon,n.label]})}function cg(e){if(e==null||e<=0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n}h ${a}m`:a>0?`${a}m ${s}s`:`${s}s`}function _R(e){if(e==null||e<=0)return"text-[var(--color-text-muted)]";const t=e/6e4;return t<10?"text-[var(--color-running)]":t<60?"text-[var(--color-stuck)]":"text-[var(--color-crashed)]"}function ug(e){const t=Date.now()-new Date(e).getTime();return t<6e4?`${Math.floor(t/1e3)}s 前`:t<36e5?`${Math.floor(t/6e4)}m 前`:`${Math.floor(t/36e5)}h 前`}function kR({alerts:e,selected:t,onSelect:n}){return e.length===0?m.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[m.jsx(Pp,{size:18,strokeWidth:2.5,className:"text-[var(--color-running)]"}),m.jsx("span",{className:"text-sm font-bold text-[var(--color-running)]",children:"全部 worker 健康"})]}):m.jsxs("section",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2 text-[var(--color-crashed)]",children:[m.jsx(RA,{size:14,strokeWidth:2.5}),"Alerts (",e.length,")"]}),m.jsx("div",{className:"flex flex-col gap-2",children:e.map(a=>{const s=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return m.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="crashed"?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-stuck-bg)]",s?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(og,{state:a.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold",children:[a.project,"/worker-",a.slot]}),a.card&&m.jsxs("span",{className:"truncate",children:["#",a.card.seq," ",a.card.title]}),m.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1",children:[m.jsx(MC,{size:10,strokeWidth:2.5}),cg(a.runtimeMs)]})]}),a.markerUpdatedAt&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1 font-[family-name:var(--font-mono)]",children:a.state==="crashed"?"PID 已死。":`marker 停 ${ug(a.markerUpdatedAt)}。`})]},`${a.project}-${a.slot}`)})})]})}function NR({active:e,selected:t,onSelect:n}){return e.length===0?m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)]",children:m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"没有 worker 在运行。"})}):m.jsxs("section",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2",children:[m.jsx(jf,{size:14,strokeWidth:2.5}),"Active (",e.length,")"]}),m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map(a=>{const s=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return m.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="starting"?"bg-[var(--color-secondary)]":"bg-[var(--color-running-bg)]",s?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[m.jsx(og,{state:a.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm flex-1 truncate",children:[a.project,"/worker-",a.slot]}),m.jsx("span",{className:`text-xs font-[family-name:var(--font-mono)] ${_R(a.runtimeMs)}`,children:cg(a.runtimeMs)})]}),a.card&&m.jsxs("div",{className:"text-sm font-semibold mb-1 truncate",children:["#",a.card.seq," · ",a.card.title]}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-2 mb-1",children:[a.stage&&m.jsxs("span",{children:["stage: ",a.stage]}),a.markerUpdatedAt&&m.jsxs("span",{className:"ml-auto",children:["marker ",ug(a.markerUpdatedAt)]})]}),a.lastLogLine&&m.jsxs("div",{className:"text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded px-2 py-1 mt-2 truncate",children:[m.jsx(t1,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),a.lastLogLine.msg]})]},`${a.project}-${a.slot}`)})})]})}function TR({capacity:e,selected:t,onSelect:n}){return e.length===0?null:m.jsxs("section",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2",children:"Capacity"}),m.jsx("div",{className:"nb-card p-0 overflow-hidden",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)]",children:[m.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:"项目"}),m.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:"占用"}),m.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"running"}),m.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"其它"}),m.jsx("th",{className:"px-3 py-2"})]})}),m.jsx("tbody",{children:e.map(a=>{const s=a.running+a.starting+a.stuck+a.crashed,o=(t==null?void 0:t.project)===a.project;return m.jsxs("tr",{onClick:()=>n(a.project),className:["border-b border-dashed border-[var(--color-border-light)] last:border-0 cursor-pointer hover:bg-[var(--color-accent-yellow)]",o?"bg-[var(--color-accent-yellow)]":""].join(" "),children:[m.jsx("td",{className:"px-3 py-2 font-[family-name:var(--font-mono)] font-bold",children:a.project}),m.jsx("td",{className:"px-3 py-2",children:m.jsx(CR,{total:a.total,cap:a})}),m.jsxs("td",{className:"px-3 py-2 text-right font-[family-name:var(--font-mono)]",children:[m.jsx("span",{className:"text-[var(--color-running)] font-bold",children:a.running}),m.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["/",a.total]})]}),m.jsxs("td",{className:"px-3 py-2 text-right text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:[a.starting>0&&m.jsxs("span",{className:"mr-2",children:["starting ",a.starting]}),a.stuck>0&&m.jsxs("span",{className:"text-[var(--color-stuck)] font-bold mr-2",children:["stuck ",a.stuck]}),a.crashed>0&&m.jsxs("span",{className:"text-[var(--color-crashed)] font-bold mr-2",children:["crashed ",a.crashed]}),s===0&&m.jsx("span",{children:"idle"})]}),m.jsx("td",{className:"px-3 py-2 text-right",children:m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"详情 →"})})]},a.project)})})]})})]})}function CR({total:e,cap:t}){const n=[];for(let a=0;a<t.crashed;a++)n.push("crashed");for(let a=0;a<t.stuck;a++)n.push("stuck");for(let a=0;a<t.starting;a++)n.push("starting");for(let a=0;a<t.running;a++)n.push("running");for(let a=0;a<t.idle;a++)n.push("idle");return m.jsxs("div",{className:"flex gap-1 items-center",children:[n.map((a,s)=>m.jsx("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-[var(--color-text)]",style:{background:AR(a)},title:a},s)),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] ml-2 font-[family-name:var(--font-mono)]",children:[e," slot",e!==1?"s":""]})]})}function AR(e){switch(e){case"running":return"var(--color-running-bg)";case"starting":return"var(--color-secondary)";case"stuck":return"var(--color-stuck-bg)";case"crashed":return"var(--color-crashed-bg)";default:return"var(--color-idle-bg)"}}function OR({project:e,initialSlot:t,onChange:n}){var d;const a=lt({queryKey:["workers",e],queryFn:()=>ER(e),refetchInterval:3e3}),s=((d=a.data)==null?void 0:d.data)??[],[o,c]=M.useState(null);M.useEffect(()=>{if(s.length===0){c(null);return}const h=s[0].slot;c(y=>y!=null&&s.some(g=>g.slot===y)?y:t!=null&&s.some(g=>g.slot===t)?t:h)},[e,t,s.length]);const f=s.find(h=>h.slot===o)??null;return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs("div",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold truncate",children:e}),m.jsx(ds,{to:`/board?project=${encodeURIComponent(e)}`,className:"text-xs underline text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"看板 →"})]}),a.isLoading&&s.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 workers…"}):s.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"该项目没有 worker slot。"}):m.jsx("div",{className:"flex flex-wrap gap-2",children:s.map(h=>m.jsx(RR,{worker:h,active:h.slot===o,onClick:()=>c(h.slot)},h.slot))})]}),f?m.jsx(MR,{project:e,worker:f,onChange:n}):m.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:m.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:s.length===0?"无 worker":"请选择一个 worker"})})]})}function RR({worker:e,active:t,onClick:n}){return m.jsxs("button",{type:"button",onClick:n,className:["nb-card p-2 text-left min-w-[130px] transition-transform",t?"ring-4 ring-[var(--color-text)]":"opacity-80 hover:opacity-100"].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[m.jsx(og,{state:e.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs",children:["worker-",e.slot]})]}),e.card?m.jsxs("div",{className:"text-[11px] truncate font-[family-name:var(--font-mono)]",children:["#",e.card.seq," ",e.card.title]}):m.jsx("div",{className:"text-[11px] text-[var(--color-text-muted)] italic",children:"空闲"})]})}function MR({project:e,worker:t,onChange:n}){var h,y;const{confirm:a,alert:s}=si(),o=t.state==="crashed"||t.state==="stuck",c=lt({queryKey:["worker-detail",e,t.slot],queryFn:()=>SR(e,t.slot),refetchInterval:3e3}),f=((h=c.data)==null?void 0:h.recentOutput)??[],d=((y=c.data)==null?void 0:y.recentLogs)??[];return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[t.card?m.jsxs("div",{children:[m.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1",children:"当前卡片"}),m.jsxs("div",{className:"text-sm font-semibold break-words",children:["#",t.card.seq," · ",t.card.title]})]}):m.jsx("div",{className:"text-sm text-[var(--color-text-muted)] italic",children:"slot 空闲,没有当前卡片。"}),m.jsxs("dl",{className:"grid grid-cols-[100px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"Stage"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.stage??"—"}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Runtime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:cg(t.runtimeMs)}),m.jsx("dt",{className:"font-bold",children:"Started"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.startedAt?new Date(t.startedAt).toLocaleString():"—"}),m.jsx("dt",{className:"font-bold",children:"Marker"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.markerUpdatedAt?ug(t.markerUpdatedAt):"—"})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 flex items-center gap-1",children:[m.jsx(t1,{size:10,strokeWidth:2.5}),"Claude 输出 · 最近 ",f.length," 行"]}),c.isLoading&&f.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载中…"}):f.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"还没收到 session 输出。Worker 刚启动时需要几秒。"}):m.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-80 overflow-auto whitespace-pre-wrap break-words",children:f.map(g=>`${g.ts?`${g.ts} [${g.kind}] `:`[${g.kind}] `}${g.text}`).join(`
|
|
477
|
+
`).trim()}function vm(e){return dp(e,"描述")}function hR({project:e,seq:t,onClose:n,onChanged:a}){var K,oe,V,pe,R,L,J,C,me,_e,ve;const s=qn(),{confirm:o,alert:c}=si(),{data:f,isLoading:d,isError:h,error:y,refetch:g}=lt({queryKey:["card",e,t],queryFn:()=>GO(e,t)}),[x,v]=M.useState(!1),[S,w]=M.useState(""),[k,_]=M.useState(""),[A,T]=M.useState(new Set),[D,$]=M.useState([]),[j,q]=M.useState(""),U=lt({queryKey:["skills-all",e],queryFn:()=>lg(e),enabled:x}),O=((oe=(K=lt({queryKey:["projects"],queryFn:_r,refetchInterval:1e4}).data)==null?void 0:K.data.find(ce=>ce.name===e))==null?void 0:oe.pipelineStatus)==="running";M.useEffect(()=>{x&&f&&(w(f.title),_(vm(f.body)),T(new Set(f.skills)),$([...f.labels]))},[x,f]),M.useEffect(()=>{const ce=ke=>{ke.key==="Escape"&&(x?v(!1):n())};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[n,x]);const P=Pn({mutationFn:()=>{if(!f)throw new Error("no data");const ce={},ke=S.trim();ke&&ke!==f.title&&(ce.title=ke);const Ke=vm(f.body);k!==Ke&&(ce.description=k);const Dt=[...A].sort(),yn=[...f.skills].sort();return JSON.stringify(Dt)!==JSON.stringify(yn)&&(ce.skills=Dt),JSON.stringify(D)!==JSON.stringify(f.labels)&&(ce.labels=D),Object.keys(ce).length===0?Promise.resolve({ok:!0,noop:!0}):WO(e,t,ce)},onSuccess:()=>{s.invalidateQueries({queryKey:["card",e,t]}),s.invalidateQueries({queryKey:["cards",e]}),v(!1),a()},onError:ce=>{c({title:"保存失败",body:ce instanceof Error?ce.message:String(ce)})}}),G=M.useMemo(()=>{if(!x||!f)return!1;if(S.trim()!==f.title||k!==vm(f.body))return!0;const ce=[...A].sort(),ke=[...f.skills].sort();return JSON.stringify(ce)!==JSON.stringify(ke)||JSON.stringify(D)!==JSON.stringify(f.labels)},[x,f,S,k,A,D]),le=ce=>{const ke=new Set(A);ke.has(ce)?ke.delete(ce):ke.add(ce),T(ke)},ae=()=>{const ce=j.trim();if(ce){if(D.includes(ce)){q("");return}$([...D,ce]),q("")}},W=ce=>{$(D.filter(ke=>ke!==ce))};return m.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[m.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&m.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),x&&m.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:"⚠ 编辑中"})]}),x?m.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:S,onChange:ce=>w(ce.target.value),maxLength:200,"aria-label":"卡片标题"}):m.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??"加载中…"})]}),m.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!x&&f&&m.jsxs("button",{onClick:()=>v(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":"编辑卡片",children:[m.jsx(Hp,{size:12,strokeWidth:2.5})," 编辑"]}),m.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":"关闭",type:"button",children:m.jsx(Er,{size:14,strokeWidth:3})})]})]}),d&&m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}),h&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",y instanceof Error?y.message:String(y)]}),f&&m.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!x&&m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(QC,{size:14}),m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:f.branch})]}),x?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),U.isLoading&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 skill 列表…"}),U.data&&U.data.data.length>0&&m.jsx("div",{className:"flex flex-wrap gap-1.5",children:U.data.data.map(ce=>{const ke=A.has(ce.name);return m.jsx("button",{type:"button",onClick:()=>le(ce.name),"aria-pressed":ke,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",ke?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:ce.name},ce.name)})})]}),m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[D.map(ce=>m.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[ce,m.jsx("button",{type:"button",onClick:()=>W(ce),className:"hover:text-[var(--color-crashed)]","aria-label":`删除 ${ce}`,children:m.jsx(Er,{size:10,strokeWidth:3})})]},ce)),m.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:"+ 添加 label",value:j,onChange:ce=>q(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&!ce.nativeEvent.isComposing&&(ce.preventDefault(),ae())}}),j&&m.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:ae,"aria-label":"添加 label",children:m.jsx(Xi,{size:10,strokeWidth:3})})]}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖"})]})]}):m.jsxs(m.Fragment,{children:[f.skills.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),m.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.skills.map(ce=>m.jsx(iS,{name:ce},ce))})]}),f.labels.length>0&&m.jsxs("div",{children:[m.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),m.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.labels.map(ce=>m.jsx(aS,{label:ce,kind:ce==="NEEDS-FIX"?"warn":"default"},ce))})]})]}),x?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:k,onChange:ce=>_(ce.target.value),"aria-label":"卡片描述"}),m.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:'只替换 "## 描述" 段的内容;检查清单和日志段不动。'})]}),(((C=f.checklist)==null?void 0:C.total)??0)>0&&m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[m.jsx("div",{className:"flex items-center justify-between mb-2",children:m.jsxs("span",{className:"font-bold text-sm",children:["检查清单 ",((me=f.checklist)==null?void 0:me.done)??0,"/",((_e=f.checklist)==null?void 0:_e.total)??0]})}),m.jsx("ul",{className:"text-sm space-y-1",children:(((ve=f.checklist)==null?void 0:ve.items)??[]).map((ce,ke)=>m.jsxs("li",{className:`flex items-start gap-2 ${ce.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:ce.done?"✓":"○"}),m.jsx("span",{children:ce.text})]},ke))})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"描述"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:dp(f.body,"描述")||"(空)"})]}),m.jsxs("div",{children:[m.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:["检查清单 ",m.jsxs("span",{className:"text-[var(--color-text-muted)] normal-case tracking-normal",children:[((V=f.checklist)==null?void 0:V.done)??0,"/",((pe=f.checklist)==null?void 0:pe.total)??0]})]}),m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:(((R=f.checklist)==null?void 0:R.total)??0)>0?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"flex items-center justify-end mb-2",children:m.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:m.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${((L=f.checklist)==null?void 0:L.percent)??0}%`}})})}),m.jsx("ul",{className:"text-sm space-y-1",children:(((J=f.checklist)==null?void 0:J.items)??[]).map((ce,ke)=>m.jsxs("li",{className:`flex items-start gap-2 ${ce.done?"opacity-60 line-through":""}`,children:[m.jsx("span",{children:ce.done?"✓":"○"}),m.jsx("span",{children:ce.text})]},ke))})]}):m.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:["暂无清单项。在描述里用 ",m.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"- [ ] 项"})," 语法添加。"]})})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"日志"}),m.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:dp(f.body,"日志")||"(空)"})]})]}),m.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end flex-wrap",children:x?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{v(!1),g()},disabled:P.isPending,children:"取消"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>P.mutate(),disabled:!G||!S.trim()||P.isPending,"aria-label":"保存卡片修改",children:[P.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:14,strokeWidth:3}),"保存"]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",disabled:f.state==="Done"||O,title:f.state==="Done"?"卡片已完成;先拖回 Todo 再启动":O?"Pipeline 正在跑——supervisor 会自动 dispatch,无需手动启动":void 0,onClick:async()=>{try{await VO(e,t),a()}catch(ce){c({title:"启动 worker 失败",body:ce instanceof Error?ce.message:String(ce)})}},children:[m.jsx(Kp,{size:14,strokeWidth:3}),"启动 worker"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await o({title:`重置卡片 #${t}`,body:"卡片状态会回到初始,已做的 checklist 会清空。",confirm:"重置",danger:!0}))try{await QO(e,t),a(),n()}catch(ke){c({title:"重置失败",body:ke instanceof Error?ke.message:String(ke)})}},children:[m.jsx(WE,{size:14,strokeWidth:2.5}),"重置卡片"]}),m.jsxs("button",{className:"nb-btn",style:{background:"var(--color-crashed)",color:"var(--color-bg)"},type:"button",onClick:async()=>{if(!(!await o({title:`删除卡片 #${t}`,body:`即将删除 "${f.title}"。此操作不可恢复(md 文件将被物理删除)。是否继续?`,confirm:"继续",danger:!0})||!await o({title:"最终确认",body:`请再次确认删除卡片 #${t}。`,confirm:"确定删除",danger:!0})))try{await YO(e,t),a(),n()}catch(Ke){c({title:"删除失败",body:Ke instanceof Error?Ke.message:String(Ke)})}},"aria-label":"删除卡片",children:[m.jsx(Il,{size:14,strokeWidth:2.5}),"删除卡片"]})]})})]})]})})}function mR({current:e,onChange:t}){const[n,a]=M.useState(!1),s=M.useRef(null),{data:o}=lt({queryKey:["projects"],queryFn:_r});return M.useEffect(()=>{const c=f=>{var d;(d=s.current)!=null&&d.contains(f.target)||a(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),m.jsxs("div",{className:"relative",ref:s,children:[m.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 px-3 py-2 bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[3px_3px_0_var(--color-text)] font-[family-name:var(--font-mono)] text-sm font-bold hover:-translate-x-px hover:-translate-y-px hover:shadow-[4px_4px_0_var(--color-text)] transition-[transform,box-shadow] duration-150",onClick:()=>a(c=>!c),children:[e,m.jsx(yc,{size:14,strokeWidth:2.5})]}),n&&o&&m.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[5px_5px_0_var(--color-text)] overflow-hidden",children:o.data.map(c=>m.jsxs("button",{type:"button",onClick:()=>{t(c.name),a(!1)},className:["w-full text-left px-4 py-2 text-sm font-semibold",c.name===e?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:c.name}),m.jsxs("span",{className:"ml-2 text-xs text-[var(--color-text-muted)]",children:[c.cards.total," cards"]})]},c.name))})]})}const pR=[{state:"Planning",label:"Planning",bg:"var(--color-accent-purple)"},{state:"Backlog",label:"Backlog",bg:"var(--color-bg-cream)"},{state:"Todo",label:"Todo",bg:"var(--color-accent-yellow)"},{state:"Inprogress",label:"Inprogress",bg:"var(--color-secondary)"},{state:"QA",label:"QA / Review",bg:"var(--color-accent-pink)"},{state:"Done",label:"Done",bg:"var(--color-accent-mint)"}],rS="sps-console:last-board-project";function gR(){if(typeof window>"u")return null;try{return localStorage.getItem(rS)}catch{return null}}function bR(e){if(!(typeof window>"u"))try{localStorage.setItem(rS,e)}catch{}}function yR(){var W,K,oe;const[e,t]=QE(),n=e.get("project"),[a,s]=M.useState(null),[o,c]=M.useState(""),[f,d]=M.useState(()=>new Set),[h,y]=M.useState(()=>new Set),{confirm:g,alert:x}=si();nR(n);const v=lt({queryKey:["projects"],queryFn:_r}),S=lt({queryKey:["cards",n],queryFn:()=>KO(n??""),enabled:!!n}),w=qn(),k=()=>{w.invalidateQueries({queryKey:["cards",n]}),w.invalidateQueries({queryKey:["projects"]}),w.invalidateQueries({queryKey:["pipeline-status",n]})},_=V=>{t({project:V})};M.useEffect(()=>{var pe;if(n){bR(n);return}const V=gR();V&&((pe=v.data)!=null&&pe.data.some(R=>R.name===V))&&t({project:V},{replace:!0})},[n,v.data,t]);const A=Pn({mutationFn:()=>JO(n),onSuccess:()=>{k()},onError:V=>{x({title:"启动 pipeline 失败",body:V instanceof Error?V.message:String(V)})}}),T=Pn({mutationFn:()=>eR(n),onSuccess:()=>k(),onError:V=>{x({title:"停止 pipeline 失败",body:V instanceof Error?V.message:String(V)})}}),D=Pn({mutationFn:()=>tR(n,{all:!0}),onSuccess:()=>k(),onError:V=>{x({title:"重置失败",body:V instanceof Error?V.message:String(V)})}}),[$,j]=M.useState(!1),q=Pn({mutationFn:V=>XO(n,V),onSuccess:()=>{k(),j(!1)},onError:V=>{x({title:"新建卡片失败",body:V instanceof Error?V.message:String(V)})}}),U=Pn({mutationFn:({seq:V,state:pe})=>ZO(n,V,pe),onMutate:async({seq:V,state:pe})=>{await w.cancelQueries({queryKey:["cards",n]});const R=w.getQueryData(["cards",n]);return R&&w.setQueryData(["cards",n],{...R,data:R.data.map(L=>L.seq===V?{...L,state:pe}:L)}),{prev:R}},onError:(V,pe,R)=>{R!=null&&R.prev&&w.setQueryData(["cards",n],R.prev),x({title:"移动卡片失败",body:V instanceof Error?V.message:String(V)})},onSettled:()=>{w.invalidateQueries({queryKey:["cards",n]})}}),Z=((W=S.data)==null?void 0:W.data)??[],{allSkills:O,allLabels:P}=M.useMemo(()=>{const V=new Set,pe=new Set;for(const R of Z){for(const L of R.skills)V.add(L);for(const L of R.labels)pe.add(L)}return{allSkills:[...V].sort(),allLabels:[...pe].sort()}},[Z]);if(!n)return m.jsxs("div",{className:"flex flex-col gap-6 max-w-4xl",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"看板"}),m.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:"选择一个项目 🎯"}),m.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:"看板按项目分。挑一个开始:"}),m.jsx("div",{className:"flex flex-wrap gap-2",children:(K=v.data)==null?void 0:K.data.map(V=>m.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>_(V.name),type:"button",children:V.name},V.name))})]})]});const G=Z.filter(V=>{if(o){const pe=o.toLowerCase();if(!(V.title.toLowerCase().includes(pe)||V.skills.some(L=>L.toLowerCase().includes(pe))||V.labels.some(L=>L.toLowerCase().includes(pe))))return!1}return!(f.size>0&&!V.skills.some(R=>f.has(R))||h.size>0&&!V.labels.some(R=>h.has(R)))}),le=(oe=v.data)==null?void 0:oe.data.find(V=>V.name===n),ae=(le==null?void 0:le.pipelineStatus)==="running";return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"看板 ✨"}),m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:le?`${le.name} · ${le.cards.total} cards · ${le.workers.active} workers 活跃`:"加载中…"})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsx(mR,{current:n,onChange:_}),m.jsxs("button",{className:ae?"nb-btn nb-btn-danger":"nb-btn nb-btn-primary",onClick:()=>ae?T.mutate():A.mutate(),disabled:A.isPending||T.isPending,type:"button","aria-label":ae?"停止 pipeline":"启动 pipeline",title:ae?"停止 pipeline":"启动 pipeline",children:[A.isPending||T.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):ae?m.jsx(e1,{size:14,strokeWidth:3}):m.jsx(Kp,{size:14,strokeWidth:3}),ae?"停止":"启动"]}),m.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await g({title:"重置整个流水线",body:"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。",confirm:"重置全部",danger:!0})&&D.mutate()},disabled:D.isPending,children:[D.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(WE,{size:14,strokeWidth:2.5}),"重置"]}),m.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>j(!0),disabled:q.isPending,children:[q.isPending?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(Xi,{size:14,strokeWidth:3}),"新卡片"]})]})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(xf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"搜索标题 / skill / label…",value:o,onChange:V=>c(V.target.value),"aria-label":"搜索卡片"})]}),m.jsx(Jv,{label:"skill",options:O,selected:f,onChange:d}),m.jsx(Jv,{label:"label",options:P,selected:h,onChange:y}),(o||f.size>0||h.size>0)&&m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{c(""),d(new Set),y(new Set)},type:"button","aria-label":"清空筛选",children:[m.jsx(Er,{size:11,strokeWidth:3}),"清空"]}),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[m.jsx(KC,{size:12}),G.length," / ",Z.length]})]}),S.isError&&m.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[m.jsx("p",{className:"font-semibold",children:"加载卡片失败"}),m.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:S.error instanceof Error?S.error.message:String(S.error)})]}),!S.isError&&m.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-3",children:pR.map(V=>m.jsx(dR,{label:V.label,bg:V.bg,cards:G.filter(xR(V.state)),onCardClick:pe=>s(pe.seq),onDropCard:pe=>U.mutate({seq:pe,state:V.state})},V.state))}),a!==null&&m.jsx(hR,{project:n,seq:a,onClose:()=>s(null),onChanged:k}),$&&m.jsx(HO,{project:n,isPending:q.isPending,onCancel:()=>j(!1),onCreate:V=>q.mutate(V)})]})}function xR(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Jv({label:e,options:t,selected:n,onChange:a}){const[s,o]=M.useState(!1),c=M.useRef(null);M.useEffect(()=>{if(!s)return;const y=x=>{var v;(v=c.current)!=null&&v.contains(x.target)||o(!1)},g=x=>{x.key==="Escape"&&o(!1)};return window.addEventListener("click",y),window.addEventListener("keydown",g),()=>{window.removeEventListener("click",y),window.removeEventListener("keydown",g)}},[s]);const f=y=>{const g=new Set(n);g.has(y)?g.delete(y):g.add(y),a(g)},d=t.length===0,h=n.size;return m.jsxs("div",{ref:c,className:"relative",children:[m.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!d&&o(y=>!y),disabled:d,"aria-haspopup":"listbox","aria-expanded":s,"aria-label":`按 ${e} 筛选`,children:[e,h>0&&m.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:h}),m.jsx(yc,{size:11,strokeWidth:3,className:["transition-transform",s?"rotate-180":""].join(" ")})]}),s&&m.jsxs("div",{role:"listbox",className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] max-h-64 overflow-auto nb-card p-2",style:{padding:8},children:[t.map(y=>{const g=n.has(y);return m.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",g?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[m.jsx("input",{type:"checkbox",checked:g,onChange:()=>f(y),className:"flex-shrink-0"}),m.jsx("span",{className:"truncate",children:y})]},y)}),h>0&&m.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>a(new Set),children:"清空选择"})]})]})}function vR(){return Ht("/api/workers/all")}function ER(e){return Ht(`/api/projects/${encodeURIComponent(e)}/workers`)}function SR(e,t){return Ht(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function sS(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function e0(e,t){return sS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function wR(e,t,n){return sS(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function og({state:e}){const n={running:{bg:"var(--color-running-bg)",color:"var(--color-running)",label:"running"},starting:{bg:"var(--color-secondary)",color:"var(--color-text)",label:"starting",icon:m.jsx(Wt,{size:9,strokeWidth:3,className:"animate-spin"})},stuck:{bg:"var(--color-stuck-bg)",color:"var(--color-stuck)",label:"stuck"},crashed:{bg:"var(--color-crashed-bg)",color:"var(--color-crashed)",label:"crashed",icon:m.jsx(SA,{size:9,strokeWidth:2.5})},idle:{bg:"var(--color-idle-bg)",color:"var(--color-idle)",label:"idle"}}[e];return m.jsxs("span",{className:"nb-status inline-flex items-center gap-1",style:{background:n.bg,color:n.color},children:[n.icon,n.label]})}function cg(e){if(e==null||e<=0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n}h ${a}m`:a>0?`${a}m ${s}s`:`${s}s`}function _R(e){if(e==null||e<=0)return"text-[var(--color-text-muted)]";const t=e/6e4;return t<10?"text-[var(--color-running)]":t<60?"text-[var(--color-stuck)]":"text-[var(--color-crashed)]"}function ug(e){const t=Date.now()-new Date(e).getTime();return t<6e4?`${Math.floor(t/1e3)}s 前`:t<36e5?`${Math.floor(t/6e4)}m 前`:`${Math.floor(t/36e5)}h 前`}function kR({alerts:e,selected:t,onSelect:n}){return e.length===0?m.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[m.jsx(Pp,{size:18,strokeWidth:2.5,className:"text-[var(--color-running)]"}),m.jsx("span",{className:"text-sm font-bold text-[var(--color-running)]",children:"全部 worker 健康"})]}):m.jsxs("section",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2 text-[var(--color-crashed)]",children:[m.jsx(RA,{size:14,strokeWidth:2.5}),"Alerts (",e.length,")"]}),m.jsx("div",{className:"flex flex-col gap-2",children:e.map(a=>{const s=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return m.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="crashed"?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-stuck-bg)]",s?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.jsx(og,{state:a.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold",children:[a.project,"/worker-",a.slot]}),a.card&&m.jsxs("span",{className:"truncate",children:["#",a.card.seq," ",a.card.title]}),m.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1",children:[m.jsx(MC,{size:10,strokeWidth:2.5}),cg(a.runtimeMs)]})]}),a.markerUpdatedAt&&m.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1 font-[family-name:var(--font-mono)]",children:a.state==="crashed"?"PID 已死。":`marker 停 ${ug(a.markerUpdatedAt)}。`})]},`${a.project}-${a.slot}`)})})]})}function NR({active:e,selected:t,onSelect:n}){return e.length===0?m.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)]",children:m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"没有 worker 在运行。"})}):m.jsxs("section",{children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2",children:[m.jsx(jf,{size:14,strokeWidth:2.5}),"Active (",e.length,")"]}),m.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map(a=>{const s=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return m.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="starting"?"bg-[var(--color-secondary)]":"bg-[var(--color-running-bg)]",s?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[m.jsx(og,{state:a.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm flex-1 truncate",children:[a.project,"/worker-",a.slot]}),m.jsx("span",{className:`text-xs font-[family-name:var(--font-mono)] ${_R(a.runtimeMs)}`,children:cg(a.runtimeMs)})]}),a.card&&m.jsxs("div",{className:"text-sm font-semibold mb-1 truncate",children:["#",a.card.seq," · ",a.card.title]}),m.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-2 mb-1",children:[a.stage&&m.jsxs("span",{children:["stage: ",a.stage]}),a.markerUpdatedAt&&m.jsxs("span",{className:"ml-auto",children:["marker ",ug(a.markerUpdatedAt)]})]}),a.lastLogLine&&m.jsxs("div",{className:"text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded px-2 py-1 mt-2 truncate",children:[m.jsx(t1,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),a.lastLogLine.msg]})]},`${a.project}-${a.slot}`)})})]})}function TR({capacity:e,selected:t,onSelect:n}){return e.length===0?null:m.jsxs("section",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2",children:"Capacity"}),m.jsx("div",{className:"nb-card p-0 overflow-hidden",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)]",children:[m.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:"项目"}),m.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:"占用"}),m.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"running"}),m.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"其它"}),m.jsx("th",{className:"px-3 py-2"})]})}),m.jsx("tbody",{children:e.map(a=>{const s=a.running+a.starting+a.stuck+a.crashed,o=(t==null?void 0:t.project)===a.project;return m.jsxs("tr",{onClick:()=>n(a.project),className:["border-b border-dashed border-[var(--color-border-light)] last:border-0 cursor-pointer hover:bg-[var(--color-accent-yellow)]",o?"bg-[var(--color-accent-yellow)]":""].join(" "),children:[m.jsx("td",{className:"px-3 py-2 font-[family-name:var(--font-mono)] font-bold",children:a.project}),m.jsx("td",{className:"px-3 py-2",children:m.jsx(CR,{total:a.total,cap:a})}),m.jsxs("td",{className:"px-3 py-2 text-right font-[family-name:var(--font-mono)]",children:[m.jsx("span",{className:"text-[var(--color-running)] font-bold",children:a.running}),m.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["/",a.total]})]}),m.jsxs("td",{className:"px-3 py-2 text-right text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:[a.starting>0&&m.jsxs("span",{className:"mr-2",children:["starting ",a.starting]}),a.stuck>0&&m.jsxs("span",{className:"text-[var(--color-stuck)] font-bold mr-2",children:["stuck ",a.stuck]}),a.crashed>0&&m.jsxs("span",{className:"text-[var(--color-crashed)] font-bold mr-2",children:["crashed ",a.crashed]}),s===0&&m.jsx("span",{children:"idle"})]}),m.jsx("td",{className:"px-3 py-2 text-right",children:m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:"详情 →"})})]},a.project)})})]})})]})}function CR({total:e,cap:t}){const n=[];for(let a=0;a<t.crashed;a++)n.push("crashed");for(let a=0;a<t.stuck;a++)n.push("stuck");for(let a=0;a<t.starting;a++)n.push("starting");for(let a=0;a<t.running;a++)n.push("running");for(let a=0;a<t.idle;a++)n.push("idle");return m.jsxs("div",{className:"flex gap-1 items-center",children:[n.map((a,s)=>m.jsx("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-[var(--color-text)]",style:{background:AR(a)},title:a},s)),m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] ml-2 font-[family-name:var(--font-mono)]",children:[e," slot",e!==1?"s":""]})]})}function AR(e){switch(e){case"running":return"var(--color-running-bg)";case"starting":return"var(--color-secondary)";case"stuck":return"var(--color-stuck-bg)";case"crashed":return"var(--color-crashed-bg)";default:return"var(--color-idle-bg)"}}function OR({project:e,initialSlot:t,onChange:n}){var d;const a=lt({queryKey:["workers",e],queryFn:()=>ER(e),refetchInterval:3e3}),s=((d=a.data)==null?void 0:d.data)??[],[o,c]=M.useState(null);M.useEffect(()=>{if(s.length===0){c(null);return}const h=s[0].slot;c(y=>y!=null&&s.some(g=>g.slot===y)?y:t!=null&&s.some(g=>g.slot===t)?t:h)},[e,t,s.length]);const f=s.find(h=>h.slot===o)??null;return m.jsxs("div",{className:"flex flex-col h-full",children:[m.jsxs("div",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2",children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold truncate",children:e}),m.jsx(ds,{to:`/board?project=${encodeURIComponent(e)}`,className:"text-xs underline text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:"看板 →"})]}),a.isLoading&&s.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载 workers…"}):s.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"该项目没有 worker slot。"}):m.jsx("div",{className:"flex flex-wrap gap-2",children:s.map(h=>m.jsx(RR,{worker:h,active:h.slot===o,onClick:()=>c(h.slot)},h.slot))})]}),f?m.jsx(MR,{project:e,worker:f,onChange:n}):m.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:m.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:s.length===0?"无 worker":"请选择一个 worker"})})]})}function RR({worker:e,active:t,onClick:n}){return m.jsxs("button",{type:"button",onClick:n,className:["nb-card p-2 text-left min-w-[130px] transition-transform",t?"ring-4 ring-[var(--color-text)]":"opacity-80 hover:opacity-100"].join(" "),children:[m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[m.jsx(og,{state:e.state}),m.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs",children:["worker-",e.slot]})]}),e.card?m.jsxs("div",{className:"text-[11px] truncate font-[family-name:var(--font-mono)]",children:["#",e.card.seq," ",e.card.title]}):m.jsx("div",{className:"text-[11px] text-[var(--color-text-muted)] italic",children:"空闲"})]})}function MR({project:e,worker:t,onChange:n}){var h,y;const{confirm:a,alert:s}=si(),o=t.state==="crashed"||t.state==="stuck",c=lt({queryKey:["worker-detail",e,t.slot],queryFn:()=>SR(e,t.slot),refetchInterval:3e3}),f=((h=c.data)==null?void 0:h.recentOutput)??[],d=((y=c.data)==null?void 0:y.recentLogs)??[];return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[t.card?m.jsxs("div",{children:[m.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1",children:"当前卡片"}),m.jsxs("div",{className:"text-sm font-semibold break-words",children:["#",t.card.seq," · ",t.card.title]})]}):m.jsx("div",{className:"text-sm text-[var(--color-text-muted)] italic",children:"slot 空闲,没有当前卡片。"}),m.jsxs("dl",{className:"grid grid-cols-[100px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"Stage"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.stage??"—"}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Runtime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:cg(t.runtimeMs)}),m.jsx("dt",{className:"font-bold",children:"Started"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.startedAt?new Date(t.startedAt).toLocaleString():"—"}),m.jsx("dt",{className:"font-bold",children:"Marker"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.markerUpdatedAt?ug(t.markerUpdatedAt):"—"})]}),m.jsxs("div",{children:[m.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 flex items-center gap-1",children:[m.jsx(t1,{size:10,strokeWidth:2.5}),"Claude 输出 · 最近 ",f.length," 行"]}),c.isLoading&&f.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"加载中…"}):f.length===0?m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:"还没收到 session 输出。Worker 刚启动时需要几秒。"}):m.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-80 overflow-auto whitespace-pre-wrap break-words",children:f.map(g=>`${g.ts?`${g.ts} [${g.kind}] `:`[${g.kind}] `}${g.text}`).join(`
|
|
478
478
|
`)})]}),d.length>0&&m.jsxs("div",{children:[m.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 opacity-60",children:["Supervisor 心跳 · 最近 ",d.length," 行"]}),m.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-40 overflow-auto whitespace-pre-wrap break-words opacity-80",children:d.map(g=>`${g.ts??""} [${g.level}] ${g.msg}`).join(`
|
|
479
|
-
`)}),m.jsx(ds,{to:`/logs?project=${encodeURIComponent(e)}&worker=${t.slot}`,className:"text-xs underline text-[var(--color-running)] mt-1 inline-block",children:"查看完整 log →"})]})]}),m.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] flex gap-2 justify-end flex-wrap",children:[o&&t.card&&m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:`重启 worker-${t.slot}`,body:`先杀进程,再重新 launch 到 #${t.card.seq}`,confirm:"重启"})){try{await e0(e,t.slot)}catch{}try{await wR(e,t.slot,t.card.seq),n()}catch(x){s({title:"重启失败",body:x instanceof Error?x.message:String(x)})}}},children:[m.jsx(CA,{size:11,strokeWidth:2.5})," 重启"]}),t.state!=="idle"&&m.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:`终止 worker-${t.slot}`,body:"当前任务强制中断。",confirm:"终止",danger:!0}))try{await e0(e,t.slot),n()}catch(x){s({title:"终止失败",body:x instanceof Error?x.message:String(x)})}},children:[m.jsx(zA,{size:11,strokeWidth:2.5})," 终止"]})]})]})}function jR(){var o;const e=qn(),[t,n]=M.useState(null),a=lt({queryKey:["workers-agg"],queryFn:vR,refetchInterval:5e3});M.useEffect(()=>{if(!a.data)return;const c=a.data.capacity.map(d=>d.project),f=[];for(const d of c){const h=new EventSource(`/stream/projects/${encodeURIComponent(d)}`),y=()=>{e.invalidateQueries({queryKey:["workers-agg"]})};h.addEventListener("worker.updated",y),h.addEventListener("worker.added",y),h.addEventListener("worker.deleted",y),h.addEventListener("card.updated",y),f.push(h)}return()=>{for(const d of f)d.close()}},[(o=a.data)==null?void 0:o.capacity.map(c=>c.project).join(","),e]);const s=M.useMemo(()=>{if(!a.data)return{projects:0,running:0,starting:0,stuck:0,crashed:0,idle:0};const c={projects:a.data.capacity.length,running:0,starting:0,stuck:0,crashed:0,idle:0};for(const f of a.data.capacity)c.running+=f.running,c.starting+=f.starting,c.stuck+=f.stuck,c.crashed+=f.crashed,c.idle+=f.idle;return c},[a.data]);return m.jsxs("div",{className:"flex flex-col gap-4 h-[calc(100vh-140px)]",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:["跨 ",s.projects," 项目 · ",s.running," 跑 · ",s.starting," 启动 ·"," ",m.jsxs("span",{className:"text-[var(--color-stuck)]",children:[s.stuck," 卡"]})," ·"," ",m.jsxs("span",{className:"text-[var(--color-crashed)]",children:[s.crashed," 崩"]})," · ",s.idle," 闲"]})]}),m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a.refetch(),disabled:a.isFetching,type:"button","aria-label":"刷新",children:[a.isFetching?m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin"}):m.jsx(Cl,{size:12,strokeWidth:2.5}),"刷新"]})]}),m.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 flex-1 min-h-0",children:[m.jsxs("div",{className:"flex flex-col gap-4 overflow-auto pr-2",children:[a.isLoading&&m.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"加载中…"}),a.isError&&m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["加载失败: ",a.error instanceof Error?a.error.message:String(a.error)]})}),a.data&&m.jsxs(m.Fragment,{children:[m.jsx(kR,{alerts:a.data.alerts,selected:t,onSelect:(c,f)=>n({project:c,slot:f})}),m.jsx(NR,{active:a.data.active,selected:t,onSelect:(c,f)=>n({project:c,slot:f})}),m.jsx(TR,{capacity:a.data.capacity,selected:t,onSelect:c=>n({project:c})})]})]}),m.jsx("aside",{className:"nb-card p-0 overflow-hidden flex flex-col h-full",children:t?m.jsx(OR,{project:t.project,initialSlot:t.slot,onChange:()=>e.invalidateQueries({queryKey:["workers-agg"]})}):m.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:m.jsxs("div",{children:[m.jsx(jf,{size:32,className:"mx-auto mb-3 text-[var(--color-text-subtle)]",strokeWidth:2}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"点击项目 / worker 查看详情"})]})})})]})]})}function DR(e){const t=new URLSearchParams;return e.project&&t.set("project",e.project),e.worker&&t.set("worker",e.worker),t.set("limit",String(e.limit)),e.since&&t.set("since",e.since),Ht(`/api/logs?${t}`)}function LR(e){const t=new URLSearchParams({project:e.project});return e.worker&&t.set("worker",e.worker),`/stream/logs?${t}`}const IR=["error","warn","info","debug"],zR=["error","warn","info"];function BR(){var U,Z;const[e,t]=QE(),n=e.get("project"),a=e.get("worker")??"",[s,o]=M.useState([]),[c,f]=M.useState(!1),[d,h]=M.useState(!0),[y,g]=M.useState(()=>new Set(zR)),[x,v]=M.useState(""),[S,w]=M.useState("live"),[k,_]=M.useState(()=>{const O=new Date(Date.now()-36e5),P=G=>String(G).padStart(2,"0");return`${O.getFullYear()}-${P(O.getMonth()+1)}-${P(O.getDate())}T${P(O.getHours())}:${P(O.getMinutes())}`}),A=M.useRef(null),T=!n,D=lt({queryKey:["projects"],queryFn:
|
|
479
|
+
`)}),m.jsx(ds,{to:`/logs?project=${encodeURIComponent(e)}&worker=${t.slot}`,className:"text-xs underline text-[var(--color-running)] mt-1 inline-block",children:"查看完整 log →"})]})]}),m.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] flex gap-2 justify-end flex-wrap",children:[o&&t.card&&m.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:`重启 worker-${t.slot}`,body:`先杀进程,再重新 launch 到 #${t.card.seq}`,confirm:"重启"})){try{await e0(e,t.slot)}catch{}try{await wR(e,t.slot,t.card.seq),n()}catch(x){s({title:"重启失败",body:x instanceof Error?x.message:String(x)})}}},children:[m.jsx(CA,{size:11,strokeWidth:2.5})," 重启"]}),t.state!=="idle"&&m.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:`终止 worker-${t.slot}`,body:"当前任务强制中断。",confirm:"终止",danger:!0}))try{await e0(e,t.slot),n()}catch(x){s({title:"终止失败",body:x instanceof Error?x.message:String(x)})}},children:[m.jsx(zA,{size:11,strokeWidth:2.5})," 终止"]})]})]})}function jR(){var o;const e=qn(),[t,n]=M.useState(null),a=lt({queryKey:["workers-agg"],queryFn:vR,refetchInterval:5e3});M.useEffect(()=>{if(!a.data)return;const c=a.data.capacity.map(d=>d.project),f=[];for(const d of c){const h=new EventSource(`/stream/projects/${encodeURIComponent(d)}`),y=()=>{e.invalidateQueries({queryKey:["workers-agg"]})};h.addEventListener("worker.updated",y),h.addEventListener("worker.added",y),h.addEventListener("worker.deleted",y),h.addEventListener("card.updated",y),f.push(h)}return()=>{for(const d of f)d.close()}},[(o=a.data)==null?void 0:o.capacity.map(c=>c.project).join(","),e]);const s=M.useMemo(()=>{if(!a.data)return{projects:0,running:0,starting:0,stuck:0,crashed:0,idle:0};const c={projects:a.data.capacity.length,running:0,starting:0,stuck:0,crashed:0,idle:0};for(const f of a.data.capacity)c.running+=f.running,c.starting+=f.starting,c.stuck+=f.stuck,c.crashed+=f.crashed,c.idle+=f.idle;return c},[a.data]);return m.jsxs("div",{className:"flex flex-col gap-4 h-[calc(100vh-140px)]",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Workers 👷"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:["跨 ",s.projects," 项目 · ",s.running," 跑 · ",s.starting," 启动 ·"," ",m.jsxs("span",{className:"text-[var(--color-stuck)]",children:[s.stuck," 卡"]})," ·"," ",m.jsxs("span",{className:"text-[var(--color-crashed)]",children:[s.crashed," 崩"]})," · ",s.idle," 闲"]})]}),m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a.refetch(),disabled:a.isFetching,type:"button","aria-label":"刷新",children:[a.isFetching?m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin"}):m.jsx(Cl,{size:12,strokeWidth:2.5}),"刷新"]})]}),m.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 flex-1 min-h-0",children:[m.jsxs("div",{className:"flex flex-col gap-4 overflow-auto pr-2",children:[a.isLoading&&m.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"加载中…"}),a.isError&&m.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:m.jsxs("p",{children:["加载失败: ",a.error instanceof Error?a.error.message:String(a.error)]})}),a.data&&m.jsxs(m.Fragment,{children:[m.jsx(kR,{alerts:a.data.alerts,selected:t,onSelect:(c,f)=>n({project:c,slot:f})}),m.jsx(NR,{active:a.data.active,selected:t,onSelect:(c,f)=>n({project:c,slot:f})}),m.jsx(TR,{capacity:a.data.capacity,selected:t,onSelect:c=>n({project:c})})]})]}),m.jsx("aside",{className:"nb-card p-0 overflow-hidden flex flex-col h-full",children:t?m.jsx(OR,{project:t.project,initialSlot:t.slot,onChange:()=>e.invalidateQueries({queryKey:["workers-agg"]})}):m.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:m.jsxs("div",{children:[m.jsx(jf,{size:32,className:"mx-auto mb-3 text-[var(--color-text-subtle)]",strokeWidth:2}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"点击项目 / worker 查看详情"})]})})})]})]})}function DR(e){const t=new URLSearchParams;return e.project&&t.set("project",e.project),e.worker&&t.set("worker",e.worker),t.set("limit",String(e.limit)),e.since&&t.set("since",e.since),Ht(`/api/logs?${t}`)}function LR(e){const t=new URLSearchParams({project:e.project});return e.worker&&t.set("worker",e.worker),`/stream/logs?${t}`}const IR=["error","warn","info","debug"],zR=["error","warn","info"];function BR(){var U,Z;const[e,t]=QE(),n=e.get("project"),a=e.get("worker")??"",[s,o]=M.useState([]),[c,f]=M.useState(!1),[d,h]=M.useState(!0),[y,g]=M.useState(()=>new Set(zR)),[x,v]=M.useState(""),[S,w]=M.useState("live"),[k,_]=M.useState(()=>{const O=new Date(Date.now()-36e5),P=G=>String(G).padStart(2,"0");return`${O.getFullYear()}-${P(O.getMonth()+1)}-${P(O.getDate())}T${P(O.getHours())}:${P(O.getMinutes())}`}),A=M.useRef(null),T=!n,D=lt({queryKey:["projects"],queryFn:_r}),{data:$,refetch:j}=lt({queryKey:["logs",n??"agg",a,S,S==="history"?k:"live"],queryFn:()=>DR({project:n||void 0,worker:a||void 0,limit:S==="history"?2e3:500,since:S==="history"?new Date(k).toISOString():void 0}),refetchInterval:T&&S==="live"?5e3:!1});M.useEffect(()=>{$!=null&&$.data&&o($.data)},[$]),M.useEffect(()=>{if(!n||S!=="live")return;const O=LR({project:n,worker:a||void 0}),P=new EventSource(O);return P.addEventListener("log.line",G=>{if(!c)try{const le=JSON.parse(G.data);o(ae=>{const W=[...ae,le];return W.length>5e3&&W.splice(0,W.length-5e3),W})}catch{}}),()=>P.close()},[n,a,c,S]),M.useEffect(()=>{if(!d)return;const O=A.current;O&&(O.scrollTop=O.scrollHeight)},[s,d]);const q=M.useMemo(()=>{const O=x.toLowerCase();return s.filter(P=>!(!y.has(P.level)||O&&!P.msg.toLowerCase().includes(O)))},[s,y,x]);return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsx("header",{className:"flex items-center justify-between gap-3 flex-wrap",children:m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:"Logs 📜"}),m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[T?`全部项目(${((U=D.data)==null?void 0:U.data.length)??0})`:n,a&&` · worker-${a}`," · ",T&&S==="live"?"5s 轮询":"tail -f"," · ",s.length," lines",c&&m.jsx("span",{className:"text-[var(--color-stuck)] ml-2 font-bold",children:"⏸ PAUSED"})]})]})}),m.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[m.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[m.jsxs("button",{type:"button",onClick:()=>w("live"),"aria-pressed":S==="live",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",S==="live"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[m.jsx(ZE,{size:11,strokeWidth:2.5}),"实时"]}),m.jsxs("button",{type:"button",onClick:()=>w("history"),"aria-pressed":S==="history",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",S==="history"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[m.jsx(ZC,{size:11,strokeWidth:2.5}),"历史"]})]}),S==="history"&&m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"datetime-local",className:"nb-input",style:{padding:"4px 8px",fontSize:12},value:k,onChange:O=>_(O.target.value),"aria-label":"查询起始时间"}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>j(),type:"button","aria-label":"查询",children:[m.jsx(xf,{size:11,strokeWidth:3}),"查询"]})]}),m.jsxs("div",{className:"relative",children:[m.jsx(qC,{size:14,strokeWidth:2.5,className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none text-[var(--color-text)]"}),m.jsxs("select",{className:"nb-input appearance-none pl-9 pr-9 font-[family-name:var(--font-mono)] cursor-pointer",style:{padding:"10px 36px 10px 36px",fontSize:13,minWidth:180},value:n??"",onChange:O=>{const P=O.target.value;t(P?{project:P}:{})},"aria-label":"筛选项目",children:[m.jsx("option",{value:"",children:"全部项目"}),(Z=D.data)==null?void 0:Z.data.map(O=>m.jsx("option",{value:O.name,children:O.name},O.name))]}),m.jsx(yc,{size:14,strokeWidth:3,className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[var(--color-text)]"})]}),m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(xf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"过滤关键字…",value:x,onChange:O=>v(O.target.value),"aria-label":"过滤日志"})]}),m.jsx("div",{className:"flex items-center gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:IR.map(O=>m.jsx(UR,{level:O,enabled:y.has(O),onToggle:()=>{g(P=>{const G=new Set(P);return G.has(O)?G.delete(O):G.add(O),G})}},O))}),m.jsxs("div",{className:"ml-auto flex gap-2",children:[S==="live"&&m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(O=>!O),type:"button",children:d?"✓ Auto-scroll":"Auto-scroll"}),m.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>f(O=>!O),type:"button",children:c?m.jsxs(m.Fragment,{children:[m.jsx(Kp,{size:12,strokeWidth:3})," Resume"]}):m.jsxs(m.Fragment,{children:[m.jsx(cA,{size:12,strokeWidth:3})," Pause"]})})]}),m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>{const O=new Blob([q.map(le=>le.raw).join(`
|
|
480
480
|
`)],{type:"text/plain"}),P=URL.createObjectURL(O),G=document.createElement("a");G.href=P,G.download=`${n}-log-${Date.now()}.log`,G.click(),URL.revokeObjectURL(P)},type:"button",children:[m.jsx(XE,{size:12,strokeWidth:2.5})," Export"]})]})]}),m.jsxs("div",{className:"nb-card p-0 overflow-hidden",children:[m.jsxs("div",{className:"px-4 py-2 bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)] flex items-center justify-between font-[family-name:var(--font-mono)] text-xs",children:[m.jsx("span",{className:"text-[var(--color-text-muted)]",children:($==null?void 0:$.file)??"~/.coral/projects/.../logs/*.log"}),S==="live"?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"live"}):m.jsx("span",{className:"nb-status",style:{background:"var(--color-accent-purple)",color:"var(--color-text)"},children:"history"})]}),m.jsxs("div",{ref:A,className:"overflow-auto font-[family-name:var(--font-mono)] text-[12px] leading-[22px] max-h-[70vh] bg-[var(--color-bg)] p-2",onScroll:O=>{const P=O.currentTarget;!(P.scrollHeight-P.scrollTop-P.clientHeight<40)&&d&&h(!1)},children:[q.map((O,P)=>m.jsx(FR,{line:O},P)),q.length===0&&m.jsx("div",{className:"text-center py-12 text-[var(--color-text-subtle)]",children:"没有匹配的日志"})]})]})]})}function UR({level:e,enabled:t,onToggle:n}){const a={error:"var(--color-crashed-bg)",warn:"var(--color-stuck-bg)",info:"var(--color-secondary)",debug:"var(--color-accent-purple)"},s={error:"var(--color-crashed)",warn:"var(--color-stuck)",info:"var(--color-text)",debug:"var(--color-text)"};return m.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:["px-3 py-0.5 rounded-full font-[family-name:var(--font-mono)] text-[10px] font-bold tracking-widest cursor-pointer",t?"border-[1.5px] border-[var(--color-text)]":"text-[var(--color-text-subtle)]"].join(" "),style:t?{background:a[e],color:s[e]}:{},children:e.toUpperCase()})}function FR({line:e}){var a;const t={error:"bg-[var(--color-crashed)] text-[var(--color-text)]",warn:"bg-[var(--color-stuck)] text-[var(--color-text)]",info:"bg-[var(--color-secondary)] text-[var(--color-text)]",debug:"",trace:""},n=!!e.project;return m.jsxs("div",{className:["grid gap-2 px-2 py-0.5 rounded hover:bg-[var(--color-bg-cream)]",n?"grid-cols-[100px_90px_60px_1fr]":"grid-cols-[100px_60px_1fr]"].join(" "),children:[m.jsx("span",{className:"text-[var(--color-text-subtle)] whitespace-nowrap",children:e.ts?((a=e.ts.split("T")[1])==null?void 0:a.replace("Z",""))??e.ts:"--"}),n&&m.jsx("span",{className:"truncate text-[var(--color-text-muted)] font-bold",title:e.project,children:e.project}),m.jsx("span",{className:`text-center font-bold ${t[e.level]??""}`,style:{borderRadius:4,padding:"0 6px"},children:e.level.toUpperCase()}),m.jsx("span",{className:"truncate text-[var(--color-text)]",children:e.msg})]})}function $R(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const PR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,HR={};function t0(e,t){return(HR.jsx?qR:PR).test(e)}const KR=/[ \t\n\f\r]/g;function GR(e){return typeof e=="object"?e.type==="text"?n0(e.value):!1:n0(e)}function n0(e){return e.replace(KR,"")===""}class Sc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Sc.prototype.normal={};Sc.prototype.property={};Sc.prototype.space=void 0;function lS(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Sc(n,a,t)}function hp(e){return e.toLowerCase()}class Hn{constructor(t,n){this.attribute=n,this.property=t}}Hn.prototype.attribute="";Hn.prototype.booleanish=!1;Hn.prototype.boolean=!1;Hn.prototype.commaOrSpaceSeparated=!1;Hn.prototype.commaSeparated=!1;Hn.prototype.defined=!1;Hn.prototype.mustUseProperty=!1;Hn.prototype.number=!1;Hn.prototype.overloadedBoolean=!1;Hn.prototype.property="";Hn.prototype.spaceSeparated=!1;Hn.prototype.space=void 0;let QR=0;const Pe=ps(),Zt=ps(),mp=ps(),fe=ps(),St=ps(),pl=ps(),ti=ps();function ps(){return 2**++QR}const pp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:Zt,commaOrSpaceSeparated:ti,commaSeparated:pl,number:fe,overloadedBoolean:mp,spaceSeparated:St},Symbol.toStringTag,{value:"Module"})),Em=Object.keys(pp);class fg extends Hn{constructor(t,n,a,s){let o=-1;if(super(t,n),i0(this,"space",s),typeof a=="number")for(;++o<Em.length;){const c=Em[o];i0(this,Em[o],(a&pp[c])===pp[c])}}}fg.prototype.defined=!0;function i0(e,t,n){n&&(e[t]=n)}function Hl(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new fg(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[hp(a)]=a,n[hp(o.attribute)]=a}return new Sc(t,n,e.space)}const oS=Hl({properties:{ariaActiveDescendant:null,ariaAtomic:Zt,ariaAutoComplete:null,ariaBusy:Zt,ariaChecked:Zt,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:St,ariaCurrent:null,ariaDescribedBy:St,ariaDetails:null,ariaDisabled:Zt,ariaDropEffect:St,ariaErrorMessage:null,ariaExpanded:Zt,ariaFlowTo:St,ariaGrabbed:Zt,ariaHasPopup:null,ariaHidden:Zt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:St,ariaLevel:fe,ariaLive:null,ariaModal:Zt,ariaMultiLine:Zt,ariaMultiSelectable:Zt,ariaOrientation:null,ariaOwns:St,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:Zt,ariaReadOnly:Zt,ariaRelevant:null,ariaRequired:Zt,ariaRoleDescription:St,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:Zt,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cS(e,t){return t in e?e[t]:t}function uS(e,t){return cS(e,t.toLowerCase())}const YR=Hl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pl,acceptCharset:St,accessKey:St,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:St,autoFocus:Pe,autoPlay:Pe,blocking:St,capture:null,charSet:null,checked:Pe,cite:null,className:St,cols:fe,colSpan:null,content:null,contentEditable:Zt,controls:Pe,controlsList:St,coords:fe|pl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:mp,draggable:Zt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:St,height:fe,hidden:mp,high:fe,href:null,hrefLang:null,htmlFor:St,httpEquiv:St,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:St,itemRef:St,itemScope:Pe,itemType:St,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Pe,optimum:fe,pattern:null,ping:St,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:St,required:Pe,reversed:Pe,rows:fe,rowSpan:fe,sandbox:St,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:Zt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Pe,useMap:null,value:Zt,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:St,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:Zt,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:uS}),VR=Hl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ti,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:St,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Pe,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:pl,g2:pl,glyphName:pl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:ti,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:fe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:St,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ti,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ti,rev:ti,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ti,requiredFeatures:ti,requiredFonts:ti,requiredFormats:ti,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:ti,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ti,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ti,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cS}),fS=Hl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dS=Hl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uS}),hS=Hl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),XR={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ZR=/[A-Z]/g,a0=/-[a-z]/g,WR=/^data[-\w.:]+$/i;function JR(e,t){const n=hp(t);let a=t,s=Hn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&WR.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(a0,tM);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!a0.test(o)){let c=o.replace(ZR,eM);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}s=fg}return new s(a,t)}function eM(e){return"-"+e.toLowerCase()}function tM(e){return e.charAt(1).toUpperCase()}const nM=lS([oS,YR,fS,dS,hS],"html"),dg=lS([oS,VR,fS,dS,hS],"svg");function iM(e){return e.join(" ").trim()}var al={},Sm,r0;function aM(){if(r0)return Sm;r0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,d=`
|
|
481
|
-
`,h="/",y="*",g="",x="comment",v="declaration";function S(k,_){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];_=_||{};var A=1,T=1;function D(ae){var W=ae.match(t);W&&(A+=W.length);var K=ae.lastIndexOf(d);T=~K?ae.length-K:T+ae.length}function $(){var ae={line:A,column:T};return function(W){return W.position=new j(ae),Z(),W}}function j(ae){this.start=ae,this.end={line:A,column:T},this.source=_.source}j.prototype.content=k;function q(ae){var W=new Error(_.source+":"+A+":"+T+": "+ae);if(W.reason=ae,W.filename=_.source,W.line=A,W.column=T,W.source=k,!_.silent)throw W}function U(ae){var W=ae.exec(k);if(W){var K=W[0];return D(K),k=k.slice(K.length),W}}function Z(){U(n)}function O(ae){var W;for(ae=ae||[];W=P();)W!==!1&&ae.push(W);return ae}function P(){var ae=$();if(!(h!=k.charAt(0)||y!=k.charAt(1))){for(var W=2;g!=k.charAt(W)&&(y!=k.charAt(W)||h!=k.charAt(W+1));)++W;if(W+=2,g===k.charAt(W-1))return q("End of comment missing");var K=k.slice(2,W-2);return T+=2,D(K),k=k.slice(W),T+=2,ae({type:x,comment:K})}}function G(){var ae=$(),W=U(a);if(W){if(P(),!U(s))return q("property missing ':'");var K=U(o),oe=ae({type:v,property:w(W[0].replace(e,g)),value:K?w(K[0].replace(e,g)):g});return U(c),oe}}function le(){var ae=[];O(ae);for(var W;W=G();)W!==!1&&(ae.push(W),O(ae));return ae}return Z(),le()}function w(k){return k?k.replace(f,g):g}return Sm=S,Sm}var s0;function rM(){if(s0)return al;s0=1;var e=al&&al.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(al,"__esModule",{value:!0}),al.default=n;const t=e(aM());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof s=="function";return c.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:y}=d;f?s(h,y,d):y&&(o=o||{},o[h]=y)}),o}return al}var Ko={},l0;function sM(){if(l0)return Ko;l0=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},d=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(s,f):h=h.replace(a,f),h.replace(t,c))};return Ko.camelCase=d,Ko}var Go,o0;function lM(){if(o0)return Go;o0=1;var e=Go&&Go.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(rM()),n=sM();function a(s,o){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(f,d){f&&d&&(c[(0,n.camelCase)(f,o)]=d)}),c}return a.default=a,Go=a,Go}var oM=lM();const cM=Np(oM),mS=pS("end"),hg=pS("start");function pS(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function uM(e){const t=hg(e),n=mS(e);if(t&&n)return{start:t,end:n}}function Jo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?c0(e.position):"start"in e||"end"in e?c0(e):"line"in e||"column"in e?gp(e):""}function gp(e){return u0(e&&e.line)+":"+u0(e&&e.column)}function c0(e){return gp(e&&e.start)+"-"+gp(e&&e.end)}function u0(e){return e&&typeof e=="number"?e:1}class bn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(c=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const d=a.indexOf(":");d===-1?o.ruleId=a:(o.source=a.slice(0,d),o.ruleId=a.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Jo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}bn.prototype.file="";bn.prototype.name="";bn.prototype.reason="";bn.prototype.message="";bn.prototype.stack="";bn.prototype.column=void 0;bn.prototype.line=void 0;bn.prototype.ancestors=void 0;bn.prototype.cause=void 0;bn.prototype.fatal=void 0;bn.prototype.place=void 0;bn.prototype.ruleId=void 0;bn.prototype.source=void 0;const mg={}.hasOwnProperty,fM=new Map,dM=/[A-Z]/g,hM=new Set(["table","tbody","thead","tfoot","tr"]),mM=new Set(["td","th"]),gS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pM(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=wM(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=SM(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?dg:nM,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bS(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function bS(e,t,n){if(t.type==="element")return gM(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bM(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return xM(e,t,n);if(t.type==="mdxjsEsm")return yM(e,t);if(t.type==="root")return vM(e,t,n);if(t.type==="text")return EM(e,t)}function gM(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=dg,e.schema=s),e.ancestors.push(t);const o=xS(e,t.tagName,!1),c=_M(e,t);let f=gg(e,t);return hM.has(t.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!GR(d):!0})),yS(e,c,o,t),pg(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function bM(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}cc(e,t.position)}function yM(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cc(e,t.position)}function xM(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=dg,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:xS(e,t.name,!0),c=kM(e,t),f=gg(e,t);return yS(e,c,o,t),pg(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function vM(e,t,n){const a={};return pg(a,gg(e,t)),e.create(t,e.Fragment,a,n)}function EM(e,t){return t.value}function yS(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function pg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function SM(e,t,n){return a;function a(s,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function wM(e,t){return n;function n(a,s,o,c){const f=Array.isArray(o.children),d=hg(a);return t(s,o,c,f,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function _M(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&mg.call(t.properties,s)){const o=NM(e,s,t.properties[s]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&mM.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function kM(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else cc(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else cc(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function gg(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:fM;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const h=s.get(d)||0;c=d+"-"+h,s.set(d,h+1)}}const f=bS(e,o,c);f!==void 0&&n.push(f)}return n}function NM(e,t,n){const a=JR(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?$R(n):iM(n)),a.property==="style"){let s=typeof n=="object"?n:TM(e,String(n));return e.stylePropertyNameCase==="css"&&(s=CM(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?XR[a.property]||a.property:a.attribute,n]}}function TM(e,t){try{return cM(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new bn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=gS+"#cannot-parse-style-attribute",s}}function xS(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,c;for(;++o<s.length;){const f=t0(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=t0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return mg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);cc(e)}function cc(e,t){const n=new bn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=gS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function CM(e){const t={};let n;for(n in e)mg.call(e,n)&&(t[AM(n)]=e[n]);return t}function AM(e){let t=e.replace(dM,OM);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function OM(e){return"-"+e.toLowerCase()}const wm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},RM={};function bg(e,t){const n=RM,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vS(e,a,s)}function vS(e,t,n){if(MM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return f0(e.children,t,n)}return Array.isArray(e)?f0(e,t,n):""}function f0(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=vS(e[s],t,n);return a.join("")}function MM(e){return!!(e&&typeof e=="object")}const d0=document.createElement("i");function yg(e){const t="&"+e+";";d0.innerHTML=t;const n=d0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ai(e,t,n,a){const s=e.length;let o=0,c;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function xi(e,t){return e.length>0?(ai(e,e.length,0,t),e):t}const h0={}.hasOwnProperty;function ES(e){const t={};let n=-1;for(;++n<e.length;)jM(t,e[n]);return t}function jM(e,t){let n;for(n in t){const s=(h0.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){h0.call(s,c)||(s[c]=[]);const f=o[c];DM(s[c],Array.isArray(f)?f:f?[f]:[])}}}function DM(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ai(e,0,0,a)}function SS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tn=kr(/[A-Za-z]/),pn=kr(/[\dA-Za-z]/),LM=kr(/[#-'*+\--9=?A-Z^-~]/);function _f(e){return e!==null&&(e<32||e===127)}const bp=kr(/\d/),IM=kr(/[\dA-Fa-f]/),zM=kr(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const Vf=kr(new RegExp("\\p{P}|\\p{S}","u")),fs=kr(/\s/);function kr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kl(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&pn(e.charCodeAt(n+1))&&pn(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),s=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+s+1,c=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function tt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(d){return Ye(d)?(e.enter(n),f(d)):t(d)}function f(d){return Ye(d)&&o++<s?(e.consume(d),f):(e.exit(n),t(d))}}const BM={tokenize:UM};function UM(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),tt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ae(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const FM={tokenize:$M},m0={tokenize:PM};function $M(e){const t=this,n=[];let a=0,s,o,c;return f;function f(T){if(a<n.length){const D=n[a];return t.containerState=D[1],e.attempt(D[0].continuation,d,h)(T)}return h(T)}function d(T){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const D=t.events.length;let $=D,j;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){j=t.events[$][1].end;break}_(a);let q=D;for(;q<t.events.length;)t.events[q][1].end={...j},q++;return ai(t.events,$+1,0,t.events.slice(D)),t.events.length=q,h(T)}return f(T)}function h(T){if(a===n.length){if(!s)return x(T);if(s.currentConstruct&&s.currentConstruct.concrete)return S(T);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(m0,y,g)(T)}function y(T){return s&&A(),_(a),x(T)}function g(T){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,S(T)}function x(T){return t.containerState={},e.attempt(m0,v,S)(T)}function v(T){return a++,n.push([t.currentConstruct,t.containerState]),x(T)}function S(T){if(T===null){s&&A(),_(0),e.consume(T);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),w(T)}function w(T){if(T===null){k(e.exit("chunkFlow"),!0),_(0),e.consume(T);return}return Ae(T)?(e.consume(T),k(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(T),w)}function k(T,D){const $=t.sliceStream(T);if(D&&$.push(null),T.previous=o,o&&(o.next=T),o=T,s.defineSkip(T.start),s.write($),t.parser.lazy[T.start.line]){let j=s.events.length;for(;j--;)if(s.events[j][1].start.offset<c&&(!s.events[j][1].end||s.events[j][1].end.offset>c))return;const q=t.events.length;let U=q,Z,O;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(Z){O=t.events[U][1].end;break}Z=!0}for(_(a),j=q;j<t.events.length;)t.events[j][1].end={...O},j++;ai(t.events,U+1,0,t.events.slice(q)),t.events.length=j}}function _(T){let D=n.length;for(;D-- >T;){const $=n[D];t.containerState=$[1],$[0].exit.call(t,e)}n.length=T}function A(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function PM(e,t,n){return tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rl(e){if(e===null||xt(e)||fs(e))return 1;if(Vf(e))return 2}function Xf(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const yp={name:"attention",resolveAll:qM,tokenize:HM};function qM(e,t){let n=-1,a,s,o,c,f,d,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},x={...e[n][1].start};p0(g,-d),p0(x,d),c={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:d>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=xi(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=xi(h,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=xi(h,Xf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=xi(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=xi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,ai(e,a-1,n-a+3,h),n=a+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function HM(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Rl(a);let o;return c;function c(d){return o=d,e.enter("attentionSequence"),f(d)}function f(d){if(d===o)return e.consume(d),f;const h=e.exit("attentionSequence"),y=Rl(d),g=!y||y===2&&s||n.includes(d),x=!s||s===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(s||!x)),h._close=!!(o===42?x:x&&(y||!g)),t(d)}}function p0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const KM={name:"autolink",tokenize:GM};function GM(e,t,n){let a=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return Tn(v)?(e.consume(v),c):v===64?n(v):h(v)}function c(v){return v===43||v===45||v===46||pn(v)?(a=1,f(v)):h(v)}function f(v){return v===58?(e.consume(v),a=0,d):(v===43||v===45||v===46||pn(v))&&a++<32?(e.consume(v),f):(a=0,h(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||_f(v)?n(v):(e.consume(v),d)}function h(v){return v===64?(e.consume(v),y):LM(v)?(e.consume(v),h):n(v)}function y(v){return pn(v)?g(v):n(v)}function g(v){return v===46?(e.consume(v),a=0,y):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):x(v)}function x(v){if((v===45||pn(v))&&a++<63){const S=v===45?x:g;return e.consume(v),S}return n(v)}}const wc={partial:!0,tokenize:QM};function QM(e,t,n){return a;function a(o){return Ye(o)?tt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Ae(o)?t(o):n(o)}}const wS={continuation:{tokenize:VM},exit:XM,name:"blockQuote",tokenize:YM};function YM(e,t,n){const a=this;return s;function s(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return Ye(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function VM(e,t,n){const a=this;return s;function s(c){return Ye(c)?tt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(wS,t,n)(c)}}function XM(e){e.exit("blockQuote")}const _S={name:"characterEscape",tokenize:ZM};function ZM(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return zM(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const kS={name:"characterReference",tokenize:WM};function WM(e,t,n){const a=this;let s=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=pn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=IM,y):(e.enter("characterReferenceValue"),o=7,c=bp,y(g))}function y(g){if(g===59&&s){const x=e.exit("characterReferenceValue");return c===pn&&!yg(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&s++<o?(e.consume(g),y):n(g)}}const g0={partial:!0,tokenize:ej},b0={concrete:!0,name:"codeFenced",tokenize:JM};function JM(e,t,n){const a=this,s={partial:!0,tokenize:$};let o=0,c=0,f;return d;function d(j){return h(j)}function h(j){const q=a.events[a.events.length-1];return o=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,f=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(j)}function y(j){return j===f?(c++,e.consume(j),y):c<3?n(j):(e.exit("codeFencedFenceSequence"),Ye(j)?tt(e,g,"whitespace")(j):g(j))}function g(j){return j===null||Ae(j)?(e.exit("codeFencedFence"),a.interrupt?t(j):e.check(g0,w,D)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(j)):Ye(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,v,"whitespace")(j)):j===96&&j===f?n(j):(e.consume(j),x)}function v(j){return j===null||Ae(j)?g(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(j))}function S(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(j)):j===96&&j===f?n(j):(e.consume(j),S)}function w(j){return e.attempt(s,D,k)(j)}function k(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),_}function _(j){return o>0&&Ye(j)?tt(e,A,"linePrefix",o+1)(j):A(j)}function A(j){return j===null||Ae(j)?e.check(g0,w,D)(j):(e.enter("codeFlowValue"),T(j))}function T(j){return j===null||Ae(j)?(e.exit("codeFlowValue"),A(j)):(e.consume(j),T)}function D(j){return e.exit("codeFenced"),t(j)}function $(j,q,U){let Z=0;return O;function O(W){return j.enter("lineEnding"),j.consume(W),j.exit("lineEnding"),P}function P(W){return j.enter("codeFencedFence"),Ye(W)?tt(j,G,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):G(W)}function G(W){return W===f?(j.enter("codeFencedFenceSequence"),le(W)):U(W)}function le(W){return W===f?(Z++,j.consume(W),le):Z>=c?(j.exit("codeFencedFenceSequence"),Ye(W)?tt(j,ae,"whitespace")(W):ae(W)):U(W)}function ae(W){return W===null||Ae(W)?(j.exit("codeFencedFence"),q(W)):U(W)}}}function ej(e,t,n){const a=this;return s;function s(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const _m={name:"codeIndented",tokenize:nj},tj={partial:!0,tokenize:ij};function nj(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),tt(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?d(h):Ae(h)?e.attempt(tj,c,d)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Ae(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function d(h){return e.exit("codeIndented"),t(h)}}function ij(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):tt(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Ae(c)?s(c):n(c)}}const aj={name:"codeText",previous:sj,resolve:rj,tokenize:lj};function rj(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function sj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function lj(e,t,n){let a=0,s,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),s=0,y(g)):Ae(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Ae(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),s++,y):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class oj{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Qo(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Qo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Qo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qo(this.left,n.reverse())}}}function Qo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function NS(e){const t={};let n=-1,a,s,o,c,f,d,h;const y=new oj(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(a=y.get(n),n&&a[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(d=a[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,cj(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...y.get(s)[1].start},f=y.slice(s,n),f.unshift(a),y.splice(s,n-s+1,f))}}return ai(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function cj(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,d=[],h={};let y,g,x=-1,v=n,S=0,w=0;const k=[w];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(y=a.sliceStream(v),v.next||y.push(null),g&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=n;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(w=x+1,k.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):k.pop(),x=k.length;x--;){const _=f.slice(k[x],k[x+1]),A=o.pop();d.push([A,A+_.length-1]),e.splice(A,2,_)}for(d.reverse(),x=-1;++x<d.length;)h[S+d[x][0]]=S+d[x][1],S+=d[x][1]-d[x][0]-1;return h}const uj={resolve:dj,tokenize:hj},fj={partial:!0,tokenize:mj};function dj(e){return NS(e),e}function hj(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):Ae(f)?e.check(fj,c,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function mj(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),tt(e,o,"linePrefix")}function o(c){if(c===null||Ae(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function TS(e,t,n,a,s,o,c,f,d){const h=d||Number.POSITIVE_INFINITY;let y=0;return g;function g(_){return _===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(_),e.exit(o),x):_===null||_===32||_===41||_f(_)?n(_):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),w(_))}function x(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Ae(_)?n(_):(e.consume(_),_===92?S:v)}function S(_){return _===60||_===62||_===92?(e.consume(_),v):v(_)}function w(_){return!y&&(_===null||_===41||xt(_))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(_)):y<h&&_===40?(e.consume(_),y++,w):_===41?(e.consume(_),y--,w):_===null||_===32||_===40||_f(_)?n(_):(e.consume(_),_===92?k:w)}function k(_){return _===40||_===41||_===92?(e.consume(_),w):w(_)}}function CS(e,t,n,a,s,o){const c=this;let f=0,d;return h;function h(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(o),y}function y(v){return f>999||v===null||v===91||v===93&&!d||v===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):Ae(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Ae(v)||f++>999?(e.exit("chunkString"),y(v)):(e.consume(v),d||(d=!Ye(v)),v===92?x:g)}function x(v){return v===91||v===92||v===93?(e.consume(v),f++,g):g(v)}}function AS(e,t,n,a,s,o){let c;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),c=x===40?41:x,d):n(x)}function d(x){return x===c?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===c?(e.exit(o),d(c)):x===null?n(x):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),tt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===c||x===null||Ae(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:y)}function g(x){return x===c||x===92?(e.consume(x),y):y(x)}}function ec(e,t){let n;return a;function a(s){return Ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Ye(s)?tt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const pj={name:"definition",tokenize:bj},gj={partial:!0,tokenize:yj};function bj(e,t,n){const a=this;let s;return o;function o(v){return e.enter("definition"),c(v)}function c(v){return CS.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=Mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return xt(v)?ec(e,h)(v):h(v)}function h(v){return TS(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return e.attempt(gj,g,g)(v)}function g(v){return Ye(v)?tt(e,x,"whitespace")(v):x(v)}function x(v){return v===null||Ae(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function yj(e,t,n){return a;function a(f){return xt(f)?ec(e,s)(f):n(f)}function s(f){return AS(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Ye(f)?tt(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ae(f)?t(f):n(f)}}const xj={name:"hardBreakEscape",tokenize:vj};function vj(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Ae(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Ej={name:"headingAtx",resolve:Sj,tokenize:wj};function Sj(e,t){let n=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},ai(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function wj(e,t,n){let a=0;return s;function s(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||xt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),d(y)):y===null||Ae(y)?(e.exit("atxHeading"),t(y)):Ye(y)?tt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function d(y){return y===35?(e.consume(y),d):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||xt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const _j=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],y0=["pre","script","style","textarea"],kj={concrete:!0,name:"htmlFlow",resolveTo:Cj,tokenize:Aj},Nj={partial:!0,tokenize:Rj},Tj={partial:!0,tokenize:Oj};function Cj(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Aj(e,t,n){const a=this;let s,o,c,f,d;return h;function h(C){return y(C)}function y(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),g}function g(C){return C===33?(e.consume(C),x):C===47?(e.consume(C),o=!0,w):C===63?(e.consume(C),s=3,a.interrupt?t:R):Tn(C)?(e.consume(C),c=String.fromCharCode(C),k):n(C)}function x(C){return C===45?(e.consume(C),s=2,v):C===91?(e.consume(C),s=5,f=0,S):Tn(C)?(e.consume(C),s=4,a.interrupt?t:R):n(C)}function v(C){return C===45?(e.consume(C),a.interrupt?t:R):n(C)}function S(C){const me="CDATA[";return C===me.charCodeAt(f++)?(e.consume(C),f===me.length?a.interrupt?t:G:S):n(C)}function w(C){return Tn(C)?(e.consume(C),c=String.fromCharCode(C),k):n(C)}function k(C){if(C===null||C===47||C===62||xt(C)){const me=C===47,_e=c.toLowerCase();return!me&&!o&&y0.includes(_e)?(s=1,a.interrupt?t(C):G(C)):_j.includes(c.toLowerCase())?(s=6,me?(e.consume(C),_):a.interrupt?t(C):G(C)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(C):o?A(C):T(C))}return C===45||pn(C)?(e.consume(C),c+=String.fromCharCode(C),k):n(C)}function _(C){return C===62?(e.consume(C),a.interrupt?t:G):n(C)}function A(C){return Ye(C)?(e.consume(C),A):O(C)}function T(C){return C===47?(e.consume(C),O):C===58||C===95||Tn(C)?(e.consume(C),D):Ye(C)?(e.consume(C),T):O(C)}function D(C){return C===45||C===46||C===58||C===95||pn(C)?(e.consume(C),D):$(C)}function $(C){return C===61?(e.consume(C),j):Ye(C)?(e.consume(C),$):T(C)}function j(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),d=C,q):Ye(C)?(e.consume(C),j):U(C)}function q(C){return C===d?(e.consume(C),d=null,Z):C===null||Ae(C)?n(C):(e.consume(C),q)}function U(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?$(C):(e.consume(C),U)}function Z(C){return C===47||C===62||Ye(C)?T(C):n(C)}function O(C){return C===62?(e.consume(C),P):n(C)}function P(C){return C===null||Ae(C)?G(C):Ye(C)?(e.consume(C),P):n(C)}function G(C){return C===45&&s===2?(e.consume(C),K):C===60&&s===1?(e.consume(C),oe):C===62&&s===4?(e.consume(C),L):C===63&&s===3?(e.consume(C),R):C===93&&s===5?(e.consume(C),pe):Ae(C)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Nj,J,le)(C)):C===null||Ae(C)?(e.exit("htmlFlowData"),le(C)):(e.consume(C),G)}function le(C){return e.check(Tj,ae,J)(C)}function ae(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return C===null||Ae(C)?le(C):(e.enter("htmlFlowData"),G(C))}function K(C){return C===45?(e.consume(C),R):G(C)}function oe(C){return C===47?(e.consume(C),c="",V):G(C)}function V(C){if(C===62){const me=c.toLowerCase();return y0.includes(me)?(e.consume(C),L):G(C)}return Tn(C)&&c.length<8?(e.consume(C),c+=String.fromCharCode(C),V):G(C)}function pe(C){return C===93?(e.consume(C),R):G(C)}function R(C){return C===62?(e.consume(C),L):C===45&&s===2?(e.consume(C),R):G(C)}function L(C){return C===null||Ae(C)?(e.exit("htmlFlowData"),J(C)):(e.consume(C),L)}function J(C){return e.exit("htmlFlow"),t(C)}}function Oj(e,t,n){const a=this;return s;function s(c){return Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function Rj(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(wc,t,n)}}const Mj={name:"htmlText",tokenize:jj};function jj(e,t,n){const a=this;let s,o,c;return f;function f(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),$):R===63?(e.consume(R),T):Tn(R)?(e.consume(R),U):n(R)}function h(R){return R===45?(e.consume(R),y):R===91?(e.consume(R),o=0,S):Tn(R)?(e.consume(R),A):n(R)}function y(R){return R===45?(e.consume(R),v):n(R)}function g(R){return R===null?n(R):R===45?(e.consume(R),x):Ae(R)?(c=g,oe(R)):(e.consume(R),g)}function x(R){return R===45?(e.consume(R),v):g(R)}function v(R){return R===62?K(R):R===45?x(R):g(R)}function S(R){const L="CDATA[";return R===L.charCodeAt(o++)?(e.consume(R),o===L.length?w:S):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),k):Ae(R)?(c=w,oe(R)):(e.consume(R),w)}function k(R){return R===93?(e.consume(R),_):w(R)}function _(R){return R===62?K(R):R===93?(e.consume(R),_):w(R)}function A(R){return R===null||R===62?K(R):Ae(R)?(c=A,oe(R)):(e.consume(R),A)}function T(R){return R===null?n(R):R===63?(e.consume(R),D):Ae(R)?(c=T,oe(R)):(e.consume(R),T)}function D(R){return R===62?K(R):T(R)}function $(R){return Tn(R)?(e.consume(R),j):n(R)}function j(R){return R===45||pn(R)?(e.consume(R),j):q(R)}function q(R){return Ae(R)?(c=q,oe(R)):Ye(R)?(e.consume(R),q):K(R)}function U(R){return R===45||pn(R)?(e.consume(R),U):R===47||R===62||xt(R)?Z(R):n(R)}function Z(R){return R===47?(e.consume(R),K):R===58||R===95||Tn(R)?(e.consume(R),O):Ae(R)?(c=Z,oe(R)):Ye(R)?(e.consume(R),Z):K(R)}function O(R){return R===45||R===46||R===58||R===95||pn(R)?(e.consume(R),O):P(R)}function P(R){return R===61?(e.consume(R),G):Ae(R)?(c=P,oe(R)):Ye(R)?(e.consume(R),P):Z(R)}function G(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),s=R,le):Ae(R)?(c=G,oe(R)):Ye(R)?(e.consume(R),G):(e.consume(R),ae)}function le(R){return R===s?(e.consume(R),s=void 0,W):R===null?n(R):Ae(R)?(c=le,oe(R)):(e.consume(R),le)}function ae(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||xt(R)?Z(R):(e.consume(R),ae)}function W(R){return R===47||R===62||xt(R)?Z(R):n(R)}function K(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function oe(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),V}function V(R){return Ye(R)?tt(e,pe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):pe(R)}function pe(R){return e.enter("htmlTextData"),c(R)}}const xg={name:"labelEnd",resolveAll:zj,resolveTo:Bj,tokenize:Uj},Dj={tokenize:Fj},Lj={tokenize:$j},Ij={tokenize:Pj};function zj(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&ai(e,0,e.length,n),e}function Bj(e,t){let n=e.length,a=0,s,o,c,f;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(c=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",d,t],["enter",h,t]],f=xi(f,e.slice(o+1,o+a+3)),f=xi(f,[["enter",y,t]]),f=xi(f,Xf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=xi(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=xi(f,e.slice(c+1)),f=xi(f,[["exit",d,t]]),ai(e,o,e.length,f),e}function Uj(e,t,n){const a=this;let s=a.events.length,o,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return f;function f(x){return o?o._inactive?g(x):(c=a.parser.defined.includes(Mi(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),d):n(x)}function d(x){return x===40?e.attempt(Dj,y,c?y:g)(x):x===91?e.attempt(Lj,y,c?h:g)(x):c?y(x):g(x)}function h(x){return e.attempt(Ij,y,g)(x)}function y(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function Fj(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return xt(g)?ec(e,o)(g):o(g)}function o(g){return g===41?y(g):TS(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return xt(g)?ec(e,d)(g):y(g)}function f(g){return n(g)}function d(g){return g===34||g===39||g===40?AS(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return xt(g)?ec(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function $j(e,t,n){const a=this;return s;function s(f){return CS.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function Pj(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const qj={name:"labelStartImage",resolveAll:xg.resolveAll,tokenize:Hj};function Hj(e,t,n){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const Kj={name:"labelStartLink",resolveAll:xg.resolveAll,tokenize:Gj};function Gj(e,t,n){const a=this;return s;function s(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const km={name:"lineEnding",tokenize:Qj};function Qj(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),tt(e,t,"linePrefix")}}const mf={name:"thematicBreak",tokenize:Yj};function Yj(e,t,n){let a=0,s;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return s=h,f(h)}function f(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):a>=3&&(h===null||Ae(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),a++,d):(e.exit("thematicBreakSequence"),Ye(h)?tt(e,f,"whitespace")(h):f(h))}}const Bn={continuation:{tokenize:Wj},exit:eD,name:"list",tokenize:Zj},Vj={partial:!0,tokenize:tD},Xj={partial:!0,tokenize:Jj};function Zj(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return f;function f(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:bp(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(mf,n,h)(v):h(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return bp(v)&&++c<10?(e.consume(v),d):(!a.interrupt||c<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),h(v)):n(v)}function h(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(wc,a.interrupt?n:y,e.attempt(Vj,x,g))}function y(v){return a.containerState.initialBlankLine=!0,o++,x(v)}function g(v){return Ye(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x):n(v)}function x(v){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Wj(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(wc,s,o);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,tt(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Ye(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(Xj,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,tt(e,e.attempt(Bn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function Jj(e,t,n){const a=this;return tt(e,s,"listItemIndent",a.containerState.size+1);function s(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function eD(e){e.exit(this.containerState.type)}function tD(e,t,n){const a=this;return tt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const c=a.events[a.events.length-1];return!Ye(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const x0={name:"setextUnderline",resolveTo:nD,tokenize:iD};function nD(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function iD(e,t,n){const a=this;let s;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===s?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Ye(h)?tt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ae(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const aD={tokenize:rD};function rD(e){const t=this,n=e.attempt(wc,a,e.attempt(this.parser.constructs.flowInitial,s,tt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(uj,s)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sD={resolveAll:RS()},lD=OS("string"),oD=OS("text");function OS(e){return{resolveAll:RS(e==="text"?cD:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,c,f);return c;function c(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),d}function d(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),d)}function h(y){if(y===null)return!0;const g=s[y];let x=-1;if(g)for(;++x<g.length;){const v=g[x];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function RS(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function cD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let o=s.length,c=-1,f=0,d;for(;o--;){const h=s[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)d=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const uD={42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:wS},fD={91:pj},dD={[-2]:_m,[-1]:_m,32:_m},hD={35:Ej,42:mf,45:[x0,mf],60:kj,61:x0,95:mf,96:b0,126:b0},mD={38:kS,92:_S},pD={[-5]:km,[-4]:km,[-3]:km,33:qj,38:kS,42:yp,60:[KM,Mj],91:Kj,92:[xj,_S],93:xg,95:yp,96:aj},gD={null:[yp,sD]},bD={null:[42,95]},yD={null:[]},xD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bD,contentInitial:fD,disable:yD,document:uD,flow:hD,flowInitial:dD,insideSpan:gD,string:mD,text:pD},Symbol.toStringTag,{value:"Module"}));function vD(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let c=[],f=[];const d={attempt:q($),check:q(j),consume:A,enter:T,exit:D,interrupt:q(j,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:v,write:g};let y=t.tokenize.call(h,d);return t.resolveAll&&o.push(t),h;function g(P){return c=xi(c,P),k(),c[c.length-1]!==null?[]:(U(t,0),h.events=Xf(o,h.events,h),h.events)}function x(P,G){return SD(v(P),G)}function v(P){return ED(c,P)}function S(){const{_bufferIndex:P,_index:G,line:le,column:ae,offset:W}=a;return{_bufferIndex:P,_index:G,line:le,column:ae,offset:W}}function w(P){s[P.line]=P.column,O()}function k(){let P;for(;a._index<c.length;){const G=c[a._index];if(typeof G=="string")for(P=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===P&&a._bufferIndex<G.length;)_(G.charCodeAt(a._bufferIndex));else _(G)}}function _(P){y=y(P)}function A(P){Ae(P)?(a.line++,a.column=1,a.offset+=P===-3?2:1,O()):P!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=P}function T(P,G){const le=G||{};return le.type=P,le.start=S(),h.events.push(["enter",le,h]),f.push(le),le}function D(P){const G=f.pop();return G.end=S(),h.events.push(["exit",G,h]),G}function $(P,G){U(P,G.from)}function j(P,G){G.restore()}function q(P,G){return le;function le(ae,W,K){let oe,V,pe,R;return Array.isArray(ae)?J(ae):"tokenize"in ae?J([ae]):L(ae);function L(ve){return ce;function ce(ke){const Ke=ke!==null&&ve[ke],Dt=ke!==null&&ve.null,yn=[...Array.isArray(Ke)?Ke:Ke?[Ke]:[],...Array.isArray(Dt)?Dt:Dt?[Dt]:[]];return J(yn)(ke)}}function J(ve){return oe=ve,V=0,ve.length===0?K:C(ve[V])}function C(ve){return ce;function ce(ke){return R=Z(),pe=ve,ve.partial||(h.currentConstruct=ve),ve.name&&h.parser.constructs.disable.null.includes(ve.name)?_e():ve.tokenize.call(G?Object.assign(Object.create(h),G):h,d,me,_e)(ke)}}function me(ve){return P(pe,R),W}function _e(ve){return R.restore(),++V<oe.length?C(oe[V]):K}}}function U(P,G){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&ai(h.events,G,h.events.length-G,P.resolve(h.events.slice(G),h)),P.resolveTo&&(h.events=P.resolveTo(h.events,h))}function Z(){const P=S(),G=h.previous,le=h.currentConstruct,ae=h.events.length,W=Array.from(f);return{from:ae,restore:K};function K(){a=P,h.previous=G,h.currentConstruct=le,h.events.length=ae,f=W,O()}}function O(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function ED(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let c;if(n===s)c=[e[n].slice(a,o)];else{if(c=e.slice(n,s),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[s].slice(0,o))}return c}function SD(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
481
|
+
`,h="/",y="*",g="",x="comment",v="declaration";function S(k,_){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];_=_||{};var A=1,T=1;function D(ae){var W=ae.match(t);W&&(A+=W.length);var K=ae.lastIndexOf(d);T=~K?ae.length-K:T+ae.length}function $(){var ae={line:A,column:T};return function(W){return W.position=new j(ae),Z(),W}}function j(ae){this.start=ae,this.end={line:A,column:T},this.source=_.source}j.prototype.content=k;function q(ae){var W=new Error(_.source+":"+A+":"+T+": "+ae);if(W.reason=ae,W.filename=_.source,W.line=A,W.column=T,W.source=k,!_.silent)throw W}function U(ae){var W=ae.exec(k);if(W){var K=W[0];return D(K),k=k.slice(K.length),W}}function Z(){U(n)}function O(ae){var W;for(ae=ae||[];W=P();)W!==!1&&ae.push(W);return ae}function P(){var ae=$();if(!(h!=k.charAt(0)||y!=k.charAt(1))){for(var W=2;g!=k.charAt(W)&&(y!=k.charAt(W)||h!=k.charAt(W+1));)++W;if(W+=2,g===k.charAt(W-1))return q("End of comment missing");var K=k.slice(2,W-2);return T+=2,D(K),k=k.slice(W),T+=2,ae({type:x,comment:K})}}function G(){var ae=$(),W=U(a);if(W){if(P(),!U(s))return q("property missing ':'");var K=U(o),oe=ae({type:v,property:w(W[0].replace(e,g)),value:K?w(K[0].replace(e,g)):g});return U(c),oe}}function le(){var ae=[];O(ae);for(var W;W=G();)W!==!1&&(ae.push(W),O(ae));return ae}return Z(),le()}function w(k){return k?k.replace(f,g):g}return Sm=S,Sm}var s0;function rM(){if(s0)return al;s0=1;var e=al&&al.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(al,"__esModule",{value:!0}),al.default=n;const t=e(aM());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof s=="function";return c.forEach(d=>{if(d.type!=="declaration")return;const{property:h,value:y}=d;f?s(h,y,d):y&&(o=o||{},o[h]=y)}),o}return al}var Ko={},l0;function sM(){if(l0)return Ko;l0=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},d=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(s,f):h=h.replace(a,f),h.replace(t,c))};return Ko.camelCase=d,Ko}var Go,o0;function lM(){if(o0)return Go;o0=1;var e=Go&&Go.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(rM()),n=sM();function a(s,o){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(f,d){f&&d&&(c[(0,n.camelCase)(f,o)]=d)}),c}return a.default=a,Go=a,Go}var oM=lM();const cM=Np(oM),mS=pS("end"),hg=pS("start");function pS(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function uM(e){const t=hg(e),n=mS(e);if(t&&n)return{start:t,end:n}}function Jo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?c0(e.position):"start"in e||"end"in e?c0(e):"line"in e||"column"in e?gp(e):""}function gp(e){return u0(e&&e.line)+":"+u0(e&&e.column)}function c0(e){return gp(e&&e.start)+"-"+gp(e&&e.end)}function u0(e){return e&&typeof e=="number"?e:1}class bn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(c=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const d=a.indexOf(":");d===-1?o.ruleId=a:(o.source=a.slice(0,d),o.ruleId=a.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=Jo(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}bn.prototype.file="";bn.prototype.name="";bn.prototype.reason="";bn.prototype.message="";bn.prototype.stack="";bn.prototype.column=void 0;bn.prototype.line=void 0;bn.prototype.ancestors=void 0;bn.prototype.cause=void 0;bn.prototype.fatal=void 0;bn.prototype.place=void 0;bn.prototype.ruleId=void 0;bn.prototype.source=void 0;const mg={}.hasOwnProperty,fM=new Map,dM=/[A-Z]/g,hM=new Set(["table","tbody","thead","tfoot","tr"]),mM=new Set(["td","th"]),gS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pM(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=wM(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=SM(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?dg:nM,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bS(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function bS(e,t,n){if(t.type==="element")return gM(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bM(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return xM(e,t,n);if(t.type==="mdxjsEsm")return yM(e,t);if(t.type==="root")return vM(e,t,n);if(t.type==="text")return EM(e,t)}function gM(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=dg,e.schema=s),e.ancestors.push(t);const o=xS(e,t.tagName,!1),c=_M(e,t);let f=gg(e,t);return hM.has(t.tagName)&&(f=f.filter(function(d){return typeof d=="string"?!GR(d):!0})),yS(e,c,o,t),pg(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function bM(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}cc(e,t.position)}function yM(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cc(e,t.position)}function xM(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=dg,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:xS(e,t.name,!0),c=kM(e,t),f=gg(e,t);return yS(e,c,o,t),pg(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function vM(e,t,n){const a={};return pg(a,gg(e,t)),e.create(t,e.Fragment,a,n)}function EM(e,t){return t.value}function yS(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function pg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function SM(e,t,n){return a;function a(s,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function wM(e,t){return n;function n(a,s,o,c){const f=Array.isArray(o.children),d=hg(a);return t(s,o,c,f,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function _M(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&mg.call(t.properties,s)){const o=NM(e,s,t.properties[s]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&mM.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function kM(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else cc(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else cc(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function gg(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:fM;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const h=s.get(d)||0;c=d+"-"+h,s.set(d,h+1)}}const f=bS(e,o,c);f!==void 0&&n.push(f)}return n}function NM(e,t,n){const a=JR(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?$R(n):iM(n)),a.property==="style"){let s=typeof n=="object"?n:TM(e,String(n));return e.stylePropertyNameCase==="css"&&(s=CM(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?XR[a.property]||a.property:a.attribute,n]}}function TM(e,t){try{return cM(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new bn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=gS+"#cannot-parse-style-attribute",s}}function xS(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,c;for(;++o<s.length;){const f=t0(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=t0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return mg.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);cc(e)}function cc(e,t){const n=new bn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=gS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function CM(e){const t={};let n;for(n in e)mg.call(e,n)&&(t[AM(n)]=e[n]);return t}function AM(e){let t=e.replace(dM,OM);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function OM(e){return"-"+e.toLowerCase()}const wm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},RM={};function bg(e,t){const n=RM,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return vS(e,a,s)}function vS(e,t,n){if(MM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return f0(e.children,t,n)}return Array.isArray(e)?f0(e,t,n):""}function f0(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=vS(e[s],t,n);return a.join("")}function MM(e){return!!(e&&typeof e=="object")}const d0=document.createElement("i");function yg(e){const t="&"+e+";";d0.innerHTML=t;const n=d0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ai(e,t,n,a){const s=e.length;let o=0,c;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function xi(e,t){return e.length>0?(ai(e,e.length,0,t),e):t}const h0={}.hasOwnProperty;function ES(e){const t={};let n=-1;for(;++n<e.length;)jM(t,e[n]);return t}function jM(e,t){let n;for(n in t){const s=(h0.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){h0.call(s,c)||(s[c]=[]);const f=o[c];DM(s[c],Array.isArray(f)?f:f?[f]:[])}}}function DM(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ai(e,0,0,a)}function SS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Mi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tn=Nr(/[A-Za-z]/),pn=Nr(/[\dA-Za-z]/),LM=Nr(/[#-'*+\--9=?A-Z^-~]/);function _f(e){return e!==null&&(e<32||e===127)}const bp=Nr(/\d/),IM=Nr(/[\dA-Fa-f]/),zM=Nr(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Ye(e){return e===-2||e===-1||e===32}const Vf=Nr(new RegExp("\\p{P}|\\p{S}","u")),fs=Nr(/\s/);function Nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kl(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&pn(e.charCodeAt(n+1))&&pn(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),s=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+s+1,c=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function tt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(d){return Ye(d)?(e.enter(n),f(d)):t(d)}function f(d){return Ye(d)&&o++<s?(e.consume(d),f):(e.exit(n),t(d))}}const BM={tokenize:UM};function UM(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),tt(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ae(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const FM={tokenize:$M},m0={tokenize:PM};function $M(e){const t=this,n=[];let a=0,s,o,c;return f;function f(T){if(a<n.length){const D=n[a];return t.containerState=D[1],e.attempt(D[0].continuation,d,h)(T)}return h(T)}function d(T){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&A();const D=t.events.length;let $=D,j;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){j=t.events[$][1].end;break}_(a);let q=D;for(;q<t.events.length;)t.events[q][1].end={...j},q++;return ai(t.events,$+1,0,t.events.slice(D)),t.events.length=q,h(T)}return f(T)}function h(T){if(a===n.length){if(!s)return x(T);if(s.currentConstruct&&s.currentConstruct.concrete)return S(T);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(m0,y,g)(T)}function y(T){return s&&A(),_(a),x(T)}function g(T){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,S(T)}function x(T){return t.containerState={},e.attempt(m0,v,S)(T)}function v(T){return a++,n.push([t.currentConstruct,t.containerState]),x(T)}function S(T){if(T===null){s&&A(),_(0),e.consume(T);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),w(T)}function w(T){if(T===null){k(e.exit("chunkFlow"),!0),_(0),e.consume(T);return}return Ae(T)?(e.consume(T),k(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(T),w)}function k(T,D){const $=t.sliceStream(T);if(D&&$.push(null),T.previous=o,o&&(o.next=T),o=T,s.defineSkip(T.start),s.write($),t.parser.lazy[T.start.line]){let j=s.events.length;for(;j--;)if(s.events[j][1].start.offset<c&&(!s.events[j][1].end||s.events[j][1].end.offset>c))return;const q=t.events.length;let U=q,Z,O;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(Z){O=t.events[U][1].end;break}Z=!0}for(_(a),j=q;j<t.events.length;)t.events[j][1].end={...O},j++;ai(t.events,U+1,0,t.events.slice(q)),t.events.length=j}}function _(T){let D=n.length;for(;D-- >T;){const $=n[D];t.containerState=$[1],$[0].exit.call(t,e)}n.length=T}function A(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function PM(e,t,n){return tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rl(e){if(e===null||xt(e)||fs(e))return 1;if(Vf(e))return 2}function Xf(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const yp={name:"attention",resolveAll:qM,tokenize:HM};function qM(e,t){let n=-1,a,s,o,c,f,d,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},x={...e[n][1].start};p0(g,-d),p0(x,d),c={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:d>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=xi(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=xi(h,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=xi(h,Xf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=xi(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=xi(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,ai(e,a-1,n-a+3,h),n=a+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function HM(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Rl(a);let o;return c;function c(d){return o=d,e.enter("attentionSequence"),f(d)}function f(d){if(d===o)return e.consume(d),f;const h=e.exit("attentionSequence"),y=Rl(d),g=!y||y===2&&s||n.includes(d),x=!s||s===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(s||!x)),h._close=!!(o===42?x:x&&(y||!g)),t(d)}}function p0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const KM={name:"autolink",tokenize:GM};function GM(e,t,n){let a=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return Tn(v)?(e.consume(v),c):v===64?n(v):h(v)}function c(v){return v===43||v===45||v===46||pn(v)?(a=1,f(v)):h(v)}function f(v){return v===58?(e.consume(v),a=0,d):(v===43||v===45||v===46||pn(v))&&a++<32?(e.consume(v),f):(a=0,h(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||_f(v)?n(v):(e.consume(v),d)}function h(v){return v===64?(e.consume(v),y):LM(v)?(e.consume(v),h):n(v)}function y(v){return pn(v)?g(v):n(v)}function g(v){return v===46?(e.consume(v),a=0,y):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):x(v)}function x(v){if((v===45||pn(v))&&a++<63){const S=v===45?x:g;return e.consume(v),S}return n(v)}}const wc={partial:!0,tokenize:QM};function QM(e,t,n){return a;function a(o){return Ye(o)?tt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Ae(o)?t(o):n(o)}}const wS={continuation:{tokenize:VM},exit:XM,name:"blockQuote",tokenize:YM};function YM(e,t,n){const a=this;return s;function s(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return Ye(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function VM(e,t,n){const a=this;return s;function s(c){return Ye(c)?tt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(wS,t,n)(c)}}function XM(e){e.exit("blockQuote")}const _S={name:"characterEscape",tokenize:ZM};function ZM(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return zM(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const kS={name:"characterReference",tokenize:WM};function WM(e,t,n){const a=this;let s=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=pn,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=IM,y):(e.enter("characterReferenceValue"),o=7,c=bp,y(g))}function y(g){if(g===59&&s){const x=e.exit("characterReferenceValue");return c===pn&&!yg(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&s++<o?(e.consume(g),y):n(g)}}const g0={partial:!0,tokenize:ej},b0={concrete:!0,name:"codeFenced",tokenize:JM};function JM(e,t,n){const a=this,s={partial:!0,tokenize:$};let o=0,c=0,f;return d;function d(j){return h(j)}function h(j){const q=a.events[a.events.length-1];return o=q&&q[1].type==="linePrefix"?q[2].sliceSerialize(q[1],!0).length:0,f=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(j)}function y(j){return j===f?(c++,e.consume(j),y):c<3?n(j):(e.exit("codeFencedFenceSequence"),Ye(j)?tt(e,g,"whitespace")(j):g(j))}function g(j){return j===null||Ae(j)?(e.exit("codeFencedFence"),a.interrupt?t(j):e.check(g0,w,D)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(j)):Ye(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,v,"whitespace")(j)):j===96&&j===f?n(j):(e.consume(j),x)}function v(j){return j===null||Ae(j)?g(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(j))}function S(j){return j===null||Ae(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(j)):j===96&&j===f?n(j):(e.consume(j),S)}function w(j){return e.attempt(s,D,k)(j)}function k(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),_}function _(j){return o>0&&Ye(j)?tt(e,A,"linePrefix",o+1)(j):A(j)}function A(j){return j===null||Ae(j)?e.check(g0,w,D)(j):(e.enter("codeFlowValue"),T(j))}function T(j){return j===null||Ae(j)?(e.exit("codeFlowValue"),A(j)):(e.consume(j),T)}function D(j){return e.exit("codeFenced"),t(j)}function $(j,q,U){let Z=0;return O;function O(W){return j.enter("lineEnding"),j.consume(W),j.exit("lineEnding"),P}function P(W){return j.enter("codeFencedFence"),Ye(W)?tt(j,G,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):G(W)}function G(W){return W===f?(j.enter("codeFencedFenceSequence"),le(W)):U(W)}function le(W){return W===f?(Z++,j.consume(W),le):Z>=c?(j.exit("codeFencedFenceSequence"),Ye(W)?tt(j,ae,"whitespace")(W):ae(W)):U(W)}function ae(W){return W===null||Ae(W)?(j.exit("codeFencedFence"),q(W)):U(W)}}}function ej(e,t,n){const a=this;return s;function s(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const _m={name:"codeIndented",tokenize:nj},tj={partial:!0,tokenize:ij};function nj(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),tt(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?d(h):Ae(h)?e.attempt(tj,c,d)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||Ae(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function d(h){return e.exit("codeIndented"),t(h)}}function ij(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):tt(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Ae(c)?s(c):n(c)}}const aj={name:"codeText",previous:sj,resolve:rj,tokenize:lj};function rj(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function sj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function lj(e,t,n){let a=0,s,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),s=0,y(g)):Ae(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||Ae(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),s++,y):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class oj{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Qo(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Qo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Qo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Qo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Qo(this.left,n.reverse())}}}function Qo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function NS(e){const t={};let n=-1,a,s,o,c,f,d,h;const y=new oj(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(a=y.get(n),n&&a[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(d=a[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,cj(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...y.get(s)[1].start},f=y.slice(s,n),f.unshift(a),y.splice(s,n-s+1,f))}}return ai(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function cj(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,d=[],h={};let y,g,x=-1,v=n,S=0,w=0;const k=[w];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(y=a.sliceStream(v),v.next||y.push(null),g&&c.defineSkip(v.start),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),v._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=v,v=v.next}for(v=n;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(w=x+1,k.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(c.events=[],v?(v._tokenizer=void 0,v.previous=void 0):k.pop(),x=k.length;x--;){const _=f.slice(k[x],k[x+1]),A=o.pop();d.push([A,A+_.length-1]),e.splice(A,2,_)}for(d.reverse(),x=-1;++x<d.length;)h[S+d[x][0]]=S+d[x][1],S+=d[x][1]-d[x][0]-1;return h}const uj={resolve:dj,tokenize:hj},fj={partial:!0,tokenize:mj};function dj(e){return NS(e),e}function hj(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):Ae(f)?e.check(fj,c,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function mj(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),tt(e,o,"linePrefix")}function o(c){if(c===null||Ae(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function TS(e,t,n,a,s,o,c,f,d){const h=d||Number.POSITIVE_INFINITY;let y=0;return g;function g(_){return _===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(_),e.exit(o),x):_===null||_===32||_===41||_f(_)?n(_):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),w(_))}function x(_){return _===62?(e.enter(o),e.consume(_),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(_))}function v(_){return _===62?(e.exit("chunkString"),e.exit(f),x(_)):_===null||_===60||Ae(_)?n(_):(e.consume(_),_===92?S:v)}function S(_){return _===60||_===62||_===92?(e.consume(_),v):v(_)}function w(_){return!y&&(_===null||_===41||xt(_))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(_)):y<h&&_===40?(e.consume(_),y++,w):_===41?(e.consume(_),y--,w):_===null||_===32||_===40||_f(_)?n(_):(e.consume(_),_===92?k:w)}function k(_){return _===40||_===41||_===92?(e.consume(_),w):w(_)}}function CS(e,t,n,a,s,o){const c=this;let f=0,d;return h;function h(v){return e.enter(a),e.enter(s),e.consume(v),e.exit(s),e.enter(o),y}function y(v){return f>999||v===null||v===91||v===93&&!d||v===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(a),t):Ae(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===null||v===91||v===93||Ae(v)||f++>999?(e.exit("chunkString"),y(v)):(e.consume(v),d||(d=!Ye(v)),v===92?x:g)}function x(v){return v===91||v===92||v===93?(e.consume(v),f++,g):g(v)}}function AS(e,t,n,a,s,o){let c;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),c=x===40?41:x,d):n(x)}function d(x){return x===c?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===c?(e.exit(o),d(c)):x===null?n(x):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),tt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===c||x===null||Ae(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:y)}function g(x){return x===c||x===92?(e.consume(x),y):y(x)}}function ec(e,t){let n;return a;function a(s){return Ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Ye(s)?tt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const pj={name:"definition",tokenize:bj},gj={partial:!0,tokenize:yj};function bj(e,t,n){const a=this;let s;return o;function o(v){return e.enter("definition"),c(v)}function c(v){return CS.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=Mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return xt(v)?ec(e,h)(v):h(v)}function h(v){return TS(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return e.attempt(gj,g,g)(v)}function g(v){return Ye(v)?tt(e,x,"whitespace")(v):x(v)}function x(v){return v===null||Ae(v)?(e.exit("definition"),a.parser.defined.push(s),t(v)):n(v)}}function yj(e,t,n){return a;function a(f){return xt(f)?ec(e,s)(f):n(f)}function s(f){return AS(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Ye(f)?tt(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ae(f)?t(f):n(f)}}const xj={name:"hardBreakEscape",tokenize:vj};function vj(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Ae(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Ej={name:"headingAtx",resolve:Sj,tokenize:wj};function Sj(e,t){let n=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},ai(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function wj(e,t,n){let a=0;return s;function s(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||xt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),d(y)):y===null||Ae(y)?(e.exit("atxHeading"),t(y)):Ye(y)?tt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function d(y){return y===35?(e.consume(y),d):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||xt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const _j=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],y0=["pre","script","style","textarea"],kj={concrete:!0,name:"htmlFlow",resolveTo:Cj,tokenize:Aj},Nj={partial:!0,tokenize:Rj},Tj={partial:!0,tokenize:Oj};function Cj(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Aj(e,t,n){const a=this;let s,o,c,f,d;return h;function h(C){return y(C)}function y(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),g}function g(C){return C===33?(e.consume(C),x):C===47?(e.consume(C),o=!0,w):C===63?(e.consume(C),s=3,a.interrupt?t:R):Tn(C)?(e.consume(C),c=String.fromCharCode(C),k):n(C)}function x(C){return C===45?(e.consume(C),s=2,v):C===91?(e.consume(C),s=5,f=0,S):Tn(C)?(e.consume(C),s=4,a.interrupt?t:R):n(C)}function v(C){return C===45?(e.consume(C),a.interrupt?t:R):n(C)}function S(C){const me="CDATA[";return C===me.charCodeAt(f++)?(e.consume(C),f===me.length?a.interrupt?t:G:S):n(C)}function w(C){return Tn(C)?(e.consume(C),c=String.fromCharCode(C),k):n(C)}function k(C){if(C===null||C===47||C===62||xt(C)){const me=C===47,_e=c.toLowerCase();return!me&&!o&&y0.includes(_e)?(s=1,a.interrupt?t(C):G(C)):_j.includes(c.toLowerCase())?(s=6,me?(e.consume(C),_):a.interrupt?t(C):G(C)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(C):o?A(C):T(C))}return C===45||pn(C)?(e.consume(C),c+=String.fromCharCode(C),k):n(C)}function _(C){return C===62?(e.consume(C),a.interrupt?t:G):n(C)}function A(C){return Ye(C)?(e.consume(C),A):O(C)}function T(C){return C===47?(e.consume(C),O):C===58||C===95||Tn(C)?(e.consume(C),D):Ye(C)?(e.consume(C),T):O(C)}function D(C){return C===45||C===46||C===58||C===95||pn(C)?(e.consume(C),D):$(C)}function $(C){return C===61?(e.consume(C),j):Ye(C)?(e.consume(C),$):T(C)}function j(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),d=C,q):Ye(C)?(e.consume(C),j):U(C)}function q(C){return C===d?(e.consume(C),d=null,Z):C===null||Ae(C)?n(C):(e.consume(C),q)}function U(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?$(C):(e.consume(C),U)}function Z(C){return C===47||C===62||Ye(C)?T(C):n(C)}function O(C){return C===62?(e.consume(C),P):n(C)}function P(C){return C===null||Ae(C)?G(C):Ye(C)?(e.consume(C),P):n(C)}function G(C){return C===45&&s===2?(e.consume(C),K):C===60&&s===1?(e.consume(C),oe):C===62&&s===4?(e.consume(C),L):C===63&&s===3?(e.consume(C),R):C===93&&s===5?(e.consume(C),pe):Ae(C)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Nj,J,le)(C)):C===null||Ae(C)?(e.exit("htmlFlowData"),le(C)):(e.consume(C),G)}function le(C){return e.check(Tj,ae,J)(C)}function ae(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),W}function W(C){return C===null||Ae(C)?le(C):(e.enter("htmlFlowData"),G(C))}function K(C){return C===45?(e.consume(C),R):G(C)}function oe(C){return C===47?(e.consume(C),c="",V):G(C)}function V(C){if(C===62){const me=c.toLowerCase();return y0.includes(me)?(e.consume(C),L):G(C)}return Tn(C)&&c.length<8?(e.consume(C),c+=String.fromCharCode(C),V):G(C)}function pe(C){return C===93?(e.consume(C),R):G(C)}function R(C){return C===62?(e.consume(C),L):C===45&&s===2?(e.consume(C),R):G(C)}function L(C){return C===null||Ae(C)?(e.exit("htmlFlowData"),J(C)):(e.consume(C),L)}function J(C){return e.exit("htmlFlow"),t(C)}}function Oj(e,t,n){const a=this;return s;function s(c){return Ae(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function Rj(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(wc,t,n)}}const Mj={name:"htmlText",tokenize:jj};function jj(e,t,n){const a=this;let s,o,c;return f;function f(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),d}function d(R){return R===33?(e.consume(R),h):R===47?(e.consume(R),$):R===63?(e.consume(R),T):Tn(R)?(e.consume(R),U):n(R)}function h(R){return R===45?(e.consume(R),y):R===91?(e.consume(R),o=0,S):Tn(R)?(e.consume(R),A):n(R)}function y(R){return R===45?(e.consume(R),v):n(R)}function g(R){return R===null?n(R):R===45?(e.consume(R),x):Ae(R)?(c=g,oe(R)):(e.consume(R),g)}function x(R){return R===45?(e.consume(R),v):g(R)}function v(R){return R===62?K(R):R===45?x(R):g(R)}function S(R){const L="CDATA[";return R===L.charCodeAt(o++)?(e.consume(R),o===L.length?w:S):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),k):Ae(R)?(c=w,oe(R)):(e.consume(R),w)}function k(R){return R===93?(e.consume(R),_):w(R)}function _(R){return R===62?K(R):R===93?(e.consume(R),_):w(R)}function A(R){return R===null||R===62?K(R):Ae(R)?(c=A,oe(R)):(e.consume(R),A)}function T(R){return R===null?n(R):R===63?(e.consume(R),D):Ae(R)?(c=T,oe(R)):(e.consume(R),T)}function D(R){return R===62?K(R):T(R)}function $(R){return Tn(R)?(e.consume(R),j):n(R)}function j(R){return R===45||pn(R)?(e.consume(R),j):q(R)}function q(R){return Ae(R)?(c=q,oe(R)):Ye(R)?(e.consume(R),q):K(R)}function U(R){return R===45||pn(R)?(e.consume(R),U):R===47||R===62||xt(R)?Z(R):n(R)}function Z(R){return R===47?(e.consume(R),K):R===58||R===95||Tn(R)?(e.consume(R),O):Ae(R)?(c=Z,oe(R)):Ye(R)?(e.consume(R),Z):K(R)}function O(R){return R===45||R===46||R===58||R===95||pn(R)?(e.consume(R),O):P(R)}function P(R){return R===61?(e.consume(R),G):Ae(R)?(c=P,oe(R)):Ye(R)?(e.consume(R),P):Z(R)}function G(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),s=R,le):Ae(R)?(c=G,oe(R)):Ye(R)?(e.consume(R),G):(e.consume(R),ae)}function le(R){return R===s?(e.consume(R),s=void 0,W):R===null?n(R):Ae(R)?(c=le,oe(R)):(e.consume(R),le)}function ae(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||xt(R)?Z(R):(e.consume(R),ae)}function W(R){return R===47||R===62||xt(R)?Z(R):n(R)}function K(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function oe(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),V}function V(R){return Ye(R)?tt(e,pe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):pe(R)}function pe(R){return e.enter("htmlTextData"),c(R)}}const xg={name:"labelEnd",resolveAll:zj,resolveTo:Bj,tokenize:Uj},Dj={tokenize:Fj},Lj={tokenize:$j},Ij={tokenize:Pj};function zj(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&ai(e,0,e.length,n),e}function Bj(e,t){let n=e.length,a=0,s,o,c,f;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(c=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",d,t],["enter",h,t]],f=xi(f,e.slice(o+1,o+a+3)),f=xi(f,[["enter",y,t]]),f=xi(f,Xf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=xi(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=xi(f,e.slice(c+1)),f=xi(f,[["exit",d,t]]),ai(e,o,e.length,f),e}function Uj(e,t,n){const a=this;let s=a.events.length,o,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return f;function f(x){return o?o._inactive?g(x):(c=a.parser.defined.includes(Mi(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),d):n(x)}function d(x){return x===40?e.attempt(Dj,y,c?y:g)(x):x===91?e.attempt(Lj,y,c?h:g)(x):c?y(x):g(x)}function h(x){return e.attempt(Ij,y,g)(x)}function y(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function Fj(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return xt(g)?ec(e,o)(g):o(g)}function o(g){return g===41?y(g):TS(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return xt(g)?ec(e,d)(g):y(g)}function f(g){return n(g)}function d(g){return g===34||g===39||g===40?AS(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return xt(g)?ec(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function $j(e,t,n){const a=this;return s;function s(f){return CS.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Mi(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function Pj(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const qj={name:"labelStartImage",resolveAll:xg.resolveAll,tokenize:Hj};function Hj(e,t,n){const a=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const Kj={name:"labelStartLink",resolveAll:xg.resolveAll,tokenize:Gj};function Gj(e,t,n){const a=this;return s;function s(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const km={name:"lineEnding",tokenize:Qj};function Qj(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),tt(e,t,"linePrefix")}}const mf={name:"thematicBreak",tokenize:Yj};function Yj(e,t,n){let a=0,s;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return s=h,f(h)}function f(h){return h===s?(e.enter("thematicBreakSequence"),d(h)):a>=3&&(h===null||Ae(h))?(e.exit("thematicBreak"),t(h)):n(h)}function d(h){return h===s?(e.consume(h),a++,d):(e.exit("thematicBreakSequence"),Ye(h)?tt(e,f,"whitespace")(h):f(h))}}const Bn={continuation:{tokenize:Wj},exit:eD,name:"list",tokenize:Zj},Vj={partial:!0,tokenize:tD},Xj={partial:!0,tokenize:Jj};function Zj(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return f;function f(v){const S=a.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||v===a.containerState.marker:bp(v)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(mf,n,h)(v):h(v);if(!a.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return bp(v)&&++c<10?(e.consume(v),d):(!a.interrupt||c<2)&&(a.containerState.marker?v===a.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),h(v)):n(v)}function h(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||v,e.check(wc,a.interrupt?n:y,e.attempt(Vj,x,g))}function y(v){return a.containerState.initialBlankLine=!0,o++,x(v)}function g(v){return Ye(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),x):n(v)}function x(v){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Wj(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(wc,s,o);function s(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,tt(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Ye(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(Xj,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,tt(e,e.attempt(Bn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function Jj(e,t,n){const a=this;return tt(e,s,"listItemIndent",a.containerState.size+1);function s(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function eD(e){e.exit(this.containerState.type)}function tD(e,t,n){const a=this;return tt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const c=a.events[a.events.length-1];return!Ye(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const x0={name:"setextUnderline",resolveTo:nD,tokenize:iD};function nD(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function iD(e,t,n){const a=this;let s;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===s?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Ye(h)?tt(e,d,"lineSuffix")(h):d(h))}function d(h){return h===null||Ae(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const aD={tokenize:rD};function rD(e){const t=this,n=e.attempt(wc,a,e.attempt(this.parser.constructs.flowInitial,s,tt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(uj,s)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const sD={resolveAll:RS()},lD=OS("string"),oD=OS("text");function OS(e){return{resolveAll:RS(e==="text"?cD:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,c,f);return c;function c(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),d}function d(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),d)}function h(y){if(y===null)return!0;const g=s[y];let x=-1;if(g)for(;++x<g.length;){const v=g[x];if(!v.previous||v.previous.call(a,a.previous))return!0}return!1}}}function RS(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function cD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let o=s.length,c=-1,f=0,d;for(;o--;){const h=s[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)d=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||d||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const uD={42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:wS},fD={91:pj},dD={[-2]:_m,[-1]:_m,32:_m},hD={35:Ej,42:mf,45:[x0,mf],60:kj,61:x0,95:mf,96:b0,126:b0},mD={38:kS,92:_S},pD={[-5]:km,[-4]:km,[-3]:km,33:qj,38:kS,42:yp,60:[KM,Mj],91:Kj,92:[xj,_S],93:xg,95:yp,96:aj},gD={null:[yp,sD]},bD={null:[42,95]},yD={null:[]},xD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bD,contentInitial:fD,disable:yD,document:uD,flow:hD,flowInitial:dD,insideSpan:gD,string:mD,text:pD},Symbol.toStringTag,{value:"Module"}));function vD(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let c=[],f=[];const d={attempt:q($),check:q(j),consume:A,enter:T,exit:D,interrupt:q(j,{interrupt:!0})},h={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:v,write:g};let y=t.tokenize.call(h,d);return t.resolveAll&&o.push(t),h;function g(P){return c=xi(c,P),k(),c[c.length-1]!==null?[]:(U(t,0),h.events=Xf(o,h.events,h),h.events)}function x(P,G){return SD(v(P),G)}function v(P){return ED(c,P)}function S(){const{_bufferIndex:P,_index:G,line:le,column:ae,offset:W}=a;return{_bufferIndex:P,_index:G,line:le,column:ae,offset:W}}function w(P){s[P.line]=P.column,O()}function k(){let P;for(;a._index<c.length;){const G=c[a._index];if(typeof G=="string")for(P=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===P&&a._bufferIndex<G.length;)_(G.charCodeAt(a._bufferIndex));else _(G)}}function _(P){y=y(P)}function A(P){Ae(P)?(a.line++,a.column=1,a.offset+=P===-3?2:1,O()):P!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=P}function T(P,G){const le=G||{};return le.type=P,le.start=S(),h.events.push(["enter",le,h]),f.push(le),le}function D(P){const G=f.pop();return G.end=S(),h.events.push(["exit",G,h]),G}function $(P,G){U(P,G.from)}function j(P,G){G.restore()}function q(P,G){return le;function le(ae,W,K){let oe,V,pe,R;return Array.isArray(ae)?J(ae):"tokenize"in ae?J([ae]):L(ae);function L(ve){return ce;function ce(ke){const Ke=ke!==null&&ve[ke],Dt=ke!==null&&ve.null,yn=[...Array.isArray(Ke)?Ke:Ke?[Ke]:[],...Array.isArray(Dt)?Dt:Dt?[Dt]:[]];return J(yn)(ke)}}function J(ve){return oe=ve,V=0,ve.length===0?K:C(ve[V])}function C(ve){return ce;function ce(ke){return R=Z(),pe=ve,ve.partial||(h.currentConstruct=ve),ve.name&&h.parser.constructs.disable.null.includes(ve.name)?_e():ve.tokenize.call(G?Object.assign(Object.create(h),G):h,d,me,_e)(ke)}}function me(ve){return P(pe,R),W}function _e(ve){return R.restore(),++V<oe.length?C(oe[V]):K}}}function U(P,G){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&ai(h.events,G,h.events.length-G,P.resolve(h.events.slice(G),h)),P.resolveTo&&(h.events=P.resolveTo(h.events,h))}function Z(){const P=S(),G=h.previous,le=h.currentConstruct,ae=h.events.length,W=Array.from(f);return{from:ae,restore:K};function K(){a=P,h.previous=G,h.currentConstruct=le,h.events.length=ae,f=W,O()}}function O(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function ED(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let c;if(n===s)c=[e[n].slice(a,o)];else{if(c=e.slice(n,s),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[s].slice(0,o))}return c}function SD(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
482
482
|
`;break}case-3:{c=`\r
|
|
483
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&s)continue;c=" ";break}default:c=String.fromCharCode(o)}s=o===-2,a.push(c)}return a.join("")}function wD(e){const a={constructs:ES([xD,...(e||{}).extensions||[]]),content:s(BM),defined:[],document:s(FM),flow:s(aD),lazy:{},string:s(lD),text:s(oD)};return a;function s(o){return c;function c(f){return vD(a,o,f)}}}function _D(e){for(;!NS(e););return e}const v0=/[\0\t\n\r]/g;function kD(){let e=1,t="",n=!0,a;return s;function s(o,c,f){const d=[];let h,y,g,x,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(v0.lastIndex=g,h=v0.exec(o),x=h&&h.index!==void 0?h.index:o.length,v=o.charCodeAt(x),!h){t=o.slice(g);break}if(v===10&&g===x&&a)d.push(-3),a=void 0;else switch(a&&(d.push(-5),a=void 0),g<x&&(d.push(o.slice(g,x)),e+=x-g),v){case 0:{d.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,d.push(-2);e++<y;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return f&&(a&&d.push(-5),t&&d.push(t),d.push(null)),d}}const ND=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TD(e){return e.replace(ND,CD)}function CD(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return SS(n.slice(o?2:1),o?16:10)}return yg(n)||e}const MS={}.hasOwnProperty;function AD(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),OD(n)(_D(wD(n).document().write(kD()(e,t,!0))))}function OD(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ii),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:o(Li),blockQuote:o(Dt),characterEscape:Z,characterReference:Z,codeFenced:o(yn),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(yn,c),codeText:o(Wi,c),codeTextData:Z,data:Z,codeFlowValue:Z,definition:o(Oa),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Kn),hardBreakEscape:o(We),hardBreakTrailing:o(We),htmlFlow:o(_i,c),htmlFlowData:Z,htmlText:o(_i,c),htmlTextData:Z,image:o(li),label:c,link:o(Ii),listItem:o(Nr),listItemValue:x,listOrdered:o(Ji,g),listUnordered:o(Ji),paragraph:o(Gl),reference:C,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Li),strong:o(bs),thematicBreak:o(ys)},exit:{atxHeading:d(),atxHeadingSequence:$,autolink:d(),autolinkEmail:Ke,autolinkProtocol:ke,blockQuote:d(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:ve,characterReference:ce,codeFenced:d(k),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:O,codeIndented:d(_),codeText:d(W),codeTextData:O,data:O,definition:d(),definitionDestinationString:D,definitionLabelString:A,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(le),htmlFlowData:O,htmlText:d(ae),htmlTextData:O,image:d(oe),label:pe,labelText:V,lineEnding:P,link:d(K),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:me,resourceDestinationString:R,resourceTitleString:L,resource:J,setextHeading:d(U),setextHeadingLineSequence:q,setextHeadingText:j,strong:d(),thematicBreak:d()}};jS(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(te){let de={type:"root",children:[]};const Oe={stack:[de],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},qe=[];let nt=-1;for(;++nt<te.length;)if(te[nt][1].type==="listOrdered"||te[nt][1].type==="listUnordered")if(te[nt][0]==="enter")qe.push(nt);else{const xn=qe.pop();nt=s(te,xn,nt)}for(nt=-1;++nt<te.length;){const xn=t[te[nt][0]];MS.call(xn,te[nt][1].type)&&xn[te[nt][1].type].call(Object.assign({sliceSerialize:te[nt][2].sliceSerialize},Oe),te[nt][1])}if(Oe.tokenStack.length>0){const xn=Oe.tokenStack[Oe.tokenStack.length-1];(xn[1]||E0).call(Oe,void 0,xn[0])}for(de.position={start:sr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:sr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)de=t.transforms[nt](de)||de;return de}function s(te,de,Oe){let qe=de-1,nt=-1,xn=!1,ki,an,Lt,un;for(;++qe<=Oe;){const ot=te[qe];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?nt++:nt--,un=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(ki&&!un&&!nt&&!Lt&&(Lt=qe),un=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:un=void 0}if(!nt&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||nt===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(ki){let zi=qe;for(an=void 0;zi--;){const vn=te[zi];if(vn[1].type==="lineEnding"||vn[1].type==="lineEndingBlank"){if(vn[0]==="exit")continue;an&&(te[an][1].type="lineEndingBlank",xn=!0),vn[1].type="lineEnding",an=zi}else if(!(vn[1].type==="linePrefix"||vn[1].type==="blockQuotePrefix"||vn[1].type==="blockQuotePrefixWhitespace"||vn[1].type==="blockQuoteMarker"||vn[1].type==="listItemIndent"))break}Lt&&(!an||Lt<an)&&(ki._spread=!0),ki.end=Object.assign({},an?te[an][1].start:ot[1].end),te.splice(an||qe,0,["exit",ki,ot[2]]),qe++,Oe++}if(ot[1].type==="listItemPrefix"){const zi={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};ki=zi,te.splice(qe,0,["enter",zi,ot[2]]),qe++,Oe++,Lt=void 0,un=!0}}}return te[de][1]._spread=xn,Oe}function o(te,de){return Oe;function Oe(qe){f.call(this,te(qe),qe),de&&de.call(this,qe)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(te,de,Oe){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([de,Oe||void 0]),te.position={start:sr(de.start),end:void 0}}function d(te){return de;function de(Oe){te&&te.call(this,Oe),h.call(this,Oe)}}function h(te,de){const Oe=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==te.type&&(de?de.call(this,te,qe[0]):(qe[1]||E0).call(this,te,qe[0]));else throw new Error("Cannot close `"+te.type+"` ("+Jo({start:te.start,end:te.end})+"): it’s not open");Oe.position.end=sr(te.end)}function y(){return bg(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(te){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),de=this.stack[this.stack.length-1];de.lang=te}function S(){const te=this.resume(),de=this.stack[this.stack.length-1];de.meta=te}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/(\r?\n|\r)$/g,"")}function A(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Mi(this.sliceSerialize(te)).toLowerCase()}function T(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function D(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function $(te){const de=this.stack[this.stack.length-1];if(!de.depth){const Oe=this.sliceSerialize(te).length;de.depth=Oe}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function q(te){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(te){const Oe=this.stack[this.stack.length-1].children;let qe=Oe[Oe.length-1];(!qe||qe.type!=="text")&&(qe=Ot(),qe.position={start:sr(te.start),end:void 0},Oe.push(qe)),this.stack.push(qe)}function O(te){const de=this.stack.pop();de.value+=this.sliceSerialize(te),de.position.end=sr(te.end)}function P(te){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=de.children[de.children.length-1];Oe.position.end=sr(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(Z.call(this,te),O.call(this,te))}function G(){this.data.atHardBreak=!0}function le(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function ae(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function W(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function K(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function oe(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function V(te){const de=this.sliceSerialize(te),Oe=this.stack[this.stack.length-2];Oe.label=TD(de),Oe.identifier=Mi(de).toLowerCase()}function pe(){const te=this.stack[this.stack.length-1],de=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const qe=te.children;Oe.children=qe}else Oe.alt=de}function R(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function L(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function J(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function me(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Mi(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function _e(te){this.data.characterReferenceType=te.type}function ve(te){const de=this.sliceSerialize(te),Oe=this.data.characterReferenceType;let qe;Oe?(qe=SS(de,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=yg(de);const nt=this.stack[this.stack.length-1];nt.value+=qe}function ce(te){const de=this.stack.pop();de.position.end=sr(te.end)}function ke(te){O.call(this,te);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(te)}function Ke(te){O.call(this,te);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(te)}function Dt(){return{type:"blockquote",children:[]}}function yn(){return{type:"code",lang:null,meta:null,value:""}}function Wi(){return{type:"inlineCode",value:""}}function Oa(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Kn(){return{type:"emphasis",children:[]}}function Li(){return{type:"heading",depth:0,children:[]}}function We(){return{type:"break"}}function _i(){return{type:"html",value:""}}function li(){return{type:"image",title:null,url:"",alt:null}}function Ii(){return{type:"link",title:null,url:"",children:[]}}function Ji(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Nr(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Gl(){return{type:"paragraph",children:[]}}function bs(){return{type:"strong",children:[]}}function Ot(){return{type:"text",value:""}}function ys(){return{type:"thematicBreak"}}}function sr(e){return{line:e.line,column:e.column,offset:e.offset}}function jS(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?jS(e,a):RD(e,a)}}function RD(e,t){let n;for(n in t)if(MS.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function E0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Jo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Jo({start:t.start,end:t.end})+") is still open")}function MD(e){const t=this;t.parser=n;function n(a){return AD(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function jD(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function DD(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
483
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&s)continue;c=" ";break}default:c=String.fromCharCode(o)}s=o===-2,a.push(c)}return a.join("")}function wD(e){const a={constructs:ES([xD,...(e||{}).extensions||[]]),content:s(BM),defined:[],document:s(FM),flow:s(aD),lazy:{},string:s(lD),text:s(oD)};return a;function s(o){return c;function c(f){return vD(a,o,f)}}}function _D(e){for(;!NS(e););return e}const v0=/[\0\t\n\r]/g;function kD(){let e=1,t="",n=!0,a;return s;function s(o,c,f){const d=[];let h,y,g,x,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(v0.lastIndex=g,h=v0.exec(o),x=h&&h.index!==void 0?h.index:o.length,v=o.charCodeAt(x),!h){t=o.slice(g);break}if(v===10&&g===x&&a)d.push(-3),a=void 0;else switch(a&&(d.push(-5),a=void 0),g<x&&(d.push(o.slice(g,x)),e+=x-g),v){case 0:{d.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,d.push(-2);e++<y;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return f&&(a&&d.push(-5),t&&d.push(t),d.push(null)),d}}const ND=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TD(e){return e.replace(ND,CD)}function CD(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return SS(n.slice(o?2:1),o?16:10)}return yg(n)||e}const MS={}.hasOwnProperty;function AD(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),OD(n)(_D(wD(n).document().write(kD()(e,t,!0))))}function OD(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ii),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:o(Li),blockQuote:o(Dt),characterEscape:Z,characterReference:Z,codeFenced:o(yn),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(yn,c),codeText:o(Wi,c),codeTextData:Z,data:Z,codeFlowValue:Z,definition:o(Oa),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Kn),hardBreakEscape:o(We),hardBreakTrailing:o(We),htmlFlow:o(_i,c),htmlFlowData:Z,htmlText:o(_i,c),htmlTextData:Z,image:o(li),label:c,link:o(Ii),listItem:o(Tr),listItemValue:x,listOrdered:o(Ji,g),listUnordered:o(Ji),paragraph:o(Gl),reference:C,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Li),strong:o(bs),thematicBreak:o(ys)},exit:{atxHeading:d(),atxHeadingSequence:$,autolink:d(),autolinkEmail:Ke,autolinkProtocol:ke,blockQuote:d(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:ve,characterReference:ce,codeFenced:d(k),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:O,codeIndented:d(_),codeText:d(W),codeTextData:O,data:O,definition:d(),definitionDestinationString:D,definitionLabelString:A,definitionTitleString:T,emphasis:d(),hardBreakEscape:d(G),hardBreakTrailing:d(G),htmlFlow:d(le),htmlFlowData:O,htmlText:d(ae),htmlTextData:O,image:d(oe),label:pe,labelText:V,lineEnding:P,link:d(K),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:me,resourceDestinationString:R,resourceTitleString:L,resource:J,setextHeading:d(U),setextHeadingLineSequence:q,setextHeadingText:j,strong:d(),thematicBreak:d()}};jS(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(te){let de={type:"root",children:[]};const Oe={stack:[de],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},qe=[];let nt=-1;for(;++nt<te.length;)if(te[nt][1].type==="listOrdered"||te[nt][1].type==="listUnordered")if(te[nt][0]==="enter")qe.push(nt);else{const xn=qe.pop();nt=s(te,xn,nt)}for(nt=-1;++nt<te.length;){const xn=t[te[nt][0]];MS.call(xn,te[nt][1].type)&&xn[te[nt][1].type].call(Object.assign({sliceSerialize:te[nt][2].sliceSerialize},Oe),te[nt][1])}if(Oe.tokenStack.length>0){const xn=Oe.tokenStack[Oe.tokenStack.length-1];(xn[1]||E0).call(Oe,void 0,xn[0])}for(de.position={start:lr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:lr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)de=t.transforms[nt](de)||de;return de}function s(te,de,Oe){let qe=de-1,nt=-1,xn=!1,ki,an,Lt,un;for(;++qe<=Oe;){const ot=te[qe];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?nt++:nt--,un=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(ki&&!un&&!nt&&!Lt&&(Lt=qe),un=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:un=void 0}if(!nt&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||nt===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(ki){let zi=qe;for(an=void 0;zi--;){const vn=te[zi];if(vn[1].type==="lineEnding"||vn[1].type==="lineEndingBlank"){if(vn[0]==="exit")continue;an&&(te[an][1].type="lineEndingBlank",xn=!0),vn[1].type="lineEnding",an=zi}else if(!(vn[1].type==="linePrefix"||vn[1].type==="blockQuotePrefix"||vn[1].type==="blockQuotePrefixWhitespace"||vn[1].type==="blockQuoteMarker"||vn[1].type==="listItemIndent"))break}Lt&&(!an||Lt<an)&&(ki._spread=!0),ki.end=Object.assign({},an?te[an][1].start:ot[1].end),te.splice(an||qe,0,["exit",ki,ot[2]]),qe++,Oe++}if(ot[1].type==="listItemPrefix"){const zi={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};ki=zi,te.splice(qe,0,["enter",zi,ot[2]]),qe++,Oe++,Lt=void 0,un=!0}}}return te[de][1]._spread=xn,Oe}function o(te,de){return Oe;function Oe(qe){f.call(this,te(qe),qe),de&&de.call(this,qe)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(te,de,Oe){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([de,Oe||void 0]),te.position={start:lr(de.start),end:void 0}}function d(te){return de;function de(Oe){te&&te.call(this,Oe),h.call(this,Oe)}}function h(te,de){const Oe=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==te.type&&(de?de.call(this,te,qe[0]):(qe[1]||E0).call(this,te,qe[0]));else throw new Error("Cannot close `"+te.type+"` ("+Jo({start:te.start,end:te.end})+"): it’s not open");Oe.position.end=lr(te.end)}function y(){return bg(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(te){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),de=this.stack[this.stack.length-1];de.lang=te}function S(){const te=this.resume(),de=this.stack[this.stack.length-1];de.meta=te}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te.replace(/(\r?\n|\r)$/g,"")}function A(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Mi(this.sliceSerialize(te)).toLowerCase()}function T(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function D(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function $(te){const de=this.stack[this.stack.length-1];if(!de.depth){const Oe=this.sliceSerialize(te).length;de.depth=Oe}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function q(te){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(te){const Oe=this.stack[this.stack.length-1].children;let qe=Oe[Oe.length-1];(!qe||qe.type!=="text")&&(qe=Ot(),qe.position={start:lr(te.start),end:void 0},Oe.push(qe)),this.stack.push(qe)}function O(te){const de=this.stack.pop();de.value+=this.sliceSerialize(te),de.position.end=lr(te.end)}function P(te){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=de.children[de.children.length-1];Oe.position.end=lr(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(Z.call(this,te),O.call(this,te))}function G(){this.data.atHardBreak=!0}function le(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function ae(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function W(){const te=this.resume(),de=this.stack[this.stack.length-1];de.value=te}function K(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function oe(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=de,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function V(te){const de=this.sliceSerialize(te),Oe=this.stack[this.stack.length-2];Oe.label=TD(de),Oe.identifier=Mi(de).toLowerCase()}function pe(){const te=this.stack[this.stack.length-1],de=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const qe=te.children;Oe.children=qe}else Oe.alt=de}function R(){const te=this.resume(),de=this.stack[this.stack.length-1];de.url=te}function L(){const te=this.resume(),de=this.stack[this.stack.length-1];de.title=te}function J(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function me(te){const de=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=de,Oe.identifier=Mi(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function _e(te){this.data.characterReferenceType=te.type}function ve(te){const de=this.sliceSerialize(te),Oe=this.data.characterReferenceType;let qe;Oe?(qe=SS(de,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=yg(de);const nt=this.stack[this.stack.length-1];nt.value+=qe}function ce(te){const de=this.stack.pop();de.position.end=lr(te.end)}function ke(te){O.call(this,te);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(te)}function Ke(te){O.call(this,te);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(te)}function Dt(){return{type:"blockquote",children:[]}}function yn(){return{type:"code",lang:null,meta:null,value:""}}function Wi(){return{type:"inlineCode",value:""}}function Oa(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Kn(){return{type:"emphasis",children:[]}}function Li(){return{type:"heading",depth:0,children:[]}}function We(){return{type:"break"}}function _i(){return{type:"html",value:""}}function li(){return{type:"image",title:null,url:"",alt:null}}function Ii(){return{type:"link",title:null,url:"",children:[]}}function Ji(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Tr(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Gl(){return{type:"paragraph",children:[]}}function bs(){return{type:"strong",children:[]}}function Ot(){return{type:"text",value:""}}function ys(){return{type:"thematicBreak"}}}function lr(e){return{line:e.line,column:e.column,offset:e.offset}}function jS(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?jS(e,a):RD(e,a)}}function RD(e,t){let n;for(n in t)if(MS.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function E0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Jo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Jo({start:t.start,end:t.end})+") is still open")}function MD(e){const t=this;t.parser=n;function n(a){return AD(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function jD(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function DD(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
484
484
|
`}]}function LD(e,t){const n=t.value?t.value+`
|
|
485
485
|
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function ID(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zD(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BD(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=Kl(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,f);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,d);const h={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,h),e.applyData(t,h)}function UD(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FD(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function DS(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=a:s.push({type:"text",value:a}),s}function $D(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return DS(e,t);const s={src:Kl(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function PD(e,t){const n={src:Kl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function qD(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function HD(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return DS(e,t);const s={href:Kl(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function KD(e,t){const n={href:Kl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GD(e,t,n){const a=e.all(t),s=n?QD(n):LS(t),o={},c=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const y=a[f];(s||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
|
|
486
486
|
`}),y.type==="element"&&y.tagName==="p"&&!s?c.push(...y.children):c.push(y)}const d=a[a.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&c.push({type:"text",value:`
|
|
@@ -509,8 +509,8 @@ ${g.join(`
|
|
|
509
509
|
`.repeat(h)||" "),h=-1,d.push(y))}return d.join("")}function dw(e,t,n){return e.type==="element"?gz(e,t,n):e.type==="text"?n.whitespace==="normal"?hw(e,n):bz(e):[]}function gz(e,t,n){const a=mw(e,n),s=e.children||[];let o=-1,c=[];if(mz(e))return c;let f,d;for(_p(e)||Y0(e)&&H0(t,e,Y0)?d=`
|
|
510
510
|
`:hz(e)?(f=2,d=2):fw(e)&&(f=1,d=1);++o<s.length;)c=c.concat(dw(s[o],e,{whitespace:a,breakBefore:o?void 0:f,breakAfter:o<s.length-1?_p(s[o+1]):d}));return Q0(e)&&H0(t,e,Q0)&&c.push(" "),f&&c.unshift(f),d&&c.push(d),c}function hw(e,t){const n=String(e.value),a=[],s=[];let o=0;for(;o<=n.length;){K0.lastIndex=o;const d=K0.exec(n),h=d&&"index"in d?d.index:n.length;a.push(yz(n.slice(o,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),o=h+1}let c=-1,f;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(s.push(a[c]),f=void 0):a[c]?(typeof f=="number"&&s.push(f),s.push(a[c]),f=0):(c===0||c===a.length-1)&&s.push(0);return s}function bz(e){return[String(e.value)]}function yz(e,t,n){const a=[];let s=0,o;for(;s<e.length;){G0.lastIndex=s;const c=G0.exec(e);o=c?c.index:e.length,!s&&!o&&c&&!t&&a.push(""),s!==o&&a.push(e.slice(s,o)),s=c?o+c[0].length:o}return s!==o&&!n&&a.push(""),a.join(" ")}function mw(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function xz(e){return!!(e.properties||{}).hidden}function vz(e){return e.tagName==="td"||e.tagName==="th"}function Ez(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function Sz(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",c="(?!struct)("+a+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},y={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},v=t.optional(s)+e.IDENT_RE+"\\s*\\(",S=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],k=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:w,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:k},$={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},j=[$,g,f,n,e.C_BLOCK_COMMENT_MODE,y,h],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:j.concat([{begin:/\(/,end:/\)/,keywords:D,contains:j.concat(["self"]),relevance:0}]),relevance:0},U={className:"function",begin:"("+c+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:D,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,y]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,y,f,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,y,f]}]},f,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(q,U,$,j,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function wz(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=Sz(e),a=n.keywords;return a.type=[...a.type,...t.type],a.literal=[...a.literal,...t.literal],a.built_in=[...a.built_in,...t.built_in],a._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function _z(e){const t=e.regex,n={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(f);const d={match:/\\"/},h={className:"string",begin:/'/,end:/'/},y={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],v=e.SHEBANG({binary:`(${x.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],k=["true","false"],_={match:/(\/[a-z._-]+)+/},A=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],D=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],$=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:w,literal:k,built_in:[...A,...T,"set","shopt",...D,...$]},contains:[v,e.SHEBANG(),S,g,o,c,_,f,d,h,y,n]}}function kz(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",c="("+a+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},y={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},v=t.optional(s)+e.IDENT_RE+"\\s*\\(",k={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},_=[g,f,n,e.C_BLOCK_COMMENT_MODE,y,h],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:_.concat([{begin:/\(/,end:/\)/,keywords:k,contains:_.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+c+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:k,relevance:0},{begin:v,returnBegin:!0,contains:[e.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,y,f,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,y,f]}]},f,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:k,disableAutodetect:!0,illegal:"</",contains:[].concat(A,T,_,[g,{begin:e.IDENT_RE+"::",keywords:k},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:h,keywords:k}}}function Nz(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",c="(?!struct)("+a+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},y={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},v=t.optional(s)+e.IDENT_RE+"\\s*\\(",S=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],k=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:w,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:k},$={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},j=[$,g,f,n,e.C_BLOCK_COMMENT_MODE,y,h],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:j.concat([{begin:/\(/,end:/\)/,keywords:D,contains:j.concat(["self"]),relevance:0}]),relevance:0},U={className:"function",begin:"("+c+"[\\*&\\s]+)+"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:D,relevance:0},{begin:v,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,y]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,y,f,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,y,f]}]},f,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(q,U,$,j,[g,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Tz(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],a=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],c={keyword:s.concat(o),built_in:t,literal:a},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},y={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=e.inherit(y,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:c},v=e.inherit(x,{illegal:/\n/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,v]},w={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},k=e.inherit(w,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});x.contains=[w,S,y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],v.contains=[k,S,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[h,w,S,y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},A={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:c,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,A,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,A,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:c,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,A],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,relevance:0,contains:[_,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},D]}}const Cz=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Az=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Oz=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Rz=[...Az,...Oz],Mz=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),jz=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Dz=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Lz=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Iz(e){const t=e.regex,n=Cz(e),a={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",o=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,a,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+jz.join("|")+")"},{begin:":(:)?("+Dz.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Lz.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Mz.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Rz.join("|")+")\\b"}]}}function zz(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Bz(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function Uz(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Fz(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const s={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[a,o,s,c,n,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,y=/'[^']*'/,g=t.either(d,h,y),x=t.concat(g,"(\\s*\\.\\s*",g,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[a,f,o,s,c,n]}}]}}var ll="[0-9](_*[0-9])*",tf=`\\.(${ll})`,nf="[0-9a-fA-F](_*[0-9a-fA-F])*",V0={className:"number",variants:[{begin:`(\\b(${ll})((${tf})|\\.)?|(${tf}))[eE][+-]?(${ll})[fFdD]?\\b`},{begin:`\\b(${ll})((${tf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${tf})[fFdD]?\\b`},{begin:`\\b(${ll})[fFdD]\\b`},{begin:`\\b0[xX]((${nf})\\.?|(${nf})?\\.(${nf}))[pP][+-]?(${ll})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${nf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function pw(e,t,n){return n===-1?"":e.replace(t,a=>pw(e,t,n-1))}function $z(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",a=n+pw("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},y={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,V0,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},V0,h]}}const X0="[A-Za-z$_][0-9A-Za-z$_]*",Pz=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],qz=["true","false","null","undefined","NaN","Infinity"],gw=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],bw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],yw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Hz=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Kz=[].concat(yw,gw,bw);function Gz(e){const t=e.regex,n=(V,{after:pe})=>{const R="</"+V[0].slice(1);return V.input.indexOf(R,pe)!==-1},a=X0,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,pe)=>{const R=V[0].length+V.index,L=V.input[R];if(L==="<"||L===","){pe.ignoreMatch();return}L===">"&&(n(V,{after:R})||pe.ignoreMatch());let J;const C=V.input.substring(R);if(J=C.match(/^\s*=/)){pe.ignoreMatch();return}if((J=C.match(/^\s+extends\s+/))&&J.index===0){pe.ignoreMatch();return}}},f={$pattern:X0,keyword:Pz,literal:qz,built_in:Kz,"variable.language":Hz},d="[0-9](_?[0-9])*",h=`\\.(${d})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${y})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${y})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,x]},A={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,w,k,{match:/\$\d+/},g];x.contains=T.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(T)});const D=[].concat(A,x.contains),$=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(D)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$},q={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,t.concat(a,"(",t.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},U={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...gw,...bw]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(V){return t.concat("(?!",V.join("|"),")")}const le={match:t.concat(/\b/,G([...yw,"super","import"].map(V=>`${V}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},K="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(K)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:U},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,w,k,A,{match:/\$\d+/},g,U,{scope:"attr",match:a+t.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:K,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},le,P,q,W,{match:/\$[(.]/}]}}function Qz(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],s={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ol="[0-9](_*[0-9])*",af=`\\.(${ol})`,rf="[0-9a-fA-F](_*[0-9a-fA-F])*",Yz={className:"number",variants:[{begin:`(\\b(${ol})((${af})|\\.)?|(${af}))[eE][+-]?(${ol})[fFdD]?\\b`},{begin:`\\b(${ol})((${af})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${af})[fFdD]?\\b`},{begin:`\\b(${ol})[fFdD]\\b`},{begin:`\\b0[xX]((${rf})\\.?|(${rf})?\\.(${rf}))[pP][+-]?(${ol})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${rf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Vz(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},a={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},c={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,s]}]};s.contains.push(c);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},d={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(c,{className:"string"}),"self"]}]},h=Yz,y=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},x=g;return x.variants[1].contains=[g],g.variants[1].contains=[x],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,y,n,a,f,d,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,e.C_LINE_COMMENT_MODE,y],relevance:0},e.C_LINE_COMMENT_MODE,y,f,d,c,e.C_NUMBER_MODE]},y]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,d]},c,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
511
511
|
`},h]}}const Xz=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Zz=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Wz=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Jz=[...Zz,...Wz],e4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xw=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),vw=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),t4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),n4=xw.concat(vw).sort().reverse();function i4(e){const t=Xz(e),n=n4,a="and or not only",s="[\\w-]+",o="("+s+"|@\\{"+s+"\\})",c=[],f=[],d=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},h=function(T,D,$){return{className:T,begin:D,relevance:$}},y={$pattern:/[a-z-]+/,keyword:a,attribute:e4.join(" ")},g={begin:"\\(",end:"\\)",contains:f,keywords:y,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d("'"),d('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,g,h("variable","@@?"+s,10),h("variable","@\\{"+s+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const x=f.concat({begin:/\{/,end:/\}/,contains:c}),v={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},S={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+t4.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:y,returnEnd:!0,contains:f,relevance:0}},k={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:x}},_={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,h("keyword","all\\b"),h("variable","@\\{"+s+"\\}"),{begin:"\\b("+Jz.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",o,0),h("selector-id","#"+o),h("selector-class","\\."+o,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+xw.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+vw.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:x},{begin:"!important"},t.FUNCTION_DISPATCH]},A={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[_]};return c.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,w,k,A,S,_,v,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:c}}function a4(e){const t="\\[=*\\[",n="\\]=*\\]",a={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[a],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[a],relevance:5}])}}function r4(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},a={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},s={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},c={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,a,s,o,c]}}function s4(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},y={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(h,{contains:[]}),x=e.inherit(y,{contains:[]});h.contains.push(x),y.contains.push(g);let v=[n,d];return[h,y,g,x].forEach(_=>{_.contains=_.contains.concat(v)}),v=v.concat(h,y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:v},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:v}]}]},n,o,h,y,{className:"quote",begin:"^>\\s+",contains:v,end:"$"},s,a,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function l4(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},d={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function o4(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],a=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},c={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},y=[e.BACKSLASH_ESCAPE,o,d],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(w,k,_="\\1")=>{const A=_==="\\1"?_:t.concat(_,k);return t.concat(t.concat("(?:",w,")"),k,/(?:\\.|[^\\\/])*?/,A,/(?:\\.|[^\\\/])*?/,_,a)},v=(w,k,_)=>t.concat(t.concat("(?:",w,")"),k,/(?:\\.|[^\\\/])*?/,_,a),S=[d,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),c,{className:"string",contains:y,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:x("s|tr|y",t.either(...g,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:v("(?:m|qr)?",/\//,/\//)},{begin:v("m|qr",t.either(...g,{capture:!0}),/\1/)},{begin:v("m|qr",/\(/,/\)/)},{begin:v("m|qr",/\[/,/\]/)},{begin:v("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=S,c.contains=S,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:S}}function c4(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,a=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),c={scope:"variable",match:"\\$+"+a},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),y=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(d)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(ae,W)=>{W.data._beginMatch=ae[1]||ae[2]},"on:end":(ae,W)=>{W.data._beginMatch!==ae[1]&&W.ignoreMatch()}},x=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),v=`[
|
|
512
|
-
]`,S={scope:"string",variants:[y,h,g,x]},w={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},k=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],A=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:_,literal:(ae=>{const W=[];return ae.forEach(K=>{W.push(K),K.toLowerCase()===K?W.push(K.toUpperCase()):W.push(K.toLowerCase())}),W})(k),built_in:A},$=ae=>ae.map(W=>W.replace(/\|\d+$/,"")),j={variants:[{match:[/new/,t.concat(v,"+"),t.concat("(?!",$(A).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},q=t.concat(a,"\\b(?!\\()"),U={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),q],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),q],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Z={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[Z,c,U,e.C_BLOCK_COMMENT_MODE,S,w,j]},P={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",$(_).join("\\b|"),"|",$(A).join("\\b|"),"\\b)"),a,t.concat(v,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(P);const G=[Z,U,e.C_BLOCK_COMMENT_MODE,S,w,j],le={begin:t.concat(/#\[\s*\\?/,t.either(s,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:k,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:k,keyword:["new","array"]},contains:["self",...G]},...G,{scope:"meta",variants:[{match:s},{match:o}]}]};return{case_insensitive:!1,keywords:D,contains:[le,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},c,P,U,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},j,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",le,c,U,e.C_BLOCK_COMMENT_MODE,S,w]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},S,w]}}function u4(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function f4(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function d4(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},y={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,y,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,y,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",v=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,S=`\\b|${a.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${v}))[eE][+-]?(${x})[jJ]?(?=${S})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${x})[jJ](?=${S})`}]},k={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",d,w,g,e.HASH_COMMENT_MODE]}]};return h.contains=[g,w,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[d,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,k,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,_,g]}]}}function h4(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function m4(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[o,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function p4(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(a,/(::\w+)*/),c={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},d={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],y={className:"subst",begin:/#\{/,end:/\}/,keywords:c},g={className:"string",contains:[e.BACKSLASH_ESCAPE,y],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,y]})]}]},x="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${v}))?([eE][+-]?(${v})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:c}]},j=[g,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:c},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:c},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:n}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:c},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,y],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(d,h),relevance:0}].concat(d,h);y.contains=j,w.contains=j;const O=[{begin:/^\s*=>/,starts:{end:"$",contains:j}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:c,contains:j}}];return h.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:c,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(O).concat(h).concat(j)}}function g4(e){const t=e.regex,n=/(r#)?/,a=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],y=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:y,keyword:f,literal:d,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:y}},{className:"punctuation",begin:"->"},o]}}const b4=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),y4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],x4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],v4=[...y4,...x4],E4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),S4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),w4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function k4(e){const t=b4(e),n=w4,a=S4,s="@[a-z-]+",o="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+v4.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_4.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:E4.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function N4(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function T4(e){const t=e.regex,n=e.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],y=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],x=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=y,S=[...h,...d].filter($=>!y.includes($)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},k={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function A($){return t.concat(/\b/,t.either(...$.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:A(x),relevance:0};function D($,{exceptions:j,when:q}={}){const U=q;return j=j||[],$.map(Z=>Z.match(/\|\d+$/)||j.includes(Z)?Z:U(Z)?`${Z}|0`:Z)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(S,{when:$=>$.length<3}),literal:o,type:f,built_in:g},contains:[{scope:"type",match:A(c)},T,_,w,a,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,k]}}function Ew(e){return e?typeof e=="string"?e:e.source:null}function Vo(e){return gt("(?=",e,")")}function gt(...e){return e.map(n=>Ew(n)).join("")}function C4(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function _n(...e){return"("+(C4(e).capture?"":"?:")+e.map(a=>Ew(a)).join("|")+")"}const Rg=e=>gt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),A4=["Protocol","Type"].map(Rg),Z0=["init","self"].map(Rg),O4=["Any","Self"],Bm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],W0=["false","nil","true"],R4=["assignment","associativity","higherThan","left","lowerThan","none","right"],M4=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],J0=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Sw=_n(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),ww=_n(Sw,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Um=gt(Sw,ww,"*"),_w=_n(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Cf=_n(_w,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qi=gt(_w,Cf,"*"),sf=gt(/[A-Z]/,Cf,"*"),j4=["attached","autoclosure",gt(/convention\(/,_n("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gt(/objc\(/,qi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],D4=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function L4(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,_n(...A4,...Z0)],className:{2:"keyword"}},o={match:gt(/\./,_n(...Bm)),relevance:0},c=Bm.filter(We=>typeof We=="string").concat(["_|0"]),f=Bm.filter(We=>typeof We!="string").concat(O4).map(Rg),d={variants:[{className:"keyword",match:_n(...f,...Z0)}]},h={$pattern:_n(/\b\w+/,/#\w+/),keyword:c.concat(M4),literal:W0},y=[s,o,d],g={match:gt(/\./,_n(...J0)),relevance:0},x={className:"built_in",match:gt(/\b/,_n(...J0),/(?=\()/)},v=[g,x],S={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:Um},{match:`\\.(\\.|${ww})+`}]},k=[S,w],_="([0-9]_*)+",A="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${_})(\\.(${_}))?([eE][+-]?(${_}))?\\b`},{match:`\\b0x(${A})(\\.(${A}))?([pP][+-]?(${_}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},D=(We="")=>({className:"subst",variants:[{match:gt(/\\/,We,/[0\\tnr"']/)},{match:gt(/\\/,We,/u\{[0-9a-fA-F]{1,8}\}/)}]}),$=(We="")=>({className:"subst",match:gt(/\\/,We,/[\t ]*(?:[\r\n]|\r\n)/)}),j=(We="")=>({className:"subst",label:"interpol",begin:gt(/\\/,We,/\(/),end:/\)/}),q=(We="")=>({begin:gt(We,/"""/),end:gt(/"""/,We),contains:[D(We),$(We),j(We)]}),U=(We="")=>({begin:gt(We,/"/),end:gt(/"/,We),contains:[D(We),j(We)]}),Z={className:"string",variants:[q(),q("#"),q("##"),q("###"),U(),U("#"),U("##"),U("###")]},O=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],P={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:O},G=We=>{const _i=gt(We,/\//),li=gt(/\//,We);return{begin:_i,end:li,contains:[...O,{scope:"comment",begin:`#(?!.*${li})`,end:/$/}]}},le={scope:"regexp",variants:[G("###"),G("##"),G("#"),P]},ae={match:gt(/`/,qi,/`/)},W={className:"variable",match:/\$\d+/},K={className:"variable",match:`\\$${Cf}+`},oe=[ae,W,K],V={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:D4,contains:[...k,T,Z]}]}},pe={scope:"keyword",match:gt(/@/,_n(...j4),Vo(_n(/\(/,/\s+/)))},R={scope:"meta",match:gt(/@/,qi)},L=[V,pe,R],J={match:Vo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Cf,"+")},{className:"type",match:sf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gt(/\s+&\s+/,Vo(sf)),relevance:0}]},C={begin:/</,end:/>/,keywords:h,contains:[...a,...y,...L,S,J]};J.contains.push(C);const me={match:gt(qi,/\s*:/),keywords:"_|0",relevance:0},_e={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",me,...a,le,...y,...v,...k,T,Z,...oe,...L,J]},ve={begin:/</,end:/>/,keywords:"repeat each",contains:[...a,J]},ce={begin:_n(Vo(gt(qi,/\s*:/)),Vo(gt(qi,/\s+/,qi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qi}]},ke={begin:/\(/,end:/\)/,keywords:h,contains:[ce,...a,...y,...k,T,Z,...L,J,_e],endsParent:!0,illegal:/["']/},Ke={match:[/(func|macro)/,/\s+/,_n(ae.match,qi,Um)],className:{1:"keyword",3:"title.function"},contains:[ve,ke,t],illegal:[/\[/,/%/]},Dt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ve,ke,t],illegal:/\[|%/},yn={match:[/operator/,/\s+/,Um],className:{1:"keyword",3:"title"}},Wi={begin:[/precedencegroup/,/\s+/,sf],className:{1:"keyword",3:"title"},contains:[J],keywords:[...R4,...W0],end:/}/},Oa={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Kn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Li={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qi,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[ve,...y,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:sf},...y],relevance:0}]};for(const We of Z.variants){const _i=We.contains.find(Ii=>Ii.label==="interpol");_i.keywords=h;const li=[...y,...v,...k,T,Z,...oe];_i.contains=[...li,{begin:/\(/,end:/\)/,contains:["self",...li]}]}return{name:"Swift",keywords:h,contains:[...a,Ke,Dt,Oa,Kn,Li,yn,Wi,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},le,...y,...v,...k,T,Z,...oe,...L,J,_e]}}const Af="[A-Za-z$_][0-9A-Za-z$_]*",kw=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Nw=["true","false","null","undefined","NaN","Infinity"],Tw=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Cw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Aw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ow=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rw=[].concat(Aw,Tw,Cw);function I4(e){const t=e.regex,n=(V,{after:pe})=>{const R="</"+V[0].slice(1);return V.input.indexOf(R,pe)!==-1},a=Af,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,pe)=>{const R=V[0].length+V.index,L=V.input[R];if(L==="<"||L===","){pe.ignoreMatch();return}L===">"&&(n(V,{after:R})||pe.ignoreMatch());let J;const C=V.input.substring(R);if(J=C.match(/^\s*=/)){pe.ignoreMatch();return}if((J=C.match(/^\s+extends\s+/))&&J.index===0){pe.ignoreMatch();return}}},f={$pattern:Af,keyword:kw,literal:Nw,built_in:Rw,"variable.language":Ow},d="[0-9](_?[0-9])*",h=`\\.(${d})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${y})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${y})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,x]},A={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,w,k,{match:/\$\d+/},g];x.contains=T.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(T)});const D=[].concat(A,x.contains),$=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(D)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$},q={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,t.concat(a,"(",t.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},U={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Tw,...Cw]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(V){return t.concat("(?!",V.join("|"),")")}const le={match:t.concat(/\b/,G([...Aw,"super","import"].map(V=>`${V}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},K="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(K)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:U},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,w,k,A,{match:/\$\d+/},g,U,{scope:"attr",match:a+t.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:K,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},le,P,q,W,{match:/\$[(.]/}]}}function z4(e){const t=e.regex,n=I4(e),a=Af,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Af,keyword:kw.concat(d),literal:Nw,built_in:Rw.concat(s),"variable.language":Ow},y={className:"meta",begin:"@"+a},g=(w,k,_)=>{const A=w.contains.findIndex(T=>T.label===k);if(A===-1)throw new Error("can not find mode to replace");w.contains.splice(A,1,_)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(y);const x=n.contains.find(w=>w.scope==="attr"),v=Object.assign({},x,{match:t.concat(a,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,x,v]),n.contains=n.contains.concat([y,o,c,v]),g(n,"shebang",e.SHEBANG()),g(n,"use_strict",f);const S=n.contains.find(w=>w.label==="func.def");return S.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function B4(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,c=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,s),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,c,/ *#/)},{begin:t.concat(/# */,t.either(o,s),/ +/,t.either(c,f),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},y={className:"label",begin:/^\w+:/},g=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,a,d,h,y,g,x,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[x]}]}}function U4(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),a=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},c={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:a},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,c,s,e.QUOTE_STRING_MODE,d,h,f]}}function F4(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(o,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,d,f,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,c,d,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function $4(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},f=e.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},S={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},k=[a,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},x,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,w,o,c],_=[...k];return _.pop(),_.push(f),v.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:k}}const P4={arduino:wz,bash:_z,c:kz,cpp:Nz,csharp:Tz,css:Iz,diff:zz,go:Bz,graphql:Uz,ini:Fz,java:$z,javascript:Gz,json:Qz,kotlin:Vz,less:i4,lua:a4,makefile:r4,markdown:s4,objectivec:l4,perl:o4,php:c4,"php-template":u4,plaintext:f4,python:d4,"python-repl":h4,r:m4,ruby:p4,rust:g4,scss:k4,shell:N4,sql:T4,swift:L4,typescript:z4,vbnet:B4,wasm:U4,xml:F4,yaml:$4};var Fm,eE;function q4(){if(eE)return Fm;eE=1;function e(B){return B instanceof Map?B.clear=B.delete=B.set=function(){throw new Error("map is read-only")}:B instanceof Set&&(B.add=B.clear=B.delete=function(){throw new Error("set is read-only")}),Object.freeze(B),Object.getOwnPropertyNames(B).forEach(ie=>{const ge=B[ie],Le=typeof ge;(Le==="object"||Le==="function")&&!Object.isFrozen(ge)&&e(ge)}),B}class t{constructor(ie){ie.data===void 0&&(ie.data={}),this.data=ie.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(B){return B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(B,...ie){const ge=Object.create(null);for(const Le in B)ge[Le]=B[Le];return ie.forEach(function(Le){for(const wt in Le)ge[wt]=Le[wt]}),ge}const s="</span>",o=B=>!!B.scope,c=(B,{prefix:ie})=>{if(B.startsWith("language:"))return B.replace("language:","language-");if(B.includes(".")){const ge=B.split(".");return[`${ie}${ge.shift()}`,...ge.map((Le,wt)=>`${Le}${"_".repeat(wt+1)}`)].join(" ")}return`${ie}${B}`};class f{constructor(ie,ge){this.buffer="",this.classPrefix=ge.classPrefix,ie.walk(this)}addText(ie){this.buffer+=n(ie)}openNode(ie){if(!o(ie))return;const ge=c(ie.scope,{prefix:this.classPrefix});this.span(ge)}closeNode(ie){o(ie)&&(this.buffer+=s)}value(){return this.buffer}span(ie){this.buffer+=`<span class="${ie}">`}}const d=(B={})=>{const ie={children:[]};return Object.assign(ie,B),ie};class h{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ie){this.top.children.push(ie)}openNode(ie){const ge=d({scope:ie});this.add(ge),this.stack.push(ge)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ie){return this.constructor._walk(ie,this.rootNode)}static _walk(ie,ge){return typeof ge=="string"?ie.addText(ge):ge.children&&(ie.openNode(ge),ge.children.forEach(Le=>this._walk(ie,Le)),ie.closeNode(ge)),ie}static _collapse(ie){typeof ie!="string"&&ie.children&&(ie.children.every(ge=>typeof ge=="string")?ie.children=[ie.children.join("")]:ie.children.forEach(ge=>{h._collapse(ge)}))}}class y extends h{constructor(ie){super(),this.options=ie}addText(ie){ie!==""&&this.add(ie)}startScope(ie){this.openNode(ie)}endScope(){this.closeNode()}__addSublanguage(ie,ge){const Le=ie.root;ge&&(Le.scope=`language:${ge}`),this.add(Le)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(B){return B?typeof B=="string"?B:B.source:null}function x(B){return w("(?=",B,")")}function v(B){return w("(?:",B,")*")}function S(B){return w("(?:",B,")?")}function w(...B){return B.map(ge=>g(ge)).join("")}function k(B){const ie=B[B.length-1];return typeof ie=="object"&&ie.constructor===Object?(B.splice(B.length-1,1),ie):{}}function _(...B){return"("+(k(B).capture?"":"?:")+B.map(Le=>g(Le)).join("|")+")"}function A(B){return new RegExp(B.toString()+"|").exec("").length-1}function T(B,ie){const ge=B&&B.exec(ie);return ge&&ge.index===0}const D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function $(B,{joinWith:ie}){let ge=0;return B.map(Le=>{ge+=1;const wt=ge;let bt=g(Le),Ee="";for(;bt.length>0;){const ye=D.exec(bt);if(!ye){Ee+=bt;break}Ee+=bt.substring(0,ye.index),bt=bt.substring(ye.index+ye[0].length),ye[0][0]==="\\"&&ye[1]?Ee+="\\"+String(Number(ye[1])+wt):(Ee+=ye[0],ye[0]==="("&&ge++)}return Ee}).map(Le=>`(${Le})`).join(ie)}const j=/\b\B/,q="[a-zA-Z]\\w*",U="[a-zA-Z_]\\w*",Z="\\b\\d+(\\.\\d+)?",O="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",le=(B={})=>{const ie=/^#![ ]*\//;return B.binary&&(B.begin=w(ie,/.*\b/,B.binary,/\b.*/)),a({scope:"meta",begin:ie,end:/$/,relevance:0,"on:begin":(ge,Le)=>{ge.index!==0&&Le.ignoreMatch()}},B)},ae={begin:"\\\\[\\s\\S]",relevance:0},W={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ae]},K={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ae]},oe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},V=function(B,ie,ge={}){const Le=a({scope:"comment",begin:B,end:ie,contains:[]},ge);Le.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const wt=_("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Le.contains.push({begin:w(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Le},pe=V("//","$"),R=V("/\\*","\\*/"),L=V("#","$"),J={scope:"number",begin:Z,relevance:0},C={scope:"number",begin:O,relevance:0},me={scope:"number",begin:P,relevance:0},_e={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},ve={scope:"title",begin:q,relevance:0},ce={scope:"title",begin:U,relevance:0},ke={begin:"\\.\\s*"+U,relevance:0};var Dt=Object.freeze({__proto__:null,APOS_STRING_MODE:W,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:me,BINARY_NUMBER_RE:P,COMMENT:V,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:pe,C_NUMBER_MODE:C,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(B){return Object.assign(B,{"on:begin":(ie,ge)=>{ge.data._beginMatch=ie[1]},"on:end":(ie,ge)=>{ge.data._beginMatch!==ie[1]&&ge.ignoreMatch()}})},HASH_COMMENT_MODE:L,IDENT_RE:q,MATCH_NOTHING_RE:j,METHOD_GUARD:ke,NUMBER_MODE:J,NUMBER_RE:Z,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:K,REGEXP_MODE:_e,RE_STARTERS_RE:G,SHEBANG:le,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:U,UNDERSCORE_TITLE_MODE:ce});function yn(B,ie){B.input[B.index-1]==="."&&ie.ignoreMatch()}function Wi(B,ie){B.className!==void 0&&(B.scope=B.className,delete B.className)}function Oa(B,ie){ie&&B.beginKeywords&&(B.begin="\\b("+B.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",B.__beforeBegin=yn,B.keywords=B.keywords||B.beginKeywords,delete B.beginKeywords,B.relevance===void 0&&(B.relevance=0))}function Kn(B,ie){Array.isArray(B.illegal)&&(B.illegal=_(...B.illegal))}function Li(B,ie){if(B.match){if(B.begin||B.end)throw new Error("begin & end are not supported with match");B.begin=B.match,delete B.match}}function We(B,ie){B.relevance===void 0&&(B.relevance=1)}const _i=(B,ie)=>{if(!B.beforeMatch)return;if(B.starts)throw new Error("beforeMatch cannot be used with starts");const ge=Object.assign({},B);Object.keys(B).forEach(Le=>{delete B[Le]}),B.keywords=ge.keywords,B.begin=w(ge.beforeMatch,x(ge.begin)),B.starts={relevance:0,contains:[Object.assign(ge,{endsParent:!0})]},B.relevance=0,delete ge.beforeMatch},li=["of","and","for","in","not","or","if","then","parent","list","value"],Ii="keyword";function Ji(B,ie,ge=Ii){const Le=Object.create(null);return typeof B=="string"?wt(ge,B.split(" ")):Array.isArray(B)?wt(ge,B):Object.keys(B).forEach(function(bt){Object.assign(Le,Ji(B[bt],ie,bt))}),Le;function wt(bt,Ee){ie&&(Ee=Ee.map(ye=>ye.toLowerCase())),Ee.forEach(function(ye){const De=ye.split("|");Le[De[0]]=[bt,Nr(De[0],De[1])]})}}function Nr(B,ie){return ie?Number(ie):Gl(B)?0:1}function Gl(B){return li.includes(B.toLowerCase())}const bs={},Ot=B=>{console.error(B)},ys=(B,...ie)=>{console.log(`WARN: ${B}`,...ie)},te=(B,ie)=>{bs[`${B}/${ie}`]||(console.log(`Deprecated as of ${B}. ${ie}`),bs[`${B}/${ie}`]=!0)},de=new Error;function Oe(B,ie,{key:ge}){let Le=0;const wt=B[ge],bt={},Ee={};for(let ye=1;ye<=ie.length;ye++)Ee[ye+Le]=wt[ye],bt[ye+Le]=!0,Le+=A(ie[ye-1]);B[ge]=Ee,B[ge]._emit=bt,B[ge]._multi=!0}function qe(B){if(Array.isArray(B.begin)){if(B.skip||B.excludeBegin||B.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof B.beginScope!="object"||B.beginScope===null)throw Ot("beginScope must be object"),de;Oe(B,B.begin,{key:"beginScope"}),B.begin=$(B.begin,{joinWith:""})}}function nt(B){if(Array.isArray(B.end)){if(B.skip||B.excludeEnd||B.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof B.endScope!="object"||B.endScope===null)throw Ot("endScope must be object"),de;Oe(B,B.end,{key:"endScope"}),B.end=$(B.end,{joinWith:""})}}function xn(B){B.scope&&typeof B.scope=="object"&&B.scope!==null&&(B.beginScope=B.scope,delete B.scope)}function ki(B){xn(B),typeof B.beginScope=="string"&&(B.beginScope={_wrap:B.beginScope}),typeof B.endScope=="string"&&(B.endScope={_wrap:B.endScope}),qe(B),nt(B)}function an(B){function ie(Ee,ye){return new RegExp(g(Ee),"m"+(B.case_insensitive?"i":"")+(B.unicodeRegex?"u":"")+(ye?"g":""))}class ge{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ye,De){De.position=this.position++,this.matchIndexes[this.matchAt]=De,this.regexes.push([De,ye]),this.matchAt+=A(ye)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ye=this.regexes.map(De=>De[1]);this.matcherRe=ie($(ye,{joinWith:"|"}),!0),this.lastIndex=0}exec(ye){this.matcherRe.lastIndex=this.lastIndex;const De=this.matcherRe.exec(ye);if(!De)return null;const Ut=De.findIndex((ea,vs)=>vs>0&&ea!==void 0),Nt=this.matchIndexes[Ut];return De.splice(0,Ut),Object.assign(De,Nt)}}class Le{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ye){if(this.multiRegexes[ye])return this.multiRegexes[ye];const De=new ge;return this.rules.slice(ye).forEach(([Ut,Nt])=>De.addRule(Ut,Nt)),De.compile(),this.multiRegexes[ye]=De,De}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ye,De){this.rules.push([ye,De]),De.type==="begin"&&this.count++}exec(ye){const De=this.getMatcher(this.regexIndex);De.lastIndex=this.lastIndex;let Ut=De.exec(ye);if(this.resumingScanAtSamePosition()&&!(Ut&&Ut.index===this.lastIndex)){const Nt=this.getMatcher(0);Nt.lastIndex=this.lastIndex+1,Ut=Nt.exec(ye)}return Ut&&(this.regexIndex+=Ut.position+1,this.regexIndex===this.count&&this.considerAll()),Ut}}function wt(Ee){const ye=new Le;return Ee.contains.forEach(De=>ye.addRule(De.begin,{rule:De,type:"begin"})),Ee.terminatorEnd&&ye.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&ye.addRule(Ee.illegal,{type:"illegal"}),ye}function bt(Ee,ye){const De=Ee;if(Ee.isCompiled)return De;[Wi,Li,ki,_i].forEach(Nt=>Nt(Ee,ye)),B.compilerExtensions.forEach(Nt=>Nt(Ee,ye)),Ee.__beforeBegin=null,[Oa,Kn,We].forEach(Nt=>Nt(Ee,ye)),Ee.isCompiled=!0;let Ut=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),Ut=Ee.keywords.$pattern,delete Ee.keywords.$pattern),Ut=Ut||/\w+/,Ee.keywords&&(Ee.keywords=Ji(Ee.keywords,B.case_insensitive)),De.keywordPatternRe=ie(Ut,!0),ye&&(Ee.begin||(Ee.begin=/\B|\b/),De.beginRe=ie(De.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(De.endRe=ie(De.end)),De.terminatorEnd=g(De.end)||"",Ee.endsWithParent&&ye.terminatorEnd&&(De.terminatorEnd+=(Ee.end?"|":"")+ye.terminatorEnd)),Ee.illegal&&(De.illegalRe=ie(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Nt){return un(Nt==="self"?Ee:Nt)})),Ee.contains.forEach(function(Nt){bt(Nt,De)}),Ee.starts&&bt(Ee.starts,ye),De.matcher=wt(De),De}if(B.compilerExtensions||(B.compilerExtensions=[]),B.contains&&B.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return B.classNameAliases=a(B.classNameAliases||{}),bt(B)}function Lt(B){return B?B.endsWithParent||Lt(B.starts):!1}function un(B){return B.variants&&!B.cachedVariants&&(B.cachedVariants=B.variants.map(function(ie){return a(B,{variants:null},ie)})),B.cachedVariants?B.cachedVariants:Lt(B)?a(B,{starts:B.starts?a(B.starts):null}):Object.isFrozen(B)?a(B):B}var ot="11.11.1";class zi extends Error{constructor(ie,ge){super(ie),this.name="HTMLInjectionError",this.html=ge}}const vn=n,Nc=a,Tr=Symbol("nomatch"),xs=7,Cr=function(B){const ie=Object.create(null),ge=Object.create(null),Le=[];let wt=!0;const bt="Could not find the language '{}', did you forget to load/include a language module?",Ee={disableAutodetect:!0,name:"Plain text",contains:[]};let ye={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:y};function De(ue){return ye.noHighlightRe.test(ue)}function Ut(ue){let Ne=ue.className+" ";Ne+=ue.parentNode?ue.parentNode.className:"";const He=ye.languageDetectRe.exec(Ne);if(He){const ct=En(He[1]);return ct||(ys(bt.replace("{}",He[1])),ys("Falling back to no-highlight mode for this block.",ue)),ct?He[1]:"no-highlight"}return Ne.split(/\s+/).find(ct=>De(ct)||En(ct))}function Nt(ue,Ne,He){let ct="",$t="";typeof Ne=="object"?(ct=ue,He=Ne.ignoreIllegals,$t=Ne.language):(te("10.7.0","highlight(lang, code, ...args) has been deprecated."),te("10.7.0",`Please use highlight(code, options) instead.
|
|
513
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),$t=ue,ct=Ne),He===void 0&&(He=!0);const dn={code:ct,language:$t};
|
|
514
|
-
`,1;if(Zl>1e5&&Zl>Se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ut+=Be,Be.length}const rn=En(ue);if(!rn)throw Ot(bt.replace("{}",ue)),new Error('Unknown language: "'+ue+'"');const Rc=an(rn);let Ns="",je=ct||Rc;const Mc={},Gt=new ye.__emitter(ye);Xl();let ut="",Da=0,ia=0,Zl=0,La=!1;try{if(rn.__emitTokens)rn.__emitTokens(Ne,Gt);else{for(je.matcher.considerAll();;){Zl++,La?La=!1:je.matcher.considerAll(),je.matcher.lastIndex=ia;const he=je.matcher.exec(Ne);if(!he)break;const Se=Ne.substring(ia,he.index),Be=ks(Se,he);ia=he.index+Be}ks(Ne.substring(ia))}return Gt.finalize(),Ns=Gt.toHTML(),{language:ue,value:Ns,relevance:Da,illegal:!1,_emitter:Gt,_top:je}}catch(he){if(he.message&&he.message.includes("Illegal"))return{language:ue,value:vn(Ne),illegal:!0,relevance:0,_illegalBy:{message:he.message,index:ia,context:Ne.slice(ia-100,ia+100),mode:he.mode,resultSoFar:Ns},_emitter:Gt};if(wt)return{language:ue,value:vn(Ne),illegal:!1,relevance:0,errorRaised:he,_emitter:Gt,_top:je};throw he}}function vs(ue){const Ne={value:vn(ue),illegal:!1,relevance:0,_top:Ee,_emitter:new ye.__emitter(ye)};return Ne._emitter.addText(ue),Ne}function Es(ue,Ne){Ne=Ne||ye.languages||Object.keys(ie);const He=vs(ue),ct=Ne.filter(En).filter(Ma).map(Et=>ea(Et,ue,!1));ct.unshift(He);const $t=ct.sort((Et,Qn)=>{if(Et.relevance!==Qn.relevance)return Qn.relevance-Et.relevance;if(Et.language&&Qn.language){if(En(Et.language).supersetOf===Qn.language)return 1;if(En(Qn.language).supersetOf===Et.language)return-1}return 0}),[dn,Gn]=$t,An=dn;return An.secondBest=Gn,An}function Bi(ue,Ne,He){const ct=Ne&&ge[Ne]||He;ue.classList.add("hljs"),ue.classList.add(`language-${ct}`)}function Ft(ue){let Ne=null;const He=Ut(ue);if(De(He))return;if(Or("before:highlightElement",{el:ue,language:He}),ue.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ue);return}if(ue.children.length>0&&(ye.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ue)),ye.throwUnescapedHTML))throw new zi("One of your code blocks includes unescaped HTML.",ue.innerHTML);Ne=ue;const ct=Ne.textContent,$t=He?Nt(ct,{language:He,ignoreIllegals:!0}):Es(ct);ue.innerHTML=$t.value,ue.dataset.highlighted="yes",Bi(ue,He,$t.language),ue.result={language:$t.language,re:$t.relevance,relevance:$t.relevance},$t.secondBest&&(ue.secondBest={language:$t.secondBest.language,relevance:$t.secondBest.relevance}),Or("after:highlightElement",{el:ue,result:$t,text:ct})}function fn(ue){ye=Nc(ye,ue)}const Ra=()=>{Ss(),te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ql(){Ss(),te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Tc=!1;function Ss(){function ue(){Ss()}if(document.readyState==="loading"){Tc||window.addEventListener("DOMContentLoaded",ue,!1),Tc=!0;return}document.querySelectorAll(ye.cssSelector).forEach(Ft)}function Cc(ue,Ne){let He=null;try{He=Ne(B)}catch(ct){if(Ot("Language definition for '{}' could not be registered.".replace("{}",ue)),wt)Ot(ct);else throw ct;He=Ee}He.name||(He.name=ue),ie[ue]=He,He.rawDefinition=Ne.bind(null,B),He.aliases&&ta(He.aliases,{languageName:ue})}function Ar(ue){delete ie[ue];for(const Ne of Object.keys(ge))ge[Ne]===ue&&delete ge[Ne]}function Yl(){return Object.keys(ie)}function En(ue){return ue=(ue||"").toLowerCase(),ie[ue]||ie[ge[ue]]}function ta(ue,{languageName:Ne}){typeof ue=="string"&&(ue=[ue]),ue.forEach(He=>{ge[He.toLowerCase()]=Ne})}function Ma(ue){const Ne=En(ue);return Ne&&!Ne.disableAutodetect}function ja(ue){ue["before:highlightBlock"]&&!ue["before:highlightElement"]&&(ue["before:highlightElement"]=Ne=>{ue["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),ue["after:highlightBlock"]&&!ue["after:highlightElement"]&&(ue["after:highlightElement"]=Ne=>{ue["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function Kt(ue){ja(ue),Le.push(ue)}function Ac(ue){const Ne=Le.indexOf(ue);Ne!==-1&&Le.splice(Ne,1)}function Or(ue,Ne){const He=ue;Le.forEach(function(ct){ct[He]&&ct[He](Ne)})}function na(ue){return te("10.7.0","highlightBlock will be removed entirely in v12.0"),te("10.7.0","Please use highlightElement now."),Ft(ue)}Object.assign(B,{highlight:Nt,highlightAuto:Es,highlightAll:Ss,highlightElement:Ft,highlightBlock:na,configure:fn,initHighlighting:Ra,initHighlightingOnLoad:Ql,registerLanguage:Cc,unregisterLanguage:Ar,listLanguages:Yl,getLanguage:En,registerAliases:ta,autoDetection:Ma,inherit:Nc,addPlugin:Kt,removePlugin:Ac}),B.debugMode=function(){wt=!1},B.safeMode=function(){wt=!0},B.versionString=ot,B.regex={concat:w,lookahead:x,either:_,optional:S,anyNumberOfTimes:v};for(const ue in Dt)typeof Dt[ue]=="object"&&e(Dt[ue]);return Object.assign(B,Dt),B},Cn=Cr({});return Cn.newInstance=()=>Cr({}),Fm=Cn,Cn.HighlightJS=Cn,Cn.default=Cn,Fm}var H4=q4();const K4=Np(H4),tE={},G4="hljs-";function Q4(e){const t=K4.newInstance();return e&&o(e),{highlight:n,highlightAuto:a,listLanguages:s,register:o,registerAlias:c,registered:f};function n(d,h,y){const g=y||tE,x=typeof g.prefix=="string"?g.prefix:G4;if(!t.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");t.configure({__emitter:Y4,classPrefix:x});const v=t.highlight(h,{ignoreIllegals:!0,language:d});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const S=v._emitter.root,w=S.data;return w.language=v.language,w.relevance=v.relevance,S}function a(d,h){const g=(h||tE).subset||s();let x=-1,v=0,S;for(;++x<g.length;){const w=g[x];if(!t.getLanguage(w))continue;const k=n(w,d,h);k.data&&k.data.relevance!==void 0&&k.data.relevance>v&&(v=k.data.relevance,S=k)}return S||{type:"root",children:[],data:{language:void 0,relevance:v}}}function s(){return t.listLanguages()}function o(d,h){if(typeof d=="string")t.registerLanguage(d,h);else{let y;for(y in d)Object.hasOwn(d,y)&&t.registerLanguage(y,d[y])}}function c(d,h){if(typeof d=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:d});else{let y;for(y in d)if(Object.hasOwn(d,y)){const g=d[y];t.registerAliases(typeof g=="string"?g:[...g],{languageName:y})}}}function f(d){return!!t.getLanguage(d)}}class Y4{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],a=n.children[n.children.length-1];a&&a.type==="text"?a.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const a=this.stack[this.stack.length-1],s=t.root.children;n?a.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):a.children.push(...s)}openNode(t){const n=this,a=t.split(".").map(function(c,f){return f?c+"_".repeat(f):n.options.classPrefix+c}),s=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:a},children:[]};s.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const V4={};function Mg(e){const t=e||V4,n=t.aliases,a=t.detect||!1,s=t.languages||P4,o=t.plainText,c=t.prefix,f=t.subset;let d="hljs";const h=Q4(s);if(n&&h.registerAlias(n),c){const y=c.indexOf("-");d=y===-1?c:c.slice(0,y)}return function(y,g){Jf(y,"element",function(x,v,S){if(x.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const w=X4(x);if(w===!1||!w&&!a||w&&o&&o.includes(w))return;Array.isArray(x.properties.className)||(x.properties.className=[]),x.properties.className.includes(d)||x.properties.className.unshift(d);const k=pz(x,{whitespace:"pre"});let _;try{_=w?h.highlight(w,k,{prefix:c}):h.highlightAuto(k,{prefix:c,subset:f})}catch(A){const T=A;if(w&&/Unknown language/.test(T.message)){g.message("Cannot highlight as `"+w+"`, it’s not registered",{ancestors:[S,x],cause:T,place:x.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!w&&_.data&&_.data.language&&x.properties.className.push("language-"+_.data.language),_.children.length>0&&(x.children=_.children)})}}function X4(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let a;for(;++n<t.length;){const s=String(t[n]);if(s==="no-highlight"||s==="nohighlight")return!1;!a&&s.slice(0,5)==="lang-"&&(a=s.slice(5)),!a&&s.slice(0,9)==="language-"&&(a=s.slice(9))}return a}function Z4({name:e,projects:t,onClose:n,onChange:a}){const{confirm:s,alert:o}=si(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=lt({queryKey:["skill",e],queryFn:()=>zO(e)});M.useEffect(()=>{const _=A=>{A.key==="Escape"&&n()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n]);const g=async(_,A)=>{try{await A(),await y(),a()}catch(T){o({title:`${_}失败`,body:T instanceof Error?T.message:String(T)})}},x=_=>g("link",()=>UO(e,_)),v=async _=>{await s({title:`从 ${_} 移除 ${e}`,body:"skill 链接会被解除,项目后续运行时将无法使用该 skill。",confirm:"移除",danger:!0})&&await g("unlink",()=>FO(e,_))},S=_=>g("freeze",()=>$O(e,_)),w=async _=>{await s({title:`解冻 ${e} @ ${_}`,body:"本地对这个 skill 的改动会被覆盖,回到最新共享版本。",confirm:"解冻",danger:!0})&&await g("unfreeze",()=>PO(e,_))},k=new Map(((c==null?void 0:c.linkedProjects)??[]).map(_=>[_.project,_.state]));return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl",children:[m.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e}),c&&m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[c.category," · ",c.origin||"local"]})]}),m.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":"关闭",type:"button",children:m.jsx(vr,{size:16,strokeWidth:3})})]}),f&&m.jsx("p",{children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-3 uppercase tracking-wider",children:"项目链接状态"}),m.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(_=>{const A=k.get(_);return m.jsxs("div",{className:"flex items-center justify-between gap-3 p-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:_}),A==="linked"&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"linked"}),A==="frozen"&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:"frozen"}),!A&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-idle-bg)",color:"var(--color-idle)"},children:"absent"})]}),m.jsxs("div",{className:"flex gap-2",children:[!A&&m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:()=>x(_),type:"button",children:[m.jsx(iA,{size:11})," link"]}),A==="linked"&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>S(_),type:"button",children:[m.jsx(_A,{size:11})," freeze"]}),m.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:()=>v(_),type:"button",children:"unlink"})]}),A==="frozen"&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>w(_),type:"button",children:[m.jsx(UC,{size:11})," unfreeze"]}),m.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:()=>v(_),type:"button",children:"unlink"})]})]})]},_)}),t.length===0&&m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"还没有任何项目。先去创建一个项目。"})]})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"SKILL.md 预览"}),m.jsx("div",{className:"prose-chat bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-80 overflow-auto text-sm",children:c.body?m.jsx(kg,{remarkPlugins:[Ag],rehypePlugins:[Mg],children:c.body}):m.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"(empty)"})})]}),c.references.length>0&&m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"References"}),m.jsx("ul",{className:"flex flex-col gap-2",children:c.references.map(_=>m.jsx(W4,{skillName:e,file:_.name,lines:_.lines},_.name))})]})]})]})})}function W4({skillName:e,file:t,lines:n}){const[a,s]=M.useState(!1),{data:o,isLoading:c,isError:f,error:d}=lt({queryKey:["skill-ref",e,t],queryFn:()=>BO(e,t),enabled:a,staleTime:1/0});return m.jsxs("li",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[m.jsxs("button",{type:"button",onClick:()=>s(h=>!h),"aria-label":`${a?"收起":"展开"} ${t}`,"aria-expanded":a,className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[m.jsx($p,{size:12,strokeWidth:3,className:["transition-transform",a?"rotate-90":""].join(" ")}),m.jsx(qp,{size:12,strokeWidth:2.5}),m.jsx("span",{className:"flex-1 text-left font-bold",children:t}),m.jsxs("span",{className:"text-xs text-[var(--color-text-subtle)]",children:[n," lines"]})]}),a&&m.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg)] max-h-96 overflow-auto",children:[c&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"加载中…"}),f&&m.jsxs("p",{className:"text-xs text-[var(--color-crashed)]",children:["加载失败: ",d instanceof Error?d.message:String(d)]}),o&&m.jsx("div",{className:"prose-chat text-sm",children:m.jsx(kg,{remarkPlugins:[Ag],rehypePlugins:[Mg],children:o.content})})]})]})}const J4=[{value:"all",label:"全部"},{value:"language",label:"language"},{value:"end",label:"end"},{value:"persona",label:"persona"},{value:"workflow",label:"workflow"},{value:"other",label:"other"}],eB={language:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg-cream)"};function tB(){var x;const[e,t]=M.useState("all"),[n,a]=M.useState(""),[s,o]=M.useState(null),c=qn(),{data:f,isLoading:d}=lt({queryKey:["skills"],queryFn:()=>lg()}),h=lt({queryKey:["projects"],queryFn:wr}),y=M.useMemo(()=>((f==null?void 0:f.data)??[]).filter(S=>!(e!=="all"&&S.category!==e||n&&!S.name.toLowerCase().includes(n.toLowerCase()))),[f,e,n]),g=M.useMemo(()=>{const v=(f==null?void 0:f.data)??[],S={all:v.length};for(const w of v)S[w.category]=(S[w.category]??0)+1;return S},[f]);return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"Skills 🎯"}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:d?"加载中…":`${(f==null?void 0:f.data.length)??0} 个 user-level skill`})]}),m.jsx("div",{className:"flex gap-3 items-center",children:m.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{await qO(),c.invalidateQueries({queryKey:["skills"]})},type:"button",children:[m.jsx(Cl,{size:14,strokeWidth:2.5}),"Sync bundled"]})})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(xf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"搜索 skill…",value:n,onChange:v=>a(v.target.value),"aria-label":"搜索 skill"})]}),m.jsx("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:J4.map(v=>m.jsxs("button",{type:"button",onClick:()=>t(v.value),className:["px-3 py-1 rounded-full text-xs font-bold font-[family-name:var(--font-body)]",e===v.value?"bg-[var(--color-text)] text-[var(--color-bg)]":"text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),children:[v.label," ",g[v.value]]},v.value))})]}),m.jsx("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(280px,1fr))]",children:y.map(v=>{var S;return m.jsx(nB,{skill:v,projectCount:((S=h.data)==null?void 0:S.data.length)??0,onOpen:()=>o(v.name)},v.name)})}),s&&m.jsx(Z4,{name:s,projects:((x=h.data)==null?void 0:x.data.map(v=>v.name))??[],onClose:()=>o(null),onChange:()=>c.invalidateQueries({queryKey:["skills"]})})]})}function nB({skill:e,projectCount:t,onOpen:n}){const a=eB[e.category];return m.jsxs("article",{onClick:n,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n())},tabIndex:0,role:"button","aria-label":`Open ${e.name}`,className:"nb-card nb-card-interactive flex flex-col gap-3",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:e.name}),m.jsx("span",{className:"nb-badge text-[10px]",style:{background:a},children:e.category})]}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] leading-5 line-clamp-3",children:e.description||"(no description)"}),m.jsxs("div",{className:"flex items-center justify-between text-xs font-[family-name:var(--font-mono)] pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)]",children:[m.jsx("span",{className:"font-bold",children:e.linkedProjects.length>0?`● linked in ${e.linkedProjects.length}`:"○ not linked"}),m.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[t," projects"]})]})]})}function iB(){var s;const e=lt({queryKey:["system-info"],queryFn:r1}),t=lt({queryKey:["system-env"],queryFn:$A}),[n,a]=M.useState(!1);return m.jsxs("div",{className:"flex flex-col gap-6 max-w-4xl",children:[m.jsx("header",{children:m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"系统 ⚙️"})}),m.jsx(aB,{current:(s=e.data)==null?void 0:s.version}),m.jsxs("section",{className:"nb-card",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:"运行时"}),e.data?m.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"Node"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.data.nodeVersion}),m.jsx("dt",{className:"font-bold",children:"Platform"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.data.platform}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.data.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Uptime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:oB(e.data.uptimeMs)})]}):m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})]}),m.jsxs("section",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:["全局配置 ",m.jsx("code",{className:"text-sm font-[family-name:var(--font-mono)] font-normal bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"~/.coral/env"})]}),n?m.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold",children:"⚠ 编辑模式"}):m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a(!0),type:"button","aria-label":"编辑 env 文件",children:[m.jsx(Hp,{size:12,strokeWidth:2.5})," 编辑"]})]}),n?m.jsx(rB,{onClose:()=>{a(!1),t.refetch()}}):t.data&&t.data.exists?m.jsx("dl",{className:"grid grid-cols-[220px_1fr] gap-y-1 text-sm font-[family-name:var(--font-mono)]",children:t.data.entries.map(o=>m.jsxs("div",{className:"contents",children:[m.jsxs("dt",{className:"font-bold flex items-center gap-2",children:[o.masked&&m.jsx("span",{className:"text-[var(--color-stuck)]",children:"🔒"}),o.key]}),m.jsx("dd",{className:"text-[var(--color-text-muted)] truncate",children:o.value})]},o.key))}):m.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:['env 文件不存在。点"编辑"或者终端运行 ',m.jsx("code",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded font-[family-name:var(--font-mono)]",children:"sps setup"}),"。"]})]}),m.jsx(sB,{})]})}function aB({current:e}){var S;const{confirm:t,alert:n}=si(),[a,s]=M.useState(!1),[o,c]=M.useState(null),f=lt({queryKey:["latest-version"],queryFn:HA,enabled:!1}),[d,h]=M.useState(null),[y,g]=M.useState("npm i -g @coralai/sps-cli@latest"),x=async()=>{var k;if(await t({title:"升级 sps-cli",body:`当前 ${e},升级到 ${(k=f.data)==null?void 0:k.latest}。要求所有 pipeline 已停止。升级后请重启 sps console 生效。`,confirm:"升级"})){s(!0),c(null),h(null);try{const _=await KA();if(c(_.output),h(_.installedVersion),g(_.command),_.ok)n({title:"升级完成",body:`装上了 v${_.installedVersion}。请 \`pkill -f "sps console"\` 再重启以生效。`});else{const A=_.installedVersion&&_.installedVersion===e?`npm 执行完毕但版本没变(仍 ${_.installedVersion})——多半是权限或 registry 问题。可复制下面的命令在终端手动跑。`:"npm 没装上新版本。可复制命令手动跑,或看下面日志定位。";n({title:"升级未生效",body:A})}}catch(_){c(_.message),n({title:"升级失败",body:_.message})}finally{s(!1)}}},v=async()=>{const w=f.data&&!f.data.upToDate?`npm i -g @coralai/sps-cli@${f.data.latest}`:y;try{await navigator.clipboard.writeText(w),n({title:"命令已复制",body:`粘贴到终端运行即可:
|
|
512
|
+
]`,S={scope:"string",variants:[y,h,g,x]},w={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},k=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],A=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:_,literal:(ae=>{const W=[];return ae.forEach(K=>{W.push(K),K.toLowerCase()===K?W.push(K.toUpperCase()):W.push(K.toLowerCase())}),W})(k),built_in:A},$=ae=>ae.map(W=>W.replace(/\|\d+$/,"")),j={variants:[{match:[/new/,t.concat(v,"+"),t.concat("(?!",$(A).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},q=t.concat(a,"\\b(?!\\()"),U={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),q],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),q],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},Z={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[Z,c,U,e.C_BLOCK_COMMENT_MODE,S,w,j]},P={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",$(_).join("\\b|"),"|",$(A).join("\\b|"),"\\b)"),a,t.concat(v,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(P);const G=[Z,U,e.C_BLOCK_COMMENT_MODE,S,w,j],le={begin:t.concat(/#\[\s*\\?/,t.either(s,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:k,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:k,keyword:["new","array"]},contains:["self",...G]},...G,{scope:"meta",variants:[{match:s},{match:o}]}]};return{case_insensitive:!1,keywords:D,contains:[le,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},c,P,U,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},j,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",le,c,U,e.C_BLOCK_COMMENT_MODE,S,w]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},S,w]}}function u4(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function f4(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function d4(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},y={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,y,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,y,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",v=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,S=`\\b|${a.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${v}))[eE][+-]?(${x})[jJ]?(?=${S})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${x})[jJ](?=${S})`}]},k={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",d,w,g,e.HASH_COMMENT_MODE]}]};return h.contains=[g,w,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[d,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,k,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,_,g]}]}}function h4(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function m4(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[o,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function p4(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(a,/(::\w+)*/),c={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},d={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],y={className:"subst",begin:/#\{/,end:/\}/,keywords:c},g={className:"string",contains:[e.BACKSLASH_ESCAPE,y],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,y]})]}]},x="[1-9](_?[0-9])*|0",v="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${v}))?([eE][+-]?(${v})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:c}]},j=[g,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:c},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:c},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:n}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:c},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,y],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(d,h),relevance:0}].concat(d,h);y.contains=j,w.contains=j;const O=[{begin:/^\s*=>/,starts:{end:"$",contains:j}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:c,contains:j}}];return h.unshift(d),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:c,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(O).concat(h).concat(j)}}function g4(e){const t=e.regex,n=/(r#)?/,a=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],y=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:y,keyword:f,literal:d,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:y}},{className:"punctuation",begin:"->"},o]}}const b4=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),y4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],x4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],v4=[...y4,...x4],E4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),S4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),w4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function k4(e){const t=b4(e),n=w4,a=S4,s="@[a-z-]+",o="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+v4.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_4.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:E4.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function N4(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function T4(e){const t=e.regex,n=e.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],y=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],x=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],v=y,S=[...h,...d].filter($=>!y.includes($)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},k={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...v),/\s*\(/),relevance:0,keywords:{built_in:v}};function A($){return t.concat(/\b/,t.either(...$.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:A(x),relevance:0};function D($,{exceptions:j,when:q}={}){const U=q;return j=j||[],$.map(Z=>Z.match(/\|\d+$/)||j.includes(Z)?Z:U(Z)?`${Z}|0`:Z)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(S,{when:$=>$.length<3}),literal:o,type:f,built_in:g},contains:[{scope:"type",match:A(c)},T,_,w,a,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,k]}}function Ew(e){return e?typeof e=="string"?e:e.source:null}function Vo(e){return gt("(?=",e,")")}function gt(...e){return e.map(n=>Ew(n)).join("")}function C4(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function _n(...e){return"("+(C4(e).capture?"":"?:")+e.map(a=>Ew(a)).join("|")+")"}const Rg=e=>gt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),A4=["Protocol","Type"].map(Rg),Z0=["init","self"].map(Rg),O4=["Any","Self"],Bm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],W0=["false","nil","true"],R4=["assignment","associativity","higherThan","left","lowerThan","none","right"],M4=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],J0=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Sw=_n(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),ww=_n(Sw,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Um=gt(Sw,ww,"*"),_w=_n(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Cf=_n(_w,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),qi=gt(_w,Cf,"*"),sf=gt(/[A-Z]/,Cf,"*"),j4=["attached","autoclosure",gt(/convention\(/,_n("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",gt(/objc\(/,qi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],D4=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function L4(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,_n(...A4,...Z0)],className:{2:"keyword"}},o={match:gt(/\./,_n(...Bm)),relevance:0},c=Bm.filter(We=>typeof We=="string").concat(["_|0"]),f=Bm.filter(We=>typeof We!="string").concat(O4).map(Rg),d={variants:[{className:"keyword",match:_n(...f,...Z0)}]},h={$pattern:_n(/\b\w+/,/#\w+/),keyword:c.concat(M4),literal:W0},y=[s,o,d],g={match:gt(/\./,_n(...J0)),relevance:0},x={className:"built_in",match:gt(/\b/,_n(...J0),/(?=\()/)},v=[g,x],S={match:/->/,relevance:0},w={className:"operator",relevance:0,variants:[{match:Um},{match:`\\.(\\.|${ww})+`}]},k=[S,w],_="([0-9]_*)+",A="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${_})(\\.(${_}))?([eE][+-]?(${_}))?\\b`},{match:`\\b0x(${A})(\\.(${A}))?([pP][+-]?(${_}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},D=(We="")=>({className:"subst",variants:[{match:gt(/\\/,We,/[0\\tnr"']/)},{match:gt(/\\/,We,/u\{[0-9a-fA-F]{1,8}\}/)}]}),$=(We="")=>({className:"subst",match:gt(/\\/,We,/[\t ]*(?:[\r\n]|\r\n)/)}),j=(We="")=>({className:"subst",label:"interpol",begin:gt(/\\/,We,/\(/),end:/\)/}),q=(We="")=>({begin:gt(We,/"""/),end:gt(/"""/,We),contains:[D(We),$(We),j(We)]}),U=(We="")=>({begin:gt(We,/"/),end:gt(/"/,We),contains:[D(We),j(We)]}),Z={className:"string",variants:[q(),q("#"),q("##"),q("###"),U(),U("#"),U("##"),U("###")]},O=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],P={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:O},G=We=>{const _i=gt(We,/\//),li=gt(/\//,We);return{begin:_i,end:li,contains:[...O,{scope:"comment",begin:`#(?!.*${li})`,end:/$/}]}},le={scope:"regexp",variants:[G("###"),G("##"),G("#"),P]},ae={match:gt(/`/,qi,/`/)},W={className:"variable",match:/\$\d+/},K={className:"variable",match:`\\$${Cf}+`},oe=[ae,W,K],V={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:D4,contains:[...k,T,Z]}]}},pe={scope:"keyword",match:gt(/@/,_n(...j4),Vo(_n(/\(/,/\s+/)))},R={scope:"meta",match:gt(/@/,qi)},L=[V,pe,R],J={match:Vo(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:gt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Cf,"+")},{className:"type",match:sf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:gt(/\s+&\s+/,Vo(sf)),relevance:0}]},C={begin:/</,end:/>/,keywords:h,contains:[...a,...y,...L,S,J]};J.contains.push(C);const me={match:gt(qi,/\s*:/),keywords:"_|0",relevance:0},_e={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",me,...a,le,...y,...v,...k,T,Z,...oe,...L,J]},ve={begin:/</,end:/>/,keywords:"repeat each",contains:[...a,J]},ce={begin:_n(Vo(gt(qi,/\s*:/)),Vo(gt(qi,/\s+/,qi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:qi}]},ke={begin:/\(/,end:/\)/,keywords:h,contains:[ce,...a,...y,...k,T,Z,...L,J,_e],endsParent:!0,illegal:/["']/},Ke={match:[/(func|macro)/,/\s+/,_n(ae.match,qi,Um)],className:{1:"keyword",3:"title.function"},contains:[ve,ke,t],illegal:[/\[/,/%/]},Dt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ve,ke,t],illegal:/\[|%/},yn={match:[/operator/,/\s+/,Um],className:{1:"keyword",3:"title"}},Wi={begin:[/precedencegroup/,/\s+/,sf],className:{1:"keyword",3:"title"},contains:[J],keywords:[...R4,...W0],end:/}/},Oa={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Kn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Li={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,qi,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[ve,...y,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:sf},...y],relevance:0}]};for(const We of Z.variants){const _i=We.contains.find(Ii=>Ii.label==="interpol");_i.keywords=h;const li=[...y,...v,...k,T,Z,...oe];_i.contains=[...li,{begin:/\(/,end:/\)/,contains:["self",...li]}]}return{name:"Swift",keywords:h,contains:[...a,Ke,Dt,Oa,Kn,Li,yn,Wi,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},le,...y,...v,...k,T,Z,...oe,...L,J,_e]}}const Af="[A-Za-z$_][0-9A-Za-z$_]*",kw=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Nw=["true","false","null","undefined","NaN","Infinity"],Tw=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Cw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Aw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ow=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rw=[].concat(Aw,Tw,Cw);function I4(e){const t=e.regex,n=(V,{after:pe})=>{const R="</"+V[0].slice(1);return V.input.indexOf(R,pe)!==-1},a=Af,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,pe)=>{const R=V[0].length+V.index,L=V.input[R];if(L==="<"||L===","){pe.ignoreMatch();return}L===">"&&(n(V,{after:R})||pe.ignoreMatch());let J;const C=V.input.substring(R);if(J=C.match(/^\s*=/)){pe.ignoreMatch();return}if((J=C.match(/^\s+extends\s+/))&&J.index===0){pe.ignoreMatch();return}}},f={$pattern:Af,keyword:kw,literal:Nw,built_in:Rw,"variable.language":Ow},d="[0-9](_?[0-9])*",h=`\\.(${d})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${y})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${y})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},x={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,x],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,x]},A={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,w,k,{match:/\$\d+/},g];x.contains=T.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(T)});const D=[].concat(A,x.contains),$=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(D)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$},q={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,t.concat(a,"(",t.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},U={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Tw,...Cw]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(V){return t.concat("(?!",V.join("|"),")")}const le={match:t.concat(/\b/,G([...Aw,"super","import"].map(V=>`${V}\\s*\\(`)),a,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:t.concat(/\./,t.lookahead(t.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},K="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",oe={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(K)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:U},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,v,S,w,k,A,{match:/\$\d+/},g,U,{scope:"attr",match:a+t.lookahead(":"),relevance:0},oe,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,e.REGEXP_MODE,{className:"function",begin:K,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},le,P,q,W,{match:/\$[(.]/}]}}function z4(e){const t=e.regex,n=I4(e),a=Af,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Af,keyword:kw.concat(d),literal:Nw,built_in:Rw.concat(s),"variable.language":Ow},y={className:"meta",begin:"@"+a},g=(w,k,_)=>{const A=w.contains.findIndex(T=>T.label===k);if(A===-1)throw new Error("can not find mode to replace");w.contains.splice(A,1,_)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(y);const x=n.contains.find(w=>w.scope==="attr"),v=Object.assign({},x,{match:t.concat(a,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,x,v]),n.contains=n.contains.concat([y,o,c,v]),g(n,"shebang",e.SHEBANG()),g(n,"use_strict",f);const S=n.contains.find(w=>w.label==="func.def");return S.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function B4(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,c=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,d={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,s),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,c,/ *#/)},{begin:t.concat(/# */,t.either(o,s),/ +/,t.either(c,f),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},y={className:"label",begin:/^\w+:/},g=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,a,d,h,y,g,x,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[x]}]}}function U4(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),a=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},c={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},d={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:a},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,c,s,e.QUOTE_STRING_MODE,d,h,f]}}function F4(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(o,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,d,f,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,c,d,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function $4(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},f=e.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},S={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},k=[a,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},x,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,w,o,c],_=[...k];return _.pop(),_.push(f),v.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:k}}const P4={arduino:wz,bash:_z,c:kz,cpp:Nz,csharp:Tz,css:Iz,diff:zz,go:Bz,graphql:Uz,ini:Fz,java:$z,javascript:Gz,json:Qz,kotlin:Vz,less:i4,lua:a4,makefile:r4,markdown:s4,objectivec:l4,perl:o4,php:c4,"php-template":u4,plaintext:f4,python:d4,"python-repl":h4,r:m4,ruby:p4,rust:g4,scss:k4,shell:N4,sql:T4,swift:L4,typescript:z4,vbnet:B4,wasm:U4,xml:F4,yaml:$4};var Fm,eE;function q4(){if(eE)return Fm;eE=1;function e(B){return B instanceof Map?B.clear=B.delete=B.set=function(){throw new Error("map is read-only")}:B instanceof Set&&(B.add=B.clear=B.delete=function(){throw new Error("set is read-only")}),Object.freeze(B),Object.getOwnPropertyNames(B).forEach(ie=>{const ge=B[ie],Le=typeof ge;(Le==="object"||Le==="function")&&!Object.isFrozen(ge)&&e(ge)}),B}class t{constructor(ie){ie.data===void 0&&(ie.data={}),this.data=ie.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(B){return B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(B,...ie){const ge=Object.create(null);for(const Le in B)ge[Le]=B[Le];return ie.forEach(function(Le){for(const wt in Le)ge[wt]=Le[wt]}),ge}const s="</span>",o=B=>!!B.scope,c=(B,{prefix:ie})=>{if(B.startsWith("language:"))return B.replace("language:","language-");if(B.includes(".")){const ge=B.split(".");return[`${ie}${ge.shift()}`,...ge.map((Le,wt)=>`${Le}${"_".repeat(wt+1)}`)].join(" ")}return`${ie}${B}`};class f{constructor(ie,ge){this.buffer="",this.classPrefix=ge.classPrefix,ie.walk(this)}addText(ie){this.buffer+=n(ie)}openNode(ie){if(!o(ie))return;const ge=c(ie.scope,{prefix:this.classPrefix});this.span(ge)}closeNode(ie){o(ie)&&(this.buffer+=s)}value(){return this.buffer}span(ie){this.buffer+=`<span class="${ie}">`}}const d=(B={})=>{const ie={children:[]};return Object.assign(ie,B),ie};class h{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ie){this.top.children.push(ie)}openNode(ie){const ge=d({scope:ie});this.add(ge),this.stack.push(ge)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ie){return this.constructor._walk(ie,this.rootNode)}static _walk(ie,ge){return typeof ge=="string"?ie.addText(ge):ge.children&&(ie.openNode(ge),ge.children.forEach(Le=>this._walk(ie,Le)),ie.closeNode(ge)),ie}static _collapse(ie){typeof ie!="string"&&ie.children&&(ie.children.every(ge=>typeof ge=="string")?ie.children=[ie.children.join("")]:ie.children.forEach(ge=>{h._collapse(ge)}))}}class y extends h{constructor(ie){super(),this.options=ie}addText(ie){ie!==""&&this.add(ie)}startScope(ie){this.openNode(ie)}endScope(){this.closeNode()}__addSublanguage(ie,ge){const Le=ie.root;ge&&(Le.scope=`language:${ge}`),this.add(Le)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(B){return B?typeof B=="string"?B:B.source:null}function x(B){return w("(?=",B,")")}function v(B){return w("(?:",B,")*")}function S(B){return w("(?:",B,")?")}function w(...B){return B.map(ge=>g(ge)).join("")}function k(B){const ie=B[B.length-1];return typeof ie=="object"&&ie.constructor===Object?(B.splice(B.length-1,1),ie):{}}function _(...B){return"("+(k(B).capture?"":"?:")+B.map(Le=>g(Le)).join("|")+")"}function A(B){return new RegExp(B.toString()+"|").exec("").length-1}function T(B,ie){const ge=B&&B.exec(ie);return ge&&ge.index===0}const D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function $(B,{joinWith:ie}){let ge=0;return B.map(Le=>{ge+=1;const wt=ge;let bt=g(Le),Ee="";for(;bt.length>0;){const ye=D.exec(bt);if(!ye){Ee+=bt;break}Ee+=bt.substring(0,ye.index),bt=bt.substring(ye.index+ye[0].length),ye[0][0]==="\\"&&ye[1]?Ee+="\\"+String(Number(ye[1])+wt):(Ee+=ye[0],ye[0]==="("&&ge++)}return Ee}).map(Le=>`(${Le})`).join(ie)}const j=/\b\B/,q="[a-zA-Z]\\w*",U="[a-zA-Z_]\\w*",Z="\\b\\d+(\\.\\d+)?",O="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",le=(B={})=>{const ie=/^#![ ]*\//;return B.binary&&(B.begin=w(ie,/.*\b/,B.binary,/\b.*/)),a({scope:"meta",begin:ie,end:/$/,relevance:0,"on:begin":(ge,Le)=>{ge.index!==0&&Le.ignoreMatch()}},B)},ae={begin:"\\\\[\\s\\S]",relevance:0},W={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ae]},K={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ae]},oe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},V=function(B,ie,ge={}){const Le=a({scope:"comment",begin:B,end:ie,contains:[]},ge);Le.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const wt=_("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Le.contains.push({begin:w(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Le},pe=V("//","$"),R=V("/\\*","\\*/"),L=V("#","$"),J={scope:"number",begin:Z,relevance:0},C={scope:"number",begin:O,relevance:0},me={scope:"number",begin:P,relevance:0},_e={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},ve={scope:"title",begin:q,relevance:0},ce={scope:"title",begin:U,relevance:0},ke={begin:"\\.\\s*"+U,relevance:0};var Dt=Object.freeze({__proto__:null,APOS_STRING_MODE:W,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:me,BINARY_NUMBER_RE:P,COMMENT:V,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:pe,C_NUMBER_MODE:C,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(B){return Object.assign(B,{"on:begin":(ie,ge)=>{ge.data._beginMatch=ie[1]},"on:end":(ie,ge)=>{ge.data._beginMatch!==ie[1]&&ge.ignoreMatch()}})},HASH_COMMENT_MODE:L,IDENT_RE:q,MATCH_NOTHING_RE:j,METHOD_GUARD:ke,NUMBER_MODE:J,NUMBER_RE:Z,PHRASAL_WORDS_MODE:oe,QUOTE_STRING_MODE:K,REGEXP_MODE:_e,RE_STARTERS_RE:G,SHEBANG:le,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:U,UNDERSCORE_TITLE_MODE:ce});function yn(B,ie){B.input[B.index-1]==="."&&ie.ignoreMatch()}function Wi(B,ie){B.className!==void 0&&(B.scope=B.className,delete B.className)}function Oa(B,ie){ie&&B.beginKeywords&&(B.begin="\\b("+B.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",B.__beforeBegin=yn,B.keywords=B.keywords||B.beginKeywords,delete B.beginKeywords,B.relevance===void 0&&(B.relevance=0))}function Kn(B,ie){Array.isArray(B.illegal)&&(B.illegal=_(...B.illegal))}function Li(B,ie){if(B.match){if(B.begin||B.end)throw new Error("begin & end are not supported with match");B.begin=B.match,delete B.match}}function We(B,ie){B.relevance===void 0&&(B.relevance=1)}const _i=(B,ie)=>{if(!B.beforeMatch)return;if(B.starts)throw new Error("beforeMatch cannot be used with starts");const ge=Object.assign({},B);Object.keys(B).forEach(Le=>{delete B[Le]}),B.keywords=ge.keywords,B.begin=w(ge.beforeMatch,x(ge.begin)),B.starts={relevance:0,contains:[Object.assign(ge,{endsParent:!0})]},B.relevance=0,delete ge.beforeMatch},li=["of","and","for","in","not","or","if","then","parent","list","value"],Ii="keyword";function Ji(B,ie,ge=Ii){const Le=Object.create(null);return typeof B=="string"?wt(ge,B.split(" ")):Array.isArray(B)?wt(ge,B):Object.keys(B).forEach(function(bt){Object.assign(Le,Ji(B[bt],ie,bt))}),Le;function wt(bt,Ee){ie&&(Ee=Ee.map(ye=>ye.toLowerCase())),Ee.forEach(function(ye){const De=ye.split("|");Le[De[0]]=[bt,Tr(De[0],De[1])]})}}function Tr(B,ie){return ie?Number(ie):Gl(B)?0:1}function Gl(B){return li.includes(B.toLowerCase())}const bs={},Ot=B=>{console.error(B)},ys=(B,...ie)=>{console.log(`WARN: ${B}`,...ie)},te=(B,ie)=>{bs[`${B}/${ie}`]||(console.log(`Deprecated as of ${B}. ${ie}`),bs[`${B}/${ie}`]=!0)},de=new Error;function Oe(B,ie,{key:ge}){let Le=0;const wt=B[ge],bt={},Ee={};for(let ye=1;ye<=ie.length;ye++)Ee[ye+Le]=wt[ye],bt[ye+Le]=!0,Le+=A(ie[ye-1]);B[ge]=Ee,B[ge]._emit=bt,B[ge]._multi=!0}function qe(B){if(Array.isArray(B.begin)){if(B.skip||B.excludeBegin||B.returnBegin)throw Ot("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof B.beginScope!="object"||B.beginScope===null)throw Ot("beginScope must be object"),de;Oe(B,B.begin,{key:"beginScope"}),B.begin=$(B.begin,{joinWith:""})}}function nt(B){if(Array.isArray(B.end)){if(B.skip||B.excludeEnd||B.returnEnd)throw Ot("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof B.endScope!="object"||B.endScope===null)throw Ot("endScope must be object"),de;Oe(B,B.end,{key:"endScope"}),B.end=$(B.end,{joinWith:""})}}function xn(B){B.scope&&typeof B.scope=="object"&&B.scope!==null&&(B.beginScope=B.scope,delete B.scope)}function ki(B){xn(B),typeof B.beginScope=="string"&&(B.beginScope={_wrap:B.beginScope}),typeof B.endScope=="string"&&(B.endScope={_wrap:B.endScope}),qe(B),nt(B)}function an(B){function ie(Ee,ye){return new RegExp(g(Ee),"m"+(B.case_insensitive?"i":"")+(B.unicodeRegex?"u":"")+(ye?"g":""))}class ge{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ye,De){De.position=this.position++,this.matchIndexes[this.matchAt]=De,this.regexes.push([De,ye]),this.matchAt+=A(ye)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ye=this.regexes.map(De=>De[1]);this.matcherRe=ie($(ye,{joinWith:"|"}),!0),this.lastIndex=0}exec(ye){this.matcherRe.lastIndex=this.lastIndex;const De=this.matcherRe.exec(ye);if(!De)return null;const Ut=De.findIndex((ea,vs)=>vs>0&&ea!==void 0),Nt=this.matchIndexes[Ut];return De.splice(0,Ut),Object.assign(De,Nt)}}class Le{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ye){if(this.multiRegexes[ye])return this.multiRegexes[ye];const De=new ge;return this.rules.slice(ye).forEach(([Ut,Nt])=>De.addRule(Ut,Nt)),De.compile(),this.multiRegexes[ye]=De,De}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ye,De){this.rules.push([ye,De]),De.type==="begin"&&this.count++}exec(ye){const De=this.getMatcher(this.regexIndex);De.lastIndex=this.lastIndex;let Ut=De.exec(ye);if(this.resumingScanAtSamePosition()&&!(Ut&&Ut.index===this.lastIndex)){const Nt=this.getMatcher(0);Nt.lastIndex=this.lastIndex+1,Ut=Nt.exec(ye)}return Ut&&(this.regexIndex+=Ut.position+1,this.regexIndex===this.count&&this.considerAll()),Ut}}function wt(Ee){const ye=new Le;return Ee.contains.forEach(De=>ye.addRule(De.begin,{rule:De,type:"begin"})),Ee.terminatorEnd&&ye.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&ye.addRule(Ee.illegal,{type:"illegal"}),ye}function bt(Ee,ye){const De=Ee;if(Ee.isCompiled)return De;[Wi,Li,ki,_i].forEach(Nt=>Nt(Ee,ye)),B.compilerExtensions.forEach(Nt=>Nt(Ee,ye)),Ee.__beforeBegin=null,[Oa,Kn,We].forEach(Nt=>Nt(Ee,ye)),Ee.isCompiled=!0;let Ut=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),Ut=Ee.keywords.$pattern,delete Ee.keywords.$pattern),Ut=Ut||/\w+/,Ee.keywords&&(Ee.keywords=Ji(Ee.keywords,B.case_insensitive)),De.keywordPatternRe=ie(Ut,!0),ye&&(Ee.begin||(Ee.begin=/\B|\b/),De.beginRe=ie(De.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(De.endRe=ie(De.end)),De.terminatorEnd=g(De.end)||"",Ee.endsWithParent&&ye.terminatorEnd&&(De.terminatorEnd+=(Ee.end?"|":"")+ye.terminatorEnd)),Ee.illegal&&(De.illegalRe=ie(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Nt){return un(Nt==="self"?Ee:Nt)})),Ee.contains.forEach(function(Nt){bt(Nt,De)}),Ee.starts&&bt(Ee.starts,ye),De.matcher=wt(De),De}if(B.compilerExtensions||(B.compilerExtensions=[]),B.contains&&B.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return B.classNameAliases=a(B.classNameAliases||{}),bt(B)}function Lt(B){return B?B.endsWithParent||Lt(B.starts):!1}function un(B){return B.variants&&!B.cachedVariants&&(B.cachedVariants=B.variants.map(function(ie){return a(B,{variants:null},ie)})),B.cachedVariants?B.cachedVariants:Lt(B)?a(B,{starts:B.starts?a(B.starts):null}):Object.isFrozen(B)?a(B):B}var ot="11.11.1";class zi extends Error{constructor(ie,ge){super(ie),this.name="HTMLInjectionError",this.html=ge}}const vn=n,Nc=a,Cr=Symbol("nomatch"),xs=7,Ar=function(B){const ie=Object.create(null),ge=Object.create(null),Le=[];let wt=!0;const bt="Could not find the language '{}', did you forget to load/include a language module?",Ee={disableAutodetect:!0,name:"Plain text",contains:[]};let ye={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:y};function De(ue){return ye.noHighlightRe.test(ue)}function Ut(ue){let Ne=ue.className+" ";Ne+=ue.parentNode?ue.parentNode.className:"";const He=ye.languageDetectRe.exec(Ne);if(He){const ct=En(He[1]);return ct||(ys(bt.replace("{}",He[1])),ys("Falling back to no-highlight mode for this block.",ue)),ct?He[1]:"no-highlight"}return Ne.split(/\s+/).find(ct=>De(ct)||En(ct))}function Nt(ue,Ne,He){let ct="",$t="";typeof Ne=="object"?(ct=ue,He=Ne.ignoreIllegals,$t=Ne.language):(te("10.7.0","highlight(lang, code, ...args) has been deprecated."),te("10.7.0",`Please use highlight(code, options) instead.
|
|
513
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),$t=ue,ct=Ne),He===void 0&&(He=!0);const dn={code:ct,language:$t};Rr("before:highlight",dn);const Gn=dn.result?dn.result:ea(dn.language,dn.code,He);return Gn.code=dn.code,Rr("after:highlight",Gn),Gn}function ea(ue,Ne,He,ct){const $t=Object.create(null);function dn(he,Se){return he.keywords[Se]}function Gn(){if(!je.keywords){Gt.addText(ut);return}let he=0;je.keywordPatternRe.lastIndex=0;let Se=je.keywordPatternRe.exec(ut),Be="";for(;Se;){Be+=ut.substring(he,Se.index);const Ve=rn.case_insensitive?Se[0].toLowerCase():Se[0],Rt=dn(je,Ve);if(Rt){const[oi,Wl]=Rt;if(Gt.addText(Be),Be="",$t[Ve]=($t[Ve]||0)+1,$t[Ve]<=xs&&(Da+=Wl),oi.startsWith("_"))Be+=Se[0];else{const jc=rn.classNameAliases[oi]||oi;Qn(Se[0],jc)}}else Be+=Se[0];he=je.keywordPatternRe.lastIndex,Se=je.keywordPatternRe.exec(ut)}Be+=ut.substring(he),Gt.addText(Be)}function An(){if(ut==="")return;let he=null;if(typeof je.subLanguage=="string"){if(!ie[je.subLanguage]){Gt.addText(ut);return}he=ea(je.subLanguage,ut,!0,Mc[je.subLanguage]),Mc[je.subLanguage]=he._top}else he=Es(ut,je.subLanguage.length?je.subLanguage:null);je.relevance>0&&(Da+=he.relevance),Gt.__addSublanguage(he._emitter,he.language)}function Et(){je.subLanguage!=null?An():Gn(),ut=""}function Qn(he,Se){he!==""&&(Gt.startScope(Se),Gt.addText(he),Gt.endScope())}function Oc(he,Se){let Be=1;const Ve=Se.length-1;for(;Be<=Ve;){if(!he._emit[Be]){Be++;continue}const Rt=rn.classNameAliases[he[Be]]||he[Be],oi=Se[Be];Rt?Qn(oi,Rt):(ut=oi,Gn(),ut=""),Be++}}function ws(he,Se){return he.scope&&typeof he.scope=="string"&&Gt.openNode(rn.classNameAliases[he.scope]||he.scope),he.beginScope&&(he.beginScope._wrap?(Qn(ut,rn.classNameAliases[he.beginScope._wrap]||he.beginScope._wrap),ut=""):he.beginScope._multi&&(Oc(he.beginScope,Se),ut="")),je=Object.create(he,{parent:{value:je}}),je}function Vl(he,Se,Be){let Ve=T(he.endRe,Be);if(Ve){if(he["on:end"]){const Rt=new t(he);he["on:end"](Se,Rt),Rt.isMatchIgnored&&(Ve=!1)}if(Ve){for(;he.endsParent&&he.parent;)he=he.parent;return he}}if(he.endsWithParent)return Vl(he.parent,Se,Be)}function _s(he){return je.matcher.regexIndex===0?(ut+=he[0],1):(La=!0,0)}function ed(he){const Se=he[0],Be=he.rule,Ve=new t(Be),Rt=[Be.__beforeBegin,Be["on:begin"]];for(const oi of Rt)if(oi&&(oi(he,Ve),Ve.isMatchIgnored))return _s(Se);return Be.skip?ut+=Se:(Be.excludeBegin&&(ut+=Se),Et(),!Be.returnBegin&&!Be.excludeBegin&&(ut=Se)),ws(Be,he),Be.returnBegin?0:Se.length}function On(he){const Se=he[0],Be=Ne.substring(he.index),Ve=Vl(je,he,Be);if(!Ve)return Cr;const Rt=je;je.endScope&&je.endScope._wrap?(Et(),Qn(Se,je.endScope._wrap)):je.endScope&&je.endScope._multi?(Et(),Oc(je.endScope,he)):Rt.skip?ut+=Se:(Rt.returnEnd||Rt.excludeEnd||(ut+=Se),Et(),Rt.excludeEnd&&(ut=Se));do je.scope&&Gt.closeNode(),!je.skip&&!je.subLanguage&&(Da+=je.relevance),je=je.parent;while(je!==Ve.parent);return Ve.starts&&ws(Ve.starts,he),Rt.returnEnd?0:Se.length}function Xl(){const he=[];for(let Se=je;Se!==rn;Se=Se.parent)Se.scope&&he.unshift(Se.scope);he.forEach(Se=>Gt.openNode(Se))}let Mr={};function ks(he,Se){const Be=Se&&Se[0];if(ut+=he,Be==null)return Et(),0;if(Mr.type==="begin"&&Se.type==="end"&&Mr.index===Se.index&&Be===""){if(ut+=Ne.slice(Se.index,Se.index+1),!wt){const Ve=new Error(`0 width match regex (${ue})`);throw Ve.languageName=ue,Ve.badRule=Mr.rule,Ve}return 1}if(Mr=Se,Se.type==="begin")return ed(Se);if(Se.type==="illegal"&&!He){const Ve=new Error('Illegal lexeme "'+Be+'" for mode "'+(je.scope||"<unnamed>")+'"');throw Ve.mode=je,Ve}else if(Se.type==="end"){const Ve=On(Se);if(Ve!==Cr)return Ve}if(Se.type==="illegal"&&Be==="")return ut+=`
|
|
514
|
+
`,1;if(Zl>1e5&&Zl>Se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ut+=Be,Be.length}const rn=En(ue);if(!rn)throw Ot(bt.replace("{}",ue)),new Error('Unknown language: "'+ue+'"');const Rc=an(rn);let Ns="",je=ct||Rc;const Mc={},Gt=new ye.__emitter(ye);Xl();let ut="",Da=0,ia=0,Zl=0,La=!1;try{if(rn.__emitTokens)rn.__emitTokens(Ne,Gt);else{for(je.matcher.considerAll();;){Zl++,La?La=!1:je.matcher.considerAll(),je.matcher.lastIndex=ia;const he=je.matcher.exec(Ne);if(!he)break;const Se=Ne.substring(ia,he.index),Be=ks(Se,he);ia=he.index+Be}ks(Ne.substring(ia))}return Gt.finalize(),Ns=Gt.toHTML(),{language:ue,value:Ns,relevance:Da,illegal:!1,_emitter:Gt,_top:je}}catch(he){if(he.message&&he.message.includes("Illegal"))return{language:ue,value:vn(Ne),illegal:!0,relevance:0,_illegalBy:{message:he.message,index:ia,context:Ne.slice(ia-100,ia+100),mode:he.mode,resultSoFar:Ns},_emitter:Gt};if(wt)return{language:ue,value:vn(Ne),illegal:!1,relevance:0,errorRaised:he,_emitter:Gt,_top:je};throw he}}function vs(ue){const Ne={value:vn(ue),illegal:!1,relevance:0,_top:Ee,_emitter:new ye.__emitter(ye)};return Ne._emitter.addText(ue),Ne}function Es(ue,Ne){Ne=Ne||ye.languages||Object.keys(ie);const He=vs(ue),ct=Ne.filter(En).filter(Ma).map(Et=>ea(Et,ue,!1));ct.unshift(He);const $t=ct.sort((Et,Qn)=>{if(Et.relevance!==Qn.relevance)return Qn.relevance-Et.relevance;if(Et.language&&Qn.language){if(En(Et.language).supersetOf===Qn.language)return 1;if(En(Qn.language).supersetOf===Et.language)return-1}return 0}),[dn,Gn]=$t,An=dn;return An.secondBest=Gn,An}function Bi(ue,Ne,He){const ct=Ne&&ge[Ne]||He;ue.classList.add("hljs"),ue.classList.add(`language-${ct}`)}function Ft(ue){let Ne=null;const He=Ut(ue);if(De(He))return;if(Rr("before:highlightElement",{el:ue,language:He}),ue.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ue);return}if(ue.children.length>0&&(ye.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ue)),ye.throwUnescapedHTML))throw new zi("One of your code blocks includes unescaped HTML.",ue.innerHTML);Ne=ue;const ct=Ne.textContent,$t=He?Nt(ct,{language:He,ignoreIllegals:!0}):Es(ct);ue.innerHTML=$t.value,ue.dataset.highlighted="yes",Bi(ue,He,$t.language),ue.result={language:$t.language,re:$t.relevance,relevance:$t.relevance},$t.secondBest&&(ue.secondBest={language:$t.secondBest.language,relevance:$t.secondBest.relevance}),Rr("after:highlightElement",{el:ue,result:$t,text:ct})}function fn(ue){ye=Nc(ye,ue)}const Ra=()=>{Ss(),te("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ql(){Ss(),te("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Tc=!1;function Ss(){function ue(){Ss()}if(document.readyState==="loading"){Tc||window.addEventListener("DOMContentLoaded",ue,!1),Tc=!0;return}document.querySelectorAll(ye.cssSelector).forEach(Ft)}function Cc(ue,Ne){let He=null;try{He=Ne(B)}catch(ct){if(Ot("Language definition for '{}' could not be registered.".replace("{}",ue)),wt)Ot(ct);else throw ct;He=Ee}He.name||(He.name=ue),ie[ue]=He,He.rawDefinition=Ne.bind(null,B),He.aliases&&ta(He.aliases,{languageName:ue})}function Or(ue){delete ie[ue];for(const Ne of Object.keys(ge))ge[Ne]===ue&&delete ge[Ne]}function Yl(){return Object.keys(ie)}function En(ue){return ue=(ue||"").toLowerCase(),ie[ue]||ie[ge[ue]]}function ta(ue,{languageName:Ne}){typeof ue=="string"&&(ue=[ue]),ue.forEach(He=>{ge[He.toLowerCase()]=Ne})}function Ma(ue){const Ne=En(ue);return Ne&&!Ne.disableAutodetect}function ja(ue){ue["before:highlightBlock"]&&!ue["before:highlightElement"]&&(ue["before:highlightElement"]=Ne=>{ue["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),ue["after:highlightBlock"]&&!ue["after:highlightElement"]&&(ue["after:highlightElement"]=Ne=>{ue["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function Kt(ue){ja(ue),Le.push(ue)}function Ac(ue){const Ne=Le.indexOf(ue);Ne!==-1&&Le.splice(Ne,1)}function Rr(ue,Ne){const He=ue;Le.forEach(function(ct){ct[He]&&ct[He](Ne)})}function na(ue){return te("10.7.0","highlightBlock will be removed entirely in v12.0"),te("10.7.0","Please use highlightElement now."),Ft(ue)}Object.assign(B,{highlight:Nt,highlightAuto:Es,highlightAll:Ss,highlightElement:Ft,highlightBlock:na,configure:fn,initHighlighting:Ra,initHighlightingOnLoad:Ql,registerLanguage:Cc,unregisterLanguage:Or,listLanguages:Yl,getLanguage:En,registerAliases:ta,autoDetection:Ma,inherit:Nc,addPlugin:Kt,removePlugin:Ac}),B.debugMode=function(){wt=!1},B.safeMode=function(){wt=!0},B.versionString=ot,B.regex={concat:w,lookahead:x,either:_,optional:S,anyNumberOfTimes:v};for(const ue in Dt)typeof Dt[ue]=="object"&&e(Dt[ue]);return Object.assign(B,Dt),B},Cn=Ar({});return Cn.newInstance=()=>Ar({}),Fm=Cn,Cn.HighlightJS=Cn,Cn.default=Cn,Fm}var H4=q4();const K4=Np(H4),tE={},G4="hljs-";function Q4(e){const t=K4.newInstance();return e&&o(e),{highlight:n,highlightAuto:a,listLanguages:s,register:o,registerAlias:c,registered:f};function n(d,h,y){const g=y||tE,x=typeof g.prefix=="string"?g.prefix:G4;if(!t.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");t.configure({__emitter:Y4,classPrefix:x});const v=t.highlight(h,{ignoreIllegals:!0,language:d});if(v.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:v.errorRaised});const S=v._emitter.root,w=S.data;return w.language=v.language,w.relevance=v.relevance,S}function a(d,h){const g=(h||tE).subset||s();let x=-1,v=0,S;for(;++x<g.length;){const w=g[x];if(!t.getLanguage(w))continue;const k=n(w,d,h);k.data&&k.data.relevance!==void 0&&k.data.relevance>v&&(v=k.data.relevance,S=k)}return S||{type:"root",children:[],data:{language:void 0,relevance:v}}}function s(){return t.listLanguages()}function o(d,h){if(typeof d=="string")t.registerLanguage(d,h);else{let y;for(y in d)Object.hasOwn(d,y)&&t.registerLanguage(y,d[y])}}function c(d,h){if(typeof d=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:d});else{let y;for(y in d)if(Object.hasOwn(d,y)){const g=d[y];t.registerAliases(typeof g=="string"?g:[...g],{languageName:y})}}}function f(d){return!!t.getLanguage(d)}}class Y4{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],a=n.children[n.children.length-1];a&&a.type==="text"?a.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const a=this.stack[this.stack.length-1],s=t.root.children;n?a.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):a.children.push(...s)}openNode(t){const n=this,a=t.split(".").map(function(c,f){return f?c+"_".repeat(f):n.options.classPrefix+c}),s=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:a},children:[]};s.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const V4={};function Mg(e){const t=e||V4,n=t.aliases,a=t.detect||!1,s=t.languages||P4,o=t.plainText,c=t.prefix,f=t.subset;let d="hljs";const h=Q4(s);if(n&&h.registerAlias(n),c){const y=c.indexOf("-");d=y===-1?c:c.slice(0,y)}return function(y,g){Jf(y,"element",function(x,v,S){if(x.tagName!=="code"||!S||S.type!=="element"||S.tagName!=="pre")return;const w=X4(x);if(w===!1||!w&&!a||w&&o&&o.includes(w))return;Array.isArray(x.properties.className)||(x.properties.className=[]),x.properties.className.includes(d)||x.properties.className.unshift(d);const k=pz(x,{whitespace:"pre"});let _;try{_=w?h.highlight(w,k,{prefix:c}):h.highlightAuto(k,{prefix:c,subset:f})}catch(A){const T=A;if(w&&/Unknown language/.test(T.message)){g.message("Cannot highlight as `"+w+"`, it’s not registered",{ancestors:[S,x],cause:T,place:x.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!w&&_.data&&_.data.language&&x.properties.className.push("language-"+_.data.language),_.children.length>0&&(x.children=_.children)})}}function X4(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let a;for(;++n<t.length;){const s=String(t[n]);if(s==="no-highlight"||s==="nohighlight")return!1;!a&&s.slice(0,5)==="lang-"&&(a=s.slice(5)),!a&&s.slice(0,9)==="language-"&&(a=s.slice(9))}return a}function Z4({name:e,projects:t,onClose:n,onChange:a}){const{confirm:s,alert:o}=si(),{data:c,isLoading:f,isError:d,error:h,refetch:y}=lt({queryKey:["skill",e],queryFn:()=>zO(e)});M.useEffect(()=>{const _=A=>{A.key==="Escape"&&n()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n]);const g=async(_,A)=>{try{await A(),await y(),a()}catch(T){o({title:`${_}失败`,body:T instanceof Error?T.message:String(T)})}},x=_=>g("link",()=>UO(e,_)),v=async _=>{await s({title:`从 ${_} 移除 ${e}`,body:"skill 链接会被解除,项目后续运行时将无法使用该 skill。",confirm:"移除",danger:!0})&&await g("unlink",()=>FO(e,_))},S=_=>g("freeze",()=>$O(e,_)),w=async _=>{await s({title:`解冻 ${e} @ ${_}`,body:"本地对这个 skill 的改动会被覆盖,回到最新共享版本。",confirm:"解冻",danger:!0})&&await g("unfreeze",()=>PO(e,_))},k=new Map(((c==null?void 0:c.linkedProjects)??[]).map(_=>[_.project,_.state]));return m.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:m.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl",children:[m.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e}),c&&m.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[c.category," · ",c.origin||"local"]})]}),m.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":"关闭",type:"button",children:m.jsx(Er,{size:16,strokeWidth:3})})]}),f&&m.jsx("p",{children:"加载中…"}),d&&m.jsxs("p",{className:"text-[var(--color-crashed)]",children:["加载失败: ",h instanceof Error?h.message:String(h)]}),c&&m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-3 uppercase tracking-wider",children:"项目链接状态"}),m.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(_=>{const A=k.get(_);return m.jsxs("div",{className:"flex items-center justify-between gap-3 p-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:_}),A==="linked"&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"linked"}),A==="frozen"&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:"frozen"}),!A&&m.jsx("span",{className:"nb-status",style:{background:"var(--color-idle-bg)",color:"var(--color-idle)"},children:"absent"})]}),m.jsxs("div",{className:"flex gap-2",children:[!A&&m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:()=>x(_),type:"button",children:[m.jsx(iA,{size:11})," link"]}),A==="linked"&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>S(_),type:"button",children:[m.jsx(_A,{size:11})," freeze"]}),m.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:()=>v(_),type:"button",children:"unlink"})]}),A==="frozen"&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>w(_),type:"button",children:[m.jsx(UC,{size:11})," unfreeze"]}),m.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:()=>v(_),type:"button",children:"unlink"})]})]})]},_)}),t.length===0&&m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"还没有任何项目。先去创建一个项目。"})]})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"SKILL.md 预览"}),m.jsx("div",{className:"prose-chat bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-80 overflow-auto text-sm",children:c.body?m.jsx(kg,{remarkPlugins:[Ag],rehypePlugins:[Mg],children:c.body}):m.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"(empty)"})})]}),c.references.length>0&&m.jsxs("div",{children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"References"}),m.jsx("ul",{className:"flex flex-col gap-2",children:c.references.map(_=>m.jsx(W4,{skillName:e,file:_.name,lines:_.lines},_.name))})]})]})]})})}function W4({skillName:e,file:t,lines:n}){const[a,s]=M.useState(!1),{data:o,isLoading:c,isError:f,error:d}=lt({queryKey:["skill-ref",e,t],queryFn:()=>BO(e,t),enabled:a,staleTime:1/0});return m.jsxs("li",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[m.jsxs("button",{type:"button",onClick:()=>s(h=>!h),"aria-label":`${a?"收起":"展开"} ${t}`,"aria-expanded":a,className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[m.jsx($p,{size:12,strokeWidth:3,className:["transition-transform",a?"rotate-90":""].join(" ")}),m.jsx(qp,{size:12,strokeWidth:2.5}),m.jsx("span",{className:"flex-1 text-left font-bold",children:t}),m.jsxs("span",{className:"text-xs text-[var(--color-text-subtle)]",children:[n," lines"]})]}),a&&m.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg)] max-h-96 overflow-auto",children:[c&&m.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"加载中…"}),f&&m.jsxs("p",{className:"text-xs text-[var(--color-crashed)]",children:["加载失败: ",d instanceof Error?d.message:String(d)]}),o&&m.jsx("div",{className:"prose-chat text-sm",children:m.jsx(kg,{remarkPlugins:[Ag],rehypePlugins:[Mg],children:o.content})})]})]})}const J4=[{value:"all",label:"全部"},{value:"language",label:"language"},{value:"end",label:"end"},{value:"persona",label:"persona"},{value:"workflow",label:"workflow"},{value:"other",label:"other"}],eB={language:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg-cream)"};function tB(){var x;const[e,t]=M.useState("all"),[n,a]=M.useState(""),[s,o]=M.useState(null),c=qn(),{data:f,isLoading:d}=lt({queryKey:["skills"],queryFn:()=>lg()}),h=lt({queryKey:["projects"],queryFn:_r}),y=M.useMemo(()=>((f==null?void 0:f.data)??[]).filter(S=>!(e!=="all"&&S.category!==e||n&&!S.name.toLowerCase().includes(n.toLowerCase()))),[f,e,n]),g=M.useMemo(()=>{const v=(f==null?void 0:f.data)??[],S={all:v.length};for(const w of v)S[w.category]=(S[w.category]??0)+1;return S},[f]);return m.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[m.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"Skills 🎯"}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:d?"加载中…":`${(f==null?void 0:f.data.length)??0} 个 user-level skill`})]}),m.jsx("div",{className:"flex gap-3 items-center",children:m.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{await qO(),c.invalidateQueries({queryKey:["skills"]})},type:"button",children:[m.jsx(Cl,{size:14,strokeWidth:2.5}),"Sync bundled"]})})]}),m.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[m.jsxs("div",{className:"relative flex-1 max-w-md",children:[m.jsx(xf,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),m.jsx("input",{className:"nb-input pl-9 w-full",placeholder:"搜索 skill…",value:n,onChange:v=>a(v.target.value),"aria-label":"搜索 skill"})]}),m.jsx("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:J4.map(v=>m.jsxs("button",{type:"button",onClick:()=>t(v.value),className:["px-3 py-1 rounded-full text-xs font-bold font-[family-name:var(--font-body)]",e===v.value?"bg-[var(--color-text)] text-[var(--color-bg)]":"text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),children:[v.label," ",g[v.value]]},v.value))})]}),m.jsx("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(280px,1fr))]",children:y.map(v=>{var S;return m.jsx(nB,{skill:v,projectCount:((S=h.data)==null?void 0:S.data.length)??0,onOpen:()=>o(v.name)},v.name)})}),s&&m.jsx(Z4,{name:s,projects:((x=h.data)==null?void 0:x.data.map(v=>v.name))??[],onClose:()=>o(null),onChange:()=>c.invalidateQueries({queryKey:["skills"]})})]})}function nB({skill:e,projectCount:t,onOpen:n}){const a=eB[e.category];return m.jsxs("article",{onClick:n,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),n())},tabIndex:0,role:"button","aria-label":`Open ${e.name}`,className:"nb-card nb-card-interactive flex flex-col gap-3",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:e.name}),m.jsx("span",{className:"nb-badge text-[10px]",style:{background:a},children:e.category})]}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] leading-5 line-clamp-3",children:e.description||"(no description)"}),m.jsxs("div",{className:"flex items-center justify-between text-xs font-[family-name:var(--font-mono)] pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)]",children:[m.jsx("span",{className:"font-bold",children:e.linkedProjects.length>0?`● linked in ${e.linkedProjects.length}`:"○ not linked"}),m.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[t," projects"]})]})]})}function iB(){var s;const e=lt({queryKey:["system-info"],queryFn:r1}),t=lt({queryKey:["system-env"],queryFn:$A}),[n,a]=M.useState(!1);return m.jsxs("div",{className:"flex flex-col gap-6 max-w-4xl",children:[m.jsx("header",{children:m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"系统 ⚙️"})}),m.jsx(aB,{current:(s=e.data)==null?void 0:s.version}),m.jsxs("section",{className:"nb-card",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:"运行时"}),e.data?m.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"Node"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.data.nodeVersion}),m.jsx("dt",{className:"font-bold",children:"Platform"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.data.platform}),m.jsx("dt",{className:"font-bold",children:"PID"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e.data.pid??"—"}),m.jsx("dt",{className:"font-bold",children:"Uptime"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:oB(e.data.uptimeMs)})]}):m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"})]}),m.jsxs("section",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:["全局配置 ",m.jsx("code",{className:"text-sm font-[family-name:var(--font-mono)] font-normal bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"~/.coral/env"})]}),n?m.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold",children:"⚠ 编辑模式"}):m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a(!0),type:"button","aria-label":"编辑 env 文件",children:[m.jsx(Hp,{size:12,strokeWidth:2.5})," 编辑"]})]}),n?m.jsx(rB,{onClose:()=>{a(!1),t.refetch()}}):t.data&&t.data.exists?m.jsx("dl",{className:"grid grid-cols-[220px_1fr] gap-y-1 text-sm font-[family-name:var(--font-mono)]",children:t.data.entries.map(o=>m.jsxs("div",{className:"contents",children:[m.jsxs("dt",{className:"font-bold flex items-center gap-2",children:[o.masked&&m.jsx("span",{className:"text-[var(--color-stuck)]",children:"🔒"}),o.key]}),m.jsx("dd",{className:"text-[var(--color-text-muted)] truncate",children:o.value})]},o.key))}):m.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:['env 文件不存在。点"编辑"或者终端运行 ',m.jsx("code",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded font-[family-name:var(--font-mono)]",children:"sps setup"}),"。"]})]}),m.jsx(sB,{})]})}function aB({current:e}){var S;const{confirm:t,alert:n}=si(),[a,s]=M.useState(!1),[o,c]=M.useState(null),f=lt({queryKey:["latest-version"],queryFn:HA,enabled:!1}),[d,h]=M.useState(null),[y,g]=M.useState("npm i -g @coralai/sps-cli@latest"),x=async()=>{var k;if(await t({title:"升级 sps-cli",body:`当前 ${e},升级到 ${(k=f.data)==null?void 0:k.latest}。要求所有 pipeline 已停止。升级后请重启 sps console 生效。`,confirm:"升级"})){s(!0),c(null),h(null);try{const _=await KA();if(c(_.output),h(_.installedVersion),g(_.command),_.ok)n({title:"升级完成",body:`装上了 v${_.installedVersion}。请 \`pkill -f "sps console"\` 再重启以生效。`});else{const A=_.installedVersion&&_.installedVersion===e?`npm 执行完毕但版本没变(仍 ${_.installedVersion})——多半是权限或 registry 问题。可复制下面的命令在终端手动跑。`:"npm 没装上新版本。可复制命令手动跑,或看下面日志定位。";n({title:"升级未生效",body:A})}}catch(_){c(_.message),n({title:"升级失败",body:_.message})}finally{s(!1)}}},v=async()=>{const w=f.data&&!f.data.upToDate?`npm i -g @coralai/sps-cli@${f.data.latest}`:y;try{await navigator.clipboard.writeText(w),n({title:"命令已复制",body:`粘贴到终端运行即可:
|
|
515
515
|
${w}`})}catch{n({title:"复制失败",body:`请手动复制:
|
|
516
|
-
${w}`})}};return m.jsxs("section",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"版本"}),m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>f.refetch(),disabled:f.isFetching||!e,type:"button","aria-label":"检查最新版本",children:[f.isFetching?m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin"}):m.jsx(Cl,{size:12,strokeWidth:2.5}),"检查更新"]})]}),m.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"sps-cli (当前)"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e??"—"}),f.data&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-bold",children:"npm (最新)"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2 flex-wrap",children:[f.data.latest,f.data.upToDate?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"最新"}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"3px 10px",fontSize:11},onClick:x,disabled:a,type:"button","aria-label":"升级到最新版本",children:[a?m.jsx(Wt,{size:11,strokeWidth:3,className:"animate-spin"}):m.jsx(XE,{size:11,strokeWidth:2.5}),"升级"]}),m.jsxs("button",{className:"nb-btn",style:{padding:"3px 10px",fontSize:11},onClick:v,type:"button","aria-label":"复制升级命令",title:"自动升级失败时手动跑",children:[m.jsx(DC,{size:11,strokeWidth:2.5})," 复制命令"]})]})]})]}),d&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-bold",children:"已安装"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2",children:[d,d===((S=f.data)==null?void 0:S.latest)?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"已生效(重启 console 后可见)"}):d===e?m.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:"未升级成功"}):null]})]}),f.isError&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-bold",children:"检查"}),m.jsx("dd",{className:"text-[var(--color-crashed)] text-xs",children:f.error instanceof Error?f.error.message:String(f.error)})]})]}),o&&m.jsx("pre",{className:"mt-3 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-40 overflow-auto whitespace-pre-wrap",children:o})]})}function rB({onClose:e}){const t=qn(),{alert:n}=si(),a=lt({queryKey:["system-env-raw"],queryFn:PA}),[s,o]=M.useState(null),[c,f]=M.useState(null);M.useEffect(()=>{a.data&&s===null&&(o(a.data.content),f(a.data.etag))},[a.data,s]);const d=s!==null&&a.data&&s!==a.data.content,h=Pn({mutationFn:()=>{if(s===null)throw new Error("no draft");return qA(s,c??"")},onSuccess:()=>{t.invalidateQueries({queryKey:["system-env"]}),t.invalidateQueries({queryKey:["system-env-raw"]}),e()},onError:y=>{const g=y.status;n({title:g===409?"env 被其他地方修改了":"保存失败",body:g===409?"请点取消后重开编辑。":y instanceof Error?y.message:String(y)})}});return a.isLoading?m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}):m.jsxs("div",{children:[m.jsx("p",{className:"text-xs text-[var(--color-stuck)] font-bold mb-2",children:"⚠ 文件包含凭证明文。保存时保持 0600 权限。"}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:320,resize:"vertical"},value:s??"",onChange:y=>o(y.target.value),spellCheck:!1,"aria-label":"env 文件编辑器"}),m.jsxs("div",{className:"flex items-center justify-between mt-3",children:[m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[c?`etag: ${c}`:"",d?" · ● 未保存":""]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:e,disabled:h.isPending,type:"button",children:[m.jsx(vr,{size:12,strokeWidth:3})," 取消"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>h.mutate(),disabled:!d||h.isPending,type:"button","aria-label":"保存 env",children:[h.isPending?m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:12,strokeWidth:3}),"保存"]})]})]})]})}function sB(){var g;const{alert:e}=si(),t=lt({queryKey:["projects"],queryFn:wr}),[n,a]=M.useState({}),[s,o]=M.useState({}),[c,f]=M.useState({}),d=(((g=t.data)==null?void 0:g.data)??[]).map(x=>({project:x.name})),h=async(x,v)=>{o(S=>({...S,[x]:v?"fix":"check"}));try{const S=await GA(x,v);a(w=>({...w,[x]:S})),f(w=>({...w,[x]:!0}))}catch(S){e({title:`doctor ${v?"修复":"检查"}失败`,body:S instanceof Error?S.message:String(S)})}finally{o(S=>({...S,[x]:null}))}},y=async()=>{for(const x of d)await h(x.project,!1)};return m.jsxs("section",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"项目健康检查"}),m.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>{y()},disabled:d.length===0||Object.values(s).some(Boolean),type:"button",children:[m.jsx(Cl,{size:12,strokeWidth:2.5}),"检查全部"]})]}),d.length===0?m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:"还没有项目。"}):m.jsx("ul",{className:"flex flex-col gap-2",children:d.map(x=>{const v=n[x.project],S=s[x.project],w=v?v.checks.filter(T=>T.status==="fail").length:0,k=v?v.checks.filter(T=>T.status==="warn").length:0,_=c[x.project]??!1,A=v!=null;return m.jsxs("li",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[m.jsxs("button",{type:"button",onClick:()=>f(T=>({...T,[x.project]:!_})),disabled:!A,className:"flex items-center gap-2 flex-1 text-left min-w-0","aria-label":_?"折叠":"展开",children:[A&&v.ok?m.jsx(ap,{size:16,className:"text-[var(--color-running)] shrink-0",strokeWidth:2.5}):A?m.jsx(rc,{size:16,className:"text-[var(--color-stuck)] shrink-0",strokeWidth:2.5}):m.jsx(ap,{size:16,className:"text-[var(--color-text-subtle)] shrink-0",strokeWidth:2.5}),A&&(_?m.jsx(yc,{size:12}):m.jsx($p,{size:12})),m.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)]",children:x.project}),A?v.ok?m.jsx("span",{className:"text-xs text-[var(--color-running)] font-semibold",children:"OK"}):m.jsxs("span",{className:"text-xs text-[var(--color-stuck)] font-semibold",children:[w," fail · ",k," warn"]}):m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:'点 "检查" 运行 sps doctor'})]}),m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{h(x.project,!1)},disabled:!!S,type:"button","aria-label":"检查",children:[S==="check"?m.jsx(Wt,{size:11,strokeWidth:3,className:"animate-spin"}):m.jsx(Cl,{size:11,strokeWidth:2.5}),"检查"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:()=>{h(x.project,!0)},disabled:!!S||A&&v.ok,type:"button","aria-label":"自动修复",title:A&&v.ok?"已无可修问题":"调 sps doctor <proj> --fix:自动创建 .claude/hooks/stop.sh、state.json 等",children:[S==="fix"?m.jsx(Wt,{size:11,strokeWidth:3,className:"animate-spin"}):m.jsx(a1,{size:11,strokeWidth:2.5}),"修复"]})]}),_&&A&&m.jsxs("div",{className:"border-t-2 border-dashed border-[var(--color-text)] px-3 py-2",children:[m.jsx("ul",{className:"flex flex-col gap-1 text-xs font-[family-name:var(--font-mono)]",children:v.checks.map((T,D)=>m.jsx(lB,{check:T},`${T.name}-${D}`))}),v.fixes.length>0&&m.jsxs("div",{className:"mt-3 bg-[var(--color-running-bg)] border-2 border-[var(--color-running)] rounded p-2",children:[m.jsx("div",{className:"text-xs font-bold text-[var(--color-running)] mb-1",children:"已修复"}),m.jsx("ul",{className:"text-xs list-disc pl-4",children:v.fixes.map((T,D)=>m.jsx("li",{children:T},D))})]})]})]},x.project)})})]})}function lB({check:e}){const t=e.status==="pass"?m.jsx(ap,{size:12,className:"text-[var(--color-running)]",strokeWidth:2.5}):e.status==="fail"?m.jsx(rc,{size:12,className:"text-[var(--color-crashed)]",strokeWidth:2.5}):e.status==="warn"?m.jsx(rc,{size:12,className:"text-[var(--color-stuck)]",strokeWidth:2.5}):m.jsx("span",{className:"w-3 h-3 rounded-full bg-[var(--color-text-subtle)] inline-block"});return m.jsxs("li",{className:"flex items-start gap-2",children:[m.jsx("span",{className:"pt-0.5 shrink-0",children:t}),m.jsx("span",{className:"font-bold w-32 shrink-0",children:e.name}),m.jsx("span",{className:"text-[var(--color-text-muted)] break-words",children:e.message})]})}function oB(e){const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n}h ${a}m ${s}s`:a>0?`${a}m ${s}s`:`${s}s`}function cB(){return Ht("/api/chat/sessions")}function uB(e){return Ht(`/api/chat/sessions/${e}`)}async function nE(e={}){const t=await fetch("/api/chat/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return await t.json()}async function fB(e){const t=await fetch(`/api/chat/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`${t.status}`)}async function dB(e,t){const n=await fetch(`/api/chat/sessions/${e}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return await n.json()}async function hB(e){const t=await fetch(`/api/chat/sessions/${e}/interrupt`,{method:"POST"});if(!t.ok&&t.status!==204)throw new Error(`${t.status}: ${await t.text()}`)}function mB(e,t){const n=t?`?since=${encodeURIComponent(t)}`:"";return Ht(`/api/chat/sessions/${e}/messages${n}`)}function iE(){var A,T,D,$,j,q;const{sessionId:e}=UE(),t=Sr(),n=qn(),{confirm:a,alert:s}=si(),o=lt({queryKey:["chat-sessions"],queryFn:cB}),c=lt({queryKey:["chat-session",e],queryFn:()=>uB(e??""),enabled:!!e}),[f,d]=M.useState(null),[h,y]=M.useState(""),[g,x]=M.useState(!1),v=M.useRef(null);M.useEffect(()=>{if(!e)return;const U=new EventSource(`/stream/chat/${encodeURIComponent(e)}`);let Z=!0;return U.addEventListener("open",()=>{if(Z){Z=!1;return}const O=n.getQueryData(["chat-session",e]),P=O!=null&&O.messages.length?O.messages[O.messages.length-1].ts:void 0;mB(e,P).then(G=>{G.data.length!==0&&n.setQueryData(["chat-session",e],le=>{if(!le)return le;const ae=new Set(le.messages.map(K=>K.id)),W=G.data.filter(K=>!ae.has(K.id));return W.length===0?le:{...le,messages:[...le.messages,...W],lastMessageAt:W[W.length-1].ts,messageCount:le.messageCount+W.length}})}).catch(()=>{})}),U.addEventListener("chat.message",O=>{try{const P=JSON.parse(O.data);n.setQueryData(["chat-session",e],G=>{if(!G||G.messages.some(W=>W.id===P.message.id))return G;const ae=G.messages.findIndex(W=>W.role==="user"&&W.id.startsWith("optim-")&&W.content===P.message.content);if(ae>=0){const W=[...G.messages];return W[ae]=P.message,{...G,messages:W}}return{...G,messages:[...G.messages,P.message]}})}catch{}}),U.addEventListener("chat.message.pending",O=>{try{const P=JSON.parse(O.data);d({id:P.assistantId,blocks:[],done:!1,finalMessage:null})}catch{}}),U.addEventListener("chat.message.chunk.text",O=>{try{const P=JSON.parse(O.data);d(G=>{if(!G||G.id!==P.assistantId)return G;const le=[...G.blocks],ae=le[le.length-1];return ae&&ae.type==="text"?le[le.length-1]={...ae,target:ae.target+P.text}:le.push({type:"text",target:P.text,displayed:""}),{...G,blocks:le}})}catch{}}),U.addEventListener("chat.message.chunk.tool_use",O=>{try{const P=JSON.parse(O.data);d(G=>!G||G.id!==P.assistantId?G:{...G,blocks:[...G.blocks,{type:"tool_use",id:P.id,title:P.title,kind:P.kind,status:P.status}]})}catch{}}),U.addEventListener("chat.message.chunk.tool_update",O=>{try{const P=JSON.parse(O.data);d(G=>!G||G.id!==P.assistantId?G:{...G,blocks:G.blocks.map(le=>le.type==="tool_use"&&le.id===P.id?{...le,status:P.status}:le)})}catch{}}),U.addEventListener("chat.message.complete",O=>{try{const P=JSON.parse(O.data);d(G=>G&&G.id===P.assistantId?{...G,done:!0,finalMessage:P.message}:G)}catch{}}),()=>U.close()},[e,n]),M.useEffect(()=>{if(!f)return;const U=f.blocks.reduce((O,P)=>P.type==="text"?O+(P.target.length-P.displayed.length):O,0);if(U<=0){if(f.done&&f.finalMessage){const O=f.finalMessage;n.setQueryData(["chat-session",e],P=>!P||P.messages.some(G=>G.id===O.id)?P:{...P,messages:[...P.messages,O],lastMessageAt:O.ts,messageCount:P.messageCount+1}),n.invalidateQueries({queryKey:["chat-sessions"]}),d(null),x(!1)}return}const Z=setTimeout(()=>{d(O=>{if(!O)return O;let P=Math.max(1,Math.ceil(U/40));const G=O.blocks.map(le=>{if(le.type!=="text"||P<=0)return le;const ae=le.target.length-le.displayed.length;if(ae<=0)return le;const W=Math.min(ae,P);return P-=W,{...le,displayed:le.target.slice(0,le.displayed.length+W)}});return{...O,blocks:G}})},25);return()=>clearTimeout(Z)},[f,n,e]),M.useEffect(()=>{const U=v.current;U&&(U.scrollTop=U.scrollHeight)},[c.data,f]);const S=M.useCallback(async()=>{const U=await nE();n.invalidateQueries({queryKey:["chat-sessions"]}),t(`/chat/${U.id}`)},[n,t]),w=M.useCallback(async()=>{const U=h.trim();if(!U||g)return;let Z=e;if(!Z){const P=await nE();n.invalidateQueries({queryKey:["chat-sessions"]}),Z=P.id,t(`/chat/${Z}`,{replace:!0})}const O={id:`optim-${Date.now()}`,role:"user",content:U,ts:new Date().toISOString(),status:"complete"};n.setQueryData(["chat-session",Z],P=>P?{...P,messages:[...P.messages,O],lastMessageAt:O.ts,messageCount:P.messageCount+1}:{id:Z,createdAt:O.ts,lastMessageAt:O.ts,title:U.slice(0,60),project:null,messageCount:1,messages:[O]}),y(""),x(!0);try{await dB(Z,U)}catch(P){x(!1),console.error("sendMessage failed",P),s({title:"发送失败",body:P instanceof Error?P.message:String(P)})}},[h,g,e,n,t,s]),k=M.useCallback(async U=>{await a({title:"删除对话",body:"对话记录会永久删除,不可恢复。",confirm:"删除",danger:!0})&&(await fB(U),n.invalidateQueries({queryKey:["chat-sessions"]}),e===U&&t("/chat"))},[n,e,t,a]),_=M.useCallback(async()=>{if(e)try{await hB(e)}catch(U){s({title:"中断失败",body:U instanceof Error?U.message:String(U)})}},[e,s]);return m.jsxs("div",{className:"grid grid-cols-[260px_1fr] gap-4 h-[calc(100vh-140px)]",children:[m.jsxs("aside",{className:"nb-card p-3 overflow-auto flex flex-col gap-2",children:[m.jsxs("button",{className:"nb-btn nb-btn-primary w-full justify-center",onClick:S,type:"button",children:[m.jsx(Xi,{size:14,strokeWidth:3}),"新建对话"]}),m.jsxs("div",{className:"mt-2 text-xs font-[family-name:var(--font-heading)] uppercase tracking-wider text-[var(--color-text-muted)] px-2",children:["历史 ",((A=o.data)==null?void 0:A.data.length)??0]}),m.jsxs("div",{className:"flex flex-col gap-1.5 mt-1",children:[(((T=o.data)==null?void 0:T.data)??[]).map(U=>m.jsxs("div",{className:["group flex items-start gap-2 p-2 rounded-lg border-2 border-transparent",e===U.id?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[m.jsxs("button",{type:"button","aria-label":`打开对话 ${U.title}`,onClick:()=>t(`/chat/${U.id}`),className:"flex items-start gap-2 flex-1 min-w-0 text-left",children:[m.jsx($v,{size:14,strokeWidth:2.5,className:"mt-0.5 flex-shrink-0"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("p",{className:"text-sm font-semibold truncate",children:U.title}),m.jsxs("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate",children:[U.messageCount," msg · ",Dw(U.lastMessageAt??U.createdAt)]})]})]}),m.jsx("button",{type:"button","aria-label":"删除对话",className:"opacity-0 group-hover:opacity-100 p-1 hover:text-[var(--color-crashed)]",onClick:Z=>{Z.stopPropagation(),k(U.id)},children:m.jsx(Il,{size:12})})]},U.id)),(((D=o.data)==null?void 0:D.data)??[]).length===0&&m.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic text-center py-4",children:"还没对话。点上面新建。"})]})]}),m.jsx("div",{className:"nb-card p-0 flex flex-col overflow-hidden",children:e?m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:(($=c.data)==null?void 0:$.title)??"新对话"}),m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:e})]}),m.jsxs("div",{ref:v,className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[(((j=c.data)==null?void 0:j.messages)??[]).map(U=>m.jsx(pB,{msg:U},U.id)),f&&m.jsx(gB,{pending:f}),!c.isLoading&&(((q=c.data)==null?void 0:q.messages)??[]).length===0&&!f&&!g&&m.jsx("p",{className:"text-center text-[var(--color-text-subtle)] italic mt-12",children:"下方输入问题开始对话 · Enter 发送 · Shift+Enter 换行"})]}),m.jsx("div",{className:"border-t-2 border-[var(--color-text)] p-3 bg-[var(--color-bg-cream)]",children:m.jsxs("div",{className:"flex gap-2 items-end",children:[m.jsx("textarea",{className:"nb-input flex-1 resize-none",placeholder:"说点什么… (Enter 发送,Shift+Enter 换行)",rows:2,value:h,onChange:U=>y(U.target.value),onKeyDown:U=>{U.key==="Enter"&&!U.shiftKey&&!U.nativeEvent.isComposing&&(U.preventDefault(),w())},"aria-label":"消息输入"}),f?m.jsxs("button",{className:"nb-btn nb-btn-danger",onClick:_,type:"button","aria-label":"中断生成",children:[m.jsx(e1,{size:14,strokeWidth:3}),"中断"]}):m.jsxs("button",{className:"nb-btn nb-btn-primary",onClick:w,disabled:!h.trim()||g,type:"button","aria-label":"发送",children:[g?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(xA,{size:14,strokeWidth:3}),"发送"]})]})})]}):m.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:m.jsxs("div",{className:"text-center max-w-md",children:[m.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center mx-auto mb-4",children:m.jsx($v,{size:32,strokeWidth:2.5})}),m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"对话 💬"}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:'点左上角"新建对话"开始一个 session。或直接在下方输入,会自动建 session。'}),m.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic",children:"Enter 发送 · Shift+Enter 换行 · 内容流式返回"})]})})})]})}function pB({msg:e}){const t=e.role==="user",n=e.role==="error",a=e.blocks&&e.blocks.length>0?e.blocks:[{type:"text",text:e.content}];return m.jsx("div",{className:t?"self-end max-w-3xl":"self-start max-w-3xl",children:m.jsxs("div",{className:["nb-card",t?"bg-[var(--color-secondary)]":n?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-bg)]"].join(" "),children:[m.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:[t?"你":n?"错误":"assistant",m.jsx("span",{className:"font-normal",children:"·"}),m.jsx("span",{className:"font-normal",children:Dw(e.ts)})]}),m.jsx("div",{className:"flex flex-col gap-2",children:a.map((s,o)=>m.jsx(bB,{block:s},o))}),e.truncated&&m.jsx("p",{className:"mt-3 px-3 py-2 bg-[var(--color-stuck-bg)] border-2 border-[var(--color-stuck)] rounded-lg text-xs text-[var(--color-stuck)] font-bold",children:"⚠ 输出超过 10MB,已截断"})]})})}function gB({pending:e}){const t=(()=>{for(let n=e.blocks.length-1;n>=0;n--)if(e.blocks[n].type==="text")return n;return-1})();return m.jsx("div",{className:"self-start max-w-3xl",children:m.jsxs("div",{className:"nb-card bg-[var(--color-bg)]",children:[m.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:["assistant",m.jsx("span",{className:"font-normal",children:"·"}),m.jsxs("span",{className:"flex items-center gap-1 font-normal text-[var(--color-running)]",children:[m.jsx(Wt,{size:10,strokeWidth:3,className:"animate-spin"}),"streaming"]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[e.blocks.length===0&&m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"…"}),e.blocks.map((n,a)=>{if(n.type==="text"){const s=a===t;return m.jsxs("div",{className:"relative",children:[m.jsx(Mw,{text:n.displayed}),s&&m.jsx("span",{className:"inline-block w-2 h-4 ml-1 bg-[var(--color-text)] animate-pulse align-middle"})]},a)}return m.jsx(jw,{tool:n},a)})]})]})})}function bB({block:e}){return e.type==="text"?m.jsx(Mw,{text:e.text}):m.jsx(jw,{tool:e})}function Mw({text:e}){return e?m.jsx("div",{className:"text-sm font-[family-name:var(--font-body)] break-words prose-chat",children:m.jsx(kg,{remarkPlugins:[Ag],rehypePlugins:[Mg],children:e})}):null}function jw({tool:e}){const[t,n]=M.useState(!1),a=e.status==="completed",s=e.status==="failed",o=!a&&!s;return m.jsxs("div",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[m.jsxs("button",{type:"button",onClick:()=>n(c=>!c),className:"w-full flex items-center gap-2 px-3 py-2 text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[m.jsx($p,{size:12,strokeWidth:3,className:["transition-transform",t?"rotate-90":""].join(" ")}),m.jsx(a1,{size:12,strokeWidth:2.5}),m.jsx("span",{className:"font-bold",children:e.kind}),m.jsx("span",{className:"flex-1 text-left text-[var(--color-text-muted)] truncate",children:e.title}),o&&m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin text-[var(--color-running)]"}),a&&m.jsx(Pp,{size:12,strokeWidth:2.5,className:"text-[var(--color-running)]"}),s&&m.jsx(OC,{size:12,strokeWidth:2.5,className:"text-[var(--color-crashed)]"})]}),t&&m.jsxs("div",{className:"px-3 py-2 text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] border-t-2 border-[var(--color-text)]",children:[m.jsxs("div",{children:["id: ",m.jsx("span",{className:"text-[var(--color-text)]",children:e.id})]}),m.jsxs("div",{children:["status: ",m.jsx("span",{className:"text-[var(--color-text)]",children:e.status})]})]})]})}function Dw(e){if(!e)return"";const t=new Date(e),n=Date.now()-t.getTime();return n<6e4?"刚才":n<36e5?`${Math.floor(n/6e4)}m`:n<864e5?`${Math.floor(n/36e5)}h`:t.toLocaleDateString()}function yB(){return m.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:"404 · 页面不存在"}),m.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:"没找到这个页面。可能是链接过期了。"}),m.jsx(ds,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:"返回首页"})]})}function xB(){return m.jsx(c2,{children:m.jsx(jT,{children:m.jsxs(zn,{element:m.jsx(l2,{}),children:[m.jsx(zn,{index:!0,element:m.jsx(OT,{to:"/projects",replace:!0})}),m.jsx(zn,{path:"/projects",element:m.jsx(u2,{})}),m.jsx(zn,{path:"/projects/new",element:m.jsx(x2,{})}),m.jsx(zn,{path:"/projects/:name",element:m.jsx(MO,{})}),m.jsx(zn,{path:"/board",element:m.jsx(yR,{})}),m.jsx(zn,{path:"/workers",element:m.jsx(jR,{})}),m.jsx(zn,{path:"/logs",element:m.jsx(BR,{})}),m.jsx(zn,{path:"/skills",element:m.jsx(tB,{})}),m.jsx(zn,{path:"/system",element:m.jsx(iB,{})}),m.jsx(zn,{path:"/chat",element:m.jsx(iE,{})}),m.jsx(zn,{path:"/chat/:sessionId",element:m.jsx(iE,{})}),m.jsx(zn,{path:"*",element:m.jsx(yB,{})})]})})})}o2();const vB=new vN({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),Lw=document.getElementById("root");if(!Lw)throw new Error("#root not found");Vk.createRoot(Lw).render(m.jsx(M.StrictMode,{children:m.jsx(EN,{client:vB,children:m.jsx(aC,{children:m.jsx(g2,{children:m.jsx(xB,{})})})})}));
|
|
516
|
+
${w}`})}};return m.jsxs("section",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"版本"}),m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>f.refetch(),disabled:f.isFetching||!e,type:"button","aria-label":"检查最新版本",children:[f.isFetching?m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin"}):m.jsx(Cl,{size:12,strokeWidth:2.5}),"检查更新"]})]}),m.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-2 text-sm",children:[m.jsx("dt",{className:"font-bold",children:"sps-cli (当前)"}),m.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e??"—"}),f.data&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-bold",children:"npm (最新)"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2 flex-wrap",children:[f.data.latest,f.data.upToDate?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"最新"}):m.jsxs(m.Fragment,{children:[m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"3px 10px",fontSize:11},onClick:x,disabled:a,type:"button","aria-label":"升级到最新版本",children:[a?m.jsx(Wt,{size:11,strokeWidth:3,className:"animate-spin"}):m.jsx(XE,{size:11,strokeWidth:2.5}),"升级"]}),m.jsxs("button",{className:"nb-btn",style:{padding:"3px 10px",fontSize:11},onClick:v,type:"button","aria-label":"复制升级命令",title:"自动升级失败时手动跑",children:[m.jsx(DC,{size:11,strokeWidth:2.5})," 复制命令"]})]})]})]}),d&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-bold",children:"已安装"}),m.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2",children:[d,d===((S=f.data)==null?void 0:S.latest)?m.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"已生效(重启 console 后可见)"}):d===e?m.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:"未升级成功"}):null]})]}),f.isError&&m.jsxs(m.Fragment,{children:[m.jsx("dt",{className:"font-bold",children:"检查"}),m.jsx("dd",{className:"text-[var(--color-crashed)] text-xs",children:f.error instanceof Error?f.error.message:String(f.error)})]})]}),o&&m.jsx("pre",{className:"mt-3 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-40 overflow-auto whitespace-pre-wrap",children:o})]})}function rB({onClose:e}){const t=qn(),{alert:n}=si(),a=lt({queryKey:["system-env-raw"],queryFn:PA}),[s,o]=M.useState(null),[c,f]=M.useState(null);M.useEffect(()=>{a.data&&s===null&&(o(a.data.content),f(a.data.etag))},[a.data,s]);const d=s!==null&&a.data&&s!==a.data.content,h=Pn({mutationFn:()=>{if(s===null)throw new Error("no draft");return qA(s,c??"")},onSuccess:()=>{t.invalidateQueries({queryKey:["system-env"]}),t.invalidateQueries({queryKey:["system-env-raw"]}),e()},onError:y=>{const g=y.status;n({title:g===409?"env 被其他地方修改了":"保存失败",body:g===409?"请点取消后重开编辑。":y instanceof Error?y.message:String(y)})}});return a.isLoading?m.jsx("p",{className:"text-[var(--color-text-muted)]",children:"加载中…"}):m.jsxs("div",{children:[m.jsx("p",{className:"text-xs text-[var(--color-stuck)] font-bold mb-2",children:"⚠ 文件包含凭证明文。保存时保持 0600 权限。"}),m.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:320,resize:"vertical"},value:s??"",onChange:y=>o(y.target.value),spellCheck:!1,"aria-label":"env 文件编辑器"}),m.jsxs("div",{className:"flex items-center justify-between mt-3",children:[m.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[c?`etag: ${c}`:"",d?" · ● 未保存":""]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:e,disabled:h.isPending,type:"button",children:[m.jsx(Er,{size:12,strokeWidth:3})," 取消"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>h.mutate(),disabled:!d||h.isPending,type:"button","aria-label":"保存 env",children:[h.isPending?m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin"}):m.jsx(Df,{size:12,strokeWidth:3}),"保存"]})]})]})]})}function sB(){var g;const{alert:e}=si(),t=lt({queryKey:["projects"],queryFn:_r}),[n,a]=M.useState({}),[s,o]=M.useState({}),[c,f]=M.useState({}),d=(((g=t.data)==null?void 0:g.data)??[]).map(x=>({project:x.name})),h=async(x,v)=>{o(S=>({...S,[x]:v?"fix":"check"}));try{const S=await GA(x,v);a(w=>({...w,[x]:S})),f(w=>({...w,[x]:!0}))}catch(S){e({title:`doctor ${v?"修复":"检查"}失败`,body:S instanceof Error?S.message:String(S)})}finally{o(S=>({...S,[x]:null}))}},y=async()=>{for(const x of d)await h(x.project,!1)};return m.jsxs("section",{className:"nb-card",children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"项目健康检查"}),m.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>{y()},disabled:d.length===0||Object.values(s).some(Boolean),type:"button",children:[m.jsx(Cl,{size:12,strokeWidth:2.5}),"检查全部"]})]}),d.length===0?m.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:"还没有项目。"}):m.jsx("ul",{className:"flex flex-col gap-2",children:d.map(x=>{const v=n[x.project],S=s[x.project],w=v?v.checks.filter(T=>T.status==="fail").length:0,k=v?v.checks.filter(T=>T.status==="warn").length:0,_=c[x.project]??!1,A=v!=null;return m.jsxs("li",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[m.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[m.jsxs("button",{type:"button",onClick:()=>f(T=>({...T,[x.project]:!_})),disabled:!A,className:"flex items-center gap-2 flex-1 text-left min-w-0","aria-label":_?"折叠":"展开",children:[A&&v.ok?m.jsx(ap,{size:16,className:"text-[var(--color-running)] shrink-0",strokeWidth:2.5}):A?m.jsx(rc,{size:16,className:"text-[var(--color-stuck)] shrink-0",strokeWidth:2.5}):m.jsx(ap,{size:16,className:"text-[var(--color-text-subtle)] shrink-0",strokeWidth:2.5}),A&&(_?m.jsx(yc,{size:12}):m.jsx($p,{size:12})),m.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)]",children:x.project}),A?v.ok?m.jsx("span",{className:"text-xs text-[var(--color-running)] font-semibold",children:"OK"}):m.jsxs("span",{className:"text-xs text-[var(--color-stuck)] font-semibold",children:[w," fail · ",k," warn"]}):m.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:'点 "检查" 运行 sps doctor'})]}),m.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{h(x.project,!1)},disabled:!!S,type:"button","aria-label":"检查",children:[S==="check"?m.jsx(Wt,{size:11,strokeWidth:3,className:"animate-spin"}):m.jsx(Cl,{size:11,strokeWidth:2.5}),"检查"]}),m.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:()=>{h(x.project,!0)},disabled:!!S||A&&v.ok,type:"button","aria-label":"自动修复",title:A&&v.ok?"已无可修问题":"调 sps doctor <proj> --fix:自动创建 .claude/hooks/stop.sh、state.json 等",children:[S==="fix"?m.jsx(Wt,{size:11,strokeWidth:3,className:"animate-spin"}):m.jsx(a1,{size:11,strokeWidth:2.5}),"修复"]})]}),_&&A&&m.jsxs("div",{className:"border-t-2 border-dashed border-[var(--color-text)] px-3 py-2",children:[m.jsx("ul",{className:"flex flex-col gap-1 text-xs font-[family-name:var(--font-mono)]",children:v.checks.map((T,D)=>m.jsx(lB,{check:T},`${T.name}-${D}`))}),v.fixes.length>0&&m.jsxs("div",{className:"mt-3 bg-[var(--color-running-bg)] border-2 border-[var(--color-running)] rounded p-2",children:[m.jsx("div",{className:"text-xs font-bold text-[var(--color-running)] mb-1",children:"已修复"}),m.jsx("ul",{className:"text-xs list-disc pl-4",children:v.fixes.map((T,D)=>m.jsx("li",{children:T},D))})]})]})]},x.project)})})]})}function lB({check:e}){const t=e.status==="pass"?m.jsx(ap,{size:12,className:"text-[var(--color-running)]",strokeWidth:2.5}):e.status==="fail"?m.jsx(rc,{size:12,className:"text-[var(--color-crashed)]",strokeWidth:2.5}):e.status==="warn"?m.jsx(rc,{size:12,className:"text-[var(--color-stuck)]",strokeWidth:2.5}):m.jsx("span",{className:"w-3 h-3 rounded-full bg-[var(--color-text-subtle)] inline-block"});return m.jsxs("li",{className:"flex items-start gap-2",children:[m.jsx("span",{className:"pt-0.5 shrink-0",children:t}),m.jsx("span",{className:"font-bold w-32 shrink-0",children:e.name}),m.jsx("span",{className:"text-[var(--color-text-muted)] break-words",children:e.message})]})}function oB(e){const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n}h ${a}m ${s}s`:a>0?`${a}m ${s}s`:`${s}s`}function cB(){return Ht("/api/chat/sessions")}function uB(e){return Ht(`/api/chat/sessions/${e}`)}async function nE(e={}){const t=await fetch("/api/chat/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return await t.json()}async function fB(e){const t=await fetch(`/api/chat/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`${t.status}`)}async function dB(e,t){const n=await fetch(`/api/chat/sessions/${e}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return await n.json()}async function hB(e){const t=await fetch(`/api/chat/sessions/${e}/interrupt`,{method:"POST"});if(!t.ok&&t.status!==204)throw new Error(`${t.status}: ${await t.text()}`)}function mB(e,t){const n=t?`?since=${encodeURIComponent(t)}`:"";return Ht(`/api/chat/sessions/${e}/messages${n}`)}function iE(){var A,T,D,$,j,q;const{sessionId:e}=UE(),t=wr(),n=qn(),{confirm:a,alert:s}=si(),o=lt({queryKey:["chat-sessions"],queryFn:cB}),c=lt({queryKey:["chat-session",e],queryFn:()=>uB(e??""),enabled:!!e}),[f,d]=M.useState(null),[h,y]=M.useState(""),[g,x]=M.useState(!1),v=M.useRef(null);M.useEffect(()=>{if(!e)return;const U=new EventSource(`/stream/chat/${encodeURIComponent(e)}`);let Z=!0;return U.addEventListener("open",()=>{if(Z){Z=!1;return}const O=n.getQueryData(["chat-session",e]),P=O!=null&&O.messages.length?O.messages[O.messages.length-1].ts:void 0;mB(e,P).then(G=>{G.data.length!==0&&n.setQueryData(["chat-session",e],le=>{if(!le)return le;const ae=new Set(le.messages.map(K=>K.id)),W=G.data.filter(K=>!ae.has(K.id));return W.length===0?le:{...le,messages:[...le.messages,...W],lastMessageAt:W[W.length-1].ts,messageCount:le.messageCount+W.length}})}).catch(()=>{})}),U.addEventListener("chat.message",O=>{try{const P=JSON.parse(O.data);n.setQueryData(["chat-session",e],G=>{if(!G||G.messages.some(W=>W.id===P.message.id))return G;const ae=G.messages.findIndex(W=>W.role==="user"&&W.id.startsWith("optim-")&&W.content===P.message.content);if(ae>=0){const W=[...G.messages];return W[ae]=P.message,{...G,messages:W}}return{...G,messages:[...G.messages,P.message]}})}catch{}}),U.addEventListener("chat.message.pending",O=>{try{const P=JSON.parse(O.data);d({id:P.assistantId,blocks:[],done:!1,finalMessage:null})}catch{}}),U.addEventListener("chat.message.chunk.text",O=>{try{const P=JSON.parse(O.data);d(G=>{if(!G||G.id!==P.assistantId)return G;const le=[...G.blocks],ae=le[le.length-1];return ae&&ae.type==="text"?le[le.length-1]={...ae,target:ae.target+P.text}:le.push({type:"text",target:P.text,displayed:""}),{...G,blocks:le}})}catch{}}),U.addEventListener("chat.message.chunk.tool_use",O=>{try{const P=JSON.parse(O.data);d(G=>!G||G.id!==P.assistantId?G:{...G,blocks:[...G.blocks,{type:"tool_use",id:P.id,title:P.title,kind:P.kind,status:P.status}]})}catch{}}),U.addEventListener("chat.message.chunk.tool_update",O=>{try{const P=JSON.parse(O.data);d(G=>!G||G.id!==P.assistantId?G:{...G,blocks:G.blocks.map(le=>le.type==="tool_use"&&le.id===P.id?{...le,status:P.status}:le)})}catch{}}),U.addEventListener("chat.message.complete",O=>{try{const P=JSON.parse(O.data);d(G=>G&&G.id===P.assistantId?{...G,done:!0,finalMessage:P.message}:G)}catch{}}),()=>U.close()},[e,n]),M.useEffect(()=>{if(!f)return;const U=f.blocks.reduce((O,P)=>P.type==="text"?O+(P.target.length-P.displayed.length):O,0);if(U<=0){if(f.done&&f.finalMessage){const O=f.finalMessage;n.setQueryData(["chat-session",e],P=>!P||P.messages.some(G=>G.id===O.id)?P:{...P,messages:[...P.messages,O],lastMessageAt:O.ts,messageCount:P.messageCount+1}),n.invalidateQueries({queryKey:["chat-sessions"]}),d(null),x(!1)}return}const Z=setTimeout(()=>{d(O=>{if(!O)return O;let P=Math.max(1,Math.ceil(U/40));const G=O.blocks.map(le=>{if(le.type!=="text"||P<=0)return le;const ae=le.target.length-le.displayed.length;if(ae<=0)return le;const W=Math.min(ae,P);return P-=W,{...le,displayed:le.target.slice(0,le.displayed.length+W)}});return{...O,blocks:G}})},25);return()=>clearTimeout(Z)},[f,n,e]),M.useEffect(()=>{const U=v.current;U&&(U.scrollTop=U.scrollHeight)},[c.data,f]);const S=M.useCallback(async()=>{const U=await nE();n.invalidateQueries({queryKey:["chat-sessions"]}),t(`/chat/${U.id}`)},[n,t]),w=M.useCallback(async()=>{const U=h.trim();if(!U||g)return;let Z=e;if(!Z){const P=await nE();n.invalidateQueries({queryKey:["chat-sessions"]}),Z=P.id,t(`/chat/${Z}`,{replace:!0})}const O={id:`optim-${Date.now()}`,role:"user",content:U,ts:new Date().toISOString(),status:"complete"};n.setQueryData(["chat-session",Z],P=>P?{...P,messages:[...P.messages,O],lastMessageAt:O.ts,messageCount:P.messageCount+1}:{id:Z,createdAt:O.ts,lastMessageAt:O.ts,title:U.slice(0,60),project:null,messageCount:1,messages:[O]}),y(""),x(!0);try{await dB(Z,U)}catch(P){x(!1),console.error("sendMessage failed",P),s({title:"发送失败",body:P instanceof Error?P.message:String(P)})}},[h,g,e,n,t,s]),k=M.useCallback(async U=>{await a({title:"删除对话",body:"对话记录会永久删除,不可恢复。",confirm:"删除",danger:!0})&&(await fB(U),n.invalidateQueries({queryKey:["chat-sessions"]}),e===U&&t("/chat"))},[n,e,t,a]),_=M.useCallback(async()=>{if(e)try{await hB(e)}catch(U){s({title:"中断失败",body:U instanceof Error?U.message:String(U)})}},[e,s]);return m.jsxs("div",{className:"grid grid-cols-[260px_1fr] gap-4 h-[calc(100vh-140px)]",children:[m.jsxs("aside",{className:"nb-card p-3 overflow-auto flex flex-col gap-2",children:[m.jsxs("button",{className:"nb-btn nb-btn-primary w-full justify-center",onClick:S,type:"button",children:[m.jsx(Xi,{size:14,strokeWidth:3}),"新建对话"]}),m.jsxs("div",{className:"mt-2 text-xs font-[family-name:var(--font-heading)] uppercase tracking-wider text-[var(--color-text-muted)] px-2",children:["历史 ",((A=o.data)==null?void 0:A.data.length)??0]}),m.jsxs("div",{className:"flex flex-col gap-1.5 mt-1",children:[(((T=o.data)==null?void 0:T.data)??[]).map(U=>m.jsxs("div",{className:["group flex items-start gap-2 p-2 rounded-lg border-2 border-transparent",e===U.id?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[m.jsxs("button",{type:"button","aria-label":`打开对话 ${U.title}`,onClick:()=>t(`/chat/${U.id}`),className:"flex items-start gap-2 flex-1 min-w-0 text-left",children:[m.jsx($v,{size:14,strokeWidth:2.5,className:"mt-0.5 flex-shrink-0"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsx("p",{className:"text-sm font-semibold truncate",children:U.title}),m.jsxs("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate",children:[U.messageCount," msg · ",Dw(U.lastMessageAt??U.createdAt)]})]})]}),m.jsx("button",{type:"button","aria-label":"删除对话",className:"opacity-0 group-hover:opacity-100 p-1 hover:text-[var(--color-crashed)]",onClick:Z=>{Z.stopPropagation(),k(U.id)},children:m.jsx(Il,{size:12})})]},U.id)),(((D=o.data)==null?void 0:D.data)??[]).length===0&&m.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic text-center py-4",children:"还没对话。点上面新建。"})]})]}),m.jsx("div",{className:"nb-card p-0 flex flex-col overflow-hidden",children:e?m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[m.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:(($=c.data)==null?void 0:$.title)??"新对话"}),m.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:e})]}),m.jsxs("div",{ref:v,className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[(((j=c.data)==null?void 0:j.messages)??[]).map(U=>m.jsx(pB,{msg:U},U.id)),f&&m.jsx(gB,{pending:f}),!c.isLoading&&(((q=c.data)==null?void 0:q.messages)??[]).length===0&&!f&&!g&&m.jsx("p",{className:"text-center text-[var(--color-text-subtle)] italic mt-12",children:"下方输入问题开始对话 · Enter 发送 · Shift+Enter 换行"})]}),m.jsx("div",{className:"border-t-2 border-[var(--color-text)] p-3 bg-[var(--color-bg-cream)]",children:m.jsxs("div",{className:"flex gap-2 items-end",children:[m.jsx("textarea",{className:"nb-input flex-1 resize-none",placeholder:"说点什么… (Enter 发送,Shift+Enter 换行)",rows:2,value:h,onChange:U=>y(U.target.value),onKeyDown:U=>{U.key==="Enter"&&!U.shiftKey&&!U.nativeEvent.isComposing&&(U.preventDefault(),w())},"aria-label":"消息输入"}),f?m.jsxs("button",{className:"nb-btn nb-btn-danger",onClick:_,type:"button","aria-label":"中断生成",children:[m.jsx(e1,{size:14,strokeWidth:3}),"中断"]}):m.jsxs("button",{className:"nb-btn nb-btn-primary",onClick:w,disabled:!h.trim()||g,type:"button","aria-label":"发送",children:[g?m.jsx(Wt,{size:14,strokeWidth:3,className:"animate-spin"}):m.jsx(xA,{size:14,strokeWidth:3}),"发送"]})]})})]}):m.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:m.jsxs("div",{className:"text-center max-w-md",children:[m.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center mx-auto mb-4",children:m.jsx($v,{size:32,strokeWidth:2.5})}),m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:"对话 💬"}),m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:'点左上角"新建对话"开始一个 session。或直接在下方输入,会自动建 session。'}),m.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic",children:"Enter 发送 · Shift+Enter 换行 · 内容流式返回"})]})})})]})}function pB({msg:e}){const t=e.role==="user",n=e.role==="error",a=e.blocks&&e.blocks.length>0?e.blocks:[{type:"text",text:e.content}];return m.jsx("div",{className:t?"self-end max-w-3xl":"self-start max-w-3xl",children:m.jsxs("div",{className:["nb-card",t?"bg-[var(--color-secondary)]":n?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-bg)]"].join(" "),children:[m.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:[t?"你":n?"错误":"assistant",m.jsx("span",{className:"font-normal",children:"·"}),m.jsx("span",{className:"font-normal",children:Dw(e.ts)})]}),m.jsx("div",{className:"flex flex-col gap-2",children:a.map((s,o)=>m.jsx(bB,{block:s},o))}),e.truncated&&m.jsx("p",{className:"mt-3 px-3 py-2 bg-[var(--color-stuck-bg)] border-2 border-[var(--color-stuck)] rounded-lg text-xs text-[var(--color-stuck)] font-bold",children:"⚠ 输出超过 10MB,已截断"})]})})}function gB({pending:e}){const t=(()=>{for(let n=e.blocks.length-1;n>=0;n--)if(e.blocks[n].type==="text")return n;return-1})();return m.jsx("div",{className:"self-start max-w-3xl",children:m.jsxs("div",{className:"nb-card bg-[var(--color-bg)]",children:[m.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:["assistant",m.jsx("span",{className:"font-normal",children:"·"}),m.jsxs("span",{className:"flex items-center gap-1 font-normal text-[var(--color-running)]",children:[m.jsx(Wt,{size:10,strokeWidth:3,className:"animate-spin"}),"streaming"]})]}),m.jsxs("div",{className:"flex flex-col gap-2",children:[e.blocks.length===0&&m.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"…"}),e.blocks.map((n,a)=>{if(n.type==="text"){const s=a===t;return m.jsxs("div",{className:"relative",children:[m.jsx(Mw,{text:n.displayed}),s&&m.jsx("span",{className:"inline-block w-2 h-4 ml-1 bg-[var(--color-text)] animate-pulse align-middle"})]},a)}return m.jsx(jw,{tool:n},a)})]})]})})}function bB({block:e}){return e.type==="text"?m.jsx(Mw,{text:e.text}):m.jsx(jw,{tool:e})}function Mw({text:e}){return e?m.jsx("div",{className:"text-sm font-[family-name:var(--font-body)] break-words prose-chat",children:m.jsx(kg,{remarkPlugins:[Ag],rehypePlugins:[Mg],children:e})}):null}function jw({tool:e}){const[t,n]=M.useState(!1),a=e.status==="completed",s=e.status==="failed",o=!a&&!s;return m.jsxs("div",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[m.jsxs("button",{type:"button",onClick:()=>n(c=>!c),className:"w-full flex items-center gap-2 px-3 py-2 text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[m.jsx($p,{size:12,strokeWidth:3,className:["transition-transform",t?"rotate-90":""].join(" ")}),m.jsx(a1,{size:12,strokeWidth:2.5}),m.jsx("span",{className:"font-bold",children:e.kind}),m.jsx("span",{className:"flex-1 text-left text-[var(--color-text-muted)] truncate",children:e.title}),o&&m.jsx(Wt,{size:12,strokeWidth:3,className:"animate-spin text-[var(--color-running)]"}),a&&m.jsx(Pp,{size:12,strokeWidth:2.5,className:"text-[var(--color-running)]"}),s&&m.jsx(OC,{size:12,strokeWidth:2.5,className:"text-[var(--color-crashed)]"})]}),t&&m.jsxs("div",{className:"px-3 py-2 text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] border-t-2 border-[var(--color-text)]",children:[m.jsxs("div",{children:["id: ",m.jsx("span",{className:"text-[var(--color-text)]",children:e.id})]}),m.jsxs("div",{children:["status: ",m.jsx("span",{className:"text-[var(--color-text)]",children:e.status})]})]})]})}function Dw(e){if(!e)return"";const t=new Date(e),n=Date.now()-t.getTime();return n<6e4?"刚才":n<36e5?`${Math.floor(n/6e4)}m`:n<864e5?`${Math.floor(n/36e5)}h`:t.toLocaleDateString()}function yB(){return m.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[m.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:"404 · 页面不存在"}),m.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:"没找到这个页面。可能是链接过期了。"}),m.jsx(ds,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:"返回首页"})]})}function xB(){return m.jsx(c2,{children:m.jsx(jT,{children:m.jsxs(zn,{element:m.jsx(l2,{}),children:[m.jsx(zn,{index:!0,element:m.jsx(OT,{to:"/projects",replace:!0})}),m.jsx(zn,{path:"/projects",element:m.jsx(u2,{})}),m.jsx(zn,{path:"/projects/new",element:m.jsx(x2,{})}),m.jsx(zn,{path:"/projects/:name",element:m.jsx(MO,{})}),m.jsx(zn,{path:"/board",element:m.jsx(yR,{})}),m.jsx(zn,{path:"/workers",element:m.jsx(jR,{})}),m.jsx(zn,{path:"/logs",element:m.jsx(BR,{})}),m.jsx(zn,{path:"/skills",element:m.jsx(tB,{})}),m.jsx(zn,{path:"/system",element:m.jsx(iB,{})}),m.jsx(zn,{path:"/chat",element:m.jsx(iE,{})}),m.jsx(zn,{path:"/chat/:sessionId",element:m.jsx(iE,{})}),m.jsx(zn,{path:"*",element:m.jsx(yB,{})})]})})})}o2();const vB=new vN({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),Lw=document.getElementById("root");if(!Lw)throw new Error("#root not found");Vk.createRoot(Lw).render(m.jsx(M.StrictMode,{children:m.jsx(EN,{client:vB,children:m.jsx(aC,{children:m.jsx(g2,{children:m.jsx(xB,{})})})})}));
|