mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-24 05:02:20 +08:00
fix(ui): 滚动锚点恢复 e2e 实测修三处——单向贴底判定 + 停稳校准 + 轮询对齐
Playwright 对真实会话历史起 7 条断言,连修三个实测问题: - 贴底跟随判定吃了程序滚动的回声:回放一批长高 >40px 即误判离底, 跟随卡在中途。scroll 事件改单向(贴底→true),离底只认用户输入 (滚轮向上/滚动条带按下) - 滚动停止后布局无事件微调 ~6px,记忆存了停稳前的值:保存加 600ms 停稳校准 - 切回后同样在新渲染布局里对齐、随后微调导致 6px 漂移(RO 抓不到 再分配):恢复存活期 200ms 轮询对齐,用户接管即停 最终:切走切回同条目 0px 偏差、截图逐像素一致,7/7 通过。
This commit is contained in:
1 parent
a1c12b579d
commit
b31dbfbc26
3 files changed
+116
-54
No files matched your search
@@ -10,7 +10,7 @@
|
||||
<style>
|
||||
html, body { background: #fcfdfc; }
|
||||
</style>
|
||||
<script type="module" crossorigin>var ig=Object.defineProperty;var sg=(i,s,o)=>s in i?ig(i,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[s]=o;var pt=(i,s,o)=>sg(i,typeof s!="symbol"?s+"":s,o);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const g of p.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function o(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function u(d){if(d.ep)return;d.ep=!0;const p=o(d);fetch(d.href,p)}})();function og(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ua={exports:{}},_s={},Fa={exports:{}},Ve={};/**
|
||||
<script type="module" crossorigin>var ig=Object.defineProperty;var sg=(i,s,o)=>s in i?ig(i,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[s]=o;var ht=(i,s,o)=>sg(i,typeof s!="symbol"?s+"":s,o);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const g of p.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function o(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function u(d){if(d.ep)return;d.ep=!0;const p=o(d);fetch(d.href,p)}})();function og(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ua={exports:{}},_s={},Fa={exports:{}},Ve={};/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
@@ -18,7 +18,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Ud;function lg(){if(Ud)return Ve;Ud=1;var i=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),D=Symbol.iterator;function N(k){return k===null||typeof k!="object"?null:(k=D&&k[D]||k["@@iterator"],typeof k=="function"?k:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,W={};function G(k,x,z){this.props=k,this.context=x,this.refs=W,this.updater=z||P}G.prototype.isReactComponent={},G.prototype.setState=function(k,x){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,x,"setState")},G.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function pe(){}pe.prototype=G.prototype;function me(k,x,z){this.props=k,this.context=x,this.refs=W,this.updater=z||P}var ve=me.prototype=new pe;ve.constructor=me,B(ve,G.prototype),ve.isPureReactComponent=!0;var le=Array.isArray,he=Object.prototype.hasOwnProperty,M={current:null},ie={key:!0,ref:!0,__self:!0,__source:!0};function J(k,x,z){var $,ye={},Ne=null,ce=null;if(x!=null)for($ in x.ref!==void 0&&(ce=x.ref),x.key!==void 0&&(Ne=""+x.key),x)he.call(x,$)&&!ie.hasOwnProperty($)&&(ye[$]=x[$]);var ae=arguments.length-2;if(ae===1)ye.children=z;else if(1<ae){for(var Oe=Array(ae),ze=0;ze<ae;ze++)Oe[ze]=arguments[ze+2];ye.children=Oe}if(k&&k.defaultProps)for($ in ae=k.defaultProps,ae)ye[$]===void 0&&(ye[$]=ae[$]);return{$$typeof:i,type:k,key:Ne,ref:ce,props:ye,_owner:M.current}}function ue(k,x){return{$$typeof:i,type:k.type,key:x,ref:k.ref,props:k.props,_owner:k._owner}}function Be(k){return typeof k=="object"&&k!==null&&k.$$typeof===i}function Ze(k){var x={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(z){return x[z]})}var Ie=/\/+/g;function Qe(k,x){return typeof k=="object"&&k!==null&&k.key!=null?Ze(""+k.key):x.toString(36)}function Ue(k,x,z,$,ye){var Ne=typeof k;(Ne==="undefined"||Ne==="boolean")&&(k=null);var ce=!1;if(k===null)ce=!0;else switch(Ne){case"string":case"number":ce=!0;break;case"object":switch(k.$$typeof){case i:case s:ce=!0}}if(ce)return ce=k,ye=ye(ce),k=$===""?"."+Qe(ce,0):$,le(ye)?(z="",k!=null&&(z=k.replace(Ie,"$&/")+"/"),Ue(ye,x,z,"",function(ze){return ze})):ye!=null&&(Be(ye)&&(ye=ue(ye,z+(!ye.key||ce&&ce.key===ye.key?"":(""+ye.key).replace(Ie,"$&/")+"/")+k)),x.push(ye)),1;if(ce=0,$=$===""?".":$+":",le(k))for(var ae=0;ae<k.length;ae++){Ne=k[ae];var Oe=$+Qe(Ne,ae);ce+=Ue(Ne,x,z,Oe,ye)}else if(Oe=N(k),typeof Oe=="function")for(k=Oe.call(k),ae=0;!(Ne=k.next()).done;)Ne=Ne.value,Oe=$+Qe(Ne,ae++),ce+=Ue(Ne,x,z,Oe,ye);else if(Ne==="object")throw x=String(k),Error("Objects are not valid as a React child (found: "+(x==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":x)+"). If you meant to render a collection of children, use an array instead.");return ce}function tt(k,x,z){if(k==null)return k;var $=[],ye=0;return Ue(k,$,"","",function(Ne){return x.call(z,Ne,ye++)}),$}function Xe(k){if(k._status===-1){var x=k._result;x=x(),x.then(function(z){(k._status===0||k._status===-1)&&(k._status=1,k._result=z)},function(z){(k._status===0||k._status===-1)&&(k._status=2,k._result=z)}),k._status===-1&&(k._status=0,k._result=x)}if(k._status===1)return k._result.default;throw k._result}var Fe={current:null},U={transition:null},oe={ReactCurrentDispatcher:Fe,ReactCurrentBatchConfig:U,ReactCurrentOwner:M};function X(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:tt,forEach:function(k,x,z){tt(k,function(){x.apply(this,arguments)},z)},count:function(k){var x=0;return tt(k,function(){x++}),x},toArray:function(k){return tt(k,function(x){return x})||[]},only:function(k){if(!Be(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},Ve.Component=G,Ve.Fragment=o,Ve.Profiler=d,Ve.PureComponent=me,Ve.StrictMode=u,Ve.Suspense=w,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oe,Ve.act=X,Ve.cloneElement=function(k,x,z){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var $=B({},k.props),ye=k.key,Ne=k.ref,ce=k._owner;if(x!=null){if(x.ref!==void 0&&(Ne=x.ref,ce=M.current),x.key!==void 0&&(ye=""+x.key),k.type&&k.type.defaultProps)var ae=k.type.defaultProps;for(Oe in x)he.call(x,Oe)&&!ie.hasOwnProperty(Oe)&&($[Oe]=x[Oe]===void 0&&ae!==void 0?ae[Oe]:x[Oe])}var Oe=arguments.length-2;if(Oe===1)$.children=z;else if(1<Oe){ae=Array(Oe);for(var ze=0;ze<Oe;ze++)ae[ze]=arguments[ze+2];$.children=ae}return{$$typeof:i,type:k.type,key:ye,reLine truncated
|
||||
*/var Ud;function lg(){if(Ud)return Ve;Ud=1;var i=Symbol.for("react.element"),s=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),z=Symbol.iterator;function T(S){return S===null||typeof S!="object"?null:(S=z&&S[z]||S["@@iterator"],typeof S=="function"?S:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,W={};function Y(S,_,H){this.props=S,this.context=_,this.refs=W,this.updater=H||P}Y.prototype.isReactComponent={},Y.prototype.setState=function(S,_){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,_,"setState")},Y.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function de(){}de.prototype=Y.prototype;function ve(S,_,H){this.props=S,this.context=_,this.refs=W,this.updater=H||P}var ye=ve.prototype=new de;ye.constructor=ve,B(ye,Y.prototype),ye.isPureReactComponent=!0;var ae=Array.isArray,ge=Object.prototype.hasOwnProperty,j={current:null},re={key:!0,ref:!0,__self:!0,__source:!0};function te(S,_,H){var se,Ne={},_e=null,ue=null;if(_!=null)for(se in _.ref!==void 0&&(ue=_.ref),_.key!==void 0&&(_e=""+_.key),_)ge.call(_,se)&&!re.hasOwnProperty(se)&&(Ne[se]=_[se]);var O=arguments.length-2;if(O===1)Ne.children=H;else if(1<O){for(var pe=Array(O),Re=0;Re<O;Re++)pe[Re]=arguments[Re+2];Ne.children=pe}if(S&&S.defaultProps)for(se in O=S.defaultProps,O)Ne[se]===void 0&&(Ne[se]=O[se]);return{$$typeof:i,type:S,key:_e,ref:ue,props:Ne,_owner:j.current}}function ce(S,_){return{$$typeof:i,type:S.type,key:_,ref:S.ref,props:S.props,_owner:S._owner}}function Be(S){return typeof S=="object"&&S!==null&&S.$$typeof===i}function Ze(S){var _={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(H){return _[H]})}var Me=/\/+/g;function Qe(S,_){return typeof S=="object"&&S!==null&&S.key!=null?Ze(""+S.key):_.toString(36)}function Ke(S,_,H,se,Ne){var _e=typeof S;(_e==="undefined"||_e==="boolean")&&(S=null);var ue=!1;if(S===null)ue=!0;else switch(_e){case"string":case"number":ue=!0;break;case"object":switch(S.$$typeof){case i:case s:ue=!0}}if(ue)return ue=S,Ne=Ne(ue),S=se===""?"."+Qe(ue,0):se,ae(Ne)?(H="",S!=null&&(H=S.replace(Me,"$&/")+"/"),Ke(Ne,_,H,"",function(Re){return Re})):Ne!=null&&(Be(Ne)&&(Ne=ce(Ne,H+(!Ne.key||ue&&ue.key===Ne.key?"":(""+Ne.key).replace(Me,"$&/")+"/")+S)),_.push(Ne)),1;if(ue=0,se=se===""?".":se+":",ae(S))for(var O=0;O<S.length;O++){_e=S[O];var pe=se+Qe(_e,O);ue+=Ke(_e,_,H,pe,Ne)}else if(pe=T(S),typeof pe=="function")for(S=pe.call(S),O=0;!(_e=S.next()).done;)_e=_e.value,pe=se+Qe(_e,O++),ue+=Ke(_e,_,H,pe,Ne);else if(_e==="object")throw _=String(S),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.");return ue}function tt(S,_,H){if(S==null)return S;var se=[],Ne=0;return Ke(S,se,"","",function(_e){return _.call(H,_e,Ne++)}),se}function Xe(S){if(S._status===-1){var _=S._result;_=_(),_.then(function(H){(S._status===0||S._status===-1)&&(S._status=1,S._result=H)},function(H){(S._status===0||S._status===-1)&&(S._status=2,S._result=H)}),S._status===-1&&(S._status=0,S._result=_)}if(S._status===1)return S._result.default;throw S._result}var We={current:null},U={transition:null},le={ReactCurrentDispatcher:We,ReactCurrentBatchConfig:U,ReactCurrentOwner:j};function V(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:tt,forEach:function(S,_,H){tt(S,function(){_.apply(this,arguments)},H)},count:function(S){var _=0;return tt(S,function(){_++}),_},toArray:function(S){return tt(S,function(_){return _})||[]},only:function(S){if(!Be(S))throw Error("React.Children.only expected to receive a single React element child.");return S}},Ve.Component=Y,Ve.Fragment=o,Ve.Profiler=d,Ve.PureComponent=ve,Ve.StrictMode=u,Ve.Suspense=x,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=le,Ve.act=V,Ve.cloneElement=function(S,_,H){if(S==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+S+".");var se=B({},S.props),Ne=S.key,_e=S.ref,ue=S._owner;if(_!=null){if(_.ref!==void 0&&(_e=_.ref,ue=j.current),_.key!==void 0&&(Ne=""+_.key),S.type&&S.type.defaultProps)var O=S.type.defaultProps;for(pe in _)ge.call(_,pe)&&!re.hasOwnProperty(pe)&&(se[pe]=_[pe]===void 0&&O!==void 0?O[pe]:_[pe])}var pe=arguments.length-2;if(pe===1)se.children=H;else if(1<pe){O=Array(pe);for(var Re=0;Re<pe;Re++)O[Re]=arguments[Re+2];se.children=O}return{$$typeof:i,type:S.type,key:Line truncated
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
@@ -26,7 +26,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Wd;function ag(){if(Wd)return _s;Wd=1;var i=dc(),s=Symbol.for("react.element"),o=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function g(m,w,v){var S,D={},N=null,P=null;v!==void 0&&(N=""+v),w.key!==void 0&&(N=""+w.key),w.ref!==void 0&&(P=w.ref);for(S in w)u.call(w,S)&&!p.hasOwnProperty(S)&&(D[S]=w[S]);if(m&&m.defaultProps)for(S in w=m.defaultProps,w)D[S]===void 0&&(D[S]=w[S]);return{$$typeof:s,type:m,key:N,ref:P,props:D,_owner:d.current}}return _s.Fragment=o,_s.jsx=g,_s.jsxs=g,_s}var Hd;function cg(){return Hd||(Hd=1,Ua.exports=ag()),Ua.exports}var a=cg(),L=dc(),Wo={},Wa={exports:{}},Tn={},Ha={exports:{}},Ga={};/**
|
||||
*/var Wd;function ag(){if(Wd)return _s;Wd=1;var i=dc(),s=Symbol.for("react.element"),o=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function g(m,x,v){var E,z={},T=null,P=null;v!==void 0&&(T=""+v),x.key!==void 0&&(T=""+x.key),x.ref!==void 0&&(P=x.ref);for(E in x)u.call(x,E)&&!p.hasOwnProperty(E)&&(z[E]=x[E]);if(m&&m.defaultProps)for(E in x=m.defaultProps,x)z[E]===void 0&&(z[E]=x[E]);return{$$typeof:s,type:m,key:T,ref:P,props:z,_owner:d.current}}return _s.Fragment=o,_s.jsx=g,_s.jsxs=g,_s}var Hd;function cg(){return Hd||(Hd=1,Ua.exports=ag()),Ua.exports}var a=cg(),D=dc(),Wo={},Wa={exports:{}},Tn={},Ha={exports:{}},Ga={};/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
@@ -34,7 +34,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var Gd;function ug(){return Gd||(Gd=1,(function(i){function s(U,oe){var X=U.length;U.push(oe);e:for(;0<X;){var k=X-1>>>1,x=U[k];if(0<d(x,oe))U[k]=oe,U[X]=x,X=k;else break e}}function o(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var oe=U[0],X=U.pop();if(X!==oe){U[0]=X;e:for(var k=0,x=U.length,z=x>>>1;k<z;){var $=2*(k+1)-1,ye=U[$],Ne=$+1,ce=U[Ne];if(0>d(ye,X))Ne<x&&0>d(ce,ye)?(U[k]=ce,U[Ne]=X,k=Ne):(U[k]=ye,U[$]=X,k=$);else if(Ne<x&&0>d(ce,X))U[k]=ce,U[Ne]=X,k=Ne;else break e}}return oe}function d(U,oe){var X=U.sortIndex-oe.sortIndex;return X!==0?X:U.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var p=performance;i.unstable_now=function(){return p.now()}}else{var g=Date,m=g.now();i.unstable_now=function(){return g.now()-m}}var w=[],v=[],S=1,D=null,N=3,P=!1,B=!1,W=!1,G=typeof setTimeout=="function"?setTimeout:null,pe=typeof clearTimeout=="function"?clearTimeout:null,me=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ve(U){for(var oe=o(v);oe!==null;){if(oe.callback===null)u(v);else if(oe.startTime<=U)u(v),oe.sortIndex=oe.expirationTime,s(w,oe);else break;oe=o(v)}}function le(U){if(W=!1,ve(U),!B)if(o(w)!==null)B=!0,Xe(he);else{var oe=o(v);oe!==null&&Fe(le,oe.startTime-U)}}function he(U,oe){B=!1,W&&(W=!1,pe(J),J=-1),P=!0;var X=N;try{for(ve(oe),D=o(w);D!==null&&(!(D.expirationTime>oe)||U&&!Ze());){var k=D.callback;if(typeof k=="function"){D.callback=null,N=D.priorityLevel;var x=k(D.expirationTime<=oe);oe=i.unstable_now(),typeof x=="function"?D.callback=x:D===o(w)&&u(w),ve(oe)}else u(w);D=o(w)}if(D!==null)var z=!0;else{var $=o(v);$!==null&&Fe(le,$.startTime-oe),z=!1}return z}finally{D=null,N=X,P=!1}}var M=!1,ie=null,J=-1,ue=5,Be=-1;function Ze(){return!(i.unstable_now()-Be<ue)}function Ie(){if(ie!==null){var U=i.unstable_now();Be=U;var oe=!0;try{oe=ie(!0,U)}finally{oe?Qe():(M=!1,ie=null)}}else M=!1}var Qe;if(typeof me=="function")Qe=function(){me(Ie)};else if(typeof MessageChannel<"u"){var Ue=new MessageChannel,tt=Ue.port2;Ue.port1.onmessage=Ie,Qe=function(){tt.postMessage(null)}}else Qe=function(){G(Ie,0)};function Xe(U){ie=U,M||(M=!0,Qe())}function Fe(U,oe){J=G(function(){U(i.unstable_now())},oe)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(U){U.callback=null},i.unstable_continueExecution=function(){B||P||(B=!0,Xe(he))},i.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<U?Math.floor(1e3/U):5},i.unstable_getCurrentPriorityLevel=function(){return N},i.unstable_getFirstCallbackNode=function(){return o(w)},i.unstable_next=function(U){switch(N){case 1:case 2:case 3:var oe=3;break;default:oe=N}var X=N;N=oe;try{return U()}finally{N=X}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(U,oe){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var X=N;N=U;try{return oe()}finally{N=X}},i.unstable_scheduleCallback=function(U,oe,X){var k=i.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?k+X:k):X=k,U){case 1:var x=-1;break;case 2:x=250;break;case 5:x=1073741823;break;case 4:x=1e4;break;default:x=5e3}return x=X+x,U={id:S++,callback:oe,priorityLevel:U,startTime:X,expirationTime:x,sortIndex:-1},X>k?(U.sortIndex=X,s(v,U),o(w)===null&&U===o(v)&&(W?(pe(J),J=-1):W=!0,Fe(le,X-k))):(U.sortIndex=x,s(w,U),B||P||(B=!0,Xe(he))),U},i.unstable_shouldYield=Ze,i.unstable_wrapCallback=function(U){var oe=N;return function(){var X=N;N=oe;try{return U.apply(this,arguments)}finally{N=X}}}})(Ga)),Ga}var Yd;function dg(){return Yd||(Yd=1,Ha.exports=ug()),Ha.exports}/**
|
||||
*/var Gd;function ug(){return Gd||(Gd=1,(function(i){function s(U,le){var V=U.length;U.push(le);e:for(;0<V;){var S=V-1>>>1,_=U[S];if(0<d(_,le))U[S]=le,U[V]=_,V=S;else break e}}function o(U){return U.length===0?null:U[0]}function u(U){if(U.length===0)return null;var le=U[0],V=U.pop();if(V!==le){U[0]=V;e:for(var S=0,_=U.length,H=_>>>1;S<H;){var se=2*(S+1)-1,Ne=U[se],_e=se+1,ue=U[_e];if(0>d(Ne,V))_e<_&&0>d(ue,Ne)?(U[S]=ue,U[_e]=V,S=_e):(U[S]=Ne,U[se]=V,S=se);else if(_e<_&&0>d(ue,V))U[S]=ue,U[_e]=V,S=_e;else break e}}return le}function d(U,le){var V=U.sortIndex-le.sortIndex;return V!==0?V:U.id-le.id}if(typeof performance=="object"&&typeof performance.now=="function"){var p=performance;i.unstable_now=function(){return p.now()}}else{var g=Date,m=g.now();i.unstable_now=function(){return g.now()-m}}var x=[],v=[],E=1,z=null,T=3,P=!1,B=!1,W=!1,Y=typeof setTimeout=="function"?setTimeout:null,de=typeof clearTimeout=="function"?clearTimeout:null,ve=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function ye(U){for(var le=o(v);le!==null;){if(le.callback===null)u(v);else if(le.startTime<=U)u(v),le.sortIndex=le.expirationTime,s(x,le);else break;le=o(v)}}function ae(U){if(W=!1,ye(U),!B)if(o(x)!==null)B=!0,Xe(ge);else{var le=o(v);le!==null&&We(ae,le.startTime-U)}}function ge(U,le){B=!1,W&&(W=!1,de(te),te=-1),P=!0;var V=T;try{for(ye(le),z=o(x);z!==null&&(!(z.expirationTime>le)||U&&!Ze());){var S=z.callback;if(typeof S=="function"){z.callback=null,T=z.priorityLevel;var _=S(z.expirationTime<=le);le=i.unstable_now(),typeof _=="function"?z.callback=_:z===o(x)&&u(x),ye(le)}else u(x);z=o(x)}if(z!==null)var H=!0;else{var se=o(v);se!==null&&We(ae,se.startTime-le),H=!1}return H}finally{z=null,T=V,P=!1}}var j=!1,re=null,te=-1,ce=5,Be=-1;function Ze(){return!(i.unstable_now()-Be<ce)}function Me(){if(re!==null){var U=i.unstable_now();Be=U;var le=!0;try{le=re(!0,U)}finally{le?Qe():(j=!1,re=null)}}else j=!1}var Qe;if(typeof ve=="function")Qe=function(){ve(Me)};else if(typeof MessageChannel<"u"){var Ke=new MessageChannel,tt=Ke.port2;Ke.port1.onmessage=Me,Qe=function(){tt.postMessage(null)}}else Qe=function(){Y(Me,0)};function Xe(U){re=U,j||(j=!0,Qe())}function We(U,le){te=Y(function(){U(i.unstable_now())},le)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(U){U.callback=null},i.unstable_continueExecution=function(){B||P||(B=!0,Xe(ge))},i.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ce=0<U?Math.floor(1e3/U):5},i.unstable_getCurrentPriorityLevel=function(){return T},i.unstable_getFirstCallbackNode=function(){return o(x)},i.unstable_next=function(U){switch(T){case 1:case 2:case 3:var le=3;break;default:le=T}var V=T;T=le;try{return U()}finally{T=V}},i.unstable_pauseExecution=function(){},i.unstable_requestPaint=function(){},i.unstable_runWithPriority=function(U,le){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var V=T;T=U;try{return le()}finally{T=V}},i.unstable_scheduleCallback=function(U,le,V){var S=i.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?S+V:S):V=S,U){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=V+_,U={id:E++,callback:le,priorityLevel:U,startTime:V,expirationTime:_,sortIndex:-1},V>S?(U.sortIndex=V,s(v,U),o(x)===null&&U===o(v)&&(W?(de(te),te=-1):W=!0,We(ae,V-S))):(U.sortIndex=_,s(x,U),B||P||(B=!0,Xe(ge))),U},i.unstable_shouldYield=Ze,i.unstable_wrapCallback=function(U){var le=T;return function(){var V=T;T=le;try{return U.apply(this,arguments)}finally{T=V}}}})(Ga)),Ga}var Yd;function dg(){return Yd||(Yd=1,Ha.exports=ug()),Ha.exports}/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
@@ -42,53 +42,53 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/var qd;function fg(){if(qd)return Tn;qd=1;var i=dc(),s=dg();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=new Set,d={};function p(e,t){g(e,t),g(e+"Capture",t)}function g(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),w=Object.prototype.hasOwnProperty,v=/^[: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]*$/,S={},D={};function N(e){return w.call(D,e)?!0:w.call(S,e)?!1:v.test(e)?D[e]=!0:(S[e]=!0,!1)}function P(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function B(e,t,n,r){if(t===null||typeof t>"u"||P(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function W(e,t,n,r,l,c,f){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=f}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){G[e]=new W(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];G[t]=new W(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){G[e]=new W(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){G[e]=new W(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){G[e]=new W(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){G[e]=new W(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){G[e]=new W(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){G[e]=new W(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){G[e]=new W(e,5,!1,e.toLowerCase(),null,!1,!1)});var pe=/[\-:]([a-z])/g;function me(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(pe,me);G[t]=new W(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(pe,me);G[t]=new W(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(pe,me);G[t]=new W(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){G[e]=new W(e,1,!1,e.toLowerCase(),null,!1,!1)}),G.xlinkHref=new W("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){G[e]=new W(e,1,!1,e.toLowerCase(),null,!0,!0)});function ve(e,t,n,r){var l=G.hasOwnProperty(t)?G[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="nLine truncated
|
||||
`+k+e}var z=!1;function $(e,t){if(!e||z)return"";z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(O){var r=O}Reflect.construct(e,[],t)}else{try{t.call()}catch(O){r=O}e.call(t.prototype)}else{try{throw Error()}catch(O){r=O}e()}}catch(O){if(O&&r&&typeof O.stack=="string"){for(var l=O.stack.split(`
|
||||
*/var qd;function fg(){if(qd)return Tn;qd=1;var i=dc(),s=dg();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=new Set,d={};function p(e,t){g(e,t),g(e+"Capture",t)}function g(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,v=/^[: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]*$/,E={},z={};function T(e){return x.call(z,e)?!0:x.call(E,e)?!1:v.test(e)?z[e]=!0:(E[e]=!0,!1)}function P(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function B(e,t,n,r){if(t===null||typeof t>"u"||P(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function W(e,t,n,r,l,c,f){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=f}var Y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Y[e]=new W(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Y[t]=new W(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Y[e]=new W(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Y[e]=new W(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Y[e]=new W(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Y[e]=new W(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Y[e]=new W(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Y[e]=new W(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Y[e]=new W(e,5,!1,e.toLowerCase(),null,!1,!1)});var de=/[\-:]([a-z])/g;function ve(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(de,ve);Y[t]=new W(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(de,ve);Y[t]=new W(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(de,ve);Y[t]=new W(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Y[e]=new W(e,1,!1,e.toLowerCase(),null,!1,!1)}),Y.xlinkHref=new W("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Y[e]=new W(e,1,!1,e.toLowerCase(),null,!0,!0)});function ye(e,t,n,r){var l=Y.hasOwnProperty(t)?Y[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="nLine truncated
|
||||
`+S+e}var H=!1;function se(e,t){if(!e||H)return"";H=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(M){var r=M}Reflect.construct(e,[],t)}else{try{t.call()}catch(M){r=M}e.call(t.prototype)}else{try{throw Error()}catch(M){r=M}e()}}catch(M){if(M&&r&&typeof M.stack=="string"){for(var l=M.stack.split(`
|
||||
`),c=r.stack.split(`
|
||||
`),f=l.length-1,y=c.length-1;1<=f&&0<=y&&l[f]!==c[y];)y--;for(;1<=f&&0<=y;f--,y--)if(l[f]!==c[y]){if(f!==1||y!==1)do if(f--,y--,0>y||l[f]!==c[y]){var T=`
|
||||
`+l[f].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),T}while(1<=f&&0<=y);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?x(e):""}function ye(e){switch(e.tag){case 5:return x(e.type);case 16:return x("Lazy");case 13:return x("Suspense");case 19:return x("SuspenseList");case 0:case 2:case 15:return e=$(e.type,!1),e;case 11:return e=$(e.type.render,!1),e;case 1:return e=$(e.type,!0),e;default:return""}}function Ne(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ie:return"Fragment";case M:return"Portal";case ue:return"Profiler";case J:return"StrictMode";case Qe:return"Suspense";case Ue:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ze:return(e.displayName||"Context")+".Consumer";case Be:return(e._context.displayName||"Context")+".Provider";case Ie:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tt:return t=e.displayName||null,t!==null?t:Ne(e.type)||"Memo";case Xe:t=e._payload,e=e._init;try{return Ne(e(t))}catch{}}return null}function ce(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(t);case 8:return t===J?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ae(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Oe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ze(e){var t=Oe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(f){r=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(f){r=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ke(e){e._valueTracker||(e._valueTracker=ze(e))}function ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Oe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ye(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function wt(e,t){var n=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ee(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ae(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function mn(e,t){t=t.checked,t!=null&&ve(e,"checked",t,!1)}function vn(e,t){mn(e,t);var n=ae(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yn(e,t.type,n):t.hasOwnProperty("defaultValue")&&yn(e,t.type,ae(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ut(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function yn(e,t,n){(t!=="number"||Ye(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ft=Array.isArray;function nn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ae(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function _n(e,t){if(t.dangerouslySetInLine truncated
|
||||
`).replace(vh,"")}function eo(e,t,n){if(t=su(t),su(e)!==t&&n)throw Error(o(425))}function to(){}var Il=null,Ol=null;function Ml(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jl=typeof setTimeout=="function"?setTimeout:void 0,yh=typeof clearTimeout=="function"?clearTimeout:void 0,ou=typeof Promise=="function"?Promise:void 0,xh=typeof queueMicrotask=="function"?queueMicrotask:typeof ou<"u"?function(e){return ou.resolve(null).then(e).catch(wh)}:jl;function wh(e){setTimeout(function(){throw e})}function Ll(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),ts(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);ts(t)}function Dr(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==="$?")break;if(t==="/$")return null}}return e}function lu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ri=Math.random().toString(36).slice(2),ar="__reactFiber$"+Ri,fs="__reactProps$"+Ri,wr="__reactContainer$"+Ri,Dl="__reactEvents$"+Ri,Eh="__reactListeners$"+Ri,Sh="__reactHandles$"+Ri;function ti(e){var t=e[ar];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wr]||n[ar]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lu(e);e!==null;){if(n=e[ar])return n;e=lu(e)}return t}e=n,n=e.parentNode}return null}function ps(e){return e=e[ar]||e[wr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ci(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function no(e){return e[fs]||null}var zl=[],Ii=-1;function zr(e){return{current:e}}function xt(e){0>Ii||(e.current=zl[Ii],zl[Ii]=null,Ii--)}function mt(e,t){Ii++,zl[Ii]=e.current,e.current=t}var Pr={},an=zr(Pr),wn=zr(!1),ni=Pr;function Oi(e,t){var n=e.type.contextTypes;if(!n)return Pr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},c;for(c in n)l[c]=t[c];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function En(e){return e=e.childContextTypes,e!=null}function ro(){xt(wn),xt(an)}function au(e,t,n){if(an.current!==Pr)throw Error(o(168));mt(an,t),mt(wn,n)}function cu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(o(108,ce(e)||"Unknown",l));return X({},n,r)}function io(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pr,ni=an.current,mt(an,e),mt(wn,wn.current),!0}function uu(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=cu(e,t,ni),r.__reactInternalMemoizedMergedChildContext=e,xt(wn),xt(an),mt(an,e)):xt(wn),mt(wn,n)}var Er=null,so=!1,Pl=!1;function du(e){Er===null?Er=[e]:Er.push(e)}function kh(e){so=!0,du(e)}function Br(){if(!Pl&&Er!==null){Pl=!0;var e=0,t=h;try{var n=Er;for(h=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Er=null,so=!1}catch(l){throw Er!==null&&(Er=Er.slice(e+1)),yi(Cn,Br),l}finally{h=t,Pl=!1}}return null}var Mi=[],ji=0,oo=null,lo=0,Bn=[],Un=0,ri=null,Sr=1,kr="";function ii(e,t){Mi[ji++]=lo,Mi[ji++]=oo,oo=e,lo=t}function fu(e,t,n){Bn[Un++]=Sr,Bn[Un++]=kr,Bn[Un++]=ri,ri=e;var r=Sr;e=kr;var l=32-dt(r)-1;r&=~(1<<l),n+=1;var c=32-dt(t)+l;if(30<c){var f=l-l%5;c=(r&(1<<f)-1).toString(32),r>>=f,l-=f,Sr=1<<32-dt(t)+l|n<<l|r,kr=c+e}else Sr=1<<c|n<<l|r,kr=e}function Bl(e){e.return!==null&&(ii(e,1),fu(e,1,0))}function Ul(e){for(;e===oo;)oo=Mi[--ji],Mi[ji]=null,lo=Mi[--ji],Mi[ji]=null;for(;e===ri;)ri=Bn[--Un],Bn[Un]=null,kr=Bn[--Un],Bn[Un]=null,Sr=Bn[--Un],Bn[Un]=null}var Mn=null,jn=null,St=!1,Qn=null;function pu(e,t){var n=Gn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function hu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mn=e,jn=Dr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mn=e,jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ri!==null?{id:Sr,overflow:kr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Gn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mn=e,jn=null,!0):!1;default:return!1}}function Fl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wl(e){if(St){var t=jn;if(t){var n=t;if(!hu(e,t)){if(Fl(e))throw Error(o(418));t=Dr(n.nextSibling);var r=Mn;t&&hu(e,t)?pu(r,n):(e.flags=e.flags&-4097|2,St=!1,Mn=e)}}else{if(Fl(e))throw Error(o(418));e.flags=e.flags&-4097|2,St=!1,Mn=e}}}function gu(e){for(e=e.retLine truncated
|
||||
`),f=l.length-1,y=c.length-1;1<=f&&0<=y&&l[f]!==c[y];)y--;for(;1<=f&&0<=y;f--,y--)if(l[f]!==c[y]){if(f!==1||y!==1)do if(f--,y--,0>y||l[f]!==c[y]){var b=`
|
||||
`+l[f].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),b}while(1<=f&&0<=y);break}}}finally{H=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_(e):""}function Ne(e){switch(e.tag){case 5:return _(e.type);case 16:return _("Lazy");case 13:return _("Suspense");case 19:return _("SuspenseList");case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return""}}function _e(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case re:return"Fragment";case j:return"Portal";case ce:return"Profiler";case te:return"StrictMode";case Qe:return"Suspense";case Ke:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ze:return(e.displayName||"Context")+".Consumer";case Be:return(e._context.displayName||"Context")+".Provider";case Me:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tt:return t=e.displayName||null,t!==null?t:_e(e.type)||"Memo";case Xe:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}function ue(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _e(t);case 8:return t===te?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function O(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Re(e){var t=pe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(f){r=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(f){r=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pe(e){e._valueTracker||(e._valueTracker=Re(e))}function it(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fe(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dt(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function xe(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=O(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function mn(e,t){t=t.checked,t!=null&&ye(e,"checked",t,!1)}function vn(e,t){mn(e,t);var n=O(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yn(e,t.type,n):t.hasOwnProperty("defaultValue")&&yn(e,t.type,O(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ut(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function yn(e,t,n){(t!=="number"||Fe(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ft=Array.isArray;function nn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+O(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function _n(e,t){if(t.dangerouslySetInLine truncated
|
||||
`).replace(vh,"")}function eo(e,t,n){if(t=su(t),su(e)!==t&&n)throw Error(o(425))}function to(){}var Il=null,Ol=null;function Ml(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jl=typeof setTimeout=="function"?setTimeout:void 0,yh=typeof clearTimeout=="function"?clearTimeout:void 0,ou=typeof Promise=="function"?Promise:void 0,xh=typeof queueMicrotask=="function"?queueMicrotask:typeof ou<"u"?function(e){return ou.resolve(null).then(e).catch(wh)}:jl;function wh(e){setTimeout(function(){throw e})}function Ll(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),ts(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);ts(t)}function Dr(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==="$?")break;if(t==="/$")return null}}return e}function lu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Ri=Math.random().toString(36).slice(2),ar="__reactFiber$"+Ri,fs="__reactProps$"+Ri,wr="__reactContainer$"+Ri,Dl="__reactEvents$"+Ri,Eh="__reactListeners$"+Ri,Sh="__reactHandles$"+Ri;function ti(e){var t=e[ar];if(t)return t;for(var n=e.parentNode;n;){if(t=n[wr]||n[ar]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lu(e);e!==null;){if(n=e[ar])return n;e=lu(e)}return t}e=n,n=e.parentNode}return null}function ps(e){return e=e[ar]||e[wr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ci(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function no(e){return e[fs]||null}var zl=[],Ii=-1;function zr(e){return{current:e}}function wt(e){0>Ii||(e.current=zl[Ii],zl[Ii]=null,Ii--)}function vt(e,t){Ii++,zl[Ii]=e.current,e.current=t}var Pr={},an=zr(Pr),wn=zr(!1),ni=Pr;function Oi(e,t){var n=e.type.contextTypes;if(!n)return Pr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},c;for(c in n)l[c]=t[c];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function En(e){return e=e.childContextTypes,e!=null}function ro(){wt(wn),wt(an)}function au(e,t,n){if(an.current!==Pr)throw Error(o(168));vt(an,t),vt(wn,n)}function cu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(o(108,ue(e)||"Unknown",l));return V({},n,r)}function io(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pr,ni=an.current,vt(an,e),vt(wn,wn.current),!0}function uu(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=cu(e,t,ni),r.__reactInternalMemoizedMergedChildContext=e,wt(wn),wt(an),vt(an,e)):wt(wn),vt(wn,n)}var Er=null,so=!1,Pl=!1;function du(e){Er===null?Er=[e]:Er.push(e)}function kh(e){so=!0,du(e)}function Br(){if(!Pl&&Er!==null){Pl=!0;var e=0,t=h;try{var n=Er;for(h=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Er=null,so=!1}catch(l){throw Er!==null&&(Er=Er.slice(e+1)),yi(Cn,Br),l}finally{h=t,Pl=!1}}return null}var Mi=[],ji=0,oo=null,lo=0,Bn=[],Un=0,ri=null,Sr=1,kr="";function ii(e,t){Mi[ji++]=lo,Mi[ji++]=oo,oo=e,lo=t}function fu(e,t,n){Bn[Un++]=Sr,Bn[Un++]=kr,Bn[Un++]=ri,ri=e;var r=Sr;e=kr;var l=32-pt(r)-1;r&=~(1<<l),n+=1;var c=32-pt(t)+l;if(30<c){var f=l-l%5;c=(r&(1<<f)-1).toString(32),r>>=f,l-=f,Sr=1<<32-pt(t)+l|n<<l|r,kr=c+e}else Sr=1<<c|n<<l|r,kr=e}function Bl(e){e.return!==null&&(ii(e,1),fu(e,1,0))}function Ul(e){for(;e===oo;)oo=Mi[--ji],Mi[ji]=null,lo=Mi[--ji],Mi[ji]=null;for(;e===ri;)ri=Bn[--Un],Bn[Un]=null,kr=Bn[--Un],Bn[Un]=null,Sr=Bn[--Un],Bn[Un]=null}var Mn=null,jn=null,St=!1,Qn=null;function pu(e,t){var n=Gn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function hu(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mn=e,jn=Dr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mn=e,jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ri!==null?{id:Sr,overflow:kr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Gn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mn=e,jn=null,!0):!1;default:return!1}}function Fl(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wl(e){if(St){var t=jn;if(t){var n=t;if(!hu(e,t)){if(Fl(e))throw Error(o(418));t=Dr(n.nextSibling);var r=Mn;t&&hu(e,t)?pu(r,n):(e.flags=e.flags&-4097|2,St=!1,Mn=e)}}else{if(Fl(e))throw Error(o(418));e.flags=e.flags&-4097|2,St=!1,Mn=e}}}function gu(e){for(e=e.retLine truncated
|
||||
Error generating stack: `+c.message+`
|
||||
`+c.stack}return{value:e,source:t,stack:l,digest:null}}function ua(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function da(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Oh=typeof WeakMap=="function"?WeakMap:Map;function Xu(e,t,n){n=Tr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_o||(_o=!0,Na=r),da(e,t)},n}function Vu(e,t,n){n=Tr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){da(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){da(e,t),typeof r!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var f=t.stack;this.componentDidCatch(t.value,{componentStack:f!==null?f:""})}),n}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Oh;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=qh.bind(null,e,t,n),t.then(e,e))}function Ju(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $u(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Tr(-1,1),t.tag=2,Fr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Mh=le.ReactCurrentOwner,Sn=!1;function fn(e,t,n,r){t.child=e===null?xu(t,null,n,r):Di(t,e.child,n,r)}function ed(e,t,n,r,l){n=n.render;var c=t.ref;return Pi(t,l),r=na(e,t,n,r,c,l),n=ra(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Nr(e,t,l)):(St&&n&&Bl(t),t.flags|=1,fn(e,t,r,l),t.child)}function td(e,t,n,r,l){if(e===null){var c=n.type;return typeof c=="function"&&!Ma(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,nd(e,t,c,r,l)):(e=jo(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&l)===0){var f=c.memoizedProps;if(n=n.compare,n=n!==null?n:ls,n(f,r)&&e.ref===t.ref)return Nr(e,t,l)}return t.flags|=1,e=Kr(c,r),e.ref=t.ref,e.return=t,t.child=e}function nd(e,t,n,r,l){if(e!==null){var c=e.memoizedProps;if(ls(c,r)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=r=c,(e.lanes&l)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,Nr(e,t,l)}return fa(e,t,n,r,l)}function rd(e,t,n){var r=t.pendingProps,l=r.children,c=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},mt(Wi,Ln),Ln|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,mt(Wi,Ln),Ln|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=c!==null?c.baseLanes:n,mt(Wi,Ln),Ln|=r}else c!==null?(r=c.baseLanes|n,t.memoizedState=null):r=n,mt(Wi,Ln),Ln|=r;return fn(e,t,l,n),t.child}function id(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fa(e,t,n,r,l){var c=En(n)?ni:an.current;return c=Oi(t,c),Pi(t,l),n=na(e,t,n,r,c,l),r=ra(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Nr(e,t,l)):(St&&r&&Bl(t),t.flags|=1,fn(e,t,n,l),t.child)}function sd(e,t,n,r,l){if(En(n)){var c=!0;io(t)}else c=!1;if(Pi(t,l),t.stateNode===null)ko(e,t),Ku(t,n,r),ca(t,n,r,l),r=!0;else if(e===null){var f=t.stateNode,y=t.memoizedProps;f.props=y;var T=f.context,O=n.contextType;typeof O=="object"&&O!==null?O=Fn(O):(O=En(n)?ni:an.current,O=Oi(t,O));var Z=n.getDerivedStateFromProps,Q=typeof Z=="function"||typeof f.getSnapshotBeforeUpdate=="function";Q||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==r||T!==O)&&Zu(t,f,r,O),Ur=!1;var K=t.memoizedState;f.state=K,ho(t,r,f,l),T=t.memoizedState,y!==r||K!==T||wn.current||Ur?(typeof Z=="function"&&(aa(t,n,Z,r),T=t.memoizedState),(y=Ur||qu(t,n,y,r,K,T,O))?(Q||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=T),f.props=r,f.state=T,f.context=O,r=y):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,Eu(e,t),y=t.memoizedProps,O=t.type===t.elementType?y:Jn(t.type,y),f.props=O,Q=t.pendingProps,K=f.context,T=n.contextType,typeof T=="object"&&T!==null?T=Fn(T):(T=En(n)?ni:an.current,T=Oi(t,T));var xe=n.getDerivedStateFromProps;(Z=typeof xe=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==Q||K!==T)&&Zu(t,f,r,T),Ur=!1,K=t.memoizedState,f.state=K,ho(t,r,Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xg(i,s){return qg(i)||Kg(i,s)||Vg(i,s)||Zg()}function Vg(i,s){if(i){if(typeof i=="string")return Vd(i,s);var o={}.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Vd(i,s):void 0}}const Hf=Object.entries,Qd=Object.setPrototypeOf,Qg=Object.isFrozen,Jg=Object.getPrototypeOf,$g=Object.getOwnPropertyDescriptor;let en=Object.freeze,tn=Object.seal,Xi=Object.create,Gf=typeof Reflect<"u"&&Reflect,nc=Gf.apply,rc=Gf.construct;en||(en=function(s){return s});tn||(tn=function(s){return s});nc||(nc=function(s,o){for(var u=arguments.length,d=new Array(u>2?u-2:0),p=2;p<u;p++)d[p-2]=arguments[p];return s.apply(o,d)});rc||(rc=function(s){for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return new s(...u)});const Yi=jt(Array.prototype.forEach),em=jt(Array.prototype.lastIndexOf),Jd=jt(Array.prototype.pop),qi=jt(Array.prototype.push),tm=jt(Array.prototype.splice),Qr=Array.isArray,Ds=jt(String.prototype.toLowerCase),Ya=jt(String.prototype.toString),$d=jt(String.prototype.match),Rs=jt(String.prototype.replace),ef=jt(String.prototype.indexOf),nm=jt(String.prototype.trim),rm=jt(Number.prototype.toString),im=jt(Boolean.prototype.toString),tf=typeof BigInt>"u"?null:jt(BigInt.prototype.toString),nf=typeof Symbol>"u"?null:jt(Symbol.prototype.toString),Zt=jt(Object.prototype.hasOwnProperty),Cs=jt(Object.prototype.toString),Kt=jt(RegExp.prototype.test),pi=sm(TypeError);function jt(i){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return nc(i,s,u)}}function sm(i){return function(){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];return rc(i,o)}}function et(i,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ds;if(Qd&&Qd(i,null),!Qr(s))return i;let u=s.length;for(;u--;){let d=s[u];if(typeof d=="string"){const p=o(d);p!==d&&(Qg(s)||(s[u]=p),d=p)}i[d]=!0}return i}function om(i){for(let s=0;s<i.length;s++)Zt(i,s)||(i[s]=null);return i}function hn(i){const s=Xi(null);for(const u of Hf(i)){var o=Xg(u,2);const d=o[0],p=o[1];Zt(i,d)&&(Qr(p)?s[d]=om(p):p&&typeof p=="object"&&p.constructor===Object?s[d]=hn(p):s[d]=p)}return s}function lm(i){switch(typeof i){case"string":return i;case"number":return rm(i);case"boolean":return im(i);case"bigint":return tf?tf(i):"0";case"symbol":return nf?nf(i):"Symbol()";case"undefined":return Cs(i);case"function":case"object":{if(i===null)return Cs(i);const s=i,o=pr(s,"toString");if(typeof o=="function"){const u=o(s);return typeof u=="string"?u:Cs(u)}return Cs(i)}default:return Cs(i)}}function pr(i,s){for(;i!==null;){const u=$g(i,s);if(u){if(u.get)return jt(u.get);if(typeof u.value=="function")return jt(u.value)}i=Jg(i)}function o(){return null}return o}function am(i){try{return Kt(i,""),!0}catch{return!1}}const rf=en(["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"]),qa=en(["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"]),Ka=en(["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"]),cm=en(["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","sLine truncated
|
||||
`+Ot),H&&(Ot=Ge(Ot)),M&&nr?Ie(Ot):Ot},s.setConfig=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sr(te),ge=!0,We=Ke,Xt=Ye},s.clearConfig=function(){zt=null,ge=!1,We=null,Xt=null,M=J,ie=""},s.isValidAttribute=function(te,h,A){zt||sr({});const q=at(te),se=at(h);return lr(q,se,A)},s.addHook=function(te,h){typeof h=="function"&&Zt(k,te)&&qi(k[te],h)},s.removeHook=function(te,h){if(Zt(k,te)){if(h!==void 0){const A=em(k[te],h);return A===-1?void 0:tm(k[te],A,1)[0]}return Jd(k[te])}},s.removeHooks=function(te){Zt(k,te)&&(k[te]=[])},s.removeAllHooks=function(){k=df()},s}var bm=Yf(),Va,ff;function Tm(){if(ff)return Va;ff=1;function i(E){return E instanceof Map?E.clear=E.delete=E.set=function(){throw new Error("map is read-only")}:E instanceof Set&&(E.add=E.clear=E.delete=function(){throw new Error("set is read-only")}),Object.freeze(E),Object.getOwnPropertyNames(E).forEach(F=>{const re=E[F],_e=typeof re;(_e==="object"||_e==="function")&&!Object.isFrozen(re)&&i(re)}),E}class s{constructor(F){F.data===void 0&&(F.data={}),this.data=F.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(E){return E.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(E,...F){const re=Object.create(null);for(const _e in E)re[_e]=E[_e];return F.forEach(function(_e){for(const Je in _e)re[Je]=_e[Je]}),re}const d="</span>",p=E=>!!E.scope,g=(E,{prefix:F})=>{if(E.startsWith("language:"))return E.replace("language:","language-");if(E.includes(".")){const re=E.split(".");return[`${F}${re.shift()}`,...re.map((_e,Je)=>`${_e}${"_".repeat(Je+1)}`)].join(" ")}return`${F}${E}`};class m{constructor(F,re){this.buffer="",this.classPrefix=re.classPrefix,F.walk(this)}addText(F){this.buffer+=o(F)}openNode(F){if(!p(F))return;const re=g(F.scope,{prefix:this.classPrefix});this.span(re)}closeNode(F){p(F)&&(this.buffer+=d)}value(){return this.buffer}span(F){this.buffer+=`<span class="${F}">`}}const w=(E={})=>{const F={children:[]};return Object.assign(F,E),F};class v{constructor(){this.rootNode=w(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(F){this.top.children.push(F)}openNode(F){const re=w({scope:F});this.add(re),this.stack.push(re)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(F){return this.constructor._walk(F,this.rootNode)}static _walk(F,re){return typeof re=="string"?F.addText(re):re.children&&(F.openNode(re),re.children.forEach(_e=>this._walk(F,_e)),F.closeNode(re)),F}static _collapse(F){typeof F!="string"&&F.children&&(F.children.every(re=>typeof re=="string")?F.children=[F.children.join("")]:F.children.forEach(re=>{v._collapse(re)}))}}class S extends v{constructor(F){super(),this.options=F}addText(F){F!==""&&this.add(F)}startScope(F){this.openNode(F)}endScope(){this.closeNode()}__addSublanguage(F,re){const _e=F.root;re&&(_e.scope=`language:${re}`),this.add(_e)}toHTML(){return new m(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function D(E){return E?typeof E=="string"?E:E.source:null}function N(E){return W("(?=",E,")")}function P(E){return W("(?:",E,")*")}function B(E){return W("(?:",E,")?")}function W(...E){return E.map(re=>D(re)).join("")}function G(E){const F=E[E.length-1];return typeof F=="object"&&F.constructor===Object?(E.splice(E.length-1,1),F):{}}function pe(...E){return"("+(G(E).capture?"":"?:")+E.map(_e=>D(_e)).join("|")+")"}function me(E){return new RegExp(E.toString()+"|").exec("").length-1}function ve(E,F){const re=E&&E.exec(F);return re&&re.index===0}const le=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function he(E,{joinWith:F}){let re=0;return E.map(_e=>{re+=1;const Je=re;let lt=D(_e),b="";for(;lt.length>0;){const R=le.exec(lt);if(!R){b+=lt;break}b+=lt.substring(0,R.index),lt=lt.substring(R.index+R[0].length),R[0][0]==="\\"&&R[1]?b+="\\"+String(Number(R[1])+Je):(b+=R[0],R[0]==="("&&re++)}return b}).map(_e=>`(${_e})`).join(F)}const M=/\b\B/,ie="[a-zA-Z]\\w*",J="[a-zA-Z_]\\w*",ue="\\b\\d+(\\.\\d+)?",Be="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ze="\\b(0b[01]+)",Ie="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Qe=(E={})=>{const F=/^#![ ]*\//;return E.binary&&(E.begin=W(F,/.*\b/,E.binary,/\b.*/)),u({scope:"meta",begin:F,end:/$/,relevance:0,"on:begin":(re,_e)=>{re.index!==0&&_e.ignoreMatch()}},E)},Ue={begin:"\\\\[\\s\\S]",relevance:0},tt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ue]},Xe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ue]},Fe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(E,F,re={}){const _e=u({scope:"comment",begin:E,end:F,contains:[]},rLine truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),vt=ee,Ge=Re),He===void 0&&(He=!0);const dt={code:Ge,language:vt};yr("before:highlight",dt);const Vt=dt.result?dt.result:It(dt.language,dt.code,He);return Vt.code=dt.code,yr("after:highlight",Vt),Vt}function It(ee,Re,He,Ge){const vt=Object.create(null);function dt(V,fe){return V.keywords[fe]}function Vt(){if(!A.keywords){se.addText(de);return}let V=0;A.keywordPatternRe.lastIndex=0;let fe=A.keywordPatternRe.exec(de),be="";for(;fe;){be+=de.substring(V,fe.index);const $e=ln.case_insensitive?fe[0].toLowerCase():fe[0],At=dt(A,$e);if(At){const[Ht,dl]=At;if(se.addText(be),be="",vt[$e]=(vt[$e]||0)+1,vt[$e]<=rn&&(je+=dl),Ht.startsWith("_"))be+=fe[0];else{const Fs=ln.classNameAliases[Ht]||Ht;Qt(fe[0],Fs)}}else be+=fe[0];V=A.keywordPatternRe.lastIndex,fe=A.keywordPatternRe.exec(de)}be+=de.substring(V),se.addText(be)}function Pn(){if(de==="")return;let V=null;if(typeof A.subLanguage=="string"){if(!F[A.subLanguage]){se.addText(de);return}V=It(A.subLanguage,de,!0,q[A.subLanguage]),q[A.subLanguage]=V._top}else V=on(de,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(je+=V.relevance),se.__addSublanguage(V._emitter,V.language)}function gt(){A.subLanguage!=null?Pn():Vt(),de=""}function Qt(V,fe){V!==""&&(se.startScope(fe),se.addText(V),se.endScope())}function xr(V,fe){let be=1;const $e=fe.length-1;for(;be<=$e;){if(!V._emit[be]){be++;continue}const At=ln.classNameAliases[V[be]]||V[be],Ht=fe[be];At?Qt(Ht,At):(de=Ht,Vt(),de=""),be++}}function Zn(V,fe){return V.scope&&typeof V.scope=="string"&&se.openNode(ln.classNameAliases[V.scope]||V.scope),V.beginScope&&(V.beginScope._wrap?(Qt(de,ln.classNameAliases[V.beginScope._wrap]||V.beginScope._wrap),de=""):V.beginScope._multi&&(xr(V.beginScope,fe),de="")),A=Object.create(V,{parent:{value:A}}),A}function lr(V,fe,be){let $e=ve(V.endRe,be);if($e){if(V["on:end"]){const At=new s(V);V["on:end"](fe,At),At.isMatchIgnored&&($e=!1)}if($e){for(;V.endsParent&&V.parent;)V=V.parent;return V}}if(V.endsWithParent)return lr(V.parent,fe,be)}function Ji(V){return A.matcher.regexIndex===0?(de+=V[0],1):(Ot=!0,0)}function Ei(V){const fe=V[0],be=V.rule,$e=new s(be),At=[be.__beforeBegin,be["on:begin"]];for(const Ht of At)if(Ht&&(Ht(V,$e),$e.isMatchIgnored))return Ji(fe);return be.skip?de+=fe:(be.excludeBegin&&(de+=fe),gt(),!be.returnBegin&&!be.excludeBegin&&(de=fe)),Zn(be,V),be.returnBegin?0:fe.length}function ei(V){const fe=V[0],be=Re.substring(V.index),$e=lr(A,V,be);if(!$e)return zn;const At=A;A.endScope&&A.endScope._wrap?(gt(),Qt(fe,A.endScope._wrap)):A.endScope&&A.endScope._multi?(gt(),xr(A.endScope,V)):At.skip?de+=fe:(At.returnEnd||At.excludeEnd||(de+=fe),gt(),At.excludeEnd&&(de=fe));do A.scope&&se.closeNode(),!A.skip&&!A.subLanguage&&(je+=A.relevance),A=A.parent;while(A!==$e.parent);return $e.starts&&Zn($e.starts,V),At.returnEnd?0:fe.length}function Si(){const V=[];for(let fe=A;fe!==ln;fe=fe.parent)fe.scope&&V.unshift(fe.scope);V.forEach(fe=>se.openNode(fe))}let Xn={};function In(V,fe){const be=fe&&fe[0];if(de+=V,be==null)return gt(),0;if(Xn.type==="begin"&&fe.type==="end"&&Xn.index===fe.index&&be===""){if(de+=Re.slice(fe.index,fe.index+1),!Je){const $e=new Error(`0 width match regex (${ee})`);throw $e.languageName=ee,$e.badRule=Xn.rule,$e}return 1}if(Xn=fe,fe.type==="begin")return Ei(fe);if(fe.type==="illegal"&&!He){const $e=new Error('Illegal lexeme "'+be+'" for mode "'+(A.scope||"<unnamed>")+'"');throw $e.mode=A,$e}else if(fe.type==="end"){const $e=ei(fe);if($e!==zn)return $e}if(fe.type==="illegal"&&be==="")return de+=`
|
||||
`,1;if(Et>1e5&&Et>fe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return de+=be,be.length}const ln=Rn(ee);if(!ln)throw Y(lt.replace("{}",ee)),new Error('Unknown language: "'+ee+'"');const te=mr(ln);let h="",A=Ge||te;const q={},se=new R.__emitter(R);Si();let de="",je=0,nt=0,Et=0,Ot=!1;try{if(ln.__emitTokens)ln.__emitTokens(Re,se);else{for(A.matcher.considerAll();;){Et++,Ot?Ot=!1:A.matcher.considerAll(),A.matcher.lastIndex=nt;const V=A.matcher.exec(Re);if(!V)break;const fe=Re.substring(nt,V.index),be=In(fe,V);nt=V.index+be}In(Re.substring(nt))}return se.finalize(),h=se.toHTML(),{language:ee,value:h,relevance:je,illegal:!1,_emitter:se,_top:A}}catch(V){if(V.message&&V.message.includes("Illegal"))return{language:ee,value:ut(Re),illegal:!0,relevance:0,_illegalBy:{message:V.message,index:nt,context:Re.slice(nt-100,nt+100),mode:V.mode,resultSoFar:h},_emitter:se};if(Je)return{language:ee,value:ut(Re),illegal:!1,relevance:0,errorRaised:V,_emitter:se,_top:A};throw V}}function Me(ee){const Re={value:ut(ee),illegal:!1,relevance:0,_top:b,_emitter:new R.__emitter(R)};return Re._emitter.addText(ee),Re}function on(ee,Re){Re=Re||R.languages||Object.keys(F);const He=Me(ee),Ge=Re.filter(Rn).filter(wi).map(gt=>It(gt,ee,!1));Ge.unshift(He);const vt=Ge.sort((gt,Qt)=>{if(gt.relevance!==Qt.relevance)return Qt.relevance-gt.relevance;if(gt.language&&Qt.language){if(Rn(gt.language).supersetOf===Qt.language)return 1;if(Rn(Qt.language).supersetOf===gt.language)return-1}return 0}),[dt,Vt]=vt,Pn=dt;return Pn.secondBest=Vt,Pn}function xn(ee,Re,He){const Ge=Re&&re[Re]||He;ee.classList.add("hljs"),ee.classList.add(`language-${Ge}`)}function ir(ee){let Re=null;const He=we(ee);if(j(He))return;if(yr("before:highlightElement",{el:ee,language:He}),ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ee);return}if(ee.children.length>0&&(R.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ee)),R.throwUnescapedHTML))throw new Kn("One of your code blocks includes unescaped HTML.",ee.innerHTML);Re=ee;const Ge=Re.textContent,vt=He?qe(Ge,{language:He,ignoreIllegals:!0}):on(Ge);ee.innerHTML=vt.value,ee.dataset.highlighted="yes",xn(ee,He,vt.language),ee.result={language:vt.language,re:vt.relevance,relevance:vt.relevance},vt.secondBest&&(ee.secondBest={language:vt.secondBest.language,relevance:vt.secondBest.relevance}),yr("after:highlightElement",{el:ee,result:vt,text:Ge})}function at(ee){R=Dt(R,ee)}const zt=()=>{sr(),ge("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function vi(){sr(),ge("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Or=!1;function sr(){function ee(){sr()}if(document.readyState==="loading"){Or||window.addEventListener("DOMContentLoaded",ee,!1),Or=!0;return}document.querySelectorAll(R.cssSelector).forEach(ir)}function Jr(ee,Re){let He=null;try{He=Re(E)}catch(Ge){if(Y("Language definition for '{}' could not be registered.".replace("{}",ee)),Je)Y(Ge);else throw Ge;He=b}He.name||(He.name=ee),F[ee]=He,He.rawDefinition=Re.bind(null,E),He.aliases&&xi(He.aliases,{languageName:ee})}function $r(ee){delete F[ee];for(const Re of Object.keys(re))re[Re]===ee&&delete re[Re]}function yi(){return Object.keys(F)}function Rn(ee){return ee=(ee||"").toLowerCase(),F[ee]||F[re[ee]]}function xi(ee,{languageName:Re}){typeof ee=="string"&&(ee=[ee]),ee.forEach(He=>{re[He.toLowerCase()]=Re})}function wi(ee){const Re=Rn(ee);return Re&&!Re.disableAutodetect}function it(ee){ee["before:highlightBlock"]&&!ee["before:highlightElement"]&&(ee["before:highlightElement"]=Re=>{ee["before:highlightBlock"](Object.assign({block:Re.el},Re))}),ee["after:highlightBlock"]&&!ee["after:highlightElement"]&&(ee["after:highlightElement"]=Re=>{ee["after:highlightBlock"](Object.assign({block:Re.el},Re))})}function Mr(ee){it(ee),_e.push(ee)}function Cn(ee){const Re=_e.indexOf(ee);Re!==-1&&_e.splice(Re,1)}function yr(ee,Re){const He=ee;_e.forEach(function(Ge){Ge[He]&&Ge[He](Re)})}function or(ee){return ge("10.7.0","highlightBlock will be removed entirely in v12.0"),ge("10.7.0","Please use highlightElement now."),ir(ee)}Object.assign(E,{highlight:qe,highlightAuto:on,highlightAll:sr,highlightElement:ir,highlightBlock:or,configure:at,initHighlighting:zt,initHighlightingOnLoad:vi,registerLanguage:Jr,unregisterLanguage:$r,listLanguages:yi,getLanguage:Rn,registerAliases:xi,autoDetection:wi,inherit:Dt,addPlugin:Mr,removePlugin:Cn}),E.debugMode=function(){Je=!1},E.safeMode=function(){Je=!0},E.versionString=qn,E.regex={concat:W,lookahead:N,either:pe,optional:B,anyNumberOfTimes:P};for(const ee in ze)typeof ze[ee]=="object"&&i(ze[ee]);return Object.assign(E,ze),E},Nt=sn({});return Nt.newInstance=()=>sn({}),Va=Nt,Nt.HighlightJSLine truncated
|
||||
]`).replace("lheading",op).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ap=/^( {2,}|\\)\n(?!\s*$)/,mv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,al=/[\p{P}\p{S}]/u,yc=/[\s\p{P}\p{S}]/u,cp=/[^\s\p{P}\p{S}]/u,vv=ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,yc).getRegex(),up=/(?!~)[\p{P}\p{S}]/u,yv=/(?!~)[\s\p{P}\p{S}]/u,xv=/(?:[^\s\p{P}\p{S}]|~)/u,wv=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,dp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ev=ct(dp,"u").replace(/punct/g,al).getRegex(),Sv=ct(dp,"u").replace(/punct/g,up).getRegex(),fp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kv=ct(fp,"gu").replace(/notPunctSpace/g,cp).replace(/punctSpace/g,yc).replace(/punct/g,al).getRegex(),bv=ct(fp,"gu").replace(/notPunctSpace/g,xv).replace(/punctSpace/g,yv).replace(/punct/g,up).getRegex(),Tv=ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cp).replace(/punctSpace/g,yc).replace(/punct/g,al).getRegex(),Nv=ct(/\\(punct)/,"gu").replace(/punct/g,al).getRegex(),Av=ct(/^<(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(),_v=ct(mc).replace("(?:-->|$)","-->").getRegex(),Rv=ct("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_v).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cv=ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pp=ct(/^!?\[(label)\]\[(ref)\]/).replace("label",Jo).replace("ref",gc).getRegex(),hp=ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",gc).getRegex(),Iv=ct("reflink|nolink(?!\\()","g").replace("reflink",pp).replace("nolink",hp).getRegex(),xc={_backpedal:Ps,anyPunctuation:Nv,autolink:Av,blockSkip:wv,br:ap,code:gv,del:Ps,emStrongLDelim:Ev,emStrongRDelimAst:kv,emStrongRDelimUnd:Tv,escape:hv,link:Cv,nolink:hp,punctuation:vv,reflink:pp,reflinkSearch:Iv,tag:Rv,text:mv,url:Ps},Ov={...xc,link:ct(/^!?\[(label)\]\((.*?)\)/).replace("label",Jo).getRegex(),reflink:ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jo).getRegex()},ic={...xc,emStrongRDelimAst:bv,emStrongLDelim:Sv,url:ct(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Mv={...ic,br:ct(ap).replace("{2,}","*").getRegex(),text:ct(ic.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:vc,gfm:fv,pedantic:pv},Is={normal:xc,gfm:ic,breaks:Mv,pedantic:Ov},jv={"&":"&","<":"<",">":">",'"':""","'":"'"},mf=i=>jv[i];function hr(i,s){if(s){if(gn.escapeTest.test(i))return i.replace(gn.escapeReplace,mf)}else if(gn.escapeTestNoEncode.test(i))return i.replace(gn.escapeReplaceNoEncode,mf);return i}function vf(i){try{i=encodeURI(i).replace(gn.percentDecode,"%")}catch{return null}return i}function yf(i,s){var p;const o=i.replace(gn.findPipe,(g,m,w)=>{let v=!1,S=m;for(;--S>=0&&w[S]==="\\";)v=!v;return v?"|":" |"}),u=o.split(gn.splitPipe);let d=0;if(u[0].trim()||u.shift(),u.length>0&&!((p=u.at(-1))!=null&&p.trim())&&u.pop(),s)if(u.length>s)u.splice(s);else for(;u.length<s;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(gn.slashPipe,"|");return u}function Os(i,s,o){const u=i.length;if(u===0)return"";let d=0;for(;d<u&&i.charAt(u-d-1)===s;)d++;return i.slice(0,u-d)}function Lv(i,s){if(i.indexOf(s[1])===-1)return-1;let o=0;for(let u=0;u<i.length;u++)if(i[u]==="\\")u++;else if(i[u]===s[0])o++;else if(i[u]===s[1]Line truncated
|
||||
`+c.stack}return{value:e,source:t,stack:l,digest:null}}function ua(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function da(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Oh=typeof WeakMap=="function"?WeakMap:Map;function Xu(e,t,n){n=Tr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){_o||(_o=!0,Na=r),da(e,t)},n}function Vu(e,t,n){n=Tr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){da(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(n.callback=function(){da(e,t),typeof r!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var f=t.stack;this.componentDidCatch(t.value,{componentStack:f!==null?f:""})}),n}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Oh;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=qh.bind(null,e,t,n),t.then(e,e))}function Ju(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function $u(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Tr(-1,1),t.tag=2,Fr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Mh=ae.ReactCurrentOwner,Sn=!1;function fn(e,t,n,r){t.child=e===null?xu(t,null,n,r):Di(t,e.child,n,r)}function ed(e,t,n,r,l){n=n.render;var c=t.ref;return Pi(t,l),r=na(e,t,n,r,c,l),n=ra(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Nr(e,t,l)):(St&&n&&Bl(t),t.flags|=1,fn(e,t,r,l),t.child)}function td(e,t,n,r,l){if(e===null){var c=n.type;return typeof c=="function"&&!Ma(c)&&c.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=c,nd(e,t,c,r,l)):(e=jo(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&l)===0){var f=c.memoizedProps;if(n=n.compare,n=n!==null?n:ls,n(f,r)&&e.ref===t.ref)return Nr(e,t,l)}return t.flags|=1,e=Kr(c,r),e.ref=t.ref,e.return=t,t.child=e}function nd(e,t,n,r,l){if(e!==null){var c=e.memoizedProps;if(ls(c,r)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=r=c,(e.lanes&l)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,Nr(e,t,l)}return fa(e,t,n,r,l)}function rd(e,t,n){var r=t.pendingProps,l=r.children,c=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},vt(Wi,Ln),Ln|=n;else{if((n&1073741824)===0)return e=c!==null?c.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,vt(Wi,Ln),Ln|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=c!==null?c.baseLanes:n,vt(Wi,Ln),Ln|=r}else c!==null?(r=c.baseLanes|n,t.memoizedState=null):r=n,vt(Wi,Ln),Ln|=r;return fn(e,t,l,n),t.child}function id(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fa(e,t,n,r,l){var c=En(n)?ni:an.current;return c=Oi(t,c),Pi(t,l),n=na(e,t,n,r,c,l),r=ra(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Nr(e,t,l)):(St&&r&&Bl(t),t.flags|=1,fn(e,t,n,l),t.child)}function sd(e,t,n,r,l){if(En(n)){var c=!0;io(t)}else c=!1;if(Pi(t,l),t.stateNode===null)ko(e,t),Ku(t,n,r),ca(t,n,r,l),r=!0;else if(e===null){var f=t.stateNode,y=t.memoizedProps;f.props=y;var b=f.context,M=n.contextType;typeof M=="object"&&M!==null?M=Fn(M):(M=En(n)?ni:an.current,M=Oi(t,M));var X=n.getDerivedStateFromProps,J=typeof X=="function"||typeof f.getSnapshotBeforeUpdate=="function";J||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==r||b!==M)&&Zu(t,f,r,M),Ur=!1;var Z=t.memoizedState;f.state=Z,ho(t,r,f,l),b=t.memoizedState,y!==r||Z!==b||wn.current||Ur?(typeof X=="function"&&(aa(t,n,X,r),b=t.memoizedState),(y=Ur||qu(t,n,y,r,Z,b,M))?(J||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=b),f.props=r,f.state=b,f.context=M,r=y):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,Eu(e,t),y=t.memoizedProps,M=t.type===t.elementType?y:Jn(t.type,y),f.props=M,J=t.pendingProps,Z=f.context,b=n.contextType,typeof b=="object"&&b!==null?b=Fn(b):(b=En(n)?ni:an.current,b=Oi(t,b));var we=n.getDerivedStateFromProps;(X=typeof we=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(y!==J||Z!==b)&&Zu(t,f,r,b),Ur=!1,Z=t.memoizedState,f.state=Z,ho(t,r,Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xg(i,s){return qg(i)||Kg(i,s)||Vg(i,s)||Zg()}function Vg(i,s){if(i){if(typeof i=="string")return Vd(i,s);var o={}.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Vd(i,s):void 0}}const Hf=Object.entries,Qd=Object.setPrototypeOf,Qg=Object.isFrozen,Jg=Object.getPrototypeOf,$g=Object.getOwnPropertyDescriptor;let en=Object.freeze,tn=Object.seal,Xi=Object.create,Gf=typeof Reflect<"u"&&Reflect,nc=Gf.apply,rc=Gf.construct;en||(en=function(s){return s});tn||(tn=function(s){return s});nc||(nc=function(s,o){for(var u=arguments.length,d=new Array(u>2?u-2:0),p=2;p<u;p++)d[p-2]=arguments[p];return s.apply(o,d)});rc||(rc=function(s){for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return new s(...u)});const Yi=jt(Array.prototype.forEach),em=jt(Array.prototype.lastIndexOf),Jd=jt(Array.prototype.pop),qi=jt(Array.prototype.push),tm=jt(Array.prototype.splice),Qr=Array.isArray,Ds=jt(String.prototype.toLowerCase),Ya=jt(String.prototype.toString),$d=jt(String.prototype.match),Rs=jt(String.prototype.replace),ef=jt(String.prototype.indexOf),nm=jt(String.prototype.trim),rm=jt(Number.prototype.toString),im=jt(Boolean.prototype.toString),tf=typeof BigInt>"u"?null:jt(BigInt.prototype.toString),nf=typeof Symbol>"u"?null:jt(Symbol.prototype.toString),Zt=jt(Object.prototype.hasOwnProperty),Cs=jt(Object.prototype.toString),Kt=jt(RegExp.prototype.test),pi=sm(TypeError);function jt(i){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var o=arguments.length,u=new Array(o>1?o-1:0),d=1;d<o;d++)u[d-1]=arguments[d];return nc(i,s,u)}}function sm(i){return function(){for(var s=arguments.length,o=new Array(s),u=0;u<s;u++)o[u]=arguments[u];return rc(i,o)}}function et(i,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ds;if(Qd&&Qd(i,null),!Qr(s))return i;let u=s.length;for(;u--;){let d=s[u];if(typeof d=="string"){const p=o(d);p!==d&&(Qg(s)||(s[u]=p),d=p)}i[d]=!0}return i}function om(i){for(let s=0;s<i.length;s++)Zt(i,s)||(i[s]=null);return i}function hn(i){const s=Xi(null);for(const u of Hf(i)){var o=Xg(u,2);const d=o[0],p=o[1];Zt(i,d)&&(Qr(p)?s[d]=om(p):p&&typeof p=="object"&&p.constructor===Object?s[d]=hn(p):s[d]=p)}return s}function lm(i){switch(typeof i){case"string":return i;case"number":return rm(i);case"boolean":return im(i);case"bigint":return tf?tf(i):"0";case"symbol":return nf?nf(i):"Symbol()";case"undefined":return Cs(i);case"function":case"object":{if(i===null)return Cs(i);const s=i,o=pr(s,"toString");if(typeof o=="function"){const u=o(s);return typeof u=="string"?u:Cs(u)}return Cs(i)}default:return Cs(i)}}function pr(i,s){for(;i!==null;){const u=$g(i,s);if(u){if(u.get)return jt(u.get);if(typeof u.value=="function")return jt(u.value)}i=Jg(i)}function o(){return null}return o}function am(i){try{return Kt(i,""),!0}catch{return!1}}const rf=en(["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"]),qa=en(["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"]),Ka=en(["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"]),cm=en(["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","sLine truncated
|
||||
`+Ot),G&&(Ot=Ye(Ot)),j&&nr?Me(Ot):Ot},s.setConfig=function(){let ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sr(ee),me=!0,He=Pe,Xt=Fe},s.clearConfig=function(){zt=null,me=!1,He=null,Xt=null,j=te,re=""},s.isValidAttribute=function(ee,h,N){zt||sr({});const K=ct(ee),oe=ct(h);return lr(K,oe,N)},s.addHook=function(ee,h){typeof h=="function"&&Zt(S,ee)&&qi(S[ee],h)},s.removeHook=function(ee,h){if(Zt(S,ee)){if(h!==void 0){const N=em(S[ee],h);return N===-1?void 0:tm(S[ee],N,1)[0]}return Jd(S[ee])}},s.removeHooks=function(ee){Zt(S,ee)&&(S[ee]=[])},s.removeAllHooks=function(){S=df()},s}var bm=Yf(),Va,ff;function Tm(){if(ff)return Va;ff=1;function i(w){return w instanceof Map?w.clear=w.delete=w.set=function(){throw new Error("map is read-only")}:w instanceof Set&&(w.add=w.clear=w.delete=function(){throw new Error("set is read-only")}),Object.freeze(w),Object.getOwnPropertyNames(w).forEach(F=>{const ie=w[F],Ce=typeof ie;(Ce==="object"||Ce==="function")&&!Object.isFrozen(ie)&&i(ie)}),w}class s{constructor(F){F.data===void 0&&(F.data={}),this.data=F.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function o(w){return w.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(w,...F){const ie=Object.create(null);for(const Ce in w)ie[Ce]=w[Ce];return F.forEach(function(Ce){for(const Je in Ce)ie[Je]=Ce[Je]}),ie}const d="</span>",p=w=>!!w.scope,g=(w,{prefix:F})=>{if(w.startsWith("language:"))return w.replace("language:","language-");if(w.includes(".")){const ie=w.split(".");return[`${F}${ie.shift()}`,...ie.map((Ce,Je)=>`${Ce}${"_".repeat(Je+1)}`)].join(" ")}return`${F}${w}`};class m{constructor(F,ie){this.buffer="",this.classPrefix=ie.classPrefix,F.walk(this)}addText(F){this.buffer+=o(F)}openNode(F){if(!p(F))return;const ie=g(F.scope,{prefix:this.classPrefix});this.span(ie)}closeNode(F){p(F)&&(this.buffer+=d)}value(){return this.buffer}span(F){this.buffer+=`<span class="${F}">`}}const x=(w={})=>{const F={children:[]};return Object.assign(F,w),F};class v{constructor(){this.rootNode=x(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(F){this.top.children.push(F)}openNode(F){const ie=x({scope:F});this.add(ie),this.stack.push(ie)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(F){return this.constructor._walk(F,this.rootNode)}static _walk(F,ie){return typeof ie=="string"?F.addText(ie):ie.children&&(F.openNode(ie),ie.children.forEach(Ce=>this._walk(F,Ce)),F.closeNode(ie)),F}static _collapse(F){typeof F!="string"&&F.children&&(F.children.every(ie=>typeof ie=="string")?F.children=[F.children.join("")]:F.children.forEach(ie=>{v._collapse(ie)}))}}class E extends v{constructor(F){super(),this.options=F}addText(F){F!==""&&this.add(F)}startScope(F){this.openNode(F)}endScope(){this.closeNode()}__addSublanguage(F,ie){const Ce=F.root;ie&&(Ce.scope=`language:${ie}`),this.add(Ce)}toHTML(){return new m(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function z(w){return w?typeof w=="string"?w:w.source:null}function T(w){return W("(?=",w,")")}function P(w){return W("(?:",w,")*")}function B(w){return W("(?:",w,")?")}function W(...w){return w.map(ie=>z(ie)).join("")}function Y(w){const F=w[w.length-1];return typeof F=="object"&&F.constructor===Object?(w.splice(w.length-1,1),F):{}}function de(...w){return"("+(Y(w).capture?"":"?:")+w.map(Ce=>z(Ce)).join("|")+")"}function ve(w){return new RegExp(w.toString()+"|").exec("").length-1}function ye(w,F){const ie=w&&w.exec(F);return ie&&ie.index===0}const ae=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ge(w,{joinWith:F}){let ie=0;return w.map(Ce=>{ie+=1;const Je=ie;let at=z(Ce),k="";for(;at.length>0;){const R=ae.exec(at);if(!R){k+=at;break}k+=at.substring(0,R.index),at=at.substring(R.index+R[0].length),R[0][0]==="\\"&&R[1]?k+="\\"+String(Number(R[1])+Je):(k+=R[0],R[0]==="("&&ie++)}return k}).map(Ce=>`(${Ce})`).join(F)}const j=/\b\B/,re="[a-zA-Z]\\w*",te="[a-zA-Z_]\\w*",ce="\\b\\d+(\\.\\d+)?",Be="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ze="\\b(0b[01]+)",Me="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Qe=(w={})=>{const F=/^#![ ]*\//;return w.binary&&(w.begin=W(F,/.*\b/,w.binary,/\b.*/)),u({scope:"meta",begin:F,end:/$/,relevance:0,"on:begin":(ie,Ce)=>{ie.index!==0&&Ce.ignoreMatch()}},w)},Ke={begin:"\\\\[\\s\\S]",relevance:0},tt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ke]},Xe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ke]},We={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(w,F,ie={}){const Ce=u({scope:"comment",begin:w,end:F,contains:[]}Line truncated
|
||||
https://github.com/highlightjs/highlight.js/issues/2277`),yt=$,Ye=Ie),Ge===void 0&&(Ge=!0);const pt={code:Ye,language:yt};yr("before:highlight",pt);const Vt=pt.result?pt.result:It(pt.language,pt.code,Ge);return Vt.code=pt.code,yr("after:highlight",Vt),Vt}function It($,Ie,Ge,Ye){const yt=Object.create(null);function pt(Q,he){return Q.keywords[he]}function Vt(){if(!N.keywords){oe.addText(fe);return}let Q=0;N.keywordPatternRe.lastIndex=0;let he=N.keywordPatternRe.exec(fe),be="";for(;he;){be+=fe.substring(Q,he.index);const $e=ln.case_insensitive?he[0].toLowerCase():he[0],At=pt(N,$e);if(At){const[Ht,dl]=At;if(oe.addText(be),be="",yt[$e]=(yt[$e]||0)+1,yt[$e]<=rn&&(Le+=dl),Ht.startsWith("_"))be+=he[0];else{const Fs=ln.classNameAliases[Ht]||Ht;Qt(he[0],Fs)}}else be+=he[0];Q=N.keywordPatternRe.lastIndex,he=N.keywordPatternRe.exec(fe)}be+=fe.substring(Q),oe.addText(be)}function Pn(){if(fe==="")return;let Q=null;if(typeof N.subLanguage=="string"){if(!F[N.subLanguage]){oe.addText(fe);return}Q=It(N.subLanguage,fe,!0,K[N.subLanguage]),K[N.subLanguage]=Q._top}else Q=on(fe,N.subLanguage.length?N.subLanguage:null);N.relevance>0&&(Le+=Q.relevance),oe.__addSublanguage(Q._emitter,Q.language)}function mt(){N.subLanguage!=null?Pn():Vt(),fe=""}function Qt(Q,he){Q!==""&&(oe.startScope(he),oe.addText(Q),oe.endScope())}function xr(Q,he){let be=1;const $e=he.length-1;for(;be<=$e;){if(!Q._emit[be]){be++;continue}const At=ln.classNameAliases[Q[be]]||Q[be],Ht=he[be];At?Qt(Ht,At):(fe=Ht,Vt(),fe=""),be++}}function Zn(Q,he){return Q.scope&&typeof Q.scope=="string"&&oe.openNode(ln.classNameAliases[Q.scope]||Q.scope),Q.beginScope&&(Q.beginScope._wrap?(Qt(fe,ln.classNameAliases[Q.beginScope._wrap]||Q.beginScope._wrap),fe=""):Q.beginScope._multi&&(xr(Q.beginScope,he),fe="")),N=Object.create(Q,{parent:{value:N}}),N}function lr(Q,he,be){let $e=ye(Q.endRe,be);if($e){if(Q["on:end"]){const At=new s(Q);Q["on:end"](he,At),At.isMatchIgnored&&($e=!1)}if($e){for(;Q.endsParent&&Q.parent;)Q=Q.parent;return Q}}if(Q.endsWithParent)return lr(Q.parent,he,be)}function Ji(Q){return N.matcher.regexIndex===0?(fe+=Q[0],1):(Ot=!0,0)}function Ei(Q){const he=Q[0],be=Q.rule,$e=new s(be),At=[be.__beforeBegin,be["on:begin"]];for(const Ht of At)if(Ht&&(Ht(Q,$e),$e.isMatchIgnored))return Ji(he);return be.skip?fe+=he:(be.excludeBegin&&(fe+=he),mt(),!be.returnBegin&&!be.excludeBegin&&(fe=he)),Zn(be,Q),be.returnBegin?0:he.length}function ei(Q){const he=Q[0],be=Ie.substring(Q.index),$e=lr(N,Q,be);if(!$e)return zn;const At=N;N.endScope&&N.endScope._wrap?(mt(),Qt(he,N.endScope._wrap)):N.endScope&&N.endScope._multi?(mt(),xr(N.endScope,Q)):At.skip?fe+=he:(At.returnEnd||At.excludeEnd||(fe+=he),mt(),At.excludeEnd&&(fe=he));do N.scope&&oe.closeNode(),!N.skip&&!N.subLanguage&&(Le+=N.relevance),N=N.parent;while(N!==$e.parent);return $e.starts&&Zn($e.starts,Q),At.returnEnd?0:he.length}function Si(){const Q=[];for(let he=N;he!==ln;he=he.parent)he.scope&&Q.unshift(he.scope);Q.forEach(he=>oe.openNode(he))}let Xn={};function In(Q,he){const be=he&&he[0];if(fe+=Q,be==null)return mt(),0;if(Xn.type==="begin"&&he.type==="end"&&Xn.index===he.index&&be===""){if(fe+=Ie.slice(he.index,he.index+1),!Je){const $e=new Error(`0 width match regex (${$})`);throw $e.languageName=$,$e.badRule=Xn.rule,$e}return 1}if(Xn=he,he.type==="begin")return Ei(he);if(he.type==="illegal"&&!Ge){const $e=new Error('Illegal lexeme "'+be+'" for mode "'+(N.scope||"<unnamed>")+'"');throw $e.mode=N,$e}else if(he.type==="end"){const $e=ei(he);if($e!==zn)return $e}if(he.type==="illegal"&&be==="")return fe+=`
|
||||
`,1;if(Et>1e5&&Et>he.index*3)throw new Error("potential infinite loop, way more iterations than matches");return fe+=be,be.length}const ln=Rn($);if(!ln)throw q(at.replace("{}",$)),new Error('Unknown language: "'+$+'"');const ee=mr(ln);let h="",N=Ye||ee;const K={},oe=new R.__emitter(R);Si();let fe="",Le=0,nt=0,Et=0,Ot=!1;try{if(ln.__emitTokens)ln.__emitTokens(Ie,oe);else{for(N.matcher.considerAll();;){Et++,Ot?Ot=!1:N.matcher.considerAll(),N.matcher.lastIndex=nt;const Q=N.matcher.exec(Ie);if(!Q)break;const he=Ie.substring(nt,Q.index),be=In(he,Q);nt=Q.index+be}In(Ie.substring(nt))}return oe.finalize(),h=oe.toHTML(),{language:$,value:h,relevance:Le,illegal:!1,_emitter:oe,_top:N}}catch(Q){if(Q.message&&Q.message.includes("Illegal"))return{language:$,value:ft(Ie),illegal:!0,relevance:0,_illegalBy:{message:Q.message,index:nt,context:Ie.slice(nt-100,nt+100),mode:Q.mode,resultSoFar:h},_emitter:oe};if(Je)return{language:$,value:ft(Ie),illegal:!1,relevance:0,errorRaised:Q,_emitter:oe,_top:N};throw Q}}function je($){const Ie={value:ft($),illegal:!1,relevance:0,_top:k,_emitter:new R.__emitter(R)};return Ie._emitter.addText($),Ie}function on($,Ie){Ie=Ie||R.languages||Object.keys(F);const Ge=je($),Ye=Ie.filter(Rn).filter(wi).map(mt=>It(mt,$,!1));Ye.unshift(Ge);const yt=Ye.sort((mt,Qt)=>{if(mt.relevance!==Qt.relevance)return Qt.relevance-mt.relevance;if(mt.language&&Qt.language){if(Rn(mt.language).supersetOf===Qt.language)return 1;if(Rn(Qt.language).supersetOf===mt.language)return-1}return 0}),[pt,Vt]=yt,Pn=pt;return Pn.secondBest=Vt,Pn}function xn($,Ie,Ge){const Ye=Ie&&ie[Ie]||Ge;$.classList.add("hljs"),$.classList.add(`language-${Ye}`)}function ir($){let Ie=null;const Ge=Ee($);if(L(Ge))return;if(yr("before:highlightElement",{el:$,language:Ge}),$.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",$);return}if($.children.length>0&&(R.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn($)),R.throwUnescapedHTML))throw new Kn("One of your code blocks includes unescaped HTML.",$.innerHTML);Ie=$;const Ye=Ie.textContent,yt=Ge?qe(Ye,{language:Ge,ignoreIllegals:!0}):on(Ye);$.innerHTML=yt.value,$.dataset.highlighted="yes",xn($,Ge,yt.language),$.result={language:yt.language,re:yt.relevance,relevance:yt.relevance},yt.secondBest&&($.secondBest={language:yt.secondBest.language,relevance:yt.secondBest.relevance}),yr("after:highlightElement",{el:$,result:yt,text:Ye})}function ct($){R=Dt(R,$)}const zt=()=>{sr(),me("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function vi(){sr(),me("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Or=!1;function sr(){function $(){sr()}if(document.readyState==="loading"){Or||window.addEventListener("DOMContentLoaded",$,!1),Or=!0;return}document.querySelectorAll(R.cssSelector).forEach(ir)}function Jr($,Ie){let Ge=null;try{Ge=Ie(w)}catch(Ye){if(q("Language definition for '{}' could not be registered.".replace("{}",$)),Je)q(Ye);else throw Ye;Ge=k}Ge.name||(Ge.name=$),F[$]=Ge,Ge.rawDefinition=Ie.bind(null,w),Ge.aliases&&xi(Ge.aliases,{languageName:$})}function $r($){delete F[$];for(const Ie of Object.keys(ie))ie[Ie]===$&&delete ie[Ie]}function yi(){return Object.keys(F)}function Rn($){return $=($||"").toLowerCase(),F[$]||F[ie[$]]}function xi($,{languageName:Ie}){typeof $=="string"&&($=[$]),$.forEach(Ge=>{ie[Ge.toLowerCase()]=Ie})}function wi($){const Ie=Rn($);return Ie&&!Ie.disableAutodetect}function st($){$["before:highlightBlock"]&&!$["before:highlightElement"]&&($["before:highlightElement"]=Ie=>{$["before:highlightBlock"](Object.assign({block:Ie.el},Ie))}),$["after:highlightBlock"]&&!$["after:highlightElement"]&&($["after:highlightElement"]=Ie=>{$["after:highlightBlock"](Object.assign({block:Ie.el},Ie))})}function Mr($){st($),Ce.push($)}function Cn($){const Ie=Ce.indexOf($);Ie!==-1&&Ce.splice(Ie,1)}function yr($,Ie){const Ge=$;Ce.forEach(function(Ye){Ye[Ge]&&Ye[Ge](Ie)})}function or($){return me("10.7.0","highlightBlock will be removed entirely in v12.0"),me("10.7.0","Please use highlightElement now."),ir($)}Object.assign(w,{highlight:qe,highlightAuto:on,highlightAll:sr,highlightElement:ir,highlightBlock:or,configure:ct,initHighlighting:zt,initHighlightingOnLoad:vi,registerLanguage:Jr,unregisterLanguage:$r,listLanguages:yi,getLanguage:Rn,registerAliases:xi,autoDetection:wi,inherit:Dt,addPlugin:Mr,removePlugin:Cn}),w.debugMode=function(){Je=!1},w.safeMode=function(){Je=!0},w.versionString=qn,w.regex={concat:W,lookahead:T,either:de,optional:B,anyNumberOfTimes:P};for(const $ in Re)typeof Re[$]=="object"&&i(Re[$]);return Object.assign(w,Re),w},Nt=sn({});return Nt.newInstance=()=>sn({}),Va=Nt,Nt.HighlightJS=Nt,Nt.default=Nt,Va}var Nm=Tm();const qf=og(Nm);function Am(i){const s=i.rLine truncated
|
||||
]`).replace("lheading",op).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ap=/^( {2,}|\\)\n(?!\s*$)/,mv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,al=/[\p{P}\p{S}]/u,yc=/[\s\p{P}\p{S}]/u,cp=/[^\s\p{P}\p{S}]/u,vv=ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,yc).getRegex(),up=/(?!~)[\p{P}\p{S}]/u,yv=/(?!~)[\s\p{P}\p{S}]/u,xv=/(?:[^\s\p{P}\p{S}]|~)/u,wv=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,dp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ev=ut(dp,"u").replace(/punct/g,al).getRegex(),Sv=ut(dp,"u").replace(/punct/g,up).getRegex(),fp="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kv=ut(fp,"gu").replace(/notPunctSpace/g,cp).replace(/punctSpace/g,yc).replace(/punct/g,al).getRegex(),bv=ut(fp,"gu").replace(/notPunctSpace/g,xv).replace(/punctSpace/g,yv).replace(/punct/g,up).getRegex(),Tv=ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cp).replace(/punctSpace/g,yc).replace(/punct/g,al).getRegex(),Nv=ut(/\\(punct)/,"gu").replace(/punct/g,al).getRegex(),Av=ut(/^<(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(),_v=ut(mc).replace("(?:-->|$)","-->").getRegex(),Rv=ut("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",_v).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jo=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cv=ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pp=ut(/^!?\[(label)\]\[(ref)\]/).replace("label",Jo).replace("ref",gc).getRegex(),hp=ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",gc).getRegex(),Iv=ut("reflink|nolink(?!\\()","g").replace("reflink",pp).replace("nolink",hp).getRegex(),xc={_backpedal:Ps,anyPunctuation:Nv,autolink:Av,blockSkip:wv,br:ap,code:gv,del:Ps,emStrongLDelim:Ev,emStrongRDelimAst:kv,emStrongRDelimUnd:Tv,escape:hv,link:Cv,nolink:hp,punctuation:vv,reflink:pp,reflinkSearch:Iv,tag:Rv,text:mv,url:Ps},Ov={...xc,link:ut(/^!?\[(label)\]\((.*?)\)/).replace("label",Jo).getRegex(),reflink:ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jo).getRegex()},ic={...xc,emStrongRDelimAst:bv,emStrongLDelim:Sv,url:ut(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Mv={...ic,br:ut(ap).replace("{2,}","*").getRegex(),text:ut(ic.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:vc,gfm:fv,pedantic:pv},Is={normal:xc,gfm:ic,breaks:Mv,pedantic:Ov},jv={"&":"&","<":"<",">":">",'"':""","'":"'"},mf=i=>jv[i];function hr(i,s){if(s){if(gn.escapeTest.test(i))return i.replace(gn.escapeReplace,mf)}else if(gn.escapeTestNoEncode.test(i))return i.replace(gn.escapeReplaceNoEncode,mf);return i}function vf(i){try{i=encodeURI(i).replace(gn.percentDecode,"%")}catch{return null}return i}function yf(i,s){var p;const o=i.replace(gn.findPipe,(g,m,x)=>{let v=!1,E=m;for(;--E>=0&&x[E]==="\\";)v=!v;return v?"|":" |"}),u=o.split(gn.splitPipe);let d=0;if(u[0].trim()||u.shift(),u.length>0&&!((p=u.at(-1))!=null&&p.trim())&&u.pop(),s)if(u.length>s)u.splice(s);else for(;u.length<s;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(gn.slashPipe,"|");return u}function Os(i,s,o){const u=i.length;if(u===0)return"";let d=0;for(;d<u&&i.charAt(u-d-1)===s;)d++;return i.slice(0,u-d)}function Lv(i,s){if(i.indexOf(s[1])===-1)return-1;let o=0;for(let u=0;u<i.length;u++)if(i[u]==="\\")u++;else if(i[u]===s[0])o++;else if(i[u]===s[1]Line truncated
|
||||
`).map(p=>{const g=p.match(o.other.beginningSpace);if(g===null)return p;const[m]=g;return m.length>=d.length?p.slice(d.length):p}).join(`
|
||||
`)}var $o=class{constructor(i){pt(this,"options");pt(this,"rules");pt(this,"lexer");this.options=i||mi}space(i){const s=this.rules.block.newline.exec(i);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(i){const s=this.rules.block.code.exec(i);if(s){const o=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Os(o,`
|
||||
`)}var $o=class{constructor(i){ht(this,"options");ht(this,"rules");ht(this,"lexer");this.options=i||mi}space(i){const s=this.rules.block.newline.exec(i);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(i){const s=this.rules.block.code.exec(i);if(s){const o=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Os(o,`
|
||||
`)}}}fences(i){const s=this.rules.block.fences.exec(i);if(s){const o=s[0],u=Dv(o,s[3]||"",this.rules);return{type:"code",raw:o,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:u}}}heading(i){const s=this.rules.block.heading.exec(i);if(s){let o=s[2].trim();if(this.rules.other.endingHash.test(o)){const u=Os(o,"#");(this.options.pedantic||!u||this.rules.other.endingSpaceChar.test(u))&&(o=u.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(i){const s=this.rules.block.hr.exec(i);if(s)return{type:"hr",raw:Os(s[0],`
|
||||
`)}}blockquote(i){const s=this.rules.block.blockquote.exec(i);if(s){let o=Os(s[0],`
|
||||
`).split(`
|
||||
`),u="",d="";const p=[];for(;o.length>0;){let g=!1;const m=[];let w;for(w=0;w<o.length;w++)if(this.rules.other.blockquoteStart.test(o[w]))m.push(o[w]),g=!0;else if(!g)m.push(o[w]);else break;o=o.slice(w);const v=m.join(`
|
||||
`),S=v.replace(this.rules.other.blockquoteSetextReplace,`
|
||||
`),u="",d="";const p=[];for(;o.length>0;){let g=!1;const m=[];let x;for(x=0;x<o.length;x++)if(this.rules.other.blockquoteStart.test(o[x]))m.push(o[x]),g=!0;else if(!g)m.push(o[x]);else break;o=o.slice(x);const v=m.join(`
|
||||
`),E=v.replace(this.rules.other.blockquoteSetextReplace,`
|
||||
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");u=u?`${u}
|
||||
${v}`:v,d=d?`${d}
|
||||
${S}`:S;const D=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(S,p,!0),this.lexer.state.top=D,o.length===0)break;const N=p.at(-1);if((N==null?void 0:N.type)==="code")break;if((N==null?void 0:N.type)==="blockquote"){const P=N,B=P.raw+`
|
||||
${E}`:E;const z=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(E,p,!0),this.lexer.state.top=z,o.length===0)break;const T=p.at(-1);if((T==null?void 0:T.type)==="code")break;if((T==null?void 0:T.type)==="blockquote"){const P=T,B=P.raw+`
|
||||
`+o.join(`
|
||||
`),W=this.blockquote(B);p[p.length-1]=W,u=u.substring(0,u.length-P.raw.length)+W.raw,d=d.substring(0,d.length-P.text.length)+W.text;break}else if((N==null?void 0:N.type)==="list"){const P=N,B=P.raw+`
|
||||
`),W=this.blockquote(B);p[p.length-1]=W,u=u.substring(0,u.length-P.raw.length)+W.raw,d=d.substring(0,d.length-P.text.length)+W.text;break}else if((T==null?void 0:T.type)==="list"){const P=T,B=P.raw+`
|
||||
`+o.join(`
|
||||
`),W=this.list(B);p[p.length-1]=W,u=u.substring(0,u.length-N.raw.length)+W.raw,d=d.substring(0,d.length-P.raw.length)+W.raw,o=B.substring(p.at(-1).raw.length).split(`
|
||||
`);continue}}return{type:"blockquote",raw:u,tokens:p,text:d}}}list(i){let s=this.rules.block.list.exec(i);if(s){let o=s[1].trim();const u=o.length>1,d={type:"list",raw:"",ordered:u,start:u?+o.slice(0,-1):"",loose:!1,items:[]};o=u?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=u?o:"[*+-]");const p=this.rules.other.listItemRegex(o);let g=!1;for(;i;){let w=!1,v="",S="";if(!(s=p.exec(i))||this.rules.block.hr.test(i))break;v=s[0],i=i.substring(v.length);let D=s[2].split(`
|
||||
`,1)[0].replace(this.rules.other.listReplaceTabs,pe=>" ".repeat(3*pe.length)),N=i.split(`
|
||||
`,1)[0],P=!D.trim(),B=0;if(this.options.pedantic?(B=2,S=D.trimStart()):P?B=s[1].length+1:(B=s[2].search(this.rules.other.nonSpaceChar),B=B>4?1:B,S=D.slice(B),B+=s[1].length),P&&this.rules.other.blankLine.test(N)&&(v+=N+`
|
||||
`,i=i.substring(N.length+1),w=!0),!w){const pe=this.rules.other.nextBulletRegex(B),me=this.rules.other.hrRegex(B),ve=this.rules.other.fencesBeginRegex(B),le=this.rules.other.headingBeginRegex(B),he=this.rules.other.htmlBeginRegex(B);for(;i;){const M=i.split(`
|
||||
`,1)[0];let ie;if(N=M,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),ie=N):ie=N.replace(this.rules.other.tabCharGlobal," "),ve.test(N)||le.test(N)||he.test(N)||pe.test(N)||me.test(N))break;if(ie.search(this.rules.other.nonSpaceChar)>=B||!N.trim())S+=`
|
||||
`+ie.slice(B);else{if(P||D.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ve.test(D)||le.test(D)||me.test(D))break;S+=`
|
||||
`+N}!P&&!N.trim()&&(P=!0),v+=M+`
|
||||
`,i=i.substring(M.length+1),D=ie.slice(B)}}d.loose||(g?d.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(g=!0));let W=null,G;this.options.gfm&&(W=this.rules.other.listIsTask.exec(S),W&&(G=W[0]!=="[ ] ",S=S.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:v,task:!!W,checked:G,loose:!1,text:S,tokens:[]}),d.raw+=v}const m=d.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let w=0;w<d.items.length;w++)if(this.lexer.state.top=!1,d.items[w].tokens=this.lexer.blockTokens(d.items[w].text,[]),!d.loose){const v=d.items[w].tokens.filter(D=>D.type==="space"),S=v.length>0&&v.some(D=>this.rules.other.anyLine.test(D.raw));d.loose=S}if(d.loose)for(let w=0;w<d.items.length;w++)d.items[w].loose=!0;return d}}html(i){const s=this.rules.block.html.exec(i);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(i){const s=this.rules.block.def.exec(i);if(s){const o=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:o,raw:s[0],href:u,title:d}}}table(i){var g;const s=this.rules.block.table.exec(i);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const o=yf(s[1]),u=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(g=s[3])!=null&&g.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||||
`):[],p={type:"table",raw:s[0],header:[],align:[],rows:[]};if(o.length===u.length){for(const m of u)this.rules.other.tableAlignRight.test(m)?p.align.push("right"):this.rules.other.tableAlignCenter.test(m)?p.align.push("center"):this.rules.other.tableAlignLeft.test(m)?p.align.push("left"):p.align.push(null);for(let m=0;m<o.length;m++)p.header.push({text:o[m],tokens:this.lexer.inline(o[m]),header:!0,align:p.align[m]});for(const m of d)p.rows.push(yf(m,p.header.length).map((w,v)=>({text:w,tokens:this.lexer.inline(w),header:!1,align:p.align[v]})));return p}}lheading(i){const s=this.rules.block.lheading.exec(i);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(i){const s=this.rules.block.paragraph.exec(i);if(s){const o=s[1].charAt(s[1].length-1)===`
|
||||
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:o,tokens:this.lexer.inline(o)}}}text(i){const s=this.rules.block.text.exec(i);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(i){const s=this.rules.inline.escape.exec(i);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(i){const s=this.rules.inline.tag.exec(i);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(i){const s=this.rules.inline.link.exec(i);if(s){const o=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;const p=Os(o.slice(0,-1),"\\");if((o.length-p.length)%2===0)return}else{const p=Lv(s[2],"()");if(p===-2)return;if(p>-1){const m=(s[0].indexOf("!")===0?5:4)+s[1].length+p;s[2]=s[2].substring(0,p),s[0]=s[0].substring(0,m).trim(),s[3]=""}}let u=s[2],d="";if(this.options.pedantic){const p=this.rules.other.pedanticHrefTitle.exec(u);p&&(u=p[1],d=p[3])}else d=s[3]?s[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?u=u.slice(1):u=u.slice(1,-1)),xf(s,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(i,s){let o;if((o=this.rules.inline.reflink.exec(i))||(o=this.rules.inline.nolink.exec(i))){const u=(o[2]||o[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=s[u.toLowerCase()];if(!d){const p=o[0].charAt(0);return{type:"text",raw:p,text:p}}return xf(o,d,o[0],this.lexer,this.rules)}}emStrong(i,s,o=""){let u=this.rules.inline.emStrongLDelim.exec(i);if(!u||u[3]&&o.match(this.rules.other.unicodeAlphaNumeric))return;if(!(u[1]||u[2]||"")||!o||this.rules.inline.punctuation.exec(o)){const p=[...u[0]].length-1;let g,m,w=p,v=0;const S=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(S.lastIndex=0,s=s.slice(-1*i.length+p);(u=S.exec(s))!=null;){if(g=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!g)continue;if(m=[...g].length,u[3]||u[4]){w+=m;continue}else if((u[5]||u[6])&&p%3&&!((p+m)%3)){v+=m;continue}if(w-=m,w>0)continue;m=Math.min(m,m+w+v);const D=[...u[0]][0].length,N=i.slice(0,p+u.index+D+m);if(Math.min(p,m)%2){const B=N.slice(1,-1);return{type:"em",raw:N,text:B,tokens:this.lexer.inlineTokens(B)}}const P=N.slice(2,-2);return{type:"strong",raw:N,text:P,tokens:this.lexer.inlineTokens(P)}}}}codespan(i){const s=this.rules.inline.code.exec(i);if(s){let o=s[2].replace(this.rules.other.newLineCharGlobal," ");const u=this.rules.other.nonSpaceChar.test(o),d=this.rules.other.startingSpaceChar.test(o)&&this.rules.other.endingSpaceChar.test(o);return u&&d&&(o=o.substring(1,o.length-1)),{type:"codespan",raw:s[0],text:o}}}br(i){const s=this.rules.inline.br.exec(i);if(s)return{type:"br",raw:s[0]}}del(i){const s=this.rules.inline.del.exec(i);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(i){const s=this.rules.inline.autolink.exec(i);if(s){let o,u;return s[2]==="@"?(o=s[1],u="mailto:"+o):(o=s[1],u=o),{type:"link",raw:s[0],text:o,href:u,tokens:[{type:"text",raw:o,text:o}]}}}url(i){var o;let s;if(s=this.rules.inline.url.exec(i)){let u,d;if(s[2]==="@")u=s[0],d="mailto:"+u;else{let p;do p=s[0],s[0]=((o=this.rules.inline._backpedal.exec(s[0]))==null?void 0:o[0])??"";while(p!==s[0]);u=s[0],s[1]==="www."?d="http://"+s[0]:d=s[0]}return{type:"link",raw:s[0],text:u,href:d,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(i){const s=this.rules.inline.text.exec(i);if(s){const o=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:o}}}},Rr=class sc{constructor(s){pt(this,"tokens");pt(this,"options");pt(this,"state");pt(this,"tokenizer");pt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||mi,this.options.tokenizer=this.options.tokenizer||new $o,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const o={other:gn,block:qo.normal,inline:Is.normal};this.options.pedantic?(o.block=qo.pedantic,o.inline=Is.pedantic):this.options.gfm&&(o.block=qo.gfm,this.options.breaks?o.inline=Is.breaks:o.inline=Is.gfm),this.tokenizer.rules=o}static get rules(){return{block:qo,inline:Is}}static lex(s,o){return new sc(o).lex(s)}static lexInline(s,o){return new sc(o).inlineTokens(s)}lex(s){s=s.replace(gn.carriageReturn,`
|
||||
`),W=this.list(B);p[p.length-1]=W,u=u.substring(0,u.length-T.raw.length)+W.raw,d=d.substring(0,d.length-P.raw.length)+W.raw,o=B.substring(p.at(-1).raw.length).split(`
|
||||
`);continue}}return{type:"blockquote",raw:u,tokens:p,text:d}}}list(i){let s=this.rules.block.list.exec(i);if(s){let o=s[1].trim();const u=o.length>1,d={type:"list",raw:"",ordered:u,start:u?+o.slice(0,-1):"",loose:!1,items:[]};o=u?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=u?o:"[*+-]");const p=this.rules.other.listItemRegex(o);let g=!1;for(;i;){let x=!1,v="",E="";if(!(s=p.exec(i))||this.rules.block.hr.test(i))break;v=s[0],i=i.substring(v.length);let z=s[2].split(`
|
||||
`,1)[0].replace(this.rules.other.listReplaceTabs,de=>" ".repeat(3*de.length)),T=i.split(`
|
||||
`,1)[0],P=!z.trim(),B=0;if(this.options.pedantic?(B=2,E=z.trimStart()):P?B=s[1].length+1:(B=s[2].search(this.rules.other.nonSpaceChar),B=B>4?1:B,E=z.slice(B),B+=s[1].length),P&&this.rules.other.blankLine.test(T)&&(v+=T+`
|
||||
`,i=i.substring(T.length+1),x=!0),!x){const de=this.rules.other.nextBulletRegex(B),ve=this.rules.other.hrRegex(B),ye=this.rules.other.fencesBeginRegex(B),ae=this.rules.other.headingBeginRegex(B),ge=this.rules.other.htmlBeginRegex(B);for(;i;){const j=i.split(`
|
||||
`,1)[0];let re;if(T=j,this.options.pedantic?(T=T.replace(this.rules.other.listReplaceNesting," "),re=T):re=T.replace(this.rules.other.tabCharGlobal," "),ye.test(T)||ae.test(T)||ge.test(T)||de.test(T)||ve.test(T))break;if(re.search(this.rules.other.nonSpaceChar)>=B||!T.trim())E+=`
|
||||
`+re.slice(B);else{if(P||z.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ye.test(z)||ae.test(z)||ve.test(z))break;E+=`
|
||||
`+T}!P&&!T.trim()&&(P=!0),v+=j+`
|
||||
`,i=i.substring(j.length+1),z=re.slice(B)}}d.loose||(g?d.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(g=!0));let W=null,Y;this.options.gfm&&(W=this.rules.other.listIsTask.exec(E),W&&(Y=W[0]!=="[ ] ",E=E.replace(this.rules.other.listReplaceTask,""))),d.items.push({type:"list_item",raw:v,task:!!W,checked:Y,loose:!1,text:E,tokens:[]}),d.raw+=v}const m=d.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let x=0;x<d.items.length;x++)if(this.lexer.state.top=!1,d.items[x].tokens=this.lexer.blockTokens(d.items[x].text,[]),!d.loose){const v=d.items[x].tokens.filter(z=>z.type==="space"),E=v.length>0&&v.some(z=>this.rules.other.anyLine.test(z.raw));d.loose=E}if(d.loose)for(let x=0;x<d.items.length;x++)d.items[x].loose=!0;return d}}html(i){const s=this.rules.block.html.exec(i);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(i){const s=this.rules.block.def.exec(i);if(s){const o=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),u=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:o,raw:s[0],href:u,title:d}}}table(i){var g;const s=this.rules.block.table.exec(i);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const o=yf(s[1]),u=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=(g=s[3])!=null&&g.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
||||
`):[],p={type:"table",raw:s[0],header:[],align:[],rows:[]};if(o.length===u.length){for(const m of u)this.rules.other.tableAlignRight.test(m)?p.align.push("right"):this.rules.other.tableAlignCenter.test(m)?p.align.push("center"):this.rules.other.tableAlignLeft.test(m)?p.align.push("left"):p.align.push(null);for(let m=0;m<o.length;m++)p.header.push({text:o[m],tokens:this.lexer.inline(o[m]),header:!0,align:p.align[m]});for(const m of d)p.rows.push(yf(m,p.header.length).map((x,v)=>({text:x,tokens:this.lexer.inline(x),header:!1,align:p.align[v]})));return p}}lheading(i){const s=this.rules.block.lheading.exec(i);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(i){const s=this.rules.block.paragraph.exec(i);if(s){const o=s[1].charAt(s[1].length-1)===`
|
||||
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:o,tokens:this.lexer.inline(o)}}}text(i){const s=this.rules.block.text.exec(i);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(i){const s=this.rules.inline.escape.exec(i);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(i){const s=this.rules.inline.tag.exec(i);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(i){const s=this.rules.inline.link.exec(i);if(s){const o=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(o)){if(!this.rules.other.endAngleBracket.test(o))return;const p=Os(o.slice(0,-1),"\\");if((o.length-p.length)%2===0)return}else{const p=Lv(s[2],"()");if(p===-2)return;if(p>-1){const m=(s[0].indexOf("!")===0?5:4)+s[1].length+p;s[2]=s[2].substring(0,p),s[0]=s[0].substring(0,m).trim(),s[3]=""}}let u=s[2],d="";if(this.options.pedantic){const p=this.rules.other.pedanticHrefTitle.exec(u);p&&(u=p[1],d=p[3])}else d=s[3]?s[3].slice(1,-1):"";return u=u.trim(),this.rules.other.startAngleBracket.test(u)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(o)?u=u.slice(1):u=u.slice(1,-1)),xf(s,{href:u&&u.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(i,s){let o;if((o=this.rules.inline.reflink.exec(i))||(o=this.rules.inline.nolink.exec(i))){const u=(o[2]||o[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=s[u.toLowerCase()];if(!d){const p=o[0].charAt(0);return{type:"text",raw:p,text:p}}return xf(o,d,o[0],this.lexer,this.rules)}}emStrong(i,s,o=""){let u=this.rules.inline.emStrongLDelim.exec(i);if(!u||u[3]&&o.match(this.rules.other.unicodeAlphaNumeric))return;if(!(u[1]||u[2]||"")||!o||this.rules.inline.punctuation.exec(o)){const p=[...u[0]].length-1;let g,m,x=p,v=0;const E=u[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(E.lastIndex=0,s=s.slice(-1*i.length+p);(u=E.exec(s))!=null;){if(g=u[1]||u[2]||u[3]||u[4]||u[5]||u[6],!g)continue;if(m=[...g].length,u[3]||u[4]){x+=m;continue}else if((u[5]||u[6])&&p%3&&!((p+m)%3)){v+=m;continue}if(x-=m,x>0)continue;m=Math.min(m,m+x+v);const z=[...u[0]][0].length,T=i.slice(0,p+u.index+z+m);if(Math.min(p,m)%2){const B=T.slice(1,-1);return{type:"em",raw:T,text:B,tokens:this.lexer.inlineTokens(B)}}const P=T.slice(2,-2);return{type:"strong",raw:T,text:P,tokens:this.lexer.inlineTokens(P)}}}}codespan(i){const s=this.rules.inline.code.exec(i);if(s){let o=s[2].replace(this.rules.other.newLineCharGlobal," ");const u=this.rules.other.nonSpaceChar.test(o),d=this.rules.other.startingSpaceChar.test(o)&&this.rules.other.endingSpaceChar.test(o);return u&&d&&(o=o.substring(1,o.length-1)),{type:"codespan",raw:s[0],text:o}}}br(i){const s=this.rules.inline.br.exec(i);if(s)return{type:"br",raw:s[0]}}del(i){const s=this.rules.inline.del.exec(i);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(i){const s=this.rules.inline.autolink.exec(i);if(s){let o,u;return s[2]==="@"?(o=s[1],u="mailto:"+o):(o=s[1],u=o),{type:"link",raw:s[0],text:o,href:u,tokens:[{type:"text",raw:o,text:o}]}}}url(i){var o;let s;if(s=this.rules.inline.url.exec(i)){let u,d;if(s[2]==="@")u=s[0],d="mailto:"+u;else{let p;do p=s[0],s[0]=((o=this.rules.inline._backpedal.exec(s[0]))==null?void 0:o[0])??"";while(p!==s[0]);u=s[0],s[1]==="www."?d="http://"+s[0]:d=s[0]}return{type:"link",raw:s[0],text:u,href:d,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(i){const s=this.rules.inline.text.exec(i);if(s){const o=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:o}}}},Rr=class sc{constructor(s){ht(this,"tokens");ht(this,"options");ht(this,"state");ht(this,"tokenizer");ht(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||mi,this.options.tokenizer=this.options.tokenizer||new $o,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const o={other:gn,block:qo.normal,inline:Is.normal};this.options.pedantic?(o.block=qo.pedantic,o.inline=Is.pedantic):this.options.gfm&&(o.block=qo.gfm,this.options.breaks?o.inline=Is.breaks:o.inline=Is.gfm),this.tokenizer.rules=o}static get rules(){return{block:qo,inline:Is}}static lex(s,o){return new sc(o).lex(s)}static lexInline(s,o){return new sc(o).inlineTokens(s)}lex(s){s=s.replace(gn.carriageReturn,`
|
||||
`),this.blockTokens(s,this.tokens);for(let o=0;o<this.inlineQueue.length;o++){const u=this.inlineQueue[o];this.inlineTokens(u.src,u.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,o=[],u=!1){var d,p,g;for(this.options.pedantic&&(s=s.replace(gn.tabCharGlobal," ").replace(gn.spaceLine,""));s;){let m;if((p=(d=this.options.extensions)==null?void 0:d.block)!=null&&p.some(v=>(m=v.call({lexer:this},s,o))?(s=s.substring(m.raw.length),o.push(m),!0):!1))continue;if(m=this.tokenizer.space(s)){s=s.substring(m.raw.length);const v=o.at(-1);m.raw.length===1&&v!==void 0?v.raw+=`
|
||||
`:o.push(m);continue}if(m=this.tokenizer.code(s)){s=s.substring(m.raw.length);const v=o.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=`
|
||||
`+m.raw,v.text+=`
|
||||
`+m.text,this.inlineQueue.at(-1).src=v.text):o.push(m);continue}if(m=this.tokenizer.fences(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.heading(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.hr(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.blockquote(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.list(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.html(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.def(s)){s=s.substring(m.raw.length);const v=o.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=`
|
||||
`+m.raw,v.text+=`
|
||||
`+m.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title});continue}if(m=this.tokenizer.table(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.lheading(s)){s=s.substring(m.raw.length),o.push(m);continue}let w=s;if((g=this.options.extensions)!=null&&g.startBlock){let v=1/0;const S=s.slice(1);let D;this.options.extensions.startBlock.forEach(N=>{D=N.call({lexer:this},S),typeof D=="number"&&D>=0&&(v=Math.min(v,D))}),v<1/0&&v>=0&&(w=s.substring(0,v+1))}if(this.state.top&&(m=this.tokenizer.paragraph(w))){const v=o.at(-1);u&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=`
|
||||
`+m.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title});continue}if(m=this.tokenizer.table(s)){s=s.substring(m.raw.length),o.push(m);continue}if(m=this.tokenizer.lheading(s)){s=s.substring(m.raw.length),o.push(m);continue}let x=s;if((g=this.options.extensions)!=null&&g.startBlock){let v=1/0;const E=s.slice(1);let z;this.options.extensions.startBlock.forEach(T=>{z=T.call({lexer:this},E),typeof z=="number"&&z>=0&&(v=Math.min(v,z))}),v<1/0&&v>=0&&(x=s.substring(0,v+1))}if(this.state.top&&(m=this.tokenizer.paragraph(x))){const v=o.at(-1);u&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=`
|
||||
`+m.raw,v.text+=`
|
||||
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):o.push(m),u=w.length!==s.length,s=s.substring(m.raw.length);continue}if(m=this.tokenizer.text(s)){s=s.substring(m.raw.length);const v=o.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=`
|
||||
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):o.push(m),u=x.length!==s.length,s=s.substring(m.raw.length);continue}if(m=this.tokenizer.text(s)){s=s.substring(m.raw.length);const v=o.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=`
|
||||
`+m.raw,v.text+=`
|
||||
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):o.push(m);continue}if(s){const v="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return this.state.top=!0,o}inline(s,o=[]){return this.inlineQueue.push({src:s,tokens:o}),o}inlineTokens(s,o=[]){var m,w,v;let u=s,d=null;if(this.tokens.links){const S=Object.keys(this.tokens.links);if(S.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)S.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,g="";for(;s;){p||(g=""),p=!1;let S;if((w=(m=this.options.extensions)==null?void 0:m.inline)!=null&&w.some(N=>(S=N.call({lexer:this},s,o))?(s=s.substring(S.raw.length),o.push(S),!0):!1))continue;if(S=this.tokenizer.escape(s)){s=s.substring(S.raw.length),o.push(S);continue}if(S=this.tokenizer.tag(s)){s=s.substring(S.raw.length),o.push(S);continue}if(S=this.tokenizer.link(s)){s=s.substring(S.raw.length),o.push(S);continue}if(S=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(S.raw.length);const N=o.at(-1);S.type==="text"&&(N==null?void 0:N.type)==="text"?(N.raw+=S.raw,N.text+=S.text):o.push(S);continue}if(S=this.tokenizer.emStrong(s,u,g)){s=s.substring(S.raw.length),o.push(S);continue}if(S=this.tokenizer.codespan(s)){s=s.substring(S.raw.length),o.push(S);continue}if(S=this.tokenizer.br(s)){s=s.substring(S.raw.length),o.push(S);continue}if(S=this.tokenizer.del(s)){s=s.substring(S.raw.length),o.push(S);continue}if(S=this.tokenizer.autolink(s)){s=s.substring(S.raw.length),o.push(S);continue}if(!this.state.inLink&&(S=this.tokenizer.url(s))){s=s.substring(S.raw.length),o.push(S);continue}let D=s;if((v=this.options.extensions)!=null&&v.startInline){let N=1/0;const P=s.slice(1);let B;this.options.extensions.startInline.forEach(W=>{B=W.call({lexer:this},P),typeof B=="number"&&B>=0&&(N=Math.min(N,B))}),N<1/0&&N>=0&&(D=s.substring(0,N+1))}if(S=this.tokenizer.inlineText(D)){s=s.substring(S.raw.length),S.raw.slice(-1)!=="_"&&(g=S.raw.slice(-1)),p=!0;const N=o.at(-1);(N==null?void 0:N.type)==="text"?(N.raw+=S.raw,N.text+=S.text):o.push(S);continue}if(s){const N="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(N);break}else throw new Error(N)}}return o}},el=class{constructor(i){pt(this,"options");pt(this,"parser");this.options=i||mi}space(i){return""}code({text:i,lang:s,escaped:o}){var p;const u=(p=(s||"").match(gn.notSpaceStart))==null?void 0:p[0],d=i.replace(gn.endingNewline,"")+`
|
||||
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):o.push(m);continue}if(s){const v="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return this.state.top=!0,o}inline(s,o=[]){return this.inlineQueue.push({src:s,tokens:o}),o}inlineTokens(s,o=[]){var m,x,v;let u=s,d=null;if(this.tokens.links){const E=Object.keys(this.tokens.links);if(E.length>0)for(;(d=this.tokenizer.rules.inline.reflinkSearch.exec(u))!=null;)E.includes(d[0].slice(d[0].lastIndexOf("[")+1,-1))&&(u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(d=this.tokenizer.rules.inline.anyPunctuation.exec(u))!=null;)u=u.slice(0,d.index)+"++"+u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(d=this.tokenizer.rules.inline.blockSkip.exec(u))!=null;)u=u.slice(0,d.index)+"["+"a".repeat(d[0].length-2)+"]"+u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,g="";for(;s;){p||(g=""),p=!1;let E;if((x=(m=this.options.extensions)==null?void 0:m.inline)!=null&&x.some(T=>(E=T.call({lexer:this},s,o))?(s=s.substring(E.raw.length),o.push(E),!0):!1))continue;if(E=this.tokenizer.escape(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.tag(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.link(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(E.raw.length);const T=o.at(-1);E.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=E.raw,T.text+=E.text):o.push(E);continue}if(E=this.tokenizer.emStrong(s,u,g)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.codespan(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.br(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.del(s)){s=s.substring(E.raw.length),o.push(E);continue}if(E=this.tokenizer.autolink(s)){s=s.substring(E.raw.length),o.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(s))){s=s.substring(E.raw.length),o.push(E);continue}let z=s;if((v=this.options.extensions)!=null&&v.startInline){let T=1/0;const P=s.slice(1);let B;this.options.extensions.startInline.forEach(W=>{B=W.call({lexer:this},P),typeof B=="number"&&B>=0&&(T=Math.min(T,B))}),T<1/0&&T>=0&&(z=s.substring(0,T+1))}if(E=this.tokenizer.inlineText(z)){s=s.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(g=E.raw.slice(-1)),p=!0;const T=o.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=E.raw,T.text+=E.text):o.push(E);continue}if(s){const T="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(T);break}else throw new Error(T)}}return o}},el=class{constructor(i){ht(this,"options");ht(this,"parser");this.options=i||mi}space(i){return""}code({text:i,lang:s,escaped:o}){var p;const u=(p=(s||"").match(gn.notSpaceStart))==null?void 0:p[0],d=i.replace(gn.endingNewline,"")+`
|
||||
`;return u?'<pre><code class="language-'+hr(u)+'">'+(o?d:hr(d,!0))+`</code></pre>
|
||||
`:"<pre><code>"+(o?d:hr(d,!0))+`</code></pre>
|
||||
`}blockquote({tokens:i}){return`<blockquote>
|
||||
@@ -106,18 +106,18 @@ ${this.parser.parse(i)}</blockquote>
|
||||
`}tablerow({text:i}){return`<tr>
|
||||
${i}</tr>
|
||||
`}tablecell(i){const s=this.parser.parseInline(i.tokens),o=i.header?"th":"td";return(i.align?`<${o} align="${i.align}">`:`<${o}>`)+s+`</${o}>
|
||||
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${hr(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:s,tokens:o}){const u=this.parser.parseInline(o),d=vf(i);if(d===null)return u;i=d;let p='<a href="'+i+'"';return s&&(p+=' title="'+hr(s)+'"'),p+=">"+u+"</a>",p}image({href:i,title:s,text:o,tokens:u}){u&&(o=this.parser.parseInline(u,this.parser.textRenderer));const d=vf(i);if(d===null)return hr(o);i=d;let p=`<img src="${i}" alt="${o}"`;return s&&(p+=` title="${hr(s)}"`),p+=">",p}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:hr(i.text)}},wc=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},Cr=class oc{constructor(s){pt(this,"options");pt(this,"renderer");pt(this,"textRenderer");this.options=s||mi,this.options.renderer=this.options.renderer||new el,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wc}static parse(s,o){return new oc(o).parse(s)}static parseInline(s,o){return new oc(o).parseInline(s)}parse(s,o=!0){var d,p;let u="";for(let g=0;g<s.length;g++){const m=s[g];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[m.type]){const v=m,S=this.options.extensions.renderers[v.type].call({parser:this},v);if(S!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(v.type)){u+=S||"";continue}}const w=m;switch(w.type){case"space":{u+=this.renderer.space(w);continue}case"hr":{u+=this.renderer.hr(w);continue}case"heading":{u+=this.renderer.heading(w);continue}case"code":{u+=this.renderer.code(w);continue}case"table":{u+=this.renderer.table(w);continue}case"blockquote":{u+=this.renderer.blockquote(w);continue}case"list":{u+=this.renderer.list(w);continue}case"html":{u+=this.renderer.html(w);continue}case"paragraph":{u+=this.renderer.paragraph(w);continue}case"text":{let v=w,S=this.renderer.text(v);for(;g+1<s.length&&s[g+1].type==="text";)v=s[++g],S+=`
|
||||
`+this.renderer.text(v);o?u+=this.renderer.paragraph({type:"paragraph",raw:S,text:S,tokens:[{type:"text",raw:S,text:S,escaped:!0}]}):u+=S;continue}default:{const v='Token with "'+w.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}parseInline(s,o=this.renderer){var d,p;let u="";for(let g=0;g<s.length;g++){const m=s[g];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[m.type]){const v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){u+=v||"";continue}}const w=m;switch(w.type){case"escape":{u+=o.text(w);break}case"html":{u+=o.html(w);break}case"link":{u+=o.link(w);break}case"image":{u+=o.image(w);break}case"strong":{u+=o.strong(w);break}case"em":{u+=o.em(w);break}case"codespan":{u+=o.codespan(w);break}case"br":{u+=o.br(w);break}case"del":{u+=o.del(w);break}case"text":{u+=o.text(w);break}default:{const v='Token with "'+w.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}},tc,Xo=(tc=class{constructor(i){pt(this,"options");pt(this,"block");this.options=i||mi}preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}provideLexer(){return this.block?Rr.lex:Rr.lexInline}provideParser(){return this.block?Cr.parse:Cr.parseInline}},pt(tc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),tc),zv=class{constructor(...i){pt(this,"defaults",fc());pt(this,"options",this.setOptions);pt(this,"parse",this.parseMarkdown(!0));pt(this,"parseInline",this.parseMarkdown(!1));pt(this,"Parser",Cr);pt(this,"Renderer",el);pt(this,"TextRenderer",wc);pt(this,"Lexer",Rr);pt(this,"Tokenizer",$o);pt(this,"Hooks",Xo);this.use(...i)}walkTokens(i,s){var u,d;let o=[];for(const p of i)switch(o=o.concat(s.call(this,p)),p.type){case"table":{const g=p;for(const m of g.header)o=o.concat(this.walkTokens(m.tokens,s));for(const m of g.rows)for(const w of m)o=o.concat(this.walkTokens(w.tokens,s));break}case"list":{const g=p;o=o.concat(this.walkTokens(g.items,s));break}default:{const g=p;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[g.type]?this.defaults.extensions.childTokens[g.type].forEach(m=>{const w=g[m].flat(1/0);o=o.concat(this.walkTokens(w,s))}):g.tokens&&(o=o.concat(this.walkTokens(g.tokens,s)))}}return o}use(...i){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(o=>{const u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const p=s.renderers[d.name];p?s.renderers[d.name]=function(...g){let m=d.renderer.apply(this,g);return m===!1&&(m=p.apply(this,g)),m}:s.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=s[d.level];p?p.unshift(d.tokenizer):s[d.level]=[d.tokenizer],d.start&&(d.level==="block"?s.startBlock?s.startBlock.push(d.start):s.startBlock=[d.start]:d.level==="inline"&&(s.startInline?s.startInline.push(d.start):s.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(s.childTokens[d.name]=d.childTokens)}),u.extensions=s),o.renderer){const d=this.defaults.renderer||new el(this.defaults);for(const p in o.renderer){if(!(p in d))throw new Error(`renderer '${p}' does not exist`);if(["options","parser"].includes(p))continue;const g=p,m=o.renderer[g],w=d[g];d[g]=(...v)=>{let S=m.apply(d,v);return S===!1&&(S=w.apply(d,v)),S||""}}u.renderer=d}if(o.tokenizer){const d=this.defaults.tokenizer||new $o(this.defaults);for(const p in o.tokenizer){if(!(p in d))throw new Error(`tokenizer '${p}' does not exist`);if(["options","rules","lexer"].includes(p))continue;const g=p,m=o.tokenizer[g],w=d[g];d[g]=(...v)=>{let S=m.apply(d,v);return S===!1&&(S=w.apply(d,v)),S}}u.tokenizer=d}if(o.hooks){const d=this.defaults.hooks||new Xo;for(const p in o.hooks){if(!(p in d))throw new Error(`hook '${p}' does not exist`);if(["options","block"].includes(p))continue;const g=p,m=o.hooks[g],w=d[g];Xo.passThroughHooks.has(p)?d[g]=v=>{if(this.defaults.async)return Promise.resolve(m.call(d,v)).then(D=>w.call(d,D));const S=m.call(d,v);return w.call(d,S)}:d[g]=(...v)=>{let S=m.apply(d,v);return S===!1&&(S=w.apply(d,v)),S}}u.hooks=d}if(o.walkTokens){const d=this.defaults.walkTokens,p=o.walkTokens;u.walkTokens=function(g){let m=[];return m.push(p.call(this,g)),d&&(m=m.concat(d.call(this,g))),m}}this.defaults={...this.defaults,...u}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,s){return Rr.lex(i,s??this.defaults)}parser(i,s){return Cr.parse(i,s??this.defaults)}parseMarkdown(i){return(o,u)=>{const d={...u},p={...this.defaults,...d},g=this.onError(!!p.silent,!!p.async);if(this.defaults.async===!0&&d.async===!1)return g(new Error("marked(): The async option was set to tLine truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,i){const u="<p>An error occurred:</p><pre>"+hr(o.message+"",!0)+"</pre>";return s?Promise.resolve(u):u}if(s)return Promise.reject(o);throw o}}},gi=new zv;function ot(i,s){return gi.parse(i,s)}ot.options=ot.setOptions=function(i){return gi.setOptions(i),ot.defaults=gi.defaults,ip(ot.defaults),ot};ot.getDefaults=fc;ot.defaults=mi;ot.use=function(...i){return gi.use(...i),ot.defaults=gi.defaults,ip(ot.defaults),ot};ot.walkTokens=function(i,s){return gi.walkTokens(i,s)};ot.parseInline=gi.parseInline;ot.Parser=Cr;ot.parser=Cr.parse;ot.Renderer=el;ot.TextRenderer=wc;ot.Lexer=Rr;ot.lexer=Rr.lex;ot.Tokenizer=$o;ot.Hooks=Xo;ot.parse=ot;ot.options;ot.setOptions;ot.use;ot.walkTokens;ot.parseInline;Cr.parse;Rr.lex;const Ct={flex:"none",display:"block"};function Ir({size:i=13,color:s="var(--t3)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M1.5 4a1.5 1.5 0 0 1 1.5-1.5h2.6l1.3 1.5H11A1.5 1.5 0 0 1 12.5 5.5v5A1.5 1.5 0 0 1 11 12H3a1.5 1.5 0 0 1-1.5-1.5V4z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function Ms({size:i=13,color:s="var(--t4)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("path",{d:"M3.5 2.8A1.3 1.3 0 0 1 4.8 1.5h3.4l2.3 2.3v7.4a1.3 1.3 0 0 1-1.3 1.3H4.8a1.3 1.3 0 0 1-1.3-1.3V2.8z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("path",{d:"M8 1.7v2.5h2.4",stroke:s,strokeWidth:"1.1",strokeLinejoin:"round"})]})}function Pv({size:i=12,color:s="var(--t3)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M2.3 9.7 9.2 2.8a1.25 1.25 0 0 1 1.77 0l.23.23a1.25 1.25 0 0 1 0 1.77L4.3 11.7l-2.6.6.6-2.6z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function lc({size:i=14,color:s="var(--t5)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M4.5 12.5a3 3 0 0 1-.4-5.97 4 4 0 0 1 7.8-.03 2.75 2.75 0 0 1-.4 6H4.5z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function Ec({size:i=14,color:s="var(--t5)",strokeWidth:o=1.2,style:u}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...Ct,...u},children:[a.jsx("rect",{x:"2",y:"3.5",width:"12",height:"7.5",rx:"1.4",stroke:s,strokeWidth:o}),a.jsx("path",{d:"M5.5 13.5h5",stroke:s,strokeWidth:o,strokeLinecap:"round"})]})}function cl({size:i=11,color:s="var(--t4)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 12 12",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M6 2v8M2 6h8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round"})})}function Sc({size:i=10,color:s="var(--t5)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M3.5 2L7 5 3.5 8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ac({size:i=8,color:s="var(--t6)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function gp({size:i=12,color:s="var(--t3)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("circle",{cx:"3",cy:"7",r:"1.1",fill:s}),a.jsx("circle",{cx:"7",cy:"7",r:"1.1",fill:s}),a.jsx("circle",{cx:"11",cy:"7",r:"1.1",fill:s})]})}function mp({size:i=12,color:s="var(--t3)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("rect",{x:"2",y:"2.5",width:"10",height:"3",rx:"1",stroke:s,strokeWidth:"1.2"}),a.jsx("path",{d:"M3 5.5v4A1.5 1.5 0 0 0 4.5 11h5A1.5 1.5 0 0 0 11 9.5v-4M5.5 7.5h3",stroke:s,strokeWidth:"1.2",strokeLinecap:"round"})]})}function tl({size:i=12,color:s="var(--err)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M2.5 3.5h9M5.5 3.5v-1h3v1M4 3.5l.5 7A1.5 1.5 0 0 0 6 12h2a1.5 1.5 0 0 0 1.5-1.5l.5-7",stroke:s,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function vp({size:i=15,color:s="var(--t3)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...Ct,...o},children:[a.jsx("path",{d:"M6.8 1.8h2.4l.3 1.6c.5.2 1 .4 1.4.8l1.6-.6 1.2 2-1.3 1.1c.05.25.1.55.1.85s-.05.6-.1.85l1.3 1.1-1.2 2-1.6-.6c-.4.35-.9.6-1.4.8l-.3 1.6H6.8l-.3-1.6c-.5-.2-1-.45-1.4-.8l-1.6.6-1.2-2 1.3-1.1A4.6 4.6 0 0 1 3.5 8c0-.3.03-.6.1-.85L2.3 6l1.2-2 1.6.6c.4-.35.9-.6 1.4-.8l.3-2z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.9",stroke:s,strokeWidth:"1.2"})]})}function Bv({size:i=13,color:s="var(--t5)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("circle",{cx:"7",cyLine truncated
|
||||
`)[0].slice(0,160):"";d[p]={...g,status:s.status==="completed"?"ok":"fail",out:m,lastLine:void 0};break}}return{...i,items:d}}case"plan":{const d=i.items.slice(),p=d[d.length-1];return p&&p.kind==="plan"?(d[d.length-1]={kind:"plan",entries:s.entries??[]},{...i,items:d,streamKind:""}):Vr(i,{kind:"plan",entries:s.entries??[]})}case"llm_call_retry":return Vr(i,{kind:"sys",text:`模型调用重试 #${s.attempt??"?"}: ${s.message??""}`});case"usage_update":return{...i,usage:{used:s.used??0,size:s.size??0}};case"compact_status":return Vr(i,{kind:"sys",text:s.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const d=s.model??"";return{...Vr(i,{kind:"sys",text:`模型已切换为 ${d}`}),model:d}}case"permission_mode_update":{const d=s.mode??"default";return{...Vr(i,{kind:"sys",text:d==="yolo"?"⚡ 已开启 YOLO 模式:所有操作不再询问,直接执行":"已恢复默认权限模式"}),permMode:d}}default:return i}}function Kv(i,s){switch(s.type){case"task-started":return{...i,running:!0};case"task-ended":return{...i,running:!1,streamKind:"",turnEnded:!0,items:[...Sf(i.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const o=Zi(s);return{...i,running:!1,streamKind:"",items:[...Sf(i.items),{kind:"sys",text:"✗ "+((o==null?void 0:o.error)||"未知错误"),error:!0}]}}case"user-input":{const o=Zi(s);let u="";try{u=o!=null&&o.content?Pf(o.content):""}catch{u=(o==null?void 0:o.content)??""}return Vr(i,{kind:"user",text:u})}case"permission-req":{const o=Zi(s);return o!=null&&o.id?Vr(i,{kind:"perm",id:o.id,title:o.title??"",tool:o.tool??"",state:"open"}):i}case"permission-resolved":{const o=Zi(s);return o!=null&&o.id?{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===o.id&&u.state==="open"?{...u,state:o.outcome??"expired"}:u)}:i}case"task-running":if(s.kind==="acp_event"){const o=Zi(s);if(o!=null&&o.update)return qv(i,o.update)}return i;default:return i}}function wp(i,s){let o=i;for(const u of s)o=Kv(o,u);return o}function Zv(i,s,o){return{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===s&&u.state==="open"?{...u,state:o?"allowed":"rejected"}:u)}}ot.setOptions({gfm:!0,breaks:!0});const Xv=new ot.Renderer;ot.use({renderer:{code(i){return`<div class="mdcode">${Xv.code(i)}<button class="mdcopy" type="button">复制</button></div>`}}});function Vv(i){var o;const s=()=>{const u=document.createElement("textarea");u.value=i,u.style.cssText="position:fixed;opacity:0",document.body.appendChild(u),u.select(),document.execCommand("copy"),u.remove()};(o=navigator.clipboard)!=null&&o.writeText?navigator.clipboard.writeText(i).catch(s):s()}const Tt='"JetBrains Mono","HarmonyOS Sans SC",ui-monospace,Menlo,Consolas,"Courier New","Microsoft YaHei",monospace';function Qv(i){var p,g;const s=i.target,o=s.closest("button.mdcopy");if(o){Vv(((g=(p=o.parentElement)==null?void 0:p.querySelector("pre"))==null?void 0:g.textContent)??""),o.textContent="已复制",o.classList.add("ok"),window.setTimeout(()=>{o.textContent="复制",o.classList.remove("ok")},1500);return}const u=s.closest("a");if(!u)return;i.preventDefault();const d=u.getAttribute("href")||"";/^https?:/i.test(d)&&Ff(d)}function Jv({text:i}){const s=L.useMemo(()=>bm.sanitize(ot.parse(i,{async:!1})),[i]);return a.jsx("div",{className:"md",onClick:Qv,dangerouslySetInnerHTML:{__html:s}})}function $v({text:i}){const[s,o]=L.useState(!1);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{onClick:()=>o(!s),style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",cursor:"pointer",userSelect:"none",lineHeight:1.6,minWidth:0},children:[a.jsx(xp,{}),a.jsx("span",{style:{fontWeight:600,color:"var(--t3)",flex:"none"},children:"思考"}),!s&&a.jsx("span",{className:"ellipsis",style:{flex:1,minWidth:0},children:i.trim().replace(/\s+/g," ")}),s&&a.jsx("span",{style:{flex:1}}),a.jsx(Sc,{size:9,color:"var(--t6)",style:{transform:s?"rotate(90deg)":"none",transition:"transform .15s ease"}})]}),s&&a.jsx("div",{style:{marginLeft:5,borderLeft:"2px solid var(--line)",padding:"2px 0 2px 13px",fontSize:12,color:"var(--t4)",lineHeight:1.7,whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .2s ease"},children:i})]})}function ey({entries:i}){const s=o=>o==="completed"?"☑":o==="in_progress"?"◐":"☐";return a.jsx("div",{className:"card",style:{padding:"11px 14px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:i.map((o,u)=>a.jsxs("div",{style:{color:o.status==="completed"?"var(--t5)":o.status==="in_progress"?"var(--acc)":"var(--t2)",textDecoration:o.status==="completed"?"line-through":"none"},children:[a.jsx("span",{style:{display:"inline-block",width:18},children:s(o.status)})," ",o.content]},u))})}function ty({status:i}){return i==="ok"?a.jsx(kc,{size:11}):i==="fail"?a.jsx("span",{style:{color:"var(--err)",fontSize:11,flex:"none"},children:"✗"}):a.jsx("span",{style:{width:7,height:7,borderRadius:"50Line truncated
|
||||
`),p=[],g=[],m=[];for(const v of d){const S=v.match(oy);S&&s?(S[1]==="图片"?p:g).push(S[2]):m.push(v)}const w=m.join(`
|
||||
`).trim();return a.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[a.jsxs("div",{style:{maxWidth:"70%",background:"var(--userBg)",border:"1px solid var(--accBd)",borderRadius:"12px 12px 3px 12px",padding:"9px 15px",fontSize:13.5,lineHeight:1.6,color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:[w,(p.length>0||g.length>0)&&a.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:w?8:2,alignItems:"center"},children:[p.map(v=>a.jsx("img",{src:s(v),alt:v,title:v,onClick:()=>u(v),style:{maxWidth:150,maxHeight:120,borderRadius:8,border:"1px solid var(--accBd)",cursor:"zoom-in",display:"block"}},v)),g.map(v=>a.jsxs("span",{title:v+"(点击下载)",onClick:()=>Ff(new URL(s(v),location.origin).href),style:{height:28,display:"flex",alignItems:"center",gap:6,padding:"0 10px",borderRadius:8,border:"1px solid var(--accBd)",background:"var(--card)",fontSize:12,color:"var(--t2)",maxWidth:240,cursor:"pointer"},children:["📄",a.jsx("span",{className:"ellipsis",children:v.split("/").pop()})]},v))]})]}),o&&a.jsx("div",{onClick:()=>u(null),style:{position:"fixed",inset:0,background:"var(--scrim3)",zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out"},children:a.jsx("img",{src:s(o),alt:o,style:{maxWidth:"90vw",maxHeight:"90vh",borderRadius:10,boxShadow:"var(--shadowLg)"}})})]})}function ay({item:i,onPermAnswer:s,uploadUrl:o}){switch(i.kind){case"user":return a.jsx(ly,{text:i.text,uploadUrl:o});case"agent":return a.jsx("div",{style:{maxWidth:"92%",wordBreak:"break-word",animation:"mcin .25s ease"},children:a.jsx(Jv,{text:i.text})});case"thought":return a.jsx($v,{text:i.text});case"plan":return a.jsx(ey,{entries:i.entries});case"sys":return i.text==="— 本轮结束 —"?a.jsx(sy,{}):a.jsx("div",{style:{color:i.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:i.text});case"perm":return a.jsx(iy,{item:i,onAnswer:s})}}function Ep({items:i,onPermAnswer:s,onOpenChild:o,uploadUrl:u,workdir:d}){const p=[];for(let g=0;g<i.length;){const m=i[g];if(m.kind==="tool"){const w=g,v=[];for(;g<i.length;){const S=i[g];if(S.kind!=="tool")break;v.push(S),g++}p.push(a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:v.map((S,D)=>a.jsx(ry,{item:S,onOpenChild:o,workdir:d},S.tcId||D))},"g"+w))}else p.push(a.jsx(ay,{item:m,onPermAnswer:s,uploadUrl:u},g)),g++}return a.jsx(a.Fragment,{children:p})}function cy(i){const s=[];let o=0,u=0;for(const d of i.split(`
|
||||
`)){const p=d.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(p){o=+p[1],u=+p[2],s.push({no:"",text:d,kind:"h"});continue}d.startsWith("diff ")||d.startsWith("index ")||d.startsWith("+++")||d.startsWith("---")||d.startsWith("new file")||d.startsWith("deleted file")||d.startsWith("similarity")||d.startsWith("rename")||d.startsWith("old mode")||d.startsWith("new mode")||(d.startsWith("+")?s.push({no:String(u++),text:d,kind:"add"}):d.startsWith("-")?s.push({no:String(o++),text:d,kind:"del"}):(s.push({no:String(u),text:d,kind:"ctx"}),o++,u++))}return s}function uy({text:i}){const s=L.useMemo(()=>cy(i),[i]);return s.some(o=>o.kind==="h")?a.jsx("div",{style:{font:"12px/1.9 "+Tt},children:s.map((o,u)=>o.kind==="h"?a.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--codeBg)",color:"var(--t4)",fontSize:11},children:[a.jsx("span",{style:{width:36,flex:"none"}}),a.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:o.text})]},u):a.jsxs("div",{style:{display:"flex",padding:"0 24px",background:o.kind==="add"?"var(--addBg)":o.kind==="del"?"var(--delBg)":"transparent",color:o.kind==="add"?"var(--addT)":o.kind==="del"?"var(--delT)":"var(--t3)"},children:[a.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:o.no}),a.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:o.text||" "})]},u))}):a.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap"},children:i})}for(const[i,s]of Object.entries({bash:Am,c:_m,cpp:Rm,css:Pm,go:Bm,ini:Um,java:Fm,javascript:qm,json:Km,markdown:Zm,python:Xm,rust:Vm,sql:Qm,typescript:$m,xml:ev,yaml:tv}))qf.registerLanguage(i,s);const dy={js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",go:"go",py:"python",rs:"rust",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",hpp:"cpp",json:"json",css:"css",html:"xml",htm:"xml",xml:"xml",svg:"xml",vue:"xml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",sql:"sql",ini:"ini",toml:"ini",conf:"ini"};function fy(i){const s=[],o=[];for(const u of i.split(`
|
||||
`)){const d=o.join(""),p=/<span[^>]*>|<\/span>/g;for(let g=p.exec(u);g;g=p.exec(u))g[0]==="</span>"?o.pop():o.push(g[0]);s.push(d+u+"</span>".repeat(o.length))}return s}const Tf={flex:1,minWidth:0,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--t2)"};function py({path:i,text:s}){const o=L.useMemo(()=>{var p;const u=((p=i.split(".").pop())==null?void 0:p.toLowerCase())??"",d=dy[u];if(d)try{return{html:!0,rows:fy(qf.highlight(s,{language:d}).value)}}catch{}return{html:!1,rows:s.split(`
|
||||
`)}},[i,s]);return a.jsx("div",{style:{font:"12px/1.9 "+Tt},children:o.rows.map((u,d)=>a.jsxs("div",{style:{display:"flex",padding:"0 24px"},children:[a.jsx("span",{style:{width:42,color:"var(--t5)",flex:"none",opacity:.6,userSelect:"none"},children:d+1}),o.html?a.jsx("span",{className:"hl",style:Tf,dangerouslySetInnerHTML:{__html:u||" "}}):a.jsx("span",{style:Tf,children:u||" "})]},d))})}const ul="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAABRHElEQVR4nO29d5xU1fn4/z7nlukzuwtLFQSxYkM0xkqxG40dkqiJibFrNNUYUxbSjUlMMTEmxhg1FogxdmMDLBhRBBRsiIL0Xdg2O/Xee57fH3dmG7sUP7Z8fz6v192ZvXPvac9znvO08xz4GD6Gj+Fj+Bg+ho/hY/gYPoaP4WP4GDYPCkEB6sNuyHsB/0904n0BEdXANPUKu6tG6tWc2bPD+5On+53PzJhhMXVq8OE08GN4T6FBRE+cNctmVoONoPt6RgEiokTEFiScPPK/PYn+pxv/fwIRNYWZeubsJYrJ0wNAqj85QFkk8p32p7ZvtstjlwXNw7yCN369KqadwN69mUI0HkuUDqD+67fWHPMwIhqlzIfXmXcP/78iABFRk2ZPs+ZM2l1QXaw7iuY2Wbrzo+3v7P+W17Z3ixT3bglyu7T6heFByrU8BaXAIIDn+WhfMAmbnQqRpnmDT965lto2QVBKSf+1fzTB/rAb8H5DF9IxKpylvgZekw3p6S3PT1pOduIGv3jQ19bO3rc9rpyCZfADD4MPtkDZC5TliHIc8DzsnKdFI7T75NFuPpu3SSP/q0vB/5sEIKgpzNAzAaVUAPgW8IsNC4b/hxWHvynZCRMa/310wWW7ojb4vkcgHpScQEcjYumIsjxLmeYOJavXWtaKZmRFI6qtjLn4MCRp+1Yibo/Opf65XXr4BmSGVannfw7+J6m2XxBRMFNX2bsCnpa1g37ePu/YpaWWkzaUSocVE066hMGUS6C00VHXCEap5pxm2TrFS2uQRavg9bXoVa3Q3IEqeaigiLngWPyfnyymNSeDIml/urXPHhcOGr+0QURP/x+VAf7f4AAiitnTLJTygUBErCuL8ybNyq88fWrTg8e1RxmcUwWMeFCOBFYsJqioZtlazQtLtZ77Fix6B95pgVwJhYBloRwLcW0wgtl5e4IrjoZsIXAHpO2x2dRtFw0av3SKzLCmd5/9EmoHDaBeYWaoQgITZ89mTncV8iMC/9sE0BPxvoikj9l41yn7brjjslUUxrXaQjmfQ3k6IOagHNHq1XUWT7yGmv0aevEqVEsuLCvigGtDTTzUB0TAhJNaiiX8y46BVERMtqSH5q22y4bu9oPZsxrst9hBIbMUs2fDpOkBFUFwejetAmDOBzku2wD/mwTQC/E/WfNk/b322gtGbbjpvA2Ov12hWEKKgVjpRGDFUhZvrbHUYy+jHl6CWrgK2vMo24KoCzUJAJQRRAQCg5IK9iyNastjjt4TOXEvZGOHiQ6us8ZlMz86We25EmA+0wHQlcsTiZ2fe7LGb+8Y/nI0PyRdlnEron56Tz+y+IH6qTeXja/4CGkL/1sygIiaOHuaVWWl31n32OC7WXVBU1C8MB+3B5eyObTSgUrFlLQVNLNfhbsXop95A92UBdtG4g5YujLDpcc87RoMCW/7BhIu/j0XIiNqjSitx0vd3KUjv3zwDR0Lh8xh3bA3TW5ULl/cb43JDTLCnh1+eVCADPYJYioZxbc1HoZMOskRG2u+fMfAY26cOKvB/qgsB/8zHGCKzLBmKhXMAf/BNW/UX6nnXXS9WnpRNqoHeW0FrJzjW8mkJWtbLHXzXNSMeaiXV4cITkSQ2gRKBGXCWS59IV5RIQgFWkEhT/CTUzC7DEVt6FA67mCQRO3K6174WsucnXPapIJYhGIkIBDBeCZ8D4WyHKzAD1TWE6PwmrXlNPnueODGOZM+yJHbPHz0CaAi2c9UUwNZLfHPxB74+kXlpy9aF/GHltqLqED7OhWz5M2Nttz2H/RdL6DfaQbXQdJxUKCMgcB0K7Jb+b15oAKUQnUUMSftS3D6vtCcQ1lKScFjQax5b21biB8gWOCXAhxLlAIlKJX3lW4uKFnXrqxs3goOGkUAemBZ9FidnPk4MIXdZeYHMHRbAx9tApAZFkoFFgRHrPvnETs5N/1yncveHdk2tGf7Oh235I01tv7rM+i7F6KasqhYFGqTYAwqMH0vcqrPr12gFQSG4LR9kHQEVfCRuAu2g6UwlANUyVN6Q5uSVc2WWdaEfr0RtboFVrdBcwes2Uhw4WFw9C5GlQNdn+e132135Nzfi6iZfHRUxo8kATRIg54OoKYGV699ZtCNeumP5+rmcztKJXQ28O1M0pJ3Ntr87F7sO+ejNuYhEYHaBAQCftA5k3sJ40B/gk+3uyLg2Og75mP23g7KBvXSanhrIyxdr9VbG1ArN6DWZ9HZAlbJR1WWDbE1ojVqYB3mnCMwxcDE4km9k19zo1LKmyiz7DmKj8T6Dx9BITBc66cGDnD4hn+dtcg0X9XoeIODDXljZZJQ8rX+2xzUdbNgbRsqEQPHCmd8Fdeq8w99EUDf0H0oBJRCch5SEwnL35hHlT1AobRGHAscC2WpCqEREo5W0JIjOGsi5prTJWhvU0OtVMfN6aNGHZnZbiMiHykt4KPDAUQUTLNmqqn+39YuGPU76/VfP221nNzRkUWjAzUwacnjr6F/9hB6/ltQZfVBuL5vSsnbMsZ9CAJGUAkHVQiQvA9RBxJupWQBA4ggRlBIVW8ImXsignzhE0i5EFjJmF2b5bojM9tt3PGN30beVKr0rsbnfYI+/d4fNDRIg4ZpSqvp/iUts076sbvwhUV228m5xtbAiseFjoJlfe027M/9CWvRSqhNoRyN8sNZvwny36v5ZQQsULYKNYigIlcE0kOSrKA+VC87SshRY5E9hkOuqHVgJJ2uSTzZ/kb9mztfVkJQYX8/GvChLwFVlh/D4vDGu66a57Ze3phtQRsC0mmLexZgTbsLvXwjZLqMNpuFd9WrXkuA9PqtF9eWTb4QGo5a85gzD8S/4axQKC36YtVnVH2Jd3aza3/6yOMn3aCmqiCUBSZ/6LLAh0oAE2fNsudMnuzPWL94yDT94g3Lk95x+TUtgZ1KaNORV9aPH0DdNBdsGxV3QsOMIhS4+oKt7E0PUaHfh3r9qrq/2QeTka5PsRTmgklw+gHIiHpMW0cg2ljxmgxDcjx9hD/ooj+PPO5lQs4nH6ZM8KERQNUa9sN3Ht3zL9Y7d66Jm92Cja2erk878vwKrK/egbV4JZJOojDhmktV3tqSHtc/bG6kexS1BSrplwAgXB46CsjgDP6XJ8AXJ6JTWoL2fEBNzK4N7Pw4u/7Spwed9tcyFa1HTf9QVMMPhQD2feF6Z/5+53tfanxw4mx7w/1vl9uSusP3ZWDcVv94Guvyu1FFg0pFwa9yybCp7ycB9Ib+it4s8qtgayj6UCgguw5HvnMcwXF7oLLFIBBjpQcNYOecc/vz/qRz1PDh+Q+LCD5wAqiufUe/ffukBcnC/Y3FbMIKCEzCtfTP7sP69WMQj0JFyOtUsbq1WL1LAng3fLZ38X2W0d9NpUK3cr6M+AH+5w/AfO9EVCoiqr0jYEDC3q0cX3h2cdCnvj7q2LVVeehdNPNdwwdLADLDQk0NJr59y6SXEsX720qFhCXKBBqtv34b1oznIZMK3bCmKt73RQDhF2FT+ths9e9VP7ay8E5LRMU/QFuOYPdhyG/PRO0zEtnQ6pu6hD2gZL1yaPvAI+4ee+oHTgQfmDoypYL8s9Y+NGlxwru/pVhIKKNNIKL1F/6CnvE8UpOCIAiRD/SP/G4yV2+B/aMAFXyLqrTNCJgAauPo19djnfI75O4FmEEDbasl72+MmLFPDWh+7KvLHxo6U00NGkQ+MLx8IBU1SIOeqaYGv9w4b8QcveHfG/18wjbKGAutz/4r+olXUTUplBdsEZtC34986ESgen32Bb5BJSMoX9Dn3Yh1/eMwoMa2Wwt+s23G/jve9NgNTa8Om46SD8pW8P5XIqKmz3xFiUjkT6U37luhOjJWKQiCiNb6gr+hH38FapLgdeN6nRuvpNf/PQru8+vm4APfz9VXuwIDtkYnolhXzED9/nGC+gG21Zz3VzrFsdd6zz8kS8SZDp3hZe8nfABUNs3SU2cG49fdfu076fLeVkfJl5q4pa+ciXX/IsiEyO/bZbOl/r+7ef+ejar0unrf7w+qS1w6jpr2L/R1j8OAtK0b2/yXo7m9xqf+/jdHTTcw833Hz/tawRQRCzXdP3blfV94M+mdU25q8U1d0ubaR7H+9gySToaeuwr0OWZ9ieE9BngzxpnNwLviBv0hvPczm61R9ZBcVSqG/u4M5K75mPpam6YO/42a4PRxq247CzU1mDhr1vvqr3nfCGDKjBnWTJS5WRbvuDje+sdsc6uxkjFLZi1G/+h+SMbCQI1uoHr+2RR6D253IpC+H9kSbBURbGlGv1uQsAEq5qK/cRvqxZXoTNwqNLcGbzv5P3y9adaucyZP9pkxw3ofagfeRwKYCbhKy28bF/1qtVNMWMoxQXNRWZfPREsl5Kp3WFZf2NjSjOt6+10habOvvJeIr0z8TS4BHBtV8NCX3oxpLylLO7TYfuIhb/lfRMRmCu+bPPD+EICE26aPW3vfYW9F/RPMxlxAKmLrXzyAXtoIcSf0qFVgU+RvydmjUNVrk7q3qoTNP9Mv4jf9QXVLine truncated
|
||||
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${hr(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:s,tokens:o}){const u=this.parser.parseInline(o),d=vf(i);if(d===null)return u;i=d;let p='<a href="'+i+'"';return s&&(p+=' title="'+hr(s)+'"'),p+=">"+u+"</a>",p}image({href:i,title:s,text:o,tokens:u}){u&&(o=this.parser.parseInline(u,this.parser.textRenderer));const d=vf(i);if(d===null)return hr(o);i=d;let p=`<img src="${i}" alt="${o}"`;return s&&(p+=` title="${hr(s)}"`),p+=">",p}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:hr(i.text)}},wc=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}},Cr=class oc{constructor(s){ht(this,"options");ht(this,"renderer");ht(this,"textRenderer");this.options=s||mi,this.options.renderer=this.options.renderer||new el,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wc}static parse(s,o){return new oc(o).parse(s)}static parseInline(s,o){return new oc(o).parseInline(s)}parse(s,o=!0){var d,p;let u="";for(let g=0;g<s.length;g++){const m=s[g];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[m.type]){const v=m,E=this.options.extensions.renderers[v.type].call({parser:this},v);if(E!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(v.type)){u+=E||"";continue}}const x=m;switch(x.type){case"space":{u+=this.renderer.space(x);continue}case"hr":{u+=this.renderer.hr(x);continue}case"heading":{u+=this.renderer.heading(x);continue}case"code":{u+=this.renderer.code(x);continue}case"table":{u+=this.renderer.table(x);continue}case"blockquote":{u+=this.renderer.blockquote(x);continue}case"list":{u+=this.renderer.list(x);continue}case"html":{u+=this.renderer.html(x);continue}case"paragraph":{u+=this.renderer.paragraph(x);continue}case"text":{let v=x,E=this.renderer.text(v);for(;g+1<s.length&&s[g+1].type==="text";)v=s[++g],E+=`
|
||||
`+this.renderer.text(v);o?u+=this.renderer.paragraph({type:"paragraph",raw:E,text:E,tokens:[{type:"text",raw:E,text:E,escaped:!0}]}):u+=E;continue}default:{const v='Token with "'+x.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}parseInline(s,o=this.renderer){var d,p;let u="";for(let g=0;g<s.length;g++){const m=s[g];if((p=(d=this.options.extensions)==null?void 0:d.renderers)!=null&&p[m.type]){const v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){u+=v||"";continue}}const x=m;switch(x.type){case"escape":{u+=o.text(x);break}case"html":{u+=o.html(x);break}case"link":{u+=o.link(x);break}case"image":{u+=o.image(x);break}case"strong":{u+=o.strong(x);break}case"em":{u+=o.em(x);break}case"codespan":{u+=o.codespan(x);break}case"br":{u+=o.br(x);break}case"del":{u+=o.del(x);break}case"text":{u+=o.text(x);break}default:{const v='Token with "'+x.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return u}},tc,Xo=(tc=class{constructor(i){ht(this,"options");ht(this,"block");this.options=i||mi}preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}provideLexer(){return this.block?Rr.lex:Rr.lexInline}provideParser(){return this.block?Cr.parse:Cr.parseInline}},ht(tc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),tc),zv=class{constructor(...i){ht(this,"defaults",fc());ht(this,"options",this.setOptions);ht(this,"parse",this.parseMarkdown(!0));ht(this,"parseInline",this.parseMarkdown(!1));ht(this,"Parser",Cr);ht(this,"Renderer",el);ht(this,"TextRenderer",wc);ht(this,"Lexer",Rr);ht(this,"Tokenizer",$o);ht(this,"Hooks",Xo);this.use(...i)}walkTokens(i,s){var u,d;let o=[];for(const p of i)switch(o=o.concat(s.call(this,p)),p.type){case"table":{const g=p;for(const m of g.header)o=o.concat(this.walkTokens(m.tokens,s));for(const m of g.rows)for(const x of m)o=o.concat(this.walkTokens(x.tokens,s));break}case"list":{const g=p;o=o.concat(this.walkTokens(g.items,s));break}default:{const g=p;(d=(u=this.defaults.extensions)==null?void 0:u.childTokens)!=null&&d[g.type]?this.defaults.extensions.childTokens[g.type].forEach(m=>{const x=g[m].flat(1/0);o=o.concat(this.walkTokens(x,s))}):g.tokens&&(o=o.concat(this.walkTokens(g.tokens,s)))}}return o}use(...i){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(o=>{const u={...o};if(u.async=this.defaults.async||u.async||!1,o.extensions&&(o.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const p=s.renderers[d.name];p?s.renderers[d.name]=function(...g){let m=d.renderer.apply(this,g);return m===!1&&(m=p.apply(this,g)),m}:s.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=s[d.level];p?p.unshift(d.tokenizer):s[d.level]=[d.tokenizer],d.start&&(d.level==="block"?s.startBlock?s.startBlock.push(d.start):s.startBlock=[d.start]:d.level==="inline"&&(s.startInline?s.startInline.push(d.start):s.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(s.childTokens[d.name]=d.childTokens)}),u.extensions=s),o.renderer){const d=this.defaults.renderer||new el(this.defaults);for(const p in o.renderer){if(!(p in d))throw new Error(`renderer '${p}' does not exist`);if(["options","parser"].includes(p))continue;const g=p,m=o.renderer[g],x=d[g];d[g]=(...v)=>{let E=m.apply(d,v);return E===!1&&(E=x.apply(d,v)),E||""}}u.renderer=d}if(o.tokenizer){const d=this.defaults.tokenizer||new $o(this.defaults);for(const p in o.tokenizer){if(!(p in d))throw new Error(`tokenizer '${p}' does not exist`);if(["options","rules","lexer"].includes(p))continue;const g=p,m=o.tokenizer[g],x=d[g];d[g]=(...v)=>{let E=m.apply(d,v);return E===!1&&(E=x.apply(d,v)),E}}u.tokenizer=d}if(o.hooks){const d=this.defaults.hooks||new Xo;for(const p in o.hooks){if(!(p in d))throw new Error(`hook '${p}' does not exist`);if(["options","block"].includes(p))continue;const g=p,m=o.hooks[g],x=d[g];Xo.passThroughHooks.has(p)?d[g]=v=>{if(this.defaults.async)return Promise.resolve(m.call(d,v)).then(z=>x.call(d,z));const E=m.call(d,v);return x.call(d,E)}:d[g]=(...v)=>{let E=m.apply(d,v);return E===!1&&(E=x.apply(d,v)),E}}u.hooks=d}if(o.walkTokens){const d=this.defaults.walkTokens,p=o.walkTokens;u.walkTokens=function(g){let m=[];return m.push(p.call(this,g)),d&&(m=m.concat(d.call(this,g))),m}}this.defaults={...this.defaults,...u}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,s){return Rr.lex(i,s??this.defaults)}parser(i,s){return Cr.parse(i,s??this.defaults)}parseMarkdown(i){return(o,u)=>{const d={...u},p={...this.defaults,...d},g=this.onError(!!p.silent,!!p.async);if(this.defaults.async===!0&&d.async===!1)return g(new Error("marked(): The async option was set to tLine truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,i){const u="<p>An error occurred:</p><pre>"+hr(o.message+"",!0)+"</pre>";return s?Promise.resolve(u):u}if(s)return Promise.reject(o);throw o}}},gi=new zv;function lt(i,s){return gi.parse(i,s)}lt.options=lt.setOptions=function(i){return gi.setOptions(i),lt.defaults=gi.defaults,ip(lt.defaults),lt};lt.getDefaults=fc;lt.defaults=mi;lt.use=function(...i){return gi.use(...i),lt.defaults=gi.defaults,ip(lt.defaults),lt};lt.walkTokens=function(i,s){return gi.walkTokens(i,s)};lt.parseInline=gi.parseInline;lt.Parser=Cr;lt.parser=Cr.parse;lt.Renderer=el;lt.TextRenderer=wc;lt.Lexer=Rr;lt.lexer=Rr.lex;lt.Tokenizer=$o;lt.Hooks=Xo;lt.parse=lt;lt.options;lt.setOptions;lt.use;lt.walkTokens;lt.parseInline;Cr.parse;Rr.lex;const Ct={flex:"none",display:"block"};function Ir({size:i=13,color:s="var(--t3)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M1.5 4a1.5 1.5 0 0 1 1.5-1.5h2.6l1.3 1.5H11A1.5 1.5 0 0 1 12.5 5.5v5A1.5 1.5 0 0 1 11 12H3a1.5 1.5 0 0 1-1.5-1.5V4z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function Ms({size:i=13,color:s="var(--t4)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("path",{d:"M3.5 2.8A1.3 1.3 0 0 1 4.8 1.5h3.4l2.3 2.3v7.4a1.3 1.3 0 0 1-1.3 1.3H4.8a1.3 1.3 0 0 1-1.3-1.3V2.8z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("path",{d:"M8 1.7v2.5h2.4",stroke:s,strokeWidth:"1.1",strokeLinejoin:"round"})]})}function Pv({size:i=12,color:s="var(--t3)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M2.3 9.7 9.2 2.8a1.25 1.25 0 0 1 1.77 0l.23.23a1.25 1.25 0 0 1 0 1.77L4.3 11.7l-2.6.6.6-2.6z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function lc({size:i=14,color:s="var(--t5)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M4.5 12.5a3 3 0 0 1-.4-5.97 4 4 0 0 1 7.8-.03 2.75 2.75 0 0 1-.4 6H4.5z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"})})}function Ec({size:i=14,color:s="var(--t5)",strokeWidth:o=1.2,style:u}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...Ct,...u},children:[a.jsx("rect",{x:"2",y:"3.5",width:"12",height:"7.5",rx:"1.4",stroke:s,strokeWidth:o}),a.jsx("path",{d:"M5.5 13.5h5",stroke:s,strokeWidth:o,strokeLinecap:"round"})]})}function cl({size:i=11,color:s="var(--t4)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 12 12",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M6 2v8M2 6h8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round"})})}function Sc({size:i=10,color:s="var(--t5)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M3.5 2L7 5 3.5 8",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ac({size:i=8,color:s="var(--t6)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 10 10",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M2 3.5 5 6.5 8 3.5",stroke:s,strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function gp({size:i=12,color:s="var(--t3)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("circle",{cx:"3",cy:"7",r:"1.1",fill:s}),a.jsx("circle",{cx:"7",cy:"7",r:"1.1",fill:s}),a.jsx("circle",{cx:"11",cy:"7",r:"1.1",fill:s})]})}function mp({size:i=12,color:s="var(--t3)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("rect",{x:"2",y:"2.5",width:"10",height:"3",rx:"1",stroke:s,strokeWidth:"1.2"}),a.jsx("path",{d:"M3 5.5v4A1.5 1.5 0 0 0 4.5 11h5A1.5 1.5 0 0 0 11 9.5v-4M5.5 7.5h3",stroke:s,strokeWidth:"1.2",strokeLinecap:"round"})]})}function tl({size:i=12,color:s="var(--err)",style:o}){return a.jsx("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:a.jsx("path",{d:"M2.5 3.5h9M5.5 3.5v-1h3v1M4 3.5l.5 7A1.5 1.5 0 0 0 6 12h2a1.5 1.5 0 0 0 1.5-1.5l.5-7",stroke:s,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function vp({size:i=15,color:s="var(--t3)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 16 16",fill:"none",style:{...Ct,...o},children:[a.jsx("path",{d:"M6.8 1.8h2.4l.3 1.6c.5.2 1 .4 1.4.8l1.6-.6 1.2 2-1.3 1.1c.05.25.1.55.1.85s-.05.6-.1.85l1.3 1.1-1.2 2-1.6-.6c-.4.35-.9.6-1.4.8l-.3 1.6H6.8l-.3-1.6c-.5-.2-1-.45-1.4-.8l-1.6.6-1.2-2 1.3-1.1A4.6 4.6 0 0 1 3.5 8c0-.3.03-.6.1-.85L2.3 6l1.2-2 1.6.6c.4-.35.9-.6 1.4-.8l.3-2z",stroke:s,strokeWidth:"1.2",strokeLinejoin:"round"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.9",stroke:s,strokeWidth:"1.2"})]})}function Bv({size:i=13,color:s="var(--t5)",style:o}){return a.jsxs("svg",{width:i,height:i,viewBox:"0 0 14 14",fill:"none",style:{...Ct,...o},children:[a.jsx("circle",{cx:"7",cyLine truncated
|
||||
`)[0].slice(0,160):"";d[p]={...g,status:s.status==="completed"?"ok":"fail",out:m,lastLine:void 0};break}}return{...i,items:d}}case"plan":{const d=i.items.slice(),p=d[d.length-1];return p&&p.kind==="plan"?(d[d.length-1]={kind:"plan",entries:s.entries??[]},{...i,items:d,streamKind:""}):Vr(i,{kind:"plan",entries:s.entries??[]})}case"llm_call_retry":return Vr(i,{kind:"sys",text:`模型调用重试 #${s.attempt??"?"}: ${s.message??""}`});case"usage_update":return{...i,usage:{used:s.used??0,size:s.size??0}};case"compact_status":return Vr(i,{kind:"sys",text:s.status==="started"?"⟳ 上下文接近上限,正在压缩…":"⟳ 上下文压缩完成"});case"model_update":{const d=s.model??"";return{...Vr(i,{kind:"sys",text:`模型已切换为 ${d}`}),model:d}}case"permission_mode_update":{const d=s.mode??"default";return{...Vr(i,{kind:"sys",text:d==="yolo"?"⚡ 已开启 YOLO 模式:所有操作不再询问,直接执行":"已恢复默认权限模式"}),permMode:d}}default:return i}}function Kv(i,s){switch(s.type){case"task-started":return{...i,running:!0};case"task-ended":return{...i,running:!1,streamKind:"",turnEnded:!0,items:[...Sf(i.items),{kind:"sys",text:"— 本轮结束 —"}]};case"task-error":{const o=Zi(s);return{...i,running:!1,streamKind:"",items:[...Sf(i.items),{kind:"sys",text:"✗ "+((o==null?void 0:o.error)||"未知错误"),error:!0}]}}case"user-input":{const o=Zi(s);let u="";try{u=o!=null&&o.content?Pf(o.content):""}catch{u=(o==null?void 0:o.content)??""}return Vr(i,{kind:"user",text:u})}case"permission-req":{const o=Zi(s);return o!=null&&o.id?Vr(i,{kind:"perm",id:o.id,title:o.title??"",tool:o.tool??"",state:"open"}):i}case"permission-resolved":{const o=Zi(s);return o!=null&&o.id?{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===o.id&&u.state==="open"?{...u,state:o.outcome??"expired"}:u)}:i}case"task-running":if(s.kind==="acp_event"){const o=Zi(s);if(o!=null&&o.update)return qv(i,o.update)}return i;default:return i}}function wp(i,s){let o=i;for(const u of s)o=Kv(o,u);return o}function Zv(i,s,o){return{...i,items:i.items.map(u=>u.kind==="perm"&&u.id===s&&u.state==="open"?{...u,state:o?"allowed":"rejected"}:u)}}lt.setOptions({gfm:!0,breaks:!0});const Xv=new lt.Renderer;lt.use({renderer:{code(i){return`<div class="mdcode">${Xv.code(i)}<button class="mdcopy" type="button">复制</button></div>`}}});function Vv(i){var o;const s=()=>{const u=document.createElement("textarea");u.value=i,u.style.cssText="position:fixed;opacity:0",document.body.appendChild(u),u.select(),document.execCommand("copy"),u.remove()};(o=navigator.clipboard)!=null&&o.writeText?navigator.clipboard.writeText(i).catch(s):s()}const Tt='"JetBrains Mono","HarmonyOS Sans SC",ui-monospace,Menlo,Consolas,"Courier New","Microsoft YaHei",monospace';function Qv(i){var p,g;const s=i.target,o=s.closest("button.mdcopy");if(o){Vv(((g=(p=o.parentElement)==null?void 0:p.querySelector("pre"))==null?void 0:g.textContent)??""),o.textContent="已复制",o.classList.add("ok"),window.setTimeout(()=>{o.textContent="复制",o.classList.remove("ok")},1500);return}const u=s.closest("a");if(!u)return;i.preventDefault();const d=u.getAttribute("href")||"";/^https?:/i.test(d)&&Ff(d)}function Jv({text:i}){const s=D.useMemo(()=>bm.sanitize(lt.parse(i,{async:!1})),[i]);return a.jsx("div",{className:"md",onClick:Qv,dangerouslySetInnerHTML:{__html:s}})}function $v({text:i}){const[s,o]=D.useState(!1);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[a.jsxs("div",{onClick:()=>o(!s),style:{display:"flex",alignItems:"center",gap:8,fontSize:12,color:"var(--t4)",cursor:"pointer",userSelect:"none",lineHeight:1.6,minWidth:0},children:[a.jsx(xp,{}),a.jsx("span",{style:{fontWeight:600,color:"var(--t3)",flex:"none"},children:"思考"}),!s&&a.jsx("span",{className:"ellipsis",style:{flex:1,minWidth:0},children:i.trim().replace(/\s+/g," ")}),s&&a.jsx("span",{style:{flex:1}}),a.jsx(Sc,{size:9,color:"var(--t6)",style:{transform:s?"rotate(90deg)":"none",transition:"transform .15s ease"}})]}),s&&a.jsx("div",{style:{marginLeft:5,borderLeft:"2px solid var(--line)",padding:"2px 0 2px 13px",fontSize:12,color:"var(--t4)",lineHeight:1.7,whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .2s ease"},children:i})]})}function ey({entries:i}){const s=o=>o==="completed"?"☑":o==="in_progress"?"◐":"☐";return a.jsx("div",{className:"card",style:{padding:"11px 14px",fontSize:12.5,display:"flex",flexDirection:"column",gap:4,animation:"mcin .25s ease"},children:i.map((o,u)=>a.jsxs("div",{style:{color:o.status==="completed"?"var(--t5)":o.status==="in_progress"?"var(--acc)":"var(--t2)",textDecoration:o.status==="completed"?"line-through":"none"},children:[a.jsx("span",{style:{display:"inline-block",width:18},children:s(o.status)})," ",o.content]},u))})}function ty({status:i}){return i==="ok"?a.jsx(kc,{size:11}):i==="fail"?a.jsx("span",{style:{color:"var(--err)",fontSize:11,flex:"none"},children:"✗"}):a.jsx("span",{style:{width:7,height:7,borderRadius:"50Line truncated
|
||||
`),p=[],g=[],m=[];for(const v of d){const E=v.match(oy);E&&s?(E[1]==="图片"?p:g).push(E[2]):m.push(v)}const x=m.join(`
|
||||
`).trim();return a.jsxs("div",{style:{display:"flex",justifyContent:"flex-end"},children:[a.jsxs("div",{style:{maxWidth:"70%",background:"var(--userBg)",border:"1px solid var(--accBd)",borderRadius:"12px 12px 3px 12px",padding:"9px 15px",fontSize:13.5,lineHeight:1.6,color:"var(--t1)",whiteSpace:"pre-wrap",wordBreak:"break-word",animation:"mcin .25s ease"},children:[x,(p.length>0||g.length>0)&&a.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:x?8:2,alignItems:"center"},children:[p.map(v=>a.jsx("img",{src:s(v),alt:v,title:v,onClick:()=>u(v),style:{maxWidth:150,maxHeight:120,borderRadius:8,border:"1px solid var(--accBd)",cursor:"zoom-in",display:"block"}},v)),g.map(v=>a.jsxs("span",{title:v+"(点击下载)",onClick:()=>Ff(new URL(s(v),location.origin).href),style:{height:28,display:"flex",alignItems:"center",gap:6,padding:"0 10px",borderRadius:8,border:"1px solid var(--accBd)",background:"var(--card)",fontSize:12,color:"var(--t2)",maxWidth:240,cursor:"pointer"},children:["📄",a.jsx("span",{className:"ellipsis",children:v.split("/").pop()})]},v))]})]}),o&&a.jsx("div",{onClick:()=>u(null),style:{position:"fixed",inset:0,background:"var(--scrim3)",zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out"},children:a.jsx("img",{src:s(o),alt:o,style:{maxWidth:"90vw",maxHeight:"90vh",borderRadius:10,boxShadow:"var(--shadowLg)"}})})]})}function ay({item:i,onPermAnswer:s,uploadUrl:o}){switch(i.kind){case"user":return a.jsx(ly,{text:i.text,uploadUrl:o});case"agent":return a.jsx("div",{style:{maxWidth:"92%",wordBreak:"break-word",animation:"mcin .25s ease"},children:a.jsx(Jv,{text:i.text})});case"thought":return a.jsx($v,{text:i.text});case"plan":return a.jsx(ey,{entries:i.entries});case"sys":return i.text==="— 本轮结束 —"?a.jsx(sy,{}):a.jsx("div",{style:{color:i.error?"var(--err)":"var(--t5)",fontSize:11.5,textAlign:"center"},children:i.text});case"perm":return a.jsx(iy,{item:i,onAnswer:s})}}function Ep({items:i,onPermAnswer:s,onOpenChild:o,uploadUrl:u,workdir:d}){const p=[];for(let g=0;g<i.length;){const m=i[g];if(m.kind==="tool"){const x=g,v=[];for(;g<i.length;){const E=i[g];if(E.kind!=="tool")break;v.push(E),g++}p.push(a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:v.map((E,z)=>a.jsx(ry,{item:E,onOpenChild:o,workdir:d},E.tcId||z))},"g"+x))}else p.push(a.jsx(ay,{item:m,onPermAnswer:s,uploadUrl:u},g)),g++}return a.jsx(a.Fragment,{children:p})}function cy(i){const s=[];let o=0,u=0;for(const d of i.split(`
|
||||
`)){const p=d.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(p){o=+p[1],u=+p[2],s.push({no:"",text:d,kind:"h"});continue}d.startsWith("diff ")||d.startsWith("index ")||d.startsWith("+++")||d.startsWith("---")||d.startsWith("new file")||d.startsWith("deleted file")||d.startsWith("similarity")||d.startsWith("rename")||d.startsWith("old mode")||d.startsWith("new mode")||(d.startsWith("+")?s.push({no:String(u++),text:d,kind:"add"}):d.startsWith("-")?s.push({no:String(o++),text:d,kind:"del"}):(s.push({no:String(u),text:d,kind:"ctx"}),o++,u++))}return s}function uy({text:i}){const s=D.useMemo(()=>cy(i),[i]);return s.some(o=>o.kind==="h")?a.jsx("div",{style:{font:"12px/1.9 "+Tt},children:s.map((o,u)=>o.kind==="h"?a.jsxs("div",{style:{display:"flex",padding:"2px 24px",background:"var(--codeBg)",color:"var(--t4)",fontSize:11},children:[a.jsx("span",{style:{width:36,flex:"none"}}),a.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all"},children:o.text})]},u):a.jsxs("div",{style:{display:"flex",padding:"0 24px",background:o.kind==="add"?"var(--addBg)":o.kind==="del"?"var(--delBg)":"transparent",color:o.kind==="add"?"var(--addT)":o.kind==="del"?"var(--delT)":"var(--t3)"},children:[a.jsx("span",{style:{width:36,color:"var(--t5)",flex:"none",opacity:.6},children:o.no}),a.jsx("span",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",minWidth:0},children:o.text||" "})]},u))}):a.jsx("pre",{style:{margin:0,padding:"10px 24px",font:"12px/1.9 "+Tt,color:"var(--t4)",whiteSpace:"pre-wrap"},children:i})}for(const[i,s]of Object.entries({bash:Am,c:_m,cpp:Rm,css:Pm,go:Bm,ini:Um,java:Fm,javascript:qm,json:Km,markdown:Zm,python:Xm,rust:Vm,sql:Qm,typescript:$m,xml:ev,yaml:tv}))qf.registerLanguage(i,s);const dy={js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",go:"go",py:"python",rs:"rust",java:"java",c:"c",h:"c",cc:"cpp",cpp:"cpp",hpp:"cpp",json:"json",css:"css",html:"xml",htm:"xml",xml:"xml",svg:"xml",vue:"xml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",yml:"yaml",yaml:"yaml",sql:"sql",ini:"ini",toml:"ini",conf:"ini"};function fy(i){const s=[],o=[];for(const u of i.split(`
|
||||
`)){const d=o.join(""),p=/<span[^>]*>|<\/span>/g;for(let g=p.exec(u);g;g=p.exec(u))g[0]==="</span>"?o.pop():o.push(g[0]);s.push(d+u+"</span>".repeat(o.length))}return s}const Tf={flex:1,minWidth:0,whiteSpace:"pre-wrap",wordBreak:"break-word",color:"var(--t2)"};function py({path:i,text:s}){const o=D.useMemo(()=>{var p;const u=((p=i.split(".").pop())==null?void 0:p.toLowerCase())??"",d=dy[u];if(d)try{return{html:!0,rows:fy(qf.highlight(s,{language:d}).value)}}catch{}return{html:!1,rows:s.split(`
|
||||
`)}},[i,s]);return a.jsx("div",{style:{font:"12px/1.9 "+Tt},children:o.rows.map((u,d)=>a.jsxs("div",{style:{display:"flex",padding:"0 24px"},children:[a.jsx("span",{style:{width:42,color:"var(--t5)",flex:"none",opacity:.6,userSelect:"none"},children:d+1}),o.html?a.jsx("span",{className:"hl",style:Tf,dangerouslySetInnerHTML:{__html:u||" "}}):a.jsx("span",{style:Tf,children:u||" "})]},d))})}const ul="data:image/png;base64,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 truncated
|
||||
`)){const d=u.indexOf("=");if(d<=0)continue;const p=u.slice(0,d).trim();p&&(s[p]=u.slice(d+1).trim(),o++)}return o?s:void 0}const Ay=i=>i&&typeof i=="object"?Object.entries(i).map(([s,o])=>`${s}=${String(o)}`).join(`
|
||||
`):"";function _y(i){const s={};for(const o of i){const u=o.name.trim();if(!u)continue;const d=o.source?{source:o.source}:{};if(o.type==="stdio"){if(!o.command.trim())continue;const p=o.args.trim()?o.args.trim().split(/\s+/):void 0;s[u]={...o.extra,command:o.command.trim(),args:p,env:Of(o.kv),...d}}else{if(!o.url.trim())continue;s[u]={...o.extra,url:o.url.trim(),headers:Of(o.kv),...d}}}return s}function Mf(i){return Object.entries(i).map(([s,o])=>{const u=o??{},d=typeof u.command=="string"&&u.command!=="",p=Object.fromEntries(Object.entries(u).filter(([g])=>!Ny.has(g)));return{name:s,type:d?"stdio":"http",url:typeof u.url=="string"?u.url:"",command:typeof u.command=="string"?u.command:"",args:Array.isArray(u.args)?u.args.map(String).join(" "):"",kv:Ay(d?u.env:u.headers),source:typeof u.source=="string"?u.source:void 0,extra:Object.keys(p).length?p:void 0}})}function Ry({version:i,update:s,onUpdateStatus:o}){const[u,d]=L.useState("idle"),[p,g]=L.useState(null),m=!!(s!=null&&s.available),w=async()=>{d("checking"),g(null);try{const P=await Uf();o(P),P.available||g({text:"已是最新版本",color:"var(--ok)"})}catch(P){g({text:P instanceof Error?P.message:String(P),color:"var(--err)"})}finally{d("idle")}},v=async()=>{d("installing"),g(null);try{await Hg()}catch(P){g({text:P instanceof Error?P.message:String(P),color:"var(--err)"}),d("idle")}},S=u!=="idle",D=u==="checking"?"检查中":u==="installing"?"更新中":m?"下载更新":"检查更新",N=m&&u!=="checking";return a.jsxs("div",{className:"card card-lg",style:{padding:"14px 16px",display:"flex",alignItems:"center",gap:12},children:[a.jsx("div",{style:{width:34,height:34,borderRadius:9,background:"var(--accBg)",display:"flex",alignItems:"center",justifyContent:"center",flex:"none"},children:a.jsx("img",{src:ul,alt:"",draggable:!1,style:{width:22,height:22,borderRadius:5}})}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[a.jsx("span",{style:{fontWeight:700,fontSize:13},children:"MonkeyCode"}),a.jsx("span",{className:"ellipsis",style:{fontSize:11.5,color:"var(--t5)",fontFamily:Tt},children:m?`${(s==null?void 0:s.current)??i} → ${s==null?void 0:s.latest} 可用`:i})]}),a.jsx("span",{style:{flex:1}}),p&&a.jsx("span",{style:{fontSize:12,color:p.color,flex:"none"},children:p.text}),a.jsxs("button",{className:N?"hv-acc":"hv",onClick:()=>!S&&void(N?v():w()),style:{...gr,gap:6,flex:"none",...N?{background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)"}:{},opacity:S?.7:1,cursor:S?"default":"pointer"},children:[S&&a.jsx("span",{style:{width:11,height:11,border:`1.5px solid ${N?"var(--onAcc)":"var(--t1)"}`,borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .9s linear infinite",display:"inline-block"}}),D]})]})}const Cy=()=>({name:"",provider:"anthropic",base_url:"",api_key:"",model:""}),Iy=()=>({name:"",type:"http",url:"",command:"",args:"",kv:""});function jf(i,s,o){const u=i.filter(g=>g.name.trim()&&g.source!==_r),d=new Map(u.map(g=>[g.name.trim(),g])),p=new Set(d.keys());for(const g of s){const m=g.name.trim();o&&p.has(m)||d.set(m,g)}return[...d.values()]}const Lf=[{key:"account",label:"百智云账号",icon:il},{key:"models",label:"模型",icon:xp},{key:"mcp",label:"MCP 服务器",icon:Ec},{key:"general",label:"通用",icon:vp}],Ja={flex:"none",fontSize:10.5,fontWeight:600,padding:"1px 7px",borderRadius:5,background:"var(--hov)",color:"var(--t4)",whiteSpace:"nowrap"},$a={color:"var(--t5)",fontSize:12.5,border:"1px dashed var(--dashBd)",borderRadius:10,padding:16,lineHeight:1.7};function Oy({onClose:i,hostVersion:s,update:o,onUpdateStatus:u,onDirtyChange:d}){var _n;const p=hi(),[g,m]=L.useState("account"),[w,v]=L.useState([]),[S,D]=L.useState(0),[N,P]=L.useState({}),[B,W]=L.useState(null),[G,pe]=L.useState(!0),[me,ve]=L.useState([]),[le,he]=L.useState(null),[M,ie]=L.useState(!0),[J,ue]=L.useState(!1),[Be,Ze]=L.useState(""),[Ie,Qe]=L.useState(!1),[Ue,tt]=L.useState(null),[Xe,Fe]=L.useState(""),U=async()=>{try{const H=await Tg();tt(H),Fe("")}catch(H){Fe(H instanceof Error?H.message:String(H))}};L.useEffect(()=>{U()},[]);const oe=!!(Ue!=null&&Ue.logged_in),X=(H,Y,Se)=>({models:H.map((ge,We)=>({...ge,name:ge.name.trim(),default:We===Y})),mcp_servers:_y(Se)}),k=L.useRef(""),x=L.useRef(null);L.useEffect(()=>{if(!p){ue(!0);return}Mg().then(H=>{const Y=(H==null?void 0:H.models)??[],Se=Math.max(0,Y.findIndex(We=>We.default)),ge=Mf((H==null?void 0:H.mcp_servers)??{});v(Y),D(Se),ve(ge),x.current={models:Y,defaultIdx:Se,mcps:ge},k.current=JSON.stringify(X(Y,Se,ge)),ue(!0)}).catch(H=>Ze("读取配置失败: "+(H instanceof Error?H.message:String(H))))},[p]);const z=L.useMemo(()=>p&&J&&JSON.stringify(X(w,S,me))!==k.current,[p,J,w,S,me]);L.useEffect(()=>{d==null||d(z)},[z]),L.useEffect(()=>()=>d==null?void 0:d(!1),[]);const $=()=>{const H=x.current;H&&(v(H.models),D(H.defaultIdx),ve(H.mcps),W(null),he(null),P({}),Ze(""))},ye=(H,Y)=>v(Se=>Se.map((ge,We)=>We===H?{...ge,...Y}:ge)),Ne=(H,Y)=>ve(Se=>Se.map((ge,We)=Line truncated
|
||||
`);if(!(!z||!ie.current)){if(u.running){G(z),B(""),me([]);return}ie.current.send("user-input",{content:zs(z)})&&(B(""),me([]))}},stop:()=>{var x;return void((x=ie.current)==null?void 0:x.send("user-cancel",{}))},clearQueued:()=>G(null),addFiles:async x=>{if(s)for(const z of x){if(z.size>20*1024*1024){g(`⚠ ${z.name||"文件"} 过大(上限 20MB)`);continue}try{const $=await new Promise((ae,Oe)=>{const ze=new FileReader;ze.onload=()=>ae(ze.result),ze.onerror=()=>Oe(new Error("读取文件失败")),ze.readAsDataURL(z)}),ye=$.slice($.indexOf(",")+1),Ne=z.type.startsWith("image/"),{path:ce}=await kg(s,z.name,z.type,ye);me(ae=>[...ae,{path:ce,isImage:Ne,name:z.name||ce.split("/").pop()||"",preview:Ne?$:void 0}])}catch($){g("⚠ 附件上传失败: "+($ instanceof Error?$.message:String($)))}}},removeAtt:x=>me(z=>z.filter(($,ye)=>ye!==x)),answerPerm:(x,z)=>{var ye;const $=z!=="deny";(ye=ie.current)!=null&&ye.send("permission-resp",{id:x,approved:$,remember:z==="always"||z==="persist",persist:z==="persist"})&&d(Ne=>Zv(Ne,x,$))},switchModel:async x=>{var z;if(!(!ie.current||!x||x===v))try{const $=await ie.current.call("session_set_model",{model:x});if($.error){g("⚠ 切换模型失败: "+$.error);return}S(x),(z=ue.current)==null||z.call(ue)}catch($){g("⚠ 切换模型失败: "+($ instanceof Error?$.message:$))}},toggleYolo:async()=>{if(!ie.current)return;const x=D,z=x?"default":"yolo";N(!x);try{const $=await ie.current.call("session_set_mode",{mode:z});$.error&&(N(x),g("⚠ 切换权限模式失败: "+$.error))}catch($){N(x),g("⚠ 切换权限模式失败: "+($ instanceof Error?$.message:$))}},refreshChanges:Be,fileDiff:x=>{const z=ie.current;return z?z.call("repo_file_diff",{path:x}):Promise.reject(new Error("未连接"))},listFiles:x=>{const z=ie.current;return z?z.call("repo_file_list",{path:x}):Promise.reject(new Error("未连接"))},readFile:x=>{const z=ie.current;return z?z.call("repo_read_file",{path:x}):Promise.reject(new Error("未连接"))},reveal:x=>{const z=ie.current;return z?z.call("repo_reveal",{path:x}):Promise.reject(new Error("未连接"))},notify:g}}const ec="~/MonkeyCode",Df=/Mac/.test(navigator.userAgent),fr={A:{text:"新增",fg:"var(--addT)",bg:"var(--addBg)"},M:{text:"修改",fg:"var(--warn)",bg:"var(--warnBg)"},D:{text:"删除",fg:"var(--delT)",bg:"var(--delBg)"}},Ly=i=>i>=1<<20?(i/(1<<20)).toFixed(1)+" MB":i>=1024?(i/1024).toFixed(1)+" KB":i+" B",js={height:32,display:"flex",alignItems:"center",gap:9,padding:"0 10px",borderRadius:8,cursor:"pointer",minWidth:0,flex:"none"},Ls={flex:"none",fontSize:10.5,fontWeight:600,borderRadius:9,padding:"2px 8px",lineHeight:1.4},zf=i=>({border:"none",background:"transparent",height:34,padding:"0 3px",marginBottom:-1,borderBottom:`2px solid ${i?"var(--acc)":"transparent"}`,fontSize:13,fontWeight:i?700:500,color:i?"var(--t1)":"var(--t5)",cursor:i?"default":"pointer",display:"flex",alignItems:"center",gap:6,flex:"none"});function Dy(){var Je,lt;const[i,s]=L.useState([]),[o,u]=L.useState("new"),d=L.useRef(!1),p=()=>{d.current&&!window.confirm("有未保存的更改,确定离开设置?")||u(Ee.id?"session":"new")},[g,m]=L.useState([]),[w,v]=L.useState(null),[S,D]=L.useState(null),[N,P]=L.useState(!1),[B,W]=L.useState("files"),[G,pe]=L.useState(new Map),[me,ve]=L.useState(new Set),[le,he]=L.useState(new Set),[M,ie]=L.useState(""),[J,ue]=L.useState(null),[Be,Ze]=L.useState(()=>{const b=parseInt(localStorage.getItem("mc.drawerWidth")??"",10);return Number.isFinite(b)?Math.min(Math.max(b,420),1200):600}),[Ie,Qe]=L.useState(!1),[Ue,tt]=L.useState(()=>{const b=parseInt(localStorage.getItem("mc.drawerSplit")??"",10);return Number.isFinite(b)&&b>0?Math.max(b,80):0}),[Xe,Fe]=L.useState(!1),U=L.useRef(null),[oe,X]=L.useState(null),[k,x]=L.useState(ec),[z,$]=L.useState(""),[ye,Ne]=L.useState(""),[ce,ae]=L.useState(""),[Oe,ze]=L.useState(!1),[Ke,ft]=L.useState(!1),Ye=L.useRef(!1),wt=L.useCallback(async()=>{const b=await mg();return s(b),b},[]),Ee=jy({onSessionsChanged:()=>void wt()}),[mn,vn]=L.useState(new Set),Ut=L.useRef(Ee.id);Ut.current=Ee.id;const yn=L.useRef(Ee.notify);yn.current=Ee.notify,L.useEffect(()=>vg(b=>{if(b.type!=="session-status"&&b.type!=="session-ask"||(wt(),b.id===Ut.current))return;if(b.type==="session-ask"){b.open&&yn.current(`「${b.title||"任务"}」等待权限审批`);return}if(b.status==="running")return;vn(j=>new Set(j).add(b.id));const R=b.status==="finished"?"已完成":b.status==="error"?"出错了":"已中断";yn.current(`「${b.title||"任务"}」${R}`)}),[wt]);const Ft=(b,R)=>{Ee.open(b.id,{model:b.model,mode:b.mode,firstMessage:R}),vn(j=>{if(!j.has(b.id))return j;const we=new Set(j);return we.delete(b.id),we}),u("session"),P(!1),ue(null)},nn=async b=>{try{await Sg(b.id,!b.archived),await wt()}catch(R){Ee.notify("⚠ 归档失败: "+(R instanceof Error?R.message:String(R)))}},_n=async(b,R)=>{try{await Eg(b.id,R),await wt()}catch(j){Ee.notify("⚠ 重命名失败: "+(j instanceof Error?j.message:String(j)))}},H=async b=>{try{await wgLine truncated
|
||||
`):"";function _y(i){const s={};for(const o of i){const u=o.name.trim();if(!u)continue;const d=o.source?{source:o.source}:{};if(o.type==="stdio"){if(!o.command.trim())continue;const p=o.args.trim()?o.args.trim().split(/\s+/):void 0;s[u]={...o.extra,command:o.command.trim(),args:p,env:Of(o.kv),...d}}else{if(!o.url.trim())continue;s[u]={...o.extra,url:o.url.trim(),headers:Of(o.kv),...d}}}return s}function Mf(i){return Object.entries(i).map(([s,o])=>{const u=o??{},d=typeof u.command=="string"&&u.command!=="",p=Object.fromEntries(Object.entries(u).filter(([g])=>!Ny.has(g)));return{name:s,type:d?"stdio":"http",url:typeof u.url=="string"?u.url:"",command:typeof u.command=="string"?u.command:"",args:Array.isArray(u.args)?u.args.map(String).join(" "):"",kv:Ay(d?u.env:u.headers),source:typeof u.source=="string"?u.source:void 0,extra:Object.keys(p).length?p:void 0}})}function Ry({version:i,update:s,onUpdateStatus:o}){const[u,d]=D.useState("idle"),[p,g]=D.useState(null),m=!!(s!=null&&s.available),x=async()=>{d("checking"),g(null);try{const P=await Uf();o(P),P.available||g({text:"已是最新版本",color:"var(--ok)"})}catch(P){g({text:P instanceof Error?P.message:String(P),color:"var(--err)"})}finally{d("idle")}},v=async()=>{d("installing"),g(null);try{await Hg()}catch(P){g({text:P instanceof Error?P.message:String(P),color:"var(--err)"}),d("idle")}},E=u!=="idle",z=u==="checking"?"检查中":u==="installing"?"更新中":m?"下载更新":"检查更新",T=m&&u!=="checking";return a.jsxs("div",{className:"card card-lg",style:{padding:"14px 16px",display:"flex",alignItems:"center",gap:12},children:[a.jsx("div",{style:{width:34,height:34,borderRadius:9,background:"var(--accBg)",display:"flex",alignItems:"center",justifyContent:"center",flex:"none"},children:a.jsx("img",{src:ul,alt:"",draggable:!1,style:{width:22,height:22,borderRadius:5}})}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[a.jsx("span",{style:{fontWeight:700,fontSize:13},children:"MonkeyCode"}),a.jsx("span",{className:"ellipsis",style:{fontSize:11.5,color:"var(--t5)",fontFamily:Tt},children:m?`${(s==null?void 0:s.current)??i} → ${s==null?void 0:s.latest} 可用`:i})]}),a.jsx("span",{style:{flex:1}}),p&&a.jsx("span",{style:{fontSize:12,color:p.color,flex:"none"},children:p.text}),a.jsxs("button",{className:T?"hv-acc":"hv",onClick:()=>!E&&void(T?v():x()),style:{...gr,gap:6,flex:"none",...T?{background:"var(--acc)",borderColor:"var(--acc)",color:"var(--onAcc)"}:{},opacity:E?.7:1,cursor:E?"default":"pointer"},children:[E&&a.jsx("span",{style:{width:11,height:11,border:`1.5px solid ${T?"var(--onAcc)":"var(--t1)"}`,borderTopColor:"transparent",borderRadius:"50%",animation:"mcspin .9s linear infinite",display:"inline-block"}}),z]})]})}const Cy=()=>({name:"",provider:"anthropic",base_url:"",api_key:"",model:""}),Iy=()=>({name:"",type:"http",url:"",command:"",args:"",kv:""});function jf(i,s,o){const u=i.filter(g=>g.name.trim()&&g.source!==_r),d=new Map(u.map(g=>[g.name.trim(),g])),p=new Set(d.keys());for(const g of s){const m=g.name.trim();o&&p.has(m)||d.set(m,g)}return[...d.values()]}const Lf=[{key:"account",label:"百智云账号",icon:il},{key:"models",label:"模型",icon:xp},{key:"mcp",label:"MCP 服务器",icon:Ec},{key:"general",label:"通用",icon:vp}],Ja={flex:"none",fontSize:10.5,fontWeight:600,padding:"1px 7px",borderRadius:5,background:"var(--hov)",color:"var(--t4)",whiteSpace:"nowrap"},$a={color:"var(--t5)",fontSize:12.5,border:"1px dashed var(--dashBd)",borderRadius:10,padding:16,lineHeight:1.7};function Oy({onClose:i,hostVersion:s,update:o,onUpdateStatus:u,onDirtyChange:d}){var _n;const p=hi(),[g,m]=D.useState("account"),[x,v]=D.useState([]),[E,z]=D.useState(0),[T,P]=D.useState({}),[B,W]=D.useState(null),[Y,de]=D.useState(!0),[ve,ye]=D.useState([]),[ae,ge]=D.useState(null),[j,re]=D.useState(!0),[te,ce]=D.useState(!1),[Be,Ze]=D.useState(""),[Me,Qe]=D.useState(!1),[Ke,tt]=D.useState(null),[Xe,We]=D.useState(""),U=async()=>{try{const G=await Tg();tt(G),We("")}catch(G){We(G instanceof Error?G.message:String(G))}};D.useEffect(()=>{U()},[]);const le=!!(Ke!=null&&Ke.logged_in),V=(G,q,Se)=>({models:G.map((me,He)=>({...me,name:me.name.trim(),default:He===q})),mcp_servers:_y(Se)}),S=D.useRef(""),_=D.useRef(null);D.useEffect(()=>{if(!p){ce(!0);return}Mg().then(G=>{const q=(G==null?void 0:G.models)??[],Se=Math.max(0,q.findIndex(He=>He.default)),me=Mf((G==null?void 0:G.mcp_servers)??{});v(q),z(Se),ye(me),_.current={models:q,defaultIdx:Se,mcps:me},S.current=JSON.stringify(V(q,Se,me)),ce(!0)}).catch(G=>Ze("读取配置失败: "+(G instanceof Error?G.message:String(G))))},[p]);const H=D.useMemo(()=>p&&te&&JSON.stringify(V(x,E,ve))!==S.current,[p,te,x,E,ve]);D.useEffect(()=>{d==null||d(H)},[H]),D.useEffect(()=>()=>d==null?void 0:d(!1),[]);const se=()=>{const G=_.current;G&&(v(G.models),z(G.defaultIdx),ye(G.mcps),W(null),ge(null),P({}),Ze(""))},Ne=(G,q)=>v(Se=>Se.map((me,He)=>He===G?{...me,...q}:me)),_e=(G,q)=>ye(Se=>Se.map((me,Line truncated
|
||||
`);if(!(!H||!re.current)){if(u.running){Y(H),B(""),ve([]);return}re.current.send("user-input",{content:zs(H)})&&(B(""),ve([]))}},stop:()=>{var _;return void((_=re.current)==null?void 0:_.send("user-cancel",{}))},clearQueued:()=>Y(null),addFiles:async _=>{if(s)for(const H of _){if(H.size>20*1024*1024){g(`⚠ ${H.name||"文件"} 过大(上限 20MB)`);continue}try{const se=await new Promise((O,pe)=>{const Re=new FileReader;Re.onload=()=>O(Re.result),Re.onerror=()=>pe(new Error("读取文件失败")),Re.readAsDataURL(H)}),Ne=se.slice(se.indexOf(",")+1),_e=H.type.startsWith("image/"),{path:ue}=await kg(s,H.name,H.type,Ne);ve(O=>[...O,{path:ue,isImage:_e,name:H.name||ue.split("/").pop()||"",preview:_e?se:void 0}])}catch(se){g("⚠ 附件上传失败: "+(se instanceof Error?se.message:String(se)))}}},removeAtt:_=>ve(H=>H.filter((se,Ne)=>Ne!==_)),answerPerm:(_,H)=>{var Ne;const se=H!=="deny";(Ne=re.current)!=null&&Ne.send("permission-resp",{id:_,approved:se,remember:H==="always"||H==="persist",persist:H==="persist"})&&d(_e=>Zv(_e,_,se))},switchModel:async _=>{var H;if(!(!re.current||!_||_===v))try{const se=await re.current.call("session_set_model",{model:_});if(se.error){g("⚠ 切换模型失败: "+se.error);return}E(_),(H=ce.current)==null||H.call(ce)}catch(se){g("⚠ 切换模型失败: "+(se instanceof Error?se.message:se))}},toggleYolo:async()=>{if(!re.current)return;const _=z,H=_?"default":"yolo";T(!_);try{const se=await re.current.call("session_set_mode",{mode:H});se.error&&(T(_),g("⚠ 切换权限模式失败: "+se.error))}catch(se){T(_),g("⚠ 切换权限模式失败: "+(se instanceof Error?se.message:se))}},refreshChanges:Be,fileDiff:_=>{const H=re.current;return H?H.call("repo_file_diff",{path:_}):Promise.reject(new Error("未连接"))},listFiles:_=>{const H=re.current;return H?H.call("repo_file_list",{path:_}):Promise.reject(new Error("未连接"))},readFile:_=>{const H=re.current;return H?H.call("repo_read_file",{path:_}):Promise.reject(new Error("未连接"))},reveal:_=>{const H=re.current;return H?H.call("repo_reveal",{path:_}):Promise.reject(new Error("未连接"))},notify:g}}const ec="~/MonkeyCode",Df=/Mac/.test(navigator.userAgent),fr={A:{text:"新增",fg:"var(--addT)",bg:"var(--addBg)"},M:{text:"修改",fg:"var(--warn)",bg:"var(--warnBg)"},D:{text:"删除",fg:"var(--delT)",bg:"var(--delBg)"}},Ly=i=>i>=1<<20?(i/(1<<20)).toFixed(1)+" MB":i>=1024?(i/1024).toFixed(1)+" KB":i+" B",js={height:32,display:"flex",alignItems:"center",gap:9,padding:"0 10px",borderRadius:8,cursor:"pointer",minWidth:0,flex:"none"},Ls={flex:"none",fontSize:10.5,fontWeight:600,borderRadius:9,padding:"2px 8px",lineHeight:1.4},zf=i=>({border:"none",background:"transparent",height:34,padding:"0 3px",marginBottom:-1,borderBottom:`2px solid ${i?"var(--acc)":"transparent"}`,fontSize:13,fontWeight:i?700:500,color:i?"var(--t1)":"var(--t5)",cursor:i?"default":"pointer",display:"flex",alignItems:"center",gap:6,flex:"none"});function Dy(){var Je,at;const[i,s]=D.useState([]),[o,u]=D.useState("new"),d=D.useRef(!1),p=()=>{d.current&&!window.confirm("有未保存的更改,确定离开设置?")||u(xe.id?"session":"new")},[g,m]=D.useState([]),[x,v]=D.useState(null),[E,z]=D.useState(null),[T,P]=D.useState(!1),[B,W]=D.useState("files"),[Y,de]=D.useState(new Map),[ve,ye]=D.useState(new Set),[ae,ge]=D.useState(new Set),[j,re]=D.useState(""),[te,ce]=D.useState(null),[Be,Ze]=D.useState(()=>{const k=parseInt(localStorage.getItem("mc.drawerWidth")??"",10);return Number.isFinite(k)?Math.min(Math.max(k,420),1200):600}),[Me,Qe]=D.useState(!1),[Ke,tt]=D.useState(()=>{const k=parseInt(localStorage.getItem("mc.drawerSplit")??"",10);return Number.isFinite(k)&&k>0?Math.max(k,80):0}),[Xe,We]=D.useState(!1),U=D.useRef(null),[le,V]=D.useState(null),[S,_]=D.useState(ec),[H,se]=D.useState(""),[Ne,_e]=D.useState(""),[ue,O]=D.useState(""),[pe,Re]=D.useState(!1),[Pe,it]=D.useState(!1),Fe=D.useRef(!1),dt=D.useCallback(async()=>{const k=await mg();return s(k),k},[]),xe=jy({onSessionsChanged:()=>void dt()}),[mn,vn]=D.useState(new Set),Ut=D.useRef(xe.id);Ut.current=xe.id;const yn=D.useRef(xe.notify);yn.current=xe.notify,D.useEffect(()=>vg(k=>{if(k.type!=="session-status"&&k.type!=="session-ask"||(dt(),k.id===Ut.current))return;if(k.type==="session-ask"){k.open&&yn.current(`「${k.title||"任务"}」等待权限审批`);return}if(k.status==="running")return;vn(L=>new Set(L).add(k.id));const R=k.status==="finished"?"已完成":k.status==="error"?"出错了":"已中断";yn.current(`「${k.title||"任务"}」${R}`)}),[dt]);const Ft=(k,R)=>{xe.open(k.id,{model:k.model,mode:k.mode,firstMessage:R}),vn(L=>{if(!L.has(k.id))return L;const Ee=new Set(L);return Ee.delete(k.id),Ee}),u("session"),P(!1),ce(null)},nn=async k=>{try{await Sg(k.id,!k.archived),await dt()}catch(R){xe.notify("⚠ 归档失败: "+(R instanceof Error?R.message:String(R)))}},_n=async(k,R)=>{try{await Eg(k.id,R),await dt()}catch(L){xe.notify("⚠ 重命名失败: "+(L instanceof Error?L.message:String(L)))}},GLine truncated
|
||||
<style rel="stylesheet" crossorigin>:root{--bg: #fcfdfc;--side: #eef1ee;--line: rgba(30, 40, 35, .12);--line2: rgba(30, 40, 35, .08);--t1: #1d221f;--t2: #2a302b;--t3: #59605a;--t4: #7b827c;--t5: #8a918b;--t6: #a8afa9;--t7: #c4c9c3;--tDis: #b3b9b2;--acc: #1f8a5b;--accH: #25a06b;--accBg: rgba(31, 138, 91, .12);--accBd: rgba(31, 138, 91, .2);--accBg2: rgba(31, 138, 91, .15);--onAcc: #fff;--ok: #28a866;--err: #c2503e;--errBg: rgba(194, 80, 62, .09);--warn: #a16207;--warnBg: rgba(232, 193, 90, .14);--warnBd: rgba(161, 98, 7, .35);--card: #ffffff;--cardBd: rgba(30, 40, 35, .1);--cardSh: 0 1px 2px rgba(0, 0, 0, .04);--hov: rgba(120, 130, 125, .12);--hov2: rgba(120, 130, 125, .18);--hov3: rgba(120, 130, 125, .25);--pop: #fcfdfd;--shadow: 0 8px 28px rgba(30, 45, 38, .2);--codeBg: rgba(30, 40, 35, .05);--userBg: #e9f2ec;--addBg: rgba(40, 168, 102, .08);--addT: #1c7a4b;--delBg: rgba(194, 80, 62, .08);--delT: #a63d2e;--scrim: rgba(20, 30, 25, .25);--scrim2: rgba(20, 30, 25, .35);--scrim3: rgba(20, 30, 25, .55);--panel: rgba(255, 255, 255, .92);--panel2: rgba(255, 255, 255, .7);--panelSh: 0 4px 20px rgba(30, 45, 38, .08);--panelShLg: 0 10px 36px rgba(30, 45, 38, .12);--shadowLg: 0 24px 70px rgba(30, 45, 38, .3);--inputBg: #fdfdfc;--inputBd: rgba(30, 40, 35, .13);--btnBd: rgba(30, 40, 35, .15);--dashBd: rgba(30, 40, 35, .22);--errBd: rgba(194, 80, 62, .3);--accBd2: rgba(31, 138, 91, .3);--accBgSoft: rgba(31, 138, 91, .07);--accSel: rgba(31, 138, 91, .85);--accSh: 0 2px 8px rgba(31, 138, 91, .25);--onAccDim: rgba(255, 255, 255, .85);--onAccBg: rgba(255, 255, 255, .18);--warnBd2: rgba(161, 98, 7, .18);--warnT: #7c5210;--notice: #e8913a;--track: var(--hov3);--segBg: var(--hov);--segSh: 0 1px 3px rgba(0, 0, 0, .12);--linkH: #166b46;--sbThumb: rgba(110, 120, 115, .22);--sbThumbH: rgba(110, 120, 115, .38);--hlKw: #cf222e;--hlStr: #0a3069;--hlNum: #0550ae;--hlFn: #8250df;--hlAttr: #953800}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;font-family:HarmonyOS Sans SC,HarmonyOS Sans,PingFang SC,Microsoft YaHei,sans-serif;background:var(--bg);color:var(--t1);font-size:13px;overflow:hidden}a{color:var(--acc);text-decoration:none}a:hover{color:var(--linkH);text-decoration:underline}input,textarea,select,button{font-family:inherit}textarea::placeholder,input::placeholder{color:var(--t6)}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{border:none;background:transparent;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;border-radius:6px;flex:none}.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:29}.pop{background:var(--pop);border:1px solid var(--line);border-radius:9px;box-shadow:var(--shadow);padding:4px;display:flex;flex-direction:column;z-index:30;animation:mcin .15s ease}.menu-item{border:none;background:transparent;cursor:pointer;display:flex;align-items:center;gap:8px;padding:6px 9px;border-radius:6px;font-size:12.5px;color:var(--t1);text-align:left;white-space:nowrap}.card{background:var(--card);border:1px solid var(--cardBd);border-radius:10px;box-shadow:var(--cardSh)}.card-lg{border-radius:11px;padding:16px}.skeleton{background:var(--hov);border-radius:6px;animation:mcpulse 1.4s ease infinite;flex:none}.spinner{width:13px;height:13px;border:2px solid var(--acc);border-top-color:transparent;border-radius:50%;animation:mcspin .9s linear infinite;flex:none}@keyframes mcspin{to{transform:rotate(360deg)}}@keyframes mcpulse{0%,to{opacity:1}50%{opacity:.35}}@keyframes mcin{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}@keyframes mcslide{0%{transform:translate(40px);opacity:0}to{transform:none;opacity:1}}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--sbThumb);border-radius:6px;border:2px solid transparent;background-clip:content-box}::-webkit-scrollbar-thumb:hover{background:var(--sbThumbH);background-clip:content-box}*{scrollbar-width:thin;scrollbar-color:var(--sbThumb) transparent}.hv:hover{background:var(--hov)!important}.hv2:hover{background:var(--hov2)!important}.hv3:hover{background:var(--hov3)!important}.hv-t1:hover{color:var(--t1)!important}.hv-err:hover{color:var(--err)!important}.hv-errbg:hover{background:var(--errBg)!important}.hv-op:hover{filter:brightness(.97)}.hv-acc:hover{background:var(--accH)!important}.hv-accbg:hover{background:var(--accBgSoft)!important}.hv-bd:hover{border-color:var(--acc)!important}.hv-caption-close:hover{background:#e81123!important;color:#fff!important}.hrow .row-acts{opacity:0;transition:opacity .12s ease}.hrow:hover .row-acts{opacity:1}.hl .hljs-comment,.hl .hljs-quote{color:var(--t5);font-style:italic}.hl .hljs-keyword,.hl .hljs-selector-tag,.hl .hljs-meta,.hl .hljs-doctag{color:var(--hlKw)}.hl .hljs-string,.hl .hljs-regexp,.hl .hljs-addition{color:var(--hlStr)}.hl .hljs-number,.hl .hljs-literal,.hl .hljs-symbol,.hl .hljs-bullet,.hl .hljs-built_in,.hl .hljs-variable,.hl .hljs-template-variablLine truncated
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+55
-9
@@ -9,6 +9,8 @@ import {
|
||||
type ClipboardEvent,
|
||||
type DragEvent,
|
||||
type KeyboardEvent,
|
||||
type MouseEvent as ReactMouseEvent,
|
||||
type WheelEvent as ReactWheelEvent,
|
||||
} from "react";
|
||||
import { LogList, MONO } from "./components";
|
||||
import {
|
||||
@@ -306,10 +308,18 @@ export function ChatView({
|
||||
const saved = session.id ? scrollMemo.get(session.id) : undefined;
|
||||
pinnedRef.current = saved ? saved.pinned : true; // 首次打开默认贴底
|
||||
restoreRef.current = saved && !saved.pinned ? { anchor: saved.anchor, offset: saved.offset } : null;
|
||||
if (!restoreRef.current) return;
|
||||
// 渲染后布局还会无事件地微调一次(实测 ~6px,RO 也抓不到这种再分配):
|
||||
// 恢复期间低频轮询对齐兜底,对齐到位后是零修正的空转,用户接管即停
|
||||
const iv = window.setInterval(() => {
|
||||
if (restoreRef.current) alignLog();
|
||||
else clearInterval(iv);
|
||||
}, 200);
|
||||
return () => clearInterval(iv);
|
||||
}, [session.id]);
|
||||
|
||||
// 自动滚动:优先对齐记忆锚点,否则贴底跟随
|
||||
useEffect(() => {
|
||||
const alignLog = () => {
|
||||
const el = logRef.current;
|
||||
if (!el) return;
|
||||
const a = restoreRef.current;
|
||||
@@ -323,7 +333,21 @@ export function ChatView({
|
||||
} else if (pinnedRef.current) {
|
||||
el.scrollTop = el.scrollHeight;
|
||||
}
|
||||
}, [chat.items, chat.running]);
|
||||
};
|
||||
useEffect(alignLog, [chat.items, chat.running]);
|
||||
|
||||
// 图片解码/字体加载等异步高度变化不经过 items,回放结束后仍会把位置顶漂
|
||||
// (实测漂 6px):监听内容列高度做兜底重对齐。用户接管后(restore 清空且
|
||||
// 未贴底)此路径自然不动作
|
||||
const hasLog = chat.items.length > 0;
|
||||
useEffect(() => {
|
||||
const col = logRef.current?.firstElementChild;
|
||||
if (!col) return;
|
||||
const ro = new ResizeObserver(alignLog);
|
||||
ro.observe(col);
|
||||
return () => ro.disconnect();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [hasLog]);
|
||||
|
||||
// 输入框随内容自适应高度
|
||||
useEffect(() => {
|
||||
@@ -333,12 +357,10 @@ export function ChatView({
|
||||
el.style.height = Math.min(el.scrollHeight, 160) + "px";
|
||||
}, [input]);
|
||||
|
||||
const onLogScroll = () => {
|
||||
const saveAnchor = () => {
|
||||
const el = logRef.current;
|
||||
if (!el) return;
|
||||
pinnedRef.current = el.scrollHeight - el.scrollTop - el.clientHeight < 40;
|
||||
// 恢复进行中的程序滚动不写记忆,避免中途切走时锚点被半成品覆盖
|
||||
if (!session.id || restoreRef.current) return;
|
||||
if (!el || !session.id || restoreRef.current) return;
|
||||
const elTop = el.getBoundingClientRect().top;
|
||||
let anchor = 0;
|
||||
let offset = 0;
|
||||
@@ -354,11 +376,35 @@ export function ChatView({
|
||||
}
|
||||
scrollMemo.set(session.id, { anchor, offset, pinned: pinnedRef.current });
|
||||
};
|
||||
const saveTimer = useRef(0);
|
||||
|
||||
// 用户主动介入(滚轮/触摸/点击含拖滚动条)即终止锚点恢复,交还滚动控制权
|
||||
const onLogScroll = () => {
|
||||
const el = logRef.current;
|
||||
if (!el) return;
|
||||
// scroll 事件只做"贴底→跟随"的单向判定,离底不在这里判:程序滚动同样发
|
||||
// scroll 事件,回放中一批内容长高 >40px 就会把跟随误判成用户离底(实测
|
||||
// 卡在中途)。离底判定只认用户真实输入(onWheel/滚动条拖拽)
|
||||
if (el.scrollHeight - el.scrollTop - el.clientHeight < 40) pinnedRef.current = true;
|
||||
saveAnchor();
|
||||
// 滚动停止后布局仍会微调一次(实测 ~6px,不发 scroll 事件),停稳后补一次校准
|
||||
clearTimeout(saveTimer.current);
|
||||
saveTimer.current = window.setTimeout(saveAnchor, 600);
|
||||
};
|
||||
|
||||
// 用户主动介入即终止锚点恢复,交还滚动控制权;向上意图同时解除贴底跟随
|
||||
const cancelRestore = () => {
|
||||
restoreRef.current = null;
|
||||
};
|
||||
const onLogWheel = (e: ReactWheelEvent) => {
|
||||
cancelRestore();
|
||||
if (e.deltaY < 0) pinnedRef.current = false; // 向上滚 = 离开底部去看历史
|
||||
};
|
||||
const onLogMouseDown = (e: ReactMouseEvent) => {
|
||||
cancelRestore();
|
||||
// 按在右缘滚动条带上 = 准备拖动定位,解除跟随(拖回底部会经 scroll 事件重新贴上)
|
||||
const el = logRef.current;
|
||||
if (el && e.clientX > el.getBoundingClientRect().right - 20) pinnedRef.current = false;
|
||||
};
|
||||
|
||||
const onKey = (e: KeyboardEvent<HTMLTextAreaElement>) => {
|
||||
// 输入法组合态(选字/确认候选)的 Enter 不发送
|
||||
@@ -590,9 +636,9 @@ export function ChatView({
|
||||
<div
|
||||
ref={logRef}
|
||||
onScroll={onLogScroll}
|
||||
onWheel={cancelRestore}
|
||||
onWheel={onLogWheel}
|
||||
onTouchStart={cancelRestore}
|
||||
onMouseDown={cancelRestore}
|
||||
onMouseDown={onLogMouseDown}
|
||||
style={{ flex: 1, overflowY: "auto", overflowX: "hidden", minHeight: 0, scrollbarGutter: "stable both-edges" }}
|
||||
>
|
||||
<div style={{ maxWidth: COL_MAX, margin: "0 auto", padding: "26px 36px 16px", display: "flex", flexDirection: "column", gap: 18 }}>
|
||||
|
||||
@@ -148,3 +148,19 @@
|
||||
事件,区分"用户滚动"要靠 wheel/touchstart/mousedown,不能靠 scroll。
|
||||
- 一并记着:ChatView 不按会话 key 重挂,组件级 ref(pinnedRef)会把上一
|
||||
会话的状态带进新会话;会话级 UI 状态要么显式按 id 复位,要么存模块级 Map。
|
||||
|
||||
## 2026-07-18 补:滚动锚点被"你确定么"问出的三个真 bug(e2e 实测发现)
|
||||
|
||||
- **静态审查+构建通过 ≠ 对**:被质疑后按"先自证"起 7440 实例 + Playwright
|
||||
写了 7 条断言的 e2e,连抓 3 个静态审查没看出的问题。滚动/布局类改动
|
||||
必须 e2e,单测和 tsc 什么都证明不了。
|
||||
- **贴底跟随的判定不能吃程序滚动的回声**:scroll 事件里 `距底<40 → pinned`
|
||||
双向赋值时,回放一批长高 >40px 就把跟随误判成离底(必现卡在中途)。
|
||||
正确:scroll 事件只做"贴底→true"单向判定;置 false 只认用户真实输入
|
||||
(wheel deltaY<0、滚动条带 mousedown)。
|
||||
- **滚动停止后布局还会无事件地微调 ~6px**(RO 观察列高也抓不到这种再分配):
|
||||
保存侧用 600ms 防抖补一次校准;恢复侧在 restore 存活期间 200ms 轮询
|
||||
对齐(对齐后零修正空转,用户接管即停)。像素级验证轨迹:探针逐 200ms
|
||||
采样 childOffset = scrollTop - Δ,收敛值相等才算真对齐。
|
||||
- pkill 模式串会匹配到自己所在的复合命令行把 shell 一起杀掉(exit 144):
|
||||
模式里插字符类 `'scrolltest[ ]serve'` 或分独立调用执行。
|
||||
Reference in new issue
Block a user