@ferrule-io/ok-fine 0.3.7 → 0.3.9

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.
@@ -14,12 +14,12 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
14
14
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?je(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je(`Lazy`);case 13:return e.child!==t&&t!==null?je(`Suspense Fallback`):je(`Suspense`);case 19:return je(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return je(`Activity`);case 30:return je(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
15
15
  Error generating stack: `+e.message+`
16
16
  `+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function st(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-$e(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function xt(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[Ct])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=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]*$`),Wt={},Gt={};function Kt(e){return Ie.call(Gt,e)?!0:Ie.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var I=!1;function qt(){var e=I;return I=!1,e}function Jt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Zt(s):e.removeAttribute(`name`)}function on(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ln(e,t,n){if(t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,I=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),I=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var gn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),L=/^[\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 _n(e){return L.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function vn(){}var yn=null;function bn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xn=null,Sn=null;function Cn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));an(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var wn=!1;function Tn(e,t,n){if(wn)return e(t,n);wn=!0;try{return e(t)}finally{if(wn=!1,(xn!==null||Sn!==null)&&(Wd(),xn&&(t=xn,e=Sn,Sn=xn=null,Cn(t),e)))for(t=0;t<e.length;t++)Cn(e[t])}}function En(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,On=!1;if(Dn)try{var kn={};Object.defineProperty(kn,"passive",{get:function(){On=!0}}),window.addEventListener(`test`,kn,kn),window.removeEventListener(`test`,kn,kn)}catch{On=!1}var An=null,jn=null,Mn=null;function Nn(){if(Mn)return Mn;var e,t=jn,n=t.length,r,i=`value`in An?An.value:An.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Mn=i.slice(e,1<r?1-r:void 0)}function Pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Fn(){return!0}function In(){return!1}function Ln(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Fn:In,this.isPropagationStopped=In,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Fn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Fn)},persist:function(){},isPersistent:Fn}),t}var Rn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zn=Ln(Rn),Bn=T({},Rn,{view:0,detail:0}),Vn=Ln(Bn),Hn,Un,R,Wn=T({},Bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==R&&(R&&e.type===`mousemove`?(Hn=e.screenX-R.screenX,Un=e.screenY-R.screenY):Un=Hn=0,R=e),Hn)},movementY:function(e){return`movementY`in e?e.movementY:Un}}),Gn=Ln(Wn),Kn=Ln(T({},Wn,{dataTransfer:0})),qn=Ln(T({},Bn,{relatedTarget:0})),Jn=Ln(T({},Rn,{animationName:0,elapsedTime:0,pseudoElement:0})),Yn=Ln(T({},Rn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Xn=Ln(T({},Rn,{data:0})),Zn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Qn={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`},$n={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function er(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$n[e])?!!t[e]:!1}function tr(){return er}var nr=Ln(T({},Bn,{key:function(e){if(e.key){var t=Zn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Qn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tr,charCode:function(e){return e.type===`keypress`?Pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),rr=Ln(T({},Wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),ir=Ln(T({},Rn,{submitter:0})),ar=Ln(T({},Bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tr})),or=Ln(T({},Rn,{propertyName:0,elapsedTime:0,pseudoElement:0})),sr=Ln(T({},Wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),cr=Ln(T({},Rn,{newState:0,oldState:0,source:0})),lr=[9,13,27,32],ur=Dn&&`CompositionEvent`in window,dr=null;Dn&&`documentMode`in document&&(dr=document.documentMode);var fr=Dn&&`TextEvent`in window&&!dr,pr=Dn&&(!ur||dr&&8<dr&&11>=dr),mr=` `,hr=!1;function gr(e,t){switch(e){case`keyup`:return lr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function _r(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var vr=!1;function yr(e,t){switch(e){case`compositionend`:return _r(t);case`keypress`:return t.which===32?(hr=!0,mr):null;case`textInput`:return e=t.data,e===mr&&hr?null:e;default:return null}}function br(e,t){if(vr)return e===`compositionend`||!ur&&gr(e,t)?(e=Nn(),Mn=jn=An=null,vr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return pr&&t.locale!==`ko`?null:t.data;default:return null}}var xr={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 Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!xr[e.type]:t===`textarea`}function Cr(e,t,n,r){xn?Sn?Sn.push(r):Sn=[r]:xn=r,t=ep(t,`onChange`),0<t.length&&(n=new zn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var wr=null,Tr=null;function Er(e){qf(e,0)}function Dr(e){if(tn(Ft(e)))return e}function Or(e,t){if(e===`change`)return t}var kr=!1;if(Dn){var Ar;if(Dn){var jr=`oninput`in document;if(!jr){var Mr=document.createElement(`div`);Mr.setAttribute(`oninput`,`return;`),jr=typeof Mr.oninput==`function`}Ar=jr}else Ar=!1;kr=Ar&&(!document.documentMode||9<document.documentMode)}function Nr(){wr&&(wr.detachEvent(`onpropertychange`,Pr),Tr=wr=null)}function Pr(e){if(e.propertyName===`value`&&Dr(Tr)){var t=[];Cr(t,Tr,e,bn(e)),Tn(Er,t)}}function Fr(e,t,n){e===`focusin`?(Nr(),wr=t,Tr=n,wr.attachEvent(`onpropertychange`,Pr)):e===`focusout`&&Nr()}function Ir(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Dr(Tr)}function Lr(e,t){if(e===`click`)return Dr(t)}function Rr(e,t){if(e===`input`||e===`change`)return Dr(t)}function zr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Br=typeof Object.is==`function`?Object.is:zr;function Vr(e,t){if(Br(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ie.call(t,i)||!Br(e[i],t[i]))return!1}return!0}function Hr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Ur(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wr(e,t){var n=Ur(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ur(n)}}function Gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Hr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hr(e.document)}return t}function qr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Jr=Dn&&`documentMode`in document&&11>=document.documentMode,Yr=null,Xr=null,Zr=null,Qr=!1;function $r(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qr||Yr==null||Yr!==Hr(r)||(r=Yr,`selectionStart`in r&&qr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Zr&&Vr(Zr,r)||(Zr=r,r=ep(Xr,`onSelect`),0<r.length&&(t=new zn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Yr)))}function ei(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ti={animationend:ei(`Animation`,`AnimationEnd`),animationiteration:ei(`Animation`,`AnimationIteration`),animationstart:ei(`Animation`,`AnimationStart`),transitionrun:ei(`Transition`,`TransitionRun`),transitionstart:ei(`Transition`,`TransitionStart`),transitioncancel:ei(`Transition`,`TransitionCancel`),transitionend:ei(`Transition`,`TransitionEnd`)},ni={},ri={};Dn&&(ri=document.createElement(`div`).style,`AnimationEvent`in window||(delete ti.animationend.animation,delete ti.animationiteration.animation,delete ti.animationstart.animation),`TransitionEvent`in window||delete ti.transitionend.transition);function ii(e){if(ni[e])return ni[e];if(!ti[e])return e;var t=ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ri)return ni[e]=t[n];return e}var ai=ii(`animationend`),oi=ii(`animationiteration`),si=ii(`animationstart`),ci=ii(`transitionrun`),li=ii(`transitionstart`),ui=ii(`transitioncancel`),di=ii(`transitionend`),fi=new Map,pi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);pi.push(`scrollEnd`);function mi(e,t){fi.set(e,t),Vt(t,[e])}var hi=0;function gi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=hi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function _i(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function vi(e,t){return e=_i(e),t=_i(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var yi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},bi=[],xi=0,Si=0;function Ci(){for(var e=xi,t=Si=xi=0;t<e;){var n=bi[t];bi[t++]=null;var r=bi[t];bi[t++]=null;var i=bi[t];bi[t++]=null;var a=bi[t];if(bi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Di(n,i,a)}}function wi(e,t,n,r){bi[xi++]=e,bi[xi++]=t,bi[xi++]=n,bi[xi++]=r,Si|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ti(e,t,n,r){return wi(e,t,n,r),Oi(e)}function Ei(e,t){return wi(e,null,null,t),Oi(e)}function Di(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Oi(e){if(50<Pd)throw Pd=0,Fd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ki={};function Ai(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ji(e,t,n,r){return new Ai(e,t,n,r)}function Mi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ni(e,t){var n=e.alternate;return n===null?(n=ji(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Pi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Mi(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,xe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ce:return e=ji(31,n,t,a),e.elementType=ce,e.lanes=o,e;case k:return Ii(n.children,a,o,t);case ee:s=8,a|=24;break;case A:return e=ji(12,n,t,a|2),e.elementType=A,e.lanes=o,e;case ie:return e=ji(13,n,t,a),e.elementType=ie,e.lanes=o,e;case ae:return e=ji(19,n,t,a),e.elementType=ae,e.lanes=o,e;case j:case ue:return e=a|32,e=ji(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ne:s=10;break a;case te:s=9;break a;case re:s=11;break a;case oe:s=14;break a;case se:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ji(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ii(e,t,n,r){return e=ji(7,e,r,t),e.lanes=n,e}function Li(e,t,n){return e=ji(6,e,null,t),e.lanes=n,e}function Ri(e){var t=ji(18,null,null,0);return t.stateNode=e,t}function zi(e,t,n){return t=ji(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bi=new WeakMap;function Vi(e,t){if(typeof e==`object`&&e){var n=Bi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Bi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Hi=[],Ui=0,Wi=null,Gi=0,Ki=[],qi=0,Ji=null,Yi=1,Xi=``;function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Wi,Wi=e,Gi=t}function Qi(e,t,n){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Ji=e;var r=Yi;e=Xi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yi=1<<32-$e(t)+i|n<<i|r,Xi=a+e}else Yi=1<<a|n<<i|r,Xi=e}function $i(e){e.return!==null&&(Zi(e,1),Qi(e,1,0))}function ea(e){for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null;for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Xi=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null}function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Xi,Ki[qi++]=Ji,Yi=t.id,Xi=t.overflow,Ji=e}var na=null,ra=null,z=!1,ia=null,aa=!1,oa=Error(i(519));function sa(e){throw pa(Vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),oa}function ca(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:K(`cancel`,t),K(`close`,t);break;case`iframe`:case`object`:case`embed`:K(`load`,t);break;case`video`:case`audio`:for(n=0;n<Gf.length;n++)K(Gf[n],t);break;case`source`:K(`error`,t);break;case`img`:case`image`:case`link`:K(`error`,t),K(`load`,t);break;case`details`:K(`toggle`,t);break;case`input`:K(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:K(`invalid`,t);break;case`textarea`:K(`invalid`,t),un(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||op(t.textContent,n)?(r.popover!=null&&(K(`beforetoggle`,t),K(`toggle`,t)),r.onScroll!=null&&K(`scroll`,t),r.onScrollEnd!=null&&K(`scrollend`,t),r.onClick!=null&&(t.onclick=vn),t=!0):t=!1,t||sa(e,!0)}function la(e){for(na=e.return;na;)switch(na.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:na=na.return}}function ua(e){if(e!==na)return!1;if(!z)return la(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&ra&&sa(e),la(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ra=_m(e)}else t===27?(t=ra,Op(e.type)?(e=gm,gm=null,ra=e):ra=t):ra=na?hm(e.stateNode.nextSibling):null;return!0}function da(){ra=na=null,z=!1}function fa(){var e=ia;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),ia=null),e}function pa(e){ia===null?ia=[e]:ia.push(e)}var ma=F(null),ha=null,ga=null;function _a(e,t,n){be(ma,t._currentValue),t._currentValue=n}function va(e){e._currentValue=ma.current,ye(ma)}function ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ba(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ya(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ya(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ya(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function xa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Br(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}a=a.return}return e!==null&&ba(t,e,n,r),t.flags|=262144,e!==null}function Sa(e){for(e=e.firstContext;e!==null;){if(!Br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ca(e){ha=e,ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wa(e){return Ea(ha,e)}function Ta(e,t){return ha===null&&Ca(e),Ea(e,t)}function Ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ga===null){if(e===null)throw Error(i(308));ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ga=ga.next=t;return n}var Da=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Oa=t.unstable_scheduleCallback,ka=t.unstable_NormalPriority,Aa={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ja(){return{controller:new Da,data:new Map,refCount:0}}function Ma(e){e.refCount--,e.refCount===0&&Oa(ka,function(){e.controller.abort()})}function Na(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Pa=null;function Fa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ia=null,La=0,Ra=0,za=null;function Ba(e,t){if(Ia===null){var n=Ia=[];La=0,Ra=Bf(),za={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return La++,t.then(Va,Va),t}function Va(){if(--La===0&&(Pa=null,Ia!==null)){za!==null&&(za.status=`fulfilled`);var e=Ia;Ia=null,Ra=0,za=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ha(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ua=M.S;M.S=function(e,t){if(bd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Ba(e,t),Pa!==null)for(var n=Ef;n!==null;)Na(n,Pa),n=n.next;if(n=e.types,n!==null){for(var r=Ef;r!==null;)Na(r,n),r=r.next;if(Ra!==0){r=Pa,r===null&&(r=Pa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ua!==null&&Ua(e,t)};var Wa=F(null);function Ga(){var e=Wa.current;return e===null?rd.pooledCache:e}function Ka(e,t){t===null?be(Wa,Wa.current):be(Wa,t.pool)}function qa(){var e=Ga();return e===null?null:{parent:Aa._currentValue,pool:e}}var Ja=Error(i(460)),Ya=Error(i(474)),Xa=Error(i(542)),Za={then:function(){}};function Qa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function $a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(vn,vn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(vn,vn);else{if(e=rd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e}throw to=t,Ja}}function eo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(to=e,Ja):e}}var to=null;function no(){if(to===null)throw Error(i(459));var e=to;return to=null,e}function ro(e){if(e===Ja||e===Xa)throw Error(i(483))}var io=null,ao=0;function oo(e){var t=ao;return ao+=1,io===null&&(io=[]),$a(io,e,t)}function so(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function co(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function lo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ni(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),so(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===se&&eo(i)===t.type)?(t=a(t,n.props),so(t,n),t.return=e,t):(t=Fi(n.type,n.key,n.props,null,e.mode,r),so(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=zi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ii(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Fi(t.type,t.key,t.props,null,e.mode,n),so(n,t),n.return=e,n;case O:return t=zi(t,e.mode,n),t.return=e,t;case se:return t=eo(t),f(e,t,n)}if(ge(t)||pe(t))return t=Ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,oo(t),n);if(t.$$typeof===ne)return f(e,Ta(e,t),n);co(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case se:return n=eo(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,oo(n),r);if(n.$$typeof===ne)return p(e,t,Ta(e,n),r);co(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case se:return r=eo(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,oo(r),i);if(r.$$typeof===ne)return m(e,t,n,Ta(t,r),i);co(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&Zi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return z&&Zi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),z&&Zi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),z&&Zi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&Zi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),z&&Zi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),so(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===se&&eo(l)===r.type){n(e,r.sibling),c=a(r,o.props),so(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ii(o.props.children,e.mode,c,o.key),so(c,o),c.return=e,e=c):(c=Fi(o.type,o.key,o.props,null,e.mode,c),so(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=zi(o,e.mode,c),c.return=e,e=c}return s(e);case se:return o=eo(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,oo(o),c);if(o.$$typeof===ne)return _(e,r,Ta(e,o),c);co(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ao=0;var i=_(e,t,n,r);return io=null,i}catch(t){if(t===Ja||t===Xa)throw t;var a=ji(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var uo=lo(!0),fo=lo(!1),po=!1;function mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ho(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _o(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,V&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Oi(e),Di(e,null,n),t}return wi(e,r,t,n),Oi(e)}function vo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function yo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var bo=!1;function xo(){if(bo){var e=za;if(e!==null)throw e}}function So(e,t,n,r){bo=!1;var i=e.updateQueue;po=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(U&f)===f:(r&f)===f){f!==0&&f===Ra&&(bo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:po=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),dd|=o,e.lanes=o,e.memoizedState=d}}function Co(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function wo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Co(n[e],t)}var To=F(null),Eo=F(0);function Do(e,t){e=ld,be(Eo,e),be(To,t),ld=e|t.baseLanes}function Oo(){be(Eo,ld),be(To,To.current)}function ko(){ld=Eo.current,ye(To),ye(Eo)}var Ao=F(null),jo=null;function Mo(e){var t=e.alternate;be(Lo,Lo.current&1),be(Ao,e),jo===null&&(t===null||To.current!==null||t.memoizedState!==null)&&(jo=e)}function No(e){be(Lo,Lo.current),be(Ao,e),jo===null&&(jo=e)}function Po(e){e.tag===22?(be(Lo,Lo.current),be(Ao,e),jo===null&&(jo=e)):Fo()}function Fo(){be(Lo,Lo.current),be(Ao,Ao.current)}function Io(e){ye(Ao),jo===e&&(jo=null),ye(Lo)}var Lo=F(0);function Ro(e,t){be(Ao,Ao.current),be(Lo,t)}function zo(e){ye(Lo),ye(Ao),jo===e&&(jo=null)}function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vo=0,B=null,Ho=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Br(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Vo=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){M.H=hc;var t=Ho!==null&&Ho.next!==null;if(Vo=0,Uo=Ho=B=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Pc||(e=e.dependencies,e!==null&&Sa(e)&&(Pc=!0))}function ts(e,t,n,r){B=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=Ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=vc,o=t(n,r)}while(Go);return o}function ns(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(Ho===null?null:Ho.memoizedState)!==e&&(B.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Vo=0,Uo=Ho=B=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?B.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(Ho===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=Ho.next;var t=Uo===null?B.memoizedState:Uo.next;if(t!==null)Uo=t,Ho=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));Ho=e,e={memoizedState:Ho.memoizedState,baseState:Ho.baseState,baseQueue:Ho.baseQueue,queue:Ho.queue,next:null},Uo===null?B.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=$a(Yo,e,t),t=B,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===de)return;if(e.$$typeof===ne)return wa(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=cs(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),Ho,e)}function ms(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Vo&f)===f:(U&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ra&&(d=!0);else if((Vo&p)===p){u=u.next,p===Ra&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,dd|=p;f=u.action,Ko&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Br(o,e.memoizedState)&&(Pc=!0,d&&(n=za,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function hs(e){var t=ss(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Br(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=B,a=ss(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Br((Ho||a).memoizedState,n);if(s&&(a.memoizedState=n,Pc=!0),a=a.queue,Vs(ys.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,rd===null)throw Error(i(349));o||Vo&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=cs(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Br(e,n)}catch{return!0}}function xs(e){var t=Ei(e,2);t!==null&&zd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,Ho,typeof r==`function`?r:fs)}function ws(e,t,n,r,a){if(fc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(z){var n=rd.formState;if(n!==null){a:{var r=B;if(z){if(ra){b:{for(var i=ra,a=aa;i.nodeType!==8;){if(!a){i=null;break b}if(i=hm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ra=hm(i.nextSibling),r=i.data===`F!`;break a}}sa(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,B,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,B,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),Ho,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Ja?Xa:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ss(),n=Ho;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=cs(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ls(){return ss().memoizedState}function Rs(e,t,n,r){var i=os();B.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;Ho!==null&&r!==null&&Qo(r,Ho.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(B.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=cs(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(V&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Vo&1073741824&&!(U&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),B.lanes|=e,dd|=e,n)}function Qs(e,t,n,r){return Br(n,t)?n:To.current===null?!(Vo&106)||Vo&1073741824&&!(U&261930)?(Pc=!0,e.memoizedState=n):(e=Ld(),B.lanes|=e,dd|=e,t):(e=Zs(e,n,r),Br(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,dc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ha(c,r),Id(e)):uc(e,t,r,Id(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=nc(e).queue;$s(e,a,t,_e,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Id())}function ic(){return wa(ph)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=go(n);var r=_o(t,e,n);r!==null&&(zd(r,t,n),vo(r,t,n)),t={cache:ja()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Ti(e,t,n,r),n!==null&&(zd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Id())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Br(s,o))return wi(e,t,i,0),rd===null&&Ci(),!1}catch{}if(n=Ti(e,t,i,r),n!==null)return zd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Bf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(i(479))}else t=Ti(e,n,r,2),t!==null&&zd(t,e,2)}function fc(e){var t=e.alternate;return e===B||t!==null&&t===B}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var hc={readContext:wa,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:wa,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:wa,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Qe(!0);try{n(t)}finally{Qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=cc.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,B,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=os();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),rd===null)throw Error(i(349));U&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=rd.identifierPrefix;if(z){var n=Xi,r=Yi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,B)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(V&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ss(),Ho.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(ss(),Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:wa,use:us,useCallback:Ys,useContext:wa,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ss();return Ho===null?Zs(n,e,t):Qs(n,Ho.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ss();return Ho===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,Ho,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=go(r);i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(zd(t,e,r),vo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=go(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(zd(t,e,r),vo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=go(n);r.tag=2,t!=null&&(r.callback=t),t=_o(e,r,n),t!==null&&(zd(t,e,n),vo(t,e,n))}};function xc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Vr(n,r)||!Vr(i,a):!0}function Sc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bc.enqueueReplaceState(t,t.state,null)}function Cc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){yi(e)}function Tc(e){console.error(e)}function Ec(e){yi(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){return n=go(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=go(e),e.tag=3,e}function jc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&xa(t,n,a,!0),n=Ao.current,n!==null){switch(n.tag){case 31:case 13:case 19:return jo===null?$d():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),bf(e,r,a)),!1;case 22:return n.flags|=65536,r===Za?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),bf(e,r,a)),!1}throw Error(i(435,n.tag))}return bf(e,r,a),$d(),!1}if(z)return t=Ao.current,t===null?(r!==oa&&(t=Error(i(423),{cause:r}),pa(Vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Vi(r,n),a=kc(e.stateNode,r,a),yo(e,a),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==oa&&(e=Error(i(422),{cause:r}),pa(Vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Vi(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=kc(n.stateNode,r,e),yo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ac(a),jc(a,e,n,r),yo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(i(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?fo(t,null,n,r):uo(t,e.child,n,r)}function Ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ca(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(z&&s&&$i(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Mi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Vr:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Ni(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Vr(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ka(t,a===null?null:a.cachePool),a===null?Oo():Do(t,a),Po(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ka(t,null),Oo(),Fo()):(Ka(t,a.cachePool),Do(t,a),Fo(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Ga();return a=a===null?null:{parent:Aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ka(t,null),Oo(),Po(t),e!==null&&xa(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return uo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Io(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(No(t),(e=ra)?(e=dm(e,aa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(No(t),a){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Pc||xa(e,t,n,!1),a=(n&e.childLanes)!==0,Pc||a){if(To.current===null){if(r=rd,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ei(e,s),zd(r,e,s),Nc;$d()}t=Uc(e,t,n)}else e=o.treeContext,ra=hm(s.nextSibling),na=t,z=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Ni(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Kc(e,t,n,r,i){return Ca(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(z&&r&&$i(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ca(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(z&&r&&$i(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ca(t),t.stateNode===null){var a=ki,o=n.contextType;typeof o==`object`&&o&&(a=wa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},mo(t),o=n.contextType,a.context=typeof o==`object`&&o?wa(o):ki,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&bc.enqueueReplaceState(a,a.state,null),So(t,r,a,i),xo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ki,typeof u==`object`&&u&&(o=wa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Sc(t,a,r,o),po=!1;var f=t.memoizedState;a.state=f,So(t,r,a,i),xo(),l=t.memoizedState,s||f!==l||po?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=po||xc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ho(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ki,typeof l==`object`&&l&&(c=wa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Sc(t,a,r,c),po=!1,f=t.memoizedState,a.state=f,So(t,r,a,i),xo();var p=t.memoizedState;o!==d||f!==p||po||e!==null&&e.dependencies!==null&&Sa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=po||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Sa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=uo(t,e.child,null,i),t.child=uo(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return da(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:qa()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Lo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(i?Mo(t):Fo(),(e=ra)?(e=dm(e,aa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ji===null?null:{id:Yi,overflow:Xi},retryLane:536870912,hydrationErrors:null},n=Ri(e),n.return=t,t.child=n,na=t,ra=null)):e=null,e===null)throw sa(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Fo(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Ii(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(Mo(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Fo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ni(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ii(i,a,n,null),i.flags|=2):i=Ni(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=qa():(s=Aa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=Ni(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=ji(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return uo(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Mo(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Fo(),o=a.fallback,s=t.mode,a=tl({mode:`visible`,children:a.children},s),o=Ii(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,uo(t,e.child,null,c),a=t.child,a.memoizedState=Zc(c),a.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,a)):(Fo(),t.child=e.child,t.flags|=128,null);if(Mo(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,pa({value:a,source:null,stack:null})),nl(e,t,c)}if(Pc||xa(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(To.current!==null)return nl(e,t,c);if(r=rd,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ei(e,a),zd(r,e,a),Nc;return fm(o)||$d(),nl(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ra=hm(o.nextSibling),na=t,z=!0,ia=null,aa=!1,e!==null&&ta(t,e),t=el(t,a.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ya(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Bo(n)===null&&(t=e),e=e.sibling}return t}function ol(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Lo.current;if(t.flags&128)return Ro(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ro(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=z?Gi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return _a(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(xa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ni(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ni(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Sa(e)))}function fl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),_a(t,Aa,e.memoizedState.cache),da();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:_a(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Mo(t),t.flags|=128,null;r=xa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(Mo(t),e=ul(e,t,n),e===null?null:e.sibling)}Mo(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(xa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ro(t,Lo.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:_a(t,Aa,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,z&&t.flags&1048576&&Qi(t,Gi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=eo(t.elementType),t.type=e,typeof e==`function`)Mi(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Ic(null,t,e,r,n);break a}if(a===oe){t.tag=14,t=Lc(null,t,e,r,n);break a}if(a===ne){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Cc(r,t.pendingProps),Jc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ho(e,t),So(t,r,null,n);var s=t.memoizedState;if(r=s.cache,_a(t,Aa,r),r!==o.cache&&ba(t,[Aa],n,!0),xo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Yc(e,t,r,n);break a}if(r!==a){a=Vi(Error(i(424)),t),pa(a),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ra=hm(e.firstChild),na=t,z=!0,ia=null,aa=!0,n=fo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(da(),r===a){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(t.stateNode=vp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&z&&(r=t.stateNode=xm(t.type,t.pendingProps,Ce.current),na=t,aa=!0,a=ra,Op(t.type)?(gm=a,ra=hm(r.firstChild)):ra=a),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=ra)&&(r=lm(r,t.type,t.pendingProps,aa),r===null?a=!1:(t.stateNode=r,na=t,ra=hm(r.firstChild),aa=!1,a=!0)),a||sa(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(a,o)?r=null:s!==null&&yp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),ph._currentValue=a),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=ra)&&(n=um(n,t.pendingProps,aa),n===null?e=!1:(t.stateNode=n,na=t,ra=null,e=!0)),e||sa(t)),null;case 13:return $c(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ca(t),a=wa(a),r=r(a),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ca(t),r=wa(Aa),e===null?(a=Ga(),a===null&&(a=rd,o=ja(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},mo(t),_a(t,Aa,a)):((e.lanes&n)!==0&&(ho(e,t),So(t,null,null,n),xo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,_a(t,Aa,r),r!==a.cache&&ba(t,[Aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),_a(t,Aa,r))),Fc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:z&&$i(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Xd())e.flags|=8192;else throw to=Za,Ya}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(Xd())e.flags|=8192;else throw to=Za,Ya}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,hd|=t)}function vl(e,t){if(!z)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(ea(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),va(Aa),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ua(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fa())),yl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,a,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,a,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}e=xe.current,ua(t)?ca(t,e):(e=xm(a,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=xe.current,ua(t))ca(t,o);else{var s=hp(Ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ct]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(cp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,ua(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=na,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||sa(t,!0)}else e=hp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ua(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ct]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Io(t),t):(Io(t),null);if(t.flags&128)throw Error(i(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ua(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ct]=t}else da(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),a=!1}else a=fa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Io(t),t):(Io(t),null)}return Io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),yl(t),null);case 4:return Ee(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return va(t.type),yl(t),null;case 19:if(zo(t),r=t.memoizedState,r===null)return yl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)vl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pi(n,e),n=n.sibling;return Ro(t,Lo.current&1|2),z&&Zi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>xd&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Bo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return yl(t),null}else 2*Ve()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,a=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Lo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?Ro(t,o):(n=o,be(Ao,t),be(Lo,n),jo===null&&(jo=t)),z&&Zi(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Io(t),ko(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ye(Wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),va(Aa),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(i(156,t.tag))}function xl(e,t){switch(ea(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return va(Aa),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Io(t),t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return va(t.type),null;case 22:case 23:return Io(t),ko(),e!==null&&ye(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return va(Aa),null;case 25:return null;default:return null}}function Sl(e,t){switch(ea(t),t.tag){case 3:va(Aa),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Io(t);break;case 13:Io(t);break;case 19:zo(t);break;case 10:va(t.type);break;case 22:case 23:Io(t),ko(),e!==null&&ye(Wa);break;case 24:va(Aa)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){G(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){G(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){G(t,t.return,e)}}function Tl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wo(t,n)}catch(t){G(e,e.return,t)}}}function El(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){G(e,t,n)}}function Dl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=gi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);p(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){G(e,t,n)}}function Ol(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){G(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){G(e,t,n)}else n.current=null}}function kl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function Al(e){for(var t=e.return;t!==null&&(Nl(t)&&om(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function jl(e){for(var t=e.return;t!==null&&(Nl(t)&&sm(e.stateNode,t.stateNode),!Ml(t));)t=t.return}function Ml(e){return e.tag===5||e.tag===3||e.tag===27}function Nl(e){return e&&e.tag===7&&e.stateNode!==null}function Pl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){G(e,e.return,t)}}function Fl(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[wt]=t}catch(t){G(e,e.return,t)}}function Il(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Ll(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Il(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Op(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vn)),kl(e,r),I=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),kl(e,r),I=!0;else if(i!==4&&(i===27&&(kl(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[Ct]=e,t[wt]=n}catch(t){G(e,e.return,t)}}var Vl=!1,Hl=null;function Ul(e){(e.tag===30||e.subtreeFlags&33554432)&&(Vl=!0)}var Wl=null;function Gl(){var e=Wl;return Wl=null,e}var Kl=0;function ql(e,t,n,r,i){return Kl=0,Jl(e.child,t,n,r,i)}function Jl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Vl=!0,jp(o,Kl===0?t:t+`_`+Kl,n),Kl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Jl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Yl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Yl(e.child,t)),e=e.sibling}function Xl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Xl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=vi(t.default,t.share),t!==`none`&&(ql(e,n,t,null,!1)||Yl(e.child,!1))}e=e.sibling}}function Zl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=gi(r,n),a=vi(r.default,n.paired?r.share:r.enter);a===`none`?Xl(e):ql(e,i,a,null,!1)?(Xl(e),n.paired||t||Rd(e,r.onEnter)):Yl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e,t),e=e.sibling;else Xl(e)}function Ql(e){if(Hl!==null&&Hl.size!==0){var t=Hl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=vi(n.default,n.share);if(a!==`none`&&(ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Yl(e.child,!1)),t.delete(r),t.size===0)break}}}Ql(e)}e=e.sibling}}}function $l(e){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode),r=Hl===null?void 0:Hl.get(n),i=vi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(ql(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Hl.delete(n),Rd(e,t.onShare)):Yl(e.child,!1)),Hl!==null&&Ql(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)$l(e),e=e.sibling;else Hl!==null&&Ql(e)}function eu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=gi(t,e.stateNode);t=vi(t.default,t.update),e.flags&=-5,t!==`none`&&ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&eu(e);e=e.sibling}}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Yl(e.child,!1))}tu(e)}e=e.sibling}}function nu(e){if(e.tag===30)e.stateNode.paired=null,Yl(e.child,!1),tu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else tu(e)}function ru(e){for(e=e.child;e!==null;)e.tag===30?Yl(e.child,!1):e.subtreeFlags&33554432&&ru(e),e=e.sibling}function iu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Kl<a.length){var l=a[Kl],u=Pp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&jp(c,Kl===0?n:n+`_`+Kl,i),s&&e.flags&4||(Wl===null&&(Wl=[]),Wl.push(c,Kl===0?r:r+`_`+Kl,t.memoizedProps)),Kl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:iu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function au(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=gi(n,r),a=vi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Kl=0,i=iu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&au(e,t);e=e.sibling}}var ou=!1,su=!1,cu=!1,lu=!1,uu=typeof WeakSet==`function`?WeakSet:Set,du=null,fu=!1,pu=!1,mu=!1,hu=!1;function gu(e,t,n){if(e=e.containerInfo,pp=Sh,e=Kr(e),qr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,du=t,t=n?9270:1024;du!==null;){if(e=du,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&$l(r[a]);if(e.alternate===null&&e.flags&2)n&&Ul(e),_u(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&$l(r),_u(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ul(e),_u(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,du=r):(n&&eu(e),_u(n))}}Hl=null}function _u(e){for(;du!==null;){var t=du,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){G(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=gi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=vi(a.default,a.update),a!==`none`&&ql(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,du=r;break}du=t.return}}function vu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ru(e,n),r&4&&Cl(5,n);break;case 1:if(Ru(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){G(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){G(n,n.return,e)}}}r&64&&Tl(n),r&512&&Dl(n,n.return);break;case 3:if(Ru(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{wo(e,t)}catch(e){G(n,n.return,e)}}break;case 27:t===null&&r&4&&Bl(n);case 26:case 5:Ru(e,n),t===null&&r&4&&Pl(n),r&512&&Dl(n,n.return);break;case 12:Ru(e,n);break;case 31:Ru(e,n),r&4&&Du(e,n);break;case 13:Ru(e,n),r&4&&Ou(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||ou,!r){var a=t!==null&&t.memoizedState!==null||su;t=ou,i=su,ou=r,(su=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Bu(e,n,r)):Ru(e,n),ou=t,su=i}break;case 30:Ru(e,n),r&512&&Dl(n,n.return);break;case 7:r&512&&Dl(n,n.return);default:Ru(e,n)}}function yu(e,t){for(e=e.child;e!==null;)bu(e,t),e=e.sibling}function bu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){G(e,e.return,t)}xu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,I=!0}catch(t){G(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){G(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&yu(e,t);break;default:yu(e,t)}}function xu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:bu(n,r);break a;case 22:n.memoizedState===null&&xu(n,r);break a;default:xu(n,r)}}e=e.sibling}}function Su(e){var t=e.alternate;t!==null&&(e.alternate=null,Su(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Cu=null,wu=!1;function Tu(e,t,n){for(n=n.child;n!==null;)Eu(e,t,n),n=n.sibling}function Eu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:su||Ol(n,t),Tu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!su&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:su||Ol(n,t),jl(n);var r=Cu,i=wu;Op(n.type)&&(Cu=n.stateNode,wu=!1),Tu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),Cu=r,wu=i;break;case 5:su||Ol(n,t),jl(n);case 6:if(n.tag===6&&jl(n),r=Cu,i=wu,Cu=null,Tu(e,t,n),Cu=r,wu=i,Cu!==null){if(wu)try{(Cu.nodeType===9?Cu.body:Cu.nodeName===`HTML`?Cu.ownerDocument.body:Cu).removeChild(n.stateNode),I=!0}catch(e){G(n,t,e)}else try{Cu.removeChild(n.stateNode),I=!0}catch(e){G(n,t,e)}}break;case 18:Cu!==null&&(wu?(e=Cu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(Cu,n.stateNode));break;case 4:r=Cu,i=wu,Cu=n.stateNode.containerInfo,wu=!0,Tu(e,t,n),Cu=r,wu=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),su||wl(4,n,t),Tu(e,t,n);break;case 1:su||(Ol(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&El(n,t,r)),Tu(e,t,n);break;case 21:Tu(e,t,n);break;case 22:su=(r=su)||n.memoizedState!==null,Tu(e,t,n),su=r;break;case 30:Ol(n,t),Tu(e,t,n);break;case 7:su||Ol(n,t),Tu(e,t,n);break;default:Tu(e,t,n)}}function Du(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){G(t,t.return,e)}}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){G(t,t.return,e)}}function ku(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new uu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new uu),t;default:throw Error(i(435,e.tag))}}function Au(e,t){var n=ku(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=wf.bind(null,e,t);t.then(r,r)}})}function ju(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){Cu=l.stateNode,wu=!1;break a}break;case 5:Cu=l.stateNode,wu=!1;break a;case 3:case 4:Cu=l.stateNode.containerInfo,wu=!0;break a}l=l.return}if(Cu===null)throw Error(i(160));Eu(s,c,o),Cu=null,wu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Nu(t,e,n),t=t.sibling}var Mu=null;function Nu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ju(t,e,n),Pu(e),a&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&64&&ou&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Mu,ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(ou)e.stateNode=vp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),cp(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Zm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),cp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else ou||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Fl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||su||t.parentNode.removeChild(t)):a.count--,n===null?ou||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:ju(t,e,n),Pu(e),a&512&&(su||r===null||Ol(r,r.return)),r!==null&&a&4&&Fl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=cu,cu=!1,ju(t,e,n),cu=o,Pu(e),a&512&&(su||r===null||Ol(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),I=!0}catch(t){G(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Fl(e,t,r===null?t:r.memoizedProps)),a&1024&&(lu=!0);break;case 6:if(ju(t,e,n),Pu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,I=!0}catch(t){G(e,e.return,t)}}break;case 3:if(I=!1,Xm=null,o=Mu,Mu=Em(t.containerInfo),ju(t,e,n),Mu=o,Pu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){G(e,e.return,t)}lu&&(lu=!1,Fu(e)),I=!1;break;case 4:a=cu,cu=ou,r=qt(),o=Mu,Mu=Em(e.stateNode.containerInfo),ju(t,e,n),Pu(e),Mu=o,I&&pu&&(mu=!0),I=r,cu=a;break;case 12:ju(t,e,n),Pu(e);break;case 31:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 13:ju(t,e,n),Pu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=ou,l=su,u=cu;ou=c||o,cu=u||o,su=l||s,ju(t,e,n),su=l,cu=u,ou=c,Pu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||ou||su||(t=s||su,n=ou,r=su,ou=o||ou,su=t,zu(e,2),ou=n,su=r),!o&&cu||yu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Au(e,n))));break;case 19:ju(t,e,n),Pu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Au(e,t)));break;case 30:a&512&&(su||r===null||Ol(r,r.return)),a=qt(),o=pu,s=(n&335544064)===n,c=e.memoizedProps,pu=s&&vi(c.default,c.update)!==`none`,ju(t,e,n),Pu(e),s&&r!==null&&I&&(e.flags|=4),pu=o,I=a;break;case 21:break;case 7:a&512&&(su||r===null||Ol(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ju(t,e,n),Pu(e)}}function Pu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Il(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Nl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ml(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;zl(e,Ll(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),zl(e,Ll(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Rl(e,Ll(e),u,s);break;default:throw Error(i(161))}}catch(t){G(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Fu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Iu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Lu(t,e),t=t.sibling;else au(t,!1)}function Lu(e,t){var n=e.alternate;if(n===null)Zl(e,!1);else switch(e.tag){case 3:if(hu=fu=!1,Gl(),Iu(t,e),!fu&&!mu){if(e=Wl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),hu=!0}Wl=null;break;case 5:Iu(t,e);break;case 4:r=fu,fu=!1,Iu(t,e),fu&&(mu=!0),fu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Iu(t,e):Zl(e,!1));break;case 30:r=fu,i=Gl(),fu=!1,Iu(t,e),fu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=gi(a,o),o=gi(n.memoizedProps,o);var s=vi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Kl=0,t=iu(e,n,t,o,s,a,!0),Kl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Wl=i):i!==null&&(i.push.apply(i,Wl),Wl=i),fu=e.flags&32?!0:r;break;default:Iu(t,e)}}function Ru(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)vu(e,t.alternate,t),t=t.sibling}function zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),zu(n,r);break;case 1:Ol(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&El(n,n.return,i),zu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:Ol(n,n.return),n.tag!==5&&n.tag!==27||jl(n),zu(n,r);break;case 6:jl(n);break;case 26:Ol(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||su||i.parentNode.removeChild(i),zu(n,r);break;case 22:n.memoizedState===null&&zu(n,r);break;case 30:Ol(n,n.return),zu(n,r);break;case 7:Ol(n,n.return);default:zu(n,r)}e=e.sibling}}function Bu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Bu(i,a,n),Cl(4,a);break;case 1:if(Bu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){G(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Co(l[i],c)}catch(e){G(r,r.return,e)}}s&&o&64&&Tl(a),Dl(a,a.return);break;case 27:n&2&&Bl(a);case 5:a.tag!==5&&a.tag!==27||Al(a),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 6:Al(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||ou||Qm(Em(c.ownerDocument),a.type,c),Bu(i,a,n),s&&r===null&&o&4&&Pl(a),Dl(a,a.return);break;case 12:Bu(i,a,n);break;case 31:Bu(i,a,n),s&&o&4&&Du(i,a);break;case 13:Bu(i,a,n),s&&o&4&&Ou(i,a);break;case 22:a.memoizedState===null&&Bu(i,a,n),Dl(a,a.return);break;case 30:Bu(i,a,n),Dl(a,a.return);break;case 7:Dl(a,a.return);default:Bu(i,a,n)}t=t.sibling}}function Vu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ma(n))}function Hu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ma(e))}function Uu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Wu(e,t,n,r),t=t.sibling;else i&&ru(t)}function Wu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&nu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Uu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Uu(e,t,n,r);break;case 3:Uu(e,t,n,r),i&&hu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ma(a)));break;case 12:if(a&2048){Uu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){G(t,t.return,e)}}else Uu(e,t,n,r);break;case 31:Uu(e,t,n,r);break;case 13:Uu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&nu(t),o._visibility&2?Uu(e,t,n,r):(o._visibility|=2,Gu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&nu(s),o._visibility&2?Uu(e,t,n,r):Ku(e,t)),a&2048&&Vu(s,t);break;case 24:Uu(e,t,n,r),a&2048&&Hu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Yl(a.child,!0),Yl(t.child,!0))),Uu(e,t,n,r);break;default:Uu(e,t,n,r)}}function Gu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Gu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Gu(a,o,s,c,i)):u._visibility&2?Gu(a,o,s,c,i):Ku(a,o),i&&l&2048&&Vu(o.alternate,o);break;case 24:Gu(a,o,s,c,i),i&&l&2048&&Hu(o.alternate,o);break;default:Gu(a,o,s,c,i)}t=t.sibling}}function Ku(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ku(n,r),i&2048&&Vu(r.alternate,r);break;case 24:Ku(n,r),i&2048&&Hu(r.alternate,r);break;default:Ku(n,r)}t=t.sibling}}var qu=8192;function Ju(e,t,n){if(e.subtreeFlags&qu)for(e=e.child;e!==null;)Yu(e,t,n),e=e.sibling}function Yu(e,t,n){switch(e.tag){case 26:Ju(e,t,n),e.flags&qu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Mu,e.memoizedState,e.memoizedProps));break;case 5:Ju(e,t,n),e.flags&qu&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Mu;Mu=Em(e.stateNode.containerInfo),Ju(e,t,n),Mu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=qu,qu=16777216,Ju(e,t,n),qu=r):Ju(e,t,n));break;case 30:if((e.flags&qu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Hl===null&&(Hl=new Map),Hl.set(r,i)}Ju(e,t,n);break;default:Ju(e,t,n)}}function Xu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Qu(e),e=e.sibling}function Qu(e){switch(e.tag){case 0:case 11:case 15:Zu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Zu(e);break;case 12:Zu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):Zu(e);break;default:Zu(e)}}function $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];du=r,ed(r,e)}Xu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function ed(e,t){for(;du!==null;){var n=du;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ma(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,du=r;else a:for(n=e;du!==null;){r=du;var i=r.sibling,a=r.return;if(Su(r),r===n){du=null;break a}if(i!==null){i.return=a,du=i;break a}du=a}}}var td={getCacheForType:function(e){var t=wa(Aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return wa(Aa).controller.signal}},nd=typeof WeakMap==`function`?WeakMap:Map,V=0,rd=null,H=null,U=0,id=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return V&2&&U!==0?U&-U:M.T===null?bt():Bf()}function Ld(){if(md===0){if(!(U&536870912)||z){var e=it;it<<=1,!(it&3932160)&&(it=262144),md=e}else md=536870912}return e=Ao.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(gi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===rd&&(id===2||id===9)||e.cancelPendingCommit!==null)&&(Kd(e,0),Ud(e,U,md,!1)),pt(e,n),(!(V&2)||e!==rd)&&(e===rd&&(!(V&2)&&(fd|=n),ud===4&&Ud(e,U,md,!1)),Mf(e))}function Bd(e,t,n){if(V&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?nf(e,t):ef(e,t,!0),o=r;do{if(a===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){a=ef(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(Kd(c,s).flags|=256),s=ef(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,a=4;break a}o=_d,_d=a,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Kd(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=yd+300-Ve(),10<a)){if(Ud(r,t,md,!od),st(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=Sp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),a);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);Mf(e)}function Vd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vn},Hl=null,Yu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-Ve():(a&4194048)===a?bd-Ve():0,m=oh(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(lf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}lf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Br(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ud(e,t,n,r){t=lt(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Wd(){return V&6?!0:(Nf(0,!1),!1)}function Gd(){if(H!==null){if(id===0)var e=H.return;else e=H,ga=ha=null,as(e),io=null,ao=0,e=H;for(;e!==null;)Sl(e.alternate,e),e=e.return;H=null}}function Kd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),rd=e,H=n=Ni(e.current,null),U=t,id=0,ad=null,od=!1,sd=ct(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=lt(e,t),Ci(),n}function Jd(e,t){B=null,M.H=hc,t===Ja||t===Xa?(t=no(),id=3):t===Ya?(t=no(),id=4):id=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,H===null&&(ud=1,Dc(e,Vi(t,e.current)))}function Xd(){var e=Ao.current;return e===null?!0:(U&4194048)===U?jo===null:(U&62914560)===U||U&536870912?e===jo:!1}function Zd(){var e=M.H;return M.H=hc,e===null?hc:e}function Qd(){var e=M.A;return M.A=td,e}function $d(){ud=4,od||(U&4194048)!==U&&Ao.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||rd===null||Ud(rd,U,md,!1)}function ef(e,t,n){var r=V;V|=2;var i=Zd(),a=Qd();(rd!==e||U!==t)&&(Sd=null,Kd(e,t)),t=!1;var o=ud;a:do try{if(id!==0&&H!==null){var s=H,c=ad;switch(id){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:Ao.current===null&&(t=!0);var l=id;if(id=0,ad=null,of(e,s,c,l),n&&sd){o=0;break a}break;default:l=id,id=0,ad=null,of(e,s,c,l)}}tf(),o=ud;break}catch(t){Jd(e,t)}while(1);return t&&e.shellSuspendCounter++,ga=ha=null,V=r,M.H=i,M.A=a,H===null&&(rd=null,U=0,Ci()),o}function tf(){for(;H!==null;)W(H)}function nf(e,t){var n=V;V|=2;var r=Zd(),a=Qd();rd!==e||U!==t?(Sd=null,xd=Ve()+500,Kd(e,t)):sd=ct(e,t);a:do try{if(id!==0&&H!==null){t=H;var o=ad;b:switch(id){case 1:id=0,ad=null,of(e,t,o,1);break;case 2:case 9:if(Qa(o)){id=0,ad=null,af(t);break}t=function(){id!==2&&id!==9||rd!==e||(id=7),Mf(e)},o.then(t,t);break a;case 3:id=7;break a;case 4:id=5;break a;case 7:Qa(o)?(id=0,ad=null,af(t)):(id=0,ad=null,of(e,t,o,7));break;case 5:var s=null;switch(H.tag){case 26:s=H.memoizedState;case 5:case 27:var c=H;if(s?th(s):c.stateNode.complete){id=0,ad=null;var l=c.sibling;if(l!==null)H=l;else{var u=c.return;u===null?H=null:(H=u,sf(u))}break b}}id=0,ad=null,of(e,t,o,5);break;case 6:id=0,ad=null,of(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(i(462))}}rf();break}catch(t){Jd(e,t)}while(1);return ga=ha=null,M.H=r,M.A=a,V=n,H===null?(rd=null,U=0,Ci(),ud):0}function rf(){for(;H!==null&&!ze();)W(H)}function W(e){var t=pl(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?sf(e):H=t}function af(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,U);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,U);break;case 5:as(t);var r=t;r===na&&(z?(la(r),r.tag===5&&r.stateNode!=null&&(ra=r.stateNode)):(la(r),z=!0));default:Sl(n,t),t=H=Pi(t,ld),t=pl(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?sf(e):H=t}function of(e,t,n,r){ga=ha=null,as(t),io=null,ao=0;var i=t.return;try{if(Mc(e,i,t,n,U)){ud=1,Dc(e,Vi(n,e.current)),H=null;return}}catch(t){if(i!==null)throw H=i,t;ud=1,Dc(e,Vi(n,e.current)),H=null;return}t.flags&32768?(z||r===1?e=!0:sd||U&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),cf(t,e)):sf(t)}function sf(e){var t=e;do{if(t.flags&32768){cf(t,od);return}e=t.return;var n=bl(t.alternate,t,ld);if(n!==null){H=n;return}if(t=t.sibling,t!==null){H=t;return}H=t=e}while(t!==null);ud===0&&(ud=5)}function cf(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,H=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){H=e;return}H=e=n}while(e!==null);ud=6,H=null}function lf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do _f();while(wd!==0);if(V&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===rd&&(H=rd=null,U=0),Ed=t,Td=e,Dd=n,kd=a,Ad=r,uf(e,t,n,s,c,l,f)}}function uf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=Si,mt(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Fa(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Tf(Ge,function(){return vf(),null})):(e.callbackNode=null,e.callbackPriority=0),Vl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=V,V|=4;try{gu(e,t,n)}finally{V=a,N.p=i,M.T=r}}wd=1,Vl?jd=Rp(o,e.containerInfo,Nd,pf,mf,ff,hf,vf,df,null,null):(pf(),mf(),hf())}function df(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function ff(){wd===3&&(wd=0,Lu(Ed,Td),wd=4)}function pf(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=V;V|=4;try{pu=mu=!1,Nu(t,e,n),n=mp;var o=Kr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Gr(s.ownerDocument.documentElement,s)){if(c!==null&&qr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Wr(s,h),v=Wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Sh=!!pp,mp=pp=null}finally{V=a,N.p=i,M.T=r}}e.current=t,wd=2}}function mf(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=V;V|=4;try{vu(e,t.alternate,t)}finally{V=i,N.p=r,M.T=n}}wd=3}}function hf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Be();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,gf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{M.T=n,N.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Dd&3&&_f(),Mf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Nf(0,!1)}}function gf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ma(t)))}function _f(){return jd!==null&&(jd.skipTransition(),jd=null),pf(),mf(),hf(),vf()}function vf(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=yt(Dd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,V&6)throw Error(i(331));var c=V;if(V|=4,Qu(o.current),Wu(o,o.current,s,n),V=c,Nf(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{N.p=a,M.T=r,gf(e,t)}}function yf(e,t,n){t=Vi(n,t),t=kc(e.stateNode,t,2),e=_o(e,t,2),e!==null&&(pt(e,2),Mf(e))}function G(e,t,n){if(e.tag===3)yf(e,e,n);else for(;t!==null;){if(t.tag===3){yf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Vi(n,e),n=Ac(2),r=_o(t,n,2),r!==null&&(jc(n,r,t,e),pt(r,2),Mf(r));break}}t=t.return}}function bf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=xf.bind(null,e,t,n),t.then(e,e))}function xf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rd===e&&(U&n)===n&&(ud===4||ud===3&&(U&62914560)===U&&300>Ve()-yd?V&2?pd|=n:Kd(e,0):pd|=n,hd===U&&(hd=0)),Mf(e)}function Sf(e,t){t===0&&(t=dt()),e=Ei(e,t),e!==null&&(pt(e,t),Mf(e))}function Cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sf(e,n)}function wf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Sf(e,n)}function Tf(e,t){return Le(e,t)}var Ef=null,Df=null,Of=!1,kf=!1,Af=!1,jf=0;function Mf(e){e!==Df&&e.next===null&&(Df===null?Ef=Df=e:Df=Df.next=e),kf=!0,Of||(Of=!0,zf())}function Nf(e,t){if(!Af&&kf){Af=!0;do for(var n=!1,r=Ef;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Rf(r,a))}else a=U,a=st(r,r===rd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,Rf(r,a))}r=r.next}while(n);Af=!1}}function Pf(){Ff()}function Ff(){kf=Of=!1;var e=0;jf!==0&&xp()&&(e=jf);for(var t=Ve(),n=null,r=Ef;r!==null;){var i=r.next,a=If(r,t);a===0?(r.next=null,n===null?Ef=i:n.next=i,i===null&&(Df=n)):(n=r,(e!==0||a&3)&&(kf=!0)),r=i}wd!==0&&wd!==5||Nf(e,!1),jf!==0&&(jf=0)}function If(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=rd,n=U,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(id===2||id===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Lf.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(_f()&&e.callbackNode!==n)return null;var r=U;return r=st(e,e===rd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),If(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Lf.bind(null,e):null)}function Rf(e,t){if(_f())return null;Bd(e,t,!0)}function zf(){Ep(function(){V&6?Le(Ue,Pf):Ff()})}function Bf(){if(jf===0){var e=Ra;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),jf=e}return jf}function Vf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:_n(e)}function Hf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Vf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?Vf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new zn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Uf=0;Uf<pi.length;Uf++){var Wf=pi[Uf];mi(Wf.toLowerCase(),`on`+(Wf[0].toUpperCase()+Wf.slice(1)))}mi(ai,`onAnimationEnd`),mi(oi,`onAnimationIteration`),mi(si,`onAnimationStart`),mi(`dblclick`,`onDoubleClick`),mi(`focusin`,`onFocus`),mi(`focusout`,`onBlur`),mi(ci,`onTransitionRun`),mi(li,`onTransitionStart`),mi(ui,`onTransitionCancel`),mi(di,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Gf=`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(` `),Kf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Gf));function qf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){yi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){yi(e)}i.currentTarget=null,a=c}}}}function K(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Zf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Kf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Zf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!On||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Qf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Nt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Tn(function(){var r=a,i=bn(n),s=[];a:{var c=fi.get(e);if(c!==void 0){var l=zn,u=e;switch(e){case`keypress`:if(Pn(n)===0)break a;case`keydown`:case`keyup`:l=nr;break;case`focusin`:u=`focus`,l=qn;break;case`focusout`:u=`blur`,l=qn;break;case`beforeblur`:case`afterblur`:l=qn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Gn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ar;break;case ai:case oi:case si:l=Jn;break;case di:l=or;break;case`scroll`:case`scrollend`:l=Vn;break;case`wheel`:l=sr;break;case`copy`:case`cut`:case`paste`:l=Yn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=rr;break;case`submit`:l=ir;break;case`toggle`:case`beforetoggle`:l=cr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=En(m,p),g!=null&&d.push($f(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==yn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Gn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=rr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,tp):null,c!==null&&np(s,u,c,d,!1),l!==null&&f!==null&&np(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Or;else if(Sr(c)){if(kr)_=Rr;else{_=Ir;var v=Fr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Or):_=Lr;if(_&&=_(e,r)){Cr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(Sr(v)||v.contentEditable===`true`)&&(Yr=v,Xr=r,Zr=null);break;case`focusout`:Zr=Xr=Yr=null;break;case`mousedown`:Qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Qr=!1,$r(s,n,i);break;case`selectionchange`:if(Jr)break;case`keydown`:case`keyup`:$r(s,n,i)}var y;if(ur)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else vr?gr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(pr&&n.locale!==`ko`&&(vr||b!==`onCompositionStart`?b===`onCompositionEnd`&&vr&&(y=Nn()):(An=i,jn=`value`in An?An.value:An.textContent,vr=!0)),v=ep(r,b),0<v.length&&(b=new Xn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=_r(n),y!==null&&(b.data=y)))),(y=fr?yr(e,n):br(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new Xn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Hf(s,e,r,n,i)}qf(s,t)})}function $f(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ep(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=En(e,n),i!=null&&r.unshift($f(e,i,a)),i=En(e,t),i!=null&&r.push($f(e,i,a))),e.tag===3)return r;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=En(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=En(n,a),l!=null&&o.push($f(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rp=/\r\n?/g,ip=/\u0000|\uFFFD/g;function ap(e){return(typeof e==`string`?e:``+e).replace(rp,`
17
- `).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function q(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&q(e,t,`name`,a.name,a,null),q(e,t,`formEncType`,a.formEncType,a,null),q(e,t,`formMethod`,a.formMethod,a,null),q(e,t,`formTarget`,a.formTarget,a,null)):(q(e,t,`encType`,a.encType,a,null),q(e,t,`method`,a.method,a,null),q(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=vn);return;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=_n(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:K(`beforetoggle`,e),K(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}I=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=vn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}I=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}I=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:K(`error`,e),K(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:q(e,t,o,s,n,null)}}a&&q(e,t,`srcSet`,n.srcSet,n,null),r&&q(e,t,`src`,n.src,n,null);return;case`input`:K(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:q(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in K(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:q(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in K(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:q(e,t,s,c,n,null)}un(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:q(e,t,l,r,n,null)}return;case`dialog`:K(`beforetoggle`,e),K(`toggle`,e),K(`cancel`,e),K(`close`,e);break;case`iframe`:case`object`:K(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)K(Gf[r],e);break;case`image`:K(`error`,e),K(`load`,e);break;case`details`:K(`toggle`,e);break;case`embed`:case`source`:case`link`:K(`error`,e),K(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:q(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&q(e,t,c,r,n,null))}var lp={};function up(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||q(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(I=!0),o=m;break;case`name`:m!==f&&(I=!0),a=m;break;case`checked`:m!==f&&(I=!0),u=m;break;case`defaultChecked`:m!==f&&(I=!0),d=m;break;case`value`:m!==f&&(I=!0),s=m;break;case`defaultValue`:m!==f&&(I=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&q(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||q(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(I=!0),p=o;break;case`defaultValue`:o!==l&&(I=!0),c=o;break;case`multiple`:o!==l&&(I=!0),s=o;default:o!==l&&q(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:q(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(I=!0),p=a;break;case`defaultValue`:a!==o&&(I=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&q(e,t,s,a,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:q(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(I=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:q(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&q(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:q(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&q(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||q(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&dp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&dp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function vp(e,t,n,r){return n=hp(n).createElement(e),n[Ct]=r,n[wt]=t,cp(n,e,t),Lt(n),n}function yp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=v(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=hp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),rm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),rm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=v(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&q(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===vn&&(e.onclick=null),Mt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=N.d;N.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Wd();return e||t}function km(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=It(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);Lt(c),cp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=It(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Lt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=It(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Lt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=Ce.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bm(e){return`href="`+rn(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),cp(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+rn(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),cp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,Lt(a),a):(r=n,(a=wm.get(o))&&(r=T({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),cp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ch.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ph={$$typeof:ne,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function mh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ji(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},mo(a),e}function gh(e){return e?(e=ki,e):ki}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=go(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=_o(e,r,t),n!==null&&(zd(n,e,t),vo(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Ei(e,67108864);t!==null&&zd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Id();t=vt(t);var n=Ei(e,t);n!==null&&zd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Th(e,t,n,r)}finally{N.p=a,M.T=i}}function wh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Th(e,t,n,r)}finally{N.p=a,M.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Qf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(V&6)&&(xd=Ve()+500,Nf(0,!1))}}break;case 31:case 13:s=Ei(a,2),s!==null&&zd(s,a,2),Wd(),yh(a,2)}if(a=Eh(r),a===null&&Qf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Eh(e){return e=bn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function kh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,xt(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){xh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yn=r,n.target.dispatchEvent(r),yn=null}else return t=Pt(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Oh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Id(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Wd(),t[Tt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(i(527,Qh,`19.3.0`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Xe=eg.inject($h),Ze=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[Tt]=t.current,Xf(e),new Xh(t)}})),Zd=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Xd()})),Qd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,$d=/^[\\/]{2}/;function ef(e,t){return t+e.replace(/\\/g,`/`)}var tf=`popstate`;function nf(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function rf(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return cf(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:lf(t)}return df(t,n,null,e)}function W(e,t){if(e===!1||e==null)throw Error(t)}function af(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function of(){return Math.random().toString(36).substring(2,10)}function sf(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function cf(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?uf(t):t,state:n,key:t&&t.key||r||of(),mask:i}}function lf({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 uf(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function df(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=nf(e)?e:cf(h.location,e,t);n&&n(r,e),l=u()+1;let d=sf(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=nf(e)?e:cf(h.location,e,t);n&&n(r,e),l=u();let i=sf(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ff(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(tf,d),c=e,()=>{i.removeEventListener(tf,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ff(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),W(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:lf(t);return i=i.replace(/ $/,`%20`),!n&&$d.test(i)&&(i=r+i),new URL(i,r)}var pf=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},mf=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function hf(e){return mf.has(e)}var gf=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function _f(e){return gf.has(e)}function vf(e){return e.index===!0}function yf(e){let t={};return e.Component&&Object.assign(t,{element:m.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function G(e,t=yf,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(W(e.index!==!0||!e.children,`Cannot specify children on an index route`),W(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),vf(e)){let n={...e,id:s};return r[s]=bf(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=bf(n,t(n)),e.children&&(n.children=G(e.children,t,o,r,i)),n}})}function bf(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function xf(e,t,n=`/`){return Sf(e,t,n,!1)}function Sf(e,t,n,r,i){let a=Wf((typeof t==`string`?uf(t):t).pathname||`/`,n);if(a==null)return null;let o=i??wf(e),s=null,c=Uf(a);for(let e=0;s==null&&e<o.length;++e)s=zf(o[e],c,r);return s}function Cf(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function wf(e){let t=Tf(e);return Df(t),t}function Tf(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;W(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=$f([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(W(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Tf(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Lf(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Hf(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ef(e.path))a(e,t,!0,n)}),t}function Ef(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ef(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Df(e){e.sort((e,t)=>e.score===t.score?Rf(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Of=/^:[\w-]+$/,kf=/^:[\w-]+/,Af=3.5,jf=3,Mf=2,Nf=1,Pf=10,Ff=-2,If=e=>e===`*`;function Lf(e,t){let n=e.split(`/`),r=n.length;return n.some(If)&&(r+=Ff),t&&(r+=Mf),n.filter(e=>!If(e)).reduce((e,t)=>e+(Of.test(t)?jf:kf.test(t)?Af:t===``?Nf:Pf),r)}function Rf(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function zf(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Vf(u,l,s.matcher,s.compiledParams):Bf(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Bf({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:$f([a,d.pathname]),pathnameBase:tp($f([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=$f([a,d.pathnameBase]))}return o}function Bf(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Hf(e.path,e.caseSensitive,e.end);return Vf(e,t,n,r)}function Vf(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=ep(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=ep(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Hf(e,t=!1,n=!0){af(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Uf(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return af(!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 Wf(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Gf({basename:e,pathname:t}){return t===`/`?e:$f([e,t])}var Kf=e=>Qd.test(e);function qf(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?uf(e):e,a;return n?(n=Qf(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?K(n.substring(1),`/`):K(n,t)):a=t,{pathname:a,search:np(r),hash:rp(i)}}function K(e,t){let n=ep(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Jf(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yf(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Xf(e){let t=Yf(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Zf(e,t,n,r=!1){let i;typeof e==`string`?i=uf(e):(i={...e},W(!i.pathname||!i.pathname.includes(`?`),Jf(`?`,`pathname`,`search`,i)),W(!i.pathname||!i.pathname.includes(`#`),Jf(`#`,`pathname`,`hash`,i)),W(!i.search||!i.search.includes(`#`),Jf(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=qf(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Qf=e=>e.replace(/[\\/]{2,}/g,`/`),$f=e=>Qf(e.join(`/`));function ep(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var tp=e=>ep(e).replace(/^\/*/,`/`),np=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,rp=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ip=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ap=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function op(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function q(e){return $f(e.map(e=>e.route.path).filter(Boolean))||`/`}function sp(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?uf(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var cp=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function lp(e,t){let n=e;if(typeof n!=`string`||!Qd.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(cp)try{let e=new URL(window.location.href),r=$d.test(n)?new URL(ef(n,e.protocol)):new URL(n),a=Wf(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{af(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var up=Symbol(`Uninstrumented`),dp=new WeakMap;function fp(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>vp(await yp(n.lazy,void 0,()=>e(...t),bp))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>vp(await yp(n[`lazy.middleware`],void 0,()=>t(...e),bp))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>vp(await yp(n[`lazy.loader`],void 0,()=>t(...e),bp))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>vp(await yp(n[`lazy.action`],void 0,()=>t(...e),bp))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=mp(t.loader),i=async(...t)=>vp(await yp(n.loader,xp(t[0]),()=>e(...t),bp));e.hydrate===!0&&(i.hydrate=!0),hp(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=mp(t.action),i=async(...t)=>vp(await yp(n.action,xp(t[0]),()=>e(...t),bp));hp(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=mp(e),r=async(...e)=>vp(await yp(n.middleware,xp(e[0]),()=>t(...e),bp));return hp(r,t),r})),r}function pp(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=mp(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?lf(i):`.`,...Sp(e,a??{})};return vp(await yp(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=gp(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...bp(e),meta:o})))};hp(r,t),e.navigate=r}if(n.fetch.length>0){let t=mp(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return vp(await yp(n.fetch,{href:o??`.`,fetcherKey:i,...Sp(e,s??{})},async()=>{let n=gp(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...bp(e),meta:c})))};hp(r,t),e.fetch=r}return e}function mp(e){return e[up]??e}function hp(e,t){e[up]=t}function gp(e,t){return dp.set(e,t),()=>{dp.get(e)===t&&dp.delete(e)}}function _p(e){let t=dp.get(e);return dp.delete(e),t}function vp(e){if(e.type===`error`)throw e.value;return e.value}async function yp(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=yp(e,t,n,r,i,a-1),await s,W(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function bp(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function xp(e){let{request:t,context:n,params:r}=e;return{...e,request:Cp(t),params:{...r},context:wp(n)}}function Sp(e,t){return{currentUrl:lf(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Cp(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function wp(e){return{get:t=>e.get(t)}}var Tp=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=wf(e)}match(e,t=!1){return Sf(this.#e,e,this.#n,t,this.#t)}},Ep=new URL(`http://localhost`);function Dp(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ep)}catch{return Ep}}function Op(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function kp(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Ap(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Op(i,n),s=!Op(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!kp(e,i)||!Op(i,a)))throw Error(`External navigation is not allowed`)}var jp=[`POST`,`PUT`,`PATCH`,`DELETE`],Mp=new Set(jp),Np=[`GET`,...jp],Pp=new Set(Np),Fp=new Set([301,302,303,307,308]),Ip=new Set([307,308]),Lp={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rp={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zp={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Bp=`remix-router-transitions`,Vp=Symbol(`ResetLoaderData`);function Hp(e,t){return e.unstable_routePatternMatching?(W(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Tp(t)}var Up=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}};function Wp(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;W(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...fp(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=Hp(o,s),l={},u=new Up(G(e.routes,a,void 0,l),c),d=e.dataStrategy||sm,f=null,p=new Set,m=null,h=null,g=null,_=null,v=e.hydrationData!=null,y=c.match(e.history.location),b=!1,x=null,S,C;if(y==null&&!e.patchRoutesOnNavigation){let t=jm(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Am(u.activeRoutes);S=!0,C=!S,y=n,x={[r.id]:t}}else if(y&&!e.hydrationData&&Ye(y,e.history.location.pathname).active&&(y=null),!y){S=!1,C=!S,y=[];let t=Ye(null,e.history.location.pathname);t.active&&t.matches&&(b=!0,y=t.matches)}else if(y.some(e=>e.route.lazy))S=!1,C=!S;else if(!y.some(e=>Yp(e.route)))S=!0,C=!S;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=y;if(n){let e=y.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}C=!1,S=!0,r.forEach(e=>{let r=Xp(e.route,t,n);C||=r.renderFallback,S&&=!r.shouldLoad})}let w,T={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,renderFallback:C,navigation:Lp,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=`POP`,D=null,O=!1,k,ee=!1,A=new Map,te=null,ne=!1,re=!1,ie=new Set,ae=new Map,oe=0,se=-1,ce=new Map,j=new Set,le=new Map,ue=new Map,de=new Set,fe=new Map,pe,me=null;function he(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(pe){pe(),pe=void 0;return}af(fe.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ue({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{pe=e});e.history.go(r*-1),He(i,{state:`blocked`,location:n,proceed(){He(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(T.blockers);e.set(i,zp),N({blockers:e})}}),D?.resolve(),D=null;return}return F(t,n)}),n){nh(t,A);let e=()=>rh(t,A);t.addEventListener(`pagehide`,e),te=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||F(`POP`,T.location,{initialHydration:!0}),w}function ge(){f&&f(),te&&te(),p.clear(),k&&k.abort(),T.fetchers.forEach((e,t)=>Pe(T.fetchers,t)),T.blockers.forEach((e,t)=>Ve(t))}function M(e){if(p.add(e),m){let{newErrors:t}=m;m=null,e(T,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)}function N(e,t={}){e.matches&&=e.matches.map(e=>{let t=l[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),T={...T,...e};let n=[],r=[];T.fetchers.forEach((e,t)=>{e.state===`idle`&&(de.has(t)?n.push(t):r.push(t))}),de.forEach(e=>{!T.fetchers.has(e)&&!ae.has(e)&&n.push(e)}),p.size===0&&(m={newErrors:e.errors??null}),[...p].forEach(r=>r(T,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Pe(T.fetchers,e)),r.forEach(e=>T.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=T.actionData!=null&&T.navigation.formMethod!=null&&Km(T.navigation.formMethod)&&T.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?T.actionData:null;let o=n.loaderData?Dm(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,s=T.blockers;s.size>0&&!ne&&(s=new Map(s),s.forEach((e,t)=>s.set(t,zp)));let c=!ne&&Je(t,n.matches||T.matches),l=O===!0||T.navigation.formMethod!=null&&Km(T.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),ne||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!ne&&t!==T.location){let e=A.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(ee){let e=A.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(T.location.pathname,e)),d={currentLocation:T.location,nextLocation:t}}N({...n,actionData:a,loaderData:o,historyAction:E,location:t,initialized:!0,renderFallback:!1,navigation:Lp,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,O=!1,ee=!1,ne=!1,re=!1,D?.resolve(),D=null,me?.resolve(),me=null}async function P(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=ih();let n=D.promise;return e.history.go(t),n}let r=_p(w),{path:i,submission:a,error:o}=qp(!1,Kp(T.location,T.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?uf(n.mask):{...T.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},$d.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Ap(typeof n.mask==`string`?n.mask:lf(n.mask),lf(c),e.history.createURL(`/`),`reject`)}let l=T.location,u=cf(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},Ap(t==null?e.history.createHref(T.location):typeof t==`string`?t:lf(t),e.history.createHref(u.mask||u),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Km(a.formMethod)&&a.formAction===T.location.pathname+T.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Ue({currentLocation:l,nextLocation:u,historyAction:f});if(h){He(h,{state:`blocked`,location:u,proceed(){He(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),P(t,n)},reset(){let e=new Map(T.blockers);e.set(h,zp),N({blockers:e})}});return}await F(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ve(){me||=ih(),ke(),N({revalidation:`loading`});let e=me.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(F(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(F(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ee===!0}),e)}async function F(t,n,r){k&&k.abort(),k=null,E=t,ne=(r&&r.startUninterruptedRevalidation)===!0,qe(T.location,T.matches),O=(r&&r.preventScrollReset)===!0,ee=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&T.matches&&T.matches.length>0&&!b?T.matches:c.match(n),a=(r&&r.flushSync)===!0;if(i&&T.initialized&&!re&&Pm(T.location,n)&&!(r&&r.submission&&Km(r.submission.formMethod))){_e(n,{matches:i},{flushSync:a});return}let o=Ye(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=Ym(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=We(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;k=new AbortController;let l=Sm(e.history,n,k.signal,r&&r.submission),u=e.getContext?await e.getContext():new pf,d;if(r&&r.pendingError)d=[km(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Km(r.submission.formMethod)){let c=await ye(l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(c.shortCircuited)return;if(c.pendingActionResult){let[e,t]=c.pendingActionResult;if(zm(t)&&op(t.error)&&t.error.status===404){k=null,_e(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,d=c.pendingActionResult,s=Zm(n,i,t,r.submission),a=!1,o.active=!1,l=Sm(e.history,l.url,l.signal)}let{shortCircuited:f,matches:p,loaderData:m,errors:h,workingFetchers:g}=await be(l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,d,r&&r.callSiteDefaultShouldRevalidate);f||(k=null,_e(n,{matches:p||i,...Om(d),loaderData:m,errors:h,...g?{fetchers:g}:{}}))}async function ye(t,n,i,o,c,d,f,p,m={}){if(ke(),N({navigation:Qm(n,o,c,i)},{flushSync:m.flushSync===!0}),f){let e=await Xe(o,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Am(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=km(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)o=e.matches;else{let{notFoundMatches:e,error:t,route:r}=We(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Jm(o,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:jm(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await De(t,n,pm(a,l,t,n,o,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of o)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Bm(h)){let n;return n=m&&m.replace!=null?m.replace:xm(h.response.headers.get(`Location`),new URL(t.url),s,e.history)===T.location.pathname+T.location.search,await Ee(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(zm(h)){let e=km(o,g.route.id);return(m&&m.replace)!==!0&&(E=`PUSH`),{matches:o,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:o,pendingActionResult:[g.route.id,h]}}async function be(t,n,i,o,s,d,f,p,m,h,g,_,v,y){let b=f||Zm(n,i,o,p),x=p||m||Xm(b),S=!ne&&!g;if(d){if(S){let e=xe(v);N({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Xe(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Am(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=km(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=We(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let{dsMatches:C,revalidatingFetchers:w}=Jp(t,s,a,l,e.history,T,i,x,n,g?[]:r,g===!0,re,ie,de,le,j,c,v,y);if(se=++oe,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&w.length===0){let e=new Map(T.fetchers),t=Re(e);return _e(n,{matches:i,loaderData:{},errors:v&&zm(v[1])?{[v[0]]:v[1].error}:null,...Om(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=xe(v);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=Se(w)),N(e,{flushSync:_})}w.forEach(e=>{Ie(e.key),e.controller&&ae.set(e.key,e.controller)});let E=()=>w.forEach(e=>Ie(e.key));k&&k.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Oe(C,w,t,n,s);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener(`abort`,E),w.forEach(e=>ae.delete(e.key));let ee=Mm(D);if(ee)return await Ee(t,ee.result,!0,{replace:h}),{shortCircuited:!0};if(ee=Mm(O),ee)return j.add(ee.key),await Ee(t,ee.result,!0,{replace:h}),{shortCircuited:!0};let A=new Map(T.fetchers),{loaderData:te,errors:ce}=Em(T,i,D,v,w,O,A);g&&T.errors&&(ce={...T.errors,...ce});let ue=Re(A),fe=ze(se,A),pe=ue||fe||w.length>0;return{matches:i,loaderData:te,errors:ce,...pe?{workingFetchers:A}:{}}}function xe(e){if(e&&!zm(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Se(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=$m(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ce(t,n,r,i){Ie(t);let a=(i&&i.flushSync)===!0,o=_p(w),l=Kp(T.location,T.matches,s,r,n,i?.relative),u=c.match(l),d=Ye(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(Ym(e.history,l,u)),!u){je(t,n,jm(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=qp(!0,l,i);if(m){je(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new pf,g=(i&&i.preventScrollReset)===!0;if(p&&Km(p.formMethod)){await we(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};le.set(t,_),await Te(t,_,u,h,a,g,p)}async function we(t,n,i,o,s,u,d,f,p,m){ke(),le.delete(t),Ae(t,eh(p,T.fetchers.get(t)),{flushSync:d});let h=new AbortController,g=Sm(e.history,i,h.signal,p);if(u){let e=await Xe(o,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){je(t,n,e.error,{flushSync:d});return}if(e.matches)o=e.matches;else{je(t,n,jm(404,{pathname:i}),{flushSync:d});return}}let _=Jm(o,i);if(!_.route.action&&!_.route.lazy){je(t,n,jm(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:d});return}ae.set(t,h);let v=oe,y=pm(a,l,g,i,o,_,r,s),b=await De(g,i,y,s,t),x=b[_.route.id];if(!x){for(let e of y)if(b[e.route.id]){x=b[e.route.id];break}}if(g.signal.aborted){ae.get(t)===h&&ae.delete(t);return}if(de.has(t)){if(Bm(x)||zm(x)){Ae(t,th(void 0));return}}else{if(Bm(x)){if(ae.delete(t),se>v){Ae(t,th(void 0));return}return j.add(t),Ae(t,$m(p)),Ee(g,x,!1,{fetcherSubmission:p,preventScrollReset:f})}if(zm(x)){je(t,n,x.error);return}}let S=T.navigation.location||T.location,C=Sm(e.history,S,h.signal),w=T.navigation.state===`idle`?T.matches:c.match(T.navigation.location);W(w,`Didn't find any matches after fetcher action`);let D=++oe;ce.set(t,D);let{dsMatches:O,revalidatingFetchers:ee}=Jp(C,s,a,l,e.history,T,w,p,S,r,!1,re,ie,de,le,j,c,[_.route.id,x],m),A=$m(p,x.data),te=new Map(T.fetchers);te.set(t,A),ee.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=te.get(t),r=$m(void 0,n?n.data:void 0);te.set(t,r),Ie(t),e.controller&&ae.set(t,e.controller)}),N({fetchers:te});let ne=()=>ee.forEach(e=>Ie(e.key));h.signal.addEventListener(`abort`,ne);let{loaderResults:ue,fetcherResults:fe}=await Oe(O,ee,C,S,s);if(h.signal.aborted){ce.get(t)===D&&ce.delete(t);return}h.signal.removeEventListener(`abort`,ne),ce.delete(t),ae.delete(t),ee.forEach(e=>ae.delete(e.key));let pe=T.fetchers.has(t),me=e=>{if(!pe)return e;let n=new Map(e.fetchers);return n.set(t,th(x.data)),{...e,fetchers:n}},he=Mm(ue);if(he)return T=me(T),Ee(C,he.result,!1,{preventScrollReset:f});if(he=Mm(fe),he)return j.add(he.key),T=me(T),Ee(C,he.result,!1,{preventScrollReset:f});let ge=new Map(T.fetchers);pe&&ge.set(t,th(x.data));let{loaderData:M,errors:P}=Em(T,w,ue,void 0,ee,fe,ge);ze(D,ge),T.navigation.state===`loading`&&D>se?(W(E,`Expected pending action`),k&&k.abort(),_e(T.navigation.location,{matches:w,loaderData:M,errors:P,fetchers:ge})):(N({errors:P,loaderData:Dm(T.loaderData,M,w,P),fetchers:ge}),re=!1)}async function Te(t,n,i,o,s,c,u){let{routeId:d,path:f}=n,p=T.fetchers.get(t);Ae(t,$m(u,p?p.data:void 0),{flushSync:s});let m=new AbortController,h=Sm(e.history,f,m.signal);if(n.isDiscovering){let e=await Xe(i,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){je(t,d,e.error,{flushSync:s});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{je(t,d,jm(404,{pathname:f}),{flushSync:s});return}}let g=Jm(i,f);ae.set(t,m);let _=oe,v=await De(h,f,pm(a,l,h,f,i,g,r,o),o,t),y=v[g.route.id];if(!y){for(let e of i)if(v[e.route.id]){y=v[e.route.id];break}}if(ae.get(t)===m&&ae.delete(t),!h.signal.aborted){if(de.has(t)){Ae(t,th(void 0));return}if(Bm(y)){if(se>_){Ae(t,th(void 0));return}j.add(t),await Ee(h,y,!1,{preventScrollReset:c});return}if(zm(y)){je(t,d,y.error);return}Ae(t,th(y.data))}}async function Ee(r,i,a,{submission:o,fetcherSubmission:c,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(re=!0);let d=i.response.headers.get(`Location`);W(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=xm(d,p,s,e.history),Ap(f,d,p,`allow-explicit`);let m=cf(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Kf(d)){let n=ff(t,d,!0);e=n.origin!==t.location.origin||Wf(n.pathname,s)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}k=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=T.navigation;!o&&!c&&g&&_&&v&&(o=Xm(T.navigation));let y=o||c;Ip.has(i.response.status)&&y&&Km(y.formMethod)?await F(h,m,{submission:{...y,formAction:d},preventScrollReset:l||O,enableViewTransition:a?ee:void 0}):await F(h,m,{overrideNavigation:Zm(m,[],h,o),fetcherSubmission:c,preventScrollReset:l||O,enableViewTransition:a?ee:void 0})}async function De(e,t,n,r,i){let a,o={};try{a=await mm(d,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Km(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!T.loaderData.hasOwnProperty(e.route.id)&&(!T.errors||!T.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Rm(r)){let i=r.result;o[t]={type:`redirect`,response:vm(i,e,t,n,s)}}else o[t]=await _m(r);return o}async function Oe(e,t,n,r,i){let a=De(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await De(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:jm(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function ke(){re=!0,le.forEach((e,t)=>{ae.has(t)&&ie.add(t),Ie(t)})}function Ae(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),N({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function je(e,t,n,r={}){let i=km(T.matches,t),a=new Map(T.fetchers);Pe(a,e),N({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Me(e){return ue.set(e,(ue.get(e)||0)+1),de.has(e)&&de.delete(e),T.fetchers.get(e)||Rp}function Ne(e,t){Ie(e,t?.reason),Ae(e,th(null))}function Pe(e,t){let n=T.fetchers.get(t);ae.has(t)&&!(n&&n.state===`loading`&&ce.has(t))&&Ie(t),le.delete(t),ce.delete(t),j.delete(t),de.delete(t),ie.delete(t),e.delete(t)}function Fe(e){let t=(ue.get(e)||0)-1;t<=0?(ue.delete(e),de.add(e)):ue.set(e,t),N({fetchers:new Map(T.fetchers)})}function Ie(e,t){let n=ae.get(e);n&&(n.abort(t),ae.delete(e))}function Le(e,t){for(let n of e){let e=t.get(n);W(e,`Expected fetcher: ${n}`);let r=th(e.data);t.set(n,r)}}function Re(e){let t=[],n=!1;for(let r of j){let i=e.get(r);W(i,`Expected fetcher: ${r}`),i.state===`loading`&&(j.delete(r),t.push(r),n=!0)}return Le(t,e),n}function ze(e,t){let n=[];for(let[r,i]of ce)if(i<e){let e=t.get(r);W(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Ie(r),ce.delete(r),n.push(r))}return Le(n,t),n.length>0}function Be(e,t){let n=T.blockers.get(e)||zp;return fe.get(e)!==t&&fe.set(e,t),n}function Ve(e){T.blockers.delete(e),fe.delete(e)}function He(e,t){let n=T.blockers.get(e)||zp;W(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),N({blockers:r})}function Ue({currentLocation:e,nextLocation:t,historyAction:n}){if(fe.size===0)return;fe.size>1&&af(!1,`A router only supports one blocker at a time`);let r=Array.from(fe.entries()),[i,a]=r[r.length-1],o=T.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function We(e){let t=jm(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=Am(n);return{notFoundMatches:r,route:i,error:t}}function Ge(e,t,n){if(h=e,_=t,g=n||null,!v&&T.navigation===Lp){v=!0;let e=Je(T.location,T.matches);e!=null&&N({restoreScrollPosition:e})}return()=>{h=null,_=null,g=null}}function Ke(e,t){return g&&g(e,t.map(e=>Cf(e,T.loaderData)))||e.key}function qe(e,t){if(h&&_){let n=Ke(e,t);h[n]=_()}}function Je(e,t){if(h){let n=Ke(e,t),r=h[n];if(typeof r==`number`)return r}return null}function Ye(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:c.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:c.match(n,!0)}}return{active:!1,matches:null}}async function Xe(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let o=t;for(;;){let t=l;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:o,fetcherKey:i,patch:(e,n)=>{r.aborted||em(e,n,u,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:o}}if(r.aborted)return{type:`aborted`};let s=c.match(n),d=null;if(s&&(Object.keys(s[0].params).length===0||(d=c.match(n,!0),!(d&&o.length<d.length&&Ze(o,d.slice(0,o.length))))))return{type:`success`,matches:s};if(d||=c.match(n,!0),!d||Ze(o,d))return{type:`success`,matches:null};o=d}}function Ze(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Qe(e){l={},u.setHmrRoutes(G(e,a,void 0,l))}function $e(e,t,n=!1){em(e,t,u,l,a,n),u.hasHMRRoutes||N({})}return w={get basename(){return s},get future(){return o},get state(){return T},get routes(){return u.stableRoutes},match(e){return c.match(e)},get manifest(){return l},get window(){return t},initialize:he,subscribe:M,enableScrollRestoration:Ge,navigate:P,fetch:Ce,revalidate:ve,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Me,resetFetcher:Ne,deleteFetcher:Fe,dispose:ge,getBlocker:Be,deleteBlocker:Ve,patchRoutes:$e,_internalFetchControllers:ae,_internalSetRoutes:Qe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){N(e)}},e.instrumentations&&(w=pp(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function Gp(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Kp(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Zf(r||`.`,Xf(o),Wf(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=qm(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=Gf({basename:n,pathname:c.pathname})),lf(c)}function qp(e,t,n){if(!n||!Gp(n))return{path:t};if(n.formMethod&&!Gm(n.formMethod))return{path:t,error:jm(405,{method:n.formMethod})};let r=()=>({path:t,error:jm(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Nm(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Km(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Km(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}W(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Cm(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Cm(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=wm(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=wm(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Km(c.formMethod))return{path:t,submission:c};let l=uf(t);return e&&l.search&&qm(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:lf(l),submission:c}}function Jp(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?zm(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&zm(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=q(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!Yp(s))f=!1;else if(u){let{shouldLoad:e}=Xp(s,a.loaderData,a.errors);f=e}else Zp(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return fm(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?Qp(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return fm(n,r,e,c,E,i,l,t,$p(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=Jm(_,e.path),b=new AbortController,x=Sm(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=pm(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=pm(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};$p(y,a)&&(S=pm(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function Yp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Xp(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Yp(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Zp(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Qp(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function $p(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function em(e,t,n,r,i,a){let o;if(e){let t=r[e];W(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>tm(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=G(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=G([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function tm(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>tm(e,t)))??!1}var nm=new WeakMap,rm=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(W(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=nm.get(i);o||(o={},nm.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=hf(e),n=i[e]!==void 0;if(t)af(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)af(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},im=new WeakMap;function am(e,t,n,r,i){let a=n[e.id];if(W(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=im.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{W(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=_f(e),o=a[e]!==void 0;i?af(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?af(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return im.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=rm({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function om(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function sm(e){return e.matches.some(e=>e.route.middleware)?cm(e,()=>om(e)):om(e)}function cm(e,t){return lm(e,t,e=>{if(Wm(e))throw e;return e},Im,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[km(r,a).route.id]:{type:`error`,result:t}}}}}async function lm(e,t,n,r,i){let{matches:a,...o}=e;return await um(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function um(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await um(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function dm(e,t,n,r,i){let a=rm({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=am(r.route,Km(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function fm(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=dm(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?$p(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?$p(a,{...l,defaultShouldRevalidate:e}):$p(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Km(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Km(n.method)||!p)?hm({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function pm(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?fm(e,t,n,r,q(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:dm(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function mm(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:sp(t,n),pattern:q(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return cm(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function hm({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Km(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:sp(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw jm(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw jm(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function gm(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function _m(e){let{result:t,type:n}=e;if(Hm(t)){let e;try{e=await gm(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new ap(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Vm(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Fm(t),statusCode:op(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:op(t)?t.status:void 0}:Vm(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function vm(e,t,n,r,i){let a=e.headers.get(`Location`);if(W(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Kf(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Kp(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var ym=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function bm(e){try{return ym.includes(new URL(e).protocol)}catch{return!1}}function xm(e,t,n,r){if(Kf(e)){let r=e,i=$d.test(r)?new URL(ef(r,t.protocol)):new URL(r);if(bm(i.toString()))throw Error(`Invalid redirect location`);let a=Wf(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Qf(i.pathname)+i.search+i.hash}try{if(bm(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Sm(e,t,n,r){let i=e.createURL(Nm(t)).toString(),a={signal:n};if(r&&Km(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Cm(r.formData):r.formData}return new Request(i,a)}function Cm(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function wm(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Tm(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&zm(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(W(!Bm(f),`Cannot handle redirect results in processLoaderData`),zm(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=km(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Vp),c||(c=!0,s=op(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Em(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Tm(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(W(s,`Did not find corresponding fetcher result`),zm(s)){let t=km(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Bm(s))W(!1,`Unhandled fetcher revalidation redirect`);else{let e=th(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Dm(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Vp).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Om(e){return e?zm(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function km(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Am(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function jm(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new ap(e||500,o,Error(s),!0)}function Mm(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Bm(r))return{key:n,result:r}}}function Nm(e){return lf({...typeof e==`string`?uf(e):e,hash:``})}function Pm(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Fm(e){return new ap(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Im(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Lm(t))}function Lm(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Rm(e){return Hm(e.result)&&Fp.has(e.result.status)}function zm(e){return e.type===`error`}function Bm(e){return(e&&e.type)===`redirect`}function Vm(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Hm(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Um(e){return Fp.has(e)}function Wm(e){return Hm(e)&&Um(e.status)&&e.headers.has(`Location`)}function Gm(e){return Pp.has(e.toUpperCase())}function Km(e){return Mp.has(e.toUpperCase())}function qm(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Jm(e,t){let n=typeof t==`string`?uf(t).search:t.search;if(e[e.length-1].route.index&&qm(n||``))return e[e.length-1];let r=Yf(e);return r[r.length-1]}function Ym(e,t,n){return{url:sp(e.createURL(t),t),pattern:n?q(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Xm(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Zm(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qm(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function $m(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function eh(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function th(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function nh(e,t){try{let n=e.sessionStorage.getItem(Bp);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function rh(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Bp,JSON.stringify(n))}catch(e){af(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function ih(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var ah=m.createContext(null);ah.displayName=`DataRouter`;var oh=m.createContext(null);oh.displayName=`DataRouterState`;var sh=m.createContext(null);sh.displayName=`DataRouterData`;var ch=m.createContext(null);ch.displayName=`DataRouterNavigation`;var lh=m.createContext(!1);function uh(){return m.useContext(lh)}var dh=m.createContext({isTransitioning:!1});dh.displayName=`ViewTransition`;var fh=m.createContext(null);fh.displayName=`Fetchers`;var ph=m.createContext(null);ph.displayName=`Await`;var mh=m.createContext(null);mh.displayName=`Navigation`;var hh=m.createContext(null);hh.displayName=`Location`;var gh=m.createContext({outlet:null,matches:[],isDataRoute:!1});gh.displayName=`Route`;var _h=m.createContext(!1);_h.displayName=`IsDataRoute`;var vh=m.createContext(void 0);vh.displayName=`RouteId`;var yh=m.createContext(null);yh.displayName=`RouteError`;var bh=`REACT_ROUTER_ERROR`,xh=`REDIRECT`,Sh=`ROUTE_ERROR_RESPONSE`;function Ch(e){if(e.startsWith(`${bh}:${xh}:{`))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 wh(e){if(e.startsWith(`${bh}:${Sh}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ap(t.status,t.statusText,t.data)}catch{}}function Th(e,{relative:t}={}){W(Eh(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=m.useContext(mh),{hash:i,pathname:a,search:o}=Ph(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:$f([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Eh(){return m.useContext(hh)!=null}function Dh(){return W(Eh(),`useLocation() may be used only in the context of a <Router> component.`),m.useContext(hh).location}var Oh=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function kh(){return m.useContext(_h)?Yh():Ah()}function Ah(){W(Eh(),`useNavigate() may be used only in the context of a <Router> component.`);let e=m.useContext(ah),{basename:t,navigator:n}=m.useContext(mh),{matches:r}=m.useContext(gh),{pathname:i}=Dh(),a=JSON.stringify(Xf(r)),o=m.useRef(!1);return m.useLayoutEffect(()=>{o.current=!0}),m.useCallback((r,s={})=>{if(af(o.current,Oh),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Zf(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:$f([t,c.pathname])),Ap(typeof r==`string`?r:lf(r),n.createHref(c),Dp(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var jh=m.createContext(null);function Mh(e){let t=m.useContext(gh).outlet;return m.useMemo(()=>t&&m.createElement(jh.Provider,{value:e},t),[t,e])}function Nh(){let{matches:e}=m.useContext(gh);return e[e.length-1]?.params??{}}function Ph(e,{relative:t}={}){let{matches:n}=m.useContext(gh),{pathname:r}=Dh(),i=JSON.stringify(Xf(n));return m.useMemo(()=>Zf(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Fh(e,t,n){W(Eh(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=m.useContext(mh),{matches:i}=m.useContext(gh),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=Dh(),l;if(t){let e=typeof t==`string`?uf(t):t;W(s===`/`||e.pathname?.startsWith(s),`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 "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):xf(e,{pathname:d});let p=Hh(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:$f([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:$f([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?m.createElement(hh.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Ih(){let e=Jh(),t=op(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return m.createElement(m.Fragment,null,m.createElement(`h2`,null,`Unexpected Application Error!`),m.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?m.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Lh=m.createElement(Ih,null),Rh=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=lh;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?t.error:e.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`){let t=wh(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:m.createElement(gh.Provider,{value:this.props.routeContext},m.createElement(_h.Provider,{value:this.props.routeContext.isDataRoute},m.createElement(vh.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},m.createElement(yh.Provider,{value:e,children:this.props.component}))));return this.context?m.createElement(Bh,{error:e},t):t}},zh=new WeakMap;function Bh({children:e,error:t}){let{basename:n,navigator:r}=m.useContext(mh);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ch(t.digest);if(e){let i=zh.get(t);if(i)throw i;let a=lp(e.location,n),o=a.absoluteURL||a.to;if(Ap(e.location,o,Dp(r),`allow-explicit`),bm(o))throw Error(`Invalid redirect location`);if(cp&&!zh.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw zh.set(t,n),n}}return m.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Vh({routeContext:e,match:t,children:n}){let r=m.useContext(ah);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(gh.Provider,{value:e},m.createElement(_h.Provider,{value:e.isDataRoute},m.createElement(vh.Provider,{value:t.route.id},n)))}function Hh(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);W(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:q(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Lh,o&&(s<0&&c===0?(Zh(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?f:d?p:n.route.Component?m.createElement(n.route.Component,null):n.route.element?n.route.element:e,m.createElement(Vh,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?m.createElement(Rh,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Uh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wh(e){let t=m.useContext(ah);return W(t,Uh(e)),t}function Gh(e){let t=m.useContext(oh);return W(t,Uh(e)),t}function Kh(e){let t=m.useContext(sh);return W(t,Uh(e)),t}function qh(e){let t=m.useContext(vh);return W(t,`${e} can only be used on routes that contain a unique "id"`),t}function Jh(){let e=m.useContext(yh),t=Kh(`useRouteError`),n=qh(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Yh(){let{router:e}=Wh(`useNavigate`),t=qh(`useNavigate`),n=m.useRef(!1);return m.useLayoutEffect(()=>{n.current=!0}),m.useCallback(async(r,i={})=>{af(n.current,Oh),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Xh={};function Zh(e,t,n){!t&&!Xh[e]&&(Xh[e]=!0,af(!1,n))}var Qh={};function $h(e,t){!e&&!Qh[t]&&(Qh[t]=!0,console.warn(t))}var eg=[`HydrateFallback`,`hydrateFallbackElement`],tg=class{status=`pending`;promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function ng({router:e,flushSync:t,onError:n,useTransitions:r}){r=uh()||r;let[i,a]=m.useState(e.state),[o,s]=(0,m.useOptimistic)(i),[c,l]=m.useState(),[u,d]=m.useState({isTransitioning:!1}),[f,p]=m.useState(),[h,g]=m.useState(),[_,v]=m.useState(),y=m.useRef(new Map),b=m.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:q(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),$h(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if($h(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&u?t(()=>a(i)):r===!1?a(i):m.startTransition(()=>{r===!0&&s(e=>rg(e,i)),a(i)});return}if(t&&u){t(()=>{h&&(f?.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),g(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>g(n));return}h?(f?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,f,r,s,n]);m.useLayoutEffect(()=>e.subscribe(b),[e,b]),m.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new tg)},[u]),m.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):m.startTransition(()=>{r===!0&&s(e=>rg(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),g(void 0),l(void 0),d({isTransitioning:!1})}),g(i)}},[c,f,e.window,r,s]),m.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,h,o.location,c]),m.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=m.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=m.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]),w=m.useMemo(()=>({historyAction:o.historyAction,location:o.location,matches:o.matches,initialized:o.initialized,renderFallback:o.renderFallback,restoreScrollPosition:o.restoreScrollPosition,preventScrollReset:o.preventScrollReset,blockers:o.blockers}),[o.historyAction,o.location,o.matches,o.initialized,o.renderFallback,o.restoreScrollPosition,o.preventScrollReset,o.blockers]),T=m.useMemo(()=>({navigation:o.navigation,revalidation:o.revalidation}),[o.navigation,o.revalidation]),E=m.useMemo(()=>({loaderData:o.loaderData,actionData:o.actionData,errors:o.errors}),[o.loaderData,o.actionData,o.errors]),D=m.useMemo(()=>({fetchers:o.fetchers,fetcherData:y.current}),[o.fetchers]);return m.createElement(m.Fragment,null,m.createElement(ah.Provider,{value:C},m.createElement(oh.Provider,{value:w},m.createElement(ch.Provider,{value:T},m.createElement(sh.Provider,{value:E},m.createElement(fh.Provider,{value:D},m.createElement(dh.Provider,{value:u},m.createElement(sg,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},m.createElement(ig,{routes:e.routes,manifest:e.manifest,state:o,isStatic:!1,onError:n})))))))),null)}function rg(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var ig=m.memo(ag);function ag({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=m.useContext(ah);return W(a,`You must render this element inside a <DataRouterContext.Provider> element`),Fh(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function og(e){return Mh(e.context)}function sg({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){W(!Eh(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=m.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=uf(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:h}=n,g=m.useMemo(()=>{let e=Wf(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:h},navigationType:r}},[s,l,u,d,f,p,r,h]);return af(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:m.createElement(mh.Provider,{value:c},m.createElement(hh.Provider,{children:t,value:g}))}m.Component;var cg=`application/x-www-form-urlencoded`;function lg(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ug(e){return lg(e)&&e.tagName.toLowerCase()===`button`}function dg(e){return lg(e)&&e.tagName.toLowerCase()===`form`}function fg(e){return lg(e)&&e.tagName.toLowerCase()===`input`}function pg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mg(e,t){return e.button===0&&(!t||t===`_self`)&&!pg(e)}function hg(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function gg(e,t){let n=hg(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var _g=null;function vg(){if(_g===null)try{new FormData(document.createElement(`form`),0),_g=!1}catch{_g=!0}return _g}var yg=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function bg(e){return e!=null&&!yg.has(e)?(af(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${cg}"`),null):e}function xg(e,t){let n,r,i,a,o;if(dg(e)){let o=e.getAttribute(`action`);r=o?Wf(o,t):null,n=e.getAttribute(`method`)||`get`,i=bg(e.getAttribute(`enctype`))||cg,a=new FormData(e)}else if(ug(e)||fg(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Wf(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=bg(e.getAttribute(`formenctype`))||bg(o.getAttribute(`enctype`))||cg,a=new FormData(o,e),!vg()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(lg(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=cg,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Sg(e,t){if(e===!1||e==null)throw Error(t)}function Cg(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}var wg=l(Yd(),1),Tg=Zd(),Eg=`modulepreload`,Dg=function(e){return`/ui/`+e},Og={},kg=function(e){return e.pathname.endsWith(`.css`)},Ag=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Dg(t,n);let r=s(t);if(r.href in Og)return;Og[r.href]=!0;let i=kg(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:Eg,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function jg(e,t){if(e.id in t)return t[e.id];try{let n=await Ag(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Mg(e){return e!=null&&typeof e.page==`string`}function Ng(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 Pg(e,t,n){return zg((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await jg(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ng).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Fg(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ig(e,t,{includeHydrateFallback:n}={}){return Lg(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Lg(e){return[...new Set(e)]}function Rg(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function zg(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Mg(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Rg(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Bg=m.createContext(void 0);Bg.displayName=`FrameworkContext`;function Vg(){let e=m.useContext(Bg);return Sg(e,`You must render this element inside a <HydratedRouter> element`),e}function Hg(e,t){let n=m.useContext(Bg),[r,i]=m.useState(!1),[a,o]=m.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=m.useRef(null);m.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),m.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ug(s,p),onBlur:Ug(c,h),onMouseEnter:Ug(l,p),onMouseLeave:Ug(u,h),onTouchStart:Ug(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ug(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wg({page:e,...t}){let n=uh(),{nonce:r}=Vg(),{router:i}=Wh(`PrefetchPageLinks`),a=m.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?m.createElement(Kg,{page:e,matches:a,...t}):m.createElement(qg,{page:e,matches:a,...t})):null}function Gg(e){let{manifest:t,routeModules:n}=Vg(),[r,i]=m.useState([]);return m.useEffect(()=>{let r=!1;return Pg(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Kg({page:e,matches:t,...n}){let r=Dh(),i=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Cg(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return m.createElement(m.Fragment,null,i.map(e=>m.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qg({page:e,matches:t,...n}){let r=Dh(),{manifest:i,routeModules:a}=Vg(),{matches:o}=Gh(`PrefetchPageLinks`),{loaderData:s}=Kh(`PrefetchPageLinks`),c=m.useMemo(()=>Fg(e,t,o,i,r,`data`),[e,t,o,i,r]),l=m.useMemo(()=>Fg(e,t,o,i,r,`assets`),[e,t,o,i,r]),u=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let l=Cg(e,`data`);return o&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[s,r,i,c,t,e,a]),d=m.useMemo(()=>Ig(l,i),[l,i]),f=Gg(l);return m.createElement(m.Fragment,null,u.map(e=>m.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>m.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>m.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Jg(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Yg=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Yg&&(window.__reactRouterVersion=`8`)}catch{}function Xg(e,t){return Wp({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:rf({window:t?.window}),hydrationData:t?.hydrationData||Zg(),routes:e,mapRouteProperties:yf,hydrationRouteProperties:eg,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Zg(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Qg(e.errors)}),e}function Qg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new ap(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&ip.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var $g=m.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},h){let{basename:g,navigator:_,useTransitions:v}=m.useContext(mh),y=typeof l==`string`&&Qd.test(l),b=lp(l,g);l=b.to;let x=Th(l,{relative:r}),S=Dh(),C=null;if(o){let e=Zf(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:$f([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Hg(n,p),D=n_(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),ee=m.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Jg(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?m.createElement(m.Fragment,null,ee,m.createElement(Wg,{page:x})):ee});$g.displayName=`Link`;var e_=m.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ph(a,{relative:c.relative}),d=Dh(),f=m.useContext(ch),{navigator:p,basename:h}=m.useContext(mh),g=f!=null&&c_(u)&&o===!0,_=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f?.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=Wf(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return m.createElement($g,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});e_.displayName=`NavLink`;var t_=m.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},h)=>{let{useTransitions:g}=m.useContext(mh),_=o_(),v=s_(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Qd.test(s);return m.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});g&&n!==!1?m.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});t_.displayName=`Form`;function n_(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=kh(),d=Dh(),f=Ph(e,{relative:o});return m.useCallback(p=>{if(mg(p,t)){p.preventDefault();let t=n===void 0?lf(d)===lf(f):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?m.startTransition(()=>h()):h()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function r_(e){af(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(hg(e)),n=m.useRef(!1),r=Dh(),i=m.useMemo(()=>gg(r.search,n.current?null:t.current),[r.search]),a=kh();return[i,m.useCallback((e,t)=>{let r=hg(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var i_=0,a_=()=>`__${String(++i_)}__`;function o_(){let{router:e}=Wh(`useSubmit`),{basename:t}=m.useContext(mh),n=qh(`useSubmit`),r=e.fetch,i=e.navigate;return m.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=xg(e,t);a.navigate===!1?await r(a.fetcherKey||a_(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function s_(e,{relative:t}={}){let{basename:n}=m.useContext(mh),r=m.useContext(gh);W(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ph(e||`.`,{relative:t})},o=Dh();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:$f([n,a.pathname])),lf(a)}function c_(e,{relative:t}={}){let n=m.useContext(dh);W(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Wh(`useViewTransitionState`),i=Ph(e,{relative:t});if(!n.isTransitioning)return!1;let a=Wf(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Wf(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Bf(i.pathname,o)!=null||Bf(i.pathname,a)!=null}function l_(e){return m.createElement(ng,{flushSync:wg.flushSync,...e})}var u_=class extends Error{status;code;constructor(e,t,n){super(n),this.name=`ApiError`,this.status=e,this.code=t}},d_={getToken:()=>null,onUnauthorized:()=>{},onForbidden:()=>{}};function f_(e){d_=e}async function p_(e,t){let n=new Headers(t?.headers),r=d_.getToken();r&&!n.has(`authorization`)&&n.set(`authorization`,`Bearer ${r}`);let i=e.startsWith(`/`)||/^https?:\/\//i.test(e)?e:`/${e}`,a=await fetch(i,{...t,headers:n});if(!a.ok){if(a.status===401)throw d_.onUnauthorized(),new u_(401,`unauthorized`,`unauthorized`);if(a.status===403&&(a.headers.get(`www-authenticate`)??``).includes(`insufficient_scope`))throw d_.onForbidden(),new u_(403,`insufficient_scope`,`insufficient scope`);let e=`http_${a.status}`,t=a.statusText||`HTTP ${a.status}`;try{let n=await a.json();n?.error&&(typeof n.error.code==`string`&&(e=n.error.code),typeof n.error.message==`string`&&(t=n.error.message))}catch{}throw new u_(a.status,e,t)}return a}async function m_(){let e=await fetch(`/ui/config.json`);if(!e.ok){let t=`http_${e.status}`,n=e.statusText||`HTTP ${e.status}`;try{let r=await e.json();r?.error?.code&&(t=r.error.code),r?.error?.message&&(n=r.error.message)}catch{}throw new u_(e.status,t,n)}return await e.json()}async function h_(){return(await(await p_(`/api/v1/projects`)).json()).projects}async function g_(e){return await(await p_(`/api/v1/projects/${encodeURIComponent(e)}`)).json()}async function __(e,t){let n=t?`?path=${encodeURIComponent(t)}`:``;return(await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/index${n}`)).json()).entries}async function v_(e,t){let n=(t.startsWith(`/`)?t.slice(1):t).split(`/`).map(encodeURIComponent).join(`/`);return await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/concepts/${n}`,{headers:{accept:`application/json`}})).json()}async function y_(e,t){let n=(t.startsWith(`/`)?t.slice(1):t).split(`/`).map(encodeURIComponent).join(`/`),r=await p_(`/api/v1/projects/${encodeURIComponent(e)}/files/${n}`),i=await r.text(),a=r.headers.get(`etag`),o=null;if(a){let e=a.replace(/^W\//,``).replace(/^"|"$/g,``);o=e.length>0?e:null}return{content:i,revision:o}}async function b_(e,t){let n=new URLSearchParams;t?.id&&n.set(`id`,t.id),t?.limit!==void 0&&n.set(`limit`,String(t.limit));let r=n.toString();return(await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/history${r?`?${r}`:``}`)).json()).commits}async function x_(e){return(await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/lint`)).json()).issues}async function S_(e){let t=new URLSearchParams;if(e.q!==void 0&&e.q.trim()!==``&&t.set(`q`,e.q.trim()),e.project&&t.set(`project`,e.project),e.type&&t.set(`type`,e.type),e.tag&&e.tag.length>0)for(let n of e.tag)n&&t.append(`tag`,n);e.status&&t.set(`status`,e.status),e.trustTier&&t.set(`trustTier`,e.trustTier),typeof e.stale==`boolean`&&t.set(`stale`,e.stale?`true`:`false`),typeof e.limit==`number`&&t.set(`limit`,String(e.limit));let n=t.toString();return(await(await p_(`/api/v1/search${n?`?${n}`:``}`)).json()).results}async function C_(){return await(await p_(`/api/v1/sync`)).json()}async function w_(e){let t=await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/archive`)).blob();if(typeof window<`u`&&typeof document<`u`&&typeof URL.createObjectURL==`function`){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e}.tar.gz`,r.style.display=`none`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}}var T_=new Ue({defaultOptions:{queries:{staleTime:3e4,retry:(e,t)=>t instanceof u_&&t.status<500?!1:e<2}}}),E_={projects:()=>[`projects`],project:e=>[`project`,e],index:(e,t)=>[`index`,e,t],concept:(e,t)=>[`concept`,e,t],file:(e,t)=>[`file`,e,t],history:(e,t,n)=>[`history`,e,t??null,n],lint:e=>[`lint`,e],search:e=>[`search`,e],sync:()=>[`sync`]};function D_(){return nt({queryKey:E_.projects(),queryFn:h_})}function O_(e){return nt({queryKey:E_.project(e),queryFn:()=>g_(e),enabled:!!e})}function k_(e,t,n=!0){return nt({queryKey:E_.index(e,t),queryFn:()=>__(e,t),enabled:!!e&&n})}function A_(e,t){return nt({queryKey:E_.concept(e,t),queryFn:()=>v_(e,t),enabled:!!(e&&t)})}function j_(e,t){return nt({queryKey:E_.file(e,t),queryFn:()=>y_(e,t),enabled:!!(e&&t)})}function M_(e,t){let n=t?.id??null,r=t?.limit??20;return nt({queryKey:E_.history(e,n,r),queryFn:()=>b_(e,{id:n??void 0,limit:r}),enabled:!!e})}function N_(e){return nt({queryKey:E_.lint(e),queryFn:()=>x_(e),enabled:!!e})}function P_(e,t=!0){return nt({queryKey:E_.search(e),queryFn:()=>S_(e),placeholderData:le,enabled:t})}function F_(){return nt({queryKey:E_.sync(),queryFn:C_,refetchInterval:6e4})}var I_;(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(I_=`oauth4webapi/v3.8.8`);function L_(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}var R_=`ERR_INVALID_ARG_VALUE`,z_=`ERR_INVALID_ARG_TYPE`;function B_(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}var V_=Symbol(),H_=Symbol(),U_=Symbol(),W_=Symbol(),G_=Symbol(),K_=new TextEncoder,q_=new TextDecoder;function J_(e){return typeof e==`string`?K_.encode(e):q_.decode(e)}var Y_;if(Uint8Array.prototype.toBase64)Y_=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;Y_=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}var X_=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw B_(`The input to be decoded is not correctly encoded.`,R_,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw B_(`The input to be decoded is not correctly encoded.`,R_,e)}};function Z_(e){return typeof e==`string`?X_(e):Y_(e)}var Q_=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=uy,Error.captureStackTrace?.(this,this.constructor)}},$_=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}};function J(e,t,n){return new $_(e,{code:t,cause:n})}function ev(e){return!(typeof e!=`object`||!e||Array.isArray(e))}function tv(e){L_(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e??{});if(I_&&!t.has(`user-agent`)&&t.set(`user-agent`,I_),t.has(`authorization`))throw B_(`"options.headers" must not include the "authorization" header name`,R_);return t}function nv(e,t){if(t!==void 0){if(typeof t==`function`&&(t=t(e.href)),!(t instanceof AbortSignal))throw B_(`"options.signal" must return or be an instance of AbortSignal`,z_);return t}}function rv(e,t,n,r,i){try{if(typeof e!=`number`||!Number.isFinite(e))throw B_(`${n} must be a number`,z_,i);if(e>0)return;if(t){if(e!==0)throw B_(`${n} must be a non-negative number`,R_,i);return}throw B_(`${n} must be a positive number`,R_,i)}catch(e){throw r?J(e.message,r,i):e}}function iv(e,t,n,r){try{if(typeof e!=`string`)throw B_(`${t} must be a string`,z_,r);if(e.length===0)throw B_(`${t} must not be empty`,R_,r)}catch(e){throw n?J(e.message,n,r):e}}async function av(e,t){let n=e;if(!(n instanceof URL)&&n!==My)throw B_(`"expectedIssuerIdentifier" must be an instance of URL`,z_);if(!L_(t,Response))throw B_(`"response" must be an instance of Response`,z_);if(t.status!==200)throw J(`"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)`,my,t);Sy(t);let r=await jy(t);if(iv(r.issuer,`"response" body "issuer" property`,Y,{body:r}),n!==My&&new URL(r.issuer).href!==n.href)throw J(`"response" body "issuer" property does not match the expected value`,yy,{expected:n.href,body:r,attribute:`issuer`});return r}function ov(e){cv(e,`application/json`)}function sv(e,...t){let n=`"response" content-type must be `;if(t.length>2){let e=t.pop();n+=`${t.join(`, `)}, or ${e}`}else t.length===2?n+=`${t[0]} or ${t[1]}`:n+=t[0];return J(n,py,e)}function cv(e,t){if(Pv(e)!==t)throw sv(e,t)}function lv(){return Z_(crypto.getRandomValues(new Uint8Array(32)))}function uv(){return lv()}function dv(){return lv()}async function fv(e){return iv(e,`codeVerifier`),Z_(await crypto.subtle.digest(`SHA-256`,J_(e)))}function pv(e){let t=e?.[H_];return typeof t==`number`&&Number.isFinite(t)?t:0}function mv(e){let t=e?.[U_];return typeof t==`number`&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function hv(){return Math.floor(Date.now()/1e3)}function gv(e){if(typeof e!=`object`||!e)throw B_(`"as" must be an object`,z_);iv(e.issuer,`"as.issuer"`)}function _v(e){if(typeof e!=`object`||!e)throw B_(`"client" must be an object`,z_);iv(e.client_id,`"client.client_id"`)}function vv(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}var yv=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function bv(e,t){if(t&&e.protocol!==`https:`)throw J(`only requests to HTTPS are allowed`,hy,e);if(e.protocol!==`https:`&&e.protocol!==`http:`)throw J(`only HTTP and HTTPS requests are allowed`,gy,e)}function xv(e,t,n,r){let i;if(typeof e!=`string`||!(i=yv(e)))throw J(`authorization server metadata does not contain a valid ${n?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,e===void 0?by:xy,{attribute:n?`mtls_endpoint_aliases.${t}`:t});return bv(i,r),i}function Sv(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?xv(e.mtls_endpoint_aliases[t],t,n,r):xv(e[t],t,n,r)}var Cv=class extends Error{cause;code;error;status;error_description;response;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=ly,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),Error.captureStackTrace?.(this,this.constructor)}},wv=class extends Error{cause;code;error;error_description;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=dy,this.cause=t.cause,this.error=t.cause.get(`error`),this.error_description=t.cause.get(`error_description`)??void 0,Error.captureStackTrace?.(this,this.constructor)}},Tv=class extends Error{cause;code;response;status;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=cy,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),Error.captureStackTrace?.(this,this.constructor)}},Ev=RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),Dv=RegExp(`^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_\`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)`),Ov=RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),kv=RegExp(`^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)`);function Av(e){if(!L_(e,Response))throw B_(`"response" must be an instance of Response`,z_);let t=e.headers.get(`www-authenticate`);if(t===null)return;let n=[],r=t;for(;r;){let e=r.match(Ev),t=e?.[`1`].toLowerCase();if(!t)return;let i=r.substring(e[0].length);if(i&&!i.match(/^[\s,]/))return;let a=i.match(/^\s+(.*)$/),o=!!a;r=a?a[1]:void 0;let s={},c;if(o)for(;r;){let t,n;if(e=r.match(Dv)){[,t,n,r]=e,n.includes(`\\`)&&(n=n.replace(/\\([\s\S])/g,`$1`)),s[t.toLowerCase()]=n;continue}if(e=r.match(Ov)){[,t,n,r]=e,s[t.toLowerCase()]=n;continue}if(e=r.match(kv)){if(Object.keys(s).length)break;[,c,r]=e;break}return}else r=i||void 0;let l={scheme:t,parameters:s};c&&(l.token68=c),n.push(l)}if(n.length)return n}async function jv(e){if(e.status>399&&e.status<500){Sy(e),ov(e);try{let t=await e.clone().json();if(ev(t)&&typeof t.error==`string`&&t.error.length)return t}catch{}}}async function Mv(e,t,n){if(e.status!==t){Vv(e);let t;throw(t=await jv(e))?(await e.body?.cancel(),new Cv(`server responded with an error in the response body`,{cause:t,response:e})):J(`"response" is not a conform ${n} response (unexpected HTTP status code)`,my,e)}}function Nv(e){if(!Wv.has(e))throw B_(`"options.DPoP" is not a valid DPoPHandle`,R_)}function Pv(e){return e.headers.get(`content-type`)?.split(`;`)[0]}async function Fv(e,t,n,r,i,a,o){return await n(e,t,i,a),a.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`),(o?.[W_]||fetch)(r.href,{body:i,headers:Object.fromEntries(a.entries()),method:`POST`,redirect:`manual`,signal:nv(r,o?.signal)})}async function Iv(e,t,n,r,i,a){let o=Sv(e,`token_endpoint`,t.use_mtls_endpoint_aliases,a?.[V_]!==!0);i.set(`grant_type`,r);let s=tv(a?.headers);s.set(`accept`,`application/json`),a?.DPoP!==void 0&&(Nv(a.DPoP),await a.DPoP.addProof(o,s,`POST`));let c=await Fv(e,t,n,o,i,s,a);return a?.DPoP?.cacheNonce(c,o),c}var Lv=new WeakMap,Rv=new WeakMap;function zv(e){if(!e.id_token)return;let t=Lv.get(e);if(!t)throw B_(`"ref" was already garbage collected or did not resolve from the proper sources`,R_);return t}async function Bv(e,t,n,r,i,a){if(gv(e),_v(t),!L_(n,Response))throw B_(`"response" must be an instance of Response`,z_);await Mv(n,200,`Token Endpoint`),Sy(n);let o=await jy(n);if(iv(o.access_token,`"response" body "access_token" property`,Y,{body:o}),iv(o.token_type,`"response" body "token_type" property`,Y,{body:o}),o.token_type=o.token_type.toLowerCase(),o.expires_in!==void 0){let e=typeof o.expires_in==`number`?o.expires_in:parseFloat(o.expires_in);rv(e,!0,`"response" body "expires_in" property`,Y,{body:o}),o.expires_in=e}if(o.refresh_token!==void 0&&iv(o.refresh_token,`"response" body "refresh_token" property`,Y,{body:o}),o.scope!==void 0&&typeof o.scope!=`string`)throw J(`"response" body "scope" property must be a string`,Y,{body:o});if(o.id_token!==void 0){iv(o.id_token,`"response" body "id_token" property`,Y,{body:o});let a=[];t.require_auth_time===!0&&a.push(`auth_time`),t.default_max_age!==void 0&&(rv(t.default_max_age,!0,`"client.default_max_age"`),a.push(`auth_time`)),r?.length&&a.push(...r);let{claims:s,jwt:c}=await Zv(e,t,o.id_token,a,i);ny(t,s),$v(s),Rv.set(n,c),Lv.set(o,s)}if(a?.[o.token_type]!==void 0)a[o.token_type](n,o);else if(o.token_type!==`dpop`&&o.token_type!==`bearer`)throw new Q_("unsupported `token_type` value",{cause:{body:o}});return o}function Vv(e){let t;if(t=Av(e))throw new Tv(`server responded with a challenge in the WWW-Authenticate HTTP Header`,{cause:t,response:e})}function Hv(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw J(`unexpected JWT "aud" (audience) claim value`,vy,{expected:e,claims:t.claims,claim:`aud`})}else if(t.claims.aud!==e)throw J(`unexpected JWT "aud" (audience) claim value`,vy,{expected:e,claims:t.claims,claim:`aud`});return t}function Uv(e,t){let n=e[Ny]?.(t)??e.issuer;if(t.claims.iss!==n)throw J(`unexpected JWT "iss" (issuer) claim value`,vy,{expected:n,claims:t.claims,claim:`iss`});return t}var Wv=new WeakSet;function Gv(e){return Wv.add(e),e}var Kv=Symbol();async function qv(e,t,n,r,i,a,o){if(gv(e),_v(t),!Wv.has(r))throw B_(`"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()`,R_);iv(i,`"redirectUri"`);let s=Ty(r,`code`);if(!s)throw J(`no authorization code in "callbackParameters"`,Y);let c=new URLSearchParams(o?.additionalParameters);return c.set(`redirect_uri`,i),c.set(`code`,s),a!==Kv&&(iv(a,`"codeVerifier"`),c.set(`code_verifier`,a)),Iv(e,t,n,`authorization_code`,c,o)}var Jv={aud:`audience`,c_hash:`code hash`,client_id:`client id`,exp:`expiration time`,iat:`issued at`,iss:`issuer`,jti:`jwt id`,nonce:`nonce`,s_hash:`state hash`,sub:`subject`,ath:`access token hash`,htm:`http method`,htu:`http uri`,cnf:`confirmation`,auth_time:`authentication time`};function Yv(e,t){for(let n of e)if(t.claims[n]===void 0)throw J(`JWT "${n}" (${Jv[n]}) claim missing`,Y,{claims:t.claims});return t}function Xv(e,t){if(typeof t.claims[e]!=`string`)throw J(`unexpected JWT "${e}" (${Jv[e]}) claim type`,Y,{claims:t.claims});return t}function Zv(e,t,n,r,i){return Cy(n,wy.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,`RS256`),pv(t),mv(t),i).then(Yv.bind(void 0,[`aud`,`exp`,`iat`,`iss`,`sub`,...r])).then(Uv.bind(void 0,e)).then(Hv.bind(void 0,t.client_id)).then(Xv.bind(void 0,`sub`))}function Qv(e,t){if(t===iy)return t;let n=t===void 0;return n&&(t=e.default_max_age),t===void 0?iy:(rv(t,!0,n?`"client.default_max_age"`:`"maxAge" argument`),t)}function $v(e){e.auth_time!==void 0&&rv(e.auth_time,!0,`ID Token "auth_time" (authentication time)`,Y,{claims:e})}function ey(e,t,n){if(n===iy)return;let r=hv()+pv(e),i=mv(e);if(t.auth_time+n<r-i)throw J(`too much time has elapsed since the last End-User authentication`,_y,{claims:t,now:r,tolerance:i,claim:`auth_time`})}function ty(e,t){let n=t===ry?void 0:t;if(e.nonce!==n)throw J(`unexpected ID Token "nonce" claim value`,vy,{expected:n,claims:e,claim:`nonce`})}function ny(e,t){if(Array.isArray(t.aud)&&t.aud.length!==1){if(t.azp===void 0)throw J(`ID Token "aud" (audience) claim includes additional untrusted audiences`,vy,{claims:t,claim:`aud`});if(t.azp!==e.client_id)throw J(`unexpected ID Token "azp" (authorized party) claim value`,vy,{expected:e.client_id,claims:t,claim:`azp`})}}var ry=Symbol(),iy=Symbol();async function ay(e,t,n,r){return typeof r?.expectedNonce==`string`||typeof r?.maxAge==`number`||r?.requireIdToken?oy(e,t,n,r.expectedNonce,r.maxAge,r[G_],r.recognizedTokenTypes):sy(e,t,n,r?.maxAge,r?.[G_],r?.recognizedTokenTypes)}async function oy(e,t,n,r,i,a,o){let s=[];switch(r){case void 0:r=ry;break;case ry:break;default:iv(r,`"expectedNonce" argument`),s.push(`nonce`)}i=Qv(t,i),i!==iy&&s.push(`auth_time`);let c=await Bv(e,t,n,s,a,o);iv(c.id_token,`"response" body "id_token" property`,Y,{body:c});let l=zv(c);return ey(t,l,i),ty(l,r),c}async function sy(e,t,n,r,i,a){let o=await Bv(e,t,n,void 0,i,a),s=zv(o);return s&&(ey(t,s,Qv(t,r)),ty(s,ry)),o}var cy=`OAUTH_WWW_AUTHENTICATE_CHALLENGE`,ly=`OAUTH_RESPONSE_BODY_ERROR`,uy=`OAUTH_UNSUPPORTED_OPERATION`,dy=`OAUTH_AUTHORIZATION_RESPONSE_ERROR`,fy=`OAUTH_PARSE_ERROR`,Y=`OAUTH_INVALID_RESPONSE`,py=`OAUTH_RESPONSE_IS_NOT_JSON`,my=`OAUTH_RESPONSE_IS_NOT_CONFORM`,hy=`OAUTH_HTTP_REQUEST_FORBIDDEN`,gy=`OAUTH_REQUEST_PROTOCOL_FORBIDDEN`,_y=`OAUTH_JWT_TIMESTAMP_CHECK_FAILED`,vy=`OAUTH_JWT_CLAIM_COMPARISON_FAILED`,yy=`OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED`,by=`OAUTH_MISSING_SERVER_METADATA`,xy=`OAUTH_INVALID_SERVER_METADATA`;function Sy(e){if(e.bodyUsed)throw B_(`"response" body has been used already`,R_)}async function Cy(e,t,n,r,i){let{0:a,1:o,length:s}=e.split(`.`);if(s===5){if(i!==void 0)e=await i(e),{0:a,1:o,length:s}=e.split(`.`);else throw new Q_(`JWE decryption is not configured`,{cause:e})}if(s!==3)throw J(`Invalid JWT`,Y,e);let c;try{c=JSON.parse(J_(Z_(a)))}catch(e){throw J(`failed to parse JWT Header body as base64url encoded JSON`,fy,e)}if(!ev(c))throw J(`JWT Header must be a top level object`,Y,e);if(t(c),c.crit!==void 0)throw new Q_(`no JWT "crit" header parameter extensions are supported`,{cause:{header:c}});let l;try{l=JSON.parse(J_(Z_(o)))}catch(e){throw J(`failed to parse JWT Payload body as base64url encoded JSON`,fy,e)}if(!ev(l))throw J(`JWT Payload must be a top level object`,Y,e);let u=hv()+n;if(l.exp!==void 0){if(typeof l.exp!=`number`)throw J(`unexpected JWT "exp" (expiration time) claim type`,Y,{claims:l});if(l.exp<=u-r)throw J(`unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp`,_y,{claims:l,now:u,tolerance:r,claim:`exp`})}if(l.iat!==void 0&&typeof l.iat!=`number`)throw J(`unexpected JWT "iat" (issued at) claim type`,Y,{claims:l});if(l.iss!==void 0&&typeof l.iss!=`string`)throw J(`unexpected JWT "iss" (issuer) claim type`,Y,{claims:l});if(l.nbf!==void 0){if(typeof l.nbf!=`number`)throw J(`unexpected JWT "nbf" (not before) claim type`,Y,{claims:l});if(l.nbf>u+r)throw J(`unexpected JWT "nbf" (not before) claim value`,_y,{claims:l,now:u,tolerance:r,claim:`nbf`})}if(l.aud!==void 0&&typeof l.aud!=`string`&&!Array.isArray(l.aud))throw J(`unexpected JWT "aud" (audience) claim type`,Y,{claims:l});return{header:c,claims:l,jwt:e}}function wy(e,t,n,r){if(e!==void 0){if(typeof e==`string`?r.alg!==e:!e.includes(r.alg))throw J(`unexpected JWT "alg" header parameter`,Y,{header:r,expected:e,reason:`client configuration`});return}if(Array.isArray(t)){if(!t.includes(r.alg))throw J(`unexpected JWT "alg" header parameter`,Y,{header:r,expected:t,reason:`authorization server metadata`});return}if(n!==void 0){if(typeof n==`string`?r.alg!==n:typeof n==`function`?!n(r.alg):!n.includes(r.alg))throw J(`unexpected JWT "alg" header parameter`,Y,{header:r,expected:n,reason:`default value`});return}throw J(`missing client or server configuration to verify used JWT "alg" header parameter`,void 0,{client:e,issuer:t,fallback:n})}function Ty(e,t){let{0:n,length:r}=e.getAll(t);if(r>1)throw J(`"${t}" parameter must be provided only once`,Y);return n}var Ey=Symbol(),Dy=Symbol();function Oy(e,t,n,r){if(gv(e),_v(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw B_(`"parameters" must be an instance of URLSearchParams, or URL`,z_);if(Ty(n,`response`))throw J(`"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()`,Y,{parameters:n});let i=Ty(n,`iss`),a=Ty(n,`state`);if(!i&&e.authorization_response_iss_parameter_supported)throw J(`response parameter "iss" (issuer) missing`,Y,{parameters:n});if(i&&i!==e.issuer)throw J(`unexpected "iss" (issuer) response parameter value`,Y,{expected:e.issuer,parameters:n});switch(r){case void 0:case Dy:if(a!==void 0)throw J(`unexpected "state" response parameter encountered`,Y,{expected:void 0,parameters:n});break;case Ey:break;default:if(iv(r,`"expectedState" argument`),a!==r)throw J(a===void 0?`response parameter "state" missing`:`unexpected "state" response parameter value`,Y,{expected:r,parameters:n})}if(Ty(n,`error`))throw new wv(`authorization response from the server is an error`,{cause:n});let o=Ty(n,`id_token`),s=Ty(n,`token`);if(o!==void 0||s!==void 0)throw new Q_(`implicit and hybrid flows are not supported`);return Gv(new URLSearchParams(n))}async function ky(e,t,n){gv(e);let r=Sv(e,`registration_endpoint`,t.use_mtls_endpoint_aliases,n?.[V_]!==!0),i=tv(n?.headers);i.set(`accept`,`application/json`),i.set(`content-type`,`application/json`);let a=`POST`;n?.DPoP&&(Nv(n.DPoP),await n.DPoP.addProof(r,i,a,n.initialAccessToken)),n?.initialAccessToken&&i.set(`authorization`,`${i.has(`dpop`)?`DPoP`:`Bearer`} ${n.initialAccessToken}`);let o=await(n?.[W_]||fetch)(r.href,{body:JSON.stringify(t),headers:Object.fromEntries(i.entries()),method:a,redirect:`manual`,signal:nv(r,n?.signal)});return n?.DPoP?.cacheNonce(o,r),o}async function Ay(e){if(!L_(e,Response))throw B_(`"response" must be an instance of Response`,z_);await Mv(e,201,`Dynamic Client Registration Endpoint`),Sy(e);let t=await jy(e);return iv(t.client_id,`"response" body "client_id" property`,Y,{body:t}),t.client_secret!==void 0&&iv(t.client_secret,`"response" body "client_secret" property`,Y,{body:t}),t.client_secret&&rv(t.client_secret_expires_at,!0,`"response" body "client_secret_expires_at" property`,Y,{body:t}),t}async function jy(e,t=ov){let n;try{n=await e.json()}catch(n){throw t(e),J(`failed to parse "response" body as JSON`,fy,n)}if(!ev(n))throw J(`"response" body must be a top level object`,Y,{body:n});return n}var My=Symbol(),Ny=Symbol();function Py(e){if(typeof e!=`object`||!e||!(`resource`in e)||typeof e.resource!=`string`||!(`authorization_servers`in e)||!Array.isArray(e.authorization_servers)||e.authorization_servers.length===0)throw Error(`invalid protected resource metadata`);let t=e.authorization_servers[0];if(typeof t!=`string`)throw Error(`invalid protected resource metadata`);return{resource:e.resource,primaryServer:t}}async function Fy(e){let t=`${e.replace(/\/+$/,``)}/.well-known/oauth-protected-resource/mcp`,n=await fetch(t);if(!n.ok)throw Error(`invalid protected resource metadata`);let r;try{r=await n.json()}catch{throw Error(`invalid protected resource metadata`)}let{resource:i,primaryServer:a}=Py(r),o=`${e.replace(/\/+$/,``)}/.well-known/oauth-authorization-server`,s=await fetch(o),c=await av(new URL(a),s);return{as:c,resource:i,insecure:new URL(c.token_endpoint??c.issuer).protocol===`http:`}}function Iy(e,t){return t.oauthClientId!==null||typeof e.as.registration_endpoint==`string`}async function Ly(e,t,n,r){if(t.oauthClientId)return t.oauthClientId;let i=`okf.oauth.client:${e.as.issuer}:${n}`,a=r.getItem(i);if(a)return a;if(typeof e.as.registration_endpoint!=`string`)throw Error(`sign-in is not configured`);let o=await Ay(await ky(e.as,{client_name:`ok-fine web`,redirect_uris:[n],grant_types:[`authorization_code`],response_types:[`code`],token_endpoint_auth_method:`none`,scope:t.scope},{[V_]:e.insecure}));return r.setItem(i,o.client_id),o.client_id}function Ry(e,t,n){let r=`okf.oauth.client:${e.as.issuer}:${t}`;n.removeItem(r)}async function zy(e,t,n,r,i){let a=uv(),o=await fv(a),s=dv();if(!e.as.authorization_endpoint)throw Error(`missing authorization endpoint in authorization server metadata`);let c=new URL(e.as.authorization_endpoint);return c.searchParams.set(`client_id`,t),c.searchParams.set(`redirect_uri`,n),c.searchParams.set(`response_type`,`code`),c.searchParams.set(`scope`,r),c.searchParams.set(`code_challenge`,o),c.searchParams.set(`code_challenge_method`,`S256`),c.searchParams.set(`state`,s),c.searchParams.set(`resource`,e.resource),{url:c,pending:{state:s,codeVerifier:a,clientId:t,redirectUri:n,returnTo:i}}}async function By(e,t,n){let r={client_id:t.clientId},i=Oy(e.as,r,n,t.state),a=await qv(e.as,r,vv(),i,t.redirectUri,t.codeVerifier,{additionalParameters:{resource:e.resource},[V_]:e.insecure}),o=await ay(e.as,r,a);return{accessToken:o.access_token,expiresAt:o.expires_in?Date.now()+o.expires_in*1e3:null}}function Vy(e,t=Date.now()){return e.accessToken.length>0&&(e.expiresAt===null||e.expiresAt-3e4>t)}function Hy(e){try{let t=e.split(`.`)[1];if(!t)return null;let n=t.replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4!=0;)n+=`=`;let r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0)),a=new TextDecoder().decode(i),o=JSON.parse(a);return typeof o!=`object`||!o?null:`email`in o&&typeof o.email==`string`&&o.email.trim().length>0?o.email.trim():`preferred_username`in o&&typeof o.preferred_username==`string`&&o.preferred_username.trim().length>0?o.preferred_username.trim():`name`in o&&typeof o.name==`string`&&o.name.trim().length>0?o.name.trim():`sub`in o&&typeof o.sub==`string`&&o.sub.trim().length>0?o.sub.trim():null}catch{return null}}var Uy=(0,m.createContext)(null);function Wy({children:e}){let t=_(),[n,r]=(0,m.useState)({status:`loading`}),i=(0,m.useRef)(n);i.current=n;let a=(0,m.useRef)(new Map);(0,m.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await m_();if(!e)return;if(t.authMode===`none`){r({status:`open`,config:t});return}let n=await Fy(window.location.origin);if(!e)return;if(!Iy(n,t)){r({status:`unconfigured`,config:t,discovery:n,redirectUri:`${window.location.origin}/ui/callback`});return}let i=window.sessionStorage.getItem(`okf.oauth.token`);if(i)try{let e=JSON.parse(i);if(typeof e==`object`&&e&&`accessToken`in e&&typeof e.accessToken==`string`){let i=`expiresAt`in e&&typeof e.expiresAt==`number`?e.expiresAt:null,a={accessToken:e.accessToken,expiresAt:i};if(Vy(a)){let e=Hy(a.accessToken);r({status:`signed-in`,config:t,discovery:n,token:a,identity:e});return}}}catch{}r({status:`signed-out`,config:t,discovery:n,reason:`initial`})}catch(t){if(!e)return;let n=t instanceof Error?t.message:`Failed to initialize authentication`;r({status:`error`,message:n})}})(),()=>{e=!1}},[]),(0,m.useEffect)(()=>{f_({getToken:()=>{let e=i.current;return e.status===`signed-in`?e.token.accessToken:null},onUnauthorized:()=>{window.sessionStorage.removeItem(`okf.oauth.token`),t.clear();let e=i.current;`config`in e&&`discovery`in e&&r({status:`signed-out`,config:e.config,discovery:e.discovery,reason:`expired`})},onForbidden:()=>{let e=i.current;`config`in e&&`discovery`in e&&r({status:`forbidden`,config:e.config,discovery:e.discovery,scope:e.config.scope})}})},[t]),(0,m.useEffect)(()=>{if(n.status!==`signed-in`||n.token.expiresAt===null)return;let e=n.token.expiresAt-3e4-Date.now();if(e<=0){window.sessionStorage.removeItem(`okf.oauth.token`),t.clear(),r({status:`signed-out`,config:n.config,discovery:n.discovery,reason:`expired`});return}let i=setTimeout(()=>{window.sessionStorage.removeItem(`okf.oauth.token`),t.clear(),r({status:`signed-out`,config:n.config,discovery:n.discovery,reason:`expired`})},e);return()=>{clearTimeout(i)}},[n,t]);let o={state:n,login:(0,m.useCallback)(async e=>{let t,n,r=i.current;`config`in r&&`discovery`in r?(t=r.config,n=r.discovery):(t=await m_(),n=await Fy(window.location.origin));let a=`${window.location.origin}/ui/callback`,o=await Ly(n,t,a,window.localStorage),{url:s,pending:c}=await zy(n,o,a,t.scope,e);window.sessionStorage.setItem(`okf.oauth.pending`,JSON.stringify(c)),window.location.assign(s.href)},[]),completeLogin:(0,m.useCallback)(async e=>{let t=a.current.get(e.href);if(t)return t;let n=(async()=>{let t,n,a=i.current;`config`in a&&`discovery`in a?(t=a.config,n=a.discovery):(t=await m_(),n=await Fy(window.location.origin));let o=window.sessionStorage.getItem(`okf.oauth.pending`);if(window.sessionStorage.removeItem(`okf.oauth.pending`),!o)throw Error(`Sign-in session expired; try again`);let s;try{let e=JSON.parse(o);if(typeof e!=`object`||!e||!(`state`in e)||!(`codeVerifier`in e)||!(`clientId`in e)||!(`redirectUri`in e)||!(`returnTo`in e)||typeof e.state!=`string`||typeof e.codeVerifier!=`string`||typeof e.clientId!=`string`||typeof e.redirectUri!=`string`||typeof e.returnTo!=`string`)throw Error(`Invalid pending login session`);s={state:e.state,codeVerifier:e.codeVerifier,clientId:e.clientId,redirectUri:e.redirectUri,returnTo:e.returnTo}}catch(e){throw Error(`Sign-in session expired; try again`,{cause:e})}try{let i=await By(n,s,e);window.sessionStorage.setItem(`okf.oauth.token`,JSON.stringify(i));let a=Hy(i.accessToken);return r({status:`signed-in`,config:t,discovery:n,token:i,identity:a}),s.returnTo}catch(e){if(e instanceof wv||e instanceof Cv){(e.error===`invalid_client`||e.error===`unauthorized_client`)&&Ry(n,s.redirectUri,window.localStorage);let i=e.error_description?`${e.error}: ${e.error_description}`:e.error;r({status:`signed-out`,config:t,discovery:n,reason:`signed-out`,error:i})}throw e}})();return a.current.set(e.href,n),n},[]),logout:(0,m.useCallback)(()=>{window.sessionStorage.removeItem(`okf.oauth.token`),t.clear();let e=i.current;`config`in e&&`discovery`in e&&r({status:`signed-out`,config:e.config,discovery:e.discovery,reason:`signed-out`})},[t])};return(0,h.jsx)(Uy.Provider,{value:o,children:e})}function Gy(){let e=(0,m.useContext)(Uy);if(!e)throw Error(`useAuth must be used within an AuthProvider`);return e}var Ky=`okf.theme`,qy=new Set;function Jy(){for(let e of qy)e()}function Yy(e){return qy.add(e),()=>{qy.delete(e)}}function Xy(e){if(typeof document>`u`)return;let t=typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches,n=e===`dark`||e===`system`&&!!t;document.documentElement.classList.toggle(`dark`,n),document.documentElement.style.colorScheme=n?`dark`:`light`}function Zy(){try{if(typeof localStorage<`u`){let e=localStorage.getItem(Ky);if(e===`light`||e===`dark`||e===`system`)return e}}catch{}return`system`}function Qy(e){try{typeof localStorage<`u`&&localStorage.setItem(Ky,e)}catch{}Xy(e),Jy()}var $y=!1;function eb(){$y||($y=!0,Xy(Zy()),typeof window<`u`&&window.matchMedia&&(window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{Zy()===`system`&&(Xy(`system`),Jy())}),window.addEventListener(`storage`,e=>{e.key===Ky&&(Xy(Zy()),Jy())})))}function tb(){return[(0,m.useSyncExternalStore)(Yy,Zy,()=>`system`),Qy]}function nb(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=nb(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function X(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=nb(e))&&(r&&(r+=` `),r+=t);return r}var rb=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function ib(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:rb(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var ab=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},ob=e=>{let t=ab(e);return t.charAt(0).toUpperCase()+t.slice(1)},sb=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),cb={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function lb(e){return e!=null}function ub(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??cb.width,a=e.size??e.height??cb.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?sb(...c):sb(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??cb[`stroke-width`])*Number(e.size??e.width??cb.width)/Number(t.size??t.width??cb.width):t.strokeWidth??cb[`stroke-width`];return[`svg`,{...Object.entries(cb).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&lb(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&lb(t.width)&&{[r(`width`)]:t.width},...`height`in t&&lb(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function db(e,t={}){return ub(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var fb=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},pb=(0,m.createContext)({}),mb=()=>(0,m.useContext)(pb),hb=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=mb()??{},b=!!c||fb(d),[x,S,C=[]]=db(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:sb(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Z(e,t=[],n=[]){let r=typeof e==`string`?ib(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(hb,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=ob(r.name)),i}var gb={name:`badge-check`,size:24,node:[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`verified`]};gb.node;var _b=Z(gb),vb={name:`book-a`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`m8 13 4-7 4 7`,key:`4rari8`}],[`path`,{d:`M9.1 11h5.7`,key:`1gkovt`}]]};vb.node;var yb=Z(vb),bb={name:`book-open-check`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`m16 12 2 2 4-4`,key:`mdajum`}],[`path`,{d:`M22 6V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2h4.001A2 2 0 0022 17v-1.344`,key:`144kbk`}]]};bb.node;var xb=Z(bb),Sb={name:`bookmark`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};Sb.node;var Cb=Z(Sb),wb={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};wb.node;var Tb=Z(wb),Eb={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Eb.node;var Db=Z(Eb),Ob={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Ob.node;var kb=Z(Ob),Ab={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Ab.node;var jb=Z(Ab),Mb={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Mb.node;var Nb=Z(Mb),Pb={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Pb.node;var Fb=Z(Pb),Ib={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Ib.node;var Lb=Z(Ib),Rb={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Rb.node;var zb=Z(Rb),Bb={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Bb.node;var Vb=Z(Bb),Hb={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Hb.node;var Ub=Z(Hb),Wb={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};Wb.node;var Gb=Z(Wb),Kb={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Kb.node;var qb=Z(Kb),Jb={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Jb.node;var Yb=Z(Jb),Xb={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Xb.node;var Zb=Z(Xb),Qb={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};Qb.node;var $b=Z(Qb),ex={name:`file-question-mark`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]],aliases:[`file-question`]};ex.node;var tx=Z(ex),nx={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};nx.node;var rx=Z(nx),ix={name:`folder-kanban`,size:24,node:[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]};ix.node;var ax=Z(ix),ox={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};ox.node;var sx=Z(ox),cx={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};cx.node;var lx=Z(cx),ux={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};ux.node;var dx=Z(ux),fx={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};fx.node;var px=Z(fx),mx={name:`heart-pulse`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]};mx.node;var hx=Z(mx),gx={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};gx.node;var _x=Z(gx),vx={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};vx.node;var yx=Z(vx),bx={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};bx.node;var xx=Z(bx),Sx={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Sx.node;var Cx=Z(Sx),wx={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};wx.node;var Tx=Z(wx),Ex={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Ex.node;var Dx=Z(Ex),Ox={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Ox.node;var kx=Z(Ox),Ax={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};Ax.node;var jx=Z(Ax),Mx={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};Mx.node;var Nx=Z(Mx),Px={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Px.node;var Fx=Z(Px),Ix={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};Ix.node;var Lx=Z(Ix),Rx={name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]};Rx.node;var zx=Z(Rx),Bx={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Bx.node;var Vx=Z(Bx),Hx={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Hx.node;var Ux=Z(Hx),Wx={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Wx.node;var Gx=Z(Wx),Kx={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Kx.node;var qx=Z(Kx),Jx={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};Jx.node;var Yx=Z(Jx),Xx={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Xx.node;var Zx=Z(Xx),Qx={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};Qx.node;var $x=Z(Qx),eS={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};eS.node;var tS=Z(eS);function nS({icon:e,title:t,hint:n,action:r,className:i}){return(0,h.jsxs)(`div`,{className:X(`flex flex-col items-center justify-center p-8 text-center rounded-2xl border border-border bg-surface/50`,i),children:[e&&(0,h.jsx)(`div`,{className:`mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 ring-1 ring-border text-muted`,children:(0,h.jsx)(e,{size:24})}),(0,h.jsx)(`h3`,{className:`text-base font-medium text-fg`,children:t}),n&&(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted max-w-sm`,children:n}),r&&(0,h.jsx)(`div`,{className:`mt-4`,children:r})]})}function rS({error:e,onRetry:t,fullScreen:n=!1,className:r}){let i=e instanceof u_&&(e.code===`project_not_found`||e.code===`not_found`),a=e instanceof Error?e.message:typeof e==`string`?e:`An unexpected error occurred.`,o=i?(0,h.jsx)(nS,{icon:tx,title:`Not found`,hint:`The requested project, concept, or file could not be found.`,action:(0,h.jsx)($g,{to:`/`,className:`inline-flex items-center justify-center rounded-lg bg-accent-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-600 focus-visible:outline-2 outline-accent-500`,children:`Back to all projects`})}):(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-8 text-center rounded-2xl border border-rose-500/20 bg-rose-500/5 max-w-lg mx-auto`,children:[(0,h.jsx)(`div`,{className:`mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-1 ring-rose-500/20`,children:(0,h.jsx)(Lb,{size:24})}),(0,h.jsx)(`h3`,{className:`text-base font-medium text-fg`,children:`Something went wrong`}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted break-words max-w-sm`,children:a}),t&&(0,h.jsx)(`button`,{type:`button`,onClick:t,className:`mt-4 inline-flex items-center justify-center rounded-lg border border-border bg-surface px-4 py-2 text-sm font-medium text-fg transition-colors hover:bg-surface-2 focus-visible:outline-2 outline-accent-500`,children:`Retry`})]});return n?(0,h.jsx)(`div`,{className:X(`flex min-h-[60vh] items-center justify-center p-6`,r),children:(0,h.jsx)(`div`,{className:`w-full max-w-md`,children:o})}):(0,h.jsx)(`div`,{className:r,children:o})}function iS({size:e=24,className:t}){let n=(0,m.useId)();return(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,className:X(`shrink-0`,t),"aria-hidden":`true`,children:[(0,h.jsx)(`defs`,{children:(0,h.jsxs)(`linearGradient`,{id:n,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,h.jsx)(`stop`,{offset:`0`,stopColor:`#8b5cf6`}),(0,h.jsx)(`stop`,{offset:`1`,stopColor:`#22d3ee`})]})}),(0,h.jsx)(`rect`,{width:`24`,height:`24`,rx:`7`,fill:`url(#${n})`}),(0,h.jsx)(`path`,{d:`M7 12.5l3.2 3.2L17 8.8`,fill:`none`,stroke:`#ffffff`,strokeWidth:`2.25`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function aS({className:e,size:t=24}){return(0,h.jsxs)(`div`,{className:X(`inline-flex items-center gap-2 font-semibold tracking-tight text-fg`,e),children:[(0,h.jsx)(iS,{size:t}),(0,h.jsx)(`span`,{children:`ok-fine`})]})}function oS({title:e,className:t,children:n}){return(0,m.useEffect)(()=>{document.title=`${e} · ok-fine`},[e]),(0,h.jsx)(Gd.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:`easeOut`},className:t,children:n})}function sS(){let{state:e,logout:t}=Gy(),n=e.status===`forbidden`?e.scope:`config`in e?e.config.scope:`okf:read`;return(0,h.jsx)(oS,{title:`Forbidden`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-border-strong bg-surface p-8 shadow-[0_30px_80px_-20px_rgb(139_92_246/0.35)] ring-1 ring-border-strong text-center flex flex-col items-center`,children:[(0,h.jsx)(iS,{size:44,className:`mb-3`}),(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`ok-fine`}),(0,h.jsx)(`h2`,{className:`mt-2 text-base font-medium text-fg`,children:`Access denied`}),(0,h.jsxs)(`p`,{className:`mt-3 text-sm text-muted`,children:[`Your account can't read this knowledge base (needs`,` `,(0,h.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs text-fg`,children:n}),`).`]}),(0,h.jsx)(`button`,{type:`button`,onClick:t,className:`mt-6 w-full rounded-xl border border-border bg-surface px-4 py-2.5 text-sm font-medium text-fg transition hover:bg-surface-2 focus-visible:outline-2 outline-accent-500 cursor-pointer`,children:`Sign out`}),(0,h.jsx)(`p`,{className:`mt-4 text-xs text-subtle`,children:`Sign in with an account that has read permissions.`})]})})}function cS({value:e,label:t,className:n}){let[r,i]=(0,m.useState)(!1),a=(0,m.useRef)(void 0);return(0,m.useEffect)(()=>()=>{clearTimeout(a.current)},[]),(0,h.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),i(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>i(!1),1500)}catch{}},"aria-label":r?`Copied`:t??`Copy to clipboard`,title:r?`Copied`:t??`Copy`,className:X(`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface/80 px-2 py-1 text-xs font-medium text-muted backdrop-blur-xs transition-colors hover:bg-surface-2 hover:text-fg focus-visible:outline-2 outline-accent-500`,n),children:[r?(0,h.jsx)(kb,{size:14,className:`text-emerald-500 shrink-0`}):(0,h.jsx)(qb,{size:14,className:`shrink-0 text-muted`}),t&&(0,h.jsx)(`span`,{children:r?`Copied`:t})]})}function lS(){let{state:e}=Gy(),t=typeof window<`u`?window.location.origin:``,n=e.status===`unconfigured`?e.redirectUri:`${t}/ui/callback`,r=`config`in e?e.config.scope:`okf:read`,i=`discovery`in e?e.discovery.resource:`${t}/mcp`;return(0,h.jsx)(oS,{title:`Sign-in not configured`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-lg rounded-2xl border border-border-strong bg-surface p-8 shadow-[0_30px_80px_-20px_rgb(139_92_246/0.35)] ring-1 ring-border-strong flex flex-col items-center`,children:[(0,h.jsx)(iS,{size:44,className:`mb-3`}),(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`ok-fine`}),(0,h.jsx)(`h2`,{className:`mt-2 text-base font-medium text-fg`,children:`Sign-in isn't configured`}),(0,h.jsxs)(`p`,{className:`mt-2 text-sm text-muted text-center`,children:[`The web UI needs a public OAuth 2.0 client. Set`,` `,(0,h.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs text-fg`,children:`OAUTH_UI_CLIENT_ID`}),` (Helm`,` `,(0,h.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs text-fg`,children:`oauth.uiClientId`}),`) with these parameters:`]}),(0,h.jsxs)(`div`,{className:`mt-6 w-full space-y-3 text-left`,children:[(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Redirect URI`}),(0,h.jsx)(cS,{value:n})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:n})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Web origin`}),(0,h.jsx)(cS,{value:t})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:t})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Scope`}),(0,h.jsx)(cS,{value:r})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:r})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Resource`}),(0,h.jsx)(cS,{value:i})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:i})]})]}),(0,h.jsx)(`p`,{className:`mt-6 text-xs text-subtle text-center`,children:`Alternatively, your identity provider must advertise dynamic client registration.`})]})})}function uS(){let e=typeof window<`u`?window.location.pathname:`/`,t=typeof window<`u`?window.location.search:``,n=typeof window<`u`?window.location.hash:``,r=e.replace(/^\/ui(?:\/|$)/,`/`);return r.startsWith(`/`)||(r=`/${r}`),`${r}${t}${n}`}function dS({error:e}){let{state:t,login:n}=Gy(),[r,i]=(0,m.useState)(!1),a=`identity provider`;if(t.status===`signed-out`)try{a=new URL(t.discovery.as.issuer).host}catch{a=t.discovery.as.issuer}let o=e??(t.status===`signed-out`?t.error:void 0);return(0,h.jsx)(oS,{title:`Sign in`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-border-strong bg-surface p-8 shadow-[0_30px_80px_-20px_rgb(139_92_246/0.35)] ring-1 ring-border-strong text-center flex flex-col items-center`,children:[(0,h.jsx)(iS,{size:44,className:`mb-3`}),(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`ok-fine`}),(0,h.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:`Shared knowledge for your agents and your team.`}),o?(0,h.jsx)(`div`,{className:`mt-6 w-full rounded-xl border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-left text-sm text-rose-600 dark:text-rose-400 break-words`,children:o}):t.status===`signed-out`&&t.reason===`expired`?(0,h.jsx)(`div`,{className:`mt-6 w-full rounded-xl border border-amber-500/20 bg-amber-500/10 px-4 py-3 text-sm text-amber-600 dark:text-amber-400`,children:`Your session expired.`}):t.status===`signed-out`&&t.reason===`signed-out`?(0,h.jsx)(`div`,{className:`mt-6 w-full rounded-xl border border-border bg-surface-2 px-4 py-3 text-sm text-muted`,children:`You've signed out.`}):null,(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{try{i(!0),await n(uS())}catch{i(!1)}},disabled:r,className:`mt-6 w-full rounded-xl bg-gradient-to-r from-accent-500 to-accent-600 px-4 py-3 text-sm font-medium text-white shadow-sm transition hover:from-accent-600 hover:to-accent-700 focus-visible:outline-2 outline-accent-500 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:r?`Redirecting…`:`Continue with ${a}`}),(0,h.jsx)(`p`,{className:`mt-4 text-xs text-subtle`,children:`Read-only view · signs in through your organization's identity provider`})]})})}function fS(){let{state:e}=Gy();return e.status===`loading`?(0,h.jsx)(`div`,{className:`fixed inset-0 flex items-center justify-center bg-bg`,children:(0,h.jsx)(Gd.div,{animate:{opacity:[.3,1,.3]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`},children:(0,h.jsx)(iS,{size:48})})}):e.status===`open`||e.status===`signed-in`?(0,h.jsx)(og,{}):e.status===`signed-out`?(0,h.jsx)(dS,{error:e.error}):e.status===`unconfigured`?(0,h.jsx)(lS,{}):e.status===`forbidden`?(0,h.jsx)(sS,{}):e.status===`error`?(0,h.jsx)(`div`,{className:`fixed inset-0 flex items-center justify-center bg-bg p-6`,children:(0,h.jsx)(rS,{error:e.message,onRetry:()=>window.location.reload(),fullScreen:!0})}):null}var pS=1,mS=.9,hS=.8,gS=.17,_S=.1,vS=.999,yS=.9999,bS=.99,xS=/[\\\/_+.#"@\[\(\{&]/,SS=/[\\\/_+.#"@\[\(\{&]/g,CS=/[\s-]/,wS=/[\s-]/g;function TS(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?pS:bS;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=TS(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=pS:xS.test(e.charAt(l-1))?(d*=hS,p=e.slice(i,l-1).match(SS),p&&i>0&&(d*=vS**+p.length)):CS.test(e.charAt(l-1))?(d*=mS,m=e.slice(i,l-1).match(wS),m&&i>0&&(d*=vS**+m.length)):(d*=gS,i>0&&(d*=vS**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=yS)),(d<_S&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=TS(e,t,n,r,l+1,a+2,o),f*_S>d&&(d=f*_S)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function ES(e){return e.toLowerCase().replace(wS,` `)}function DS(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,TS(e,t,ES(e),ES(t),0,0,{})}var OS=Object.defineProperty,kS=(e,t)=>OS(e,`name`,{value:t,configurable:!0}),AS=!!(typeof window<`u`&&window.document&&window.document.createElement);function jS(e,t,{checkForDefaultPrevented:n=!0}={}){return kS(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}kS(jS,`composeEventHandlers`);function MS(e){if(!AS)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}kS(MS,`getOwnerWindow`);function NS(e){if(!AS)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}kS(NS,`getOwnerDocument`);function PS(e,t=!1){let{activeElement:n}=NS(e);if(!n?.nodeName)return null;if(FS(n)&&n.contentDocument)return PS(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=NS(n).getElementById(e);if(t)return t}}return n}kS(PS,`getActiveElement`);function FS(e){return e.tagName===`IFRAME`}kS(FS,`isFrame`);var IS=Object.defineProperty,LS=(e,t)=>IS(e,`name`,{value:t,configurable:!0});function RS(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}LS(RS,`setRef`);function zS(...e){return t=>{let n=!1,r=e.map(e=>{let r=RS(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():RS(e[t],null)}}}}LS(zS,`composeRefs`);function BS(...e){return m.useCallback(zS(...e),e)}LS(BS,`useComposedRefs`);var VS=Object.defineProperty,HS=(e,t)=>VS(e,`name`,{value:t,configurable:!0});function US(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=HS(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,h.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return HS(i,`useContext`),[r,i]}HS(US,`createContext`);function WS(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=HS(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,h.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return HS(s,`useContext`),[o,s]}HS(r,`createContext`);let i=HS(()=>{let t=n.map(e=>m.createContext(e));return HS(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,GS(i,...t)]}HS(WS,`createContextScope`);function GS(...e){let t=e[0];if(e.length===1)return t;let n=HS(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return HS(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}HS(GS,`composeContextScopes`);var KS=globalThis?.document?m.useLayoutEffect:()=>{},qS=Object.defineProperty,JS=(e,t)=>qS(e,`name`,{value:t,configurable:!0}),YS=m.useId||(()=>void 0),XS=0;function ZS(e){let[t,n]=m.useState(YS());return KS(()=>{e||n(e=>e??String(XS++))},[e]),e||(t?`radix-${t}`:``)}JS(ZS,`useId`);var QS=Object.defineProperty,$S=(e,t)=>QS(e,`name`,{value:t,configurable:!0}),eC=m.useEffectEvent,tC=m.useInsertionEffect;function nC(e){if(typeof eC==`function`)return eC(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof tC==`function`?tC(()=>{t.current=e}):KS(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}$S(nC,`useEffectEvent`);var rC=Object.defineProperty,iC=(e,t)=>rC(e,`name`,{value:t,configurable:!0}),aC=m.useInsertionEffect||KS;function oC({prop:e,defaultProp:t,onChange:n=iC(()=>{},`onChange`),caller:r}){let[i,a,o]=sC({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=cC(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}iC(oC,`useControllableState`);function sC({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return aC(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}iC(sC,`useUncontrolledState`);function cC(e){return typeof e==`function`}iC(cC,`isFunction`);var lC=Symbol(`RADIX:SYNC_STATE`);function uC(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=nC(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===lC)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:lC,state:i})},[i,d.state,c]),[g,f]}iC(uC,`useControllableStateReducer`);var dC=Object.defineProperty,fC=(e,t)=>dC(e,`name`,{value:t,configurable:!0});function pC(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];xC(r)&&typeof TC==`function`&&(r=TC(r._payload)),m.Children.forEach(r,e=>{if(yC(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;xC(n)&&typeof TC==`function`&&(n=TC(n._payload)),a=gC(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?vC(a):void 0,l=BS(n,c);if(!a){if(r||r===0)throw Error(o?wC(e):CC(e));return r}let u=_C(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}fC(pC,`createSlot`);var mC=Symbol.for(`radix.slottable`);function hC(e){let t=fC(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=mC,t}fC(hC,`createSlottable`);var gC=fC((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function _C(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}fC(_C,`mergeProps`);function vC(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}fC(vC,`getElementRef`);function yC(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===mC}fC(yC,`isSlottable`);var bC=Symbol.for(`react.lazy`);function xC(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===bC&&`_payload`in e&&SC(e._payload)}fC(xC,`isLazyComponent`);function SC(e){return typeof e==`object`&&!!e&&`then`in e}fC(SC,`isPromiseLike`);var CC=fC(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),wC=fC(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),TC=m.use,EC=Object.defineProperty,DC=(e,t)=>EC(e,`name`,{value:t,configurable:!0}),OC=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=pC(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,h.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kC(e,t){e&&wg.flushSync(()=>e.dispatchEvent(t))}DC(kC,`dispatchDiscreteCustomEvent`);var AC=Object.defineProperty,jC=(e,t)=>AC(e,`name`,{value:t,configurable:!0});function MC(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}jC(MC,`useCallbackRef`);var NC=Object.defineProperty,PC=(e,t)=>NC(e,`name`,{value:t,configurable:!0}),FC=`dismissableLayer.update`,IC=`dismissableLayer.pointerDownOutside`,LC=`dismissableLayer.focusOutside`,RC,zC=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),BC=m.forwardRef(PC(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(zC),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,g]=m.useState({}),_=BS(t,f),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=m.useRef(!1),T=UC(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=WC(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),D=d?x===v.length-1:!1,O=MC(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(D)return p.addEventListener(`keydown`,O,{capture:!0}),()=>p.removeEventListener(`keydown`,O,{capture:!0})},[p,D,O]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(RC=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),GC(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=RC))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),GC())},[d,u]),m.useEffect(()=>{let e=PC(()=>g({}),`handleUpdate`);return document.addEventListener(FC,e),()=>document.removeEventListener(FC,e)},[]),(0,h.jsx)(OC.div,{...l,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:jS(e.onFocusCapture,E.onFocusCapture),onBlurCapture:jS(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:jS(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function VC(){let e=m.useContext(zC),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}PC(VC,`useDismissableLayerSurface`);var HC=PC(()=>!0,`IS_TRUE`);function UC(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=HC}=t,s=MC(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}PC(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}PC(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}PC(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}PC(p,`handleInteractionBubble`);let m=PC(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||KC(IC,s,p,{discrete:!0})};if(PC(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:PC(()=>c.current=!0,`onPointerDownCapture`)}}PC(UC,`usePointerDownOutside`);function WC(e,t=globalThis?.document){let n=MC(e),r=m.useRef(!1);return m.useEffect(()=>{let e=PC(e=>{e.target&&!r.current&&KC(LC,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:PC(()=>r.current=!0,`onFocusCapture`),onBlurCapture:PC(()=>r.current=!1,`onBlurCapture`)}}PC(WC,`useFocusOutside`);function GC(){let e=new CustomEvent(FC);document.dispatchEvent(e)}PC(GC,`dispatchUpdate`);function KC(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?kC(i,a):i.dispatchEvent(a)}PC(KC,`handleAndDispatchCustomEvent`);var qC=Object.defineProperty,JC=(e,t)=>qC(e,`name`,{value:t,configurable:!0}),YC=`focusScope.autoFocusOnMount`,XC=`focusScope.autoFocusOnUnmount`,ZC={bubbles:!1,cancelable:!0},QC=m.forwardRef(JC(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=MC(i),u=MC(a),d=m.useRef(null),f=BS(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:aw(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||aw(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&aw(s)};JC(e,`handleFocusIn`),JC(t,`handleFocusOut`),JC(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){ow.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(YC,ZC);s.addEventListener(YC,l),s.dispatchEvent(t),t.defaultPrevented||($C(lw(tw(s)),{select:!0}),document.activeElement===e&&aw(s))}return()=>{s.removeEventListener(YC,l),setTimeout(()=>{let t=new CustomEvent(XC,ZC);s.addEventListener(XC,u),s.dispatchEvent(t),t.defaultPrevented||aw(e??document.body,{select:!0}),s.removeEventListener(XC,u),ow.remove(p)},0)}}},[s,l,u,p]);let g=m.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ew(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&aw(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&aw(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,h.jsx)(OC.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})},`FocusScope`));function $C(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(aw(r,{select:t}),document.activeElement!==n)return}JC($C,`focusFirst`);function ew(e){let t=tw(e);return[nw(t,e),nw(t.reverse(),e)]}JC(ew,`getTabbableEdges`);function tw(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:JC(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}JC(tw,`getTabbableCandidates`);function nw(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):rw(r,{upTo:t})))return r}JC(nw,`findVisible`);function rw(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}JC(rw,`isHidden`);function iw(e){return e instanceof HTMLInputElement&&`select`in e}JC(iw,`isSelectableInput`);function aw(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&iw(e)&&t&&e.select()}}JC(aw,`focus`);var ow=sw();function sw(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=cw(e,t),e.unshift(t)},remove(t){e=cw(e,t),e[0]?.resume()}}}JC(sw,`createFocusScopesStack`);function cw(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}JC(cw,`arrayRemove`);function lw(e){return e.filter(e=>e.tagName!==`A`)}JC(lw,`removeLinks`);var uw=Object.defineProperty,dw=m.forwardRef(((e,t)=>uw(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);KS(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?wg.createPortal((0,h.jsx)(OC.div,{...r,ref:t}),o):null},`Portal`)),fw=Object.defineProperty,pw=(e,t)=>fw(e,`name`,{value:t,configurable:!0});function mw(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}pw(mw,`useStateMachine`);var hw=pw(e=>{let{present:t,children:n}=e,r=gw(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=vw(r.ref,bw(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function gw(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=mw(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??yw(r.current),o.current=void 0):a.current=`none`},[s]),KS(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=yw(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),KS(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=pw(a=>{let o=yw(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=pw(e=>{e.target===t&&(a.current=yw(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=yw(t)}else r.current=null;n(e)},[])}}pw(gw,`usePresence`);function _w(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}pw(_w,`setRef`);function vw(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=_w(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():_w(n[e],null)}}},[])}pw(vw,`useStableComposedRefs`);function yw(e){return e?.animationName||`none`}pw(yw,`getAnimationName`);function bw(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}pw(bw,`getElementRef`);var xw=Object.defineProperty,Sw=(e,t)=>xw(e,`name`,{value:t,configurable:!0}),Cw=0,ww=null;function Tw(e){return Ew(),e.children}Sw(Tw,`FocusGuards`);function Ew(){m.useEffect(()=>{ww||={start:Dw(),end:Dw()};let{start:e,end:t}=ww;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Cw++,()=>{Cw===1&&(ww?.start.remove(),ww?.end.remove(),ww=null),Cw=Math.max(0,Cw-1)}},[])}Sw(Ew,`useFocusGuards`);function Dw(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Sw(Dw,`createFocusGuard`);var Ow=function(){return Ow=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ow.apply(this,arguments)};function kw(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Aw(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var jw=`right-scroll-bar-position`,Mw=`width-before-scroll-bar`,Nw=`with-scroll-bars-hidden`,Pw=`--removed-body-scroll-bar-size`;function Fw(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Iw(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Lw=typeof window<`u`?m.useLayoutEffect:m.useEffect,Rw=new WeakMap;function zw(e,t){var n=Iw(t||null,function(t){return e.forEach(function(e){return Fw(e,t)})});return Lw(function(){var t=Rw.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Fw(e,null)}),i.forEach(function(e){r.has(e)||Fw(e,a)})}Rw.set(n,e)},[e]),n}function Bw(e){return e}function Vw(e,t){t===void 0&&(t=Bw);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Hw(e){e===void 0&&(e={});var t=Vw(null);return t.options=Ow({async:!0,ssr:!1},e),t}var Uw=function(e){var t=e.sideCar,n=kw(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return m.createElement(r,Ow({},n))};Uw.isSideCarExport=!0;function Ww(e,t){return e.useMedium(t),Uw}var Gw=Hw(),Kw=function(){},qw=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Kw,onWheelCapture:Kw,onTouchMoveCapture:Kw}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=kw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=zw([n,t]),w=Ow(Ow({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:Gw,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),Ow(Ow({},w),{ref:C})):m.createElement(y,Ow({},w,{className:c,ref:C}),s))});qw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},qw.classNames={fullWidth:Mw,zeroRight:jw};var Jw=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Yw(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Jw();return t&&e.setAttribute(`nonce`,t),e}function Xw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Zw(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Qw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Yw())&&(Xw(t,n),Zw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$w=function(){var e=Qw();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},eT=function(){var e=$w();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},tT={left:0,top:0,right:0,gap:0},nT=function(e){return parseInt(e||``,10)||0},rT=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[nT(n),nT(r),nT(i)]},iT=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return tT;var t=rT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},aT=eT(),oT=`data-scroll-locked`,sT=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
18
- .${Nw} {
17
+ `).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function q(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&q(e,t,`name`,a.name,a,null),q(e,t,`formEncType`,a.formEncType,a,null),q(e,t,`formMethod`,a.formMethod,a,null),q(e,t,`formTarget`,a.formTarget,a,null)):(q(e,t,`encType`,a.encType,a,null),q(e,t,`method`,a.method,a,null),q(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=vn);return;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=_n(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:K(`beforetoggle`,e),K(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}I=!0}function sp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&K(`scroll`,e);return;case`onScrollEnd`:r!=null&&K(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=vn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}I=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}I=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:K(`error`,e),K(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:q(e,t,o,s,n,null)}}a&&q(e,t,`srcSet`,n.srcSet,n,null),r&&q(e,t,`src`,n.src,n,null);return;case`input`:K(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:q(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in K(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:q(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in K(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:q(e,t,s,c,n,null)}un(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:q(e,t,l,r,n,null)}return;case`dialog`:K(`beforetoggle`,e),K(`toggle`,e),K(`cancel`,e),K(`close`,e);break;case`iframe`:case`object`:K(`load`,e);break;case`video`:case`audio`:for(r=0;r<Gf.length;r++)K(Gf[r],e);break;case`image`:K(`error`,e),K(`load`,e);break;case`details`:K(`toggle`,e);break;case`embed`:case`source`:case`link`:K(`error`,e),K(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:q(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&q(e,t,c,r,n,null))}var lp={};function up(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||q(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(I=!0),o=m;break;case`name`:m!==f&&(I=!0),a=m;break;case`checked`:m!==f&&(I=!0),u=m;break;case`defaultChecked`:m!==f&&(I=!0),d=m;break;case`value`:m!==f&&(I=!0),s=m;break;case`defaultValue`:m!==f&&(I=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&q(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||q(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(I=!0),p=o;break;case`defaultValue`:o!==l&&(I=!0),c=o;break;case`multiple`:o!==l&&(I=!0),s=o;default:o!==l&&q(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:q(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(I=!0),p=a;break;case`defaultValue`:a!==o&&(I=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&q(e,t,s,a,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:q(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(I=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:q(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&q(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:q(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&q(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||q(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&dp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&dp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function vp(e,t,n,r){return n=hp(n).createElement(e),n[Ct]=r,n[wt]=t,cp(n,e,t),Lt(n),n}function yp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=v(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=hp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),rm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),rm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=v(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&q(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===vn&&(e.onclick=null),Mt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=N.d;N.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Wd();return e||t}function km(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=It(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);Lt(c),cp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=It(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Lt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=It(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Lt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var a=(a=Ce.current)?Em(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bm(e){return`href="`+rn(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),cp(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+rn(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),cp(r,`style`,a),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bm(n.href);var o=e.querySelector(Vm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Hm(n),(a=wm.get(a))&&Jm(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(a=e.querySelector(Gm(o)))?(t.instance=a,Lt(a),a):(r=n,(a=wm.get(o))&&(r=T({},n),Ym(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),cp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ch.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ph={$$typeof:ne,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function mh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ji(3,null,null,t),e.current=a,a.stateNode=e,t=ja(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},mo(a),e}function gh(e){return e?(e=ki,e):ki}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=go(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=_o(e,r,t),n!==null&&(zd(n,e,t),vo(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Ei(e,67108864);t!==null&&zd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Id();t=vt(t);var n=Ei(e,t);n!==null&&zd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Th(e,t,n,r)}finally{N.p=a,M.T=i}}function wh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Th(e,t,n,r)}finally{N.p=a,M.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Qf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}Mf(a),!(V&6)&&(xd=Ve()+500,Nf(0,!1))}}break;case 31:case 13:s=Ei(a,2),s!==null&&zd(s,a,2),Wd(),yh(a,2)}if(a=Eh(r),a===null&&Qf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Eh(e){return e=bn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function kh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`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 Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,xt(e.priority,function(){xh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){xh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yn=r,n.target.dispatchEvent(r),yn=null}else return t=Pt(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Oh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;_h(n,Id(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Wd(),t[Tt]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(i(527,Qh,`19.3.0`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Xe=eg.inject($h),Ze=eg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=wc,s=Tc,c=Ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,o,s,c,Yh),e[Tt]=t.current,Xf(e),new Xh(t)}})),Zd=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Xd()})),Qd=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,$d=/^[\\/]{2}/;function ef(e,t){return t+e.replace(/\\/g,`/`)}var tf=`popstate`;function nf(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function rf(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return cf(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:lf(t)}return df(t,n,null,e)}function W(e,t){if(e===!1||e==null)throw Error(t)}function af(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function of(){return Math.random().toString(36).substring(2,10)}function sf(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function cf(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?uf(t):t,state:n,key:t&&t.key||r||of(),mask:i}}function lf({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 uf(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function df(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=nf(e)?e:cf(h.location,e,t);n&&n(r,e),l=u()+1;let d=sf(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=nf(e)?e:cf(h.location,e,t);n&&n(r,e),l=u();let i=sf(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ff(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(tf,d),c=e,()=>{i.removeEventListener(tf,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ff(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),W(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:lf(t);return i=i.replace(/ $/,`%20`),!n&&$d.test(i)&&(i=r+i),new URL(i,r)}var pf=class{#e=new Map;constructor(e){if(e)for(let[t,n]of e)this.set(t,n)}get(e){if(this.#e.has(e))return this.#e.get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){this.#e.set(e,t)}},mf=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`,`unstable_validateParams`]);function hf(e){return mf.has(e)}var gf=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`,`unstable_validateParams`]);function _f(e){return gf.has(e)}function vf(e){return e.index===!0}function yf(e){let t={};return e.Component&&Object.assign(t,{element:m.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}function G(e,t=yf,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(W(e.index!==!0||!e.children,`Cannot specify children on an index route`),W(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),vf(e)){let n={...e,id:s};return r[s]=bf(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=bf(n,t(n)),e.children&&(n.children=G(e.children,t,o,r,i)),n}})}function bf(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function xf(e,t,n=`/`){return Sf(e,t,n,!1)}function Sf(e,t,n,r,i){let a=Wf((typeof t==`string`?uf(t):t).pathname||`/`,n);if(a==null)return null;let o=i??wf(e),s=null,c=Uf(a);for(let e=0;s==null&&e<o.length;++e)s=zf(o[e],c,r);return s}function Cf(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,loaderData:t[n.id],handle:n.handle}}function wf(e){let t=Tf(e);return Df(t),t}function Tf(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;W(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=$f([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(W(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Tf(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Lf(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Hf(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ef(e.path))a(e,t,!0,n)}),t}function Ef(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ef(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Df(e){e.sort((e,t)=>e.score===t.score?Rf(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Of=/^:[\w-]+$/,kf=/^:[\w-]+/,Af=3.5,jf=3,Mf=2,Nf=1,Pf=10,Ff=-2,If=e=>e===`*`;function Lf(e,t){let n=e.split(`/`),r=n.length;return n.some(If)&&(r+=Ff),t&&(r+=Mf),n.filter(e=>!If(e)).reduce((e,t)=>e+(Of.test(t)?jf:kf.test(t)?Af:t===``?Nf:Pf),r)}function Rf(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function zf(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Vf(u,l,s.matcher,s.compiledParams):Bf(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Bf({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:$f([a,d.pathname]),pathnameBase:tp($f([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=$f([a,d.pathnameBase]))}return o}function Bf(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Hf(e.path,e.caseSensitive,e.end);return Vf(e,t,n,r)}function Vf(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=ep(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=ep(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Hf(e,t=!1,n=!0){af(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(?=\/|$|\()/g,`(?:/$1)?`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Uf(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return af(!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 Wf(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Gf({basename:e,pathname:t}){return t===`/`?e:$f([e,t])}var Kf=e=>Qd.test(e);function qf(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?uf(e):e,a;return n?(n=Qf(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?K(n.substring(1),`/`):K(n,t)):a=t,{pathname:a,search:np(r),hash:rp(i)}}function K(e,t){let n=ep(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Jf(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yf(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Xf(e){let t=Yf(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Zf(e,t,n,r=!1){let i;typeof e==`string`?i=uf(e):(i={...e},W(!i.pathname||!i.pathname.includes(`?`),Jf(`?`,`pathname`,`search`,i)),W(!i.pathname||!i.pathname.includes(`#`),Jf(`#`,`pathname`,`hash`,i)),W(!i.search||!i.search.includes(`#`),Jf(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=qf(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Qf=e=>e.replace(/[\\/]{2,}/g,`/`),$f=e=>Qf(e.join(`/`));function ep(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var tp=e=>ep(e).replace(/^\/*/,`/`),np=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,rp=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,ip=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ap=class{status;statusText;data;error;internal;constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function op(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function q(e){return $f(e.map(e=>e.route.path).filter(Boolean))||`/`}function sp(e,t){let n=new URL(typeof e==`string`||e instanceof URL?e:e.url),r=typeof t==`string`?uf(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);let i=e.toString();n.search=i?`?${i}`:``}else n.search=``;return n.hash=r.hash||``,n}var cp=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function lp(e,t){let n=e;if(typeof n!=`string`||!Qd.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(cp)try{let e=new URL(window.location.href),r=$d.test(n)?new URL(ef(n,e.protocol)):new URL(n),a=Wf(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{af(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var up=Symbol(`Uninstrumented`),dp=new WeakMap;function fp(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){e.lazy!=null&&n.lazy.push(e.lazy),e[`lazy.loader`]!=null&&n[`lazy.loader`].push(e[`lazy.loader`]),e[`lazy.action`]!=null&&n[`lazy.action`].push(e[`lazy.action`]),e[`lazy.middleware`]!=null&&n[`lazy.middleware`].push(e[`lazy.middleware`]),e.middleware!=null&&n.middleware.push(e.middleware),e.loader!=null&&n.loader.push(e.loader),e.action!=null&&n.action.push(e.action)}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=t.lazy;r.lazy=async(...t)=>vp(await yp(n.lazy,void 0,()=>e(...t),bp))}if(typeof t.lazy==`object`){let e=t.lazy;if(typeof e.middleware==`function`&&n[`lazy.middleware`].length>0){let t=e.middleware;r.lazy=Object.assign(r.lazy||{},{middleware:async(...e)=>vp(await yp(n[`lazy.middleware`],void 0,()=>t(...e),bp))})}if(typeof e.loader==`function`&&n[`lazy.loader`].length>0){let t=e.loader;r.lazy=Object.assign(r.lazy||{},{loader:async(...e)=>vp(await yp(n[`lazy.loader`],void 0,()=>t(...e),bp))})}if(typeof e.action==`function`&&n[`lazy.action`].length>0){let t=e.action;r.lazy=Object.assign(r.lazy||{},{action:async(...e)=>vp(await yp(n[`lazy.action`],void 0,()=>t(...e),bp))})}}if(typeof t.loader==`function`&&n.loader.length>0){let e=mp(t.loader),i=async(...t)=>vp(await yp(n.loader,xp(t[0]),()=>e(...t),bp));e.hydrate===!0&&(i.hydrate=!0),hp(i,e),r.loader=i}if(typeof t.action==`function`&&n.action.length>0){let e=mp(t.action),i=async(...t)=>vp(await yp(n.action,xp(t[0]),()=>e(...t),bp));hp(i,e),r.action=i}return t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=mp(e),r=async(...e)=>vp(await yp(n.middleware,xp(e[0]),()=>t(...e),bp));return hp(r,t),r})),r}function pp(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){e.navigate!=null&&n.navigate.push(e.navigate),e.fetch!=null&&n.fetch.push(e.fetch)}})),n.navigate.length>0){let t=mp(e.navigate),r=async(...r)=>{let[i,a]=r,o,s={to:typeof i==`number`||typeof i==`string`?i:i?lf(i):`.`,...Sp(e,a??{})};return vp(await yp(n.navigate,s,async()=>{if(typeof i==`number`)return await t(...r);let n=gp(e,e=>{o=e});try{return await t(...r)}finally{n()}},e=>({...bp(e),meta:o})))};hp(r,t),e.navigate=r}if(n.fetch.length>0){let t=mp(e.fetch),r=async(...r)=>{let[i,a,o,s]=r,c;return vp(await yp(n.fetch,{href:o??`.`,fetcherKey:i,...Sp(e,s??{})},async()=>{let n=gp(e,e=>{c=e});try{return await t(...r)}finally{n()}},e=>({...bp(e),meta:c})))};hp(r,t),e.fetch=r}return e}function mp(e){return e[up]??e}function hp(e,t){e[up]=t}function gp(e,t){return dp.set(e,t),()=>{dp.get(e)===t&&dp.delete(e)}}function _p(e){let t=dp.get(e);return dp.delete(e),t}function vp(e){if(e.type===`error`)throw e.value;return e.value}async function yp(e,t,n,r,i={result:null,innerResult:null},a=e.length-1){let o=e[a];if(o){let s,c=async()=>(s?console.error(`You cannot call instrumented handlers more than once`):s=yp(e,t,n,r,i,a-1),await s,W(i.innerResult,`Expected an inner result`),i.innerResult);try{await o(c,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}s||await c(),await s}else{try{i.result={type:`success`,value:await n()}}catch(e){i.result={type:`error`,value:e}}i.innerResult=r(i.result,t)}return i.result?i.result:(i.result={type:`error`,value:Error(`No result assigned in instrumentation chain.`)},i.innerResult=r(i.result,t),i.result)}function bp(e){return e.type===`error`&&e.value instanceof Error?{status:`error`,error:e.value}:{status:`success`,error:void 0}}function xp(e){let{request:t,context:n,params:r}=e;return{...e,request:Cp(t),params:{...r},context:wp(n)}}function Sp(e,t){return{currentUrl:lf(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function Cp(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function wp(e){return{get:t=>e.get(t)}}var Tp=class{#e=[];#t=[];#n;constructor(e){this.#n=e}update(e){this.#e=e,this.#t=wf(e)}match(e,t=!1){return Sf(this.#e,e,this.#n,t,this.#t)}},Ep=new URL(`http://localhost`);function Dp(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ep)}catch{return Ep}}function Op(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function kp(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Ap(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Op(i,n),s=!Op(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!kp(e,i)||!Op(i,a)))throw Error(`External navigation is not allowed`)}var jp=[`POST`,`PUT`,`PATCH`,`DELETE`],Mp=new Set(jp),Np=[`GET`,...jp],Pp=new Set(Np),Fp=new Set([301,302,303,307,308]),Ip=new Set([307,308]),Lp={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rp={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zp={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Bp=`remix-router-transitions`,Vp=Symbol(`ResetLoaderData`);function Hp(e,t){return e.unstable_routePatternMatching?(W(void 0,`You must call unstable_preloadRoutePattern() from "react-router/route-pattern" before enabling future.unstable_routePatternMatching.`),new(void 0)(t)):new Tp(t)}var Up=class{#e;#t;#n;constructor(e,t){this.#e=e,this.#n=t,this.#n.update(e)}get stableRoutes(){return this.#e}get activeRoutes(){return this.#t??this.#e}get hasHMRRoutes(){return this.#t!=null}setRoutes(e){this.#e=e,this.#t||this.#n.update(e)}setHmrRoutes(e){this.#t=e,this.#n.update(e)}commitHmrRoutes(){this.#t&&(this.#e=this.#t,this.#t=void 0,this.#n.update(this.#e))}};function Wp(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;W(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties,a=i||(()=>({}));if(e.instrumentations){let t=e.instrumentations;a=e=>({...i?.(e),...fp(t.map(e=>e.route).filter(Boolean),e)})}let o={...e.future},s=e.basename||`/`;s.startsWith(`/`)||(s=`/${s}`);let c=Hp(o,s),l={},u=new Up(G(e.routes,a,void 0,l),c),d=e.dataStrategy||sm,f=null,p=new Set,m=null,h=null,g=null,_=null,v=e.hydrationData!=null,y=c.match(e.history.location),b=!1,x=null,S,C;if(y==null&&!e.patchRoutesOnNavigation){let t=jm(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Am(u.activeRoutes);S=!0,C=!S,y=n,x={[r.id]:t}}else if(y&&!e.hydrationData&&Ye(y,e.history.location.pathname).active&&(y=null),!y){S=!1,C=!S,y=[];let t=Ye(null,e.history.location.pathname);t.active&&t.matches&&(b=!0,y=t.matches)}else if(y.some(e=>e.route.lazy))S=!1,C=!S;else if(!y.some(e=>Yp(e.route)))S=!0,C=!S;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=y;if(n){let e=y.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}C=!1,S=!0,r.forEach(e=>{let r=Xp(e.route,t,n);C||=r.renderFallback,S&&=!r.shouldLoad})}let w,T={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,renderFallback:C,navigation:Lp,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=`POP`,D=null,O=!1,k,ee=!1,A=new Map,te=null,ne=!1,re=!1,ie=new Set,ae=new Map,oe=0,se=-1,ce=new Map,j=new Set,le=new Map,ue=new Map,de=new Set,fe=new Map,pe,me=null;function he(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(pe){pe(),pe=void 0;return}af(fe.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ue({currentLocation:T.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{pe=e});e.history.go(r*-1),He(i,{state:`blocked`,location:n,proceed(){He(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(T.blockers);e.set(i,zp),N({blockers:e})}}),D?.resolve(),D=null;return}return F(t,n)}),n){nh(t,A);let e=()=>rh(t,A);t.addEventListener(`pagehide`,e),te=()=>t.removeEventListener(`pagehide`,e)}return T.initialized||F(`POP`,T.location,{initialHydration:!0}),w}function ge(){f&&f(),te&&te(),p.clear(),k&&k.abort(),T.fetchers.forEach((e,t)=>Pe(T.fetchers,t)),T.blockers.forEach((e,t)=>Ve(t))}function M(e){if(p.add(e),m){let{newErrors:t}=m;m=null,e(T,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>p.delete(e)}function N(e,t={}){e.matches&&=e.matches.map(e=>{let t=l[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),T={...T,...e};let n=[],r=[];T.fetchers.forEach((e,t)=>{e.state===`idle`&&(de.has(t)?n.push(t):r.push(t))}),de.forEach(e=>{!T.fetchers.has(e)&&!ae.has(e)&&n.push(e)}),p.size===0&&(m={newErrors:e.errors??null}),[...p].forEach(r=>r(T,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Pe(T.fetchers,e)),r.forEach(e=>T.fetchers.delete(e))}function _e(t,n,{flushSync:r}={}){let i=T.actionData!=null&&T.navigation.formMethod!=null&&Km(T.navigation.formMethod)&&T.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?T.actionData:null;let o=n.loaderData?Dm(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,s=T.blockers;s.size>0&&!ne&&(s=new Map(s),s.forEach((e,t)=>s.set(t,zp)));let c=!ne&&Je(t,n.matches||T.matches),l=O===!0||T.navigation.formMethod!=null&&Km(T.navigation.formMethod)&&t.state?._isRedirect!==!0;u.commitHmrRoutes(),ne||E===`POP`||(E===`PUSH`?e.history.push(t,t.state):E===`REPLACE`&&e.history.replace(t,t.state));let d;if(E===`POP`&&!ne&&t!==T.location){let e=A.get(T.location.pathname);e&&e.has(t.pathname)?d={currentLocation:T.location,nextLocation:t}:A.has(t.pathname)&&(d={currentLocation:t,nextLocation:T.location})}else if(ee){let e=A.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(T.location.pathname,e)),d={currentLocation:T.location,nextLocation:t}}N({...n,actionData:a,loaderData:o,historyAction:E,location:t,initialized:!0,renderFallback:!1,navigation:Lp,revalidation:`idle`,restoreScrollPosition:c,preventScrollReset:l,blockers:s},{viewTransitionOpts:d,flushSync:r===!0}),E=`POP`,O=!1,ee=!1,ne=!1,re=!1,D?.resolve(),D=null,me?.resolve(),me=null}async function P(t,n){if(D?.resolve(),D=null,typeof t==`number`){D||=ih();let n=D.promise;return e.history.go(t),n}let r=_p(w),{path:i,submission:a,error:o}=qp(!1,Kp(T.location,T.matches,s,t,n?.fromRouteId,n?.relative),n),c;if(n?.mask){let t=typeof n.mask==`string`?uf(n.mask):{...T.location.mask,...n.mask};if(c={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},$d.test(c.pathname))throw Error(`External navigation is not allowed`);c.pathname.startsWith(`\\`)&&(c.pathname=c.pathname.replace(/^\\+/,`/`)),Ap(typeof n.mask==`string`?n.mask:lf(n.mask),lf(c),e.history.createURL(`/`),`reject`)}let l=T.location,u=cf(l,i,n&&n.state,void 0,c);u={...u,...e.history.encodeLocation(u)},Ap(t==null?e.history.createHref(T.location):typeof t==`string`?t:lf(t),e.history.createHref(u.mask||u),e.history.createURL(`/`),`reject`);let d=n&&n.replace!=null?n.replace:void 0,f=`PUSH`;d===!0?f=`REPLACE`:d===!1||a!=null&&Km(a.formMethod)&&a.formAction===T.location.pathname+T.location.search&&(f=`REPLACE`);let p=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,m=(n&&n.flushSync)===!0,h=Ue({currentLocation:l,nextLocation:u,historyAction:f});if(h){He(h,{state:`blocked`,location:u,proceed(){He(h,{state:`proceeding`,proceed:void 0,reset:void 0,location:u}),P(t,n)},reset(){let e=new Map(T.blockers);e.set(h,zp),N({blockers:e})}});return}await F(f,u,{submission:a,pendingError:o,preventScrollReset:p,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate,instrumentationNavigateMetaReceiver:r})}function ve(){me||=ih(),ke(),N({revalidation:`loading`});let e=me.promise;return T.navigation.state===`submitting`?e:T.navigation.state===`idle`?(F(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),e):(F(E||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:ee===!0}),e)}async function F(t,n,r){k&&k.abort(),k=null,E=t,ne=(r&&r.startUninterruptedRevalidation)===!0,qe(T.location,T.matches),O=(r&&r.preventScrollReset)===!0,ee=(r&&r.enableViewTransition)===!0;let i=r?.initialHydration&&T.matches&&T.matches.length>0&&!b?T.matches:c.match(n),a=(r&&r.flushSync)===!0;if(i&&T.initialized&&!re&&Pm(T.location,n)&&!(r&&r.submission&&Km(r.submission.formMethod))){_e(n,{matches:i},{flushSync:a});return}let o=Ye(i,n.pathname);if(o.active&&o.matches&&(i=o.matches),r?.instrumentationNavigateMetaReceiver){let t=Ym(e.history,n,i);r.instrumentationNavigateMetaReceiver(t)}if(!i){let{error:e,notFoundMatches:t,route:r}=We(n.pathname);_e(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:a});return}let s=r&&r.overrideNavigation?{...r.overrideNavigation,matches:i,historyAction:t}:void 0;k=new AbortController;let l=Sm(e.history,n,k.signal,r&&r.submission),u=e.getContext?await e.getContext():new pf,d;if(r&&r.pendingError)d=[km(i).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Km(r.submission.formMethod)){let c=await ye(l,n,r.submission,i,t,u,o.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:a});if(c.shortCircuited)return;if(c.pendingActionResult){let[e,t]=c.pendingActionResult;if(zm(t)&&op(t.error)&&t.error.status===404){k=null,_e(n,{matches:c.matches,loaderData:{},errors:{[e]:t.error}});return}}i=c.matches||i,d=c.pendingActionResult,s=Zm(n,i,t,r.submission),a=!1,o.active=!1,l=Sm(e.history,l.url,l.signal)}let{shortCircuited:f,matches:p,loaderData:m,errors:h,workingFetchers:g}=await be(l,n,i,t,u,o.active,s,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,a,d,r&&r.callSiteDefaultShouldRevalidate);f||(k=null,_e(n,{matches:p||i,...Om(d),loaderData:m,errors:h,...g?{fetchers:g}:{}}))}async function ye(t,n,i,o,c,d,f,p,m={}){if(ke(),N({navigation:Qm(n,o,c,i)},{flushSync:m.flushSync===!0}),f){let e=await Xe(o,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Am(u.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=km(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)o=e.matches;else{let{notFoundMatches:e,error:t,route:r}=We(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Jm(o,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:jm(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await De(t,n,pm(a,l,t,n,o,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of o)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Bm(h)){let n;return n=m&&m.replace!=null?m.replace:xm(h.response.headers.get(`Location`),new URL(t.url),s,e.history)===T.location.pathname+T.location.search,await Ee(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(zm(h)){let e=km(o,g.route.id);return(m&&m.replace)!==!0&&(E=`PUSH`),{matches:o,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:o,pendingActionResult:[g.route.id,h]}}async function be(t,n,i,o,s,d,f,p,m,h,g,_,v,y){let b=f||Zm(n,i,o,p),x=p||m||Xm(b),S=!ne&&!g;if(d){if(S){let e=xe(v);N({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Xe(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Am(u.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=km(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=We(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let{dsMatches:C,revalidatingFetchers:w}=Jp(t,s,a,l,e.history,T,i,x,n,g?[]:r,g===!0,re,ie,de,le,j,c,v,y);if(se=++oe,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&w.length===0){let e=new Map(T.fetchers),t=Re(e);return _e(n,{matches:i,loaderData:{},errors:v&&zm(v[1])?{[v[0]]:v[1].error}:null,...Om(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=xe(v);t!==void 0&&(e.actionData=t)}w.length>0&&(e.fetchers=Se(w)),N(e,{flushSync:_})}w.forEach(e=>{Ie(e.key),e.controller&&ae.set(e.key,e.controller)});let E=()=>w.forEach(e=>Ie(e.key));k&&k.signal.addEventListener(`abort`,E);let{loaderResults:D,fetcherResults:O}=await Oe(C,w,t,n,s);if(t.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener(`abort`,E),w.forEach(e=>ae.delete(e.key));let ee=Mm(D);if(ee)return await Ee(t,ee.result,!0,{replace:h}),{shortCircuited:!0};if(ee=Mm(O),ee)return j.add(ee.key),await Ee(t,ee.result,!0,{replace:h}),{shortCircuited:!0};let A=new Map(T.fetchers),{loaderData:te,errors:ce}=Em(T,i,D,v,w,O,A);g&&T.errors&&(ce={...T.errors,...ce});let ue=Re(A),fe=ze(se,A),pe=ue||fe||w.length>0;return{matches:i,loaderData:te,errors:ce,...pe?{workingFetchers:A}:{}}}function xe(e){if(e&&!zm(e[1]))return{[e[0]]:e[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Se(e){let t=new Map(T.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=$m(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ce(t,n,r,i){Ie(t);let a=(i&&i.flushSync)===!0,o=_p(w),l=Kp(T.location,T.matches,s,r,n,i?.relative),u=c.match(l),d=Ye(u,l);if(d.active&&d.matches&&(u=d.matches),o&&o(Ym(e.history,l,u)),!u){je(t,n,jm(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=qp(!0,l,i);if(m){je(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new pf,g=(i&&i.preventScrollReset)===!0;if(p&&Km(p.formMethod)){await we(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}let _={routeId:n,path:f,isDiscovering:d.active};le.set(t,_),await Te(t,_,u,h,a,g,p)}async function we(t,n,i,o,s,u,d,f,p,m){ke(),le.delete(t),Ae(t,eh(p,T.fetchers.get(t)),{flushSync:d});let h=new AbortController,g=Sm(e.history,i,h.signal,p);if(u){let e=await Xe(o,new URL(g.url).pathname,g.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){je(t,n,e.error,{flushSync:d});return}if(e.matches)o=e.matches;else{je(t,n,jm(404,{pathname:i}),{flushSync:d});return}}let _=Jm(o,i);if(!_.route.action&&!_.route.lazy){je(t,n,jm(405,{method:p.formMethod,pathname:i,routeId:n}),{flushSync:d});return}ae.set(t,h);let v=oe,y=pm(a,l,g,i,o,_,r,s),b=await De(g,i,y,s,t),x=b[_.route.id];if(!x){for(let e of y)if(b[e.route.id]){x=b[e.route.id];break}}if(g.signal.aborted){ae.get(t)===h&&ae.delete(t);return}if(de.has(t)){if(Bm(x)||zm(x)){Ae(t,th(void 0));return}}else{if(Bm(x)){if(ae.delete(t),se>v){Ae(t,th(void 0));return}return j.add(t),Ae(t,$m(p)),Ee(g,x,!1,{fetcherSubmission:p,preventScrollReset:f})}if(zm(x)){je(t,n,x.error);return}}let S=T.navigation.location||T.location,C=Sm(e.history,S,h.signal),w=T.navigation.state===`idle`?T.matches:c.match(T.navigation.location);W(w,`Didn't find any matches after fetcher action`);let D=++oe;ce.set(t,D);let{dsMatches:O,revalidatingFetchers:ee}=Jp(C,s,a,l,e.history,T,w,p,S,r,!1,re,ie,de,le,j,c,[_.route.id,x],m),A=$m(p,x.data),te=new Map(T.fetchers);te.set(t,A),ee.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=te.get(t),r=$m(void 0,n?n.data:void 0);te.set(t,r),Ie(t),e.controller&&ae.set(t,e.controller)}),N({fetchers:te});let ne=()=>ee.forEach(e=>Ie(e.key));h.signal.addEventListener(`abort`,ne);let{loaderResults:ue,fetcherResults:fe}=await Oe(O,ee,C,S,s);if(h.signal.aborted){ce.get(t)===D&&ce.delete(t);return}h.signal.removeEventListener(`abort`,ne),ce.delete(t),ae.delete(t),ee.forEach(e=>ae.delete(e.key));let pe=T.fetchers.has(t),me=e=>{if(!pe)return e;let n=new Map(e.fetchers);return n.set(t,th(x.data)),{...e,fetchers:n}},he=Mm(ue);if(he)return T=me(T),Ee(C,he.result,!1,{preventScrollReset:f});if(he=Mm(fe),he)return j.add(he.key),T=me(T),Ee(C,he.result,!1,{preventScrollReset:f});let ge=new Map(T.fetchers);pe&&ge.set(t,th(x.data));let{loaderData:M,errors:P}=Em(T,w,ue,void 0,ee,fe,ge);ze(D,ge),T.navigation.state===`loading`&&D>se?(W(E,`Expected pending action`),k&&k.abort(),_e(T.navigation.location,{matches:w,loaderData:M,errors:P,fetchers:ge})):(N({errors:P,loaderData:Dm(T.loaderData,M,w,P),fetchers:ge}),re=!1)}async function Te(t,n,i,o,s,c,u){let{routeId:d,path:f}=n,p=T.fetchers.get(t);Ae(t,$m(u,p?p.data:void 0),{flushSync:s});let m=new AbortController,h=Sm(e.history,f,m.signal);if(n.isDiscovering){let e=await Xe(i,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){je(t,d,e.error,{flushSync:s});return}if(e.matches)i=e.matches,n.isDiscovering=!1;else{je(t,d,jm(404,{pathname:f}),{flushSync:s});return}}let g=Jm(i,f);ae.set(t,m);let _=oe,v=await De(h,f,pm(a,l,h,f,i,g,r,o),o,t),y=v[g.route.id];if(!y){for(let e of i)if(v[e.route.id]){y=v[e.route.id];break}}if(ae.get(t)===m&&ae.delete(t),!h.signal.aborted){if(de.has(t)){Ae(t,th(void 0));return}if(Bm(y)){if(se>_){Ae(t,th(void 0));return}j.add(t),await Ee(h,y,!1,{preventScrollReset:c});return}if(zm(y)){je(t,d,y.error);return}Ae(t,th(y.data))}}async function Ee(r,i,a,{submission:o,fetcherSubmission:c,preventScrollReset:l,replace:u}={}){a||(D?.resolve(),D=null),i.response.headers.has(`X-Remix-Revalidate`)&&(re=!0);let d=i.response.headers.get(`Location`);W(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=xm(d,p,s,e.history),Ap(f,d,p,`allow-explicit`);let m=cf(T.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Kf(d)){let n=ff(t,d,!0);e=n.origin!==t.location.origin||Wf(n.pathname,s)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}k=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=T.navigation;!o&&!c&&g&&_&&v&&(o=Xm(T.navigation));let y=o||c;Ip.has(i.response.status)&&y&&Km(y.formMethod)?await F(h,m,{submission:{...y,formAction:d},preventScrollReset:l||O,enableViewTransition:a?ee:void 0}):await F(h,m,{overrideNavigation:Zm(m,[],h,o),fetcherSubmission:c,preventScrollReset:l||O,enableViewTransition:a?ee:void 0})}async function De(e,t,n,r,i){let a,o={};try{a=await mm(d,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Km(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!T.loaderData.hasOwnProperty(e.route.id)&&(!T.errors||!T.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Rm(r)){let i=r.result;o[t]={type:`redirect`,response:vm(i,e,t,n,s)}}else o[t]=await _m(r);return o}async function Oe(e,t,n,r,i){let a=De(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await De(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:jm(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function ke(){re=!0,le.forEach((e,t)=>{ae.has(t)&&ie.add(t),Ie(t)})}function Ae(e,t,n={}){let r=new Map(T.fetchers);r.set(e,t),N({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function je(e,t,n,r={}){let i=km(T.matches,t),a=new Map(T.fetchers);Pe(a,e),N({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Me(e){return ue.set(e,(ue.get(e)||0)+1),de.has(e)&&de.delete(e),T.fetchers.get(e)||Rp}function Ne(e,t){Ie(e,t?.reason),Ae(e,th(null))}function Pe(e,t){let n=T.fetchers.get(t);ae.has(t)&&!(n&&n.state===`loading`&&ce.has(t))&&Ie(t),le.delete(t),ce.delete(t),j.delete(t),de.delete(t),ie.delete(t),e.delete(t)}function Fe(e){let t=(ue.get(e)||0)-1;t<=0?(ue.delete(e),de.add(e)):ue.set(e,t),N({fetchers:new Map(T.fetchers)})}function Ie(e,t){let n=ae.get(e);n&&(n.abort(t),ae.delete(e))}function Le(e,t){for(let n of e){let e=t.get(n);W(e,`Expected fetcher: ${n}`);let r=th(e.data);t.set(n,r)}}function Re(e){let t=[],n=!1;for(let r of j){let i=e.get(r);W(i,`Expected fetcher: ${r}`),i.state===`loading`&&(j.delete(r),t.push(r),n=!0)}return Le(t,e),n}function ze(e,t){let n=[];for(let[r,i]of ce)if(i<e){let e=t.get(r);W(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Ie(r),ce.delete(r),n.push(r))}return Le(n,t),n.length>0}function Be(e,t){let n=T.blockers.get(e)||zp;return fe.get(e)!==t&&fe.set(e,t),n}function Ve(e){T.blockers.delete(e),fe.delete(e)}function He(e,t){let n=T.blockers.get(e)||zp;W(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(T.blockers);r.set(e,t),N({blockers:r})}function Ue({currentLocation:e,nextLocation:t,historyAction:n}){if(fe.size===0)return;fe.size>1&&af(!1,`A router only supports one blocker at a time`);let r=Array.from(fe.entries()),[i,a]=r[r.length-1],o=T.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function We(e){let t=jm(404,{pathname:e}),n=u.activeRoutes,{matches:r,route:i}=Am(n);return{notFoundMatches:r,route:i,error:t}}function Ge(e,t,n){if(h=e,_=t,g=n||null,!v&&T.navigation===Lp){v=!0;let e=Je(T.location,T.matches);e!=null&&N({restoreScrollPosition:e})}return()=>{h=null,_=null,g=null}}function Ke(e,t){return g&&g(e,t.map(e=>Cf(e,T.loaderData)))||e.key}function qe(e,t){if(h&&_){let n=Ke(e,t);h[n]=_()}}function Je(e,t){if(h){let n=Ke(e,t),r=h[n];if(typeof r==`number`)return r}return null}function Ye(t,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:c.match(n,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:c.match(n,!0)}}return{active:!1,matches:null}}async function Xe(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let o=t;for(;;){let t=l;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:o,fetcherKey:i,patch:(e,n)=>{r.aborted||em(e,n,u,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:o}}if(r.aborted)return{type:`aborted`};let s=c.match(n),d=null;if(s&&(Object.keys(s[0].params).length===0||(d=c.match(n,!0),!(d&&o.length<d.length&&Ze(o,d.slice(0,o.length))))))return{type:`success`,matches:s};if(d||=c.match(n,!0),!d||Ze(o,d))return{type:`success`,matches:null};o=d}}function Ze(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Qe(e){l={},u.setHmrRoutes(G(e,a,void 0,l))}function $e(e,t,n=!1){em(e,t,u,l,a,n),u.hasHMRRoutes||N({})}return w={get basename(){return s},get future(){return o},get state(){return T},get routes(){return u.stableRoutes},match(e){return c.match(e)},get manifest(){return l},get window(){return t},initialize:he,subscribe:M,enableScrollRestoration:Ge,navigate:P,fetch:Ce,revalidate:ve,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Me,resetFetcher:Ne,deleteFetcher:Fe,dispose:ge,getBlocker:Be,deleteBlocker:Ve,patchRoutes:$e,_internalFetchControllers:ae,_internalSetRoutes:Qe,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){N(e)}},e.instrumentations&&(w=pp(w,e.instrumentations.map(e=>e.router).filter(Boolean))),w}function Gp(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Kp(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Zf(r||`.`,Xf(o),Wf(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=qm(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=Gf({basename:n,pathname:c.pathname})),lf(c)}function qp(e,t,n){if(!n||!Gp(n))return{path:t};if(n.formMethod&&!Gm(n.formMethod))return{path:t,error:jm(405,{method:n.formMethod})};let r=()=>({path:t,error:jm(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Nm(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Km(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}\n`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Km(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}W(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Cm(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Cm(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=wm(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=wm(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Km(c.formMethod))return{path:t,submission:c};let l=uf(t);return e&&l.search&&qm(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:lf(l),submission:c}}function Jp(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=_?zm(_[1])?_[1].error:_[1].data:void 0,b=i.createURL(a.location),x=i.createURL(c),S;if(u&&a.errors){let e=Object.keys(a.errors)[0];S=o.findIndex(t=>t.route.id===e)}else if(_&&zm(_[1])){let e=_[0];S=o.findIndex(t=>t.route.id===e)-1}let C=_?_[1].statusCode:void 0,w=C&&C>=400,T={currentUrl:b,currentParams:a.matches[0]?.params||{},nextUrl:x,nextParams:o[0].params,...s,actionResult:y,actionStatus:C},E=q(o),D=o.map((i,o)=>{let{route:s}=i,f=null;if(S!=null&&o>S)f=!1;else if(s.lazy)f=!0;else if(!Yp(s))f=!1;else if(u){let{shouldLoad:e}=Xp(s,a.loaderData,a.errors);f=e}else Zp(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return fm(n,r,e,c,E,i,l,t,f);let p=!1;typeof v==`boolean`?p=v:w?p=!1:d||b.pathname+b.search===x.pathname+x.search?p=!0:b.search===x.search?Qp(a.matches[o],i)&&(p=!0):p=!0;let m={...T,defaultShouldRevalidate:p};return fm(n,r,e,c,E,i,l,t,$p(i,m),m,v)}),O=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s)||e.isDiscovering)return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,_=g.match(e.path);if(!_){O.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let y=Jm(_,e.path),b=new AbortController,x=Sm(i,e.path,b.signal),S=null;if(f.has(s))f.delete(s),S=pm(n,r,x,e.path,_,y,l,t);else if(m)d&&(S=pm(n,r,x,e.path,_,y,l,t));else{let i;i=typeof v==`boolean`?v:!w&&d;let a={...T,defaultShouldRevalidate:i};$p(y,a)&&(S=pm(n,r,x,e.path,_,y,l,t,a))}S&&O.push({key:s,routeId:e.routeId,path:e.path,matches:S,match:y,request:x,controller:b})}),{dsMatches:D,revalidatingFetchers:O}}function Yp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Xp(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Yp(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Zp(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Qp(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function $p(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function em(e,t,n,r,i,a){let o;if(e){let t=r[e];W(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>tm(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=G(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=G([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function tm(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>tm(e,t)))??!1}var nm=new WeakMap,rm=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(W(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=nm.get(i);o||(o={},nm.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=hf(e),n=i[e]!==void 0;if(t)af(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)af(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},im=new WeakMap;function am(e,t,n,r,i){let a=n[e.id];if(W(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=im.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{W(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=_f(e),o=a[e]!==void 0;i?af(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?af(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return im.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=rm({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function om(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function sm(e){return e.matches.some(e=>e.route.middleware)?cm(e,()=>om(e)):om(e)}function cm(e,t){return lm(e,t,e=>{if(Wm(e))throw e;return e},Im,n);async function n(t,n,r){if(r)return Object.assign(r.value,{[n]:{type:`error`,result:t}});{let{matches:r}=e,i=Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0)),a=r[i].route.id;for(let e of r.slice(0,i+1))try{await e._lazyPromises?.route}catch{a=e.route.id;break}return{[km(r,a).route.id]:{type:`error`,result:t}}}}}async function lm(e,t,n,r,i){let{matches:a,...o}=e;return await um(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function um(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await um(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function dm(e,t,n,r,i){let a=rm({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=am(r.route,Km(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function fm(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=dm(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?$p(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?$p(a,{...l,defaultShouldRevalidate:e}):$p(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Km(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Km(n.method)||!p)?hm({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function pm(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?fm(e,t,n,r,q(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:dm(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function mm(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:sp(t,n),pattern:q(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return cm(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function hm({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Km(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:sp(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw jm(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw jm(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function gm(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function _m(e){let{result:t,type:n}=e;if(Hm(t)){let e;try{e=await gm(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new ap(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Vm(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Fm(t),statusCode:op(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:op(t)?t.status:void 0}:Vm(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function vm(e,t,n,r,i){let a=e.headers.get(`Location`);if(W(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Kf(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Kp(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var ym=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function bm(e){try{return ym.includes(new URL(e).protocol)}catch{return!1}}function xm(e,t,n,r){if(Kf(e)){let r=e,i=$d.test(r)?new URL(ef(r,t.protocol)):new URL(r);if(bm(i.toString()))throw Error(`Invalid redirect location`);let a=Wf(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Qf(i.pathname)+i.search+i.hash}try{if(bm(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Sm(e,t,n,r){let i=e.createURL(Nm(t)).toString(),a={signal:n};if(r&&Km(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Cm(r.formData):r.formData}return new Request(i,a)}function Cm(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function wm(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Tm(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&zm(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(W(!Bm(f),`Cannot handle redirect results in processLoaderData`),zm(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=km(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Vp),c||(c=!0,s=op(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Em(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=Tm(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(W(s,`Did not find corresponding fetcher result`),zm(s)){let t=km(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Bm(s))W(!1,`Unhandled fetcher revalidation redirect`);else{let e=th(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Dm(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Vp).reduce((e,[t,n])=>(e[t]=n,e),{}),a=0;for(let o of n){let n=o.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&o.route.loader&&(i[n]=e[n],a++),r&&r.hasOwnProperty(n))break}return Object.keys(t).length===0&&a===Object.keys(e).length?e:i}function Om(e){return e?zm(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function km(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.ErrorBoundary!=null||e.route.errorElement!=null)||e[0]}function Am(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function jm(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new ap(e||500,o,Error(s),!0)}function Mm(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Bm(r))return{key:n,result:r}}}function Nm(e){return lf({...typeof e==`string`?uf(e):e,hash:``})}function Pm(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Fm(e){return new ap(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Im(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Lm(t))}function Lm(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Rm(e){return Hm(e.result)&&Fp.has(e.result.status)}function zm(e){return e.type===`error`}function Bm(e){return(e&&e.type)===`redirect`}function Vm(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Hm(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Um(e){return Fp.has(e)}function Wm(e){return Hm(e)&&Um(e.status)&&e.headers.has(`Location`)}function Gm(e){return Pp.has(e.toUpperCase())}function Km(e){return Mp.has(e.toUpperCase())}function qm(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Jm(e,t){let n=typeof t==`string`?uf(t).search:t.search;if(e[e.length-1].route.index&&qm(n||``))return e[e.length-1];let r=Yf(e);return r[r.length-1]}function Ym(e,t,n){return{url:sp(e.createURL(t),t),pattern:n?q(n):``,params:n?.[0]?.params?{...n[0].params}:{}}}function Xm(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Zm(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Qm(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function $m(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function eh(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function th(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function nh(e,t){try{let n=e.sessionStorage.getItem(Bp);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function rh(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Bp,JSON.stringify(n))}catch(e){af(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function ih(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var ah=m.createContext(null);ah.displayName=`DataRouter`;var oh=m.createContext(null);oh.displayName=`DataRouterState`;var sh=m.createContext(null);sh.displayName=`DataRouterData`;var ch=m.createContext(null);ch.displayName=`DataRouterNavigation`;var lh=m.createContext(!1);function uh(){return m.useContext(lh)}var dh=m.createContext({isTransitioning:!1});dh.displayName=`ViewTransition`;var fh=m.createContext(null);fh.displayName=`Fetchers`;var ph=m.createContext(null);ph.displayName=`Await`;var mh=m.createContext(null);mh.displayName=`Navigation`;var hh=m.createContext(null);hh.displayName=`Location`;var gh=m.createContext({outlet:null,matches:[],isDataRoute:!1});gh.displayName=`Route`;var _h=m.createContext(!1);_h.displayName=`IsDataRoute`;var vh=m.createContext(void 0);vh.displayName=`RouteId`;var yh=m.createContext(null);yh.displayName=`RouteError`;var bh=`REACT_ROUTER_ERROR`,xh=`REDIRECT`,Sh=`ROUTE_ERROR_RESPONSE`;function Ch(e){if(e.startsWith(`${bh}:${xh}:{`))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 wh(e){if(e.startsWith(`${bh}:${Sh}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new ap(t.status,t.statusText,t.data)}catch{}}function Th(e,{relative:t}={}){W(Eh(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=m.useContext(mh),{hash:i,pathname:a,search:o}=Ph(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:$f([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Eh(){return m.useContext(hh)!=null}function Dh(){return W(Eh(),`useLocation() may be used only in the context of a <Router> component.`),m.useContext(hh).location}var Oh=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function kh(){return m.useContext(_h)?Yh():Ah()}function Ah(){W(Eh(),`useNavigate() may be used only in the context of a <Router> component.`);let e=m.useContext(ah),{basename:t,navigator:n}=m.useContext(mh),{matches:r}=m.useContext(gh),{pathname:i}=Dh(),a=JSON.stringify(Xf(r)),o=m.useRef(!1);return m.useLayoutEffect(()=>{o.current=!0}),m.useCallback((r,s={})=>{if(af(o.current,Oh),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Zf(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:$f([t,c.pathname])),Ap(typeof r==`string`?r:lf(r),n.createHref(c),Dp(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var jh=m.createContext(null);function Mh(e){let t=m.useContext(gh).outlet;return m.useMemo(()=>t&&m.createElement(jh.Provider,{value:e},t),[t,e])}function Nh(){let{matches:e}=m.useContext(gh);return e[e.length-1]?.params??{}}function Ph(e,{relative:t}={}){let{matches:n}=m.useContext(gh),{pathname:r}=Dh(),i=JSON.stringify(Xf(n));return m.useMemo(()=>Zf(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Fh(e,t,n){W(Eh(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=m.useContext(mh),{matches:i}=m.useContext(gh),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let s=a?a.pathnameBase:`/`;a&&a.route;let c=Dh(),l;if(t){let e=typeof t==`string`?uf(t):t;W(s===`/`||e.pathname?.startsWith(s),`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 "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`),l=e}else l=c;let u=l.pathname||`/`,d=u;if(s!==`/`){let e=s.replace(/^\//,``).split(`/`);d=`/`+u.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let f;f=n?n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):n.router.match(n.state.location):xf(e,{pathname:d});let p=Hh(f&&f.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:$f([s,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?s:$f([s,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&p?m.createElement(hh.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...l},navigationType:`POP`}},p):p}function Ih(){let e=Jh(),t=op(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return m.createElement(m.Fragment,null,m.createElement(`h2`,null,`Unexpected Application Error!`),m.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?m.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Lh=m.createElement(Ih,null),Rh=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static contextType=lh;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?t.error:e.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`){let t=wh(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:m.createElement(gh.Provider,{value:this.props.routeContext},m.createElement(_h.Provider,{value:this.props.routeContext.isDataRoute},m.createElement(vh.Provider,{value:this.props.routeContext.matches[this.props.routeContext.matches.length-1]?.route.id},m.createElement(yh.Provider,{value:e,children:this.props.component}))));return this.context?m.createElement(Bh,{error:e},t):t}},zh=new WeakMap;function Bh({children:e,error:t}){let{basename:n,navigator:r}=m.useContext(mh);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ch(t.digest);if(e){let i=zh.get(t);if(i)throw i;let a=lp(e.location,n),o=a.absoluteURL||a.to;if(Ap(e.location,o,Dp(r),`allow-explicit`),bm(o))throw Error(`Invalid redirect location`);if(cp&&!zh.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw zh.set(t,n),n}}return m.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Vh({routeContext:e,match:t,children:n}){let r=m.useContext(ah);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(gh.Provider,{value:e},m.createElement(_h.Provider,{value:e.isDataRoute},m.createElement(vh.Provider,{value:t.route.id},n)))}function Hh(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);W(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:q(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Lh,o&&(s<0&&c===0?(Zh(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?f:d?p:n.route.Component?m.createElement(n.route.Component,null):n.route.element?n.route.element:e,m.createElement(Vh,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?m.createElement(Rh,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Uh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wh(e){let t=m.useContext(ah);return W(t,Uh(e)),t}function Gh(e){let t=m.useContext(oh);return W(t,Uh(e)),t}function Kh(e){let t=m.useContext(sh);return W(t,Uh(e)),t}function qh(e){let t=m.useContext(vh);return W(t,`${e} can only be used on routes that contain a unique "id"`),t}function Jh(){let e=m.useContext(yh),t=Kh(`useRouteError`),n=qh(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Yh(){let{router:e}=Wh(`useNavigate`),t=qh(`useNavigate`),n=m.useRef(!1);return m.useLayoutEffect(()=>{n.current=!0}),m.useCallback(async(r,i={})=>{af(n.current,Oh),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Xh={};function Zh(e,t,n){!t&&!Xh[e]&&(Xh[e]=!0,af(!1,n))}var Qh={};function $h(e,t){!e&&!Qh[t]&&(Qh[t]=!0,console.warn(t))}var eg=[`HydrateFallback`,`hydrateFallbackElement`],tg=class{status=`pending`;promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function ng({router:e,flushSync:t,onError:n,useTransitions:r}){r=uh()||r;let[i,a]=m.useState(e.state),[o,s]=(0,m.useOptimistic)(i),[c,l]=m.useState(),[u,d]=m.useState({isTransitioning:!1}),[f,p]=m.useState(),[h,g]=m.useState(),[_,v]=m.useState(),y=m.useRef(new Map),b=m.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:_})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:q(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&y.current.set(t,e.data)}),o.forEach(e=>y.current.delete(e)),$h(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let b=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if($h(_==null||b,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!b){t&&u?t(()=>a(i)):r===!1?a(i):m.startTransition(()=>{r===!0&&s(e=>rg(e,i)),a(i)});return}if(t&&u){t(()=>{h&&(f?.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),g(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>g(n));return}h?(f?.resolve(),h.skipTransition(),v({state:i,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,h,f,r,s,n]);m.useLayoutEffect(()=>e.subscribe(b),[e,b]),m.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new tg)},[u]),m.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):m.startTransition(()=>{r===!0&&s(e=>rg(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),g(void 0),l(void 0),d({isTransitioning:!1})}),g(i)}},[c,f,e.window,r,s]),m.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,h,o.location,c]),m.useEffect(()=>{!u.isTransitioning&&_&&(l(_.state),d({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),v(void 0))},[u.isTransitioning,_]);let x=m.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=m.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]),w=m.useMemo(()=>({historyAction:o.historyAction,location:o.location,matches:o.matches,initialized:o.initialized,renderFallback:o.renderFallback,restoreScrollPosition:o.restoreScrollPosition,preventScrollReset:o.preventScrollReset,blockers:o.blockers}),[o.historyAction,o.location,o.matches,o.initialized,o.renderFallback,o.restoreScrollPosition,o.preventScrollReset,o.blockers]),T=m.useMemo(()=>({navigation:o.navigation,revalidation:o.revalidation}),[o.navigation,o.revalidation]),E=m.useMemo(()=>({loaderData:o.loaderData,actionData:o.actionData,errors:o.errors}),[o.loaderData,o.actionData,o.errors]),D=m.useMemo(()=>({fetchers:o.fetchers,fetcherData:y.current}),[o.fetchers]);return m.createElement(m.Fragment,null,m.createElement(ah.Provider,{value:C},m.createElement(oh.Provider,{value:w},m.createElement(ch.Provider,{value:T},m.createElement(sh.Provider,{value:E},m.createElement(fh.Provider,{value:D},m.createElement(dh.Provider,{value:u},m.createElement(sg,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,useTransitions:r},m.createElement(ig,{routes:e.routes,manifest:e.manifest,state:o,isStatic:!1,onError:n})))))))),null)}function rg(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var ig=m.memo(ag);function ag({routes:e,manifest:t,state:n,isStatic:r,onError:i}){let a=m.useContext(ah);return W(a,`You must render this element inside a <DataRouterContext.Provider> element`),Fh(e,void 0,{router:a.router,manifest:t,state:n,isStatic:r,onError:i})}function og(e){return Mh(e.context)}function sg({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){W(!Eh(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=m.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=uf(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:h}=n,g=m.useMemo(()=>{let e=Wf(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:h},navigationType:r}},[s,l,u,d,f,p,r,h]);return af(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:m.createElement(mh.Provider,{value:c},m.createElement(hh.Provider,{children:t,value:g}))}m.Component;var cg=`application/x-www-form-urlencoded`;function lg(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ug(e){return lg(e)&&e.tagName.toLowerCase()===`button`}function dg(e){return lg(e)&&e.tagName.toLowerCase()===`form`}function fg(e){return lg(e)&&e.tagName.toLowerCase()===`input`}function pg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mg(e,t){return e.button===0&&(!t||t===`_self`)&&!pg(e)}function hg(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function gg(e,t){let n=hg(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var _g=null;function vg(){if(_g===null)try{new FormData(document.createElement(`form`),0),_g=!1}catch{_g=!0}return _g}var yg=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function bg(e){return e!=null&&!yg.has(e)?(af(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${cg}"`),null):e}function xg(e,t){let n,r,i,a,o;if(dg(e)){let o=e.getAttribute(`action`);r=o?Wf(o,t):null,n=e.getAttribute(`method`)||`get`,i=bg(e.getAttribute(`enctype`))||cg,a=new FormData(e)}else if(ug(e)||fg(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Wf(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=bg(e.getAttribute(`formenctype`))||bg(o.getAttribute(`enctype`))||cg,a=new FormData(o,e),!vg()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(lg(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=cg,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Sg(e,t){if(e===!1||e==null)throw Error(t)}function Cg(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname=n.pathname.endsWith(`/`)?`${n.pathname}_.${t}`:`${n.pathname}.${t}`,n}var wg=l(Yd(),1),Tg=Zd(),Eg=`modulepreload`,Dg=function(e){return`/ui/`+e},Og={},kg=function(e){return e.pathname.endsWith(`.css`)},Ag=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Dg(t,n);let r=s(t);if(r.href in Og)return;Og[r.href]=!0;let i=kg(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:Eg,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function jg(e,t){if(e.id in t)return t[e.id];try{let n=await Ag(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Mg(e){return e!=null&&typeof e.page==`string`}function Ng(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 Pg(e,t,n){return zg((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await jg(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ng).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Fg(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ig(e,t,{includeHydrateFallback:n}={}){return Lg(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Lg(e){return[...new Set(e)]}function Rg(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function zg(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Mg(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Rg(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}var Bg=m.createContext(void 0);Bg.displayName=`FrameworkContext`;function Vg(){let e=m.useContext(Bg);return Sg(e,`You must render this element inside a <HydratedRouter> element`),e}function Hg(e,t){let n=m.useContext(Bg),[r,i]=m.useState(!1),[a,o]=m.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=m.useRef(null);m.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),m.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ug(s,p),onBlur:Ug(c,h),onMouseEnter:Ug(l,p),onMouseLeave:Ug(u,h),onTouchStart:Ug(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ug(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wg({page:e,...t}){let n=uh(),{nonce:r}=Vg(),{router:i}=Wh(`PrefetchPageLinks`),a=m.useMemo(()=>i.match(e),[i,i.routes,e]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?m.createElement(Kg,{page:e,matches:a,...t}):m.createElement(qg,{page:e,matches:a,...t})):null}function Gg(e){let{manifest:t,routeModules:n}=Vg(),[r,i]=m.useState([]);return m.useEffect(()=>{let r=!1;return Pg(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Kg({page:e,matches:t,...n}){let r=Dh(),i=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Cg(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return m.createElement(m.Fragment,null,i.map(e=>m.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function qg({page:e,matches:t,...n}){let r=Dh(),{manifest:i,routeModules:a}=Vg(),{matches:o}=Gh(`PrefetchPageLinks`),{loaderData:s}=Kh(`PrefetchPageLinks`),c=m.useMemo(()=>Fg(e,t,o,i,r,`data`),[e,t,o,i,r]),l=m.useMemo(()=>Fg(e,t,o,i,r,`assets`),[e,t,o,i,r]),u=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,o=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?o=!0:n.add(e.route.id))}),n.size===0)return[];let l=Cg(e,`data`);return o&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[s,r,i,c,t,e,a]),d=m.useMemo(()=>Ig(l,i),[l,i]),f=Gg(l);return m.createElement(m.Fragment,null,u.map(e=>m.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>m.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>m.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Jg(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Yg=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Yg&&(window.__reactRouterVersion=`8`)}catch{}function Xg(e,t){return Wp({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:rf({window:t?.window}),hydrationData:t?.hydrationData||Zg(),routes:e,mapRouteProperties:yf,hydrationRouteProperties:eg,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Zg(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Qg(e.errors)}),e}function Qg(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new ap(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&ip.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var $g=m.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},h){let{basename:g,navigator:_,useTransitions:v}=m.useContext(mh),y=typeof l==`string`&&Qd.test(l),b=lp(l,g);l=b.to;let x=Th(l,{relative:r}),S=Dh(),C=null;if(o){let e=Zf(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:$f([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Hg(n,p),D=n_(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),ee=m.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Jg(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?m.createElement(m.Fragment,null,ee,m.createElement(Wg,{page:x})):ee});$g.displayName=`Link`;var e_=m.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ph(a,{relative:c.relative}),d=Dh(),f=m.useContext(ch),{navigator:p,basename:h}=m.useContext(mh),g=f!=null&&c_(u)&&o===!0,_=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f?.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=Wf(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(b)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return m.createElement($g,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});e_.displayName=`NavLink`;var t_=m.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},h)=>{let{useTransitions:g}=m.useContext(mh),_=o_(),v=s_(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Qd.test(s);return m.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});g&&n!==!1?m.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});t_.displayName=`Form`;function n_(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=kh(),d=Dh(),f=Ph(e,{relative:o});return m.useCallback(p=>{if(mg(p,t)){p.preventDefault();let t=n===void 0?lf(d)===lf(f):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?m.startTransition(()=>h()):h()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function r_(e){af(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(hg(e)),n=m.useRef(!1),r=Dh(),i=m.useMemo(()=>gg(r.search,n.current?null:t.current),[r.search]),a=kh();return[i,m.useCallback((e,t)=>{let r=hg(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var i_=0,a_=()=>`__${String(++i_)}__`;function o_(){let{router:e}=Wh(`useSubmit`),{basename:t}=m.useContext(mh),n=qh(`useSubmit`),r=e.fetch,i=e.navigate;return m.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=xg(e,t);a.navigate===!1?await r(a.fetcherKey||a_(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,relative:a.relative,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function s_(e,{relative:t}={}){let{basename:n}=m.useContext(mh),r=m.useContext(gh);W(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ph(e||`.`,{relative:t})},o=Dh();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:$f([n,a.pathname])),lf(a)}function c_(e,{relative:t}={}){let n=m.useContext(dh);W(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Wh(`useViewTransitionState`),i=Ph(e,{relative:t});if(!n.isTransitioning)return!1;let a=Wf(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Wf(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Bf(i.pathname,o)!=null||Bf(i.pathname,a)!=null}function l_(e){return m.createElement(ng,{flushSync:wg.flushSync,...e})}var u_=class extends Error{status;code;constructor(e,t,n){super(n),this.name=`ApiError`,this.status=e,this.code=t}},d_={getToken:()=>null,onUnauthorized:()=>{},onForbidden:()=>{}};function f_(e){d_=e}async function p_(e,t){let n=new Headers(t?.headers),r=d_.getToken();r&&!n.has(`authorization`)&&n.set(`authorization`,`Bearer ${r}`);let i=e.startsWith(`/`)||/^https?:\/\//i.test(e)?e:`/${e}`,a=await fetch(i,{...t,headers:n});if(!a.ok){if(a.status===401)throw d_.onUnauthorized(),new u_(401,`unauthorized`,`unauthorized`);if(a.status===403&&(a.headers.get(`www-authenticate`)??``).includes(`insufficient_scope`))throw d_.onForbidden(),new u_(403,`insufficient_scope`,`insufficient scope`);let e=`http_${a.status}`,t=a.statusText||`HTTP ${a.status}`;try{let n=await a.json();n?.error&&(typeof n.error.code==`string`&&(e=n.error.code),typeof n.error.message==`string`&&(t=n.error.message))}catch{}throw new u_(a.status,e,t)}return a}async function m_(){let e=await fetch(`/ui/config.json`);if(!e.ok){let t=`http_${e.status}`,n=e.statusText||`HTTP ${e.status}`;try{let r=await e.json();r?.error?.code&&(t=r.error.code),r?.error?.message&&(n=r.error.message)}catch{}throw new u_(e.status,t,n)}return await e.json()}async function h_(){return(await(await p_(`/api/v1/projects`)).json()).projects}async function g_(e){return await(await p_(`/api/v1/projects/${encodeURIComponent(e)}`)).json()}async function __(e,t){let n=t?`?path=${encodeURIComponent(t)}`:``;return(await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/index${n}`)).json()).entries}async function v_(e,t){let n=(t.startsWith(`/`)?t.slice(1):t).split(`/`).map(encodeURIComponent).join(`/`);return await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/concepts/${n}`,{headers:{accept:`application/json`}})).json()}async function y_(e,t){let n=(t.startsWith(`/`)?t.slice(1):t).split(`/`).map(encodeURIComponent).join(`/`),r=await p_(`/api/v1/projects/${encodeURIComponent(e)}/files/${n}`),i=await r.text(),a=r.headers.get(`etag`),o=null;if(a){let e=a.replace(/^W\//,``).replace(/^"|"$/g,``);o=e.length>0?e:null}return{content:i,revision:o}}async function b_(e,t){let n=new URLSearchParams;t?.id&&n.set(`id`,t.id),t?.limit!==void 0&&n.set(`limit`,String(t.limit));let r=n.toString();return(await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/history${r?`?${r}`:``}`)).json()).commits}async function x_(e){return(await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/lint`)).json()).issues}async function S_(e){let t=new URLSearchParams;if(e.q!==void 0&&e.q.trim()!==``&&t.set(`q`,e.q.trim()),e.project&&t.set(`project`,e.project),e.type&&t.set(`type`,e.type),e.tag&&e.tag.length>0)for(let n of e.tag)n&&t.append(`tag`,n);e.status&&t.set(`status`,e.status),e.trustTier&&t.set(`trustTier`,e.trustTier),typeof e.stale==`boolean`&&t.set(`stale`,e.stale?`true`:`false`),typeof e.limit==`number`&&t.set(`limit`,String(e.limit));let n=t.toString();return(await(await p_(`/api/v1/search${n?`?${n}`:``}`)).json()).results}async function C_(){return await(await p_(`/api/v1/sync`)).json()}async function w_(e){let t=await(await p_(`/api/v1/projects/${encodeURIComponent(e)}/archive`)).blob();if(typeof window<`u`&&typeof document<`u`&&typeof URL.createObjectURL==`function`){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`${e}.tar.gz`,r.style.display=`none`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}}var T_=new Ue({defaultOptions:{queries:{staleTime:3e4,retry:(e,t)=>t instanceof u_&&t.status<500?!1:e<2}}}),E_={projects:()=>[`projects`],project:e=>[`project`,e],index:(e,t)=>[`index`,e,t],concept:(e,t)=>[`concept`,e,t],file:(e,t)=>[`file`,e,t],history:(e,t,n)=>[`history`,e,t??null,n],lint:e=>[`lint`,e],search:e=>[`search`,e],sync:()=>[`sync`]};function D_(){return nt({queryKey:E_.projects(),queryFn:h_})}function O_(e){return nt({queryKey:E_.project(e),queryFn:()=>g_(e),enabled:!!e})}function k_(e,t,n=!0){return nt({queryKey:E_.index(e,t),queryFn:()=>__(e,t),enabled:!!e&&n})}function A_(e,t){return nt({queryKey:E_.concept(e,t),queryFn:()=>v_(e,t),enabled:!!(e&&t)})}function j_(e,t){return nt({queryKey:E_.file(e,t),queryFn:()=>y_(e,t),enabled:!!(e&&t)})}function M_(e,t){let n=t?.id??null,r=t?.limit??20;return nt({queryKey:E_.history(e,n,r),queryFn:()=>b_(e,{id:n??void 0,limit:r}),enabled:!!e})}function N_(e){return nt({queryKey:E_.lint(e),queryFn:()=>x_(e),enabled:!!e})}function P_(e,t=!0){return nt({queryKey:E_.search(e),queryFn:()=>S_(e),placeholderData:le,enabled:t})}function F_(){return nt({queryKey:E_.sync(),queryFn:C_,refetchInterval:6e4})}var I_;(typeof navigator>`u`||!navigator.userAgent?.startsWith?.(`Mozilla/5.0 `))&&(I_=`oauth4webapi/v3.8.8`);function L_(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}var R_=`ERR_INVALID_ARG_VALUE`,z_=`ERR_INVALID_ARG_TYPE`;function B_(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}var V_=Symbol(),H_=Symbol(),U_=Symbol(),W_=Symbol(),G_=Symbol(),K_=new TextEncoder,q_=new TextDecoder;function J_(e){return typeof e==`string`?K_.encode(e):q_.decode(e)}var Y_;if(Uint8Array.prototype.toBase64)Y_=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;Y_=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}var X_=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw B_(`The input to be decoded is not correctly encoded.`,R_,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw B_(`The input to be decoded is not correctly encoded.`,R_,e)}};function Z_(e){return typeof e==`string`?X_(e):Y_(e)}var Q_=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=uy,Error.captureStackTrace?.(this,this.constructor)}},$_=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}};function J(e,t,n){return new $_(e,{code:t,cause:n})}function ev(e){return!(typeof e!=`object`||!e||Array.isArray(e))}function tv(e){L_(e,Headers)&&(e=Object.fromEntries(e.entries()));let t=new Headers(e??{});if(I_&&!t.has(`user-agent`)&&t.set(`user-agent`,I_),t.has(`authorization`))throw B_(`"options.headers" must not include the "authorization" header name`,R_);return t}function nv(e,t){if(t!==void 0){if(typeof t==`function`&&(t=t(e.href)),!(t instanceof AbortSignal))throw B_(`"options.signal" must return or be an instance of AbortSignal`,z_);return t}}function rv(e,t,n,r,i){try{if(typeof e!=`number`||!Number.isFinite(e))throw B_(`${n} must be a number`,z_,i);if(e>0)return;if(t){if(e!==0)throw B_(`${n} must be a non-negative number`,R_,i);return}throw B_(`${n} must be a positive number`,R_,i)}catch(e){throw r?J(e.message,r,i):e}}function iv(e,t,n,r){try{if(typeof e!=`string`)throw B_(`${t} must be a string`,z_,r);if(e.length===0)throw B_(`${t} must not be empty`,R_,r)}catch(e){throw n?J(e.message,n,r):e}}async function av(e,t){let n=e;if(!(n instanceof URL)&&n!==My)throw B_(`"expectedIssuerIdentifier" must be an instance of URL`,z_);if(!L_(t,Response))throw B_(`"response" must be an instance of Response`,z_);if(t.status!==200)throw J(`"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)`,my,t);Sy(t);let r=await jy(t);if(iv(r.issuer,`"response" body "issuer" property`,Y,{body:r}),n!==My&&new URL(r.issuer).href!==n.href)throw J(`"response" body "issuer" property does not match the expected value`,yy,{expected:n.href,body:r,attribute:`issuer`});return r}function ov(e){cv(e,`application/json`)}function sv(e,...t){let n=`"response" content-type must be `;if(t.length>2){let e=t.pop();n+=`${t.join(`, `)}, or ${e}`}else t.length===2?n+=`${t[0]} or ${t[1]}`:n+=t[0];return J(n,py,e)}function cv(e,t){if(Pv(e)!==t)throw sv(e,t)}function lv(){return Z_(crypto.getRandomValues(new Uint8Array(32)))}function uv(){return lv()}function dv(){return lv()}async function fv(e){return iv(e,`codeVerifier`),Z_(await crypto.subtle.digest(`SHA-256`,J_(e)))}function pv(e){let t=e?.[H_];return typeof t==`number`&&Number.isFinite(t)?t:0}function mv(e){let t=e?.[U_];return typeof t==`number`&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function hv(){return Math.floor(Date.now()/1e3)}function gv(e){if(typeof e!=`object`||!e)throw B_(`"as" must be an object`,z_);iv(e.issuer,`"as.issuer"`)}function _v(e){if(typeof e!=`object`||!e)throw B_(`"client" must be an object`,z_);iv(e.client_id,`"client.client_id"`)}function vv(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}var yv=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function bv(e,t){if(t&&e.protocol!==`https:`)throw J(`only requests to HTTPS are allowed`,hy,e);if(e.protocol!==`https:`&&e.protocol!==`http:`)throw J(`only HTTP and HTTPS requests are allowed`,gy,e)}function xv(e,t,n,r){let i;if(typeof e!=`string`||!(i=yv(e)))throw J(`authorization server metadata does not contain a valid ${n?`"as.mtls_endpoint_aliases.${t}"`:`"as.${t}"`}`,e===void 0?by:xy,{attribute:n?`mtls_endpoint_aliases.${t}`:t});return bv(i,r),i}function Sv(e,t,n,r){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?xv(e.mtls_endpoint_aliases[t],t,n,r):xv(e[t],t,n,r)}var Cv=class extends Error{cause;code;error;status;error_description;response;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=ly,this.cause=t.cause,this.error=t.cause.error,this.status=t.response.status,this.error_description=t.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:t.response}),Error.captureStackTrace?.(this,this.constructor)}},wv=class extends Error{cause;code;error;error_description;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=dy,this.cause=t.cause,this.error=t.cause.get(`error`),this.error_description=t.cause.get(`error_description`)??void 0,Error.captureStackTrace?.(this,this.constructor)}},Tv=class extends Error{cause;code;response;status;constructor(e,t){super(e,t),this.name=this.constructor.name,this.code=cy,this.cause=t.cause,this.status=t.response.status,this.response=t.response,Object.defineProperty(this,"response",{enumerable:!1}),Error.captureStackTrace?.(this,this.constructor)}},Ev=RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)"),Dv=RegExp(`^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_\`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)`),Ov=RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),kv=RegExp(`^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)`);function Av(e){if(!L_(e,Response))throw B_(`"response" must be an instance of Response`,z_);let t=e.headers.get(`www-authenticate`);if(t===null)return;let n=[],r=t;for(;r;){let e=r.match(Ev),t=e?.[`1`].toLowerCase();if(!t)return;let i=r.substring(e[0].length);if(i&&!i.match(/^[\s,]/))return;let a=i.match(/^\s+(.*)$/),o=!!a;r=a?a[1]:void 0;let s={},c;if(o)for(;r;){let t,n;if(e=r.match(Dv)){[,t,n,r]=e,n.includes(`\\`)&&(n=n.replace(/\\([\s\S])/g,`$1`)),s[t.toLowerCase()]=n;continue}if(e=r.match(Ov)){[,t,n,r]=e,s[t.toLowerCase()]=n;continue}if(e=r.match(kv)){if(Object.keys(s).length)break;[,c,r]=e;break}return}else r=i||void 0;let l={scheme:t,parameters:s};c&&(l.token68=c),n.push(l)}if(n.length)return n}async function jv(e){if(e.status>399&&e.status<500){Sy(e),ov(e);try{let t=await e.clone().json();if(ev(t)&&typeof t.error==`string`&&t.error.length)return t}catch{}}}async function Mv(e,t,n){if(e.status!==t){Vv(e);let t;throw(t=await jv(e))?(await e.body?.cancel(),new Cv(`server responded with an error in the response body`,{cause:t,response:e})):J(`"response" is not a conform ${n} response (unexpected HTTP status code)`,my,e)}}function Nv(e){if(!Wv.has(e))throw B_(`"options.DPoP" is not a valid DPoPHandle`,R_)}function Pv(e){return e.headers.get(`content-type`)?.split(`;`)[0]}async function Fv(e,t,n,r,i,a,o){return await n(e,t,i,a),a.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`),(o?.[W_]||fetch)(r.href,{body:i,headers:Object.fromEntries(a.entries()),method:`POST`,redirect:`manual`,signal:nv(r,o?.signal)})}async function Iv(e,t,n,r,i,a){let o=Sv(e,`token_endpoint`,t.use_mtls_endpoint_aliases,a?.[V_]!==!0);i.set(`grant_type`,r);let s=tv(a?.headers);s.set(`accept`,`application/json`),a?.DPoP!==void 0&&(Nv(a.DPoP),await a.DPoP.addProof(o,s,`POST`));let c=await Fv(e,t,n,o,i,s,a);return a?.DPoP?.cacheNonce(c,o),c}var Lv=new WeakMap,Rv=new WeakMap;function zv(e){if(!e.id_token)return;let t=Lv.get(e);if(!t)throw B_(`"ref" was already garbage collected or did not resolve from the proper sources`,R_);return t}async function Bv(e,t,n,r,i,a){if(gv(e),_v(t),!L_(n,Response))throw B_(`"response" must be an instance of Response`,z_);await Mv(n,200,`Token Endpoint`),Sy(n);let o=await jy(n);if(iv(o.access_token,`"response" body "access_token" property`,Y,{body:o}),iv(o.token_type,`"response" body "token_type" property`,Y,{body:o}),o.token_type=o.token_type.toLowerCase(),o.expires_in!==void 0){let e=typeof o.expires_in==`number`?o.expires_in:parseFloat(o.expires_in);rv(e,!0,`"response" body "expires_in" property`,Y,{body:o}),o.expires_in=e}if(o.refresh_token!==void 0&&iv(o.refresh_token,`"response" body "refresh_token" property`,Y,{body:o}),o.scope!==void 0&&typeof o.scope!=`string`)throw J(`"response" body "scope" property must be a string`,Y,{body:o});if(o.id_token!==void 0){iv(o.id_token,`"response" body "id_token" property`,Y,{body:o});let a=[];t.require_auth_time===!0&&a.push(`auth_time`),t.default_max_age!==void 0&&(rv(t.default_max_age,!0,`"client.default_max_age"`),a.push(`auth_time`)),r?.length&&a.push(...r);let{claims:s,jwt:c}=await Zv(e,t,o.id_token,a,i);ny(t,s),$v(s),Rv.set(n,c),Lv.set(o,s)}if(a?.[o.token_type]!==void 0)a[o.token_type](n,o);else if(o.token_type!==`dpop`&&o.token_type!==`bearer`)throw new Q_("unsupported `token_type` value",{cause:{body:o}});return o}function Vv(e){let t;if(t=Av(e))throw new Tv(`server responded with a challenge in the WWW-Authenticate HTTP Header`,{cause:t,response:e})}function Hv(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw J(`unexpected JWT "aud" (audience) claim value`,vy,{expected:e,claims:t.claims,claim:`aud`})}else if(t.claims.aud!==e)throw J(`unexpected JWT "aud" (audience) claim value`,vy,{expected:e,claims:t.claims,claim:`aud`});return t}function Uv(e,t){let n=e[Ny]?.(t)??e.issuer;if(t.claims.iss!==n)throw J(`unexpected JWT "iss" (issuer) claim value`,vy,{expected:n,claims:t.claims,claim:`iss`});return t}var Wv=new WeakSet;function Gv(e){return Wv.add(e),e}var Kv=Symbol();async function qv(e,t,n,r,i,a,o){if(gv(e),_v(t),!Wv.has(r))throw B_(`"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()`,R_);iv(i,`"redirectUri"`);let s=Ty(r,`code`);if(!s)throw J(`no authorization code in "callbackParameters"`,Y);let c=new URLSearchParams(o?.additionalParameters);return c.set(`redirect_uri`,i),c.set(`code`,s),a!==Kv&&(iv(a,`"codeVerifier"`),c.set(`code_verifier`,a)),Iv(e,t,n,`authorization_code`,c,o)}var Jv={aud:`audience`,c_hash:`code hash`,client_id:`client id`,exp:`expiration time`,iat:`issued at`,iss:`issuer`,jti:`jwt id`,nonce:`nonce`,s_hash:`state hash`,sub:`subject`,ath:`access token hash`,htm:`http method`,htu:`http uri`,cnf:`confirmation`,auth_time:`authentication time`};function Yv(e,t){for(let n of e)if(t.claims[n]===void 0)throw J(`JWT "${n}" (${Jv[n]}) claim missing`,Y,{claims:t.claims});return t}function Xv(e,t){if(typeof t.claims[e]!=`string`)throw J(`unexpected JWT "${e}" (${Jv[e]}) claim type`,Y,{claims:t.claims});return t}function Zv(e,t,n,r,i){return Cy(n,wy.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,`RS256`),pv(t),mv(t),i).then(Yv.bind(void 0,[`aud`,`exp`,`iat`,`iss`,`sub`,...r])).then(Uv.bind(void 0,e)).then(Hv.bind(void 0,t.client_id)).then(Xv.bind(void 0,`sub`))}function Qv(e,t){if(t===iy)return t;let n=t===void 0;return n&&(t=e.default_max_age),t===void 0?iy:(rv(t,!0,n?`"client.default_max_age"`:`"maxAge" argument`),t)}function $v(e){e.auth_time!==void 0&&rv(e.auth_time,!0,`ID Token "auth_time" (authentication time)`,Y,{claims:e})}function ey(e,t,n){if(n===iy)return;let r=hv()+pv(e),i=mv(e);if(t.auth_time+n<r-i)throw J(`too much time has elapsed since the last End-User authentication`,_y,{claims:t,now:r,tolerance:i,claim:`auth_time`})}function ty(e,t){let n=t===ry?void 0:t;if(e.nonce!==n)throw J(`unexpected ID Token "nonce" claim value`,vy,{expected:n,claims:e,claim:`nonce`})}function ny(e,t){if(Array.isArray(t.aud)&&t.aud.length!==1){if(t.azp===void 0)throw J(`ID Token "aud" (audience) claim includes additional untrusted audiences`,vy,{claims:t,claim:`aud`});if(t.azp!==e.client_id)throw J(`unexpected ID Token "azp" (authorized party) claim value`,vy,{expected:e.client_id,claims:t,claim:`azp`})}}var ry=Symbol(),iy=Symbol();async function ay(e,t,n,r){return typeof r?.expectedNonce==`string`||typeof r?.maxAge==`number`||r?.requireIdToken?oy(e,t,n,r.expectedNonce,r.maxAge,r[G_],r.recognizedTokenTypes):sy(e,t,n,r?.maxAge,r?.[G_],r?.recognizedTokenTypes)}async function oy(e,t,n,r,i,a,o){let s=[];switch(r){case void 0:r=ry;break;case ry:break;default:iv(r,`"expectedNonce" argument`),s.push(`nonce`)}i=Qv(t,i),i!==iy&&s.push(`auth_time`);let c=await Bv(e,t,n,s,a,o);iv(c.id_token,`"response" body "id_token" property`,Y,{body:c});let l=zv(c);return ey(t,l,i),ty(l,r),c}async function sy(e,t,n,r,i,a){let o=await Bv(e,t,n,void 0,i,a),s=zv(o);return s&&(ey(t,s,Qv(t,r)),ty(s,ry)),o}var cy=`OAUTH_WWW_AUTHENTICATE_CHALLENGE`,ly=`OAUTH_RESPONSE_BODY_ERROR`,uy=`OAUTH_UNSUPPORTED_OPERATION`,dy=`OAUTH_AUTHORIZATION_RESPONSE_ERROR`,fy=`OAUTH_PARSE_ERROR`,Y=`OAUTH_INVALID_RESPONSE`,py=`OAUTH_RESPONSE_IS_NOT_JSON`,my=`OAUTH_RESPONSE_IS_NOT_CONFORM`,hy=`OAUTH_HTTP_REQUEST_FORBIDDEN`,gy=`OAUTH_REQUEST_PROTOCOL_FORBIDDEN`,_y=`OAUTH_JWT_TIMESTAMP_CHECK_FAILED`,vy=`OAUTH_JWT_CLAIM_COMPARISON_FAILED`,yy=`OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED`,by=`OAUTH_MISSING_SERVER_METADATA`,xy=`OAUTH_INVALID_SERVER_METADATA`;function Sy(e){if(e.bodyUsed)throw B_(`"response" body has been used already`,R_)}async function Cy(e,t,n,r,i){let{0:a,1:o,length:s}=e.split(`.`);if(s===5){if(i!==void 0)e=await i(e),{0:a,1:o,length:s}=e.split(`.`);else throw new Q_(`JWE decryption is not configured`,{cause:e})}if(s!==3)throw J(`Invalid JWT`,Y,e);let c;try{c=JSON.parse(J_(Z_(a)))}catch(e){throw J(`failed to parse JWT Header body as base64url encoded JSON`,fy,e)}if(!ev(c))throw J(`JWT Header must be a top level object`,Y,e);if(t(c),c.crit!==void 0)throw new Q_(`no JWT "crit" header parameter extensions are supported`,{cause:{header:c}});let l;try{l=JSON.parse(J_(Z_(o)))}catch(e){throw J(`failed to parse JWT Payload body as base64url encoded JSON`,fy,e)}if(!ev(l))throw J(`JWT Payload must be a top level object`,Y,e);let u=hv()+n;if(l.exp!==void 0){if(typeof l.exp!=`number`)throw J(`unexpected JWT "exp" (expiration time) claim type`,Y,{claims:l});if(l.exp<=u-r)throw J(`unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp`,_y,{claims:l,now:u,tolerance:r,claim:`exp`})}if(l.iat!==void 0&&typeof l.iat!=`number`)throw J(`unexpected JWT "iat" (issued at) claim type`,Y,{claims:l});if(l.iss!==void 0&&typeof l.iss!=`string`)throw J(`unexpected JWT "iss" (issuer) claim type`,Y,{claims:l});if(l.nbf!==void 0){if(typeof l.nbf!=`number`)throw J(`unexpected JWT "nbf" (not before) claim type`,Y,{claims:l});if(l.nbf>u+r)throw J(`unexpected JWT "nbf" (not before) claim value`,_y,{claims:l,now:u,tolerance:r,claim:`nbf`})}if(l.aud!==void 0&&typeof l.aud!=`string`&&!Array.isArray(l.aud))throw J(`unexpected JWT "aud" (audience) claim type`,Y,{claims:l});return{header:c,claims:l,jwt:e}}function wy(e,t,n,r){if(e!==void 0){if(typeof e==`string`?r.alg!==e:!e.includes(r.alg))throw J(`unexpected JWT "alg" header parameter`,Y,{header:r,expected:e,reason:`client configuration`});return}if(Array.isArray(t)){if(!t.includes(r.alg))throw J(`unexpected JWT "alg" header parameter`,Y,{header:r,expected:t,reason:`authorization server metadata`});return}if(n!==void 0){if(typeof n==`string`?r.alg!==n:typeof n==`function`?!n(r.alg):!n.includes(r.alg))throw J(`unexpected JWT "alg" header parameter`,Y,{header:r,expected:n,reason:`default value`});return}throw J(`missing client or server configuration to verify used JWT "alg" header parameter`,void 0,{client:e,issuer:t,fallback:n})}function Ty(e,t){let{0:n,length:r}=e.getAll(t);if(r>1)throw J(`"${t}" parameter must be provided only once`,Y);return n}var Ey=Symbol(),Dy=Symbol();function Oy(e,t,n,r){if(gv(e),_v(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw B_(`"parameters" must be an instance of URLSearchParams, or URL`,z_);if(Ty(n,`response`))throw J(`"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()`,Y,{parameters:n});let i=Ty(n,`iss`),a=Ty(n,`state`);if(!i&&e.authorization_response_iss_parameter_supported)throw J(`response parameter "iss" (issuer) missing`,Y,{parameters:n});if(i&&i!==e.issuer)throw J(`unexpected "iss" (issuer) response parameter value`,Y,{expected:e.issuer,parameters:n});switch(r){case void 0:case Dy:if(a!==void 0)throw J(`unexpected "state" response parameter encountered`,Y,{expected:void 0,parameters:n});break;case Ey:break;default:if(iv(r,`"expectedState" argument`),a!==r)throw J(a===void 0?`response parameter "state" missing`:`unexpected "state" response parameter value`,Y,{expected:r,parameters:n})}if(Ty(n,`error`))throw new wv(`authorization response from the server is an error`,{cause:n});let o=Ty(n,`id_token`),s=Ty(n,`token`);if(o!==void 0||s!==void 0)throw new Q_(`implicit and hybrid flows are not supported`);return Gv(new URLSearchParams(n))}async function ky(e,t,n){gv(e);let r=Sv(e,`registration_endpoint`,t.use_mtls_endpoint_aliases,n?.[V_]!==!0),i=tv(n?.headers);i.set(`accept`,`application/json`),i.set(`content-type`,`application/json`);let a=`POST`;n?.DPoP&&(Nv(n.DPoP),await n.DPoP.addProof(r,i,a,n.initialAccessToken)),n?.initialAccessToken&&i.set(`authorization`,`${i.has(`dpop`)?`DPoP`:`Bearer`} ${n.initialAccessToken}`);let o=await(n?.[W_]||fetch)(r.href,{body:JSON.stringify(t),headers:Object.fromEntries(i.entries()),method:a,redirect:`manual`,signal:nv(r,n?.signal)});return n?.DPoP?.cacheNonce(o,r),o}async function Ay(e){if(!L_(e,Response))throw B_(`"response" must be an instance of Response`,z_);await Mv(e,201,`Dynamic Client Registration Endpoint`),Sy(e);let t=await jy(e);return iv(t.client_id,`"response" body "client_id" property`,Y,{body:t}),t.client_secret!==void 0&&iv(t.client_secret,`"response" body "client_secret" property`,Y,{body:t}),t.client_secret&&rv(t.client_secret_expires_at,!0,`"response" body "client_secret_expires_at" property`,Y,{body:t}),t}async function jy(e,t=ov){let n;try{n=await e.json()}catch(n){throw t(e),J(`failed to parse "response" body as JSON`,fy,n)}if(!ev(n))throw J(`"response" body must be a top level object`,Y,{body:n});return n}var My=Symbol(),Ny=Symbol();function Py(e){if(typeof e!=`object`||!e||!(`resource`in e)||typeof e.resource!=`string`||!(`authorization_servers`in e)||!Array.isArray(e.authorization_servers)||e.authorization_servers.length===0)throw Error(`invalid protected resource metadata`);let t=e.authorization_servers[0];if(typeof t!=`string`)throw Error(`invalid protected resource metadata`);return{resource:e.resource,primaryServer:t}}async function Fy(e){let t=`${e.replace(/\/+$/,``)}/.well-known/oauth-protected-resource/mcp`,n=await fetch(t);if(!n.ok)throw Error(`invalid protected resource metadata`);let r;try{r=await n.json()}catch{throw Error(`invalid protected resource metadata`)}let{resource:i,primaryServer:a}=Py(r),o=`${e.replace(/\/+$/,``)}/.well-known/oauth-authorization-server`,s=await fetch(o),c=await av(new URL(a),s);return{as:c,resource:i,insecure:new URL(c.token_endpoint??c.issuer).protocol===`http:`}}function Iy(e,t){return t.oauthClientId!==null||typeof e.as.registration_endpoint==`string`}async function Ly(e,t,n,r){if(t.oauthClientId)return t.oauthClientId;let i=`okf.oauth.client:${e.as.issuer}:${n}`,a=r.getItem(i);if(a&&typeof a==`string`&&a.trim().length>0)return a.trim();if(typeof e.as.registration_endpoint!=`string`)throw Error(`sign-in is not configured`);let o=await Ay(await ky(e.as,{client_name:`ok-fine web`,redirect_uris:[n],grant_types:[`authorization_code`],response_types:[`code`],token_endpoint_auth_method:`none`,scope:t.scope},{[V_]:e.insecure}));return r.setItem(i,o.client_id),o.client_id}function Ry(e,t,n){let r=`okf.oauth.client:${e.as.issuer}:${t}`;n.removeItem(r)}async function zy(e,t,n,r,i){let a=uv(),o=await fv(a),s=dv();if(!e.as.authorization_endpoint)throw Error(`missing authorization endpoint in authorization server metadata`);let c=new URL(e.as.authorization_endpoint);return c.searchParams.set(`client_id`,t),c.searchParams.set(`redirect_uri`,n),c.searchParams.set(`response_type`,`code`),c.searchParams.set(`scope`,r),c.searchParams.set(`code_challenge`,o),c.searchParams.set(`code_challenge_method`,`S256`),c.searchParams.set(`state`,s),c.searchParams.set(`resource`,e.resource),{url:c,pending:{state:s,codeVerifier:a,clientId:t,redirectUri:n,returnTo:i}}}async function By(e,t,n){let r={client_id:t.clientId},i=Oy(e.as,r,n,t.state),a=await qv(e.as,r,vv(),i,t.redirectUri,t.codeVerifier,{additionalParameters:{resource:e.resource},[V_]:e.insecure}),o=await ay(e.as,r,a);return{accessToken:o.access_token,expiresAt:o.expires_in?Date.now()+o.expires_in*1e3:null}}function Vy(e,t=Date.now()){return e.accessToken.length>0&&(e.expiresAt===null||e.expiresAt-3e4>t)}function Hy(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return!0}return!1}function Uy(e){try{let t=e.split(`.`)[1];if(!t)return null;let n=t.replace(/-/g,`+`).replace(/_/g,`/`);for(;n.length%4!=0;)n+=`=`;let r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0)),a=new TextDecoder().decode(i),o=JSON.parse(a);if(typeof o!=`object`||!o)return null;let s=e=>{if(typeof e!=`string`)return null;let t=e.trim();return t.length>0&&!Hy(t)?t:null};if(`email`in o){let e=s(o.email);if(e)return e}if(`preferred_username`in o){let e=s(o.preferred_username);if(e)return e}if(`name`in o){let e=s(o.name);if(e)return e}if(`sub`in o){let e=s(o.sub);if(e)return e}return null}catch{return null}}function Wy(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return!0}return!1}function Gy(e,t){if(typeof e!=`string`||Wy(e))return`/`;let n=e.trim();if(n.length===0||n.startsWith(`//`)||n.includes(`\\`))return`/`;if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(n)){if(!/^https?:\/\//i.test(n))return`/`;let e=t??(typeof window<`u`?window.location.origin:void 0);if(!e)return`/`;try{let t=new URL(n);return t.origin===e?Gy(`${t.pathname}${t.search}${t.hash}`,e):`/`}catch{return`/`}}let r=n.split(/[?#]/,1)[0]??``;if(/%(?:2f|5c)/i.test(r))return`/`;let i=r;for(let e=0;e<3;e++)try{let e=decodeURIComponent(i);if(e===i)break;if(i=e,i.includes(`\\`)||i.includes(`//`)||/%(?:2f|5c)/i.test(i))return`/`}catch{return`/`}let a;try{if(a=new URL(n,`http://okf.internal`),a.origin!==`http://okf.internal`)return`/`}catch{return`/`}let o=a.pathname;if(o===`/ui`||o===`/ui/`)o=`/`;else if(o.startsWith(`/ui/`))o=o.slice(3);else if(/^\/(?:api|healthz|mcp|\.well-known)(?:\/|$)/.test(o))return`/`;return o.startsWith(`//`)||o===`/callback`||o.startsWith(`/callback/`)?`/`:`${o}${a.search}${a.hash}`}function Ky(){if(typeof window>`u`)return`/`;try{let e=new URLSearchParams(window.location.search).get(`returnTo`);if(e){let t=Gy(e,window.location.origin);if(t!==`/`)return t}}catch{}return Gy(`${window.location.pathname}${window.location.search}${window.location.hash}`,window.location.origin)}var qy=(0,m.createContext)(null);function Jy({children:e}){let t=_(),[n,r]=(0,m.useState)({status:`loading`}),i=(0,m.useRef)(n);i.current=n;let a=(0,m.useRef)(new Map);(0,m.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await m_();if(!e)return;if(t.authMode===`none`){r({status:`open`,config:t});return}let n=await Fy(window.location.origin);if(!e)return;if(!Iy(n,t)){r({status:`unconfigured`,config:t,discovery:n,redirectUri:`${window.location.origin}/ui/callback`});return}let i=window.sessionStorage.getItem(`okf.oauth.token`);if(i){try{let e=JSON.parse(i);if(typeof e==`object`&&e&&`accessToken`in e&&typeof e.accessToken==`string`){let i=`expiresAt`in e&&typeof e.expiresAt==`number`?e.expiresAt:null,a={accessToken:e.accessToken,expiresAt:i};if(Vy(a)){let e=Uy(a.accessToken);r({status:`signed-in`,config:t,discovery:n,token:a,identity:e});return}}}catch{}window.sessionStorage.removeItem(`okf.oauth.token`),window.sessionStorage.removeItem(`okf.oauth.pending`)}r({status:`signed-out`,config:t,discovery:n,reason:`initial`})}catch(t){if(!e)return;let n=t instanceof Error?t.message:`Failed to initialize authentication`;r({status:`error`,message:n})}})(),()=>{e=!1}},[]),(0,m.useEffect)(()=>{f_({getToken:()=>{let e=i.current;return e.status===`signed-in`&&Vy(e.token)?e.token.accessToken:null},onUnauthorized:()=>{window.sessionStorage.removeItem(`okf.oauth.token`),window.sessionStorage.removeItem(`okf.oauth.pending`),t.clear();let e=i.current;`config`in e&&`discovery`in e&&r({status:`signed-out`,config:e.config,discovery:e.discovery,reason:`expired`})},onForbidden:()=>{let e=i.current;`config`in e&&`discovery`in e&&r({status:`forbidden`,config:e.config,discovery:e.discovery,scope:e.config.scope})}})},[t]),(0,m.useEffect)(()=>{if(n.status!==`signed-in`||n.token.expiresAt===null)return;let e=n.token.expiresAt-3e4-Date.now();if(e<=0){window.sessionStorage.removeItem(`okf.oauth.token`),window.sessionStorage.removeItem(`okf.oauth.pending`),t.clear(),r({status:`signed-out`,config:n.config,discovery:n.discovery,reason:`expired`});return}let i=setTimeout(()=>{window.sessionStorage.removeItem(`okf.oauth.token`),window.sessionStorage.removeItem(`okf.oauth.pending`),t.clear(),r({status:`signed-out`,config:n.config,discovery:n.discovery,reason:`expired`})},e);return()=>{clearTimeout(i)}},[n,t]);let o={state:n,login:(0,m.useCallback)(async e=>{let t,n,r=i.current;`config`in r&&`discovery`in r?(t=r.config,n=r.discovery):(t=await m_(),n=await Fy(window.location.origin));let a=`${window.location.origin}/ui/callback`,o=await Ly(n,t,a,window.localStorage),s=Gy(e,window.location.origin),{url:c,pending:l}=await zy(n,o,a,t.scope,s);window.sessionStorage.setItem(`okf.oauth.pending`,JSON.stringify(l)),window.location.assign(c.href)},[]),completeLogin:(0,m.useCallback)(async e=>{let t=a.current.get(e.href);if(t)return t;let n=(async()=>{let t,n,a=i.current;`config`in a&&`discovery`in a?(t=a.config,n=a.discovery):(t=await m_(),n=await Fy(window.location.origin));let o=window.sessionStorage.getItem(`okf.oauth.pending`);if(window.sessionStorage.removeItem(`okf.oauth.pending`),!o)throw Error(`Sign-in session expired; try again`);let s;try{let e=JSON.parse(o);if(typeof e!=`object`||!e||!(`state`in e)||!(`codeVerifier`in e)||!(`clientId`in e)||!(`redirectUri`in e)||!(`returnTo`in e)||typeof e.state!=`string`||typeof e.codeVerifier!=`string`||typeof e.clientId!=`string`||typeof e.redirectUri!=`string`||typeof e.returnTo!=`string`)throw Error(`Invalid pending login session`);s={state:e.state,codeVerifier:e.codeVerifier,clientId:e.clientId,redirectUri:e.redirectUri,returnTo:e.returnTo}}catch(e){throw Error(`Sign-in session expired; try again`,{cause:e})}try{let i=await By(n,s,e);window.sessionStorage.setItem(`okf.oauth.token`,JSON.stringify(i));let a=Uy(i.accessToken);return r({status:`signed-in`,config:t,discovery:n,token:i,identity:a}),Gy(s.returnTo,window.location.origin)}catch(e){if(e instanceof wv||e instanceof Cv){(e.error===`invalid_client`||e.error===`unauthorized_client`)&&Ry(n,s.redirectUri,window.localStorage);let i=e.error_description?`${e.error}: ${e.error_description}`:e.error;r({status:`signed-out`,config:t,discovery:n,reason:`signed-out`,error:i})}throw e}})();return a.current.set(e.href,n),n},[]),logout:(0,m.useCallback)(()=>{window.sessionStorage.removeItem(`okf.oauth.token`),window.sessionStorage.removeItem(`okf.oauth.pending`),t.clear();let e=i.current;`config`in e&&`discovery`in e&&r({status:`signed-out`,config:e.config,discovery:e.discovery,reason:`signed-out`})},[t])};return(0,h.jsx)(qy.Provider,{value:o,children:e})}function Yy(){let e=(0,m.useContext)(qy);if(!e)throw Error(`useAuth must be used within an AuthProvider`);return e}var Xy=`okf.theme`,Zy=new Set;function Qy(){for(let e of Zy)e()}function $y(e){return Zy.add(e),()=>{Zy.delete(e)}}function eb(e){if(typeof document>`u`)return;let t=typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches,n=e===`dark`||e===`system`&&!!t;document.documentElement.classList.toggle(`dark`,n),document.documentElement.style.colorScheme=n?`dark`:`light`}function tb(){try{if(typeof localStorage<`u`){let e=localStorage.getItem(Xy);if(e===`light`||e===`dark`||e===`system`)return e}}catch{}return`system`}function nb(e){try{typeof localStorage<`u`&&localStorage.setItem(Xy,e)}catch{}eb(e),Qy()}var rb=!1;function ib(){rb||(rb=!0,eb(tb()),typeof window<`u`&&window.matchMedia&&(window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{tb()===`system`&&(eb(`system`),Qy())}),window.addEventListener(`storage`,e=>{e.key===Xy&&(eb(tb()),Qy())})))}function ab(){return[(0,m.useSyncExternalStore)($y,tb,()=>`system`),nb]}function ob(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ob(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function X(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ob(e))&&(r&&(r+=` `),r+=t);return r}var sb=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function cb(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:sb(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var lb=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},ub=e=>{let t=lb(e);return t.charAt(0).toUpperCase()+t.slice(1)},db=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),fb={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function pb(e){return e!=null}function mb(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??fb.width,a=e.size??e.height??fb.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?db(...c):db(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??fb[`stroke-width`])*Number(e.size??e.width??fb.width)/Number(t.size??t.width??fb.width):t.strokeWidth??fb[`stroke-width`];return[`svg`,{...Object.entries(fb).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&pb(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&pb(t.width)&&{[r(`width`)]:t.width},...`height`in t&&pb(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function hb(e,t={}){return mb(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var gb=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},_b=(0,m.createContext)({}),vb=()=>(0,m.useContext)(_b),yb=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=vb()??{},b=!!c||gb(d),[x,S,C=[]]=hb(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:db(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function Z(e,t=[],n=[]){let r=typeof e==`string`?cb(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(yb,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=ub(r.name)),i}var bb={name:`badge-check`,size:24,node:[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`verified`]};bb.node;var xb=Z(bb),Sb={name:`book-a`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`m8 13 4-7 4 7`,key:`4rari8`}],[`path`,{d:`M9.1 11h5.7`,key:`1gkovt`}]]};Sb.node;var Cb=Z(Sb),wb={name:`book-open-check`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`m16 12 2 2 4-4`,key:`mdajum`}],[`path`,{d:`M22 6V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2h4.001A2 2 0 0022 17v-1.344`,key:`144kbk`}]]};wb.node;var Tb=Z(wb),Eb={name:`bookmark`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};Eb.node;var Db=Z(Eb),Ob={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Ob.node;var kb=Z(Ob),Ab={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Ab.node;var jb=Z(Ab),Mb={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Mb.node;var Nb=Z(Mb),Pb={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Pb.node;var Fb=Z(Pb),Ib={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Ib.node;var Lb=Z(Ib),Rb={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Rb.node;var zb=Z(Rb),Bb={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};Bb.node;var Vb=Z(Bb),Hb={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Hb.node;var Ub=Z(Hb),Wb={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Wb.node;var Gb=Z(Wb),Kb={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};Kb.node;var qb=Z(Kb),Jb={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};Jb.node;var Yb=Z(Jb),Xb={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Xb.node;var Zb=Z(Xb),Qb={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Qb.node;var $b=Z(Qb),ex={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};ex.node;var tx=Z(ex),nx={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};nx.node;var rx=Z(nx),ix={name:`file-question-mark`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]],aliases:[`file-question`]};ix.node;var ax=Z(ix),ox={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};ox.node;var sx=Z(ox),cx={name:`folder-kanban`,size:24,node:[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]};cx.node;var lx=Z(cx),ux={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};ux.node;var dx=Z(ux),fx={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};fx.node;var px=Z(fx),mx={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};mx.node;var hx=Z(mx),gx={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};gx.node;var _x=Z(gx),vx={name:`heart-pulse`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}],[`path`,{d:`M3.22 13H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27`,key:`auskq0`}]]};vx.node;var yx=Z(vx),bx={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};bx.node;var xx=Z(bx),Sx={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Sx.node;var Cx=Z(Sx),wx={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};wx.node;var Tx=Z(wx),Ex={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Ex.node;var Dx=Z(Ex),Ox={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Ox.node;var kx=Z(Ox),Ax={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Ax.node;var jx=Z(Ax),Mx={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Mx.node;var Nx=Z(Mx),Px={name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]};Px.node;var Fx=Z(Px),Ix={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};Ix.node;var Lx=Z(Ix),Rx={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Rx.node;var zx=Z(Rx),Bx={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};Bx.node;var Vx=Z(Bx),Hx={name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]};Hx.node;var Ux=Z(Hx),Wx={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Wx.node;var Gx=Z(Wx),Kx={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Kx.node;var qx=Z(Kx),Jx={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Jx.node;var Yx=Z(Jx),Xx={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Xx.node;var Zx=Z(Xx),Qx={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};Qx.node;var $x=Z(Qx),eS={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};eS.node;var tS=Z(eS),nS={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};nS.node;var rS=Z(nS),iS={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};iS.node;var aS=Z(iS);function oS({icon:e,title:t,hint:n,action:r,className:i}){return(0,h.jsxs)(`div`,{className:X(`flex flex-col items-center justify-center p-8 text-center rounded-2xl border border-border bg-surface/50`,i),children:[e&&(0,h.jsx)(`div`,{className:`mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-surface-2 ring-1 ring-border text-muted`,children:(0,h.jsx)(e,{size:24})}),(0,h.jsx)(`h3`,{className:`text-base font-medium text-fg`,children:t}),n&&(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted max-w-sm`,children:n}),r&&(0,h.jsx)(`div`,{className:`mt-4`,children:r})]})}function sS({error:e,onRetry:t,fullScreen:n=!1,className:r}){let i=e instanceof u_&&(e.code===`project_not_found`||e.code===`not_found`),a=e instanceof Error?e.message:typeof e==`string`?e:`An unexpected error occurred.`,o=i?(0,h.jsx)(oS,{icon:ax,title:`Not found`,hint:`The requested project, concept, or file could not be found.`,action:(0,h.jsx)($g,{to:`/`,className:`inline-flex items-center justify-center rounded-lg bg-accent-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-600 focus-visible:outline-2 outline-accent-500`,children:`Back to all projects`})}):(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-8 text-center rounded-2xl border border-rose-500/20 bg-rose-500/5 max-w-lg mx-auto`,children:[(0,h.jsx)(`div`,{className:`mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-1 ring-rose-500/20`,children:(0,h.jsx)(Vb,{size:24})}),(0,h.jsx)(`h3`,{className:`text-base font-medium text-fg`,children:`Something went wrong`}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted break-words max-w-sm`,children:a}),t&&(0,h.jsx)(`button`,{type:`button`,onClick:t,className:`mt-4 inline-flex items-center justify-center rounded-lg border border-border bg-surface px-4 py-2 text-sm font-medium text-fg transition-colors hover:bg-surface-2 focus-visible:outline-2 outline-accent-500`,children:`Retry`})]});return n?(0,h.jsx)(`div`,{className:X(`flex min-h-[60vh] items-center justify-center p-6`,r),children:(0,h.jsx)(`div`,{className:`w-full max-w-md`,children:o})}):(0,h.jsx)(`div`,{className:r,children:o})}function cS({size:e=24,className:t}){let n=(0,m.useId)();return(0,h.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,className:X(`shrink-0`,t),"aria-hidden":`true`,children:[(0,h.jsx)(`defs`,{children:(0,h.jsxs)(`linearGradient`,{id:n,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,h.jsx)(`stop`,{offset:`0`,stopColor:`#8b5cf6`}),(0,h.jsx)(`stop`,{offset:`1`,stopColor:`#22d3ee`})]})}),(0,h.jsx)(`rect`,{width:`24`,height:`24`,rx:`7`,fill:`url(#${n})`}),(0,h.jsx)(`path`,{d:`M7 12.5l3.2 3.2L17 8.8`,fill:`none`,stroke:`#ffffff`,strokeWidth:`2.25`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function lS({className:e,size:t=24}){return(0,h.jsxs)(`div`,{className:X(`inline-flex items-center gap-2 font-semibold tracking-tight text-fg`,e),children:[(0,h.jsx)(cS,{size:t}),(0,h.jsx)(`span`,{children:`ok-fine`})]})}function uS({title:e,className:t,children:n}){return(0,m.useEffect)(()=>{document.title=`${e} · ok-fine`},[e]),(0,h.jsx)(Gd.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:`easeOut`},className:t,children:n})}function dS(){let{state:e,logout:t}=Yy(),n=e.status===`forbidden`?e.scope:`config`in e?e.config.scope:`okf:read`;return(0,h.jsx)(uS,{title:`Forbidden`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-border-strong bg-surface p-8 shadow-[0_30px_80px_-20px_rgb(139_92_246/0.35)] ring-1 ring-border-strong text-center flex flex-col items-center`,children:[(0,h.jsx)(cS,{size:44,className:`mb-3`}),(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`ok-fine`}),(0,h.jsx)(`h2`,{className:`mt-2 text-base font-medium text-fg`,children:`Access denied`}),(0,h.jsxs)(`p`,{className:`mt-3 text-sm text-muted`,children:[`Your account can't read this knowledge base (needs`,` `,(0,h.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs text-fg`,children:n}),`).`]}),(0,h.jsx)(`button`,{type:`button`,onClick:t,className:`mt-6 w-full rounded-xl border border-border bg-surface px-4 py-2.5 text-sm font-medium text-fg transition hover:bg-surface-2 focus-visible:outline-2 outline-accent-500 cursor-pointer`,children:`Sign out`}),(0,h.jsx)(`p`,{className:`mt-4 text-xs text-subtle`,children:`Sign in with an account that has read permissions.`})]})})}function fS({value:e,label:t,className:n}){let[r,i]=(0,m.useState)(!1),a=(0,m.useRef)(void 0);return(0,m.useEffect)(()=>()=>{clearTimeout(a.current)},[]),(0,h.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),i(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>i(!1),1500)}catch{}},"aria-label":r?`Copied`:t??`Copy to clipboard`,title:r?`Copied`:t??`Copy`,className:X(`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface/80 px-2 py-1 text-xs font-medium text-muted backdrop-blur-xs transition-colors hover:bg-surface-2 hover:text-fg focus-visible:outline-2 outline-accent-500`,n),children:[r?(0,h.jsx)(Nb,{size:14,className:`text-emerald-500 shrink-0`}):(0,h.jsx)(Zb,{size:14,className:`shrink-0 text-muted`}),t&&(0,h.jsx)(`span`,{children:r?`Copied`:t})]})}function pS(){let{state:e}=Yy(),t=typeof window<`u`?window.location.origin:``,n=e.status===`unconfigured`?e.redirectUri:`${t}/ui/callback`,r=`config`in e?e.config.scope:`okf:read`,i=`discovery`in e?e.discovery.resource:`${t}/mcp`;return(0,h.jsx)(uS,{title:`Sign-in not configured`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-lg rounded-2xl border border-border-strong bg-surface p-8 shadow-[0_30px_80px_-20px_rgb(139_92_246/0.35)] ring-1 ring-border-strong flex flex-col items-center`,children:[(0,h.jsx)(cS,{size:44,className:`mb-3`}),(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`ok-fine`}),(0,h.jsx)(`h2`,{className:`mt-2 text-base font-medium text-fg`,children:`Sign-in isn't configured`}),(0,h.jsxs)(`p`,{className:`mt-2 text-sm text-muted text-center`,children:[`The web UI needs a public OAuth 2.0 client. Set`,` `,(0,h.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs text-fg`,children:`OAUTH_UI_CLIENT_ID`}),` (Helm`,` `,(0,h.jsx)(`code`,{className:`rounded bg-surface-2 px-1.5 py-0.5 font-mono text-xs text-fg`,children:`oauth.uiClientId`}),`) with these parameters:`]}),(0,h.jsxs)(`div`,{className:`mt-6 w-full space-y-3 text-left`,children:[(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Redirect URI`}),(0,h.jsx)(fS,{value:n})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:n})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Web origin`}),(0,h.jsx)(fS,{value:t})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:t})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Scope`}),(0,h.jsx)(fS,{value:r})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:r})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface-2 p-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium text-muted`,children:`Resource`}),(0,h.jsx)(fS,{value:i})]}),(0,h.jsx)(`div`,{className:`mt-1 font-mono text-xs text-fg break-all`,children:i})]})]}),(0,h.jsx)(`p`,{className:`mt-6 text-xs text-subtle text-center`,children:`Alternatively, your identity provider must advertise dynamic client registration.`})]})})}function mS({error:e}){let{state:t,login:n}=Yy(),[r,i]=(0,m.useState)(!1),a=`identity provider`;if(t.status===`signed-out`)try{a=new URL(t.discovery.as.issuer).host}catch{a=t.discovery.as.issuer}let o=e??(t.status===`signed-out`?t.error:void 0);return(0,h.jsx)(uS,{title:`Sign in`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-border-strong bg-surface p-8 shadow-[0_30px_80px_-20px_rgb(139_92_246/0.35)] ring-1 ring-border-strong text-center flex flex-col items-center`,children:[(0,h.jsx)(cS,{size:44,className:`mb-3`}),(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`ok-fine`}),(0,h.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:`Shared knowledge for your agents and your team.`}),o?(0,h.jsx)(`div`,{className:`mt-6 w-full rounded-xl border border-rose-500/20 bg-rose-500/10 px-4 py-3 text-left text-sm text-rose-600 dark:text-rose-400 break-words`,children:o}):t.status===`signed-out`&&t.reason===`expired`?(0,h.jsx)(`div`,{className:`mt-6 w-full rounded-xl border border-amber-500/20 bg-amber-500/10 px-4 py-3 text-sm text-amber-600 dark:text-amber-400`,children:`Your session expired.`}):t.status===`signed-out`&&t.reason===`signed-out`?(0,h.jsx)(`div`,{className:`mt-6 w-full rounded-xl border border-border bg-surface-2 px-4 py-3 text-sm text-muted`,children:`You've signed out.`}):null,(0,h.jsx)(`button`,{type:`button`,onClick:async()=>{try{i(!0),await n(Ky())}catch{i(!1)}},disabled:r,className:`mt-6 w-full rounded-xl bg-gradient-to-r from-accent-500 to-accent-600 px-4 py-3 text-sm font-medium text-white shadow-sm transition hover:from-accent-600 hover:to-accent-700 focus-visible:outline-2 outline-accent-500 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,children:r?`Redirecting…`:`Continue with ${a}`}),(0,h.jsx)(`p`,{className:`mt-4 text-xs text-subtle`,children:`Read-only view · signs in through your organization's identity provider`})]})})}function hS(){let{state:e}=Yy();return e.status===`loading`?(0,h.jsx)(`div`,{className:`fixed inset-0 flex items-center justify-center bg-bg`,children:(0,h.jsx)(Gd.div,{animate:{opacity:[.3,1,.3]},transition:{duration:1.2,repeat:1/0,ease:`easeInOut`},children:(0,h.jsx)(cS,{size:48})})}):e.status===`open`||e.status===`signed-in`?(0,h.jsx)(og,{}):e.status===`signed-out`?(0,h.jsx)(mS,{error:e.error}):e.status===`unconfigured`?(0,h.jsx)(pS,{}):e.status===`forbidden`?(0,h.jsx)(dS,{}):e.status===`error`?(0,h.jsx)(`div`,{className:`fixed inset-0 flex items-center justify-center bg-bg p-6`,children:(0,h.jsx)(sS,{error:e.message,onRetry:()=>window.location.reload(),fullScreen:!0})}):null}var gS=1,_S=.9,vS=.8,yS=.17,bS=.1,xS=.999,SS=.9999,CS=.99,wS=/[\\\/_+.#"@\[\(\{&]/,TS=/[\\\/_+.#"@\[\(\{&]/g,ES=/[\s-]/,DS=/[\s-]/g;function OS(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?gS:CS;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=OS(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=gS:wS.test(e.charAt(l-1))?(d*=vS,p=e.slice(i,l-1).match(TS),p&&i>0&&(d*=xS**+p.length)):ES.test(e.charAt(l-1))?(d*=_S,m=e.slice(i,l-1).match(DS),m&&i>0&&(d*=xS**+m.length)):(d*=yS,i>0&&(d*=xS**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=SS)),(d<bS&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=OS(e,t,n,r,l+1,a+2,o),f*bS>d&&(d=f*bS)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function kS(e){return e.toLowerCase().replace(DS,` `)}function AS(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,OS(e,t,kS(e),kS(t),0,0,{})}var jS=Object.defineProperty,MS=(e,t)=>jS(e,`name`,{value:t,configurable:!0}),NS=!!(typeof window<`u`&&window.document&&window.document.createElement);function PS(e,t,{checkForDefaultPrevented:n=!0}={}){return MS(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}MS(PS,`composeEventHandlers`);function FS(e){if(!NS)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}MS(FS,`getOwnerWindow`);function IS(e){if(!NS)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}MS(IS,`getOwnerDocument`);function LS(e,t=!1){let{activeElement:n}=IS(e);if(!n?.nodeName)return null;if(RS(n)&&n.contentDocument)return LS(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=IS(n).getElementById(e);if(t)return t}}return n}MS(LS,`getActiveElement`);function RS(e){return e.tagName===`IFRAME`}MS(RS,`isFrame`);var zS=Object.defineProperty,BS=(e,t)=>zS(e,`name`,{value:t,configurable:!0});function VS(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}BS(VS,`setRef`);function HS(...e){return t=>{let n=!1,r=e.map(e=>{let r=VS(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():VS(e[t],null)}}}}BS(HS,`composeRefs`);function US(...e){return m.useCallback(HS(...e),e)}BS(US,`useComposedRefs`);var WS=Object.defineProperty,GS=(e,t)=>WS(e,`name`,{value:t,configurable:!0});function KS(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=GS(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,h.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return GS(i,`useContext`),[r,i]}GS(KS,`createContext`);function qS(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=GS(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,h.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return GS(s,`useContext`),[o,s]}GS(r,`createContext`);let i=GS(()=>{let t=n.map(e=>m.createContext(e));return GS(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,JS(i,...t)]}GS(qS,`createContextScope`);function JS(...e){let t=e[0];if(e.length===1)return t;let n=GS(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return GS(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}GS(JS,`composeContextScopes`);var YS=globalThis?.document?m.useLayoutEffect:()=>{},XS=Object.defineProperty,ZS=(e,t)=>XS(e,`name`,{value:t,configurable:!0}),QS=m.useId||(()=>void 0),$S=0;function eC(e){let[t,n]=m.useState(QS());return YS(()=>{e||n(e=>e??String($S++))},[e]),e||(t?`radix-${t}`:``)}ZS(eC,`useId`);var tC=Object.defineProperty,nC=(e,t)=>tC(e,`name`,{value:t,configurable:!0}),rC=m.useEffectEvent,iC=m.useInsertionEffect;function aC(e){if(typeof rC==`function`)return rC(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof iC==`function`?iC(()=>{t.current=e}):YS(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}nC(aC,`useEffectEvent`);var oC=Object.defineProperty,sC=(e,t)=>oC(e,`name`,{value:t,configurable:!0}),cC=m.useInsertionEffect||YS;function lC({prop:e,defaultProp:t,onChange:n=sC(()=>{},`onChange`),caller:r}){let[i,a,o]=uC({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=dC(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}sC(lC,`useControllableState`);function uC({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return cC(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}sC(uC,`useUncontrolledState`);function dC(e){return typeof e==`function`}sC(dC,`isFunction`);var fC=Symbol(`RADIX:SYNC_STATE`);function pC(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=aC(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===fC)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:fC,state:i})},[i,d.state,c]),[g,f]}sC(pC,`useControllableStateReducer`);var mC=Object.defineProperty,hC=(e,t)=>mC(e,`name`,{value:t,configurable:!0});function gC(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];wC(r)&&typeof OC==`function`&&(r=OC(r._payload)),m.Children.forEach(r,e=>{if(SC(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;wC(n)&&typeof OC==`function`&&(n=OC(n._payload)),a=yC(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?xC(a):void 0,l=US(n,c);if(!a){if(r||r===0)throw Error(o?DC(e):EC(e));return r}let u=bC(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}hC(gC,`createSlot`);var _C=Symbol.for(`radix.slottable`);function vC(e){let t=hC(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=_C,t}hC(vC,`createSlottable`);var yC=hC((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function bC(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}hC(bC,`mergeProps`);function xC(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}hC(xC,`getElementRef`);function SC(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_C}hC(SC,`isSlottable`);var CC=Symbol.for(`react.lazy`);function wC(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===CC&&`_payload`in e&&TC(e._payload)}hC(wC,`isLazyComponent`);function TC(e){return typeof e==`object`&&!!e&&`then`in e}hC(TC,`isPromiseLike`);var EC=hC(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),DC=hC(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),OC=m.use,kC=Object.defineProperty,AC=(e,t)=>kC(e,`name`,{value:t,configurable:!0}),jC=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=gC(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,h.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function MC(e,t){e&&wg.flushSync(()=>e.dispatchEvent(t))}AC(MC,`dispatchDiscreteCustomEvent`);var NC=Object.defineProperty,PC=(e,t)=>NC(e,`name`,{value:t,configurable:!0});function FC(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}PC(FC,`useCallbackRef`);var IC=Object.defineProperty,LC=(e,t)=>IC(e,`name`,{value:t,configurable:!0}),RC=`dismissableLayer.update`,zC=`dismissableLayer.pointerDownOutside`,BC=`dismissableLayer.focusOutside`,VC,HC=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),UC=m.forwardRef(LC(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(HC),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,g]=m.useState({}),_=US(t,f),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=m.useRef(!1),T=KC(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=qC(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),D=d?x===v.length-1:!1,O=FC(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(D)return p.addEventListener(`keydown`,O,{capture:!0}),()=>p.removeEventListener(`keydown`,O,{capture:!0})},[p,D,O]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(VC=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),JC(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=VC))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),JC())},[d,u]),m.useEffect(()=>{let e=LC(()=>g({}),`handleUpdate`);return document.addEventListener(RC,e),()=>document.removeEventListener(RC,e)},[]),(0,h.jsx)(jC.div,{...l,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:PS(e.onFocusCapture,E.onFocusCapture),onBlurCapture:PS(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:PS(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function WC(){let e=m.useContext(HC),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}LC(WC,`useDismissableLayerSurface`);var GC=LC(()=>!0,`IS_TRUE`);function KC(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=GC}=t,s=FC(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}LC(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}LC(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}LC(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}LC(p,`handleInteractionBubble`);let m=LC(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||YC(zC,s,p,{discrete:!0})};if(LC(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:LC(()=>c.current=!0,`onPointerDownCapture`)}}LC(KC,`usePointerDownOutside`);function qC(e,t=globalThis?.document){let n=FC(e),r=m.useRef(!1);return m.useEffect(()=>{let e=LC(e=>{e.target&&!r.current&&YC(BC,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:LC(()=>r.current=!0,`onFocusCapture`),onBlurCapture:LC(()=>r.current=!1,`onBlurCapture`)}}LC(qC,`useFocusOutside`);function JC(){let e=new CustomEvent(RC);document.dispatchEvent(e)}LC(JC,`dispatchUpdate`);function YC(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?MC(i,a):i.dispatchEvent(a)}LC(YC,`handleAndDispatchCustomEvent`);var XC=Object.defineProperty,ZC=(e,t)=>XC(e,`name`,{value:t,configurable:!0}),QC=`focusScope.autoFocusOnMount`,$C=`focusScope.autoFocusOnUnmount`,ew={bubbles:!1,cancelable:!0},tw=m.forwardRef(ZC(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=FC(i),u=FC(a),d=m.useRef(null),f=US(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:cw(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||cw(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&cw(s)};ZC(e,`handleFocusIn`),ZC(t,`handleFocusOut`),ZC(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){lw.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(QC,ew);s.addEventListener(QC,l),s.dispatchEvent(t),t.defaultPrevented||(nw(fw(iw(s)),{select:!0}),document.activeElement===e&&cw(s))}return()=>{s.removeEventListener(QC,l),setTimeout(()=>{let t=new CustomEvent($C,ew);s.addEventListener($C,u),s.dispatchEvent(t),t.defaultPrevented||cw(e??document.body,{select:!0}),s.removeEventListener($C,u),lw.remove(p)},0)}}},[s,l,u,p]);let g=m.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=rw(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&cw(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&cw(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,h.jsx)(jC.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})},`FocusScope`));function nw(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(cw(r,{select:t}),document.activeElement!==n)return}ZC(nw,`focusFirst`);function rw(e){let t=iw(e);return[aw(t,e),aw(t.reverse(),e)]}ZC(rw,`getTabbableEdges`);function iw(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ZC(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ZC(iw,`getTabbableCandidates`);function aw(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ow(r,{upTo:t})))return r}ZC(aw,`findVisible`);function ow(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ZC(ow,`isHidden`);function sw(e){return e instanceof HTMLInputElement&&`select`in e}ZC(sw,`isSelectableInput`);function cw(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&sw(e)&&t&&e.select()}}ZC(cw,`focus`);var lw=uw();function uw(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=dw(e,t),e.unshift(t)},remove(t){e=dw(e,t),e[0]?.resume()}}}ZC(uw,`createFocusScopesStack`);function dw(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ZC(dw,`arrayRemove`);function fw(e){return e.filter(e=>e.tagName!==`A`)}ZC(fw,`removeLinks`);var pw=Object.defineProperty,mw=m.forwardRef(((e,t)=>pw(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);YS(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?wg.createPortal((0,h.jsx)(jC.div,{...r,ref:t}),o):null},`Portal`)),hw=Object.defineProperty,gw=(e,t)=>hw(e,`name`,{value:t,configurable:!0});function _w(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}gw(_w,`useStateMachine`);var vw=gw(e=>{let{present:t,children:n}=e,r=yw(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=xw(r.ref,Cw(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function yw(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=_w(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??Sw(r.current),o.current=void 0):a.current=`none`},[s]),YS(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Sw(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),YS(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=gw(a=>{let o=Sw(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=gw(e=>{e.target===t&&(a.current=Sw(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Sw(t)}else r.current=null;n(e)},[])}}gw(yw,`usePresence`);function bw(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}gw(bw,`setRef`);function xw(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=bw(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():bw(n[e],null)}}},[])}gw(xw,`useStableComposedRefs`);function Sw(e){return e?.animationName||`none`}gw(Sw,`getAnimationName`);function Cw(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}gw(Cw,`getElementRef`);var ww=Object.defineProperty,Tw=(e,t)=>ww(e,`name`,{value:t,configurable:!0}),Ew=0,Dw=null;function Ow(e){return kw(),e.children}Tw(Ow,`FocusGuards`);function kw(){m.useEffect(()=>{Dw||={start:Aw(),end:Aw()};let{start:e,end:t}=Dw;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ew++,()=>{Ew===1&&(Dw?.start.remove(),Dw?.end.remove(),Dw=null),Ew=Math.max(0,Ew-1)}},[])}Tw(kw,`useFocusGuards`);function Aw(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Tw(Aw,`createFocusGuard`);var jw=function(){return jw=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},jw.apply(this,arguments)};function Mw(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Nw(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Pw=`right-scroll-bar-position`,Fw=`width-before-scroll-bar`,Iw=`with-scroll-bars-hidden`,Lw=`--removed-body-scroll-bar-size`;function Rw(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function zw(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Bw=typeof window<`u`?m.useLayoutEffect:m.useEffect,Vw=new WeakMap;function Hw(e,t){var n=zw(t||null,function(t){return e.forEach(function(e){return Rw(e,t)})});return Bw(function(){var t=Vw.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Rw(e,null)}),i.forEach(function(e){r.has(e)||Rw(e,a)})}Vw.set(n,e)},[e]),n}function Uw(e){return e}function Ww(e,t){t===void 0&&(t=Uw);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Gw(e){e===void 0&&(e={});var t=Ww(null);return t.options=jw({async:!0,ssr:!1},e),t}var Kw=function(e){var t=e.sideCar,n=Mw(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return m.createElement(r,jw({},n))};Kw.isSideCarExport=!0;function qw(e,t){return e.useMedium(t),Kw}var Jw=Gw(),Yw=function(){},Xw=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Yw,onWheelCapture:Yw,onTouchMoveCapture:Yw}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Mw(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Hw([n,t]),w=jw(jw({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:Jw,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),jw(jw({},w),{ref:C})):m.createElement(y,jw({},w,{className:c,ref:C}),s))});Xw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Xw.classNames={fullWidth:Fw,zeroRight:Pw};var Zw=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Qw(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Zw();return t&&e.setAttribute(`nonce`,t),e}function $w(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eT(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var tT=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Qw())&&($w(t,n),eT(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nT=function(){var e=tT();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rT=function(){var e=nT();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},iT={left:0,top:0,right:0,gap:0},aT=function(e){return parseInt(e||``,10)||0},oT=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[aT(n),aT(r),aT(i)]},sT=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return iT;var t=oT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},cT=rT(),lT=`data-scroll-locked`,uT=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
18
+ .${Iw} {
19
19
  overflow: hidden ${r};
20
20
  padding-right: ${s}px ${r};
21
21
  }
22
- body[${oT}] {
22
+ body[${lT}] {
23
23
  overflow: hidden ${r};
24
24
  overscroll-behavior: contain;
25
25
  ${[t&&`position: relative ${r};`,n===`margin`&&`
@@ -32,40 +32,40 @@ Error generating stack: `+e.message+`
32
32
  `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
33
33
  }
34
34
 
35
- .${jw} {
35
+ .${Pw} {
36
36
  right: ${s}px ${r};
37
37
  }
38
38
 
39
- .${Mw} {
39
+ .${Fw} {
40
40
  margin-right: ${s}px ${r};
41
41
  }
42
42
 
43
- .${jw} .${jw} {
43
+ .${Pw} .${Pw} {
44
44
  right: 0 ${r};
45
45
  }
46
46
 
47
- .${Mw} .${Mw} {
47
+ .${Fw} .${Fw} {
48
48
  margin-right: 0 ${r};
49
49
  }
50
50
 
51
- body[${oT}] {
52
- ${Pw}: ${s}px;
51
+ body[${lT}] {
52
+ ${Lw}: ${s}px;
53
53
  }
54
- `},cT=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},lT=function(){m.useEffect(function(){return document.body.setAttribute(oT,(cT()+1).toString()),function(){var e=cT()-1;e<=0?document.body.removeAttribute(oT):document.body.setAttribute(oT,e.toString())}},[])},uT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;lT();var a=m.useMemo(function(){return iT(i)},[i]);return m.createElement(aT,{styles:sT(a,!t,i,n?``:`!important`)})},dT=!1;if(typeof window<`u`)try{var fT=Object.defineProperty({},"passive",{get:function(){return dT=!0,!0}});window.addEventListener(`test`,fT,fT),window.removeEventListener(`test`,fT,fT)}catch{dT=!1}var pT=dT?{passive:!1}:!1,mT=function(e){return e.tagName===`TEXTAREA`},hT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!mT(e)&&n[t]===`visible`)},gT=function(e){return hT(e,`overflowY`)},_T=function(e){return hT(e,`overflowX`)},vT=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),xT(e,r)){var i=ST(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yT=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},bT=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},xT=function(e,t){return e===`v`?gT(t):_T(t)},ST=function(e,t){return e===`v`?yT(t):bT(t)},CT=function(e,t){return e===`h`&&t===`rtl`?-1:1},wT=function(e,t,n,r,i){var a=CT(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=ST(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&xT(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},TT=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ET=function(e){return[e.deltaX,e.deltaY]},DT=function(e){return e&&`current`in e?e.current:e},OT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kT=function(e){return`
54
+ `},dT=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},fT=function(){m.useEffect(function(){return document.body.setAttribute(lT,(dT()+1).toString()),function(){var e=dT()-1;e<=0?document.body.removeAttribute(lT):document.body.setAttribute(lT,e.toString())}},[])},pT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;fT();var a=m.useMemo(function(){return sT(i)},[i]);return m.createElement(cT,{styles:uT(a,!t,i,n?``:`!important`)})},mT=!1;if(typeof window<`u`)try{var hT=Object.defineProperty({},"passive",{get:function(){return mT=!0,!0}});window.addEventListener(`test`,hT,hT),window.removeEventListener(`test`,hT,hT)}catch{mT=!1}var gT=mT?{passive:!1}:!1,_T=function(e){return e.tagName===`TEXTAREA`},vT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!_T(e)&&n[t]===`visible`)},yT=function(e){return vT(e,`overflowY`)},bT=function(e){return vT(e,`overflowX`)},xT=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),wT(e,r)){var i=TT(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ST=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},CT=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},wT=function(e,t){return e===`v`?yT(t):bT(t)},TT=function(e,t){return e===`v`?ST(t):CT(t)},ET=function(e,t){return e===`h`&&t===`rtl`?-1:1},DT=function(e,t,n,r,i){var a=ET(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=TT(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&wT(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},OT=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kT=function(e){return[e.deltaX,e.deltaY]},AT=function(e){return e&&`current`in e?e.current:e},jT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MT=function(e){return`
55
55
  .block-interactivity-${e} {pointer-events: none;}
56
56
  .allow-interactivity-${e} {pointer-events: all;}
57
- `},AT=0,jT=[];function MT(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(AT++)[0],a=m.useState(eT)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Aw([e.lockRef.current],(e.shards||[]).map(DT),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=TT(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=vT(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=vT(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return wT(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(jT.length&&jT[jT.length-1]===a){var r=`deltaY`in n?ET(n):TT(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&OT(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(DT).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:NT(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=TT(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,ET(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,TT(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return jT.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,pT),document.addEventListener(`touchmove`,c,pT),document.addEventListener(`touchstart`,u,pT),function(){jT=jT.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,pT),document.removeEventListener(`touchmove`,c,pT),document.removeEventListener(`touchstart`,u,pT)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:kT(i)}):null,p?m.createElement(uT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function NT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var PT=Ww(Gw,MT),FT=m.forwardRef(function(e,t){return m.createElement(qw,Ow({},e,{ref:t,sideCar:PT}))});FT.classNames=qw.classNames;var IT=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},LT=new WeakMap,RT=new WeakMap,zT={},BT=0,VT=function(e){return e&&(e.host||VT(e.parentNode))},HT=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=VT(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},UT=function(e,t,n,r){var i=HT(t,Array.isArray(e)?e:[e]);zT[n]||(zT[n]=new WeakMap);var a=zT[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(LT.get(e)||0)+1,l=(a.get(e)||0)+1;LT.set(e,c),a.set(e,l),o.push(e),c===1&&i&&RT.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),BT++,function(){o.forEach(function(e){var t=LT.get(e)-1,i=a.get(e)-1;LT.set(e,t),a.set(e,i),t||(RT.has(e)||e.removeAttribute(r),RT.delete(e)),i||e.removeAttribute(n)}),BT--,BT||(LT=new WeakMap,LT=new WeakMap,RT=new WeakMap,zT={})}},WT=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||IT(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),UT(r,i,n,`aria-hidden`)):function(){return null}},GT=Object.defineProperty,KT=(e,t)=>GT(e,`name`,{value:t,configurable:!0}),qT=`Dialog`,[JT,YT]=WS(qT),[XT,ZT]=JT(qT),QT=KT(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=oC({prop:r,defaultProp:i??!1,onChange:a,caller:qT}),[d,f]=m.useState(0),[p,g]=m.useState(0);return(0,h.jsx)(XT,{scope:t,triggerRef:s,contentRef:c,contentId:ZS(),titleId:ZS(),descriptionId:ZS(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:g,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),$T=`DialogPortal`,[eE,tE]=JT($T,{forceMount:void 0}),nE=KT(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ZT($T,t);return(0,h.jsx)(eE,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,h.jsx)(hw,{present:n||a.open,children:(0,h.jsx)(dw,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),rE=`DialogOverlay`,iE=m.forwardRef(KT(function(e,t){let n=tE(rE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ZT(rE,e.__scopeDialog);return a.modal?(0,h.jsx)(hw,{present:r||a.open,children:(0,h.jsx)(oE,{...i,ref:t})}):null},`DialogOverlay`)),aE=pC(`DialogOverlay.RemoveScroll`),oE=m.forwardRef(KT(function(e,t){let{__scopeDialog:n,...r}=e,i=ZT(rE,n),a=BS(t,VC());return(0,h.jsx)(FT,{as:aE,allowPinchZoom:!0,shards:[i.contentRef],children:(0,h.jsx)(OC.div,{"data-state":fE(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),sE=`DialogContent`,cE=m.forwardRef(KT(function(e,t){let n=tE(sE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ZT(sE,e.__scopeDialog);return(0,h.jsx)(hw,{present:r||a.open,children:a.modal?(0,h.jsx)(lE,{...i,ref:t}):(0,h.jsx)(uE,{...i,ref:t})})},`DialogContent`)),lE=m.forwardRef(KT(function(e,t){let n=ZT(sE,e.__scopeDialog),r=m.useRef(null),i=BS(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return WT(e)},[]),(0,h.jsx)(dE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:jS(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:jS(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:jS(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),uE=m.forwardRef(KT(function(e,t){let n=ZT(sE,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,h.jsx)(dE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),dE=m.forwardRef(KT(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ZT(sE,n);return Ew(),(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(QC,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(BC,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":fE(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function fE(e){return e?`open`:`closed`}KT(fE,`getState`);var pE=`[cmdk-group=""]`,mE=`[cmdk-group-items=""]`,hE=`[cmdk-group-heading=""]`,gE=`[cmdk-item=""]`,_E=`${gE}:not([aria-disabled="true"])`,vE=`cmdk-item-select`,yE=`data-value`,bE=(e,t,n)=>DS(e,t,n),xE=m.createContext(void 0),SE=()=>m.useContext(xE),CE=m.createContext(void 0),wE=()=>m.useContext(CE),TE=m.createContext(void 0),EE=m.forwardRef((e,t)=>{let n=BE(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=BE(()=>new Set),i=BE(()=>new Map),a=BE(()=>new Map),o=BE(()=>new Set),s=RE(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=ZS(),b=ZS(),x=ZS(),S=m.useRef(null),C=UE();zE(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),zE(()=>{C(6,ee)},[]);let w=m.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||C(5,ee),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=m.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??bE;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;te().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(mE);t?t.appendChild(e.parentElement===t?e:e.closest(`${mE} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${mE} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${pE}[${yE}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=te().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(yE);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ee(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(pE)?.querySelector(hE))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${gE}[aria-selected="true"]`)}function te(){return Array.from(S.current?.querySelectorAll(_E)||[])}function ne(e){let t=te()[e];t&&w.setState(`value`,t.getAttribute(yE))}function re(e){var t;let n=A(),r=te(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(yE))}function ie(e){let t=A()?.closest(pE),n;for(;t&&!n;)t=e>0?IE(t,pE):LE(t,pE),n=t?.querySelector(_E);n?w.setState(`value`,n.getAttribute(yE)):re(e)}let ae=()=>ne(te().length-1),oe=e=>{e.preventDefault(),e.metaKey?ae():e.altKey?ie(1):re(1)},se=e=>{e.preventDefault(),e.metaKey?ne(0):e.altKey?ie(-1):re(-1)};return m.createElement(OC.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&oe(e);break;case`ArrowDown`:oe(e);break;case`p`:case`k`:_&&e.ctrlKey&&se(e);break;case`ArrowUp`:se(e);break;case`Home`:e.preventDefault(),ne(0);break;case`End`:e.preventDefault(),ae();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(vE);t.dispatchEvent(e)}}}}},m.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:KE},c),GE(e,e=>m.createElement(CE.Provider,{value:w},m.createElement(xE.Provider,{value:T},e))))}),DE=m.forwardRef((e,t)=>{let n=ZS(),r=m.useRef(null),i=m.useContext(TE),a=SE(),o=RE(e),s=o.current?.forceMount??i?.forceMount;zE(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=HE(n,r,[e.value,e.children,r],e.keywords),l=wE(),u=VE(e=>e.value&&e.value===c.current),d=VE(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);m.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(vE,f),()=>t.removeEventListener(vE,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return m.createElement(OC.div,{ref:zS(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:p,onClick:h?void 0:f},e.children)}),OE=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=ZS(),s=m.useRef(null),c=m.useRef(null),l=ZS(),u=SE(),d=VE(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));zE(()=>u.group(o),[]),HE(o,s,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:i}),[i]);return m.createElement(OC.div,{ref:zS(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&m.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),GE(e,e=>m.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},m.createElement(TE.Provider,{value:f},e))))}),kE=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=m.useRef(null),a=VE(e=>!e.search);return!n&&!a?null:m.createElement(OC.div,{ref:zS(i,t),...r,"cmdk-separator":``,role:`separator`})}),AE=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=wE(),o=VE(e=>e.search),s=VE(e=>e.selectedItemId),c=SE();return m.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),m.createElement(OC.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),jE=m.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=m.useRef(null),o=m.useRef(null),s=VE(e=>e.selectedItemId),c=SE();return m.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),m.createElement(OC.div,{ref:zS(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},GE(e,e=>m.createElement(`div`,{ref:zS(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),ME=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return m.createElement(QT,{open:n,onOpenChange:r},m.createElement(nE,{container:o},m.createElement(iE,{"cmdk-overlay":``,className:i}),m.createElement(cE,{"aria-label":e.label,"cmdk-dialog":``,className:a},m.createElement(EE,{ref:t,...s}))))}),NE=m.forwardRef((e,t)=>VE(e=>e.filtered.count===0)?m.createElement(OC.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),PE=m.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return m.createElement(OC.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},GE(e,e=>m.createElement(`div`,{"aria-hidden":!0},e)))}),FE=Object.assign(EE,{List:jE,Item:DE,Input:AE,Group:OE,Separator:kE,Dialog:ME,Empty:NE,Loading:PE});function IE(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function LE(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function RE(e){let t=m.useRef(e);return zE(()=>{t.current=e}),t}var zE=typeof window>`u`?m.useEffect:m.useLayoutEffect;function BE(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function VE(e){let t=wE(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function HE(e,t,n,r=[]){let i=m.useRef(),a=SE();return zE(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(yE,s),i.current=s}),i}var UE=()=>{let[e,t]=m.useState(),n=BE(()=>new Map);return zE(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function WE(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function GE({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(WE(t),{ref:t.ref},n(t.props.children)):n(t)}var KE={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},qE=/^[a-z][a-z0-9+.-]*:/i;function JE(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47,r=e.split(`/`),i=[];for(let e=0;e<r.length;e++){let n=r[e];n&&n!==`.`&&(n===`..`?i.length>0&&i[i.length-1]!==`..`?i.pop():t||i.push(`..`):i.push(n))}let a=i.join(`/`);return t&&(a=`/${a}`),a.length===0?t?`/`:`.`:(n&&!a.endsWith(`/`)&&(a+=`/`),a)}function YE(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:e.slice(0,n)}function XE(e){if(e.length===0)return``;let t=0,n=-1,r=!0;for(let i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!r){t=i+1;break}}else n===-1&&(r=!1,n=i+1);return n===-1?``:e.slice(t,n)}function ZE(e,t){if(!e)return{kind:`invalid`};if(e.startsWith(`#`))return{kind:`anchor`,hash:e};if(e.startsWith(`//`)||qE.test(e))return{kind:`external`,href:e};let n=e;try{n=decodeURI(e)}catch{}let r=``,i=n.indexOf(`#`);i!==-1&&(r=n.slice(i),n=n.slice(0,i));let a=n.indexOf(`?`);a!==-1&&(n=n.slice(0,a));let o;if(n.startsWith(`/`))o=JE(n.slice(1));else{let e=YE(t),r=e===`.`?``:e;o=JE(r?`${r}/${n}`:n)}if(o===`..`||o.startsWith(`../`)||n.endsWith(`/`))return{kind:`invalid`};if(o.endsWith(`.md`)){let e=XE(o);return e===`index.md`||e===`log.md`?{kind:`invalid`}:{kind:`concept`,id:o.slice(0,-3),hash:r}}return{kind:`file`,path:o,hash:r}}function QE(e,t){let n=t.startsWith(`/`)?t.slice(1):t;return`/p/${encodeURIComponent(e)}/c/${n}`}function $E(e,t){let n=t.startsWith(`/`)?t.slice(1):t;return`/p/${encodeURIComponent(e)}/f/${n}`}var eD=`okf.recent`,tD=8;function nD(e){return!!(e&&typeof e==`object`&&`project`in e&&typeof e.project==`string`&&`id`in e&&typeof e.id==`string`&&`title`in e&&typeof e.title==`string`&&`type`in e&&(e.type===null||typeof e.type==`string`))}function rD(){try{if(typeof localStorage>`u`)return[];let e=localStorage.getItem(eD);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(nD).slice(0,tD):[]}catch{return[]}}function iD(e){try{if(typeof localStorage>`u`)return;let t=[e,...rD().filter(t=>t.project!==e.project||t.id!==e.id)].slice(0,tD);localStorage.setItem(eD,JSON.stringify(t))}catch{}}function aD({text:e,query:t,className:n}){if(!e)return null;if(!t?.trim())return(0,h.jsx)(`span`,{className:n,children:e});let r=t.trim().split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),i=[],a={};for(let e of r){let t=e.toLowerCase();a[t]||(a[t]=!0,i.push(e))}if(i.sort((e,t)=>t.length-e.length),i.length===0)return(0,h.jsx)(`span`,{className:n,children:e});let o=i.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)),s=RegExp(`(${o.join(`|`)})`,`gi`),c=e.split(s);return(0,h.jsx)(`span`,{className:n,children:c.map((e,t)=>i.some(t=>t.toLowerCase()===e.toLowerCase())?(0,h.jsx)(`mark`,{className:`rounded-xs bg-amber-400/25 px-0.5 font-medium text-fg dark:bg-amber-400/35`,children:e},t):e)})}var oD=[`Project`,`Decision`,`Convention`,`Architecture`,`Component`,`Playbook`,`Interface`,`Reference`,`Glossary Term`],sD={project:`text-accent-500`,decision:`text-violet-600 dark:text-violet-400`,convention:`text-sky-600 dark:text-sky-400`,architecture:`text-cyan-600 dark:text-cyan-400`,component:`text-cyan-600 dark:text-cyan-400`,playbook:`text-emerald-600 dark:text-emerald-400`,interface:`text-amber-600 dark:text-amber-400`,reference:`text-zinc-600 dark:text-zinc-400`,"glossary term":`text-pink-600 dark:text-pink-400`};function cD(e){return e?sD[e.trim().toLowerCase()]??`text-zinc-600 dark:text-zinc-400`:`text-zinc-600 dark:text-zinc-400`}function lD({type:e,className:t,size:n=16}){let r=e?e.trim().toLowerCase():``,i=X(`shrink-0`,cD(e),t);switch(r){case`project`:return(0,h.jsx)(ax,{size:n,className:i});case`decision`:return(0,h.jsx)(zx,{size:n,className:i});case`convention`:return(0,h.jsx)(Lx,{size:n,className:i});case`architecture`:return(0,h.jsx)(jx,{size:n,className:i});case`component`:return(0,h.jsx)(Db,{size:n,className:i});case`playbook`:return(0,h.jsx)(xb,{size:n,className:i});case`interface`:return(0,h.jsx)(Nx,{size:n,className:i});case`reference`:return(0,h.jsx)(Cb,{size:n,className:i});case`glossary term`:return(0,h.jsx)(yb,{size:n,className:i});default:return(0,h.jsx)(rx,{size:n,className:i})}}function uD({open:e=!1,className:t,size:n=16}){let r=X(`shrink-0 text-muted`,t);return e?(0,h.jsx)(sx,{size:n,className:r}):(0,h.jsx)(lx,{size:n,className:r})}function dD({className:e,size:t=16}){return(0,h.jsx)($b,{size:t,className:X(`shrink-0 text-muted`,e)})}var fD=(0,m.createContext)(null);function pD(){let e=(0,m.useContext)(fD);if(!e)throw Error(`useCommandPalette must be used within CommandPaletteContext.Provider`);return e}function mD(e){let t=e?.toLowerCase();return t===`human-reviewed`?`bg-emerald-500`:t===`machine-confirmed`?`bg-sky-500`:`bg-zinc-400 dark:bg-zinc-600`}function hD({open:e,onOpenChange:t,currentProject:n}){let r=kh(),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(!!n),[u,d]=(0,m.useState)(``);(0,m.useEffect)(()=>{l(!!n)},[n]),(0,m.useEffect)(()=>{let e=setTimeout(()=>{s(i)},150);return()=>clearTimeout(e)},[i]),(0,m.useEffect)(()=>{function n(n){if((n.metaKey||n.ctrlKey)&&n.key===`k`){n.preventDefault(),t(!e);return}if(n.key===`/`&&!e){let e=n.target;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.isContentEditable||e.closest(`input, textarea, select, [contenteditable]`))||(n.preventDefault(),t(!0))}}return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let f=D_(),p=e?rD():[],g=o.trim().length>=2,_=c&&n?n:void 0,v=P_({q:o.trim(),project:_,limit:20},g&&e),y=g?v.data?.[0]:void 0,b=p[0],x=f.data?.[0],S=``;y?S=`hit-${y.project}-${y.id}`:o.trim().length>0?S=`search-all-results`:b?S=`recent-${b.project}-${b.id}`:x&&(S=`proj-${x.project}`),(0,m.useEffect)(()=>{d(S)},[S]);let C=e=>{t(!1),a(``),r(e)};return(0,h.jsxs)(FE.Dialog,{value:u,onValueChange:d,open:e,onOpenChange:e=>{t(e),e||a(``)},label:`Search concepts, projects…`,shouldFilter:!1,overlayClassName:`fixed inset-0 bg-black/60 backdrop-blur-xs z-50 animate-[okf-fade-in_120ms_ease-out]`,contentClassName:`fixed left-1/2 top-[15%] -translate-x-1/2 w-full max-w-xl z-50 p-3 outline-none`,className:`w-full bg-surface border border-border-strong rounded-2xl shadow-2xl overflow-hidden flex flex-col max-h-[70vh] text-fg animate-[okf-scale-in_120ms_ease-out]`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 px-3 border-b border-border`,children:[(0,h.jsx)(Vx,{size:16,className:`text-muted shrink-0`}),(0,h.jsx)(FE.Input,{value:i,onValueChange:a,placeholder:`Search concepts, projects…`,className:`w-full bg-transparent py-3 text-sm text-fg placeholder:text-muted outline-none`}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>{n&&l(e=>!e)},disabled:!n,className:X(`shrink-0 text-xs px-2.5 py-1 rounded-md font-medium transition-colors select-none`,n?c?`bg-accent-500/10 text-accent-500 ring-1 ring-accent-500/20 hover:bg-accent-500/20 cursor-pointer`:`bg-surface-2 text-muted ring-1 ring-border hover:text-fg cursor-pointer`:`bg-surface-2 text-muted/60 ring-1 ring-border cursor-default`),title:n?`Click to toggle search scope`:void 0,children:c&&n?`This project`:`All projects`})]}),(0,h.jsxs)(FE.List,{className:`overflow-y-auto max-h-[380px] p-2 space-y-1`,children:[g&&v.isLoading&&(0,h.jsx)(FE.Loading,{className:`px-4 py-8 text-center text-xs text-subtle`,children:`Searching...`}),g&&!v.isLoading&&v.data&&v.data.length===0&&(0,h.jsx)(FE.Empty,{className:`px-4 py-8 text-center text-xs text-subtle`,children:`No matching concepts or files`}),g&&v.data&&v.data.length>0&&(0,h.jsx)(FE.Group,{heading:`Concepts & Files`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-subtle [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider`,children:v.data.map(e=>(0,h.jsxs)(FE.Item,{value:`hit-${e.project}-${e.id}`,onSelect:()=>C(QE(e.project,e.id)),className:`flex flex-col gap-1 px-2.5 py-2 rounded-lg text-xs cursor-pointer data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,h.jsx)(lD,{type:e.type,size:14}),(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:e.title}),(0,h.jsxs)(`span`,{className:`font-mono text-[11px] text-subtle truncate`,children:[e.project,`/`,e.id]}),(0,h.jsx)(`span`,{className:X(`ml-auto h-2 w-2 rounded-full shrink-0`,mD(e.trustTier)),title:e.trustTier})]}),e.snippet&&(0,h.jsx)(`div`,{className:`text-[11px] text-muted truncate pl-5`,children:(0,h.jsx)(aD,{text:e.snippet,query:o})})]},`${e.project}/${e.id}`))}),!g&&(0,h.jsxs)(h.Fragment,{children:[p.length>0&&(0,h.jsx)(FE.Group,{heading:`Recent`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-subtle [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider`,children:p.map(e=>(0,h.jsxs)(FE.Item,{value:`recent-${e.project}-${e.id}`,onSelect:()=>C(QE(e.project,e.id)),className:`flex items-center gap-2 px-2.5 py-2 rounded-lg text-xs cursor-pointer data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsx)(lD,{type:e.type,size:14}),(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:e.title}),(0,h.jsxs)(`span`,{className:`ml-auto font-mono text-[11px] text-subtle shrink-0`,children:[e.project,`/`,e.id]})]},`recent-${e.project}-${e.id}`))}),f.data&&f.data.length>0&&(0,h.jsx)(FE.Group,{heading:`Projects`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-subtle [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider`,children:f.data.map(e=>(0,h.jsxs)(FE.Item,{value:`proj-${e.project}`,onSelect:()=>C(`/p/${encodeURIComponent(e.project)}`),className:`flex items-center gap-2 px-2.5 py-2 rounded-lg text-xs cursor-pointer data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsx)(ax,{size:14,className:`text-accent-500 shrink-0`}),(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:e.title}),(0,h.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-subtle shrink-0`,children:e.project})]},`proj-${e.project}`))})]}),o.trim().length>0&&(0,h.jsx)(FE.Group,{className:`pt-1 border-t border-border mt-1`,children:(0,h.jsxs)(FE.Item,{value:`search-all-results`,onSelect:()=>{let e=new URLSearchParams;e.set(`q`,o.trim()),c&&n&&e.set(`project`,n),C(`/search?${e.toString()}`)},className:`flex items-center gap-2 px-2.5 py-2 rounded-lg text-xs cursor-pointer text-muted hover:text-fg data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsx)(Vx,{size:14,className:`shrink-0 text-muted`}),(0,h.jsxs)(`span`,{children:[`Search all results for “`,(0,h.jsx)(`strong`,{className:`text-fg font-medium`,children:o.trim()}),`”`]})]})})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-3 px-3.5 py-2 border-t border-border text-[11px] text-subtle bg-surface-2/40 select-none`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`kbd`,{className:`font-mono bg-surface px-1 py-0.2 rounded border border-border`,children:`↑↓`}),` navigate`]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`kbd`,{className:`font-mono bg-surface px-1 py-0.2 rounded border border-border`,children:`↵`}),` open`]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`kbd`,{className:`font-mono bg-surface px-1 py-0.2 rounded border border-border`,children:`esc`}),` close`]})]})]})}function Q({className:e}){return(0,h.jsx)(`div`,{className:X(`animate-shimmer rounded-md bg-surface-2`,e),"aria-hidden":`true`})}var gD=(0,m.createContext)(null);function _D(){let e=(0,m.useContext)(gD);if(!e)throw Error(`useTreeState must be used within a TreeStateContext.Provider`);return e}function vD(e,t){let n=[],r=[],i=[];for(let a of e)if(a.kind===`directory`)n.push(a);else if(a.kind===`concept`){if(t&&a.id===`overview`)continue;r.push(a)}else a.kind===`file`&&i.push(a);return n.sort((e,t)=>e.path.localeCompare(t.path)),r.sort((e,t)=>e.title.localeCompare(t.title)),i.sort((e,t)=>e.path.localeCompare(t.path)),[...n,...r,...i]}function yD({project:e,dir:t,depth:n,activeConceptId:r,activeFilePath:i}){let{data:a,isLoading:o}=k_(e,t,!0),{expanded:s,toggle:c}=_D(),l=(0,m.useMemo)(()=>a?vD(a,t===``):[],[a,t]);return o?(0,h.jsxs)(`div`,{className:`py-1 space-y-1`,style:{paddingLeft:`${n*12+12}px`},children:[(0,h.jsx)(Q,{className:`h-5 w-3/4 rounded-md`}),(0,h.jsx)(Q,{className:`h-5 w-1/2 rounded-md`})]}):l.length===0?(0,h.jsx)(`div`,{className:`py-1 text-[11px] text-subtle italic select-none`,style:{paddingLeft:`${n*12+16}px`},children:`Empty directory`}):(0,h.jsx)(`div`,{className:`space-y-0.5`,children:l.map(t=>{if(t.kind===`directory`){let a=s.has(t.path),o=t.path.split(`/`).pop()??t.path;return(0,h.jsxs)(`div`,{"data-tree-path":t.path,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>c(t.path),className:`group flex w-full items-center gap-1.5 py-1 pr-2 rounded-md text-xs font-medium text-muted hover:text-fg hover:bg-surface-2 transition-colors cursor-pointer text-left`,style:{paddingLeft:`${n*12+6}px`},children:[(0,h.jsx)(Nb,{size:12,className:X(`text-subtle transition-transform duration-150 shrink-0`,a&&`rotate-90`)}),(0,h.jsx)(uD,{open:a,size:14}),(0,h.jsx)(`span`,{className:`truncate flex-1`,children:o}),(0,h.jsx)(`span`,{className:`ml-auto text-[11px] text-subtle font-mono tabular-nums`,children:t.conceptCount})]}),(0,h.jsx)(tu,{initial:!1,children:a&&(0,h.jsx)(Gd.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.15,ease:`easeInOut`},className:`overflow-hidden`,children:(0,h.jsx)(yD,{project:e,dir:t.path,depth:n+1,activeConceptId:r,activeFilePath:i})})})]},`dir-${t.path}`)}if(t.kind===`concept`){let i=r===t.id;return(0,h.jsx)(`div`,{"data-tree-path":t.id,children:(0,h.jsxs)($g,{to:QE(e,t.id),className:X(`group flex items-center gap-2 py-1 pr-2 rounded-md text-xs transition-colors`,i?`border-l-2 border-accent-500 bg-surface-2 text-fg font-medium pl-[calc(var(--tree-pad)-2px)]`:`border-l-2 border-transparent text-muted hover:text-fg hover:bg-surface-2`),style:{"--tree-pad":`${n*12+20}px`,paddingLeft:i?`${n*12+18}px`:`${n*12+20}px`},children:[(0,h.jsx)(lD,{type:t.type,size:14}),(0,h.jsx)(`span`,{className:`truncate`,children:t.title})]})},`concept-${t.id}`)}if(t.kind===`file`){let r=i===t.path,a=t.path.split(`/`).pop()??t.path;return(0,h.jsx)(`div`,{"data-tree-path":t.path,children:(0,h.jsxs)($g,{to:$E(e,t.path),className:X(`group flex items-center gap-2 py-1 pr-2 rounded-md text-xs transition-colors`,r?`border-l-2 border-accent-500 bg-surface-2 text-fg font-medium font-mono`:`border-l-2 border-transparent text-muted hover:text-fg hover:bg-surface-2 font-mono`),style:{paddingLeft:r?`${n*12+18}px`:`${n*12+20}px`},children:[(0,h.jsx)(dD,{size:14}),(0,h.jsx)(`span`,{className:`truncate`,children:a})]})},`file-${t.path}`)}return null})})}function bD({project:e}){let t=Nh(),n=Dh(),r=t[`*`]??null,i=n.pathname.includes(`/c/`)&&r!==null,a=n.pathname.includes(`/f/`)&&r!==null,o=i?r:null,s=a?r:null,{expanded:c,toggle:l}=_D();return(0,m.useEffect)(()=>{let e=o??s;if(!e)return;let t=e.split(`/`);if(t.length<=1)return;let n=``;for(let e=0;e<t.length-1;e++){let r=t[e];r&&(n=n?`${n}/${r}`:r,c.has(n)||l(n))}},[o,s,c,l]),(0,h.jsx)(`div`,{className:`py-1`,children:(0,h.jsx)(yD,{project:e,dir:``,depth:0,activeConceptId:o,activeFilePath:s})})}var xD=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`}),SD=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function CD(e){let t=new Date(e).getTime();if(Number.isNaN(t))return e;let n=Math.round((t-Date.now())/1e3);if(Math.abs(n)<60)return xD.format(n,`second`);let r=Math.round(n/60);if(Math.abs(r)<60)return xD.format(r,`minute`);let i=Math.round(r/60);if(Math.abs(i)<24)return xD.format(i,`hour`);let a=Math.round(i/24);if(Math.abs(a)<7)return xD.format(a,`day`);let o=Math.round(a/7);if(Math.abs(o)<5)return xD.format(o,`week`);let s=Math.round(a/30);if(Math.abs(s)<12)return xD.format(s,`month`);let c=Math.round(a/365);return xD.format(c,`year`)}function wD(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:SD.format(t)}function TD(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)%360}function ED(e){let t=e.startsWith(`human:`)?e.slice(6):e,n=t.indexOf(`@`);n!==-1&&(t=t.slice(0,n));let r=t.match(/[A-Za-z0-9]+/g);return!r||r.length===0?``:r.slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)}function DD(e){return e.startsWith(`human:`)?`human`:`agent`}function OD(e){return e.slice(0,7)}function kD({className:e}){let{data:t,isLoading:n}=F_();if(n||!t)return(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-zinc-500/10 text-zinc-500 ring-1 ring-inset ring-zinc-500/20`,e),children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-zinc-400 animate-pulse`}),(0,h.jsx)(`span`,{children:`Syncing...`})]});if(t.remote===null)return(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 ring-1 ring-inset ring-zinc-500/20`,e),children:[(0,h.jsx)(px,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Local only`})]});if(t.lastError)return(0,h.jsxs)(`span`,{title:t.lastError,className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-1 ring-inset ring-rose-500/20`,e),children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-rose-500 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate max-w-[120px]`,children:`Sync error`})]});if(t.ahead>0||t.behind>0)return(0,h.jsx)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 ring-1 ring-inset ring-amber-500/20 font-mono`,e),children:(0,h.jsxs)(`span`,{children:[`↑`,t.ahead,` ↓`,t.behind]})});let r=t.lastSyncAt?CD(t.lastSyncAt):`just now`;return(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-1 ring-inset ring-emerald-500/20`,e),children:[(0,h.jsxs)(`span`,{className:`relative flex h-2 w-2 shrink-0`,children:[(0,h.jsx)(`span`,{className:`absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75`}),(0,h.jsx)(`span`,{className:`relative inline-flex h-2 w-2 rounded-full bg-emerald-500`})]}),(0,h.jsxs)(`span`,{children:[`Synced `,r]})]})}var AD={system:`light`,light:`dark`,dark:`system`};function jD({className:e}){let[t,n]=tb();return(0,h.jsxs)(`button`,{type:`button`,onClick:()=>{n(AD[t])},className:e??`inline-flex h-8 w-8 items-center justify-center rounded-lg text-muted hover:bg-surface-2 hover:text-fg transition-colors`,"aria-label":`Toggle theme (current: ${t})`,title:`Theme: ${t} (click to switch to ${AD[t]})`,children:[t===`system`&&(0,h.jsx)(Dx,{size:16}),t===`light`&&(0,h.jsx)(qx,{size:16}),t===`dark`&&(0,h.jsx)(kx,{size:16})]})}function MD({actor:e,size:t=28,className:n}){let r=TD(e),i=ED(e),a=DD(e),o=Math.max(10,Math.round(t*.42)),s=Math.max(10,Math.round(t*.4));return(0,h.jsxs)(`div`,{className:X(`relative inline-flex shrink-0 select-none`,n),style:{width:t,height:t},title:e,children:[(0,h.jsx)(`div`,{className:`flex h-full w-full items-center justify-center rounded-full font-medium text-white shadow-xs`,style:{background:`linear-gradient(135deg, hsl(${r} 70% 55%), hsl(${(r+40)%360} 70% 45%))`,fontSize:s},children:i}),(0,h.jsx)(`div`,{className:`absolute -bottom-0.5 -right-0.5 flex items-center justify-center rounded-full bg-surface text-muted ring-1 ring-border`,style:{width:o+4,height:o+4},children:a===`human`?(0,h.jsx)($x,{size:o}):(0,h.jsx)(Tb,{size:o})})]})}function ND({className:e}){let{state:t,logout:n}=Gy(),[r,i]=(0,m.useState)(!1),a=(0,m.useRef)(null);if((0,m.useEffect)(()=>{if(!r)return;function e(e){a.current&&!a.current.contains(e.target)&&i(!1)}function t(e){e.key===`Escape`&&i(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),t.status===`loading`)return(0,h.jsx)(`div`,{className:X(`h-7 w-24 rounded-md bg-surface-2 animate-pulse`,e)});let o=t.status===`open`,s=t.status===`signed-in`,c=`config`in t?t.config.version:null,l=s?t.identity:null;return(0,h.jsxs)(`div`,{ref:a,className:X(`relative inline-block`,e),children:[o?(0,h.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 ring-1 ring-inset ring-amber-500/20 hover:bg-amber-500/20 transition-colors`,title:`Running in local mode without authentication`,"aria-expanded":r,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-amber-500`}),(0,h.jsx)(`span`,{children:`Local mode · auth off`})]}):s?(0,h.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`flex items-center gap-2 rounded-lg p-1 text-left hover:bg-surface-2 transition-colors max-w-[200px]`,"aria-expanded":r,children:[(0,h.jsx)(MD,{actor:l??`User`,size:26}),(0,h.jsx)(`span`,{className:`truncate text-xs font-medium text-fg`,children:l??`Signed in`})]}):null,r&&(0,h.jsxs)(`div`,{role:`menu`,className:`absolute bottom-full left-0 mb-2 w-56 rounded-xl border border-border bg-surface p-1.5 shadow-xl z-50 text-xs`,children:[l&&(0,h.jsxs)(`div`,{className:`px-2.5 py-1.5 border-b border-border mb-1`,children:[(0,h.jsx)(`div`,{className:`font-medium text-fg truncate`,children:l}),(0,h.jsx)(`div`,{className:`text-[11px] text-muted truncate`,children:`Identity provider session`})]}),c&&(0,h.jsxs)(`div`,{className:`px-2.5 py-1 text-[11px] text-muted font-mono`,children:[`ok-fine v`,c]}),s&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,h.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{i(!1),n()},className:`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-xs font-medium text-rose-600 dark:text-rose-400 hover:bg-rose-500/10 transition-colors cursor-pointer`,children:[(0,h.jsx)(Cx,{size:13,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Sign out`})]})]})]})]})}function PD({project:e,drawerOpen:t,onCloseDrawer:n}){let r=kh(),i=D_(),[a,o]=(0,m.useState)(!1),s=(0,m.useRef)(null),c=i.data?.find(t=>t.project===e)?.title??e??`All projects`;(0,m.useEffect)(()=>{if(!a)return;function e(e){s.current&&!s.current.contains(e.target)&&o(!1)}function t(e){e.key===`Escape`&&o(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let l=e=>{o(!1),n(),r(e?`/p/${encodeURIComponent(e)}`:`/`)};return(0,h.jsxs)(h.Fragment,{children:[t&&(0,h.jsx)(`button`,{type:`button`,"aria-label":`Close sidebar`,onClick:n,className:`fixed inset-0 z-40 bg-black/50 backdrop-blur-xs lg:hidden animate-[fade-in_150ms_ease-out] cursor-default border-none p-0`}),(0,h.jsxs)(`aside`,{className:X(`fixed inset-y-0 left-0 z-50 w-[272px] bg-surface border-r border-border flex flex-col h-full shadow-2xl lg:shadow-none transition-transform duration-200 ease-out lg:static lg:z-auto lg:translate-x-0`,t?`translate-x-0`:`-translate-x-full lg:translate-x-0`),children:[(0,h.jsxs)(`div`,{className:`h-14 border-b border-border flex items-center justify-between px-4 shrink-0`,children:[(0,h.jsx)($g,{to:`/`,onClick:n,className:`hover:opacity-90 transition-opacity`,title:`ok-fine home`,children:(0,h.jsx)(aS,{size:22})}),(0,h.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close sidebar`,className:`lg:hidden p-1.5 rounded-lg text-muted hover:text-fg hover:bg-surface-2 transition-colors cursor-pointer`,children:(0,h.jsx)(tS,{size:18})})]}),(0,h.jsxs)(`div`,{ref:s,className:`relative p-2 border-b border-border shrink-0`,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 rounded-lg bg-surface-2 hover:bg-surface border border-border text-xs font-medium text-fg transition-colors cursor-pointer text-left`,children:[(0,h.jsx)(`span`,{className:`truncate`,children:c}),(0,h.jsx)(Fb,{size:14,className:`text-subtle shrink-0`})]}),a&&(0,h.jsxs)(`div`,{role:`menu`,className:`absolute left-2 right-2 top-full mt-1 rounded-xl border border-border bg-surface p-1 shadow-xl z-50 text-xs space-y-0.5 max-h-64 overflow-y-auto`,children:[(0,h.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>l(),className:X(`flex w-full items-center justify-between px-2.5 py-1.5 rounded-lg text-left transition-colors cursor-pointer`,e?`text-muted hover:text-fg hover:bg-surface-2`:`bg-accent-500/10 text-accent-500 font-medium`),children:[(0,h.jsx)(`span`,{children:`All projects`}),!e&&(0,h.jsx)(kb,{size:14,className:`shrink-0`})]}),(0,h.jsx)(`div`,{className:`my-1 border-t border-border`}),i.data?.map(t=>{let n=t.project===e;return(0,h.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>l(t.project),className:X(`flex w-full items-center justify-between px-2.5 py-1.5 rounded-lg text-left transition-colors cursor-pointer`,n?`bg-accent-500/10 text-accent-500 font-medium`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsxs)(`div`,{className:`truncate pr-2`,children:[(0,h.jsx)(`div`,{className:`font-medium truncate`,children:t.title}),(0,h.jsx)(`div`,{className:`font-mono text-[10px] text-subtle truncate`,children:t.project})]}),n&&(0,h.jsx)(kb,{size:14,className:`shrink-0`})]},t.project)})]})]}),(0,h.jsx)(`div`,{className:`flex-1 overflow-y-auto min-h-0 flex flex-col p-2 space-y-4`,children:e?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`nav`,{"aria-label":`Project sections`,className:`space-y-0.5`,children:[(0,h.jsxs)(e_,{to:`/p/${encodeURIComponent(e)}`,end:!0,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(yx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Overview`})]}),(0,h.jsxs)(e_,{to:`/p/${encodeURIComponent(e)}/activity`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(Fx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Activity`})]}),(0,h.jsxs)(e_,{to:`/p/${encodeURIComponent(e)}/health`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(hx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Health`})]}),(0,h.jsxs)(e_,{to:`/search?project=${encodeURIComponent(e)}`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(Vx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Search`})]})]}),(0,h.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:[(0,h.jsx)(`div`,{className:`px-2 pb-1 text-[11px] font-medium uppercase tracking-wider text-subtle select-none`,children:`Knowledge`}),(0,h.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,h.jsx)(bD,{project:e})})]})]}):(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsxs)(`nav`,{"aria-label":`Global navigation`,className:`space-y-0.5`,children:[(0,h.jsxs)(e_,{to:`/`,end:!0,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(yx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Projects`})]}),(0,h.jsxs)(e_,{to:`/search`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(Vx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Search`})]})]}),i.data&&i.data.length>0&&(0,h.jsxs)(`div`,{className:`pt-2`,children:[(0,h.jsx)(`div`,{className:`px-2 pb-1 text-[11px] font-medium uppercase tracking-wider text-subtle select-none`,children:`Projects`}),(0,h.jsx)(`div`,{className:`space-y-0.5`,children:i.data.map(e=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e.project)}`,onClick:n,className:`flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs text-muted hover:text-fg hover:bg-surface-2 transition-colors`,children:[(0,h.jsx)(ax,{size:14,className:`text-accent-500 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e.title})]},e.project))})]})]})}),(0,h.jsxs)(`div`,{className:`p-3 border-t border-border flex flex-col gap-2.5 mt-auto bg-surface shrink-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(kD,{}),(0,h.jsx)(jD,{})]}),(0,h.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,h.jsx)(ND,{})})]})]})]})}function FD({className:e}){let t=Nh(),n=Dh(),r=t.project,i=t[`*`],a=O_(r??``).data?.title??r,o=n.pathname.includes(`/c/`)&&!!i,s=n.pathname.includes(`/f/`)&&!!i,c=n.pathname.endsWith(`/activity`),l=n.pathname.endsWith(`/health`),u=n.pathname===`/search`,d=A_(r??``,o?i??``:``).data?.derived?.title??(i?i.split(`/`).pop():``),f=i?i.split(`/`):[],p=f.slice(0,-1),m=f[f.length-1]??``,g=(0,h.jsx)(`span`,{className:`text-subtle/50 select-none mx-0.5`,children:`/`});return(0,h.jsxs)(`nav`,{"aria-label":`Breadcrumbs`,className:X(`flex items-center gap-1 text-xs overflow-hidden whitespace-nowrap min-w-0`,e),children:[(0,h.jsx)($g,{to:`/`,className:X(`transition-colors shrink-0`,!r&&!u?`font-medium text-fg`:`text-muted hover:text-fg`),children:`Projects`}),u&&(0,h.jsxs)(h.Fragment,{children:[g,(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:`Search`})]}),r&&(0,h.jsxs)(h.Fragment,{children:[g,!o&&!s&&!c&&!l?(0,h.jsx)(`span`,{className:`font-medium text-fg truncate max-w-[200px]`,title:a,children:a}):(0,h.jsx)($g,{to:`/p/${encodeURIComponent(r)}`,className:`text-muted hover:text-fg transition-colors truncate max-w-[160px] shrink-0`,title:a,children:a})]}),c&&(0,h.jsxs)(h.Fragment,{children:[g,(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:`Activity`})]}),l&&(0,h.jsxs)(h.Fragment,{children:[g,(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:`Health`})]}),(o||s)&&(0,h.jsxs)(h.Fragment,{children:[p.map((e,t)=>{let n=p.slice(0,t+1).join(`/`);return(0,h.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[g,(0,h.jsx)(`span`,{className:`text-subtle select-none max-w-[120px] truncate`,title:e,children:e})]},n)}),g,o?(0,h.jsx)(`span`,{className:`font-medium text-fg truncate max-w-[220px]`,title:d,children:d}):(0,h.jsx)(`span`,{className:`font-medium font-mono text-fg truncate max-w-[220px]`,title:m,children:m})]})]})}function ID({onMenuClick:e}){let{open:t}=pD();return(0,h.jsxs)(`header`,{className:`sticky top-0 z-30 h-14 bg-bg/70 backdrop-blur-xl border-b border-border flex items-center justify-between px-4 gap-4 shrink-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,h.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Open sidebar menu`,className:`lg:hidden p-1.5 -ml-1 rounded-lg text-muted hover:text-fg hover:bg-surface-2 transition-colors cursor-pointer shrink-0`,children:(0,h.jsx)(Tx,{size:18})}),(0,h.jsx)(FD,{})]}),(0,h.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center gap-2 px-2.5 py-1 rounded-lg bg-surface-2 hover:bg-surface border border-border hover:border-border-strong text-xs transition-colors cursor-pointer shrink-0`,title:`Search knowledge base (⌘K or /)`,children:[(0,h.jsx)(Vx,{size:13,className:`text-muted shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted hidden sm:inline`,children:`Search knowledge…`}),(0,h.jsx)(`kbd`,{className:`hidden sm:inline-block font-mono text-[10px] text-subtle bg-surface px-1.5 py-0.5 rounded border border-border`,children:`⌘K`})]})]})}function LD(){let{project:e}=Nh(),[t,n]=(0,m.useState)(()=>new Set),[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(!1),s=(0,m.useRef)(e);(0,m.useEffect)(()=>{s.current!==e&&(s.current=e,n(new Set))},[e]);let{pathname:c}=Dh();(0,m.useEffect)(()=>{c&&i(!1)},[c]);let l=(0,m.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,m.useCallback)(e=>{n(t=>{let n=new Set(t),r=e.split(`/`),i=``;for(let e of r)e&&(i=i?`${i}/${e}`:e,n.add(i));return n}),i(!0),requestAnimationFrame(()=>{try{document.querySelector(`[data-tree-path="${CSS.escape(e)}"]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})}catch{document.querySelector(`[data-tree-path]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})}})},[]),d=(0,m.useMemo)(()=>({expanded:t,toggle:l,reveal:u}),[t,l,u]),f=(0,m.useMemo)(()=>({open:()=>o(!0)}),[]);return(0,h.jsx)(gD.Provider,{value:d,children:(0,h.jsxs)(fD.Provider,{value:f,children:[(0,h.jsxs)(`div`,{className:`flex h-screen w-screen overflow-hidden text-fg`,children:[(0,h.jsx)(PD,{project:e,drawerOpen:r,onCloseDrawer:()=>i(!1)}),(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col min-w-0 h-full overflow-hidden`,children:[(0,h.jsx)(ID,{onMenuClick:()=>i(!0)}),(0,h.jsx)(`main`,{className:`flex-1 overflow-y-auto min-h-0`,children:(0,h.jsx)(og,{})})]})]}),(0,h.jsx)(hD,{open:a,onOpenChange:o,currentProject:e})]})})}var RD=new Intl.DateTimeFormat(void 0,{dateStyle:`full`});function zD(){let e=Nh().project??``,{data:t}=O_(e),{data:n,isLoading:r,isError:i,error:a,refetch:o}=M_(e,{limit:100}),s=(0,m.useMemo)(()=>{if(!n||n.length===0)return[];let e=[],t=``,r=[];for(let i of n){let n=RD.format(new Date(i.at));n===t?r.push(i):(r.length>0&&e.push({day:t,entries:r}),t=n,r=[i])}return r.length>0&&e.push({day:t,entries:r}),e},[n]),c=t?.title?`${t.title} Activity`:`Activity`;return r?(0,h.jsxs)(oS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-32 rounded-md`}),(0,h.jsx)(Q,{className:`h-8 w-48 rounded-lg`})]}),(0,h.jsx)(`div`,{className:`mt-8 space-y-8`,children:Array.from({length:2}).map((e,t)=>(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsx)(Q,{className:`h-5 w-40 rounded-md`}),(0,h.jsx)(`div`,{className:`rounded-xl border border-border bg-surface divide-y divide-border p-4 space-y-3`,children:Array.from({length:3}).map((e,t)=>(0,h.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(Q,{className:`h-7 w-7 rounded-full shrink-0`}),(0,h.jsxs)(`div`,{className:`space-y-1`,children:[(0,h.jsx)(Q,{className:`h-4 w-48`}),(0,h.jsx)(Q,{className:`h-3 w-32`})]})]}),(0,h.jsx)(Q,{className:`h-6 w-16 rounded-md`})]},t))})]},t))})]}):i?(0,h.jsx)(oS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(rS,{error:a,onRetry:()=>void o()})}):!n||n.length===0?(0,h.jsxs)(oS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-6`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}`,className:`transition-colors hover:text-fg`,children:t?.title??e}),(0,h.jsx)(`span`,{children:`/`}),(0,h.jsx)(`span`,{className:`text-fg`,children:`Activity`})]}),(0,h.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:`Activity`})]}),(0,h.jsx)(nS,{icon:Fx,title:`No activity recorded`,hint:`Changes to concepts and files in this project will appear here.`,className:`mt-8 py-16`})]}):(0,h.jsxs)(oS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-8`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}`,className:`transition-colors hover:text-fg`,children:t?.title??e}),(0,h.jsx)(`span`,{children:`/`}),(0,h.jsx)(`span`,{className:`text-fg`,children:`Activity`})]}),(0,h.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:`Activity`}),(0,h.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`History of commits and updates for `,t?.title??e]})]}),(0,h.jsx)(`div`,{className:`space-y-8`,children:s.map(e=>(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wider text-muted`,children:e.day}),(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:e.entries.map(e=>{let t=e.actor.startsWith(`human:`),n=t?e.actor.slice(6):e.actor;return(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0`,children:[(0,h.jsx)(MD,{actor:e.actor,size:28,className:`mt-0.5 shrink-0`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`text-sm font-medium text-fg break-words`,children:e.subject}),(0,h.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-xs text-muted`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-subtle`,children:[t?(0,h.jsx)($x,{size:12,className:`shrink-0 text-muted`}):(0,h.jsx)(Tb,{size:12,className:`shrink-0 text-muted`}),(0,h.jsx)(`span`,{className:`truncate max-w-[200px]`,children:n})]}),e.principal&&(0,h.jsxs)(`span`,{className:`font-mono text-xs text-subtle truncate max-w-[200px]`,children:[`(`,e.principal,`)`]}),(0,h.jsx)(`span`,{children:`·`}),(0,h.jsx)(`span`,{title:wD(e.at),children:CD(e.at)})]})]})]}),(0,h.jsx)(`div`,{className:`flex items-center gap-2 self-end sm:self-center shrink-0`,children:(0,h.jsx)(cS,{value:e.sha,label:OD(e.sha),className:`font-mono text-xs`})})]},e.sha)})})]},e.day))})]})}function BD(){let{completeLogin:e}=Gy(),t=kh(),[n,r]=(0,m.useState)(null),i=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{if(i.current)return;i.current=!0;let n=new URL(window.location.href);e(n).then(e=>{t(e,{replace:!0})}).catch(e=>{r(e instanceof Error?e.message:String(e))})},[e,t]),n===null?(0,h.jsx)(oS,{title:`Signing in`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3`,children:[(0,h.jsx)(xx,{size:36,className:`animate-spin text-accent-500`}),(0,h.jsx)(`p`,{className:`text-sm font-medium text-muted`,children:`Signing you in…`})]})}):(0,h.jsx)(dS,{error:n})}function VD({className:e,children:t}){return(0,h.jsx)(`span`,{className:X(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset`,e),children:t})}function HD({status:e,className:t}){let n=e.toLowerCase(),r=`bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 ring-zinc-500/20`;return n===`draft`?r=`bg-amber-500/10 text-amber-600 dark:text-amber-400 ring-amber-500/20`:n===`stable`?r=`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-emerald-500/20`:n===`deprecated`&&(r=`bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-rose-500/20`),(0,h.jsx)(VD,{className:X(r,t),children:e})}function UD({tier:e,className:t}){let n=e.toLowerCase();return n===`human-reviewed`?(0,h.jsxs)(VD,{className:X(`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-emerald-500/20`,t),children:[(0,h.jsx)(Ux,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`human-reviewed`})]}):n===`machine-confirmed`?(0,h.jsxs)(VD,{className:X(`bg-sky-500/10 text-sky-600 dark:text-sky-400 ring-sky-500/20`,t),children:[(0,h.jsx)(_b,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`machine-confirmed`})]}):(0,h.jsxs)(VD,{className:X(`bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 ring-zinc-500/20`,t),children:[(0,h.jsx)(Vb,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:e||`unverified`})]})}function WD({className:e}){return(0,h.jsxs)(VD,{className:X(`bg-orange-500/10 text-orange-600 dark:text-orange-400 ring-orange-500/20`,e),children:[(0,h.jsx)(Ub,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Stale`})]})}function GD({type:e,className:t}){return(0,h.jsxs)(VD,{className:X(`bg-surface-2 text-fg ring-border`,t),children:[(0,h.jsx)(lD,{type:e,size:12}),(0,h.jsx)(`span`,{children:e||`Concept`})]})}function KD({code:e,lang:t,lineNumbers:n=!1,className:r}){let[i,a]=(0,m.useState)(null);(0,m.useEffect)(()=>{let n=!1;if(!t){a(null);return}return Ag(async()=>{let{highlight:e}=await import(`./highlight-CW19vWvw.js`);return{highlight:e}},[]).then(({highlight:n})=>n(e,t)).then(e=>{n||a(e)}).catch(()=>{n||a(null)}),()=>{n=!0}},[e,t]);let o=e.split(`
58
- `);return(0,h.jsxs)(`div`,{className:X(`relative group`,r),children:[(0,h.jsx)(`div`,{className:`absolute top-2.5 right-2.5 z-10 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity`,children:(0,h.jsx)(cS,{value:e})}),i?(0,h.jsx)(`div`,{className:X(n&&`okf-lines`),dangerouslySetInnerHTML:{__html:i}}):(0,h.jsx)(`pre`,{className:X(`okf-code overflow-x-auto`,n&&`okf-lines`),children:(0,h.jsx)(`code`,{children:n?o.map((e,t)=>(0,h.jsxs)(`span`,{className:`line`,children:[e,t<o.length-1?`
59
- `:``]},t)):e})})]})}var qD=14;function JD({project:e,conceptId:t,inbound:n,outbound:r,className:i}){let a=kh();if(n.length===0&&r.length===0)return(0,h.jsx)(`div`,{className:X(`rounded-xl border border-border bg-surface-2/40 p-4 text-center text-xs text-muted italic`,i),children:`No connections yet`});let o=n.slice(0,6),s=n.length-o.length,c=r.slice(0,6),l=r.length-c.length,u=t.split(`/`).pop()??t,d=u.length>qD?`${u.slice(0,13)}…`:u,f=(e,t)=>t===1?110:24+e*172/(t-1),p=(e,t)=>t===1?110:24+e*172/(t-1);return(0,h.jsxs)(`div`,{className:X(`rounded-xl border border-border bg-surface-2/30 p-2.5`,i),children:[(0,h.jsx)(`div`,{className:`mb-2 px-1 text-xs font-semibold uppercase tracking-wider text-muted`,children:`Connections`}),(0,h.jsxs)(`svg`,{viewBox:`0 0 280 220`,className:`w-full h-auto overflow-visible select-none text-[11px]`,"aria-label":`Connections graph`,children:[(0,h.jsxs)(`defs`,{children:[(0,h.jsxs)(`linearGradient`,{id:`okf-grad-inbound`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,h.jsx)(`stop`,{offset:`0%`,stopColor:`#22d3ee`}),(0,h.jsx)(`stop`,{offset:`100%`,stopColor:`#8b5cf6`})]}),(0,h.jsxs)(`linearGradient`,{id:`okf-grad-outbound`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,h.jsx)(`stop`,{offset:`0%`,stopColor:`#8b5cf6`}),(0,h.jsx)(`stop`,{offset:`100%`,stopColor:`#22d3ee`})]}),(0,h.jsx)(`marker`,{id:`okf-arrow-in`,viewBox:`0 0 8 8`,refX:`6`,refY:`4`,markerWidth:`5`,markerHeight:`5`,orient:`auto`,children:(0,h.jsx)(`path`,{d:`M 0 1 L 6 4 L 0 7`,fill:`none`,stroke:`#8b5cf6`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,h.jsx)(`marker`,{id:`okf-arrow-out`,viewBox:`0 0 8 8`,refX:`6`,refY:`4`,markerWidth:`5`,markerHeight:`5`,orient:`auto`,children:(0,h.jsx)(`path`,{d:`M 0 1 L 6 4 L 0 7`,fill:`none`,stroke:`#22d3ee`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),o.map((e,t)=>{let n=f(t,o.length),r=`M 70 ${n} C 85 ${n}, 85 110, 100 110`;return(0,h.jsx)(Gd.path,{d:r,fill:`none`,stroke:`url(#okf-grad-inbound)`,strokeWidth:`1.5`,markerEnd:`url(#okf-arrow-in)`,initial:{pathLength:0},animate:{pathLength:1},transition:{duration:.4,delay:t*.04,ease:`easeOut`}},`edge-in-${o[t]}`)}),c.map((e,t)=>{let n=p(t,c.length),r=`M 180 110 C 195 110, 195 ${n}, 210 ${n}`;return(0,h.jsx)(Gd.path,{d:r,fill:`none`,stroke:`url(#okf-grad-outbound)`,strokeWidth:`1.5`,markerEnd:`url(#okf-arrow-out)`,initial:{pathLength:0},animate:{pathLength:1},transition:{duration:.4,delay:(o.length+t)*.04,ease:`easeOut`}},`edge-out-${e.id}`)}),(0,h.jsxs)(`g`,{className:`cursor-default`,children:[(0,h.jsx)(`rect`,{x:`100`,y:`98`,width:`80`,height:`24`,rx:`6`,className:`fill-surface stroke-accent-500/50 stroke-1.5`}),(0,h.jsx)(`text`,{x:`140`,y:`110`,textAnchor:`middle`,dominantBaseline:`central`,className:`fill-fg font-medium`,children:d}),(0,h.jsx)(`title`,{children:t})]}),o.map((t,n)=>{let r=f(n,o.length),i=t.split(`/`).pop()??t,s=i.length>qD?`${i.slice(0,13)}…`:i;return(0,h.jsxs)(`g`,{className:`cursor-pointer`,onClick:()=>a(QE(e,t)),children:[(0,h.jsx)(`rect`,{x:`2`,y:r-10,width:`68`,height:`20`,rx:`5`,className:`fill-surface stroke-border hover:stroke-accent-500 hover:fill-surface-2 transition-colors stroke-1`}),(0,h.jsx)(`text`,{x:`36`,y:r,textAnchor:`middle`,dominantBaseline:`central`,className:`fill-muted hover:fill-fg text-[10px] pointer-events-none`,children:s}),(0,h.jsx)(`title`,{children:t})]},`in-${t}`)}),s>0&&(0,h.jsxs)(`text`,{x:`36`,y:`212`,textAnchor:`middle`,className:`fill-subtle text-[10px] font-mono`,children:[`+`,s,` more`]}),c.map((t,n)=>{let r=p(n,c.length),i=t.id.split(`/`).pop()??t.id,o=i.length>qD?`${i.slice(0,13)}…`:i,s=t.exists!==!1;return(0,h.jsxs)(`g`,{className:s?`cursor-pointer`:`cursor-not-allowed`,onClick:()=>{s&&a(QE(e,t.id))},children:[(0,h.jsx)(`rect`,{x:`210`,y:r-10,width:`68`,height:`20`,rx:`5`,strokeDasharray:t.exists===!1?`3 2`:void 0,className:t.exists===!1?`fill-surface stroke-rose-500/80 stroke-1`:`fill-surface stroke-border hover:stroke-accent-500 hover:fill-surface-2 transition-colors stroke-1`}),(0,h.jsx)(`text`,{x:`244`,y:r,textAnchor:`middle`,dominantBaseline:`central`,className:t.exists===!1?`fill-rose-500 text-[10px] pointer-events-none`:`fill-muted hover:fill-fg text-[10px] pointer-events-none`,children:o}),(0,h.jsxs)(`title`,{children:[t.id,t.exists===!1?` (missing)`:``]})]},`out-${t.id}`)}),l>0&&(0,h.jsxs)(`text`,{x:`244`,y:`212`,textAnchor:`middle`,className:`fill-subtle text-[10px] font-mono`,children:[`+`,l,` more`]})]})]})}function YD(e,t){this.v=e,this.k=t}function XD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZD(e){if(Array.isArray(e))return e}function QD(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function $D(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
60
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eO(e,t){return ZD(e)||QD(e,t)||tO(e,t)||$D()}function tO(e,t){if(e){if(typeof e==`string`)return XD(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XD(e,t):void 0}}function nO(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof YD;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}nO.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},nO.prototype.next=function(e){return this._invoke(`next`,e)},nO.prototype.throw=function(e){return this._invoke(`throw`,e)},nO.prototype.return=function(e){return this._invoke(`return`,e)};var rO=Object.entries,iO=Object.setPrototypeOf,aO=Object.isFrozen,oO=Object.getPrototypeOf,sO=Object.getOwnPropertyDescriptor,cO=Object.freeze,lO=Object.seal,uO=Object.create,dO=typeof Reflect<`u`&&Reflect,fO=dO.apply,pO=dO.construct;cO||=function(e){return e},lO||=function(e){return e},fO||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},pO||=function(e){return new e(...[...arguments].slice(1))};var mO=PO(Array.prototype.forEach);Array.prototype.indexOf;var hO=PO(Array.prototype.lastIndexOf),gO=PO(Array.prototype.pop),_O=PO(Array.prototype.push);Array.prototype.slice;var vO=PO(Array.prototype.splice),yO=Array.isArray,bO=PO(String.prototype.toLowerCase),xO=PO(String.prototype.toString),SO=PO(String.prototype.match),CO=PO(String.prototype.replace),wO=PO(String.prototype.indexOf),TO=PO(String.prototype.trim),EO=PO(Number.prototype.toString),DO=PO(Boolean.prototype.toString),OO=typeof BigInt>`u`?null:PO(BigInt.prototype.toString),kO=typeof Symbol>`u`?null:PO(Symbol.prototype.toString),AO=PO(Object.prototype.hasOwnProperty),jO=PO(Object.prototype.toString),MO=PO(RegExp.prototype.test),NO=FO(TypeError);function PO(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return fO(e,t,n)}}function FO(e){return function(){return pO(e,[...arguments])}}function IO(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bO;if(iO&&iO(e,null),!yO(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(aO(t)||(t[r]=e),i=e)}e[i]=!0}return e}function LO(e){for(let t=0;t<e.length;t++)AO(e,t)||(e[t]=null);return e}function RO(e){let t=uO(null);for(let r of rO(e)){var n=eO(r,2);let i=n[0],a=n[1];AO(e,i)&&(t[i]=yO(a)?LO(a):a&&typeof a==`object`&&a.constructor===Object?RO(a):a)}return t}function zO(e){switch(typeof e){case`string`:return e;case`number`:return EO(e);case`boolean`:return DO(e);case`bigint`:return OO?OO(e):`0`;case`symbol`:return kO?kO(e):`Symbol()`;case`undefined`:return jO(e);case`function`:case`object`:{if(e===null)return jO(e);let t=e,n=BO(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:jO(e)}return jO(e)}default:return jO(e)}}function BO(e,t){for(;e!==null;){let n=sO(e,t);if(n){if(n.get)return PO(n.get);if(typeof n.value==`function`)return PO(n.value)}e=oO(e)}function n(){return null}return n}function VO(e){try{return MO(e,``),!0}catch{return!1}}var HO=cO(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),UO=cO(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),WO=cO([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),GO=cO([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),KO=cO(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),qO=cO([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),JO=cO([`#text`]),YO=cO(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),XO=cO(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),ZO=cO(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),QO=cO([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),$O=lO(/{{[\w\W]*|^[\w\W]*}}/g),ek=lO(/<%[\w\W]*|^[\w\W]*%>/g),tk=lO(/\${[\w\W]*/g),nk=lO(/^data-[\-\w.\u00B7-\uFFFF]+$/),rk=lO(/^aria-[\-\w]+$/),ik=lO(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ak=lO(/^(?:\w+script|data):/i),ok=lO(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sk=lO(/^html$/i),ck=lO(/^[a-z][.\w]*(-[.\w]+)+$/i),lk=lO(/<[/\w!]/g),uk=lO(/<[/\w]/g),dk=lO(/<\/no(script|embed|frames)/i),fk=lO(/\/>/i),pk={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mk=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],hk=cO(IO({},mk)),gk=function(){let e={};return mO(mk,t=>{e[t]=lO(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),cO(e)}(),_k=function(){return typeof window>`u`?null:window},vk=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},yk=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},bk=function(e,t,n,r){return AO(e,t)&&yO(e[t])?IO(r.base?RO(r.base):{},e[t],r.transform):n},xk=function(e,t,n){let r=AO(e,t)?e[t]:void 0;return r&&typeof r==`object`?RO(r):n()};function Sk(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_k(),t=e=>Sk(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==pk.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=BO(d,`cloneNode`),p=BO(d,`remove`),m=BO(d,`removeAttributeNode`),h=BO(d,`nextSibling`),g=BO(d,`childNodes`),_=BO(d,`parentNode`),v=BO(d,`shadowRoot`),y=BO(d,`attributes`),b=o&&o.prototype?BO(o.prototype,`nodeType`):null,x=o&&o.prototype?BO(o.prototype,`nodeName`):null,S=o&&o.prototype?BO(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,O=!1,k=0,ee=function(){if(k>0)throw NO(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){ee(),k++;try{return T.createHTML(e)}finally{k--}},te=function(e){ee(),k++;try{return T.createScriptURL(e)}finally{k--}},ne=function(){return O||=(D=vk(u,i),!0),D},re=n,ie=re.implementation,ae=re.createNodeIterator,oe=re.createDocumentFragment,se=re.getElementsByTagName,ce=r.importNode,j=yk();t.isSupported=typeof rO==`function`&&typeof _==`function`&&ie&&ie.createHTMLDocument!==void 0;let le=$O,ue=ek,de=tk,fe=nk,pe=rk,me=ak,he=ok,ge=ck,M=ik,N=null,_e=IO({},[...HO,...UO,...WO,...KO,...JO]),P=null,ve=IO({},[...YO,...XO,...ZO,...QO]),F=Object.seal(uO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,be=null,xe=Object.seal(uO(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Se=!0,Ce=!0,we=!1,Te=!0,Ee=!1,De=!0,Oe=!1,ke=!1,Ae=null,je=null,Me=!1,Ne=!1,Pe=!1,Fe=!1,Ie=!0,Le=!1,Re=`user-content-`,ze=!0,Be=!1,Ve={},He=null,Ue=IO({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),We=null,Ge=IO({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ke=null,qe=IO({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Je=`http://www.w3.org/1998/Math/MathML`,Ye=`http://www.w3.org/2000/svg`,Xe=`http://www.w3.org/1999/xhtml`,Ze=Xe,Qe=!1,$e=null,et=IO({},[Je,Ye,Xe],xO),tt=cO([`mi`,`mo`,`mn`,`ms`,`mtext`]),nt=IO({},tt),rt=cO([`annotation-xml`]),it=IO({},rt),at=IO({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],ct=null,lt=null,ut=n.createElement(`form`),dt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(lt&&lt===e)return;(!e||typeof e!=`object`)&&(e={}),e=RO(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ct=ot===`application/xhtml+xml`?xO:bO,N=bk(e,`ALLOWED_TAGS`,_e,{transform:ct}),P=bk(e,`ALLOWED_ATTR`,ve,{transform:ct}),$e=bk(e,`ALLOWED_NAMESPACES`,et,{transform:xO}),Ke=bk(e,`ADD_URI_SAFE_ATTR`,qe,{transform:ct,base:qe}),We=bk(e,`ADD_DATA_URI_TAGS`,Ge,{transform:ct,base:Ge}),He=bk(e,`FORBID_CONTENTS`,Ue,{transform:ct}),ye=bk(e,`FORBID_TAGS`,RO({}),{transform:ct}),be=bk(e,`FORBID_ATTR`,RO({}),{transform:ct}),Ve=AO(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?RO(e.USE_PROFILES):e.USE_PROFILES:!1,Se=e.ALLOW_ARIA_ATTR!==!1,Ce=e.ALLOW_DATA_ATTR!==!1,we=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=e.SAFE_FOR_TEMPLATES||!1,De=e.SAFE_FOR_XML!==!1,Oe=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Fe=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Ie=e.SANITIZE_DOM!==!1,Le=e.SANITIZE_NAMED_PROPS||!1,ze=e.KEEP_CONTENT!==!1,Be=e.IN_PLACE||!1,M=VO(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:ik,Ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Xe,nt=xk(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>IO({},tt)),it=xk(e,`HTML_INTEGRATION_POINTS`,()=>IO({},rt));let t=xk(e,`CUSTOM_ELEMENT_HANDLING`,()=>uO(null));if(F=uO(null),AO(t,`tagNameCheck`)&&dt(t.tagNameCheck)&&(F.tagNameCheck=t.tagNameCheck),AO(t,`attributeNameCheck`)&&dt(t.attributeNameCheck)&&(F.attributeNameCheck=t.attributeNameCheck),AO(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(F.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),lO(F),Ee&&(Ce=!1),Pe&&(Ne=!0),Ve&&(N=IO({},JO),P=uO(null),Ve.html===!0&&(IO(N,HO),IO(P,YO)),Ve.svg===!0&&(IO(N,UO),IO(P,XO),IO(P,QO)),Ve.svgFilters===!0&&(IO(N,WO),IO(P,XO),IO(P,QO)),Ve.mathMl===!0&&(IO(N,KO),IO(P,ZO),IO(P,QO))),xe.tagCheck=null,xe.attributeCheck=null,AO(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?xe.tagCheck=e.ADD_TAGS:yO(e.ADD_TAGS)&&(N===_e&&(N=RO(N)),IO(N,e.ADD_TAGS,ct))),AO(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?xe.attributeCheck=e.ADD_ATTR:yO(e.ADD_ATTR)&&(P===ve&&(P=RO(P)),IO(P,e.ADD_ATTR,ct))),AO(e,`ADD_FORBID_CONTENTS`)&&yO(e.ADD_FORBID_CONTENTS)&&(He===Ue&&(He=RO(He)),IO(He,e.ADD_FORBID_CONTENTS,ct)),ze&&(N[`#text`]=!0),Oe&&IO(N,[`html`,`head`,`body`]),N.table&&(IO(N,[`tbody`]),delete ye.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw NO(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw NO(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ne()),T&&typeof E==`string`&&(E=A(``)));cO&&cO(e),lt=e},pt=IO({},[...UO,...WO,...GO]),mt=IO({},[...KO,...qO]),ht=function(e,t,n){return t.namespaceURI===Xe?e===`svg`:t.namespaceURI===Je?e===`svg`&&(n===`annotation-xml`||nt[n]):!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Xe?e===`math`:t.namespaceURI===Ye?e===`math`&&it[n]:!!mt[e]},_t=function(e,t,n){return t.namespaceURI===Ye&&!it[n]||t.namespaceURI===Je&&!nt[n]?!1:!mt[e]&&(at[e]||!pt[e])},vt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Ze,tagName:`template`});let n=bO(e.tagName),r=bO(t.tagName);return $e[e.namespaceURI]?e.namespaceURI===Ye?ht(n,t,r):e.namespaceURI===Je?gt(n,t,r):e.namespaceURI===Xe?_t(n,t,r):!!(ot===`application/xhtml+xml`&&$e[e.namespaceURI]):!1},yt=function(e){_O(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw NO(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},bt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},xt=function(e){wt(e);let t=g(e);if(t){let e=[];mO(t,t=>{_O(e,t)}),mO(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&bt(e,r,i)}},St=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}_O(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ne||Pe)try{yt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ct=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||P[ct(i)]||bt(e,r,i)}},wt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===pk.element&&Ct(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Tt=function(e,t){return De?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Et=function(e){if(!De)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===pk.processingInstruction||n===pk.comment&&MO(uk,e.data)){try{p(e)}catch{}continue}if(n===pk.element){let t=e,n=ct(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Tt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Dt=function(e){let t=null,r=null;if(Me)e=`<remove></remove>`+e;else{let t=SO(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&Ze===Xe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(Ze===Xe)try{t=new l().parseFromString(i,ot)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Ze,`template`,null);try{t.documentElement.innerHTML=Qe?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ze===Xe?se.call(t,Oe?`html`:`body`)[0]:Oe?t.documentElement:a},Ot=function(e){let t=S?S(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},kt=function(e){return e=CO(e,le,` `),e=CO(e,ue,` `),e=CO(e,de,` `),e},At=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=kt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&mO(i,e=>{Mt(e.content)&&At(e.content)})},jt=function(e){let t=x?x(e):null;return typeof t!=`string`||ct(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===pk.documentFragment}catch{return!1}},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Pt(e,n,r){e.length!==0&&mO(e,e=>{e.call(t,n,r,lt)})}let Ft=function(e,t){return!!(De&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&MO(lk,e.textContent)&&MO(lk,e.innerHTML)||De&&e.namespaceURI===Xe&&hk[t]&&(Nt(e.firstElementChild)||typeof e.textContent==`string`&&MO(gk[t],e.textContent))||e.nodeType===pk.processingInstruction||De&&e.nodeType===pk.comment&&MO(uk,e.data))},It=function(e,t){return e instanceof RegExp?MO(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Lt=function(e,t,n){if(!ye[t]&&Ut(t)&&It(F.tagNameCheck,t))return!1;if(ze&&!He[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return yt(e),!0},Rt=function(e,t,n,r){return e.length===0?t:t===n||t===r?RO(t):t},zt=function(e,t){return e===t||_(e)!==null?!1:(Be&&wt(e),!0)},Bt=function(e,n){if(Pt(j.beforeSanitizeElements,e,null),zt(e,n))return!0;if(jt(e))return yt(e),!0;let r=ct(w(e));if(N=Rt(j.uponSanitizeElement,N,_e,Ae),Pt(j.uponSanitizeElement,e,{tagName:r,allowedTags:N}),zt(e,n))return!0;if(Ft(e,r))return yt(e),!0;if(ye[r]||!(xe.tagCheck instanceof Function&&xe.tagCheck(r))&&!N[r]){let t=Lt(e,r,n);return t===!1&&(Pt(j.afterSanitizeElements,e,null),zt(e,n))?!0:t}if(C(e)===pk.element&&!vt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&MO(dk,e.innerHTML))return yt(e),!0;if(Ee&&e.nodeType===pk.text){let n=kt(e.textContent);e.textContent!==n&&(_O(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Pt(j.afterSanitizeElements,e,null),zt(e,n)},Vt=function(e,t,r){if(be[t]||Tt(t,e)||Ie&&(t===`id`||t===`name`)&&(r in n||r in ut))return!1;let i=P[t]||xe.attributeCheck instanceof Function&&xe.attributeCheck(t,e);return Ce&&MO(fe,t)||Se&&MO(pe,t)?!0:i?Ke[t]||MO(M,CO(r,he,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&wO(r,`data:`)===0&&We[e]||we&&!MO(me,CO(r,he,``))?!0:!r:Ut(e)&&It(F.tagNameCheck,e)&&It(F.attributeNameCheck,t,e)||t===`is`&&F.allowCustomizedBuiltInElements&&It(F.tagNameCheck,r)},Ht=IO({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ut=function(e){return!Ht[bO(e)]&&MO(ge,e)},Wt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return te(r)}return r},Gt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!jt(e)||(yt(e),!1)}catch{return St(t,e),!1}},Kt=function(e,n){if(Pt(j.beforeSanitizeAttributes,e,null),zt(e,n))return;let r=e.attributes;if(!r||jt(e))return;P=Rt(j.uponSanitizeAttribute,P,ve,je);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0},a=r.length,o=ct(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=ct(s),d=l,f=s===`value`?d:TO(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Pt(j.uponSanitizeAttribute,e,i),f=i.attrValue,Le&&(u===`id`||u===`name`)&&wO(f,Re)!==0&&(St(s,e,n),f=Re+f,p=!0),De&&MO(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){St(s,e,n);continue}if(u===`attributename`&&SO(f,`href`)){St(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){St(s,e,n);continue}if(!Te&&MO(fk,f)){St(s,e,n);continue}if(Ee&&(f=kt(f)),!Vt(o,u,f)){St(s,e,n);continue}f=Wt(o,u,c,f),f!==d&&Gt(e,s,c,f)&&p&&gO(t.removed)}}Pt(j.afterSanitizeAttributes,e,null),zt(e,n)},I=function(e){let t=null,n=Ot(e);for(Pt(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Pt(j.uponSanitizeShadowNode,t,null),Bt(t,e),Kt(t,e),Mt(t.content)&&I(t.content),C(t)===pk.element){let e=v(t);Mt(e)&&(qt(e),I(e))}Pt(j.afterSanitizeShadowDOM,e,null)},qt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){I(e.shadow);continue}let n=e.node,r=C(n)===pk.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&ct(e)===`template`){let e=n.content;Mt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Mt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Qe=!e,Qe&&(e=`<!-->`),typeof e!=`string`&&!Nt(e)&&(e=zO(e),typeof e!=`string`))throw NO(`dirty is not a string, aborting`);if(!t.isSupported)return e;ke?(N=Ae,P=je):ft(n),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(N=RO(N)),j.uponSanitizeAttribute.length>0&&(P=RO(P)),t.removed=[];let c=Be&&typeof e!=`string`&&Nt(e);if(c){Et(e);let t=w(e);if(typeof t==`string`){let n=ct(t);if(!N[n]||ye[n])throw xt(e),NO(`root node is forbidden and cannot be sanitized in-place`)}if(jt(e))throw xt(e),NO(`root node is clobbered and cannot be sanitized in-place`);try{qt(e)}catch(t){throw xt(e),t}}else if(Nt(e))i=Dt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===pk.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),qt(i);else{if(!Ne&&!Ee&&!Oe&&e.indexOf(`<`)===-1)return T&&Fe?A(e):e;if(i=Dt(e),!i)return Ne?null:Fe?E:``}i&&Me&&yt(i.firstChild);let l=c?e:i;try{let e=Ot(l);for(;o=e.nextNode();)Bt(o,l),Kt(o,l),Mt(o.content)&&I(o.content)}catch(n){throw c&&(xt(e),mO(t.removed,e=>{e.element&&wt(e.element)})),n}if(c){let n=!1;if(mO(t.removed,t=>{t.element&&(t.element===e&&(n=!0),wt(t.element))}),n)throw NO(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ee&&At(e),e}if(Ne){if(Ee&&At(i),Pe)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(P.shadowroot||P.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=Oe?i.outerHTML:i.innerHTML;return Oe&&N[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&MO(sk,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
61
- `+u),Ee&&(u=kt(u)),T&&Fe?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ft(e),ke=!0,Ae=N,je=P},t.clearConfig=function(){lt=null,ke=!1,Ae=null,je=null,T=D,E=``},t.isValidAttribute=function(e,t,n){lt||ft({});let r=ct(e),i=ct(t);return Vt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&AO(j,e)&&_O(j[e],t)},t.removeHook=function(e,t){if(AO(j,e)){if(t!==void 0){let n=hO(j[e],t);return n===-1?void 0:vO(j[e],n,1)[0]}return gO(j[e])}},t.removeHooks=function(e){AO(j,e)&&(j[e]=[])},t.removeAllHooks=function(){j=yk()},t}var Ck=Sk();function wk(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tk=wk();function Ek(e){Tk=e}var Dk={exec:()=>null};function Ok(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function $(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Ak.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var kk=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Ak={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ok(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ok(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ok(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ok(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Ok(e=>RegExp(`^ {0,${e}}(?:</?(?:${Gk})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:Ok(e=>RegExp(`^ {0,${e}}>`))},jk=/^(?:[ \t]*(?:\n|$))+/,Mk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Nk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Pk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Fk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ik=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Lk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rk=$(Lk).replace(/bull/g,Ik).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),zk=$(Lk).replace(/bull/g,Ik).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Bk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Vk=/^[^\n]+/,Hk=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Uk=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Hk).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Wk=$(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ik).getRegex(),Gk=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Kk=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,qk=$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Kk).replace(`tag`,Gk).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Jk=e=>$(Bk).replace(`hr`,Pk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Gk).getRegex(),Yk=Jk(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Xk=Jk(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Zk={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Xk).getRegex(),code:Mk,def:Uk,fences:Nk,heading:Fk,hr:Pk,html:qk,lheading:Rk,list:Wk,newline:jk,paragraph:Yk,table:Dk,text:Vk},Qk=$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Pk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Gk).getRegex(),$k={...Zk,lheading:zk,table:Qk,paragraph:$(Bk).replace(`hr`,Pk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Qk).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Gk).getRegex()},eA={...Zk,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Kk).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Dk,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(Bk).replace(`hr`,Pk).replace(`heading`,` *#{1,6} *[^
62
- ]`).replace(`lheading`,Rk).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},tA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nA=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rA=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,iA=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,aA=/[\p{P}\p{S}]/u,oA=/[\s\p{P}\p{S}]/u,sA=/[^\s\p{P}\p{S}]/u,cA=$(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,oA).getRegex(),lA=/[\p{Pi}\p{Ps}"']/u,uA=/(?!~)[\p{P}\p{S}]/u,dA=/(?!~)[\s\p{P}\p{S}]/u,fA=/(?:[^\s\p{P}\p{S}]|~)/u,pA=$(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,kk?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),mA=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,hA=$(mA,`u`).replace(/punct/g,aA).getRegex(),gA=$(mA,`u`).replace(/punct/g,uA).getRegex(),_A=$(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,lA).replace(/punct/g,aA).getRegex(),vA=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,yA=$(vA,`gu`).replace(/notPunctSpace/g,sA).replace(/punctSpace/g,oA).replace(/punct/g,aA).getRegex(),bA=$(vA,`gu`).replace(/notPunctSpace/g,fA).replace(/punctSpace/g,dA).replace(/punct/g,uA).getRegex(),xA=$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,sA).replace(/punctSpace/g,oA).replace(/punct/g,aA).getRegex(),SA=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,sA).replace(/punctSpace/g,oA).replace(/punct/g,aA).getRegex(),CA=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,sA).replace(/punctSpace/g,oA).replace(/punct/g,aA).getRegex(),wA=$(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,aA).getRegex(),TA=$(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,sA).replace(/punctSpace/g,oA).replace(/punct/g,aA).getRegex(),EA=$(/\\(punct)/,`gu`).replace(/punct/g,aA).getRegex(),DA=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),OA=$(Kk).replace(`(?:-->|$)`,`-->`).getRegex(),kA=$(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,OA).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),AA=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,jA=$(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,AA).getRegex(),MA=$(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,jA).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),NA=$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,jA).replace(`ref`,Hk).getRegex(),PA=$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Hk).getRegex(),FA=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,IA=$(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,AA).getRegex(),LA=$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,IA).replace(`ref`,FA).getRegex()).replace(`nolink`,$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,FA).getRegex()).getRegex(),RA=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zA=$(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),BA={_backpedal:Dk,anyPunctuation:EA,autolink:DA,blockSkip:pA,br:rA,code:nA,del:Dk,delLDelim:Dk,delRDelim:Dk,emStrongLDelim:hA,emStrongRDelimAst:yA,emStrongRDelimUnd:SA,escape:tA,link:MA,nolink:PA,punctuation:cA,reflink:NA,reflinkSearch:LA,tag:kA,text:iA,url:Dk},VA={...BA,emStrongLDelim:_A,emStrongRDelimAst:xA,emStrongRDelimUnd:CA,link:$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,jA).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,jA).getRegex()},HA={...BA,emStrongRDelimAst:bA,emStrongLDelim:gA,delLDelim:wA,delRDelim:TA,url:$(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,zA).replace(`protocol`,RA).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,RA).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},UA={...HA,br:$(rA).replace(`{2,}`,`*`).getRegex(),text:$(HA.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},WA={normal:Zk,gfm:$k,pedantic:eA},GA={normal:BA,gfm:HA,breaks:UA,pedantic:VA},KA={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},qA=e=>KA[e];function JA(e,t){if(t){if(Ak.escapeTest.test(e))return e.replace(Ak.escapeReplace,qA)}else if(Ak.escapeTestNoEncode.test(e))return e.replace(Ak.escapeReplaceNoEncode,qA);return e}function YA(e){return e.replace(Ak.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function XA(e){try{e=encodeURI(e).replace(Ak.percentDecode,`%`)}catch{return null}return e}function ZA(e,t){let n=e.replace(Ak.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Ak.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Ak.slashPipe,`|`);return n}function QA(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function $A(e){let t=e.split(`
63
- `),n=t.length-1;for(;n>=0&&Ak.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
64
- `)}function ej(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function tj(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function nj(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function rj(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function ij(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
57
+ `},NT=0,PT=[];function FT(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(NT++)[0],a=m.useState(rT)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nw([e.lockRef.current],(e.shards||[]).map(AT),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=OT(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=xT(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=xT(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return DT(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(PT.length&&PT[PT.length-1]===a){var r=`deltaY`in n?kT(n):OT(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&jT(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(AT).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:IT(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=OT(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,kT(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,OT(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return PT.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,gT),document.addEventListener(`touchmove`,c,gT),document.addEventListener(`touchstart`,u,gT),function(){PT=PT.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,gT),document.removeEventListener(`touchmove`,c,gT),document.removeEventListener(`touchstart`,u,gT)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:MT(i)}):null,p?m.createElement(pT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function IT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var LT=qw(Jw,FT),RT=m.forwardRef(function(e,t){return m.createElement(Xw,jw({},e,{ref:t,sideCar:LT}))});RT.classNames=Xw.classNames;var zT=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},BT=new WeakMap,VT=new WeakMap,HT={},UT=0,WT=function(e){return e&&(e.host||WT(e.parentNode))},GT=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=WT(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},KT=function(e,t,n,r){var i=GT(t,Array.isArray(e)?e:[e]);HT[n]||(HT[n]=new WeakMap);var a=HT[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(BT.get(e)||0)+1,l=(a.get(e)||0)+1;BT.set(e,c),a.set(e,l),o.push(e),c===1&&i&&VT.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),UT++,function(){o.forEach(function(e){var t=BT.get(e)-1,i=a.get(e)-1;BT.set(e,t),a.set(e,i),t||(VT.has(e)||e.removeAttribute(r),VT.delete(e)),i||e.removeAttribute(n)}),UT--,UT||(BT=new WeakMap,BT=new WeakMap,VT=new WeakMap,HT={})}},qT=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||zT(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),KT(r,i,n,`aria-hidden`)):function(){return null}},JT=Object.defineProperty,YT=(e,t)=>JT(e,`name`,{value:t,configurable:!0}),XT=`Dialog`,[ZT,QT]=qS(XT),[$T,eE]=ZT(XT),tE=YT(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=lC({prop:r,defaultProp:i??!1,onChange:a,caller:XT}),[d,f]=m.useState(0),[p,g]=m.useState(0);return(0,h.jsx)($T,{scope:t,triggerRef:s,contentRef:c,contentId:eC(),titleId:eC(),descriptionId:eC(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:g,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),nE=`DialogPortal`,[rE,iE]=ZT(nE,{forceMount:void 0}),aE=YT(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=eE(nE,t);return(0,h.jsx)(rE,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,h.jsx)(vw,{present:n||a.open,children:(0,h.jsx)(mw,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),oE=`DialogOverlay`,sE=m.forwardRef(YT(function(e,t){let n=iE(oE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=eE(oE,e.__scopeDialog);return a.modal?(0,h.jsx)(vw,{present:r||a.open,children:(0,h.jsx)(lE,{...i,ref:t})}):null},`DialogOverlay`)),cE=gC(`DialogOverlay.RemoveScroll`),lE=m.forwardRef(YT(function(e,t){let{__scopeDialog:n,...r}=e,i=eE(oE,n),a=US(t,WC());return(0,h.jsx)(RT,{as:cE,allowPinchZoom:!0,shards:[i.contentRef],children:(0,h.jsx)(jC.div,{"data-state":hE(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),uE=`DialogContent`,dE=m.forwardRef(YT(function(e,t){let n=iE(uE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=eE(uE,e.__scopeDialog);return(0,h.jsx)(vw,{present:r||a.open,children:a.modal?(0,h.jsx)(fE,{...i,ref:t}):(0,h.jsx)(pE,{...i,ref:t})})},`DialogContent`)),fE=m.forwardRef(YT(function(e,t){let n=eE(uE,e.__scopeDialog),r=m.useRef(null),i=US(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return qT(e)},[]),(0,h.jsx)(mE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:PS(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:PS(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:PS(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),pE=m.forwardRef(YT(function(e,t){let n=eE(uE,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,h.jsx)(mE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),mE=m.forwardRef(YT(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=eE(uE,n);return kw(),(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(tw,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,h.jsx)(UC,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":hE(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function hE(e){return e?`open`:`closed`}YT(hE,`getState`);var gE=`[cmdk-group=""]`,_E=`[cmdk-group-items=""]`,vE=`[cmdk-group-heading=""]`,yE=`[cmdk-item=""]`,bE=`${yE}:not([aria-disabled="true"])`,xE=`cmdk-item-select`,SE=`data-value`,CE=(e,t,n)=>AS(e,t,n),wE=m.createContext(void 0),TE=()=>m.useContext(wE),EE=m.createContext(void 0),DE=()=>m.useContext(EE),OE=m.createContext(void 0),kE=m.forwardRef((e,t)=>{let n=UE(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=UE(()=>new Set),i=UE(()=>new Map),a=UE(()=>new Map),o=UE(()=>new Set),s=VE(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=eC(),b=eC(),x=eC(),S=m.useRef(null),C=KE();HE(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),HE(()=>{C(6,ee)},[]);let w=m.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||C(5,ee),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=m.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??CE;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;te().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(_E);t?t.appendChild(e.parentElement===t?e:e.closest(`${_E} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${_E} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${gE}[${SE}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=te().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(SE);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ee(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(gE)?.querySelector(vE))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${yE}[aria-selected="true"]`)}function te(){return Array.from(S.current?.querySelectorAll(bE)||[])}function ne(e){let t=te()[e];t&&w.setState(`value`,t.getAttribute(SE))}function re(e){var t;let n=A(),r=te(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(SE))}function ie(e){let t=A()?.closest(gE),n;for(;t&&!n;)t=e>0?zE(t,gE):BE(t,gE),n=t?.querySelector(bE);n?w.setState(`value`,n.getAttribute(SE)):re(e)}let ae=()=>ne(te().length-1),oe=e=>{e.preventDefault(),e.metaKey?ae():e.altKey?ie(1):re(1)},se=e=>{e.preventDefault(),e.metaKey?ne(0):e.altKey?ie(-1):re(-1)};return m.createElement(jC.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&oe(e);break;case`ArrowDown`:oe(e);break;case`p`:case`k`:_&&e.ctrlKey&&se(e);break;case`ArrowUp`:se(e);break;case`Home`:e.preventDefault(),ne(0);break;case`End`:e.preventDefault(),ae();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(xE);t.dispatchEvent(e)}}}}},m.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:YE},c),JE(e,e=>m.createElement(EE.Provider,{value:w},m.createElement(wE.Provider,{value:T},e))))}),AE=m.forwardRef((e,t)=>{let n=eC(),r=m.useRef(null),i=m.useContext(OE),a=TE(),o=VE(e),s=o.current?.forceMount??i?.forceMount;HE(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=GE(n,r,[e.value,e.children,r],e.keywords),l=DE(),u=WE(e=>e.value&&e.value===c.current),d=WE(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);m.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(xE,f),()=>t.removeEventListener(xE,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return m.createElement(jC.div,{ref:HS(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:p,onClick:h?void 0:f},e.children)}),jE=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=eC(),s=m.useRef(null),c=m.useRef(null),l=eC(),u=TE(),d=WE(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));HE(()=>u.group(o),[]),GE(o,s,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:o,forceMount:i}),[i]);return m.createElement(jC.div,{ref:HS(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&m.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),JE(e,e=>m.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},m.createElement(OE.Provider,{value:f},e))))}),ME=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=m.useRef(null),a=WE(e=>!e.search);return!n&&!a?null:m.createElement(jC.div,{ref:HS(i,t),...r,"cmdk-separator":``,role:`separator`})}),NE=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=DE(),o=WE(e=>e.search),s=WE(e=>e.selectedItemId),c=TE();return m.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),m.createElement(jC.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),PE=m.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=m.useRef(null),o=m.useRef(null),s=WE(e=>e.selectedItemId),c=TE();return m.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),m.createElement(jC.div,{ref:HS(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},JE(e,e=>m.createElement(`div`,{ref:HS(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),FE=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return m.createElement(tE,{open:n,onOpenChange:r},m.createElement(aE,{container:o},m.createElement(sE,{"cmdk-overlay":``,className:i}),m.createElement(dE,{"aria-label":e.label,"cmdk-dialog":``,className:a},m.createElement(kE,{ref:t,...s}))))}),IE=m.forwardRef((e,t)=>WE(e=>e.filtered.count===0)?m.createElement(jC.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),LE=m.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return m.createElement(jC.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},JE(e,e=>m.createElement(`div`,{"aria-hidden":!0},e)))}),RE=Object.assign(kE,{List:PE,Item:AE,Input:NE,Group:jE,Separator:ME,Dialog:FE,Empty:IE,Loading:LE});function zE(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function BE(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function VE(e){let t=m.useRef(e);return HE(()=>{t.current=e}),t}var HE=typeof window>`u`?m.useEffect:m.useLayoutEffect;function UE(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function WE(e){let t=DE(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function GE(e,t,n,r=[]){let i=m.useRef(),a=TE();return HE(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(SE,s),i.current=s}),i}var KE=()=>{let[e,t]=m.useState(),n=UE(()=>new Map);return HE(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function qE(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function JE({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(qE(t),{ref:t.ref},n(t.props.children)):n(t)}var YE={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},XE={"http:":!0,"https:":!0,"mailto:":!0,"tel:":!0};function ZE(e){return e.replace(/&#x([0-9a-f]+);?/gi,(e,t)=>{let n=Number.parseInt(t,16);return n>0&&n<1114111?String.fromCodePoint(n):``}).replace(/&#([0-9]+);?/g,(e,t)=>{let n=Number.parseInt(t,10);return n>0&&n<1114111?String.fromCodePoint(n):``}).replace(/&colon;?/gi,`:`).replace(/&tab;?/gi,``).replace(/&newline;?/gi,``)}function QE(e){let t=``;for(let n of e){let e=n.charCodeAt(0);e>32&&!(e>=127&&e<=159)&&!/\s/.test(n)&&(t+=n)}return t}function $E(e){let t=QE(ZE(e.trim())),n=/^[a-z][a-z0-9+.-]*:/i.exec(t);return n?n[0].toLowerCase():null}function eD(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47,r=e.split(`/`),i=[];for(let e=0;e<r.length;e++){let n=r[e];n&&n!==`.`&&(n===`..`?i.length>0&&i[i.length-1]!==`..`?i.pop():t||i.push(`..`):i.push(n))}let a=i.join(`/`);return t&&(a=`/${a}`),a.length===0?t?`/`:`.`:(n&&!a.endsWith(`/`)&&(a+=`/`),a)}function tD(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:e.slice(0,n)}function nD(e){if(e.length===0)return``;let t=0,n=-1,r=!0;for(let i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===47){if(!r){t=i+1;break}}else n===-1&&(r=!1,n=i+1);return n===-1?``:e.slice(t,n)}function rD(e,t){if(!e)return{kind:`invalid`};let n=$E(e);if(n!==null)return XE[n]?{kind:`external`,href:e.trim()}:{kind:`invalid`};let r=e.trim();if(r.startsWith(`//`)){if(e.includes(`\\`)||!/^\/\/[^/?#\s\\]+(?:\/[^\s\\]*)?(?:#[^\s\\]*)?$/.test(r))return{kind:`invalid`};let t=r;try{t=decodeURI(r)}catch{return{kind:`invalid`}}return t.includes(`\\`)?{kind:`invalid`}:{kind:`external`,href:r}}if(e.startsWith(`#`))return{kind:`anchor`,hash:e};if(e.includes(`\\`))return{kind:`invalid`};let i=e;try{i=decodeURI(e)}catch{}if(i.includes(`\\`)||i.startsWith(`//`)||i.startsWith(`/\\`))return{kind:`invalid`};let a=``,o=i.indexOf(`#`);o!==-1&&(a=i.slice(o),i=i.slice(0,o));let s=i.indexOf(`?`);s!==-1&&(i=i.slice(0,s));let c;if(i.startsWith(`/`))c=eD(i.slice(1));else{let e=tD(t),n=e===`.`?``:e;c=eD(n?`${n}/${i}`:i)}if(c.includes(`\\`)||c===`..`||c.startsWith(`../`)||i.endsWith(`/`))return{kind:`invalid`};if(c.endsWith(`.md`)){let e=nD(c);return e===`index.md`||e===`log.md`?{kind:`invalid`}:{kind:`concept`,id:c.slice(0,-3),hash:a}}return{kind:`file`,path:c,hash:a}}function iD(e,t){let n=t.startsWith(`/`)?t.slice(1):t;return`/p/${encodeURIComponent(e)}/c/${n}`}function aD(e,t){let n=t.startsWith(`/`)?t.slice(1):t;return`/p/${encodeURIComponent(e)}/f/${n}`}var oD=`okf.recent`,sD=8;function cD(e){return!!(e&&typeof e==`object`&&`project`in e&&typeof e.project==`string`&&`id`in e&&typeof e.id==`string`&&`title`in e&&typeof e.title==`string`&&`type`in e&&(e.type===null||typeof e.type==`string`))}function lD(){try{if(typeof localStorage>`u`)return[];let e=localStorage.getItem(oD);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(cD).slice(0,sD):[]}catch{return[]}}function uD(e){try{if(typeof localStorage>`u`)return;let t=[e,...lD().filter(t=>t.project!==e.project||t.id!==e.id)].slice(0,sD);localStorage.setItem(oD,JSON.stringify(t))}catch{}}function dD({text:e,query:t,className:n}){if(!e)return null;if(!t?.trim())return(0,h.jsx)(`span`,{className:n,children:e});let r=t.trim().split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),i=[],a={};for(let e of r){let t=e.toLowerCase();a[t]||(a[t]=!0,i.push(e))}if(i.sort((e,t)=>t.length-e.length),i.length===0)return(0,h.jsx)(`span`,{className:n,children:e});let o=i.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)),s=RegExp(`(${o.join(`|`)})`,`gi`),c=e.split(s);return(0,h.jsx)(`span`,{className:n,children:c.map((e,t)=>i.some(t=>t.toLowerCase()===e.toLowerCase())?(0,h.jsx)(`mark`,{className:`rounded-xs bg-amber-400/25 px-0.5 font-medium text-fg dark:bg-amber-400/35`,children:e},t):e)})}var fD=[`Project`,`Decision`,`Convention`,`Architecture`,`Component`,`Playbook`,`Interface`,`Reference`,`Glossary Term`],pD={project:`text-accent-500`,decision:`text-violet-600 dark:text-violet-400`,convention:`text-sky-600 dark:text-sky-400`,architecture:`text-cyan-600 dark:text-cyan-400`,component:`text-cyan-600 dark:text-cyan-400`,playbook:`text-emerald-600 dark:text-emerald-400`,interface:`text-amber-600 dark:text-amber-400`,reference:`text-zinc-600 dark:text-zinc-400`,"glossary term":`text-pink-600 dark:text-pink-400`};function mD(e){return e?pD[e.trim().toLowerCase()]??`text-zinc-600 dark:text-zinc-400`:`text-zinc-600 dark:text-zinc-400`}function hD({type:e,className:t,size:n=16}){let r=e?e.trim().toLowerCase():``,i=X(`shrink-0`,mD(e),t);switch(r){case`project`:return(0,h.jsx)(lx,{size:n,className:i});case`decision`:return(0,h.jsx)(Ux,{size:n,className:i});case`convention`:return(0,h.jsx)(Vx,{size:n,className:i});case`architecture`:return(0,h.jsx)(Fx,{size:n,className:i});case`component`:return(0,h.jsx)(jb,{size:n,className:i});case`playbook`:return(0,h.jsx)(Tb,{size:n,className:i});case`interface`:return(0,h.jsx)(Lx,{size:n,className:i});case`reference`:return(0,h.jsx)(Db,{size:n,className:i});case`glossary term`:return(0,h.jsx)(Cb,{size:n,className:i});default:return(0,h.jsx)(sx,{size:n,className:i})}}function gD({open:e=!1,className:t,size:n=16}){let r=X(`shrink-0 text-muted`,t);return e?(0,h.jsx)(dx,{size:n,className:r}):(0,h.jsx)(px,{size:n,className:r})}function _D({className:e,size:t=16}){return(0,h.jsx)(rx,{size:t,className:X(`shrink-0 text-muted`,e)})}var vD=(0,m.createContext)(null);function yD(){let e=(0,m.useContext)(vD);if(!e)throw Error(`useCommandPalette must be used within CommandPaletteContext.Provider`);return e}function bD(e){let t=e?.toLowerCase();return t===`human-reviewed`?`bg-emerald-500`:t===`machine-confirmed`?`bg-sky-500`:`bg-zinc-400 dark:bg-zinc-600`}function xD({open:e,onOpenChange:t,currentProject:n}){let r=kh(),[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)(``),[c,l]=(0,m.useState)(!!n),[u,d]=(0,m.useState)(``);(0,m.useEffect)(()=>{l(!!n)},[n]),(0,m.useEffect)(()=>{let e=setTimeout(()=>{s(i)},150);return()=>clearTimeout(e)},[i]),(0,m.useEffect)(()=>{function n(n){if((n.metaKey||n.ctrlKey)&&n.key===`k`){n.preventDefault(),t(!e);return}if(n.key===`/`&&!e){let e=n.target;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`||e.isContentEditable||e.closest(`input, textarea, select, [contenteditable]`))||(n.preventDefault(),t(!0))}}return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]);let f=D_(),p=e?lD():[],g=o.trim().length>=2,_=c&&n?n:void 0,v=P_({q:o.trim(),project:_,limit:20},g&&e),y=g?v.data?.[0]:void 0,b=p[0],x=f.data?.[0],S=``;y?S=`hit-${y.project}-${y.id}`:o.trim().length>0?S=`search-all-results`:b?S=`recent-${b.project}-${b.id}`:x&&(S=`proj-${x.project}`),(0,m.useEffect)(()=>{d(S)},[S]);let C=e=>{t(!1),a(``),r(e)};return(0,h.jsxs)(RE.Dialog,{value:u,onValueChange:d,open:e,onOpenChange:e=>{t(e),e||a(``)},label:`Search concepts, projects…`,shouldFilter:!1,overlayClassName:`fixed inset-0 bg-black/60 backdrop-blur-xs z-50 animate-[okf-fade-in_120ms_ease-out]`,contentClassName:`fixed left-1/2 top-[15%] -translate-x-1/2 w-full max-w-xl z-50 p-3 outline-none`,className:`w-full bg-surface border border-border-strong rounded-2xl shadow-2xl overflow-hidden flex flex-col max-h-[70vh] text-fg animate-[okf-scale-in_120ms_ease-out]`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 px-3 border-b border-border`,children:[(0,h.jsx)(Gx,{size:16,className:`text-muted shrink-0`}),(0,h.jsx)(RE.Input,{value:i,onValueChange:a,placeholder:`Search concepts, projects…`,className:`w-full bg-transparent py-3 text-sm text-fg placeholder:text-muted outline-none`}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>{n&&l(e=>!e)},disabled:!n,className:X(`shrink-0 text-xs px-2.5 py-1 rounded-md font-medium transition-colors select-none`,n?c?`bg-accent-500/10 text-accent-500 ring-1 ring-accent-500/20 hover:bg-accent-500/20 cursor-pointer`:`bg-surface-2 text-muted ring-1 ring-border hover:text-fg cursor-pointer`:`bg-surface-2 text-muted/60 ring-1 ring-border cursor-default`),title:n?`Click to toggle search scope`:void 0,children:c&&n?`This project`:`All projects`})]}),(0,h.jsxs)(RE.List,{className:`overflow-y-auto max-h-[380px] p-2 space-y-1`,children:[g&&v.isLoading&&(0,h.jsx)(RE.Loading,{className:`px-4 py-8 text-center text-xs text-subtle`,children:`Searching...`}),g&&!v.isLoading&&v.data&&v.data.length===0&&(0,h.jsx)(RE.Empty,{className:`px-4 py-8 text-center text-xs text-subtle`,children:`No matching concepts or files`}),g&&v.data&&v.data.length>0&&(0,h.jsx)(RE.Group,{heading:`Concepts & Files`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-subtle [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider`,children:v.data.map(e=>(0,h.jsxs)(RE.Item,{value:`hit-${e.project}-${e.id}`,onSelect:()=>C(iD(e.project,e.id)),className:`flex flex-col gap-1 px-2.5 py-2 rounded-lg text-xs cursor-pointer data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,h.jsx)(hD,{type:e.type,size:14}),(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:e.title}),(0,h.jsxs)(`span`,{className:`font-mono text-[11px] text-subtle truncate`,children:[e.project,`/`,e.id]}),(0,h.jsx)(`span`,{className:X(`ml-auto h-2 w-2 rounded-full shrink-0`,bD(e.trustTier)),title:e.trustTier})]}),e.snippet&&(0,h.jsx)(`div`,{className:`text-[11px] text-muted truncate pl-5`,children:(0,h.jsx)(dD,{text:e.snippet,query:o})})]},`${e.project}/${e.id}`))}),!g&&(0,h.jsxs)(h.Fragment,{children:[p.length>0&&(0,h.jsx)(RE.Group,{heading:`Recent`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-subtle [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider`,children:p.map(e=>(0,h.jsxs)(RE.Item,{value:`recent-${e.project}-${e.id}`,onSelect:()=>C(iD(e.project,e.id)),className:`flex items-center gap-2 px-2.5 py-2 rounded-lg text-xs cursor-pointer data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsx)(hD,{type:e.type,size:14}),(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:e.title}),(0,h.jsxs)(`span`,{className:`ml-auto font-mono text-[11px] text-subtle shrink-0`,children:[e.project,`/`,e.id]})]},`recent-${e.project}-${e.id}`))}),f.data&&f.data.length>0&&(0,h.jsx)(RE.Group,{heading:`Projects`,className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-subtle [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider`,children:f.data.map(e=>(0,h.jsxs)(RE.Item,{value:`proj-${e.project}`,onSelect:()=>C(`/p/${encodeURIComponent(e.project)}`),className:`flex items-center gap-2 px-2.5 py-2 rounded-lg text-xs cursor-pointer data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsx)(lx,{size:14,className:`text-accent-500 shrink-0`}),(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:e.title}),(0,h.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-subtle shrink-0`,children:e.project})]},`proj-${e.project}`))})]}),o.trim().length>0&&(0,h.jsx)(RE.Group,{className:`pt-1 border-t border-border mt-1`,children:(0,h.jsxs)(RE.Item,{value:`search-all-results`,onSelect:()=>{let e=new URLSearchParams;e.set(`q`,o.trim()),c&&n&&e.set(`project`,n),C(`/search?${e.toString()}`)},className:`flex items-center gap-2 px-2.5 py-2 rounded-lg text-xs cursor-pointer text-muted hover:text-fg data-[selected=true]:bg-surface-2 data-[selected=true]:text-fg transition-colors`,children:[(0,h.jsx)(Gx,{size:14,className:`shrink-0 text-muted`}),(0,h.jsxs)(`span`,{children:[`Search all results for “`,(0,h.jsx)(`strong`,{className:`text-fg font-medium`,children:o.trim()}),`”`]})]})})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-3 px-3.5 py-2 border-t border-border text-[11px] text-subtle bg-surface-2/40 select-none`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`kbd`,{className:`font-mono bg-surface px-1 py-0.2 rounded border border-border`,children:`↑↓`}),` navigate`]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`kbd`,{className:`font-mono bg-surface px-1 py-0.2 rounded border border-border`,children:`↵`}),` open`]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`kbd`,{className:`font-mono bg-surface px-1 py-0.2 rounded border border-border`,children:`esc`}),` close`]})]})]})}function Q({className:e}){return(0,h.jsx)(`div`,{className:X(`animate-shimmer rounded-md bg-surface-2`,e),"aria-hidden":`true`})}var SD=(0,m.createContext)(null);function CD(){let e=(0,m.useContext)(SD);if(!e)throw Error(`useTreeState must be used within a TreeStateContext.Provider`);return e}function wD(e,t){let n=[],r=[],i=[];for(let a of e)if(a.kind===`directory`)n.push(a);else if(a.kind===`concept`){if(t&&a.id===`overview`)continue;r.push(a)}else a.kind===`file`&&i.push(a);return n.sort((e,t)=>e.path.localeCompare(t.path)),r.sort((e,t)=>e.title.localeCompare(t.title)),i.sort((e,t)=>e.path.localeCompare(t.path)),[...n,...r,...i]}function TD({project:e,dir:t,depth:n,activeConceptId:r,activeFilePath:i}){let{data:a,isLoading:o}=k_(e,t,!0),{expanded:s,toggle:c}=CD(),l=(0,m.useMemo)(()=>a?wD(a,t===``):[],[a,t]);return o?(0,h.jsxs)(`div`,{className:`py-1 space-y-1`,style:{paddingLeft:`${n*12+12}px`},children:[(0,h.jsx)(Q,{className:`h-5 w-3/4 rounded-md`}),(0,h.jsx)(Q,{className:`h-5 w-1/2 rounded-md`})]}):l.length===0?(0,h.jsx)(`div`,{className:`py-1 text-[11px] text-subtle italic select-none`,style:{paddingLeft:`${n*12+16}px`},children:`Empty directory`}):(0,h.jsx)(`div`,{className:`space-y-0.5`,children:l.map(t=>{if(t.kind===`directory`){let a=s.has(t.path),o=t.path.split(`/`).pop()??t.path;return(0,h.jsxs)(`div`,{"data-tree-path":t.path,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>c(t.path),className:`group flex w-full items-center gap-1.5 py-1 pr-2 rounded-md text-xs font-medium text-muted hover:text-fg hover:bg-surface-2 transition-colors cursor-pointer text-left`,style:{paddingLeft:`${n*12+6}px`},children:[(0,h.jsx)(Lb,{size:12,className:X(`text-subtle transition-transform duration-150 shrink-0`,a&&`rotate-90`)}),(0,h.jsx)(gD,{open:a,size:14}),(0,h.jsx)(`span`,{className:`truncate flex-1`,children:o}),(0,h.jsx)(`span`,{className:`ml-auto text-[11px] text-subtle font-mono tabular-nums`,children:t.conceptCount})]}),(0,h.jsx)(tu,{initial:!1,children:a&&(0,h.jsx)(Gd.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.15,ease:`easeInOut`},className:`overflow-hidden`,children:(0,h.jsx)(TD,{project:e,dir:t.path,depth:n+1,activeConceptId:r,activeFilePath:i})})})]},`dir-${t.path}`)}if(t.kind===`concept`){let i=r===t.id;return(0,h.jsx)(`div`,{"data-tree-path":t.id,children:(0,h.jsxs)($g,{to:iD(e,t.id),className:X(`group flex items-center gap-2 py-1 pr-2 rounded-md text-xs transition-colors`,i?`border-l-2 border-accent-500 bg-surface-2 text-fg font-medium pl-[calc(var(--tree-pad)-2px)]`:`border-l-2 border-transparent text-muted hover:text-fg hover:bg-surface-2`),style:{"--tree-pad":`${n*12+20}px`,paddingLeft:i?`${n*12+18}px`:`${n*12+20}px`},children:[(0,h.jsx)(hD,{type:t.type,size:14}),(0,h.jsx)(`span`,{className:`truncate`,children:t.title})]})},`concept-${t.id}`)}if(t.kind===`file`){let r=i===t.path,a=t.path.split(`/`).pop()??t.path;return(0,h.jsx)(`div`,{"data-tree-path":t.path,children:(0,h.jsxs)($g,{to:aD(e,t.path),className:X(`group flex items-center gap-2 py-1 pr-2 rounded-md text-xs transition-colors`,r?`border-l-2 border-accent-500 bg-surface-2 text-fg font-medium font-mono`:`border-l-2 border-transparent text-muted hover:text-fg hover:bg-surface-2 font-mono`),style:{paddingLeft:r?`${n*12+18}px`:`${n*12+20}px`},children:[(0,h.jsx)(_D,{size:14}),(0,h.jsx)(`span`,{className:`truncate`,children:a})]})},`file-${t.path}`)}return null})})}function ED({project:e}){let t=Nh(),n=Dh(),r=t[`*`]??null,i=n.pathname.includes(`/c/`)&&r!==null,a=n.pathname.includes(`/f/`)&&r!==null,o=i?r:null,s=a?r:null,{expanded:c,toggle:l}=CD();return(0,m.useEffect)(()=>{let e=o??s;if(!e)return;let t=e.split(`/`);if(t.length<=1)return;let n=``;for(let e=0;e<t.length-1;e++){let r=t[e];r&&(n=n?`${n}/${r}`:r,c.has(n)||l(n))}},[o,s,c,l]),(0,h.jsx)(`div`,{className:`py-1`,children:(0,h.jsx)(TD,{project:e,dir:``,depth:0,activeConceptId:o,activeFilePath:s})})}var DD=new Intl.RelativeTimeFormat(`en`,{numeric:`auto`}),OD=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function kD(e){let t=new Date(e).getTime();if(Number.isNaN(t))return e;let n=Math.round((t-Date.now())/1e3);if(Math.abs(n)<60)return DD.format(n,`second`);let r=Math.round(n/60);if(Math.abs(r)<60)return DD.format(r,`minute`);let i=Math.round(r/60);if(Math.abs(i)<24)return DD.format(i,`hour`);let a=Math.round(i/24);if(Math.abs(a)<7)return DD.format(a,`day`);let o=Math.round(a/7);if(Math.abs(o)<5)return DD.format(o,`week`);let s=Math.round(a/30);if(Math.abs(s)<12)return DD.format(s,`month`);let c=Math.round(a/365);return DD.format(c,`year`)}function AD(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:OD.format(t)}function jD(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)%360}function MD(e){let t=e.startsWith(`human:`)?e.slice(6):e,n=t.indexOf(`@`);n!==-1&&(t=t.slice(0,n));let r=t.match(/[A-Za-z0-9]+/g);return!r||r.length===0?``:r.slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)}function ND(e){return e.startsWith(`human:`)?`human`:`agent`}function PD(e){return e.slice(0,7)}function FD({className:e}){let{data:t,isLoading:n}=F_();if(n||!t)return(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-zinc-500/10 text-zinc-500 ring-1 ring-inset ring-zinc-500/20`,e),children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-zinc-400 animate-pulse`}),(0,h.jsx)(`span`,{children:`Syncing...`})]});if(t.remote===null)return(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 ring-1 ring-inset ring-zinc-500/20`,e),children:[(0,h.jsx)(_x,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Local only`})]});if(t.lastError)return(0,h.jsxs)(`span`,{title:t.lastError,className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-1 ring-inset ring-rose-500/20`,e),children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-rose-500 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate max-w-[120px]`,children:`Sync error`})]});if(t.ahead>0||t.behind>0)return(0,h.jsx)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 ring-1 ring-inset ring-amber-500/20 font-mono`,e),children:(0,h.jsxs)(`span`,{children:[`↑`,t.ahead,` ↓`,t.behind]})});let r=t.lastSyncAt?kD(t.lastSyncAt):`just now`;return(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-1 ring-inset ring-emerald-500/20`,e),children:[(0,h.jsxs)(`span`,{className:`relative flex h-2 w-2 shrink-0`,children:[(0,h.jsx)(`span`,{className:`absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75`}),(0,h.jsx)(`span`,{className:`relative inline-flex h-2 w-2 rounded-full bg-emerald-500`})]}),(0,h.jsxs)(`span`,{children:[`Synced `,r]})]})}var ID={system:`light`,light:`dark`,dark:`system`};function LD({className:e}){let[t,n]=ab();return(0,h.jsxs)(`button`,{type:`button`,onClick:()=>{n(ID[t])},className:e??`inline-flex h-8 w-8 items-center justify-center rounded-lg text-muted hover:bg-surface-2 hover:text-fg transition-colors`,"aria-label":`Toggle theme (current: ${t})`,title:`Theme: ${t} (click to switch to ${ID[t]})`,children:[t===`system`&&(0,h.jsx)(jx,{size:16}),t===`light`&&(0,h.jsx)(Zx,{size:16}),t===`dark`&&(0,h.jsx)(Nx,{size:16})]})}function RD({actor:e,size:t=28,className:n}){let r=jD(e),i=MD(e),a=ND(e),o=Math.max(10,Math.round(t*.42)),s=Math.max(10,Math.round(t*.4));return(0,h.jsxs)(`div`,{className:X(`relative inline-flex shrink-0 select-none`,n),style:{width:t,height:t},title:e,children:[(0,h.jsx)(`div`,{className:`flex h-full w-full items-center justify-center rounded-full font-medium text-white shadow-xs`,style:{background:`linear-gradient(135deg, hsl(${r} 70% 55%), hsl(${(r+40)%360} 70% 45%))`,fontSize:s},children:i}),(0,h.jsx)(`div`,{className:`absolute -bottom-0.5 -right-0.5 flex items-center justify-center rounded-full bg-surface text-muted ring-1 ring-border`,style:{width:o+4,height:o+4},children:a===`human`?(0,h.jsx)(rS,{size:o}):(0,h.jsx)(kb,{size:o})})]})}function zD({className:e}){let{state:t,logout:n}=Yy(),[r,i]=(0,m.useState)(!1),a=(0,m.useRef)(null);if((0,m.useEffect)(()=>{if(!r)return;function e(e){a.current&&!a.current.contains(e.target)&&i(!1)}function t(e){e.key===`Escape`&&i(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),t.status===`loading`)return(0,h.jsx)(`div`,{className:X(`h-7 w-24 rounded-md bg-surface-2 animate-pulse`,e)});let o=t.status===`open`,s=t.status===`signed-in`,c=`config`in t?t.config.version:null,l=s?t.identity:null;return(0,h.jsxs)(`div`,{ref:a,className:X(`relative inline-block`,e),children:[o?(0,h.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 ring-1 ring-inset ring-amber-500/20 hover:bg-amber-500/20 transition-colors`,title:`Running in local mode without authentication`,"aria-expanded":r,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-amber-500`}),(0,h.jsx)(`span`,{children:`Local mode · auth off`})]}):s?(0,h.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`flex items-center gap-2 rounded-lg p-1 text-left hover:bg-surface-2 transition-colors max-w-[200px]`,"aria-expanded":r,children:[(0,h.jsx)(RD,{actor:l??`User`,size:26}),(0,h.jsx)(`span`,{className:`truncate text-xs font-medium text-fg`,children:l??`Signed in`})]}):null,r&&(0,h.jsxs)(`div`,{role:`menu`,className:`absolute bottom-full left-0 mb-2 w-56 rounded-xl border border-border bg-surface p-1.5 shadow-xl z-50 text-xs`,children:[l&&(0,h.jsxs)(`div`,{className:`px-2.5 py-1.5 border-b border-border mb-1`,children:[(0,h.jsx)(`div`,{className:`font-medium text-fg truncate`,children:l}),(0,h.jsx)(`div`,{className:`text-[11px] text-muted truncate`,children:`Identity provider session`})]}),c&&(0,h.jsxs)(`div`,{className:`px-2.5 py-1 text-[11px] text-muted font-mono`,children:[`ok-fine v`,c]}),s&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`my-1 border-t border-border`}),(0,h.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{i(!1),n()},className:`flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-xs font-medium text-rose-600 dark:text-rose-400 hover:bg-rose-500/10 transition-colors cursor-pointer`,children:[(0,h.jsx)(Dx,{size:13,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Sign out`})]})]})]})]})}function BD({project:e,drawerOpen:t,onCloseDrawer:n}){let r=kh(),i=D_(),[a,o]=(0,m.useState)(!1),s=(0,m.useRef)(null),c=i.data?.find(t=>t.project===e)?.title??e??`All projects`;(0,m.useEffect)(()=>{if(!a)return;function e(e){s.current&&!s.current.contains(e.target)&&o(!1)}function t(e){e.key===`Escape`&&o(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);let l=e=>{o(!1),n(),r(e?`/p/${encodeURIComponent(e)}`:`/`)};return(0,h.jsxs)(h.Fragment,{children:[t&&(0,h.jsx)(`button`,{type:`button`,"aria-label":`Close sidebar`,onClick:n,className:`fixed inset-0 z-40 bg-black/50 backdrop-blur-xs lg:hidden animate-[fade-in_150ms_ease-out] cursor-default border-none p-0`}),(0,h.jsxs)(`aside`,{className:X(`fixed inset-y-0 left-0 z-50 w-[272px] bg-surface border-r border-border flex flex-col h-full shadow-2xl lg:shadow-none transition-transform duration-200 ease-out lg:static lg:z-auto lg:translate-x-0`,t?`translate-x-0`:`-translate-x-full lg:translate-x-0`),children:[(0,h.jsxs)(`div`,{className:`h-14 border-b border-border flex items-center justify-between px-4 shrink-0`,children:[(0,h.jsx)($g,{to:`/`,onClick:n,className:`hover:opacity-90 transition-opacity`,title:`ok-fine home`,children:(0,h.jsx)(lS,{size:22})}),(0,h.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close sidebar`,className:`lg:hidden p-1.5 rounded-lg text-muted hover:text-fg hover:bg-surface-2 transition-colors cursor-pointer`,children:(0,h.jsx)(aS,{size:18})})]}),(0,h.jsxs)(`div`,{ref:s,className:`relative p-2 border-b border-border shrink-0`,children:[(0,h.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),"aria-expanded":a,className:`flex w-full items-center justify-between gap-2 px-2.5 py-1.5 rounded-lg bg-surface-2 hover:bg-surface border border-border text-xs font-medium text-fg transition-colors cursor-pointer text-left`,children:[(0,h.jsx)(`span`,{className:`truncate`,children:c}),(0,h.jsx)(zb,{size:14,className:`text-subtle shrink-0`})]}),a&&(0,h.jsxs)(`div`,{role:`menu`,className:`absolute left-2 right-2 top-full mt-1 rounded-xl border border-border bg-surface p-1 shadow-xl z-50 text-xs space-y-0.5 max-h-64 overflow-y-auto`,children:[(0,h.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>l(),className:X(`flex w-full items-center justify-between px-2.5 py-1.5 rounded-lg text-left transition-colors cursor-pointer`,e?`text-muted hover:text-fg hover:bg-surface-2`:`bg-accent-500/10 text-accent-500 font-medium`),children:[(0,h.jsx)(`span`,{children:`All projects`}),!e&&(0,h.jsx)(Nb,{size:14,className:`shrink-0`})]}),(0,h.jsx)(`div`,{className:`my-1 border-t border-border`}),i.data?.map(t=>{let n=t.project===e;return(0,h.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>l(t.project),className:X(`flex w-full items-center justify-between px-2.5 py-1.5 rounded-lg text-left transition-colors cursor-pointer`,n?`bg-accent-500/10 text-accent-500 font-medium`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsxs)(`div`,{className:`truncate pr-2`,children:[(0,h.jsx)(`div`,{className:`font-medium truncate`,children:t.title}),(0,h.jsx)(`div`,{className:`font-mono text-[10px] text-subtle truncate`,children:t.project})]}),n&&(0,h.jsx)(Nb,{size:14,className:`shrink-0`})]},t.project)})]})]}),(0,h.jsx)(`div`,{className:`flex-1 overflow-y-auto min-h-0 flex flex-col p-2 space-y-4`,children:e?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`nav`,{"aria-label":`Project sections`,className:`space-y-0.5`,children:[(0,h.jsxs)(e_,{to:`/p/${encodeURIComponent(e)}`,end:!0,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(Cx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Overview`})]}),(0,h.jsxs)(e_,{to:`/p/${encodeURIComponent(e)}/activity`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(zx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Activity`})]}),(0,h.jsxs)(e_,{to:`/p/${encodeURIComponent(e)}/health`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(yx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Health`})]}),(0,h.jsxs)(e_,{to:`/search?project=${encodeURIComponent(e)}`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(Gx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Search`})]})]}),(0,h.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col`,children:[(0,h.jsx)(`div`,{className:`px-2 pb-1 text-[11px] font-medium uppercase tracking-wider text-subtle select-none`,children:`Knowledge`}),(0,h.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,h.jsx)(ED,{project:e})})]})]}):(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsxs)(`nav`,{"aria-label":`Global navigation`,className:`space-y-0.5`,children:[(0,h.jsxs)(e_,{to:`/`,end:!0,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(Cx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Projects`})]}),(0,h.jsxs)(e_,{to:`/search`,onClick:n,className:({isActive:e})=>X(`flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-colors`,e?`bg-surface-2 text-fg`:`text-muted hover:text-fg hover:bg-surface-2`),children:[(0,h.jsx)(Gx,{size:14,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Search`})]})]}),i.data&&i.data.length>0&&(0,h.jsxs)(`div`,{className:`pt-2`,children:[(0,h.jsx)(`div`,{className:`px-2 pb-1 text-[11px] font-medium uppercase tracking-wider text-subtle select-none`,children:`Projects`}),(0,h.jsx)(`div`,{className:`space-y-0.5`,children:i.data.map(e=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e.project)}`,onClick:n,className:`flex items-center gap-2 px-2.5 py-1.5 rounded-lg text-xs text-muted hover:text-fg hover:bg-surface-2 transition-colors`,children:[(0,h.jsx)(lx,{size:14,className:`text-accent-500 shrink-0`}),(0,h.jsx)(`span`,{className:`truncate`,children:e.title})]},e.project))})]})]})}),(0,h.jsxs)(`div`,{className:`p-3 border-t border-border flex flex-col gap-2.5 mt-auto bg-surface shrink-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(FD,{}),(0,h.jsx)(LD,{})]}),(0,h.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,h.jsx)(zD,{})})]})]})]})}function VD({className:e}){let t=Nh(),n=Dh(),r=t.project,i=t[`*`],a=O_(r??``).data?.title??r,o=n.pathname.includes(`/c/`)&&!!i,s=n.pathname.includes(`/f/`)&&!!i,c=n.pathname.endsWith(`/activity`),l=n.pathname.endsWith(`/health`),u=n.pathname===`/search`,d=A_(r??``,o?i??``:``).data?.derived?.title??(i?i.split(`/`).pop():``),f=i?i.split(`/`):[],p=f.slice(0,-1),m=f[f.length-1]??``,g=(0,h.jsx)(`span`,{className:`text-subtle/50 select-none mx-0.5`,children:`/`});return(0,h.jsxs)(`nav`,{"aria-label":`Breadcrumbs`,className:X(`flex items-center gap-1 text-xs overflow-hidden whitespace-nowrap min-w-0`,e),children:[(0,h.jsx)($g,{to:`/`,className:X(`transition-colors shrink-0`,!r&&!u?`font-medium text-fg`:`text-muted hover:text-fg`),children:`Projects`}),u&&(0,h.jsxs)(h.Fragment,{children:[g,(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:`Search`})]}),r&&(0,h.jsxs)(h.Fragment,{children:[g,!o&&!s&&!c&&!l?(0,h.jsx)(`span`,{className:`font-medium text-fg truncate max-w-[200px]`,title:a,children:a}):(0,h.jsx)($g,{to:`/p/${encodeURIComponent(r)}`,className:`text-muted hover:text-fg transition-colors truncate max-w-[160px] shrink-0`,title:a,children:a})]}),c&&(0,h.jsxs)(h.Fragment,{children:[g,(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:`Activity`})]}),l&&(0,h.jsxs)(h.Fragment,{children:[g,(0,h.jsx)(`span`,{className:`font-medium text-fg truncate`,children:`Health`})]}),(o||s)&&(0,h.jsxs)(h.Fragment,{children:[p.map((e,t)=>{let n=p.slice(0,t+1).join(`/`);return(0,h.jsxs)(`span`,{className:`flex items-center gap-1 shrink-0`,children:[g,(0,h.jsx)(`span`,{className:`text-subtle select-none max-w-[120px] truncate`,title:e,children:e})]},n)}),g,o?(0,h.jsx)(`span`,{className:`font-medium text-fg truncate max-w-[220px]`,title:d,children:d}):(0,h.jsx)(`span`,{className:`font-medium font-mono text-fg truncate max-w-[220px]`,title:m,children:m})]})]})}function HD({onMenuClick:e}){let{open:t}=yD();return(0,h.jsxs)(`header`,{className:`sticky top-0 z-30 h-14 bg-bg/70 backdrop-blur-xl border-b border-border flex items-center justify-between px-4 gap-4 shrink-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,h.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Open sidebar menu`,className:`lg:hidden p-1.5 -ml-1 rounded-lg text-muted hover:text-fg hover:bg-surface-2 transition-colors cursor-pointer shrink-0`,children:(0,h.jsx)(kx,{size:18})}),(0,h.jsx)(VD,{})]}),(0,h.jsxs)(`button`,{type:`button`,onClick:t,className:`inline-flex items-center gap-2 px-2.5 py-1 rounded-lg bg-surface-2 hover:bg-surface border border-border hover:border-border-strong text-xs transition-colors cursor-pointer shrink-0`,title:`Search knowledge base (⌘K or /)`,children:[(0,h.jsx)(Gx,{size:13,className:`text-muted shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted hidden sm:inline`,children:`Search knowledge…`}),(0,h.jsx)(`kbd`,{className:`hidden sm:inline-block font-mono text-[10px] text-subtle bg-surface px-1.5 py-0.5 rounded border border-border`,children:`⌘K`})]})]})}function UD(){let{project:e}=Nh(),[t,n]=(0,m.useState)(()=>new Set),[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(!1),s=(0,m.useRef)(e);(0,m.useEffect)(()=>{s.current!==e&&(s.current=e,n(new Set))},[e]);let{pathname:c}=Dh();(0,m.useEffect)(()=>{c&&i(!1)},[c]);let l=(0,m.useCallback)(e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,m.useCallback)(e=>{n(t=>{let n=new Set(t),r=e.split(`/`),i=``;for(let e of r)e&&(i=i?`${i}/${e}`:e,n.add(i));return n}),i(!0),requestAnimationFrame(()=>{try{document.querySelector(`[data-tree-path="${CSS.escape(e)}"]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})}catch{document.querySelector(`[data-tree-path]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})}})},[]),d=(0,m.useMemo)(()=>({expanded:t,toggle:l,reveal:u}),[t,l,u]),f=(0,m.useMemo)(()=>({open:()=>o(!0)}),[]);return(0,h.jsx)(SD.Provider,{value:d,children:(0,h.jsxs)(vD.Provider,{value:f,children:[(0,h.jsxs)(`div`,{className:`flex h-screen w-screen overflow-hidden text-fg`,children:[(0,h.jsx)(BD,{project:e,drawerOpen:r,onCloseDrawer:()=>i(!1)}),(0,h.jsxs)(`div`,{className:`flex flex-1 flex-col min-w-0 h-full overflow-hidden`,children:[(0,h.jsx)(HD,{onMenuClick:()=>i(!0)}),(0,h.jsx)(`main`,{className:`flex-1 overflow-y-auto min-h-0`,children:(0,h.jsx)(og,{})})]})]}),(0,h.jsx)(xD,{open:a,onOpenChange:o,currentProject:e})]})})}var WD=new Intl.DateTimeFormat(void 0,{dateStyle:`full`});function GD(){let e=Nh().project??``,{data:t}=O_(e),{data:n,isLoading:r,isError:i,error:a,refetch:o}=M_(e,{limit:100}),s=(0,m.useMemo)(()=>{if(!n||n.length===0)return[];let e=[],t=``,r=[];for(let i of n){let n=WD.format(new Date(i.at));n===t?r.push(i):(r.length>0&&e.push({day:t,entries:r}),t=n,r=[i])}return r.length>0&&e.push({day:t,entries:r}),e},[n]),c=t?.title?`${t.title} Activity`:`Activity`;return r?(0,h.jsxs)(uS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-32 rounded-md`}),(0,h.jsx)(Q,{className:`h-8 w-48 rounded-lg`})]}),(0,h.jsx)(`div`,{className:`mt-8 space-y-8`,children:Array.from({length:2}).map((e,t)=>(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsx)(Q,{className:`h-5 w-40 rounded-md`}),(0,h.jsx)(`div`,{className:`rounded-xl border border-border bg-surface divide-y divide-border p-4 space-y-3`,children:Array.from({length:3}).map((e,t)=>(0,h.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(Q,{className:`h-7 w-7 rounded-full shrink-0`}),(0,h.jsxs)(`div`,{className:`space-y-1`,children:[(0,h.jsx)(Q,{className:`h-4 w-48`}),(0,h.jsx)(Q,{className:`h-3 w-32`})]})]}),(0,h.jsx)(Q,{className:`h-6 w-16 rounded-md`})]},t))})]},t))})]}):i?(0,h.jsx)(uS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(sS,{error:a,onRetry:()=>void o()})}):!n||n.length===0?(0,h.jsxs)(uS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-6`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}`,className:`transition-colors hover:text-fg`,children:t?.title??e}),(0,h.jsx)(`span`,{children:`/`}),(0,h.jsx)(`span`,{className:`text-fg`,children:`Activity`})]}),(0,h.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:`Activity`})]}),(0,h.jsx)(oS,{icon:zx,title:`No activity recorded`,hint:`Changes to concepts and files in this project will appear here.`,className:`mt-8 py-16`})]}):(0,h.jsxs)(uS,{title:c,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-8`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}`,className:`transition-colors hover:text-fg`,children:t?.title??e}),(0,h.jsx)(`span`,{children:`/`}),(0,h.jsx)(`span`,{className:`text-fg`,children:`Activity`})]}),(0,h.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:`Activity`}),(0,h.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`History of commits and updates for `,t?.title??e]})]}),(0,h.jsx)(`div`,{className:`space-y-8`,children:s.map(e=>(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(`h2`,{className:`text-xs font-semibold uppercase tracking-wider text-muted`,children:e.day}),(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:e.entries.map(e=>{let t=e.actor.startsWith(`human:`),n=t?e.actor.slice(6):e.actor;return(0,h.jsxs)(`div`,{className:`flex flex-col gap-3 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0`,children:[(0,h.jsx)(RD,{actor:e.actor,size:28,className:`mt-0.5 shrink-0`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`text-sm font-medium text-fg break-words`,children:e.subject}),(0,h.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-xs text-muted`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1 font-mono text-subtle`,children:[t?(0,h.jsx)(rS,{size:12,className:`shrink-0 text-muted`}):(0,h.jsx)(kb,{size:12,className:`shrink-0 text-muted`}),(0,h.jsx)(`span`,{className:`truncate max-w-[200px]`,children:n})]}),e.principal&&(0,h.jsxs)(`span`,{className:`font-mono text-xs text-subtle truncate max-w-[200px]`,children:[`(`,e.principal,`)`]}),(0,h.jsx)(`span`,{children:`·`}),(0,h.jsx)(`span`,{title:AD(e.at),children:kD(e.at)})]})]})]}),(0,h.jsx)(`div`,{className:`flex items-center gap-2 self-end sm:self-center shrink-0`,children:(0,h.jsx)(fS,{value:e.sha,label:PD(e.sha),className:`font-mono text-xs`})})]},e.sha)})})]},e.day))})]})}function KD(){let{completeLogin:e}=Yy(),t=kh(),[n,r]=(0,m.useState)(null),i=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{if(i.current)return;i.current=!0;let n=new URL(window.location.href);e(n).then(e=>{t(Gy(e),{replace:!0})}).catch(e=>{let t;t=e instanceof wv||e instanceof Cv?e.error_description?`${e.error}: ${e.error_description}`:e.error:e instanceof Error?e.message:String(e),r(t)})},[e,t]),n===null?(0,h.jsx)(uS,{title:`Signing in`,className:`min-h-screen flex items-center justify-center p-6 bg-bg`,children:(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3`,children:[(0,h.jsx)(Tx,{size:36,className:`animate-spin text-accent-500`}),(0,h.jsx)(`p`,{className:`text-sm font-medium text-muted`,children:`Signing you in…`})]})}):(0,h.jsx)(mS,{error:n})}function qD({className:e,children:t}){return(0,h.jsx)(`span`,{className:X(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset`,e),children:t})}function JD({status:e,className:t}){let n=e.toLowerCase(),r=`bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 ring-zinc-500/20`;return n===`draft`?r=`bg-amber-500/10 text-amber-600 dark:text-amber-400 ring-amber-500/20`:n===`stable`?r=`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-emerald-500/20`:n===`deprecated`&&(r=`bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-rose-500/20`),(0,h.jsx)(qD,{className:X(r,t),children:e})}function YD({tier:e,className:t}){let n=e.toLowerCase();return n===`human-reviewed`?(0,h.jsxs)(qD,{className:X(`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-emerald-500/20`,t),children:[(0,h.jsx)(qx,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`human-reviewed`})]}):n===`machine-confirmed`?(0,h.jsxs)(qD,{className:X(`bg-sky-500/10 text-sky-600 dark:text-sky-400 ring-sky-500/20`,t),children:[(0,h.jsx)(xb,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`machine-confirmed`})]}):(0,h.jsxs)(qD,{className:X(`bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 ring-zinc-500/20`,t),children:[(0,h.jsx)(Gb,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:e||`unverified`})]})}function XD({className:e}){return(0,h.jsxs)(qD,{className:X(`bg-orange-500/10 text-orange-600 dark:text-orange-400 ring-orange-500/20`,e),children:[(0,h.jsx)(qb,{size:12,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Stale`})]})}function ZD({type:e,className:t}){return(0,h.jsxs)(qD,{className:X(`bg-surface-2 text-fg ring-border`,t),children:[(0,h.jsx)(hD,{type:e,size:12}),(0,h.jsx)(`span`,{children:e||`Concept`})]})}function QD({code:e,lang:t,lineNumbers:n=!1,className:r}){let[i,a]=(0,m.useState)(null);(0,m.useEffect)(()=>{let n=!1;if(!t){a(null);return}return Ag(async()=>{let{highlight:e}=await import(`./highlight-DkgVr4Tn.js`);return{highlight:e}},[]).then(({highlight:n})=>n(e,t)).then(e=>{n||a(e)}).catch(()=>{n||a(null)}),()=>{n=!0}},[e,t]);let o=e.split(`
58
+ `);return(0,h.jsxs)(`div`,{className:X(`relative group`,r),children:[(0,h.jsx)(`div`,{className:`absolute top-2.5 right-2.5 z-10 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity`,children:(0,h.jsx)(fS,{value:e})}),i?(0,h.jsx)(`div`,{className:X(n&&`okf-lines`),dangerouslySetInnerHTML:{__html:i}}):(0,h.jsx)(`pre`,{className:X(`okf-code overflow-x-auto`,n&&`okf-lines`),children:(0,h.jsx)(`code`,{children:n?o.map((e,t)=>(0,h.jsxs)(`span`,{className:`line`,children:[e,t<o.length-1?`
59
+ `:``]},t)):e})})]})}var $D=14;function eO({project:e,conceptId:t,inbound:n,outbound:r,className:i}){let a=kh();if(n.length===0&&r.length===0)return(0,h.jsx)(`div`,{className:X(`rounded-xl border border-border bg-surface-2/40 p-4 text-center text-xs text-muted italic`,i),children:`No connections yet`});let o=n.slice(0,6),s=n.length-o.length,c=r.slice(0,6),l=r.length-c.length,u=t.split(`/`).pop()??t,d=u.length>$D?`${u.slice(0,13)}…`:u,f=(e,t)=>t===1?110:24+e*172/(t-1),p=(e,t)=>t===1?110:24+e*172/(t-1);return(0,h.jsxs)(`div`,{className:X(`rounded-xl border border-border bg-surface-2/30 p-2.5`,i),children:[(0,h.jsx)(`div`,{className:`mb-2 px-1 text-xs font-semibold uppercase tracking-wider text-muted`,children:`Connections`}),(0,h.jsxs)(`svg`,{viewBox:`0 0 280 220`,className:`w-full h-auto overflow-visible select-none text-[11px]`,"aria-label":`Connections graph`,children:[(0,h.jsxs)(`defs`,{children:[(0,h.jsxs)(`linearGradient`,{id:`okf-grad-inbound`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,h.jsx)(`stop`,{offset:`0%`,stopColor:`#22d3ee`}),(0,h.jsx)(`stop`,{offset:`100%`,stopColor:`#8b5cf6`})]}),(0,h.jsxs)(`linearGradient`,{id:`okf-grad-outbound`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,h.jsx)(`stop`,{offset:`0%`,stopColor:`#8b5cf6`}),(0,h.jsx)(`stop`,{offset:`100%`,stopColor:`#22d3ee`})]}),(0,h.jsx)(`marker`,{id:`okf-arrow-in`,viewBox:`0 0 8 8`,refX:`6`,refY:`4`,markerWidth:`5`,markerHeight:`5`,orient:`auto`,children:(0,h.jsx)(`path`,{d:`M 0 1 L 6 4 L 0 7`,fill:`none`,stroke:`#8b5cf6`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,h.jsx)(`marker`,{id:`okf-arrow-out`,viewBox:`0 0 8 8`,refX:`6`,refY:`4`,markerWidth:`5`,markerHeight:`5`,orient:`auto`,children:(0,h.jsx)(`path`,{d:`M 0 1 L 6 4 L 0 7`,fill:`none`,stroke:`#22d3ee`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),o.map((e,t)=>{let n=f(t,o.length),r=`M 70 ${n} C 85 ${n}, 85 110, 100 110`;return(0,h.jsx)(Gd.path,{d:r,fill:`none`,stroke:`url(#okf-grad-inbound)`,strokeWidth:`1.5`,markerEnd:`url(#okf-arrow-in)`,initial:{pathLength:0},animate:{pathLength:1},transition:{duration:.4,delay:t*.04,ease:`easeOut`}},`edge-in-${o[t]}`)}),c.map((e,t)=>{let n=p(t,c.length),r=`M 180 110 C 195 110, 195 ${n}, 210 ${n}`;return(0,h.jsx)(Gd.path,{d:r,fill:`none`,stroke:`url(#okf-grad-outbound)`,strokeWidth:`1.5`,markerEnd:`url(#okf-arrow-out)`,initial:{pathLength:0},animate:{pathLength:1},transition:{duration:.4,delay:(o.length+t)*.04,ease:`easeOut`}},`edge-out-${e.id}`)}),(0,h.jsxs)(`g`,{className:`cursor-default`,children:[(0,h.jsx)(`rect`,{x:`100`,y:`98`,width:`80`,height:`24`,rx:`6`,className:`fill-surface stroke-accent-500/50 stroke-1.5`}),(0,h.jsx)(`text`,{x:`140`,y:`110`,textAnchor:`middle`,dominantBaseline:`central`,className:`fill-fg font-medium`,children:d}),(0,h.jsx)(`title`,{children:t})]}),o.map((t,n)=>{let r=f(n,o.length),i=t.split(`/`).pop()??t,s=i.length>$D?`${i.slice(0,13)}…`:i;return(0,h.jsxs)(`g`,{className:`cursor-pointer`,onClick:()=>a(iD(e,t)),children:[(0,h.jsx)(`rect`,{x:`2`,y:r-10,width:`68`,height:`20`,rx:`5`,className:`fill-surface stroke-border hover:stroke-accent-500 hover:fill-surface-2 transition-colors stroke-1`}),(0,h.jsx)(`text`,{x:`36`,y:r,textAnchor:`middle`,dominantBaseline:`central`,className:`fill-muted hover:fill-fg text-[10px] pointer-events-none`,children:s}),(0,h.jsx)(`title`,{children:t})]},`in-${t}`)}),s>0&&(0,h.jsxs)(`text`,{x:`36`,y:`212`,textAnchor:`middle`,className:`fill-subtle text-[10px] font-mono`,children:[`+`,s,` more`]}),c.map((t,n)=>{let r=p(n,c.length),i=t.id.split(`/`).pop()??t.id,o=i.length>$D?`${i.slice(0,13)}…`:i,s=t.exists!==!1;return(0,h.jsxs)(`g`,{className:s?`cursor-pointer`:`cursor-not-allowed`,onClick:()=>{s&&a(iD(e,t.id))},children:[(0,h.jsx)(`rect`,{x:`210`,y:r-10,width:`68`,height:`20`,rx:`5`,strokeDasharray:t.exists===!1?`3 2`:void 0,className:t.exists===!1?`fill-surface stroke-rose-500/80 stroke-1`:`fill-surface stroke-border hover:stroke-accent-500 hover:fill-surface-2 transition-colors stroke-1`}),(0,h.jsx)(`text`,{x:`244`,y:r,textAnchor:`middle`,dominantBaseline:`central`,className:t.exists===!1?`fill-rose-500 text-[10px] pointer-events-none`:`fill-muted hover:fill-fg text-[10px] pointer-events-none`,children:o}),(0,h.jsxs)(`title`,{children:[t.id,t.exists===!1?` (missing)`:``]})]},`out-${t.id}`)}),l>0&&(0,h.jsxs)(`text`,{x:`244`,y:`212`,textAnchor:`middle`,className:`fill-subtle text-[10px] font-mono`,children:[`+`,l,` more`]})]})]})}function tO(e,t){this.v=e,this.k=t}function nO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rO(e){if(Array.isArray(e))return e}function iO(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function aO(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
60
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oO(e,t){return rO(e)||iO(e,t)||sO(e,t)||aO()}function sO(e,t){if(e){if(typeof e==`string`)return nO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nO(e,t):void 0}}function cO(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof tO;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}cO.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},cO.prototype.next=function(e){return this._invoke(`next`,e)},cO.prototype.throw=function(e){return this._invoke(`throw`,e)},cO.prototype.return=function(e){return this._invoke(`return`,e)};var lO=Object.entries,uO=Object.setPrototypeOf,dO=Object.isFrozen,fO=Object.getPrototypeOf,pO=Object.getOwnPropertyDescriptor,mO=Object.freeze,hO=Object.seal,gO=Object.create,_O=typeof Reflect<`u`&&Reflect,vO=_O.apply,yO=_O.construct;mO||=function(e){return e},hO||=function(e){return e},vO||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},yO||=function(e){return new e(...[...arguments].slice(1))};var bO=BO(Array.prototype.forEach);Array.prototype.indexOf;var xO=BO(Array.prototype.lastIndexOf),SO=BO(Array.prototype.pop),CO=BO(Array.prototype.push);Array.prototype.slice;var wO=BO(Array.prototype.splice),TO=Array.isArray,EO=BO(String.prototype.toLowerCase),DO=BO(String.prototype.toString),OO=BO(String.prototype.match),kO=BO(String.prototype.replace),AO=BO(String.prototype.indexOf),jO=BO(String.prototype.trim),MO=BO(Number.prototype.toString),NO=BO(Boolean.prototype.toString),PO=typeof BigInt>`u`?null:BO(BigInt.prototype.toString),FO=typeof Symbol>`u`?null:BO(Symbol.prototype.toString),IO=BO(Object.prototype.hasOwnProperty),LO=BO(Object.prototype.toString),RO=BO(RegExp.prototype.test),zO=VO(TypeError);function BO(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return vO(e,t,n)}}function VO(e){return function(){return yO(e,[...arguments])}}function HO(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:EO;if(uO&&uO(e,null),!TO(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(dO(t)||(t[r]=e),i=e)}e[i]=!0}return e}function UO(e){for(let t=0;t<e.length;t++)IO(e,t)||(e[t]=null);return e}function WO(e){let t=gO(null);for(let r of lO(e)){var n=oO(r,2);let i=n[0],a=n[1];IO(e,i)&&(t[i]=TO(a)?UO(a):a&&typeof a==`object`&&a.constructor===Object?WO(a):a)}return t}function GO(e){switch(typeof e){case`string`:return e;case`number`:return MO(e);case`boolean`:return NO(e);case`bigint`:return PO?PO(e):`0`;case`symbol`:return FO?FO(e):`Symbol()`;case`undefined`:return LO(e);case`function`:case`object`:{if(e===null)return LO(e);let t=e,n=KO(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:LO(e)}return LO(e)}default:return LO(e)}}function KO(e,t){for(;e!==null;){let n=pO(e,t);if(n){if(n.get)return BO(n.get);if(typeof n.value==`function`)return BO(n.value)}e=fO(e)}function n(){return null}return n}function qO(e){try{return RO(e,``),!0}catch{return!1}}var JO=mO(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),YO=mO(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),XO=mO([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ZO=mO([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),QO=mO(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),$O=mO([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),ek=mO([`#text`]),tk=mO(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),nk=mO(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),rk=mO(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ik=mO([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ak=hO(/{{[\w\W]*|^[\w\W]*}}/g),ok=hO(/<%[\w\W]*|^[\w\W]*%>/g),sk=hO(/\${[\w\W]*/g),ck=hO(/^data-[\-\w.\u00B7-\uFFFF]+$/),lk=hO(/^aria-[\-\w]+$/),uk=hO(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dk=hO(/^(?:\w+script|data):/i),fk=hO(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pk=hO(/^html$/i),mk=hO(/^[a-z][.\w]*(-[.\w]+)+$/i),hk=hO(/<[/\w!]/g),gk=hO(/<[/\w]/g),_k=hO(/<\/no(script|embed|frames)/i),vk=hO(/\/>/i),yk={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bk=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],xk=mO(HO({},bk)),Sk=function(){let e={};return bO(bk,t=>{e[t]=hO(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),mO(e)}(),Ck=function(){return typeof window>`u`?null:window},wk=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Tk=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ek=function(e,t,n,r){return IO(e,t)&&TO(e[t])?HO(r.base?WO(r.base):{},e[t],r.transform):n},Dk=function(e,t,n){let r=IO(e,t)?e[t]:void 0;return r&&typeof r==`object`?WO(r):n()};function Ok(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ck(),t=e=>Ok(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==yk.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=KO(d,`cloneNode`),p=KO(d,`remove`),m=KO(d,`removeAttributeNode`),h=KO(d,`nextSibling`),g=KO(d,`childNodes`),_=KO(d,`parentNode`),v=KO(d,`shadowRoot`),y=KO(d,`attributes`),b=o&&o.prototype?KO(o.prototype,`nodeType`):null,x=o&&o.prototype?KO(o.prototype,`nodeName`):null,S=o&&o.prototype?KO(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,O=!1,k=0,ee=function(){if(k>0)throw zO(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){ee(),k++;try{return T.createHTML(e)}finally{k--}},te=function(e){ee(),k++;try{return T.createScriptURL(e)}finally{k--}},ne=function(){return O||=(D=wk(u,i),!0),D},re=n,ie=re.implementation,ae=re.createNodeIterator,oe=re.createDocumentFragment,se=re.getElementsByTagName,ce=r.importNode,j=Tk();t.isSupported=typeof lO==`function`&&typeof _==`function`&&ie&&ie.createHTMLDocument!==void 0;let le=ak,ue=ok,de=sk,fe=ck,pe=lk,me=dk,he=fk,ge=mk,M=uk,N=null,_e=HO({},[...JO,...YO,...XO,...QO,...ek]),P=null,ve=HO({},[...tk,...nk,...rk,...ik]),F=Object.seal(gO(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,be=null,xe=Object.seal(gO(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Se=!0,Ce=!0,we=!1,Te=!0,Ee=!1,De=!0,Oe=!1,ke=!1,Ae=null,je=null,Me=!1,Ne=!1,Pe=!1,Fe=!1,Ie=!0,Le=!1,Re=`user-content-`,ze=!0,Be=!1,Ve={},He=null,Ue=HO({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),We=null,Ge=HO({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ke=null,qe=HO({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Je=`http://www.w3.org/1998/Math/MathML`,Ye=`http://www.w3.org/2000/svg`,Xe=`http://www.w3.org/1999/xhtml`,Ze=Xe,Qe=!1,$e=null,et=HO({},[Je,Ye,Xe],DO),tt=mO([`mi`,`mo`,`mn`,`ms`,`mtext`]),nt=HO({},tt),rt=mO([`annotation-xml`]),it=HO({},rt),at=HO({},[`title`,`style`,`font`,`a`,`script`]),ot=null,st=[`application/xhtml+xml`,`text/html`],ct=null,lt=null,ut=n.createElement(`form`),dt=function(e){return e instanceof RegExp||e instanceof Function},ft=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(lt&&lt===e)return;(!e||typeof e!=`object`)&&(e={}),e=WO(e),ot=st.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,ct=ot===`application/xhtml+xml`?DO:EO,N=Ek(e,`ALLOWED_TAGS`,_e,{transform:ct}),P=Ek(e,`ALLOWED_ATTR`,ve,{transform:ct}),$e=Ek(e,`ALLOWED_NAMESPACES`,et,{transform:DO}),Ke=Ek(e,`ADD_URI_SAFE_ATTR`,qe,{transform:ct,base:qe}),We=Ek(e,`ADD_DATA_URI_TAGS`,Ge,{transform:ct,base:Ge}),He=Ek(e,`FORBID_CONTENTS`,Ue,{transform:ct}),ye=Ek(e,`FORBID_TAGS`,WO({}),{transform:ct}),be=Ek(e,`FORBID_ATTR`,WO({}),{transform:ct}),Ve=IO(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?WO(e.USE_PROFILES):e.USE_PROFILES:!1,Se=e.ALLOW_ARIA_ATTR!==!1,Ce=e.ALLOW_DATA_ATTR!==!1,we=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=e.SAFE_FOR_TEMPLATES||!1,De=e.SAFE_FOR_XML!==!1,Oe=e.WHOLE_DOCUMENT||!1,Ne=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Fe=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Ie=e.SANITIZE_DOM!==!1,Le=e.SANITIZE_NAMED_PROPS||!1,ze=e.KEEP_CONTENT!==!1,Be=e.IN_PLACE||!1,M=qO(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:uk,Ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Xe,nt=Dk(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>HO({},tt)),it=Dk(e,`HTML_INTEGRATION_POINTS`,()=>HO({},rt));let t=Dk(e,`CUSTOM_ELEMENT_HANDLING`,()=>gO(null));if(F=gO(null),IO(t,`tagNameCheck`)&&dt(t.tagNameCheck)&&(F.tagNameCheck=t.tagNameCheck),IO(t,`attributeNameCheck`)&&dt(t.attributeNameCheck)&&(F.attributeNameCheck=t.attributeNameCheck),IO(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(F.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),hO(F),Ee&&(Ce=!1),Pe&&(Ne=!0),Ve&&(N=HO({},ek),P=gO(null),Ve.html===!0&&(HO(N,JO),HO(P,tk)),Ve.svg===!0&&(HO(N,YO),HO(P,nk),HO(P,ik)),Ve.svgFilters===!0&&(HO(N,XO),HO(P,nk),HO(P,ik)),Ve.mathMl===!0&&(HO(N,QO),HO(P,rk),HO(P,ik))),xe.tagCheck=null,xe.attributeCheck=null,IO(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?xe.tagCheck=e.ADD_TAGS:TO(e.ADD_TAGS)&&(N===_e&&(N=WO(N)),HO(N,e.ADD_TAGS,ct))),IO(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?xe.attributeCheck=e.ADD_ATTR:TO(e.ADD_ATTR)&&(P===ve&&(P=WO(P)),HO(P,e.ADD_ATTR,ct))),IO(e,`ADD_FORBID_CONTENTS`)&&TO(e.ADD_FORBID_CONTENTS)&&(He===Ue&&(He=WO(He)),HO(He,e.ADD_FORBID_CONTENTS,ct)),ze&&(N[`#text`]=!0),Oe&&HO(N,[`html`,`head`,`body`]),N.table&&(HO(N,[`tbody`]),delete ye.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw zO(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw zO(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ne()),T&&typeof E==`string`&&(E=A(``)));mO&&mO(e),lt=e},pt=HO({},[...YO,...XO,...ZO]),mt=HO({},[...QO,...$O]),ht=function(e,t,n){return t.namespaceURI===Xe?e===`svg`:t.namespaceURI===Je?e===`svg`&&(n===`annotation-xml`||nt[n]):!!pt[e]},gt=function(e,t,n){return t.namespaceURI===Xe?e===`math`:t.namespaceURI===Ye?e===`math`&&it[n]:!!mt[e]},_t=function(e,t,n){return t.namespaceURI===Ye&&!it[n]||t.namespaceURI===Je&&!nt[n]?!1:!mt[e]&&(at[e]||!pt[e])},vt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Ze,tagName:`template`});let n=EO(e.tagName),r=EO(t.tagName);return $e[e.namespaceURI]?e.namespaceURI===Ye?ht(n,t,r):e.namespaceURI===Je?gt(n,t,r):e.namespaceURI===Xe?_t(n,t,r):!!(ot===`application/xhtml+xml`&&$e[e.namespaceURI]):!1},yt=function(e){CO(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw zO(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},bt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},xt=function(e){wt(e);let t=g(e);if(t){let e=[];bO(t,t=>{CO(e,t)}),bO(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&bt(e,r,i)}},St=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}CO(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ne||Pe)try{yt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ct=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||P[ct(i)]||bt(e,r,i)}},wt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===yk.element&&Ct(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Tt=function(e,t){return De?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Et=function(e){if(!De)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===yk.processingInstruction||n===yk.comment&&RO(gk,e.data)){try{p(e)}catch{}continue}if(n===yk.element){let t=e,n=ct(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Tt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Dt=function(e){let t=null,r=null;if(Me)e=`<remove></remove>`+e;else{let t=OO(e,/^[\r\n\t ]+/);r=t&&t[0]}ot===`application/xhtml+xml`&&Ze===Xe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(Ze===Xe)try{t=new l().parseFromString(i,ot)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Ze,`template`,null);try{t.documentElement.innerHTML=Qe?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ze===Xe?se.call(t,Oe?`html`:`body`)[0]:Oe?t.documentElement:a},Ot=function(e){let t=S?S(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},kt=function(e){return e=kO(e,le,` `),e=kO(e,ue,` `),e=kO(e,de,` `),e},At=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=kt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&bO(i,e=>{Mt(e.content)&&At(e.content)})},jt=function(e){let t=x?x(e):null;return typeof t!=`string`||ct(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Mt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===yk.documentFragment}catch{return!1}},Nt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Pt(e,n,r){e.length!==0&&bO(e,e=>{e.call(t,n,r,lt)})}let Ft=function(e,t){return!!(De&&e.hasChildNodes()&&!Nt(e.firstElementChild)&&RO(hk,e.textContent)&&RO(hk,e.innerHTML)||De&&e.namespaceURI===Xe&&xk[t]&&(Nt(e.firstElementChild)||typeof e.textContent==`string`&&RO(Sk[t],e.textContent))||e.nodeType===yk.processingInstruction||De&&e.nodeType===yk.comment&&RO(gk,e.data))},It=function(e,t){return e instanceof RegExp?RO(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Lt=function(e,t,n){if(!ye[t]&&Ut(t)&&It(F.tagNameCheck,t))return!1;if(ze&&!He[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return yt(e),!0},Rt=function(e,t,n,r){return e.length===0?t:t===n||t===r?WO(t):t},zt=function(e,t){return e===t||_(e)!==null?!1:(Be&&wt(e),!0)},Bt=function(e,n){if(Pt(j.beforeSanitizeElements,e,null),zt(e,n))return!0;if(jt(e))return yt(e),!0;let r=ct(w(e));if(N=Rt(j.uponSanitizeElement,N,_e,Ae),Pt(j.uponSanitizeElement,e,{tagName:r,allowedTags:N}),zt(e,n))return!0;if(Ft(e,r))return yt(e),!0;if(ye[r]||!(xe.tagCheck instanceof Function&&xe.tagCheck(r))&&!N[r]){let t=Lt(e,r,n);return t===!1&&(Pt(j.afterSanitizeElements,e,null),zt(e,n))?!0:t}if(C(e)===yk.element&&!vt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&RO(_k,e.innerHTML))return yt(e),!0;if(Ee&&e.nodeType===yk.text){let n=kt(e.textContent);e.textContent!==n&&(CO(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Pt(j.afterSanitizeElements,e,null),zt(e,n)},Vt=function(e,t,r){if(be[t]||Tt(t,e)||Ie&&(t===`id`||t===`name`)&&(r in n||r in ut))return!1;let i=P[t]||xe.attributeCheck instanceof Function&&xe.attributeCheck(t,e);return Ce&&RO(fe,t)||Se&&RO(pe,t)?!0:i?Ke[t]||RO(M,kO(r,he,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&AO(r,`data:`)===0&&We[e]||we&&!RO(me,kO(r,he,``))?!0:!r:Ut(e)&&It(F.tagNameCheck,e)&&It(F.attributeNameCheck,t,e)||t===`is`&&F.allowCustomizedBuiltInElements&&It(F.tagNameCheck,r)},Ht=HO({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ut=function(e){return!Ht[EO(e)]&&RO(ge,e)},Wt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return te(r)}return r},Gt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!jt(e)||(yt(e),!1)}catch{return St(t,e),!1}},Kt=function(e,n){if(Pt(j.beforeSanitizeAttributes,e,null),zt(e,n))return;let r=e.attributes;if(!r||jt(e))return;P=Rt(j.uponSanitizeAttribute,P,ve,je);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0},a=r.length,o=ct(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=ct(s),d=l,f=s===`value`?d:jO(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Pt(j.uponSanitizeAttribute,e,i),f=i.attrValue,Le&&(u===`id`||u===`name`)&&AO(f,Re)!==0&&(St(s,e,n),f=Re+f,p=!0),De&&RO(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){St(s,e,n);continue}if(u===`attributename`&&OO(f,`href`)){St(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){St(s,e,n);continue}if(!Te&&RO(vk,f)){St(s,e,n);continue}if(Ee&&(f=kt(f)),!Vt(o,u,f)){St(s,e,n);continue}f=Wt(o,u,c,f),f!==d&&Gt(e,s,c,f)&&p&&SO(t.removed)}}Pt(j.afterSanitizeAttributes,e,null),zt(e,n)},I=function(e){let t=null,n=Ot(e);for(Pt(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Pt(j.uponSanitizeShadowNode,t,null),Bt(t,e),Kt(t,e),Mt(t.content)&&I(t.content),C(t)===yk.element){let e=v(t);Mt(e)&&(qt(e),I(e))}Pt(j.afterSanitizeShadowDOM,e,null)},qt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){I(e.shadow);continue}let n=e.node,r=C(n)===yk.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&ct(e)===`template`){let e=n.content;Mt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Mt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Qe=!e,Qe&&(e=`<!-->`),typeof e!=`string`&&!Nt(e)&&(e=GO(e),typeof e!=`string`))throw zO(`dirty is not a string, aborting`);if(!t.isSupported)return e;ke?(N=Ae,P=je):ft(n),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(N=WO(N)),j.uponSanitizeAttribute.length>0&&(P=WO(P)),t.removed=[];let c=Be&&typeof e!=`string`&&Nt(e);if(c){Et(e);let t=w(e);if(typeof t==`string`){let n=ct(t);if(!N[n]||ye[n])throw xt(e),zO(`root node is forbidden and cannot be sanitized in-place`)}if(jt(e))throw xt(e),zO(`root node is clobbered and cannot be sanitized in-place`);try{qt(e)}catch(t){throw xt(e),t}}else if(Nt(e))i=Dt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===yk.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),qt(i);else{if(!Ne&&!Ee&&!Oe&&e.indexOf(`<`)===-1)return T&&Fe?A(e):e;if(i=Dt(e),!i)return Ne?null:Fe?E:``}i&&Me&&yt(i.firstChild);let l=c?e:i;try{let e=Ot(l);for(;o=e.nextNode();)Bt(o,l),Kt(o,l),Mt(o.content)&&I(o.content)}catch(n){throw c&&(xt(e),bO(t.removed,e=>{e.element&&wt(e.element)})),n}if(c){let n=!1;if(bO(t.removed,t=>{t.element&&(t.element===e&&(n=!0),wt(t.element))}),n)throw zO(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ee&&At(e),e}if(Ne){if(Ee&&At(i),Pe)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(P.shadowroot||P.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=Oe?i.outerHTML:i.innerHTML;return Oe&&N[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&RO(pk,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
61
+ `+u),Ee&&(u=kt(u)),T&&Fe?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ft(e),ke=!0,Ae=N,je=P},t.clearConfig=function(){lt=null,ke=!1,Ae=null,je=null,T=D,E=``},t.isValidAttribute=function(e,t,n){lt||ft({});let r=ct(e),i=ct(t);return Vt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&IO(j,e)&&CO(j[e],t)},t.removeHook=function(e,t){if(IO(j,e)){if(t!==void 0){let n=xO(j[e],t);return n===-1?void 0:wO(j[e],n,1)[0]}return SO(j[e])}},t.removeHooks=function(e){IO(j,e)&&(j[e]=[])},t.removeAllHooks=function(){j=Tk()},t}var kk=Ok();function Ak(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var jk=Ak();function Mk(e){jk=e}var Nk={exec:()=>null};function Pk(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function $(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Ik.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Fk=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Ik={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Pk(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Pk(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Pk(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Pk(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Pk(e=>RegExp(`^ {0,${e}}(?:</?(?:${Zk})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:Pk(e=>RegExp(`^ {0,${e}}>`))},Lk=/^(?:[ \t]*(?:\n|$))+/,Rk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,zk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Bk=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Hk=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Uk=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wk=$(Uk).replace(/bull/g,Hk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Gk=$(Uk).replace(/bull/g,Hk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,qk=/^[^\n]+/,Jk=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Yk=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Jk).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Xk=$(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Hk).getRegex(),Zk=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Qk=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$k=$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Qk).replace(`tag`,Zk).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),eA=e=>$(Kk).replace(`hr`,Bk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Zk).getRegex(),tA=eA(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),nA=eA(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),rA={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,nA).getRegex(),code:Rk,def:Yk,fences:zk,heading:Vk,hr:Bk,html:$k,lheading:Wk,list:Xk,newline:Lk,paragraph:tA,table:Nk,text:qk},iA=$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Bk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Zk).getRegex(),aA={...rA,lheading:Gk,table:iA,paragraph:$(Kk).replace(`hr`,Bk).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,iA).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,Zk).getRegex()},oA={...rA,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Qk).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nk,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(Kk).replace(`hr`,Bk).replace(`heading`,` *#{1,6} *[^
62
+ ]`).replace(`lheading`,Wk).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},sA=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cA=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lA=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,uA=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,dA=/[\p{P}\p{S}]/u,fA=/[\s\p{P}\p{S}]/u,pA=/[^\s\p{P}\p{S}]/u,mA=$(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,fA).getRegex(),hA=/[\p{Pi}\p{Ps}"']/u,gA=/(?!~)[\p{P}\p{S}]/u,_A=/(?!~)[\s\p{P}\p{S}]/u,vA=/(?:[^\s\p{P}\p{S}]|~)/u,yA=$(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Fk?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),bA=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,xA=$(bA,`u`).replace(/punct/g,dA).getRegex(),SA=$(bA,`u`).replace(/punct/g,gA).getRegex(),CA=$(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,hA).replace(/punct/g,dA).getRegex(),wA=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,TA=$(wA,`gu`).replace(/notPunctSpace/g,pA).replace(/punctSpace/g,fA).replace(/punct/g,dA).getRegex(),EA=$(wA,`gu`).replace(/notPunctSpace/g,vA).replace(/punctSpace/g,_A).replace(/punct/g,gA).getRegex(),DA=$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,pA).replace(/punctSpace/g,fA).replace(/punct/g,dA).getRegex(),OA=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,pA).replace(/punctSpace/g,fA).replace(/punct/g,dA).getRegex(),kA=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,pA).replace(/punctSpace/g,fA).replace(/punct/g,dA).getRegex(),AA=$(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,dA).getRegex(),jA=$(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,pA).replace(/punctSpace/g,fA).replace(/punct/g,dA).getRegex(),MA=$(/\\(punct)/,`gu`).replace(/punct/g,dA).getRegex(),NA=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),PA=$(Qk).replace(`(?:-->|$)`,`-->`).getRegex(),FA=$(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,PA).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),IA=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,LA=$(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,IA).getRegex(),RA=$(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,LA).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zA=$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,LA).replace(`ref`,Jk).getRegex(),BA=$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Jk).getRegex(),VA=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,HA=$(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,IA).getRegex(),UA=$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,HA).replace(`ref`,VA).getRegex()).replace(`nolink`,$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,VA).getRegex()).getRegex(),WA=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,GA=$(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),KA={_backpedal:Nk,anyPunctuation:MA,autolink:NA,blockSkip:yA,br:lA,code:cA,del:Nk,delLDelim:Nk,delRDelim:Nk,emStrongLDelim:xA,emStrongRDelimAst:TA,emStrongRDelimUnd:OA,escape:sA,link:RA,nolink:BA,punctuation:mA,reflink:zA,reflinkSearch:UA,tag:FA,text:uA,url:Nk},qA={...KA,emStrongLDelim:CA,emStrongRDelimAst:DA,emStrongRDelimUnd:kA,link:$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,LA).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,LA).getRegex()},JA={...KA,emStrongRDelimAst:EA,emStrongLDelim:SA,delLDelim:AA,delRDelim:jA,url:$(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,GA).replace(`protocol`,WA).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,WA).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},YA={...JA,br:$(lA).replace(`{2,}`,`*`).getRegex(),text:$(JA.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},XA={normal:rA,gfm:aA,pedantic:oA},ZA={normal:KA,gfm:JA,breaks:YA,pedantic:qA},QA={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},$A=e=>QA[e];function ej(e,t){if(t){if(Ik.escapeTest.test(e))return e.replace(Ik.escapeReplace,$A)}else if(Ik.escapeTestNoEncode.test(e))return e.replace(Ik.escapeReplaceNoEncode,$A);return e}function tj(e){return e.replace(Ik.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function nj(e){try{e=encodeURI(e).replace(Ik.percentDecode,`%`)}catch{return null}return e}function rj(e,t){let n=e.replace(Ik.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Ik.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Ik.slashPipe,`|`);return n}function ij(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function aj(e){let t=e.split(`
63
+ `),n=t.length-1;for(;n>=0&&Ik.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
64
+ `)}function oj(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function sj(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function cj(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function lj(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function uj(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
65
65
  `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
66
- `)}function aj(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var oj=class{options;rules;lexer;constructor(e){this.options=e||Tk}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:$A(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ij(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=QA(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:QA(t[0],`
67
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:QA(t[0],`
68
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=QA(t[0],`
66
+ `)}function dj(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var fj=class{options;rules;lexer;constructor(e){this.options=e||jk}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:aj(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=uj(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ij(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:ij(t[0],`
67
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ij(t[0],`
68
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ij(t[0],`
69
69
  `).split(`
70
70
  `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
71
71
  `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
@@ -80,19 +80,19 @@ ${d.join(`
80
80
  `+e.join(`
81
81
  `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
82
82
  `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
83
- `,1)[0],l=t[1].length,u=this.options.pedantic?nj(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>nj(e,l)),d=e.split(`
83
+ `,1)[0],l=t[1].length,u=this.options.pedantic?cj(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>cj(e,l)),d=e.split(`
84
84
  `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
85
85
  `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
86
86
  `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
87
87
  `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
88
88
  `+d}f=!d.trim(),r+=l+`
89
- `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=$A(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&tj(t[2],`()`)!==-1)return;let e=ej(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:QA(t[0],`
90
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ZA(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
91
- `):[],a={type:`table`,raw:QA(t[0],`
92
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(ZA(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:QA(t[0],`
89
+ `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=aj(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&sj(t[2],`()`)!==-1)return;let e=oj(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:ij(t[0],`
90
+ `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=rj(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
91
+ `):[],a={type:`table`,raw:ij(t[0],`
92
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(rj(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:ij(t[0],`
93
93
  `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
94
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&aj(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=QA(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=tj(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),rj(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&aj(e,n[1],r,this.rules))return;let i=t[ej((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return rj(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:YA(t[0]),escaped:e}}}},sj=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Tk,this.options.tokenizer=this.options.tokenizer||new oj,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:Ak,block:WA.normal,inline:GA.normal};this.options.pedantic?(t.block=WA.pedantic,t.inline=GA.pedantic):this.options.gfm&&(t.block=WA.gfm,t.inline=this.options.breaks?GA.breaks:GA.gfm),this.tokenizer.rules=t}static get rules(){return{block:WA,inline:GA}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Ak.carriageReturn,`
95
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Ak.tabCharGlobal,` `).replace(Ak.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
94
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&dj(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=ij(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=sj(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),lj(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&dj(e,n[1],r,this.rules))return;let i=t[oj((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return lj(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:tj(t[0]),escaped:e}}}},pj=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||jk,this.options.tokenizer=this.options.tokenizer||new fj,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:Ik,block:XA.normal,inline:ZA.normal};this.options.pedantic?(t.block=XA.pedantic,t.inline=ZA.pedantic):this.options.gfm&&(t.block=XA.gfm,t.inline=this.options.breaks?ZA.breaks:ZA.gfm),this.tokenizer.rules=t}static get rules(){return{block:XA,inline:ZA}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Ik.carriageReturn,`
95
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Ik.tabCharGlobal,` `).replace(Ik.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
96
96
  `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
97
97
  `)?``:`
98
98
  `)+i.raw,n.text+=`
@@ -105,9 +105,9 @@ ${d.join(`
105
105
  `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
106
106
  `)?``:`
107
107
  `)+i.raw,n.text+=`
108
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,ej(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,ej(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},cj=class{options;parser;constructor(e){this.options=e||Tk}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Ak.notSpaceStart)?.[0],i=e?e.replace(Ak.endingNewline,``)+`
109
- `:``;return r?`<pre><code class="language-`+JA(r)+`">`+(n?i:JA(i,!0))+`</code></pre>
110
- `:`<pre><code>`+(n?i:JA(i,!0))+`</code></pre>
108
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,oj(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,oj(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},mj=class{options;parser;constructor(e){this.options=e||jk}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Ik.notSpaceStart)?.[0],i=e?e.replace(Ik.endingNewline,``)+`
109
+ `:``;return r?`<pre><code class="language-`+ej(r)+`">`+(n?i:ej(i,!0))+`</code></pre>
110
+ `:`<pre><code>`+(n?i:ej(i,!0))+`</code></pre>
111
111
  `}blockquote({tokens:e}){return`<blockquote>
112
112
  ${this.parser.parse(e)}</blockquote>
113
113
  `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
@@ -123,5 +123,5 @@ ${this.parser.parse(e)}</blockquote>
123
123
  `}tablerow({text:e}){return`<tr>
124
124
  ${e}</tr>
125
125
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
126
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${JA(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?JA(n,!0):this.parser.parseInline(r),o=XA(e);if(o===null)return a;e=JA(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+JA(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=XA(e);if(i===null)return JA(n);e=i;let a=`<img src="${JA(e)}" alt="${JA(n)}"`;return t&&(a+=` title="${JA(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:JA(e.text)}},lj=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},uj=class e{options;renderer;textRenderer;constructor(e){this.options=e||Tk,this.options.renderer=this.options.renderer||new cj,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new lj}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},dj=class{options;block;constructor(e){this.options=e||Tk}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?sj.lex:sj.lexInline}provideParser(e=this.block){return e?uj.parse:uj.parseInline}},fj=class{defaults=wk();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=uj;Renderer=cj;TextRenderer=lj;Lexer=sj;Tokenizer=oj;Hooks=dj;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new cj(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new oj(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new dj;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=dj.passThroughHooks.has(n)?e=>{if(this.defaults.async&&dj.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return sj.lex(e,t??this.defaults)}parser(e,t){return uj.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?sj.lex:sj.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?uj.parse:uj.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?sj.lex:sj.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?uj.parse:uj.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
127
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+JA(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},pj=new fj;function mj(e,t){return pj.parse(e,t)}mj.options=mj.setOptions=function(e){return pj.setOptions(e),mj.defaults=pj.defaults,Ek(mj.defaults),mj},mj.getDefaults=wk,mj.defaults=Tk;function hj(...e){return pj.use(...e),mj.defaults=pj.defaults,Ek(mj.defaults),mj}mj.use=hj,mj.walkTokens=function(e,t){return pj.walkTokens(e,t)},mj.parseInline=pj.parseInline,mj.Parser=uj,mj.parser=uj.parse,mj.Renderer=cj,mj.TextRenderer=lj,mj.Lexer=sj,mj.lexer=sj.lex,mj.Tokenizer=oj,mj.Hooks=dj,mj.parse=mj,mj.options,mj.setOptions,mj.walkTokens,mj.parseInline,uj.parse,sj.lex;function gj(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function _j(e){if(!e||e.length===0)return``;let t=``;for(let n of e)`tokens`in n&&Array.isArray(n.tokens)?t+=_j(n.tokens):`text`in n&&typeof n.text==`string`&&(t+=n.text);return t}function vj(e,t){let n=[],r=[],i=new Set,a=new Map,o=new fj({gfm:!0});o.use({extensions:[{name:`citation`,level:`inline`,start(e){return e.indexOf(`[^`)},tokenizer(e){let t=/^\[\^([^\]\s]+)\](?!:)/.exec(e);if(t?.[1])return{type:`citation`,raw:t[0],label:t[1]}},renderer(e){if(!(`label`in e)||typeof e.label!=`string`)return``;let n=e.label,i=t.sources.find(e=>e.id===n||e.id.toLowerCase()===n.toLowerCase()),o=i?i.id:n,s=r.indexOf(o)+1;if(s===0&&(r.push(o),s=r.length),i)return`<sup class="okf-cite"><a href="#source-${encodeURIComponent(i.id)}" data-okf-cite="${gj(i.id)}">${s}</a></sup>`;let c=a.get(n.toLowerCase());return c?.href?`<sup class="okf-cite"><a href="${gj(c.href)}" target="_blank" rel="noopener noreferrer">${s}</a></sup>`:`<sup class="okf-cite"><span class="okf-cite-missing" title="Unknown source">${s}</span></sup>`}}],renderer:{heading(e){let t=e.depth,r=_j(e.tokens).trim(),a=r.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`heading`,o=a,s=1;for(;i.has(o);)s++,o=`${a}-${s}`;i.add(o),(t===2||t===3)&&n.push({id:o,text:r,depth:t});let c=this.parser.parseInline(e.tokens);return`<h${t} id="${o}"><a class="okf-anchor" href="#${o}" aria-hidden="true">#</a>${c}</h${t}>\n`},code(e){return`<pre class="okf-code" data-lang="${gj((e.lang||``).match(/^\S*/)?.[0]??``)}"><code>${gj(e.text)}</code></pre>\n`},link(e){let n=e.href,r=e.title?` title="${gj(e.title)}"`:``,i=this.parser.parseInline(e.tokens),a=ZE(n,t.conceptId);if(a.kind===`concept`){let e=t.outbound.find(e=>e.id===a.id),n=!e||e.exists,o=gj(`/ui${QE(t.project,a.id)}${a.hash}`),s=gj(a.id);return n?`<a href="${o}" data-okf-internal data-okf-concept="${s}"${r}>${i}</a>`:`<a href="${o}" data-okf-internal data-okf-concept="${s}" class="okf-broken" title="Missing concept">${i}</a>`}return a.kind===`file`?`<a href="${gj(`/ui${$E(t.project,a.path)}${a.hash}`)}" data-okf-internal${r}>${i}</a>`:a.kind===`anchor`?`<a href="${gj(n)}"${r}>${i}</a>`:a.kind===`external`?`<a href="${gj(n)}" target="_blank" rel="noopener noreferrer" class="okf-external"${r}>${i}</a>`:`<span class="okf-broken" title="Broken link">${i}</span>`},image(e){let t=e.href,n=gj(e.text),r=e.title?` title="${gj(e.title)}"`:``;return t.startsWith(`http://`)||t.startsWith(`https://`)||t.startsWith(`//`)||t.startsWith(`data:`)?`<img src="${gj(t)}" alt="${n}"${r}>`:`<span class="okf-image-missing">${n}</span>`}}});let s=o.lexer(e);if(s.links)for(let[e,t]of Object.entries(s.links))e.startsWith(`^`)&&t&&typeof t.href==`string`&&a.set(e.slice(1).toLowerCase(),{href:t.href,title:typeof t.title==`string`?t.title:void 0});for(let e=0;e<s.length;e++){let n=s[e];if(!(n&&n.type===`space`)){n&&n.type===`heading`&&n.depth===1&&(`text`in n&&typeof n.text==`string`?n.text.trim():``).toLowerCase()===t.title.trim().toLowerCase()&&s.splice(e,1);break}}return{html:Ck.sanitize(o.parser(s),{ADD_ATTR:[`target`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`iframe`,`object`,`embed`],FORBID_ATTR:[`style`]}),headings:n,citations:r}}var yj=/^github\.com\/([^/]+)\/([^/]+)\/(.+)$/,bj=/^gitlab\.com\/([^/]+)\/([^/]+)\/(.+)$/,xj=/^(github|gitlab)\.com\/[^/]+\/[^/]+$/,Sj=/^https?:\/\//,Cj={type:!0,title:!0,description:!0,tags:!0,status:!0,generated:!0,verified:!0,sources:!0,stale_after:!0};function wj(e){if(!e||typeof e!=`object`)return[];let t=e.sources;if(!Array.isArray(t))return[];let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!r||typeof r!=`object`||!(`resource`in r)||typeof r.resource!=`string`)continue;let i=r.resource.trim();if(i.length===0)continue;let a=`id`in r&&typeof r.id==`string`&&r.id.trim().length>0?r.id.trim():`source-${e+1}`,o=`commit`in r&&typeof r.commit==`string`&&r.commit.trim().length>0?r.commit.trim():void 0,s=null,c=i;if(Sj.test(i))s=i;else{let e=yj.exec(i);if(e?.[1]&&e[2]&&e[3])s=`https://github.com/${e[1]}/${e[2]}/blob/${o??`HEAD`}/${e[3]}`,c=e[3];else{let e=bj.exec(i);e?.[1]&&e[2]&&e[3]?(s=`https://gitlab.com/${e[1]}/${e[2]}/-/blob/${o??`HEAD`}/${e[3]}`,c=e[3]):xj.test(i)&&(s=`https://${i}`)}}n.push({id:a,resource:i,...o===void 0?{}:{commit:o},url:s,label:c})}return n}function Tj(e){if(!e||typeof e!=`object`)return[];let t=e.verified;if(t==null)return[];let n=Array.isArray(t)?t:[t],r=[];for(let e of n)if(e&&typeof e==`object`&&`by`in e&&typeof e.by==`string`&&e.by.length>0){let t=`at`in e&&typeof e.at==`string`?e.at:void 0;r.push(t===void 0?{by:e.by}:{by:e.by,at:t})}return r}function Ej(e){return!e||typeof e!=`object`?[]:Object.entries(e).filter(([e])=>!(e in Cj))}function Dj({concept:e,conceptId:t,targetRect:n,onMouseEnter:r,onMouseLeave:i}){let a=n.bottom+6,o=Math.max(12,Math.min(n.left,window.innerWidth-332));return(0,h.jsx)(`div`,{role:`tooltip`,style:{top:a,left:o},onMouseEnter:r,onMouseLeave:i,className:`fixed z-50 w-80 max-w-[calc(100vw-24px)] rounded-xl border border-border-strong bg-surface/95 p-3.5 shadow-xl backdrop-blur-md transition-all duration-150`,children:e?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,h.jsx)(lD,{type:e.derived?.type??null,className:`mt-0.5 shrink-0`,size:16}),(0,h.jsx)(`div`,{className:`min-w-0 flex-1 font-medium text-sm text-fg line-clamp-2 leading-snug`,children:e.derived?.title??e.id})]}),e.derived?.description&&(0,h.jsx)(`p`,{className:`mt-1.5 text-xs text-muted line-clamp-2 leading-relaxed`,children:e.derived.description}),(0,h.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5 pt-1.5 border-t border-border/50`,children:[e.derived?.status&&(0,h.jsx)(HD,{status:e.derived.status}),e.derived?.trustTier&&(0,h.jsx)(UD,{tier:e.derived.trustTier}),e.derived?.stale&&(0,h.jsx)(WD,{})]})]}):(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(`div`,{className:`font-mono text-xs text-muted truncate`,children:t}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-4 rounded-full`}),(0,h.jsx)(Q,{className:`h-4 w-40 rounded-sm`})]}),(0,h.jsx)(Q,{className:`h-3 w-full rounded-sm`}),(0,h.jsx)(Q,{className:`h-3 w-3/4 rounded-sm`}),(0,h.jsxs)(`div`,{className:`flex gap-1 pt-1`,children:[(0,h.jsx)(Q,{className:`h-4 w-12 rounded-full`}),(0,h.jsx)(Q,{className:`h-4 w-16 rounded-full`})]})]})})}function Oj({project:e,concept:t,onHeadings:n,onCitations:r,className:i}){let a=kh(),o=(0,m.useRef)(null),[s,c]=(0,m.useState)(null),l=(0,m.useRef)(void 0),u=(0,m.useRef)(!1),d=(0,m.useMemo)(()=>vj(t.body,{project:e,conceptId:t.id,title:t.derived?.title??t.id,sources:wj(t.frontmatter),outbound:t.links.outbound}),[t,e]);return(0,m.useEffect)(()=>{n?.(d.headings),r?.(d.citations)},[d,n,r]),(0,m.useEffect)(()=>{let e=o.current;if(!e)return;let t=!1;return(async()=>{let n=Array.from(e.querySelectorAll(`pre.okf-code`));if(n.length===0)return;let{highlight:r}=await Ag(async()=>{let{highlight:e}=await import(`./highlight-CW19vWvw.js`);return{highlight:e}},[]);if(!t)for(let e of n){if(t)break;if(e.getAttribute(`data-okf-processed`)===`true`)continue;e.setAttribute(`data-okf-processed`,`true`);let n=e.getAttribute(`data-lang`)??``,i=e.querySelector(`code`)?.textContent??e.textContent??``,a=null;if(n)try{a=await r(i,n)}catch{}if(t)break;let o=document.createElement(`div`);if(o.className=`relative group not-prose my-4`,a){o.innerHTML=a;let e=o.querySelector(`pre`);e&&e.classList.add(`overflow-x-auto`)}else{let t=e.cloneNode(!0);o.appendChild(t)}let s=document.createElement(`button`);s.type=`button`,s.setAttribute(`aria-label`,`Copy code`),s.title=`Copy code`,s.className=`absolute top-2.5 right-2.5 z-10 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity inline-flex items-center gap-1 rounded-md border border-border bg-surface/80 px-2 py-1 text-xs font-medium text-muted backdrop-blur-xs hover:bg-surface-2 hover:text-fg focus-visible:outline-2 outline-accent-500 cursor-pointer select-none`,s.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`,s.addEventListener(`click`,async e=>{e.stopPropagation();try{await navigator.clipboard.writeText(i),s.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-emerald-500 shrink-0"><polyline points="20 6 9 17 4 12"/></svg>`,setTimeout(()=>{s.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`},1500)}catch{}}),o.appendChild(s),e.parentNode?.replaceChild(o,e)}})(),()=>{t=!0}},[d.html]),(0,m.useEffect)(()=>{let e=()=>{clearTimeout(l.current),c(null)};return window.addEventListener(`scroll`,e,{passive:!0}),()=>{window.removeEventListener(`scroll`,e),clearTimeout(l.current)}},[]),(0,h.jsxs)(`div`,{className:`relative`,children:[(0,h.jsx)(`div`,{ref:o,onClick:e=>{let t=e.target;if(!t)return;let n=t.closest(`a[data-okf-cite]`);if(n){e.preventDefault();let t=n.getAttribute(`data-okf-cite`);if(t){let e=document.getElementById(`source-${t}`);e&&(e.scrollIntoView({behavior:`smooth`}),e.classList.remove(`okf-flash`),e.offsetWidth,e.classList.add(`okf-flash`),setTimeout(()=>{e.classList.remove(`okf-flash`)},1600))}return}let r=t.closest(`a[data-okf-internal]`);if(r){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;e.preventDefault();let t=r.getAttribute(`href`);if(t){let e=t;e.startsWith(`/ui`)&&(e=e.slice(3)||`/`),a(e)}}},onMouseOver:t=>{let n=t.target;if(!n)return;let r=n.closest(`a[data-okf-concept]`);if(!r)return;let i=r.getAttribute(`data-okf-concept`);i&&s?.targetEl!==r&&(clearTimeout(l.current),l.current=window.setTimeout(async()=>{let t=r.getBoundingClientRect();try{let n=await T_.fetchQuery({queryKey:E_.concept(e,i),queryFn:()=>v_(e,i)});c({conceptId:i,concept:n,rect:t,targetEl:r})}catch{}},250))},onMouseOut:e=>{let t=e.target;if(!t)return;let n=t.closest(`a[data-okf-concept]`);n&&(clearTimeout(l.current),setTimeout(()=>{u.current||c(e=>e?.targetEl===n?null:e)},100))},className:X(`prose prose-zinc dark:prose-invert max-w-3xl`,i),dangerouslySetInnerHTML:{__html:d.html}}),s&&(0,h.jsx)(Dj,{concept:s.concept,conceptId:s.conceptId,targetRect:s.rect,onMouseEnter:()=>{u.current=!0},onMouseLeave:()=>{u.current=!1,c(null)}})]})}function kj({headings:e,className:t}){let[n,r]=(0,m.useState)(e[0]?.id??``);if((0,m.useEffect)(()=>{if(e.length<3)return;let t=e.map(e=>document.getElementById(e.id)).filter(e=>e!==null);if(t.length===0)return;let n=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&r(t.target.id)},{rootMargin:`0px 0px -70% 0px`,threshold:[0,1]});for(let e of t)n.observe(e);return()=>{n.disconnect()}},[e]),e.length<3)return null;let i=(e,t)=>{e.preventDefault();let n=document.getElementById(t);n&&(n.scrollIntoView({behavior:`smooth`}),r(t),window.history.replaceState(null,``,`#${t}`))};return(0,h.jsxs)(`nav`,{"aria-label":`Table of contents`,className:X(`space-y-2`,t),children:[(0,h.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted`,children:`On this page`}),(0,h.jsx)(`ul`,{className:`space-y-1 border-l border-border text-xs`,children:e.map(e=>{let t=n===e.id;return(0,h.jsx)(`li`,{className:e.depth===3?`pl-5`:`pl-3`,children:(0,h.jsx)(`a`,{href:`#${e.id}`,onClick:t=>i(t,e.id),className:X(`block py-0.5 transition-colors line-clamp-1`,t?`-ml-px border-l-2 border-accent-500 pl-1 font-medium text-accent-500`:`text-muted hover:text-fg`),children:e.text})},e.id)})})]})}function Aj(){let e=Nh(),t=e.project??``,n=e[`*`]??``,{data:r,isLoading:i,error:a,refetch:o}=A_(t,n),{data:s}=M_(t,{id:n,limit:10}),[c,l]=(0,m.useState)([]),[u,d]=(0,m.useState)([]),[f,p]=(0,m.useState)(!1);(0,m.useEffect)(()=>{r&&iD({project:t,id:r.id,title:r.derived?.title??r.id,type:r.derived?.type??null})},[r,t]);let g=(0,m.useMemo)(()=>{if(!r)return[];let e=wj(r.frontmatter),t=new Map;for(let n of e)t.set(n.id,n);let n=[],i=new Set;for(let e of u){let r=t.get(e);r&&!i.has(r.id)&&(n.push(r),i.add(r.id))}for(let t of e)i.has(t.id)||(n.push(t),i.add(t.id));return n},[r,u]),_=r?.derived?.title??(n||`Concept`);if(i)return(0,h.jsxs)(oS,{title:_,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6 space-y-6`,children:[(0,h.jsxs)(`div`,{className:`space-y-3 border-b border-border pb-6`,children:[(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(Q,{className:`h-5 w-20 rounded-full`}),(0,h.jsx)(Q,{className:`h-5 w-16 rounded-full`})]}),(0,h.jsx)(Q,{className:`h-9 w-96 rounded-md`}),(0,h.jsx)(Q,{className:`h-5 w-full max-w-xl rounded-md`})]}),(0,h.jsxs)(`div`,{className:`flex flex-col xl:flex-row gap-8`,children:[(0,h.jsxs)(`div`,{className:`flex-1 space-y-4`,children:[(0,h.jsx)(Q,{className:`h-32 w-full rounded-xl`}),(0,h.jsx)(Q,{className:`h-48 w-full rounded-xl`})]}),(0,h.jsxs)(`div`,{className:`w-full xl:w-72 space-y-4`,children:[(0,h.jsx)(Q,{className:`h-40 w-full rounded-xl`}),(0,h.jsx)(Q,{className:`h-40 w-full rounded-xl`})]})]})]});if(a)return(0,h.jsx)(oS,{title:_,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(rS,{error:a,onRetry:o,fullScreen:!0})});if(!r)return(0,h.jsx)(oS,{title:_,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(nS,{title:`Concept not found`,hint:`Could not find concept "${n}" in project "${t}".`})});let v=r.derived?.status?.toLowerCase()===`deprecated`,y=Tj(r.frontmatter),b=Ej(r.frontmatter);return(0,h.jsxs)(oS,{title:`${_} · ${t}`,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6`,children:[(0,h.jsxs)(`header`,{className:`space-y-4 border-b border-border pb-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(GD,{type:r.derived?.type??null}),r.derived?.status&&(0,h.jsx)(HD,{status:r.derived.status}),r.derived?.trustTier&&(0,h.jsx)(UD,{tier:r.derived.trustTier}),r.derived?.stale&&(0,h.jsx)(WD,{})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:X(`text-3xl font-semibold tracking-tight text-fg`,v&&`line-through opacity-70`),children:r.derived?.title??r.id}),r.derived?.description&&(0,h.jsx)(`p`,{className:`mt-2 text-lg text-muted leading-relaxed`,children:r.derived.description})]}),r.derived?.tags&&r.derived.tags.length>0&&(0,h.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5 pt-1`,children:r.derived.tags.map(e=>(0,h.jsxs)($g,{to:`/search?project=${encodeURIComponent(t)}&tag=${encodeURIComponent(e)}`,className:`inline-flex items-center rounded-md bg-surface-2 px-2 py-0.5 text-xs font-medium text-muted hover:text-fg hover:bg-border transition-colors`,children:[`#`,e]},e))}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-2`,children:[(0,h.jsx)(cS,{value:typeof window<`u`?window.location.href:``,label:`Copy link`}),(0,h.jsx)(cS,{value:r.id,label:`Copy ID`}),(0,h.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),"aria-label":`Toggle markdown source`,className:X(`inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-2 outline-accent-500 cursor-pointer`,f?`bg-accent-500/10 text-accent-500 border-accent-500/30`:`bg-surface text-muted hover:bg-surface-2 hover:text-fg`),children:[(0,h.jsx)(Gb,{size:14,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Source`})]})]})]}),(0,h.jsxs)(`div`,{className:`mt-8 flex flex-col xl:flex-row xl:items-start gap-8`,children:[(0,h.jsx)(`div`,{className:`min-w-0 flex-1`,children:f?(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted`,children:[(0,h.jsx)(`span`,{className:`font-mono`,children:`Raw Markdown`}),(0,h.jsx)(cS,{value:r.markdown,label:`Copy markdown`})]}),(0,h.jsx)(KD,{code:r.markdown,lang:`markdown`,lineNumbers:!0,className:`rounded-xl border border-border bg-surface-2 shadow-xs`})]}):(0,h.jsx)(Oj,{project:t,concept:r,onHeadings:l,onCitations:d})}),(0,h.jsxs)(`aside`,{className:`w-full xl:w-72 xl:sticky xl:top-20 shrink-0 space-y-6`,children:[c.length>=3&&(0,h.jsx)(kj,{headings:c}),(0,h.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsx)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:`Details`}),r.derived?.generatedAt&&(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-muted shrink-0`,children:`Generated`}),(0,h.jsxs)(`span`,{className:`text-fg text-right font-mono text-[11px]`,title:wD(r.derived.generatedAt),children:[CD(r.derived.generatedAt),r.derived.generatedBy&&` by ${r.derived.generatedBy}`]})]}),(0,h.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,h.jsx)(`span`,{className:`text-muted block`,children:`Verified`}),y.length>0?(0,h.jsx)(`div`,{className:`space-y-1.5 pl-1`,children:y.map((e,t)=>(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-fg`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,h.jsx)(MD,{actor:e.by,size:18}),(0,h.jsx)(`span`,{className:`truncate font-mono text-[11px]`,children:e.by})]}),e.at&&(0,h.jsx)(`span`,{className:`text-muted text-[10px] shrink-0`,title:wD(e.at),children:CD(e.at)})]},`${e.by}-${e.at??t}`))}):(0,h.jsx)(`div`,{className:`text-subtle italic pl-1`,children:`Unverified`})]}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-muted`,children:`Stale after`}),(0,h.jsx)(`span`,{className:X(`font-mono text-[11px]`,r.derived?.stale?`text-orange-500 font-semibold`:`text-fg`),children:r.derived?.staleAfter?r.derived.staleAfter.split(`T`)[0]:`—`})]}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-muted`,children:`Revision`}),(0,h.jsx)(`span`,{className:`font-mono text-[11px] text-muted`,children:r.revision.slice(0,8)})]})]}),g.length>0&&(0,h.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsxs)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:[`Sources (`,g.length,`)`]}),(0,h.jsx)(`ol`,{className:`space-y-2`,children:g.map((e,t)=>(0,h.jsxs)(`li`,{id:`source-${e.id}`,className:`rounded-lg p-2 transition-colors border border-transparent hover:border-border hover:bg-surface-2/50`,children:[(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,h.jsxs)(`span`,{className:`font-mono text-muted text-[10px] shrink-0`,children:[t+1,`.`]}),(0,h.jsx)(`span`,{className:`font-mono text-fg text-xs truncate`,title:e.label,children:e.label})]}),e.commit&&(0,h.jsx)(`span`,{className:`font-mono text-[10px] px-1.5 py-0.5 rounded bg-surface border border-border text-muted shrink-0`,title:`Commit ${e.commit}`,children:OD(e.commit)})]}),e.url&&(0,h.jsx)(`div`,{className:`mt-1 pl-4`,children:(0,h.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-accent-500 hover:text-accent-400 hover:underline truncate max-w-full`,children:[(0,h.jsx)(`span`,{className:`truncate`,children:e.resource}),(0,h.jsx)(Zb,{size:10,className:`shrink-0`})]})})]},e.id))})]}),(0,h.jsx)(JD,{project:t,conceptId:r.id,inbound:r.links.inbound,outbound:r.links.outbound}),(0,h.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsx)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:`History`}),s&&s.length>0?(0,h.jsx)(`div`,{className:`relative pl-4 space-y-4 before:absolute before:left-1.5 before:top-2 before:bottom-2 before:w-px before:bg-border`,children:s.map(e=>(0,h.jsxs)(`div`,{className:`relative space-y-1`,children:[(0,h.jsx)(`div`,{className:`absolute -left-4 top-1.5 h-2 w-2 rounded-full bg-accent-500 ring-2 ring-surface`}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-1 text-[11px]`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,h.jsx)(MD,{actor:e.actor,size:16}),(0,h.jsx)(`span`,{className:`truncate font-mono text-fg`,children:e.actor})]}),(0,h.jsx)(`span`,{className:`text-muted shrink-0 text-[10px]`,title:wD(e.at),children:CD(e.at)})]}),(0,h.jsx)(`p`,{className:`text-fg text-xs break-words`,children:e.subject}),(0,h.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,h.jsx)(cS,{value:e.sha,label:OD(e.sha),className:`px-1.5 py-0.5 text-[10px] font-mono`})})]},e.sha))}):(0,h.jsx)(`div`,{className:`text-subtle italic`,children:`No history available`})]}),r.issues&&r.issues.length>0&&(0,h.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsxs)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:[`Lint issues (`,r.issues.length,`)`]}),(0,h.jsx)(`div`,{className:`space-y-2`,children:r.issues.map(e=>(0,h.jsxs)(`div`,{className:`flex items-start gap-2 p-2 rounded-lg bg-surface border border-border/60`,children:[e.severity===`error`?(0,h.jsx)(Lb,{size:14,className:`text-rose-500 shrink-0 mt-0.5`}):e.severity===`warning`?(0,h.jsx)(Zx,{size:14,className:`text-amber-500 shrink-0 mt-0.5`}):(0,h.jsx)(_x,{size:14,className:`text-sky-500 shrink-0 mt-0.5`}),(0,h.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,h.jsx)(`div`,{className:`font-mono font-semibold text-[11px] text-fg`,children:e.code}),(0,h.jsx)(`p`,{className:`text-muted text-[11px] leading-tight break-words`,children:e.message})]})]},`${e.code}-${e.path}-${e.message}`))})]}),b.length>0&&(0,h.jsxs)(`details`,{className:`group rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsxs)(`summary`,{className:`cursor-pointer font-semibold uppercase tracking-wider text-muted hover:text-fg flex items-center justify-between select-none`,children:[(0,h.jsxs)(`span`,{children:[`Extra frontmatter (`,b.length,`)`]}),(0,h.jsx)(jb,{size:14,className:`transition-transform group-open:rotate-180`})]}),(0,h.jsx)(`div`,{className:`mt-2 space-y-1 overflow-x-auto rounded-lg bg-surface p-2 font-mono text-[11px] border border-border/50`,children:b.map(([e,t])=>(0,h.jsxs)(`div`,{className:`break-all`,children:[(0,h.jsx)(`span`,{className:`text-accent-500`,children:e}),`:`,` `,(0,h.jsx)(`span`,{className:`text-muted`,children:JSON.stringify(t)})]},e))})]})]})]})]})}var jj={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,json:`json`,yaml:`yaml`,yml:`yaml`,sh:`bash`,bash:`bash`,py:`python`,go:`go`,rs:`rust`,sql:`sql`,md:`markdown`,diff:`diff`,patch:`diff`,toml:`toml`,html:`html`,css:`css`,java:`java`,rb:`ruby`,dockerfile:`dockerfile`};function Mj(e){let t=e.split(`/`).pop()??e;if(t.toLowerCase()===`dockerfile`)return`dockerfile`;let n=t.lastIndexOf(`.`);return n===-1?null:jj[t.slice(n+1).toLowerCase()]??null}function Nj(){let e=Nh(),t=e.project??``,n=e[`*`]??``,{data:r,isLoading:i,error:a,refetch:o}=j_(t,n),s=n.split(`/`).pop()??n,c=s?`${s} · ${t}`:`File`;if(i)return(0,h.jsxs)(oS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6 space-y-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between border-b border-border pb-4`,children:[(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-6 w-64 rounded-md`}),(0,h.jsx)(Q,{className:`h-4 w-28 rounded-md`})]}),(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(Q,{className:`h-8 w-24 rounded-md`}),(0,h.jsx)(Q,{className:`h-8 w-28 rounded-md`})]})]}),(0,h.jsx)(Q,{className:`h-96 w-full rounded-xl`})]});if(a)return(0,h.jsx)(oS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(rS,{error:a,onRetry:o,fullScreen:!0})});if(!r)return(0,h.jsx)(oS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(nS,{title:`File not found`,hint:`Could not find file "${n}" in project "${t}".`})});let l=()=>{let e=new Blob([r.content],{type:`text/plain;charset=utf-8`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=s||`file`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},u=Mj(n);return(0,h.jsxs)(oS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6 space-y-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between border-b border-border pb-4`,children:[(0,h.jsxs)(`div`,{className:`space-y-1.5 min-w-0`,children:[(0,h.jsx)(`h1`,{className:`font-mono text-xl font-semibold text-fg break-all`,children:n}),r.revision&&(0,h.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,h.jsxs)(`span`,{className:`font-mono text-xs px-2 py-0.5 rounded-md bg-surface-2 border border-border text-muted`,children:[`rev: `,r.revision.slice(0,8)]})})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,h.jsx)(cS,{value:r.content,label:`Copy content`}),(0,h.jsxs)(`button`,{type:`button`,onClick:l,"aria-label":`Download file`,className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-2.5 py-1 text-xs font-medium text-muted transition-colors hover:bg-surface-2 hover:text-fg focus-visible:outline-2 outline-accent-500 cursor-pointer`,children:[(0,h.jsx)(Yb,{size:14,className:`shrink-0 text-muted`}),(0,h.jsx)(`span`,{children:`Download`})]})]})]}),(0,h.jsx)(KD,{code:r.content,lang:u,lineNumbers:!0,className:`rounded-xl border border-border bg-surface-2 overflow-hidden shadow-xs`})]})}function Pj(){let e=Nh().project??``,{data:t}=O_(e),n=N_(e),r=P_({project:e,stale:!0,limit:100}),i=P_({project:e,trustTier:`unverified`,limit:100}),a=n.isLoading||r.isLoading||i.isLoading,o=n.isError||r.isError||i.isError,s=n.error||r.error||i.error,c=()=>{n.refetch(),r.refetch(),i.refetch()},l=(0,m.useMemo)(()=>{if(!n.data)return{errors:[],warnings:[],infos:[]};let e=[],t=[],r=[];for(let i of n.data)i.severity===`error`?e.push(i):i.severity===`warning`?t.push(i):r.push(i);return{errors:e,warnings:t,infos:r}},[n.data]),u=t?.title?`${t.title} Health`:`Health`;if(a)return(0,h.jsxs)(oS,{title:u,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-32 rounded-md`}),(0,h.jsx)(Q,{className:`h-8 w-48 rounded-lg`})]}),(0,h.jsx)(`div`,{className:`mt-8 space-y-10`,children:Array.from({length:3}).map((e,t)=>(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsx)(Q,{className:`h-7 w-48 rounded-md`}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-4 space-y-3`,children:[(0,h.jsx)(Q,{className:`h-12 w-full rounded-lg`}),(0,h.jsx)(Q,{className:`h-12 w-full rounded-lg`})]})]},t))})]});if(o)return(0,h.jsx)(oS,{title:u,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(rS,{error:s,onRetry:c})});let d=n.data??[],f=r.data??[],p=i.data??[],g=l.errors.length;return(0,h.jsxs)(oS,{title:u,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-8`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}`,className:`transition-colors hover:text-fg`,children:t?.title??e}),(0,h.jsx)(`span`,{children:`/`}),(0,h.jsx)(`span`,{className:`text-fg`,children:`Health`})]}),(0,h.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-4`,children:(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`Knowledge Base Health`}),(0,h.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`Lint diagnostics, staleness, and verification status for `,t?.title??e]})]})})]}),(0,h.jsxs)(`div`,{className:`space-y-10`,children:[(0,h.jsxs)(`section`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border pb-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-fg`,children:`Specification Conformance`}),g===0?(0,h.jsxs)(VD,{className:`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-emerald-500/20`,children:[(0,h.jsx)(zb,{size:13}),(0,h.jsx)(`span`,{children:`Conformant`})]}):(0,h.jsxs)(VD,{className:`bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-rose-500/20`,children:[(0,h.jsx)(Lb,{size:13}),(0,h.jsxs)(`span`,{children:[g,` `,g===1?`error`:`errors`]})]})]}),(0,h.jsxs)(`span`,{className:`text-xs text-muted`,children:[`(`,d.length,`)`]})]}),d.length===0?(0,h.jsx)(nS,{icon:zb,title:`All concepts and files conform`,hint:`No lint or specification issues found in this project.`,className:`py-10`}):(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:[...l.errors,...l.warnings,...l.infos].map((t,n)=>{let r=t.path.endsWith(`.md`)?`/p/${encodeURIComponent(e)}/c/${t.path.slice(0,-3)}`:`/p/${encodeURIComponent(e)}/f/${t.path}`,i=_x,a=`text-sky-500 bg-sky-500/10 ring-sky-500/20`;return t.severity===`error`?(i=Lb,a=`text-rose-600 dark:text-rose-400 bg-rose-500/10 ring-rose-500/20`):t.severity===`warning`&&(i=Zx,a=`text-amber-600 dark:text-amber-400 bg-amber-500/10 ring-amber-500/20`),(0,h.jsx)(`div`,{className:`flex flex-col gap-2 p-4 sm:flex-row sm:items-center sm:justify-between`,children:(0,h.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0`,children:[(0,h.jsx)(`div`,{className:X(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full ring-1`,a),children:(0,h.jsx)(i,{size:14})}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`font-mono text-xs font-semibold text-fg`,children:t.code}),(0,h.jsx)(`span`,{className:`text-xs text-muted`,children:`on`}),(0,h.jsx)($g,{to:r,className:`font-mono text-xs text-accent-500 hover:text-accent-600 transition-colors truncate max-w-sm`,title:`Navigate to ${t.path}`,children:t.path})]}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted break-words`,children:t.message})]})]})},n)})})]}),(0,h.jsxs)(`section`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border pb-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-fg`,children:`Stale Concepts`}),f.length>0&&(0,h.jsx)(WD,{})]}),(0,h.jsxs)(`span`,{className:`text-xs text-muted`,children:[`(`,f.length,`)`]})]}),f.length===0?(0,h.jsx)(nS,{icon:Ub,title:`No stale concepts`,hint:`All concepts are within their defined freshness interval.`,className:`py-10`}):(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:f.map(t=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e)}/c/${t.id}`,className:`group flex flex-col gap-3 p-4 transition-colors hover:bg-surface-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,h.jsx)(lD,{type:t.type,size:18}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`text-sm font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500 truncate`,children:t.title}),(0,h.jsx)(`span`,{className:`font-mono text-xs text-subtle shrink-0`,children:t.id})]}),t.description&&(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted`,children:t.description})]})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 self-end sm:self-center`,children:[(0,h.jsx)(HD,{status:t.status}),(0,h.jsx)(UD,{tier:t.trustTier}),(0,h.jsx)(WD,{})]})]},t.id))})]}),(0,h.jsxs)(`section`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border pb-3`,children:[(0,h.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,h.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-fg`,children:`Unverified Concepts`})}),(0,h.jsxs)(`span`,{className:`text-xs text-muted`,children:[`(`,p.length,`)`]})]}),p.length===0?(0,h.jsx)(nS,{icon:zb,title:`All concepts verified`,hint:`Every concept has been machine-confirmed or human-reviewed.`,className:`py-10`}):(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:p.map(t=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e)}/c/${t.id}`,className:`group flex flex-col gap-3 p-4 transition-colors hover:bg-surface-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,h.jsx)(lD,{type:t.type,size:18}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`text-sm font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500 truncate`,children:t.title}),(0,h.jsx)(`span`,{className:`font-mono text-xs text-subtle shrink-0`,children:t.id})]}),t.description&&(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted`,children:t.description})]})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 self-end sm:self-center`,children:[(0,h.jsx)(HD,{status:t.status}),(0,h.jsx)(UD,{tier:t.trustTier}),t.stale&&(0,h.jsx)(WD,{})]})]},t.id))})]})]})]})}function Fj(){return(0,h.jsxs)(oS,{title:`Page not found`,className:`flex min-h-[70vh] flex-col items-center justify-center p-8 text-center`,children:[(0,h.jsx)(`div`,{className:`text-8xl font-black tracking-tighter bg-gradient-to-br from-accent-500 via-accent-400 to-glow bg-clip-text text-transparent select-none`,children:`404`}),(0,h.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold tracking-tight text-fg`,children:`Nothing here`}),(0,h.jsx)(`p`,{className:`mt-2 text-sm text-muted max-w-sm`,children:`The page you're looking for doesn't exist, has been moved, or you don't have access to it.`}),(0,h.jsx)($g,{to:`/`,className:`mt-6 inline-flex items-center justify-center rounded-lg bg-surface-2 px-4 py-2 text-xs font-medium text-fg ring-1 ring-border hover:bg-surface hover:ring-border-strong transition-colors`,children:`Back to projects`})]})}function Ij({label:e,icon:t,value:n,tone:r=`default`,to:i,children:a,className:o}){let s=r===`warn`,c=X(`rounded-xl border p-4 transition-all`,s?`border-orange-500/30 bg-orange-500/5 dark:border-orange-500/20`:`border-border bg-surface`,i&&`block hover:-translate-y-px hover:border-border-strong`,o),l=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-muted`,children:e}),t&&(0,h.jsx)(t,{size:16,className:s?`text-orange-600 dark:text-orange-400`:`text-muted shrink-0`})]}),n!==void 0&&(0,h.jsx)(`div`,{className:X(`mt-2 text-2xl font-semibold tracking-tight`,s?`text-orange-600 dark:text-orange-400`:`text-fg`),children:n}),a&&(0,h.jsx)(`div`,{className:`mt-3`,children:a})]});return i?(0,h.jsx)($g,{to:i,className:c,children:l}):(0,h.jsx)(`div`,{className:c,children:l})}function Lj(){let e=Nh().project??``,t=_D(),[n,r]=(0,m.useState)(!1),{data:i,isLoading:a,isError:o,error:s,refetch:c}=O_(e),l=A_(e,`overview`),u=k_(e,``),d=M_(e,{limit:8}),f=(0,m.useMemo)(()=>u.data?u.data.filter(e=>e.kind===`directory`).sort((e,t)=>e.path.localeCompare(t.path)):[],[u.data]),p=(0,m.useMemo)(()=>i?.typeCounts?Object.entries(i.typeCounts).sort(([,e],[,t])=>t-e).slice(0,5):[],[i?.typeCounts]),g=(0,m.useMemo)(()=>{if(!i?.trustTierCounts)return{total:0,human:0,machine:0,unverified:0};let e=i.trustTierCounts[`human-reviewed`]??0,t=i.trustTierCounts[`machine-confirmed`]??0,n=i.trustTierCounts.unverified??0;return{total:e+t+n,human:e,machine:t,unverified:n}},[i?.trustTierCounts]);return a?(0,h.jsxs)(oS,{title:e||`Project`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(Q,{className:`h-9 w-64 rounded-lg`}),(0,h.jsx)(Q,{className:`h-5 w-96 rounded-md`})]}),(0,h.jsx)(`div`,{className:`mt-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,h.jsx)(Q,{className:`h-32 rounded-xl`},t))}),(0,h.jsxs)(`div`,{className:`mt-8 grid grid-cols-1 gap-8 lg:grid-cols-12`,children:[(0,h.jsx)(`div`,{className:`lg:col-span-7 xl:col-span-8`,children:(0,h.jsx)(Q,{className:`h-96 rounded-xl`})}),(0,h.jsxs)(`div`,{className:`lg:col-span-5 xl:col-span-4 space-y-6`,children:[(0,h.jsx)(Q,{className:`h-64 rounded-xl`}),(0,h.jsx)(Q,{className:`h-48 rounded-xl`})]})]})]}):o?(0,h.jsx)(oS,{title:e||`Project`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(rS,{error:s,onRetry:()=>void c()})}):i?(0,h.jsxs)(oS,{title:i.title,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col justify-between gap-4 border-b border-border pb-6 sm:flex-row sm:items-start`,children:[(0,h.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight text-fg`,children:i.title}),(0,h.jsx)(`span`,{className:`font-mono text-xs text-subtle`,children:i.project})]}),i.description&&(0,h.jsx)(`p`,{className:`mt-2 text-base text-muted`,children:i.description}),i.repositories&&i.repositories.length>0&&(0,h.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:i.repositories.map(e=>{let t=e.indexOf(`/`),n=t===-1?e:e.slice(t+1);return(0,h.jsxs)(`a`,{href:`https://${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface-2 px-2 py-1 font-mono text-xs text-muted transition-colors hover:border-border-strong hover:text-fg`,title:`View ${e}`,children:[(0,h.jsx)(dx,{size:13,className:`shrink-0 text-subtle`}),(0,h.jsx)(`span`,{children:n})]},e)})})]}),(0,h.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:(0,h.jsxs)(`button`,{type:`button`,onClick:async()=>{try{r(!0),await w_(e)}catch{}finally{r(!1)}},disabled:n,className:`inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-2 text-sm font-medium text-fg shadow-xs transition-colors hover:bg-surface-2 hover:border-border-strong disabled:opacity-50 focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(Yb,{size:15,className:`shrink-0 text-muted`}),(0,h.jsx)(`span`,{children:n?`Exporting…`:`Export .tar.gz`})]})})]}),(0,h.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,h.jsx)(Ij,{label:`Concepts`,icon:rx,value:i.conceptCount,to:`/search?project=${encodeURIComponent(e)}`}),(0,h.jsx)(Ij,{label:`Stale`,icon:Ub,value:i.staleCount,tone:i.staleCount>0?`warn`:`default`,to:`/p/${encodeURIComponent(e)}/health`}),(0,h.jsx)(Ij,{label:`Trust`,icon:Ux,children:(0,h.jsxs)(`div`,{className:`mt-1`,children:[(0,h.jsx)(`div`,{className:`flex h-2 w-full overflow-hidden rounded-full bg-surface-2`,children:g.total>0?(0,h.jsxs)(h.Fragment,{children:[g.human>0&&(0,h.jsx)(`div`,{style:{width:`${g.human/g.total*100}%`},className:`bg-emerald-500`,title:`Human-reviewed: ${g.human}`}),g.machine>0&&(0,h.jsx)(`div`,{style:{width:`${g.machine/g.total*100}%`},className:`bg-sky-500`,title:`Machine-confirmed: ${g.machine}`}),g.unverified>0&&(0,h.jsx)(`div`,{style:{width:`${g.unverified/g.total*100}%`},className:`bg-zinc-400 dark:bg-zinc-600`,title:`Unverified: ${g.unverified}`})]}):(0,h.jsx)(`div`,{className:`w-full bg-surface-2`})}),(0,h.jsxs)(`div`,{className:`mt-2.5 flex items-center justify-between text-[11px] text-muted`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-500`}),(0,h.jsxs)(`span`,{children:[g.human,` human`]})]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-sky-500`}),(0,h.jsxs)(`span`,{children:[g.machine,` auto`]})]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-zinc-400 dark:bg-zinc-600`}),(0,h.jsxs)(`span`,{children:[g.unverified,` unverified`]})]})]})]})}),(0,h.jsx)(Ij,{label:`Types`,icon:Db,children:p.length>0?(0,h.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:p.map(([t,n])=>(0,h.jsxs)($g,{to:`/search?project=${encodeURIComponent(e)}&type=${encodeURIComponent(t)}`,className:`inline-flex items-center gap-1 rounded-md bg-surface-2 px-1.5 py-0.5 text-xs text-muted transition-colors hover:bg-surface hover:text-fg ring-1 ring-border/50`,children:[(0,h.jsx)(lD,{type:t,size:12}),(0,h.jsx)(`span`,{children:t}),(0,h.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:n})]},t))}):(0,h.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`No types recorded`})})]}),(0,h.jsxs)(`div`,{className:`mt-8 grid grid-cols-1 gap-8 lg:grid-cols-12`,children:[(0,h.jsxs)(`div`,{className:`lg:col-span-7 xl:col-span-8`,children:[l.isLoading&&(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-6 space-y-4`,children:[(0,h.jsx)(Q,{className:`h-7 w-48 rounded-md`}),(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-5/6`}),(0,h.jsx)(Q,{className:`h-4 w-4/6`})]}),l.data&&(0,h.jsx)(`div`,{className:`rounded-xl border border-border bg-surface p-6 sm:p-8`,children:(0,h.jsx)(Oj,{project:e,concept:l.data})})]}),(0,h.jsxs)(`div`,{className:`space-y-6 lg:col-span-5 xl:col-span-4`,children:[(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-5`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between pb-3 border-b border-border`,children:[(0,h.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold tracking-tight text-fg`,children:[(0,h.jsx)(Fx,{size:16,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Recent activity`})]}),(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}/activity`,className:`text-xs font-medium text-accent-500 transition-colors hover:text-accent-600`,children:`View all`})]}),(0,h.jsxs)(`div`,{className:`mt-3 divide-y divide-border/50`,children:[d.isLoading&&(0,h.jsx)(`div`,{className:`space-y-3 py-2`,children:Array.from({length:4}).map((e,t)=>(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(Q,{className:`h-6 w-6 rounded-full shrink-0`}),(0,h.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(0,h.jsx)(Q,{className:`h-3.5 w-3/4`}),(0,h.jsx)(Q,{className:`h-3 w-1/2`})]})]},t))}),d.data&&d.data.length>0?d.data.map(e=>{let t=e.actor.startsWith(`human:`)?e.actor.slice(6):e.actor;return(0,h.jsxs)(`div`,{className:`flex items-start gap-3 py-2.5 first:pt-1 last:pb-1`,children:[(0,h.jsx)(MD,{actor:e.actor,size:22,className:`mt-0.5`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`truncate text-xs font-medium text-fg`,title:e.subject,children:e.subject}),(0,h.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5 text-[11px] text-muted`,children:[(0,h.jsx)(`span`,{className:`truncate font-mono text-subtle max-w-[120px]`,children:t}),(0,h.jsx)(`span`,{children:`·`}),(0,h.jsx)(`span`,{title:wD(e.at),children:CD(e.at)})]})]})]},e.sha)}):!d.isLoading&&(0,h.jsx)(`p`,{className:`py-4 text-center text-xs text-muted`,children:`No recent activity`})]})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-5`,children:[(0,h.jsx)(`div`,{className:`pb-3 border-b border-border`,children:(0,h.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold tracking-tight text-fg`,children:[(0,h.jsx)(lx,{size:16,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Browse`})]})}),(0,h.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[u.isLoading&&(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-10 w-full rounded-lg`}),(0,h.jsx)(Q,{className:`h-10 w-full rounded-lg`}),(0,h.jsx)(Q,{className:`h-10 w-full rounded-lg`})]}),f.length>0?f.map(e=>(0,h.jsxs)(`button`,{type:`button`,onClick:()=>t.reveal(e.path),className:`group flex w-full items-center justify-between rounded-lg border border-border bg-surface-2/50 p-2.5 text-left transition-colors hover:border-border-strong hover:bg-surface-2 focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,h.jsx)(lx,{size:16,className:`shrink-0 text-accent-500`}),(0,h.jsx)(`span`,{className:`truncate text-xs font-medium text-fg transition-colors group-hover:text-accent-500`,children:e.path})]}),(0,h.jsxs)(`span`,{className:`ml-2 shrink-0 text-[11px] text-muted`,children:[e.conceptCount,` `,e.conceptCount===1?`concept`:`concepts`]})]},e.path)):!u.isLoading&&(0,h.jsx)(`p`,{className:`py-4 text-center text-xs text-muted`,children:`No directories`})]})]})]})]})]}):null}function Rj(){let{data:e,isLoading:t,isError:n,error:r,refetch:i}=D_(),[a,o]=(0,m.useState)(``),s=(0,m.useMemo)(()=>e?e.reduce((e,t)=>e+t.conceptCount,0):0,[e]),c=(0,m.useMemo)(()=>{if(!e)return[];let t=a.trim().toLowerCase();return[...t?e.filter(e=>e.title.toLowerCase().includes(t)||e.project.toLowerCase().includes(t)||!!e.description?.toLowerCase().includes(t)):e].sort((e,t)=>!e.updatedAt&&!t.updatedAt?0:e.updatedAt?t.updatedAt?new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime():-1:1)},[e,a]);return t?(0,h.jsxs)(oS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(Q,{className:`h-9 w-64 rounded-lg`}),(0,h.jsx)(Q,{className:`h-5 w-48 rounded-md`})]}),(0,h.jsx)(`div`,{className:`mt-6`,children:(0,h.jsx)(Q,{className:`h-10 w-full max-w-sm rounded-lg`})}),(0,h.jsx)(`div`,{className:`mt-8 grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,h.jsxs)(`div`,{className:`flex flex-col justify-between rounded-xl border border-border bg-surface p-5`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(Q,{className:`h-5 w-32`}),(0,h.jsx)(Q,{className:`h-4 w-20`})]}),(0,h.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-3/4`})]})]}),(0,h.jsxs)(`div`,{className:`mt-6 border-t border-border pt-4 flex items-center justify-between`,children:[(0,h.jsx)(Q,{className:`h-4 w-28`}),(0,h.jsx)(Q,{className:`h-4 w-20`})]})]},t))})]}):n?(0,h.jsx)(oS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(rS,{error:r,onRetry:()=>void i()})}):!e||e.length===0?(0,h.jsxs)(oS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-8`,children:[(0,h.jsx)(`h1`,{className:`bg-gradient-to-r from-fg to-muted bg-clip-text text-3xl font-semibold tracking-tight text-transparent`,children:`Knowledge base`}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`0 projects · 0 concepts`})]}),(0,h.jsx)(nS,{icon:ax,title:`No projects yet`,hint:`Agents create them with create_project, or POST /api/v1/projects.`,className:`mt-6 py-16`})]}):(0,h.jsxs)(oS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`bg-gradient-to-r from-fg to-muted bg-clip-text text-3xl font-semibold tracking-tight text-transparent`,children:`Knowledge base`}),(0,h.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[e.length,` `,e.length===1?`project`:`projects`,` · `,s,` `,s===1?`concept`:`concepts`]})]}),(0,h.jsx)(`div`,{className:`mt-6`,children:(0,h.jsxs)(`div`,{className:`relative max-w-sm`,children:[(0,h.jsx)(Vx,{size:16,className:`absolute left-3 top-1/2 -translate-y-1/2 text-subtle`}),(0,h.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`Filter projects…`,className:`w-full rounded-lg border border-border bg-surface py-2 pl-9 pr-3 text-sm text-fg placeholder:text-muted transition-colors focus-visible:outline-2 outline-accent-500`})]})}),c.length===0?(0,h.jsx)(nS,{icon:Vx,title:`No matching projects`,hint:`No projects match "${a}". Try adjusting your filter.`,className:`mt-8 py-12`}):(0,h.jsx)(`div`,{className:`mt-8 grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:c.map(e=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e.project)}`,className:`group flex flex-col justify-between rounded-xl border border-border bg-surface p-5 transition-all duration-150 hover:-translate-y-px hover:border-border-strong hover:shadow-[0_8px_30px_-12px_rgb(139_92_246/0.35)]`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500 truncate`,children:e.title}),(0,h.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-subtle`,children:e.project})]}),(0,h.jsx)(`p`,{className:`mt-2 line-clamp-2 text-sm text-muted min-h-[2.5rem]`,children:e.description||`No description provided.`})]}),(0,h.jsxs)(`div`,{className:`mt-5 border-t border-border pt-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(rx,{size:14,className:`shrink-0 text-subtle`}),(0,h.jsx)(`span`,{children:e.conceptCount})]}),(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5`,e.staleCount>0?`font-medium text-orange-600 dark:text-orange-400`:`text-muted`),children:[(0,h.jsx)(Ub,{size:14,className:`shrink-0`}),(0,h.jsxs)(`span`,{children:[e.staleCount,` stale`]})]}),(0,h.jsx)(`span`,{className:`ml-auto text-subtle truncate`,children:e.updatedAt?`Updated ${CD(e.updatedAt)}`:`Never updated`})]}),e.repositories&&e.repositories.length>0&&(0,h.jsx)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5`,children:e.repositories.map(e=>{let t=e.indexOf(`/`),n=t===-1?e:e.slice(t+1);return(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-muted ring-1 ring-border/50`,title:e,children:[(0,h.jsx)(dx,{size:11,className:`shrink-0 text-subtle`}),(0,h.jsx)(`span`,{className:`truncate max-w-[140px]`,children:n})]},e)})})]})]},e.project))})]})}function zj(){let[e,t]=r_(),n=e.get(`q`)??``,r=e.get(`project`)??``,i=e.get(`type`)??``,a=e.getAll(`tag`),o=e.get(`status`)??``,s=e.get(`trustTier`)??``,c=e.get(`stale`)??``,[l,u]=(0,m.useState)(``),{data:d}=D_(),{data:f}=O_(r),p=(0,m.useMemo)(()=>{if(r&&f?.typeCounts){let e=Object.keys(f.typeCounts);if(e.length>0)return e}return oD},[r,f?.typeCounts]),{data:g,isLoading:_,isError:v,error:y,refetch:b}=P_((0,m.useMemo)(()=>{let e={limit:50};return n.trim()&&(e.q=n.trim()),r&&(e.project=r),i&&(e.type=i),a.length>0&&(e.tag=a),o&&(e.status=o),s&&(e.trustTier=s),c===`true`&&(e.stale=!0),c===`false`&&(e.stale=!1),e},[n,r,i,a,o,s,c])),x=(n,r)=>{let i=new URLSearchParams(e);r?i.set(n,r):i.delete(n),t(i,{replace:!0})},S=n=>{let r=n.trim();if(!r||a.includes(r))return;let i=new URLSearchParams(e);i.append(`tag`,r),t(i,{replace:!0}),u(``)},C=n=>{let r=new URLSearchParams(e);r.delete(`tag`);for(let e of a)e!==n&&r.append(`tag`,e);t(r,{replace:!0})},w=e=>{e.preventDefault(),S(l)},T=!!(r||i||a.length>0||o||s||c);return(0,h.jsxs)(oS,{title:`Search`,className:`mx-auto max-w-6xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`Search Knowledge Base`}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`Find concepts, decisions, conventions, and architectural records across projects.`})]}),(0,h.jsxs)(`div`,{className:`relative`,children:[(0,h.jsx)(Vx,{size:20,className:`absolute left-4 top-1/2 -translate-y-1/2 text-subtle`}),(0,h.jsx)(`input`,{type:`text`,value:n,onChange:e=>x(`q`,e.target.value),placeholder:`Search concepts by keyword, text, title…`,className:`w-full rounded-xl border border-border bg-surface py-3.5 pl-12 pr-4 text-base text-fg shadow-xs placeholder:text-muted transition-colors focus-visible:outline-2 outline-accent-500`})]})]}),(0,h.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-2.5 rounded-xl border border-border bg-surface p-3 sm:gap-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-muted`,children:[(0,h.jsx)(Gx,{size:14,className:`text-subtle`}),(0,h.jsx)(`span`,{children:`Filter:`})]}),(0,h.jsxs)(`select`,{value:r,onChange:e=>x(`project`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`All projects`}),d?.map(e=>(0,h.jsx)(`option`,{value:e.project,children:e.title},e.project))]}),(0,h.jsxs)(`select`,{value:i,onChange:e=>x(`type`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`All types`}),p.map(e=>(0,h.jsx)(`option`,{value:e,children:e},e))]}),(0,h.jsxs)(`select`,{value:o,onChange:e=>x(`status`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`Any status`}),(0,h.jsx)(`option`,{value:`draft`,children:`Draft`}),(0,h.jsx)(`option`,{value:`stable`,children:`Stable`}),(0,h.jsx)(`option`,{value:`deprecated`,children:`Deprecated`})]}),(0,h.jsxs)(`select`,{value:s,onChange:e=>x(`trustTier`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`Any trust`}),(0,h.jsx)(`option`,{value:`human-reviewed`,children:`Human-reviewed`}),(0,h.jsx)(`option`,{value:`machine-confirmed`,children:`Machine-confirmed`}),(0,h.jsx)(`option`,{value:`unverified`,children:`Unverified`})]}),(0,h.jsxs)(`select`,{value:c,onChange:e=>x(`stale`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`Any staleness`}),(0,h.jsx)(`option`,{value:`true`,children:`Stale`}),(0,h.jsx)(`option`,{value:`false`,children:`Fresh`})]}),(0,h.jsx)(`form`,{onSubmit:w,className:`flex items-center`,children:(0,h.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:`+ tag…`,className:`w-20 rounded-lg border border-border bg-surface-2 px-2 py-1.5 text-xs text-fg placeholder:text-subtle transition-colors focus-visible:outline-2 outline-accent-500`})}),T&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>{let e=new URLSearchParams;n&&e.set(`q`,n),t(e,{replace:!0})},className:`ml-auto text-xs font-medium text-accent-500 hover:text-accent-600 transition-colors`,children:`Clear filters`})]}),a.length>0&&(0,h.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,h.jsxs)(`span`,{className:`text-xs text-muted flex items-center gap-1`,children:[(0,h.jsx)(Yx,{size:12,className:`text-subtle`}),(0,h.jsx)(`span`,{children:`Tags:`})]}),a.map(e=>(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-accent-500/20 bg-accent-500/10 px-2 py-0.5 font-mono text-xs text-accent-600 dark:text-accent-400`,children:[(0,h.jsxs)(`span`,{children:[`#`,e]}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`hover:text-fg transition-colors`,title:`Remove tag ${e}`,children:(0,h.jsx)(tS,{size:12})})]},e))]}),(0,h.jsxs)(`div`,{className:`mt-8`,children:[_&&(0,h.jsx)(`div`,{className:`space-y-4`,children:Array.from({length:4}).map((e,t)=>(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-5 space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(Q,{className:`h-5 w-40`}),(0,h.jsx)(Q,{className:`h-5 w-20`})]}),(0,h.jsx)(Q,{className:`h-5 w-24`})]}),(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-3/4`})]},t))}),v&&(0,h.jsx)(rS,{error:y,onRetry:()=>void b()}),!_&&!v&&g&&g.length===0&&(0,h.jsx)(nS,{icon:Vx,title:`No matches`,hint:`Try adjusting your keywords, expanding your project scope, or clearing filters.`,className:`py-16`}),!_&&!v&&g&&g.length>0&&(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(`div`,{className:`flex items-center justify-between text-xs text-muted pb-1`,children:(0,h.jsxs)(`span`,{children:[`Found `,g.length,` `,g.length===1?`result`:`results`]})}),g.map(e=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e.project)}/c/${e.id}`,className:`group block rounded-xl border border-border bg-surface p-5 transition-all duration-150 hover:-translate-y-px hover:border-border-strong hover:shadow-[0_8px_30px_-12px_rgb(139_92_246/0.35)]`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-baseline sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500`,children:(0,h.jsx)(aD,{text:e.title,query:n})}),(0,h.jsx)(GD,{type:e.type}),(0,h.jsxs)(`span`,{className:`font-mono text-xs text-subtle`,children:[e.project,`/`,e.id]})]}),(0,h.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,h.jsx)(HD,{status:e.status}),(0,h.jsx)(UD,{tier:e.trustTier}),e.stale&&(0,h.jsx)(WD,{})]})]}),e.snippet?(0,h.jsx)(`p`,{className:`mt-2.5 text-sm text-muted break-words line-clamp-2`,children:(0,h.jsx)(aD,{text:e.snippet,query:n})}):e.description&&(0,h.jsx)(`p`,{className:`mt-2.5 text-sm text-muted break-words line-clamp-2`,children:(0,h.jsx)(aD,{text:e.description,query:n})}),e.tags&&e.tags.length>0&&(0,h.jsx)(`div`,{className:`mt-3.5 flex flex-wrap items-center gap-1.5 pt-1`,children:e.tags.map(e=>(0,h.jsxs)(`span`,{className:`rounded-md bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-muted ring-1 ring-border/50`,children:[`#`,e]},e))})]},`${e.project}/${e.id}`))]})]})]})}var Bj=Xg([{path:`/callback`,element:(0,h.jsx)(BD,{})},{element:(0,h.jsx)(fS,{}),children:[{element:(0,h.jsx)(LD,{}),children:[{index:!0,element:(0,h.jsx)(Rj,{})},{path:`search`,element:(0,h.jsx)(zj,{})},{path:`p/:project`,element:(0,h.jsx)(Lj,{})},{path:`p/:project/activity`,element:(0,h.jsx)(zD,{})},{path:`p/:project/health`,element:(0,h.jsx)(Pj,{})},{path:`p/:project/c/*`,element:(0,h.jsx)(Aj,{})},{path:`p/:project/f/*`,element:(0,h.jsx)(Nj,{})},{path:`*`,element:(0,h.jsx)(Fj,{})}]}]}],{basename:`/ui`});eb();var Vj=document.getElementById(`root`);Vj&&(0,Tg.createRoot)(Vj).render((0,h.jsx)(m.StrictMode,{children:(0,h.jsx)(v,{client:T_,children:(0,h.jsx)(Wy,{children:(0,h.jsx)(cu,{reducedMotion:`user`,children:(0,h.jsx)(l_,{router:Bj})})})})}));export{s as n,Ag as t};
126
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ej(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?ej(n,!0):this.parser.parseInline(r),o=nj(e);if(o===null)return a;e=ej(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+ej(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=nj(e);if(i===null)return ej(n);e=i;let a=`<img src="${ej(e)}" alt="${ej(n)}"`;return t&&(a+=` title="${ej(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:ej(e.text)}},hj=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},gj=class e{options;renderer;textRenderer;constructor(e){this.options=e||jk,this.options.renderer=this.options.renderer||new mj,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hj}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},_j=class{options;block;constructor(e){this.options=e||jk}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?pj.lex:pj.lexInline}provideParser(e=this.block){return e?gj.parse:gj.parseInline}},vj=class{defaults=Ak();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=gj;Renderer=mj;TextRenderer=hj;Lexer=pj;Tokenizer=fj;Hooks=_j;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new mj(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new fj(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new _j;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=_j.passThroughHooks.has(n)?e=>{if(this.defaults.async&&_j.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pj.lex(e,t??this.defaults)}parser(e,t){return gj.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?pj.lex:pj.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?gj.parse:gj.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?pj.lex:pj.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?gj.parse:gj.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
127
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+ej(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},yj=new vj;function bj(e,t){return yj.parse(e,t)}bj.options=bj.setOptions=function(e){return yj.setOptions(e),bj.defaults=yj.defaults,Mk(bj.defaults),bj},bj.getDefaults=Ak,bj.defaults=jk;function xj(...e){return yj.use(...e),bj.defaults=yj.defaults,Mk(bj.defaults),bj}bj.use=xj,bj.walkTokens=function(e,t){return yj.walkTokens(e,t)},bj.parseInline=yj.parseInline,bj.Parser=gj,bj.parser=gj.parse,bj.Renderer=mj,bj.TextRenderer=hj,bj.Lexer=pj,bj.lexer=pj.lex,bj.Tokenizer=fj,bj.Hooks=_j,bj.parse=bj,bj.options,bj.setOptions,bj.walkTokens,bj.parseInline,gj.parse,pj.lex;var Sj=/^data:image\/(?:png|jpe?g|gif|webp|avif|bmp|x-icon);base64,[a-z0-9+/=\s]+$/i;kk.addHook(`afterSanitizeAttributes`,e=>{if(e.nodeName.toUpperCase()===`IMG`){let t=e.getAttribute(`src`);if(t){let n=Sj.test(t),r=t.startsWith(`/`)&&!t.startsWith(`//`)&&!t.startsWith(`/\\`);!n&&!r&&(e.removeAttribute(`src`),e.setAttribute(`data-okf-blocked-src`,`true`))}}if(e.nodeName.toUpperCase()===`A`){let t=e.getAttribute(`href`);if(t){let n=rD(t,``);n.kind===`invalid`?e.removeAttribute(`href`):n.kind===`external`&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}}});function Cj(e){return kk.sanitize(e,{ADD_ATTR:[`target`,`data-okf-cite`,`data-okf-internal`,`data-okf-concept`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`iframe`,`object`,`embed`,`script`,`foreignobject`,`animate`,`set`,`use`],FORBID_ATTR:[`style`]})}function wj(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function Tj(e){if(!e||e.length===0)return``;let t=``;for(let n of e)`tokens`in n&&Array.isArray(n.tokens)?t+=Tj(n.tokens):`text`in n&&typeof n.text==`string`&&(t+=n.text);return t}function Ej(e,t){let n=[],r=[],i=new Set,a=new Map,o=new vj({gfm:!0});o.use({extensions:[{name:`citation`,level:`inline`,start(e){return e.indexOf(`[^`)},tokenizer(e){let t=/^\[\^([^\]\s]+)\](?!:)/.exec(e);if(t?.[1])return{type:`citation`,raw:t[0],label:t[1]}},renderer(e){if(!(`label`in e)||typeof e.label!=`string`)return``;let n=e.label,i=t.sources.find(e=>e.id===n||e.id.toLowerCase()===n.toLowerCase()),o=i?i.id:n,s=r.indexOf(o)+1;if(s===0&&(r.push(o),s=r.length),i)return`<sup class="okf-cite"><a href="#source-${encodeURIComponent(i.id)}" data-okf-cite="${wj(i.id)}">${s}</a></sup>`;let c=a.get(n.toLowerCase());if(c?.href){let e=rD(c.href,t.conceptId);return e.kind===`external`?`<sup class="okf-cite"><a href="${wj(e.href)}" target="_blank" rel="noopener noreferrer">${s}</a></sup>`:e.kind===`concept`?`<sup class="okf-cite"><a href="${wj(`/ui${iD(t.project,e.id)}${e.hash}`)}" data-okf-internal data-okf-concept="${wj(e.id)}">${s}</a></sup>`:`<sup class="okf-cite"><span class="okf-cite-missing" title="Invalid source">${s}</span></sup>`}return`<sup class="okf-cite"><span class="okf-cite-missing" title="Unknown source">${s}</span></sup>`}}],renderer:{heading(e){let t=e.depth,r=Tj(e.tokens).trim(),a=r.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`heading`,o=a,s=1;for(;i.has(o);)s++,o=`${a}-${s}`;i.add(o),(t===2||t===3)&&n.push({id:o,text:r,depth:t});let c=this.parser.parseInline(e.tokens);return`<h${t} id="${o}"><a class="okf-anchor" href="#${o}" aria-hidden="true">#</a>${c}</h${t}>\n`},code(e){return`<pre class="okf-code" data-lang="${wj((e.lang||``).match(/^\S*/)?.[0]??``)}"><code>${wj(e.text)}</code></pre>\n`},link(e){let n=e.href,r=e.title?` title="${wj(e.title)}"`:``,i=this.parser.parseInline(e.tokens),a=rD(n,t.conceptId);if(a.kind===`concept`){let e=t.outbound.find(e=>e.id===a.id),n=!e||e.exists,o=wj(`/ui${iD(t.project,a.id)}${a.hash}`),s=wj(a.id);return n?`<a href="${o}" data-okf-internal data-okf-concept="${s}"${r}>${i}</a>`:`<a href="${o}" data-okf-internal data-okf-concept="${s}" class="okf-broken" title="Missing concept">${i}</a>`}return a.kind===`file`?`<a href="${wj(`/ui${aD(t.project,a.path)}${a.hash}`)}" data-okf-internal${r}>${i}</a>`:a.kind===`anchor`?`<a href="${wj(n)}"${r}>${i}</a>`:a.kind===`external`?`<a href="${wj(a.href)}" target="_blank" rel="noopener noreferrer" class="okf-external"${r}>${i}</a>`:`<span class="okf-broken" title="Broken link">${i}</span>`},image(e){let n=e.href,r=wj(e.text),i=e.title?` title="${wj(e.title)}"`:``;if(n.startsWith(`/`)&&!n.startsWith(`//`)&&!n.startsWith(`/\\`)||Sj.test(n))return`<img src="${wj(n)}" alt="${r}"${i}>`;let a=rD(n,t.conceptId);if(a.kind===`external`){let e=r?`[Image: ${r}]`:`[Remote image]`;return`<span class="okf-image-blocked"><a href="${wj(a.href)}" target="_blank" rel="noopener noreferrer" class="okf-external" title="Remote image blocked to protect IP">${e}</a></span>`}return`<span class="okf-image-missing">${r||`Image`}</span>`}}});let s=o.lexer(e);if(s.links)for(let[e,t]of Object.entries(s.links))e.startsWith(`^`)&&t&&typeof t.href==`string`&&a.set(e.slice(1).toLowerCase(),{href:t.href,title:typeof t.title==`string`?t.title:void 0});for(let e=0;e<s.length;e++){let n=s[e];if(!(n&&n.type===`space`)){n&&n.type===`heading`&&n.depth===1&&(`text`in n&&typeof n.text==`string`?n.text.trim():``).toLowerCase()===t.title.trim().toLowerCase()&&s.splice(e,1);break}}return{html:Cj(o.parser(s)),headings:n,citations:r}}var Dj=/^github\.com\/([^/]+)\/([^/]+)\/(.+)$/,Oj=/^gitlab\.com\/([^/]+)\/([^/]+)\/(.+)$/,kj=/^(github|gitlab)\.com\/[^/]+\/[^/]+$/,Aj=/^https?:\/\//i,jj=/^[a-zA-Z0-9._-]+$/;function Mj(e){try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`?t.href:null}catch{return null}}var Nj={type:!0,title:!0,description:!0,tags:!0,status:!0,generated:!0,verified:!0,sources:!0,stale_after:!0};function Pj(e){if(!e||typeof e!=`object`)return[];let t=e.sources;if(!Array.isArray(t))return[];let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(!r||typeof r!=`object`||!(`resource`in r)||typeof r.resource!=`string`)continue;let i=r.resource.trim();if(i.length===0)continue;let a=`id`in r&&typeof r.id==`string`&&r.id.trim().length>0?r.id.trim():`source-${e+1}`,o=`commit`in r&&typeof r.commit==`string`&&r.commit.trim().length>0?r.commit.trim():void 0,s=o&&jj.test(o)?o:void 0,c=s??`HEAD`,l=null,u=i;if(Aj.test(i))l=Mj(i);else{let e=Dj.exec(i);if(e?.[1]&&e[2]&&e[3])l=Mj(`https://github.com/${e[1]}/${e[2]}/blob/${c}/${e[3]}`),u=e[3];else{let e=Oj.exec(i);e?.[1]&&e[2]&&e[3]?(l=Mj(`https://gitlab.com/${e[1]}/${e[2]}/-/blob/${c}/${e[3]}`),u=e[3]):kj.test(i)&&(l=Mj(`https://${i}`))}}n.push({id:a,resource:i,...s===void 0?{}:{commit:s},url:l,label:u})}return n}function Fj(e){if(!e||typeof e!=`object`)return[];let t=e.verified;if(t==null)return[];let n=Array.isArray(t)?t:[t],r=[];for(let e of n)if(e&&typeof e==`object`&&`by`in e&&typeof e.by==`string`&&e.by.length>0){let t=`at`in e&&typeof e.at==`string`?e.at:void 0;r.push(t===void 0?{by:e.by}:{by:e.by,at:t})}return r}function Ij(e){return!e||typeof e!=`object`?[]:Object.entries(e).filter(([e])=>!(e in Nj))}function Lj({concept:e,conceptId:t,targetRect:n,onMouseEnter:r,onMouseLeave:i}){let a=n.bottom+6,o=Math.max(12,Math.min(n.left,window.innerWidth-332));return(0,h.jsx)(`div`,{role:`tooltip`,style:{top:a,left:o},onMouseEnter:r,onMouseLeave:i,className:`fixed z-50 w-80 max-w-[calc(100vw-24px)] rounded-xl border border-border-strong bg-surface/95 p-3.5 shadow-xl backdrop-blur-md transition-all duration-150`,children:e?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,h.jsx)(hD,{type:e.derived?.type??null,className:`mt-0.5 shrink-0`,size:16}),(0,h.jsx)(`div`,{className:`min-w-0 flex-1 font-medium text-sm text-fg line-clamp-2 leading-snug`,children:e.derived?.title??e.id})]}),e.derived?.description&&(0,h.jsx)(`p`,{className:`mt-1.5 text-xs text-muted line-clamp-2 leading-relaxed`,children:e.derived.description}),(0,h.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5 pt-1.5 border-t border-border/50`,children:[e.derived?.status&&(0,h.jsx)(JD,{status:e.derived.status}),e.derived?.trustTier&&(0,h.jsx)(YD,{tier:e.derived.trustTier}),e.derived?.stale&&(0,h.jsx)(XD,{})]})]}):(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(`div`,{className:`font-mono text-xs text-muted truncate`,children:t}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-4 rounded-full`}),(0,h.jsx)(Q,{className:`h-4 w-40 rounded-sm`})]}),(0,h.jsx)(Q,{className:`h-3 w-full rounded-sm`}),(0,h.jsx)(Q,{className:`h-3 w-3/4 rounded-sm`}),(0,h.jsxs)(`div`,{className:`flex gap-1 pt-1`,children:[(0,h.jsx)(Q,{className:`h-4 w-12 rounded-full`}),(0,h.jsx)(Q,{className:`h-4 w-16 rounded-full`})]})]})})}function Rj({project:e,concept:t,onHeadings:n,onCitations:r,className:i}){let a=kh(),o=(0,m.useRef)(null),[s,c]=(0,m.useState)(null),l=(0,m.useRef)(void 0),u=(0,m.useRef)(!1),d=(0,m.useMemo)(()=>Ej(t.body,{project:e,conceptId:t.id,title:t.derived?.title??t.id,sources:Pj(t.frontmatter),outbound:t.links.outbound}),[t,e]);return(0,m.useEffect)(()=>{n?.(d.headings),r?.(d.citations)},[d,n,r]),(0,m.useEffect)(()=>{let e=o.current;if(!e)return;let t=!1;return(async()=>{let n=Array.from(e.querySelectorAll(`pre.okf-code`));if(n.length===0)return;let{highlight:r}=await Ag(async()=>{let{highlight:e}=await import(`./highlight-DkgVr4Tn.js`);return{highlight:e}},[]);if(!t)for(let e of n){if(t)break;if(e.getAttribute(`data-okf-processed`)===`true`)continue;e.setAttribute(`data-okf-processed`,`true`);let n=e.getAttribute(`data-lang`)??``,i=e.querySelector(`code`)?.textContent??e.textContent??``,a=null;if(n)try{a=await r(i,n)}catch{}if(t)break;let o=document.createElement(`div`);if(o.className=`relative group not-prose my-4`,a){o.innerHTML=a;let e=o.querySelector(`pre`);e&&e.classList.add(`overflow-x-auto`)}else{let t=e.cloneNode(!0);o.appendChild(t)}let s=document.createElement(`button`);s.type=`button`,s.setAttribute(`aria-label`,`Copy code`),s.title=`Copy code`,s.className=`absolute top-2.5 right-2.5 z-10 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity inline-flex items-center gap-1 rounded-md border border-border bg-surface/80 px-2 py-1 text-xs font-medium text-muted backdrop-blur-xs hover:bg-surface-2 hover:text-fg focus-visible:outline-2 outline-accent-500 cursor-pointer select-none`,s.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`,s.addEventListener(`click`,async e=>{e.stopPropagation();try{await navigator.clipboard.writeText(i),s.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-emerald-500 shrink-0"><polyline points="20 6 9 17 4 12"/></svg>`,setTimeout(()=>{s.innerHTML=`<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`},1500)}catch{}}),o.appendChild(s),e.parentNode?.replaceChild(o,e)}})(),()=>{t=!0}},[d.html]),(0,m.useEffect)(()=>{let e=()=>{clearTimeout(l.current),c(null)};return window.addEventListener(`scroll`,e,{passive:!0}),()=>{window.removeEventListener(`scroll`,e),clearTimeout(l.current)}},[]),(0,h.jsxs)(`div`,{className:`relative`,children:[(0,h.jsx)(`div`,{ref:o,onClick:e=>{let t=e.target;if(!t)return;let n=t.closest(`a[data-okf-cite]`);if(n){e.preventDefault();let t=n.getAttribute(`data-okf-cite`);if(t){let e=document.getElementById(`source-${t}`);e&&(e.scrollIntoView({behavior:`smooth`}),e.classList.remove(`okf-flash`),e.offsetWidth,e.classList.add(`okf-flash`),setTimeout(()=>{e.classList.remove(`okf-flash`)},1600))}return}let r=t.closest(`a[data-okf-internal]`);if(r){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;e.preventDefault();let t=r.getAttribute(`href`);if(t){let e=t;e.startsWith(`/ui`)&&(e=e.slice(3)||`/`),e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.startsWith(`/\\`)&&!e.includes(`\\`)&&a(e)}}},onMouseOver:t=>{let n=t.target;if(!n)return;let r=n.closest(`a[data-okf-concept]`);if(!r)return;let i=r.getAttribute(`data-okf-concept`);i&&s?.targetEl!==r&&(clearTimeout(l.current),l.current=window.setTimeout(async()=>{let t=r.getBoundingClientRect();try{let n=await T_.fetchQuery({queryKey:E_.concept(e,i),queryFn:()=>v_(e,i)});c({conceptId:i,concept:n,rect:t,targetEl:r})}catch{}},250))},onMouseOut:e=>{let t=e.target;if(!t)return;let n=t.closest(`a[data-okf-concept]`);n&&(clearTimeout(l.current),setTimeout(()=>{u.current||c(e=>e?.targetEl===n?null:e)},100))},className:X(`prose prose-zinc dark:prose-invert max-w-3xl`,i),dangerouslySetInnerHTML:{__html:d.html}}),s&&(0,h.jsx)(Lj,{concept:s.concept,conceptId:s.conceptId,targetRect:s.rect,onMouseEnter:()=>{u.current=!0},onMouseLeave:()=>{u.current=!1,c(null)}})]})}function zj({headings:e,className:t}){let[n,r]=(0,m.useState)(e[0]?.id??``);if((0,m.useEffect)(()=>{if(e.length<3)return;let t=e.map(e=>document.getElementById(e.id)).filter(e=>e!==null);if(t.length===0)return;let n=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&r(t.target.id)},{rootMargin:`0px 0px -70% 0px`,threshold:[0,1]});for(let e of t)n.observe(e);return()=>{n.disconnect()}},[e]),e.length<3)return null;let i=(e,t)=>{e.preventDefault();let n=document.getElementById(t);n&&(n.scrollIntoView({behavior:`smooth`}),r(t),window.history.replaceState(null,``,`#${t}`))};return(0,h.jsxs)(`nav`,{"aria-label":`Table of contents`,className:X(`space-y-2`,t),children:[(0,h.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted`,children:`On this page`}),(0,h.jsx)(`ul`,{className:`space-y-1 border-l border-border text-xs`,children:e.map(e=>{let t=n===e.id;return(0,h.jsx)(`li`,{className:e.depth===3?`pl-5`:`pl-3`,children:(0,h.jsx)(`a`,{href:`#${e.id}`,onClick:t=>i(t,e.id),className:X(`block py-0.5 transition-colors line-clamp-1`,t?`-ml-px border-l-2 border-accent-500 pl-1 font-medium text-accent-500`:`text-muted hover:text-fg`),children:e.text})},e.id)})})]})}function Bj(){let e=Nh(),t=e.project??``,n=e[`*`]??``,{data:r,isLoading:i,error:a,refetch:o}=A_(t,n),{data:s}=M_(t,{id:n,limit:10}),[c,l]=(0,m.useState)([]),[u,d]=(0,m.useState)([]),[f,p]=(0,m.useState)(!1);(0,m.useEffect)(()=>{r&&uD({project:t,id:r.id,title:r.derived?.title??r.id,type:r.derived?.type??null})},[r,t]);let g=(0,m.useMemo)(()=>{if(!r)return[];let e=Pj(r.frontmatter),t=new Map;for(let n of e)t.set(n.id,n);let n=[],i=new Set;for(let e of u){let r=t.get(e);r&&!i.has(r.id)&&(n.push(r),i.add(r.id))}for(let t of e)i.has(t.id)||(n.push(t),i.add(t.id));return n},[r,u]),_=r?.derived?.title??(n||`Concept`);if(i)return(0,h.jsxs)(uS,{title:_,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6 space-y-6`,children:[(0,h.jsxs)(`div`,{className:`space-y-3 border-b border-border pb-6`,children:[(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(Q,{className:`h-5 w-20 rounded-full`}),(0,h.jsx)(Q,{className:`h-5 w-16 rounded-full`})]}),(0,h.jsx)(Q,{className:`h-9 w-96 rounded-md`}),(0,h.jsx)(Q,{className:`h-5 w-full max-w-xl rounded-md`})]}),(0,h.jsxs)(`div`,{className:`flex flex-col xl:flex-row gap-8`,children:[(0,h.jsxs)(`div`,{className:`flex-1 space-y-4`,children:[(0,h.jsx)(Q,{className:`h-32 w-full rounded-xl`}),(0,h.jsx)(Q,{className:`h-48 w-full rounded-xl`})]}),(0,h.jsxs)(`div`,{className:`w-full xl:w-72 space-y-4`,children:[(0,h.jsx)(Q,{className:`h-40 w-full rounded-xl`}),(0,h.jsx)(Q,{className:`h-40 w-full rounded-xl`})]})]})]});if(a)return(0,h.jsx)(uS,{title:_,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(sS,{error:a,onRetry:o,fullScreen:!0})});if(!r)return(0,h.jsx)(uS,{title:_,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(oS,{title:`Concept not found`,hint:`Could not find concept "${n}" in project "${t}".`})});let v=r.derived?.status?.toLowerCase()===`deprecated`,y=Fj(r.frontmatter),b=Ij(r.frontmatter);return(0,h.jsxs)(uS,{title:`${_} · ${t}`,className:`max-w-7xl mx-auto px-4 sm:px-6 py-6`,children:[(0,h.jsxs)(`header`,{className:`space-y-4 border-b border-border pb-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(ZD,{type:r.derived?.type??null}),r.derived?.status&&(0,h.jsx)(JD,{status:r.derived.status}),r.derived?.trustTier&&(0,h.jsx)(YD,{tier:r.derived.trustTier}),r.derived?.stale&&(0,h.jsx)(XD,{})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:X(`text-3xl font-semibold tracking-tight text-fg`,v&&`line-through opacity-70`),children:r.derived?.title??r.id}),r.derived?.description&&(0,h.jsx)(`p`,{className:`mt-2 text-lg text-muted leading-relaxed`,children:r.derived.description})]}),r.derived?.tags&&r.derived.tags.length>0&&(0,h.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5 pt-1`,children:r.derived.tags.map(e=>(0,h.jsxs)($g,{to:`/search?project=${encodeURIComponent(t)}&tag=${encodeURIComponent(e)}`,className:`inline-flex items-center rounded-md bg-surface-2 px-2 py-0.5 text-xs font-medium text-muted hover:text-fg hover:bg-border transition-colors`,children:[`#`,e]},e))}),(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-2`,children:[(0,h.jsx)(fS,{value:typeof window<`u`?window.location.href:``,label:`Copy link`}),(0,h.jsx)(fS,{value:r.id,label:`Copy ID`}),(0,h.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),"aria-label":`Toggle markdown source`,className:X(`inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-2 outline-accent-500 cursor-pointer`,f?`bg-accent-500/10 text-accent-500 border-accent-500/30`:`bg-surface text-muted hover:bg-surface-2 hover:text-fg`),children:[(0,h.jsx)(Yb,{size:14,className:`shrink-0`}),(0,h.jsx)(`span`,{children:`Source`})]})]})]}),(0,h.jsxs)(`div`,{className:`mt-8 flex flex-col xl:flex-row xl:items-start gap-8`,children:[(0,h.jsx)(`div`,{className:`min-w-0 flex-1`,children:f?(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted`,children:[(0,h.jsx)(`span`,{className:`font-mono`,children:`Raw Markdown`}),(0,h.jsx)(fS,{value:r.markdown,label:`Copy markdown`})]}),(0,h.jsx)(QD,{code:r.markdown,lang:`markdown`,lineNumbers:!0,className:`rounded-xl border border-border bg-surface-2 shadow-xs`})]}):(0,h.jsx)(Rj,{project:t,concept:r,onHeadings:l,onCitations:d})}),(0,h.jsxs)(`aside`,{className:`w-full xl:w-72 xl:sticky xl:top-20 shrink-0 space-y-6`,children:[c.length>=3&&(0,h.jsx)(zj,{headings:c}),(0,h.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsx)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:`Details`}),r.derived?.generatedAt&&(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-muted shrink-0`,children:`Generated`}),(0,h.jsxs)(`span`,{className:`text-fg text-right font-mono text-[11px]`,title:AD(r.derived.generatedAt),children:[kD(r.derived.generatedAt),r.derived.generatedBy&&` by ${r.derived.generatedBy}`]})]}),(0,h.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,h.jsx)(`span`,{className:`text-muted block`,children:`Verified`}),y.length>0?(0,h.jsx)(`div`,{className:`space-y-1.5 pl-1`,children:y.map((e,t)=>(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-fg`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,h.jsx)(RD,{actor:e.by,size:18}),(0,h.jsx)(`span`,{className:`truncate font-mono text-[11px]`,children:e.by})]}),e.at&&(0,h.jsx)(`span`,{className:`text-muted text-[10px] shrink-0`,title:AD(e.at),children:kD(e.at)})]},`${e.by}-${e.at??t}`))}):(0,h.jsx)(`div`,{className:`text-subtle italic pl-1`,children:`Unverified`})]}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-muted`,children:`Stale after`}),(0,h.jsx)(`span`,{className:X(`font-mono text-[11px]`,r.derived?.stale?`text-orange-500 font-semibold`:`text-fg`),children:r.derived?.staleAfter?r.derived.staleAfter.split(`T`)[0]:`—`})]}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-muted`,children:`Revision`}),(0,h.jsx)(`span`,{className:`font-mono text-[11px] text-muted`,children:r.revision.slice(0,8)})]})]}),g.length>0&&(0,h.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsxs)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:[`Sources (`,g.length,`)`]}),(0,h.jsx)(`ol`,{className:`space-y-2`,children:g.map((e,t)=>(0,h.jsxs)(`li`,{id:`source-${e.id}`,className:`rounded-lg p-2 transition-colors border border-transparent hover:border-border hover:bg-surface-2/50`,children:[(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,h.jsxs)(`span`,{className:`font-mono text-muted text-[10px] shrink-0`,children:[t+1,`.`]}),(0,h.jsx)(`span`,{className:`font-mono text-fg text-xs truncate`,title:e.label,children:e.label})]}),e.commit&&(0,h.jsx)(`span`,{className:`font-mono text-[10px] px-1.5 py-0.5 rounded bg-surface border border-border text-muted shrink-0`,title:`Commit ${e.commit}`,children:PD(e.commit)})]}),e.url&&(0,h.jsx)(`div`,{className:`mt-1 pl-4`,children:(0,h.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-accent-500 hover:text-accent-400 hover:underline truncate max-w-full`,children:[(0,h.jsx)(`span`,{className:`truncate`,children:e.resource}),(0,h.jsx)(tx,{size:10,className:`shrink-0`})]})})]},e.id))})]}),(0,h.jsx)(eO,{project:t,conceptId:r.id,inbound:r.links.inbound,outbound:r.links.outbound}),(0,h.jsxs)(`div`,{className:`space-y-3 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsx)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:`History`}),s&&s.length>0?(0,h.jsx)(`div`,{className:`relative pl-4 space-y-4 before:absolute before:left-1.5 before:top-2 before:bottom-2 before:w-px before:bg-border`,children:s.map(e=>(0,h.jsxs)(`div`,{className:`relative space-y-1`,children:[(0,h.jsx)(`div`,{className:`absolute -left-4 top-1.5 h-2 w-2 rounded-full bg-accent-500 ring-2 ring-surface`}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-1 text-[11px]`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,h.jsx)(RD,{actor:e.actor,size:16}),(0,h.jsx)(`span`,{className:`truncate font-mono text-fg`,children:e.actor})]}),(0,h.jsx)(`span`,{className:`text-muted shrink-0 text-[10px]`,title:AD(e.at),children:kD(e.at)})]}),(0,h.jsx)(`p`,{className:`text-fg text-xs break-words`,children:e.subject}),(0,h.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,h.jsx)(fS,{value:e.sha,label:PD(e.sha),className:`px-1.5 py-0.5 text-[10px] font-mono`})})]},e.sha))}):(0,h.jsx)(`div`,{className:`text-subtle italic`,children:`No history available`})]}),r.issues&&r.issues.length>0&&(0,h.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsxs)(`div`,{className:`font-semibold uppercase tracking-wider text-muted`,children:[`Lint issues (`,r.issues.length,`)`]}),(0,h.jsx)(`div`,{className:`space-y-2`,children:r.issues.map(e=>(0,h.jsxs)(`div`,{className:`flex items-start gap-2 p-2 rounded-lg bg-surface border border-border/60`,children:[e.severity===`error`?(0,h.jsx)(Vb,{size:14,className:`text-rose-500 shrink-0 mt-0.5`}):e.severity===`warning`?(0,h.jsx)(tS,{size:14,className:`text-amber-500 shrink-0 mt-0.5`}):(0,h.jsx)(xx,{size:14,className:`text-sky-500 shrink-0 mt-0.5`}),(0,h.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,h.jsx)(`div`,{className:`font-mono font-semibold text-[11px] text-fg`,children:e.code}),(0,h.jsx)(`p`,{className:`text-muted text-[11px] leading-tight break-words`,children:e.message})]})]},`${e.code}-${e.path}-${e.message}`))})]}),b.length>0&&(0,h.jsxs)(`details`,{className:`group rounded-xl border border-border bg-surface-2/30 p-3.5 text-xs`,children:[(0,h.jsxs)(`summary`,{className:`cursor-pointer font-semibold uppercase tracking-wider text-muted hover:text-fg flex items-center justify-between select-none`,children:[(0,h.jsxs)(`span`,{children:[`Extra frontmatter (`,b.length,`)`]}),(0,h.jsx)(Fb,{size:14,className:`transition-transform group-open:rotate-180`})]}),(0,h.jsx)(`div`,{className:`mt-2 space-y-1 overflow-x-auto rounded-lg bg-surface p-2 font-mono text-[11px] border border-border/50`,children:b.map(([e,t])=>(0,h.jsxs)(`div`,{className:`break-all`,children:[(0,h.jsx)(`span`,{className:`text-accent-500`,children:e}),`:`,` `,(0,h.jsx)(`span`,{className:`text-muted`,children:JSON.stringify(t)})]},e))})]})]})]})]})}var Vj={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,json:`json`,yaml:`yaml`,yml:`yaml`,sh:`bash`,bash:`bash`,py:`python`,go:`go`,rs:`rust`,sql:`sql`,md:`markdown`,diff:`diff`,patch:`diff`,toml:`toml`,html:`html`,css:`css`,java:`java`,rb:`ruby`,dockerfile:`dockerfile`};function Hj(e){let t=e.split(`/`).pop()??e;if(t.toLowerCase()===`dockerfile`)return`dockerfile`;let n=t.lastIndexOf(`.`);return n===-1?null:Vj[t.slice(n+1).toLowerCase()]??null}function Uj(){let e=Nh(),t=e.project??``,n=e[`*`]??``,{data:r,isLoading:i,error:a,refetch:o}=j_(t,n),s=n.split(`/`).pop()??n,c=s?`${s} · ${t}`:`File`;if(i)return(0,h.jsxs)(uS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6 space-y-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between border-b border-border pb-4`,children:[(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-6 w-64 rounded-md`}),(0,h.jsx)(Q,{className:`h-4 w-28 rounded-md`})]}),(0,h.jsxs)(`div`,{className:`flex gap-2`,children:[(0,h.jsx)(Q,{className:`h-8 w-24 rounded-md`}),(0,h.jsx)(Q,{className:`h-8 w-28 rounded-md`})]})]}),(0,h.jsx)(Q,{className:`h-96 w-full rounded-xl`})]});if(a)return(0,h.jsx)(uS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(sS,{error:a,onRetry:o,fullScreen:!0})});if(!r)return(0,h.jsx)(uS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6`,children:(0,h.jsx)(oS,{title:`File not found`,hint:`Could not find file "${n}" in project "${t}".`})});let l=()=>{let e=new Blob([r.content],{type:`text/plain;charset=utf-8`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=s||`file`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},u=Hj(n);return(0,h.jsxs)(uS,{title:c,className:`max-w-6xl mx-auto px-4 sm:px-6 py-6 space-y-6`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between border-b border-border pb-4`,children:[(0,h.jsxs)(`div`,{className:`space-y-1.5 min-w-0`,children:[(0,h.jsx)(`h1`,{className:`font-mono text-xl font-semibold text-fg break-all`,children:n}),r.revision&&(0,h.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,h.jsxs)(`span`,{className:`font-mono text-xs px-2 py-0.5 rounded-md bg-surface-2 border border-border text-muted`,children:[`rev: `,r.revision.slice(0,8)]})})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,h.jsx)(fS,{value:r.content,label:`Copy content`}),(0,h.jsxs)(`button`,{type:`button`,onClick:l,"aria-label":`Download file`,className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-2.5 py-1 text-xs font-medium text-muted transition-colors hover:bg-surface-2 hover:text-fg focus-visible:outline-2 outline-accent-500 cursor-pointer`,children:[(0,h.jsx)($b,{size:14,className:`shrink-0 text-muted`}),(0,h.jsx)(`span`,{children:`Download`})]})]})]}),(0,h.jsx)(QD,{code:r.content,lang:u,lineNumbers:!0,className:`rounded-xl border border-border bg-surface-2 overflow-hidden shadow-xs`})]})}function Wj(){let e=Nh().project??``,{data:t}=O_(e),n=N_(e),r=P_({project:e,stale:!0,limit:100}),i=P_({project:e,trustTier:`unverified`,limit:100}),a=n.isLoading||r.isLoading||i.isLoading,o=n.isError||r.isError||i.isError,s=n.error||r.error||i.error,c=()=>{n.refetch(),r.refetch(),i.refetch()},l=(0,m.useMemo)(()=>{if(!n.data)return{errors:[],warnings:[],infos:[]};let e=[],t=[],r=[];for(let i of n.data)i.severity===`error`?e.push(i):i.severity===`warning`?t.push(i):r.push(i);return{errors:e,warnings:t,infos:r}},[n.data]),u=t?.title?`${t.title} Health`:`Health`;if(a)return(0,h.jsxs)(uS,{title:u,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-32 rounded-md`}),(0,h.jsx)(Q,{className:`h-8 w-48 rounded-lg`})]}),(0,h.jsx)(`div`,{className:`mt-8 space-y-10`,children:Array.from({length:3}).map((e,t)=>(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsx)(Q,{className:`h-7 w-48 rounded-md`}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-4 space-y-3`,children:[(0,h.jsx)(Q,{className:`h-12 w-full rounded-lg`}),(0,h.jsx)(Q,{className:`h-12 w-full rounded-lg`})]})]},t))})]});if(o)return(0,h.jsx)(uS,{title:u,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(sS,{error:s,onRetry:c})});let d=n.data??[],f=r.data??[],p=i.data??[],g=l.errors.length;return(0,h.jsxs)(uS,{title:u,className:`mx-auto max-w-5xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-8`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted`,children:[(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}`,className:`transition-colors hover:text-fg`,children:t?.title??e}),(0,h.jsx)(`span`,{children:`/`}),(0,h.jsx)(`span`,{className:`text-fg`,children:`Health`})]}),(0,h.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-4`,children:(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`Knowledge Base Health`}),(0,h.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[`Lint diagnostics, staleness, and verification status for `,t?.title??e]})]})})]}),(0,h.jsxs)(`div`,{className:`space-y-10`,children:[(0,h.jsxs)(`section`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border pb-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-fg`,children:`Specification Conformance`}),g===0?(0,h.jsxs)(qD,{className:`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 ring-emerald-500/20`,children:[(0,h.jsx)(Ub,{size:13}),(0,h.jsx)(`span`,{children:`Conformant`})]}):(0,h.jsxs)(qD,{className:`bg-rose-500/10 text-rose-600 dark:text-rose-400 ring-rose-500/20`,children:[(0,h.jsx)(Vb,{size:13}),(0,h.jsxs)(`span`,{children:[g,` `,g===1?`error`:`errors`]})]})]}),(0,h.jsxs)(`span`,{className:`text-xs text-muted`,children:[`(`,d.length,`)`]})]}),d.length===0?(0,h.jsx)(oS,{icon:Ub,title:`All concepts and files conform`,hint:`No lint or specification issues found in this project.`,className:`py-10`}):(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:[...l.errors,...l.warnings,...l.infos].map((t,n)=>{let r=t.path.endsWith(`.md`)?`/p/${encodeURIComponent(e)}/c/${t.path.slice(0,-3)}`:`/p/${encodeURIComponent(e)}/f/${t.path}`,i=xx,a=`text-sky-500 bg-sky-500/10 ring-sky-500/20`;return t.severity===`error`?(i=Vb,a=`text-rose-600 dark:text-rose-400 bg-rose-500/10 ring-rose-500/20`):t.severity===`warning`&&(i=tS,a=`text-amber-600 dark:text-amber-400 bg-amber-500/10 ring-amber-500/20`),(0,h.jsx)(`div`,{className:`flex flex-col gap-2 p-4 sm:flex-row sm:items-center sm:justify-between`,children:(0,h.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0`,children:[(0,h.jsx)(`div`,{className:X(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full ring-1`,a),children:(0,h.jsx)(i,{size:14})}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`font-mono text-xs font-semibold text-fg`,children:t.code}),(0,h.jsx)(`span`,{className:`text-xs text-muted`,children:`on`}),(0,h.jsx)($g,{to:r,className:`font-mono text-xs text-accent-500 hover:text-accent-600 transition-colors truncate max-w-sm`,title:`Navigate to ${t.path}`,children:t.path})]}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted break-words`,children:t.message})]})]})},n)})})]}),(0,h.jsxs)(`section`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border pb-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-fg`,children:`Stale Concepts`}),f.length>0&&(0,h.jsx)(XD,{})]}),(0,h.jsxs)(`span`,{className:`text-xs text-muted`,children:[`(`,f.length,`)`]})]}),f.length===0?(0,h.jsx)(oS,{icon:qb,title:`No stale concepts`,hint:`All concepts are within their defined freshness interval.`,className:`py-10`}):(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:f.map(t=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e)}/c/${t.id}`,className:`group flex flex-col gap-3 p-4 transition-colors hover:bg-surface-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,h.jsx)(hD,{type:t.type,size:18}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`text-sm font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500 truncate`,children:t.title}),(0,h.jsx)(`span`,{className:`font-mono text-xs text-subtle shrink-0`,children:t.id})]}),t.description&&(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted`,children:t.description})]})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 self-end sm:self-center`,children:[(0,h.jsx)(JD,{status:t.status}),(0,h.jsx)(YD,{tier:t.trustTier}),(0,h.jsx)(XD,{})]})]},t.id))})]}),(0,h.jsxs)(`section`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border pb-3`,children:[(0,h.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,h.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-fg`,children:`Unverified Concepts`})}),(0,h.jsxs)(`span`,{className:`text-xs text-muted`,children:[`(`,p.length,`)`]})]}),p.length===0?(0,h.jsx)(oS,{icon:Ub,title:`All concepts verified`,hint:`Every concept has been machine-confirmed or human-reviewed.`,className:`py-10`}):(0,h.jsx)(`div`,{className:`overflow-hidden rounded-xl border border-border bg-surface divide-y divide-border`,children:p.map(t=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e)}/c/${t.id}`,className:`group flex flex-col gap-3 p-4 transition-colors hover:bg-surface-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,h.jsx)(hD,{type:t.type,size:18}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`text-sm font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500 truncate`,children:t.title}),(0,h.jsx)(`span`,{className:`font-mono text-xs text-subtle shrink-0`,children:t.id})]}),t.description&&(0,h.jsx)(`p`,{className:`mt-0.5 line-clamp-1 text-xs text-muted`,children:t.description})]})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 self-end sm:self-center`,children:[(0,h.jsx)(JD,{status:t.status}),(0,h.jsx)(YD,{tier:t.trustTier}),t.stale&&(0,h.jsx)(XD,{})]})]},t.id))})]})]})]})}function Gj(){return(0,h.jsxs)(uS,{title:`Page not found`,className:`flex min-h-[70vh] flex-col items-center justify-center p-8 text-center`,children:[(0,h.jsx)(`div`,{className:`text-8xl font-black tracking-tighter bg-gradient-to-br from-accent-500 via-accent-400 to-glow bg-clip-text text-transparent select-none`,children:`404`}),(0,h.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold tracking-tight text-fg`,children:`Nothing here`}),(0,h.jsx)(`p`,{className:`mt-2 text-sm text-muted max-w-sm`,children:`The page you're looking for doesn't exist, has been moved, or you don't have access to it.`}),(0,h.jsx)($g,{to:`/`,className:`mt-6 inline-flex items-center justify-center rounded-lg bg-surface-2 px-4 py-2 text-xs font-medium text-fg ring-1 ring-border hover:bg-surface hover:ring-border-strong transition-colors`,children:`Back to projects`})]})}function Kj({label:e,icon:t,value:n,tone:r=`default`,to:i,children:a,className:o}){let s=r===`warn`,c=X(`rounded-xl border p-4 transition-all`,s?`border-orange-500/30 bg-orange-500/5 dark:border-orange-500/20`:`border-border bg-surface`,i&&`block hover:-translate-y-px hover:border-border-strong`,o),l=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-muted`,children:e}),t&&(0,h.jsx)(t,{size:16,className:s?`text-orange-600 dark:text-orange-400`:`text-muted shrink-0`})]}),n!==void 0&&(0,h.jsx)(`div`,{className:X(`mt-2 text-2xl font-semibold tracking-tight`,s?`text-orange-600 dark:text-orange-400`:`text-fg`),children:n}),a&&(0,h.jsx)(`div`,{className:`mt-3`,children:a})]});return i?(0,h.jsx)($g,{to:i,className:c,children:l}):(0,h.jsx)(`div`,{className:c,children:l})}function qj(){let e=Nh().project??``,t=CD(),[n,r]=(0,m.useState)(!1),{data:i,isLoading:a,isError:o,error:s,refetch:c}=O_(e),l=A_(e,`overview`),u=k_(e,``),d=M_(e,{limit:8}),f=(0,m.useMemo)(()=>u.data?u.data.filter(e=>e.kind===`directory`).sort((e,t)=>e.path.localeCompare(t.path)):[],[u.data]),p=(0,m.useMemo)(()=>i?.typeCounts?Object.entries(i.typeCounts).sort(([,e],[,t])=>t-e).slice(0,5):[],[i?.typeCounts]),g=(0,m.useMemo)(()=>{if(!i?.trustTierCounts)return{total:0,human:0,machine:0,unverified:0};let e=i.trustTierCounts[`human-reviewed`]??0,t=i.trustTierCounts[`machine-confirmed`]??0,n=i.trustTierCounts.unverified??0;return{total:e+t+n,human:e,machine:t,unverified:n}},[i?.trustTierCounts]);return a?(0,h.jsxs)(uS,{title:e||`Project`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(Q,{className:`h-9 w-64 rounded-lg`}),(0,h.jsx)(Q,{className:`h-5 w-96 rounded-md`})]}),(0,h.jsx)(`div`,{className:`mt-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,h.jsx)(Q,{className:`h-32 rounded-xl`},t))}),(0,h.jsxs)(`div`,{className:`mt-8 grid grid-cols-1 gap-8 lg:grid-cols-12`,children:[(0,h.jsx)(`div`,{className:`lg:col-span-7 xl:col-span-8`,children:(0,h.jsx)(Q,{className:`h-96 rounded-xl`})}),(0,h.jsxs)(`div`,{className:`lg:col-span-5 xl:col-span-4 space-y-6`,children:[(0,h.jsx)(Q,{className:`h-64 rounded-xl`}),(0,h.jsx)(Q,{className:`h-48 rounded-xl`})]})]})]}):o?(0,h.jsx)(uS,{title:e||`Project`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(sS,{error:s,onRetry:()=>void c()})}):i?(0,h.jsxs)(uS,{title:i.title,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col justify-between gap-4 border-b border-border pb-6 sm:flex-row sm:items-start`,children:[(0,h.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight text-fg`,children:i.title}),(0,h.jsx)(`span`,{className:`font-mono text-xs text-subtle`,children:i.project})]}),i.description&&(0,h.jsx)(`p`,{className:`mt-2 text-base text-muted`,children:i.description}),i.repositories&&i.repositories.length>0&&(0,h.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:i.repositories.map(e=>{let t=null;try{let n=new URL(`https://${e}`);n.protocol===`https:`&&n.hostname&&(t=n.href)}catch{}if(!t)return null;let n=e.indexOf(`/`),r=n===-1?e:e.slice(n+1);return(0,h.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-surface-2 px-2 py-1 font-mono text-xs text-muted transition-colors hover:border-border-strong hover:text-fg`,title:`View ${e}`,children:[(0,h.jsx)(hx,{size:13,className:`shrink-0 text-subtle`}),(0,h.jsx)(`span`,{children:r})]},e)})})]}),(0,h.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:(0,h.jsxs)(`button`,{type:`button`,onClick:async()=>{try{r(!0),await w_(e)}catch{}finally{r(!1)}},disabled:n,className:`inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-2 text-sm font-medium text-fg shadow-xs transition-colors hover:bg-surface-2 hover:border-border-strong disabled:opacity-50 focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)($b,{size:15,className:`shrink-0 text-muted`}),(0,h.jsx)(`span`,{children:n?`Exporting…`:`Export .tar.gz`})]})})]}),(0,h.jsxs)(`div`,{className:`mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,h.jsx)(Kj,{label:`Concepts`,icon:sx,value:i.conceptCount,to:`/search?project=${encodeURIComponent(e)}`}),(0,h.jsx)(Kj,{label:`Stale`,icon:qb,value:i.staleCount,tone:i.staleCount>0?`warn`:`default`,to:`/p/${encodeURIComponent(e)}/health`}),(0,h.jsx)(Kj,{label:`Trust`,icon:qx,children:(0,h.jsxs)(`div`,{className:`mt-1`,children:[(0,h.jsx)(`div`,{className:`flex h-2 w-full overflow-hidden rounded-full bg-surface-2`,children:g.total>0?(0,h.jsxs)(h.Fragment,{children:[g.human>0&&(0,h.jsx)(`div`,{style:{width:`${g.human/g.total*100}%`},className:`bg-emerald-500`,title:`Human-reviewed: ${g.human}`}),g.machine>0&&(0,h.jsx)(`div`,{style:{width:`${g.machine/g.total*100}%`},className:`bg-sky-500`,title:`Machine-confirmed: ${g.machine}`}),g.unverified>0&&(0,h.jsx)(`div`,{style:{width:`${g.unverified/g.total*100}%`},className:`bg-zinc-400 dark:bg-zinc-600`,title:`Unverified: ${g.unverified}`})]}):(0,h.jsx)(`div`,{className:`w-full bg-surface-2`})}),(0,h.jsxs)(`div`,{className:`mt-2.5 flex items-center justify-between text-[11px] text-muted`,children:[(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-500`}),(0,h.jsxs)(`span`,{children:[g.human,` human`]})]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-sky-500`}),(0,h.jsxs)(`span`,{children:[g.machine,` auto`]})]}),(0,h.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-zinc-400 dark:bg-zinc-600`}),(0,h.jsxs)(`span`,{children:[g.unverified,` unverified`]})]})]})]})}),(0,h.jsx)(Kj,{label:`Types`,icon:jb,children:p.length>0?(0,h.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:p.map(([t,n])=>(0,h.jsxs)($g,{to:`/search?project=${encodeURIComponent(e)}&type=${encodeURIComponent(t)}`,className:`inline-flex items-center gap-1 rounded-md bg-surface-2 px-1.5 py-0.5 text-xs text-muted transition-colors hover:bg-surface hover:text-fg ring-1 ring-border/50`,children:[(0,h.jsx)(hD,{type:t,size:12}),(0,h.jsx)(`span`,{children:t}),(0,h.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:n})]},t))}):(0,h.jsx)(`p`,{className:`mt-2 text-xs text-muted`,children:`No types recorded`})})]}),(0,h.jsxs)(`div`,{className:`mt-8 grid grid-cols-1 gap-8 lg:grid-cols-12`,children:[(0,h.jsxs)(`div`,{className:`lg:col-span-7 xl:col-span-8`,children:[l.isLoading&&(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-6 space-y-4`,children:[(0,h.jsx)(Q,{className:`h-7 w-48 rounded-md`}),(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-5/6`}),(0,h.jsx)(Q,{className:`h-4 w-4/6`})]}),l.data&&(0,h.jsx)(`div`,{className:`rounded-xl border border-border bg-surface p-6 sm:p-8`,children:(0,h.jsx)(Rj,{project:e,concept:l.data})})]}),(0,h.jsxs)(`div`,{className:`space-y-6 lg:col-span-5 xl:col-span-4`,children:[(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-5`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between pb-3 border-b border-border`,children:[(0,h.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold tracking-tight text-fg`,children:[(0,h.jsx)(zx,{size:16,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Recent activity`})]}),(0,h.jsx)($g,{to:`/p/${encodeURIComponent(e)}/activity`,className:`text-xs font-medium text-accent-500 transition-colors hover:text-accent-600`,children:`View all`})]}),(0,h.jsxs)(`div`,{className:`mt-3 divide-y divide-border/50`,children:[d.isLoading&&(0,h.jsx)(`div`,{className:`space-y-3 py-2`,children:Array.from({length:4}).map((e,t)=>(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(Q,{className:`h-6 w-6 rounded-full shrink-0`}),(0,h.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(0,h.jsx)(Q,{className:`h-3.5 w-3/4`}),(0,h.jsx)(Q,{className:`h-3 w-1/2`})]})]},t))}),d.data&&d.data.length>0?d.data.map(e=>{let t=e.actor.startsWith(`human:`)?e.actor.slice(6):e.actor;return(0,h.jsxs)(`div`,{className:`flex items-start gap-3 py-2.5 first:pt-1 last:pb-1`,children:[(0,h.jsx)(RD,{actor:e.actor,size:22,className:`mt-0.5`}),(0,h.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,h.jsx)(`p`,{className:`truncate text-xs font-medium text-fg`,title:e.subject,children:e.subject}),(0,h.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5 text-[11px] text-muted`,children:[(0,h.jsx)(`span`,{className:`truncate font-mono text-subtle max-w-[120px]`,children:t}),(0,h.jsx)(`span`,{children:`·`}),(0,h.jsx)(`span`,{title:AD(e.at),children:kD(e.at)})]})]})]},e.sha)}):!d.isLoading&&(0,h.jsx)(`p`,{className:`py-4 text-center text-xs text-muted`,children:`No recent activity`})]})]}),(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-5`,children:[(0,h.jsx)(`div`,{className:`pb-3 border-b border-border`,children:(0,h.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold tracking-tight text-fg`,children:[(0,h.jsx)(px,{size:16,className:`text-muted`}),(0,h.jsx)(`span`,{children:`Browse`})]})}),(0,h.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[u.isLoading&&(0,h.jsxs)(`div`,{className:`space-y-2`,children:[(0,h.jsx)(Q,{className:`h-10 w-full rounded-lg`}),(0,h.jsx)(Q,{className:`h-10 w-full rounded-lg`}),(0,h.jsx)(Q,{className:`h-10 w-full rounded-lg`})]}),f.length>0?f.map(e=>(0,h.jsxs)(`button`,{type:`button`,onClick:()=>t.reveal(e.path),className:`group flex w-full items-center justify-between rounded-lg border border-border bg-surface-2/50 p-2.5 text-left transition-colors hover:border-border-strong hover:bg-surface-2 focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,h.jsx)(px,{size:16,className:`shrink-0 text-accent-500`}),(0,h.jsx)(`span`,{className:`truncate text-xs font-medium text-fg transition-colors group-hover:text-accent-500`,children:e.path})]}),(0,h.jsxs)(`span`,{className:`ml-2 shrink-0 text-[11px] text-muted`,children:[e.conceptCount,` `,e.conceptCount===1?`concept`:`concepts`]})]},e.path)):!u.isLoading&&(0,h.jsx)(`p`,{className:`py-4 text-center text-xs text-muted`,children:`No directories`})]})]})]})]})]}):null}function Jj(){let{data:e,isLoading:t,isError:n,error:r,refetch:i}=D_(),[a,o]=(0,m.useState)(``),s=(0,m.useMemo)(()=>e?e.reduce((e,t)=>e+t.conceptCount,0):0,[e]),c=(0,m.useMemo)(()=>{if(!e)return[];let t=a.trim().toLowerCase();return[...t?e.filter(e=>e.title.toLowerCase().includes(t)||e.project.toLowerCase().includes(t)||!!e.description?.toLowerCase().includes(t)):e].sort((e,t)=>!e.updatedAt&&!t.updatedAt?0:e.updatedAt?t.updatedAt?new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime():-1:1)},[e,a]);return t?(0,h.jsxs)(uS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(Q,{className:`h-9 w-64 rounded-lg`}),(0,h.jsx)(Q,{className:`h-5 w-48 rounded-md`})]}),(0,h.jsx)(`div`,{className:`mt-6`,children:(0,h.jsx)(Q,{className:`h-10 w-full max-w-sm rounded-lg`})}),(0,h.jsx)(`div`,{className:`mt-8 grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,h.jsxs)(`div`,{className:`flex flex-col justify-between rounded-xl border border-border bg-surface p-5`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,h.jsx)(Q,{className:`h-5 w-32`}),(0,h.jsx)(Q,{className:`h-4 w-20`})]}),(0,h.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-3/4`})]})]}),(0,h.jsxs)(`div`,{className:`mt-6 border-t border-border pt-4 flex items-center justify-between`,children:[(0,h.jsx)(Q,{className:`h-4 w-28`}),(0,h.jsx)(Q,{className:`h-4 w-20`})]})]},t))})]}):n?(0,h.jsx)(uS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:(0,h.jsx)(sS,{error:r,onRetry:()=>void i()})}):!e||e.length===0?(0,h.jsxs)(uS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`mb-8`,children:[(0,h.jsx)(`h1`,{className:`bg-gradient-to-r from-fg to-muted bg-clip-text text-3xl font-semibold tracking-tight text-transparent`,children:`Knowledge base`}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`0 projects · 0 concepts`})]}),(0,h.jsx)(oS,{icon:lx,title:`No projects yet`,hint:`Agents create them with create_project, or POST /api/v1/projects.`,className:`mt-6 py-16`})]}):(0,h.jsxs)(uS,{title:`Projects`,className:`mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`bg-gradient-to-r from-fg to-muted bg-clip-text text-3xl font-semibold tracking-tight text-transparent`,children:`Knowledge base`}),(0,h.jsxs)(`p`,{className:`mt-1 text-sm text-muted`,children:[e.length,` `,e.length===1?`project`:`projects`,` · `,s,` `,s===1?`concept`:`concepts`]})]}),(0,h.jsx)(`div`,{className:`mt-6`,children:(0,h.jsxs)(`div`,{className:`relative max-w-sm`,children:[(0,h.jsx)(Gx,{size:16,className:`absolute left-3 top-1/2 -translate-y-1/2 text-subtle`}),(0,h.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),placeholder:`Filter projects…`,className:`w-full rounded-lg border border-border bg-surface py-2 pl-9 pr-3 text-sm text-fg placeholder:text-muted transition-colors focus-visible:outline-2 outline-accent-500`})]})}),c.length===0?(0,h.jsx)(oS,{icon:Gx,title:`No matching projects`,hint:`No projects match "${a}". Try adjusting your filter.`,className:`mt-8 py-12`}):(0,h.jsx)(`div`,{className:`mt-8 grid gap-4 sm:grid-cols-2 xl:grid-cols-3`,children:c.map(e=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e.project)}`,className:`group flex flex-col justify-between rounded-xl border border-border bg-surface p-5 transition-all duration-150 hover:-translate-y-px hover:border-border-strong hover:shadow-[0_8px_30px_-12px_rgb(139_92_246/0.35)]`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500 truncate`,children:e.title}),(0,h.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-subtle`,children:e.project})]}),(0,h.jsx)(`p`,{className:`mt-2 line-clamp-2 text-sm text-muted min-h-[2.5rem]`,children:e.description||`No description provided.`})]}),(0,h.jsxs)(`div`,{className:`mt-5 border-t border-border pt-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted`,children:[(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,h.jsx)(sx,{size:14,className:`shrink-0 text-subtle`}),(0,h.jsx)(`span`,{children:e.conceptCount})]}),(0,h.jsxs)(`span`,{className:X(`inline-flex items-center gap-1.5`,e.staleCount>0?`font-medium text-orange-600 dark:text-orange-400`:`text-muted`),children:[(0,h.jsx)(qb,{size:14,className:`shrink-0`}),(0,h.jsxs)(`span`,{children:[e.staleCount,` stale`]})]}),(0,h.jsx)(`span`,{className:`ml-auto text-subtle truncate`,children:e.updatedAt?`Updated ${kD(e.updatedAt)}`:`Never updated`})]}),e.repositories&&e.repositories.length>0&&(0,h.jsx)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5`,children:e.repositories.map(e=>{let t=e.indexOf(`/`),n=t===-1?e:e.slice(t+1);return(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-muted ring-1 ring-border/50`,title:e,children:[(0,h.jsx)(hx,{size:11,className:`shrink-0 text-subtle`}),(0,h.jsx)(`span`,{className:`truncate max-w-[140px]`,children:n})]},e)})})]})]},e.project))})]})}function Yj(){let[e,t]=r_(),n=e.get(`q`)??``,r=e.get(`project`)??``,i=e.get(`type`)??``,a=e.getAll(`tag`),o=e.get(`status`)??``,s=e.get(`trustTier`)??``,c=e.get(`stale`)??``,[l,u]=(0,m.useState)(``),{data:d}=D_(),{data:f}=O_(r),p=(0,m.useMemo)(()=>{if(r&&f?.typeCounts){let e=Object.keys(f.typeCounts);if(e.length>0)return e}return fD},[r,f?.typeCounts]),{data:g,isLoading:_,isError:v,error:y,refetch:b}=P_((0,m.useMemo)(()=>{let e={limit:50};return n.trim()&&(e.q=n.trim()),r&&(e.project=r),i&&(e.type=i),a.length>0&&(e.tag=a),o&&(e.status=o),s&&(e.trustTier=s),c===`true`&&(e.stale=!0),c===`false`&&(e.stale=!1),e},[n,r,i,a,o,s,c])),x=(n,r)=>{let i=new URLSearchParams(e);r?i.set(n,r):i.delete(n),t(i,{replace:!0})},S=n=>{let r=n.trim();if(!r||a.includes(r))return;let i=new URLSearchParams(e);i.append(`tag`,r),t(i,{replace:!0}),u(``)},C=n=>{let r=new URLSearchParams(e);r.delete(`tag`);for(let e of a)e!==n&&r.append(`tag`,e);t(r,{replace:!0})},w=e=>{e.preventDefault(),S(l)},T=!!(r||i||a.length>0||o||s||c);return(0,h.jsxs)(uS,{title:`Search`,className:`mx-auto max-w-6xl px-4 py-8 sm:px-6 lg:px-8`,children:[(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:`Search Knowledge Base`}),(0,h.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`Find concepts, decisions, conventions, and architectural records across projects.`})]}),(0,h.jsxs)(`div`,{className:`relative`,children:[(0,h.jsx)(Gx,{size:20,className:`absolute left-4 top-1/2 -translate-y-1/2 text-subtle`}),(0,h.jsx)(`input`,{type:`text`,value:n,onChange:e=>x(`q`,e.target.value),placeholder:`Search concepts by keyword, text, title…`,className:`w-full rounded-xl border border-border bg-surface py-3.5 pl-12 pr-4 text-base text-fg shadow-xs placeholder:text-muted transition-colors focus-visible:outline-2 outline-accent-500`})]})]}),(0,h.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-2.5 rounded-xl border border-border bg-surface p-3 sm:gap-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium text-muted`,children:[(0,h.jsx)(Yx,{size:14,className:`text-subtle`}),(0,h.jsx)(`span`,{children:`Filter:`})]}),(0,h.jsxs)(`select`,{value:r,onChange:e=>x(`project`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`All projects`}),d?.map(e=>(0,h.jsx)(`option`,{value:e.project,children:e.title},e.project))]}),(0,h.jsxs)(`select`,{value:i,onChange:e=>x(`type`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`All types`}),p.map(e=>(0,h.jsx)(`option`,{value:e,children:e},e))]}),(0,h.jsxs)(`select`,{value:o,onChange:e=>x(`status`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`Any status`}),(0,h.jsx)(`option`,{value:`draft`,children:`Draft`}),(0,h.jsx)(`option`,{value:`stable`,children:`Stable`}),(0,h.jsx)(`option`,{value:`deprecated`,children:`Deprecated`})]}),(0,h.jsxs)(`select`,{value:s,onChange:e=>x(`trustTier`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`Any trust`}),(0,h.jsx)(`option`,{value:`human-reviewed`,children:`Human-reviewed`}),(0,h.jsx)(`option`,{value:`machine-confirmed`,children:`Machine-confirmed`}),(0,h.jsx)(`option`,{value:`unverified`,children:`Unverified`})]}),(0,h.jsxs)(`select`,{value:c,onChange:e=>x(`stale`,e.target.value),className:`rounded-lg border border-border bg-surface-2 px-2.5 py-1.5 text-xs text-fg transition-colors hover:border-border-strong focus-visible:outline-2 outline-accent-500`,children:[(0,h.jsx)(`option`,{value:``,children:`Any staleness`}),(0,h.jsx)(`option`,{value:`true`,children:`Stale`}),(0,h.jsx)(`option`,{value:`false`,children:`Fresh`})]}),(0,h.jsx)(`form`,{onSubmit:w,className:`flex items-center`,children:(0,h.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:`+ tag…`,className:`w-20 rounded-lg border border-border bg-surface-2 px-2 py-1.5 text-xs text-fg placeholder:text-subtle transition-colors focus-visible:outline-2 outline-accent-500`})}),T&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>{let e=new URLSearchParams;n&&e.set(`q`,n),t(e,{replace:!0})},className:`ml-auto text-xs font-medium text-accent-500 hover:text-accent-600 transition-colors`,children:`Clear filters`})]}),a.length>0&&(0,h.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[(0,h.jsxs)(`span`,{className:`text-xs text-muted flex items-center gap-1`,children:[(0,h.jsx)($x,{size:12,className:`text-subtle`}),(0,h.jsx)(`span`,{children:`Tags:`})]}),a.map(e=>(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-accent-500/20 bg-accent-500/10 px-2 py-0.5 font-mono text-xs text-accent-600 dark:text-accent-400`,children:[(0,h.jsxs)(`span`,{children:[`#`,e]}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`hover:text-fg transition-colors`,title:`Remove tag ${e}`,children:(0,h.jsx)(aS,{size:12})})]},e))]}),(0,h.jsxs)(`div`,{className:`mt-8`,children:[_&&(0,h.jsx)(`div`,{className:`space-y-4`,children:Array.from({length:4}).map((e,t)=>(0,h.jsxs)(`div`,{className:`rounded-xl border border-border bg-surface p-5 space-y-3`,children:[(0,h.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(Q,{className:`h-5 w-40`}),(0,h.jsx)(Q,{className:`h-5 w-20`})]}),(0,h.jsx)(Q,{className:`h-5 w-24`})]}),(0,h.jsx)(Q,{className:`h-4 w-full`}),(0,h.jsx)(Q,{className:`h-4 w-3/4`})]},t))}),v&&(0,h.jsx)(sS,{error:y,onRetry:()=>void b()}),!_&&!v&&g&&g.length===0&&(0,h.jsx)(oS,{icon:Gx,title:`No matches`,hint:`Try adjusting your keywords, expanding your project scope, or clearing filters.`,className:`py-16`}),!_&&!v&&g&&g.length>0&&(0,h.jsxs)(`div`,{className:`space-y-3`,children:[(0,h.jsx)(`div`,{className:`flex items-center justify-between text-xs text-muted pb-1`,children:(0,h.jsxs)(`span`,{children:[`Found `,g.length,` `,g.length===1?`result`:`results`]})}),g.map(e=>(0,h.jsxs)($g,{to:`/p/${encodeURIComponent(e.project)}/c/${e.id}`,className:`group block rounded-xl border border-border bg-surface p-5 transition-all duration-150 hover:-translate-y-px hover:border-border-strong hover:shadow-[0_8px_30px_-12px_rgb(139_92_246/0.35)]`,children:[(0,h.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-baseline sm:justify-between`,children:[(0,h.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,h.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg transition-colors group-hover:text-accent-500`,children:(0,h.jsx)(dD,{text:e.title,query:n})}),(0,h.jsx)(ZD,{type:e.type}),(0,h.jsxs)(`span`,{className:`font-mono text-xs text-subtle`,children:[e.project,`/`,e.id]})]}),(0,h.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,h.jsx)(JD,{status:e.status}),(0,h.jsx)(YD,{tier:e.trustTier}),e.stale&&(0,h.jsx)(XD,{})]})]}),e.snippet?(0,h.jsx)(`p`,{className:`mt-2.5 text-sm text-muted break-words line-clamp-2`,children:(0,h.jsx)(dD,{text:e.snippet,query:n})}):e.description&&(0,h.jsx)(`p`,{className:`mt-2.5 text-sm text-muted break-words line-clamp-2`,children:(0,h.jsx)(dD,{text:e.description,query:n})}),e.tags&&e.tags.length>0&&(0,h.jsx)(`div`,{className:`mt-3.5 flex flex-wrap items-center gap-1.5 pt-1`,children:e.tags.map(e=>(0,h.jsxs)(`span`,{className:`rounded-md bg-surface-2 px-1.5 py-0.5 font-mono text-[11px] text-muted ring-1 ring-border/50`,children:[`#`,e]},e))})]},`${e.project}/${e.id}`))]})]})]})}var Xj=Xg([{path:`/callback`,element:(0,h.jsx)(KD,{})},{element:(0,h.jsx)(hS,{}),children:[{element:(0,h.jsx)(UD,{}),children:[{index:!0,element:(0,h.jsx)(Jj,{})},{path:`search`,element:(0,h.jsx)(Yj,{})},{path:`p/:project`,element:(0,h.jsx)(qj,{})},{path:`p/:project/activity`,element:(0,h.jsx)(GD,{})},{path:`p/:project/health`,element:(0,h.jsx)(Wj,{})},{path:`p/:project/c/*`,element:(0,h.jsx)(Bj,{})},{path:`p/:project/f/*`,element:(0,h.jsx)(Uj,{})},{path:`*`,element:(0,h.jsx)(Gj,{})}]}]}],{basename:`/ui`});ib();var Zj=document.getElementById(`root`);Zj&&(0,Tg.createRoot)(Zj).render((0,h.jsx)(m.StrictMode,{children:(0,h.jsx)(v,{client:T_,children:(0,h.jsx)(Jy,{children:(0,h.jsx)(cu,{reducedMotion:`user`,children:(0,h.jsx)(l_,{router:Xj})})})})}));export{Ag as n,s as r,kk as t};